const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["app/assets/globalSearch.js","app/assets/connectSearchBox.js","app/assets/_commonjsHelpers.js","app/assets/helpers.js","app/assets/connectHitsPerPage.js","app/assets/hits.js","app/assets/videoModal.js","app/assets/icons.js","app/assets/leaflet.js","app/assets/leaflet-gesture-handling.min.js","app/assets/countryList.js","app/assets/facetCheckbox.js","app/assets/themesFacets.js","app/assets/handleFacetsDropdown.js","app/assets/connectClearRefinements.js","app/assets/programmeMapLeaflet.js","app/assets/newsStoriesFilter.js","app/assets/algoliaDataFetch.js","app/assets/countriesFacets.js","app/assets/programmeFacets.js","app/assets/connectConfigure.js","app/assets/searchPage.js","app/assets/callsForProjects.js","app/assets/configure.js","app/assets/imageModal.js","app/assets/jobsSearch.js","app/assets/campaignMap.js"])))=>i.map(i=>d[i]); const xo="modulepreload",Uo=function(t){return"/"+t},jr={},X=function(e,n,i){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),o=s?.nonce||s?.getAttribute("nonce");r=Promise.allSettled(n.map(d=>{if(d=Uo(d),d in jr)return;jr[d]=!0;const u=d.endsWith(".css"),E=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="proxy.php?url=https%3A%2F%2Finterreg.eu%2F%24%7Bd%7D"]${E}`))return;const h=document.createElement("link");if(h.rel=u?"stylesheet":xo,u||(h.as="script"),h.crossOrigin="",h.href=d,o&&h.setAttribute("nonce",o),document.head.appendChild(h),u)return new Promise((m,p)=>{h.addEventListener("load",m),h.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${d}`)))})}))}function a(s){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s}return r.then(s=>{for(const o of s||[])o.status==="rejected"&&a(o.reason);return e().catch(a)})},Ha=()=>{document.querySelector("html")?.classList.toggle("no-scroll")},Oo=t=>{const e=t.querySelectorAll('a[href], button, textarea, input[type="text"], input[type="radio"], input[type="checkbox"], select, [tabindex]:not([tabindex="-1"])'),n=e[0],i=e[e.length-1],r=a=>{a.key==="Tab"&&(a.shiftKey?document.activeElement===n&&(a.preventDefault(),i.focus()):document.activeElement===i&&(a.preventDefault(),n.focus()))};return t.addEventListener("keydown",r),()=>{t.removeEventListener("keydown",r)}},No=document.querySelectorAll("[data-megamenu]"),$o=document.querySelectorAll("[data-menuitem]"),Ri=document.querySelector("[data-togglemobilenav]"),Zr=document.querySelector("[data-navContainer]");Zr&&Ri?.addEventListener("click",()=>{Ri.querySelector(".menu_icon")?.classList.toggle("hidden"),Ri.querySelector(".close_icon")?.classList.toggle("hidden"),Zr?.classList.toggle("active"),Ha()});const Pn=()=>{No.forEach(t=>{const e=t.querySelector("[data-megamenu-content]"),n=t.querySelector("button");e?.classList.remove("expanded"),n&&(n.ariaExpanded="false")})},Fo=document.querySelector("[data-search]");Fo?.addEventListener("focusin",()=>{Pn()});$o.forEach(t=>{const e=t.querySelector("[data-megamenu-close]"),n=t.querySelector("[data-megamenu-content]"),i=t.querySelector("button");t.hasAttribute("data-megamenu")&&i?.addEventListener("click",()=>{i.ariaExpanded=="true"?(i.ariaExpanded="false",n?.classList.remove("expanded")):(i.ariaExpanded="true",n?.classList.add("expanded"))}),e?.addEventListener("click",()=>{i&&(i.ariaExpanded="false",n?.classList.remove("expanded"))}),t.addEventListener("focusin",r=>{const a=r.target,s=a.closest("[data-megamenu]");(!a.closest("[data-megamenu]")||s?.ariaExpanded=="false")&&Pn()}),document.addEventListener("click",r=>{const a=r.target,s=a.closest("[data-megamenu]");(!a.closest("[data-megamenu]")||s?.ariaExpanded=="false")&&Pn()}),document.addEventListener("keydown",r=>{document.activeElement?.closest("[data-megamenu]")&&r.key=="Escape"&&Pn()})});const w={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"},B={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},qa={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_WIDTH:"mediaWidth"},Ga=Object.entries(qa),l=Ga.reduce((t,[e,n])=>(t[e]=n.toLowerCase(),t),{}),Bo={USER_INACTIVE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},Ft=Ga.reduce((t,[e,n])=>(t[e]=n.toLowerCase(),t),{...Bo});Object.entries(Ft).reduce((t,[e,n])=>{const i=l[e];return i&&(t[n]=i),t},{userinactivechange:"userinactive"});const Vo=Object.entries(l).reduce((t,[e,n])=>{const i=Ft[e];return i&&(t[n]=i),t},{userinactive:"userinactivechange"}),Ne={SUBTITLES:"subtitles",CAPTIONS:"captions",DESCRIPTIONS:"descriptions",CHAPTERS:"chapters",METADATA:"metadata"},Ut={DISABLED:"disabled",HIDDEN:"hidden",SHOWING:"showing"},Jr={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},ge={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},He={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"},Wo={INLINE:"inline",FULLSCREEN:"fullscreen",PICTURE_IN_PICTURE:"picture-in-picture"},Ho={2:"Network Error",3:"Decode Error",4:"Source Not Supported",5:"Encryption Error"},qo={2:"A network error caused the media download to fail.",3:"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.",4:"An unsupported error occurred. The server or network failed, or your browser does not support this format.",5:"The media is encrypted and there are no keys to decrypt it."},Ka=t=>{var e,n;return t.code===1?null:{title:(e=Ho[t.code])!=null?e:`Error ${t.code}`,message:(n=qo[t.code])!=null?n:t.message}},ne={ENTER_AIRPLAY:"Start airplay",EXIT_AIRPLAY:"Stop airplay",AUDIO_TRACK_MENU:"Audio",CAPTIONS:"Captions",ENABLE_CAPTIONS:"Enable captions",DISABLE_CAPTIONS:"Disable captions",START_CAST:"Start casting",STOP_CAST:"Stop casting",ENTER_FULLSCREEN:"Enter fullscreen mode",EXIT_FULLSCREEN:"Exit fullscreen mode",MUTE:"Mute",UNMUTE:"Unmute",ENTER_PIP:"Enter picture in picture mode",EXIT_PIP:"Enter picture in picture mode",PLAY:"Play",PAUSE:"Pause",PLAYBACK_RATE:"Playback rate",RENDITIONS:"Quality",SEEK_BACKWARD:"Seek backward",SEEK_FORWARD:"Seek forward",SETTINGS:"Settings"},tt={AUDIO_PLAYER:()=>"audio player",VIDEO_PLAYER:()=>"video player",VOLUME:()=>"volume",SEEK:()=>"seek",CLOSED_CAPTIONS:()=>"closed captions",PLAYBACK_RATE:({playbackRate:t=1}={})=>`current playback rate ${t}`,PLAYBACK_TIME:()=>"playback time",MEDIA_LOADING:()=>"media loading",SETTINGS:()=>"settings",AUDIO_TRACKS:()=>"audio tracks",QUALITY:()=>"quality"},le={PLAY:()=>"play",PAUSE:()=>"pause",MUTE:()=>"mute",UNMUTE:()=>"unmute",ENTER_AIRPLAY:()=>"start airplay",EXIT_AIRPLAY:()=>"stop airplay",ENTER_CAST:()=>"start casting",EXIT_CAST:()=>"stop casting",ENTER_FULLSCREEN:()=>"enter fullscreen mode",EXIT_FULLSCREEN:()=>"exit fullscreen mode",ENTER_PIP:()=>"enter picture in picture mode",EXIT_PIP:()=>"exit picture in picture mode",SEEK_FORWARD_N_SECS:({seekOffset:t=30}={})=>`seek forward ${t} seconds`,SEEK_BACK_N_SECS:({seekOffset:t=30}={})=>`seek back ${t} seconds`,SEEK_LIVE:()=>"seek to live",PLAYING_LIVE:()=>"playing live"};function Go(t){return t?.map(Ko).join(" ")}function Ko(t){if(t){const{id:e,width:n,height:i}=t;return[e,n,i].filter(r=>r!=null).join(":")}}function Yo(t){return t?.map(Qo).join(" ")}function Qo(t){if(t){const{id:e,kind:n,language:i,label:r}=t;return[e,n,i,r].filter(a=>a!=null).join(":")}}function mr(t){return typeof t=="number"&&!Number.isNaN(t)&&Number.isFinite(t)}const Ya=t=>new Promise(e=>setTimeout(e,t)),ea=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],zo=(t,e)=>{const n=t===1?ea[e].singular:ea[e].plural;return`${t} ${n}`},tn=t=>{if(!mr(t))return"";const e=Math.abs(t),n=e!==t,i=new Date(0,0,0,0,0,e,0);return`${[i.getHours(),i.getMinutes(),i.getSeconds()].map((o,d)=>o&&zo(o,d)).filter(o=>o).join(", ")}${n?" remaining":""}`};function dt(t,e){let n=!1;t<0&&(n=!0,t=0-t),t=t<0?0:t;let i=Math.floor(t%60),r=Math.floor(t/60%60),a=Math.floor(t/3600);const s=Math.floor(e/60%60),o=Math.floor(e/3600);return(isNaN(t)||t===1/0)&&(a=r=i="0"),a=a>0||o>0?a+":":"",r=((a||s>=10)&&r<10?"0"+r:r)+":",i=i<10?"0"+i:i,(n?"-":"")+a+r+i}let Qa=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}};class za extends Qa{}class ta extends za{constructor(){super(...arguments),this.role=null}}class Xo{observe(){}unobserve(){}disconnect(){}}const Xa={createElement:function(){return new sn.HTMLElement},createElementNS:function(){return new sn.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(t){return!1}},sn={ResizeObserver:Xo,document:Xa,Node:za,Element:ta,HTMLElement:class extends ta{constructor(){super(...arguments),this.innerHTML=""}get content(){return new sn.DocumentFragment}},DocumentFragment:class extends Qa{},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:!1,media:t}}},ja=typeof window>"u"||typeof window.customElements>"u",Za=Object.keys(sn).every(t=>t in globalThis),c=ja&&!Za?sn:globalThis,D=ja&&!Za?Xa:globalThis.document,na=new WeakMap,pr=t=>{let e=na.get(t);return e||na.set(t,e=new Set),e},Ja=new c.ResizeObserver(t=>{for(const e of t)for(const n of pr(e.target))n(e)});function es(t,e){pr(t).add(e),Ja.observe(t)}function jo(t,e){const n=pr(t);n.delete(e),n.size||Ja.unobserve(t)}function Zo(t){const e={};for(const n of t)e[n.name]=n.value;return e}function Jo(t){var e;return(e=el(t))!=null?e:vn(t,"media-controller")}function el(t){var e;const{MEDIA_CONTROLLER:n}=B,i=t.getAttribute(n);if(i)return(e=nl(t))==null?void 0:e.getElementById(i)}const ts=(t,e,n=".value")=>{const i=t.querySelector(n);i&&(i.textContent=e)},tl=(t,e)=>{const n=`slot[name="${e}"]`,i=t.shadowRoot.querySelector(n);return i?i.children:[]},ns=(t,e)=>tl(t,e)[0],Bt=(t,e)=>!t||!e?!1:t?.contains(e)?!0:Bt(t,e.getRootNode().host),vn=(t,e)=>{if(!t)return null;const n=t.closest(e);return n||vn(t.getRootNode().host,e)};function is(t=document){var e;const n=t?.activeElement;return n?(e=is(n.shadowRoot))!=null?e:n:null}function nl(t){var e;const n=(e=t?.getRootNode)==null?void 0:e.call(t);return n instanceof ShadowRoot||n instanceof Document?n:null}function rs(t,{depth:e=3,checkOpacity:n=!0,checkVisibilityCSS:i=!0}={}){if(t.checkVisibility)return t.checkVisibility({checkOpacity:n,checkVisibilityCSS:i});let r=t;for(;r&&e>0;){const a=getComputedStyle(r);if(n&&a.opacity==="0"||i&&a.visibility==="hidden"||a.display==="none")return!1;r=r.parentElement,e--}return!0}function il(t,e,n,i){const r=Ci(n,i),a=Ci(n,{x:t,y:e}),s=Ci(i,{x:t,y:e});return a>r||s>r?a>s?1:0:a/r}function Ci(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function K(t,e){const n=rl(t,i=>i===e);return n||al(t,e)}function rl(t,e){var n,i;let r;for(r of(n=t.querySelectorAll("style:not([media])"))!=null?n:[]){let a;try{a=(i=r.sheet)==null?void 0:i.cssRules}catch{continue}for(const s of a??[])if(e(s.selectorText))return s}}function al(t,e){var n,i;const r=(n=t.querySelectorAll("style:not([media])"))!=null?n:[],a=r?.[r.length-1];return a?.sheet?(a?.sheet.insertRule(`${e}{}`,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",t),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function G(t,e,n=Number.NaN){const i=t.getAttribute(e);return i!=null?+i:n}function oe(t,e,n){const i=+n;if(n==null||Number.isNaN(i)){t.hasAttribute(e)&&t.removeAttribute(e);return}G(t,e,void 0)!==i&&t.setAttribute(e,`${i}`)}function Q(t,e){return t.hasAttribute(e)}function z(t,e,n){if(n==null){t.hasAttribute(e)&&t.removeAttribute(e);return}Q(t,e)!=n&&t.toggleAttribute(e,n)}function de(t,e,n=null){var i;return(i=t.getAttribute(e))!=null?i:n}function ue(t,e,n){if(n==null){t.hasAttribute(e)&&t.removeAttribute(e);return}const i=`${n}`;de(t,e,void 0)!==i&&t.setAttribute(e,i)}var as=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},Ke=(t,e,n)=>(as(t,e,"read from private field"),n?n.call(t):e.get(t)),sl=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},bn=(t,e,n,i)=>(as(t,e,"write to private field"),e.set(t,n),n),me;const ss=D.createElement("template");ss.innerHTML=` `;class ol extends c.HTMLElement{constructor(e={}){if(super(),sl(this,me,void 0),!this.shadowRoot){const n=this.attachShadow({mode:"open"}),i=ss.content.cloneNode(!0);this.nativeEl=i;let r=e.slotTemplate;r||(r=D.createElement("template"),r.innerHTML=`${e.defaultContent||""}`),this.nativeEl.appendChild(r.content.cloneNode(!0)),n.appendChild(i)}}static get observedAttributes(){return[B.MEDIA_CONTROLLER,l.MEDIA_PAUSED]}attributeChangedCallback(e,n,i){var r,a,s,o,d;e===B.MEDIA_CONTROLLER&&(n&&((a=(r=Ke(this,me))==null?void 0:r.unassociateElement)==null||a.call(r,this),bn(this,me,null)),i&&this.isConnected&&(bn(this,me,(s=this.getRootNode())==null?void 0:s.getElementById(i)),(d=(o=Ke(this,me))==null?void 0:o.associateElement)==null||d.call(o,this)))}connectedCallback(){var e,n,i,r;this.tabIndex=-1,this.setAttribute("aria-hidden","true"),bn(this,me,ll(this)),this.getAttribute(B.MEDIA_CONTROLLER)&&((n=(e=Ke(this,me))==null?void 0:e.associateElement)==null||n.call(e,this)),(i=Ke(this,me))==null||i.addEventListener("pointerdown",this),(r=Ke(this,me))==null||r.addEventListener("click",this)}disconnectedCallback(){var e,n,i,r;this.getAttribute(B.MEDIA_CONTROLLER)&&((n=(e=Ke(this,me))==null?void 0:e.unassociateElement)==null||n.call(e,this)),(i=Ke(this,me))==null||i.removeEventListener("pointerdown",this),(r=Ke(this,me))==null||r.removeEventListener("click",this),bn(this,me,null)}handleEvent(e){var n;const i=(n=e.composedPath())==null?void 0:n[0];if(["video","media-controller"].includes(i?.localName)){if(e.type==="pointerdown")this._pointerType=e.pointerType;else if(e.type==="click"){const{clientX:a,clientY:s}=e,{left:o,top:d,width:u,height:E}=this.getBoundingClientRect(),h=a-o,m=s-d;if(h<0||m<0||h>u||m>E||u===0&&E===0)return;const{pointerType:p=this._pointerType}=e;if(this._pointerType=void 0,p===Jr.TOUCH){this.handleTap(e);return}else if(p===Jr.MOUSE){this.handleMouseClick(e);return}}}}get mediaPaused(){return Q(this,l.MEDIA_PAUSED)}set mediaPaused(e){z(this,l.MEDIA_PAUSED,e)}handleTap(e){}handleMouseClick(e){const n=this.mediaPaused?w.MEDIA_PLAY_REQUEST:w.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new c.CustomEvent(n,{composed:!0,bubbles:!0}))}}me=new WeakMap;function ll(t){var e;const n=t.getAttribute(B.MEDIA_CONTROLLER);return n?(e=t.getRootNode())==null?void 0:e.getElementById(n):vn(t,"media-controller")}c.customElements.get("media-gesture-receiver")||c.customElements.define("media-gesture-receiver",ol);var fr=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},et=(t,e,n)=>(fr(t,e,"read from private field"),n?n.call(t):e.get(t)),Fe=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Yt=(t,e,n,i)=>(fr(t,e,"write to private field"),e.set(t,n),n),Ie=(t,e,n)=>(fr(t,e,"access private method"),n),di,yt,on,Pt,Hi,os,qi,ls,ln,Ti,Ii,Er,Nt,dn;const U={AUDIO:"audio",AUTOHIDE:"autohide",BREAKPOINTS:"breakpoints",GESTURES_DISABLED:"gesturesdisabled",KEYBOARD_CONTROL:"keyboardcontrol",NO_AUTOHIDE:"noautohide",USER_INACTIVE:"userinactive"},ds=D.createElement("template");ds.innerHTML=` `;const dl=Object.values(l),ul="sm:384 md:576 lg:768 xl:960";function cl(t){hl(t.target,t.contentRect.width)}function hl(t,e){var n;if(!t.isConnected)return;const i=(n=t.getAttribute(U.BREAKPOINTS))!=null?n:ul,r=ml(i),a=pl(r,e);let s=!1;if(Object.keys(r).forEach(o=>{if(a.includes(o)){t.hasAttribute(`breakpoint${o}`)||(t.setAttribute(`breakpoint${o}`,""),s=!0);return}t.hasAttribute(`breakpoint${o}`)&&(t.removeAttribute(`breakpoint${o}`),s=!0)}),s){const o=new CustomEvent(Ft.BREAKPOINTS_CHANGE,{detail:a});t.dispatchEvent(o)}}function ml(t){const e=t.split(/\s+/);return Object.fromEntries(e.map(n=>n.split(":")))}function pl(t,e){return Object.keys(t).filter(n=>e>=parseInt(t[n]))}class us extends c.HTMLElement{constructor(){super(),Fe(this,Hi),Fe(this,qi),Fe(this,ln),Fe(this,Ii),Fe(this,Nt),Fe(this,di,0),Fe(this,yt,null),Fe(this,on,null),Fe(this,Pt,void 0),this.breakpointsComputed=!1,this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(ds.content.cloneNode(!0)));const e=s=>{const o=this.media;for(const d of s)d.type==="childList"&&(d.removedNodes.forEach(u=>{if(u.slot=="media"&&d.target==this){let E=d.previousSibling&&d.previousSibling.previousElementSibling;if(!E||!o)this.mediaUnsetCallback(u);else{let h=E.slot!=="media";for(;(E=E.previousSibling)!==null;)E.slot=="media"&&(h=!1);h&&this.mediaUnsetCallback(u)}}}),o&&d.addedNodes.forEach(u=>{u===o&&this.handleMediaUpdated(o)}))};new MutationObserver(e).observe(this,{childList:!0,subtree:!0});let i=!1;es(this,s=>{i||(setTimeout(()=>{cl(s),i=!1,this.breakpointsComputed||(this.breakpointsComputed=!0,this.dispatchEvent(new CustomEvent(Ft.BREAKPOINTS_COMPUTED,{bubbles:!0,composed:!0})))},0),i=!0)});const a=this.querySelector(":scope > slot[slot=media]");a&&a.addEventListener("slotchange",()=>{if(!a.assignedElements({flatten:!0}).length){et(this,yt)&&this.mediaUnsetCallback(et(this,yt));return}this.handleMediaUpdated(this.media)})}static get observedAttributes(){return[U.AUTOHIDE,U.GESTURES_DISABLED].concat(dl).filter(e=>![l.MEDIA_RENDITION_LIST,l.MEDIA_AUDIO_TRACK_LIST,l.MEDIA_CHAPTERS_CUES,l.MEDIA_WIDTH,l.MEDIA_HEIGHT,l.MEDIA_ERROR,l.MEDIA_ERROR_MESSAGE].includes(e))}attributeChangedCallback(e,n,i){e.toLowerCase()==U.AUTOHIDE&&(this.autohide=i)}get media(){let e=this.querySelector(":scope > [slot=media]");return e?.nodeName=="SLOT"&&(e=e.assignedElements({flatten:!0})[0]),e}async handleMediaUpdated(e){e&&(Yt(this,yt,e),e.localName.includes("-")&&await c.customElements.whenDefined(e.localName),this.mediaSetCallback(e))}connectedCallback(){var e;const i=this.getAttribute(U.AUDIO)!=null?tt.AUDIO_PLAYER():tt.VIDEO_PLAYER();this.setAttribute("role","region"),this.setAttribute("aria-label",i),this.handleMediaUpdated(this.media),this.setAttribute(U.USER_INACTIVE,""),this.addEventListener("pointerdown",this),this.addEventListener("pointermove",this),this.addEventListener("pointerup",this),this.addEventListener("mouseleave",this),this.addEventListener("keyup",this),(e=c.window)==null||e.addEventListener("mouseup",this)}disconnectedCallback(){var e;this.media&&this.mediaUnsetCallback(this.media),(e=c.window)==null||e.removeEventListener("mouseup",this)}mediaSetCallback(e){}mediaUnsetCallback(e){Yt(this,yt,null)}handleEvent(e){switch(e.type){case"pointerdown":Yt(this,di,e.timeStamp);break;case"pointermove":Ie(this,Hi,os).call(this,e);break;case"pointerup":Ie(this,qi,ls).call(this,e);break;case"mouseleave":Ie(this,ln,Ti).call(this);break;case"mouseup":this.removeAttribute(U.KEYBOARD_CONTROL);break;case"keyup":Ie(this,Nt,dn).call(this),this.setAttribute(U.KEYBOARD_CONTROL,"");break}}set autohide(e){const n=Number(e);Yt(this,Pt,isNaN(n)?0:n)}get autohide(){return(et(this,Pt)===void 0?2:et(this,Pt)).toString()}}di=new WeakMap;yt=new WeakMap;on=new WeakMap;Pt=new WeakMap;Hi=new WeakSet;os=function(t){t.pointerType!=="mouse"&&t.timeStamp-et(this,di)<250||(Ie(this,Ii,Er).call(this),clearTimeout(et(this,on)),[this,this.media].includes(t.target)&&Ie(this,Nt,dn).call(this))};qi=new WeakSet;ls=function(t){if(t.pointerType==="touch"){const e=!this.hasAttribute(U.USER_INACTIVE);[this,this.media].includes(t.target)&&e?Ie(this,ln,Ti).call(this):Ie(this,Nt,dn).call(this)}else t.composedPath().some(e=>["media-play-button","media-fullscreen-button"].includes(e?.localName))&&Ie(this,Nt,dn).call(this)};ln=new WeakSet;Ti=function(){if(et(this,Pt)<0||this.hasAttribute(U.USER_INACTIVE))return;this.setAttribute(U.USER_INACTIVE,"");const t=new c.CustomEvent(Ft.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!0});this.dispatchEvent(t)};Ii=new WeakSet;Er=function(){if(!this.hasAttribute(U.USER_INACTIVE))return;this.removeAttribute(U.USER_INACTIVE);const t=new c.CustomEvent(Ft.USER_INACTIVE,{composed:!0,bubbles:!0,detail:!1});this.dispatchEvent(t)};Nt=new WeakSet;dn=function(){Ie(this,Ii,Er).call(this),clearTimeout(et(this,on));const t=parseInt(this.autohide);t<0||Yt(this,on,setTimeout(()=>{Ie(this,ln,Ti).call(this)},t*1e3))};c.customElements.get("media-container")||c.customElements.define("media-container",us);var cs=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},ee=(t,e,n)=>(cs(t,e,"read from private field"),n?n.call(t):e.get(t)),Wt=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},_n=(t,e,n,i)=>(cs(t,e,"write to private field"),e.set(t,n),n),At,wt,ui,lt,We,ze;class hs{constructor(e,n,{defaultValue:i}={defaultValue:void 0}){Wt(this,We),Wt(this,At,void 0),Wt(this,wt,void 0),Wt(this,ui,void 0),Wt(this,lt,new Set),_n(this,At,e),_n(this,wt,n),_n(this,ui,new Set(i))}[Symbol.iterator](){return ee(this,We,ze).values()}get length(){return ee(this,We,ze).size}get value(){var e;return(e=[...ee(this,We,ze)].join(" "))!=null?e:""}set value(e){var n;e!==this.value&&(_n(this,lt,new Set),this.add(...(n=e?.split(" "))!=null?n:[]))}toString(){return this.value}item(e){return[...ee(this,We,ze)][e]}values(){return ee(this,We,ze).values()}forEach(e,n){ee(this,We,ze).forEach(e,n)}add(...e){var n,i;e.forEach(r=>ee(this,lt).add(r)),!(this.value===""&&!((n=ee(this,At))!=null&&n.hasAttribute(`${ee(this,wt)}`)))&&((i=ee(this,At))==null||i.setAttribute(`${ee(this,wt)}`,`${this.value}`))}remove(...e){var n;e.forEach(i=>ee(this,lt).delete(i)),(n=ee(this,At))==null||n.setAttribute(`${ee(this,wt)}`,`${this.value}`)}contains(e){return ee(this,We,ze).has(e)}toggle(e,n){return typeof n<"u"?n?(this.add(e),!0):(this.remove(e),!1):this.contains(e)?(this.remove(e),!1):(this.add(e),!0)}replace(e,n){return this.remove(e),this.add(n),e===n}}At=new WeakMap;wt=new WeakMap;ui=new WeakMap;lt=new WeakMap;We=new WeakSet;ze=function(){return ee(this,lt).size?ee(this,lt):ee(this,ui)};const fl=(t="")=>t.split(/\s+/),ms=(t="")=>{const[e,n,i]=t.split(":"),r=i?decodeURIComponent(i):void 0;return{kind:e==="cc"?Ne.CAPTIONS:Ne.SUBTITLES,language:n,label:r}},ps=(t="",e={})=>fl(t).map(n=>{const i=ms(n);return{...e,...i}}),fs=t=>t?Array.isArray(t)?t.map(e=>typeof e=="string"?ms(e):e):typeof t=="string"?ps(t):[t]:[],El=({kind:t,label:e,language:n}={kind:"subtitles"})=>e?`${t==="captions"?"cc":"sb"}:${n}:${encodeURIComponent(e)}`:n,Gi=(t=[])=>Array.prototype.map.call(t,El).join(" "),vl=(t,e)=>n=>n[t]===e,Es=t=>{const e=Object.entries(t).map(([n,i])=>vl(n,i));return n=>e.every(i=>i(n))},nn=(t,e=[],n=[])=>{const i=fs(n).map(Es),r=a=>i.some(s=>s(a));Array.from(e).filter(r).forEach(a=>{a.mode=t})},Si=(t,e=()=>!0)=>{if(!t?.textTracks)return[];const n=typeof e=="function"?e:Es(e);return Array.from(t.textTracks).filter(n)},gl=t=>{var e;return!!((e=t.mediaSubtitlesShowing)!=null&&e.length)||t.hasAttribute(l.MEDIA_SUBTITLES_SHOWING)},bl=t=>{var e;const{media:n,fullscreenElement:i}=t,r=i&&"requestFullscreen"in i?"requestFullscreen":i&&"webkitRequestFullScreen"in i?"webkitRequestFullScreen":void 0;if(r){const a=(e=i[r])==null?void 0:e.call(i);if(a instanceof Promise)return a.catch(()=>{})}else n?.webkitEnterFullscreen?n.webkitEnterFullscreen():n?.requestFullscreen&&n.requestFullscreen()},ia="exitFullscreen"in D?"exitFullscreen":"webkitExitFullscreen"in D?"webkitExitFullscreen":"webkitCancelFullScreen"in D?"webkitCancelFullScreen":void 0,_l=t=>{var e;const{documentElement:n}=t;if(ia){const i=(e=n?.[ia])==null?void 0:e.call(n);if(i instanceof Promise)return i.catch(()=>{})}},Qt="fullscreenElement"in D?"fullscreenElement":"webkitFullscreenElement"in D?"webkitFullscreenElement":void 0,yl=t=>{const{documentElement:e,media:n}=t,i=e?.[Qt];return!i&&"webkitDisplayingFullscreen"in n&&"webkitPresentationMode"in n&&n.webkitDisplayingFullscreen&&n.webkitPresentationMode===Wo.FULLSCREEN?n:i},Al=t=>{var e;const{media:n,documentElement:i,fullscreenElement:r=n}=t;if(!n||!i)return!1;const a=yl(t);if(!a)return!1;if(a===r||a===n)return!0;if(a.localName.includes("-")){let s=a.shadowRoot;if(!(Qt in s))return Bt(a,r);for(;s?.[Qt];){if(s[Qt]===r)return!0;s=(e=s[Qt])==null?void 0:e.shadowRoot}}return!1},wl="fullscreenEnabled"in D?"fullscreenEnabled":"webkitFullscreenEnabled"in D?"webkitFullscreenEnabled":void 0,Tl=t=>{const{documentElement:e,media:n}=t;return!!e?.[wl]||n&&"webkitSupportsFullscreen"in n};let yn;const vr=()=>{var t,e;return yn||(yn=(e=(t=D)==null?void 0:t.createElement)==null?void 0:e.call(t,"video"),yn)},Il=async(t=vr())=>{if(!t)return!1;const e=t.volume;t.volume=e/2+.1;const n=new AbortController,i=await Promise.race([Sl(t,n.signal),kl(t,e)]);return n.abort(),i},Sl=(t,e)=>new Promise(n=>{t.addEventListener("volumechange",()=>n(!0),{signal:e})}),kl=async(t,e)=>{for(let n=0;n<10;n++){if(t.volume===e)return!1;await Ya(10)}return t.volume!==e},Ml=/.*Version\/.*Safari\/.*/.test(c.navigator.userAgent),vs=(t=vr())=>c.matchMedia("(display-mode: standalone)").matches&&Ml?!1:typeof t?.requestPictureInPicture=="function",gs=(t=vr())=>Tl({documentElement:D,media:t}),Ll=gs(),Rl=vs(),Cl=!!c.WebKitPlaybackTargetAvailabilityEvent,Dl=!!c.chrome,ci=t=>Si(t.media,e=>[Ne.SUBTITLES,Ne.CAPTIONS].includes(e.kind)).sort((e,n)=>e.kind>=n.kind?1:-1),bs=t=>Si(t.media,e=>e.mode===Ut.SHOWING&&[Ne.SUBTITLES,Ne.CAPTIONS].includes(e.kind)),_s=(t,e)=>{const n=ci(t),i=bs(t),r=!!i.length;if(n.length){if(e===!1||r&&e!==!0)nn(Ut.DISABLED,n,i);else if(e===!0||!r&&e!==!1){let a=n[0];const{options:s}=t;if(!s?.noSubtitlesLangPref){const E=globalThis.localStorage.getItem("media-chrome-pref-subtitles-lang"),h=E?[E,...globalThis.navigator.languages]:globalThis.navigator.languages,m=n.filter(p=>h.some(_=>p.language.toLowerCase().startsWith(_.split("-")[0]))).sort((p,_)=>{const S=h.findIndex(R=>p.language.toLowerCase().startsWith(R.split("-")[0])),I=h.findIndex(R=>_.language.toLowerCase().startsWith(R.split("-")[0]));return S-I});m[0]&&(a=m[0])}const{language:o,label:d,kind:u}=a;nn(Ut.DISABLED,n,i),nn(Ut.SHOWING,n,[{language:o,label:d,kind:u}])}}},gr=(t,e)=>t===e?!0:t==null||e==null||typeof t!=typeof e?!1:typeof t=="number"&&Number.isNaN(t)&&Number.isNaN(e)?!0:typeof t!="object"?!1:Array.isArray(t)?Pl(t,e):Object.entries(t).every(([n,i])=>n in e&&gr(i,e[n])),Pl=(t,e)=>{const n=Array.isArray(t),i=Array.isArray(e);return n!==i?!1:n||i?t.length!==e.length?!1:t.every((r,a)=>gr(r,e[a])):!0},xl=Object.values(He);let hi;const Ul=Il().then(t=>(hi=t,hi)),Ol=async(...t)=>{await Promise.all(t.filter(e=>e).map(async e=>{if(!("localName"in e&&e instanceof c.HTMLElement))return;const n=e.localName;if(!n.includes("-"))return;const i=c.customElements.get(n);i&&e instanceof i||(await c.customElements.whenDefined(n),c.customElements.upgrade(e))}))},xn={mediaError:{get(t){const{media:e}=t;return e?.error},mediaEvents:["emptied","error"]},mediaErrorCode:{get(t){var e;const{media:n}=t;return(e=n?.error)==null?void 0:e.code},mediaEvents:["emptied","error"]},mediaErrorMessage:{get(t){var e,n;const{media:i}=t;return(n=(e=i?.error)==null?void 0:e.message)!=null?n:""},mediaEvents:["emptied","error"]},mediaWidth:{get(t){var e;const{media:n}=t;return(e=n?.videoWidth)!=null?e:0},mediaEvents:["resize"]},mediaHeight:{get(t){var e;const{media:n}=t;return(e=n?.videoHeight)!=null?e:0},mediaEvents:["resize"]},mediaPaused:{get(t){var e;const{media:n}=t;return(e=n?.paused)!=null?e:!0},set(t,e){var n;const{media:i}=e;i&&(t?i.pause():(n=i.play())==null||n.catch(()=>{}))},mediaEvents:["play","playing","pause","emptied"]},mediaHasPlayed:{get(t,e){const{media:n}=t;return n?e?e.type==="playing":!n.paused:!1},mediaEvents:["playing","emptied"]},mediaEnded:{get(t){var e;const{media:n}=t;return(e=n?.ended)!=null?e:!1},mediaEvents:["seeked","ended","emptied"]},mediaPlaybackRate:{get(t){var e;const{media:n}=t;return(e=n?.playbackRate)!=null?e:1},set(t,e){const{media:n}=e;n&&Number.isFinite(+t)&&(n.playbackRate=+t)},mediaEvents:["ratechange","loadstart"]},mediaMuted:{get(t){var e;const{media:n}=t;return(e=n?.muted)!=null?e:!1},set(t,e){const{media:n}=e;n&&(n.muted=t)},mediaEvents:["volumechange"]},mediaVolume:{get(t){var e;const{media:n}=t;return(e=n?.volume)!=null?e:1},set(t,e){const{media:n}=e;if(n){try{t==null?c.localStorage.removeItem("media-chrome-pref-volume"):c.localStorage.setItem("media-chrome-pref-volume",t.toString())}catch{}Number.isFinite(+t)&&(n.volume=+t)}},mediaEvents:["volumechange"],stateOwnersUpdateHandlers:[(t,e)=>{const{options:{noVolumePref:n}}=e;if(!n)try{const i=c.localStorage.getItem("media-chrome-pref-volume");if(i==null)return;xn.mediaVolume.set(+i,e),t(+i)}catch(i){console.debug("Error getting volume pref",i)}}]},mediaVolumeLevel:{get(t){const{media:e}=t;return typeof e?.volume>"u"?"high":e.muted||e.volume===0?"off":e.volume<.5?"low":e.volume<.75?"medium":"high"},mediaEvents:["volumechange"]},mediaCurrentTime:{get(t){var e;const{media:n}=t;return(e=n?.currentTime)!=null?e:0},set(t,e){const{media:n}=e;!n||!mr(t)||(n.currentTime=t)},mediaEvents:["timeupdate","loadedmetadata"]},mediaDuration:{get(t){const{media:e,options:{defaultDuration:n}={}}=t;return n&&(!e||!e.duration||Number.isNaN(e.duration)||!Number.isFinite(e.duration))?n:Number.isFinite(e?.duration)?e.duration:Number.NaN},mediaEvents:["durationchange","loadedmetadata","emptied"]},mediaLoading:{get(t){const{media:e}=t;return e?.readyState<3},mediaEvents:["waiting","playing","emptied"]},mediaSeekable:{get(t){var e;const{media:n}=t;if(!((e=n?.seekable)!=null&&e.length))return;const i=n.seekable.start(0),r=n.seekable.end(n.seekable.length-1);if(!(!i&&!r))return[Number(i.toFixed(3)),Number(r.toFixed(3))]},mediaEvents:["loadedmetadata","emptied","progress","seekablechange"]},mediaBuffered:{get(t){var e;const{media:n}=t,i=(e=n?.buffered)!=null?e:[];return Array.from(i).map((r,a)=>[Number(i.start(a).toFixed(3)),Number(i.end(a).toFixed(3))])},mediaEvents:["progress","emptied"]},mediaStreamType:{get(t){const{media:e,options:{defaultStreamType:n}={}}=t,i=[He.LIVE,He.ON_DEMAND].includes(n)?n:void 0;if(!e)return i;const{streamType:r}=e;if(xl.includes(r))return r===He.UNKNOWN?i:r;const a=e.duration;return a===1/0?He.LIVE:Number.isFinite(a)?He.ON_DEMAND:i},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange"]},mediaTargetLiveWindow:{get(t){const{media:e}=t;if(!e)return Number.NaN;const{targetLiveWindow:n}=e,i=xn.mediaStreamType.get(t);return(n==null||Number.isNaN(n))&&i===He.LIVE?0:n},mediaEvents:["emptied","durationchange","loadedmetadata","streamtypechange","targetlivewindowchange"]},mediaTimeIsLive:{get(t){const{media:e,options:{liveEdgeOffset:n=10}={}}=t;if(!e)return!1;if(typeof e.liveEdgeStart=="number")return Number.isNaN(e.liveEdgeStart)?!1:e.currentTime>=e.liveEdgeStart;if(!(xn.mediaStreamType.get(t)===He.LIVE))return!1;const r=e.seekable;if(!r)return!0;if(!r.length)return!1;const a=r.end(r.length-1)-n;return e.currentTime>=a},mediaEvents:["playing","timeupdate","progress","waiting","emptied"]},mediaSubtitlesList:{get(t){return ci(t).map(({kind:e,label:n,language:i})=>({kind:e,label:n,language:i}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack"]},mediaSubtitlesShowing:{get(t){return bs(t).map(({kind:e,label:n,language:i})=>({kind:e,label:n,language:i}))},mediaEvents:["loadstart"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(t,e)=>{var n,i;const{media:r,options:a}=e;if(!r)return;const s=o=>{var d;!a.defaultSubtitles||o&&![Ne.CAPTIONS,Ne.SUBTITLES].includes((d=o?.track)==null?void 0:d.kind)||_s(e,!0)};return(n=r.textTracks)==null||n.addEventListener("addtrack",s),(i=r.textTracks)==null||i.addEventListener("removetrack",s),s(),()=>{var o,d;(o=r.textTracks)==null||o.removeEventListener("addtrack",s),(d=r.textTracks)==null||d.removeEventListener("removetrack",s)}}]},mediaChaptersCues:{get(t){var e;const{media:n}=t;if(!n)return[];const[i]=Si(n,{kind:Ne.CHAPTERS});return Array.from((e=i?.cues)!=null?e:[]).map(({text:r,startTime:a,endTime:s})=>({text:r,startTime:a,endTime:s}))},mediaEvents:["loadstart","loadedmetadata"],textTracksEvents:["addtrack","removetrack","change"],stateOwnersUpdateHandlers:[(t,e)=>{var n;const{media:i}=e;if(!i)return;const r=i.querySelector('track[kind="chapters"][default][src]'),a=(n=i.shadowRoot)==null?void 0:n.querySelector(':is(video,audio) > track[kind="chapters"][default][src]');return r?.addEventListener("load",t),a?.addEventListener("load",t),()=>{r?.removeEventListener("load",t),a?.removeEventListener("load",t)}}]},mediaIsPip:{get(t){var e,n;const{media:i,documentElement:r}=t;if(!i||!r||!r.pictureInPictureElement)return!1;if(r.pictureInPictureElement===i)return!0;if(r.pictureInPictureElement instanceof HTMLMediaElement)return(e=i.localName)!=null&&e.includes("-")?Bt(i,r.pictureInPictureElement):!1;if(r.pictureInPictureElement.localName.includes("-")){let a=r.pictureInPictureElement.shadowRoot;for(;a?.pictureInPictureElement;){if(a.pictureInPictureElement===i)return!0;a=(n=a.pictureInPictureElement)==null?void 0:n.shadowRoot}}return!1},set(t,e){const{media:n}=e;if(n)if(t){if(!D.pictureInPictureEnabled){console.warn("MediaChrome: Picture-in-picture is not enabled");return}if(!n.requestPictureInPicture){console.warn("MediaChrome: The current media does not support picture-in-picture");return}const i=()=>{console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a readyState > 0.")};n.requestPictureInPicture().catch(r=>{if(r.code===11){if(!n.src){console.warn("MediaChrome: The media is not ready for picture-in-picture. It must have a src set.");return}if(n.readyState===0&&n.preload==="none"){const a=()=>{n.removeEventListener("loadedmetadata",s),n.preload="none"},s=()=>{n.requestPictureInPicture().catch(i),a()};n.addEventListener("loadedmetadata",s),n.preload="metadata",setTimeout(()=>{n.readyState===0&&i(),a()},1e3)}else throw r}else throw r})}else D.pictureInPictureElement&&D.exitPictureInPicture()},mediaEvents:["enterpictureinpicture","leavepictureinpicture"]},mediaRenditionList:{get(t){var e;const{media:n}=t;return[...(e=n?.videoRenditions)!=null?e:[]].map(i=>({...i}))},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaRenditionSelected:{get(t){var e,n,i;const{media:r}=t;return(i=(n=r?.videoRenditions)==null?void 0:n[(e=r.videoRenditions)==null?void 0:e.selectedIndex])==null?void 0:i.id},set(t,e){const{media:n}=e;if(!n?.videoRenditions){console.warn("MediaController: Rendition selection not supported by this media.");return}const i=t,r=Array.prototype.findIndex.call(n.videoRenditions,a=>a.id==i);n.videoRenditions.selectedIndex!=r&&(n.videoRenditions.selectedIndex=r)},mediaEvents:["emptied"],videoRenditionsEvents:["addrendition","removerendition","change"]},mediaAudioTrackList:{get(t){var e;const{media:n}=t;return[...(e=n?.audioTracks)!=null?e:[]]},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]},mediaAudioTrackEnabled:{get(t){var e,n;const{media:i}=t;return(n=[...(e=i?.audioTracks)!=null?e:[]].find(r=>r.enabled))==null?void 0:n.id},set(t,e){const{media:n}=e;if(!n?.audioTracks){console.warn("MediaChrome: Audio track selection not supported by this media.");return}const i=t;for(const r of n.audioTracks)r.enabled=i==r.id},mediaEvents:["emptied"],audioTracksEvents:["addtrack","removetrack","change"]},mediaIsFullscreen:{get(t){return Al(t)},set(t,e){t?bl(e):_l(e)},rootEvents:["fullscreenchange","webkitfullscreenchange"],mediaEvents:["webkitbeginfullscreen","webkitendfullscreen","webkitpresentationmodechanged"]},mediaIsCasting:{get(t){var e;const{media:n}=t;return!n?.remote||((e=n.remote)==null?void 0:e.state)==="disconnected"?!1:!!n.remote.state},set(t,e){var n,i;const{media:r}=e;if(r&&!(t&&((n=r.remote)==null?void 0:n.state)!=="disconnected")&&!(!t&&((i=r.remote)==null?void 0:i.state)!=="connected")){if(typeof r.remote.prompt!="function"){console.warn("MediaChrome: Casting is not supported in this environment");return}r.remote.prompt().catch(()=>{})}},remoteEvents:["connect","connecting","disconnect"]},mediaIsAirplaying:{get(){return!1},set(t,e){const{media:n}=e;if(n){if(!(n.webkitShowPlaybackTargetPicker&&c.WebKitPlaybackTargetAvailabilityEvent)){console.warn("MediaChrome: received a request to select AirPlay but AirPlay is not supported in this environment");return}n.webkitShowPlaybackTargetPicker()}},mediaEvents:["webkitcurrentplaybacktargetiswirelesschanged"]},mediaFullscreenUnavailable:{get(t){const{media:e}=t;if(!Ll||!gs(e))return ge.UNSUPPORTED}},mediaPipUnavailable:{get(t){const{media:e}=t;if(!Rl||!vs(e))return ge.UNSUPPORTED}},mediaVolumeUnavailable:{get(t){const{media:e}=t;if(hi===!1||e?.volume==null)return ge.UNSUPPORTED},stateOwnersUpdateHandlers:[t=>{hi==null&&Ul.then(e=>t(e?void 0:ge.UNSUPPORTED))}]},mediaCastUnavailable:{get(t,{availability:e="not-available"}={}){var n;const{media:i}=t;if(!Dl||!((n=i?.remote)!=null&&n.state))return ge.UNSUPPORTED;if(!(e==null||e==="available"))return ge.UNAVAILABLE},stateOwnersUpdateHandlers:[(t,e)=>{var n;const{media:i}=e;return i?(i.disableRemotePlayback||i.hasAttribute("disableremoteplayback")||(n=i?.remote)==null||n.watchAvailability(a=>{t({availability:a?"available":"not-available"})}).catch(a=>{a.name==="NotSupportedError"?t({availability:null}):t({availability:"not-available"})}),()=>{var a;(a=i?.remote)==null||a.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaAirplayUnavailable:{get(t,e){if(!Cl)return ge.UNSUPPORTED;if(e?.availability==="not-available")return ge.UNAVAILABLE},mediaEvents:["webkitplaybacktargetavailabilitychanged"],stateOwnersUpdateHandlers:[(t,e)=>{var n;const{media:i}=e;return i?(i.disableRemotePlayback||i.hasAttribute("disableremoteplayback")||(n=i?.remote)==null||n.watchAvailability(a=>{t({availability:a?"available":"not-available"})}).catch(a=>{a.name==="NotSupportedError"?t({availability:null}):t({availability:"not-available"})}),()=>{var a;(a=i?.remote)==null||a.cancelWatchAvailability().catch(()=>{})}):void 0}]},mediaRenditionUnavailable:{get(t){var e;const{media:n}=t;if(!n?.videoRenditions)return ge.UNSUPPORTED;if(!((e=n.videoRenditions)!=null&&e.length))return ge.UNAVAILABLE},mediaEvents:["emptied","loadstart"],videoRenditionsEvents:["addrendition","removerendition"]},mediaAudioTrackUnavailable:{get(t){var e,n;const{media:i}=t;if(!i?.audioTracks)return ge.UNSUPPORTED;if(((n=(e=i.audioTracks)==null?void 0:e.length)!=null?n:0)<=1)return ge.UNAVAILABLE},mediaEvents:["emptied","loadstart"],audioTracksEvents:["addtrack","removetrack"]}},Nl={[w.MEDIA_PREVIEW_REQUEST](t,e,{detail:n}){var i,r,a;const{media:s}=e,o=n??void 0;let d,u;if(s&&o!=null){const[p]=Si(s,{kind:Ne.METADATA,label:"thumbnails"}),_=Array.prototype.find.call((i=p?.cues)!=null?i:[],(S,I,R)=>I===0?S.endTime>o:I===R.length-1?S.startTime<=o:S.startTime<=o&&S.endTime>o);if(_){const S=/'^(?:[a-z]+:)?\/\//i.test(_.text)||(r=s?.querySelector('track[label="thumbnails"]'))==null?void 0:r.src,I=new URL(_.text,S);u=new URLSearchParams(I.hash).get("#xywh").split(",").map(y=>+y),d=I.href}}const E=t.mediaDuration.get(e);let m=(a=t.mediaChaptersCues.get(e).find((p,_,S)=>_===S.length-1&&E===p.endTime?p.startTime<=o&&p.endTime>=o:p.startTime<=o&&p.endTime>o))==null?void 0:a.text;return n!=null&&m==null&&(m=""),{mediaPreviewTime:o,mediaPreviewImage:d,mediaPreviewCoords:u,mediaPreviewChapter:m}},[w.MEDIA_PAUSE_REQUEST](t,e){t["mediaPaused"].set(!0,e)},[w.MEDIA_PLAY_REQUEST](t,e){var n;const i="mediaPaused";if(t.mediaStreamType.get(e)===He.LIVE){const s=!(t.mediaTargetLiveWindow.get(e)>0),o=(n=t.mediaSeekable.get(e))==null?void 0:n[1];s&&o&&t.mediaCurrentTime.set(o,e)}t[i].set(!1,e)},[w.MEDIA_PLAYBACK_RATE_REQUEST](t,e,{detail:n}){const i="mediaPlaybackRate",r=n;t[i].set(r,e)},[w.MEDIA_MUTE_REQUEST](t,e){t["mediaMuted"].set(!0,e)},[w.MEDIA_UNMUTE_REQUEST](t,e){const n="mediaMuted";t.mediaVolume.get(e)||t.mediaVolume.set(.25,e),t[n].set(!1,e)},[w.MEDIA_VOLUME_REQUEST](t,e,{detail:n}){const i="mediaVolume",r=n;r&&t.mediaMuted.get(e)&&t.mediaMuted.set(!1,e),t[i].set(r,e)},[w.MEDIA_SEEK_REQUEST](t,e,{detail:n}){const i="mediaCurrentTime",r=n;t[i].set(r,e)},[w.MEDIA_SEEK_TO_LIVE_REQUEST](t,e){var n;const i="mediaCurrentTime",r=(n=t.mediaSeekable.get(e))==null?void 0:n[1];Number.isNaN(Number(r))||t[i].set(r,e)},[w.MEDIA_SHOW_SUBTITLES_REQUEST](t,e,{detail:n}){var i;const{options:r}=e,a=ci(e),s=fs(n),o=(i=s[0])==null?void 0:i.language;o&&!r.noSubtitlesLangPref&&c.localStorage.setItem("media-chrome-pref-subtitles-lang",o),nn(Ut.SHOWING,a,s)},[w.MEDIA_DISABLE_SUBTITLES_REQUEST](t,e,{detail:n}){const i=ci(e),r=n??[];nn(Ut.DISABLED,i,r)},[w.MEDIA_TOGGLE_SUBTITLES_REQUEST](t,e,{detail:n}){_s(e,n)},[w.MEDIA_RENDITION_REQUEST](t,e,{detail:n}){const i="mediaRenditionSelected",r=n;t[i].set(r,e)},[w.MEDIA_AUDIO_TRACK_REQUEST](t,e,{detail:n}){const i="mediaAudioTrackEnabled",r=n;t[i].set(r,e)},[w.MEDIA_ENTER_PIP_REQUEST](t,e){const n="mediaIsPip";t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t[n].set(!0,e)},[w.MEDIA_EXIT_PIP_REQUEST](t,e){t["mediaIsPip"].set(!1,e)},[w.MEDIA_ENTER_FULLSCREEN_REQUEST](t,e){const n="mediaIsFullscreen";t.mediaIsPip.get(e)&&t.mediaIsPip.set(!1,e),t[n].set(!0,e)},[w.MEDIA_EXIT_FULLSCREEN_REQUEST](t,e){t["mediaIsFullscreen"].set(!1,e)},[w.MEDIA_ENTER_CAST_REQUEST](t,e){const n="mediaIsCasting";t.mediaIsFullscreen.get(e)&&t.mediaIsFullscreen.set(!1,e),t[n].set(!0,e)},[w.MEDIA_EXIT_CAST_REQUEST](t,e){t["mediaIsCasting"].set(!1,e)},[w.MEDIA_AIRPLAY_REQUEST](t,e){t["mediaIsAirplaying"].set(!0,e)}},$l=({media:t,fullscreenElement:e,documentElement:n,stateMediator:i=xn,requestMap:r=Nl,options:a={},monitorStateOwnersOnlyWithSubscriptions:s=!0})=>{const o=[],d={options:{...a}};let u=Object.freeze({mediaPreviewTime:void 0,mediaPreviewImage:void 0,mediaPreviewCoords:void 0,mediaPreviewChapter:void 0});const E=S=>{S!=null&&(gr(S,u)||(u=Object.freeze({...u,...S}),o.forEach(I=>I(u))))},h=()=>{const S=Object.entries(i).reduce((I,[R,{get:y}])=>(I[R]=y(d),I),{});E(S)},m={};let p;const _=async(S,I)=>{var R,y,g,A,k,C,$,M,ie,ce,pt,v,f,b,L,T;const O=!!p;if(p={...d,...p??{},...S},O)return;await Ol(...Object.values(S));const F=o.length>0&&I===0&&s,re=d.media!==p.media,ae=((R=d.media)==null?void 0:R.textTracks)!==((y=p.media)==null?void 0:y.textTracks),$e=((g=d.media)==null?void 0:g.videoRenditions)!==((A=p.media)==null?void 0:A.videoRenditions),Ge=((k=d.media)==null?void 0:k.audioTracks)!==((C=p.media)==null?void 0:C.audioTracks),Se=(($=d.media)==null?void 0:$.remote)!==((M=p.media)==null?void 0:M.remote),Ur=d.documentElement!==p.documentElement,Or=!!d.media&&(re||F),Nr=!!((ie=d.media)!=null&&ie.textTracks)&&(ae||F),$r=!!((ce=d.media)!=null&&ce.videoRenditions)&&($e||F),Fr=!!((pt=d.media)!=null&&pt.audioTracks)&&(Ge||F),Br=!!((v=d.media)!=null&&v.remote)&&(Se||F),Vr=!!d.documentElement&&(Ur||F),Wr=Or||Nr||$r||Fr||Br||Vr,ft=o.length===0&&I===1&&s,Hr=!!p.media&&(re||ft),qr=!!((f=p.media)!=null&&f.textTracks)&&(ae||ft),Gr=!!((b=p.media)!=null&&b.videoRenditions)&&($e||ft),Kr=!!((L=p.media)!=null&&L.audioTracks)&&(Ge||ft),Yr=!!((T=p.media)!=null&&T.remote)&&(Se||ft),Qr=!!p.documentElement&&(Ur||ft),zr=Hr||qr||Gr||Kr||Yr||Qr;if(!(Wr||zr)){Object.entries(p).forEach(([N,Vt])=>{d[N]=Vt}),h(),p=void 0;return}Object.entries(i).forEach(([N,{get:Vt,mediaEvents:ko=[],textTracksEvents:Mo=[],videoRenditionsEvents:Lo=[],audioTracksEvents:Ro=[],remoteEvents:Co=[],rootEvents:Do=[],stateOwnersUpdateHandlers:Po=[]}])=>{m[N]||(m[N]={});const fe=H=>{const Ee=Vt(d,H);E({[N]:Ee})};let j;j=m[N].mediaEvents,ko.forEach(H=>{j&&Or&&(d.media.removeEventListener(H,j),m[N].mediaEvents=void 0),Hr&&(p.media.addEventListener(H,fe),m[N].mediaEvents=fe)}),j=m[N].textTracksEvents,Mo.forEach(H=>{var Ee,ye;j&&Nr&&((Ee=d.media.textTracks)==null||Ee.removeEventListener(H,j),m[N].textTracksEvents=void 0),qr&&((ye=p.media.textTracks)==null||ye.addEventListener(H,fe),m[N].textTracksEvents=fe)}),j=m[N].videoRenditionsEvents,Lo.forEach(H=>{var Ee,ye;j&&$r&&((Ee=d.media.videoRenditions)==null||Ee.removeEventListener(H,j),m[N].videoRenditionsEvents=void 0),Gr&&((ye=p.media.videoRenditions)==null||ye.addEventListener(H,fe),m[N].videoRenditionsEvents=fe)}),j=m[N].audioTracksEvents,Ro.forEach(H=>{var Ee,ye;j&&Fr&&((Ee=d.media.audioTracks)==null||Ee.removeEventListener(H,j),m[N].audioTracksEvents=void 0),Kr&&((ye=p.media.audioTracks)==null||ye.addEventListener(H,fe),m[N].audioTracksEvents=fe)}),j=m[N].remoteEvents,Co.forEach(H=>{var Ee,ye;j&&Br&&((Ee=d.media.remote)==null||Ee.removeEventListener(H,j),m[N].remoteEvents=void 0),Yr&&((ye=p.media.remote)==null||ye.addEventListener(H,fe),m[N].remoteEvents=fe)}),j=m[N].rootEvents,Do.forEach(H=>{j&&Vr&&(d.documentElement.removeEventListener(H,j),m[N].rootEvents=void 0),Qr&&(p.documentElement.addEventListener(H,fe),m[N].rootEvents=fe)});const Xr=m[N].stateOwnersUpdateHandlers;Po.forEach(H=>{Xr&&Wr&&Xr(),zr&&(m[N].stateOwnersUpdateHandlers=H(fe,p))})}),Object.entries(p).forEach(([N,Vt])=>{d[N]=Vt}),h(),p=void 0};return _({media:t,fullscreenElement:e,documentElement:n,options:a}),{dispatch(S){const{type:I,detail:R}=S;if(r[I]&&u.mediaErrorCode==null){E(r[I](i,d,S));return}I==="mediaelementchangerequest"?_({media:R}):I==="fullscreenelementchangerequest"?_({fullscreenElement:R}):I==="documentelementchangerequest"?_({documentElement:R}):I==="optionschangerequest"&&Object.entries(R??{}).forEach(([y,g])=>{d.options[y]=g})},getState(){return u},subscribe(S){return _({},o.length+1),o.push(S),S(u),()=>{const I=o.indexOf(S);I>=0&&(_({},o.length-1),o.splice(I,1))}}}};var Fl=$l,br=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},P=(t,e,n)=>(br(t,e,"read from private field"),n?n.call(t):e.get(t)),Be=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Ye=(t,e,n,i)=>(br(t,e,"write to private field"),e.set(t,n),n),je=(t,e,n)=>(br(t,e,"access private method"),n),Ze,zt,V,Xt,Le,Un,On,Ki,$t,un,Nn,Yi;const ys=["ArrowLeft","ArrowRight","Enter"," ","f","m","k","c"],ra=10,x={DEFAULT_SUBTITLES:"defaultsubtitles",DEFAULT_STREAM_TYPE:"defaultstreamtype",DEFAULT_DURATION:"defaultduration",FULLSCREEN_ELEMENT:"fullscreenelement",HOTKEYS:"hotkeys",KEYS_USED:"keysused",LIVE_EDGE_OFFSET:"liveedgeoffset",NO_AUTO_SEEK_TO_LIVE:"noautoseektolive",NO_HOTKEYS:"nohotkeys",NO_VOLUME_PREF:"novolumepref",NO_SUBTITLES_LANG_PREF:"nosubtitleslangpref",NO_DEFAULT_STORE:"nodefaultstore",KEYBOARD_FORWARD_SEEK_OFFSET:"keyboardforwardseekoffset",KEYBOARD_BACKWARD_SEEK_OFFSET:"keyboardbackwardseekoffset"};class Bl extends us{constructor(){super(),Be(this,On),Be(this,$t),Be(this,Nn),this.mediaStateReceivers=[],this.associatedElementSubscriptions=new Map,Be(this,Ze,new hs(this,x.HOTKEYS)),Be(this,zt,void 0),Be(this,V,void 0),Be(this,Xt,void 0),Be(this,Le,void 0),Be(this,Un,n=>{var i;(i=P(this,V))==null||i.dispatch(n)}),this.associateElement(this);let e={};Ye(this,Xt,n=>{Object.entries(n).forEach(([i,r])=>{if(i in e&&e[i]===r)return;this.propagateMediaState(i,r);const a=i.toLowerCase(),s=new c.CustomEvent(Vo[a],{composed:!0,detail:r});this.dispatchEvent(s)}),e=n}),this.enableHotkeys()}static get observedAttributes(){return super.observedAttributes.concat(x.NO_HOTKEYS,x.HOTKEYS,x.DEFAULT_STREAM_TYPE,x.DEFAULT_SUBTITLES,x.DEFAULT_DURATION)}get mediaStore(){return P(this,V)}set mediaStore(e){var n,i;if(P(this,V)&&((n=P(this,Le))==null||n.call(this),Ye(this,Le,void 0)),Ye(this,V,e),!P(this,V)&&!this.hasAttribute(x.NO_DEFAULT_STORE)){je(this,On,Ki).call(this);return}Ye(this,Le,(i=P(this,V))==null?void 0:i.subscribe(P(this,Xt)))}get fullscreenElement(){var e;return(e=P(this,zt))!=null?e:this}set fullscreenElement(e){var n;this.hasAttribute(x.FULLSCREEN_ELEMENT)&&this.removeAttribute(x.FULLSCREEN_ELEMENT),Ye(this,zt,e),(n=P(this,V))==null||n.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}attributeChangedCallback(e,n,i){var r,a,s,o,d,u;if(super.attributeChangedCallback(e,n,i),e===x.NO_HOTKEYS)i!==n&&i===""?(this.hasAttribute(x.HOTKEYS)&&console.warn("Media Chrome: Both `hotkeys` and `nohotkeys` have been set. All hotkeys will be disabled."),this.disableHotkeys()):i!==n&&i===null&&this.enableHotkeys();else if(e===x.HOTKEYS)P(this,Ze).value=i;else if(e===x.DEFAULT_SUBTITLES&&i!==n)(r=P(this,V))==null||r.dispatch({type:"optionschangerequest",detail:{defaultSubtitles:this.hasAttribute(x.DEFAULT_SUBTITLES)}});else if(e===x.DEFAULT_STREAM_TYPE)(s=P(this,V))==null||s.dispatch({type:"optionschangerequest",detail:{defaultStreamType:(a=this.getAttribute(x.DEFAULT_STREAM_TYPE))!=null?a:void 0}});else if(e===x.LIVE_EDGE_OFFSET)(o=P(this,V))==null||o.dispatch({type:"optionschangerequest",detail:{liveEdgeOffset:this.hasAttribute(x.LIVE_EDGE_OFFSET)?+this.getAttribute(x.LIVE_EDGE_OFFSET):void 0}});else if(e===x.FULLSCREEN_ELEMENT){const E=i?(d=this.getRootNode())==null?void 0:d.getElementById(i):void 0;Ye(this,zt,E),(u=P(this,V))==null||u.dispatch({type:"fullscreenelementchangerequest",detail:this.fullscreenElement})}}connectedCallback(){var e,n;!P(this,V)&&!this.hasAttribute(x.NO_DEFAULT_STORE)&&je(this,On,Ki).call(this),(e=P(this,V))==null||e.dispatch({type:"documentelementchangerequest",detail:D}),super.connectedCallback(),P(this,V)&&!P(this,Le)&&Ye(this,Le,(n=P(this,V))==null?void 0:n.subscribe(P(this,Xt))),this.enableHotkeys()}disconnectedCallback(){var e,n,i,r;(e=super.disconnectedCallback)==null||e.call(this),P(this,V)&&((n=P(this,V))==null||n.dispatch({type:"documentelementchangerequest",detail:void 0}),(i=P(this,V))==null||i.dispatch({type:w.MEDIA_TOGGLE_SUBTITLES_REQUEST,detail:!1})),P(this,Le)&&((r=P(this,Le))==null||r.call(this),Ye(this,Le,void 0))}mediaSetCallback(e){var n;super.mediaSetCallback(e),(n=P(this,V))==null||n.dispatch({type:"mediaelementchangerequest",detail:e}),e.hasAttribute("tabindex")||(e.tabIndex=-1)}mediaUnsetCallback(e){var n;super.mediaUnsetCallback(e),(n=P(this,V))==null||n.dispatch({type:"mediaelementchangerequest",detail:void 0})}propagateMediaState(e,n){oa(this.mediaStateReceivers,e,n)}associateElement(e){if(!e)return;const{associatedElementSubscriptions:n}=this;if(n.has(e))return;const i=this.registerMediaStateReceiver.bind(this),r=this.unregisterMediaStateReceiver.bind(this),a=Kl(e,i,r);Object.values(w).forEach(s=>{e.addEventListener(s,P(this,Un))}),n.set(e,a)}unassociateElement(e){if(!e)return;const{associatedElementSubscriptions:n}=this;if(!n.has(e))return;n.get(e)(),n.delete(e),Object.values(w).forEach(r=>{e.removeEventListener(r,P(this,Un))})}registerMediaStateReceiver(e){if(!e)return;const n=this.mediaStateReceivers;n.indexOf(e)>-1||(n.push(e),P(this,V)&&Object.entries(P(this,V).getState()).forEach(([r,a])=>{oa([e],r,a)}))}unregisterMediaStateReceiver(e){const n=this.mediaStateReceivers,i=n.indexOf(e);i<0||n.splice(i,1)}enableHotkeys(){this.addEventListener("keydown",je(this,Nn,Yi))}disableHotkeys(){this.removeEventListener("keydown",je(this,Nn,Yi)),this.removeEventListener("keyup",je(this,$t,un))}get hotkeys(){return P(this,Ze)}keyboardShortcutHandler(e){var n,i,r,a,s;const o=e.target;if(((r=(i=(n=o.getAttribute(x.KEYS_USED))==null?void 0:n.split(" "))!=null?i:o?.keysUsed)!=null?r:[]).map(m=>m==="Space"?" ":m).filter(Boolean).includes(e.key))return;let u,E,h;if(!P(this,Ze).contains(`no${e.key.toLowerCase()}`)&&!(e.key===" "&&P(this,Ze).contains("nospace")))switch(e.key){case" ":case"k":u=P(this,V).getState().mediaPaused?w.MEDIA_PLAY_REQUEST:w.MEDIA_PAUSE_REQUEST,this.dispatchEvent(new c.CustomEvent(u,{composed:!0,bubbles:!0}));break;case"m":u=this.mediaStore.getState().mediaVolumeLevel==="off"?w.MEDIA_UNMUTE_REQUEST:w.MEDIA_MUTE_REQUEST,this.dispatchEvent(new c.CustomEvent(u,{composed:!0,bubbles:!0}));break;case"f":u=this.mediaStore.getState().mediaIsFullscreen?w.MEDIA_EXIT_FULLSCREEN_REQUEST:w.MEDIA_ENTER_FULLSCREEN_REQUEST,this.dispatchEvent(new c.CustomEvent(u,{composed:!0,bubbles:!0}));break;case"c":this.dispatchEvent(new c.CustomEvent(w.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}));break;case"ArrowLeft":{const m=this.hasAttribute(x.KEYBOARD_BACKWARD_SEEK_OFFSET)?+this.getAttribute(x.KEYBOARD_BACKWARD_SEEK_OFFSET):ra;E=Math.max(((a=this.mediaStore.getState().mediaCurrentTime)!=null?a:0)-m,0),h=new c.CustomEvent(w.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:E}),this.dispatchEvent(h);break}case"ArrowRight":{const m=this.hasAttribute(x.KEYBOARD_FORWARD_SEEK_OFFSET)?+this.getAttribute(x.KEYBOARD_FORWARD_SEEK_OFFSET):ra;E=Math.max(((s=this.mediaStore.getState().mediaCurrentTime)!=null?s:0)+m,0),h=new c.CustomEvent(w.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:E}),this.dispatchEvent(h);break}}}}Ze=new WeakMap;zt=new WeakMap;V=new WeakMap;Xt=new WeakMap;Le=new WeakMap;Un=new WeakMap;On=new WeakSet;Ki=function(){var t;this.mediaStore=Fl({media:this.media,fullscreenElement:this.fullscreenElement,options:{defaultSubtitles:this.hasAttribute(x.DEFAULT_SUBTITLES),defaultDuration:this.hasAttribute(x.DEFAULT_DURATION)?+this.getAttribute(x.DEFAULT_DURATION):void 0,defaultStreamType:(t=this.getAttribute(x.DEFAULT_STREAM_TYPE))!=null?t:void 0,liveEdgeOffset:this.hasAttribute(x.LIVE_EDGE_OFFSET)?+this.getAttribute(x.LIVE_EDGE_OFFSET):void 0,noVolumePref:this.hasAttribute(x.NO_VOLUME_PREF),noSubtitlesLangPref:this.hasAttribute(x.NO_SUBTITLES_LANG_PREF)}})};$t=new WeakSet;un=function(t){const{key:e}=t;if(!ys.includes(e)){this.removeEventListener("keyup",je(this,$t,un));return}this.keyboardShortcutHandler(t)};Nn=new WeakSet;Yi=function(t){const{metaKey:e,altKey:n,key:i}=t;if(e||n||!ys.includes(i)){this.removeEventListener("keyup",je(this,$t,un));return}[" ","ArrowLeft","ArrowRight"].includes(i)&&!(P(this,Ze).contains(`no${i.toLowerCase()}`)||i===" "&&P(this,Ze).contains("nospace"))&&t.preventDefault(),this.addEventListener("keyup",je(this,$t,un),{once:!0})};const Vl=Object.values(l),Wl=Object.values(qa),As=t=>{var e,n,i,r;let{observedAttributes:a}=t.constructor;!a&&((e=t.nodeName)!=null&&e.includes("-"))&&(c.customElements.upgrade(t),{observedAttributes:a}=t.constructor);const s=(r=(i=(n=t?.getAttribute)==null?void 0:n.call(t,B.MEDIA_CHROME_ATTRIBUTES))==null?void 0:i.split)==null?void 0:r.call(i,/\s+/);return Array.isArray(a||s)?(a||s).filter(o=>Vl.includes(o)):[]},Hl=t=>{var e,n;return(e=t.nodeName)!=null&&e.includes("-")&&c.customElements.get((n=t.nodeName)==null?void 0:n.toLowerCase())&&!(t instanceof c.customElements.get(t.nodeName.toLowerCase()))&&c.customElements.upgrade(t),Wl.some(i=>i in t)},Qi=t=>Hl(t)||!!As(t).length,aa=t=>{var e;return(e=t?.join)==null?void 0:e.call(t,":")},sa={[l.MEDIA_SUBTITLES_LIST]:Gi,[l.MEDIA_SUBTITLES_SHOWING]:Gi,[l.MEDIA_SEEKABLE]:aa,[l.MEDIA_BUFFERED]:t=>t?.map(aa).join(" "),[l.MEDIA_PREVIEW_COORDS]:t=>t?.join(" "),[l.MEDIA_RENDITION_LIST]:Go,[l.MEDIA_AUDIO_TRACK_LIST]:Yo},ql=async(t,e,n)=>{var i,r;if(t.isConnected||await Ya(0),typeof n=="boolean"||n==null)return z(t,e,n);if(typeof n=="number")return oe(t,e,n);if(typeof n=="string")return ue(t,e,n);if(Array.isArray(n)&&!n.length)return t.removeAttribute(e);const a=(r=(i=sa[e])==null?void 0:i.call(sa,n))!=null?r:n;return t.setAttribute(e,a)},Gl=t=>{var e;return!!((e=t.closest)!=null&&e.call(t,'*[slot="media"]'))},at=(t,e)=>{if(Gl(t))return;const n=(r,a)=>{var s,o;Qi(r)&&a(r);const{children:d=[]}=r??{},u=(o=(s=r?.shadowRoot)==null?void 0:s.children)!=null?o:[];[...d,...u].forEach(h=>at(h,a))},i=t?.nodeName.toLowerCase();if(i.includes("-")&&!Qi(t)){c.customElements.whenDefined(i).then(()=>{n(t,e)});return}n(t,e)},oa=(t,e,n)=>{t.forEach(i=>{if(e in i){i[e]=n;return}const r=As(i),a=e.toLowerCase();r.includes(a)&&ql(i,a,n)})},Kl=(t,e,n)=>{at(t,e);const i=E=>{var h;const m=(h=E?.composedPath()[0])!=null?h:E.target;e(m)},r=E=>{var h;const m=(h=E?.composedPath()[0])!=null?h:E.target;n(m)};t.addEventListener(w.REGISTER_MEDIA_STATE_RECEIVER,i),t.addEventListener(w.UNREGISTER_MEDIA_STATE_RECEIVER,r);const a=E=>{E.forEach(h=>{const{addedNodes:m=[],removedNodes:p=[],type:_,target:S,attributeName:I}=h;_==="childList"?(Array.prototype.forEach.call(m,R=>at(R,e)),Array.prototype.forEach.call(p,R=>at(R,n))):_==="attributes"&&I===B.MEDIA_CHROME_ATTRIBUTES&&(Qi(S)?e(S):n(S))})};let s=[];const o=E=>{const h=E.target;h.name!=="media"&&(s.forEach(m=>at(m,n)),s=[...h.assignedElements({flatten:!0})],s.forEach(m=>at(m,e)))};t.addEventListener("slotchange",o);const d=new MutationObserver(a);return d.observe(t,{childList:!0,attributes:!0,subtree:!0}),()=>{at(t,n),t.removeEventListener("slotchange",o),d.disconnect(),t.removeEventListener(w.REGISTER_MEDIA_STATE_RECEIVER,i),t.removeEventListener(w.UNREGISTER_MEDIA_STATE_RECEIVER,r)}};c.customElements.get("media-controller")||c.customElements.define("media-controller",Bl);var _r=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},q=(t,e,n)=>(_r(t,e,"read from private field"),n?n.call(t):e.get(t)),Et=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},An=(t,e,n,i)=>(_r(t,e,"write to private field"),e.set(t,n),n),Yl=(t,e,n)=>(_r(t,e,"access private method"),n),Re,xt,Je,Tt,$n,zi,ws;const wn={TOOLTIP_PLACEMENT:"tooltipplacement"},Ts=D.createElement("template");Ts.innerHTML=` `;class _e extends c.HTMLElement{constructor(e={}){var n;if(super(),Et(this,zi),Et(this,Re,void 0),this.preventClick=!1,this.tooltipEl=null,this.tooltipContent="",Et(this,xt,i=>{this.preventClick||this.handleClick(i),setTimeout(q(this,Je),0)}),Et(this,Je,()=>{var i,r;(r=(i=this.tooltipEl)==null?void 0:i.updateXOffset)==null||r.call(i)}),Et(this,Tt,i=>{const{key:r}=i;if(!this.keysUsed.includes(r)){this.removeEventListener("keyup",q(this,Tt));return}this.preventClick||this.handleClick(i)}),Et(this,$n,i=>{const{metaKey:r,altKey:a,key:s}=i;if(r||a||!this.keysUsed.includes(s)){this.removeEventListener("keyup",q(this,Tt));return}this.addEventListener("keyup",q(this,Tt),{once:!0})}),!this.shadowRoot){this.attachShadow({mode:"open"});const i=Ts.content.cloneNode(!0);this.nativeEl=i;let r=e.slotTemplate;r||(r=D.createElement("template"),r.innerHTML=`${e.defaultContent||""}`),e.tooltipContent&&(i.querySelector('slot[name="tooltip-content"]').innerHTML=(n=e.tooltipContent)!=null?n:"",this.tooltipContent=e.tooltipContent),this.nativeEl.appendChild(r.content.cloneNode(!0)),this.shadowRoot.appendChild(i)}this.tooltipEl=this.shadowRoot.querySelector("media-tooltip")}static get observedAttributes(){return["disabled",wn.TOOLTIP_PLACEMENT,B.MEDIA_CONTROLLER]}enable(){this.addEventListener("click",q(this,xt)),this.addEventListener("keydown",q(this,$n)),this.tabIndex=0}disable(){this.removeEventListener("click",q(this,xt)),this.removeEventListener("keydown",q(this,$n)),this.removeEventListener("keyup",q(this,Tt)),this.tabIndex=-1}attributeChangedCallback(e,n,i){var r,a,s,o,d;e===B.MEDIA_CONTROLLER?(n&&((a=(r=q(this,Re))==null?void 0:r.unassociateElement)==null||a.call(r,this),An(this,Re,null)),i&&this.isConnected&&(An(this,Re,(s=this.getRootNode())==null?void 0:s.getElementById(i)),(d=(o=q(this,Re))==null?void 0:o.associateElement)==null||d.call(o,this))):e==="disabled"&&i!==n?i==null?this.enable():this.disable():e===wn.TOOLTIP_PLACEMENT&&this.tooltipEl&&i!==n&&(this.tooltipEl.placement=i),q(this,Je).call(this)}connectedCallback(){var e,n,i;const{style:r}=K(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","button");const a=this.getAttribute(B.MEDIA_CONTROLLER);a&&(An(this,Re,(e=this.getRootNode())==null?void 0:e.getElementById(a)),(i=(n=q(this,Re))==null?void 0:n.associateElement)==null||i.call(n,this)),c.customElements.whenDefined("media-tooltip").then(()=>Yl(this,zi,ws).call(this))}disconnectedCallback(){var e,n;this.disable(),(n=(e=q(this,Re))==null?void 0:e.unassociateElement)==null||n.call(e,this),An(this,Re,null),this.removeEventListener("mouseenter",q(this,Je)),this.removeEventListener("focus",q(this,Je)),this.removeEventListener("click",q(this,xt))}get keysUsed(){return["Enter"," "]}get tooltipPlacement(){return de(this,wn.TOOLTIP_PLACEMENT)}set tooltipPlacement(e){ue(this,wn.TOOLTIP_PLACEMENT,e)}handleClick(e){}}Re=new WeakMap;xt=new WeakMap;Je=new WeakMap;Tt=new WeakMap;$n=new WeakMap;zi=new WeakSet;ws=function(){this.addEventListener("mouseenter",q(this,Je)),this.addEventListener("focus",q(this,Je)),this.addEventListener("click",q(this,xt));const t=this.tooltipPlacement;t&&this.tooltipEl&&(this.tooltipEl.placement=t)};c.customElements.get("media-chrome-button")||c.customElements.define("media-chrome-button",_e);const la=` `,Is=D.createElement("template");Is.innerHTML=` ${la} ${la} `;const Ql=` ${ne.ENTER_AIRPLAY} ${ne.EXIT_AIRPLAY} `,da=t=>{const e=t.mediaIsAirplaying?le.EXIT_AIRPLAY():le.ENTER_AIRPLAY();t.setAttribute("aria-label",e)};class zl extends _e{static get observedAttributes(){return[...super.observedAttributes,l.MEDIA_IS_AIRPLAYING,l.MEDIA_AIRPLAY_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Is,tooltipContent:Ql,...e})}connectedCallback(){super.connectedCallback(),da(this)}attributeChangedCallback(e,n,i){super.attributeChangedCallback(e,n,i),e===l.MEDIA_IS_AIRPLAYING&&da(this)}get mediaIsAirplaying(){return Q(this,l.MEDIA_IS_AIRPLAYING)}set mediaIsAirplaying(e){z(this,l.MEDIA_IS_AIRPLAYING,e)}get mediaAirplayUnavailable(){return de(this,l.MEDIA_AIRPLAY_UNAVAILABLE)}set mediaAirplayUnavailable(e){ue(this,l.MEDIA_AIRPLAY_UNAVAILABLE,e)}handleClick(){const e=new c.CustomEvent(w.MEDIA_AIRPLAY_REQUEST,{composed:!0,bubbles:!0});this.dispatchEvent(e)}}c.customElements.get("media-airplay-button")||c.customElements.define("media-airplay-button",zl);const Xl=``,jl=``,Ss=D.createElement("template");Ss.innerHTML=` ${Xl} ${jl} `;const Zl=` ${ne.ENABLE_CAPTIONS} ${ne.DISABLE_CAPTIONS} `,ua=t=>{t.setAttribute("aria-checked",gl(t).toString())};class Jl extends _e{static get observedAttributes(){return[...super.observedAttributes,l.MEDIA_SUBTITLES_LIST,l.MEDIA_SUBTITLES_SHOWING]}constructor(e={}){super({slotTemplate:Ss,tooltipContent:Zl,...e}),this._captionsReady=!1}connectedCallback(){super.connectedCallback(),this.setAttribute("role","switch"),this.setAttribute("aria-label",tt.CLOSED_CAPTIONS()),ua(this)}attributeChangedCallback(e,n,i){super.attributeChangedCallback(e,n,i),e===l.MEDIA_SUBTITLES_SHOWING&&ua(this)}get mediaSubtitlesList(){return ca(this,l.MEDIA_SUBTITLES_LIST)}set mediaSubtitlesList(e){ha(this,l.MEDIA_SUBTITLES_LIST,e)}get mediaSubtitlesShowing(){return ca(this,l.MEDIA_SUBTITLES_SHOWING)}set mediaSubtitlesShowing(e){ha(this,l.MEDIA_SUBTITLES_SHOWING,e)}handleClick(){this.dispatchEvent(new c.CustomEvent(w.MEDIA_TOGGLE_SUBTITLES_REQUEST,{composed:!0,bubbles:!0}))}}const ca=(t,e)=>{const n=t.getAttribute(e);return n?ps(n):[]},ha=(t,e,n)=>{if(!n?.length){t.removeAttribute(e);return}const i=Gi(n);t.getAttribute(e)!==i&&t.setAttribute(e,i)};c.customElements.get("media-captions-button")||c.customElements.define("media-captions-button",Jl);const ed='',td='',ks=D.createElement("template");ks.innerHTML=` ${ed} ${td} `;const nd=` ${ne.START_CAST} ${ne.STOP_CAST} `,ma=t=>{const e=t.mediaIsCasting?le.EXIT_CAST():le.ENTER_CAST();t.setAttribute("aria-label",e)};class id extends _e{static get observedAttributes(){return[...super.observedAttributes,l.MEDIA_IS_CASTING,l.MEDIA_CAST_UNAVAILABLE]}constructor(e={}){super({slotTemplate:ks,tooltipContent:nd,...e})}connectedCallback(){super.connectedCallback(),ma(this)}attributeChangedCallback(e,n,i){super.attributeChangedCallback(e,n,i),e===l.MEDIA_IS_CASTING&&ma(this)}get mediaIsCasting(){return Q(this,l.MEDIA_IS_CASTING)}set mediaIsCasting(e){z(this,l.MEDIA_IS_CASTING,e)}get mediaCastUnavailable(){return de(this,l.MEDIA_CAST_UNAVAILABLE)}set mediaCastUnavailable(e){ue(this,l.MEDIA_CAST_UNAVAILABLE,e)}handleClick(){const e=this.mediaIsCasting?w.MEDIA_EXIT_CAST_REQUEST:w.MEDIA_ENTER_CAST_REQUEST;this.dispatchEvent(new c.CustomEvent(e,{composed:!0,bubbles:!0}))}}c.customElements.get("media-cast-button")||c.customElements.define("media-cast-button",id);var yr=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},ut=(t,e,n)=>(yr(t,e,"read from private field"),e.get(t)),Ve=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Ar=(t,e,n,i)=>(yr(t,e,"write to private field"),e.set(t,n),n),nt=(t,e,n)=>(yr(t,e,"access private method"),n),mi,cn,ht,Fn,Xi,ji,Ms,Zi,Ls,Ji,Rs,er,Cs,tr,Ds;function rd(t){return` ${this.getSlotTemplateHTML(t)} `}function ad(t){return` `}const Ht={OPEN:"open",ANCHOR:"anchor"};class ki extends c.HTMLElement{constructor(){super(),Ve(this,Fn),Ve(this,ji),Ve(this,Zi),Ve(this,Ji),Ve(this,er),Ve(this,tr),Ve(this,mi,!1),Ve(this,cn,null),Ve(this,ht,null),this.addEventListener("invoke",this),this.addEventListener("focusout",this),this.addEventListener("keydown",this)}static get observedAttributes(){return[Ht.OPEN,Ht.ANCHOR]}get open(){return Q(this,Ht.OPEN)}set open(e){z(this,Ht.OPEN,e)}handleEvent(e){switch(e.type){case"invoke":nt(this,Ji,Rs).call(this,e);break;case"focusout":nt(this,er,Cs).call(this,e);break;case"keydown":nt(this,tr,Ds).call(this,e);break}}connectedCallback(){nt(this,Fn,Xi).call(this),this.role||(this.role="dialog")}attributeChangedCallback(e,n,i){nt(this,Fn,Xi).call(this),e===Ht.OPEN&&i!==n&&(this.open?nt(this,ji,Ms).call(this):nt(this,Zi,Ls).call(this))}focus(){Ar(this,cn,is());const e=!this.dispatchEvent(new Event("focus",{composed:!0,cancelable:!0})),n=!this.dispatchEvent(new Event("focusin",{composed:!0,bubbles:!0,cancelable:!0}));if(e||n)return;const i=this.querySelector('[autofocus], [tabindex]:not([tabindex="-1"]), [role="menu"]');i?.focus()}get keysUsed(){return["Escape","Tab"]}}mi=new WeakMap;cn=new WeakMap;ht=new WeakMap;Fn=new WeakSet;Xi=function(){if(!ut(this,mi)&&(Ar(this,mi,!0),!this.shadowRoot)){this.attachShadow({mode:"open"});const t=Zo(this.attributes);this.shadowRoot.innerHTML=` ${this.constructor.getTemplateHTML(t)} `}};ji=new WeakSet;Ms=function(){var t;(t=ut(this,ht))==null||t.setAttribute("aria-expanded","true"),this.dispatchEvent(new Event("open",{composed:!0,bubbles:!0})),this.addEventListener("transitionend",()=>this.focus(),{once:!0})};Zi=new WeakSet;Ls=function(){var t;(t=ut(this,ht))==null||t.setAttribute("aria-expanded","false"),this.dispatchEvent(new Event("close",{composed:!0,bubbles:!0}))};Ji=new WeakSet;Rs=function(t){Ar(this,ht,t.relatedTarget),Bt(this,t.relatedTarget)||(this.open=!this.open)};er=new WeakSet;Cs=function(t){var e;Bt(this,t.relatedTarget)||((e=ut(this,cn))==null||e.focus(),ut(this,ht)&&ut(this,ht)!==t.relatedTarget&&this.open&&(this.open=!1))};tr=new WeakSet;Ds=function(t){var e,n,i,r,a;const{key:s,ctrlKey:o,altKey:d,metaKey:u}=t;o||d||u||this.keysUsed.includes(s)&&(t.preventDefault(),t.stopPropagation(),s==="Tab"?(t.shiftKey?(n=(e=this.previousElementSibling)==null?void 0:e.focus)==null||n.call(e):(r=(i=this.nextElementSibling)==null?void 0:i.focus)==null||r.call(i),this.blur()):s==="Escape"&&((a=ut(this,cn))==null||a.focus(),this.open=!1))};ki.getTemplateHTML=rd;ki.getSlotTemplateHTML=ad;c.customElements.get("media-chrome-dialog")||c.customElements.define("media-chrome-dialog",ki);var wr=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},W=(t,e,n)=>(wr(t,e,"read from private field"),n?n.call(t):e.get(t)),te=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Xe=(t,e,n,i)=>(wr(t,e,"write to private field"),e.set(t,n),n),Ae=(t,e,n)=>(wr(t,e,"access private method"),n),Ce,Mi,Bn,Vn,we,pi,Wn,Hn,qn,Tr,Ps,Gn,nr,Kn,ir,fi,Ir,rr,xs,ar,Us,sr,Os,or,Ns;const $s=D.createElement("template");$s.innerHTML=`
`;class Sr extends c.HTMLElement{constructor(){super(),te(this,Tr),te(this,Gn),te(this,Kn),te(this,fi),te(this,rr),te(this,ar),te(this,sr),te(this,or),te(this,Ce,void 0),te(this,Mi,void 0),te(this,Bn,void 0),te(this,Vn,void 0),te(this,we,{}),te(this,pi,[]),te(this,Wn,()=>{if(this.range.matches(":focus-visible")){const{style:e}=K(this.shadowRoot,":host");e.setProperty("--_focus-visible-box-shadow","var(--_focus-box-shadow)")}}),te(this,Hn,()=>{const{style:e}=K(this.shadowRoot,":host");e.removeProperty("--_focus-visible-box-shadow")}),te(this,qn,()=>{const e=this.shadowRoot.querySelector("#segments-clipping");e&&e.parentNode.append(e)}),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild($s.content.cloneNode(!0))),this.container=this.shadowRoot.querySelector("#container"),Xe(this,Bn,this.shadowRoot.querySelector("#startpoint")),Xe(this,Vn,this.shadowRoot.querySelector("#endpoint")),this.range=this.shadowRoot.querySelector("#range"),this.appearance=this.shadowRoot.querySelector("#appearance")}static get observedAttributes(){return["disabled","aria-disabled",B.MEDIA_CONTROLLER]}attributeChangedCallback(e,n,i){var r,a,s,o,d;e===B.MEDIA_CONTROLLER?(n&&((a=(r=W(this,Ce))==null?void 0:r.unassociateElement)==null||a.call(r,this),Xe(this,Ce,null)),i&&this.isConnected&&(Xe(this,Ce,(s=this.getRootNode())==null?void 0:s.getElementById(i)),(d=(o=W(this,Ce))==null?void 0:o.associateElement)==null||d.call(o,this))):(e==="disabled"||e==="aria-disabled"&&n!==i)&&(i==null?(this.range.removeAttribute(e),Ae(this,Gn,nr).call(this)):(this.range.setAttribute(e,i),Ae(this,Kn,ir).call(this)))}connectedCallback(){var e,n,i;const{style:r}=K(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`),W(this,we).pointer=K(this.shadowRoot,"#pointer"),W(this,we).progress=K(this.shadowRoot,"#progress"),W(this,we).thumb=K(this.shadowRoot,"#thumb"),W(this,we).activeSegment=K(this.shadowRoot,"#segments-clipping rect:nth-child(0)");const a=this.getAttribute(B.MEDIA_CONTROLLER);a&&(Xe(this,Ce,(e=this.getRootNode())==null?void 0:e.getElementById(a)),(i=(n=W(this,Ce))==null?void 0:n.associateElement)==null||i.call(n,this)),this.updateBar(),this.shadowRoot.addEventListener("focusin",W(this,Wn)),this.shadowRoot.addEventListener("focusout",W(this,Hn)),Ae(this,Gn,nr).call(this),es(this.container,W(this,qn))}disconnectedCallback(){var e,n;Ae(this,Kn,ir).call(this),(n=(e=W(this,Ce))==null?void 0:e.unassociateElement)==null||n.call(e,this),Xe(this,Ce,null),this.shadowRoot.removeEventListener("focusin",W(this,Wn)),this.shadowRoot.removeEventListener("focusout",W(this,Hn)),jo(this.container,W(this,qn))}updatePointerBar(e){var n;(n=W(this,we).pointer)==null||n.style.setProperty("width",`${this.getPointerRatio(e)*100}%`)}updateBar(){var e,n;const i=this.range.valueAsNumber*100;(e=W(this,we).progress)==null||e.style.setProperty("width",`${i}%`),(n=W(this,we).thumb)==null||n.style.setProperty("left",`${i}%`)}updateSegments(e){const n=this.shadowRoot.querySelector("#segments-clipping");if(n.textContent="",this.container.classList.toggle("segments",!!e?.length),!e?.length)return;const i=[...new Set([+this.range.min,...e.flatMap(a=>[a.start,a.end]),+this.range.max])];Xe(this,pi,[...i]);const r=i.pop();for(const[a,s]of i.entries()){const[o,d]=[a===0,a===i.length-1],u=o?"calc(var(--segments-gap) / -1)":`${s*100}%`,h=`calc(${((d?r:i[a+1])-s)*100}%${o||d?"":" - var(--segments-gap)"})`,m=D.createElementNS("http://www.w3.org/2000/svg","rect"),p=K(this.shadowRoot,`#segments-clipping rect:nth-child(${a+1})`);p.style.setProperty("x",u),p.style.setProperty("width",h),n.append(m)}}getPointerRatio(e){const n=il(e.clientX,e.clientY,W(this,Bn).getBoundingClientRect(),W(this,Vn).getBoundingClientRect());return Math.max(0,Math.min(1,n))}get dragging(){return this.hasAttribute("dragging")}handleEvent(e){switch(e.type){case"pointermove":Ae(this,or,Ns).call(this,e);break;case"input":this.updateBar();break;case"pointerenter":Ae(this,rr,xs).call(this,e);break;case"pointerdown":Ae(this,fi,Ir).call(this,e);break;case"pointerup":Ae(this,ar,Us).call(this);break;case"pointerleave":Ae(this,sr,Os).call(this);break}}get keysUsed(){return["ArrowUp","ArrowRight","ArrowDown","ArrowLeft"]}}Ce=new WeakMap;Mi=new WeakMap;Bn=new WeakMap;Vn=new WeakMap;we=new WeakMap;pi=new WeakMap;Wn=new WeakMap;Hn=new WeakMap;qn=new WeakMap;Tr=new WeakSet;Ps=function(t){const e=W(this,we).activeSegment;if(!e)return;const n=this.getPointerRatio(t),r=`#segments-clipping rect:nth-child(${W(this,pi).findIndex((a,s,o)=>{const d=o[s+1];return d!=null&&n>=a&&n<=d})+1})`;(e.selectorText!=r||!e.style.transform)&&(e.selectorText=r,e.style.setProperty("transform","var(--media-range-segment-hover-transform, scaleY(2))"))};Gn=new WeakSet;nr=function(){this.hasAttribute("disabled")||(this.addEventListener("input",this),this.addEventListener("pointerdown",this),this.addEventListener("pointerenter",this))};Kn=new WeakSet;ir=function(){var t,e;this.removeEventListener("input",this),this.removeEventListener("pointerdown",this),this.removeEventListener("pointerenter",this),(t=c.window)==null||t.removeEventListener("pointerup",this),(e=c.window)==null||e.removeEventListener("pointermove",this)};fi=new WeakSet;Ir=function(t){var e;Xe(this,Mi,t.composedPath().includes(this.range)),(e=c.window)==null||e.addEventListener("pointerup",this)};rr=new WeakSet;xs=function(t){var e;t.pointerType!=="mouse"&&Ae(this,fi,Ir).call(this,t),this.addEventListener("pointerleave",this),(e=c.window)==null||e.addEventListener("pointermove",this)};ar=new WeakSet;Us=function(){var t;(t=c.window)==null||t.removeEventListener("pointerup",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled")};sr=new WeakSet;Os=function(){var t,e;this.removeEventListener("pointerleave",this),(t=c.window)==null||t.removeEventListener("pointermove",this),this.toggleAttribute("dragging",!1),this.range.disabled=this.hasAttribute("disabled"),(e=W(this,we).activeSegment)==null||e.style.removeProperty("transform")};or=new WeakSet;Ns=function(t){this.toggleAttribute("dragging",t.buttons===1||t.pointerType!=="mouse"),this.updatePointerBar(t),Ae(this,Tr,Ps).call(this,t),this.dragging&&(t.pointerType!=="mouse"||!W(this,Mi))&&(this.range.disabled=!0,this.range.valueAsNumber=this.getPointerRatio(t),this.range.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})))};c.customElements.get("media-chrome-range")||c.customElements.define("media-chrome-range",Sr);var Fs=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},Tn=(t,e,n)=>(Fs(t,e,"read from private field"),n?n.call(t):e.get(t)),sd=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},In=(t,e,n,i)=>(Fs(t,e,"write to private field"),e.set(t,n),n),De;const Bs=D.createElement("template");Bs.innerHTML=` `;class od extends c.HTMLElement{constructor(){super(),sd(this,De,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Bs.content.cloneNode(!0)))}static get observedAttributes(){return[B.MEDIA_CONTROLLER]}attributeChangedCallback(e,n,i){var r,a,s,o,d;e===B.MEDIA_CONTROLLER&&(n&&((a=(r=Tn(this,De))==null?void 0:r.unassociateElement)==null||a.call(r,this),In(this,De,null)),i&&this.isConnected&&(In(this,De,(s=this.getRootNode())==null?void 0:s.getElementById(i)),(d=(o=Tn(this,De))==null?void 0:o.associateElement)==null||d.call(o,this)))}connectedCallback(){var e,n,i;const r=this.getAttribute(B.MEDIA_CONTROLLER);r&&(In(this,De,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(i=(n=Tn(this,De))==null?void 0:n.associateElement)==null||i.call(n,this))}disconnectedCallback(){var e,n;(n=(e=Tn(this,De))==null?void 0:e.unassociateElement)==null||n.call(e,this),In(this,De,null)}}De=new WeakMap;c.customElements.get("media-control-bar")||c.customElements.define("media-control-bar",od);var Vs=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},Sn=(t,e,n)=>(Vs(t,e,"read from private field"),n?n.call(t):e.get(t)),ld=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},kn=(t,e,n,i)=>(Vs(t,e,"write to private field"),e.set(t,n),n),Pe;const Ws=D.createElement("template");Ws.innerHTML=` `;class gn extends c.HTMLElement{constructor(){super(),ld(this,Pe,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Ws.content.cloneNode(!0)))}static get observedAttributes(){return[B.MEDIA_CONTROLLER]}attributeChangedCallback(e,n,i){var r,a,s,o,d;e===B.MEDIA_CONTROLLER&&(n&&((a=(r=Sn(this,Pe))==null?void 0:r.unassociateElement)==null||a.call(r,this),kn(this,Pe,null)),i&&this.isConnected&&(kn(this,Pe,(s=this.getRootNode())==null?void 0:s.getElementById(i)),(d=(o=Sn(this,Pe))==null?void 0:o.associateElement)==null||d.call(o,this)))}connectedCallback(){var e,n,i;const{style:r}=K(this.shadowRoot,":host");r.setProperty("display",`var(--media-control-display, var(--${this.localName}-display, inline-flex))`);const a=this.getAttribute(B.MEDIA_CONTROLLER);a&&(kn(this,Pe,(e=this.getRootNode())==null?void 0:e.getElementById(a)),(i=(n=Sn(this,Pe))==null?void 0:n.associateElement)==null||i.call(n,this))}disconnectedCallback(){var e,n;(n=(e=Sn(this,Pe))==null?void 0:e.unassociateElement)==null||n.call(e,this),kn(this,Pe,null)}}Pe=new WeakMap;c.customElements.get("media-text-display")||c.customElements.define("media-text-display",gn);var Hs=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},pa=(t,e,n)=>(Hs(t,e,"read from private field"),n?n.call(t):e.get(t)),dd=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},ud=(t,e,n,i)=>(Hs(t,e,"write to private field"),e.set(t,n),n),jt;class cd extends gn{constructor(){super(),dd(this,jt,void 0),ud(this,jt,this.shadowRoot.querySelector("slot")),pa(this,jt).textContent=dt(0)}static get observedAttributes(){return[...super.observedAttributes,l.MEDIA_DURATION]}attributeChangedCallback(e,n,i){e===l.MEDIA_DURATION&&(pa(this,jt).textContent=dt(+i)),super.attributeChangedCallback(e,n,i)}get mediaDuration(){return G(this,l.MEDIA_DURATION)}set mediaDuration(e){oe(this,l.MEDIA_DURATION,e)}}jt=new WeakMap;c.customElements.get("media-duration-display")||c.customElements.define("media-duration-display",cd);var qs=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},hd=(t,e,n)=>(qs(t,e,"read from private field"),n?n.call(t):e.get(t)),md=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},pd=(t,e,n,i)=>(qs(t,e,"write to private field"),e.set(t,n),n),Yn;function fd(t){return` ${Gs({code:+t.mediaerrorcode,message:t.mediaerrormessage})} `}function Ed(t){return t.code&&Ka(t)!==null}function Gs(t){var e;const{title:n,message:i}=(e=Ka(t))!=null?e:{};let r="";return n&&(r+=`

${n}

`),i&&(r+=`

${i}

`),r}const fa=[l.MEDIA_ERROR_CODE,l.MEDIA_ERROR_MESSAGE];class kr extends ki{constructor(){super(...arguments),md(this,Yn,null)}static get observedAttributes(){return[...super.observedAttributes,...fa]}formatErrorMessage(e){return this.constructor.formatErrorMessage(e)}attributeChangedCallback(e,n,i){var r;if(super.attributeChangedCallback(e,n,i),!fa.includes(e))return;const a=(r=this.mediaError)!=null?r:{code:this.mediaErrorCode,message:this.mediaErrorMessage};this.open=Ed(a),this.open&&(this.shadowRoot.querySelector("slot").name=`error-${this.mediaErrorCode}`,this.shadowRoot.querySelector("#content").innerHTML=this.formatErrorMessage(a))}get mediaError(){return hd(this,Yn)}set mediaError(e){pd(this,Yn,e)}get mediaErrorCode(){return G(this,"mediaerrorcode")}set mediaErrorCode(e){oe(this,"mediaerrorcode",e)}get mediaErrorMessage(){return de(this,"mediaerrormessage")}set mediaErrorMessage(e){ue(this,"mediaerrormessage",e)}}Yn=new WeakMap;kr.getSlotTemplateHTML=fd;kr.formatErrorMessage=Gs;c.customElements.get("media-error-dialog")||c.customElements.define("media-error-dialog",kr);const vd=``,gd=``,Ks=D.createElement("template");Ks.innerHTML=` ${vd} ${gd} `;const bd=` ${ne.ENTER_FULLSCREEN} ${ne.EXIT_FULLSCREEN} `,Ea=t=>{const e=t.mediaIsFullscreen?le.EXIT_FULLSCREEN():le.ENTER_FULLSCREEN();t.setAttribute("aria-label",e)};class _d extends _e{static get observedAttributes(){return[...super.observedAttributes,l.MEDIA_IS_FULLSCREEN,l.MEDIA_FULLSCREEN_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Ks,tooltipContent:bd,...e})}connectedCallback(){super.connectedCallback(),Ea(this)}attributeChangedCallback(e,n,i){super.attributeChangedCallback(e,n,i),e===l.MEDIA_IS_FULLSCREEN&&Ea(this)}get mediaFullscreenUnavailable(){return de(this,l.MEDIA_FULLSCREEN_UNAVAILABLE)}set mediaFullscreenUnavailable(e){ue(this,l.MEDIA_FULLSCREEN_UNAVAILABLE,e)}get mediaIsFullscreen(){return Q(this,l.MEDIA_IS_FULLSCREEN)}set mediaIsFullscreen(e){z(this,l.MEDIA_IS_FULLSCREEN,e)}handleClick(){const e=this.mediaIsFullscreen?w.MEDIA_EXIT_FULLSCREEN_REQUEST:w.MEDIA_ENTER_FULLSCREEN_REQUEST;this.dispatchEvent(new c.CustomEvent(e,{composed:!0,bubbles:!0}))}}c.customElements.get("media-fullscreen-button")||c.customElements.define("media-fullscreen-button",_d);const{MEDIA_TIME_IS_LIVE:Qn,MEDIA_PAUSED:rn}=l,{MEDIA_SEEK_TO_LIVE_REQUEST:yd,MEDIA_PLAY_REQUEST:Ad}=w,wd='',Ys=D.createElement("template");Ys.innerHTML=` ${wd}  LIVE `;const va=t=>{const e=t.mediaPaused||!t.mediaTimeIsLive,n=e?le.SEEK_LIVE():le.PLAYING_LIVE();t.setAttribute("aria-label",n),e?t.removeAttribute("aria-disabled"):t.setAttribute("aria-disabled","true")};class Td extends _e{static get observedAttributes(){return[...super.observedAttributes,rn,Qn]}constructor(e={}){super({slotTemplate:Ys,...e})}connectedCallback(){va(this),super.connectedCallback()}attributeChangedCallback(e,n,i){super.attributeChangedCallback(e,n,i),va(this)}get mediaPaused(){return Q(this,l.MEDIA_PAUSED)}set mediaPaused(e){z(this,l.MEDIA_PAUSED,e)}get mediaTimeIsLive(){return Q(this,l.MEDIA_TIME_IS_LIVE)}set mediaTimeIsLive(e){z(this,l.MEDIA_TIME_IS_LIVE,e)}handleClick(){!this.mediaPaused&&this.mediaTimeIsLive||(this.dispatchEvent(new c.CustomEvent(yd,{composed:!0,bubbles:!0})),this.hasAttribute(rn)&&this.dispatchEvent(new c.CustomEvent(Ad,{composed:!0,bubbles:!0})))}}c.customElements.get("media-live-button")||c.customElements.define("media-live-button",Td);var Qs=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},qt=(t,e,n)=>(Qs(t,e,"read from private field"),n?n.call(t):e.get(t)),ga=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Gt=(t,e,n,i)=>(Qs(t,e,"write to private field"),e.set(t,n),n),xe,zn;const ba={LOADING_DELAY:"loadingdelay"},zs=500,Xs=D.createElement("template"),Id=` `;Xs.innerHTML=` ${Id}
${tt.MEDIA_LOADING()}
`;class Sd extends c.HTMLElement{constructor(){if(super(),ga(this,xe,void 0),ga(this,zn,zs),!this.shadowRoot){const e=this.attachShadow({mode:"open"}),n=Xs.content.cloneNode(!0);e.appendChild(n)}}static get observedAttributes(){return[B.MEDIA_CONTROLLER,l.MEDIA_PAUSED,l.MEDIA_LOADING,ba.LOADING_DELAY]}attributeChangedCallback(e,n,i){var r,a,s,o,d;e===ba.LOADING_DELAY&&n!==i?this.loadingDelay=Number(i):e===B.MEDIA_CONTROLLER&&(n&&((a=(r=qt(this,xe))==null?void 0:r.unassociateElement)==null||a.call(r,this),Gt(this,xe,null)),i&&this.isConnected&&(Gt(this,xe,(s=this.getRootNode())==null?void 0:s.getElementById(i)),(d=(o=qt(this,xe))==null?void 0:o.associateElement)==null||d.call(o,this)))}connectedCallback(){var e,n,i;const r=this.getAttribute(B.MEDIA_CONTROLLER);r&&(Gt(this,xe,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(i=(n=qt(this,xe))==null?void 0:n.associateElement)==null||i.call(n,this))}disconnectedCallback(){var e,n;(n=(e=qt(this,xe))==null?void 0:e.unassociateElement)==null||n.call(e,this),Gt(this,xe,null)}get loadingDelay(){return qt(this,zn)}set loadingDelay(e){Gt(this,zn,e);const{style:n}=K(this.shadowRoot,":host");n.setProperty("--_loading-indicator-delay",`var(--media-loading-indicator-transition-delay, ${e}ms)`)}get mediaPaused(){return Q(this,l.MEDIA_PAUSED)}set mediaPaused(e){z(this,l.MEDIA_PAUSED,e)}get mediaLoading(){return Q(this,l.MEDIA_LOADING)}set mediaLoading(e){z(this,l.MEDIA_LOADING,e)}}xe=new WeakMap;zn=new WeakMap;c.customElements.get("media-loading-indicator")||c.customElements.define("media-loading-indicator",Sd);const{MEDIA_VOLUME_LEVEL:it}=l,kd=``,_a=``,Md=``,js=D.createElement("template");js.innerHTML=` ${kd} ${_a} ${_a} ${Md} `;const Ld=` ${ne.MUTE} ${ne.UNMUTE} `,ya=t=>{const n=t.mediaVolumeLevel==="off"?le.UNMUTE():le.MUTE();t.setAttribute("aria-label",n)};class Rd extends _e{static get observedAttributes(){return[...super.observedAttributes,l.MEDIA_VOLUME_LEVEL]}constructor(e={}){super({slotTemplate:js,tooltipContent:Ld,...e})}connectedCallback(){ya(this),super.connectedCallback()}attributeChangedCallback(e,n,i){e===l.MEDIA_VOLUME_LEVEL&&ya(this),super.attributeChangedCallback(e,n,i)}get mediaVolumeLevel(){return de(this,l.MEDIA_VOLUME_LEVEL)}set mediaVolumeLevel(e){ue(this,l.MEDIA_VOLUME_LEVEL,e)}handleClick(){const e=this.mediaVolumeLevel==="off"?w.MEDIA_UNMUTE_REQUEST:w.MEDIA_MUTE_REQUEST;this.dispatchEvent(new c.CustomEvent(e,{composed:!0,bubbles:!0}))}}c.customElements.get("media-mute-button")||c.customElements.define("media-mute-button",Rd);const Aa=``,Zs=D.createElement("template");Zs.innerHTML=` ${Aa} ${Aa} `;const Cd=` ${ne.ENTER_PIP} ${ne.EXIT_PIP} `,wa=t=>{const e=t.mediaIsPip?le.EXIT_PIP():le.ENTER_PIP();t.setAttribute("aria-label",e)};class Dd extends _e{static get observedAttributes(){return[...super.observedAttributes,l.MEDIA_IS_PIP,l.MEDIA_PIP_UNAVAILABLE]}constructor(e={}){super({slotTemplate:Zs,tooltipContent:Cd,...e})}connectedCallback(){wa(this),super.connectedCallback()}attributeChangedCallback(e,n,i){e===l.MEDIA_IS_PIP&&wa(this),super.attributeChangedCallback(e,n,i)}get mediaPipUnavailable(){return de(this,l.MEDIA_PIP_UNAVAILABLE)}set mediaPipUnavailable(e){ue(this,l.MEDIA_PIP_UNAVAILABLE,e)}get mediaIsPip(){return Q(this,l.MEDIA_IS_PIP)}set mediaIsPip(e){z(this,l.MEDIA_IS_PIP,e)}handleClick(){const e=this.mediaIsPip?w.MEDIA_EXIT_PIP_REQUEST:w.MEDIA_ENTER_PIP_REQUEST;this.dispatchEvent(new c.CustomEvent(e,{composed:!0,bubbles:!0}))}}c.customElements.get("media-pip-button")||c.customElements.define("media-pip-button",Dd);var Pd=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},Mn=(t,e,n)=>(Pd(t,e,"read from private field"),n?n.call(t):e.get(t)),xd=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},It;const Di={RATES:"rates"},Ud=[1,1.2,1.5,1.7,2],Ln=1,Js=D.createElement("template");Js.innerHTML=` `;class Od extends _e{constructor(e={}){super({slotTemplate:Js,tooltipContent:ne.PLAYBACK_RATE,...e}),xd(this,It,new hs(this,Di.RATES,{defaultValue:Ud})),this.container=this.shadowRoot.querySelector('slot[name="icon"]'),this.container.innerHTML=`${Ln}x`}static get observedAttributes(){return[...super.observedAttributes,l.MEDIA_PLAYBACK_RATE,Di.RATES]}attributeChangedCallback(e,n,i){if(super.attributeChangedCallback(e,n,i),e===Di.RATES&&(Mn(this,It).value=i),e===l.MEDIA_PLAYBACK_RATE){const r=i?+i:Number.NaN,a=Number.isNaN(r)?Ln:r;this.container.innerHTML=`${a}x`,this.setAttribute("aria-label",tt.PLAYBACK_RATE({playbackRate:a}))}}get rates(){return Mn(this,It)}set rates(e){e?Array.isArray(e)&&(Mn(this,It).value=e.join(" ")):Mn(this,It).value=""}get mediaPlaybackRate(){return G(this,l.MEDIA_PLAYBACK_RATE,Ln)}set mediaPlaybackRate(e){oe(this,l.MEDIA_PLAYBACK_RATE,e)}handleClick(){var e,n;const i=Array.from(this.rates.values(),s=>+s).sort((s,o)=>s-o),r=(n=(e=i.find(s=>s>this.mediaPlaybackRate))!=null?e:i[0])!=null?n:Ln,a=new c.CustomEvent(w.MEDIA_PLAYBACK_RATE_REQUEST,{composed:!0,bubbles:!0,detail:r});this.dispatchEvent(a)}}It=new WeakMap;c.customElements.get("media-playback-rate-button")||c.customElements.define("media-playback-rate-button",Od);const Nd=``,$d=``,eo=D.createElement("template");eo.innerHTML=` ${Nd} ${$d} `;const Fd=` ${ne.PLAY} ${ne.PAUSE} `,Ta=t=>{const e=t.mediaPaused?le.PLAY():le.PAUSE();t.setAttribute("aria-label",e)};class Bd extends _e{static get observedAttributes(){return[...super.observedAttributes,l.MEDIA_PAUSED,l.MEDIA_ENDED]}constructor(e={}){super({slotTemplate:eo,tooltipContent:Fd,...e})}connectedCallback(){Ta(this),super.connectedCallback()}attributeChangedCallback(e,n,i){e===l.MEDIA_PAUSED&&Ta(this),super.attributeChangedCallback(e,n,i)}get mediaPaused(){return Q(this,l.MEDIA_PAUSED)}set mediaPaused(e){z(this,l.MEDIA_PAUSED,e)}handleClick(){const e=this.mediaPaused?w.MEDIA_PLAY_REQUEST:w.MEDIA_PAUSE_REQUEST;this.dispatchEvent(new c.CustomEvent(e,{composed:!0,bubbles:!0}))}}c.customElements.get("media-play-button")||c.customElements.define("media-play-button",Bd);const ke={PLACEHOLDER_SRC:"placeholdersrc",SRC:"src"},to=D.createElement("template");to.innerHTML=` `;const Vd=t=>{t.style.removeProperty("background-image")},Wd=(t,e)=>{t.style["background-image"]=`url('${e}')`};class Hd extends c.HTMLElement{static get observedAttributes(){return[ke.PLACEHOLDER_SRC,ke.SRC]}constructor(){super(),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(to.content.cloneNode(!0))),this.image=this.shadowRoot.querySelector("#image")}attributeChangedCallback(e,n,i){e===ke.SRC&&(i==null?this.image.removeAttribute(ke.SRC):this.image.setAttribute(ke.SRC,i)),e===ke.PLACEHOLDER_SRC&&(i==null?Vd(this.image):Wd(this.image,i))}get placeholderSrc(){return de(this,ke.PLACEHOLDER_SRC)}set placeholderSrc(e){ue(this,ke.SRC,e)}get src(){return de(this,ke.SRC)}set src(e){ue(this,ke.SRC,e)}}c.customElements.get("media-poster-image")||c.customElements.define("media-poster-image",Hd);var no=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},qd=(t,e,n)=>(no(t,e,"read from private field"),n?n.call(t):e.get(t)),Gd=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Kd=(t,e,n,i)=>(no(t,e,"write to private field"),e.set(t,n),n),Xn;class Yd extends gn{constructor(){super(),Gd(this,Xn,void 0),Kd(this,Xn,this.shadowRoot.querySelector("slot"))}static get observedAttributes(){return[...super.observedAttributes,l.MEDIA_PREVIEW_CHAPTER]}attributeChangedCallback(e,n,i){super.attributeChangedCallback(e,n,i),e===l.MEDIA_PREVIEW_CHAPTER&&i!==n&&i!=null&&(qd(this,Xn).textContent=i,i!==""?this.setAttribute("aria-valuetext",`chapter: ${i}`):this.removeAttribute("aria-valuetext"))}get mediaPreviewChapter(){return de(this,l.MEDIA_PREVIEW_CHAPTER)}set mediaPreviewChapter(e){ue(this,l.MEDIA_PREVIEW_CHAPTER,e)}}Xn=new WeakMap;c.customElements.get("media-preview-chapter-display")||c.customElements.define("media-preview-chapter-display",Yd);var io=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},Rn=(t,e,n)=>(io(t,e,"read from private field"),n?n.call(t):e.get(t)),Qd=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Cn=(t,e,n,i)=>(io(t,e,"write to private field"),e.set(t,n),n),Ue;const ro=D.createElement("template");ro.innerHTML=` `;class zd extends c.HTMLElement{constructor(){super(),Qd(this,Ue,void 0),this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(ro.content.cloneNode(!0)))}static get observedAttributes(){return[B.MEDIA_CONTROLLER,l.MEDIA_PREVIEW_IMAGE,l.MEDIA_PREVIEW_COORDS]}connectedCallback(){var e,n,i;const r=this.getAttribute(B.MEDIA_CONTROLLER);r&&(Cn(this,Ue,(e=this.getRootNode())==null?void 0:e.getElementById(r)),(i=(n=Rn(this,Ue))==null?void 0:n.associateElement)==null||i.call(n,this))}disconnectedCallback(){var e,n;(n=(e=Rn(this,Ue))==null?void 0:e.unassociateElement)==null||n.call(e,this),Cn(this,Ue,null)}attributeChangedCallback(e,n,i){var r,a,s,o,d;[l.MEDIA_PREVIEW_IMAGE,l.MEDIA_PREVIEW_COORDS].includes(e)&&this.update(),e===B.MEDIA_CONTROLLER&&(n&&((a=(r=Rn(this,Ue))==null?void 0:r.unassociateElement)==null||a.call(r,this),Cn(this,Ue,null)),i&&this.isConnected&&(Cn(this,Ue,(s=this.getRootNode())==null?void 0:s.getElementById(i)),(d=(o=Rn(this,Ue))==null?void 0:o.associateElement)==null||d.call(o,this)))}get mediaPreviewImage(){return de(this,l.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){ue(this,l.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewCoords(){const e=this.getAttribute(l.MEDIA_PREVIEW_COORDS);if(e)return e.split(/\s+/).map(n=>+n)}set mediaPreviewCoords(e){if(!e){this.removeAttribute(l.MEDIA_PREVIEW_COORDS);return}this.setAttribute(l.MEDIA_PREVIEW_COORDS,e.join(" "))}update(){const e=this.mediaPreviewCoords,n=this.mediaPreviewImage;if(!(e&&n))return;const[i,r,a,s]=e,o=n.split("#")[0],d=getComputedStyle(this),{maxWidth:u,maxHeight:E,minWidth:h,minHeight:m}=d,p=Math.min(parseInt(u)/a,parseInt(E)/s),_=Math.max(parseInt(h)/a,parseInt(m)/s),S=p<1,I=S?p:_>1?_:1,{style:R}=K(this.shadowRoot,":host"),y=K(this.shadowRoot,"img").style,g=this.shadowRoot.querySelector("img"),A=S?"min":"max";R.setProperty(`${A}-width`,"initial","important"),R.setProperty(`${A}-height`,"initial","important"),R.width=`${a*I}px`,R.height=`${s*I}px`;const k=()=>{y.width=`${this.imgWidth*I}px`,y.height=`${this.imgHeight*I}px`,y.display="block"};g.src!==o&&(g.onload=()=>{this.imgWidth=g.naturalWidth,this.imgHeight=g.naturalHeight,k()},g.src=o,k()),k(),y.transform=`translate(-${i*I}px, -${r*I}px)`}}Ue=new WeakMap;c.customElements.get("media-preview-thumbnail")||c.customElements.define("media-preview-thumbnail",zd);var ao=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},Ia=(t,e,n)=>(ao(t,e,"read from private field"),n?n.call(t):e.get(t)),Xd=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},jd=(t,e,n,i)=>(ao(t,e,"write to private field"),e.set(t,n),n),Zt;class Zd extends gn{constructor(){super(),Xd(this,Zt,void 0),jd(this,Zt,this.shadowRoot.querySelector("slot")),Ia(this,Zt).textContent=dt(0)}static get observedAttributes(){return[...super.observedAttributes,l.MEDIA_PREVIEW_TIME]}attributeChangedCallback(e,n,i){super.attributeChangedCallback(e,n,i),e===l.MEDIA_PREVIEW_TIME&&i!=null&&(Ia(this,Zt).textContent=dt(parseFloat(i)))}get mediaPreviewTime(){return G(this,l.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){oe(this,l.MEDIA_PREVIEW_TIME,e)}}Zt=new WeakMap;c.customElements.get("media-preview-time-display")||c.customElements.define("media-preview-time-display",Zd);const vt={SEEK_OFFSET:"seekoffset"},jn=30,Jd=``,so=D.createElement("template");so.innerHTML=` ${Jd} `;const eu=0;class tu extends _e{static get observedAttributes(){return[...super.observedAttributes,l.MEDIA_CURRENT_TIME,vt.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:so,tooltipContent:ne.SEEK_BACKWARD,...e})}connectedCallback(){this.seekOffset=G(this,vt.SEEK_OFFSET,jn),super.connectedCallback()}attributeChangedCallback(e,n,i){e===vt.SEEK_OFFSET&&(this.seekOffset=G(this,vt.SEEK_OFFSET,jn)),super.attributeChangedCallback(e,n,i)}get seekOffset(){return G(this,vt.SEEK_OFFSET,jn)}set seekOffset(e){oe(this,vt.SEEK_OFFSET,e),this.setAttribute("aria-label",le.SEEK_BACK_N_SECS({seekOffset:this.seekOffset})),ts(ns(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return G(this,l.MEDIA_CURRENT_TIME,eu)}set mediaCurrentTime(e){oe(this,l.MEDIA_CURRENT_TIME,e)}handleClick(){const e=Math.max(this.mediaCurrentTime-this.seekOffset,0),n=new c.CustomEvent(w.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(n)}}c.customElements.get("media-seek-backward-button")||c.customElements.define("media-seek-backward-button",tu);const gt={SEEK_OFFSET:"seekoffset"},Zn=30,nu=``,oo=D.createElement("template");oo.innerHTML=` ${nu} `;const iu=0;class ru extends _e{static get observedAttributes(){return[...super.observedAttributes,l.MEDIA_CURRENT_TIME,gt.SEEK_OFFSET]}constructor(e={}){super({slotTemplate:oo,tooltipContent:ne.SEEK_FORWARD,...e})}connectedCallback(){this.seekOffset=G(this,gt.SEEK_OFFSET,Zn),super.connectedCallback()}attributeChangedCallback(e,n,i){e===gt.SEEK_OFFSET&&(this.seekOffset=G(this,gt.SEEK_OFFSET,Zn)),super.attributeChangedCallback(e,n,i)}get seekOffset(){return G(this,gt.SEEK_OFFSET,Zn)}set seekOffset(e){oe(this,gt.SEEK_OFFSET,e),this.setAttribute("aria-label",le.SEEK_FORWARD_N_SECS({seekOffset:this.seekOffset})),ts(ns(this,"icon"),this.seekOffset)}get mediaCurrentTime(){return G(this,l.MEDIA_CURRENT_TIME,iu)}set mediaCurrentTime(e){oe(this,l.MEDIA_CURRENT_TIME,e)}handleClick(){const e=this.mediaCurrentTime+this.seekOffset,n=new c.CustomEvent(w.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(n)}}c.customElements.get("media-seek-forward-button")||c.customElements.define("media-seek-forward-button",ru);var lo=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},Pi=(t,e,n)=>(lo(t,e,"read from private field"),n?n.call(t):e.get(t)),au=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},su=(t,e,n,i)=>(lo(t,e,"write to private field"),e.set(t,n),n),St;const Te={REMAINING:"remaining",SHOW_DURATION:"showduration",NO_TOGGLE:"notoggle"},Sa=[...Object.values(Te),l.MEDIA_CURRENT_TIME,l.MEDIA_DURATION,l.MEDIA_SEEKABLE],ka=["Enter"," "],ou=" / ",Ma=(t,{timesSep:e=ou}={})=>{var n,i;const r=t.hasAttribute(Te.REMAINING),a=t.hasAttribute(Te.SHOW_DURATION),s=(n=t.mediaCurrentTime)!=null?n:0,[,o]=(i=t.mediaSeekable)!=null?i:[];let d=0;Number.isFinite(t.mediaDuration)?d=t.mediaDuration:Number.isFinite(o)&&(d=o);const u=dt(r?0-(d-s):s);return a?`${u}${e}${dt(d)}`:u},lu="video not loaded, unknown time.",du=t=>{var e;const n=t.mediaCurrentTime,[,i]=(e=t.mediaSeekable)!=null?e:[];let r=null;if(Number.isFinite(t.mediaDuration)?r=t.mediaDuration:Number.isFinite(i)&&(r=i),n==null||r===null){t.setAttribute("aria-valuetext",lu);return}const a=t.hasAttribute(Te.REMAINING),s=t.hasAttribute(Te.SHOW_DURATION),o=tn(a?0-(r-n):n);if(!s){t.setAttribute("aria-valuetext",o);return}const d=tn(r),u=`${o} of ${d}`;t.setAttribute("aria-valuetext",u)};class uu extends gn{constructor(){super(),au(this,St,void 0),su(this,St,this.shadowRoot.querySelector("slot")),Pi(this,St).innerHTML=`${Ma(this)}`}static get observedAttributes(){return[...super.observedAttributes,...Sa,"disabled"]}connectedCallback(){const{style:e}=K(this.shadowRoot,":host(:hover:not([notoggle]))");e.setProperty("cursor","pointer"),e.setProperty("background","var(--media-control-hover-background, rgba(50 50 70 / .7))"),this.hasAttribute("disabled")||this.enable(),this.setAttribute("role","progressbar"),this.setAttribute("aria-label",tt.PLAYBACK_TIME());const n=i=>{const{key:r}=i;if(!ka.includes(r)){this.removeEventListener("keyup",n);return}this.toggleTimeDisplay()};this.addEventListener("keydown",i=>{const{metaKey:r,altKey:a,key:s}=i;if(r||a||!ka.includes(s)){this.removeEventListener("keyup",n);return}this.addEventListener("keyup",n)}),this.addEventListener("click",this.toggleTimeDisplay),super.connectedCallback()}toggleTimeDisplay(){this.noToggle||(this.hasAttribute("remaining")?this.removeAttribute("remaining"):this.setAttribute("remaining",""))}disconnectedCallback(){this.disable(),super.disconnectedCallback()}attributeChangedCallback(e,n,i){Sa.includes(e)?this.update():e==="disabled"&&i!==n&&(i==null?this.enable():this.disable()),super.attributeChangedCallback(e,n,i)}enable(){this.tabIndex=0}disable(){this.tabIndex=-1}get remaining(){return Q(this,Te.REMAINING)}set remaining(e){z(this,Te.REMAINING,e)}get showDuration(){return Q(this,Te.SHOW_DURATION)}set showDuration(e){z(this,Te.SHOW_DURATION,e)}get noToggle(){return Q(this,Te.NO_TOGGLE)}set noToggle(e){z(this,Te.NO_TOGGLE,e)}get mediaDuration(){return G(this,l.MEDIA_DURATION)}set mediaDuration(e){oe(this,l.MEDIA_DURATION,e)}get mediaCurrentTime(){return G(this,l.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){oe(this,l.MEDIA_CURRENT_TIME,e)}get mediaSeekable(){const e=this.getAttribute(l.MEDIA_SEEKABLE);if(e)return e.split(":").map(n=>+n)}set mediaSeekable(e){if(e==null){this.removeAttribute(l.MEDIA_SEEKABLE);return}this.setAttribute(l.MEDIA_SEEKABLE,e.join(":"))}update(){const e=Ma(this);du(this),e!==Pi(this,St).innerHTML&&(Pi(this,St).innerHTML=e)}}St=new WeakMap;c.customElements.get("media-time-display")||c.customElements.define("media-time-display",uu);var uo=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},J=(t,e,n)=>(uo(t,e,"read from private field"),n?n.call(t):e.get(t)),Me=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},ve=(t,e,n,i)=>(uo(t,e,"write to private field"),e.set(t,n),n),cu=(t,e,n,i)=>({set _(r){ve(t,e,r)},get _(){return J(t,e,i)}}),kt,Jn,Mt,Jt,ei,ti,ni,Lt,st,ii;class hu{constructor(e,n,i){Me(this,kt,void 0),Me(this,Jn,void 0),Me(this,Mt,void 0),Me(this,Jt,void 0),Me(this,ei,void 0),Me(this,ti,void 0),Me(this,ni,void 0),Me(this,Lt,void 0),Me(this,st,0),Me(this,ii,(r=performance.now())=>{ve(this,st,requestAnimationFrame(J(this,ii))),ve(this,Jt,performance.now()-J(this,Mt));const a=1e3/this.fps;if(J(this,Jt)>a){ve(this,Mt,r-J(this,Jt)%a);const s=1e3/((r-J(this,Jn))/++cu(this,ei)._),o=(r-J(this,ti))/1e3/this.duration;let d=J(this,ni)+o*this.playbackRate;d-J(this,kt).valueAsNumber>0?ve(this,Lt,this.playbackRate/this.duration/s):(ve(this,Lt,.995*J(this,Lt)),d=J(this,kt).valueAsNumber+J(this,Lt)),this.callback(d)}}),ve(this,kt,e),this.callback=n,this.fps=i}start(){J(this,st)===0&&(ve(this,Mt,performance.now()),ve(this,Jn,J(this,Mt)),ve(this,ei,0),J(this,ii).call(this))}stop(){J(this,st)!==0&&(cancelAnimationFrame(J(this,st)),ve(this,st,0))}update({start:e,duration:n,playbackRate:i}){const r=e-J(this,kt).valueAsNumber,a=Math.abs(n-this.duration);(r>0||r<-.03||a>=.5)&&this.callback(e),ve(this,ni,e),ve(this,ti,performance.now()),this.duration=n,this.playbackRate=i}}kt=new WeakMap;Jn=new WeakMap;Mt=new WeakMap;Jt=new WeakMap;ei=new WeakMap;ti=new WeakMap;ni=new WeakMap;Lt=new WeakMap;st=new WeakMap;ii=new WeakMap;var Mr=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)},Y=(t,e,n)=>(Mr(t,e,"read from private field"),n?n.call(t):e.get(t)),Z=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},Oe=(t,e,n,i)=>(Mr(t,e,"write to private field"),e.set(t,n),n),se=(t,e,n)=>(Mr(t,e,"access private method"),n),Rt,ct,Ei,an,vi,ri,hn,mn,Ct,Dt,en,Lr,co,lr,gi,Rr,bi,Cr,_i,Dr,dr,ho,pn,yi,ur,mo;const mu="video not loaded, unknown time.",pu=t=>{const e=t.range,n=tn(+fo(t)),i=tn(+t.mediaSeekableEnd),r=n&&i?`${n} of ${i}`:mu;e.setAttribute("aria-valuetext",r)},po=D.createElement("template");po.innerHTML=`
`;const Dn=(t,e=t.mediaCurrentTime)=>{const n=Number.isFinite(t.mediaSeekableStart)?t.mediaSeekableStart:0,i=Number.isFinite(t.mediaDuration)?t.mediaDuration:t.mediaSeekableEnd;if(Number.isNaN(i))return 0;const r=(e-n)/(i-n);return Math.max(0,Math.min(r,1))},fo=(t,e=t.range.valueAsNumber)=>{const n=Number.isFinite(t.mediaSeekableStart)?t.mediaSeekableStart:0,i=Number.isFinite(t.mediaDuration)?t.mediaDuration:t.mediaSeekableEnd;return Number.isNaN(i)?0:e*(i-n)+n};class fu extends Sr{constructor(){super(),Z(this,Dt),Z(this,Lr),Z(this,gi),Z(this,bi),Z(this,_i),Z(this,dr),Z(this,pn),Z(this,ur),Z(this,Rt,void 0),Z(this,ct,void 0),Z(this,Ei,void 0),Z(this,an,void 0),Z(this,vi,void 0),Z(this,ri,void 0),Z(this,hn,void 0),Z(this,mn,void 0),Z(this,Ct,void 0),Z(this,lr,i=>{this.dragging||(mr(i)&&(this.range.valueAsNumber=i),this.updateBar())}),this.container.appendChild(po.content.cloneNode(!0)),this.shadowRoot.querySelector("#track").insertAdjacentHTML("afterbegin",'
'),Oe(this,Ei,this.shadowRoot.querySelectorAll('[part~="box"]')),Oe(this,vi,this.shadowRoot.querySelector('[part~="preview-box"]')),Oe(this,ri,this.shadowRoot.querySelector('[part~="current-box"]'));const n=getComputedStyle(this);Oe(this,hn,parseInt(n.getPropertyValue("--media-box-padding-left"))),Oe(this,mn,parseInt(n.getPropertyValue("--media-box-padding-right"))),Oe(this,ct,new hu(this.range,Y(this,lr),60))}static get observedAttributes(){return[...super.observedAttributes,l.MEDIA_PAUSED,l.MEDIA_DURATION,l.MEDIA_SEEKABLE,l.MEDIA_CURRENT_TIME,l.MEDIA_PREVIEW_IMAGE,l.MEDIA_PREVIEW_TIME,l.MEDIA_PREVIEW_CHAPTER,l.MEDIA_BUFFERED,l.MEDIA_PLAYBACK_RATE,l.MEDIA_LOADING,l.MEDIA_ENDED]}connectedCallback(){var e;super.connectedCallback(),this.range.setAttribute("aria-label",tt.SEEK()),se(this,Dt,en).call(this),Oe(this,Rt,this.getRootNode()),(e=Y(this,Rt))==null||e.addEventListener("transitionstart",this)}disconnectedCallback(){var e;super.disconnectedCallback(),se(this,Dt,en).call(this),(e=Y(this,Rt))==null||e.removeEventListener("transitionstart",this),Oe(this,Rt,null)}attributeChangedCallback(e,n,i){super.attributeChangedCallback(e,n,i),n!=i&&(e===l.MEDIA_CURRENT_TIME||e===l.MEDIA_PAUSED||e===l.MEDIA_ENDED||e===l.MEDIA_LOADING||e===l.MEDIA_DURATION||e===l.MEDIA_SEEKABLE?(Y(this,ct).update({start:Dn(this),duration:this.mediaSeekableEnd-this.mediaSeekableStart,playbackRate:this.mediaPlaybackRate}),se(this,Dt,en).call(this),pu(this)):e===l.MEDIA_BUFFERED&&this.updateBufferedBar(),(e===l.MEDIA_DURATION||e===l.MEDIA_SEEKABLE)&&(this.mediaChaptersCues=Y(this,Ct),this.updateBar()))}get mediaChaptersCues(){return Y(this,Ct)}set mediaChaptersCues(e){var n;Oe(this,Ct,e),this.updateSegments((n=Y(this,Ct))==null?void 0:n.map(i=>({start:Dn(this,i.startTime),end:Dn(this,i.endTime)})))}get mediaPaused(){return Q(this,l.MEDIA_PAUSED)}set mediaPaused(e){z(this,l.MEDIA_PAUSED,e)}get mediaLoading(){return Q(this,l.MEDIA_LOADING)}set mediaLoading(e){z(this,l.MEDIA_LOADING,e)}get mediaDuration(){return G(this,l.MEDIA_DURATION)}set mediaDuration(e){oe(this,l.MEDIA_DURATION,e)}get mediaCurrentTime(){return G(this,l.MEDIA_CURRENT_TIME)}set mediaCurrentTime(e){oe(this,l.MEDIA_CURRENT_TIME,e)}get mediaPlaybackRate(){return G(this,l.MEDIA_PLAYBACK_RATE,1)}set mediaPlaybackRate(e){oe(this,l.MEDIA_PLAYBACK_RATE,e)}get mediaBuffered(){const e=this.getAttribute(l.MEDIA_BUFFERED);return e?e.split(" ").map(n=>n.split(":").map(i=>+i)):[]}set mediaBuffered(e){if(!e){this.removeAttribute(l.MEDIA_BUFFERED);return}const n=e.map(i=>i.join(":")).join(" ");this.setAttribute(l.MEDIA_BUFFERED,n)}get mediaSeekable(){const e=this.getAttribute(l.MEDIA_SEEKABLE);if(e)return e.split(":").map(n=>+n)}set mediaSeekable(e){if(e==null){this.removeAttribute(l.MEDIA_SEEKABLE);return}this.setAttribute(l.MEDIA_SEEKABLE,e.join(":"))}get mediaSeekableEnd(){var e;const[,n=this.mediaDuration]=(e=this.mediaSeekable)!=null?e:[];return n}get mediaSeekableStart(){var e;const[n=0]=(e=this.mediaSeekable)!=null?e:[];return n}get mediaPreviewImage(){return de(this,l.MEDIA_PREVIEW_IMAGE)}set mediaPreviewImage(e){ue(this,l.MEDIA_PREVIEW_IMAGE,e)}get mediaPreviewTime(){return G(this,l.MEDIA_PREVIEW_TIME)}set mediaPreviewTime(e){oe(this,l.MEDIA_PREVIEW_TIME,e)}get mediaEnded(){return Q(this,l.MEDIA_ENDED)}set mediaEnded(e){z(this,l.MEDIA_ENDED,e)}updateBar(){super.updateBar(),this.updateBufferedBar(),this.updateCurrentBox()}updateBufferedBar(){var e;const n=this.mediaBuffered;if(!n.length)return;let i;if(this.mediaEnded)i=1;else{const a=this.mediaCurrentTime,[,s=this.mediaSeekableStart]=(e=n.find(([o,d])=>o<=a&&a<=d))!=null?e:[];i=Dn(this,s)}const{style:r}=K(this.shadowRoot,"#buffered");r.setProperty("width",`${i*100}%`)}updateCurrentBox(){if(!this.shadowRoot.querySelector('slot[name="current"]').assignedElements().length)return;const n=K(this.shadowRoot,"#current-rail"),i=K(this.shadowRoot,'[part~="current-box"]'),r=se(this,gi,Rr).call(this,Y(this,ri)),a=se(this,bi,Cr).call(this,r,this.range.valueAsNumber),s=se(this,_i,Dr).call(this,r,this.range.valueAsNumber);n.style.transform=`translateX(${a})`,n.style.setProperty("--_range-width",`${r.range.width}`),i.style.setProperty("--_box-shift",`${s}`),i.style.setProperty("--_box-width",`${r.box.width}px`),i.style.setProperty("visibility","initial")}handleEvent(e){switch(super.handleEvent(e),e.type){case"input":se(this,ur,mo).call(this);break;case"pointermove":se(this,dr,ho).call(this,e);break;case"pointerup":case"pointerleave":se(this,pn,yi).call(this,null);break;case"transitionstart":Bt(e.target,this)&&setTimeout(()=>se(this,Dt,en).call(this),0);break}}}Rt=new WeakMap;ct=new WeakMap;Ei=new WeakMap;an=new WeakMap;vi=new WeakMap;ri=new WeakMap;hn=new WeakMap;mn=new WeakMap;Ct=new WeakMap;Dt=new WeakSet;en=function(){se(this,Lr,co).call(this)?Y(this,ct).start():Y(this,ct).stop()};Lr=new WeakSet;co=function(){return this.isConnected&&!this.mediaPaused&&!this.mediaLoading&&!this.mediaEnded&&this.mediaSeekableEnd>0&&rs(this)};lr=new WeakMap;gi=new WeakSet;Rr=function(t){var e;const i=((e=this.getAttribute("bounds")?vn(this,`#${this.getAttribute("bounds")}`):this.parentElement)!=null?e:this).getBoundingClientRect(),r=this.range.getBoundingClientRect(),a=t.offsetWidth,s=-(r.left-i.left-a/2),o=i.right-r.left-a/2;return{box:{width:a,min:s,max:o},bounds:i,range:r}};bi=new WeakSet;Cr=function(t,e){let n=`${e*100}%`;const{width:i,min:r,max:a}=t.box;if(!i)return n;if(Number.isNaN(r)||(n=`max(${`calc(1 / var(--_range-width) * 100 * ${r}% + var(--media-box-padding-left))`}, ${n})`),!Number.isNaN(a)){const o=`calc(1 / var(--_range-width) * 100 * ${a}% - var(--media-box-padding-right))`;n=`min(${n}, ${o})`}return n};_i=new WeakSet;Dr=function(t,e){const{width:n,min:i,max:r}=t.box,a=e*t.range.width;if(ar-Y(this,mn)){const s=t.bounds.right-t.range.right-Y(this,mn);return`${a+n/2-s-t.range.width}px`}return 0};dr=new WeakSet;ho=function(t){const e=[...Y(this,Ei)].some(E=>t.composedPath().includes(E));if(!this.dragging&&(e||!t.composedPath().includes(this))){se(this,pn,yi).call(this,null);return}const n=this.mediaSeekableEnd;if(!n)return;const i=K(this.shadowRoot,"#preview-rail"),r=K(this.shadowRoot,'[part~="preview-box"]'),a=se(this,gi,Rr).call(this,Y(this,vi));let s=(t.clientX-a.range.left)/a.range.width;s=Math.max(0,Math.min(1,s));const o=se(this,bi,Cr).call(this,a,s),d=se(this,_i,Dr).call(this,a,s);i.style.transform=`translateX(${o})`,i.style.setProperty("--_range-width",`${a.range.width}`),r.style.setProperty("--_box-shift",`${d}`),r.style.setProperty("--_box-width",`${a.box.width}px`);const u=Math.round(Y(this,an))-Math.round(s*n);Math.abs(u)<1&&s>.01&&s<.99||(Oe(this,an,s*n),se(this,pn,yi).call(this,Y(this,an)))};pn=new WeakSet;yi=function(t){this.dispatchEvent(new c.CustomEvent(w.MEDIA_PREVIEW_REQUEST,{composed:!0,bubbles:!0,detail:t}))};ur=new WeakSet;mo=function(){Y(this,ct).stop();const t=fo(this);this.dispatchEvent(new c.CustomEvent(w.MEDIA_SEEK_REQUEST,{composed:!0,bubbles:!0,detail:t}))};c.customElements.get("media-time-range")||c.customElements.define("media-time-range",fu);const bt={PLACEMENT:"placement",BOUNDS:"bounds"},Eo=D.createElement("template");Eo.innerHTML=`
`;class Eu extends c.HTMLElement{constructor(){if(super(),this.updateXOffset=()=>{var e;if(!rs(this,{checkOpacity:!1,checkVisibilityCSS:!1}))return;const n=this.placement;if(n==="left"||n==="right"){this.style.removeProperty("--media-tooltip-offset-x");return}const i=getComputedStyle(this),r=(e=vn(this,"#"+this.bounds))!=null?e:Jo(this);if(!r)return;const{x:a,width:s}=r.getBoundingClientRect(),{x:o,width:d}=this.getBoundingClientRect(),u=o+d,E=a+s,h=i.getPropertyValue("--media-tooltip-offset-x"),m=h?parseFloat(h.replace("px","")):0,p=i.getPropertyValue("--media-tooltip-container-margin"),_=p?parseFloat(p.replace("px","")):0,S=o-a+m-_,I=u-E+m+_;if(S<0){this.style.setProperty("--media-tooltip-offset-x",`${S}px`);return}if(I>0){this.style.setProperty("--media-tooltip-offset-x",`${I}px`);return}this.style.removeProperty("--media-tooltip-offset-x")},this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(Eo.content.cloneNode(!0))),this.arrowEl=this.shadowRoot.querySelector("#arrow"),Object.prototype.hasOwnProperty.call(this,"placement")){const e=this.placement;delete this.placement,this.placement=e}}static get observedAttributes(){return[bt.PLACEMENT,bt.BOUNDS]}get placement(){return de(this,bt.PLACEMENT)}set placement(e){ue(this,bt.PLACEMENT,e)}get bounds(){return de(this,bt.BOUNDS)}set bounds(e){ue(this,bt.BOUNDS,e)}}c.customElements.get("media-tooltip")||c.customElements.define("media-tooltip",Eu);const vu=1,gu=t=>t.mediaMuted?0:t.mediaVolume,bu=t=>`${Math.round(t*100)}%`;class _u extends Sr{static get observedAttributes(){return[...super.observedAttributes,l.MEDIA_VOLUME,l.MEDIA_MUTED,l.MEDIA_VOLUME_UNAVAILABLE]}constructor(){super(),this.range.addEventListener("input",()=>{const e=this.range.value,n=new c.CustomEvent(w.MEDIA_VOLUME_REQUEST,{composed:!0,bubbles:!0,detail:e});this.dispatchEvent(n)})}connectedCallback(){super.connectedCallback(),this.range.setAttribute("aria-label",tt.VOLUME())}attributeChangedCallback(e,n,i){super.attributeChangedCallback(e,n,i),(e===l.MEDIA_VOLUME||e===l.MEDIA_MUTED)&&(this.range.valueAsNumber=gu(this),this.range.setAttribute("aria-valuetext",bu(this.range.valueAsNumber)),this.updateBar())}get mediaVolume(){return G(this,l.MEDIA_VOLUME,vu)}set mediaVolume(e){oe(this,l.MEDIA_VOLUME,e)}get mediaMuted(){return Q(this,l.MEDIA_MUTED)}set mediaMuted(e){z(this,l.MEDIA_MUTED,e)}get mediaVolumeUnavailable(){return de(this,l.MEDIA_VOLUME_UNAVAILABLE)}set mediaVolumeUnavailable(e){ue(this,l.MEDIA_VOLUME_UNAVAILABLE,e)}}c.customElements.get("media-volume-range")||c.customElements.define("media-volume-range",_u);/*! @vimeo/player v2.23.0 | (c) 2024 Vimeo | MIT License | https://github.com/vimeo/player.js */function La(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,i)}return n}function Ra(t){for(var e=1;e=0;--L){var T=this.tryEntries[L],O=T.completion;if(T.tryLoc==="root")return b("end");if(T.tryLoc<=this.prev){var F=n.call(T,"catchLoc"),re=n.call(T,"finallyLoc");if(F&&re){if(this.prev=0;--b){var L=this.tryEntries[b];if(L.tryLoc<=this.prev&&n.call(L,"finallyLoc")&&this.prev=0;--f){var b=this.tryEntries[f];if(b.finallyLoc===v)return this.complete(b.completion,b.afterLoc),M(b),h}},catch:function(v){for(var f=this.tryEntries.length-1;f>=0;--f){var b=this.tryEntries[f];if(b.tryLoc===v){var L=b.completion;if(L.type==="throw"){var T=L.arg;M(b)}return T}}throw new Error("illegal catch attempt")},delegateYield:function(v,f,b){return this.delegate={iterator:ce(v),resultName:f,nextLoc:b},this.method==="next"&&(this.arg=void 0),h}},t}function Ca(t,e,n,i,r,a,s){try{var o=t[a](s),d=o.value}catch(u){n(u);return}o.done?e(d):Promise.resolve(d).then(i,r)}function ot(t){return function(){var e=this,n=arguments;return new Promise(function(i,r){var a=t.apply(e,n);function s(d){Ca(a,i,r,s,o,"next",d)}function o(d){Ca(a,i,r,s,o,"throw",d)}s(void 0)})}}function vo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function yu(t,e){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function si(t,e,n){return bo()?si=Reflect.construct.bind():si=function(r,a,s){var o=[null];o.push.apply(o,a);var d=Function.bind.apply(r,o),u=new d;return s&&En(u,s.prototype),u},si.apply(null,arguments)}function wu(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function cr(t){var e=typeof Map=="function"?new Map:void 0;return cr=function(i){if(i===null||!wu(i))return i;if(typeof i!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(i))return e.get(i);e.set(i,r)}function r(){return si(i,arguments,fn(this).constructor)}return r.prototype=Object.create(i.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),En(r,i)},cr(t)}function oi(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Tu(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return oi(t)}function Iu(t){var e=bo();return function(){var i=fn(t),r;if(e){var a=fn(this).constructor;r=Reflect.construct(i,arguments,a)}else r=i.apply(this,arguments);return Tu(this,r)}}function Su(t,e){if(typeof t!="object"||t===null)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function _o(t){var e=Su(t,"string");return typeof e=="symbol"?e:String(e)}var yo=typeof global<"u"&&{}.toString.call(global)==="[object global]";function Da(t,e){return t.indexOf(e.toLowerCase())===0?t:"".concat(e.toLowerCase()).concat(t.substr(0,1).toUpperCase()).concat(t.substr(1))}function ku(t){return!!(t&&t.nodeType===1&&"nodeName"in t&&t.ownerDocument&&t.ownerDocument.defaultView)}function Mu(t){return!isNaN(parseFloat(t))&&isFinite(t)&&Math.floor(t)==t}function mt(t){return/^(https?:)?\/\/((((player|www)\.)?vimeo\.com)|((player\.)?[a-zA-Z0-9-]+\.videoji\.hk))(?=$|\/)/.test(t)}function Ao(t){var e=/^https:\/\/player\.((vimeo\.com)|([a-zA-Z0-9-]+\.videoji\.hk))\/video\/\d+/;return e.test(t)}function Lu(t){var e=(t||"").match(/^(?:https?:)?(?:\/\/)?([^/?]+)/),n=(e&&e[1]||"").replace("player.","");return n.endsWith(".videoji.hk")?n:"vimeo.com"}function wo(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.id,n=t.url,i=e||n;if(!i)throw new Error("An id or url must be passed, either in an options object or as a data-vimeo-id or data-vimeo-url attribute.");if(Mu(i))return"https://vimeo.com/".concat(i);if(mt(i))return i.replace("http:","https:");throw e?new TypeError("“".concat(e,"” is not a valid video id.")):new TypeError("“".concat(i,"” is not a vimeo.com url."))}var Pa=function(e,n,i){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"addEventListener",a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:"removeEventListener",s=typeof n=="string"?[n]:n;return s.forEach(function(o){e[r](o,i)}),{cancel:function(){return s.forEach(function(d){return e[a](d,i)})}}},Ru=typeof Array.prototype.indexOf<"u",Cu=typeof window<"u"&&typeof window.postMessage<"u";if(!yo&&(!Ru||!Cu))throw new Error("Sorry, the Vimeo Player API is not available in this browser.");var Ot=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Du(t,e){return e={exports:{}},t(e,e.exports),e.exports}/*! * weakmap-polyfill v2.0.4 - ECMAScript6 WeakMap polyfill * https://github.com/polygonplanet/weakmap-polyfill * Copyright (c) 2015-2021 polygonplanet * @license MIT */(function(t){if(t.WeakMap)return;var e=Object.prototype.hasOwnProperty,n=Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{value:1}).x===1}catch{}}(),i=function(a,s,o){n?Object.defineProperty(a,s,{configurable:!0,writable:!0,value:o}):a[s]=o};t.WeakMap=function(){function a(){if(this===void 0)throw new TypeError("Constructor WeakMap requires 'new'");if(i(this,"_id",o("_WeakMap")),arguments.length>0)throw new TypeError("WeakMap iterable is not supported")}i(a.prototype,"delete",function(u){if(s(this,"delete"),!r(u))return!1;var E=u[this._id];return E&&E[0]===u?(delete u[this._id],!0):!1}),i(a.prototype,"get",function(u){if(s(this,"get"),!!r(u)){var E=u[this._id];if(E&&E[0]===u)return E[1]}}),i(a.prototype,"has",function(u){if(s(this,"has"),!r(u))return!1;var E=u[this._id];return!!(E&&E[0]===u)}),i(a.prototype,"set",function(u,E){if(s(this,"set"),!r(u))throw new TypeError("Invalid value used as weak map key");var h=u[this._id];return h&&h[0]===u?(h[1]=E,this):(i(u,this._id,[u,E]),this)});function s(u,E){if(!r(u)||!e.call(u,"_id"))throw new TypeError(E+" method called on incompatible receiver "+typeof u)}function o(u){return u+"_"+d()+"."+d()}function d(){return Math.random().toString().substring(2)}return i(a,"_polyfill",!0),a}();function r(a){return Object(a)===a}})(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Ot);var be=Du(function(t){/*! Native Promise Only v0.8.1 (c) Kyle Simpson MIT License: http://getify.mit-license.org */(function(n,i,r){i[n]=i[n]||r(),t.exports&&(t.exports=i[n])})("Promise",Ot,function(){var n,i,r,a=Object.prototype.toString,s=typeof setImmediate<"u"?function(g){return setImmediate(g)}:setTimeout;try{Object.defineProperty({},"x",{}),n=function(g,A,k,C){return Object.defineProperty(g,A,{value:k,writable:!0,configurable:C!==!1})}}catch{n=function(A,k,C){return A[k]=C,A}}r=function(){var g,A,k;function C($,M){this.fn=$,this.self=M,this.next=void 0}return{add:function(M,ie){k=new C(M,ie),A?A.next=k:g=k,A=k,k=void 0},drain:function(){var M=g;for(g=A=i=void 0;M;)M.fn.call(M.self),M=M.next}}}();function o(y,g){r.add(y,g),i||(i=s(r.drain))}function d(y){var g,A=typeof y;return y!=null&&(A=="object"||A=="function")&&(g=y.then),typeof g=="function"?g:!1}function u(){for(var y=0;y0&&o(u,A))}catch(k){m.call(new _(A),k)}}}function m(y){var g=this;g.triggered||(g.triggered=!0,g.def&&(g=g.def),g.msg=y,g.state=2,g.chain.length>0&&o(u,g))}function p(y,g,A,k){for(var C=0;C=8&&r<10&&(i=JSON.stringify(i)),t.element.contentWindow.postMessage(i,t.origin)}}function Uu(t,e){e=Li(e);var n=[],i;if(e.event){if(e.event==="error"){var r=Ai(t,e.data.method);r.forEach(function(s){var o=new Error(e.data.message);o.name=e.data.name,s.reject(o),wi(t,e.data.method,s)})}n=Ai(t,"event:".concat(e.event)),i=e.data}else if(e.method){var a=Pu(t,e.method);a&&(n.push(a),i=e.value)}n.forEach(function(s){try{if(typeof s=="function"){s.call(t,i);return}s.resolve(i)}catch{}})}var Ou=["airplay","audio_tracks","autopause","autoplay","background","byline","cc","chapter_id","chapters","chromecast","color","colors","controls","dnt","end_time","fullscreen","height","id","interactive_params","keyboard","loop","maxheight","maxwidth","muted","play_button_position","playsinline","portrait","progress_bar","quality_selector","responsive","speed","start_time","texttrack","title","transcript","transparent","url","vimeo_logo","volume","watch_full_video","width"];function To(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Ou.reduce(function(n,i){var r=t.getAttribute("data-vimeo-".concat(i));return(r||r==="")&&(n[i]=r===""?1:r),n},e)}function Pr(t,e){var n=t.html;if(!e)throw new TypeError("An element must be provided");if(e.getAttribute("data-vimeo-initialized")!==null)return e.querySelector("iframe");var i=document.createElement("div");return i.innerHTML=n,e.appendChild(i.firstChild),e.setAttribute("data-vimeo-initialized","true"),e.querySelector("iframe")}function Io(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise(function(i,r){if(!mt(t))throw new TypeError("“".concat(t,"” is not a vimeo.com url."));var a=Lu(t),s="https://".concat(a,"/api/oembed.json?url=").concat(encodeURIComponent(t));for(var o in e)e.hasOwnProperty(o)&&(s+="&".concat(o,"=").concat(encodeURIComponent(e[o])));var d="XDomainRequest"in window?new XDomainRequest:new XMLHttpRequest;d.open("GET",s,!0),d.onload=function(){if(d.status===404){r(new Error("“".concat(t,"” was not found.")));return}if(d.status===403){r(new Error("“".concat(t,"” is not embeddable.")));return}try{var u=JSON.parse(d.responseText);if(u.domain_status_code===403){Pr(u,n),r(new Error("“".concat(t,"” is not embeddable.")));return}i(u)}catch(E){r(E)}},d.onerror=function(){var u=d.status?" (".concat(d.status,")"):"";r(new Error("There was an error fetching the embed code from Vimeo".concat(u,".")))},d.send()})}function Nu(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,e=[].slice.call(t.querySelectorAll("[data-vimeo-id], [data-vimeo-url]")),n=function(r){"console"in window&&console.error&&console.error("There was an error creating an embed: ".concat(r))};e.forEach(function(i){try{if(i.getAttribute("data-vimeo-defer")!==null)return;var r=To(i),a=wo(r);Io(a,r,i).then(function(s){return Pr(s,i)}).catch(n)}catch(s){n(s)}})}function $u(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;if(!window.VimeoPlayerResizeEmbeds_){window.VimeoPlayerResizeEmbeds_=!0;var e=function(i){if(mt(i.origin)&&!(!i.data||i.data.event!=="spacechange")){for(var r=t.querySelectorAll("iframe"),a=0;a0&&arguments[0]!==void 0?arguments[0]:document;if(!window.VimeoSeoMetadataAppended){window.VimeoSeoMetadataAppended=!0;var e=function(i){if(mt(i.origin)){var r=Li(i.data);if(!(!r||r.event!=="ready"))for(var a=t.querySelectorAll("iframe"),s=0;s0&&arguments[0]!==void 0?arguments[0]:document;if(!window.VimeoCheckedUrlTimeParam){window.VimeoCheckedUrlTimeParam=!0;var e=function(r){"console"in window&&console.error&&console.error("There was an error getting video Id: ".concat(r))},n=function(r){if(mt(r.origin)){var a=Li(r.data);if(!(!a||a.event!=="ready"))for(var s=t.querySelectorAll("iframe"),o=function(){var E=s[d],h=E.contentWindow===r.source;if(Ao(E.src)&&h){var m=new xr(E);m.getVideoId().then(function(p){var _=new RegExp("[?&]vimeo_t_".concat(p,"=([^&#]*)")).exec(window.location.href);if(_&&_[1]){var S=decodeURI(_[1]);m.setCurrentTime(S)}}).catch(e)}},d=0;d2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;return vo(this,n),a=e.call(this),ai(oi(a),"logger",void 0),ai(oi(a),"speedAdjustment",0),ai(oi(a),"adjustSpeed",function(){var d=ot(he().mark(function u(E,h){var m;return he().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(a.speedAdjustment!==h){_.next=2;break}return _.abrupt("return");case 2:return _.next=4,E.getPlaybackRate();case 4:return _.t0=_.sent,_.t1=a.speedAdjustment,_.t2=_.t0-_.t1,_.t3=h,m=_.t2+_.t3,a.log("New playbackRate: ".concat(m)),_.next=12,E.setPlaybackRate(m);case 12:a.speedAdjustment=h;case 13:case"end":return _.stop()}},u)}));return function(u,E){return d.apply(this,arguments)}}()),a.logger=o,a.init(r,i,Ra(Ra({},Wu),s)),a}return go(n,[{key:"disconnect",value:function(){this.dispatchEvent(new Event("disconnect"))}},{key:"init",value:function(){var i=ot(he().mark(function a(s,o,d){var u=this,E,h,m;return he().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return _.next=2,this.waitForTOReadyState(s,"open");case 2:if(d.role!=="viewer"){_.next=10;break}return _.next=5,this.updatePlayer(s,o,d);case 5:E=Pa(s,"change",function(){return u.updatePlayer(s,o,d)}),h=this.maintainPlaybackPosition(s,o,d),this.addEventListener("disconnect",function(){h.cancel(),E.cancel()}),_.next=14;break;case 10:return _.next=12,this.updateTimingObject(s,o);case 12:m=Pa(o,["seeked","play","pause","ratechange"],function(){return u.updateTimingObject(s,o)},"on","off"),this.addEventListener("disconnect",function(){return m.cancel()});case 14:case"end":return _.stop()}},a,this)}));function r(a,s,o){return i.apply(this,arguments)}return r}()},{key:"updateTimingObject",value:function(){var i=ot(he().mark(function a(s,o){return he().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.t0=s,u.next=3,o.getCurrentTime();case 3:return u.t1=u.sent,u.next=6,o.getPaused();case 6:if(!u.sent){u.next=10;break}u.t2=0,u.next=13;break;case 10:return u.next=12,o.getPlaybackRate();case 12:u.t2=u.sent;case 13:u.t3=u.t2,u.t4={position:u.t1,velocity:u.t3},u.t0.update.call(u.t0,u.t4);case 16:case"end":return u.stop()}},a)}));function r(a,s){return i.apply(this,arguments)}return r}()},{key:"updatePlayer",value:function(){var i=ot(he().mark(function a(s,o,d){var u,E,h;return he().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:if(u=s.query(),E=u.position,h=u.velocity,typeof E=="number"&&o.setCurrentTime(E),typeof h!="number"){p.next=25;break}if(h!==0){p.next=11;break}return p.next=6,o.getPaused();case 6:if(p.t0=p.sent,p.t0!==!1){p.next=9;break}o.pause();case 9:p.next=25;break;case 11:if(!(h>0)){p.next=25;break}return p.next=14,o.getPaused();case 14:if(p.t1=p.sent,p.t1!==!0){p.next=19;break}return p.next=18,o.play().catch(function(){var _=ot(he().mark(function S(I){return he().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:if(!(I.name==="NotAllowedError"&&d.autoPlayMuted)){y.next=5;break}return y.next=3,o.setMuted(!0);case 3:return y.next=5,o.play().catch(function(g){return console.error("Couldn't play the video from TimingSrcConnector. Error:",g)});case 5:case"end":return y.stop()}},S)}));return function(S){return _.apply(this,arguments)}}());case 18:this.updatePlayer(s,o,d);case 19:return p.next=21,o.getPlaybackRate();case 21:if(p.t2=p.sent,p.t3=h,p.t2===p.t3){p.next=25;break}o.setPlaybackRate(h);case 25:case"end":return p.stop()}},a,this)}));function r(a,s,o){return i.apply(this,arguments)}return r}()},{key:"maintainPlaybackPosition",value:function(r,a,s){var o=this,d=s.allowedDrift,u=s.maxAllowedDrift,E=s.minCheckInterval,h=s.maxRateAdjustment,m=s.maxTimeToCatchUp,p=Math.min(m,Math.max(E,u))*1e3,_=function(){var I=ot(he().mark(function R(){var y,g,A,k,C;return he().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:if(M.t0=r.query().velocity===0,M.t0){M.next=6;break}return M.next=4,a.getPaused();case 4:M.t1=M.sent,M.t0=M.t1===!0;case 6:if(!M.t0){M.next=8;break}return M.abrupt("return");case 8:return M.t2=r.query().position,M.next=11,a.getCurrentTime();case 11:if(M.t3=M.sent,y=M.t2-M.t3,g=Math.abs(y),o.log("Drift: ".concat(y)),!(g>u)){M.next=22;break}return M.next=18,o.adjustSpeed(a,0);case 18:a.setCurrentTime(r.query().position),o.log("Resync by currentTime"),M.next=29;break;case 22:if(!(g>d)){M.next=29;break}return A=g/m,k=h,C=A1&&arguments[1]!==void 0?arguments[1]:{};if(vo(this,t),window.jQuery&&e instanceof jQuery&&(e.length>1&&window.console&&console.warn&&console.warn("A jQuery object with multiple elements was passed, using the first element."),e=e[0]),typeof document<"u"&&typeof e=="string"&&(e=document.getElementById(e)),!ku(e))throw new TypeError("You must pass either a valid element or a valid id.");if(e.nodeName!=="IFRAME"){var r=e.querySelector("iframe");r&&(e=r)}if(e.nodeName==="IFRAME"&&!mt(e.getAttribute("src")||""))throw new Error("The player element passed isn’t a Vimeo embed.");if(_t.has(e))return _t.get(e);this._window=e.ownerDocument.defaultView,this.element=e,this.origin="*";var a=new be(function(o,d){if(n._onMessage=function(h){if(!(!mt(h.origin)||n.element.contentWindow!==h.source)){n.origin==="*"&&(n.origin=h.origin);var m=Li(h.data),p=m&&m.event==="error",_=p&&m.data&&m.data.method==="ready";if(_){var S=new Error(m.data.message);S.name=m.data.name,d(S);return}var I=m&&m.event==="ready",R=m&&m.method==="ping";if(I||R){n.element.setAttribute("data-ready","true"),o();return}Uu(n,m)}},n._window.addEventListener("message",n._onMessage),n.element.nodeName!=="IFRAME"){var u=To(e,i),E=wo(u);Io(E,u,e).then(function(h){var m=Pr(h,e);return n.element=m,n._originalElement=e,xu(e,m),_t.set(n.element,n),h}).catch(d)}});if(xi.set(this,a),_t.set(this.element,this),this.element.nodeName==="IFRAME"&&rt(this,"ping"),pe.isEnabled){var s=function(){return pe.exit()};this.fullscreenchangeHandler=function(){pe.isFullscreen?Kt(n,"event:exitFullscreen",s):wi(n,"event:exitFullscreen",s),n.ready().then(function(){rt(n,"fullscreenchange",pe.isFullscreen)})},pe.on("fullscreenchange",this.fullscreenchangeHandler)}return this}return go(t,[{key:"callMethod",value:function(n){var i=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new be(function(a,s){return i.ready().then(function(){Kt(i,n,{resolve:a,reject:s}),rt(i,n,r)}).catch(s)})}},{key:"get",value:function(n){var i=this;return new be(function(r,a){return n=Da(n,"get"),i.ready().then(function(){Kt(i,n,{resolve:r,reject:a}),rt(i,n)}).catch(a)})}},{key:"set",value:function(n,i){var r=this;return new be(function(a,s){if(n=Da(n,"set"),i==null)throw new TypeError("There must be a value to set.");return r.ready().then(function(){Kt(r,n,{resolve:a,reject:s}),rt(r,n,i)}).catch(s)})}},{key:"on",value:function(n,i){if(!n)throw new TypeError("You must pass an event name.");if(!i)throw new TypeError("You must pass a callback function.");if(typeof i!="function")throw new TypeError("The callback must be a function.");var r=Ai(this,"event:".concat(n));r.length===0&&this.callMethod("addEventListener",n).catch(function(){}),Kt(this,"event:".concat(n),i)}},{key:"off",value:function(n,i){if(!n)throw new TypeError("You must pass an event name.");if(i&&typeof i!="function")throw new TypeError("The callback must be a function.");var r=wi(this,"event:".concat(n),i);r&&this.callMethod("removeEventListener",n).catch(function(a){})}},{key:"loadVideo",value:function(n){return this.callMethod("loadVideo",n)}},{key:"ready",value:function(){var n=xi.get(this)||new be(function(i,r){r(new Error("Unknown player. Probably unloaded."))});return be.resolve(n)}},{key:"addCuePoint",value:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.callMethod("addCuePoint",{time:n,data:i})}},{key:"removeCuePoint",value:function(n){return this.callMethod("removeCuePoint",n)}},{key:"enableTextTrack",value:function(n,i){if(!n)throw new TypeError("You must pass a language.");return this.callMethod("enableTextTrack",{language:n,kind:i})}},{key:"disableTextTrack",value:function(){return this.callMethod("disableTextTrack")}},{key:"pause",value:function(){return this.callMethod("pause")}},{key:"play",value:function(){return this.callMethod("play")}},{key:"requestFullscreen",value:function(){return pe.isEnabled?pe.request(this.element):this.callMethod("requestFullscreen")}},{key:"exitFullscreen",value:function(){return pe.isEnabled?pe.exit():this.callMethod("exitFullscreen")}},{key:"getFullscreen",value:function(){return pe.isEnabled?be.resolve(pe.isFullscreen):this.get("fullscreen")}},{key:"requestPictureInPicture",value:function(){return this.callMethod("requestPictureInPicture")}},{key:"exitPictureInPicture",value:function(){return this.callMethod("exitPictureInPicture")}},{key:"getPictureInPicture",value:function(){return this.get("pictureInPicture")}},{key:"remotePlaybackPrompt",value:function(){return this.callMethod("remotePlaybackPrompt")}},{key:"unload",value:function(){return this.callMethod("unload")}},{key:"destroy",value:function(){var n=this;return new be(function(i){if(xi.delete(n),_t.delete(n.element),n._originalElement&&(_t.delete(n._originalElement),n._originalElement.removeAttribute("data-vimeo-initialized")),n.element&&n.element.nodeName==="IFRAME"&&n.element.parentNode&&(n.element.parentNode.parentNode&&n._originalElement&&n._originalElement!==n.element.parentNode?n.element.parentNode.parentNode.removeChild(n.element.parentNode):n.element.parentNode.removeChild(n.element)),n.element&&n.element.nodeName==="DIV"&&n.element.parentNode){n.element.removeAttribute("data-vimeo-initialized");var r=n.element.querySelector("iframe");r&&r.parentNode&&(r.parentNode.parentNode&&n._originalElement&&n._originalElement!==r.parentNode?r.parentNode.parentNode.removeChild(r.parentNode):r.parentNode.removeChild(r))}n._window.removeEventListener("message",n._onMessage),pe.isEnabled&&pe.off("fullscreenchange",n.fullscreenchangeHandler),i()})}},{key:"getAutopause",value:function(){return this.get("autopause")}},{key:"setAutopause",value:function(n){return this.set("autopause",n)}},{key:"getBuffered",value:function(){return this.get("buffered")}},{key:"getCameraProps",value:function(){return this.get("cameraProps")}},{key:"setCameraProps",value:function(n){return this.set("cameraProps",n)}},{key:"getChapters",value:function(){return this.get("chapters")}},{key:"getCurrentChapter",value:function(){return this.get("currentChapter")}},{key:"getColor",value:function(){return this.get("color")}},{key:"getColors",value:function(){return be.all([this.get("colorOne"),this.get("colorTwo"),this.get("colorThree"),this.get("colorFour")])}},{key:"setColor",value:function(n){return this.set("color",n)}},{key:"setColors",value:function(n){if(!Array.isArray(n))return new be(function(a,s){return s(new TypeError("Argument must be an array."))});var i=new be(function(a){return a(null)}),r=[n[0]?this.set("colorOne",n[0]):i,n[1]?this.set("colorTwo",n[1]):i,n[2]?this.set("colorThree",n[2]):i,n[3]?this.set("colorFour",n[3]):i];return be.all(r)}},{key:"getCuePoints",value:function(){return this.get("cuePoints")}},{key:"getCurrentTime",value:function(){return this.get("currentTime")}},{key:"setCurrentTime",value:function(n){return this.set("currentTime",n)}},{key:"getDuration",value:function(){return this.get("duration")}},{key:"getEnded",value:function(){return this.get("ended")}},{key:"getLoop",value:function(){return this.get("loop")}},{key:"setLoop",value:function(n){return this.set("loop",n)}},{key:"setMuted",value:function(n){return this.set("muted",n)}},{key:"getMuted",value:function(){return this.get("muted")}},{key:"getPaused",value:function(){return this.get("paused")}},{key:"getPlaybackRate",value:function(){return this.get("playbackRate")}},{key:"setPlaybackRate",value:function(n){return this.set("playbackRate",n)}},{key:"getPlayed",value:function(){return this.get("played")}},{key:"getQualities",value:function(){return this.get("qualities")}},{key:"getQuality",value:function(){return this.get("quality")}},{key:"setQuality",value:function(n){return this.set("quality",n)}},{key:"getRemotePlaybackAvailability",value:function(){return this.get("remotePlaybackAvailability")}},{key:"getRemotePlaybackState",value:function(){return this.get("remotePlaybackState")}},{key:"getSeekable",value:function(){return this.get("seekable")}},{key:"getSeeking",value:function(){return this.get("seeking")}},{key:"getTextTracks",value:function(){return this.get("textTracks")}},{key:"getVideoEmbedCode",value:function(){return this.get("videoEmbedCode")}},{key:"getVideoId",value:function(){return this.get("videoId")}},{key:"getVideoTitle",value:function(){return this.get("videoTitle")}},{key:"getVideoWidth",value:function(){return this.get("videoWidth")}},{key:"getVideoHeight",value:function(){return this.get("videoHeight")}},{key:"getVideoUrl",value:function(){return this.get("videoUrl")}},{key:"getVolume",value:function(){return this.get("volume")}},{key:"setVolume",value:function(n){return this.set("volume",n)}},{key:"setTimingSrc",value:function(){var e=ot(he().mark(function i(r,a){var s=this,o;return he().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(r){u.next=2;break}throw new TypeError("A Timing Object must be provided.");case 2:return u.next=4,this.ready();case 4:return o=new Hu(this,r,a),rt(this,"notifyTimingObjectConnect"),o.addEventListener("disconnect",function(){return rt(s,"notifyTimingObjectDisconnect")}),u.abrupt("return",o);case 8:case"end":return u.stop()}},i,this)}));function n(i,r){return e.apply(this,arguments)}return n}()}]),t}();yo||(pe=Vu(),Nu(),$u(),Fu(),Bu());const qu="https://player.vimeo.com/video",Gu=/vimeo\.com\/(?:video\/)?(\d+)(?:\/([\w-]+))?/;function xa(t){const e={src:Ku(t),frameborder:0,width:"100%",height:"100%",allow:"accelerometer; fullscreen; autoplay; encrypted-media; gyroscope; picture-in-picture"};return` `}function Ku(t){if(!t.src)return;const e=t.src.match(Gu),n=e&&e[1],i=e&&e[2],r={controls:t.controls===""?null:0,autoplay:t.autoplay,loop:t.loop,muted:t.muted,playsinline:t.playsinline,preload:t.preload??"metadata",transparent:!1,autopause:t.autopause,h:i};return`${qu}/${n}?${zu(r)}`}class Yu extends(globalThis.HTMLElement??class{}){static getTemplateHTML=xa;static shadowRootOptions={mode:"open"};static observedAttributes=["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src"];loadComplete=new Ua;#r;#a;#i;#t=0;#e=NaN;#s=!1;#n=!this.autoplay;#d=1;#u=0;#o=0;#c=!1;#l=1;#h=NaN;#m=NaN;async load(){if(this.#r)return;this.#a&&(this.loadComplete=new Ua),this.#a=!0,await(this.#r=Promise.resolve()),this.#r=null,this.#t=0,this.#e=NaN,this.#s=!1,this.#n=!this.autoplay,this.#d=1,this.#u=0,this.#o=0,this.#c=!1,this.#l=1,this.#o=0,this.#h=NaN,this.#m=NaN,this.dispatchEvent(new Event("emptied"));let e=this.api;if(this.api=null,!this.src)return;this.dispatchEvent(new Event("loadstart"));const n={autoplay:this.autoplay,controls:this.controls,loop:this.loop,muted:this.defaultMuted,playsinline:this.playsInline,preload:this.preload??"metadata",transparent:!1,autopause:this.hasAttribute("autopause")},i=async()=>{this.#o=1,this.dispatchEvent(new Event("loadedmetadata")),this.api&&(this.#s=await this.api.getMuted(),this.#l=await this.api.getVolume(),this.dispatchEvent(new Event("volumechange")),this.#e=await this.api.getDuration(),this.dispatchEvent(new Event("durationchange"))),this.dispatchEvent(new Event("loadcomplete")),this.loadComplete.resolve()};if(this.#i){this.api=e,await this.api.loadVideo({...n,url:this.src}),await i(),await this.loadComplete;return}this.#i=!0,this.shadowRoot||(this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=xa(ju(this.attributes)));let r=this.shadowRoot.querySelector("iframe");this.api=new xr(r);const a=()=>{this.api.off("loaded",a),i()};this.api.on("loaded",a),this.api.on("bufferstart",()=>{this.#n&&(this.#n=!1,this.dispatchEvent(new Event("play"))),this.dispatchEvent(new Event("waiting"))}),this.api.on("play",()=>{this.#n&&(this.#n=!1,this.dispatchEvent(new Event("play")))}),this.api.on("playing",()=>{this.#o=3,this.#n=!1,this.dispatchEvent(new Event("playing"))}),this.api.on("seeking",()=>{this.#c=!0,this.dispatchEvent(new Event("seeking"))}),this.api.on("seeked",()=>{this.#c=!1,this.dispatchEvent(new Event("seeked"))}),this.api.on("pause",()=>{this.#n=!0,this.dispatchEvent(new Event("pause"))}),this.api.on("ended",()=>{this.#n=!0,this.dispatchEvent(new Event("ended"))}),this.api.on("ratechange",({playbackRate:s})=>{this.#d=s,this.dispatchEvent(new Event("ratechange"))}),this.api.on("volumechange",async({volume:s})=>{this.#l=s,this.api&&(this.#s=await this.api.getMuted()),this.dispatchEvent(new Event("volumechange"))}),this.api.on("durationchange",({duration:s})=>{this.#e=s,this.dispatchEvent(new Event("durationchange"))}),this.api.on("timeupdate",({seconds:s})=>{this.#t=s,this.dispatchEvent(new Event("timeupdate"))}),this.api.on("progress",({seconds:s})=>{this.#u=s,this.dispatchEvent(new Event("progress"))}),this.api.on("resize",({videoWidth:s,videoHeight:o})=>{this.#h=s,this.#m=o,this.dispatchEvent(new Event("resize"))}),await this.loadComplete}async attributeChangedCallback(e,n,i){if(n!==i){switch(e){case"autoplay":case"controls":case"src":{this.load();return}}switch(await this.loadComplete,e){case"loop":{this.api.setLoop(this.loop);break}}}}async play(){var e;this.#n=!1,this.dispatchEvent(new Event("play")),await this.loadComplete;try{await((e=this.api)==null?void 0:e.play())}catch(n){throw this.#n=!0,this.dispatchEvent(new Event("pause")),n}}async pause(){var e;return await this.loadComplete,(e=this.api)==null?void 0:e.pause()}get ended(){return this.#t>=this.#e}get seeking(){return this.#c}get readyState(){return this.#o}get videoWidth(){return this.#h}get videoHeight(){return this.#m}get src(){return this.getAttribute("src")}set src(e){this.src!=e&&this.setAttribute("src",e)}get paused(){return this.#n}get duration(){return this.#e}get autoplay(){return this.hasAttribute("autoplay")}set autoplay(e){this.autoplay!=e&&this.toggleAttribute("autoplay",!!e)}get buffered(){return this.#u>0?Oa(0,this.#u):Oa()}get controls(){return this.hasAttribute("controls")}set controls(e){this.controls!=e&&this.toggleAttribute("controls",!!e)}get currentTime(){return this.#t}set currentTime(e){this.currentTime!=e&&(this.#t=e,this.loadComplete.then(()=>{var n;(n=this.api)==null||n.setCurrentTime(e)}))}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(e){this.defaultMuted!=e&&this.toggleAttribute("muted",!!e)}get loop(){return this.hasAttribute("loop")}set loop(e){this.loop!=e&&this.toggleAttribute("loop",!!e)}get muted(){return this.#s}set muted(e){this.muted!=e&&(this.#s=e,this.loadComplete.then(()=>{var n;(n=this.api)==null||n.setMuted(e)}))}get playbackRate(){return this.#d}set playbackRate(e){this.playbackRate!=e&&(this.#d=e,this.loadComplete.then(()=>{var n;(n=this.api)==null||n.setPlaybackRate(e)}))}get playsInline(){return this.hasAttribute("playsinline")}set playsInline(e){this.playsInline!=e&&this.toggleAttribute("playsinline",!!e)}get poster(){return this.getAttribute("poster")}set poster(e){this.poster!=e&&this.setAttribute("poster",`${e}`)}get volume(){return this.#l}set volume(e){this.volume!=e&&(this.#l=e,this.loadComplete.then(()=>{var n;(n=this.api)==null||n.setVolume(e)}))}}function Qu(t){let e="";for(const n in t){const i=t[n];i===""?e+=` ${n}`:e+=` ${n}="${i}"`}return e}function zu(t){return String(new URLSearchParams(Xu(t)))}function Xu(t){let e={};for(let n in t){let i=t[n];i===!0||i===""?e[n]=1:i===!1?e[n]=0:i!=null&&(e[n]=i)}return e}function ju(t){let e={};for(let n of t)e[n.name]=n.value;return e}let Ua=class extends Promise{constructor(e=()=>{}){let n,i;super((r,a)=>{e(r,a),n=r,i=a}),this.resolve=n,this.reject=i}};function Oa(t,e){return Array.isArray(t)?Ui(t):t==null||e==null||t===0&&e===0?Ui([[0,0]]):Ui([[t,e]])}function Ui(t){return Object.defineProperties(t,{start:{value:e=>t[e][0]},end:{value:e=>t[e][1]}}),t}globalThis.customElements&&!globalThis.customElements.get("vimeo-video")&&globalThis.customElements.define("vimeo-video",Yu);const Zu="https://www.youtube.com/embed",Ju="https://www.youtube.com/iframe_api",ec="YT",tc="onYouTubeIframeAPIReady",nc=/(?:youtu\.be\/|youtube\.com\/(?:shorts\/|embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})/;function Na(t){const e={src:So(t),frameborder:0,width:"100%",height:"100%",allow:"accelerometer; fullscreen; autoplay; encrypted-media; gyroscope; picture-in-picture"};return` `}function So(t){if(!t.src)return;const e=t.src.match(nc),n=e&&e[1],i={controls:t.controls===""?null:0,autoplay:t.autoplay,loop:t.loop,mute:t.muted,playsinline:t.playsinline,preload:t.preload??"metadata",enablejsapi:1,showinfo:0,rel:0,iv_load_policy:3,modestbranding:1};return`${Zu}/${n}?${ac(i)}`}class ic extends(globalThis.HTMLElement??class{}){static getTemplateHTML=Na;static shadowRootOptions={mode:"open"};static observedAttributes=["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src"];loadComplete=new Ni;#r;#a;#i=0;#t=!1;#e;isLoaded=!1;async load(){if(this.#r)return;this.shadowRoot||this.attachShadow({mode:"open"}),this.#a&&(this.loadComplete=new Ni,this.isLoaded=!1),this.#a=!0,await(this.#r=Promise.resolve()),this.#r=null,this.#i=0,this.dispatchEvent(new Event("emptied"));let e=this.api;if(this.api=null,!this.src){e?.destroy();return}this.dispatchEvent(new Event("loadstart"));let n=this.shadowRoot.querySelector("iframe"),i=oc(this.attributes);(!n?.src||n.src!==So(i))&&(this.shadowRoot.innerHTML=Na(i),n=this.shadowRoot.querySelector("iframe"));const r=await lc(Ju,ec,tc);this.api=new r.Player(n,{events:{onReady:()=>{this.#i=1,this.dispatchEvent(new Event("loadedmetadata")),this.dispatchEvent(new Event("durationchange")),this.dispatchEvent(new Event("volumechange")),this.dispatchEvent(new Event("loadcomplete")),this.isLoaded=!0,this.loadComplete.resolve()},onError:u=>console.error(u)}});let a=!1;this.api.addEventListener("onStateChange",u=>{var E;const h=u.data;if((h===r.PlayerState.PLAYING||h===r.PlayerState.BUFFERING)&&(a||(a=!0,this.dispatchEvent(new Event("play")))),h===r.PlayerState.PLAYING)this.seeking&&(this.#t=!1,(E=this.#e)==null||E.resolve(),this.dispatchEvent(new Event("seeked"))),this.#i=3,this.dispatchEvent(new Event("playing"));else if(h===r.PlayerState.PAUSED){const m=Math.abs(this.currentTime-s);!this.seeking&&m>.1&&(this.#t=!0,this.dispatchEvent(new Event("seeking"))),a=!1,this.dispatchEvent(new Event("pause"))}h===r.PlayerState.ENDED&&(a=!1,this.dispatchEvent(new Event("pause")),this.dispatchEvent(new Event("ended")),this.loop&&this.play())}),this.api.addEventListener("onPlaybackRateChange",()=>{this.dispatchEvent(new Event("ratechange"))}),this.api.addEventListener("onVolumeChange",()=>{this.dispatchEvent(new Event("volumechange"))}),this.api.addEventListener("onVideoProgress",()=>{this.dispatchEvent(new Event("timeupdate"))}),await this.loadComplete;let s=0;setInterval(()=>{var u;const E=Math.abs(this.currentTime-s),h=this.buffered.end(this.buffered.length-1);this.seeking&&h>.1?(this.#t=!1,(u=this.#e)==null||u.resolve(),this.dispatchEvent(new Event("seeked"))):!this.seeking&&E>.1&&(this.#t=!0,this.dispatchEvent(new Event("seeking"))),s=this.currentTime},50);let o;const d=setInterval(()=>{const u=this.buffered.end(this.buffered.length-1);u>=this.duration&&(clearInterval(d),this.#i=4),o!=u&&(o=u,this.dispatchEvent(new Event("progress")))},100)}async attributeChangedCallback(e,n,i){if(n!==i)switch(e){case"src":case"autoplay":case"controls":case"loop":case"playsinline":this.load()}}async play(){var e;return this.#e=null,await this.loadComplete,(e=this.api)==null||e.playVideo(),cc(this)}async pause(){var e;return await this.loadComplete,(e=this.api)==null?void 0:e.pauseVideo()}get seeking(){return this.#t}get readyState(){return this.#i}get src(){return this.getAttribute("src")}set src(e){this.src!=e&&this.setAttribute("src",e)}get paused(){var e,n;return this.isLoaded?[-1,0,2,5].includes((n=(e=this.api)==null?void 0:e.getPlayerState)==null?void 0:n.call(e)):!this.autoplay}get duration(){var e,n;return((n=(e=this.api)==null?void 0:e.getDuration)==null?void 0:n.call(e))??NaN}get autoplay(){return this.hasAttribute("autoplay")}set autoplay(e){this.autoplay!=e&&this.toggleAttribute("autoplay",!!e)}get buffered(){var e,n;if(!this.isLoaded)return $i();const i=((e=this.api)==null?void 0:e.getVideoLoadedFraction())*((n=this.api)==null?void 0:n.getDuration());return i>0?$i(0,i):$i()}get controls(){return this.hasAttribute("controls")}set controls(e){this.controls!=e&&this.toggleAttribute("controls",!!e)}get currentTime(){var e,n;return((n=(e=this.api)==null?void 0:e.getCurrentTime)==null?void 0:n.call(e))??0}set currentTime(e){this.currentTime!=e&&(this.#e=new Ni,this.loadComplete.then(()=>{var n,i;(n=this.api)==null||n.seekTo(e,!0),this.paused&&((i=this.#e)==null||i.then(()=>{var r;this.#e&&((r=this.api)==null||r.pauseVideo())}))}))}set defaultMuted(e){this.defaultMuted!=e&&this.toggleAttribute("muted",!!e)}get defaultMuted(){return this.hasAttribute("muted")}get loop(){return this.hasAttribute("loop")}set loop(e){this.loop!=e&&this.toggleAttribute("loop",!!e)}set muted(e){this.muted!=e&&this.loadComplete.then(()=>{var n,i;e?(n=this.api)==null||n.mute():(i=this.api)==null||i.unMute()})}get muted(){var e,n;return this.isLoaded?(n=(e=this.api)==null?void 0:e.isMuted)==null?void 0:n.call(e):this.defaultMuted}get playbackRate(){var e,n;return((n=(e=this.api)==null?void 0:e.getPlaybackRate)==null?void 0:n.call(e))??1}set playbackRate(e){this.playbackRate!=e&&this.loadComplete.then(()=>{var n;(n=this.api)==null||n.setPlaybackRate(e)})}get playsInline(){return this.hasAttribute("playsinline")}set playsInline(e){this.playsInline!=e&&this.toggleAttribute("playsinline",!!e)}get poster(){return this.getAttribute("poster")}set poster(e){this.poster!=e&&this.setAttribute("poster",`${e}`)}set volume(e){this.volume!=e&&this.loadComplete.then(()=>{var n;(n=this.api)==null||n.setVolume(e*100)})}get volume(){var e;return this.isLoaded?((e=this.api)==null?void 0:e.getVolume())/100:1}}function rc(t){let e="";for(const n in t){const i=t[n];i===""?e+=` ${n}`:e+=` ${n}="${i}"`}return e}function ac(t){return String(new URLSearchParams(sc(t)))}function sc(t){let e={};for(let n in t){let i=t[n];i===!0||i===""?e[n]=1:i===!1?e[n]=0:i!=null&&(e[n]=i)}return e}function oc(t){let e={};for(let n of t)e[n.name]=n.value;return e}const Oi={};async function lc(t,e,n){return Oi[t]?Oi[t]:e&&self[e]?(await dc(0),self[e]):Oi[t]=new Promise(function(i,r){const a=document.createElement("script");a.src=t;const s=()=>i(self[e]);self[n]=s,a.onload=()=>!1,a.onerror=r,document.head.append(a)})}const dc=t=>new Promise(e=>setTimeout(e,t));function uc(t){return(...e)=>new Promise(n=>{t(...e,(...i)=>{i.length>1?n(i):n(i[0])})})}function cc(t){return uc((e,n)=>{let i;t.addEventListener(e,i=()=>{t.removeEventListener(e,i),n()})})("playing")}class Ni extends Promise{constructor(e=()=>{}){let n,i;super((r,a)=>{e(r,a),n=r,i=a}),this.resolve=n,this.reject=i}}function $i(t,e){return Array.isArray(t)?Fi(t):t==null||e==null||t===0&&e===0?Fi([[0,0]]):Fi([[t,e]])}function Fi(t){return Object.defineProperties(t,{start:{value:e=>t[e][0]},end:{value:e=>t[e][1]}}),t}globalThis.customElements&&!globalThis.customElements.get("youtube-video")&&globalThis.customElements.define("youtube-video",ic);document.addEventListener("DOMContentLoaded",()=>{const t=document.querySelector("[data-popup]");if(!t)return;const e=t.dataset.popupId,n=Oo(t),i=()=>{n(),t.remove(),sessionStorage.setItem(`popup-${e}`,"closed")};document.querySelector("[data-close-popup]")?.addEventListener("click",i),setTimeout(()=>{sessionStorage.getItem(`popup-${e}`)!=="closed"&&(t.focus(),t.classList.remove("translate-x-full"))},2e3)});const hc=document.querySelector("[data-skip-to-navigation]");hc?.addEventListener("click",t=>{const n=document.querySelector("[data-menuitem]").querySelector("a");n&&n.focus(),t.preventDefault()});const mc=document.querySelectorAll(".swiper"),li=document.querySelector("[data-search]"),Bi=document.querySelector("[data-mobile-search]"),pc=li?.querySelector("input"),$a=document.querySelector("[data-mobile-search-trigger]"),fc=document.querySelectorAll("[data-js-videomodal]"),Fa=document.querySelector("[data-map-container ]"),Ec=async()=>{await X(()=>import("./swiper.js"),[])},Ba=async t=>{await X(()=>import("./globalSearch.js"),__vite__mapDeps([0,1,2,3,4,5])).then(e=>{e.initAlgolia(t)})},vc=async()=>{await X(()=>import("./glossary.js"),[]).then(t=>{t.initGlossary()})},gc=document.querySelector(".article-container");gc&&vc();X(()=>import("./glossary.js"),[]);const bc=async()=>{await X(()=>import("./videoModal.js"),__vite__mapDeps([6,7]))},_c=async()=>{await X(()=>import("./leaflet.js").then(t=>t.l),__vite__mapDeps([8,9,2,3,10,11,1,12,13,14]))},yc=async()=>{await X(()=>import("./programmeMapLeaflet.js"),__vite__mapDeps([15,9,2,10,3])),await X(()=>import("./programmeMap.js"),[])},Ac=async()=>{await X(()=>import("./leaflet.js").then(t=>t.m),__vite__mapDeps([8,9,2,3,10,11,1,12,13,14]))};mc.length>0&&Ec();const wc=async()=>{await X(()=>import("./newsStoriesFilter.js"),__vite__mapDeps([16,1,2,11,17,18,12,3,19,20,13,4,5]))};let Qe;Bi&&$a&&($a.addEventListener("click",async()=>{li.classList.remove("searchactive"),document.activeElement!==li&&Bi.classList.toggle("mobilesearchactive"),Ha(),Bi.classList.toggle("searchactive"),document.querySelector(".searchactive")?.querySelector("input")?.focus(),(Qe==null||!Qe.hasAttribute("data-mobile-search"))&&(Qe=document.querySelector(".searchactive"),await Ba(Qe))}),pc?.addEventListener("focus",async()=>{li.classList.add("searchactive"),(Qe==null||!Qe.hasAttribute("data-search"))&&(Qe=document.querySelector(".searchactive"),await Ba(Qe))}));fc.length>0&&bc();if(Fa){const t=n=>{n[0].isIntersecting&&(_c(),Ac())};new IntersectionObserver(t).observe(Fa)}const hr=document.querySelectorAll("youtube-wrapper");hr.length>0&&X(()=>import("./lazyLoadYouTube.js"),[]).then(t=>{t.initLazyLoadYouTube(hr)});const Tc=document.querySelectorAll("vimeo-wrapper");hr.length>0&&X(()=>import("./lazyLoadYouTube.js"),[]).then(t=>{t.initLazyLoadVimeoVideo(Tc)});const Va=document.querySelectorAll("video-wrapper");Va.length>0&&X(()=>import("./lazyLoadYouTube.js"),[]).then(t=>{t.initLazyLoadHtmlVideo(Va)});const Ic=document.querySelector("[data-widget='news-story-searchbox']");Ic&&wc();const Sc=document.querySelector("[data-searchpage-searchbox]");Sc&&X(()=>import("./searchPage.js"),__vite__mapDeps([21,1,2,11,17,12,3,18,20,14]));const kc=document.querySelector('[data-widget="calls-for-projects-searchbox"]');kc&&X(()=>import("./callsForProjects.js"),__vite__mapDeps([22,11,1,2,12,3,13,19,20,4,23,5]));const Mc=document.querySelector("[data-fullscreen-image]");Mc&&X(()=>import("./imageModal.js"),__vite__mapDeps([24,7]));const Lc=document.querySelectorAll("[data-show-tooltip]");Lc.forEach(t=>{t.addEventListener("click",e=>{const n=t.nextElementSibling;n.classList.toggle("hidden"),n.querySelector("[data-close-tooltip]")?.addEventListener("click",r=>{n.classList.toggle("hidden"),r.stopImmediatePropagation()}),e.stopImmediatePropagation()})});const Vi=document.querySelector("[data-open-map-legend]");Vi?.addEventListener("click",t=>{const e=document.querySelector("[data-map-legend]");Vi.querySelector(".minus_icon")?.classList.toggle("hidden"),Vi.querySelector(".plus_icon")?.classList.toggle("hidden"),e.classList.toggle("max-h-0"),t.stopImmediatePropagation()});const Rc=document.querySelector("#programmeMap");Rc&&yc();const Cc=document.querySelector("[data-jobs-searchbox]");Cc&&X(()=>import("./jobsSearch.js"),__vite__mapDeps([25,1,2,11,18,13,4,23,20]));const Wi=document.querySelector("[data-translate-page]");Wi&&Wi.addEventListener("click",()=>{if(Wi.parentElement?.classList.toggle("!translate-x-0"),!document.querySelector("[data-google-script]")){const e=document.createElement("script");e.setAttribute("src","//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"),e.setAttribute("data-google-script",""),document.querySelector("#google_translate_element")?.appendChild(e)}});const Wa=document.querySelectorAll("[data-content-tabs]");Wa&&X(()=>import("./contentTabs.js"),[]).then(t=>{t.initContentTabs(Wa)});const Dc=document.querySelector("[data-map-coordinates]");Dc&&X(()=>import("./campaignMap.js"),__vite__mapDeps([26,9,2]));export{Oo as a,Ha as t};