@webitel/ui-sdk 25.10.80 → 25.10.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{install-DJJ60FMu.js → install-DJCMGTiR.js} +10 -10
- package/dist/ui-sdk.css +1 -1
- package/dist/ui-sdk.js +1 -1
- package/dist/ui-sdk.umd.cjs +1 -1
- package/dist/{vidstack-Bq6c3Bam-BW31r8ya.js → vidstack-Bq6c3Bam-cqs1VJsz.js} +2 -2
- package/dist/{vidstack-D2pY00kU-B93PR3ad.js → vidstack-D2pY00kU-CSk3dry7.js} +2 -2
- package/dist/{vidstack-DDXt6fpN-CTj6TBKs.js → vidstack-DDXt6fpN-9Kk2pgSP.js} +1 -1
- package/dist/{vidstack-D_-9AA6_-D_TAU8wk.js → vidstack-D_-9AA6_-jbXIgBPp.js} +1 -1
- package/dist/{vidstack-DqAw8m9J-CU1Cgw6I.js → vidstack-DqAw8m9J-4oVE4ulp.js} +1 -1
- package/dist/{vidstack-audio-DTWWroj3.js → vidstack-audio-BGoQg58p.js} +2 -2
- package/dist/{vidstack-dash-C9BPsLwH.js → vidstack-dash-CpxEb9kx.js} +3 -3
- package/dist/{vidstack-google-cast-e8rtOHzY.js → vidstack-google-cast-CZ1gl5nb.js} +3 -3
- package/dist/{vidstack-hls-CguWDGic.js → vidstack-hls-B0cO4Ury.js} +3 -3
- package/dist/{vidstack-video-DMWIBQ3I.js → vidstack-video-C2AhyL-_.js} +2 -2
- package/dist/{vidstack-vimeo-cgFYMNos.js → vidstack-vimeo-RLlvDRn5.js} +3 -3
- package/dist/{vidstack-youtube-x-C5WSbm.js → vidstack-youtube-CDYW0yd7.js} +2 -2
- package/package.json +3 -3
- package/src/components/wt-tree-table/wt-tree-table.vue +1 -1
- package/types/components/wt-tree-table/wt-tree-table.vue.d.ts +6 -6
package/dist/ui-sdk.umd.cjs
CHANGED
|
@@ -3135,7 +3135,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
3135
3135
|
array and $emits "input" event.
|
|
3136
3136
|
|
|
3137
3137
|
True: "tag" method only $emits "tag" event. Tag addition is responsibility of client side.
|
|
3138
|
-
`}},emits:["input","tag","search-change","closed"],data:()=>({defaultOptionLabel:"label",multiple:!0}),created(){this.isApiMode||this.initializeOptions()},methods:{getTagOptionLabel({optionLabel:i,option:o}){const n=this.getOptionLabel({optionLabel:i,option:o});return typeof n=="object"?o.label:n},initializeOptions(){if(!this.value)return[];const i=this.value.filter(o=>!this.options.find(n=>lc(n,o)));this.options.unshift(...i)}}},O7e={class:"multiselect__loading-wrapper"};function R7e(i,o,n,a,l,s){const d=c.resolveComponent("wt-label"),p=c.resolveComponent("wt-icon-btn"),h=c.resolveComponent("wt-chip"),f=c.resolveComponent("wt-loader"),y=c.resolveComponent("vue-multiselect"),w=c.resolveComponent("wt-input-info"),v=c.resolveDirective("observe-visibility");return c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass([{"wt-tags-input--disabled":i.disabled,"wt-tags-input--invalid":i.invalid,"wt-tags-input--loading":i.isLoading},"wt-tags-input"])},[i.hasLabel?(c.openBlock(),c.createBlock(d,c.mergeProps({key:0},i.labelProps,{disabled:i.disabled,invalid:i.invalid,class:"wt-tags-input__label"}),{default:c.withCtx(()=>[c.renderSlot(i.$slots,"label",c.normalizeProps(c.guardReactiveProps({label:i.label})),()=>[c.createTextVNode(c.toDisplayString(i.requiredLabel),1)],!0)],void 0,!0),_:3},16,["disabled","invalid"])):c.createCommentVNode("",!0),c.createVNode(y,c.mergeProps(i.$attrs,{ref:"vue-multiselect","close-on-select":!1,disabled:i.disabled,"internal-search":!i.searchMethod,label:i.selectOptionLabel,loading:!1,"model-value":i.selectValue,multiple:i.multiple,options:i.selectOptions,placeholder:i.placeholder||i.label,taggable:n.taggable,"track-by":n.trackBy,class:"wt-tags-input__select"},c.toHandlers(i.listeners)),c.createSlots({tag:c.withCtx(({option:C,remove:E})=>[c.createVNode(h,{class:"multiselect__custom-tag"},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(s.getTagOptionLabel({option:C,optionLabel:i.optionLabel}))+" ",1),c.createVNode(p,{color:"on-primary",icon:"close--filled",size:"sm",onClick:T=>E(C)},null,8,["onClick"])],void 0,!0),_:2},1024)]),option:c.withCtx(({option:C})=>[c.renderSlot(i.$slots,"option",c.normalizeProps(c.guardReactiveProps({option:C,optionLabel:i.optionLabel})),()=>[c.createTextVNode(c.toDisplayString(s.getTagOptionLabel({option:C,optionLabel:i.optionLabel})),1)],!0)]),caret:c.withCtx(({toggle:C})=>[c.createVNode(p,{disabled:i.disabled,class:"multiselect__select",color:"active",icon:"arrow-down",onMousedown:c.withModifiers(C,["prevent","stop"])},null,8,["disabled","onMousedown"])]),beforeList:c.withCtx(()=>[c.withDirectives(c.createElementVNode("div",O7e,[c.createVNode(f,{size:"sm"})],512),[[c.vShow,i.isLoading]])]),_:2},[i.showIntersectionObserver?{name:"afterList",fn:c.withCtx(()=>[c.withDirectives(c.createElementVNode("div",null,null,512),[[v,i.handleAfterListIntersect]])]),key:"0"}:void 0]),1040,["disabled","internal-search","label","model-value","multiple","options","placeholder","taggable","track-by"]),i.isValidation?(c.openBlock(),c.createBlock(w,{key:1,invalid:i.invalid},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(i.validationText),1)],void 0,!0),_:1},8,["invalid"])):c.createCommentVNode("",!0)],2)}const B7e=Ne(_7e,[["render",R7e],["__scopeId","data-v-5b67c1b1"]]),L7e={name:"WtTextarea",components:{WtLabel:dB},mixins:[dg],props:{value:{type:String,default:""},label:{type:String,default:""},placeholder:{type:String},readonly:{type:Boolean,default:!1,description:"Native textarea readonly attribute"},disabled:{type:Boolean,default:!1,description:"Native textarea disabled attribute"},required:{type:Boolean,default:!1},name:{type:String,default:""},rows:{type:Number,default:1,description:"Number of rows for textarea"},labelProps:{type:Object,description:"Object with props, passed down to wt-label as props"},autoresize:{type:Boolean,default:!1,description:"enables auto-grow for text-area"}},emits:["input","enter"],computed:{listeners(){return{...this.$listeners,input:i=>this.$emit("input",i.target.value),keypress:i=>this.handleKeypress(i)}}},mounted(){this.updateInputPaddings()},updated(){this.autoresize&&!this.value&&this.resetGrow()},methods:{handleKeypress(i){this.autoresize&&i.key==="Enter"&&!i.shiftKey&&(this.$emit("enter"),i.preventDefault())},autoGrow(){if(!this.autoresize)return;const i=this.$refs["wt-textarea"],o=2;i.style.height="auto",i.style.height=i.scrollHeight+o+"px"},resetGrow(){const i=this.$refs["wt-textarea"];i.style.height="auto"},updateInputPaddings(){const i=this.$refs["after-wrapper"].offsetWidth,o=this.$refs["wt-textarea"],n=getComputedStyle(document.documentElement).getPropertyValue("--textarea-padding");o.style.paddingRight=`calc(${n} * 2 + ${i}px)`}}},P7e={class:"wt-textarea__wrapper"},$7e=["id","disabled","placeholder","value","rows","readonly"],M7e={ref:"after-wrapper",class:"wt-textarea__after-wrapper"};function N7e(i,o,n,a,l,s){const d=c.resolveComponent("wt-label"),p=c.resolveComponent("wt-icon-btn"),h=c.resolveComponent("wt-input-info");return c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass([{"wt-textarea--disabled":n.disabled,"wt-textarea--invalid":i.invalid,"wt-textarea--autoresize":n.autoresize},"wt-textarea"])},[c.createVNode(d,c.mergeProps(n.labelProps,{disabled:n.disabled,for:n.name,required:n.required,invalid:i.invalid}),{default:c.withCtx(()=>[c.renderSlot(i.$slots,"label",c.normalizeProps(c.guardReactiveProps({label:n.label})),()=>[c.createTextVNode(c.toDisplayString(n.label),1)],!0)],void 0,!0),_:3},16,["disabled","for","required","invalid"]),c.createElementVNode("div",P7e,[c.createElementVNode("textarea",c.mergeProps({id:n.name,ref:"wt-textarea",disabled:n.disabled,placeholder:n.placeholder||n.label,value:n.value,rows:n.rows,readonly:n.readonly,class:"wt-textarea__textarea"},c.toHandlers(s.listeners,!0),{onInput:o[0]||(o[0]=(...f)=>s.autoGrow&&s.autoGrow(...f))}),null,16,$7e),c.createElementVNode("div",M7e,[c.renderSlot(i.$slots,"after-input",{},void 0,!0),c.createVNode(p,{class:c.normalizeClass([{hidden:!n.value},"wt-textarea__reset-icon-btn"]),disabled:n.disabled,icon:"close--filled",size:"sm",onClick:o[1]||(o[1]=f=>i.$emit("input",""))},null,8,["class","disabled"])],512)]),i.isValidation?(c.openBlock(),c.createBlock(h,{key:0,invalid:i.invalid},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(i.validationText),1)],void 0,!0),_:1},8,["invalid"])):c.createCommentVNode("",!0)],2)}const j7e=Ne(L7e,[["render",N7e],["__scopeId","data-v-7d1b900a"]]),F7e={name:"WtTimeInput",mixins:[dg],props:{value:{type:Number,default:0},label:{type:String,default:""},maxValue:{type:Number},required:{type:Boolean,default:!1,description:"Native input required attribute"},disabled:{type:Boolean,default:!1,description:"Native input disabled attribute"},labelProps:{type:Object,description:"Object with props, passed down to wt-label as props"},hideInputInfo:{type:Boolean,default:!1}},emits:["input"],computed:{hasLabel(){return!!(this.label||this.$slots.label)},showInfo(){return this.isValidation&&!this.hideInputInfo},listeners(){return{...this.$listeners,input:i=>this.$emit("input",i.target.value)}}}},q7e={class:"wt-time-input__wrapper"},V7e=["disabled","max","value"];function z7e(i,o,n,a,l,s){const d=c.resolveComponent("wt-label"),p=c.resolveComponent("wt-input-info");return c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass([{"wt-time-input--disabled":n.disabled,"wt-time-input--invalid":i.invalid},"wt-time-input"])},[s.hasLabel?(c.openBlock(),c.createBlock(d,c.mergeProps({key:0},n.labelProps,{disabled:n.disabled,invalid:i.invalid}),{default:c.withCtx(()=>[c.renderSlot(i.$slots,"label",c.normalizeProps(c.guardReactiveProps({label:n.label})),()=>[c.createTextVNode(c.toDisplayString(n.label),1)],!0)],void 0,!0),_:3},16,["disabled","invalid"])):c.createCommentVNode("",!0),c.createElementVNode("div",q7e,[c.createElementVNode("input",c.mergeProps({disabled:n.disabled,max:n.maxValue,min:0,value:n.value,class:"wt-time-input__input",type:"number"},c.toHandlers(s.listeners,!0)),null,16,V7e)]),s.showInfo?(c.openBlock(),c.createBlock(p,{key:1,invalid:i.invalid},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(i.validationText),1)],void 0,!0),_:1},8,["invalid"])):c.createCommentVNode("",!0)],2)}const U7e=Ne(F7e,[["render",z7e],["__scopeId","data-v-ae7cf0e8"]]),Sh=60*60,Kw=60,H7e={name:"WtTimepicker",mixins:[dg],model:{prop:"value",event:"input"},props:{value:{type:[String,Number],default:0},dateMode:{type:Boolean,default:!1},label:{type:String,default:""},format:{type:String,default:"hh:mm:ss"},disabled:{type:Boolean,default:!1},labelProps:{type:Object,description:"Object with props, passed down to wt-label as props"},noLabel:{type:Boolean,default:!1},required:{type:Boolean,default:!1,description:"Native input required attribute"}},computed:{isHour(){return this.format.includes("hh")},isMin(){return this.format.includes("mm")},isSec(){return this.format.includes("ss")},labelHours(){return this.noLabel||this.label?null:this.$t("webitelUI.timepicker.hour")},labelMin(){return this.noLabel||this.label?null:this.$t("webitelUI.timepicker.min")},labelSec(){return this.noLabel||this.label?null:this.$t("webitelUI.timepicker.sec")},hour:{get(){return this.dateMode?new Date(+this.value).getHours():Math.floor(this.value/Sh)},set(i){const o=this.dateMode?new Date(this.value).setHours(i):this.value-this.hour*Sh+i*Sh;this.$emit("input",o)}},min:{get(){return this.dateMode?new Date(+this.value).getMinutes():Math.floor(this.value/Kw%60)},set(i){const o=this.dateMode?new Date(this.value).setMinutes(i):this.value-this.min*Kw+i*Kw;this.$emit("input",o)}},sec:{get(){return this.dateMode?new Date(+this.value).getSeconds():Math.floor(this.value%60)},set(i){const o=this.dateMode?new Date(this.value).setSeconds(i):this.value-this.sec+ +i;this.$emit("input",o)}},requiredLabel(){return this.required?`${this.label} (${this.format})*`:`${this.label} (${this.format})`}},methods:{onHoursBlurEvent(){const i=this.dateMode?new Date(this.value).setHours(this.hour):this.value-this.hour*Sh+this.hour*Sh;this.$emit("input",0),this.$nextTick(()=>{this.$emit("input",i)})}}},K7e={class:"wt-timepicker__wrapper"};function G7e(i,o,n,a,l,s){const d=c.resolveComponent("wt-label"),p=c.resolveComponent("wt-time-input"),h=c.resolveComponent("wt-input-info");return c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass([{"wt-timepicker--invalid":i.invalid},"wt-timepicker"])},[n.label||!n.noLabel?(c.openBlock(),c.createBlock(d,c.mergeProps({key:0},n.labelProps,{invalid:i.invalid}),{default:c.withCtx(()=>[c.renderSlot(i.$slots,"label",c.normalizeProps(c.guardReactiveProps({label:n.label})),()=>[c.createTextVNode(c.toDisplayString(s.requiredLabel),1)],!0)],void 0,!0),_:3},16,["invalid"])):c.createCommentVNode("",!0),c.createElementVNode("div",K7e,[s.isHour?(c.openBlock(),c.createBlock(p,{key:0,disabled:n.disabled,label:s.labelHours,"max-value":n.dateMode?null:23,v:i.v,value:s.hour,"hide-input-info":"",onBlur:s.onHoursBlurEvent,onInput:o[0]||(o[0]=f=>s.hour=f)},null,8,["disabled","label","max-value","v","value","onBlur"])):c.createCommentVNode("",!0),s.isMin?(c.openBlock(),c.createBlock(p,{key:1,disabled:n.disabled,label:s.labelMin,"max-value":59,v:i.v,value:s.min,"hide-input-info":"",onInput:o[1]||(o[1]=f=>s.min=f)},null,8,["disabled","label","v","value"])):c.createCommentVNode("",!0),s.isSec?(c.openBlock(),c.createBlock(p,{key:2,disabled:n.disabled,label:s.labelSec,"max-value":59,v:i.v,value:s.sec,"hide-input-info":"",onInput:o[2]||(o[2]=f=>s.sec=f)},null,8,["disabled","label","v","value"])):c.createCommentVNode("",!0)]),i.isValidation?(c.openBlock(),c.createBlock(h,{key:1,invalid:i.invalid},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(i.validationText),1)],void 0,!0),_:1},8,["invalid"])):c.createCommentVNode("",!0)],2)}const W7e=Ne(H7e,[["render",G7e],["__scopeId","data-v-e9eb3b40"]]),Z7e=["top","right","bottom","left"],KL=["start","end"],GL=Z7e.reduce((i,o)=>i.concat(o,o+"-"+KL[0],o+"-"+KL[1]),[]),fg=Math.min,dp=Math.max,mg=Math.round,bg=Math.floor,Kr=i=>({x:i,y:i}),Y7e={left:"right",right:"left",bottom:"top",top:"bottom"},X7e={start:"end",end:"start"};function WL(i,o,n){return dp(i,fg(o,n))}function Ih(i,o){return typeof i=="function"?i(o):i}function Ql(i){return i.split("-")[0]}function Jl(i){return i.split("-")[1]}function ZL(i){return i==="x"?"y":"x"}function YL(i){return i==="y"?"height":"width"}function Iu(i){return["top","bottom"].includes(Ql(i))?"y":"x"}function XL(i){return ZL(Iu(i))}function QL(i,o,n){n===void 0&&(n=!1);const a=Jl(i),l=XL(i),s=YL(l);let d=l==="x"?a===(n?"end":"start")?"right":"left":a==="start"?"bottom":"top";return o.reference[s]>o.floating[s]&&(d=yg(d)),[d,yg(d)]}function Q7e(i){const o=yg(i);return[gg(i),o,gg(o)]}function gg(i){return i.replace(/start|end/g,o=>X7e[o])}function J7e(i,o,n){const a=["left","right"],l=["right","left"],s=["top","bottom"],d=["bottom","top"];switch(i){case"top":case"bottom":return n?o?l:a:o?a:l;case"left":case"right":return o?s:d;default:return[]}}function ewe(i,o,n,a){const l=Jl(i);let s=J7e(Ql(i),n==="start",a);return l&&(s=s.map(d=>d+"-"+l),o&&(s=s.concat(s.map(gg)))),s}function yg(i){return i.replace(/left|right|bottom|top/g,o=>Y7e[o])}function twe(i){return{top:0,right:0,bottom:0,left:0,...i}}function owe(i){return typeof i!="number"?twe(i):{top:i,right:i,bottom:i,left:i}}function wg(i){const{x:o,y:n,width:a,height:l}=i;return{width:a,height:l,top:n,left:o,right:o+a,bottom:n+l,x:o,y:n}}function JL(i,o,n){let{reference:a,floating:l}=i;const s=Iu(o),d=XL(o),p=YL(d),h=Ql(o),f=s==="y",y=a.x+a.width/2-l.width/2,w=a.y+a.height/2-l.height/2,v=a[p]/2-l[p]/2;let C;switch(h){case"top":C={x:y,y:a.y-l.height};break;case"bottom":C={x:y,y:a.y+a.height};break;case"right":C={x:a.x+a.width,y:w};break;case"left":C={x:a.x-l.width,y:w};break;default:C={x:a.x,y:a.y}}switch(Jl(o)){case"start":C[d]-=v*(n&&f?-1:1);break;case"end":C[d]+=v*(n&&f?-1:1);break}return C}const iwe=async(i,o,n)=>{const{placement:a="bottom",strategy:l="absolute",middleware:s=[],platform:d}=n,p=s.filter(Boolean),h=await(d.isRTL==null?void 0:d.isRTL(o));let f=await d.getElementRects({reference:i,floating:o,strategy:l}),{x:y,y:w}=JL(f,a,h),v=a,C={},E=0;for(let T=0;T<p.length;T++){const{name:A,fn:I}=p[T],{x,y:O,data:_,reset:R}=await I({x:y,y:w,initialPlacement:a,placement:v,strategy:l,middlewareData:C,rects:f,platform:d,elements:{reference:i,floating:o}});y=x??y,w=O??w,C={...C,[A]:{...C[A],..._}},R&&E<=50&&(E++,typeof R=="object"&&(R.placement&&(v=R.placement),R.rects&&(f=R.rects===!0?await d.getElementRects({reference:i,floating:o,strategy:l}):R.rects),{x:y,y:w}=JL(f,v,h)),T=-1)}return{x:y,y:w,placement:v,strategy:l,middlewareData:C}};async function Gw(i,o){var n;o===void 0&&(o={});const{x:a,y:l,platform:s,rects:d,elements:p,strategy:h}=i,{boundary:f="clippingAncestors",rootBoundary:y="viewport",elementContext:w="floating",altBoundary:v=!1,padding:C=0}=Ih(o,i),E=owe(C),A=p[v?w==="floating"?"reference":"floating":w],I=wg(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(A)))==null||n?A:A.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(p.floating)),boundary:f,rootBoundary:y,strategy:h})),x=w==="floating"?{x:a,y:l,width:d.floating.width,height:d.floating.height}:d.reference,O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(p.floating)),_=await(s.isElement==null?void 0:s.isElement(O))?await(s.getScale==null?void 0:s.getScale(O))||{x:1,y:1}:{x:1,y:1},R=wg(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:x,offsetParent:O,strategy:h}):x);return{top:(I.top-R.top+E.top)/_.y,bottom:(R.bottom-I.bottom+E.bottom)/_.y,left:(I.left-R.left+E.left)/_.x,right:(R.right-I.right+E.right)/_.x}}function nwe(i,o,n){return(i?[...n.filter(l=>Jl(l)===i),...n.filter(l=>Jl(l)!==i)]:n.filter(l=>Ql(l)===l)).filter(l=>i?Jl(l)===i||(o?gg(l)!==l:!1):!0)}const awe=function(i){return i===void 0&&(i={}),{name:"autoPlacement",options:i,async fn(o){var n,a,l;const{rects:s,middlewareData:d,placement:p,platform:h,elements:f}=o,{crossAxis:y=!1,alignment:w,allowedPlacements:v=GL,autoAlignment:C=!0,...E}=Ih(i,o),T=w!==void 0||v===GL?nwe(w||null,C,v):v,A=await Gw(o,E),I=((n=d.autoPlacement)==null?void 0:n.index)||0,x=T[I];if(x==null)return{};const O=QL(x,s,await(h.isRTL==null?void 0:h.isRTL(f.floating)));if(p!==x)return{reset:{placement:T[0]}};const _=[A[Ql(x)],A[O[0]],A[O[1]]],R=[...((a=d.autoPlacement)==null?void 0:a.overflows)||[],{placement:x,overflows:_}],F=T[I+1];if(F)return{data:{index:I+1,overflows:R},reset:{placement:F}};const L=R.map(q=>{const N=Jl(q.placement);return[q.placement,N&&y?q.overflows.slice(0,2).reduce((U,te)=>U+te,0):q.overflows[0],q.overflows]}).sort((q,N)=>q[1]-N[1]),K=((l=L.filter(q=>q[2].slice(0,Jl(q[0])?2:3).every(N=>N<=0))[0])==null?void 0:l[0])||L[0][0];return K!==p?{data:{index:I+1,overflows:R},reset:{placement:K}}:{}}}},rwe=function(i){return i===void 0&&(i={}),{name:"flip",options:i,async fn(o){var n,a;const{placement:l,middlewareData:s,rects:d,initialPlacement:p,platform:h,elements:f}=o,{mainAxis:y=!0,crossAxis:w=!0,fallbackPlacements:v,fallbackStrategy:C="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:T=!0,...A}=Ih(i,o);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const I=Ql(l),x=Iu(p),O=Ql(p)===p,_=await(h.isRTL==null?void 0:h.isRTL(f.floating)),R=v||(O||!T?[yg(p)]:Q7e(p)),F=E!=="none";!v&&F&&R.push(...ewe(p,T,E,_));const L=[p,...R],H=await Gw(o,A),K=[];let q=((a=s.flip)==null?void 0:a.overflows)||[];if(y&&K.push(H[I]),w){const se=QL(l,d,_);K.push(H[se[0]],H[se[1]])}if(q=[...q,{placement:l,overflows:K}],!K.every(se=>se<=0)){var N,U;const se=(((N=s.flip)==null?void 0:N.index)||0)+1,fe=L[se];if(fe)return{data:{index:se,overflows:q},reset:{placement:fe}};let pe=(U=q.filter($=>$.overflows[0]<=0).sort(($,Z)=>$.overflows[1]-Z.overflows[1])[0])==null?void 0:U.placement;if(!pe)switch(C){case"bestFit":{var te;const $=(te=q.filter(Z=>{if(F){const W=Iu(Z.placement);return W===x||W==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(W=>W>0).reduce((W,Q)=>W+Q,0)]).sort((Z,W)=>Z[1]-W[1])[0])==null?void 0:te[0];$&&(pe=$);break}case"initialPlacement":pe=p;break}if(l!==pe)return{reset:{placement:pe}}}return{}}}};async function lwe(i,o){const{placement:n,platform:a,elements:l}=i,s=await(a.isRTL==null?void 0:a.isRTL(l.floating)),d=Ql(n),p=Jl(n),h=Iu(n)==="y",f=["left","top"].includes(d)?-1:1,y=s&&h?-1:1,w=Ih(o,i);let{mainAxis:v,crossAxis:C,alignmentAxis:E}=typeof w=="number"?{mainAxis:w,crossAxis:0,alignmentAxis:null}:{mainAxis:w.mainAxis||0,crossAxis:w.crossAxis||0,alignmentAxis:w.alignmentAxis};return p&&typeof E=="number"&&(C=p==="end"?E*-1:E),h?{x:C*y,y:v*f}:{x:v*f,y:C*y}}const swe=function(i){return i===void 0&&(i=0),{name:"offset",options:i,async fn(o){var n,a;const{x:l,y:s,placement:d,middlewareData:p}=o,h=await lwe(o,i);return d===((n=p.offset)==null?void 0:n.placement)&&(a=p.arrow)!=null&&a.alignmentOffset?{}:{x:l+h.x,y:s+h.y,data:{...h,placement:d}}}}},cwe=function(i){return i===void 0&&(i={}),{name:"shift",options:i,async fn(o){const{x:n,y:a,placement:l}=o,{mainAxis:s=!0,crossAxis:d=!1,limiter:p={fn:A=>{let{x:I,y:x}=A;return{x:I,y:x}}},...h}=Ih(i,o),f={x:n,y:a},y=await Gw(o,h),w=Iu(Ql(l)),v=ZL(w);let C=f[v],E=f[w];if(s){const A=v==="y"?"top":"left",I=v==="y"?"bottom":"right",x=C+y[A],O=C-y[I];C=WL(x,C,O)}if(d){const A=w==="y"?"top":"left",I=w==="y"?"bottom":"right",x=E+y[A],O=E-y[I];E=WL(x,E,O)}const T=p.fn({...o,[v]:C,[w]:E});return{...T,data:{x:T.x-n,y:T.y-a,enabled:{[v]:s,[w]:d}}}}}};function vg(){return typeof window<"u"}function pp(i){return Ww(i)?(i.nodeName||"").toLowerCase():"#document"}function ha(i){var o;return(i==null||(o=i.ownerDocument)==null?void 0:o.defaultView)||window}function Gr(i){var o;return(o=(Ww(i)?i.ownerDocument:i.document)||window.document)==null?void 0:o.documentElement}function Ww(i){return vg()?i instanceof Node||i instanceof ha(i).Node:!1}function or(i){return vg()?i instanceof Element||i instanceof ha(i).Element:!1}function Wr(i){return vg()?i instanceof HTMLElement||i instanceof ha(i).HTMLElement:!1}function eP(i){return!vg()||typeof ShadowRoot>"u"?!1:i instanceof ShadowRoot||i instanceof ha(i).ShadowRoot}function Eh(i){const{overflow:o,overflowX:n,overflowY:a,display:l}=ir(i);return/auto|scroll|overlay|hidden|clip/.test(o+a+n)&&!["inline","contents"].includes(l)}function dwe(i){return["table","td","th"].includes(pp(i))}function Cg(i){return[":popover-open",":modal"].some(o=>{try{return i.matches(o)}catch{return!1}})}function Zw(i){const o=Yw(),n=or(i)?ir(i):i;return["transform","translate","scale","rotate","perspective"].some(a=>n[a]?n[a]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!o&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!o&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(a=>(n.willChange||"").includes(a))||["paint","layout","strict","content"].some(a=>(n.contain||"").includes(a))}function pwe(i){let o=sc(i);for(;Wr(o)&&!Eu(o);){if(Zw(o))return o;if(Cg(o))return null;o=sc(o)}return null}function Yw(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Eu(i){return["html","body","#document"].includes(pp(i))}function ir(i){return ha(i).getComputedStyle(i)}function kg(i){return or(i)?{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}:{scrollLeft:i.scrollX,scrollTop:i.scrollY}}function sc(i){if(pp(i)==="html")return i;const o=i.assignedSlot||i.parentNode||eP(i)&&i.host||Gr(i);return eP(o)?o.host:o}function tP(i){const o=sc(i);return Eu(o)?i.ownerDocument?i.ownerDocument.body:i.body:Wr(o)&&Eh(o)?o:tP(o)}function Th(i,o,n){var a;o===void 0&&(o=[]),n===void 0&&(n=!0);const l=tP(i),s=l===((a=i.ownerDocument)==null?void 0:a.body),d=ha(l);if(s){const p=Xw(d);return o.concat(d,d.visualViewport||[],Eh(l)?l:[],p&&n?Th(p):[])}return o.concat(l,Th(l,[],n))}function Xw(i){return i.parent&&Object.getPrototypeOf(i.parent)?i.frameElement:null}function oP(i){const o=ir(i);let n=parseFloat(o.width)||0,a=parseFloat(o.height)||0;const l=Wr(i),s=l?i.offsetWidth:n,d=l?i.offsetHeight:a,p=mg(n)!==s||mg(a)!==d;return p&&(n=s,a=d),{width:n,height:a,$:p}}function Qw(i){return or(i)?i:i.contextElement}function Tu(i){const o=Qw(i);if(!Wr(o))return Kr(1);const n=o.getBoundingClientRect(),{width:a,height:l,$:s}=oP(o);let d=(s?mg(n.width):n.width)/a,p=(s?mg(n.height):n.height)/l;return(!d||!Number.isFinite(d))&&(d=1),(!p||!Number.isFinite(p))&&(p=1),{x:d,y:p}}const uwe=Kr(0);function iP(i){const o=ha(i);return!Yw()||!o.visualViewport?uwe:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function hwe(i,o,n){return o===void 0&&(o=!1),!n||o&&n!==ha(i)?!1:o}function up(i,o,n,a){o===void 0&&(o=!1),n===void 0&&(n=!1);const l=i.getBoundingClientRect(),s=Qw(i);let d=Kr(1);o&&(a?or(a)&&(d=Tu(a)):d=Tu(i));const p=hwe(s,n,a)?iP(s):Kr(0);let h=(l.left+p.x)/d.x,f=(l.top+p.y)/d.y,y=l.width/d.x,w=l.height/d.y;if(s){const v=ha(s),C=a&&or(a)?ha(a):a;let E=v,T=Xw(E);for(;T&&a&&C!==E;){const A=Tu(T),I=T.getBoundingClientRect(),x=ir(T),O=I.left+(T.clientLeft+parseFloat(x.paddingLeft))*A.x,_=I.top+(T.clientTop+parseFloat(x.paddingTop))*A.y;h*=A.x,f*=A.y,y*=A.x,w*=A.y,h+=O,f+=_,E=ha(T),T=Xw(E)}}return wg({width:y,height:w,x:h,y:f})}function Jw(i,o){const n=kg(i).scrollLeft;return o?o.left+n:up(Gr(i)).left+n}function nP(i,o,n){n===void 0&&(n=!1);const a=i.getBoundingClientRect(),l=a.left+o.scrollLeft-(n?0:Jw(i,a)),s=a.top+o.scrollTop;return{x:l,y:s}}function fwe(i){let{elements:o,rect:n,offsetParent:a,strategy:l}=i;const s=l==="fixed",d=Gr(a),p=o?Cg(o.floating):!1;if(a===d||p&&s)return n;let h={scrollLeft:0,scrollTop:0},f=Kr(1);const y=Kr(0),w=Wr(a);if((w||!w&&!s)&&((pp(a)!=="body"||Eh(d))&&(h=kg(a)),Wr(a))){const C=up(a);f=Tu(a),y.x=C.x+a.clientLeft,y.y=C.y+a.clientTop}const v=d&&!w&&!s?nP(d,h,!0):Kr(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-h.scrollLeft*f.x+y.x+v.x,y:n.y*f.y-h.scrollTop*f.y+y.y+v.y}}function mwe(i){return Array.from(i.getClientRects())}function bwe(i){const o=Gr(i),n=kg(i),a=i.ownerDocument.body,l=dp(o.scrollWidth,o.clientWidth,a.scrollWidth,a.clientWidth),s=dp(o.scrollHeight,o.clientHeight,a.scrollHeight,a.clientHeight);let d=-n.scrollLeft+Jw(i);const p=-n.scrollTop;return ir(a).direction==="rtl"&&(d+=dp(o.clientWidth,a.clientWidth)-l),{width:l,height:s,x:d,y:p}}function gwe(i,o){const n=ha(i),a=Gr(i),l=n.visualViewport;let s=a.clientWidth,d=a.clientHeight,p=0,h=0;if(l){s=l.width,d=l.height;const f=Yw();(!f||f&&o==="fixed")&&(p=l.offsetLeft,h=l.offsetTop)}return{width:s,height:d,x:p,y:h}}function ywe(i,o){const n=up(i,!0,o==="fixed"),a=n.top+i.clientTop,l=n.left+i.clientLeft,s=Wr(i)?Tu(i):Kr(1),d=i.clientWidth*s.x,p=i.clientHeight*s.y,h=l*s.x,f=a*s.y;return{width:d,height:p,x:h,y:f}}function aP(i,o,n){let a;if(o==="viewport")a=gwe(i,n);else if(o==="document")a=bwe(Gr(i));else if(or(o))a=ywe(o,n);else{const l=iP(i);a={x:o.x-l.x,y:o.y-l.y,width:o.width,height:o.height}}return wg(a)}function rP(i,o){const n=sc(i);return n===o||!or(n)||Eu(n)?!1:ir(n).position==="fixed"||rP(n,o)}function wwe(i,o){const n=o.get(i);if(n)return n;let a=Th(i,[],!1).filter(p=>or(p)&&pp(p)!=="body"),l=null;const s=ir(i).position==="fixed";let d=s?sc(i):i;for(;or(d)&&!Eu(d);){const p=ir(d),h=Zw(d);!h&&p.position==="fixed"&&(l=null),(s?!h&&!l:!h&&p.position==="static"&&!!l&&["absolute","fixed"].includes(l.position)||Eh(d)&&!h&&rP(i,d))?a=a.filter(y=>y!==d):l=p,d=sc(d)}return o.set(i,a),a}function vwe(i){let{element:o,boundary:n,rootBoundary:a,strategy:l}=i;const d=[...n==="clippingAncestors"?Cg(o)?[]:wwe(o,this._c):[].concat(n),a],p=d[0],h=d.reduce((f,y)=>{const w=aP(o,y,l);return f.top=dp(w.top,f.top),f.right=fg(w.right,f.right),f.bottom=fg(w.bottom,f.bottom),f.left=dp(w.left,f.left),f},aP(o,p,l));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function Cwe(i){const{width:o,height:n}=oP(i);return{width:o,height:n}}function kwe(i,o,n){const a=Wr(o),l=Gr(o),s=n==="fixed",d=up(i,!0,s,o);let p={scrollLeft:0,scrollTop:0};const h=Kr(0);if(a||!a&&!s)if((pp(o)!=="body"||Eh(l))&&(p=kg(o)),a){const v=up(o,!0,s,o);h.x=v.x+o.clientLeft,h.y=v.y+o.clientTop}else l&&(h.x=Jw(l));const f=l&&!a&&!s?nP(l,p):Kr(0),y=d.left+p.scrollLeft-h.x-f.x,w=d.top+p.scrollTop-h.y-f.y;return{x:y,y:w,width:d.width,height:d.height}}function ev(i){return ir(i).position==="static"}function lP(i,o){if(!Wr(i)||ir(i).position==="fixed")return null;if(o)return o(i);let n=i.offsetParent;return Gr(i)===n&&(n=n.ownerDocument.body),n}function sP(i,o){const n=ha(i);if(Cg(i))return n;if(!Wr(i)){let l=sc(i);for(;l&&!Eu(l);){if(or(l)&&!ev(l))return l;l=sc(l)}return n}let a=lP(i,o);for(;a&&dwe(a)&&ev(a);)a=lP(a,o);return a&&Eu(a)&&ev(a)&&!Zw(a)?n:a||pwe(i)||n}const xwe=async function(i){const o=this.getOffsetParent||sP,n=this.getDimensions,a=await n(i.floating);return{reference:kwe(i.reference,await o(i.floating),i.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function Swe(i){return ir(i).direction==="rtl"}const Iwe={convertOffsetParentRelativeRectToViewportRelativeRect:fwe,getDocumentElement:Gr,getClippingRect:vwe,getOffsetParent:sP,getElementRects:xwe,getClientRects:mwe,getDimensions:Cwe,getScale:Tu,isElement:or,isRTL:Swe};function cP(i,o){return i.x===o.x&&i.y===o.y&&i.width===o.width&&i.height===o.height}function Ewe(i,o){let n=null,a;const l=Gr(i);function s(){var p;clearTimeout(a),(p=n)==null||p.disconnect(),n=null}function d(p,h){p===void 0&&(p=!1),h===void 0&&(h=1),s();const f=i.getBoundingClientRect(),{left:y,top:w,width:v,height:C}=f;if(p||o(),!v||!C)return;const E=bg(w),T=bg(l.clientWidth-(y+v)),A=bg(l.clientHeight-(w+C)),I=bg(y),O={rootMargin:-E+"px "+-T+"px "+-A+"px "+-I+"px",threshold:dp(0,fg(1,h))||1};let _=!0;function R(F){const L=F[0].intersectionRatio;if(L!==h){if(!_)return d();L?d(!1,L):a=setTimeout(()=>{d(!1,1e-7)},1e3)}L===1&&!cP(f,i.getBoundingClientRect())&&d(),_=!1}try{n=new IntersectionObserver(R,{...O,root:l.ownerDocument})}catch{n=new IntersectionObserver(R,O)}n.observe(i)}return d(!0),s}function dP(i,o,n,a){a===void 0&&(a={});const{ancestorScroll:l=!0,ancestorResize:s=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:p=typeof IntersectionObserver=="function",animationFrame:h=!1}=a,f=Qw(i),y=l||s?[...f?Th(f):[],...Th(o)]:[];y.forEach(I=>{l&&I.addEventListener("scroll",n,{passive:!0}),s&&I.addEventListener("resize",n)});const w=f&&p?Ewe(f,n):null;let v=-1,C=null;d&&(C=new ResizeObserver(I=>{let[x]=I;x&&x.target===f&&C&&(C.unobserve(o),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var O;(O=C)==null||O.observe(o)})),n()}),f&&!h&&C.observe(f),C.observe(o));let E,T=h?up(i):null;h&&A();function A(){const I=up(i);T&&!cP(T,I)&&n(),T=I,E=requestAnimationFrame(A)}return n(),()=>{var I;y.forEach(x=>{l&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),w==null||w(),(I=C)==null||I.disconnect(),C=null,h&&cancelAnimationFrame(E)}}const Twe=swe,Awe=awe,pP=cwe,uP=rwe,hP=(i,o,n)=>{const a=new Map,l={platform:Iwe,...n},s={...l.platform,_c:a};return iwe(i,o,{...l,platform:s})};function Dwe(i){return i!=null&&typeof i=="object"&&"$el"in i}function fP(i){if(Dwe(i)){const o=i.$el;return Ww(o)&&pp(o)==="#comment"?null:o}return i}function Ah(i){return typeof i=="function"?i():c.unref(i)}function mP(i){return typeof window>"u"?1:(i.ownerDocument.defaultView||window).devicePixelRatio||1}function bP(i,o){const n=mP(i);return Math.round(o*n)/n}function _we(i,o,n){n===void 0&&(n={});const a=n.whileElementsMounted,l=c.computed(()=>{var L;return(L=Ah(n.open))!=null?L:!0}),s=c.computed(()=>Ah(n.middleware)),d=c.computed(()=>{var L;return(L=Ah(n.placement))!=null?L:"bottom"}),p=c.computed(()=>{var L;return(L=Ah(n.strategy))!=null?L:"absolute"}),h=c.computed(()=>{var L;return(L=Ah(n.transform))!=null?L:!0}),f=c.computed(()=>fP(i.value)),y=c.computed(()=>fP(o.value)),w=c.ref(0),v=c.ref(0),C=c.ref(p.value),E=c.ref(d.value),T=c.shallowRef({}),A=c.ref(!1),I=c.computed(()=>{const L={position:C.value,left:"0",top:"0"};if(!y.value)return L;const H=bP(y.value,w.value),K=bP(y.value,v.value);return h.value?{...L,transform:"translate("+H+"px, "+K+"px)",...mP(y.value)>=1.5&&{willChange:"transform"}}:{position:C.value,left:H+"px",top:K+"px"}});let x;function O(){if(f.value==null||y.value==null)return;const L=l.value;hP(f.value,y.value,{middleware:s.value,placement:d.value,strategy:p.value}).then(H=>{w.value=H.x,v.value=H.y,C.value=H.strategy,E.value=H.placement,T.value=H.middlewareData,A.value=L!==!1})}function _(){typeof x=="function"&&(x(),x=void 0)}function R(){if(_(),a===void 0){O();return}if(f.value!=null&&y.value!=null){x=a(f.value,y.value,O);return}}function F(){l.value||(A.value=!1)}return c.watch([s,d,p,l],O,{flush:"sync"}),c.watch([f,y],R,{flush:"sync"}),c.watch(l,F,{flush:"sync"}),c.getCurrentScope()&&c.onScopeDispose(_),{x:c.shallowReadonly(w),y:c.shallowReadonly(v),strategy:c.shallowReadonly(C),placement:c.shallowReadonly(E),middlewareData:c.shallowReadonly(T),isPositioned:c.shallowReadonly(A),floatingStyles:I,update:O}}const gP={hover:"mouseenter",focus:"focus",click:"click",touch:"touchstart",pointer:"pointerdown"},yP={hover:"mouseleave",focus:"blur",click:"click",touch:"touchend",pointer:"pointerup"},wP=({target:i,triggers:o,show:n,hide:a})=>{const l=()=>{((p,h)=>{h.forEach(f=>{const y=gP[f];y?p.addEventListener(y,n):console.log(`No Tooltip Show event for ${f} trigger`);const w=yP[f];w?p.addEventListener(w,a):console.log(`No Tooltip Hide event for ${f} trigger`)})})(i.value,o)},s=()=>{((p,h)=>{h.forEach(f=>{const y=gP[f];y?p.removeEventListener(y,n):console.log(`No Tooltip Show event for ${f} trigger`);const w=yP[f];w?p.removeEventListener(w,a):console.log(`No Tooltip Hide event for ${f} trigger`)})})(i.value,o)};c.onMounted(()=>l()),c.onBeforeUnmount(()=>s())},Owe={__name:"wt-tooltip-floating",props:{triggers:{type:Array,default:()=>[]}},emits:["show","hide"],setup(i,{emit:o}){const n=i,a=o,l=c.ref(null);return wP({target:l,triggers:n.triggers,show:()=>a("show"),hide:()=>a("hide")}),(s,d)=>(c.openBlock(),c.createElementBlock("aside",{ref_key:"floating",ref:l,class:"wt-tooltip-floating"},[c.renderSlot(s.$slots,"default")],512))}},Rwe=Ne({__name:"wt-tooltip",props:{visible:{type:Boolean,default:!1},placement:{type:String,default:"auto"},popperTriggers:{type:Array,default:()=>[]},triggers:{type:Array,default:()=>["hover","focus","touch"]},popperClass:{type:String,default:""},disabled:{type:Boolean,default:!1},disableClickAway:{type:Boolean,default:!1}},emits:["update:visible"],setup(i,{emit:o}){const n=i,a=o,l=c.useTemplateRef("activator"),s=c.useTemplateRef("floating"),d=c.useTemplateRef("floatingChild"),p=c.ref(n.visible),h=()=>{a("update:visible",p.value)},f=(T={})=>{n.disabled||p.value||(p.value=!0,T.usedByTooltip=!0,h(),v())},y=(T={})=>{var I;const A=(I=d.value)==null?void 0:I.contains(T.target);!p.value||T.usedByTooltip||A||(p.value=!1,h(),C())},w=(T={})=>{n.disableClickAway||y(T)},v=()=>{window.addEventListener("scroll",y,!0)},C=()=>{window.removeEventListener("scroll",y,!0)},{floatingStyles:E}=_we(l,s,{placement:n.placement==="auto"?null:n.placement,strategy:"fixed",whileElementsMounted:dP,middleware:[pP(),Twe(4),n.placement==="auto"?Awe():uP()]});return wP({target:l,triggers:n.triggers,show:f,hide:y}),c.watch(()=>n.visible,T=>{T?f():y()}),c.onMounted(()=>{n.visible&&f()}),c.onBeforeUnmount(()=>{C()}),(T,A)=>{const I=c.resolveDirective("clickaway");return c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass([{"wt-tooltip--visible":p.value},"wt-tooltip"])},[c.createElementVNode("div",{ref_key:"activator",ref:l,class:"wt-tooltip__activator"},[c.renderSlot(T.$slots,"activator",c.normalizeProps(c.guardReactiveProps({visible:p.value})),void 0,!0)],512),p.value?c.withDirectives((c.openBlock(),c.createBlock(Owe,{key:0,ref_key:"floating",ref:s,class:c.normalizeClass([[i.popperClass],"wt-tooltip__floating"]),style:c.normalizeStyle(c.unref(E)),triggers:i.popperTriggers,onHide:y,onShow:f},{default:c.withCtx(()=>[c.createElementVNode("div",{ref_key:"floatingChild",ref:d},[c.renderSlot(T.$slots,"default",c.normalizeProps(c.guardReactiveProps({hide:y})),void 0,!0)],512)],void 0,!0),_:3},8,["class","style","triggers"])),[[I,w]]):c.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-b8fd5806"]]),Bwe={class:"wt-tree-line"},Lwe={class:"wt-tree-line__icon-wrapper"},Pwe={class:"wt-tree-line__label"},$we=c.defineComponent({__name:"wt-tree-line",props:{modelValue:{},data:{},itemLabel:{},itemData:{},childrenProp:{default:"children"},nestedLevel:{default:0},lastChild:{type:Boolean,default:!1},selectedParent:{type:Boolean,default:!1},nestedIcons:{},nextElement:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},allowParent:{type:Boolean,default:!1},searchedProp:{default:"searched"},rootData:{}},emits:["openParent","update:modelValue"],setup(i,{emit:o}){const n=i,a=o,l=c.computed(()=>n.itemLabel?n.data[n.itemLabel]:n.data),s=c.computed(()=>{const I=n.nestedIcons?[...n.nestedIcons]:[];return n.nestedLevel===0||I.push({icon:"tree-line",hidden:!n.nextElement}),I}),d=()=>Array.isArray(n.modelValue)?n.itemData?n.modelValue.includes(n.data[n.itemData]):!!n.modelValue.find(x=>lc(x,n.data)):!1,p=c.computed(()=>n.multiple?d():n.itemData?n.data[n.itemData]===n.modelValue:lc(n.modelValue,n.data)),h=c.computed(()=>n.multiple?p.value:p.value||n.selectedParent),f=(I,x,O)=>{const _=n.itemData?I[n.itemData]:I;if(x)O.some(R=>lc(R,_))||O.push(_);else{const R=O.findIndex(F=>lc(F,_));R!==-1&&O.splice(R,1)}if(I&&Array.isArray(I[n.childrenProp])&&I[n.childrenProp].length)for(const R of I[n.childrenProp])f(R,x,O)},y=(I,x,O)=>{const _=(R,F)=>{if(R===I){if(F){const L=n.itemData?F[n.itemData]:F,H=O.findIndex(K=>lc(K,L));H!==-1&&O.splice(H,1)}return!0}if(R&&Array.isArray(R[n.childrenProp])&&R[n.childrenProp].length){for(const L of R[n.childrenProp])if(_(L,R))return!0}return!1};_(x,null)},w=()=>{const I=p.value,x=[...n.modelValue];f(n.data,!I,x),I&&y(n.data,n.rootData,x),a("update:modelValue",x)},v=()=>{const I=n.itemData?n.data[n.itemData]:n.data;let x;if(n.itemData?x=n.modelValue.indexOf(n.data[n.itemData]):x=n.modelValue.findIndex(_=>lc(_,n.data)),x===-1){const _=[...n.modelValue];_.push(I),a("update:modelValue",_);return}const O=[...n.modelValue];O.splice(x,1),a("update:modelValue",O)},C=()=>{var I,x;if(n.multiple){(I=n.data[n.childrenProp])!=null&&I.length?w():v();return}if(n.allowParent&&!n.data[n.childrenProp])return a("update:modelValue",n.itemData?n.data[n.itemData]:n.data);if((x=n.data[n.childrenProp])!=null&&x.length){E.value=!E.value;return}a("update:modelValue",n.itemData?n.data[n.itemData]:n.data)},E=c.ref(!0),T=()=>{n.nestedLevel>0&&a("openParent")},A=()=>{E.value=!1,T()};return c.onMounted(()=>{p.value&&T(),n.data[n.searchedProp]&&T()}),c.watch(()=>n.modelValue,()=>{p.value&&T()}),(I,x)=>{const O=c.resolveComponent("wt-icon"),_=c.resolveComponent("wt-icon-btn"),R=c.resolveComponent("wt-tree-line",!0);return c.openBlock(),c.createElementBlock(c.Fragment,null,[c.createElementVNode("div",Bwe,[c.createElementVNode("div",Lwe,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(I.nestedIcons,(F,L)=>(c.openBlock(),c.createBlock(O,{key:L,icon:F.icon,class:c.normalizeClass({hidden:F.hidden})},null,8,["icon","class"]))),128)),I.nestedLevel>=1?(c.openBlock(),c.createBlock(O,{key:0,icon:I.lastChild?"tree-corner":"tree-cross"},null,8,["icon"])):c.createCommentVNode("",!0),I.data[I.childrenProp]&&I.data[I.childrenProp].length?(c.openBlock(),c.createBlock(_,{key:1,icon:E.value?"plus":"minus",onClick:x[0]||(x[0]=F=>E.value=!E.value)},null,8,["icon"])):c.createCommentVNode("",!0)]),c.createElementVNode("div",{class:c.normalizeClass([{active:h.value,searched:n.data[n.searchedProp]},"wt-tree-line__label-wrapper"]),onClick:C},[c.createElementVNode("p",Pwe,c.toDisplayString(l.value),1),h.value?(c.openBlock(),c.createBlock(O,{key:0,icon:"chat-message-status-sent"})):c.createCommentVNode("",!0)],2)]),c.withDirectives(c.createVNode(R8,null,{default:c.withCtx(()=>[c.createElementVNode("div",null,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(I.data[I.childrenProp],(F,L)=>(c.openBlock(),c.createBlock(R,{key:L,"model-value":I.modelValue,data:F,"children-prop":I.childrenProp,"item-label":I.itemLabel,"item-data":I.itemData,"nested-level":I.nestedLevel+1,"selected-parent":p.value||I.selectedParent,"next-element":!!I.data[I.childrenProp][L+1],"nested-icons":s.value,"last-child":L===I.data[I.childrenProp].length-1,multiple:I.multiple,"allow-parent":I.allowParent,"root-data":I.rootData||I.data,onOpenParent:A,"onUpdate:modelValue":x[1]||(x[1]=H=>a("update:modelValue",H))},null,8,["model-value","data","children-prop","item-label","item-data","nested-level","selected-parent","next-element","nested-icons","last-child","multiple","allow-parent","root-data"]))),128))])],void 0,!0),_:1},512),[[c.vShow,!E.value]])],64)}}}),tv={Tree:"tree",List:"list"},Mwe={class:"wt-tree"},Nwe={key:0,class:"wt-tree__content"},jwe={key:1,class:"wt-tree__list-content"},Fwe=["onClick"],qwe=c.defineComponent({__name:"wt-tree",props:{modelValue:{},data:{},itemLabel:{},itemData:{},mode:{default:tv.Tree},childrenProp:{default:"children"},multiple:{type:Boolean},allowParent:{type:Boolean,default:!1}},emits:["select","update:modelValue"],setup(i,{emit:o}){const n=i,a=o,l=c.computed(()=>{const p=[],h=f=>{p.push(f),f[n.childrenProp]&&f[n.childrenProp].forEach(y=>{h(y)})};return n.data.forEach(f=>{h(f)}),p}),s=p=>{a("update:modelValue",n.itemData?p[n.itemData]:p)},d=p=>n.itemData?p[n.itemData]===n.modelValue:lc(n.modelValue,p);return(p,h)=>{const f=c.resolveComponent("wt-icon");return c.openBlock(),c.createElementBlock("div",Mwe,[p.mode===c.unref(tv).Tree?(c.openBlock(),c.createElementBlock("div",Nwe,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(p.data,(y,w)=>(c.openBlock(),c.createBlock($we,{key:w,"model-value":p.modelValue,"item-label":p.itemLabel,"item-data":p.itemData,data:y,"children-prop":p.childrenProp,multiple:p.multiple,"allow-parent":p.allowParent,"onUpdate:modelValue":h[0]||(h[0]=v=>a("update:modelValue",v))},null,8,["model-value","item-label","item-data","data","children-prop","multiple","allow-parent"]))),128))])):c.createCommentVNode("",!0),p.mode===c.unref(tv).List?(c.openBlock(),c.createElementBlock("div",jwe,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(l.value,(y,w)=>(c.openBlock(),c.createElementBlock("span",{key:w,class:c.normalizeClass(["wt-tree__label-wrapper",{active:d(y)}])},[c.createElementVNode("p",{class:"wt-tree__label",onClick:v=>s(y)},c.toDisplayString(p.itemLabel?y[p.itemLabel]:y),9,Fwe),d(y)?(c.openBlock(),c.createBlock(f,{key:0,icon:"chat-message-status-sent",class:"wt-tree__label-icon"})):c.createCommentVNode("",!0)],2))),128))])):c.createCommentVNode("",!0)])}}}),Vwe={class:"wt-tree-table-td__content"},zwe={key:0,class:"wt-tree-table-td__icon-wrapper"},Uwe={key:0,class:"wt-tree-table-td__actions"},Hwe={class:"wt-tree-table-td__content"},Kwe=Ne(c.defineComponent({__name:"wt-tree-table-row",props:{data:{},rowPosition:{},childrenProp:{},selectable:{type:Boolean,default:!1},selectedElements:{},dataHeaders:{},gridActions:{type:Boolean,default:!0},nestingLevel:{default:0},searchedProp:{default:"searched"}},emits:["update:selected","expanded-collapse"],setup(i,{emit:o}){const n=i,a=o,l=c.ref(!0),s=c.computed(()=>n.nestingLevel),d=c.computed(()=>n.nestingLevel+1),p=c.computed(()=>n.selectedElements.includes(n.data)),h=()=>{l.value=!1,a("expanded-collapse")},f=(y,w=0)=>{if(y[n.searchedProp]&&w)return!0;if(Array.isArray(y[n.childrenProp])){for(const v of y[n.childrenProp])if(f(v,w+1))return!0}return!1};return c.onMounted(()=>{n.searchedProp&&f(n.data)&&h()}),(y,w)=>{const v=c.resolveComponent("wt-tree-table-row",!0);return c.openBlock(),c.createElementBlock(c.Fragment,null,[c.createElementVNode("tr",{class:c.normalizeClass([[{"wt-tree-table-row--alternate":y.rowPosition%2}],"wt-tree-table-row"])},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(y.dataHeaders,(C,E)=>(c.openBlock(),c.createElementBlock("td",{key:E,class:"wt-tree-table-td"},[c.createElementVNode("div",Vwe,[E?c.createCommentVNode("",!0):(c.openBlock(),c.createElementBlock("div",zwe,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(s.value,T=>(c.openBlock(),c.createElementBlock("div",{key:T,class:"wt-tree-table-row__tree-space"}))),128)),y.selectable?(c.openBlock(),c.createBlock(Z6,{key:0,selected:p.value,"onUpdate:selected":w[0]||(w[0]=T=>y.$emit("update:selected",{data:y.data,select:T}))},null,8,["selected"])):c.createCommentVNode("",!0),y.data[y.childrenProp]?(c.openBlock(),c.createBlock(lp,{key:1,icon:l.value?"tree-expand":"tree-collapse",onClick:w[1]||(w[1]=T=>l.value=!l.value)},null,8,["icon"])):c.createCommentVNode("",!0)])),c.renderSlot(y.$slots,C.value,{index:y.rowPosition,item:y.data},()=>[c.createTextVNode(c.toDisplayString(y.data[C.value]),1)],!0)])]))),128)),y.gridActions?(c.openBlock(),c.createElementBlock("td",Uwe,[c.createElementVNode("div",Hwe,[c.renderSlot(y.$slots,"actions",{index:y.rowPosition,item:y.data},void 0,!0)])])):c.createCommentVNode("",!0)],2),l.value?c.createCommentVNode("",!0):(c.openBlock(!0),c.createElementBlock(c.Fragment,{key:0},c.renderList(y.data[y.childrenProp],(C,E)=>(c.openBlock(),c.createBlock(v,{key:E,"children-prop":y.childrenProp,data:C,"data-headers":y.dataHeaders,"nesting-level":d.value,"row-position":y.rowPosition,"searched-prop":y.searchedProp,selectable:y.selectable,"selected-elements":y.selectedElements,onExpandedCollapse:h,"onUpdate:selected":w[2]||(w[2]=T=>y.$emit("update:selected",{data:T.data,select:T.select}))},c.createSlots({actions:c.withCtx(({item:T})=>[c.renderSlot(y.$slots,"actions",{index:y.rowPosition,item:T},void 0,!0)]),_:2},[c.renderList(y.dataHeaders,(T,A)=>({name:T.value,fn:c.withCtx(({item:I})=>[c.renderSlot(y.$slots,T.value,{index:y.rowPosition,item:I},()=>[c.createElementVNode("div",null,c.toDisplayString(I[T.value]),1)],!0)])}))]),1032,["children-prop","data","data-headers","nesting-level","row-position","searched-prop","selectable","selected-elements"]))),128))],64)}}}),[["__scopeId","data-v-638adedd"]]),Gwe={class:"wt-tree-table"},Wwe={class:"wt-tree-table-wrapper"},Zwe={class:"wt-tree-table-head"},Ywe={class:"wt-tree-table-tr wt-tree-table-tr-head"},Xwe=["onClick"],Qwe={class:"wt-tree-table-th__content"},Jwe={class:"wt-tree-table-th__text"},eve={key:0,class:"wt-tree-table-th__actions"},tve={class:"wt-tree-table-th__content"},ove={class:"wt-tree-table-body"},ive=Ne(c.defineComponent({__name:"wt-tree-table",props:{headers:{},data:{},sortable:{type:Boolean,default:!1},selectable:{type:Boolean,default:!0},selected:{},gridActions:{type:Boolean,default:!0},childrenProp:{},searchedProp:{default:"searched"}},emits:["sort","update:selected"],setup(i,{emit:o}){const n=i,a=o,l=T=>T[n.childrenProp]&&Array.isArray(T[n.childrenProp]),s=T=>{const A=[],I=x=>{if(x._isSelected)return[x];l(x)&&x[n.childrenProp].forEach(I)};return T.forEach(I),A},d=T=>{const A=[],I=x=>{A.push(x),l(x)&&x[n.childrenProp].forEach(I)};return T.forEach(I),A},p=c.computed(()=>n.selected||s(n.data)),h=c.computed(()=>p.value.length===d(n.data).length&&d(n.data).length>0),{tableHeaders:f}=W5e({headers:n.headers}),y=({sort:T})=>n.sortable&&T!==void 0,w=T=>{if(!y(T))return;const A=_B(T.sort);a("sort",T,A)},v=(T,A)=>{T.forEach(I=>{I._isSelected=A,l(I)&&v(I[n.childrenProp],A)})},C=()=>{n.selected?a("update:selected",h.value?[]:[...d(n.data)]):h.value?v(n.data,!1):v(n.data,!0)},E=(T,A)=>{n.selected?A?a("update:selected",[...p.value,T]):a("update:selected",p.value.filter(I=>I!==T)):T._isSelected=!T._isSelected};return(T,A)=>{const I=c.resolveComponent("wt-icon");return c.openBlock(),c.createElementBlock("div",Gwe,[c.createElementVNode("table",Wwe,[c.createElementVNode("thead",Zwe,[c.createElementVNode("tr",Ywe,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(f),(x,O)=>(c.openBlock(),c.createElementBlock("th",{key:O,class:c.normalizeClass([[{"wt-tree-table-th--sortable":y(x)},`wt-tree-table-th--sort-${x.sort}`],"wt-tree-table-th"]),style:c.normalizeStyle(x.width?`min-width:${x.width}`:""),onClick:_=>w(x)},[c.createElementVNode("div",Qwe,[O===0&&T.selectable?(c.openBlock(),c.createElementBlock("div",{key:0,onClick:A[0]||(A[0]=c.withModifiers(()=>{},["stop"]))},[c.createVNode(c.unref(Z6),{selected:h.value,"onUpdate:selected":C},null,8,["selected"])])):c.createCommentVNode("",!0),c.createElementVNode("div",Jwe,c.toDisplayString(x.text),1),T.sortable?(c.openBlock(),c.createBlock(I,{key:1,class:"wt-tree-table-th-sort-arrow wt-tree-table-th-sort-arrow--asc",icon:"sort-arrow-up",size:"sm"})):c.createCommentVNode("",!0),T.sortable?(c.openBlock(),c.createBlock(I,{key:2,class:"wt-tree-table-th-sort-arrow wt-tree-table-th-sort-arrow--desc",icon:"sort-arrow-down",size:"sm"})):c.createCommentVNode("",!0)])],14,Xwe))),128)),T.gridActions?(c.openBlock(),c.createElementBlock("th",eve,[c.createElementVNode("div",tve,[c.renderSlot(T.$slots,"actions-header",{},void 0,!0)])])):c.createCommentVNode("",!0)])]),c.createElementVNode("tbody",ove,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(T.data,(x,O)=>(c.openBlock(),c.createBlock(Kwe,{key:O,"row-position":O,"data-headers":c.unref(f),data:x,selectable:T.selectable,"children-prop":T.childrenProp,"selected-elements":p.value,"searched-prop":T.searchedProp,"onUpdate:selected":A[1]||(A[1]=_=>E(_.data,_.select))},c.createSlots({actions:c.withCtx(({item:_})=>[c.renderSlot(T.$slots,"actions",{item:_},void 0,!0)]),_:2},[c.renderList(c.unref(f),(_,R)=>({name:_.value,fn:c.withCtx(({item:F})=>[c.renderSlot(T.$slots,_.value,{index:O,item:F},()=>[c.createTextVNode(c.toDisplayString(F[_.value]),1)],!0)])}))]),1032,["row-position","data-headers","data","selectable","children-prop","selected-elements","searched-prop"]))),128))])])])}}}),[["__scopeId","data-v-d7f07bc0"]]),Zr=Symbol(0);let xg=!1,ov=!1,nr=null,Au=null,La=null,fa=0,Du=[],iv={};const nve=()=>{},_u=0,vP=1,Sg=2,Ig=3;function ave(){xg=!0,queueMicrotask(CP)}function CP(){if(!Du.length){xg=!1;return}ov=!0;for(let i=0;i<Du.length;i++)Du[i].$st!==_u&&rve(Du[i]);Du=[],xg=!1,ov=!1}function rve(i){let o=[i];for(;i=i[Zr];)i.$e&&i.$st!==_u&&o.push(i);for(let n=o.length-1;n>=0;n--)cv(o[n])}function lve(i){const o=cc();return Dh(o,i.length?i.bind(null,Ru.bind(o)):i,null)}function Re(i){return Dh(nr,i,null)}function Ou(i){return Dh(null,i,null)}function es(){ov||CP()}function Eg(){return nr}function kn(i,o){try{return Dh(o,i,null)}catch(n){nv(o,n);return}}function kP(i,o=nr){return o==null?void 0:o.$cx[i]}function sve(i,o,n=nr){n&&(n.$cx={...n.$cx,[i]:o})}function At(i){if(!i||!nr)return i||nve;const o=nr;return o.$d?Array.isArray(o.$d)?o.$d.push(i):o.$d=[o.$d,i]:o.$d=i,function(){o.$st!==Ig&&(i.call(null),Tg(o.$d)?o.$d=null:Array.isArray(o.$d)&&o.$d.splice(o.$d.indexOf(i),1))}}function Ru(i=!0){if(this.$st!==Ig){if(this.$h)if(Array.isArray(this.$h))for(let o=this.$h.length-1;o>=0;o--)Ru.call(this.$h[o]);else Ru.call(this.$h);if(i){const o=this[Zr];o&&(Array.isArray(o.$h)?o.$h.splice(o.$h.indexOf(this),1):o.$h=null),cve(this)}}}function cve(i){i.$st=Ig,i.$d&&xP(i),i.$s&&dv(i,0),i[Zr]=null,i.$s=null,i.$o=null,i.$h=null,i.$cx=iv,i.$eh=null}function xP(i){try{if(Array.isArray(i.$d))for(let o=i.$d.length-1;o>=0;o--){const n=i.$d[o];n.call(n)}else i.$d.call(i.$d);i.$d=null}catch(o){nv(i,o)}}function Dh(i,o,n){const a=nr,l=Au;nr=i,Au=n;try{return o.call(i)}finally{nr=a,Au=l}}function nv(i,o){if(!i||!i.$eh)throw o;let n=0,a=i.$eh.length,l=o;for(n=0;n<a;n++)try{i.$eh[n](l);break}catch(s){l=s}if(n===a)throw l}function av(){return this.$st===Ig?this.$v:(Au&&!this.$e&&(!La&&Au.$s&&Au.$s[fa]==this?fa++:La?La.push(this):La=[this]),this.$c&&cv(this),this.$v)}function SP(i){const o=Tg(i)?i(this.$v):i;if(this.$ch(this.$v,o)&&(this.$v=o,this.$o))for(let n=0;n<this.$o.length;n++)AP(this.$o[n],Sg);return this.$v}const rv=function(){this[Zr]=null,this.$h=null,nr&&nr.append(this)},hp=rv.prototype;hp.$cx=iv,hp.$eh=null,hp.$c=null,hp.$d=null,hp.append=function(i){i[Zr]=this,this.$h?Array.isArray(this.$h)?this.$h.push(i):this.$h=[this.$h,i]:this.$h=i,i.$cx=i.$cx===iv?this.$cx:{...this.$cx,...i.$cx},this.$eh&&(i.$eh=i.$eh?[...i.$eh,...this.$eh]:this.$eh)},hp.dispose=function(){Ru.call(this)};function cc(){return new rv}const IP=function(o,n,a){rv.call(this),this.$st=n?Sg:_u,this.$i=!1,this.$e=!1,this.$s=null,this.$o=null,this.$v=o,n&&(this.$c=n),a&&a.dirty&&(this.$ch=a.dirty)},lv=IP.prototype;Object.setPrototypeOf(lv,hp),lv.$ch=dve,lv.call=av;function sv(i,o,n){return new IP(i,o,n)}function dve(i,o){return i!==o}function Tg(i){return typeof i=="function"}function cv(i){if(i.$st===vP)for(let o=0;o<i.$s.length&&(cv(i.$s[o]),i.$st!==Sg);o++);i.$st===Sg?EP(i):i.$st=_u}function pve(i){i.$h&&Ru.call(i,!1),i.$d&&xP(i),i.$eh=i[Zr]?i[Zr].$eh:null}function EP(i){let o=La,n=fa;La=null,fa=0;try{pve(i);const a=Dh(i,i.$c,i);TP(i),!i.$e&&i.$i?SP.call(i,a):(i.$v=a,i.$i=!0)}catch(a){TP(i),nv(i,a)}finally{La=o,fa=n,i.$st=_u}}function TP(i){if(La){if(i.$s&&dv(i,fa),i.$s&&fa>0){i.$s.length=fa+La.length;for(let n=0;n<La.length;n++)i.$s[fa+n]=La[n]}else i.$s=La;let o;for(let n=fa;n<i.$s.length;n++)o=i.$s[n],o.$o?o.$o.push(i):o.$o=[i]}else i.$s&&fa<i.$s.length&&(dv(i,fa),i.$s.length=fa)}function AP(i,o){if(!(i.$st>=o)&&(i.$e&&i.$st===_u&&(Du.push(i),xg||ave()),i.$st=o,i.$o))for(let n=0;n<i.$o.length;n++)AP(i.$o[n],vP)}function dv(i,o){let n,a;for(let l=o;l<i.$s.length;l++)n=i.$s[l],n.$o&&(a=n.$o.indexOf(i),n.$o[a]=n.$o[n.$o.length-1],n.$o.pop())}function Ag(...i){}function Yr(i){return i===null}function an(i){return typeof i>"u"}function uve(i){return Yr(i)||an(i)}function DP(i){return(i==null?void 0:i.constructor)===Object}function Li(i){return typeof i=="number"&&!Number.isNaN(i)}function Je(i){return typeof i=="string"}function _P(i){return typeof i=="boolean"}function ar(i){return typeof i=="function"}function rn(i){return Array.isArray(i)}const hve=Event,OP=Symbol("DOM_EVENT");class Ot extends(oz=hve,tz=OP,oz){constructor(n,...a){var s,d;super(n,a[0]);V(this,tz,!0);V(this,"detail");V(this,"triggers",new fve);this.detail=(s=a[0])==null?void 0:s.detail;const l=(d=a[0])==null?void 0:d.trigger;l&&this.triggers.add(l)}get trigger(){return this.triggers.source}get originEvent(){return this.triggers.origin}get isOriginTrusted(){var n;return((n=this.triggers.origin)==null?void 0:n.isTrusted)??!1}}class fve{constructor(){V(this,"chain",[])}get source(){return this.chain[0]}get origin(){return this.chain[this.chain.length-1]}add(o){this.chain.push(o),mve(o)&&this.chain.push(...o.triggers)}remove(o){return this.chain.splice(this.chain.indexOf(o),1)[0]}has(o){return this.chain.some(n=>n===o)}hasType(o){return!!this.findType(o)}findType(o){return this.chain.find(n=>n.type===o)}walk(o){for(const n of this.chain){const a=o(n);if(a)return[n,a]}}[Symbol.iterator](){return this.chain.values()}}function mve(i){return!!(i!=null&&i[OP])}class RP extends EventTarget{constructor(){super(...arguments);V(this,"$ts__events")}addEventListener(n,a,l){return super.addEventListener(n,a,l)}removeEventListener(n,a,l){return super.removeEventListener(n,a,l)}}function uo(i,o,n,a){return i.addEventListener(o,n,a),At(()=>i.removeEventListener(o,n,a))}class go{constructor(o){P(this,n2);P(this,a2);j(this,n2,o),j(this,a2,new AbortController),At(this.abort.bind(this))}get signal(){return b(this,a2).signal}add(o,n,a){if(this.signal.aborted)throw Error("aborted");return b(this,n2).addEventListener(o,n,{...a,signal:a!=null&&a.signal?bve(this.signal,a.signal):this.signal}),this}remove(o,n){return b(this,n2).removeEventListener(o,n),this}abort(o){b(this,a2).abort(o)}}n2=new WeakMap,a2=new WeakMap;function bve(...i){const o=new AbortController,n={signal:o.signal};function a(l){o.abort(l.target.reason)}for(const l of i){if(l.aborted){o.abort(l.reason);break}l.addEventListener("abort",a,n)}return o.signal}function BP(i){return!!(i!=null&&i.type.startsWith("pointer"))}function Dg(i){return!!(i!=null&&i.type.startsWith("touch"))}function gve(i){return/^(click|mouse)/.test((i==null?void 0:i.type)??"")}function _g(i){return!!(i!=null&&i.type.startsWith("key"))}function yve(i){return _g(i)&&i.key==="Enter"}function LP(i){return _g(i)&&(i.key==="Enter"||i.key===" ")}function wve(i){return i instanceof Node}function Ge(i,o,n){if(i)if(!n&&n!==""&&n!==0)i.removeAttribute(o);else{const a=n===!0?"":n+"";i.getAttribute(o)!==a&&i.setAttribute(o,a)}else return}function Zn(i,o,n){if(i)!n&&n!==0?i.style.removeProperty(o):i.style.setProperty(o,n+"");else return}function ct(i,o){const n=sv(i,null,o),a=av.bind(n);return a[Zr]=!0,a.set=SP.bind(n),a}function vve(i){return Tg(i)&&Zr in i}function rr(i,o){const n=sv(o==null?void 0:o.initial,i,o),a=av.bind(n);return a[Zr]=!0,a}function Cve(i,o){const n=sv(null,function(){let l=i();return Tg(l)&&At(l),null},void 0);return n.$e=!0,EP(n),Ru.bind(n,!0)}function kve(i){return vve(i)&&"set"in i}const ue=Cve;function dc(i){return{id:Symbol(),provide:i}}function ma(i,o,n=Eg()){var l;const a=!an(o);sve(i.id,a?o:(l=i.provide)==null?void 0:l.call(i),n)}function qo(i){return kP(i.id)}function ba(i){return!an(kP(i.id))}const _h=Symbol(0),Oh=Symbol(0),PP=Symbol(0),pv={};iz=PP;class xve{constructor(o,n,a){P(this,nl);V(this,"$ts__events");V(this,"$ts__vars");V(this,iz,null);V(this,"$el",ct(null));V(this,"el",null);V(this,"scope",null);V(this,"attachScope",null);V(this,"connectScope",null);V(this,"component",null);V(this,"destroyed",!1);V(this,"props",pv);V(this,"attrs",null);V(this,"styles",null);V(this,"state");V(this,"$state");P(this,r2,[]);P(this,l2,[]);P(this,qp,[]);P(this,s2,[]);var d;this.scope=n,a!=null&&a.scope&&a.scope.append(n);let l=o.state,s=o.props;if(l&&(this.$state=l.create(),this.state=new Proxy(this.$state,{get:(p,h)=>this.$state[h]()}),ma(l,this.$state)),s&&(this.props=Sve(s),a!=null&&a.props))for(const p of Object.keys(a.props))(d=this.props[p])==null||d.set(a.props[p]);At(this.destroy.bind(this))}setup(){kn(()=>{for(const o of b(this,r2))o()},this.scope)}attach(o){this.el||(this.el=o,this.$el.set(o),kn(()=>{this.attachScope=cc(),kn(()=>{for(const n of b(this,l2))n(this.el);k(this,nl,xz).call(this),k(this,nl,Sz).call(this)},this.attachScope)},this.scope),o.dispatchEvent(new Event("attached")))}detach(){var o;(o=this.attachScope)==null||o.dispose(),this.attachScope=null,this.connectScope=null,this.el=null,this.$el.set(null)}connect(){!this.el||!this.attachScope||!b(this,qp).length||kn(()=>{this.connectScope=cc(),kn(()=>{for(const o of b(this,qp))o(this.el)},this.connectScope)},this.attachScope)}disconnect(){var o;(o=this.connectScope)==null||o.dispose(),this.connectScope=null}destroy(){if(this.destroyed)return;this.destroyed=!0,kn(()=>{for(const n of b(this,s2))n(this.el)},this.scope);const o=this.el;this.detach(),this.scope.dispose(),b(this,r2).length=0,b(this,l2).length=0,b(this,qp).length=0,b(this,s2).length=0,this.component=null,this.attrs=null,this.styles=null,this.props=pv,this.scope=null,this.state=pv,this.$state=null,o&&delete o.$}addHooks(o){o.onSetup&&b(this,r2).push(o.onSetup.bind(o)),o.onAttach&&b(this,l2).push(o.onAttach.bind(o)),o.onConnect&&b(this,qp).push(o.onConnect.bind(o)),o.onDestroy&&b(this,s2).push(o.onDestroy.bind(o))}}r2=new WeakMap,l2=new WeakMap,qp=new WeakMap,s2=new WeakMap,nl=new WeakSet,xz=function(){if(this.attrs)for(const o of Object.keys(this.attrs))ar(this.attrs[o])?ue(k(this,nl,Iz).bind(this,o)):Ge(this.el,o,this.attrs[o])},Sz=function(){if(this.styles)for(const o of Object.keys(this.styles))ar(this.styles[o])?ue(k(this,nl,Ez).bind(this,o)):Zn(this.el,o,this.styles[o])},Iz=function(o){Ge(this.el,o,this.attrs[o].call(this.component))},Ez=function(o){Zn(this.el,o,this.styles[o].call(this.component))};function Sve(i){const o={};for(const n of Object.keys(i)){const a=i[n];o[n]=ct(a,a)}return o}let Rh={$$:null};function Ive(i,o){return lve(()=>{Rh.$$=new xve(i,Eg(),o);const n=new i;return Rh.$$.component=n,Rh.$$=null,n})}class Pa extends EventTarget{constructor(){super();V(this,"$$");Rh.$$&&this.attach(Rh)}get el(){return this.$$.el}get $el(){return this.$$.$el()}get scope(){return this.$$.scope}get attachScope(){return this.$$.attachScope}get connectScope(){return this.$$.connectScope}get $props(){return this.$$.props}get $state(){return this.$$.$state}get state(){return this.$$.state}attach({$$:n}){return this.$$=n,n.addHooks(this),this}addEventListener(n,a,l){this.listen(n,a,l)}removeEventListener(n,a,l){var s;(s=this.el)==null||s.removeEventListener(n,a,l)}setAttributes(n){this.$$.attrs||(this.$$.attrs={}),Object.assign(this.$$.attrs,n)}setStyles(n){this.$$.styles||(this.$$.styles={}),Object.assign(this.$$.styles,n)}setCSSVars(n){this.setStyles(n)}createEvent(n,...a){return new Ot(n,a[0])}dispatch(n,...a){if(!this.el)return!1;const l=n instanceof Event?n:new Ot(n,a[0]);return Object.defineProperty(l,"target",{get:()=>this.$$.component}),Ou(()=>{var s,d;return(d=(s=this.$$)[PP])==null||d.call(s,l),this.el.dispatchEvent(l)})}dispatchEvent(n){return this.dispatch(n)}listen(n,a,l){return this.el?uo(this.el,n,a,l):Ag}}class dt extends Pa{subscribe(o){return kn(()=>ue(()=>o(this.state)),this.$$.scope)}destroy(){this.$$.destroy()}}function $t(i,o,n){i[_h]||(i[_h]=new Set),i[_h].add(o)}function ei(i,o,n){i[Oh]||(i[Oh]=new Set),i[Oh].add(o)}class pc{constructor(o){V(this,"id",Symbol(0));V(this,"record");P(this,c2);this.record=o,j(this,c2,Object.getOwnPropertyDescriptors(o))}create(){const o={},n=new Proxy(o,{get:(a,l)=>o[l]()});for(const a of Object.keys(this.record)){const l=b(this,c2)[a].get;o[a]=l?rr(l.bind(n)):ct(this.record[a])}return o}reset(o,n){for(const a of Object.keys(o))!b(this,c2)[a].get&&(!n||n(a))&&o[a].set(this.record[a])}}c2=new WeakMap;function Bu(i){return qo(i)}function Eve(i,o){for(const n of i)n(o)}function Og(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Tve(i){return i.replace(/-./g,o=>o[1].toUpperCase())}function Ave(i){return i.charAt(0).toUpperCase()+i.slice(1)}function Rg(i){return i?"true":"false"}function $P(i){return Object.keys(i)}function Lu(){let i,o;return{promise:new Promise((a,l)=>{i=a,o=l}),resolve:i,reject:o}}function Dve(i){return new Promise(o=>setTimeout(o,i))}function Pu(i){let o=-1,n;function a(...l){n=l,!(o>=0)&&(o=window.requestAnimationFrame(()=>{i.apply(this,n),o=-1,n=void 0}))}return a}const _ve=typeof window<"u"?"requestIdleCallback"in window?window.requestIdleCallback:i=>window.setTimeout(i,1):Ag;function Ove(i,o){return new Promise(n=>{_ve(a=>{i==null||i(a),n()},o)})}var ga={fullscreenEnabled:0,fullscreenElement:1,requestFullscreen:2,exitFullscreen:3,fullscreenchange:4,fullscreenerror:5,fullscreen:6},MP=["webkitFullscreenEnabled","webkitFullscreenElement","webkitRequestFullscreen","webkitExitFullscreen","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],NP=["mozFullScreenEnabled","mozFullScreenElement","mozRequestFullScreen","mozCancelFullScreen","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],jP=["msFullscreenEnabled","msFullscreenElement","msRequestFullscreen","msExitFullscreen","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"],Yn=typeof window<"u"&&typeof window.document<"u"?window.document:{},$a="fullscreenEnabled"in Yn&&Object.keys(ga)||MP[0]in Yn&&MP||NP[0]in Yn&&NP||jP[0]in Yn&&jP||[],fp={requestFullscreen:function(i){return i[$a[ga.requestFullscreen]]()},requestFullscreenFunction:function(i){return i[$a[ga.requestFullscreen]]},get exitFullscreen(){return Yn[$a[ga.exitFullscreen]].bind(Yn)},get fullscreenPseudoClass(){return":"+$a[ga.fullscreen]},addEventListener:function(i,o,n){return Yn.addEventListener($a[ga[i]],o,n)},removeEventListener:function(i,o,n){return Yn.removeEventListener($a[ga[i]],o,n)},get fullscreenEnabled(){return!!Yn[$a[ga.fullscreenEnabled]]},set fullscreenEnabled(i){},get fullscreenElement(){return Yn[$a[ga.fullscreenElement]]},set fullscreenElement(i){},get onfullscreenchange(){return Yn[("on"+$a[ga.fullscreenchange]).toLowerCase()]},set onfullscreenchange(i){return Yn[("on"+$a[ga.fullscreenchange]).toLowerCase()]=i},get onfullscreenerror(){return Yn[("on"+$a[ga.fullscreenerror]).toLowerCase()]},set onfullscreenerror(i){return Yn[("on"+$a[ga.fullscreenerror]).toLowerCase()]=i}},mp=Rve;function Rve(i,o,n){var a=null,l=null,s=n&&n.leading,d=n&&n.trailing;s==null&&(s=!0),d==null&&(d=!s),s==!0&&(d=!1);var p=function(){a&&(clearTimeout(a),a=null)},h=function(){var y=l;p(),y&&y()},f=function(){var y=s&&!a,w=this,v=arguments;if(l=function(){return i.apply(w,v)},a||(a=setTimeout(function(){if(a=null,d)return l()},o)),y)return y=!1,l()};return f.cancel=p,f.flush=h,f}var uv=Bve;function Bve(i,o,n){var a=null,l=null,s=function(){a&&(clearTimeout(a),l=null,a=null)},d=function(){var h=l;s(),h&&h()},p=function(){if(!o)return i.apply(this,arguments);var h=this,f=arguments,y=n&&!a;if(s(),l=function(){i.apply(h,f)},a=setTimeout(function(){if(a=null,!y){var w=l;return l=null,w()}},o),y)return l()};return p.cancel=s,p.flush=d,p}const FP=i=>typeof i=="object"&&i!=null&&i.nodeType===1,qP=(i,o)=>(!o||i!=="hidden")&&i!=="visible"&&i!=="clip",Bg=(i,o)=>{if(i.clientHeight<i.scrollHeight||i.clientWidth<i.scrollWidth){const n=getComputedStyle(i,null);return qP(n.overflowY,o)||qP(n.overflowX,o)||(a=>{const l=(s=>{if(!s.ownerDocument||!s.ownerDocument.defaultView)return null;try{return s.ownerDocument.defaultView.frameElement}catch{return null}})(a);return!!l&&(l.clientHeight<a.scrollHeight||l.clientWidth<a.scrollWidth)})(i)}return!1},Lg=(i,o,n,a,l,s,d,p)=>s<i&&d>o||s>i&&d<o?0:s<=i&&p<=n||d>=o&&p>=n?s-i-a:d>o&&p<n||s<i&&p>n?d-o+l:0,Lve=i=>{const o=i.parentElement;return o??(i.getRootNode().host||null)},Pve=(i,o)=>{var n,a,l,s;if(typeof document>"u")return[];const{scrollMode:d,block:p,inline:h,boundary:f,skipOverflowHiddenElements:y}=o,w=typeof f=="function"?f:pe=>pe!==f;if(!FP(i))throw new TypeError("Invalid target");const v=document.scrollingElement||document.documentElement,C=[];let E=i;for(;FP(E)&&w(E);){if(E=Lve(E),E===v){C.push(E);break}E!=null&&E===document.body&&Bg(E)&&!Bg(document.documentElement)||E!=null&&Bg(E,y)&&C.push(E)}const T=(a=(n=window.visualViewport)==null?void 0:n.width)!=null?a:innerWidth,A=(s=(l=window.visualViewport)==null?void 0:l.height)!=null?s:innerHeight,{scrollX:I,scrollY:x}=window,{height:O,width:_,top:R,right:F,bottom:L,left:H}=i.getBoundingClientRect(),{top:K,right:q,bottom:N,left:U}=(pe=>{const $=window.getComputedStyle(pe);return{top:parseFloat($.scrollMarginTop)||0,right:parseFloat($.scrollMarginRight)||0,bottom:parseFloat($.scrollMarginBottom)||0,left:parseFloat($.scrollMarginLeft)||0}})(i);let te=p==="start"||p==="nearest"?R-K:p==="end"?L+N:R+O/2-K+N,se=h==="center"?H+_/2-U+q:h==="end"?F+q:H-U;const fe=[];for(let pe=0;pe<C.length;pe++){const $=C[pe],{height:Z,width:W,top:Q,right:de,bottom:ge,left:he}=$.getBoundingClientRect();if(d==="if-needed"&&R>=0&&H>=0&&L<=A&&F<=T&&($===v&&!Bg($)||R>=Q&&L<=ge&&H>=he&&F<=de))return fe;const M=getComputedStyle($),ee=parseInt(M.borderLeftWidth,10),Ce=parseInt(M.borderTopWidth,10),xe=parseInt(M.borderRightWidth,10),Ae=parseInt(M.borderBottomWidth,10);let Le=0,re=0;const ce="offsetWidth"in $?$.offsetWidth-$.clientWidth-ee-xe:0,be="offsetHeight"in $?$.offsetHeight-$.clientHeight-Ce-Ae:0,Se="offsetWidth"in $?$.offsetWidth===0?0:W/$.offsetWidth:0,Pe="offsetHeight"in $?$.offsetHeight===0?0:Z/$.offsetHeight:0;if(v===$)Le=p==="start"?te:p==="end"?te-A:p==="nearest"?Lg(x,x+A,A,Ce,Ae,x+te,x+te+O,O):te-A/2,re=h==="start"?se:h==="center"?se-T/2:h==="end"?se-T:Lg(I,I+T,T,ee,xe,I+se,I+se+_,_),Le=Math.max(0,Le+x),re=Math.max(0,re+I);else{Le=p==="start"?te-Q-Ce:p==="end"?te-ge+Ae+be:p==="nearest"?Lg(Q,ge,Z,Ce,Ae+be,te,te+O,O):te-(Q+Z/2)+be/2,re=h==="start"?se-he-ee:h==="center"?se-(he+W/2)+ce/2:h==="end"?se-de+xe+ce:Lg(he,de,W,ee,xe+ce,se,se+_,_);const{scrollLeft:qe,scrollTop:De}=$;Le=Pe===0?0:Math.max(0,Math.min(De+Le/Pe,$.scrollHeight-Z/Pe+be)),re=Se===0?0:Math.max(0,Math.min(qe+re/Se,$.scrollWidth-W/Se+ce)),te+=De-Le,se+=qe-re}fe.push({el:$,top:Le,left:re})}return fe},hv=i=>i===null?"":i+"",$ve=i=>i===null?null:i+"",Mve=i=>i===null?0:Number(i),VP=i=>i!==null,Nve=()=>null,jve=i=>i===null?[]:JSON.parse(i),Fve=i=>i===null?{}:JSON.parse(i);function qve(i){if(i===null)return $ve;switch(typeof i){case"undefined":return hv;case"string":return hv;case"boolean":return VP;case"number":return Mve;case"function":return Nve;case"object":return rn(i)?jve:Fve;default:return hv}}const uc=Symbol(0),zP=Symbol(0),bp=Symbol(0),gp=Symbol(0);var ts;(function(i){i[i.Idle=0]="Idle";const n=1;i[i.Pending=n]="Pending";const a=2;i[i.Ready=a]="Ready"})(ts||(ts={}));function pt(i,o){var a,l,s;class n extends i{constructor(...h){super(...h);V(this,"$");V(this,l,ts.Idle);V(this,a,null);V(this,"keepAlive",!1);V(this,"forwardKeepAlive",!0);if(this.$=kn(()=>Ive(o),null),this.$.$$.addHooks(this),o.props){const f=this.$props,y=Object.getOwnPropertyDescriptors(this);for(const w of Object.keys(y))w in o.props&&(f[w].set(this[w]),delete this[w])}}static get observedAttributes(){var h;if(!this[uc]&&o.props){const f=new Map;for(const y of Object.keys(o.props)){let w=(h=this.attrs)==null?void 0:h[y],v=Je(w)?w:w&&(w==null?void 0:w.attr);v!==!1&&(v||(v=Og(y)),f.set(v,{prop:y,converter:w&&!Je(w)&&(w==null?void 0:w.converter)||qve(o.props[y])}))}this[uc]=f}return this[uc]?Array.from(this[uc].keys()):[]}get scope(){return this.$.$$.scope}get attachScope(){return this.$.$$.attachScope}get connectScope(){return this.$.$$.connectScope}get $props(){return this.$.$$.props}get $state(){return this.$.$$.$state}get state(){return this.$.state}attributeChangedCallback(h,f,y){var C;const w=this.constructor;if(!w[uc]){(C=super.attributeChangedCallback)==null||C.call(this,h,f,y);return}const v=w[uc].get(h);v&&(this[v.prop]=v.converter(y))}connectedCallback(){var y;const h=(y=this.$)==null?void 0:y.$$;if(!h||h.destroyed)return;if(this[bp]!==ts.Ready){zve.call(this);return}if(!this.isConnected)return;this.hasAttribute("keep-alive")&&(this.keepAlive=!0),h.connect(),rn(this[gp])&&Eve(this[gp],this),this[gp]=null;const f=super.connectedCallback;f&&kn(()=>f.call(this),this.connectScope)}disconnectedCallback(){var y;const h=(y=this.$)==null?void 0:y.$$;if(!h||h.destroyed)return;h.disconnect();const f=super.disconnectedCallback;f&&f.call(this),!this.keepAlive&&!this.hasAttribute("keep-alive")&&setTimeout(()=>{requestAnimationFrame(()=>{this.isConnected||h.destroy()})},0)}[(s=uc,l=bp,a=gp,zP)](){const h=this.$.$$,f=this.constructor;if(h.destroyed)return;const y=f[uc];if(y)for(const w of this.attributes){let v=y.get(w.name);v&&v.converter&&h.props[v.prop].set(v.converter(this.getAttribute(w.name)))}h.setup(),h.attach(this),this[bp]=ts.Ready,this.connectedCallback()}subscribe(h){return this.$.subscribe(h)}destroy(){this.disconnectedCallback(),this.$.destroy()}}return V(n,"attrs"),V(n,s,null),Vve(n,o),n}function Vve(i,o){const n=i.prototype,a=o.prototype;if(o.props)for(const l of Object.keys(o.props))Object.defineProperty(n,l,{enumerable:!0,configurable:!0,get(){return this.$props[l]()},set(s){this.$props[l].set(s)}});if(a[_h])for(const l of a[_h])Object.defineProperty(n,l,{enumerable:!0,configurable:!0,get(){return this.$[l]},set(s){this.$[l]=s}});if(a[Oh])for(const l of a[Oh])n[l]=function(...s){return this.$[l](...s)}}function zve(){if(this[bp]!==ts.Idle)return;this[bp]=ts.Pending;const i=Hve(this),o=i&&window.customElements.get(i.localName),n=i&&i[bp]===ts.Ready;if(i&&(!o||!n)){Uve.call(this,i);return}UP.call(this,i)}async function Uve(i){await window.customElements.whenDefined(i.localName),i[bp]!==ts.Ready&&await new Promise(o=>(i[gp]??(i[gp]=[])).push(o)),UP.call(this,i)}function UP(i){if(this.isConnected){if(i){i.keepAlive&&i.forwardKeepAlive&&(this.keepAlive=!0,this.setAttribute("keep-alive",""));const o=this.$.$$.scope;o&&i.$.$$.attachScope.append(o)}this[zP]()}}function Hve(i){let o=i.parentNode,n=i.localName.split("-",1)[0]+"-";for(;o;){if(o.nodeType===1&&o.localName.startsWith(n))return o;o=o.parentNode}return null}function lt(i,o=!1){(o||!window.customElements.get(i.tagName))&&window.customElements.define(i.tagName,i)}var Kve='<path fill-rule="evenodd" clip-rule="evenodd" d="M6 7C5.63181 7 5.33333 7.29848 5.33333 7.66667V14.8667C5.33333 14.9403 5.39361 14.9999 5.46724 15.0009C10.8844 15.0719 15.2614 19.449 15.3325 24.8661C15.3334 24.9397 15.393 25 15.4667 25H26C26.3682 25 26.6667 24.7015 26.6667 24.3333V7.66667C26.6667 7.29848 26.3682 7 26 7H6ZM17.0119 22.2294C17.0263 22.29 17.0802 22.3333 17.1425 22.3333H23.3333C23.7015 22.3333 24 22.0349 24 21.6667V10.3333C24 9.96514 23.7015 9.66667 23.3333 9.66667H8.66667C8.29848 9.66667 8 9.96514 8 10.3333V13.1909C8 13.2531 8.04332 13.3071 8.10392 13.3214C12.5063 14.3618 15.9715 17.827 17.0119 22.2294Z" fill="currentColor"/> <path d="M13.2 25C13.2736 25 13.3334 24.9398 13.3322 24.8661C13.2615 20.5544 9.77889 17.0718 5.46718 17.0011C5.39356 16.9999 5.33333 17.0597 5.33333 17.1333V18.8667C5.33333 18.9403 5.39348 18.9999 5.4671 19.0015C8.67465 19.0716 11.2617 21.6587 11.3319 24.8662C11.3335 24.9399 11.393 25 11.4667 25H13.2Z" fill="currentColor"/> <path d="M5.33333 21.1333C5.33333 21.0597 5.39332 20.9998 5.46692 21.0022C7.57033 21.0712 9.26217 22.763 9.33114 24.8664C9.33356 24.94 9.27364 25 9.2 25H6C5.63181 25 5.33333 24.7015 5.33333 24.3333V21.1333Z" fill="currentColor"/>';const HP=dc();function Rt(){return qo(HP)}const Gve=(navigator==null?void 0:navigator.userAgent.toLowerCase())||"",Pg=/iphone|ipad|ipod|ios|crios|fxios/i.test(Gve),KP=/(iphone|ipod)/gi.test((navigator==null?void 0:navigator.platform)||""),$g=!!window.chrome,Mg=!!window.safari||Pg;function GP(){return Wve()&&ar(screen.orientation.unlock)}function Wve(){return!an(window.screen.orientation)&&!an(window.screen.orientation.lock)}function WP(i,o){return i||(i=document.createElement("audio")),i.canPlayType(o).length>0}function ZP(i,o){return i||(i=document.createElement("video")),i.canPlayType(o).length>0}function YP(i){return i||(i=document.createElement("video")),i.canPlayType("application/vnd.apple.mpegurl").length>0}function XP(i){return!!document.pictureInPictureEnabled&&!(i!=null&&i.disablePictureInPicture)}function QP(i){return ar(i==null?void 0:i.webkitSupportsPresentationMode)&&ar(i==null?void 0:i.webkitSetPresentationMode)}async function Zve(){const i=document.createElement("video");return i.volume=.5,await Dve(0),i.volume===.5}function Yve(){return(window==null?void 0:window.ManagedMediaSource)??(window==null?void 0:window.MediaSource)??(window==null?void 0:window.WebKitMediaSource)}function Xve(){return(window==null?void 0:window.SourceBuffer)??(window==null?void 0:window.WebKitSourceBuffer)}function Ng(){const i=Yve();if(an(i))return!1;const o=i&&ar(i.isTypeSupported)&&i.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),n=Xve(),a=an(n)||!an(n.prototype)&&ar(n.prototype.appendBuffer)&&ar(n.prototype.remove);return!!o&&!!a}function JP(){return Ng()}const Qve=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx|flac)($|\?)/i,Jve=new Set(["audio/mpeg","audio/ogg","audio/3gp","audio/mp3","audio/webm","audio/flac","audio/m4a","audio/m4b","audio/mp4a","audio/mp4"]),eCe=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,tCe=new Set(["video/mp4","video/webm","video/3gp","video/ogg","video/avi","video/mpeg"]),oCe=/\.(m3u8)($|\?)/i,iCe=/\.(mpd)($|\?)/i,nCe=new Set(["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"]),aCe=new Set(["application/dash+xml"]);function e$({src:i,type:o}){return Je(i)?Qve.test(i)||Jve.has(o)||i.startsWith("blob:")&&o==="audio/object":o==="audio/object"}function t$(i){return Je(i.src)?eCe.test(i.src)||tCe.has(i.type)||i.src.startsWith("blob:")&&i.type==="video/object"||$u(i)&&YP():i.type==="video/object"}function $u({src:i,type:o}){return Je(i)&&oCe.test(i)||nCe.has(o)}function fv({src:i,type:o}){return Je(i)&&iCe.test(i)||aCe.has(o)}function o$(i){return Je(i.src)&&(e$(i)||t$(i)||$u(i))}function rCe(i){return typeof window.MediaStream<"u"&&i instanceof window.MediaStream}class Ti{constructor(o,n){P(this,ds);rn(o)?j(this,ds,o):!an(o)&&!an(n)?j(this,ds,[[o,n]]):j(this,ds,[])}get length(){return b(this,ds).length}start(o){return b(this,ds)[o][0]??1/0}end(o){return b(this,ds)[o][1]??1/0}}ds=new WeakMap;function i$(i){if(!i.length)return null;let o=i.start(0);for(let n=1;n<i.length;n++){const a=i.start(n);a<o&&(o=a)}return o}function yp(i){if(!i.length)return null;let o=i.end(0);for(let n=1;n<i.length;n++){const a=i.end(n);a>o&&(o=a)}return o}function lCe(i){if(i.length<=1)return i;i.sort((a,l)=>a[0]-l[0]);let o=[],n=i[0];for(let a=1;a<i.length;a++){const l=i[a];n[1]>=l[0]-1?n=[n[0],Math.max(n[1],l[1])]:(o.push(n),n=l)}return o.push(n),o}function sCe(i,o,n){let a=o[0],l=o[1];return n<a?[n,-1]:n===a?o:a===-1?(o[0]=n,o):(n>a&&(o[1]=n,l===-1&&i.push(o)),lCe(i),o)}function cCe(i,o){const n=new URL(i);for(const a of Object.keys(o))n.searchParams.set(a,o[a]+"");return n.toString()}function os(i,o="preconnect"){const n=document.querySelector(`link[href="${i}"]`);if(!Yr(n))return!0;const a=document.createElement("link");return a.rel=o,a.href=i,a.crossOrigin="true",document.head.append(a),!0}const Bh={};function mv(i){if(Bh[i])return Bh[i].promise;const o=Lu(),n=document.querySelector(`script[src="${i}"]`);if(!Yr(n))return o.resolve(),o.promise;Bh[i]=o;const a=document.createElement("script");return a.src=i,a.onload=()=>{o.resolve(),delete Bh[i]},a.onerror=()=>{o.reject(),delete Bh[i]},setTimeout(()=>document.head.append(a),0),o.promise}function Lh(i){return i==="use-credentials"?"include":Je(i)?"same-origin":void 0}function bv(i,o){return o>=i.startTime&&o<i.endTime}function jg(i,o,n){let a=null,l=Eg();function s(){const d=Je(o)?[o]:o,p=i.toArray().find(h=>d.includes(h.kind)&&h.mode==="showing");if(p!==a){if(!p){n(null),a=null;return}p.readyState==2?n(p):(n(null),kn(()=>{const h=uo(p,"load",()=>{n(p),h()},{once:!0})},l)),a=p}}return s(),uo(i,"mode-change",s)}function dCe(i,o,n){jg(i,o,a=>{if(!a){n("");return}const l=()=>{const s=a==null?void 0:a.activeCues[0];n((s==null?void 0:s.text)||"")};l(),uo(a,"cue-change",l)})}const pCe=Symbol(0),uCe=Symbol(0),hCe=Symbol(0),fCe=Symbol(0),mCe=Symbol(0),bCe=Symbol(0),gCe=Symbol(0),kt={crossOrigin:pCe,readyState:uCe,updateActiveCues:hCe,canLoad:fCe,onModeChange:mCe,native:bCe,nativeHLS:gCe};let hc=(sz=class extends RP{constructor(n){super();P(this,Ci);V(this,"src");V(this,"content");V(this,"type");V(this,"encoding");V(this,"id","");V(this,"label","");V(this,"language","");V(this,"kind");V(this,"default",!1);P(this,pm,!1);P(this,ps,0);P(this,Vp,"disabled");P(this,um,{});P(this,zp,[]);P(this,dn,[]);P(this,us,[]);V(this,lz,0);V(this,rz);V(this,az,null);V(this,nz,null);for(const a of Object.keys(n))this[a]=n[a];this.type||(this.type="vtt"),n.content?k(this,Ci,Tz).call(this,n):n.src||(this[kt.readyState]=2)}static createId(n){return`vds-${n.type}-${n.kind}-${n.src??n.label??"?"}`}get metadata(){return b(this,um)}get regions(){return b(this,zp)}get cues(){return b(this,dn)}get activeCues(){return b(this,us)}get readyState(){return this[kt.readyState]}get mode(){return b(this,Vp)}set mode(n){this.setMode(n)}addCue(n,a){var d;let l=0,s=b(this,dn).length;for(l=0;l<s&&!(n.endTime<=b(this,dn)[l].startTime);l++);l===s?b(this,dn).push(n):b(this,dn).splice(l,0,n),n instanceof TextTrackCue||(d=this[kt.native])==null||d.track.addCue(n),this.dispatchEvent(new Ot("add-cue",{detail:n,trigger:a})),bv(n,b(this,ps))&&this[kt.updateActiveCues](b(this,ps),a)}removeCue(n,a){var s;const l=b(this,dn).indexOf(n);if(l>=0){const d=b(this,us).includes(n);b(this,dn).splice(l,1),(s=this[kt.native])==null||s.track.removeCue(n),this.dispatchEvent(new Ot("remove-cue",{detail:n,trigger:a})),d&&this[kt.updateActiveCues](b(this,ps),a)}}setMode(n,a){var l;b(this,Vp)!==n&&(j(this,Vp,n),n==="disabled"?(j(this,us,[]),k(this,Ci,dx).call(this)):this.readyState===2?this[kt.updateActiveCues](b(this,ps),a):k(this,Ci,lx).call(this),this.dispatchEvent(new Ot("mode-change",{detail:this,trigger:a})),(l=this[kt.onModeChange])==null||l.call(this))}[(lz=kt.readyState,rz=kt.crossOrigin,az=kt.onModeChange,nz=kt.native,kt.updateActiveCues)](n,a){if(j(this,ps,n),this.mode==="disabled"||!b(this,dn).length)return;const l=[];for(let d=0,p=b(this,dn).length;d<p;d++){const h=b(this,dn)[d];bv(h,n)&&l.push(h)}let s=l.length!==b(this,us).length;if(!s){for(let d=0;d<l.length;d++)if(!b(this,us).includes(l[d])){s=!0;break}}j(this,us,l),s&&k(this,Ci,dx).call(this,a)}[kt.canLoad](){j(this,pm,!0),b(this,Vp)!=="disabled"&&k(this,Ci,lx).call(this)}},pm=new WeakMap,ps=new WeakMap,Vp=new WeakMap,um=new WeakMap,zp=new WeakMap,dn=new WeakMap,us=new WeakMap,Ci=new WeakSet,Tz=function(n){Promise.resolve().then(()=>F4).then(({parseText:a,VTTCue:l,VTTRegion:s})=>{!Je(n.content)||n.type==="json"?(k(this,Ci,cx).call(this,n.content,l,s),this.readyState!==3&&k(this,Ci,E3).call(this)):a(n.content,{type:n.type}).then(({cues:d,regions:p})=>{j(this,dn,d),j(this,zp,p),k(this,Ci,E3).call(this)})})},lx=async function(){var n,a;if(!(!b(this,pm)||this[kt.readyState]>0)){if(this[kt.readyState]=1,this.dispatchEvent(new Ot("load-start")),!this.src){k(this,Ci,E3).call(this);return}try{const{parseResponse:l,VTTCue:s,VTTRegion:d}=await Promise.resolve().then(()=>F4),p=(n=this[kt.crossOrigin])==null?void 0:n.call(this),h=fetch(this.src,{headers:this.type==="json"?{"Content-Type":"application/json"}:void 0,credentials:Lh(p)});if(this.type==="json")k(this,Ci,cx).call(this,await(await h).text(),s,d);else{const{errors:f,metadata:y,regions:w,cues:v}=await l(h,{type:this.type,encoding:this.encoding});if(((a=f[0])==null?void 0:a.code)===0)throw f[0];j(this,um,y),j(this,zp,w),j(this,dn,v)}k(this,Ci,E3).call(this)}catch(l){k(this,Ci,sx).call(this,l)}}},E3=function(){if(this[kt.readyState]=2,!this.src||this.type!=="vtt"){const a=this[kt.native];if(a&&!a.managed)for(const l of b(this,dn))a.track.addCue(l)}const n=new Ot("load");this[kt.updateActiveCues](b(this,ps),n),this.dispatchEvent(n)},sx=function(n){this[kt.readyState]=3,this.dispatchEvent(new Ot("error",{detail:n}))},cx=function(n,a,l){try{const{regions:s,cues:d}=wCe(n,a,l);j(this,zp,s),j(this,dn,d)}catch(s){k(this,Ci,sx).call(this,s)}},dx=function(n){this.dispatchEvent(new Ot("cue-change",{trigger:n}))},sz);const yCe=/captions|subtitles/;function xn(i){return yCe.test(i.kind)}function wCe(i,o,n){const a=Je(i)?JSON.parse(i):i;let l=[],s=[];return a.regions&&n&&(l=a.regions.map(d=>Object.assign(new n,d))),(a.cues||rn(a))&&(s=(rn(a)?a:a.cues).filter(d=>Li(d.startTime)&&Li(d.endTime)).map(d=>Object.assign(new o(0,0,""),d))),{regions:l,cues:s}}const vCe=Symbol(0),CCe=Symbol(0),kCe=Symbol(0),xCe=Symbol(0),SCe=Symbol(0),ICe=Symbol(0),ECe=Symbol(0),TCe=Symbol(0),ACe=Symbol(0),ft={add:vCe,remove:CCe,reset:kCe,select:xCe,readonly:SCe,setReadonly:ICe,onReset:ECe,onRemove:TCe,onUserSelect:ACe},DCe=Symbol(0),_Ce=Symbol(0),ln={setAuto:DCe,enableAuto:_Ce};function Ph(i){return i instanceof Error?i:Error(typeof i=="string"?i:JSON.stringify(i))}function is(i,o){if(!i)throw Error("Assertion failed.")}function n$(i,o){const n=o.composedPath()[0];return wve(n)&&i.contains(n)}const gv=new Set;{let i=function(){for(const o of gv)try{o()}catch{}window.requestAnimationFrame(i)};i()}function OCe(i){return gv.add(i),()=>gv.delete(i)}function bo(i,o,n){i.hasAttribute(o)||i.setAttribute(o,n)}function fc(i,o){if(i.hasAttribute("aria-label")||i.hasAttribute("data-no-label"))return;if(!ar(o)){Ge(i,"aria-label",o);return}function n(){Ge(i,"aria-label",o())}ue(n)}function a$(i){const o=getComputedStyle(i);return o.display!=="none"&&parseInt(o.opacity)>0}function RCe(i){return!!i&&("checkVisibility"in i?i.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0}):a$(i))}function r$(i,o){return OCe(()=>o(RCe(i)))}function l$(i,o,n){for(;o;){if(o===i)return!0;if(n!=null&&n(o))break;o=o.parentElement}return!1}function mc(i,o){return new go(i).add("pointerup",n=>{n.button===0&&!n.defaultPrevented&&o(n)}).add("keydown",n=>{LP(n)&&o(n)})}function yv(i){return Dg(i)&&(i.touches.length>1||i.changedTouches.length>1)}function ns(i){let o=Eg(),n=window.requestAnimationFrame(()=>{kn(i,o),n=-1});return()=>void window.cancelAnimationFrame(n)}function wv(i,o,n){let a,l=i,s=i.parentElement,d=i.content.firstElementChild,p=[];!d&&i.firstElementChild&&(i.innerHTML=i.firstElementChild.outerHTML,i.firstElementChild.remove(),d=i.content.firstElementChild);for(let h=0;h<o;h++)a=document.importNode(d,!0),n==null||n(a,h),s.insertBefore(a,l.nextSibling),p.push(a),l=a;return At(()=>{for(let h=0;h<p.length;h++)p[h].remove()}),p}function vv(i){const o=document.createElement("template");return o.innerHTML=i,o.content}function Cv(i){return i.cloneNode(!0).firstElementChild}function s$(i,o,n,{offsetVarName:a,xOffset:l,yOffset:s,...d}){if(!i)return;const p=n.replace(" ","-").replace("-center","");if(Zn(i,"visibility",o?null:"hidden"),!o)return;let h=n.includes("top");const f=w=>n.includes("left")?`calc(-1 * ${w})`:w,y=w=>h?`calc(-1 * ${w})`:w;return dP(o,i,()=>{hP(o,i,{placement:p,middleware:[...d.middleware??[],uP({fallbackAxisSideDirection:"start",crossAxis:!1}),pP()],...d}).then(({x:w,y:v,middlewareData:C})=>{var T;const E=!!((T=C.flip)!=null&&T.index);h=n.includes(E?"bottom":"top"),i.setAttribute("data-placement",E?n.startsWith("top")?n.replace("top","bottom"):n.replace("bottom","top"):n),Object.assign(i.style,{top:`calc(${v+"px"} + ${y(s?s+"px":`var(--${a}-y-offset, 0px)`)})`,left:`calc(${w+"px"} + ${f(l?l+"px":`var(--${a}-x-offset, 0px)`)})`})})})}function BCe(i){return getComputedStyle(i).animationName!=="none"}function wp(i){return i instanceof HTMLElement}function LCe(i){return i?"true":"false"}function sn(i){return()=>LCe(i())}function PCe(){return typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function Pi(i,o=2){return Number(i.toFixed(o))}function kv(i){var o;return((o=String(i).split(".")[1])==null?void 0:o.length)??0}function xv(i,o,n){return Math.max(i,Math.min(n,o))}let Fg=ct(!1);uo(document,"pointerdown",()=>{Fg.set(!1)}),uo(document,"keydown",i=>{i.metaKey||i.altKey||i.ctrlKey||Fg.set(!0)});class lr extends Pa{constructor(){super(...arguments);P(this,al);P(this,Dc,ct(!1))}onConnect(n){ue(()=>{const a=new go(n);if(!Fg()){b(this,Dc).set(!1),qg(n,!1),a.add("pointerenter",k(this,al,_z).bind(this)).add("pointerleave",k(this,al,Oz).bind(this));return}const l=document.activeElement===n;b(this,Dc).set(l),qg(n,l),a.add("focus",k(this,al,Az).bind(this)).add("blur",k(this,al,Dz).bind(this))})}focused(){return b(this,Dc).call(this)}}Dc=new WeakMap,al=new WeakSet,Az=function(){b(this,Dc).set(!0),qg(this.el,!0)},Dz=function(){b(this,Dc).set(!1),qg(this.el,!1)},_z=function(){c$(this.el,!0)},Oz=function(){c$(this.el,!1)};function qg(i,o){Ge(i,"data-focus",o),Ge(i,"data-hocus",o)}function c$(i,o){Ge(i,"data-hocus",o),Ge(i,"data-hover",o)}class d$ extends RP{constructor(){super(...arguments);V(this,"items",[]);V(this,cz,!1)}get length(){return this.items.length}get readonly(){return this[ft.readonly]}indexOf(n){return this.items.indexOf(n)}getById(n){return n===""?null:this.items.find(a=>a.id===n)??null}toArray(){return[...this.items]}[(cz=ft.readonly,Symbol.iterator)](){return this.items.values()}[ft.add](n,a){const l=this.items.length;""+l in this||Object.defineProperty(this,l,{get(){return this.items[l]}}),!this.items.includes(n)&&(this.items.push(n),this.dispatchEvent(new Ot("add",{detail:n,trigger:a})))}[ft.remove](n,a){var s;const l=this.items.indexOf(n);l>=0&&((s=this[ft.onRemove])==null||s.call(this,n,a),this.items.splice(l,1),this.dispatchEvent(new Ot("remove",{detail:n,trigger:a})))}[ft.reset](n){var a;for(const l of[...this.items])this[ft.remove](l,n);this.items=[],this[ft.setReadonly](!1,n),(a=this[ft.onReset])==null||a.call(this)}[ft.setReadonly](n,a){this[ft.readonly]!==n&&(this[ft.readonly]=n,this.dispatchEvent(new Ot("readonly-change",{detail:n,trigger:a})))}}const Sv=fp.fullscreenEnabled;class $Ce extends Pa{constructor(){super(...arguments);P(this,Oc);P(this,_c,!1);P(this,d2,!1)}get active(){return b(this,d2)}get supported(){return Sv}onConnect(){new go(fp).add("fullscreenchange",k(this,Oc,Bz).bind(this)).add("fullscreenerror",k(this,Oc,Lz).bind(this)),At(k(this,Oc,Rz).bind(this))}async enter(){try{return j(this,_c,!0),!this.el||Iv(this.el)?void 0:(p$(),fp.requestFullscreen(this.el))}catch(n){throw j(this,_c,!1),n}}async exit(){if(!(!this.el||!Iv(this.el)))return p$(),fp.exitFullscreen()}}_c=new WeakMap,d2=new WeakMap,Oc=new WeakSet,Rz=async function(){Sv&&await this.exit()},Bz=function(n){const a=Iv(this.el);a!==b(this,d2)&&(a||j(this,_c,!1),j(this,d2,a),this.dispatch("fullscreen-change",{detail:a,trigger:n}))},Lz=function(n){b(this,_c)&&(this.dispatch("fullscreen-error",{detail:null,trigger:n}),j(this,_c,!1))};function Iv(i){if(fp.fullscreenElement===i)return!0;try{return i.matches(fp.fullscreenPseudoClass)}catch{return!1}}function p$(){if(!Sv)throw Error("[vidstack] no fullscreen API")}const W4=class W4 extends Pa{constructor(){super(...arguments);P(this,ka);P(this,Rc,ct(k(this,ka,hx).call(this)));P(this,hs,ct(!1));P(this,Up)}get type(){return b(this,Rc).call(this)}get locked(){return b(this,hs).call(this)}get portrait(){return b(this,Rc).call(this).startsWith("portrait")}get landscape(){return b(this,Rc).call(this).startsWith("landscape")}get supported(){return W4.supported}onConnect(){if(this.supported)uo(screen.orientation,"change",k(this,ka,px).bind(this));else{const n=window.matchMedia("(orientation: landscape)");n.onchange=k(this,ka,px).bind(this),At(()=>n.onchange=null)}At(k(this,ka,Pz).bind(this))}async lock(n){Re(b(this,hs))||b(this,Up)===n||(k(this,ka,ux).call(this),await screen.orientation.lock(n),b(this,hs).set(!0),j(this,Up,n))}async unlock(){Re(b(this,hs))&&(k(this,ka,ux).call(this),j(this,Up,void 0),await screen.orientation.unlock(),b(this,hs).set(!1))}};Rc=new WeakMap,hs=new WeakMap,Up=new WeakMap,ka=new WeakSet,Pz=async function(){this.supported&&b(this,hs).call(this)&&await this.unlock()},px=function(n){b(this,Rc).set(k(this,ka,hx).call(this)),this.dispatch("orientation-change",{detail:{orientation:Re(b(this,Rc)),lock:b(this,Up)},trigger:n})},ux=function(){if(!this.supported)throw Error("[vidstack] no orientation API")},hx=function(){return this.supported?window.screen.orientation.type:window.innerWidth>=window.innerHeight?"landscape-primary":"portrait-primary"},V(W4,"supported",GP());let Vg=W4;function Ev(i){return!Je(i)&&"width"in i&&"height"in i&&Li(i.width)&&Li(i.height)}const u$=new pc({artist:"",artwork:null,audioTrack:null,audioTracks:[],autoPlay:!1,autoPlayError:null,audioGain:null,buffered:new Ti,canLoad:!1,canLoadPoster:!1,canFullscreen:!1,canOrientScreen:GP(),canPictureInPicture:!1,canPlay:!1,clipStartTime:0,clipEndTime:0,controls:!1,get iOSControls(){return KP&&this.mediaType==="video"&&(!this.playsInline||!fp.fullscreenEnabled&&this.fullscreen)},get nativeControls(){return this.controls||this.iOSControls},controlsVisible:!1,get controlsHidden(){return!this.controlsVisible},crossOrigin:null,ended:!1,error:null,fullscreen:!1,get loop(){return this.providedLoop||this.userPrefersLoop},logLevel:"silent",mediaType:"unknown",muted:!1,paused:!0,played:new Ti,playing:!1,playsInline:!1,pictureInPicture:!1,preload:"metadata",playbackRate:1,qualities:[],quality:null,autoQuality:!1,canSetQuality:!0,canSetPlaybackRate:!0,canSetVolume:!1,canSetAudioGain:!1,seekable:new Ti,seeking:!1,source:{src:"",type:""},sources:[],started:!1,textTracks:[],textTrack:null,get hasCaptions(){return this.textTracks.filter(xn).length>0},volume:1,waiting:!1,realCurrentTime:0,get currentTime(){return this.ended?this.duration:this.clipStartTime>0?Math.max(0,Math.min(this.realCurrentTime-this.clipStartTime,this.duration)):this.realCurrentTime},providedDuration:-1,intrinsicDuration:0,get duration(){return this.seekableWindow},get title(){return this.providedTitle||this.inferredTitle},get poster(){return this.providedPoster||this.inferredPoster},get viewType(){return this.providedViewType!=="unknown"?this.providedViewType:this.inferredViewType},get streamType(){return this.providedStreamType!=="unknown"?this.providedStreamType:this.inferredStreamType},get currentSrc(){return this.source},get bufferedStart(){const i=i$(this.buffered)??0;return Math.max(i,this.clipStartTime)},get bufferedEnd(){const i=yp(this.buffered)??0;return Math.min(this.seekableEnd,Math.max(0,i-this.clipStartTime))},get bufferedWindow(){return Math.max(0,this.bufferedEnd-this.bufferedStart)},get seekableStart(){if(this.isLiveDVR&&this.liveDVRWindow>0)return Math.max(0,this.seekableEnd-this.liveDVRWindow);const i=i$(this.seekable)??0;return Math.max(i,this.clipStartTime)},get seekableEnd(){if(this.providedDuration>0)return this.providedDuration;const i=this.liveSyncPosition>0?this.liveSyncPosition:this.canPlay?yp(this.seekable)??1/0:0;return this.clipEndTime>0?Math.min(this.clipEndTime,i):i},get seekableWindow(){const i=this.seekableEnd-this.seekableStart;return isNaN(i)?1/0:Math.max(0,i)},canAirPlay:!1,canGoogleCast:!1,remotePlaybackState:"disconnected",remotePlaybackType:"none",remotePlaybackLoader:null,remotePlaybackInfo:null,get isAirPlayConnected(){return this.remotePlaybackType==="airplay"&&this.remotePlaybackState==="connected"},get isGoogleCastConnected(){return this.remotePlaybackType==="google-cast"&&this.remotePlaybackState==="connected"},pointer:"fine",orientation:"landscape",width:0,height:0,mediaWidth:0,mediaHeight:0,lastKeyboardAction:null,userBehindLiveEdge:!1,liveEdgeTolerance:10,minLiveDVRWindow:60,get canSeek(){return/unknown|on-demand|:dvr/.test(this.streamType)&&Number.isFinite(this.duration)&&(!this.isLiveDVR||this.duration>=this.liveDVRWindow)},get live(){return this.streamType.includes("live")||!Number.isFinite(this.duration)},get liveEdgeStart(){return this.live&&Number.isFinite(this.seekableEnd)?Math.max(0,this.seekableEnd-this.liveEdgeTolerance):0},get liveEdge(){return this.live&&(!this.canSeek||!this.userBehindLiveEdge&&this.currentTime>=this.liveEdgeStart)},get liveEdgeWindow(){return this.live&&Number.isFinite(this.seekableEnd)?this.seekableEnd-this.liveEdgeStart:0},get isLiveDVR(){return/:dvr/.test(this.streamType)},get liveDVRWindow(){return Math.max(this.inferredLiveDVRWindow,this.minLiveDVRWindow)},autoPlaying:!1,providedTitle:"",inferredTitle:"",providedLoop:!1,userPrefersLoop:!1,providedPoster:"",inferredPoster:"",inferredViewType:"unknown",providedViewType:"unknown",providedStreamType:"unknown",inferredStreamType:"unknown",liveSyncPosition:null,inferredLiveDVRWindow:0,savedState:null}),h$=new Set(["autoPlayError","autoPlaying","buffered","canPlay","error","paused","played","playing","seekable","seeking","waiting"]),MCe=new Set([...h$,"ended","inferredPoster","inferredStreamType","inferredTitle","intrinsicDuration","inferredLiveDVRWindow","liveSyncPosition","realCurrentTime","savedState","started","userBehindLiveEdge"]);function f$(i,o=!1){const n=o?h$:MCe;u$.reset(i,a=>n.has(a)),es()}function m$(i,o){const n=i+o.clipStartTime(),a=Math.floor(i)===Math.floor(o.seekableStart()),l=Math.floor(n)===Math.floor(o.seekableEnd());return a?o.seekableStart():l?o.seekableEnd():o.isLiveDVR()&&o.liveDVRWindow()>0&&n<o.seekableEnd()-o.liveDVRWindow()?o.bufferedStart():Math.min(Math.max(o.seekableStart()+.1,n),o.seekableEnd()-.1)}class NCe{constructor(o=void 0){P(this,ao);P(this,Hp,null);P(this,xa,null);P(this,p2,-1);P(this,Z4);j(this,Z4,o)}setTarget(o){j(this,Hp,o)}getPlayer(o){var n;return b(this,xa)?b(this,xa):((n=o??b(this,Hp))==null||n.dispatchEvent(new Ot("find-media-player",{detail:a=>void j(this,xa,a),bubbles:!0,composed:!0})),b(this,xa))}setPlayer(o){j(this,xa,o)}startLoading(o){k(this,ao,Co).call(this,"media-start-loading",o)}startLoadingPoster(o){k(this,ao,Co).call(this,"media-poster-start-loading",o)}requestAirPlay(o){k(this,ao,Co).call(this,"media-airplay-request",o)}requestGoogleCast(o){k(this,ao,Co).call(this,"media-google-cast-request",o)}play(o){k(this,ao,Co).call(this,"media-play-request",o)}pause(o){k(this,ao,Co).call(this,"media-pause-request",o)}mute(o){k(this,ao,Co).call(this,"media-mute-request",o)}unmute(o){k(this,ao,Co).call(this,"media-unmute-request",o)}enterFullscreen(o,n){k(this,ao,Co).call(this,"media-enter-fullscreen-request",n,o)}exitFullscreen(o,n){k(this,ao,Co).call(this,"media-exit-fullscreen-request",n,o)}lockScreenOrientation(o,n){k(this,ao,Co).call(this,"media-orientation-lock-request",n,o)}unlockScreenOrientation(o){k(this,ao,Co).call(this,"media-orientation-unlock-request",o)}enterPictureInPicture(o){k(this,ao,Co).call(this,"media-enter-pip-request",o)}exitPictureInPicture(o){k(this,ao,Co).call(this,"media-exit-pip-request",o)}seeking(o,n){k(this,ao,Co).call(this,"media-seeking-request",n,o)}seek(o,n){k(this,ao,Co).call(this,"media-seek-request",n,o)}seekToLiveEdge(o){k(this,ao,Co).call(this,"media-live-edge-request",o)}changeDuration(o,n){k(this,ao,Co).call(this,"media-duration-change-request",n,o)}changeClipStart(o,n){k(this,ao,Co).call(this,"media-clip-start-change-request",n,o)}changeClipEnd(o,n){k(this,ao,Co).call(this,"media-clip-end-change-request",n,o)}changeVolume(o,n){k(this,ao,Co).call(this,"media-volume-change-request",n,Math.max(0,Math.min(1,o)))}changeAudioTrack(o,n){k(this,ao,Co).call(this,"media-audio-track-change-request",n,o)}changeQuality(o,n){k(this,ao,Co).call(this,"media-quality-change-request",n,o)}requestAutoQuality(o){this.changeQuality(-1,o)}changeTextTrackMode(o,n,a){k(this,ao,Co).call(this,"media-text-track-change-request",a,{index:o,mode:n})}changePlaybackRate(o,n){k(this,ao,Co).call(this,"media-rate-change-request",n,o)}changeAudioGain(o,n){k(this,ao,Co).call(this,"media-audio-gain-change-request",n,o)}resumeControls(o){k(this,ao,Co).call(this,"media-resume-controls-request",o)}pauseControls(o){k(this,ao,Co).call(this,"media-pause-controls-request",o)}togglePaused(o){const n=this.getPlayer(o==null?void 0:o.target);n&&(n.state.paused?this.play(o):this.pause(o))}toggleControls(o){const n=this.getPlayer(o==null?void 0:o.target);n&&(n.controls.showing?n.controls.hide(0,o):n.controls.show(0,o))}toggleMuted(o){const n=this.getPlayer(o==null?void 0:o.target);n&&(n.state.muted?this.unmute(o):this.mute(o))}toggleFullscreen(o,n){const a=this.getPlayer(n==null?void 0:n.target);a&&(a.state.fullscreen?this.exitFullscreen(o,n):this.enterFullscreen(o,n))}togglePictureInPicture(o){const n=this.getPlayer(o==null?void 0:o.target);n&&(n.state.pictureInPicture?this.exitPictureInPicture(o):this.enterPictureInPicture(o))}showCaptions(o){const n=this.getPlayer(o==null?void 0:o.target);if(!n)return;let a=n.state.textTracks,l=b(this,p2);(!a[l]||!xn(a[l]))&&(l=-1),l===-1&&(l=a.findIndex(s=>xn(s)&&s.default)),l===-1&&(l=a.findIndex(s=>xn(s))),l>=0&&this.changeTextTrackMode(l,"showing",o),j(this,p2,-1)}disableCaptions(o){const n=this.getPlayer(o==null?void 0:o.target);if(!n)return;const a=n.state.textTracks,l=n.state.textTrack;if(l){const s=a.indexOf(l);this.changeTextTrackMode(s,"disabled",o),j(this,p2,s)}}toggleCaptions(o){const n=this.getPlayer(o==null?void 0:o.target);n&&(n.state.textTrack?this.disableCaptions():this.showCaptions())}userPrefersLoopChange(o,n){k(this,ao,Co).call(this,"media-user-loop-change-request",n,o)}}Hp=new WeakMap,xa=new WeakMap,p2=new WeakMap,Z4=new WeakMap,ao=new WeakSet,Co=function(o,n,a){var p,h;const l=new Ot(o,{bubbles:!0,composed:!0,cancelable:!0,detail:a,trigger:n});let s=(n==null?void 0:n.target)||null;s&&s instanceof dt&&(s=s.el),s=!s||s===document||s===window||s===document.body||((p=b(this,xa))==null?void 0:p.el)&&s instanceof Node&&!b(this,xa).el.contains(s)?b(this,Hp)??((h=this.getPlayer())==null?void 0:h.el):s??b(this,Hp),b(this,xa)?o==="media-play-request"&&!b(this,xa).state.canLoad?s==null||s.dispatchEvent(l):b(this,xa).canPlayQueue.enqueue(o,()=>s==null?void 0:s.dispatchEvent(l)):s==null||s.dispatchEvent(l)},qKe=function(o){};class jCe{constructor(){V(this,"playerId","vds-player");V(this,"mediaId",null);P(this,di,{volume:null,muted:null,audioGain:null,time:null,lang:null,captions:null,rate:null,quality:null});V(this,"saveTimeThrottled",mp(this.saveTime.bind(this),1e3))}async getVolume(){return b(this,di).volume}async setVolume(o){b(this,di).volume=o,this.save()}async getMuted(){return b(this,di).muted}async setMuted(o){b(this,di).muted=o,this.save()}async getTime(){return b(this,di).time}async setTime(o,n){const a=o<0;b(this,di).time=a?null:o,a||n?this.saveTime():this.saveTimeThrottled()}async getLang(){return b(this,di).lang}async setLang(o){b(this,di).lang=o,this.save()}async getCaptions(){return b(this,di).captions}async setCaptions(o){b(this,di).captions=o,this.save()}async getPlaybackRate(){return b(this,di).rate}async setPlaybackRate(o){b(this,di).rate=o,this.save()}async getAudioGain(){return b(this,di).audioGain}async setAudioGain(o){b(this,di).audioGain=o,this.save()}async getVideoQuality(){return b(this,di).quality}async setVideoQuality(o){b(this,di).quality=o,this.save()}onChange(o,n,a="vds-player"){const l=a?localStorage.getItem(a):null,s=n?localStorage.getItem(n):null;this.playerId=a,this.mediaId=n,j(this,di,{volume:null,muted:null,audioGain:null,lang:null,captions:null,rate:null,quality:null,...l?JSON.parse(l):{},time:s?+s:null})}save(){if(!this.playerId)return;const o=JSON.stringify({...b(this,di),time:void 0});localStorage.setItem(this.playerId,o)}saveTime(){if(!this.mediaId)return;const o=(b(this,di).time??0).toString();localStorage.setItem(this.mediaId,o)}}di=new WeakMap;const $h=Symbol(0);class b$ extends d${get selected(){return this.items.find(o=>o.selected)??null}get selectedIndex(){return this.items.findIndex(o=>o.selected)}[ft.onRemove](o,n){this[ft.select](o,!1,n)}[ft.add](o,n){o[$h]=!1,Object.defineProperty(o,"selected",{get(){return this[$h]},set:a=>{var l;this.readonly||((l=this[ft.onUserSelect])==null||l.call(this),this[ft.select](o,a))}}),super[ft.add](o,n)}[ft.select](o,n,a){if(n===(o==null?void 0:o[$h]))return;const l=this.selected;o&&(o[$h]=n),(n?l!==o:l===o)&&(l&&(l[$h]=!1),this.dispatchEvent(new Ot("change",{detail:{prev:l,current:this.selected},trigger:a})))}}class FCe extends b${}class qCe{constructor(){P(this,ja);V(this,"priority",0);P(this,hm,!0);P(this,fs,null);P(this,fm,null);P(this,Bc,new Set)}canRender(o,n){return!!n}attach(o){j(this,fs,o),o&&(o.textTracks.onchange=k(this,ja,mx).bind(this))}addTrack(o){b(this,Bc).add(o),k(this,ja,$z).call(this,o)}removeTrack(o){var n,a;(a=(n=o[kt.native])==null?void 0:n.remove)==null||a.call(n),o[kt.native]=null,b(this,Bc).delete(o)}changeTrack(o){const n=o==null?void 0:o[kt.native];n&&n.track.mode!=="showing"&&(n.track.mode="showing"),j(this,fm,o)}setDisplay(o){j(this,hm,o),k(this,ja,mx).call(this)}detach(){b(this,fs)&&(b(this,fs).textTracks.onchange=null);for(const o of b(this,Bc))this.removeTrack(o);b(this,Bc).clear(),j(this,fs,null),j(this,fm,null)}}hm=new WeakMap,fs=new WeakMap,fm=new WeakMap,Bc=new WeakMap,ja=new WeakSet,$z=function(o){var a;if(!b(this,fs))return;const n=o[a=kt.native]??(o[a]=k(this,ja,Mz).call(this,o));wp(n)&&(b(this,fs).append(n),n.track.mode=n.default?"showing":"disabled")},Mz=function(o){const n=document.createElement("track"),a=o.default||o.mode==="showing",l=o.src&&o.type==="vtt";return n.id=o.id,n.src=l?o.src:"",n.label=o.label,n.kind=o.kind,n.default=a,o.language&&(n.srclang=o.language),a&&!l&&k(this,ja,fx).call(this,o,n.track),n},fx=function(o,n){var a;if(!(o.src&&o.type==="vtt"||(a=n.cues)!=null&&a.length))for(const l of o.cues)n.addCue(l)},mx=function(o){for(const n of b(this,Bc)){const a=n[kt.native];if(!a)continue;if(!b(this,hm)){a.track.mode=a.managed?"hidden":"disabled";continue}const l=a.track.mode==="showing";l&&k(this,ja,fx).call(this,n,a.track),n.setMode(l?"showing":"disabled",o)}};class VCe{constructor(o){P(this,ki);P(this,Kp,null);P(this,u2);P(this,Gp,[]);P(this,mm);P(this,bm,!1);P(this,Sa,null);P(this,rl,null);j(this,mm,o);const n=o.textTracks;j(this,u2,n),ue(k(this,ki,Nz).bind(this)),At(k(this,ki,Vz).bind(this)),new go(n).add("add",k(this,ki,Fz).bind(this)).add("remove",k(this,ki,qz).bind(this)).add("mode-change",k(this,ki,R1).bind(this))}add(o){b(this,Gp).push(o),Ou(k(this,ki,R1).bind(this))}remove(o){o.detach(),b(this,Gp).splice(b(this,Gp).indexOf(o),1),Ou(k(this,ki,R1).bind(this))}attachVideo(o){requestAnimationFrame(()=>{if(j(this,Kp,o),o){j(this,Sa,new qCe),b(this,Sa).attach(o);for(const n of b(this,u2))k(this,ki,bx).call(this,n)}k(this,ki,R1).call(this)})}}Kp=new WeakMap,u2=new WeakMap,Gp=new WeakMap,mm=new WeakMap,bm=new WeakMap,Sa=new WeakMap,rl=new WeakMap,ki=new WeakSet,Nz=function(){const{nativeControls:o}=b(this,mm).$state;j(this,bm,o()),k(this,ki,R1).call(this)},bx=function(o){var n;xn(o)&&((n=b(this,Sa))==null||n.addTrack(o))},jz=function(o){var n;xn(o)&&((n=b(this,Sa))==null||n.removeTrack(o))},Fz=function(o){k(this,ki,bx).call(this,o.detail)},qz=function(o){k(this,ki,jz).call(this,o.detail)},R1=function(){var a,l,s,d,p,h,f;const o=b(this,u2).selected;if(b(this,Kp)&&(b(this,bm)||o!=null&&o[kt.nativeHLS])){(a=b(this,rl))==null||a.changeTrack(null),(l=b(this,Sa))==null||l.setDisplay(!0),(s=b(this,Sa))==null||s.changeTrack(o);return}if((d=b(this,Sa))==null||d.setDisplay(!1),(p=b(this,Sa))==null||p.changeTrack(null),!o){(h=b(this,rl))==null||h.changeTrack(null);return}const n=b(this,Gp).sort((y,w)=>y.priority-w.priority).find(y=>y.canRender(o,b(this,Kp)));b(this,rl)!==n&&((f=b(this,rl))==null||f.detach(),n==null||n.attach(b(this,Kp)),j(this,rl,n??null)),n==null||n.changeTrack(o)},Vz=function(){var o,n;(o=b(this,Sa))==null||o.detach(),j(this,Sa,null),(n=b(this,rl))==null||n.detach(),j(this,rl,null)};class zCe extends d${constructor(){super();P(this,dl);P(this,Wp,!1);P(this,ll,{});P(this,sl,null);P(this,cl,null);V(this,dz);P(this,gm,uv(async()=>{var l;if(!b(this,Wp))return;!b(this,cl)&&b(this,sl)&&j(this,cl,await b(this,sl).getLang());const n=await((l=b(this,sl))==null?void 0:l.getCaptions()),a=[["captions","subtitles"],"chapters","descriptions","metadata"];for(const s of a){const d=this.getByKind(s);if(d.find(w=>w.mode==="showing"))continue;const p=b(this,cl)?d.find(w=>w.language===b(this,cl)):null,h=rn(s)?b(this,ll)[s.find(w=>b(this,ll)[w])||""]:b(this,ll)[s],f=p??h,y=f&&xn(f);f&&(!y||n!==!1)&&(f.mode="showing",y&&k(this,dl,gx).call(this,f))}},300));P(this,h2,null);P(this,ym,k(this,dl,zz).bind(this))}get selected(){return this.items.find(a=>a.mode==="showing"&&xn(a))??null}get selectedIndex(){const n=this.selected;return n?this.indexOf(n):-1}get preferredLang(){return b(this,cl)}set preferredLang(n){j(this,cl,n),k(this,dl,yx).call(this,n)}add(n,a){const l=n instanceof hc,s=l?n:new hc(n),d=n.kind==="captions"||n.kind==="subtitles"?"captions":n.kind;return b(this,ll)[d]&&n.default&&delete n.default,s.addEventListener("mode-change",b(this,ym)),this[ft.add](s,a),s[kt.crossOrigin]=this[kt.crossOrigin],b(this,Wp)&&s[kt.canLoad](),n.default&&(b(this,ll)[d]=s),b(this,gm).call(this),this}remove(n,a){if(j(this,h2,n),!!this.items.includes(n))return n===b(this,ll)[n.kind]&&delete b(this,ll)[n.kind],n.mode="disabled",n[kt.onModeChange]=null,n.removeEventListener("mode-change",b(this,ym)),this[ft.remove](n,a),j(this,h2,null),this}clear(n){for(const a of[...this.items])this.remove(a,n);return this}getByKind(n){const a=Array.isArray(n)?n:[n];return this.items.filter(l=>a.includes(l.kind))}[(dz=kt.crossOrigin,kt.canLoad)](){if(!b(this,Wp)){for(const n of this.items)n[kt.canLoad]();j(this,Wp,!0),b(this,gm).call(this)}}setStorage(n){j(this,sl,n)}}Wp=new WeakMap,ll=new WeakMap,sl=new WeakMap,cl=new WeakMap,gm=new WeakMap,h2=new WeakMap,ym=new WeakMap,dl=new WeakSet,zz=function(n){const a=n.detail;if(b(this,sl)&&xn(a)&&a!==b(this,h2)&&k(this,dl,gx).call(this,a),a.mode==="showing"){const l=xn(a)?["captions","subtitles"]:[a.kind];for(const s of this.items)s.mode==="showing"&&s!=a&&l.includes(s.kind)&&(s.mode="disabled")}this.dispatchEvent(new Ot("mode-change",{detail:n.detail,trigger:n}))},gx=function(n){var a,l;n.mode!=="disabled"&&k(this,dl,yx).call(this,n.language),(l=(a=b(this,sl))==null?void 0:a.setCaptions)==null||l.call(a,n.mode==="showing")},yx=function(n){var a,l;(l=(a=b(this,sl))==null?void 0:a.setLang)==null||l.call(a,j(this,cl,n))};class UCe extends b${constructor(){super(...arguments);P(this,Zp,!1);V(this,"switch","current");V(this,pz)}get auto(){return b(this,Zp)||this.readonly}[(pz=ln.enableAuto,ft.onUserSelect)](){this[ln.setAuto](!1)}[ft.onReset](n){this[ln.enableAuto]=void 0,this[ln.setAuto](!1,n)}autoSelect(n){var a;this.readonly||b(this,Zp)||!this[ln.enableAuto]||((a=this[ln.enableAuto])==null||a.call(this,n),this[ln.setAuto](!0,n))}getBySrc(n){return this.items.find(a=>a.src===n)}[ln.setAuto](n,a){b(this,Zp)!==n&&(j(this,Zp,n),this.dispatchEvent(new Ot("auto-change",{detail:n,trigger:a})))}}Zp=new WeakMap;function HCe(i){return i instanceof HTMLAudioElement}function KCe(i){return i instanceof HTMLVideoElement}function GCe(i){return HCe(i)||KCe(i)}class vp extends Pa{}const WCe={togglePaused:"k Space",toggleMuted:"m",toggleFullscreen:"f",togglePictureInPicture:"i",toggleCaptions:"c",seekBackward:"j J ArrowLeft",seekForward:"l L ArrowRight",volumeUp:"ArrowUp",volumeDown:"ArrowDown",speedUp:">",slowDown:"<"},Mh=new Set(["Shift","Alt","Meta","Ctrl"]),ZCe='button, [role="button"]',g$='input, textarea, select, [contenteditable], [role^="menuitem"], [role="timer"]';class YCe extends vp{constructor(n){super();P(this,xi);P(this,Zi);P(this,Yp);P(this,ms,null);j(this,Zi,n)}onConnect(){ue(k(this,xi,Uz).bind(this))}}Zi=new WeakMap,xi=new WeakSet,Uz=function(){const{keyDisabled:n,keyTarget:a}=this.$props;if(n())return;const l=a()==="player"?this.el:document,s=ct(!1);l===this.el?new go(this.el).add("focusin",()=>s.set(!0)).add("focusout",d=>{this.el.contains(d.target)||s.set(!1)}):(Re(s)||s.set(document.querySelector("[data-media-player]")===this.el),uo(document,"focusin",d=>{const p=d.composedPath().find(h=>h instanceof Element&&h.localName==="media-player");p!==void 0&&s.set(this.el===p)})),ue(()=>{s()&&new go(l).add("keyup",k(this,xi,Hz).bind(this)).add("keydown",k(this,xi,Kz).bind(this)).add("keydown",k(this,xi,Gz).bind(this),{capture:!0})})},Hz=function(n){var d,p;const a=document.activeElement;if(!n.key||!this.$state.canSeek()||a!=null&&a.matches(g$))return;let{method:l,value:s}=k(this,xi,D5).call(this,n);if(!Je(s)&&!rn(s)){(d=s==null?void 0:s.onKeyUp)==null||d.call(s,{event:n,player:b(this,Zi).player,remote:b(this,Zi).remote}),(p=s==null?void 0:s.callback)==null||p.call(s,n,b(this,Zi).remote);return}if(l!=null&&l.startsWith("seek")&&(n.preventDefault(),n.stopPropagation(),b(this,ms)?(k(this,xi,wx).call(this,n,l==="seekForward"),j(this,ms,null)):(b(this,Zi).remote.seek(b(this,Yp),n),j(this,Yp,void 0))),l!=null&&l.startsWith("volume")){const h=this.el.querySelector("[data-media-volume-slider]");h==null||h.dispatchEvent(new KeyboardEvent("keyup",{key:l==="volumeUp"?"Up":"Down",shiftKey:n.shiftKey,trigger:n}))}},Kz=function(n){var p,h,f,y;if(!n.key||Mh.has(n.key))return;const a=document.activeElement;if(a!=null&&a.matches(g$)||LP(n)&&(a!=null&&a.matches(ZCe)))return;let{method:l,value:s}=k(this,xi,D5).call(this,n),d=!n.metaKey&&/^[0-9]$/.test(n.key);if(!Je(s)&&!rn(s)&&!d){(p=s==null?void 0:s.onKeyDown)==null||p.call(s,{event:n,player:b(this,Zi).player,remote:b(this,Zi).remote}),(h=s==null?void 0:s.callback)==null||h.call(s,n,b(this,Zi).remote);return}if(!l&&d&&!JCe(n)){n.preventDefault(),n.stopPropagation(),b(this,Zi).remote.seek(this.$state.duration()/10*Number(n.key),n);return}if(l){switch(n.preventDefault(),n.stopPropagation(),l){case"seekForward":case"seekBackward":k(this,xi,Zz).call(this,n,l,l==="seekForward");break;case"volumeUp":case"volumeDown":const w=this.el.querySelector("[data-media-volume-slider]");if(w)w.dispatchEvent(new KeyboardEvent("keydown",{key:l==="volumeUp"?"Up":"Down",shiftKey:n.shiftKey,trigger:n}));else{const C=n.shiftKey?.1:.05;b(this,Zi).remote.changeVolume(this.$state.volume()+(l==="volumeUp"?+C:-C),n)}break;case"toggleFullscreen":b(this,Zi).remote.toggleFullscreen("prefer-media",n);break;case"speedUp":case"slowDown":const v=this.$state.playbackRate();b(this,Zi).remote.changePlaybackRate(Math.max(.25,Math.min(2,v+(l==="speedUp"?.25:-.25))),n);break;default:(y=(f=b(this,Zi).remote)[l])==null||y.call(f,n)}this.$state.lastKeyboardAction.set({action:l,event:n})}},Gz=function(n){GCe(n.target)&&k(this,xi,D5).call(this,n).method&&n.preventDefault()},D5=function(n){const a={...this.$props.keyShortcuts(),...b(this,Zi).ariaKeys},l=Object.keys(a).find(s=>{var f;const d=a[s],p=rn(d)?d.join(" "):Je(d)?d:d==null?void 0:d.keys,h=(f=rn(p)?p:p==null?void 0:p.split(" "))==null?void 0:f.map(y=>QCe(y).replace(/Control/g,"Ctrl").split("+"));return h==null?void 0:h.some(y=>{const w=new Set(y.filter(v=>Mh.has(v)));for(const v of Mh){const C=v.toLowerCase()+"Key";if(!w.has(v)&&n[C])return!1}return y.every(v=>Mh.has(v)?n[v.toLowerCase()+"Key"]:n.key===v.replace("Space"," "))})});return{method:l,value:l?a[l]:null}},Yp=new WeakMap,Wz=function(n,a){const l=n.shiftKey?10:5;return j(this,Yp,Math.max(0,Math.min((b(this,Yp)??this.$state.currentTime())+(a==="seekForward"?+l:-l),this.$state.duration())))},ms=new WeakMap,wx=function(n,a){var l;(l=b(this,ms))==null||l.dispatchEvent(new KeyboardEvent(n.type,{key:a?"Right":"Left",shiftKey:n.shiftKey,trigger:n}))},Zz=function(n,a,l){this.$state.canSeek()&&(b(this,ms)||j(this,ms,this.el.querySelector("[data-media-time-slider]")),b(this,ms)?k(this,xi,wx).call(this,n,l):b(this,Zi).remote.seeking(k(this,xi,Wz).call(this,n,a),n))};const XCe=["!","@","#","$","%","^","&","*","(",")"];function QCe(i){return i.replace(/Shift\+(\d)/g,(o,n)=>XCe[n-1])}function JCe(i){for(const o of Mh)if(i[o.toLowerCase()+"Key"])return!0;return!1}class eke extends vp{constructor(){super(...arguments);P(this,ro);P(this,f2,-2);P(this,bs,!1);P(this,wm,ct(!1));P(this,m2,ct(!1));P(this,Lc,null);P(this,b2,ct(!0));V(this,"defaultDelay",2e3)}get canIdle(){return b(this,b2).call(this)}set canIdle(n){b(this,b2).set(n)}get hideOnMouseLeave(){const{hideControlsOnMouseLeave:n}=this.$props;return b(this,wm).call(this)||n()}set hideOnMouseLeave(n){b(this,wm).set(n)}get showing(){return this.$state.controlsVisible()}show(n=0,a){k(this,ro,_5).call(this),b(this,bs)||k(this,ro,T3).call(this,!0,n,a)}hide(n=this.defaultDelay,a){k(this,ro,_5).call(this),b(this,bs)||k(this,ro,T3).call(this,!1,n,a)}pause(n){j(this,bs,!0),k(this,ro,_5).call(this),k(this,ro,T3).call(this,!0,0,n)}resume(n){j(this,bs,!1),!this.$state.paused()&&k(this,ro,T3).call(this,!1,this.defaultDelay,n)}onConnect(){ue(k(this,ro,Yz).bind(this))}}f2=new WeakMap,bs=new WeakMap,wm=new WeakMap,m2=new WeakMap,Lc=new WeakMap,b2=new WeakMap,ro=new WeakSet,Yz=function(){const{viewType:n}=this.$state;if(!this.el||!b(this,b2).call(this))return;if(n()==="audio"){this.show();return}ue(k(this,ro,Xz).bind(this)),ue(k(this,ro,Qz).bind(this));const a=k(this,ro,Jz).bind(this),l=k(this,ro,eU).bind(this),s=k(this,ro,tU).bind(this);new go(this.el).add("can-play",d=>this.show(0,d)).add("play",a).add("pause",l).add("end",s).add("auto-play-fail",l)},Xz=function(){if(!this.el)return;const{started:n,pointer:a,paused:l}=this.$state;if(!n()||a()!=="fine")return;const s=new go(this.el),d=this.hideOnMouseLeave;(!d||!b(this,m2).call(this))&&ue(()=>{l()||s.add("pointermove",k(this,ro,vx).bind(this))}),d&&s.add("mouseenter",k(this,ro,oU).bind(this)).add("mouseleave",k(this,ro,iU).bind(this))},Qz=function(){const{paused:n,started:a,autoPlayError:l}=this.$state;if(n()||l()&&!a())return;const s=k(this,ro,vx).bind(this);ue(()=>{if(!this.el)return;const d=this.$state.pointer(),p=d==="coarse",h=new go(this.el),f=[p?"touchend":"pointerup","keydown"];for(const y of f)h.add(y,s,{passive:!1})})},Jz=function(n){n.triggers.hasType("ended")||(this.show(0,n),this.hide(void 0,n))},eU=function(n){this.show(0,n)},tU=function(n){const{loop:a}=this.$state;a()&&this.hide(0,n)},oU=function(n){b(this,m2).set(!1),this.show(0,n),this.hide(void 0,n)},iU=function(n){b(this,m2).set(!0),this.hide(0,n)},_5=function(){window.clearTimeout(b(this,f2)),j(this,f2,-1)},vx=function(n){var a;n.MEDIA_GESTURE||b(this,bs)||yv(n)||(_g(n)&&(n.key==="Escape"?((a=this.el)==null||a.focus(),j(this,Lc,null)):b(this,Lc)&&(n.preventDefault(),requestAnimationFrame(()=>{var l;(l=b(this,Lc))==null||l.focus(),j(this,Lc,null)}))),this.show(0,n),this.hide(this.defaultDelay,n))},T3=function(n,a,l){if(a===0){k(this,ro,Cx).call(this,n,l);return}j(this,f2,window.setTimeout(()=>{this.scope&&k(this,ro,Cx).call(this,n&&!b(this,bs),l)},a))},Cx=function(n,a){var l;this.$state.controlsVisible()!==n&&(this.$state.controlsVisible.set(n),!n&&document.activeElement&&((l=this.el)!=null&&l.contains(document.activeElement))&&(j(this,Lc,document.activeElement),requestAnimationFrame(()=>{var s;(s=this.el)==null||s.focus({preventScroll:!0})})),this.dispatch("controls-change",{detail:n,trigger:a}))};class tke{constructor(){V(this,"name","audio");V(this,"target")}canPlay(o){return e$(o)?!Je(o.src)||o.type==="?"||WP(this.target,o.type):!1}mediaType(){return"audio"}async load(o){return new(await Promise.resolve().then(()=>MHe)).AudioProvider(this.target,o)}}class Tv{constructor(){V(this,"name","video");V(this,"target")}canPlay(o){return t$(o)?!Je(o.src)||o.type==="?"||ZP(this.target,o.type):!1}mediaType(){return"video"}async load(o){return new(await Promise.resolve().then(()=>UHe)).VideoProvider(this.target,o)}}const Y4=class Y4 extends Tv{constructor(){super(...arguments);V(this,"name","hls")}canPlay(n){return Y4.supported&&$u(n)}async load(n){return new(await Promise.resolve().then(()=>XHe)).HLSProvider(this.target,n)}};V(Y4,"supported",Ng());let Av=Y4;const X4=class X4 extends Tv{constructor(){super(...arguments);V(this,"name","dash")}canPlay(n){return X4.supported&&fv(n)}async load(n){return new(await Promise.resolve().then(()=>aKe)).DASHProvider(this.target,n)}};V(X4,"supported",JP());let Dv=X4;class oke{constructor(){V(this,"name","vimeo");V(this,"target")}preconnect(){const o=["https://i.vimeocdn.com","https://f.vimeocdn.com","https://fresnel.vimeocdn.com"];for(const n of o)os(n)}canPlay(o){return Je(o.src)&&o.type==="video/vimeo"}mediaType(){return"video"}async load(o){return new(await Promise.resolve().then(()=>dKe)).VimeoProvider(this.target,o)}async loadPoster(o,n,a){const{resolveVimeoVideoId:l,getVimeoVideoInfo:s}=await Promise.resolve().then(()=>lKe);if(!Je(o.src))return null;const{videoId:d,hash:p}=l(o.src);return d?s(d,a,p).then(h=>h?h.poster:null):null}}class ike{constructor(){V(this,"name","youtube");V(this,"target")}preconnect(){const o=["https://www.google.com","https://i.ytimg.com","https://googleads.g.doubleclick.net","https://static.doubleclick.net"];for(const n of o)os(n)}canPlay(o){return Je(o.src)&&o.type==="video/youtube"}mediaType(){return"video"}async load(o){return new(await Promise.resolve().then(()=>bKe)).YouTubeProvider(this.target,o)}async loadPoster(o,n,a){const{findYouTubePoster:l,resolveYouTubeVideoId:s}=await Promise.resolve().then(()=>fKe),d=Je(o.src)&&s(o.src);return d?l(d,a):null}}const _v=Symbol(0),nke=["autoPlay","canAirPlay","canFullscreen","canGoogleCast","canLoad","canLoadPoster","canPictureInPicture","canPlay","canSeek","ended","fullscreen","isAirPlayConnected","isGoogleCastConnected","live","liveEdge","loop","mediaType","muted","paused","pictureInPicture","playing","playsInline","remotePlaybackState","remotePlaybackType","seeking","started","streamType","viewType","waiting"],ake={artist:"",artwork:null,autoplay:!1,autoPlay:!1,clipStartTime:0,clipEndTime:0,controls:!1,currentTime:0,crossorigin:null,crossOrigin:null,duration:-1,fullscreenOrientation:"landscape",googleCast:{},load:"visible",posterLoad:"visible",logLevel:"silent",loop:!1,muted:!1,paused:!0,playsinline:!1,playsInline:!1,playbackRate:1,poster:"",preload:"metadata",preferNativeHLS:!1,src:"",title:"",controlsDelay:2e3,hideControlsOnMouseLeave:!1,viewType:"unknown",streamType:"unknown",volume:1,liveEdgeTolerance:10,minLiveDVRWindow:60,keyDisabled:!1,keyTarget:"player",keyShortcuts:WCe,storage:null};class y$ extends vp{constructor(n,a){super();P(this,vm);P(this,Xp);j(this,vm,n),j(this,Xp,a)}async onAttach(n){const a=this.$props[b(this,vm)]();if(a==="eager")requestAnimationFrame(b(this,Xp));else if(a==="idle")Ove(b(this,Xp));else if(a==="visible"){let l,s=new IntersectionObserver(d=>{this.scope&&d[0].isIntersecting&&(l==null||l(),l=void 0,b(this,Xp).call(this))});s.observe(n),l=At(()=>s.disconnect())}}}vm=new WeakMap,Xp=new WeakMap;class rke{constructor(o,n){P(this,Q4);P(this,Cm);P(this,hr);j(this,Cm,o),j(this,hr,n)}notify(o,...n){b(this,Cm).call(this,new Ot(o,{detail:n==null?void 0:n[0],trigger:n==null?void 0:n[1]}))}async ready(o,n){return Ou(async()=>{var U,te,se,fe,pe,$,Z;const{logger:a}=b(this,hr),{autoPlay:l,canPlay:s,started:d,duration:p,seekable:h,buffered:f,remotePlaybackInfo:y,playsInline:w,savedState:v,source:C}=b(this,hr).$state;if(s())return;const E={duration:(o==null?void 0:o.duration)??p(),seekable:(o==null?void 0:o.seekable)??h(),buffered:(o==null?void 0:o.buffered)??f(),provider:b(this,hr).$provider()};this.notify("can-play",E,n),es();let T=b(this,hr).$provider(),{storage:A,qualities:I}=b(this,hr),{muted:x,volume:O,clipStartTime:_,playbackRate:R}=b(this,hr).$props;await((U=A==null?void 0:A.onLoad)==null?void 0:U.call(A,C()));const F=(te=v())==null?void 0:te.currentTime,L=(se=v())==null?void 0:se.paused,H=await(A==null?void 0:A.getTime()),K=F??H??_(),q=L===!1||L!==!0&&!d()&&l();if(T){T.setVolume(await(A==null?void 0:A.getVolume())??O()),T.setMuted(x()||!!await(A==null?void 0:A.getMuted()));const W=await(A==null?void 0:A.getAudioGain())??1;W>1&&((pe=(fe=T.audioGain)==null?void 0:fe.setGain)==null||pe.call(fe,W)),($=T.setPlaybackRate)==null||$.call(T,await(A==null?void 0:A.getPlaybackRate())??R()),(Z=T.setPlaysInline)==null||Z.call(T,w()),K>0&&T.setCurrentTime(K)}const N=await(A==null?void 0:A.getVideoQuality());if(N&&I.length){let W=null,Q=1/0;for(const de of I){const ge=Math.abs(N.width-de.width)+Math.abs(N.height-de.height)+(N.bitrate?Math.abs(N.bitrate-(de.bitrate??0)):0);ge<Q&&(W=de,Q=ge)}W&&(W.selected=!0)}s()&&q?await k(this,Q4,nU).call(this,n):H&&H>0&&this.notify("started",void 0,n),y.set(null)})}}Cm=new WeakMap,hr=new WeakMap,Q4=new WeakSet,nU=async function(o){const{player:n,$state:{autoPlaying:a,muted:l}}=b(this,hr);a.set(!0);const s=new Ot("auto-play-attempt",{trigger:o});try{await n.play(s)}catch{}};class lke{constructor(){P(this,Pc,new Map)}enqueue(o,n){b(this,Pc).set(o,n)}serve(o){const n=this.peek(o);return b(this,Pc).delete(o),n}peek(o){return b(this,Pc).get(o)}delete(o){b(this,Pc).delete(o)}clear(){b(this,Pc).clear()}}Pc=new WeakMap;class w${constructor(){P(this,Mc);P(this,$c,!1);P(this,g2,Lu());P(this,fr,new Map)}get size(){return b(this,fr).size}get isServing(){return b(this,$c)}async waitForFlush(){b(this,$c)||await b(this,g2).promise}enqueue(o,n){if(b(this,$c)){n();return}b(this,fr).delete(o),b(this,fr).set(o,n)}serve(o){var n;(n=b(this,fr).get(o))==null||n(),b(this,fr).delete(o)}start(){k(this,Mc,kx).call(this),j(this,$c,!0),b(this,fr).size>0&&k(this,Mc,kx).call(this)}stop(){j(this,$c,!1)}reset(){this.stop(),b(this,fr).clear(),k(this,Mc,xx).call(this)}}$c=new WeakMap,g2=new WeakMap,fr=new WeakMap,Mc=new WeakSet,kx=function(){for(const o of b(this,fr).keys())this.serve(o);k(this,Mc,xx).call(this)},xx=function(){b(this,g2).resolve(),j(this,g2,Lu())};class ske extends vp{constructor(n,a,l){super();P(this,Vt);P(this,gs);P(this,It);P(this,ys);V(this,"controls");P(this,Qp);P(this,ws);P(this,Vo);P(this,Nc,new w$);P(this,y2,!1);P(this,Jp);j(this,gs,n),j(this,It,a),j(this,ys,l),j(this,Vo,l.$provider),this.controls=new eke,j(this,Qp,new $Ce),j(this,ws,new Vg)}onAttach(){this.listen("fullscreen-change",k(this,Vt,fU).bind(this))}onConnect(n){const a=Object.getOwnPropertyNames(Object.getPrototypeOf(this)),l=new go(n),s=k(this,Vt,lU).bind(this);for(const d of a)d.startsWith("media-")&&l.add(d,s);k(this,Vt,aU).call(this),ue(k(this,Vt,rU).bind(this)),ue(k(this,Vt,sU).bind(this)),ue(k(this,Vt,cU).bind(this)),ue(k(this,Vt,dU).bind(this)),ue(k(this,Vt,pU).bind(this)),ue(k(this,Vt,uU).bind(this)),ue(k(this,Vt,hU).bind(this))}onDestroy(){try{const n=this.createEvent("destroy"),{pictureInPicture:a,fullscreen:l}=this.$state;l()&&this.exitFullscreen("prefer-media",n),a()&&this.exitPictureInPicture(n)}catch{}b(this,Nc).reset()}async play(n){const{canPlay:a,paused:l,autoPlaying:s}=this.$state;if(k(this,Vt,Sx).call(this,n)||!Re(l))return;n&&b(this,It).queue.enqueue("media-play-request",n);const d=Re(s);try{const p=Re(b(this,Vo));return Ov(p,Re(a)),cke(d),await p.play()}catch(p){const h=this.createEvent("play-fail",{detail:Ph(p),trigger:n});throw h.autoPlay=d,b(this,gs).handle(h),p}}async pause(n){const{canPlay:a,paused:l}=this.$state;if(!Re(l)){n&&b(this,It).queue.enqueue("media-pause-request",n);try{const s=Re(b(this,Vo));return Ov(s,Re(a)),await s.pause()}catch(s){throw b(this,It).queue.delete("media-pause-request"),s}}}setAudioGain(n,a){const{audioGain:l,canSetAudioGain:s}=this.$state;if(l()===n)return;const d=b(this,Vo).call(this);if(!(d!=null&&d.audioGain)||!s())throw Error("[vidstack] audio gain api not available");a&&b(this,It).queue.enqueue("media-audio-gain-change-request",a),d.audioGain.setGain(n)}seekToLiveEdge(n){const{canPlay:a,live:l,liveEdge:s,canSeek:d,liveSyncPosition:p,seekableEnd:h,userBehindLiveEdge:f}=this.$state;if(f.set(!1),Re(()=>!l()||s()||!d()))return;const y=Re(b(this,Vo));Ov(y,Re(a)),n&&b(this,It).queue.enqueue("media-seek-request",n);const w=h()-2;y.setCurrentTime(Math.min(w,p()??w))}async enterFullscreen(n="prefer-media",a){const l=k(this,Vt,Ix).call(this,n);if(v$(n,l),!l.active)return Re(this.$state.pictureInPicture)&&(j(this,y2,!0),await this.exitPictureInPicture(a)),a&&b(this,It).queue.enqueue("media-enter-fullscreen-request",a),l.enter()}async exitFullscreen(n="prefer-media",a){const l=k(this,Vt,Ix).call(this,n);if(v$(n,l),!!l.active){a&&b(this,It).queue.enqueue("media-exit-fullscreen-request",a);try{const s=await l.exit();return b(this,y2)&&Re(this.$state.canPictureInPicture)&&await this.enterPictureInPicture(),s}finally{j(this,y2,!1)}}}async enterPictureInPicture(n){if(k(this,Vt,Ex).call(this),!this.$state.pictureInPicture())return n&&b(this,It).queue.enqueue("media-enter-pip-request",n),await b(this,Vo).call(this).pictureInPicture.enter()}async exitPictureInPicture(n){if(k(this,Vt,Ex).call(this),!!this.$state.pictureInPicture())return n&&b(this,It).queue.enqueue("media-exit-pip-request",n),await b(this,Vo).call(this).pictureInPicture.exit()}async"media-airplay-request"(n){try{await this.requestAirPlay(n)}catch{}}async requestAirPlay(n){var a;try{const l=(a=b(this,Vo).call(this))==null?void 0:a.airPlay;if(!(l!=null&&l.supported))throw Error("No AirPlay adapter.");return n&&b(this,It).queue.enqueue("media-airplay-request",n),await l.prompt()}catch(l){throw b(this,It).queue.delete("media-airplay-request"),l}}async"media-google-cast-request"(n){try{await this.requestGoogleCast(n)}catch{}}async requestGoogleCast(n){try{const{canGoogleCast:a}=this.$state;if(!Re(a)){const s=Error("Cast not available.");throw s.code="CAST_NOT_AVAILABLE",s}if(os("https://www.gstatic.com"),!b(this,Jp)){const s=await Promise.resolve().then(()=>xKe);j(this,Jp,new s.GoogleCastLoader)}await b(this,Jp).prompt(b(this,ys)),n&&b(this,It).queue.enqueue("media-google-cast-request",n);const l=Re(this.$state.remotePlaybackState)!=="disconnected";l&&this.$state.savedState.set({paused:Re(this.$state.paused),currentTime:Re(this.$state.currentTime)}),this.$state.remotePlaybackLoader.set(l?b(this,Jp):null)}catch(a){throw b(this,It).queue.delete("media-google-cast-request"),a}}"media-clip-start-change-request"(n){const{clipStartTime:a}=this.$state;a.set(n.detail)}"media-clip-end-change-request"(n){const{clipEndTime:a}=this.$state;a.set(n.detail),this.dispatch("duration-change",{detail:n.detail,trigger:n})}"media-duration-change-request"(n){const{providedDuration:a,clipEndTime:l}=this.$state;a.set(n.detail),l()<=0&&this.dispatch("duration-change",{detail:n.detail,trigger:n})}"media-audio-track-change-request"(n){const{logger:a,audioTracks:l}=b(this,ys);if(l.readonly)return;const s=n.detail,d=l[s];if(d){const p=n.type;b(this,It).queue.enqueue(p,n),d.selected=!0}}async"media-enter-fullscreen-request"(n){try{await this.enterFullscreen(n.detail,n)}catch(a){k(this,Vt,Tx).call(this,a,n)}}async"media-exit-fullscreen-request"(n){try{await this.exitFullscreen(n.detail,n)}catch(a){k(this,Vt,Tx).call(this,a,n)}}async"media-orientation-lock-request"(n){const a=n.type;try{b(this,It).queue.enqueue(a,n),await b(this,ws).lock(n.detail)}catch{b(this,It).queue.delete(a)}}async"media-orientation-unlock-request"(n){const a=n.type;try{b(this,It).queue.enqueue(a,n),await b(this,ws).unlock()}catch{b(this,It).queue.delete(a)}}async"media-enter-pip-request"(n){try{await this.enterPictureInPicture(n)}catch(a){k(this,Vt,Ax).call(this,a,n)}}async"media-exit-pip-request"(n){try{await this.exitPictureInPicture(n)}catch(a){k(this,Vt,Ax).call(this,a,n)}}"media-live-edge-request"(n){const{live:a,liveEdge:l,canSeek:s}=this.$state;if(!(!a()||l()||!s())){b(this,It).queue.enqueue("media-seek-request",n);try{this.seekToLiveEdge()}catch{b(this,It).queue.delete("media-seek-request")}}}async"media-loop-request"(n){try{b(this,It).looping=!0,b(this,It).replaying=!0,await this.play(n)}catch{b(this,It).looping=!1}}"media-user-loop-change-request"(n){this.$state.userPrefersLoop.set(n.detail)}async"media-pause-request"(n){if(!this.$state.paused())try{await this.pause(n)}catch{}}async"media-play-request"(n){if(this.$state.paused())try{await this.play(n)}catch{}}"media-rate-change-request"(n){const{playbackRate:a,canSetPlaybackRate:l}=this.$state;if(a()===n.detail||!l())return;const s=b(this,Vo).call(this);s!=null&&s.setPlaybackRate&&(b(this,It).queue.enqueue("media-rate-change-request",n),s.setPlaybackRate(n.detail))}"media-audio-gain-change-request"(n){try{this.setAudioGain(n.detail,n)}catch{}}"media-quality-change-request"(n){var p,h;const{qualities:a,storage:l,logger:s}=b(this,ys);if(a.readonly)return;b(this,It).queue.enqueue("media-quality-change-request",n);const d=n.detail;if(d<0)a.autoSelect(n),n.isOriginTrusted&&((p=l==null?void 0:l.setVideoQuality)==null||p.call(l,null));else{const f=a[d];f&&(f.selected=!0,n.isOriginTrusted&&((h=l==null?void 0:l.setVideoQuality)==null||h.call(l,{id:f.id,width:f.width,height:f.height,bitrate:f.bitrate})))}}"media-pause-controls-request"(n){const a=n.type;b(this,It).queue.enqueue(a,n),this.controls.pause(n)}"media-resume-controls-request"(n){const a=n.type;b(this,It).queue.enqueue(a,n),this.controls.resume(n)}"media-seek-request"(n){const{canSeek:a,ended:l,live:s,seekableEnd:d,userBehindLiveEdge:p}=this.$state,h=n.detail;l()&&(b(this,It).replaying=!0);const f=n.type;b(this,It).seeking=!1,b(this,It).queue.delete(f);const y=m$(h,this.$state);!Number.isFinite(y)||!a()||(b(this,It).queue.enqueue(f,n),b(this,Vo).call(this).setCurrentTime(y),s()&&n.isOriginTrusted&&Math.abs(d()-y)>=2&&p.set(!0))}"media-seeking-request"(n){const a=n.type;b(this,It).queue.enqueue(a,n),this.$state.seeking.set(!0),b(this,It).seeking=!0}"media-start-loading"(n){if(this.$state.canLoad())return;const a=n.type;b(this,It).queue.enqueue(a,n),b(this,gs).handle(this.createEvent("can-load"))}"media-poster-start-loading"(n){if(this.$state.canLoadPoster())return;const a=n.type;b(this,It).queue.enqueue(a,n),b(this,gs).handle(this.createEvent("can-load-poster"))}"media-text-track-change-request"(n){const{index:a,mode:l}=n.detail,s=b(this,ys).textTracks[a];if(s){const d=n.type;b(this,It).queue.enqueue(d,n),s.setMode(l,n)}}"media-mute-request"(n){if(this.$state.muted())return;const a=n.type;b(this,It).queue.enqueue(a,n),b(this,Vo).call(this).setMuted(!0)}"media-unmute-request"(n){const{muted:a,volume:l}=this.$state;if(!a())return;const s=n.type;b(this,It).queue.enqueue(s,n),b(this,ys).$provider().setMuted(!1),l()===0&&(b(this,It).queue.enqueue(s,n),b(this,Vo).call(this).setVolume(.25))}"media-volume-change-request"(n){const{muted:a,volume:l}=this.$state,s=n.detail;if(l()===s)return;const d=n.type;b(this,It).queue.enqueue(d,n),b(this,Vo).call(this).setVolume(s),s>0&&a()&&(b(this,It).queue.enqueue(d,n),b(this,Vo).call(this).setMuted(!1))}}gs=new WeakMap,It=new WeakMap,ys=new WeakMap,Qp=new WeakMap,ws=new WeakMap,Vo=new WeakMap,Nc=new WeakMap,Vt=new WeakSet,aU=function(){const{load:n}=this.$props,{canLoad:a}=this.$state;if(n()!=="play"||a())return;const l=this.listen("media-play-request",s=>{k(this,Vt,Sx).call(this,s),l()})},rU=function(){const n=b(this,Vo).call(this),a=this.$state.canPlay();return n&&a&&b(this,Nc).start(),()=>{b(this,Nc).stop()}},lU=function(n){n.stopPropagation(),!n.defaultPrevented&&this[n.type]&&(Re(b(this,Vo))?this[n.type](n):b(this,Nc).enqueue(n.type,()=>{Re(b(this,Vo))&&this[n.type](n)}))},Sx=function(n){const{load:a}=this.$props,{canLoad:l}=this.$state;if(a()==="play"&&!l()){const s=this.createEvent("media-start-loading",{trigger:n});return this.dispatchEvent(s),b(this,Nc).enqueue("media-play-request",async()=>{try{await this.play(s)}catch{}}),!0}return!1},y2=new WeakMap,Ix=function(n){const a=Re(b(this,Vo));return n==="prefer-media"&&b(this,Qp).supported||n==="media"?b(this,Qp):a==null?void 0:a.fullscreen},Ex=function(){if(!this.$state.canPictureInPicture())throw Error("[vidstack] no pip support")},sU=function(){this.controls.defaultDelay=this.$props.controlsDelay()},cU=function(){var l,s;const{canSetAudioGain:n}=this.$state,a=!!((s=(l=b(this,Vo).call(this))==null?void 0:l.audioGain)!=null&&s.supported);n.set(a)},dU=function(){var l,s;const{canAirPlay:n}=this.$state,a=!!((s=(l=b(this,Vo).call(this))==null?void 0:l.airPlay)!=null&&s.supported);n.set(a)},pU=function(){const{canGoogleCast:n,source:a}=this.$state,l=$g&&!Pg&&o$(a());n.set(l)},uU=function(){var l,s;const{canFullscreen:n}=this.$state,a=b(this,Qp).supported||!!((s=(l=b(this,Vo).call(this))==null?void 0:l.fullscreen)!=null&&s.supported);n.set(a)},hU=function(){var l,s;const{canPictureInPicture:n}=this.$state,a=!!((s=(l=b(this,Vo).call(this))==null?void 0:l.pictureInPicture)!=null&&s.supported);n.set(a)},Jp=new WeakMap,fU=async function(n){const a=Re(this.$props.fullscreenOrientation),l=n.detail;if(!(an(a)||a==="none"||!b(this,ws).supported))if(l){if(b(this,ws).locked)return;this.dispatch("media-orientation-lock-request",{detail:a,trigger:n})}else b(this,ws).locked&&this.dispatch("media-orientation-unlock-request",{trigger:n})},Tx=function(n,a){b(this,gs).handle(this.createEvent("fullscreen-error",{detail:Ph(n)}))},Ax=function(n,a){b(this,gs).handle(this.createEvent("picture-in-picture-error",{detail:Ph(n)}))},VKe=function(n,a,l){};function Ov(i,o){if(!(i&&o))throw Error("[vidstack] media not ready")}function v$(i,o){if(!(o!=null&&o.supported))throw Error("[vidstack] no fullscreen support")}function cke(i){if(!(!PCe()||!i))throw Error("[vidstack] autoplay blocked")}class dke{constructor(){V(this,"seeking",!1);V(this,"looping",!1);V(this,"replaying",!1);V(this,"queue",new lke)}}const pke=new Set(["auto-play","auto-play-fail","can-load","sources-change","source-change","load-start","abort","error","loaded-metadata","loaded-data","can-play","play","play-fail","pause","playing","seeking","seeked","waiting"]);class uke extends vp{constructor(n,a){super();P(this,Oe);P(this,$n);P(this,eo);P(this,Oo,new Map);P(this,e0,!1);P(this,w2,[]);P(this,t0,[-1,-1]);P(this,o0,!1);P(this,vs);P(this,jc,!1);P(this,v2,null);V(this,"seeking",mp(n=>{const{seeking:a,realCurrentTime:l,paused:s}=this.$state;a.set(!0),l.set(n.detail),k(this,Oe,ii).call(this,"media-seeking-request",n),s()&&(j(this,vs,n),b(this,C2).call(this)),j(this,t0,[-1,-1])},150,{leading:!0}));P(this,C2,uv(()=>{if(!b(this,vs))return;j(this,o0,!0);const{waiting:n,playing:a}=this.$state;n.set(!0),a.set(!1);const l=this.createEvent("waiting",{trigger:b(this,vs)});b(this,Oo).set("waiting",l),this.dispatch(l),j(this,vs,void 0),j(this,o0,!1)},300));j(this,$n,n),j(this,eo,a)}onAttach(n){n.setAttribute("aria-busy","true"),new go(this).add("fullscreen-change",this["fullscreen-change"].bind(this)).add("fullscreen-error",this["fullscreen-error"].bind(this)).add("orientation-change",this["orientation-change"].bind(this))}onConnect(n){ue(k(this,Oe,SU).bind(this)),k(this,Oe,gU).call(this),k(this,Oe,yU).call(this),k(this,Oe,wU).call(this),k(this,Oe,mU).call(this),At(k(this,Oe,bU).bind(this))}onDestroy(){const{audioTracks:n,qualities:a,textTracks:l}=b(this,eo);n[ft.reset](),a[ft.reset](),l[ft.reset](),k(this,Oe,R5).call(this)}handle(n){if(!this.scope)return;const a=n.type;Ou(()=>{var l;return(l=this[n.type])==null?void 0:l.call(this,n)}),pke.has(a)&&b(this,Oo).set(a,n),this.dispatch(n)}"provider-change"(n){var s,d;const a=b(this,eo).$provider(),l=n.detail;(a==null?void 0:a.type)!==(l==null?void 0:l.type)&&((s=a==null?void 0:a.destroy)==null||s.call(a),(d=a==null?void 0:a.scope)==null||d.dispose(),b(this,eo).$provider.set(n.detail),a&&n.detail===null&&k(this,Oe,Bx).call(this,n))}"provider-loader-change"(n){}"auto-play"(n){this.$state.autoPlayError.set(null)}"auto-play-fail"(n){this.$state.autoPlayError.set(n.detail),k(this,Oe,Dd).call(this)}"can-load"(n){this.$state.canLoad.set(!0),b(this,Oo).set("can-load",n),b(this,eo).textTracks[kt.canLoad](),k(this,Oe,ii).call(this,"media-start-loading",n)}"can-load-poster"(n){this.$state.canLoadPoster.set(!0),b(this,Oo).set("can-load-poster",n),k(this,Oe,ii).call(this,"media-poster-start-loading",n)}"media-type-change"(n){const a=b(this,Oo).get("source-change");a&&n.triggers.add(a);const l=this.$state.viewType();this.$state.mediaType.set(n.detail);const s=this.$state.providedViewType(),d=s==="unknown"?n.detail:s;l!==d&&setTimeout(()=>{requestAnimationFrame(()=>{this.scope&&(this.$state.inferredViewType.set(n.detail),this.dispatch("view-type-change",{detail:d,trigger:n}))})},0)}"stream-type-change"(n){const a=b(this,Oo).get("source-change");a&&n.triggers.add(a);const{streamType:l,inferredStreamType:s}=this.$state;s.set(n.detail),n.detail=l()}"rate-change"(n){var s;const{storage:a}=b(this,eo),{canPlay:l}=this.$state;this.$state.playbackRate.set(n.detail),k(this,Oe,ii).call(this,"media-rate-change-request",n),l()&&((s=a==null?void 0:a.setPlaybackRate)==null||s.call(a,n.detail))}"remote-playback-change"(n){const{remotePlaybackState:a,remotePlaybackType:l}=this.$state,{type:s,state:d}=n.detail,p=d==="connected";l.set(s),a.set(d);const h=s==="airplay"?"media-airplay-request":"media-google-cast-request";if(p)k(this,Oe,ii).call(this,h,n);else{const f=b(this,$n).queue.peek(h);f&&(n.request=f,n.triggers.add(f))}}"sources-change"(n){const a=this.$state.sources(),l=n.detail;this.$state.sources.set(l),k(this,Oe,IU).call(this,a,l,n)}"source-change"(n){var l,s;n.isQualityChange=((l=n.originEvent)==null?void 0:l.type)==="quality-change";const a=n.detail;k(this,Oe,Bx).call(this,n,n.isQualityChange),b(this,Oo).set(n.type,n),this.$state.source.set(a),(s=this.el)==null||s.setAttribute("aria-busy","true")}abort(n){const a=b(this,Oo).get("source-change");a&&n.triggers.add(a);const l=b(this,Oo).get("can-load");l&&!n.triggers.hasType("can-load")&&n.triggers.add(l)}"load-start"(n){const a=b(this,Oo).get("source-change");a&&n.triggers.add(a)}error(n){this.$state.error.set(n.detail);const a=b(this,Oo).get("abort");a&&n.triggers.add(a)}"loaded-metadata"(n){const a=b(this,Oo).get("load-start");a&&n.triggers.add(a)}"loaded-data"(n){const a=b(this,Oo).get("load-start");a&&n.triggers.add(a)}"can-play"(n){var l;const a=b(this,Oo).get("loaded-metadata");a&&n.triggers.add(a),k(this,Oe,Lx).call(this,n.detail),(l=this.el)==null||l.setAttribute("aria-busy","false")}"can-play-through"(n){k(this,Oe,Lx).call(this,n.detail);const a=b(this,Oo).get("can-play");a&&n.triggers.add(a)}"duration-change"(n){const{live:a,intrinsicDuration:l,providedDuration:s,clipEndTime:d,ended:p}=this.$state,h=n.detail;if(!a()){const f=Number.isNaN(h)?0:h;l.set(f),p()&&k(this,Oe,$x).call(this,n)}(s()>0||d()>0)&&n.stopImmediatePropagation()}progress(n){const{buffered:a,seekable:l}=this.$state,{buffered:s,seekable:d}=n.detail,p=yp(s),h=s.length!==a().length,f=p!==yp(a()),y=yp(d),w=d.length!==l().length,v=y!==yp(l());(h||f)&&a.set(s),(w||v)&&l.set(d)}play(n){const{paused:a,autoPlayError:l,ended:s,autoPlaying:d,playsInline:p,pointer:h,muted:f,viewType:y,live:w,userBehindLiveEdge:v}=this.$state;if(k(this,Oe,Px).call(this),!a()){n.stopImmediatePropagation();return}n.autoPlay=d();const C=b(this,Oo).get("waiting");C&&n.triggers.add(C),k(this,Oe,ii).call(this,"media-play-request",n),b(this,Oo).set("play",n),a.set(!1),l.set(null),n.autoPlay&&(this.handle(this.createEvent("auto-play",{detail:{muted:f()},trigger:n})),d.set(!1)),(s()||b(this,$n).replaying)&&(b(this,$n).replaying=!1,s.set(!1),this.handle(this.createEvent("replay",{trigger:n}))),!p()&&y()==="video"&&h()==="coarse"&&b(this,eo).remote.enterFullscreen("prefer-media",n),w()&&!v()&&b(this,eo).remote.seekToLiveEdge(n)}"play-fail"(n){const{muted:a,autoPlaying:l}=this.$state,s=b(this,Oo).get("play");s&&n.triggers.add(s),k(this,Oe,ii).call(this,"media-play-request",n);const{paused:d,playing:p}=this.$state;d.set(!0),p.set(!1),k(this,Oe,Dd).call(this),b(this,Oo).set("play-fail",n),n.autoPlay&&(this.handle(this.createEvent("auto-play-fail",{detail:{muted:a(),error:n.detail},trigger:n})),l.set(!1))}playing(n){const a=b(this,Oo).get("play"),l=b(this,Oo).get("seeked");a?n.triggers.add(a):l&&n.triggers.add(l),setTimeout(()=>k(this,Oe,Dd).call(this),0);const{paused:s,playing:d,live:p,liveSyncPosition:h,seekableEnd:f,started:y,currentTime:w,seeking:v,ended:C}=this.$state;if(s.set(!1),d.set(!0),v.set(!1),C.set(!1),b(this,$n).looping){b(this,$n).looping=!1;return}if(p()&&!y()&&w()===0){const E=h()??f()-2;Number.isFinite(E)&&b(this,eo).$provider().setCurrentTime(E)}this.started(n)}started(n){const{started:a}=this.$state;a()||(a.set(!0),this.handle(this.createEvent("started",{trigger:n})))}pause(n){var d;(d=this.el)!=null&&d.isConnected||j(this,jc,!0),k(this,Oe,ii).call(this,"media-pause-request",n);const a=b(this,Oo).get("seeked");a&&n.triggers.add(a);const{paused:l,playing:s}=this.$state;l.set(!0),s.set(!1),b(this,e0)&&setTimeout(()=>{this.handle(this.createEvent("end",{trigger:n})),j(this,e0,!1)},0),k(this,Oe,Dd).call(this)}"time-change"(n){if(b(this,$n).looping){n.stopImmediatePropagation();return}let{waiting:a,played:l,clipEndTime:s,realCurrentTime:d,currentTime:p}=this.$state,h=n.detail,f=s();d.set(h),k(this,Oe,EU).call(this),a.set(!1);for(const y of b(this,eo).textTracks)y[kt.updateActiveCues](h,n);f>0&&h>=f&&(j(this,e0,!0),this.dispatch("media-pause-request",{trigger:n})),k(this,Oe,TU).call(this),this.dispatch("time-update",{detail:{currentTime:p(),played:l()},trigger:n})}"audio-gain-change"(n){var d;const{storage:a}=b(this,eo),{canPlay:l,audioGain:s}=this.$state;s.set(n.detail),k(this,Oe,ii).call(this,"media-audio-gain-change-request",n),l()&&((d=a==null?void 0:a.setAudioGain)==null||d.call(a,s()))}"volume-change"(n){var h,f;const{storage:a}=b(this,eo),{volume:l,muted:s,canPlay:d}=this.$state,p=n.detail;l.set(p.volume),s.set(p.muted||p.volume===0),k(this,Oe,ii).call(this,"media-volume-change-request",n),k(this,Oe,ii).call(this,p.muted?"media-mute-request":"media-unmute-request",n),d()&&((h=a==null?void 0:a.setVolume)==null||h.call(a,l()),(f=a==null?void 0:a.setMuted)==null||f.call(a,s()))}seeked(n){const{seeking:a,currentTime:l,realCurrentTime:s,paused:d,seekableEnd:p,ended:h,live:f}=this.$state;if(b(this,$n).seeking)a.set(!0),n.stopImmediatePropagation();else if(a()){const y=b(this,Oo).get("waiting");y&&n.triggers.add(y);const w=b(this,Oo).get("seeking");w&&!n.triggers.has(w)&&n.triggers.add(w),d()&&k(this,Oe,Mx).call(this),a.set(!1),s.set(n.detail),k(this,Oe,ii).call(this,"media-seek-request",n);const v=n==null?void 0:n.originEvent;v!=null&&v.isTrusted&&!(v instanceof MessageEvent)&&!/seek/.test(v.type)&&this.started(n)}f()||(Math.floor(l())!==Math.floor(p())?h.set(!1):this.end(n))}waiting(n){b(this,o0)||b(this,$n).seeking||(n.stopImmediatePropagation(),j(this,vs,n),b(this,C2).call(this))}end(n){const{loop:a,ended:l}=this.$state;if(!(!a()&&l())){if(a()){setTimeout(()=>{requestAnimationFrame(()=>{k(this,Oe,Px).call(this,n),this.dispatch("media-loop-request",{trigger:n})})},10);return}setTimeout(()=>k(this,Oe,AU).call(this,n),0)}}"fullscreen-change"(n){const a=n.detail;this.$state.fullscreen.set(a),k(this,Oe,ii).call(this,a?"media-enter-fullscreen-request":"media-exit-fullscreen-request",n)}"fullscreen-error"(n){k(this,Oe,ii).call(this,"media-enter-fullscreen-request",n),k(this,Oe,ii).call(this,"media-exit-fullscreen-request",n)}"orientation-change"(n){const a=n.detail.lock;k(this,Oe,ii).call(this,a?"media-orientation-lock-request":"media-orientation-unlock-request",n)}"picture-in-picture-change"(n){const a=n.detail;this.$state.pictureInPicture.set(a),k(this,Oe,ii).call(this,a?"media-enter-pip-request":"media-exit-pip-request",n)}"picture-in-picture-error"(n){k(this,Oe,ii).call(this,"media-enter-pip-request",n),k(this,Oe,ii).call(this,"media-exit-pip-request",n)}"title-change"(n){n.trigger&&(n.stopImmediatePropagation(),this.$state.inferredTitle.set(n.detail))}"poster-change"(n){n.trigger&&(n.stopImmediatePropagation(),this.$state.inferredPoster.set(n.detail))}}$n=new WeakMap,eo=new WeakMap,Oo=new WeakMap,e0=new WeakMap,w2=new WeakMap,t0=new WeakMap,o0=new WeakMap,vs=new WeakMap,jc=new WeakMap,Oe=new WeakSet,mU=function(){b(this,jc)&&(requestAnimationFrame(()=>{this.scope&&b(this,eo).remote.play(new Ot("dom-connect"))}),j(this,jc,!1))},bU=function(){var n;b(this,jc)||(j(this,jc,!this.$state.paused()),(n=b(this,eo).$provider())==null||n.pause())},Dd=function(){k(this,Oe,Mx).call(this),j(this,e0,!1),b(this,$n).replaying=!1,b(this,$n).looping=!1,j(this,o0,!1),j(this,vs,void 0),b(this,Oo).clear()},ii=function(n,a){const l=b(this,$n).queue.serve(n);l&&(a.request=l,a.triggers.add(l))},gU=function(){k(this,Oe,O5).call(this),k(this,Oe,Dx).call(this);const n=b(this,eo).textTracks;new go(n).add("add",k(this,Oe,O5).bind(this)).add("remove",k(this,Oe,O5).bind(this)).add("mode-change",k(this,Oe,Dx).bind(this))},yU=function(){const n=b(this,eo).qualities;new go(n).add("add",k(this,Oe,Ox).bind(this)).add("remove",k(this,Oe,Ox).bind(this)).add("change",k(this,Oe,CU).bind(this)).add("auto-change",k(this,Oe,kU).bind(this)).add("readonly-change",k(this,Oe,xU).bind(this))},wU=function(){const n=b(this,eo).audioTracks;new go(n).add("add",k(this,Oe,_x).bind(this)).add("remove",k(this,Oe,_x).bind(this)).add("change",k(this,Oe,vU).bind(this))},O5=function(n){const{textTracks:a}=this.$state;a.set(b(this,eo).textTracks.toArray()),this.dispatch("text-tracks-change",{detail:a(),trigger:n})},Dx=function(n){n&&k(this,Oe,ii).call(this,"media-text-track-change-request",n);const a=b(this,eo).textTracks.selected,{textTrack:l}=this.$state;l()!==a&&(l.set(a),this.dispatch("text-track-change",{detail:a,trigger:n}))},_x=function(n){const{audioTracks:a}=this.$state;a.set(b(this,eo).audioTracks.toArray()),this.dispatch("audio-tracks-change",{detail:a(),trigger:n})},vU=function(n){const{audioTrack:a}=this.$state;a.set(b(this,eo).audioTracks.selected),n&&k(this,Oe,ii).call(this,"media-audio-track-change-request",n),this.dispatch("audio-track-change",{detail:a(),trigger:n})},Ox=function(n){const{qualities:a}=this.$state;a.set(b(this,eo).qualities.toArray()),this.dispatch("qualities-change",{detail:a(),trigger:n})},CU=function(n){const{quality:a}=this.$state;a.set(b(this,eo).qualities.selected),n&&k(this,Oe,ii).call(this,"media-quality-change-request",n),this.dispatch("quality-change",{detail:a(),trigger:n})},kU=function(){const{qualities:n}=b(this,eo),a=n.auto;this.$state.autoQuality.set(a),a||k(this,Oe,R5).call(this)},v2=new WeakMap,Rx=function(){k(this,Oe,R5).call(this),j(this,v2,ue(()=>{const{qualities:n}=b(this,eo),{mediaWidth:a,mediaHeight:l}=this.$state,s=a(),d=l();if(s===0||d===0)return;let p=null,h=1/0;for(const f of n){const y=Math.abs(f.width-s)+Math.abs(f.height-d);y<h&&(h=y,p=f)}p&&n[ft.select](p,!0,new Ot("resize",{detail:{width:s,height:d}}))}))},R5=function(){var n;(n=b(this,v2))==null||n.call(this),j(this,v2,null)},xU=function(){this.$state.canSetQuality.set(!b(this,eo).qualities.readonly)},SU=function(){const{canSetVolume:n,isGoogleCastConnected:a}=this.$state;if(a()){n.set(!1);return}Zve().then(n.set)},IU=function(n,a,l){let{qualities:s}=b(this,eo),d=!1,p=!1;for(const h of n){if(!Ev(h))continue;if(!a.some(y=>y.src===h.src)){const y=s.getBySrc(h.src);y&&(s[ft.remove](y,l),p=!0)}}p&&!s.length&&(this.$state.savedState.set(null),s[ft.reset](l));for(const h of a){if(!Ev(h)||s.getBySrc(h.src))continue;const f={id:h.id??h.height+"p",bitrate:null,codec:null,...h,selected:!1};s[ft.add](f,l),d=!0}d&&!s[ln.enableAuto]&&(k(this,Oe,Rx).call(this),s[ln.enableAuto]=k(this,Oe,Rx).bind(this),s[ln.setAuto](!0,l))},Bx=function(n,a=!1){const{audioTracks:l,qualities:s}=b(this,eo);if(!a){j(this,w2,[]),j(this,t0,[-1,-1]),l[ft.reset](n),s[ft.reset](n),f$(this.$state,a),k(this,Oe,Dd).call(this);return}f$(this.$state,a),k(this,Oe,Dd).call(this)},Lx=function(n){const{seekable:a,buffered:l,intrinsicDuration:s,canPlay:d}=this.$state;d.set(!0),l.set(n.buffered),a.set(n.seekable);const p=yp(n.seekable)??1/0;s.set(p)},Px=function(n){if(!Re(b(this,eo).$provider))return;const{ended:l,seekableStart:s,clipEndTime:d,currentTime:p,realCurrentTime:h,duration:f}=this.$state,y=l()||h()<s()||d()>0&&h()>=d()||Math.abs(p()-f())<.1;return y&&this.dispatch("media-seek-request",{detail:s(),trigger:n}),y},EU=function(){const{currentTime:n,played:a,paused:l}=this.$state;l()||(j(this,t0,sCe(b(this,w2),b(this,t0),n())),a.set(new Ti(b(this,w2))))},$x=function(n){const{clipStartTime:a,clipEndTime:l,duration:s}=this.$state;a()>0||l()>0||this.handle(this.createEvent("time-change",{detail:s(),trigger:n}))},TU=function(){var s;const{storage:n}=b(this,eo),{canPlay:a,realCurrentTime:l}=this.$state;a()&&((s=n==null?void 0:n.setTime)==null||s.call(n,l()))},C2=new WeakMap,AU=function(n){var h;const{storage:a}=b(this,eo),{paused:l,seeking:s,ended:d,duration:p}=this.$state;k(this,Oe,$x).call(this,n),l()||this.dispatch("pause",{trigger:n}),s()&&this.dispatch("seeked",{detail:p(),trigger:n}),d.set(!0),k(this,Oe,Dd).call(this),(h=a==null?void 0:a.setTime)==null||h.call(a,p(),!0),this.dispatch("ended",{trigger:n})},Mx=function(){b(this,C2).cancel(),this.$state.waiting.set(!1)};class hke extends vp{constructor(){super(...arguments);P(this,Wt)}onSetup(){k(this,Wt,DU).call(this);const n=[k(this,Wt,OU),k(this,Wt,BU),k(this,Wt,FU),k(this,Wt,qU),k(this,Wt,PU),k(this,Wt,MU),k(this,Wt,NU),k(this,Wt,VU),k(this,Wt,UU),k(this,Wt,zU),k(this,Wt,LU),k(this,Wt,jU),k(this,Wt,$U),k(this,Wt,_U),k(this,Wt,RU)];for(const a of n)ue(a.bind(this))}}Wt=new WeakSet,DU=function(){var l;const n={duration:"providedDuration",loop:"providedLoop",poster:"providedPoster",streamType:"providedStreamType",title:"providedTitle",viewType:"providedViewType"},a=new Set(["currentTime","paused","playbackRate","volume"]);for(const s of Object.keys(this.$props))a.has(s)||(l=this.$state[n[s]??s])==null||l.set(this.$props[s]());this.$state.muted.set(this.$props.muted()||this.$props.volume()===0)},_U=function(){const{viewType:n,streamType:a,title:l,poster:s,loop:d}=this.$props,p=this.$state;p.providedPoster.set(s()),p.providedStreamType.set(a()),p.providedViewType.set(n()),p.providedTitle.set(l()),p.providedLoop.set(d())},zKe=function(){},OU=function(){const{artist:n,artwork:a}=this.$props;this.$state.artist.set(n()),this.$state.artwork.set(a())},RU=function(){const{title:n}=this.$state;this.dispatch("title-change",{detail:n()})},BU=function(){const n=this.$props.autoPlay()||this.$props.autoplay();this.$state.autoPlay.set(n),this.dispatch("auto-play-change",{detail:n})},LU=function(){const n=this.$state.loop();this.dispatch("loop-change",{detail:n})},PU=function(){const n=this.$props.controls();this.$state.controls.set(n)},$U=function(){const{poster:n}=this.$state;this.dispatch("poster-change",{detail:n()})},MU=function(){const n=this.$props.crossOrigin()??this.$props.crossorigin(),a=n===!0?"":n;this.$state.crossOrigin.set(a)},NU=function(){const{duration:n}=this.$props;this.dispatch("media-duration-change-request",{detail:n()})},jU=function(){const n=this.$props.playsInline()||this.$props.playsinline();this.$state.playsInline.set(n),this.dispatch("plays-inline-change",{detail:n})},FU=function(){const{clipStartTime:n}=this.$props;this.dispatch("media-clip-start-change-request",{detail:n()})},qU=function(){const{clipEndTime:n}=this.$props;this.dispatch("media-clip-end-change-request",{detail:n()})},VU=function(){this.dispatch("live-change",{detail:this.$state.live()})},zU=function(){this.$state.liveEdgeTolerance.set(this.$props.liveEdgeTolerance()),this.$state.minLiveDVRWindow.set(this.$props.minLiveDVRWindow())},UU=function(){this.dispatch("live-edge-change",{detail:this.$state.liveEdge()})};const C$=["play","pause","seekforward","seekbackward","seekto"];class fke extends vp{constructor(){super(...arguments);P(this,pl)}onConnect(){ue(k(this,pl,KU).bind(this)),ue(k(this,pl,GU).bind(this));const n=k(this,pl,WU).bind(this);for(const a of C$)navigator.mediaSession.setActionHandler(a,n);At(k(this,pl,HU).bind(this))}}pl=new WeakSet,HU=function(){for(const n of C$)navigator.mediaSession.setActionHandler(n,null)},KU=function(){const{title:n,artist:a,artwork:l,poster:s}=this.$state;navigator.mediaSession.metadata=new MediaMetadata({title:n(),artist:a(),artwork:l()??[{src:s()}]})},GU=function(){const{canPlay:n,paused:a}=this.$state;navigator.mediaSession.playbackState=n()?a()?"paused":"playing":"none"},WU=function(n){const a=new Ot("media-session-action",{detail:n});switch(n.action){case"play":this.dispatch("media-play-request",{trigger:a});break;case"pause":this.dispatch("media-pause-request",{trigger:a});break;case"seekto":case"seekforward":case"seekbackward":this.dispatch("media-seek-request",{detail:Li(n.seekTime)?n.seekTime:this.$state.currentTime()+(n.seekOffset??(n.action==="seekforward"?10:-10)),trigger:a});break}};const n0=class n0 extends dt{constructor(){super();P(this,He);P(this,pn);P(this,i0);P(this,un);V(this,"canPlayQueue",new w$);V(this,"remoteControl");P(this,k2,!1);V(this,"orientation");new hke;const n={player:this,qualities:new UCe,audioTracks:new FCe,storage:null,$provider:ct(null),$providerSetup:ct(!1),$props:this.$props,$state:this.$state};n.remote=this.remoteControl=new NCe(void 0),n.remote.setPlayer(this),n.textTracks=new zCe,n.textTracks[kt.crossOrigin]=this.$state.crossOrigin,n.textRenderers=new VCe(n),n.ariaKeys={},j(this,pn,n),ma(HP,n),this.orientation=new Vg,new lr,new YCe(n);const a=new dke;j(this,i0,new uke(a,n)),j(this,un,new ske(b(this,i0),a,n)),n.delegate=new rke(b(this,i0).handle.bind(b(this,i0)),n),n.notify=n.delegate.notify.bind(n.delegate),typeof navigator<"u"&&"mediaSession"in navigator&&new fke,new y$("load",this.startLoading.bind(this)),new y$("posterLoad",this.startLoadingPoster.bind(this))}onSetup(){k(this,He,QU).call(this),ue(k(this,He,XU).bind(this)),ue(k(this,He,tH).bind(this)),ue(k(this,He,eH).bind(this)),ue(k(this,He,iH).bind(this)),ue(k(this,He,oH).bind(this)),ue(k(this,He,aH).bind(this)),ue(k(this,He,nH).bind(this))}onAttach(n){n.setAttribute("data-media-player",""),bo(n,"tabindex","0"),bo(n,"role","region"),ue(k(this,He,lH).bind(this)),ue(k(this,He,ZU).bind(this)),ue(k(this,He,YU).bind(this)),uo(n,"find-media-player",k(this,He,JU).bind(this))}onConnect(n){KP&&Ge(n,"data-iphone","");const a=window.matchMedia("(pointer: coarse)");k(this,He,Nx).call(this,a),a.onchange=k(this,He,Nx).bind(this);const l=new ResizeObserver(Pu(k(this,He,A3).bind(this)));l.observe(n),ue(k(this,He,A3).bind(this)),this.dispatch("media-player-connect",{detail:this,bubbles:!0,composed:!0}),At(()=>{l.disconnect(),a.onchange=null})}onDestroy(){b(this,pn).player=null,this.canPlayQueue.reset()}get provider(){return b(this,He,Aa)}get controls(){return b(this,un).controls}set controls(n){b(this,He,B5).controls.set(n)}get title(){return Re(this.$state.title)}set title(n){if(b(this,k2)){j(this,k2,!1);return}b(this,He,B5).title.set(n)}get qualities(){return b(this,pn).qualities}get audioTracks(){return b(this,pn).audioTracks}get textTracks(){return b(this,pn).textTracks}get textRenderers(){return b(this,pn).textRenderers}get duration(){return this.$state.duration()}set duration(n){b(this,He,B5).duration.set(n)}get paused(){return Re(this.$state.paused)}set paused(n){k(this,He,jx).call(this,n)}get muted(){return Re(this.$state.muted)}set muted(n){k(this,He,Fx).call(this,n)}get currentTime(){return Re(this.$state.currentTime)}set currentTime(n){k(this,He,qx).call(this,n)}get volume(){return Re(this.$state.volume)}set volume(n){k(this,He,Vx).call(this,n)}get playbackRate(){return Re(this.$state.playbackRate)}set playbackRate(n){k(this,He,zx).call(this,n)}async play(n){return b(this,un).play(n)}async pause(n){return b(this,un).pause(n)}async enterFullscreen(n,a){return b(this,un).enterFullscreen(n,a)}async exitFullscreen(n,a){return b(this,un).exitFullscreen(n,a)}enterPictureInPicture(n){return b(this,un).enterPictureInPicture(n)}exitPictureInPicture(n){return b(this,un).exitPictureInPicture(n)}seekToLiveEdge(n){b(this,un).seekToLiveEdge(n)}startLoading(n){b(this,pn).notify("can-load",void 0,n)}startLoadingPoster(n){b(this,pn).notify("can-load-poster",void 0,n)}requestAirPlay(n){return b(this,un).requestAirPlay(n)}requestGoogleCast(n){return b(this,un).requestGoogleCast(n)}setAudioGain(n,a){return b(this,un).setAudioGain(n,a)}destroy(){super.destroy(),b(this,pn).remote.setPlayer(null),this.dispatch("destroy")}};pn=new WeakMap,i0=new WeakMap,un=new WeakMap,He=new WeakSet,Aa=function(){return b(this,pn).$provider()},B5=function(){return this.$props},k2=new WeakMap,ZU=function(){const n=this.$el,{title:a,live:l,viewType:s,providedTitle:d}=this.$state,p=l(),h=Ave(s()),f=h!=="Unknown"?`${p?"Live ":""}${h}`:p?"Live":"Media",y=a();Ge(this.el,"aria-label",`${f} Player`+(y?` - ${y}`:"")),n!=null&&n.hasAttribute("title")&&(j(this,k2,!0),n==null||n.removeAttribute("title"))},YU=function(){const n=this.orientation.landscape?"landscape":"portrait";this.$state.orientation.set(n),Ge(this.el,"data-orientation",n),k(this,He,A3).call(this)},XU=function(){this.$state.canPlay()&&b(this,He,Aa)?this.canPlayQueue.start():this.canPlayQueue.stop()},QU=function(){if(n0[_v]){this.setAttributes(n0[_v]);return}const n={"data-load":function(){return this.$props.load()},"data-captions":function(){const l=this.$state.textTrack();return!!l&&xn(l)},"data-ios-controls":function(){return this.$state.iOSControls()},"data-controls":function(){return this.controls.showing},"data-buffering":function(){const{canLoad:l,canPlay:s,waiting:d}=this.$state;return l()&&(!s()||d())},"data-error":function(){const{error:l}=this.$state;return!!l()},"data-autoplay-error":function(){const{autoPlayError:l}=this.$state;return!!l()}},a={autoPlay:"autoplay",canAirPlay:"can-airplay",canPictureInPicture:"can-pip",pictureInPicture:"pip",playsInline:"playsinline",remotePlaybackState:"remote-state",remotePlaybackType:"remote-type",isAirPlayConnected:"airplay",isGoogleCastConnected:"google-cast"};for(const l of nke){const s="data-"+(a[l]??Og(l));n[s]=function(){return this.$state[l]()}}delete n.title,n0[_v]=n,this.setAttributes(n)},JU=function(n){n.detail(this)},A3=function(){if(!this.el)return;const n=this.el.clientWidth,a=this.el.clientHeight;this.$state.width.set(n),this.$state.height.set(a),Zn(this.el,"--player-width",n+"px"),Zn(this.el,"--player-height",a+"px")},Nx=function(n){const a=n.matches?"coarse":"fine";Ge(this.el,"data-pointer",a),this.$state.pointer.set(a),k(this,He,A3).call(this)},eH=function(){k(this,He,jx).call(this,this.$props.paused())},jx=function(n){n?this.canPlayQueue.enqueue("paused",()=>b(this,un).pause()):this.canPlayQueue.enqueue("paused",()=>b(this,un).play())},tH=function(){k(this,He,Fx).call(this,this.$props.muted())},Fx=function(n){this.canPlayQueue.enqueue("muted",()=>{b(this,He,Aa)&&b(this,He,Aa).setMuted(n)})},oH=function(){k(this,He,qx).call(this,this.$props.currentTime())},qx=function(n){this.canPlayQueue.enqueue("currentTime",()=>{const{currentTime:a}=this.$state;n!==Re(a)&&Re(()=>{if(!b(this,He,Aa))return;const l=m$(n,this.$state);Number.isFinite(l)&&b(this,He,Aa).setCurrentTime(l)})})},iH=function(){k(this,He,Vx).call(this,this.$props.volume())},Vx=function(n){const a=xv(0,n,1);this.canPlayQueue.enqueue("volume",()=>{b(this,He,Aa)&&b(this,He,Aa).setVolume(a)})},nH=function(){k(this,He,zx).call(this,this.$props.playbackRate())},zx=function(n){this.canPlayQueue.enqueue("rate",()=>{var a,l;b(this,He,Aa)&&((l=(a=b(this,He,Aa)).setPlaybackRate)==null||l.call(a,n))})},aH=function(){k(this,He,rH).call(this,this.$props.playsInline())},rH=function(n){this.canPlayQueue.enqueue("playsinline",()=>{var a,l;b(this,He,Aa)&&((l=(a=b(this,He,Aa)).setPlaysInline)==null||l.call(a,n))})},lH=function(){var l;let n=this.$props.storage(),a=Je(n)?new jCe:n;if(a!=null&&a.onChange){const{source:s}=this.$state,d=Je(n)?n:(l=this.el)==null?void 0:l.id,p=rr(k(this,He,sH).bind(this));ue(()=>a.onChange(s(),p(),d||void 0))}b(this,pn).storage=a,b(this,pn).textTracks.setStorage(a),At(()=>{var s;(s=a==null?void 0:a.onDestroy)==null||s.call(a),b(this,pn).storage=null,b(this,pn).textTracks.setStorage(null)})},sH=function(){const{clipStartTime:n,clipEndTime:a}=this.$props,{source:l}=this.$state,s=l();return s.src?`${s.src}:${n()}:${a()}`:null},V(n0,"props",ake),V(n0,"state",u$);let zg=n0;const To=zg.prototype;$t(To,"canPlayQueue"),$t(To,"remoteControl"),$t(To,"provider"),$t(To,"controls"),$t(To,"orientation"),$t(To,"title"),$t(To,"qualities"),$t(To,"audioTracks"),$t(To,"textTracks"),$t(To,"textRenderers"),$t(To,"duration"),$t(To,"paused"),$t(To,"muted"),$t(To,"currentTime"),$t(To,"volume"),$t(To,"playbackRate"),ei(To,"play"),ei(To,"pause"),ei(To,"enterFullscreen"),ei(To,"exitFullscreen"),ei(To,"enterPictureInPicture"),ei(To,"exitPictureInPicture"),ei(To,"seekToLiveEdge"),ei(To,"startLoading"),ei(To,"startLoadingPoster"),ei(To,"requestAirPlay"),ei(To,"requestGoogleCast"),ei(To,"setAudioGain");function mke(i,o){return fetch(i,o).then(n=>n.text()).then(n=>/type="static"/.test(n)?"on-demand":"live")}function k$(i,o){return fetch(i,o).then(n=>n.text()).then(n=>{const a=bke(n);if(a)return k$(/^https?:/.test(a)?a:new URL(a,i).href,o);const l=/EXT-X-PLAYLIST-TYPE:\s*VOD/.test(n)?"on-demand":"live";return l==="live"&&gke(n)>=10&&(/#EXT-X-DVR-ENABLED:\s*true/.test(n)||n.includes("#EXT-X-DISCONTINUITY"))?"live:dvr":l})}function bke(i){const o=i.match(/#EXT-X-STREAM-INF:[^\n]+(\n[^\n]+)*/g);return o?o[0].split(`
|
|
3138
|
+
`}},emits:["input","tag","search-change","closed"],data:()=>({defaultOptionLabel:"label",multiple:!0}),created(){this.isApiMode||this.initializeOptions()},methods:{getTagOptionLabel({optionLabel:i,option:o}){const n=this.getOptionLabel({optionLabel:i,option:o});return typeof n=="object"?o.label:n},initializeOptions(){if(!this.value)return[];const i=this.value.filter(o=>!this.options.find(n=>lc(n,o)));this.options.unshift(...i)}}},O7e={class:"multiselect__loading-wrapper"};function R7e(i,o,n,a,l,s){const d=c.resolveComponent("wt-label"),p=c.resolveComponent("wt-icon-btn"),h=c.resolveComponent("wt-chip"),f=c.resolveComponent("wt-loader"),y=c.resolveComponent("vue-multiselect"),w=c.resolveComponent("wt-input-info"),v=c.resolveDirective("observe-visibility");return c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass([{"wt-tags-input--disabled":i.disabled,"wt-tags-input--invalid":i.invalid,"wt-tags-input--loading":i.isLoading},"wt-tags-input"])},[i.hasLabel?(c.openBlock(),c.createBlock(d,c.mergeProps({key:0},i.labelProps,{disabled:i.disabled,invalid:i.invalid,class:"wt-tags-input__label"}),{default:c.withCtx(()=>[c.renderSlot(i.$slots,"label",c.normalizeProps(c.guardReactiveProps({label:i.label})),()=>[c.createTextVNode(c.toDisplayString(i.requiredLabel),1)],!0)],void 0,!0),_:3},16,["disabled","invalid"])):c.createCommentVNode("",!0),c.createVNode(y,c.mergeProps(i.$attrs,{ref:"vue-multiselect","close-on-select":!1,disabled:i.disabled,"internal-search":!i.searchMethod,label:i.selectOptionLabel,loading:!1,"model-value":i.selectValue,multiple:i.multiple,options:i.selectOptions,placeholder:i.placeholder||i.label,taggable:n.taggable,"track-by":n.trackBy,class:"wt-tags-input__select"},c.toHandlers(i.listeners)),c.createSlots({tag:c.withCtx(({option:C,remove:E})=>[c.createVNode(h,{class:"multiselect__custom-tag"},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(s.getTagOptionLabel({option:C,optionLabel:i.optionLabel}))+" ",1),c.createVNode(p,{color:"on-primary",icon:"close--filled",size:"sm",onClick:T=>E(C)},null,8,["onClick"])],void 0,!0),_:2},1024)]),option:c.withCtx(({option:C})=>[c.renderSlot(i.$slots,"option",c.normalizeProps(c.guardReactiveProps({option:C,optionLabel:i.optionLabel})),()=>[c.createTextVNode(c.toDisplayString(s.getTagOptionLabel({option:C,optionLabel:i.optionLabel})),1)],!0)]),caret:c.withCtx(({toggle:C})=>[c.createVNode(p,{disabled:i.disabled,class:"multiselect__select",color:"active",icon:"arrow-down",onMousedown:c.withModifiers(C,["prevent","stop"])},null,8,["disabled","onMousedown"])]),beforeList:c.withCtx(()=>[c.withDirectives(c.createElementVNode("div",O7e,[c.createVNode(f,{size:"sm"})],512),[[c.vShow,i.isLoading]])]),_:2},[i.showIntersectionObserver?{name:"afterList",fn:c.withCtx(()=>[c.withDirectives(c.createElementVNode("div",null,null,512),[[v,i.handleAfterListIntersect]])]),key:"0"}:void 0]),1040,["disabled","internal-search","label","model-value","multiple","options","placeholder","taggable","track-by"]),i.isValidation?(c.openBlock(),c.createBlock(w,{key:1,invalid:i.invalid},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(i.validationText),1)],void 0,!0),_:1},8,["invalid"])):c.createCommentVNode("",!0)],2)}const B7e=Ne(_7e,[["render",R7e],["__scopeId","data-v-5b67c1b1"]]),L7e={name:"WtTextarea",components:{WtLabel:dB},mixins:[dg],props:{value:{type:String,default:""},label:{type:String,default:""},placeholder:{type:String},readonly:{type:Boolean,default:!1,description:"Native textarea readonly attribute"},disabled:{type:Boolean,default:!1,description:"Native textarea disabled attribute"},required:{type:Boolean,default:!1},name:{type:String,default:""},rows:{type:Number,default:1,description:"Number of rows for textarea"},labelProps:{type:Object,description:"Object with props, passed down to wt-label as props"},autoresize:{type:Boolean,default:!1,description:"enables auto-grow for text-area"}},emits:["input","enter"],computed:{listeners(){return{...this.$listeners,input:i=>this.$emit("input",i.target.value),keypress:i=>this.handleKeypress(i)}}},mounted(){this.updateInputPaddings()},updated(){this.autoresize&&!this.value&&this.resetGrow()},methods:{handleKeypress(i){this.autoresize&&i.key==="Enter"&&!i.shiftKey&&(this.$emit("enter"),i.preventDefault())},autoGrow(){if(!this.autoresize)return;const i=this.$refs["wt-textarea"],o=2;i.style.height="auto",i.style.height=i.scrollHeight+o+"px"},resetGrow(){const i=this.$refs["wt-textarea"];i.style.height="auto"},updateInputPaddings(){const i=this.$refs["after-wrapper"].offsetWidth,o=this.$refs["wt-textarea"],n=getComputedStyle(document.documentElement).getPropertyValue("--textarea-padding");o.style.paddingRight=`calc(${n} * 2 + ${i}px)`}}},P7e={class:"wt-textarea__wrapper"},$7e=["id","disabled","placeholder","value","rows","readonly"],M7e={ref:"after-wrapper",class:"wt-textarea__after-wrapper"};function N7e(i,o,n,a,l,s){const d=c.resolveComponent("wt-label"),p=c.resolveComponent("wt-icon-btn"),h=c.resolveComponent("wt-input-info");return c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass([{"wt-textarea--disabled":n.disabled,"wt-textarea--invalid":i.invalid,"wt-textarea--autoresize":n.autoresize},"wt-textarea"])},[c.createVNode(d,c.mergeProps(n.labelProps,{disabled:n.disabled,for:n.name,required:n.required,invalid:i.invalid}),{default:c.withCtx(()=>[c.renderSlot(i.$slots,"label",c.normalizeProps(c.guardReactiveProps({label:n.label})),()=>[c.createTextVNode(c.toDisplayString(n.label),1)],!0)],void 0,!0),_:3},16,["disabled","for","required","invalid"]),c.createElementVNode("div",P7e,[c.createElementVNode("textarea",c.mergeProps({id:n.name,ref:"wt-textarea",disabled:n.disabled,placeholder:n.placeholder||n.label,value:n.value,rows:n.rows,readonly:n.readonly,class:"wt-textarea__textarea"},c.toHandlers(s.listeners,!0),{onInput:o[0]||(o[0]=(...f)=>s.autoGrow&&s.autoGrow(...f))}),null,16,$7e),c.createElementVNode("div",M7e,[c.renderSlot(i.$slots,"after-input",{},void 0,!0),c.createVNode(p,{class:c.normalizeClass([{hidden:!n.value},"wt-textarea__reset-icon-btn"]),disabled:n.disabled,icon:"close--filled",size:"sm",onClick:o[1]||(o[1]=f=>i.$emit("input",""))},null,8,["class","disabled"])],512)]),i.isValidation?(c.openBlock(),c.createBlock(h,{key:0,invalid:i.invalid},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(i.validationText),1)],void 0,!0),_:1},8,["invalid"])):c.createCommentVNode("",!0)],2)}const j7e=Ne(L7e,[["render",N7e],["__scopeId","data-v-7d1b900a"]]),F7e={name:"WtTimeInput",mixins:[dg],props:{value:{type:Number,default:0},label:{type:String,default:""},maxValue:{type:Number},required:{type:Boolean,default:!1,description:"Native input required attribute"},disabled:{type:Boolean,default:!1,description:"Native input disabled attribute"},labelProps:{type:Object,description:"Object with props, passed down to wt-label as props"},hideInputInfo:{type:Boolean,default:!1}},emits:["input"],computed:{hasLabel(){return!!(this.label||this.$slots.label)},showInfo(){return this.isValidation&&!this.hideInputInfo},listeners(){return{...this.$listeners,input:i=>this.$emit("input",i.target.value)}}}},q7e={class:"wt-time-input__wrapper"},V7e=["disabled","max","value"];function z7e(i,o,n,a,l,s){const d=c.resolveComponent("wt-label"),p=c.resolveComponent("wt-input-info");return c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass([{"wt-time-input--disabled":n.disabled,"wt-time-input--invalid":i.invalid},"wt-time-input"])},[s.hasLabel?(c.openBlock(),c.createBlock(d,c.mergeProps({key:0},n.labelProps,{disabled:n.disabled,invalid:i.invalid}),{default:c.withCtx(()=>[c.renderSlot(i.$slots,"label",c.normalizeProps(c.guardReactiveProps({label:n.label})),()=>[c.createTextVNode(c.toDisplayString(n.label),1)],!0)],void 0,!0),_:3},16,["disabled","invalid"])):c.createCommentVNode("",!0),c.createElementVNode("div",q7e,[c.createElementVNode("input",c.mergeProps({disabled:n.disabled,max:n.maxValue,min:0,value:n.value,class:"wt-time-input__input",type:"number"},c.toHandlers(s.listeners,!0)),null,16,V7e)]),s.showInfo?(c.openBlock(),c.createBlock(p,{key:1,invalid:i.invalid},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(i.validationText),1)],void 0,!0),_:1},8,["invalid"])):c.createCommentVNode("",!0)],2)}const U7e=Ne(F7e,[["render",z7e],["__scopeId","data-v-ae7cf0e8"]]),Sh=60*60,Kw=60,H7e={name:"WtTimepicker",mixins:[dg],model:{prop:"value",event:"input"},props:{value:{type:[String,Number],default:0},dateMode:{type:Boolean,default:!1},label:{type:String,default:""},format:{type:String,default:"hh:mm:ss"},disabled:{type:Boolean,default:!1},labelProps:{type:Object,description:"Object with props, passed down to wt-label as props"},noLabel:{type:Boolean,default:!1},required:{type:Boolean,default:!1,description:"Native input required attribute"}},computed:{isHour(){return this.format.includes("hh")},isMin(){return this.format.includes("mm")},isSec(){return this.format.includes("ss")},labelHours(){return this.noLabel||this.label?null:this.$t("webitelUI.timepicker.hour")},labelMin(){return this.noLabel||this.label?null:this.$t("webitelUI.timepicker.min")},labelSec(){return this.noLabel||this.label?null:this.$t("webitelUI.timepicker.sec")},hour:{get(){return this.dateMode?new Date(+this.value).getHours():Math.floor(this.value/Sh)},set(i){const o=this.dateMode?new Date(this.value).setHours(i):this.value-this.hour*Sh+i*Sh;this.$emit("input",o)}},min:{get(){return this.dateMode?new Date(+this.value).getMinutes():Math.floor(this.value/Kw%60)},set(i){const o=this.dateMode?new Date(this.value).setMinutes(i):this.value-this.min*Kw+i*Kw;this.$emit("input",o)}},sec:{get(){return this.dateMode?new Date(+this.value).getSeconds():Math.floor(this.value%60)},set(i){const o=this.dateMode?new Date(this.value).setSeconds(i):this.value-this.sec+ +i;this.$emit("input",o)}},requiredLabel(){return this.required?`${this.label} (${this.format})*`:`${this.label} (${this.format})`}},methods:{onHoursBlurEvent(){const i=this.dateMode?new Date(this.value).setHours(this.hour):this.value-this.hour*Sh+this.hour*Sh;this.$emit("input",0),this.$nextTick(()=>{this.$emit("input",i)})}}},K7e={class:"wt-timepicker__wrapper"};function G7e(i,o,n,a,l,s){const d=c.resolveComponent("wt-label"),p=c.resolveComponent("wt-time-input"),h=c.resolveComponent("wt-input-info");return c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass([{"wt-timepicker--invalid":i.invalid},"wt-timepicker"])},[n.label||!n.noLabel?(c.openBlock(),c.createBlock(d,c.mergeProps({key:0},n.labelProps,{invalid:i.invalid}),{default:c.withCtx(()=>[c.renderSlot(i.$slots,"label",c.normalizeProps(c.guardReactiveProps({label:n.label})),()=>[c.createTextVNode(c.toDisplayString(s.requiredLabel),1)],!0)],void 0,!0),_:3},16,["invalid"])):c.createCommentVNode("",!0),c.createElementVNode("div",K7e,[s.isHour?(c.openBlock(),c.createBlock(p,{key:0,disabled:n.disabled,label:s.labelHours,"max-value":n.dateMode?null:23,v:i.v,value:s.hour,"hide-input-info":"",onBlur:s.onHoursBlurEvent,onInput:o[0]||(o[0]=f=>s.hour=f)},null,8,["disabled","label","max-value","v","value","onBlur"])):c.createCommentVNode("",!0),s.isMin?(c.openBlock(),c.createBlock(p,{key:1,disabled:n.disabled,label:s.labelMin,"max-value":59,v:i.v,value:s.min,"hide-input-info":"",onInput:o[1]||(o[1]=f=>s.min=f)},null,8,["disabled","label","v","value"])):c.createCommentVNode("",!0),s.isSec?(c.openBlock(),c.createBlock(p,{key:2,disabled:n.disabled,label:s.labelSec,"max-value":59,v:i.v,value:s.sec,"hide-input-info":"",onInput:o[2]||(o[2]=f=>s.sec=f)},null,8,["disabled","label","v","value"])):c.createCommentVNode("",!0)]),i.isValidation?(c.openBlock(),c.createBlock(h,{key:1,invalid:i.invalid},{default:c.withCtx(()=>[c.createTextVNode(c.toDisplayString(i.validationText),1)],void 0,!0),_:1},8,["invalid"])):c.createCommentVNode("",!0)],2)}const W7e=Ne(H7e,[["render",G7e],["__scopeId","data-v-e9eb3b40"]]),Z7e=["top","right","bottom","left"],KL=["start","end"],GL=Z7e.reduce((i,o)=>i.concat(o,o+"-"+KL[0],o+"-"+KL[1]),[]),fg=Math.min,dp=Math.max,mg=Math.round,bg=Math.floor,Kr=i=>({x:i,y:i}),Y7e={left:"right",right:"left",bottom:"top",top:"bottom"},X7e={start:"end",end:"start"};function WL(i,o,n){return dp(i,fg(o,n))}function Ih(i,o){return typeof i=="function"?i(o):i}function Ql(i){return i.split("-")[0]}function Jl(i){return i.split("-")[1]}function ZL(i){return i==="x"?"y":"x"}function YL(i){return i==="y"?"height":"width"}function Iu(i){return["top","bottom"].includes(Ql(i))?"y":"x"}function XL(i){return ZL(Iu(i))}function QL(i,o,n){n===void 0&&(n=!1);const a=Jl(i),l=XL(i),s=YL(l);let d=l==="x"?a===(n?"end":"start")?"right":"left":a==="start"?"bottom":"top";return o.reference[s]>o.floating[s]&&(d=yg(d)),[d,yg(d)]}function Q7e(i){const o=yg(i);return[gg(i),o,gg(o)]}function gg(i){return i.replace(/start|end/g,o=>X7e[o])}function J7e(i,o,n){const a=["left","right"],l=["right","left"],s=["top","bottom"],d=["bottom","top"];switch(i){case"top":case"bottom":return n?o?l:a:o?a:l;case"left":case"right":return o?s:d;default:return[]}}function ewe(i,o,n,a){const l=Jl(i);let s=J7e(Ql(i),n==="start",a);return l&&(s=s.map(d=>d+"-"+l),o&&(s=s.concat(s.map(gg)))),s}function yg(i){return i.replace(/left|right|bottom|top/g,o=>Y7e[o])}function twe(i){return{top:0,right:0,bottom:0,left:0,...i}}function owe(i){return typeof i!="number"?twe(i):{top:i,right:i,bottom:i,left:i}}function wg(i){const{x:o,y:n,width:a,height:l}=i;return{width:a,height:l,top:n,left:o,right:o+a,bottom:n+l,x:o,y:n}}function JL(i,o,n){let{reference:a,floating:l}=i;const s=Iu(o),d=XL(o),p=YL(d),h=Ql(o),f=s==="y",y=a.x+a.width/2-l.width/2,w=a.y+a.height/2-l.height/2,v=a[p]/2-l[p]/2;let C;switch(h){case"top":C={x:y,y:a.y-l.height};break;case"bottom":C={x:y,y:a.y+a.height};break;case"right":C={x:a.x+a.width,y:w};break;case"left":C={x:a.x-l.width,y:w};break;default:C={x:a.x,y:a.y}}switch(Jl(o)){case"start":C[d]-=v*(n&&f?-1:1);break;case"end":C[d]+=v*(n&&f?-1:1);break}return C}const iwe=async(i,o,n)=>{const{placement:a="bottom",strategy:l="absolute",middleware:s=[],platform:d}=n,p=s.filter(Boolean),h=await(d.isRTL==null?void 0:d.isRTL(o));let f=await d.getElementRects({reference:i,floating:o,strategy:l}),{x:y,y:w}=JL(f,a,h),v=a,C={},E=0;for(let T=0;T<p.length;T++){const{name:A,fn:I}=p[T],{x,y:O,data:_,reset:R}=await I({x:y,y:w,initialPlacement:a,placement:v,strategy:l,middlewareData:C,rects:f,platform:d,elements:{reference:i,floating:o}});y=x??y,w=O??w,C={...C,[A]:{...C[A],..._}},R&&E<=50&&(E++,typeof R=="object"&&(R.placement&&(v=R.placement),R.rects&&(f=R.rects===!0?await d.getElementRects({reference:i,floating:o,strategy:l}):R.rects),{x:y,y:w}=JL(f,v,h)),T=-1)}return{x:y,y:w,placement:v,strategy:l,middlewareData:C}};async function Gw(i,o){var n;o===void 0&&(o={});const{x:a,y:l,platform:s,rects:d,elements:p,strategy:h}=i,{boundary:f="clippingAncestors",rootBoundary:y="viewport",elementContext:w="floating",altBoundary:v=!1,padding:C=0}=Ih(o,i),E=owe(C),A=p[v?w==="floating"?"reference":"floating":w],I=wg(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(A)))==null||n?A:A.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(p.floating)),boundary:f,rootBoundary:y,strategy:h})),x=w==="floating"?{x:a,y:l,width:d.floating.width,height:d.floating.height}:d.reference,O=await(s.getOffsetParent==null?void 0:s.getOffsetParent(p.floating)),_=await(s.isElement==null?void 0:s.isElement(O))?await(s.getScale==null?void 0:s.getScale(O))||{x:1,y:1}:{x:1,y:1},R=wg(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:p,rect:x,offsetParent:O,strategy:h}):x);return{top:(I.top-R.top+E.top)/_.y,bottom:(R.bottom-I.bottom+E.bottom)/_.y,left:(I.left-R.left+E.left)/_.x,right:(R.right-I.right+E.right)/_.x}}function nwe(i,o,n){return(i?[...n.filter(l=>Jl(l)===i),...n.filter(l=>Jl(l)!==i)]:n.filter(l=>Ql(l)===l)).filter(l=>i?Jl(l)===i||(o?gg(l)!==l:!1):!0)}const awe=function(i){return i===void 0&&(i={}),{name:"autoPlacement",options:i,async fn(o){var n,a,l;const{rects:s,middlewareData:d,placement:p,platform:h,elements:f}=o,{crossAxis:y=!1,alignment:w,allowedPlacements:v=GL,autoAlignment:C=!0,...E}=Ih(i,o),T=w!==void 0||v===GL?nwe(w||null,C,v):v,A=await Gw(o,E),I=((n=d.autoPlacement)==null?void 0:n.index)||0,x=T[I];if(x==null)return{};const O=QL(x,s,await(h.isRTL==null?void 0:h.isRTL(f.floating)));if(p!==x)return{reset:{placement:T[0]}};const _=[A[Ql(x)],A[O[0]],A[O[1]]],R=[...((a=d.autoPlacement)==null?void 0:a.overflows)||[],{placement:x,overflows:_}],F=T[I+1];if(F)return{data:{index:I+1,overflows:R},reset:{placement:F}};const L=R.map(q=>{const N=Jl(q.placement);return[q.placement,N&&y?q.overflows.slice(0,2).reduce((U,te)=>U+te,0):q.overflows[0],q.overflows]}).sort((q,N)=>q[1]-N[1]),K=((l=L.filter(q=>q[2].slice(0,Jl(q[0])?2:3).every(N=>N<=0))[0])==null?void 0:l[0])||L[0][0];return K!==p?{data:{index:I+1,overflows:R},reset:{placement:K}}:{}}}},rwe=function(i){return i===void 0&&(i={}),{name:"flip",options:i,async fn(o){var n,a;const{placement:l,middlewareData:s,rects:d,initialPlacement:p,platform:h,elements:f}=o,{mainAxis:y=!0,crossAxis:w=!0,fallbackPlacements:v,fallbackStrategy:C="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:T=!0,...A}=Ih(i,o);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const I=Ql(l),x=Iu(p),O=Ql(p)===p,_=await(h.isRTL==null?void 0:h.isRTL(f.floating)),R=v||(O||!T?[yg(p)]:Q7e(p)),F=E!=="none";!v&&F&&R.push(...ewe(p,T,E,_));const L=[p,...R],H=await Gw(o,A),K=[];let q=((a=s.flip)==null?void 0:a.overflows)||[];if(y&&K.push(H[I]),w){const se=QL(l,d,_);K.push(H[se[0]],H[se[1]])}if(q=[...q,{placement:l,overflows:K}],!K.every(se=>se<=0)){var N,U;const se=(((N=s.flip)==null?void 0:N.index)||0)+1,fe=L[se];if(fe)return{data:{index:se,overflows:q},reset:{placement:fe}};let pe=(U=q.filter($=>$.overflows[0]<=0).sort(($,Z)=>$.overflows[1]-Z.overflows[1])[0])==null?void 0:U.placement;if(!pe)switch(C){case"bestFit":{var te;const $=(te=q.filter(Z=>{if(F){const W=Iu(Z.placement);return W===x||W==="y"}return!0}).map(Z=>[Z.placement,Z.overflows.filter(W=>W>0).reduce((W,Q)=>W+Q,0)]).sort((Z,W)=>Z[1]-W[1])[0])==null?void 0:te[0];$&&(pe=$);break}case"initialPlacement":pe=p;break}if(l!==pe)return{reset:{placement:pe}}}return{}}}};async function lwe(i,o){const{placement:n,platform:a,elements:l}=i,s=await(a.isRTL==null?void 0:a.isRTL(l.floating)),d=Ql(n),p=Jl(n),h=Iu(n)==="y",f=["left","top"].includes(d)?-1:1,y=s&&h?-1:1,w=Ih(o,i);let{mainAxis:v,crossAxis:C,alignmentAxis:E}=typeof w=="number"?{mainAxis:w,crossAxis:0,alignmentAxis:null}:{mainAxis:w.mainAxis||0,crossAxis:w.crossAxis||0,alignmentAxis:w.alignmentAxis};return p&&typeof E=="number"&&(C=p==="end"?E*-1:E),h?{x:C*y,y:v*f}:{x:v*f,y:C*y}}const swe=function(i){return i===void 0&&(i=0),{name:"offset",options:i,async fn(o){var n,a;const{x:l,y:s,placement:d,middlewareData:p}=o,h=await lwe(o,i);return d===((n=p.offset)==null?void 0:n.placement)&&(a=p.arrow)!=null&&a.alignmentOffset?{}:{x:l+h.x,y:s+h.y,data:{...h,placement:d}}}}},cwe=function(i){return i===void 0&&(i={}),{name:"shift",options:i,async fn(o){const{x:n,y:a,placement:l}=o,{mainAxis:s=!0,crossAxis:d=!1,limiter:p={fn:A=>{let{x:I,y:x}=A;return{x:I,y:x}}},...h}=Ih(i,o),f={x:n,y:a},y=await Gw(o,h),w=Iu(Ql(l)),v=ZL(w);let C=f[v],E=f[w];if(s){const A=v==="y"?"top":"left",I=v==="y"?"bottom":"right",x=C+y[A],O=C-y[I];C=WL(x,C,O)}if(d){const A=w==="y"?"top":"left",I=w==="y"?"bottom":"right",x=E+y[A],O=E-y[I];E=WL(x,E,O)}const T=p.fn({...o,[v]:C,[w]:E});return{...T,data:{x:T.x-n,y:T.y-a,enabled:{[v]:s,[w]:d}}}}}};function vg(){return typeof window<"u"}function pp(i){return Ww(i)?(i.nodeName||"").toLowerCase():"#document"}function ha(i){var o;return(i==null||(o=i.ownerDocument)==null?void 0:o.defaultView)||window}function Gr(i){var o;return(o=(Ww(i)?i.ownerDocument:i.document)||window.document)==null?void 0:o.documentElement}function Ww(i){return vg()?i instanceof Node||i instanceof ha(i).Node:!1}function or(i){return vg()?i instanceof Element||i instanceof ha(i).Element:!1}function Wr(i){return vg()?i instanceof HTMLElement||i instanceof ha(i).HTMLElement:!1}function eP(i){return!vg()||typeof ShadowRoot>"u"?!1:i instanceof ShadowRoot||i instanceof ha(i).ShadowRoot}function Eh(i){const{overflow:o,overflowX:n,overflowY:a,display:l}=ir(i);return/auto|scroll|overlay|hidden|clip/.test(o+a+n)&&!["inline","contents"].includes(l)}function dwe(i){return["table","td","th"].includes(pp(i))}function Cg(i){return[":popover-open",":modal"].some(o=>{try{return i.matches(o)}catch{return!1}})}function Zw(i){const o=Yw(),n=or(i)?ir(i):i;return["transform","translate","scale","rotate","perspective"].some(a=>n[a]?n[a]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!o&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!o&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(a=>(n.willChange||"").includes(a))||["paint","layout","strict","content"].some(a=>(n.contain||"").includes(a))}function pwe(i){let o=sc(i);for(;Wr(o)&&!Eu(o);){if(Zw(o))return o;if(Cg(o))return null;o=sc(o)}return null}function Yw(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Eu(i){return["html","body","#document"].includes(pp(i))}function ir(i){return ha(i).getComputedStyle(i)}function kg(i){return or(i)?{scrollLeft:i.scrollLeft,scrollTop:i.scrollTop}:{scrollLeft:i.scrollX,scrollTop:i.scrollY}}function sc(i){if(pp(i)==="html")return i;const o=i.assignedSlot||i.parentNode||eP(i)&&i.host||Gr(i);return eP(o)?o.host:o}function tP(i){const o=sc(i);return Eu(o)?i.ownerDocument?i.ownerDocument.body:i.body:Wr(o)&&Eh(o)?o:tP(o)}function Th(i,o,n){var a;o===void 0&&(o=[]),n===void 0&&(n=!0);const l=tP(i),s=l===((a=i.ownerDocument)==null?void 0:a.body),d=ha(l);if(s){const p=Xw(d);return o.concat(d,d.visualViewport||[],Eh(l)?l:[],p&&n?Th(p):[])}return o.concat(l,Th(l,[],n))}function Xw(i){return i.parent&&Object.getPrototypeOf(i.parent)?i.frameElement:null}function oP(i){const o=ir(i);let n=parseFloat(o.width)||0,a=parseFloat(o.height)||0;const l=Wr(i),s=l?i.offsetWidth:n,d=l?i.offsetHeight:a,p=mg(n)!==s||mg(a)!==d;return p&&(n=s,a=d),{width:n,height:a,$:p}}function Qw(i){return or(i)?i:i.contextElement}function Tu(i){const o=Qw(i);if(!Wr(o))return Kr(1);const n=o.getBoundingClientRect(),{width:a,height:l,$:s}=oP(o);let d=(s?mg(n.width):n.width)/a,p=(s?mg(n.height):n.height)/l;return(!d||!Number.isFinite(d))&&(d=1),(!p||!Number.isFinite(p))&&(p=1),{x:d,y:p}}const uwe=Kr(0);function iP(i){const o=ha(i);return!Yw()||!o.visualViewport?uwe:{x:o.visualViewport.offsetLeft,y:o.visualViewport.offsetTop}}function hwe(i,o,n){return o===void 0&&(o=!1),!n||o&&n!==ha(i)?!1:o}function up(i,o,n,a){o===void 0&&(o=!1),n===void 0&&(n=!1);const l=i.getBoundingClientRect(),s=Qw(i);let d=Kr(1);o&&(a?or(a)&&(d=Tu(a)):d=Tu(i));const p=hwe(s,n,a)?iP(s):Kr(0);let h=(l.left+p.x)/d.x,f=(l.top+p.y)/d.y,y=l.width/d.x,w=l.height/d.y;if(s){const v=ha(s),C=a&&or(a)?ha(a):a;let E=v,T=Xw(E);for(;T&&a&&C!==E;){const A=Tu(T),I=T.getBoundingClientRect(),x=ir(T),O=I.left+(T.clientLeft+parseFloat(x.paddingLeft))*A.x,_=I.top+(T.clientTop+parseFloat(x.paddingTop))*A.y;h*=A.x,f*=A.y,y*=A.x,w*=A.y,h+=O,f+=_,E=ha(T),T=Xw(E)}}return wg({width:y,height:w,x:h,y:f})}function Jw(i,o){const n=kg(i).scrollLeft;return o?o.left+n:up(Gr(i)).left+n}function nP(i,o,n){n===void 0&&(n=!1);const a=i.getBoundingClientRect(),l=a.left+o.scrollLeft-(n?0:Jw(i,a)),s=a.top+o.scrollTop;return{x:l,y:s}}function fwe(i){let{elements:o,rect:n,offsetParent:a,strategy:l}=i;const s=l==="fixed",d=Gr(a),p=o?Cg(o.floating):!1;if(a===d||p&&s)return n;let h={scrollLeft:0,scrollTop:0},f=Kr(1);const y=Kr(0),w=Wr(a);if((w||!w&&!s)&&((pp(a)!=="body"||Eh(d))&&(h=kg(a)),Wr(a))){const C=up(a);f=Tu(a),y.x=C.x+a.clientLeft,y.y=C.y+a.clientTop}const v=d&&!w&&!s?nP(d,h,!0):Kr(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-h.scrollLeft*f.x+y.x+v.x,y:n.y*f.y-h.scrollTop*f.y+y.y+v.y}}function mwe(i){return Array.from(i.getClientRects())}function bwe(i){const o=Gr(i),n=kg(i),a=i.ownerDocument.body,l=dp(o.scrollWidth,o.clientWidth,a.scrollWidth,a.clientWidth),s=dp(o.scrollHeight,o.clientHeight,a.scrollHeight,a.clientHeight);let d=-n.scrollLeft+Jw(i);const p=-n.scrollTop;return ir(a).direction==="rtl"&&(d+=dp(o.clientWidth,a.clientWidth)-l),{width:l,height:s,x:d,y:p}}function gwe(i,o){const n=ha(i),a=Gr(i),l=n.visualViewport;let s=a.clientWidth,d=a.clientHeight,p=0,h=0;if(l){s=l.width,d=l.height;const f=Yw();(!f||f&&o==="fixed")&&(p=l.offsetLeft,h=l.offsetTop)}return{width:s,height:d,x:p,y:h}}function ywe(i,o){const n=up(i,!0,o==="fixed"),a=n.top+i.clientTop,l=n.left+i.clientLeft,s=Wr(i)?Tu(i):Kr(1),d=i.clientWidth*s.x,p=i.clientHeight*s.y,h=l*s.x,f=a*s.y;return{width:d,height:p,x:h,y:f}}function aP(i,o,n){let a;if(o==="viewport")a=gwe(i,n);else if(o==="document")a=bwe(Gr(i));else if(or(o))a=ywe(o,n);else{const l=iP(i);a={x:o.x-l.x,y:o.y-l.y,width:o.width,height:o.height}}return wg(a)}function rP(i,o){const n=sc(i);return n===o||!or(n)||Eu(n)?!1:ir(n).position==="fixed"||rP(n,o)}function wwe(i,o){const n=o.get(i);if(n)return n;let a=Th(i,[],!1).filter(p=>or(p)&&pp(p)!=="body"),l=null;const s=ir(i).position==="fixed";let d=s?sc(i):i;for(;or(d)&&!Eu(d);){const p=ir(d),h=Zw(d);!h&&p.position==="fixed"&&(l=null),(s?!h&&!l:!h&&p.position==="static"&&!!l&&["absolute","fixed"].includes(l.position)||Eh(d)&&!h&&rP(i,d))?a=a.filter(y=>y!==d):l=p,d=sc(d)}return o.set(i,a),a}function vwe(i){let{element:o,boundary:n,rootBoundary:a,strategy:l}=i;const d=[...n==="clippingAncestors"?Cg(o)?[]:wwe(o,this._c):[].concat(n),a],p=d[0],h=d.reduce((f,y)=>{const w=aP(o,y,l);return f.top=dp(w.top,f.top),f.right=fg(w.right,f.right),f.bottom=fg(w.bottom,f.bottom),f.left=dp(w.left,f.left),f},aP(o,p,l));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function Cwe(i){const{width:o,height:n}=oP(i);return{width:o,height:n}}function kwe(i,o,n){const a=Wr(o),l=Gr(o),s=n==="fixed",d=up(i,!0,s,o);let p={scrollLeft:0,scrollTop:0};const h=Kr(0);if(a||!a&&!s)if((pp(o)!=="body"||Eh(l))&&(p=kg(o)),a){const v=up(o,!0,s,o);h.x=v.x+o.clientLeft,h.y=v.y+o.clientTop}else l&&(h.x=Jw(l));const f=l&&!a&&!s?nP(l,p):Kr(0),y=d.left+p.scrollLeft-h.x-f.x,w=d.top+p.scrollTop-h.y-f.y;return{x:y,y:w,width:d.width,height:d.height}}function ev(i){return ir(i).position==="static"}function lP(i,o){if(!Wr(i)||ir(i).position==="fixed")return null;if(o)return o(i);let n=i.offsetParent;return Gr(i)===n&&(n=n.ownerDocument.body),n}function sP(i,o){const n=ha(i);if(Cg(i))return n;if(!Wr(i)){let l=sc(i);for(;l&&!Eu(l);){if(or(l)&&!ev(l))return l;l=sc(l)}return n}let a=lP(i,o);for(;a&&dwe(a)&&ev(a);)a=lP(a,o);return a&&Eu(a)&&ev(a)&&!Zw(a)?n:a||pwe(i)||n}const xwe=async function(i){const o=this.getOffsetParent||sP,n=this.getDimensions,a=await n(i.floating);return{reference:kwe(i.reference,await o(i.floating),i.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function Swe(i){return ir(i).direction==="rtl"}const Iwe={convertOffsetParentRelativeRectToViewportRelativeRect:fwe,getDocumentElement:Gr,getClippingRect:vwe,getOffsetParent:sP,getElementRects:xwe,getClientRects:mwe,getDimensions:Cwe,getScale:Tu,isElement:or,isRTL:Swe};function cP(i,o){return i.x===o.x&&i.y===o.y&&i.width===o.width&&i.height===o.height}function Ewe(i,o){let n=null,a;const l=Gr(i);function s(){var p;clearTimeout(a),(p=n)==null||p.disconnect(),n=null}function d(p,h){p===void 0&&(p=!1),h===void 0&&(h=1),s();const f=i.getBoundingClientRect(),{left:y,top:w,width:v,height:C}=f;if(p||o(),!v||!C)return;const E=bg(w),T=bg(l.clientWidth-(y+v)),A=bg(l.clientHeight-(w+C)),I=bg(y),O={rootMargin:-E+"px "+-T+"px "+-A+"px "+-I+"px",threshold:dp(0,fg(1,h))||1};let _=!0;function R(F){const L=F[0].intersectionRatio;if(L!==h){if(!_)return d();L?d(!1,L):a=setTimeout(()=>{d(!1,1e-7)},1e3)}L===1&&!cP(f,i.getBoundingClientRect())&&d(),_=!1}try{n=new IntersectionObserver(R,{...O,root:l.ownerDocument})}catch{n=new IntersectionObserver(R,O)}n.observe(i)}return d(!0),s}function dP(i,o,n,a){a===void 0&&(a={});const{ancestorScroll:l=!0,ancestorResize:s=!0,elementResize:d=typeof ResizeObserver=="function",layoutShift:p=typeof IntersectionObserver=="function",animationFrame:h=!1}=a,f=Qw(i),y=l||s?[...f?Th(f):[],...Th(o)]:[];y.forEach(I=>{l&&I.addEventListener("scroll",n,{passive:!0}),s&&I.addEventListener("resize",n)});const w=f&&p?Ewe(f,n):null;let v=-1,C=null;d&&(C=new ResizeObserver(I=>{let[x]=I;x&&x.target===f&&C&&(C.unobserve(o),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var O;(O=C)==null||O.observe(o)})),n()}),f&&!h&&C.observe(f),C.observe(o));let E,T=h?up(i):null;h&&A();function A(){const I=up(i);T&&!cP(T,I)&&n(),T=I,E=requestAnimationFrame(A)}return n(),()=>{var I;y.forEach(x=>{l&&x.removeEventListener("scroll",n),s&&x.removeEventListener("resize",n)}),w==null||w(),(I=C)==null||I.disconnect(),C=null,h&&cancelAnimationFrame(E)}}const Twe=swe,Awe=awe,pP=cwe,uP=rwe,hP=(i,o,n)=>{const a=new Map,l={platform:Iwe,...n},s={...l.platform,_c:a};return iwe(i,o,{...l,platform:s})};function Dwe(i){return i!=null&&typeof i=="object"&&"$el"in i}function fP(i){if(Dwe(i)){const o=i.$el;return Ww(o)&&pp(o)==="#comment"?null:o}return i}function Ah(i){return typeof i=="function"?i():c.unref(i)}function mP(i){return typeof window>"u"?1:(i.ownerDocument.defaultView||window).devicePixelRatio||1}function bP(i,o){const n=mP(i);return Math.round(o*n)/n}function _we(i,o,n){n===void 0&&(n={});const a=n.whileElementsMounted,l=c.computed(()=>{var L;return(L=Ah(n.open))!=null?L:!0}),s=c.computed(()=>Ah(n.middleware)),d=c.computed(()=>{var L;return(L=Ah(n.placement))!=null?L:"bottom"}),p=c.computed(()=>{var L;return(L=Ah(n.strategy))!=null?L:"absolute"}),h=c.computed(()=>{var L;return(L=Ah(n.transform))!=null?L:!0}),f=c.computed(()=>fP(i.value)),y=c.computed(()=>fP(o.value)),w=c.ref(0),v=c.ref(0),C=c.ref(p.value),E=c.ref(d.value),T=c.shallowRef({}),A=c.ref(!1),I=c.computed(()=>{const L={position:C.value,left:"0",top:"0"};if(!y.value)return L;const H=bP(y.value,w.value),K=bP(y.value,v.value);return h.value?{...L,transform:"translate("+H+"px, "+K+"px)",...mP(y.value)>=1.5&&{willChange:"transform"}}:{position:C.value,left:H+"px",top:K+"px"}});let x;function O(){if(f.value==null||y.value==null)return;const L=l.value;hP(f.value,y.value,{middleware:s.value,placement:d.value,strategy:p.value}).then(H=>{w.value=H.x,v.value=H.y,C.value=H.strategy,E.value=H.placement,T.value=H.middlewareData,A.value=L!==!1})}function _(){typeof x=="function"&&(x(),x=void 0)}function R(){if(_(),a===void 0){O();return}if(f.value!=null&&y.value!=null){x=a(f.value,y.value,O);return}}function F(){l.value||(A.value=!1)}return c.watch([s,d,p,l],O,{flush:"sync"}),c.watch([f,y],R,{flush:"sync"}),c.watch(l,F,{flush:"sync"}),c.getCurrentScope()&&c.onScopeDispose(_),{x:c.shallowReadonly(w),y:c.shallowReadonly(v),strategy:c.shallowReadonly(C),placement:c.shallowReadonly(E),middlewareData:c.shallowReadonly(T),isPositioned:c.shallowReadonly(A),floatingStyles:I,update:O}}const gP={hover:"mouseenter",focus:"focus",click:"click",touch:"touchstart",pointer:"pointerdown"},yP={hover:"mouseleave",focus:"blur",click:"click",touch:"touchend",pointer:"pointerup"},wP=({target:i,triggers:o,show:n,hide:a})=>{const l=()=>{((p,h)=>{h.forEach(f=>{const y=gP[f];y?p.addEventListener(y,n):console.log(`No Tooltip Show event for ${f} trigger`);const w=yP[f];w?p.addEventListener(w,a):console.log(`No Tooltip Hide event for ${f} trigger`)})})(i.value,o)},s=()=>{((p,h)=>{h.forEach(f=>{const y=gP[f];y?p.removeEventListener(y,n):console.log(`No Tooltip Show event for ${f} trigger`);const w=yP[f];w?p.removeEventListener(w,a):console.log(`No Tooltip Hide event for ${f} trigger`)})})(i.value,o)};c.onMounted(()=>l()),c.onBeforeUnmount(()=>s())},Owe={__name:"wt-tooltip-floating",props:{triggers:{type:Array,default:()=>[]}},emits:["show","hide"],setup(i,{emit:o}){const n=i,a=o,l=c.ref(null);return wP({target:l,triggers:n.triggers,show:()=>a("show"),hide:()=>a("hide")}),(s,d)=>(c.openBlock(),c.createElementBlock("aside",{ref_key:"floating",ref:l,class:"wt-tooltip-floating"},[c.renderSlot(s.$slots,"default")],512))}},Rwe=Ne({__name:"wt-tooltip",props:{visible:{type:Boolean,default:!1},placement:{type:String,default:"auto"},popperTriggers:{type:Array,default:()=>[]},triggers:{type:Array,default:()=>["hover","focus","touch"]},popperClass:{type:String,default:""},disabled:{type:Boolean,default:!1},disableClickAway:{type:Boolean,default:!1}},emits:["update:visible"],setup(i,{emit:o}){const n=i,a=o,l=c.useTemplateRef("activator"),s=c.useTemplateRef("floating"),d=c.useTemplateRef("floatingChild"),p=c.ref(n.visible),h=()=>{a("update:visible",p.value)},f=(T={})=>{n.disabled||p.value||(p.value=!0,T.usedByTooltip=!0,h(),v())},y=(T={})=>{var I;const A=(I=d.value)==null?void 0:I.contains(T.target);!p.value||T.usedByTooltip||A||(p.value=!1,h(),C())},w=(T={})=>{n.disableClickAway||y(T)},v=()=>{window.addEventListener("scroll",y,!0)},C=()=>{window.removeEventListener("scroll",y,!0)},{floatingStyles:E}=_we(l,s,{placement:n.placement==="auto"?null:n.placement,strategy:"fixed",whileElementsMounted:dP,middleware:[pP(),Twe(4),n.placement==="auto"?Awe():uP()]});return wP({target:l,triggers:n.triggers,show:f,hide:y}),c.watch(()=>n.visible,T=>{T?f():y()}),c.onMounted(()=>{n.visible&&f()}),c.onBeforeUnmount(()=>{C()}),(T,A)=>{const I=c.resolveDirective("clickaway");return c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass([{"wt-tooltip--visible":p.value},"wt-tooltip"])},[c.createElementVNode("div",{ref_key:"activator",ref:l,class:"wt-tooltip__activator"},[c.renderSlot(T.$slots,"activator",c.normalizeProps(c.guardReactiveProps({visible:p.value})),void 0,!0)],512),p.value?c.withDirectives((c.openBlock(),c.createBlock(Owe,{key:0,ref_key:"floating",ref:s,class:c.normalizeClass([[i.popperClass],"wt-tooltip__floating"]),style:c.normalizeStyle(c.unref(E)),triggers:i.popperTriggers,onHide:y,onShow:f},{default:c.withCtx(()=>[c.createElementVNode("div",{ref_key:"floatingChild",ref:d},[c.renderSlot(T.$slots,"default",c.normalizeProps(c.guardReactiveProps({hide:y})),void 0,!0)],512)],void 0,!0),_:3},8,["class","style","triggers"])),[[I,w]]):c.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-b8fd5806"]]),Bwe={class:"wt-tree-line"},Lwe={class:"wt-tree-line__icon-wrapper"},Pwe={class:"wt-tree-line__label"},$we=c.defineComponent({__name:"wt-tree-line",props:{modelValue:{},data:{},itemLabel:{},itemData:{},childrenProp:{default:"children"},nestedLevel:{default:0},lastChild:{type:Boolean,default:!1},selectedParent:{type:Boolean,default:!1},nestedIcons:{},nextElement:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},allowParent:{type:Boolean,default:!1},searchedProp:{default:"searched"},rootData:{}},emits:["openParent","update:modelValue"],setup(i,{emit:o}){const n=i,a=o,l=c.computed(()=>n.itemLabel?n.data[n.itemLabel]:n.data),s=c.computed(()=>{const I=n.nestedIcons?[...n.nestedIcons]:[];return n.nestedLevel===0||I.push({icon:"tree-line",hidden:!n.nextElement}),I}),d=()=>Array.isArray(n.modelValue)?n.itemData?n.modelValue.includes(n.data[n.itemData]):!!n.modelValue.find(x=>lc(x,n.data)):!1,p=c.computed(()=>n.multiple?d():n.itemData?n.data[n.itemData]===n.modelValue:lc(n.modelValue,n.data)),h=c.computed(()=>n.multiple?p.value:p.value||n.selectedParent),f=(I,x,O)=>{const _=n.itemData?I[n.itemData]:I;if(x)O.some(R=>lc(R,_))||O.push(_);else{const R=O.findIndex(F=>lc(F,_));R!==-1&&O.splice(R,1)}if(I&&Array.isArray(I[n.childrenProp])&&I[n.childrenProp].length)for(const R of I[n.childrenProp])f(R,x,O)},y=(I,x,O)=>{const _=(R,F)=>{if(R===I){if(F){const L=n.itemData?F[n.itemData]:F,H=O.findIndex(K=>lc(K,L));H!==-1&&O.splice(H,1)}return!0}if(R&&Array.isArray(R[n.childrenProp])&&R[n.childrenProp].length){for(const L of R[n.childrenProp])if(_(L,R))return!0}return!1};_(x,null)},w=()=>{const I=p.value,x=[...n.modelValue];f(n.data,!I,x),I&&y(n.data,n.rootData,x),a("update:modelValue",x)},v=()=>{const I=n.itemData?n.data[n.itemData]:n.data;let x;if(n.itemData?x=n.modelValue.indexOf(n.data[n.itemData]):x=n.modelValue.findIndex(_=>lc(_,n.data)),x===-1){const _=[...n.modelValue];_.push(I),a("update:modelValue",_);return}const O=[...n.modelValue];O.splice(x,1),a("update:modelValue",O)},C=()=>{var I,x;if(n.multiple){(I=n.data[n.childrenProp])!=null&&I.length?w():v();return}if(n.allowParent&&!n.data[n.childrenProp])return a("update:modelValue",n.itemData?n.data[n.itemData]:n.data);if((x=n.data[n.childrenProp])!=null&&x.length){E.value=!E.value;return}a("update:modelValue",n.itemData?n.data[n.itemData]:n.data)},E=c.ref(!0),T=()=>{n.nestedLevel>0&&a("openParent")},A=()=>{E.value=!1,T()};return c.onMounted(()=>{p.value&&T(),n.data[n.searchedProp]&&T()}),c.watch(()=>n.modelValue,()=>{p.value&&T()}),(I,x)=>{const O=c.resolveComponent("wt-icon"),_=c.resolveComponent("wt-icon-btn"),R=c.resolveComponent("wt-tree-line",!0);return c.openBlock(),c.createElementBlock(c.Fragment,null,[c.createElementVNode("div",Bwe,[c.createElementVNode("div",Lwe,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(I.nestedIcons,(F,L)=>(c.openBlock(),c.createBlock(O,{key:L,icon:F.icon,class:c.normalizeClass({hidden:F.hidden})},null,8,["icon","class"]))),128)),I.nestedLevel>=1?(c.openBlock(),c.createBlock(O,{key:0,icon:I.lastChild?"tree-corner":"tree-cross"},null,8,["icon"])):c.createCommentVNode("",!0),I.data[I.childrenProp]&&I.data[I.childrenProp].length?(c.openBlock(),c.createBlock(_,{key:1,icon:E.value?"plus":"minus",onClick:x[0]||(x[0]=F=>E.value=!E.value)},null,8,["icon"])):c.createCommentVNode("",!0)]),c.createElementVNode("div",{class:c.normalizeClass([{active:h.value,searched:n.data[n.searchedProp]},"wt-tree-line__label-wrapper"]),onClick:C},[c.createElementVNode("p",Pwe,c.toDisplayString(l.value),1),h.value?(c.openBlock(),c.createBlock(O,{key:0,icon:"chat-message-status-sent"})):c.createCommentVNode("",!0)],2)]),c.withDirectives(c.createVNode(R8,null,{default:c.withCtx(()=>[c.createElementVNode("div",null,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(I.data[I.childrenProp],(F,L)=>(c.openBlock(),c.createBlock(R,{key:L,"model-value":I.modelValue,data:F,"children-prop":I.childrenProp,"item-label":I.itemLabel,"item-data":I.itemData,"nested-level":I.nestedLevel+1,"selected-parent":p.value||I.selectedParent,"next-element":!!I.data[I.childrenProp][L+1],"nested-icons":s.value,"last-child":L===I.data[I.childrenProp].length-1,multiple:I.multiple,"allow-parent":I.allowParent,"root-data":I.rootData||I.data,onOpenParent:A,"onUpdate:modelValue":x[1]||(x[1]=H=>a("update:modelValue",H))},null,8,["model-value","data","children-prop","item-label","item-data","nested-level","selected-parent","next-element","nested-icons","last-child","multiple","allow-parent","root-data"]))),128))])],void 0,!0),_:1},512),[[c.vShow,!E.value]])],64)}}}),tv={Tree:"tree",List:"list"},Mwe={class:"wt-tree"},Nwe={key:0,class:"wt-tree__content"},jwe={key:1,class:"wt-tree__list-content"},Fwe=["onClick"],qwe=c.defineComponent({__name:"wt-tree",props:{modelValue:{},data:{},itemLabel:{},itemData:{},mode:{default:tv.Tree},childrenProp:{default:"children"},multiple:{type:Boolean},allowParent:{type:Boolean,default:!1}},emits:["select","update:modelValue"],setup(i,{emit:o}){const n=i,a=o,l=c.computed(()=>{const p=[],h=f=>{p.push(f),f[n.childrenProp]&&f[n.childrenProp].forEach(y=>{h(y)})};return n.data.forEach(f=>{h(f)}),p}),s=p=>{a("update:modelValue",n.itemData?p[n.itemData]:p)},d=p=>n.itemData?p[n.itemData]===n.modelValue:lc(n.modelValue,p);return(p,h)=>{const f=c.resolveComponent("wt-icon");return c.openBlock(),c.createElementBlock("div",Mwe,[p.mode===c.unref(tv).Tree?(c.openBlock(),c.createElementBlock("div",Nwe,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(p.data,(y,w)=>(c.openBlock(),c.createBlock($we,{key:w,"model-value":p.modelValue,"item-label":p.itemLabel,"item-data":p.itemData,data:y,"children-prop":p.childrenProp,multiple:p.multiple,"allow-parent":p.allowParent,"onUpdate:modelValue":h[0]||(h[0]=v=>a("update:modelValue",v))},null,8,["model-value","item-label","item-data","data","children-prop","multiple","allow-parent"]))),128))])):c.createCommentVNode("",!0),p.mode===c.unref(tv).List?(c.openBlock(),c.createElementBlock("div",jwe,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(l.value,(y,w)=>(c.openBlock(),c.createElementBlock("span",{key:w,class:c.normalizeClass(["wt-tree__label-wrapper",{active:d(y)}])},[c.createElementVNode("p",{class:"wt-tree__label",onClick:v=>s(y)},c.toDisplayString(p.itemLabel?y[p.itemLabel]:y),9,Fwe),d(y)?(c.openBlock(),c.createBlock(f,{key:0,icon:"chat-message-status-sent",class:"wt-tree__label-icon"})):c.createCommentVNode("",!0)],2))),128))])):c.createCommentVNode("",!0)])}}}),Vwe={class:"wt-tree-table-td__content"},zwe={key:0,class:"wt-tree-table-td__icon-wrapper"},Uwe={key:0,class:"wt-tree-table-td__actions"},Hwe={class:"wt-tree-table-td__content"},Kwe=Ne(c.defineComponent({__name:"wt-tree-table-row",props:{data:{},rowPosition:{},childrenProp:{},selectable:{type:Boolean,default:!1},selectedElements:{},dataHeaders:{},gridActions:{type:Boolean,default:!0},nestingLevel:{default:0},searchedProp:{default:"searched"}},emits:["update:selected","expanded-collapse"],setup(i,{emit:o}){const n=i,a=o,l=c.ref(!0),s=c.computed(()=>n.nestingLevel),d=c.computed(()=>n.nestingLevel+1),p=c.computed(()=>n.selectedElements.includes(n.data)),h=()=>{l.value=!1,a("expanded-collapse")},f=(y,w=0)=>{if(y[n.searchedProp]&&w)return!0;if(Array.isArray(y[n.childrenProp])){for(const v of y[n.childrenProp])if(f(v,w+1))return!0}return!1};return c.onMounted(()=>{n.searchedProp&&f(n.data)&&h()}),(y,w)=>{const v=c.resolveComponent("wt-tree-table-row",!0);return c.openBlock(),c.createElementBlock(c.Fragment,null,[c.createElementVNode("tr",{class:c.normalizeClass([[{"wt-tree-table-row--alternate":y.rowPosition%2}],"wt-tree-table-row"])},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(y.dataHeaders,(C,E)=>(c.openBlock(),c.createElementBlock("td",{key:E,class:"wt-tree-table-td"},[c.createElementVNode("div",Vwe,[E?c.createCommentVNode("",!0):(c.openBlock(),c.createElementBlock("div",zwe,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(s.value,T=>(c.openBlock(),c.createElementBlock("div",{key:T,class:"wt-tree-table-row__tree-space"}))),128)),y.selectable?(c.openBlock(),c.createBlock(Z6,{key:0,selected:p.value,"onUpdate:selected":w[0]||(w[0]=T=>y.$emit("update:selected",{data:y.data,select:T}))},null,8,["selected"])):c.createCommentVNode("",!0),y.data[y.childrenProp]?(c.openBlock(),c.createBlock(lp,{key:1,icon:l.value?"tree-expand":"tree-collapse",onClick:w[1]||(w[1]=T=>l.value=!l.value)},null,8,["icon"])):c.createCommentVNode("",!0)])),c.renderSlot(y.$slots,C.value,{index:y.rowPosition,item:y.data},()=>[c.createTextVNode(c.toDisplayString(y.data[C.value]),1)],!0)])]))),128)),y.gridActions?(c.openBlock(),c.createElementBlock("td",Uwe,[c.createElementVNode("div",Hwe,[c.renderSlot(y.$slots,"actions",{index:y.rowPosition,item:y.data},void 0,!0)])])):c.createCommentVNode("",!0)],2),l.value?c.createCommentVNode("",!0):(c.openBlock(!0),c.createElementBlock(c.Fragment,{key:0},c.renderList(y.data[y.childrenProp],(C,E)=>(c.openBlock(),c.createBlock(v,{key:E,"children-prop":y.childrenProp,data:C,"data-headers":y.dataHeaders,"nesting-level":d.value,"row-position":y.rowPosition,"searched-prop":y.searchedProp,selectable:y.selectable,"selected-elements":y.selectedElements,onExpandedCollapse:h,"onUpdate:selected":w[2]||(w[2]=T=>y.$emit("update:selected",{data:T.data,select:T.select}))},c.createSlots({actions:c.withCtx(({item:T})=>[c.renderSlot(y.$slots,"actions",{index:y.rowPosition,item:T},void 0,!0)]),_:2},[c.renderList(y.dataHeaders,(T,A)=>({name:T.value,fn:c.withCtx(({item:I})=>[c.renderSlot(y.$slots,T.value,{index:y.rowPosition,item:I},()=>[c.createElementVNode("div",null,c.toDisplayString(I[T.value]),1)],!0)])}))]),1032,["children-prop","data","data-headers","nesting-level","row-position","searched-prop","selectable","selected-elements"]))),128))],64)}}}),[["__scopeId","data-v-638adedd"]]),Gwe={class:"wt-tree-table"},Wwe={class:"wt-tree-table-wrapper"},Zwe={class:"wt-tree-table-head"},Ywe={class:"wt-tree-table-tr wt-tree-table-tr-head"},Xwe=["onClick"],Qwe={class:"wt-tree-table-th__content"},Jwe={class:"wt-tree-table-th__text"},eve={key:0,class:"wt-tree-table-th__actions"},tve={class:"wt-tree-table-th__content"},ove={class:"wt-tree-table-body"},ive=Ne(c.defineComponent({__name:"wt-tree-table",props:{headers:{},data:{},sortable:{type:Boolean,default:!1},selectable:{type:Boolean,default:!0},selected:{},gridActions:{type:Boolean,default:!0},childrenProp:{},searchedProp:{default:"searched"}},emits:["sort","update:selected"],setup(i,{emit:o}){const n=i,a=o,l=T=>T[n.childrenProp]&&Array.isArray(T[n.childrenProp]),s=T=>{const A=[],I=x=>{if(x._isSelected)return[x];l(x)&&x[n.childrenProp].forEach(I)};return T.forEach(I),A},d=T=>{const A=[],I=x=>{A.push(x),l(x)&&x[n.childrenProp].forEach(I)};return T.forEach(I),A},p=c.computed(()=>n.selected||s(n.data)),h=c.computed(()=>p.value.length===d(n.data).length&&d(n.data).length>0),{tableHeaders:f}=W5e({headers:n.headers}),y=({sort:T})=>n.sortable&&T!==void 0,w=T=>{if(!y(T))return;const A=_B(T.sort);a("sort",T,A)},v=(T,A)=>{T.forEach(I=>{I._isSelected=A,l(I)&&v(I[n.childrenProp],A)})},C=()=>{n.selected?a("update:selected",h.value?[]:[...d(n.data)]):h.value?v(n.data,!1):v(n.data,!0)},E=(T,A)=>{n.selected?A?a("update:selected",[...p.value,T]):a("update:selected",p.value.filter(I=>I!==T)):T._isSelected=!T._isSelected};return(T,A)=>{const I=c.resolveComponent("wt-icon");return c.openBlock(),c.createElementBlock("div",Gwe,[c.createElementVNode("table",Wwe,[c.createElementVNode("thead",Zwe,[c.createElementVNode("tr",Ywe,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(c.unref(f),(x,O)=>(c.openBlock(),c.createElementBlock("th",{key:O,class:c.normalizeClass([[{"wt-tree-table-th--sortable":y(x)},`wt-tree-table-th--sort-${x.sort}`],"wt-tree-table-th"]),style:c.normalizeStyle(x.width?`min-width:${x.width}`:""),onClick:_=>w(x)},[c.createElementVNode("div",Qwe,[O===0&&T.selectable?(c.openBlock(),c.createElementBlock("div",{key:0,onClick:A[0]||(A[0]=c.withModifiers(()=>{},["stop"]))},[c.createVNode(Z6,{selected:h.value,"onUpdate:selected":C},null,8,["selected"])])):c.createCommentVNode("",!0),c.createElementVNode("div",Jwe,c.toDisplayString(x.text),1),T.sortable?(c.openBlock(),c.createBlock(I,{key:1,class:"wt-tree-table-th-sort-arrow wt-tree-table-th-sort-arrow--asc",icon:"sort-arrow-up",size:"sm"})):c.createCommentVNode("",!0),T.sortable?(c.openBlock(),c.createBlock(I,{key:2,class:"wt-tree-table-th-sort-arrow wt-tree-table-th-sort-arrow--desc",icon:"sort-arrow-down",size:"sm"})):c.createCommentVNode("",!0)])],14,Xwe))),128)),T.gridActions?(c.openBlock(),c.createElementBlock("th",eve,[c.createElementVNode("div",tve,[c.renderSlot(T.$slots,"actions-header",{},void 0,!0)])])):c.createCommentVNode("",!0)])]),c.createElementVNode("tbody",ove,[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(T.data,(x,O)=>(c.openBlock(),c.createBlock(Kwe,{key:O,"row-position":O,"data-headers":c.unref(f),data:x,selectable:T.selectable,"children-prop":T.childrenProp,"selected-elements":p.value,"searched-prop":T.searchedProp,"onUpdate:selected":A[1]||(A[1]=_=>E(_.data,_.select))},c.createSlots({actions:c.withCtx(({item:_})=>[c.renderSlot(T.$slots,"actions",{item:_},void 0,!0)]),_:2},[c.renderList(c.unref(f),(_,R)=>({name:_.value,fn:c.withCtx(({item:F})=>[c.renderSlot(T.$slots,_.value,{index:O,item:F},()=>[c.createTextVNode(c.toDisplayString(F[_.value]),1)],!0)])}))]),1032,["row-position","data-headers","data","selectable","children-prop","selected-elements","searched-prop"]))),128))])])])}}}),[["__scopeId","data-v-e81e20e8"]]),Zr=Symbol(0);let xg=!1,ov=!1,nr=null,Au=null,La=null,fa=0,Du=[],iv={};const nve=()=>{},_u=0,vP=1,Sg=2,Ig=3;function ave(){xg=!0,queueMicrotask(CP)}function CP(){if(!Du.length){xg=!1;return}ov=!0;for(let i=0;i<Du.length;i++)Du[i].$st!==_u&&rve(Du[i]);Du=[],xg=!1,ov=!1}function rve(i){let o=[i];for(;i=i[Zr];)i.$e&&i.$st!==_u&&o.push(i);for(let n=o.length-1;n>=0;n--)cv(o[n])}function lve(i){const o=cc();return Dh(o,i.length?i.bind(null,Ru.bind(o)):i,null)}function Re(i){return Dh(nr,i,null)}function Ou(i){return Dh(null,i,null)}function es(){ov||CP()}function Eg(){return nr}function kn(i,o){try{return Dh(o,i,null)}catch(n){nv(o,n);return}}function kP(i,o=nr){return o==null?void 0:o.$cx[i]}function sve(i,o,n=nr){n&&(n.$cx={...n.$cx,[i]:o})}function At(i){if(!i||!nr)return i||nve;const o=nr;return o.$d?Array.isArray(o.$d)?o.$d.push(i):o.$d=[o.$d,i]:o.$d=i,function(){o.$st!==Ig&&(i.call(null),Tg(o.$d)?o.$d=null:Array.isArray(o.$d)&&o.$d.splice(o.$d.indexOf(i),1))}}function Ru(i=!0){if(this.$st!==Ig){if(this.$h)if(Array.isArray(this.$h))for(let o=this.$h.length-1;o>=0;o--)Ru.call(this.$h[o]);else Ru.call(this.$h);if(i){const o=this[Zr];o&&(Array.isArray(o.$h)?o.$h.splice(o.$h.indexOf(this),1):o.$h=null),cve(this)}}}function cve(i){i.$st=Ig,i.$d&&xP(i),i.$s&&dv(i,0),i[Zr]=null,i.$s=null,i.$o=null,i.$h=null,i.$cx=iv,i.$eh=null}function xP(i){try{if(Array.isArray(i.$d))for(let o=i.$d.length-1;o>=0;o--){const n=i.$d[o];n.call(n)}else i.$d.call(i.$d);i.$d=null}catch(o){nv(i,o)}}function Dh(i,o,n){const a=nr,l=Au;nr=i,Au=n;try{return o.call(i)}finally{nr=a,Au=l}}function nv(i,o){if(!i||!i.$eh)throw o;let n=0,a=i.$eh.length,l=o;for(n=0;n<a;n++)try{i.$eh[n](l);break}catch(s){l=s}if(n===a)throw l}function av(){return this.$st===Ig?this.$v:(Au&&!this.$e&&(!La&&Au.$s&&Au.$s[fa]==this?fa++:La?La.push(this):La=[this]),this.$c&&cv(this),this.$v)}function SP(i){const o=Tg(i)?i(this.$v):i;if(this.$ch(this.$v,o)&&(this.$v=o,this.$o))for(let n=0;n<this.$o.length;n++)AP(this.$o[n],Sg);return this.$v}const rv=function(){this[Zr]=null,this.$h=null,nr&&nr.append(this)},hp=rv.prototype;hp.$cx=iv,hp.$eh=null,hp.$c=null,hp.$d=null,hp.append=function(i){i[Zr]=this,this.$h?Array.isArray(this.$h)?this.$h.push(i):this.$h=[this.$h,i]:this.$h=i,i.$cx=i.$cx===iv?this.$cx:{...this.$cx,...i.$cx},this.$eh&&(i.$eh=i.$eh?[...i.$eh,...this.$eh]:this.$eh)},hp.dispose=function(){Ru.call(this)};function cc(){return new rv}const IP=function(o,n,a){rv.call(this),this.$st=n?Sg:_u,this.$i=!1,this.$e=!1,this.$s=null,this.$o=null,this.$v=o,n&&(this.$c=n),a&&a.dirty&&(this.$ch=a.dirty)},lv=IP.prototype;Object.setPrototypeOf(lv,hp),lv.$ch=dve,lv.call=av;function sv(i,o,n){return new IP(i,o,n)}function dve(i,o){return i!==o}function Tg(i){return typeof i=="function"}function cv(i){if(i.$st===vP)for(let o=0;o<i.$s.length&&(cv(i.$s[o]),i.$st!==Sg);o++);i.$st===Sg?EP(i):i.$st=_u}function pve(i){i.$h&&Ru.call(i,!1),i.$d&&xP(i),i.$eh=i[Zr]?i[Zr].$eh:null}function EP(i){let o=La,n=fa;La=null,fa=0;try{pve(i);const a=Dh(i,i.$c,i);TP(i),!i.$e&&i.$i?SP.call(i,a):(i.$v=a,i.$i=!0)}catch(a){TP(i),nv(i,a)}finally{La=o,fa=n,i.$st=_u}}function TP(i){if(La){if(i.$s&&dv(i,fa),i.$s&&fa>0){i.$s.length=fa+La.length;for(let n=0;n<La.length;n++)i.$s[fa+n]=La[n]}else i.$s=La;let o;for(let n=fa;n<i.$s.length;n++)o=i.$s[n],o.$o?o.$o.push(i):o.$o=[i]}else i.$s&&fa<i.$s.length&&(dv(i,fa),i.$s.length=fa)}function AP(i,o){if(!(i.$st>=o)&&(i.$e&&i.$st===_u&&(Du.push(i),xg||ave()),i.$st=o,i.$o))for(let n=0;n<i.$o.length;n++)AP(i.$o[n],vP)}function dv(i,o){let n,a;for(let l=o;l<i.$s.length;l++)n=i.$s[l],n.$o&&(a=n.$o.indexOf(i),n.$o[a]=n.$o[n.$o.length-1],n.$o.pop())}function Ag(...i){}function Yr(i){return i===null}function an(i){return typeof i>"u"}function uve(i){return Yr(i)||an(i)}function DP(i){return(i==null?void 0:i.constructor)===Object}function Li(i){return typeof i=="number"&&!Number.isNaN(i)}function Je(i){return typeof i=="string"}function _P(i){return typeof i=="boolean"}function ar(i){return typeof i=="function"}function rn(i){return Array.isArray(i)}const hve=Event,OP=Symbol("DOM_EVENT");class Ot extends(oz=hve,tz=OP,oz){constructor(n,...a){var s,d;super(n,a[0]);V(this,tz,!0);V(this,"detail");V(this,"triggers",new fve);this.detail=(s=a[0])==null?void 0:s.detail;const l=(d=a[0])==null?void 0:d.trigger;l&&this.triggers.add(l)}get trigger(){return this.triggers.source}get originEvent(){return this.triggers.origin}get isOriginTrusted(){var n;return((n=this.triggers.origin)==null?void 0:n.isTrusted)??!1}}class fve{constructor(){V(this,"chain",[])}get source(){return this.chain[0]}get origin(){return this.chain[this.chain.length-1]}add(o){this.chain.push(o),mve(o)&&this.chain.push(...o.triggers)}remove(o){return this.chain.splice(this.chain.indexOf(o),1)[0]}has(o){return this.chain.some(n=>n===o)}hasType(o){return!!this.findType(o)}findType(o){return this.chain.find(n=>n.type===o)}walk(o){for(const n of this.chain){const a=o(n);if(a)return[n,a]}}[Symbol.iterator](){return this.chain.values()}}function mve(i){return!!(i!=null&&i[OP])}class RP extends EventTarget{constructor(){super(...arguments);V(this,"$ts__events")}addEventListener(n,a,l){return super.addEventListener(n,a,l)}removeEventListener(n,a,l){return super.removeEventListener(n,a,l)}}function uo(i,o,n,a){return i.addEventListener(o,n,a),At(()=>i.removeEventListener(o,n,a))}class go{constructor(o){P(this,n2);P(this,a2);j(this,n2,o),j(this,a2,new AbortController),At(this.abort.bind(this))}get signal(){return b(this,a2).signal}add(o,n,a){if(this.signal.aborted)throw Error("aborted");return b(this,n2).addEventListener(o,n,{...a,signal:a!=null&&a.signal?bve(this.signal,a.signal):this.signal}),this}remove(o,n){return b(this,n2).removeEventListener(o,n),this}abort(o){b(this,a2).abort(o)}}n2=new WeakMap,a2=new WeakMap;function bve(...i){const o=new AbortController,n={signal:o.signal};function a(l){o.abort(l.target.reason)}for(const l of i){if(l.aborted){o.abort(l.reason);break}l.addEventListener("abort",a,n)}return o.signal}function BP(i){return!!(i!=null&&i.type.startsWith("pointer"))}function Dg(i){return!!(i!=null&&i.type.startsWith("touch"))}function gve(i){return/^(click|mouse)/.test((i==null?void 0:i.type)??"")}function _g(i){return!!(i!=null&&i.type.startsWith("key"))}function yve(i){return _g(i)&&i.key==="Enter"}function LP(i){return _g(i)&&(i.key==="Enter"||i.key===" ")}function wve(i){return i instanceof Node}function Ge(i,o,n){if(i)if(!n&&n!==""&&n!==0)i.removeAttribute(o);else{const a=n===!0?"":n+"";i.getAttribute(o)!==a&&i.setAttribute(o,a)}else return}function Zn(i,o,n){if(i)!n&&n!==0?i.style.removeProperty(o):i.style.setProperty(o,n+"");else return}function ct(i,o){const n=sv(i,null,o),a=av.bind(n);return a[Zr]=!0,a.set=SP.bind(n),a}function vve(i){return Tg(i)&&Zr in i}function rr(i,o){const n=sv(o==null?void 0:o.initial,i,o),a=av.bind(n);return a[Zr]=!0,a}function Cve(i,o){const n=sv(null,function(){let l=i();return Tg(l)&&At(l),null},void 0);return n.$e=!0,EP(n),Ru.bind(n,!0)}function kve(i){return vve(i)&&"set"in i}const ue=Cve;function dc(i){return{id:Symbol(),provide:i}}function ma(i,o,n=Eg()){var l;const a=!an(o);sve(i.id,a?o:(l=i.provide)==null?void 0:l.call(i),n)}function qo(i){return kP(i.id)}function ba(i){return!an(kP(i.id))}const _h=Symbol(0),Oh=Symbol(0),PP=Symbol(0),pv={};iz=PP;class xve{constructor(o,n,a){P(this,nl);V(this,"$ts__events");V(this,"$ts__vars");V(this,iz,null);V(this,"$el",ct(null));V(this,"el",null);V(this,"scope",null);V(this,"attachScope",null);V(this,"connectScope",null);V(this,"component",null);V(this,"destroyed",!1);V(this,"props",pv);V(this,"attrs",null);V(this,"styles",null);V(this,"state");V(this,"$state");P(this,r2,[]);P(this,l2,[]);P(this,qp,[]);P(this,s2,[]);var d;this.scope=n,a!=null&&a.scope&&a.scope.append(n);let l=o.state,s=o.props;if(l&&(this.$state=l.create(),this.state=new Proxy(this.$state,{get:(p,h)=>this.$state[h]()}),ma(l,this.$state)),s&&(this.props=Sve(s),a!=null&&a.props))for(const p of Object.keys(a.props))(d=this.props[p])==null||d.set(a.props[p]);At(this.destroy.bind(this))}setup(){kn(()=>{for(const o of b(this,r2))o()},this.scope)}attach(o){this.el||(this.el=o,this.$el.set(o),kn(()=>{this.attachScope=cc(),kn(()=>{for(const n of b(this,l2))n(this.el);k(this,nl,xz).call(this),k(this,nl,Sz).call(this)},this.attachScope)},this.scope),o.dispatchEvent(new Event("attached")))}detach(){var o;(o=this.attachScope)==null||o.dispose(),this.attachScope=null,this.connectScope=null,this.el=null,this.$el.set(null)}connect(){!this.el||!this.attachScope||!b(this,qp).length||kn(()=>{this.connectScope=cc(),kn(()=>{for(const o of b(this,qp))o(this.el)},this.connectScope)},this.attachScope)}disconnect(){var o;(o=this.connectScope)==null||o.dispose(),this.connectScope=null}destroy(){if(this.destroyed)return;this.destroyed=!0,kn(()=>{for(const n of b(this,s2))n(this.el)},this.scope);const o=this.el;this.detach(),this.scope.dispose(),b(this,r2).length=0,b(this,l2).length=0,b(this,qp).length=0,b(this,s2).length=0,this.component=null,this.attrs=null,this.styles=null,this.props=pv,this.scope=null,this.state=pv,this.$state=null,o&&delete o.$}addHooks(o){o.onSetup&&b(this,r2).push(o.onSetup.bind(o)),o.onAttach&&b(this,l2).push(o.onAttach.bind(o)),o.onConnect&&b(this,qp).push(o.onConnect.bind(o)),o.onDestroy&&b(this,s2).push(o.onDestroy.bind(o))}}r2=new WeakMap,l2=new WeakMap,qp=new WeakMap,s2=new WeakMap,nl=new WeakSet,xz=function(){if(this.attrs)for(const o of Object.keys(this.attrs))ar(this.attrs[o])?ue(k(this,nl,Iz).bind(this,o)):Ge(this.el,o,this.attrs[o])},Sz=function(){if(this.styles)for(const o of Object.keys(this.styles))ar(this.styles[o])?ue(k(this,nl,Ez).bind(this,o)):Zn(this.el,o,this.styles[o])},Iz=function(o){Ge(this.el,o,this.attrs[o].call(this.component))},Ez=function(o){Zn(this.el,o,this.styles[o].call(this.component))};function Sve(i){const o={};for(const n of Object.keys(i)){const a=i[n];o[n]=ct(a,a)}return o}let Rh={$$:null};function Ive(i,o){return lve(()=>{Rh.$$=new xve(i,Eg(),o);const n=new i;return Rh.$$.component=n,Rh.$$=null,n})}class Pa extends EventTarget{constructor(){super();V(this,"$$");Rh.$$&&this.attach(Rh)}get el(){return this.$$.el}get $el(){return this.$$.$el()}get scope(){return this.$$.scope}get attachScope(){return this.$$.attachScope}get connectScope(){return this.$$.connectScope}get $props(){return this.$$.props}get $state(){return this.$$.$state}get state(){return this.$$.state}attach({$$:n}){return this.$$=n,n.addHooks(this),this}addEventListener(n,a,l){this.listen(n,a,l)}removeEventListener(n,a,l){var s;(s=this.el)==null||s.removeEventListener(n,a,l)}setAttributes(n){this.$$.attrs||(this.$$.attrs={}),Object.assign(this.$$.attrs,n)}setStyles(n){this.$$.styles||(this.$$.styles={}),Object.assign(this.$$.styles,n)}setCSSVars(n){this.setStyles(n)}createEvent(n,...a){return new Ot(n,a[0])}dispatch(n,...a){if(!this.el)return!1;const l=n instanceof Event?n:new Ot(n,a[0]);return Object.defineProperty(l,"target",{get:()=>this.$$.component}),Ou(()=>{var s,d;return(d=(s=this.$$)[PP])==null||d.call(s,l),this.el.dispatchEvent(l)})}dispatchEvent(n){return this.dispatch(n)}listen(n,a,l){return this.el?uo(this.el,n,a,l):Ag}}class dt extends Pa{subscribe(o){return kn(()=>ue(()=>o(this.state)),this.$$.scope)}destroy(){this.$$.destroy()}}function $t(i,o,n){i[_h]||(i[_h]=new Set),i[_h].add(o)}function ei(i,o,n){i[Oh]||(i[Oh]=new Set),i[Oh].add(o)}class pc{constructor(o){V(this,"id",Symbol(0));V(this,"record");P(this,c2);this.record=o,j(this,c2,Object.getOwnPropertyDescriptors(o))}create(){const o={},n=new Proxy(o,{get:(a,l)=>o[l]()});for(const a of Object.keys(this.record)){const l=b(this,c2)[a].get;o[a]=l?rr(l.bind(n)):ct(this.record[a])}return o}reset(o,n){for(const a of Object.keys(o))!b(this,c2)[a].get&&(!n||n(a))&&o[a].set(this.record[a])}}c2=new WeakMap;function Bu(i){return qo(i)}function Eve(i,o){for(const n of i)n(o)}function Og(i){return i.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function Tve(i){return i.replace(/-./g,o=>o[1].toUpperCase())}function Ave(i){return i.charAt(0).toUpperCase()+i.slice(1)}function Rg(i){return i?"true":"false"}function $P(i){return Object.keys(i)}function Lu(){let i,o;return{promise:new Promise((a,l)=>{i=a,o=l}),resolve:i,reject:o}}function Dve(i){return new Promise(o=>setTimeout(o,i))}function Pu(i){let o=-1,n;function a(...l){n=l,!(o>=0)&&(o=window.requestAnimationFrame(()=>{i.apply(this,n),o=-1,n=void 0}))}return a}const _ve=typeof window<"u"?"requestIdleCallback"in window?window.requestIdleCallback:i=>window.setTimeout(i,1):Ag;function Ove(i,o){return new Promise(n=>{_ve(a=>{i==null||i(a),n()},o)})}var ga={fullscreenEnabled:0,fullscreenElement:1,requestFullscreen:2,exitFullscreen:3,fullscreenchange:4,fullscreenerror:5,fullscreen:6},MP=["webkitFullscreenEnabled","webkitFullscreenElement","webkitRequestFullscreen","webkitExitFullscreen","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],NP=["mozFullScreenEnabled","mozFullScreenElement","mozRequestFullScreen","mozCancelFullScreen","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],jP=["msFullscreenEnabled","msFullscreenElement","msRequestFullscreen","msExitFullscreen","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"],Yn=typeof window<"u"&&typeof window.document<"u"?window.document:{},$a="fullscreenEnabled"in Yn&&Object.keys(ga)||MP[0]in Yn&&MP||NP[0]in Yn&&NP||jP[0]in Yn&&jP||[],fp={requestFullscreen:function(i){return i[$a[ga.requestFullscreen]]()},requestFullscreenFunction:function(i){return i[$a[ga.requestFullscreen]]},get exitFullscreen(){return Yn[$a[ga.exitFullscreen]].bind(Yn)},get fullscreenPseudoClass(){return":"+$a[ga.fullscreen]},addEventListener:function(i,o,n){return Yn.addEventListener($a[ga[i]],o,n)},removeEventListener:function(i,o,n){return Yn.removeEventListener($a[ga[i]],o,n)},get fullscreenEnabled(){return!!Yn[$a[ga.fullscreenEnabled]]},set fullscreenEnabled(i){},get fullscreenElement(){return Yn[$a[ga.fullscreenElement]]},set fullscreenElement(i){},get onfullscreenchange(){return Yn[("on"+$a[ga.fullscreenchange]).toLowerCase()]},set onfullscreenchange(i){return Yn[("on"+$a[ga.fullscreenchange]).toLowerCase()]=i},get onfullscreenerror(){return Yn[("on"+$a[ga.fullscreenerror]).toLowerCase()]},set onfullscreenerror(i){return Yn[("on"+$a[ga.fullscreenerror]).toLowerCase()]=i}},mp=Rve;function Rve(i,o,n){var a=null,l=null,s=n&&n.leading,d=n&&n.trailing;s==null&&(s=!0),d==null&&(d=!s),s==!0&&(d=!1);var p=function(){a&&(clearTimeout(a),a=null)},h=function(){var y=l;p(),y&&y()},f=function(){var y=s&&!a,w=this,v=arguments;if(l=function(){return i.apply(w,v)},a||(a=setTimeout(function(){if(a=null,d)return l()},o)),y)return y=!1,l()};return f.cancel=p,f.flush=h,f}var uv=Bve;function Bve(i,o,n){var a=null,l=null,s=function(){a&&(clearTimeout(a),l=null,a=null)},d=function(){var h=l;s(),h&&h()},p=function(){if(!o)return i.apply(this,arguments);var h=this,f=arguments,y=n&&!a;if(s(),l=function(){i.apply(h,f)},a=setTimeout(function(){if(a=null,!y){var w=l;return l=null,w()}},o),y)return l()};return p.cancel=s,p.flush=d,p}const FP=i=>typeof i=="object"&&i!=null&&i.nodeType===1,qP=(i,o)=>(!o||i!=="hidden")&&i!=="visible"&&i!=="clip",Bg=(i,o)=>{if(i.clientHeight<i.scrollHeight||i.clientWidth<i.scrollWidth){const n=getComputedStyle(i,null);return qP(n.overflowY,o)||qP(n.overflowX,o)||(a=>{const l=(s=>{if(!s.ownerDocument||!s.ownerDocument.defaultView)return null;try{return s.ownerDocument.defaultView.frameElement}catch{return null}})(a);return!!l&&(l.clientHeight<a.scrollHeight||l.clientWidth<a.scrollWidth)})(i)}return!1},Lg=(i,o,n,a,l,s,d,p)=>s<i&&d>o||s>i&&d<o?0:s<=i&&p<=n||d>=o&&p>=n?s-i-a:d>o&&p<n||s<i&&p>n?d-o+l:0,Lve=i=>{const o=i.parentElement;return o??(i.getRootNode().host||null)},Pve=(i,o)=>{var n,a,l,s;if(typeof document>"u")return[];const{scrollMode:d,block:p,inline:h,boundary:f,skipOverflowHiddenElements:y}=o,w=typeof f=="function"?f:pe=>pe!==f;if(!FP(i))throw new TypeError("Invalid target");const v=document.scrollingElement||document.documentElement,C=[];let E=i;for(;FP(E)&&w(E);){if(E=Lve(E),E===v){C.push(E);break}E!=null&&E===document.body&&Bg(E)&&!Bg(document.documentElement)||E!=null&&Bg(E,y)&&C.push(E)}const T=(a=(n=window.visualViewport)==null?void 0:n.width)!=null?a:innerWidth,A=(s=(l=window.visualViewport)==null?void 0:l.height)!=null?s:innerHeight,{scrollX:I,scrollY:x}=window,{height:O,width:_,top:R,right:F,bottom:L,left:H}=i.getBoundingClientRect(),{top:K,right:q,bottom:N,left:U}=(pe=>{const $=window.getComputedStyle(pe);return{top:parseFloat($.scrollMarginTop)||0,right:parseFloat($.scrollMarginRight)||0,bottom:parseFloat($.scrollMarginBottom)||0,left:parseFloat($.scrollMarginLeft)||0}})(i);let te=p==="start"||p==="nearest"?R-K:p==="end"?L+N:R+O/2-K+N,se=h==="center"?H+_/2-U+q:h==="end"?F+q:H-U;const fe=[];for(let pe=0;pe<C.length;pe++){const $=C[pe],{height:Z,width:W,top:Q,right:de,bottom:ge,left:he}=$.getBoundingClientRect();if(d==="if-needed"&&R>=0&&H>=0&&L<=A&&F<=T&&($===v&&!Bg($)||R>=Q&&L<=ge&&H>=he&&F<=de))return fe;const M=getComputedStyle($),ee=parseInt(M.borderLeftWidth,10),Ce=parseInt(M.borderTopWidth,10),xe=parseInt(M.borderRightWidth,10),Ae=parseInt(M.borderBottomWidth,10);let Le=0,re=0;const ce="offsetWidth"in $?$.offsetWidth-$.clientWidth-ee-xe:0,be="offsetHeight"in $?$.offsetHeight-$.clientHeight-Ce-Ae:0,Se="offsetWidth"in $?$.offsetWidth===0?0:W/$.offsetWidth:0,Pe="offsetHeight"in $?$.offsetHeight===0?0:Z/$.offsetHeight:0;if(v===$)Le=p==="start"?te:p==="end"?te-A:p==="nearest"?Lg(x,x+A,A,Ce,Ae,x+te,x+te+O,O):te-A/2,re=h==="start"?se:h==="center"?se-T/2:h==="end"?se-T:Lg(I,I+T,T,ee,xe,I+se,I+se+_,_),Le=Math.max(0,Le+x),re=Math.max(0,re+I);else{Le=p==="start"?te-Q-Ce:p==="end"?te-ge+Ae+be:p==="nearest"?Lg(Q,ge,Z,Ce,Ae+be,te,te+O,O):te-(Q+Z/2)+be/2,re=h==="start"?se-he-ee:h==="center"?se-(he+W/2)+ce/2:h==="end"?se-de+xe+ce:Lg(he,de,W,ee,xe+ce,se,se+_,_);const{scrollLeft:qe,scrollTop:De}=$;Le=Pe===0?0:Math.max(0,Math.min(De+Le/Pe,$.scrollHeight-Z/Pe+be)),re=Se===0?0:Math.max(0,Math.min(qe+re/Se,$.scrollWidth-W/Se+ce)),te+=De-Le,se+=qe-re}fe.push({el:$,top:Le,left:re})}return fe},hv=i=>i===null?"":i+"",$ve=i=>i===null?null:i+"",Mve=i=>i===null?0:Number(i),VP=i=>i!==null,Nve=()=>null,jve=i=>i===null?[]:JSON.parse(i),Fve=i=>i===null?{}:JSON.parse(i);function qve(i){if(i===null)return $ve;switch(typeof i){case"undefined":return hv;case"string":return hv;case"boolean":return VP;case"number":return Mve;case"function":return Nve;case"object":return rn(i)?jve:Fve;default:return hv}}const uc=Symbol(0),zP=Symbol(0),bp=Symbol(0),gp=Symbol(0);var ts;(function(i){i[i.Idle=0]="Idle";const n=1;i[i.Pending=n]="Pending";const a=2;i[i.Ready=a]="Ready"})(ts||(ts={}));function pt(i,o){var a,l,s;class n extends i{constructor(...h){super(...h);V(this,"$");V(this,l,ts.Idle);V(this,a,null);V(this,"keepAlive",!1);V(this,"forwardKeepAlive",!0);if(this.$=kn(()=>Ive(o),null),this.$.$$.addHooks(this),o.props){const f=this.$props,y=Object.getOwnPropertyDescriptors(this);for(const w of Object.keys(y))w in o.props&&(f[w].set(this[w]),delete this[w])}}static get observedAttributes(){var h;if(!this[uc]&&o.props){const f=new Map;for(const y of Object.keys(o.props)){let w=(h=this.attrs)==null?void 0:h[y],v=Je(w)?w:w&&(w==null?void 0:w.attr);v!==!1&&(v||(v=Og(y)),f.set(v,{prop:y,converter:w&&!Je(w)&&(w==null?void 0:w.converter)||qve(o.props[y])}))}this[uc]=f}return this[uc]?Array.from(this[uc].keys()):[]}get scope(){return this.$.$$.scope}get attachScope(){return this.$.$$.attachScope}get connectScope(){return this.$.$$.connectScope}get $props(){return this.$.$$.props}get $state(){return this.$.$$.$state}get state(){return this.$.state}attributeChangedCallback(h,f,y){var C;const w=this.constructor;if(!w[uc]){(C=super.attributeChangedCallback)==null||C.call(this,h,f,y);return}const v=w[uc].get(h);v&&(this[v.prop]=v.converter(y))}connectedCallback(){var y;const h=(y=this.$)==null?void 0:y.$$;if(!h||h.destroyed)return;if(this[bp]!==ts.Ready){zve.call(this);return}if(!this.isConnected)return;this.hasAttribute("keep-alive")&&(this.keepAlive=!0),h.connect(),rn(this[gp])&&Eve(this[gp],this),this[gp]=null;const f=super.connectedCallback;f&&kn(()=>f.call(this),this.connectScope)}disconnectedCallback(){var y;const h=(y=this.$)==null?void 0:y.$$;if(!h||h.destroyed)return;h.disconnect();const f=super.disconnectedCallback;f&&f.call(this),!this.keepAlive&&!this.hasAttribute("keep-alive")&&setTimeout(()=>{requestAnimationFrame(()=>{this.isConnected||h.destroy()})},0)}[(s=uc,l=bp,a=gp,zP)](){const h=this.$.$$,f=this.constructor;if(h.destroyed)return;const y=f[uc];if(y)for(const w of this.attributes){let v=y.get(w.name);v&&v.converter&&h.props[v.prop].set(v.converter(this.getAttribute(w.name)))}h.setup(),h.attach(this),this[bp]=ts.Ready,this.connectedCallback()}subscribe(h){return this.$.subscribe(h)}destroy(){this.disconnectedCallback(),this.$.destroy()}}return V(n,"attrs"),V(n,s,null),Vve(n,o),n}function Vve(i,o){const n=i.prototype,a=o.prototype;if(o.props)for(const l of Object.keys(o.props))Object.defineProperty(n,l,{enumerable:!0,configurable:!0,get(){return this.$props[l]()},set(s){this.$props[l].set(s)}});if(a[_h])for(const l of a[_h])Object.defineProperty(n,l,{enumerable:!0,configurable:!0,get(){return this.$[l]},set(s){this.$[l]=s}});if(a[Oh])for(const l of a[Oh])n[l]=function(...s){return this.$[l](...s)}}function zve(){if(this[bp]!==ts.Idle)return;this[bp]=ts.Pending;const i=Hve(this),o=i&&window.customElements.get(i.localName),n=i&&i[bp]===ts.Ready;if(i&&(!o||!n)){Uve.call(this,i);return}UP.call(this,i)}async function Uve(i){await window.customElements.whenDefined(i.localName),i[bp]!==ts.Ready&&await new Promise(o=>(i[gp]??(i[gp]=[])).push(o)),UP.call(this,i)}function UP(i){if(this.isConnected){if(i){i.keepAlive&&i.forwardKeepAlive&&(this.keepAlive=!0,this.setAttribute("keep-alive",""));const o=this.$.$$.scope;o&&i.$.$$.attachScope.append(o)}this[zP]()}}function Hve(i){let o=i.parentNode,n=i.localName.split("-",1)[0]+"-";for(;o;){if(o.nodeType===1&&o.localName.startsWith(n))return o;o=o.parentNode}return null}function lt(i,o=!1){(o||!window.customElements.get(i.tagName))&&window.customElements.define(i.tagName,i)}var Kve='<path fill-rule="evenodd" clip-rule="evenodd" d="M6 7C5.63181 7 5.33333 7.29848 5.33333 7.66667V14.8667C5.33333 14.9403 5.39361 14.9999 5.46724 15.0009C10.8844 15.0719 15.2614 19.449 15.3325 24.8661C15.3334 24.9397 15.393 25 15.4667 25H26C26.3682 25 26.6667 24.7015 26.6667 24.3333V7.66667C26.6667 7.29848 26.3682 7 26 7H6ZM17.0119 22.2294C17.0263 22.29 17.0802 22.3333 17.1425 22.3333H23.3333C23.7015 22.3333 24 22.0349 24 21.6667V10.3333C24 9.96514 23.7015 9.66667 23.3333 9.66667H8.66667C8.29848 9.66667 8 9.96514 8 10.3333V13.1909C8 13.2531 8.04332 13.3071 8.10392 13.3214C12.5063 14.3618 15.9715 17.827 17.0119 22.2294Z" fill="currentColor"/> <path d="M13.2 25C13.2736 25 13.3334 24.9398 13.3322 24.8661C13.2615 20.5544 9.77889 17.0718 5.46718 17.0011C5.39356 16.9999 5.33333 17.0597 5.33333 17.1333V18.8667C5.33333 18.9403 5.39348 18.9999 5.4671 19.0015C8.67465 19.0716 11.2617 21.6587 11.3319 24.8662C11.3335 24.9399 11.393 25 11.4667 25H13.2Z" fill="currentColor"/> <path d="M5.33333 21.1333C5.33333 21.0597 5.39332 20.9998 5.46692 21.0022C7.57033 21.0712 9.26217 22.763 9.33114 24.8664C9.33356 24.94 9.27364 25 9.2 25H6C5.63181 25 5.33333 24.7015 5.33333 24.3333V21.1333Z" fill="currentColor"/>';const HP=dc();function Rt(){return qo(HP)}const Gve=(navigator==null?void 0:navigator.userAgent.toLowerCase())||"",Pg=/iphone|ipad|ipod|ios|crios|fxios/i.test(Gve),KP=/(iphone|ipod)/gi.test((navigator==null?void 0:navigator.platform)||""),$g=!!window.chrome,Mg=!!window.safari||Pg;function GP(){return Wve()&&ar(screen.orientation.unlock)}function Wve(){return!an(window.screen.orientation)&&!an(window.screen.orientation.lock)}function WP(i,o){return i||(i=document.createElement("audio")),i.canPlayType(o).length>0}function ZP(i,o){return i||(i=document.createElement("video")),i.canPlayType(o).length>0}function YP(i){return i||(i=document.createElement("video")),i.canPlayType("application/vnd.apple.mpegurl").length>0}function XP(i){return!!document.pictureInPictureEnabled&&!(i!=null&&i.disablePictureInPicture)}function QP(i){return ar(i==null?void 0:i.webkitSupportsPresentationMode)&&ar(i==null?void 0:i.webkitSetPresentationMode)}async function Zve(){const i=document.createElement("video");return i.volume=.5,await Dve(0),i.volume===.5}function Yve(){return(window==null?void 0:window.ManagedMediaSource)??(window==null?void 0:window.MediaSource)??(window==null?void 0:window.WebKitMediaSource)}function Xve(){return(window==null?void 0:window.SourceBuffer)??(window==null?void 0:window.WebKitSourceBuffer)}function Ng(){const i=Yve();if(an(i))return!1;const o=i&&ar(i.isTypeSupported)&&i.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),n=Xve(),a=an(n)||!an(n.prototype)&&ar(n.prototype.appendBuffer)&&ar(n.prototype.remove);return!!o&&!!a}function JP(){return Ng()}const Qve=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx|flac)($|\?)/i,Jve=new Set(["audio/mpeg","audio/ogg","audio/3gp","audio/mp3","audio/webm","audio/flac","audio/m4a","audio/m4b","audio/mp4a","audio/mp4"]),eCe=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,tCe=new Set(["video/mp4","video/webm","video/3gp","video/ogg","video/avi","video/mpeg"]),oCe=/\.(m3u8)($|\?)/i,iCe=/\.(mpd)($|\?)/i,nCe=new Set(["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"]),aCe=new Set(["application/dash+xml"]);function e$({src:i,type:o}){return Je(i)?Qve.test(i)||Jve.has(o)||i.startsWith("blob:")&&o==="audio/object":o==="audio/object"}function t$(i){return Je(i.src)?eCe.test(i.src)||tCe.has(i.type)||i.src.startsWith("blob:")&&i.type==="video/object"||$u(i)&&YP():i.type==="video/object"}function $u({src:i,type:o}){return Je(i)&&oCe.test(i)||nCe.has(o)}function fv({src:i,type:o}){return Je(i)&&iCe.test(i)||aCe.has(o)}function o$(i){return Je(i.src)&&(e$(i)||t$(i)||$u(i))}function rCe(i){return typeof window.MediaStream<"u"&&i instanceof window.MediaStream}class Ti{constructor(o,n){P(this,ds);rn(o)?j(this,ds,o):!an(o)&&!an(n)?j(this,ds,[[o,n]]):j(this,ds,[])}get length(){return b(this,ds).length}start(o){return b(this,ds)[o][0]??1/0}end(o){return b(this,ds)[o][1]??1/0}}ds=new WeakMap;function i$(i){if(!i.length)return null;let o=i.start(0);for(let n=1;n<i.length;n++){const a=i.start(n);a<o&&(o=a)}return o}function yp(i){if(!i.length)return null;let o=i.end(0);for(let n=1;n<i.length;n++){const a=i.end(n);a>o&&(o=a)}return o}function lCe(i){if(i.length<=1)return i;i.sort((a,l)=>a[0]-l[0]);let o=[],n=i[0];for(let a=1;a<i.length;a++){const l=i[a];n[1]>=l[0]-1?n=[n[0],Math.max(n[1],l[1])]:(o.push(n),n=l)}return o.push(n),o}function sCe(i,o,n){let a=o[0],l=o[1];return n<a?[n,-1]:n===a?o:a===-1?(o[0]=n,o):(n>a&&(o[1]=n,l===-1&&i.push(o)),lCe(i),o)}function cCe(i,o){const n=new URL(i);for(const a of Object.keys(o))n.searchParams.set(a,o[a]+"");return n.toString()}function os(i,o="preconnect"){const n=document.querySelector(`link[href="${i}"]`);if(!Yr(n))return!0;const a=document.createElement("link");return a.rel=o,a.href=i,a.crossOrigin="true",document.head.append(a),!0}const Bh={};function mv(i){if(Bh[i])return Bh[i].promise;const o=Lu(),n=document.querySelector(`script[src="${i}"]`);if(!Yr(n))return o.resolve(),o.promise;Bh[i]=o;const a=document.createElement("script");return a.src=i,a.onload=()=>{o.resolve(),delete Bh[i]},a.onerror=()=>{o.reject(),delete Bh[i]},setTimeout(()=>document.head.append(a),0),o.promise}function Lh(i){return i==="use-credentials"?"include":Je(i)?"same-origin":void 0}function bv(i,o){return o>=i.startTime&&o<i.endTime}function jg(i,o,n){let a=null,l=Eg();function s(){const d=Je(o)?[o]:o,p=i.toArray().find(h=>d.includes(h.kind)&&h.mode==="showing");if(p!==a){if(!p){n(null),a=null;return}p.readyState==2?n(p):(n(null),kn(()=>{const h=uo(p,"load",()=>{n(p),h()},{once:!0})},l)),a=p}}return s(),uo(i,"mode-change",s)}function dCe(i,o,n){jg(i,o,a=>{if(!a){n("");return}const l=()=>{const s=a==null?void 0:a.activeCues[0];n((s==null?void 0:s.text)||"")};l(),uo(a,"cue-change",l)})}const pCe=Symbol(0),uCe=Symbol(0),hCe=Symbol(0),fCe=Symbol(0),mCe=Symbol(0),bCe=Symbol(0),gCe=Symbol(0),kt={crossOrigin:pCe,readyState:uCe,updateActiveCues:hCe,canLoad:fCe,onModeChange:mCe,native:bCe,nativeHLS:gCe};let hc=(sz=class extends RP{constructor(n){super();P(this,Ci);V(this,"src");V(this,"content");V(this,"type");V(this,"encoding");V(this,"id","");V(this,"label","");V(this,"language","");V(this,"kind");V(this,"default",!1);P(this,pm,!1);P(this,ps,0);P(this,Vp,"disabled");P(this,um,{});P(this,zp,[]);P(this,dn,[]);P(this,us,[]);V(this,lz,0);V(this,rz);V(this,az,null);V(this,nz,null);for(const a of Object.keys(n))this[a]=n[a];this.type||(this.type="vtt"),n.content?k(this,Ci,Tz).call(this,n):n.src||(this[kt.readyState]=2)}static createId(n){return`vds-${n.type}-${n.kind}-${n.src??n.label??"?"}`}get metadata(){return b(this,um)}get regions(){return b(this,zp)}get cues(){return b(this,dn)}get activeCues(){return b(this,us)}get readyState(){return this[kt.readyState]}get mode(){return b(this,Vp)}set mode(n){this.setMode(n)}addCue(n,a){var d;let l=0,s=b(this,dn).length;for(l=0;l<s&&!(n.endTime<=b(this,dn)[l].startTime);l++);l===s?b(this,dn).push(n):b(this,dn).splice(l,0,n),n instanceof TextTrackCue||(d=this[kt.native])==null||d.track.addCue(n),this.dispatchEvent(new Ot("add-cue",{detail:n,trigger:a})),bv(n,b(this,ps))&&this[kt.updateActiveCues](b(this,ps),a)}removeCue(n,a){var s;const l=b(this,dn).indexOf(n);if(l>=0){const d=b(this,us).includes(n);b(this,dn).splice(l,1),(s=this[kt.native])==null||s.track.removeCue(n),this.dispatchEvent(new Ot("remove-cue",{detail:n,trigger:a})),d&&this[kt.updateActiveCues](b(this,ps),a)}}setMode(n,a){var l;b(this,Vp)!==n&&(j(this,Vp,n),n==="disabled"?(j(this,us,[]),k(this,Ci,dx).call(this)):this.readyState===2?this[kt.updateActiveCues](b(this,ps),a):k(this,Ci,lx).call(this),this.dispatchEvent(new Ot("mode-change",{detail:this,trigger:a})),(l=this[kt.onModeChange])==null||l.call(this))}[(lz=kt.readyState,rz=kt.crossOrigin,az=kt.onModeChange,nz=kt.native,kt.updateActiveCues)](n,a){if(j(this,ps,n),this.mode==="disabled"||!b(this,dn).length)return;const l=[];for(let d=0,p=b(this,dn).length;d<p;d++){const h=b(this,dn)[d];bv(h,n)&&l.push(h)}let s=l.length!==b(this,us).length;if(!s){for(let d=0;d<l.length;d++)if(!b(this,us).includes(l[d])){s=!0;break}}j(this,us,l),s&&k(this,Ci,dx).call(this,a)}[kt.canLoad](){j(this,pm,!0),b(this,Vp)!=="disabled"&&k(this,Ci,lx).call(this)}},pm=new WeakMap,ps=new WeakMap,Vp=new WeakMap,um=new WeakMap,zp=new WeakMap,dn=new WeakMap,us=new WeakMap,Ci=new WeakSet,Tz=function(n){Promise.resolve().then(()=>F4).then(({parseText:a,VTTCue:l,VTTRegion:s})=>{!Je(n.content)||n.type==="json"?(k(this,Ci,cx).call(this,n.content,l,s),this.readyState!==3&&k(this,Ci,E3).call(this)):a(n.content,{type:n.type}).then(({cues:d,regions:p})=>{j(this,dn,d),j(this,zp,p),k(this,Ci,E3).call(this)})})},lx=async function(){var n,a;if(!(!b(this,pm)||this[kt.readyState]>0)){if(this[kt.readyState]=1,this.dispatchEvent(new Ot("load-start")),!this.src){k(this,Ci,E3).call(this);return}try{const{parseResponse:l,VTTCue:s,VTTRegion:d}=await Promise.resolve().then(()=>F4),p=(n=this[kt.crossOrigin])==null?void 0:n.call(this),h=fetch(this.src,{headers:this.type==="json"?{"Content-Type":"application/json"}:void 0,credentials:Lh(p)});if(this.type==="json")k(this,Ci,cx).call(this,await(await h).text(),s,d);else{const{errors:f,metadata:y,regions:w,cues:v}=await l(h,{type:this.type,encoding:this.encoding});if(((a=f[0])==null?void 0:a.code)===0)throw f[0];j(this,um,y),j(this,zp,w),j(this,dn,v)}k(this,Ci,E3).call(this)}catch(l){k(this,Ci,sx).call(this,l)}}},E3=function(){if(this[kt.readyState]=2,!this.src||this.type!=="vtt"){const a=this[kt.native];if(a&&!a.managed)for(const l of b(this,dn))a.track.addCue(l)}const n=new Ot("load");this[kt.updateActiveCues](b(this,ps),n),this.dispatchEvent(n)},sx=function(n){this[kt.readyState]=3,this.dispatchEvent(new Ot("error",{detail:n}))},cx=function(n,a,l){try{const{regions:s,cues:d}=wCe(n,a,l);j(this,zp,s),j(this,dn,d)}catch(s){k(this,Ci,sx).call(this,s)}},dx=function(n){this.dispatchEvent(new Ot("cue-change",{trigger:n}))},sz);const yCe=/captions|subtitles/;function xn(i){return yCe.test(i.kind)}function wCe(i,o,n){const a=Je(i)?JSON.parse(i):i;let l=[],s=[];return a.regions&&n&&(l=a.regions.map(d=>Object.assign(new n,d))),(a.cues||rn(a))&&(s=(rn(a)?a:a.cues).filter(d=>Li(d.startTime)&&Li(d.endTime)).map(d=>Object.assign(new o(0,0,""),d))),{regions:l,cues:s}}const vCe=Symbol(0),CCe=Symbol(0),kCe=Symbol(0),xCe=Symbol(0),SCe=Symbol(0),ICe=Symbol(0),ECe=Symbol(0),TCe=Symbol(0),ACe=Symbol(0),ft={add:vCe,remove:CCe,reset:kCe,select:xCe,readonly:SCe,setReadonly:ICe,onReset:ECe,onRemove:TCe,onUserSelect:ACe},DCe=Symbol(0),_Ce=Symbol(0),ln={setAuto:DCe,enableAuto:_Ce};function Ph(i){return i instanceof Error?i:Error(typeof i=="string"?i:JSON.stringify(i))}function is(i,o){if(!i)throw Error("Assertion failed.")}function n$(i,o){const n=o.composedPath()[0];return wve(n)&&i.contains(n)}const gv=new Set;{let i=function(){for(const o of gv)try{o()}catch{}window.requestAnimationFrame(i)};i()}function OCe(i){return gv.add(i),()=>gv.delete(i)}function bo(i,o,n){i.hasAttribute(o)||i.setAttribute(o,n)}function fc(i,o){if(i.hasAttribute("aria-label")||i.hasAttribute("data-no-label"))return;if(!ar(o)){Ge(i,"aria-label",o);return}function n(){Ge(i,"aria-label",o())}ue(n)}function a$(i){const o=getComputedStyle(i);return o.display!=="none"&&parseInt(o.opacity)>0}function RCe(i){return!!i&&("checkVisibility"in i?i.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0}):a$(i))}function r$(i,o){return OCe(()=>o(RCe(i)))}function l$(i,o,n){for(;o;){if(o===i)return!0;if(n!=null&&n(o))break;o=o.parentElement}return!1}function mc(i,o){return new go(i).add("pointerup",n=>{n.button===0&&!n.defaultPrevented&&o(n)}).add("keydown",n=>{LP(n)&&o(n)})}function yv(i){return Dg(i)&&(i.touches.length>1||i.changedTouches.length>1)}function ns(i){let o=Eg(),n=window.requestAnimationFrame(()=>{kn(i,o),n=-1});return()=>void window.cancelAnimationFrame(n)}function wv(i,o,n){let a,l=i,s=i.parentElement,d=i.content.firstElementChild,p=[];!d&&i.firstElementChild&&(i.innerHTML=i.firstElementChild.outerHTML,i.firstElementChild.remove(),d=i.content.firstElementChild);for(let h=0;h<o;h++)a=document.importNode(d,!0),n==null||n(a,h),s.insertBefore(a,l.nextSibling),p.push(a),l=a;return At(()=>{for(let h=0;h<p.length;h++)p[h].remove()}),p}function vv(i){const o=document.createElement("template");return o.innerHTML=i,o.content}function Cv(i){return i.cloneNode(!0).firstElementChild}function s$(i,o,n,{offsetVarName:a,xOffset:l,yOffset:s,...d}){if(!i)return;const p=n.replace(" ","-").replace("-center","");if(Zn(i,"visibility",o?null:"hidden"),!o)return;let h=n.includes("top");const f=w=>n.includes("left")?`calc(-1 * ${w})`:w,y=w=>h?`calc(-1 * ${w})`:w;return dP(o,i,()=>{hP(o,i,{placement:p,middleware:[...d.middleware??[],uP({fallbackAxisSideDirection:"start",crossAxis:!1}),pP()],...d}).then(({x:w,y:v,middlewareData:C})=>{var T;const E=!!((T=C.flip)!=null&&T.index);h=n.includes(E?"bottom":"top"),i.setAttribute("data-placement",E?n.startsWith("top")?n.replace("top","bottom"):n.replace("bottom","top"):n),Object.assign(i.style,{top:`calc(${v+"px"} + ${y(s?s+"px":`var(--${a}-y-offset, 0px)`)})`,left:`calc(${w+"px"} + ${f(l?l+"px":`var(--${a}-x-offset, 0px)`)})`})})})}function BCe(i){return getComputedStyle(i).animationName!=="none"}function wp(i){return i instanceof HTMLElement}function LCe(i){return i?"true":"false"}function sn(i){return()=>LCe(i())}function PCe(){return typeof window>"u"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function Pi(i,o=2){return Number(i.toFixed(o))}function kv(i){var o;return((o=String(i).split(".")[1])==null?void 0:o.length)??0}function xv(i,o,n){return Math.max(i,Math.min(n,o))}let Fg=ct(!1);uo(document,"pointerdown",()=>{Fg.set(!1)}),uo(document,"keydown",i=>{i.metaKey||i.altKey||i.ctrlKey||Fg.set(!0)});class lr extends Pa{constructor(){super(...arguments);P(this,al);P(this,Dc,ct(!1))}onConnect(n){ue(()=>{const a=new go(n);if(!Fg()){b(this,Dc).set(!1),qg(n,!1),a.add("pointerenter",k(this,al,_z).bind(this)).add("pointerleave",k(this,al,Oz).bind(this));return}const l=document.activeElement===n;b(this,Dc).set(l),qg(n,l),a.add("focus",k(this,al,Az).bind(this)).add("blur",k(this,al,Dz).bind(this))})}focused(){return b(this,Dc).call(this)}}Dc=new WeakMap,al=new WeakSet,Az=function(){b(this,Dc).set(!0),qg(this.el,!0)},Dz=function(){b(this,Dc).set(!1),qg(this.el,!1)},_z=function(){c$(this.el,!0)},Oz=function(){c$(this.el,!1)};function qg(i,o){Ge(i,"data-focus",o),Ge(i,"data-hocus",o)}function c$(i,o){Ge(i,"data-hocus",o),Ge(i,"data-hover",o)}class d$ extends RP{constructor(){super(...arguments);V(this,"items",[]);V(this,cz,!1)}get length(){return this.items.length}get readonly(){return this[ft.readonly]}indexOf(n){return this.items.indexOf(n)}getById(n){return n===""?null:this.items.find(a=>a.id===n)??null}toArray(){return[...this.items]}[(cz=ft.readonly,Symbol.iterator)](){return this.items.values()}[ft.add](n,a){const l=this.items.length;""+l in this||Object.defineProperty(this,l,{get(){return this.items[l]}}),!this.items.includes(n)&&(this.items.push(n),this.dispatchEvent(new Ot("add",{detail:n,trigger:a})))}[ft.remove](n,a){var s;const l=this.items.indexOf(n);l>=0&&((s=this[ft.onRemove])==null||s.call(this,n,a),this.items.splice(l,1),this.dispatchEvent(new Ot("remove",{detail:n,trigger:a})))}[ft.reset](n){var a;for(const l of[...this.items])this[ft.remove](l,n);this.items=[],this[ft.setReadonly](!1,n),(a=this[ft.onReset])==null||a.call(this)}[ft.setReadonly](n,a){this[ft.readonly]!==n&&(this[ft.readonly]=n,this.dispatchEvent(new Ot("readonly-change",{detail:n,trigger:a})))}}const Sv=fp.fullscreenEnabled;class $Ce extends Pa{constructor(){super(...arguments);P(this,Oc);P(this,_c,!1);P(this,d2,!1)}get active(){return b(this,d2)}get supported(){return Sv}onConnect(){new go(fp).add("fullscreenchange",k(this,Oc,Bz).bind(this)).add("fullscreenerror",k(this,Oc,Lz).bind(this)),At(k(this,Oc,Rz).bind(this))}async enter(){try{return j(this,_c,!0),!this.el||Iv(this.el)?void 0:(p$(),fp.requestFullscreen(this.el))}catch(n){throw j(this,_c,!1),n}}async exit(){if(!(!this.el||!Iv(this.el)))return p$(),fp.exitFullscreen()}}_c=new WeakMap,d2=new WeakMap,Oc=new WeakSet,Rz=async function(){Sv&&await this.exit()},Bz=function(n){const a=Iv(this.el);a!==b(this,d2)&&(a||j(this,_c,!1),j(this,d2,a),this.dispatch("fullscreen-change",{detail:a,trigger:n}))},Lz=function(n){b(this,_c)&&(this.dispatch("fullscreen-error",{detail:null,trigger:n}),j(this,_c,!1))};function Iv(i){if(fp.fullscreenElement===i)return!0;try{return i.matches(fp.fullscreenPseudoClass)}catch{return!1}}function p$(){if(!Sv)throw Error("[vidstack] no fullscreen API")}const W4=class W4 extends Pa{constructor(){super(...arguments);P(this,ka);P(this,Rc,ct(k(this,ka,hx).call(this)));P(this,hs,ct(!1));P(this,Up)}get type(){return b(this,Rc).call(this)}get locked(){return b(this,hs).call(this)}get portrait(){return b(this,Rc).call(this).startsWith("portrait")}get landscape(){return b(this,Rc).call(this).startsWith("landscape")}get supported(){return W4.supported}onConnect(){if(this.supported)uo(screen.orientation,"change",k(this,ka,px).bind(this));else{const n=window.matchMedia("(orientation: landscape)");n.onchange=k(this,ka,px).bind(this),At(()=>n.onchange=null)}At(k(this,ka,Pz).bind(this))}async lock(n){Re(b(this,hs))||b(this,Up)===n||(k(this,ka,ux).call(this),await screen.orientation.lock(n),b(this,hs).set(!0),j(this,Up,n))}async unlock(){Re(b(this,hs))&&(k(this,ka,ux).call(this),j(this,Up,void 0),await screen.orientation.unlock(),b(this,hs).set(!1))}};Rc=new WeakMap,hs=new WeakMap,Up=new WeakMap,ka=new WeakSet,Pz=async function(){this.supported&&b(this,hs).call(this)&&await this.unlock()},px=function(n){b(this,Rc).set(k(this,ka,hx).call(this)),this.dispatch("orientation-change",{detail:{orientation:Re(b(this,Rc)),lock:b(this,Up)},trigger:n})},ux=function(){if(!this.supported)throw Error("[vidstack] no orientation API")},hx=function(){return this.supported?window.screen.orientation.type:window.innerWidth>=window.innerHeight?"landscape-primary":"portrait-primary"},V(W4,"supported",GP());let Vg=W4;function Ev(i){return!Je(i)&&"width"in i&&"height"in i&&Li(i.width)&&Li(i.height)}const u$=new pc({artist:"",artwork:null,audioTrack:null,audioTracks:[],autoPlay:!1,autoPlayError:null,audioGain:null,buffered:new Ti,canLoad:!1,canLoadPoster:!1,canFullscreen:!1,canOrientScreen:GP(),canPictureInPicture:!1,canPlay:!1,clipStartTime:0,clipEndTime:0,controls:!1,get iOSControls(){return KP&&this.mediaType==="video"&&(!this.playsInline||!fp.fullscreenEnabled&&this.fullscreen)},get nativeControls(){return this.controls||this.iOSControls},controlsVisible:!1,get controlsHidden(){return!this.controlsVisible},crossOrigin:null,ended:!1,error:null,fullscreen:!1,get loop(){return this.providedLoop||this.userPrefersLoop},logLevel:"silent",mediaType:"unknown",muted:!1,paused:!0,played:new Ti,playing:!1,playsInline:!1,pictureInPicture:!1,preload:"metadata",playbackRate:1,qualities:[],quality:null,autoQuality:!1,canSetQuality:!0,canSetPlaybackRate:!0,canSetVolume:!1,canSetAudioGain:!1,seekable:new Ti,seeking:!1,source:{src:"",type:""},sources:[],started:!1,textTracks:[],textTrack:null,get hasCaptions(){return this.textTracks.filter(xn).length>0},volume:1,waiting:!1,realCurrentTime:0,get currentTime(){return this.ended?this.duration:this.clipStartTime>0?Math.max(0,Math.min(this.realCurrentTime-this.clipStartTime,this.duration)):this.realCurrentTime},providedDuration:-1,intrinsicDuration:0,get duration(){return this.seekableWindow},get title(){return this.providedTitle||this.inferredTitle},get poster(){return this.providedPoster||this.inferredPoster},get viewType(){return this.providedViewType!=="unknown"?this.providedViewType:this.inferredViewType},get streamType(){return this.providedStreamType!=="unknown"?this.providedStreamType:this.inferredStreamType},get currentSrc(){return this.source},get bufferedStart(){const i=i$(this.buffered)??0;return Math.max(i,this.clipStartTime)},get bufferedEnd(){const i=yp(this.buffered)??0;return Math.min(this.seekableEnd,Math.max(0,i-this.clipStartTime))},get bufferedWindow(){return Math.max(0,this.bufferedEnd-this.bufferedStart)},get seekableStart(){if(this.isLiveDVR&&this.liveDVRWindow>0)return Math.max(0,this.seekableEnd-this.liveDVRWindow);const i=i$(this.seekable)??0;return Math.max(i,this.clipStartTime)},get seekableEnd(){if(this.providedDuration>0)return this.providedDuration;const i=this.liveSyncPosition>0?this.liveSyncPosition:this.canPlay?yp(this.seekable)??1/0:0;return this.clipEndTime>0?Math.min(this.clipEndTime,i):i},get seekableWindow(){const i=this.seekableEnd-this.seekableStart;return isNaN(i)?1/0:Math.max(0,i)},canAirPlay:!1,canGoogleCast:!1,remotePlaybackState:"disconnected",remotePlaybackType:"none",remotePlaybackLoader:null,remotePlaybackInfo:null,get isAirPlayConnected(){return this.remotePlaybackType==="airplay"&&this.remotePlaybackState==="connected"},get isGoogleCastConnected(){return this.remotePlaybackType==="google-cast"&&this.remotePlaybackState==="connected"},pointer:"fine",orientation:"landscape",width:0,height:0,mediaWidth:0,mediaHeight:0,lastKeyboardAction:null,userBehindLiveEdge:!1,liveEdgeTolerance:10,minLiveDVRWindow:60,get canSeek(){return/unknown|on-demand|:dvr/.test(this.streamType)&&Number.isFinite(this.duration)&&(!this.isLiveDVR||this.duration>=this.liveDVRWindow)},get live(){return this.streamType.includes("live")||!Number.isFinite(this.duration)},get liveEdgeStart(){return this.live&&Number.isFinite(this.seekableEnd)?Math.max(0,this.seekableEnd-this.liveEdgeTolerance):0},get liveEdge(){return this.live&&(!this.canSeek||!this.userBehindLiveEdge&&this.currentTime>=this.liveEdgeStart)},get liveEdgeWindow(){return this.live&&Number.isFinite(this.seekableEnd)?this.seekableEnd-this.liveEdgeStart:0},get isLiveDVR(){return/:dvr/.test(this.streamType)},get liveDVRWindow(){return Math.max(this.inferredLiveDVRWindow,this.minLiveDVRWindow)},autoPlaying:!1,providedTitle:"",inferredTitle:"",providedLoop:!1,userPrefersLoop:!1,providedPoster:"",inferredPoster:"",inferredViewType:"unknown",providedViewType:"unknown",providedStreamType:"unknown",inferredStreamType:"unknown",liveSyncPosition:null,inferredLiveDVRWindow:0,savedState:null}),h$=new Set(["autoPlayError","autoPlaying","buffered","canPlay","error","paused","played","playing","seekable","seeking","waiting"]),MCe=new Set([...h$,"ended","inferredPoster","inferredStreamType","inferredTitle","intrinsicDuration","inferredLiveDVRWindow","liveSyncPosition","realCurrentTime","savedState","started","userBehindLiveEdge"]);function f$(i,o=!1){const n=o?h$:MCe;u$.reset(i,a=>n.has(a)),es()}function m$(i,o){const n=i+o.clipStartTime(),a=Math.floor(i)===Math.floor(o.seekableStart()),l=Math.floor(n)===Math.floor(o.seekableEnd());return a?o.seekableStart():l?o.seekableEnd():o.isLiveDVR()&&o.liveDVRWindow()>0&&n<o.seekableEnd()-o.liveDVRWindow()?o.bufferedStart():Math.min(Math.max(o.seekableStart()+.1,n),o.seekableEnd()-.1)}class NCe{constructor(o=void 0){P(this,ao);P(this,Hp,null);P(this,xa,null);P(this,p2,-1);P(this,Z4);j(this,Z4,o)}setTarget(o){j(this,Hp,o)}getPlayer(o){var n;return b(this,xa)?b(this,xa):((n=o??b(this,Hp))==null||n.dispatchEvent(new Ot("find-media-player",{detail:a=>void j(this,xa,a),bubbles:!0,composed:!0})),b(this,xa))}setPlayer(o){j(this,xa,o)}startLoading(o){k(this,ao,Co).call(this,"media-start-loading",o)}startLoadingPoster(o){k(this,ao,Co).call(this,"media-poster-start-loading",o)}requestAirPlay(o){k(this,ao,Co).call(this,"media-airplay-request",o)}requestGoogleCast(o){k(this,ao,Co).call(this,"media-google-cast-request",o)}play(o){k(this,ao,Co).call(this,"media-play-request",o)}pause(o){k(this,ao,Co).call(this,"media-pause-request",o)}mute(o){k(this,ao,Co).call(this,"media-mute-request",o)}unmute(o){k(this,ao,Co).call(this,"media-unmute-request",o)}enterFullscreen(o,n){k(this,ao,Co).call(this,"media-enter-fullscreen-request",n,o)}exitFullscreen(o,n){k(this,ao,Co).call(this,"media-exit-fullscreen-request",n,o)}lockScreenOrientation(o,n){k(this,ao,Co).call(this,"media-orientation-lock-request",n,o)}unlockScreenOrientation(o){k(this,ao,Co).call(this,"media-orientation-unlock-request",o)}enterPictureInPicture(o){k(this,ao,Co).call(this,"media-enter-pip-request",o)}exitPictureInPicture(o){k(this,ao,Co).call(this,"media-exit-pip-request",o)}seeking(o,n){k(this,ao,Co).call(this,"media-seeking-request",n,o)}seek(o,n){k(this,ao,Co).call(this,"media-seek-request",n,o)}seekToLiveEdge(o){k(this,ao,Co).call(this,"media-live-edge-request",o)}changeDuration(o,n){k(this,ao,Co).call(this,"media-duration-change-request",n,o)}changeClipStart(o,n){k(this,ao,Co).call(this,"media-clip-start-change-request",n,o)}changeClipEnd(o,n){k(this,ao,Co).call(this,"media-clip-end-change-request",n,o)}changeVolume(o,n){k(this,ao,Co).call(this,"media-volume-change-request",n,Math.max(0,Math.min(1,o)))}changeAudioTrack(o,n){k(this,ao,Co).call(this,"media-audio-track-change-request",n,o)}changeQuality(o,n){k(this,ao,Co).call(this,"media-quality-change-request",n,o)}requestAutoQuality(o){this.changeQuality(-1,o)}changeTextTrackMode(o,n,a){k(this,ao,Co).call(this,"media-text-track-change-request",a,{index:o,mode:n})}changePlaybackRate(o,n){k(this,ao,Co).call(this,"media-rate-change-request",n,o)}changeAudioGain(o,n){k(this,ao,Co).call(this,"media-audio-gain-change-request",n,o)}resumeControls(o){k(this,ao,Co).call(this,"media-resume-controls-request",o)}pauseControls(o){k(this,ao,Co).call(this,"media-pause-controls-request",o)}togglePaused(o){const n=this.getPlayer(o==null?void 0:o.target);n&&(n.state.paused?this.play(o):this.pause(o))}toggleControls(o){const n=this.getPlayer(o==null?void 0:o.target);n&&(n.controls.showing?n.controls.hide(0,o):n.controls.show(0,o))}toggleMuted(o){const n=this.getPlayer(o==null?void 0:o.target);n&&(n.state.muted?this.unmute(o):this.mute(o))}toggleFullscreen(o,n){const a=this.getPlayer(n==null?void 0:n.target);a&&(a.state.fullscreen?this.exitFullscreen(o,n):this.enterFullscreen(o,n))}togglePictureInPicture(o){const n=this.getPlayer(o==null?void 0:o.target);n&&(n.state.pictureInPicture?this.exitPictureInPicture(o):this.enterPictureInPicture(o))}showCaptions(o){const n=this.getPlayer(o==null?void 0:o.target);if(!n)return;let a=n.state.textTracks,l=b(this,p2);(!a[l]||!xn(a[l]))&&(l=-1),l===-1&&(l=a.findIndex(s=>xn(s)&&s.default)),l===-1&&(l=a.findIndex(s=>xn(s))),l>=0&&this.changeTextTrackMode(l,"showing",o),j(this,p2,-1)}disableCaptions(o){const n=this.getPlayer(o==null?void 0:o.target);if(!n)return;const a=n.state.textTracks,l=n.state.textTrack;if(l){const s=a.indexOf(l);this.changeTextTrackMode(s,"disabled",o),j(this,p2,s)}}toggleCaptions(o){const n=this.getPlayer(o==null?void 0:o.target);n&&(n.state.textTrack?this.disableCaptions():this.showCaptions())}userPrefersLoopChange(o,n){k(this,ao,Co).call(this,"media-user-loop-change-request",n,o)}}Hp=new WeakMap,xa=new WeakMap,p2=new WeakMap,Z4=new WeakMap,ao=new WeakSet,Co=function(o,n,a){var p,h;const l=new Ot(o,{bubbles:!0,composed:!0,cancelable:!0,detail:a,trigger:n});let s=(n==null?void 0:n.target)||null;s&&s instanceof dt&&(s=s.el),s=!s||s===document||s===window||s===document.body||((p=b(this,xa))==null?void 0:p.el)&&s instanceof Node&&!b(this,xa).el.contains(s)?b(this,Hp)??((h=this.getPlayer())==null?void 0:h.el):s??b(this,Hp),b(this,xa)?o==="media-play-request"&&!b(this,xa).state.canLoad?s==null||s.dispatchEvent(l):b(this,xa).canPlayQueue.enqueue(o,()=>s==null?void 0:s.dispatchEvent(l)):s==null||s.dispatchEvent(l)},qKe=function(o){};class jCe{constructor(){V(this,"playerId","vds-player");V(this,"mediaId",null);P(this,di,{volume:null,muted:null,audioGain:null,time:null,lang:null,captions:null,rate:null,quality:null});V(this,"saveTimeThrottled",mp(this.saveTime.bind(this),1e3))}async getVolume(){return b(this,di).volume}async setVolume(o){b(this,di).volume=o,this.save()}async getMuted(){return b(this,di).muted}async setMuted(o){b(this,di).muted=o,this.save()}async getTime(){return b(this,di).time}async setTime(o,n){const a=o<0;b(this,di).time=a?null:o,a||n?this.saveTime():this.saveTimeThrottled()}async getLang(){return b(this,di).lang}async setLang(o){b(this,di).lang=o,this.save()}async getCaptions(){return b(this,di).captions}async setCaptions(o){b(this,di).captions=o,this.save()}async getPlaybackRate(){return b(this,di).rate}async setPlaybackRate(o){b(this,di).rate=o,this.save()}async getAudioGain(){return b(this,di).audioGain}async setAudioGain(o){b(this,di).audioGain=o,this.save()}async getVideoQuality(){return b(this,di).quality}async setVideoQuality(o){b(this,di).quality=o,this.save()}onChange(o,n,a="vds-player"){const l=a?localStorage.getItem(a):null,s=n?localStorage.getItem(n):null;this.playerId=a,this.mediaId=n,j(this,di,{volume:null,muted:null,audioGain:null,lang:null,captions:null,rate:null,quality:null,...l?JSON.parse(l):{},time:s?+s:null})}save(){if(!this.playerId)return;const o=JSON.stringify({...b(this,di),time:void 0});localStorage.setItem(this.playerId,o)}saveTime(){if(!this.mediaId)return;const o=(b(this,di).time??0).toString();localStorage.setItem(this.mediaId,o)}}di=new WeakMap;const $h=Symbol(0);class b$ extends d${get selected(){return this.items.find(o=>o.selected)??null}get selectedIndex(){return this.items.findIndex(o=>o.selected)}[ft.onRemove](o,n){this[ft.select](o,!1,n)}[ft.add](o,n){o[$h]=!1,Object.defineProperty(o,"selected",{get(){return this[$h]},set:a=>{var l;this.readonly||((l=this[ft.onUserSelect])==null||l.call(this),this[ft.select](o,a))}}),super[ft.add](o,n)}[ft.select](o,n,a){if(n===(o==null?void 0:o[$h]))return;const l=this.selected;o&&(o[$h]=n),(n?l!==o:l===o)&&(l&&(l[$h]=!1),this.dispatchEvent(new Ot("change",{detail:{prev:l,current:this.selected},trigger:a})))}}class FCe extends b${}class qCe{constructor(){P(this,ja);V(this,"priority",0);P(this,hm,!0);P(this,fs,null);P(this,fm,null);P(this,Bc,new Set)}canRender(o,n){return!!n}attach(o){j(this,fs,o),o&&(o.textTracks.onchange=k(this,ja,mx).bind(this))}addTrack(o){b(this,Bc).add(o),k(this,ja,$z).call(this,o)}removeTrack(o){var n,a;(a=(n=o[kt.native])==null?void 0:n.remove)==null||a.call(n),o[kt.native]=null,b(this,Bc).delete(o)}changeTrack(o){const n=o==null?void 0:o[kt.native];n&&n.track.mode!=="showing"&&(n.track.mode="showing"),j(this,fm,o)}setDisplay(o){j(this,hm,o),k(this,ja,mx).call(this)}detach(){b(this,fs)&&(b(this,fs).textTracks.onchange=null);for(const o of b(this,Bc))this.removeTrack(o);b(this,Bc).clear(),j(this,fs,null),j(this,fm,null)}}hm=new WeakMap,fs=new WeakMap,fm=new WeakMap,Bc=new WeakMap,ja=new WeakSet,$z=function(o){var a;if(!b(this,fs))return;const n=o[a=kt.native]??(o[a]=k(this,ja,Mz).call(this,o));wp(n)&&(b(this,fs).append(n),n.track.mode=n.default?"showing":"disabled")},Mz=function(o){const n=document.createElement("track"),a=o.default||o.mode==="showing",l=o.src&&o.type==="vtt";return n.id=o.id,n.src=l?o.src:"",n.label=o.label,n.kind=o.kind,n.default=a,o.language&&(n.srclang=o.language),a&&!l&&k(this,ja,fx).call(this,o,n.track),n},fx=function(o,n){var a;if(!(o.src&&o.type==="vtt"||(a=n.cues)!=null&&a.length))for(const l of o.cues)n.addCue(l)},mx=function(o){for(const n of b(this,Bc)){const a=n[kt.native];if(!a)continue;if(!b(this,hm)){a.track.mode=a.managed?"hidden":"disabled";continue}const l=a.track.mode==="showing";l&&k(this,ja,fx).call(this,n,a.track),n.setMode(l?"showing":"disabled",o)}};class VCe{constructor(o){P(this,ki);P(this,Kp,null);P(this,u2);P(this,Gp,[]);P(this,mm);P(this,bm,!1);P(this,Sa,null);P(this,rl,null);j(this,mm,o);const n=o.textTracks;j(this,u2,n),ue(k(this,ki,Nz).bind(this)),At(k(this,ki,Vz).bind(this)),new go(n).add("add",k(this,ki,Fz).bind(this)).add("remove",k(this,ki,qz).bind(this)).add("mode-change",k(this,ki,R1).bind(this))}add(o){b(this,Gp).push(o),Ou(k(this,ki,R1).bind(this))}remove(o){o.detach(),b(this,Gp).splice(b(this,Gp).indexOf(o),1),Ou(k(this,ki,R1).bind(this))}attachVideo(o){requestAnimationFrame(()=>{if(j(this,Kp,o),o){j(this,Sa,new qCe),b(this,Sa).attach(o);for(const n of b(this,u2))k(this,ki,bx).call(this,n)}k(this,ki,R1).call(this)})}}Kp=new WeakMap,u2=new WeakMap,Gp=new WeakMap,mm=new WeakMap,bm=new WeakMap,Sa=new WeakMap,rl=new WeakMap,ki=new WeakSet,Nz=function(){const{nativeControls:o}=b(this,mm).$state;j(this,bm,o()),k(this,ki,R1).call(this)},bx=function(o){var n;xn(o)&&((n=b(this,Sa))==null||n.addTrack(o))},jz=function(o){var n;xn(o)&&((n=b(this,Sa))==null||n.removeTrack(o))},Fz=function(o){k(this,ki,bx).call(this,o.detail)},qz=function(o){k(this,ki,jz).call(this,o.detail)},R1=function(){var a,l,s,d,p,h,f;const o=b(this,u2).selected;if(b(this,Kp)&&(b(this,bm)||o!=null&&o[kt.nativeHLS])){(a=b(this,rl))==null||a.changeTrack(null),(l=b(this,Sa))==null||l.setDisplay(!0),(s=b(this,Sa))==null||s.changeTrack(o);return}if((d=b(this,Sa))==null||d.setDisplay(!1),(p=b(this,Sa))==null||p.changeTrack(null),!o){(h=b(this,rl))==null||h.changeTrack(null);return}const n=b(this,Gp).sort((y,w)=>y.priority-w.priority).find(y=>y.canRender(o,b(this,Kp)));b(this,rl)!==n&&((f=b(this,rl))==null||f.detach(),n==null||n.attach(b(this,Kp)),j(this,rl,n??null)),n==null||n.changeTrack(o)},Vz=function(){var o,n;(o=b(this,Sa))==null||o.detach(),j(this,Sa,null),(n=b(this,rl))==null||n.detach(),j(this,rl,null)};class zCe extends d${constructor(){super();P(this,dl);P(this,Wp,!1);P(this,ll,{});P(this,sl,null);P(this,cl,null);V(this,dz);P(this,gm,uv(async()=>{var l;if(!b(this,Wp))return;!b(this,cl)&&b(this,sl)&&j(this,cl,await b(this,sl).getLang());const n=await((l=b(this,sl))==null?void 0:l.getCaptions()),a=[["captions","subtitles"],"chapters","descriptions","metadata"];for(const s of a){const d=this.getByKind(s);if(d.find(w=>w.mode==="showing"))continue;const p=b(this,cl)?d.find(w=>w.language===b(this,cl)):null,h=rn(s)?b(this,ll)[s.find(w=>b(this,ll)[w])||""]:b(this,ll)[s],f=p??h,y=f&&xn(f);f&&(!y||n!==!1)&&(f.mode="showing",y&&k(this,dl,gx).call(this,f))}},300));P(this,h2,null);P(this,ym,k(this,dl,zz).bind(this))}get selected(){return this.items.find(a=>a.mode==="showing"&&xn(a))??null}get selectedIndex(){const n=this.selected;return n?this.indexOf(n):-1}get preferredLang(){return b(this,cl)}set preferredLang(n){j(this,cl,n),k(this,dl,yx).call(this,n)}add(n,a){const l=n instanceof hc,s=l?n:new hc(n),d=n.kind==="captions"||n.kind==="subtitles"?"captions":n.kind;return b(this,ll)[d]&&n.default&&delete n.default,s.addEventListener("mode-change",b(this,ym)),this[ft.add](s,a),s[kt.crossOrigin]=this[kt.crossOrigin],b(this,Wp)&&s[kt.canLoad](),n.default&&(b(this,ll)[d]=s),b(this,gm).call(this),this}remove(n,a){if(j(this,h2,n),!!this.items.includes(n))return n===b(this,ll)[n.kind]&&delete b(this,ll)[n.kind],n.mode="disabled",n[kt.onModeChange]=null,n.removeEventListener("mode-change",b(this,ym)),this[ft.remove](n,a),j(this,h2,null),this}clear(n){for(const a of[...this.items])this.remove(a,n);return this}getByKind(n){const a=Array.isArray(n)?n:[n];return this.items.filter(l=>a.includes(l.kind))}[(dz=kt.crossOrigin,kt.canLoad)](){if(!b(this,Wp)){for(const n of this.items)n[kt.canLoad]();j(this,Wp,!0),b(this,gm).call(this)}}setStorage(n){j(this,sl,n)}}Wp=new WeakMap,ll=new WeakMap,sl=new WeakMap,cl=new WeakMap,gm=new WeakMap,h2=new WeakMap,ym=new WeakMap,dl=new WeakSet,zz=function(n){const a=n.detail;if(b(this,sl)&&xn(a)&&a!==b(this,h2)&&k(this,dl,gx).call(this,a),a.mode==="showing"){const l=xn(a)?["captions","subtitles"]:[a.kind];for(const s of this.items)s.mode==="showing"&&s!=a&&l.includes(s.kind)&&(s.mode="disabled")}this.dispatchEvent(new Ot("mode-change",{detail:n.detail,trigger:n}))},gx=function(n){var a,l;n.mode!=="disabled"&&k(this,dl,yx).call(this,n.language),(l=(a=b(this,sl))==null?void 0:a.setCaptions)==null||l.call(a,n.mode==="showing")},yx=function(n){var a,l;(l=(a=b(this,sl))==null?void 0:a.setLang)==null||l.call(a,j(this,cl,n))};class UCe extends b${constructor(){super(...arguments);P(this,Zp,!1);V(this,"switch","current");V(this,pz)}get auto(){return b(this,Zp)||this.readonly}[(pz=ln.enableAuto,ft.onUserSelect)](){this[ln.setAuto](!1)}[ft.onReset](n){this[ln.enableAuto]=void 0,this[ln.setAuto](!1,n)}autoSelect(n){var a;this.readonly||b(this,Zp)||!this[ln.enableAuto]||((a=this[ln.enableAuto])==null||a.call(this,n),this[ln.setAuto](!0,n))}getBySrc(n){return this.items.find(a=>a.src===n)}[ln.setAuto](n,a){b(this,Zp)!==n&&(j(this,Zp,n),this.dispatchEvent(new Ot("auto-change",{detail:n,trigger:a})))}}Zp=new WeakMap;function HCe(i){return i instanceof HTMLAudioElement}function KCe(i){return i instanceof HTMLVideoElement}function GCe(i){return HCe(i)||KCe(i)}class vp extends Pa{}const WCe={togglePaused:"k Space",toggleMuted:"m",toggleFullscreen:"f",togglePictureInPicture:"i",toggleCaptions:"c",seekBackward:"j J ArrowLeft",seekForward:"l L ArrowRight",volumeUp:"ArrowUp",volumeDown:"ArrowDown",speedUp:">",slowDown:"<"},Mh=new Set(["Shift","Alt","Meta","Ctrl"]),ZCe='button, [role="button"]',g$='input, textarea, select, [contenteditable], [role^="menuitem"], [role="timer"]';class YCe extends vp{constructor(n){super();P(this,xi);P(this,Zi);P(this,Yp);P(this,ms,null);j(this,Zi,n)}onConnect(){ue(k(this,xi,Uz).bind(this))}}Zi=new WeakMap,xi=new WeakSet,Uz=function(){const{keyDisabled:n,keyTarget:a}=this.$props;if(n())return;const l=a()==="player"?this.el:document,s=ct(!1);l===this.el?new go(this.el).add("focusin",()=>s.set(!0)).add("focusout",d=>{this.el.contains(d.target)||s.set(!1)}):(Re(s)||s.set(document.querySelector("[data-media-player]")===this.el),uo(document,"focusin",d=>{const p=d.composedPath().find(h=>h instanceof Element&&h.localName==="media-player");p!==void 0&&s.set(this.el===p)})),ue(()=>{s()&&new go(l).add("keyup",k(this,xi,Hz).bind(this)).add("keydown",k(this,xi,Kz).bind(this)).add("keydown",k(this,xi,Gz).bind(this),{capture:!0})})},Hz=function(n){var d,p;const a=document.activeElement;if(!n.key||!this.$state.canSeek()||a!=null&&a.matches(g$))return;let{method:l,value:s}=k(this,xi,D5).call(this,n);if(!Je(s)&&!rn(s)){(d=s==null?void 0:s.onKeyUp)==null||d.call(s,{event:n,player:b(this,Zi).player,remote:b(this,Zi).remote}),(p=s==null?void 0:s.callback)==null||p.call(s,n,b(this,Zi).remote);return}if(l!=null&&l.startsWith("seek")&&(n.preventDefault(),n.stopPropagation(),b(this,ms)?(k(this,xi,wx).call(this,n,l==="seekForward"),j(this,ms,null)):(b(this,Zi).remote.seek(b(this,Yp),n),j(this,Yp,void 0))),l!=null&&l.startsWith("volume")){const h=this.el.querySelector("[data-media-volume-slider]");h==null||h.dispatchEvent(new KeyboardEvent("keyup",{key:l==="volumeUp"?"Up":"Down",shiftKey:n.shiftKey,trigger:n}))}},Kz=function(n){var p,h,f,y;if(!n.key||Mh.has(n.key))return;const a=document.activeElement;if(a!=null&&a.matches(g$)||LP(n)&&(a!=null&&a.matches(ZCe)))return;let{method:l,value:s}=k(this,xi,D5).call(this,n),d=!n.metaKey&&/^[0-9]$/.test(n.key);if(!Je(s)&&!rn(s)&&!d){(p=s==null?void 0:s.onKeyDown)==null||p.call(s,{event:n,player:b(this,Zi).player,remote:b(this,Zi).remote}),(h=s==null?void 0:s.callback)==null||h.call(s,n,b(this,Zi).remote);return}if(!l&&d&&!JCe(n)){n.preventDefault(),n.stopPropagation(),b(this,Zi).remote.seek(this.$state.duration()/10*Number(n.key),n);return}if(l){switch(n.preventDefault(),n.stopPropagation(),l){case"seekForward":case"seekBackward":k(this,xi,Zz).call(this,n,l,l==="seekForward");break;case"volumeUp":case"volumeDown":const w=this.el.querySelector("[data-media-volume-slider]");if(w)w.dispatchEvent(new KeyboardEvent("keydown",{key:l==="volumeUp"?"Up":"Down",shiftKey:n.shiftKey,trigger:n}));else{const C=n.shiftKey?.1:.05;b(this,Zi).remote.changeVolume(this.$state.volume()+(l==="volumeUp"?+C:-C),n)}break;case"toggleFullscreen":b(this,Zi).remote.toggleFullscreen("prefer-media",n);break;case"speedUp":case"slowDown":const v=this.$state.playbackRate();b(this,Zi).remote.changePlaybackRate(Math.max(.25,Math.min(2,v+(l==="speedUp"?.25:-.25))),n);break;default:(y=(f=b(this,Zi).remote)[l])==null||y.call(f,n)}this.$state.lastKeyboardAction.set({action:l,event:n})}},Gz=function(n){GCe(n.target)&&k(this,xi,D5).call(this,n).method&&n.preventDefault()},D5=function(n){const a={...this.$props.keyShortcuts(),...b(this,Zi).ariaKeys},l=Object.keys(a).find(s=>{var f;const d=a[s],p=rn(d)?d.join(" "):Je(d)?d:d==null?void 0:d.keys,h=(f=rn(p)?p:p==null?void 0:p.split(" "))==null?void 0:f.map(y=>QCe(y).replace(/Control/g,"Ctrl").split("+"));return h==null?void 0:h.some(y=>{const w=new Set(y.filter(v=>Mh.has(v)));for(const v of Mh){const C=v.toLowerCase()+"Key";if(!w.has(v)&&n[C])return!1}return y.every(v=>Mh.has(v)?n[v.toLowerCase()+"Key"]:n.key===v.replace("Space"," "))})});return{method:l,value:l?a[l]:null}},Yp=new WeakMap,Wz=function(n,a){const l=n.shiftKey?10:5;return j(this,Yp,Math.max(0,Math.min((b(this,Yp)??this.$state.currentTime())+(a==="seekForward"?+l:-l),this.$state.duration())))},ms=new WeakMap,wx=function(n,a){var l;(l=b(this,ms))==null||l.dispatchEvent(new KeyboardEvent(n.type,{key:a?"Right":"Left",shiftKey:n.shiftKey,trigger:n}))},Zz=function(n,a,l){this.$state.canSeek()&&(b(this,ms)||j(this,ms,this.el.querySelector("[data-media-time-slider]")),b(this,ms)?k(this,xi,wx).call(this,n,l):b(this,Zi).remote.seeking(k(this,xi,Wz).call(this,n,a),n))};const XCe=["!","@","#","$","%","^","&","*","(",")"];function QCe(i){return i.replace(/Shift\+(\d)/g,(o,n)=>XCe[n-1])}function JCe(i){for(const o of Mh)if(i[o.toLowerCase()+"Key"])return!0;return!1}class eke extends vp{constructor(){super(...arguments);P(this,ro);P(this,f2,-2);P(this,bs,!1);P(this,wm,ct(!1));P(this,m2,ct(!1));P(this,Lc,null);P(this,b2,ct(!0));V(this,"defaultDelay",2e3)}get canIdle(){return b(this,b2).call(this)}set canIdle(n){b(this,b2).set(n)}get hideOnMouseLeave(){const{hideControlsOnMouseLeave:n}=this.$props;return b(this,wm).call(this)||n()}set hideOnMouseLeave(n){b(this,wm).set(n)}get showing(){return this.$state.controlsVisible()}show(n=0,a){k(this,ro,_5).call(this),b(this,bs)||k(this,ro,T3).call(this,!0,n,a)}hide(n=this.defaultDelay,a){k(this,ro,_5).call(this),b(this,bs)||k(this,ro,T3).call(this,!1,n,a)}pause(n){j(this,bs,!0),k(this,ro,_5).call(this),k(this,ro,T3).call(this,!0,0,n)}resume(n){j(this,bs,!1),!this.$state.paused()&&k(this,ro,T3).call(this,!1,this.defaultDelay,n)}onConnect(){ue(k(this,ro,Yz).bind(this))}}f2=new WeakMap,bs=new WeakMap,wm=new WeakMap,m2=new WeakMap,Lc=new WeakMap,b2=new WeakMap,ro=new WeakSet,Yz=function(){const{viewType:n}=this.$state;if(!this.el||!b(this,b2).call(this))return;if(n()==="audio"){this.show();return}ue(k(this,ro,Xz).bind(this)),ue(k(this,ro,Qz).bind(this));const a=k(this,ro,Jz).bind(this),l=k(this,ro,eU).bind(this),s=k(this,ro,tU).bind(this);new go(this.el).add("can-play",d=>this.show(0,d)).add("play",a).add("pause",l).add("end",s).add("auto-play-fail",l)},Xz=function(){if(!this.el)return;const{started:n,pointer:a,paused:l}=this.$state;if(!n()||a()!=="fine")return;const s=new go(this.el),d=this.hideOnMouseLeave;(!d||!b(this,m2).call(this))&&ue(()=>{l()||s.add("pointermove",k(this,ro,vx).bind(this))}),d&&s.add("mouseenter",k(this,ro,oU).bind(this)).add("mouseleave",k(this,ro,iU).bind(this))},Qz=function(){const{paused:n,started:a,autoPlayError:l}=this.$state;if(n()||l()&&!a())return;const s=k(this,ro,vx).bind(this);ue(()=>{if(!this.el)return;const d=this.$state.pointer(),p=d==="coarse",h=new go(this.el),f=[p?"touchend":"pointerup","keydown"];for(const y of f)h.add(y,s,{passive:!1})})},Jz=function(n){n.triggers.hasType("ended")||(this.show(0,n),this.hide(void 0,n))},eU=function(n){this.show(0,n)},tU=function(n){const{loop:a}=this.$state;a()&&this.hide(0,n)},oU=function(n){b(this,m2).set(!1),this.show(0,n),this.hide(void 0,n)},iU=function(n){b(this,m2).set(!0),this.hide(0,n)},_5=function(){window.clearTimeout(b(this,f2)),j(this,f2,-1)},vx=function(n){var a;n.MEDIA_GESTURE||b(this,bs)||yv(n)||(_g(n)&&(n.key==="Escape"?((a=this.el)==null||a.focus(),j(this,Lc,null)):b(this,Lc)&&(n.preventDefault(),requestAnimationFrame(()=>{var l;(l=b(this,Lc))==null||l.focus(),j(this,Lc,null)}))),this.show(0,n),this.hide(this.defaultDelay,n))},T3=function(n,a,l){if(a===0){k(this,ro,Cx).call(this,n,l);return}j(this,f2,window.setTimeout(()=>{this.scope&&k(this,ro,Cx).call(this,n&&!b(this,bs),l)},a))},Cx=function(n,a){var l;this.$state.controlsVisible()!==n&&(this.$state.controlsVisible.set(n),!n&&document.activeElement&&((l=this.el)!=null&&l.contains(document.activeElement))&&(j(this,Lc,document.activeElement),requestAnimationFrame(()=>{var s;(s=this.el)==null||s.focus({preventScroll:!0})})),this.dispatch("controls-change",{detail:n,trigger:a}))};class tke{constructor(){V(this,"name","audio");V(this,"target")}canPlay(o){return e$(o)?!Je(o.src)||o.type==="?"||WP(this.target,o.type):!1}mediaType(){return"audio"}async load(o){return new(await Promise.resolve().then(()=>MHe)).AudioProvider(this.target,o)}}class Tv{constructor(){V(this,"name","video");V(this,"target")}canPlay(o){return t$(o)?!Je(o.src)||o.type==="?"||ZP(this.target,o.type):!1}mediaType(){return"video"}async load(o){return new(await Promise.resolve().then(()=>UHe)).VideoProvider(this.target,o)}}const Y4=class Y4 extends Tv{constructor(){super(...arguments);V(this,"name","hls")}canPlay(n){return Y4.supported&&$u(n)}async load(n){return new(await Promise.resolve().then(()=>XHe)).HLSProvider(this.target,n)}};V(Y4,"supported",Ng());let Av=Y4;const X4=class X4 extends Tv{constructor(){super(...arguments);V(this,"name","dash")}canPlay(n){return X4.supported&&fv(n)}async load(n){return new(await Promise.resolve().then(()=>aKe)).DASHProvider(this.target,n)}};V(X4,"supported",JP());let Dv=X4;class oke{constructor(){V(this,"name","vimeo");V(this,"target")}preconnect(){const o=["https://i.vimeocdn.com","https://f.vimeocdn.com","https://fresnel.vimeocdn.com"];for(const n of o)os(n)}canPlay(o){return Je(o.src)&&o.type==="video/vimeo"}mediaType(){return"video"}async load(o){return new(await Promise.resolve().then(()=>dKe)).VimeoProvider(this.target,o)}async loadPoster(o,n,a){const{resolveVimeoVideoId:l,getVimeoVideoInfo:s}=await Promise.resolve().then(()=>lKe);if(!Je(o.src))return null;const{videoId:d,hash:p}=l(o.src);return d?s(d,a,p).then(h=>h?h.poster:null):null}}class ike{constructor(){V(this,"name","youtube");V(this,"target")}preconnect(){const o=["https://www.google.com","https://i.ytimg.com","https://googleads.g.doubleclick.net","https://static.doubleclick.net"];for(const n of o)os(n)}canPlay(o){return Je(o.src)&&o.type==="video/youtube"}mediaType(){return"video"}async load(o){return new(await Promise.resolve().then(()=>bKe)).YouTubeProvider(this.target,o)}async loadPoster(o,n,a){const{findYouTubePoster:l,resolveYouTubeVideoId:s}=await Promise.resolve().then(()=>fKe),d=Je(o.src)&&s(o.src);return d?l(d,a):null}}const _v=Symbol(0),nke=["autoPlay","canAirPlay","canFullscreen","canGoogleCast","canLoad","canLoadPoster","canPictureInPicture","canPlay","canSeek","ended","fullscreen","isAirPlayConnected","isGoogleCastConnected","live","liveEdge","loop","mediaType","muted","paused","pictureInPicture","playing","playsInline","remotePlaybackState","remotePlaybackType","seeking","started","streamType","viewType","waiting"],ake={artist:"",artwork:null,autoplay:!1,autoPlay:!1,clipStartTime:0,clipEndTime:0,controls:!1,currentTime:0,crossorigin:null,crossOrigin:null,duration:-1,fullscreenOrientation:"landscape",googleCast:{},load:"visible",posterLoad:"visible",logLevel:"silent",loop:!1,muted:!1,paused:!0,playsinline:!1,playsInline:!1,playbackRate:1,poster:"",preload:"metadata",preferNativeHLS:!1,src:"",title:"",controlsDelay:2e3,hideControlsOnMouseLeave:!1,viewType:"unknown",streamType:"unknown",volume:1,liveEdgeTolerance:10,minLiveDVRWindow:60,keyDisabled:!1,keyTarget:"player",keyShortcuts:WCe,storage:null};class y$ extends vp{constructor(n,a){super();P(this,vm);P(this,Xp);j(this,vm,n),j(this,Xp,a)}async onAttach(n){const a=this.$props[b(this,vm)]();if(a==="eager")requestAnimationFrame(b(this,Xp));else if(a==="idle")Ove(b(this,Xp));else if(a==="visible"){let l,s=new IntersectionObserver(d=>{this.scope&&d[0].isIntersecting&&(l==null||l(),l=void 0,b(this,Xp).call(this))});s.observe(n),l=At(()=>s.disconnect())}}}vm=new WeakMap,Xp=new WeakMap;class rke{constructor(o,n){P(this,Q4);P(this,Cm);P(this,hr);j(this,Cm,o),j(this,hr,n)}notify(o,...n){b(this,Cm).call(this,new Ot(o,{detail:n==null?void 0:n[0],trigger:n==null?void 0:n[1]}))}async ready(o,n){return Ou(async()=>{var U,te,se,fe,pe,$,Z;const{logger:a}=b(this,hr),{autoPlay:l,canPlay:s,started:d,duration:p,seekable:h,buffered:f,remotePlaybackInfo:y,playsInline:w,savedState:v,source:C}=b(this,hr).$state;if(s())return;const E={duration:(o==null?void 0:o.duration)??p(),seekable:(o==null?void 0:o.seekable)??h(),buffered:(o==null?void 0:o.buffered)??f(),provider:b(this,hr).$provider()};this.notify("can-play",E,n),es();let T=b(this,hr).$provider(),{storage:A,qualities:I}=b(this,hr),{muted:x,volume:O,clipStartTime:_,playbackRate:R}=b(this,hr).$props;await((U=A==null?void 0:A.onLoad)==null?void 0:U.call(A,C()));const F=(te=v())==null?void 0:te.currentTime,L=(se=v())==null?void 0:se.paused,H=await(A==null?void 0:A.getTime()),K=F??H??_(),q=L===!1||L!==!0&&!d()&&l();if(T){T.setVolume(await(A==null?void 0:A.getVolume())??O()),T.setMuted(x()||!!await(A==null?void 0:A.getMuted()));const W=await(A==null?void 0:A.getAudioGain())??1;W>1&&((pe=(fe=T.audioGain)==null?void 0:fe.setGain)==null||pe.call(fe,W)),($=T.setPlaybackRate)==null||$.call(T,await(A==null?void 0:A.getPlaybackRate())??R()),(Z=T.setPlaysInline)==null||Z.call(T,w()),K>0&&T.setCurrentTime(K)}const N=await(A==null?void 0:A.getVideoQuality());if(N&&I.length){let W=null,Q=1/0;for(const de of I){const ge=Math.abs(N.width-de.width)+Math.abs(N.height-de.height)+(N.bitrate?Math.abs(N.bitrate-(de.bitrate??0)):0);ge<Q&&(W=de,Q=ge)}W&&(W.selected=!0)}s()&&q?await k(this,Q4,nU).call(this,n):H&&H>0&&this.notify("started",void 0,n),y.set(null)})}}Cm=new WeakMap,hr=new WeakMap,Q4=new WeakSet,nU=async function(o){const{player:n,$state:{autoPlaying:a,muted:l}}=b(this,hr);a.set(!0);const s=new Ot("auto-play-attempt",{trigger:o});try{await n.play(s)}catch{}};class lke{constructor(){P(this,Pc,new Map)}enqueue(o,n){b(this,Pc).set(o,n)}serve(o){const n=this.peek(o);return b(this,Pc).delete(o),n}peek(o){return b(this,Pc).get(o)}delete(o){b(this,Pc).delete(o)}clear(){b(this,Pc).clear()}}Pc=new WeakMap;class w${constructor(){P(this,Mc);P(this,$c,!1);P(this,g2,Lu());P(this,fr,new Map)}get size(){return b(this,fr).size}get isServing(){return b(this,$c)}async waitForFlush(){b(this,$c)||await b(this,g2).promise}enqueue(o,n){if(b(this,$c)){n();return}b(this,fr).delete(o),b(this,fr).set(o,n)}serve(o){var n;(n=b(this,fr).get(o))==null||n(),b(this,fr).delete(o)}start(){k(this,Mc,kx).call(this),j(this,$c,!0),b(this,fr).size>0&&k(this,Mc,kx).call(this)}stop(){j(this,$c,!1)}reset(){this.stop(),b(this,fr).clear(),k(this,Mc,xx).call(this)}}$c=new WeakMap,g2=new WeakMap,fr=new WeakMap,Mc=new WeakSet,kx=function(){for(const o of b(this,fr).keys())this.serve(o);k(this,Mc,xx).call(this)},xx=function(){b(this,g2).resolve(),j(this,g2,Lu())};class ske extends vp{constructor(n,a,l){super();P(this,Vt);P(this,gs);P(this,It);P(this,ys);V(this,"controls");P(this,Qp);P(this,ws);P(this,Vo);P(this,Nc,new w$);P(this,y2,!1);P(this,Jp);j(this,gs,n),j(this,It,a),j(this,ys,l),j(this,Vo,l.$provider),this.controls=new eke,j(this,Qp,new $Ce),j(this,ws,new Vg)}onAttach(){this.listen("fullscreen-change",k(this,Vt,fU).bind(this))}onConnect(n){const a=Object.getOwnPropertyNames(Object.getPrototypeOf(this)),l=new go(n),s=k(this,Vt,lU).bind(this);for(const d of a)d.startsWith("media-")&&l.add(d,s);k(this,Vt,aU).call(this),ue(k(this,Vt,rU).bind(this)),ue(k(this,Vt,sU).bind(this)),ue(k(this,Vt,cU).bind(this)),ue(k(this,Vt,dU).bind(this)),ue(k(this,Vt,pU).bind(this)),ue(k(this,Vt,uU).bind(this)),ue(k(this,Vt,hU).bind(this))}onDestroy(){try{const n=this.createEvent("destroy"),{pictureInPicture:a,fullscreen:l}=this.$state;l()&&this.exitFullscreen("prefer-media",n),a()&&this.exitPictureInPicture(n)}catch{}b(this,Nc).reset()}async play(n){const{canPlay:a,paused:l,autoPlaying:s}=this.$state;if(k(this,Vt,Sx).call(this,n)||!Re(l))return;n&&b(this,It).queue.enqueue("media-play-request",n);const d=Re(s);try{const p=Re(b(this,Vo));return Ov(p,Re(a)),cke(d),await p.play()}catch(p){const h=this.createEvent("play-fail",{detail:Ph(p),trigger:n});throw h.autoPlay=d,b(this,gs).handle(h),p}}async pause(n){const{canPlay:a,paused:l}=this.$state;if(!Re(l)){n&&b(this,It).queue.enqueue("media-pause-request",n);try{const s=Re(b(this,Vo));return Ov(s,Re(a)),await s.pause()}catch(s){throw b(this,It).queue.delete("media-pause-request"),s}}}setAudioGain(n,a){const{audioGain:l,canSetAudioGain:s}=this.$state;if(l()===n)return;const d=b(this,Vo).call(this);if(!(d!=null&&d.audioGain)||!s())throw Error("[vidstack] audio gain api not available");a&&b(this,It).queue.enqueue("media-audio-gain-change-request",a),d.audioGain.setGain(n)}seekToLiveEdge(n){const{canPlay:a,live:l,liveEdge:s,canSeek:d,liveSyncPosition:p,seekableEnd:h,userBehindLiveEdge:f}=this.$state;if(f.set(!1),Re(()=>!l()||s()||!d()))return;const y=Re(b(this,Vo));Ov(y,Re(a)),n&&b(this,It).queue.enqueue("media-seek-request",n);const w=h()-2;y.setCurrentTime(Math.min(w,p()??w))}async enterFullscreen(n="prefer-media",a){const l=k(this,Vt,Ix).call(this,n);if(v$(n,l),!l.active)return Re(this.$state.pictureInPicture)&&(j(this,y2,!0),await this.exitPictureInPicture(a)),a&&b(this,It).queue.enqueue("media-enter-fullscreen-request",a),l.enter()}async exitFullscreen(n="prefer-media",a){const l=k(this,Vt,Ix).call(this,n);if(v$(n,l),!!l.active){a&&b(this,It).queue.enqueue("media-exit-fullscreen-request",a);try{const s=await l.exit();return b(this,y2)&&Re(this.$state.canPictureInPicture)&&await this.enterPictureInPicture(),s}finally{j(this,y2,!1)}}}async enterPictureInPicture(n){if(k(this,Vt,Ex).call(this),!this.$state.pictureInPicture())return n&&b(this,It).queue.enqueue("media-enter-pip-request",n),await b(this,Vo).call(this).pictureInPicture.enter()}async exitPictureInPicture(n){if(k(this,Vt,Ex).call(this),!!this.$state.pictureInPicture())return n&&b(this,It).queue.enqueue("media-exit-pip-request",n),await b(this,Vo).call(this).pictureInPicture.exit()}async"media-airplay-request"(n){try{await this.requestAirPlay(n)}catch{}}async requestAirPlay(n){var a;try{const l=(a=b(this,Vo).call(this))==null?void 0:a.airPlay;if(!(l!=null&&l.supported))throw Error("No AirPlay adapter.");return n&&b(this,It).queue.enqueue("media-airplay-request",n),await l.prompt()}catch(l){throw b(this,It).queue.delete("media-airplay-request"),l}}async"media-google-cast-request"(n){try{await this.requestGoogleCast(n)}catch{}}async requestGoogleCast(n){try{const{canGoogleCast:a}=this.$state;if(!Re(a)){const s=Error("Cast not available.");throw s.code="CAST_NOT_AVAILABLE",s}if(os("https://www.gstatic.com"),!b(this,Jp)){const s=await Promise.resolve().then(()=>xKe);j(this,Jp,new s.GoogleCastLoader)}await b(this,Jp).prompt(b(this,ys)),n&&b(this,It).queue.enqueue("media-google-cast-request",n);const l=Re(this.$state.remotePlaybackState)!=="disconnected";l&&this.$state.savedState.set({paused:Re(this.$state.paused),currentTime:Re(this.$state.currentTime)}),this.$state.remotePlaybackLoader.set(l?b(this,Jp):null)}catch(a){throw b(this,It).queue.delete("media-google-cast-request"),a}}"media-clip-start-change-request"(n){const{clipStartTime:a}=this.$state;a.set(n.detail)}"media-clip-end-change-request"(n){const{clipEndTime:a}=this.$state;a.set(n.detail),this.dispatch("duration-change",{detail:n.detail,trigger:n})}"media-duration-change-request"(n){const{providedDuration:a,clipEndTime:l}=this.$state;a.set(n.detail),l()<=0&&this.dispatch("duration-change",{detail:n.detail,trigger:n})}"media-audio-track-change-request"(n){const{logger:a,audioTracks:l}=b(this,ys);if(l.readonly)return;const s=n.detail,d=l[s];if(d){const p=n.type;b(this,It).queue.enqueue(p,n),d.selected=!0}}async"media-enter-fullscreen-request"(n){try{await this.enterFullscreen(n.detail,n)}catch(a){k(this,Vt,Tx).call(this,a,n)}}async"media-exit-fullscreen-request"(n){try{await this.exitFullscreen(n.detail,n)}catch(a){k(this,Vt,Tx).call(this,a,n)}}async"media-orientation-lock-request"(n){const a=n.type;try{b(this,It).queue.enqueue(a,n),await b(this,ws).lock(n.detail)}catch{b(this,It).queue.delete(a)}}async"media-orientation-unlock-request"(n){const a=n.type;try{b(this,It).queue.enqueue(a,n),await b(this,ws).unlock()}catch{b(this,It).queue.delete(a)}}async"media-enter-pip-request"(n){try{await this.enterPictureInPicture(n)}catch(a){k(this,Vt,Ax).call(this,a,n)}}async"media-exit-pip-request"(n){try{await this.exitPictureInPicture(n)}catch(a){k(this,Vt,Ax).call(this,a,n)}}"media-live-edge-request"(n){const{live:a,liveEdge:l,canSeek:s}=this.$state;if(!(!a()||l()||!s())){b(this,It).queue.enqueue("media-seek-request",n);try{this.seekToLiveEdge()}catch{b(this,It).queue.delete("media-seek-request")}}}async"media-loop-request"(n){try{b(this,It).looping=!0,b(this,It).replaying=!0,await this.play(n)}catch{b(this,It).looping=!1}}"media-user-loop-change-request"(n){this.$state.userPrefersLoop.set(n.detail)}async"media-pause-request"(n){if(!this.$state.paused())try{await this.pause(n)}catch{}}async"media-play-request"(n){if(this.$state.paused())try{await this.play(n)}catch{}}"media-rate-change-request"(n){const{playbackRate:a,canSetPlaybackRate:l}=this.$state;if(a()===n.detail||!l())return;const s=b(this,Vo).call(this);s!=null&&s.setPlaybackRate&&(b(this,It).queue.enqueue("media-rate-change-request",n),s.setPlaybackRate(n.detail))}"media-audio-gain-change-request"(n){try{this.setAudioGain(n.detail,n)}catch{}}"media-quality-change-request"(n){var p,h;const{qualities:a,storage:l,logger:s}=b(this,ys);if(a.readonly)return;b(this,It).queue.enqueue("media-quality-change-request",n);const d=n.detail;if(d<0)a.autoSelect(n),n.isOriginTrusted&&((p=l==null?void 0:l.setVideoQuality)==null||p.call(l,null));else{const f=a[d];f&&(f.selected=!0,n.isOriginTrusted&&((h=l==null?void 0:l.setVideoQuality)==null||h.call(l,{id:f.id,width:f.width,height:f.height,bitrate:f.bitrate})))}}"media-pause-controls-request"(n){const a=n.type;b(this,It).queue.enqueue(a,n),this.controls.pause(n)}"media-resume-controls-request"(n){const a=n.type;b(this,It).queue.enqueue(a,n),this.controls.resume(n)}"media-seek-request"(n){const{canSeek:a,ended:l,live:s,seekableEnd:d,userBehindLiveEdge:p}=this.$state,h=n.detail;l()&&(b(this,It).replaying=!0);const f=n.type;b(this,It).seeking=!1,b(this,It).queue.delete(f);const y=m$(h,this.$state);!Number.isFinite(y)||!a()||(b(this,It).queue.enqueue(f,n),b(this,Vo).call(this).setCurrentTime(y),s()&&n.isOriginTrusted&&Math.abs(d()-y)>=2&&p.set(!0))}"media-seeking-request"(n){const a=n.type;b(this,It).queue.enqueue(a,n),this.$state.seeking.set(!0),b(this,It).seeking=!0}"media-start-loading"(n){if(this.$state.canLoad())return;const a=n.type;b(this,It).queue.enqueue(a,n),b(this,gs).handle(this.createEvent("can-load"))}"media-poster-start-loading"(n){if(this.$state.canLoadPoster())return;const a=n.type;b(this,It).queue.enqueue(a,n),b(this,gs).handle(this.createEvent("can-load-poster"))}"media-text-track-change-request"(n){const{index:a,mode:l}=n.detail,s=b(this,ys).textTracks[a];if(s){const d=n.type;b(this,It).queue.enqueue(d,n),s.setMode(l,n)}}"media-mute-request"(n){if(this.$state.muted())return;const a=n.type;b(this,It).queue.enqueue(a,n),b(this,Vo).call(this).setMuted(!0)}"media-unmute-request"(n){const{muted:a,volume:l}=this.$state;if(!a())return;const s=n.type;b(this,It).queue.enqueue(s,n),b(this,ys).$provider().setMuted(!1),l()===0&&(b(this,It).queue.enqueue(s,n),b(this,Vo).call(this).setVolume(.25))}"media-volume-change-request"(n){const{muted:a,volume:l}=this.$state,s=n.detail;if(l()===s)return;const d=n.type;b(this,It).queue.enqueue(d,n),b(this,Vo).call(this).setVolume(s),s>0&&a()&&(b(this,It).queue.enqueue(d,n),b(this,Vo).call(this).setMuted(!1))}}gs=new WeakMap,It=new WeakMap,ys=new WeakMap,Qp=new WeakMap,ws=new WeakMap,Vo=new WeakMap,Nc=new WeakMap,Vt=new WeakSet,aU=function(){const{load:n}=this.$props,{canLoad:a}=this.$state;if(n()!=="play"||a())return;const l=this.listen("media-play-request",s=>{k(this,Vt,Sx).call(this,s),l()})},rU=function(){const n=b(this,Vo).call(this),a=this.$state.canPlay();return n&&a&&b(this,Nc).start(),()=>{b(this,Nc).stop()}},lU=function(n){n.stopPropagation(),!n.defaultPrevented&&this[n.type]&&(Re(b(this,Vo))?this[n.type](n):b(this,Nc).enqueue(n.type,()=>{Re(b(this,Vo))&&this[n.type](n)}))},Sx=function(n){const{load:a}=this.$props,{canLoad:l}=this.$state;if(a()==="play"&&!l()){const s=this.createEvent("media-start-loading",{trigger:n});return this.dispatchEvent(s),b(this,Nc).enqueue("media-play-request",async()=>{try{await this.play(s)}catch{}}),!0}return!1},y2=new WeakMap,Ix=function(n){const a=Re(b(this,Vo));return n==="prefer-media"&&b(this,Qp).supported||n==="media"?b(this,Qp):a==null?void 0:a.fullscreen},Ex=function(){if(!this.$state.canPictureInPicture())throw Error("[vidstack] no pip support")},sU=function(){this.controls.defaultDelay=this.$props.controlsDelay()},cU=function(){var l,s;const{canSetAudioGain:n}=this.$state,a=!!((s=(l=b(this,Vo).call(this))==null?void 0:l.audioGain)!=null&&s.supported);n.set(a)},dU=function(){var l,s;const{canAirPlay:n}=this.$state,a=!!((s=(l=b(this,Vo).call(this))==null?void 0:l.airPlay)!=null&&s.supported);n.set(a)},pU=function(){const{canGoogleCast:n,source:a}=this.$state,l=$g&&!Pg&&o$(a());n.set(l)},uU=function(){var l,s;const{canFullscreen:n}=this.$state,a=b(this,Qp).supported||!!((s=(l=b(this,Vo).call(this))==null?void 0:l.fullscreen)!=null&&s.supported);n.set(a)},hU=function(){var l,s;const{canPictureInPicture:n}=this.$state,a=!!((s=(l=b(this,Vo).call(this))==null?void 0:l.pictureInPicture)!=null&&s.supported);n.set(a)},Jp=new WeakMap,fU=async function(n){const a=Re(this.$props.fullscreenOrientation),l=n.detail;if(!(an(a)||a==="none"||!b(this,ws).supported))if(l){if(b(this,ws).locked)return;this.dispatch("media-orientation-lock-request",{detail:a,trigger:n})}else b(this,ws).locked&&this.dispatch("media-orientation-unlock-request",{trigger:n})},Tx=function(n,a){b(this,gs).handle(this.createEvent("fullscreen-error",{detail:Ph(n)}))},Ax=function(n,a){b(this,gs).handle(this.createEvent("picture-in-picture-error",{detail:Ph(n)}))},VKe=function(n,a,l){};function Ov(i,o){if(!(i&&o))throw Error("[vidstack] media not ready")}function v$(i,o){if(!(o!=null&&o.supported))throw Error("[vidstack] no fullscreen support")}function cke(i){if(!(!PCe()||!i))throw Error("[vidstack] autoplay blocked")}class dke{constructor(){V(this,"seeking",!1);V(this,"looping",!1);V(this,"replaying",!1);V(this,"queue",new lke)}}const pke=new Set(["auto-play","auto-play-fail","can-load","sources-change","source-change","load-start","abort","error","loaded-metadata","loaded-data","can-play","play","play-fail","pause","playing","seeking","seeked","waiting"]);class uke extends vp{constructor(n,a){super();P(this,Oe);P(this,$n);P(this,eo);P(this,Oo,new Map);P(this,e0,!1);P(this,w2,[]);P(this,t0,[-1,-1]);P(this,o0,!1);P(this,vs);P(this,jc,!1);P(this,v2,null);V(this,"seeking",mp(n=>{const{seeking:a,realCurrentTime:l,paused:s}=this.$state;a.set(!0),l.set(n.detail),k(this,Oe,ii).call(this,"media-seeking-request",n),s()&&(j(this,vs,n),b(this,C2).call(this)),j(this,t0,[-1,-1])},150,{leading:!0}));P(this,C2,uv(()=>{if(!b(this,vs))return;j(this,o0,!0);const{waiting:n,playing:a}=this.$state;n.set(!0),a.set(!1);const l=this.createEvent("waiting",{trigger:b(this,vs)});b(this,Oo).set("waiting",l),this.dispatch(l),j(this,vs,void 0),j(this,o0,!1)},300));j(this,$n,n),j(this,eo,a)}onAttach(n){n.setAttribute("aria-busy","true"),new go(this).add("fullscreen-change",this["fullscreen-change"].bind(this)).add("fullscreen-error",this["fullscreen-error"].bind(this)).add("orientation-change",this["orientation-change"].bind(this))}onConnect(n){ue(k(this,Oe,SU).bind(this)),k(this,Oe,gU).call(this),k(this,Oe,yU).call(this),k(this,Oe,wU).call(this),k(this,Oe,mU).call(this),At(k(this,Oe,bU).bind(this))}onDestroy(){const{audioTracks:n,qualities:a,textTracks:l}=b(this,eo);n[ft.reset](),a[ft.reset](),l[ft.reset](),k(this,Oe,R5).call(this)}handle(n){if(!this.scope)return;const a=n.type;Ou(()=>{var l;return(l=this[n.type])==null?void 0:l.call(this,n)}),pke.has(a)&&b(this,Oo).set(a,n),this.dispatch(n)}"provider-change"(n){var s,d;const a=b(this,eo).$provider(),l=n.detail;(a==null?void 0:a.type)!==(l==null?void 0:l.type)&&((s=a==null?void 0:a.destroy)==null||s.call(a),(d=a==null?void 0:a.scope)==null||d.dispose(),b(this,eo).$provider.set(n.detail),a&&n.detail===null&&k(this,Oe,Bx).call(this,n))}"provider-loader-change"(n){}"auto-play"(n){this.$state.autoPlayError.set(null)}"auto-play-fail"(n){this.$state.autoPlayError.set(n.detail),k(this,Oe,Dd).call(this)}"can-load"(n){this.$state.canLoad.set(!0),b(this,Oo).set("can-load",n),b(this,eo).textTracks[kt.canLoad](),k(this,Oe,ii).call(this,"media-start-loading",n)}"can-load-poster"(n){this.$state.canLoadPoster.set(!0),b(this,Oo).set("can-load-poster",n),k(this,Oe,ii).call(this,"media-poster-start-loading",n)}"media-type-change"(n){const a=b(this,Oo).get("source-change");a&&n.triggers.add(a);const l=this.$state.viewType();this.$state.mediaType.set(n.detail);const s=this.$state.providedViewType(),d=s==="unknown"?n.detail:s;l!==d&&setTimeout(()=>{requestAnimationFrame(()=>{this.scope&&(this.$state.inferredViewType.set(n.detail),this.dispatch("view-type-change",{detail:d,trigger:n}))})},0)}"stream-type-change"(n){const a=b(this,Oo).get("source-change");a&&n.triggers.add(a);const{streamType:l,inferredStreamType:s}=this.$state;s.set(n.detail),n.detail=l()}"rate-change"(n){var s;const{storage:a}=b(this,eo),{canPlay:l}=this.$state;this.$state.playbackRate.set(n.detail),k(this,Oe,ii).call(this,"media-rate-change-request",n),l()&&((s=a==null?void 0:a.setPlaybackRate)==null||s.call(a,n.detail))}"remote-playback-change"(n){const{remotePlaybackState:a,remotePlaybackType:l}=this.$state,{type:s,state:d}=n.detail,p=d==="connected";l.set(s),a.set(d);const h=s==="airplay"?"media-airplay-request":"media-google-cast-request";if(p)k(this,Oe,ii).call(this,h,n);else{const f=b(this,$n).queue.peek(h);f&&(n.request=f,n.triggers.add(f))}}"sources-change"(n){const a=this.$state.sources(),l=n.detail;this.$state.sources.set(l),k(this,Oe,IU).call(this,a,l,n)}"source-change"(n){var l,s;n.isQualityChange=((l=n.originEvent)==null?void 0:l.type)==="quality-change";const a=n.detail;k(this,Oe,Bx).call(this,n,n.isQualityChange),b(this,Oo).set(n.type,n),this.$state.source.set(a),(s=this.el)==null||s.setAttribute("aria-busy","true")}abort(n){const a=b(this,Oo).get("source-change");a&&n.triggers.add(a);const l=b(this,Oo).get("can-load");l&&!n.triggers.hasType("can-load")&&n.triggers.add(l)}"load-start"(n){const a=b(this,Oo).get("source-change");a&&n.triggers.add(a)}error(n){this.$state.error.set(n.detail);const a=b(this,Oo).get("abort");a&&n.triggers.add(a)}"loaded-metadata"(n){const a=b(this,Oo).get("load-start");a&&n.triggers.add(a)}"loaded-data"(n){const a=b(this,Oo).get("load-start");a&&n.triggers.add(a)}"can-play"(n){var l;const a=b(this,Oo).get("loaded-metadata");a&&n.triggers.add(a),k(this,Oe,Lx).call(this,n.detail),(l=this.el)==null||l.setAttribute("aria-busy","false")}"can-play-through"(n){k(this,Oe,Lx).call(this,n.detail);const a=b(this,Oo).get("can-play");a&&n.triggers.add(a)}"duration-change"(n){const{live:a,intrinsicDuration:l,providedDuration:s,clipEndTime:d,ended:p}=this.$state,h=n.detail;if(!a()){const f=Number.isNaN(h)?0:h;l.set(f),p()&&k(this,Oe,$x).call(this,n)}(s()>0||d()>0)&&n.stopImmediatePropagation()}progress(n){const{buffered:a,seekable:l}=this.$state,{buffered:s,seekable:d}=n.detail,p=yp(s),h=s.length!==a().length,f=p!==yp(a()),y=yp(d),w=d.length!==l().length,v=y!==yp(l());(h||f)&&a.set(s),(w||v)&&l.set(d)}play(n){const{paused:a,autoPlayError:l,ended:s,autoPlaying:d,playsInline:p,pointer:h,muted:f,viewType:y,live:w,userBehindLiveEdge:v}=this.$state;if(k(this,Oe,Px).call(this),!a()){n.stopImmediatePropagation();return}n.autoPlay=d();const C=b(this,Oo).get("waiting");C&&n.triggers.add(C),k(this,Oe,ii).call(this,"media-play-request",n),b(this,Oo).set("play",n),a.set(!1),l.set(null),n.autoPlay&&(this.handle(this.createEvent("auto-play",{detail:{muted:f()},trigger:n})),d.set(!1)),(s()||b(this,$n).replaying)&&(b(this,$n).replaying=!1,s.set(!1),this.handle(this.createEvent("replay",{trigger:n}))),!p()&&y()==="video"&&h()==="coarse"&&b(this,eo).remote.enterFullscreen("prefer-media",n),w()&&!v()&&b(this,eo).remote.seekToLiveEdge(n)}"play-fail"(n){const{muted:a,autoPlaying:l}=this.$state,s=b(this,Oo).get("play");s&&n.triggers.add(s),k(this,Oe,ii).call(this,"media-play-request",n);const{paused:d,playing:p}=this.$state;d.set(!0),p.set(!1),k(this,Oe,Dd).call(this),b(this,Oo).set("play-fail",n),n.autoPlay&&(this.handle(this.createEvent("auto-play-fail",{detail:{muted:a(),error:n.detail},trigger:n})),l.set(!1))}playing(n){const a=b(this,Oo).get("play"),l=b(this,Oo).get("seeked");a?n.triggers.add(a):l&&n.triggers.add(l),setTimeout(()=>k(this,Oe,Dd).call(this),0);const{paused:s,playing:d,live:p,liveSyncPosition:h,seekableEnd:f,started:y,currentTime:w,seeking:v,ended:C}=this.$state;if(s.set(!1),d.set(!0),v.set(!1),C.set(!1),b(this,$n).looping){b(this,$n).looping=!1;return}if(p()&&!y()&&w()===0){const E=h()??f()-2;Number.isFinite(E)&&b(this,eo).$provider().setCurrentTime(E)}this.started(n)}started(n){const{started:a}=this.$state;a()||(a.set(!0),this.handle(this.createEvent("started",{trigger:n})))}pause(n){var d;(d=this.el)!=null&&d.isConnected||j(this,jc,!0),k(this,Oe,ii).call(this,"media-pause-request",n);const a=b(this,Oo).get("seeked");a&&n.triggers.add(a);const{paused:l,playing:s}=this.$state;l.set(!0),s.set(!1),b(this,e0)&&setTimeout(()=>{this.handle(this.createEvent("end",{trigger:n})),j(this,e0,!1)},0),k(this,Oe,Dd).call(this)}"time-change"(n){if(b(this,$n).looping){n.stopImmediatePropagation();return}let{waiting:a,played:l,clipEndTime:s,realCurrentTime:d,currentTime:p}=this.$state,h=n.detail,f=s();d.set(h),k(this,Oe,EU).call(this),a.set(!1);for(const y of b(this,eo).textTracks)y[kt.updateActiveCues](h,n);f>0&&h>=f&&(j(this,e0,!0),this.dispatch("media-pause-request",{trigger:n})),k(this,Oe,TU).call(this),this.dispatch("time-update",{detail:{currentTime:p(),played:l()},trigger:n})}"audio-gain-change"(n){var d;const{storage:a}=b(this,eo),{canPlay:l,audioGain:s}=this.$state;s.set(n.detail),k(this,Oe,ii).call(this,"media-audio-gain-change-request",n),l()&&((d=a==null?void 0:a.setAudioGain)==null||d.call(a,s()))}"volume-change"(n){var h,f;const{storage:a}=b(this,eo),{volume:l,muted:s,canPlay:d}=this.$state,p=n.detail;l.set(p.volume),s.set(p.muted||p.volume===0),k(this,Oe,ii).call(this,"media-volume-change-request",n),k(this,Oe,ii).call(this,p.muted?"media-mute-request":"media-unmute-request",n),d()&&((h=a==null?void 0:a.setVolume)==null||h.call(a,l()),(f=a==null?void 0:a.setMuted)==null||f.call(a,s()))}seeked(n){const{seeking:a,currentTime:l,realCurrentTime:s,paused:d,seekableEnd:p,ended:h,live:f}=this.$state;if(b(this,$n).seeking)a.set(!0),n.stopImmediatePropagation();else if(a()){const y=b(this,Oo).get("waiting");y&&n.triggers.add(y);const w=b(this,Oo).get("seeking");w&&!n.triggers.has(w)&&n.triggers.add(w),d()&&k(this,Oe,Mx).call(this),a.set(!1),s.set(n.detail),k(this,Oe,ii).call(this,"media-seek-request",n);const v=n==null?void 0:n.originEvent;v!=null&&v.isTrusted&&!(v instanceof MessageEvent)&&!/seek/.test(v.type)&&this.started(n)}f()||(Math.floor(l())!==Math.floor(p())?h.set(!1):this.end(n))}waiting(n){b(this,o0)||b(this,$n).seeking||(n.stopImmediatePropagation(),j(this,vs,n),b(this,C2).call(this))}end(n){const{loop:a,ended:l}=this.$state;if(!(!a()&&l())){if(a()){setTimeout(()=>{requestAnimationFrame(()=>{k(this,Oe,Px).call(this,n),this.dispatch("media-loop-request",{trigger:n})})},10);return}setTimeout(()=>k(this,Oe,AU).call(this,n),0)}}"fullscreen-change"(n){const a=n.detail;this.$state.fullscreen.set(a),k(this,Oe,ii).call(this,a?"media-enter-fullscreen-request":"media-exit-fullscreen-request",n)}"fullscreen-error"(n){k(this,Oe,ii).call(this,"media-enter-fullscreen-request",n),k(this,Oe,ii).call(this,"media-exit-fullscreen-request",n)}"orientation-change"(n){const a=n.detail.lock;k(this,Oe,ii).call(this,a?"media-orientation-lock-request":"media-orientation-unlock-request",n)}"picture-in-picture-change"(n){const a=n.detail;this.$state.pictureInPicture.set(a),k(this,Oe,ii).call(this,a?"media-enter-pip-request":"media-exit-pip-request",n)}"picture-in-picture-error"(n){k(this,Oe,ii).call(this,"media-enter-pip-request",n),k(this,Oe,ii).call(this,"media-exit-pip-request",n)}"title-change"(n){n.trigger&&(n.stopImmediatePropagation(),this.$state.inferredTitle.set(n.detail))}"poster-change"(n){n.trigger&&(n.stopImmediatePropagation(),this.$state.inferredPoster.set(n.detail))}}$n=new WeakMap,eo=new WeakMap,Oo=new WeakMap,e0=new WeakMap,w2=new WeakMap,t0=new WeakMap,o0=new WeakMap,vs=new WeakMap,jc=new WeakMap,Oe=new WeakSet,mU=function(){b(this,jc)&&(requestAnimationFrame(()=>{this.scope&&b(this,eo).remote.play(new Ot("dom-connect"))}),j(this,jc,!1))},bU=function(){var n;b(this,jc)||(j(this,jc,!this.$state.paused()),(n=b(this,eo).$provider())==null||n.pause())},Dd=function(){k(this,Oe,Mx).call(this),j(this,e0,!1),b(this,$n).replaying=!1,b(this,$n).looping=!1,j(this,o0,!1),j(this,vs,void 0),b(this,Oo).clear()},ii=function(n,a){const l=b(this,$n).queue.serve(n);l&&(a.request=l,a.triggers.add(l))},gU=function(){k(this,Oe,O5).call(this),k(this,Oe,Dx).call(this);const n=b(this,eo).textTracks;new go(n).add("add",k(this,Oe,O5).bind(this)).add("remove",k(this,Oe,O5).bind(this)).add("mode-change",k(this,Oe,Dx).bind(this))},yU=function(){const n=b(this,eo).qualities;new go(n).add("add",k(this,Oe,Ox).bind(this)).add("remove",k(this,Oe,Ox).bind(this)).add("change",k(this,Oe,CU).bind(this)).add("auto-change",k(this,Oe,kU).bind(this)).add("readonly-change",k(this,Oe,xU).bind(this))},wU=function(){const n=b(this,eo).audioTracks;new go(n).add("add",k(this,Oe,_x).bind(this)).add("remove",k(this,Oe,_x).bind(this)).add("change",k(this,Oe,vU).bind(this))},O5=function(n){const{textTracks:a}=this.$state;a.set(b(this,eo).textTracks.toArray()),this.dispatch("text-tracks-change",{detail:a(),trigger:n})},Dx=function(n){n&&k(this,Oe,ii).call(this,"media-text-track-change-request",n);const a=b(this,eo).textTracks.selected,{textTrack:l}=this.$state;l()!==a&&(l.set(a),this.dispatch("text-track-change",{detail:a,trigger:n}))},_x=function(n){const{audioTracks:a}=this.$state;a.set(b(this,eo).audioTracks.toArray()),this.dispatch("audio-tracks-change",{detail:a(),trigger:n})},vU=function(n){const{audioTrack:a}=this.$state;a.set(b(this,eo).audioTracks.selected),n&&k(this,Oe,ii).call(this,"media-audio-track-change-request",n),this.dispatch("audio-track-change",{detail:a(),trigger:n})},Ox=function(n){const{qualities:a}=this.$state;a.set(b(this,eo).qualities.toArray()),this.dispatch("qualities-change",{detail:a(),trigger:n})},CU=function(n){const{quality:a}=this.$state;a.set(b(this,eo).qualities.selected),n&&k(this,Oe,ii).call(this,"media-quality-change-request",n),this.dispatch("quality-change",{detail:a(),trigger:n})},kU=function(){const{qualities:n}=b(this,eo),a=n.auto;this.$state.autoQuality.set(a),a||k(this,Oe,R5).call(this)},v2=new WeakMap,Rx=function(){k(this,Oe,R5).call(this),j(this,v2,ue(()=>{const{qualities:n}=b(this,eo),{mediaWidth:a,mediaHeight:l}=this.$state,s=a(),d=l();if(s===0||d===0)return;let p=null,h=1/0;for(const f of n){const y=Math.abs(f.width-s)+Math.abs(f.height-d);y<h&&(h=y,p=f)}p&&n[ft.select](p,!0,new Ot("resize",{detail:{width:s,height:d}}))}))},R5=function(){var n;(n=b(this,v2))==null||n.call(this),j(this,v2,null)},xU=function(){this.$state.canSetQuality.set(!b(this,eo).qualities.readonly)},SU=function(){const{canSetVolume:n,isGoogleCastConnected:a}=this.$state;if(a()){n.set(!1);return}Zve().then(n.set)},IU=function(n,a,l){let{qualities:s}=b(this,eo),d=!1,p=!1;for(const h of n){if(!Ev(h))continue;if(!a.some(y=>y.src===h.src)){const y=s.getBySrc(h.src);y&&(s[ft.remove](y,l),p=!0)}}p&&!s.length&&(this.$state.savedState.set(null),s[ft.reset](l));for(const h of a){if(!Ev(h)||s.getBySrc(h.src))continue;const f={id:h.id??h.height+"p",bitrate:null,codec:null,...h,selected:!1};s[ft.add](f,l),d=!0}d&&!s[ln.enableAuto]&&(k(this,Oe,Rx).call(this),s[ln.enableAuto]=k(this,Oe,Rx).bind(this),s[ln.setAuto](!0,l))},Bx=function(n,a=!1){const{audioTracks:l,qualities:s}=b(this,eo);if(!a){j(this,w2,[]),j(this,t0,[-1,-1]),l[ft.reset](n),s[ft.reset](n),f$(this.$state,a),k(this,Oe,Dd).call(this);return}f$(this.$state,a),k(this,Oe,Dd).call(this)},Lx=function(n){const{seekable:a,buffered:l,intrinsicDuration:s,canPlay:d}=this.$state;d.set(!0),l.set(n.buffered),a.set(n.seekable);const p=yp(n.seekable)??1/0;s.set(p)},Px=function(n){if(!Re(b(this,eo).$provider))return;const{ended:l,seekableStart:s,clipEndTime:d,currentTime:p,realCurrentTime:h,duration:f}=this.$state,y=l()||h()<s()||d()>0&&h()>=d()||Math.abs(p()-f())<.1;return y&&this.dispatch("media-seek-request",{detail:s(),trigger:n}),y},EU=function(){const{currentTime:n,played:a,paused:l}=this.$state;l()||(j(this,t0,sCe(b(this,w2),b(this,t0),n())),a.set(new Ti(b(this,w2))))},$x=function(n){const{clipStartTime:a,clipEndTime:l,duration:s}=this.$state;a()>0||l()>0||this.handle(this.createEvent("time-change",{detail:s(),trigger:n}))},TU=function(){var s;const{storage:n}=b(this,eo),{canPlay:a,realCurrentTime:l}=this.$state;a()&&((s=n==null?void 0:n.setTime)==null||s.call(n,l()))},C2=new WeakMap,AU=function(n){var h;const{storage:a}=b(this,eo),{paused:l,seeking:s,ended:d,duration:p}=this.$state;k(this,Oe,$x).call(this,n),l()||this.dispatch("pause",{trigger:n}),s()&&this.dispatch("seeked",{detail:p(),trigger:n}),d.set(!0),k(this,Oe,Dd).call(this),(h=a==null?void 0:a.setTime)==null||h.call(a,p(),!0),this.dispatch("ended",{trigger:n})},Mx=function(){b(this,C2).cancel(),this.$state.waiting.set(!1)};class hke extends vp{constructor(){super(...arguments);P(this,Wt)}onSetup(){k(this,Wt,DU).call(this);const n=[k(this,Wt,OU),k(this,Wt,BU),k(this,Wt,FU),k(this,Wt,qU),k(this,Wt,PU),k(this,Wt,MU),k(this,Wt,NU),k(this,Wt,VU),k(this,Wt,UU),k(this,Wt,zU),k(this,Wt,LU),k(this,Wt,jU),k(this,Wt,$U),k(this,Wt,_U),k(this,Wt,RU)];for(const a of n)ue(a.bind(this))}}Wt=new WeakSet,DU=function(){var l;const n={duration:"providedDuration",loop:"providedLoop",poster:"providedPoster",streamType:"providedStreamType",title:"providedTitle",viewType:"providedViewType"},a=new Set(["currentTime","paused","playbackRate","volume"]);for(const s of Object.keys(this.$props))a.has(s)||(l=this.$state[n[s]??s])==null||l.set(this.$props[s]());this.$state.muted.set(this.$props.muted()||this.$props.volume()===0)},_U=function(){const{viewType:n,streamType:a,title:l,poster:s,loop:d}=this.$props,p=this.$state;p.providedPoster.set(s()),p.providedStreamType.set(a()),p.providedViewType.set(n()),p.providedTitle.set(l()),p.providedLoop.set(d())},zKe=function(){},OU=function(){const{artist:n,artwork:a}=this.$props;this.$state.artist.set(n()),this.$state.artwork.set(a())},RU=function(){const{title:n}=this.$state;this.dispatch("title-change",{detail:n()})},BU=function(){const n=this.$props.autoPlay()||this.$props.autoplay();this.$state.autoPlay.set(n),this.dispatch("auto-play-change",{detail:n})},LU=function(){const n=this.$state.loop();this.dispatch("loop-change",{detail:n})},PU=function(){const n=this.$props.controls();this.$state.controls.set(n)},$U=function(){const{poster:n}=this.$state;this.dispatch("poster-change",{detail:n()})},MU=function(){const n=this.$props.crossOrigin()??this.$props.crossorigin(),a=n===!0?"":n;this.$state.crossOrigin.set(a)},NU=function(){const{duration:n}=this.$props;this.dispatch("media-duration-change-request",{detail:n()})},jU=function(){const n=this.$props.playsInline()||this.$props.playsinline();this.$state.playsInline.set(n),this.dispatch("plays-inline-change",{detail:n})},FU=function(){const{clipStartTime:n}=this.$props;this.dispatch("media-clip-start-change-request",{detail:n()})},qU=function(){const{clipEndTime:n}=this.$props;this.dispatch("media-clip-end-change-request",{detail:n()})},VU=function(){this.dispatch("live-change",{detail:this.$state.live()})},zU=function(){this.$state.liveEdgeTolerance.set(this.$props.liveEdgeTolerance()),this.$state.minLiveDVRWindow.set(this.$props.minLiveDVRWindow())},UU=function(){this.dispatch("live-edge-change",{detail:this.$state.liveEdge()})};const C$=["play","pause","seekforward","seekbackward","seekto"];class fke extends vp{constructor(){super(...arguments);P(this,pl)}onConnect(){ue(k(this,pl,KU).bind(this)),ue(k(this,pl,GU).bind(this));const n=k(this,pl,WU).bind(this);for(const a of C$)navigator.mediaSession.setActionHandler(a,n);At(k(this,pl,HU).bind(this))}}pl=new WeakSet,HU=function(){for(const n of C$)navigator.mediaSession.setActionHandler(n,null)},KU=function(){const{title:n,artist:a,artwork:l,poster:s}=this.$state;navigator.mediaSession.metadata=new MediaMetadata({title:n(),artist:a(),artwork:l()??[{src:s()}]})},GU=function(){const{canPlay:n,paused:a}=this.$state;navigator.mediaSession.playbackState=n()?a()?"paused":"playing":"none"},WU=function(n){const a=new Ot("media-session-action",{detail:n});switch(n.action){case"play":this.dispatch("media-play-request",{trigger:a});break;case"pause":this.dispatch("media-pause-request",{trigger:a});break;case"seekto":case"seekforward":case"seekbackward":this.dispatch("media-seek-request",{detail:Li(n.seekTime)?n.seekTime:this.$state.currentTime()+(n.seekOffset??(n.action==="seekforward"?10:-10)),trigger:a});break}};const n0=class n0 extends dt{constructor(){super();P(this,He);P(this,pn);P(this,i0);P(this,un);V(this,"canPlayQueue",new w$);V(this,"remoteControl");P(this,k2,!1);V(this,"orientation");new hke;const n={player:this,qualities:new UCe,audioTracks:new FCe,storage:null,$provider:ct(null),$providerSetup:ct(!1),$props:this.$props,$state:this.$state};n.remote=this.remoteControl=new NCe(void 0),n.remote.setPlayer(this),n.textTracks=new zCe,n.textTracks[kt.crossOrigin]=this.$state.crossOrigin,n.textRenderers=new VCe(n),n.ariaKeys={},j(this,pn,n),ma(HP,n),this.orientation=new Vg,new lr,new YCe(n);const a=new dke;j(this,i0,new uke(a,n)),j(this,un,new ske(b(this,i0),a,n)),n.delegate=new rke(b(this,i0).handle.bind(b(this,i0)),n),n.notify=n.delegate.notify.bind(n.delegate),typeof navigator<"u"&&"mediaSession"in navigator&&new fke,new y$("load",this.startLoading.bind(this)),new y$("posterLoad",this.startLoadingPoster.bind(this))}onSetup(){k(this,He,QU).call(this),ue(k(this,He,XU).bind(this)),ue(k(this,He,tH).bind(this)),ue(k(this,He,eH).bind(this)),ue(k(this,He,iH).bind(this)),ue(k(this,He,oH).bind(this)),ue(k(this,He,aH).bind(this)),ue(k(this,He,nH).bind(this))}onAttach(n){n.setAttribute("data-media-player",""),bo(n,"tabindex","0"),bo(n,"role","region"),ue(k(this,He,lH).bind(this)),ue(k(this,He,ZU).bind(this)),ue(k(this,He,YU).bind(this)),uo(n,"find-media-player",k(this,He,JU).bind(this))}onConnect(n){KP&&Ge(n,"data-iphone","");const a=window.matchMedia("(pointer: coarse)");k(this,He,Nx).call(this,a),a.onchange=k(this,He,Nx).bind(this);const l=new ResizeObserver(Pu(k(this,He,A3).bind(this)));l.observe(n),ue(k(this,He,A3).bind(this)),this.dispatch("media-player-connect",{detail:this,bubbles:!0,composed:!0}),At(()=>{l.disconnect(),a.onchange=null})}onDestroy(){b(this,pn).player=null,this.canPlayQueue.reset()}get provider(){return b(this,He,Aa)}get controls(){return b(this,un).controls}set controls(n){b(this,He,B5).controls.set(n)}get title(){return Re(this.$state.title)}set title(n){if(b(this,k2)){j(this,k2,!1);return}b(this,He,B5).title.set(n)}get qualities(){return b(this,pn).qualities}get audioTracks(){return b(this,pn).audioTracks}get textTracks(){return b(this,pn).textTracks}get textRenderers(){return b(this,pn).textRenderers}get duration(){return this.$state.duration()}set duration(n){b(this,He,B5).duration.set(n)}get paused(){return Re(this.$state.paused)}set paused(n){k(this,He,jx).call(this,n)}get muted(){return Re(this.$state.muted)}set muted(n){k(this,He,Fx).call(this,n)}get currentTime(){return Re(this.$state.currentTime)}set currentTime(n){k(this,He,qx).call(this,n)}get volume(){return Re(this.$state.volume)}set volume(n){k(this,He,Vx).call(this,n)}get playbackRate(){return Re(this.$state.playbackRate)}set playbackRate(n){k(this,He,zx).call(this,n)}async play(n){return b(this,un).play(n)}async pause(n){return b(this,un).pause(n)}async enterFullscreen(n,a){return b(this,un).enterFullscreen(n,a)}async exitFullscreen(n,a){return b(this,un).exitFullscreen(n,a)}enterPictureInPicture(n){return b(this,un).enterPictureInPicture(n)}exitPictureInPicture(n){return b(this,un).exitPictureInPicture(n)}seekToLiveEdge(n){b(this,un).seekToLiveEdge(n)}startLoading(n){b(this,pn).notify("can-load",void 0,n)}startLoadingPoster(n){b(this,pn).notify("can-load-poster",void 0,n)}requestAirPlay(n){return b(this,un).requestAirPlay(n)}requestGoogleCast(n){return b(this,un).requestGoogleCast(n)}setAudioGain(n,a){return b(this,un).setAudioGain(n,a)}destroy(){super.destroy(),b(this,pn).remote.setPlayer(null),this.dispatch("destroy")}};pn=new WeakMap,i0=new WeakMap,un=new WeakMap,He=new WeakSet,Aa=function(){return b(this,pn).$provider()},B5=function(){return this.$props},k2=new WeakMap,ZU=function(){const n=this.$el,{title:a,live:l,viewType:s,providedTitle:d}=this.$state,p=l(),h=Ave(s()),f=h!=="Unknown"?`${p?"Live ":""}${h}`:p?"Live":"Media",y=a();Ge(this.el,"aria-label",`${f} Player`+(y?` - ${y}`:"")),n!=null&&n.hasAttribute("title")&&(j(this,k2,!0),n==null||n.removeAttribute("title"))},YU=function(){const n=this.orientation.landscape?"landscape":"portrait";this.$state.orientation.set(n),Ge(this.el,"data-orientation",n),k(this,He,A3).call(this)},XU=function(){this.$state.canPlay()&&b(this,He,Aa)?this.canPlayQueue.start():this.canPlayQueue.stop()},QU=function(){if(n0[_v]){this.setAttributes(n0[_v]);return}const n={"data-load":function(){return this.$props.load()},"data-captions":function(){const l=this.$state.textTrack();return!!l&&xn(l)},"data-ios-controls":function(){return this.$state.iOSControls()},"data-controls":function(){return this.controls.showing},"data-buffering":function(){const{canLoad:l,canPlay:s,waiting:d}=this.$state;return l()&&(!s()||d())},"data-error":function(){const{error:l}=this.$state;return!!l()},"data-autoplay-error":function(){const{autoPlayError:l}=this.$state;return!!l()}},a={autoPlay:"autoplay",canAirPlay:"can-airplay",canPictureInPicture:"can-pip",pictureInPicture:"pip",playsInline:"playsinline",remotePlaybackState:"remote-state",remotePlaybackType:"remote-type",isAirPlayConnected:"airplay",isGoogleCastConnected:"google-cast"};for(const l of nke){const s="data-"+(a[l]??Og(l));n[s]=function(){return this.$state[l]()}}delete n.title,n0[_v]=n,this.setAttributes(n)},JU=function(n){n.detail(this)},A3=function(){if(!this.el)return;const n=this.el.clientWidth,a=this.el.clientHeight;this.$state.width.set(n),this.$state.height.set(a),Zn(this.el,"--player-width",n+"px"),Zn(this.el,"--player-height",a+"px")},Nx=function(n){const a=n.matches?"coarse":"fine";Ge(this.el,"data-pointer",a),this.$state.pointer.set(a),k(this,He,A3).call(this)},eH=function(){k(this,He,jx).call(this,this.$props.paused())},jx=function(n){n?this.canPlayQueue.enqueue("paused",()=>b(this,un).pause()):this.canPlayQueue.enqueue("paused",()=>b(this,un).play())},tH=function(){k(this,He,Fx).call(this,this.$props.muted())},Fx=function(n){this.canPlayQueue.enqueue("muted",()=>{b(this,He,Aa)&&b(this,He,Aa).setMuted(n)})},oH=function(){k(this,He,qx).call(this,this.$props.currentTime())},qx=function(n){this.canPlayQueue.enqueue("currentTime",()=>{const{currentTime:a}=this.$state;n!==Re(a)&&Re(()=>{if(!b(this,He,Aa))return;const l=m$(n,this.$state);Number.isFinite(l)&&b(this,He,Aa).setCurrentTime(l)})})},iH=function(){k(this,He,Vx).call(this,this.$props.volume())},Vx=function(n){const a=xv(0,n,1);this.canPlayQueue.enqueue("volume",()=>{b(this,He,Aa)&&b(this,He,Aa).setVolume(a)})},nH=function(){k(this,He,zx).call(this,this.$props.playbackRate())},zx=function(n){this.canPlayQueue.enqueue("rate",()=>{var a,l;b(this,He,Aa)&&((l=(a=b(this,He,Aa)).setPlaybackRate)==null||l.call(a,n))})},aH=function(){k(this,He,rH).call(this,this.$props.playsInline())},rH=function(n){this.canPlayQueue.enqueue("playsinline",()=>{var a,l;b(this,He,Aa)&&((l=(a=b(this,He,Aa)).setPlaysInline)==null||l.call(a,n))})},lH=function(){var l;let n=this.$props.storage(),a=Je(n)?new jCe:n;if(a!=null&&a.onChange){const{source:s}=this.$state,d=Je(n)?n:(l=this.el)==null?void 0:l.id,p=rr(k(this,He,sH).bind(this));ue(()=>a.onChange(s(),p(),d||void 0))}b(this,pn).storage=a,b(this,pn).textTracks.setStorage(a),At(()=>{var s;(s=a==null?void 0:a.onDestroy)==null||s.call(a),b(this,pn).storage=null,b(this,pn).textTracks.setStorage(null)})},sH=function(){const{clipStartTime:n,clipEndTime:a}=this.$props,{source:l}=this.$state,s=l();return s.src?`${s.src}:${n()}:${a()}`:null},V(n0,"props",ake),V(n0,"state",u$);let zg=n0;const To=zg.prototype;$t(To,"canPlayQueue"),$t(To,"remoteControl"),$t(To,"provider"),$t(To,"controls"),$t(To,"orientation"),$t(To,"title"),$t(To,"qualities"),$t(To,"audioTracks"),$t(To,"textTracks"),$t(To,"textRenderers"),$t(To,"duration"),$t(To,"paused"),$t(To,"muted"),$t(To,"currentTime"),$t(To,"volume"),$t(To,"playbackRate"),ei(To,"play"),ei(To,"pause"),ei(To,"enterFullscreen"),ei(To,"exitFullscreen"),ei(To,"enterPictureInPicture"),ei(To,"exitPictureInPicture"),ei(To,"seekToLiveEdge"),ei(To,"startLoading"),ei(To,"startLoadingPoster"),ei(To,"requestAirPlay"),ei(To,"requestGoogleCast"),ei(To,"setAudioGain");function mke(i,o){return fetch(i,o).then(n=>n.text()).then(n=>/type="static"/.test(n)?"on-demand":"live")}function k$(i,o){return fetch(i,o).then(n=>n.text()).then(n=>{const a=bke(n);if(a)return k$(/^https?:/.test(a)?a:new URL(a,i).href,o);const l=/EXT-X-PLAYLIST-TYPE:\s*VOD/.test(n)?"on-demand":"live";return l==="live"&&gke(n)>=10&&(/#EXT-X-DVR-ENABLED:\s*true/.test(n)||n.includes("#EXT-X-DISCONTINUITY"))?"live:dvr":l})}function bke(i){const o=i.match(/#EXT-X-STREAM-INF:[^\n]+(\n[^\n]+)*/g);return o?o[0].split(`
|
|
3139
3139
|
`)[1].trim():null}function gke(i){const o=i.split(`
|
|
3140
3140
|
`);for(const n of o)if(n.startsWith("#EXT-X-TARGETDURATION")){const a=parseFloat(n.split(":")[1]);if(!isNaN(a))return a}return-1}const Rv=new Map;class yke{constructor(o,n,a,l=[]){P(this,Si);P(this,x2,!1);P(this,S2);P(this,km);P(this,to);P(this,Cs);j(this,km,o),j(this,to,n),j(this,Cs,a);const s=new Dv,d=new Av,p=new Tv,h=new tke,f=new ike,y=new oke,w=[f,y];j(this,S2,rr(()=>{const C=n.$state.remotePlaybackLoader(),E=n.$props.preferNativeHLS()?[p,h,s,d,...w,...l]:[d,p,h,s,...w,...l];return C?[C,...E]:E}));const{$state:v}=n;v.sources.set(x$(n.$props.src()));for(const C of v.sources()){const E=b(this,S2).call(this).find(A=>A.canPlay(C));if(!E)continue;const T=E.mediaType(C);n.$state.source.set(C),n.$state.mediaType.set(T),n.$state.inferredViewType.set(T),b(this,Cs).set(E),j(this,x2,!0);break}}connect(){const o=b(this,Cs).call(this);b(this,x2)&&(k(this,Si,Hx).call(this,b(this,to).$state.source(),o),k(this,Si,Kx).call(this,o),j(this,x2,!1)),ue(k(this,Si,cH).bind(this)),ue(k(this,Si,dH).bind(this)),ue(k(this,Si,pH).bind(this)),ue(k(this,Si,uH).bind(this)),ue(k(this,Si,hH).bind(this))}}x2=new WeakMap,S2=new WeakMap,km=new WeakMap,to=new WeakMap,Cs=new WeakMap,Si=new WeakSet,cH=function(){b(this,to).notify("sources-change",[...x$(b(this,to).$props.src()),...b(this,km).call(this)])},dH=function(){var d;const{$state:o}=b(this,to),n=o.sources(),a=Re(o.source),l=k(this,Si,Ux).call(this,a,n);if(((d=n[0])==null?void 0:d.src)&&!l.src&&!l.type){const{crossOrigin:p}=o,h=Lh(p()),f=new AbortController;return Promise.all(n.map(y=>Je(y.src)&&y.type==="?"?fetch(y.src,{method:"HEAD",credentials:h,signal:f.signal}).then(w=>(y.type=w.headers.get("content-type")||"??",Rv.set(y.src,y.type),y)).catch(()=>y):y)).then(y=>{if(f.signal.aborted)return;const w=k(this,Si,Ux).call(this,Re(o.source),y);es(),w.src||b(this,to).notify("error",{message:"Failed to load resource.",code:4})}),()=>f.abort()}es()},Ux=function(o,n){let a={src:"",type:""},l=null,s=new Ot("sources-change",{detail:{sources:n}}),d=b(this,S2).call(this),{started:p,paused:h,currentTime:f,quality:y,savedState:w}=b(this,to).$state;for(const v of n){const C=d.find(E=>E.canPlay(v));if(C){a=v,l=C;break}}if(Ev(a)){const v=y(),C=n.find(E=>E.src===(v==null?void 0:v.src));Re(p)?w.set({paused:Re(h),currentTime:Re(f)}):w.set(null),C&&(a=C,s=new Ot("quality-change",{detail:{quality:v}}))}return I$(o,a)||k(this,Si,Hx).call(this,a,l,s),l!==Re(b(this,Cs))&&k(this,Si,Kx).call(this,l,s),a},Hx=function(o,n,a){b(this,to).notify("source-change",o,a),b(this,to).notify("media-type-change",(n==null?void 0:n.mediaType(o))||"unknown",a)},Kx=function(o,n){b(this,to).$providerSetup.set(!1),b(this,to).notify("provider-change",null,n),o&&Re(()=>{var a;return(a=o.preconnect)==null?void 0:a.call(o,b(this,to))}),b(this,Cs).set(o),b(this,to).notify("provider-loader-change",o,n)},pH=function(){const o=b(this,to).$provider();if(!(!o||Re(b(this,to).$providerSetup))){if(b(this,to).$state.canLoad()){kn(()=>o.setup(),o.scope),b(this,to).$providerSetup.set(!0);return}Re(()=>{var n;return(n=o.preconnect)==null?void 0:n.call(o)})}},uH=function(){if(!b(this,to).$providerSetup())return;const o=b(this,to).$provider(),n=b(this,to).$state.source(),a=Re(b(this,to).$state.crossOrigin),l=Re(b(this,to).$props.preferNativeHLS);if(!I$(o==null?void 0:o.currentSrc,n)){if(b(this,to).$state.canLoad()){const s=new AbortController;return $u(n)?(l||!Ng())&&k$(n.src,{credentials:Lh(a),signal:s.signal}).then(d=>{b(this,to).notify("stream-type-change",d)}).catch(Ag):fv(n)?mke(n.src,{credentials:Lh(a),signal:s.signal}).then(d=>{b(this,to).notify("stream-type-change",d)}).catch(Ag):b(this,to).notify("stream-type-change","on-demand"),Re(()=>{const d=Re(b(this,to).$state.preload);return o==null?void 0:o.loadSource(n,d).catch(p=>{})}),()=>s.abort()}try{Je(n.src)&&os(new URL(n.src).origin)}catch{}}},hH=function(){const o=b(this,Cs).call(this),{providedPoster:n,source:a,canLoadPoster:l}=b(this,to).$state;if(!o||!o.loadPoster||!a()||!l()||n())return;const s=new AbortController,d=new Ot("source-change",{detail:a});return o.loadPoster(a(),b(this,to),s).then(p=>{b(this,to).notify("poster-change",p||"",d)}).catch(()=>{b(this,to).notify("poster-change","",d)}),()=>{s.abort()}};function x$(i){return(rn(i)?i:[i]).map(o=>Je(o)?{src:o,type:S$(o)}:{...o,type:S$(o.src,o.type)})}function S$(i,o){return Je(o)&&o.length?o:Je(i)&&Rv.has(i)?Rv.get(i):!o&&$u({src:i,type:""})?"application/x-mpegurl":!o&&fv({src:i,type:""})?"application/dash+xml":!Je(i)||i.startsWith("blob:")?"video/object":i.includes("youtube")||i.includes("youtu.be")?"video/youtube":i.includes("vimeo")&&!i.includes("progressive_redirect")&&!i.includes(".m3u8")?"video/vimeo":"?"}function I$(i,o){return(i==null?void 0:i.src)===(o==null?void 0:o.src)&&(i==null?void 0:i.type)===(o==null?void 0:o.type)}class wke{constructor(o,n){P(this,J4);P(this,xm);P(this,Fc);P(this,Sm,[]);j(this,xm,o),j(this,Fc,n),ue(k(this,J4,fH).bind(this))}}xm=new WeakMap,Fc=new WeakMap,Sm=new WeakMap,J4=new WeakSet,fH=function(){const o=b(this,xm).call(this);for(const n of b(this,Sm))if(!o.some(a=>a.id===n.id)){const a=n.id&&b(this,Fc).textTracks.getById(n.id);a&&b(this,Fc).textTracks.remove(a)}for(const n of o){const a=n.id||hc.createId(n);b(this,Fc).textTracks.getById(a)||(n.id=a,b(this,Fc).textTracks.add(n))}j(this,Sm,o)};class Ug extends dt{constructor(){super(...arguments);P(this,Ia);P(this,mr);P(this,Im);P(this,Em,ct([]));P(this,Tm,ct([]));P(this,I2,null);P(this,E2,-1)}onSetup(){j(this,mr,Rt()),j(this,Im,new yke(b(this,Em),b(this,mr),this.$state.loader,this.$props.loaders()))}onAttach(n){n.setAttribute("data-media-provider","")}onConnect(n){b(this,Im).connect(),new wke(b(this,Tm),b(this,mr));const a=new ResizeObserver(Pu(k(this,Ia,Wx).bind(this)));a.observe(n);const l=new MutationObserver(k(this,Ia,Zx).bind(this));l.observe(n,{attributes:!0,childList:!0}),k(this,Ia,Wx).call(this),k(this,Ia,Zx).call(this),At(()=>{a.disconnect(),l.disconnect()})}load(n){n==null||n.setAttribute("aria-hidden","true"),window.cancelAnimationFrame(b(this,E2)),j(this,E2,requestAnimationFrame(()=>k(this,Ia,mH).call(this,n))),At(()=>{window.cancelAnimationFrame(b(this,E2))})}onDestroy(){j(this,I2,null),k(this,Ia,Gx).call(this)}}mr=new WeakMap,Im=new WeakMap,Em=new WeakMap,Tm=new WeakMap,I2=new WeakMap,E2=new WeakMap,Ia=new WeakSet,mH=function(n){if(!this.scope)return;const a=this.$state.loader(),{$provider:l}=b(this,mr);b(this,I2)===a&&(a==null?void 0:a.target)===n&&Re(l)||(k(this,Ia,Gx).call(this),j(this,I2,a),a&&(a.target=n||null),!(!a||!n)&&a.load(b(this,mr)).then(s=>{this.scope&&Re(this.$state.loader)===a&&b(this,mr).notify("provider-change",s)}))},Gx=function(){var n;(n=b(this,mr))==null||n.notify("provider-change",null)},Wx=function(){if(!this.el)return;const{player:n,$state:a}=b(this,mr),l=this.el.offsetWidth,s=this.el.offsetHeight;n&&(a.mediaWidth.set(l),a.mediaHeight.set(s),n.el&&(Zn(n.el,"--media-width",l+"px"),Zn(n.el,"--media-height",s+"px")))},Zx=function(){const n=[],a=[],l=this.el.children;for(const s of l)if(!s.hasAttribute("data-vds")){if(s instanceof HTMLSourceElement){const d={id:s.id,src:s.src,type:s.type};for(const p of["id","src","width","height","bitrate","codec"]){const h=s.getAttribute(`data-${p}`);Je(h)&&(d[p]=/id|src|codec/.test(p)?h:Number(h))}n.push(d)}else if(s instanceof HTMLTrackElement){const d={src:s.src,kind:s.track.kind,language:s.srclang,label:s.label,default:s.default,type:s.getAttribute("data-type")};a.push({id:s.id||hc.createId(d),...d})}}b(this,Em).set(n),b(this,Tm).set(a),es()},V(Ug,"props",{loaders:[]}),V(Ug,"state",new pc({loader:null}));const vke=Ug.prototype;ei(vke,"load");class E$ extends pt(HTMLElement,Ug){constructor(){super(...arguments);P(this,ul);P(this,ks);P(this,hn,null);P(this,ta,null)}onSetup(){j(this,ks,Rt()),this.setAttribute("keep-alive","")}onDestroy(){var n,a;(n=b(this,ta))==null||n.remove(),j(this,ta,null),(a=b(this,hn))==null||a.remove(),j(this,hn,null)}onConnect(){ue(()=>{var h,f,y;const n=this.$state.loader(),a=(n==null?void 0:n.name)==="youtube",l=(n==null?void 0:n.name)==="vimeo",s=a||l,d=(n==null?void 0:n.name)==="google-cast",p=n?d?k(this,ul,wH).call(this):s?k(this,ul,yH).call(this):n.mediaType()==="audio"?k(this,ul,bH).call(this):k(this,ul,gH).call(this):null;if(b(this,hn)!==p){const w=((h=b(this,hn))==null?void 0:h.parentElement)??this;(f=b(this,hn))==null||f.remove(),j(this,hn,p),p&&w.prepend(p),s&&p&&ue(()=>{var I;const{nativeControls:v,viewType:C}=b(this,ks).$state,E=v(),T=C()==="audio";!E&&!T?(j(this,ta,this.querySelector(".vds-blocker")),b(this,ta)||(j(this,ta,document.createElement("div")),b(this,ta).classList.add("vds-blocker"),p.after(b(this,ta)))):((I=b(this,ta))==null||I.remove(),j(this,ta,null)),Ge(p,"data-no-controls",!E)})}a?p==null||p.classList.add("vds-youtube"):l&&(p==null||p.classList.add("vds-vimeo")),s||((y=b(this,ta))==null||y.remove(),j(this,ta,null)),this.load(p)})}}ks=new WeakMap,hn=new WeakMap,ta=new WeakMap,ul=new WeakSet,bH=function(){const n=b(this,hn)instanceof HTMLAudioElement?b(this,hn):document.createElement("audio"),{controls:a,crossOrigin:l}=b(this,ks).$state;return ue(()=>{Ge(n,"controls",a()),Ge(n,"crossorigin",l())}),n},gH=function(){const n=b(this,hn)instanceof HTMLVideoElement?b(this,hn):document.createElement("video"),{crossOrigin:a,poster:l,nativeControls:s}=b(this,ks).$state,d=rr(()=>s()?"true":null),p=rr(()=>l()&&s()?l():null);return ue(()=>{Ge(n,"controls",d()),Ge(n,"crossorigin",a()),Ge(n,"poster",p())}),n},yH=function(){const n=b(this,hn)instanceof HTMLIFrameElement?b(this,hn):document.createElement("iframe"),{nativeControls:a}=b(this,ks).$state;return ue(()=>Ge(n,"tabindex",a()?null:-1)),n},wH=function(){var a;if((a=b(this,hn))!=null&&a.classList.contains("vds-google-cast"))return b(this,hn);const n=document.createElement("div");return n.classList.add("vds-google-cast"),Promise.resolve().then(()=>EKe).then(({insertContent:l})=>{l(n,b(this,ks).$state)}),n},V(E$,"tagName","media-provider");class Bv extends pt(HTMLElement,zg){}V(Bv,"tagName","media-player"),V(Bv,"attrs",{autoPlay:"autoplay",crossOrigin:"crossorigin",playsInline:"playsinline",preferNativeHLS:"prefer-native-hls",minLiveDVRWindow:"min-live-dvr-window"}),lt(Bv),lt(E$);function T$(i,o){return[...i].sort(o?kke:Cke)}function Cke(i,o){return i.height===o.height?(i.bitrate??0)-(o.bitrate??0):i.height-o.height}function kke(i,o){return o.height===i.height?(o.bitrate??0)-(i.bitrate??0):o.height-i.height}class xke extends Pa{constructor(n){super();P(this,a0);j(this,a0,n)}onAttach(n){const{$props:a,ariaKeys:l}=Rt(),s=n.getAttribute("aria-keyshortcuts");if(s){l[b(this,a0)]=s,At(()=>{delete l[b(this,a0)]});return}const d=a.keyShortcuts()[b(this,a0)];if(d){const p=rn(d)?d.join(" "):Je(d)?d:d==null?void 0:d.keys;n.setAttribute("aria-keyshortcuts",rn(p)?p.join(" "):p)}}}a0=new WeakMap;function Lv(i,o){const n=String(i),a=n.length;if(a<o){const s=o-a;return`${"0".repeat(s)}${i}`}return n}function A$(i){const o=Math.trunc(i/3600),n=Math.trunc(i%3600/60),a=Math.trunc(i%60),l=Number((i-Math.trunc(i)).toPrecision(3));return{hours:o,minutes:n,seconds:a,fraction:l}}function Hg(i,{padHrs:o=null,padMins:n=null,showHrs:a=!1,showMs:l=!1}={}){const{hours:s,minutes:d,seconds:p,fraction:h}=A$(i),f=o?Lv(s,2):s,y=n||Yr(n)&&i>=3600?Lv(d,2):d,w=Lv(p,2),v=l&&h>0?`.${String(h).replace(/^0?\./,"")}`:"",C=`${y}:${w}${v}`;return s>0||a?`${f}:${C}`:C}function Kg(i){const o=[],{hours:n,minutes:a,seconds:l}=A$(i);return n>0&&o.push(`${n} hour`),a>0&&o.push(`${a} min`),(l>0||o.length===0)&&o.push(`${l} sec`),o.join(" ")}class D$ extends Pa{constructor(n){super();P(this,qc);P(this,br);P(this,r0,-1);P(this,l0,-1);P(this,hl,null);j(this,br,n),ue(k(this,qc,vH).bind(this))}onDestroy(){var n;(n=b(this,hl))==null||n.call(this),j(this,hl,null)}show(n){var a,l,s;k(this,qc,L5).call(this),window.cancelAnimationFrame(b(this,l0)),j(this,l0,-1),(a=b(this,hl))==null||a.call(this),j(this,hl,null),j(this,r0,window.setTimeout(()=>{j(this,r0,-1);const d=b(this,br).content();d&&d.style.removeProperty("display"),Re(()=>b(this,br).onChange(!0,n))},((s=(l=b(this,br)).showDelay)==null?void 0:s.call(l))??0))}hide(n){k(this,qc,L5).call(this),Re(()=>b(this,br).onChange(!1,n)),j(this,l0,requestAnimationFrame(()=>{var l;k(this,qc,L5).call(this),j(this,l0,-1);const a=b(this,br).content();if(a){const s=()=>{a.style.display="none",j(this,hl,null)};if(BCe(a)){(l=b(this,hl))==null||l.call(this);const p=uo(a,"animationend",s,{once:!0});j(this,hl,p)}else s()}}))}}br=new WeakMap,qc=new WeakSet,vH=function(){const n=b(this,br).trigger();if(!n){this.hide();return}const a=this.show.bind(this),l=this.hide.bind(this);b(this,br).listen(n,a,l)},r0=new WeakMap,l0=new WeakMap,hl=new WeakMap,L5=function(){window.clearTimeout(b(this,r0)),j(this,r0,-1)};class Sn extends Pa{constructor(n){super();P(this,fl);P(this,xs);j(this,xs,n),new lr,n.keyShortcut&&new xke(n.keyShortcut)}onSetup(){const{disabled:n}=this.$props;this.setAttributes({"data-pressed":b(this,xs).isPresssed,"aria-pressed":k(this,fl,CH).bind(this),"aria-disabled":()=>n()?"true":null})}onAttach(n){bo(n,"tabindex","0"),bo(n,"role","button"),bo(n,"type","button")}onConnect(n){const a=mc(n,k(this,fl,xH).bind(this));for(const l of["click","touchstart"])a.add(l,k(this,fl,SH).bind(this),{passive:!0})}}xs=new WeakMap,fl=new WeakSet,CH=function(){return Rg(b(this,xs).isPresssed())},kH=function(n){kve(b(this,xs).isPresssed)&&b(this,xs).isPresssed.set(a=>!a)},xH=function(n){if(this.$props.disabled()||this.el.hasAttribute("data-disabled")){n.preventDefault(),n.stopImmediatePropagation();return}n.preventDefault(),(b(this,xs).onPress??k(this,fl,kH)).call(this,n)},SH=function(n){this.$props.disabled()&&(n.preventDefault(),n.stopImmediatePropagation())},V(Sn,"props",{disabled:!1});class _$ extends dt{constructor(){super();P(this,ml);P(this,Ss);new Sn({isPresssed:k(this,ml,EH).bind(this),onPress:k(this,ml,IH).bind(this)})}onSetup(){j(this,Ss,Rt());const{canAirPlay:n,isAirPlayConnected:a}=b(this,Ss).$state;this.setAttributes({"data-active":a,"data-supported":n,"data-state":k(this,ml,TH).bind(this),"aria-hidden":sn(()=>!n())})}onAttach(n){n.setAttribute("data-media-tooltip","airplay"),fc(n,k(this,ml,AH).bind(this))}}Ss=new WeakMap,ml=new WeakSet,IH=function(n){b(this,Ss).remote.requestAirPlay(n)},EH=function(){const{remotePlaybackType:n,remotePlaybackState:a}=b(this,Ss).$state;return n()==="airplay"&&a()!=="disconnected"},TH=function(){const{remotePlaybackType:n,remotePlaybackState:a}=b(this,Ss).$state;return n()==="airplay"&&a()},AH=function(){const{remotePlaybackState:n}=b(this,Ss).$state;return`AirPlay ${n()}`},V(_$,"props",Sn.props);class O$ extends dt{constructor(){super();P(this,c0);P(this,s0);new Sn({isPresssed:k(this,c0,Yx).bind(this),keyShortcut:"togglePaused",onPress:k(this,c0,DH).bind(this)})}onSetup(){j(this,s0,Rt());const{paused:n,ended:a}=b(this,s0).$state;this.setAttributes({"data-paused":n,"data-ended":a})}onAttach(n){n.setAttribute("data-media-tooltip","play"),fc(n,"Play")}}s0=new WeakMap,c0=new WeakSet,DH=function(n){const a=b(this,s0).remote;k(this,c0,Yx).call(this)?a.pause(n):a.play(n)},Yx=function(){const{paused:n}=b(this,s0).$state;return!n()},V(O$,"props",Sn.props);class R$ extends dt{constructor(){super();P(this,bl);P(this,d0);new Sn({isPresssed:k(this,bl,Xx).bind(this),keyShortcut:"toggleCaptions",onPress:k(this,bl,_H).bind(this)})}onSetup(){j(this,d0,Rt()),this.setAttributes({"data-active":k(this,bl,Xx).bind(this),"data-supported":()=>!k(this,bl,Qx).call(this),"aria-hidden":sn(k(this,bl,Qx).bind(this))})}onAttach(n){n.setAttribute("data-media-tooltip","caption"),fc(n,"Captions")}}d0=new WeakMap,bl=new WeakSet,_H=function(n){b(this,d0).remote.toggleCaptions(n)},Xx=function(){const{textTrack:n}=b(this,d0).$state,a=n();return!!a&&xn(a)},Qx=function(){const{hasCaptions:n}=b(this,d0).$state;return!n()},V(R$,"props",Sn.props);let Ske=(Wk=class extends dt{constructor(){super();P(this,Is);P(this,Vc);new Sn({isPresssed:k(this,Is,Jx).bind(this),keyShortcut:"toggleFullscreen",onPress:k(this,Is,OH).bind(this)})}onSetup(){j(this,Vc,Rt());const{fullscreen:n}=b(this,Vc).$state,a=k(this,Is,RH).bind(this);this.setAttributes({"data-active":n,"data-supported":a,"aria-hidden":sn(()=>!a())})}onAttach(n){n.setAttribute("data-media-tooltip","fullscreen"),fc(n,"Fullscreen")}},Vc=new WeakMap,Is=new WeakSet,OH=function(n){const a=b(this,Vc).remote,l=this.$props.target();k(this,Is,Jx).call(this)?a.exitFullscreen(l,n):a.enterFullscreen(l,n)},Jx=function(){const{fullscreen:n}=b(this,Vc).$state;return n()},RH=function(){const{canFullscreen:n}=b(this,Vc).$state;return n()},V(Wk,"props",{...Sn.props,target:"prefer-media"}),Wk);class B$ extends dt{constructor(){super();P(this,gl);P(this,p0);new Sn({isPresssed:k(this,gl,P5).bind(this),keyShortcut:"toggleMuted",onPress:k(this,gl,BH).bind(this)})}onSetup(){j(this,p0,Rt()),this.setAttributes({"data-muted":k(this,gl,P5).bind(this),"data-state":k(this,gl,LH).bind(this)})}onAttach(n){n.setAttribute("data-media-mute-button",""),n.setAttribute("data-media-tooltip","mute"),fc(n,"Mute")}}p0=new WeakMap,gl=new WeakSet,BH=function(n){const a=b(this,p0).remote;k(this,gl,P5).call(this)?a.unmute(n):a.mute(n)},P5=function(){const{muted:n,volume:a}=b(this,p0).$state;return n()||a()===0},LH=function(){const{muted:n,volume:a}=b(this,p0).$state,l=a();if(n()||l===0)return"muted";if(l>=.5)return"high";if(l<.5)return"low"},V(B$,"props",Sn.props);class L$ extends dt{constructor(){super();P(this,Es);P(this,zc);new Sn({isPresssed:k(this,Es,eS).bind(this),keyShortcut:"togglePictureInPicture",onPress:k(this,Es,PH).bind(this)})}onSetup(){j(this,zc,Rt());const{pictureInPicture:n}=b(this,zc).$state,a=k(this,Es,$H).bind(this);this.setAttributes({"data-active":n,"data-supported":a,"aria-hidden":sn(()=>!a())})}onAttach(n){n.setAttribute("data-media-tooltip","pip"),fc(n,"PiP")}}zc=new WeakMap,Es=new WeakSet,PH=function(n){const a=b(this,zc).remote;k(this,Es,eS).call(this)?a.exitPictureInPicture(n):a.enterPictureInPicture(n)},eS=function(){const{pictureInPicture:n}=b(this,zc).$state;return n()},$H=function(){const{canPictureInPicture:n}=b(this,zc).$state;return n()},V(L$,"props",Sn.props);class P$ extends dt{constructor(){super();P(this,Hc);P(this,Uc);new lr}onSetup(){j(this,Uc,Rt());const{seeking:n}=b(this,Uc).$state,{seconds:a}=this.$props,l=k(this,Hc,MH).bind(this);this.setAttributes({seconds:a,"data-seeking":n,"data-supported":l,"aria-hidden":sn(()=>!l())})}onAttach(n){bo(n,"tabindex","0"),bo(n,"role","button"),bo(n,"type","button"),n.setAttribute("data-media-tooltip","seek"),fc(n,k(this,Hc,NH).bind(this))}onConnect(n){mc(n,k(this,Hc,jH).bind(this))}}Uc=new WeakMap,Hc=new WeakSet,MH=function(){const{canSeek:n}=b(this,Uc).$state;return n()},NH=function(){const{seconds:n}=this.$props;return`Seek ${n()>0?"forward":"backward"} ${n()} seconds`},jH=function(n){const{seconds:a,disabled:l}=this.$props;if(l())return;const{currentTime:s}=b(this,Uc).$state,d=s()+a();b(this,Uc).remote.seek(d,n)},V(P$,"props",{disabled:!1,seconds:30});class $$ extends dt{constructor(){super();P(this,e5);P(this,u0);new lr}onSetup(){j(this,u0,Rt());const{disabled:n}=this.$props,{live:a,liveEdge:l}=b(this,u0).$state,s=()=>!a();this.setAttributes({"data-edge":l,"data-hidden":s,"aria-disabled":sn(()=>n()||l()),"aria-hidden":sn(s)})}onAttach(n){bo(n,"tabindex","0"),bo(n,"role","button"),bo(n,"type","button"),n.setAttribute("data-media-tooltip","live")}onConnect(n){mc(n,k(this,e5,FH).bind(this))}}u0=new WeakMap,e5=new WeakSet,FH=function(n){const{disabled:a}=this.$props,{liveEdge:l}=b(this,u0).$state;a()||l()||b(this,u0).remote.seekToLiveEdge(n)},V($$,"props",{disabled:!1});const Cp=new pc({min:0,max:100,value:0,step:1,pointerValue:0,focused:!1,dragging:!1,pointing:!1,hidden:!1,get active(){return this.dragging||this.focused||this.pointing},get fillRate(){return M$(this.min,this.max,this.value)},get fillPercent(){return this.fillRate*100},get pointerRate(){return M$(this.min,this.max,this.pointerValue)},get pointerPercent(){return this.pointerRate*100}});function M$(i,o,n){const a=o-i,l=n-i;return a>0?l/a:0}class N$ extends Pa{constructor(n){super();P(this,t5);P(this,T2);P(this,Kc);j(this,T2,n)}onConnect(n){j(this,Kc,new IntersectionObserver(a=>{var l,s;(s=(l=b(this,T2)).callback)==null||s.call(l,a,b(this,Kc))},b(this,T2))),b(this,Kc).observe(n),At(k(this,t5,qH).bind(this))}}T2=new WeakMap,Kc=new WeakMap,t5=new WeakSet,qH=function(){var n;(n=b(this,Kc))==null||n.disconnect(),j(this,Kc,void 0)};const Pv=dc(),Nh=dc();function Ike(i,o,n,a){return xv(i,Pi(n,kv(a)),o)}function Eke(i,o,n,a){const l=xv(0,n,1),s=o-i,d=s*l,p=d/a,h=a*Math.round(p);return i+h}const $v={Left:-1,ArrowLeft:-1,Up:1,ArrowUp:1,Right:1,ArrowRight:1,Down:-1,ArrowDown:-1};class Tke extends Pa{constructor(n,a){super();P(this,Xe);P(this,fn);P(this,Gc);P(this,A2);P(this,Wc,null);P(this,gr,null);P(this,Ts,null);P(this,D2);P(this,As,!1);P(this,o5,mp(n=>{k(this,Xe,_d).call(this,k(this,Xe,D3).call(this,n),n)},20,{leading:!0}));j(this,fn,n),j(this,Gc,a)}onSetup(){ba(Nh)&&j(this,A2,qo(Nh))}onConnect(n){ue(k(this,Xe,HH).bind(this,n)),ue(k(this,Xe,KH).bind(this,n)),b(this,fn).swipeGesture&&ue(k(this,Xe,VH).bind(this))}}fn=new WeakMap,Gc=new WeakMap,A2=new WeakMap,Xe=new WeakSet,VH=function(){var a;const{pointer:n}=b(this,Gc).$state;if(n()!=="coarse"||!b(this,fn).swipeGesture()){j(this,Wc,null);return}j(this,Wc,(a=b(this,Gc).player.el)==null?void 0:a.querySelector("media-provider,[data-media-provider]")),b(this,Wc)&&new go(b(this,Wc)).add("touchstart",k(this,Xe,zH).bind(this),{passive:!0}).add("touchmove",k(this,Xe,UH).bind(this),{passive:!1})},Wc=new WeakMap,gr=new WeakMap,Ts=new WeakMap,zH=function(n){j(this,gr,n.touches[0])},UH=function(n){if(Yr(b(this,gr))||yv(n))return;const a=n.touches[0],l=a.clientX-b(this,gr).clientX,s=a.clientY-b(this,gr).clientY,d=this.$state.dragging();!d&&Math.abs(s)>5||d||(n.preventDefault(),Math.abs(l)>20&&(j(this,gr,a),j(this,Ts,this.$state.value()),k(this,Xe,M5).call(this,b(this,Ts),n)))},HH=function(n){const{hidden:a}=this.$props;uo(n,"focus",k(this,Xe,GH).bind(this)),!(a()||b(this,fn).isDisabled())&&new go(n).add("keyup",k(this,Xe,JH).bind(this)).add("keydown",k(this,Xe,QH).bind(this)).add("pointerenter",k(this,Xe,WH).bind(this)).add("pointermove",k(this,Xe,ZH).bind(this)).add("pointerleave",k(this,Xe,YH).bind(this)).add("pointerdown",k(this,Xe,XH).bind(this))},KH=function(n){b(this,fn).isDisabled()||!this.$state.dragging()||new go(document).add("pointerup",k(this,Xe,eK).bind(this),{capture:!0}).add("pointermove",b(this,o5).bind(this)).add("touchmove",k(this,Xe,tK).bind(this),{passive:!1})},GH=function(){k(this,Xe,_d).call(this,this.$state.value())},$5=function(n,a){var y,w,v,C;const{value:l,min:s,max:d,dragging:p}=this.$state,h=Math.max(s(),Math.min(n,d()));l.set(h);const f=this.createEvent("value-change",{detail:h,trigger:a});if(this.dispatch(f),(w=(y=b(this,fn)).onValueChange)==null||w.call(y,f),p()){const E=this.createEvent("drag-value-change",{detail:h,trigger:a});this.dispatch(E),(C=(v=b(this,fn)).onDragValueChange)==null||C.call(v,E)}},_d=function(n,a){const{pointerValue:l,dragging:s}=this.$state;l.set(n),this.dispatch("pointer-value-change",{detail:n,trigger:a}),s()&&k(this,Xe,$5).call(this,n,a)},D3=function(n){let a,l=this.el.getBoundingClientRect(),{min:s,max:d}=this.$state;if(this.$props.orientation()==="vertical"){const{bottom:p,height:h}=l;a=(p-n.clientY)/h}else if(b(this,gr)&&Li(b(this,Ts))){const{width:p}=b(this,Wc).getBoundingClientRect(),h=(n.clientX-b(this,gr).clientX)/p,f=d()-s(),y=f*Math.abs(h);a=(h<0?b(this,Ts)-y:b(this,Ts)+y)/f}else{const{left:p,width:h}=l;a=(n.clientX-p)/h}return Math.max(s(),Math.min(d(),b(this,fn).roundValue(Eke(s(),d(),a,b(this,fn).getStep()))))},WH=function(n){this.$state.pointing.set(!0)},ZH=function(n){const{dragging:a}=this.$state;a()||k(this,Xe,_d).call(this,k(this,Xe,D3).call(this,n),n)},YH=function(n){this.$state.pointing.set(!1)},XH=function(n){if(n.button!==0)return;const a=k(this,Xe,D3).call(this,n);k(this,Xe,M5).call(this,a,n),k(this,Xe,_d).call(this,a,n)},M5=function(n,a){var d,p,h,f;const{dragging:l}=this.$state;if(l())return;l.set(!0),b(this,Gc).remote.pauseControls(a);const s=this.createEvent("drag-start",{detail:n,trigger:a});this.dispatch(s),(p=(d=b(this,fn)).onDragStart)==null||p.call(d,s),(f=(h=b(this,A2))==null?void 0:h.onDragStart)==null||f.call(h)},tS=function(n,a){var d,p,h,f;const{dragging:l}=this.$state;if(!l())return;l.set(!1),b(this,Gc).remote.resumeControls(a);const s=this.createEvent("drag-end",{detail:n,trigger:a});this.dispatch(s),(p=(d=b(this,fn)).onDragEnd)==null||p.call(d,s),j(this,gr,null),j(this,Ts,null),(f=(h=b(this,A2))==null?void 0:h.onDragEnd)==null||f.call(h)},D2=new WeakMap,As=new WeakMap,QH=function(n){if(!Object.keys($v).includes(n.key))return;const{key:l}=n,s=k(this,Xe,oS).call(this,n);if(!Yr(s)){k(this,Xe,_d).call(this,s,n),k(this,Xe,$5).call(this,s,n);return}const d=k(this,Xe,iS).call(this,n);b(this,As)||(j(this,As,l===b(this,D2)),!this.$state.dragging()&&b(this,As)&&k(this,Xe,M5).call(this,d,n)),k(this,Xe,_d).call(this,d,n),j(this,D2,l)},JH=function(n){if(!Object.keys($v).includes(n.key)||!Yr(k(this,Xe,oS).call(this,n)))return;const l=b(this,As)?this.$state.pointerValue():k(this,Xe,iS).call(this,n);k(this,Xe,$5).call(this,l,n),k(this,Xe,tS).call(this,l,n),j(this,D2,""),j(this,As,!1)},oS=function(n){let a=n.key,{min:l,max:s}=this.$state;return a==="Home"||a==="PageUp"?l():a==="End"||a==="PageDown"?s():!n.metaKey&&/^[0-9]$/.test(a)?(s()-l())/10*Number(a):null},iS=function(n){var I,x;const{key:a,shiftKey:l}=n;n.preventDefault(),n.stopPropagation();const{shiftKeyMultiplier:s}=this.$props,{min:d,max:p,value:h,pointerValue:f}=this.$state,y=b(this,fn).getStep(),w=b(this,fn).getKeyStep(),v=l?w*s():w,C=Number($v[a]),E=v*C,T=b(this,As)?f():((x=(I=b(this,fn)).getValue)==null?void 0:x.call(I))??h(),A=(T+E)/y;return Math.max(d(),Math.min(p(),Number((y*A).toFixed(3))))},eK=function(n){if(n.button!==0)return;n.preventDefault(),n.stopImmediatePropagation();const a=k(this,Xe,D3).call(this,n);k(this,Xe,_d).call(this,a,n),k(this,Xe,tS).call(this,a,n)},tK=function(n){n.preventDefault()},o5=new WeakMap;const Mu=dc(()=>({}));class ya extends Pa{constructor(n){super();P(this,Yi);P(this,Am);P(this,oa);P(this,Dm,ct(!0));P(this,_m,ct(!0));P(this,i5,Pu((n,a)=>{var l,s;(l=this.el)==null||l.style.setProperty("--slider-fill",n+"%"),(s=this.el)==null||s.style.setProperty("--slider-pointer",a+"%")}));j(this,oa,n)}onSetup(){j(this,Am,Rt());const n=new lr;n.attach(this),this.$state.focused=n.focused.bind(n),ba(Mu)||ma(Mu,{default:"value"}),ma(Pv,{orientation:this.$props.orientation,disabled:b(this,oa).isDisabled,preview:ct(null)}),ue(k(this,Yi,nK).bind(this)),ue(k(this,Yi,aK).bind(this)),ue(k(this,Yi,rK).bind(this)),k(this,Yi,sK).call(this),new Tke(b(this,oa),b(this,Am)).attach(this),new N$({callback:k(this,Yi,oK).bind(this)}).attach(this)}onAttach(n){bo(n,"role","slider"),bo(n,"tabindex","0"),bo(n,"autocomplete","off"),ue(k(this,Yi,cK).bind(this))}onConnect(n){At(r$(n,b(this,Dm).set)),ue(k(this,Yi,iK).bind(this))}}Am=new WeakMap,oa=new WeakMap,Dm=new WeakMap,_m=new WeakMap,Yi=new WeakSet,oK=function(n){b(this,_m).set(n[0].isIntersecting)},iK=function(){const{hidden:n}=this.$props;this.$state.hidden.set(n()||!b(this,Dm).call(this)||!b(this,_m).bind(this))},nK=function(){const{dragging:n,value:a,min:l,max:s}=this.$state;Re(n)||a.set(Ike(l(),s(),a(),b(this,oa).getStep()))},aK=function(){this.$state.step.set(b(this,oa).getStep())},rK=function(){if(!b(this,oa).isDisabled())return;const{dragging:n,pointing:a}=this.$state;n.set(!1),a.set(!1)},lK=function(){return Rg(b(this,oa).isDisabled())},sK=function(){const{orientation:n}=this.$props,{dragging:a,active:l,pointing:s}=this.$state;this.setAttributes({"data-dragging":a,"data-pointing":s,"data-active":l,"aria-disabled":k(this,Yi,lK).bind(this),"aria-valuemin":b(this,oa).aria.valueMin??this.$state.min,"aria-valuemax":b(this,oa).aria.valueMax??this.$state.max,"aria-valuenow":b(this,oa).aria.valueNow,"aria-valuetext":b(this,oa).aria.valueText,"aria-orientation":n})},cK=function(){const{fillPercent:n,pointerPercent:a}=this.$state;b(this,i5).call(this,Pi(n(),3),Pi(a(),3))},i5=new WeakMap,V(ya,"props",{hidden:!1,disabled:!1,step:1,keyStep:1,orientation:"horizontal",shiftKeyMultiplier:5});class kp extends dt{constructor(){super();P(this,yl);new ya({getStep:this.$props.step,getKeyStep:this.$props.keyStep,roundValue:Math.round,isDisabled:this.$props.disabled,aria:{valueNow:k(this,yl,dK).bind(this),valueText:k(this,yl,pK).bind(this)}})}onSetup(){ue(k(this,yl,uK).bind(this)),ue(k(this,yl,hK).bind(this))}}yl=new WeakSet,dK=function(){const{value:n}=this.$state;return Math.round(n())},pK=function(){const{value:n,max:a}=this.$state;return Pi(n()/a()*100,2)+"%"},uK=function(){const{value:n}=this.$props;this.$state.value.set(n())},hK=function(){const{min:n,max:a}=this.$props;this.$state.min.set(n()),this.$state.max.set(a())},V(kp,"props",{...ya.props,min:0,max:100,value:0}),V(kp,"state",Cp);const as=new Map,Gg=new Map,Zk=class Zk{constructor(o,n,a){P(this,Yo);P(this,Om);P(this,_2);P(this,Rm);V(this,"$images",ct([]));j(this,_2,o),j(this,Rm,n),j(this,Om,a),ue(k(this,Yo,fK).bind(this))}static create(o,n){const a=Rt();return new Zk(o,n,a)}};Om=new WeakMap,_2=new WeakMap,Rm=new WeakMap,Yo=new WeakSet,fK=function(){var a;const{canLoad:o}=b(this,Om).$state;if(!o())return;const n=b(this,_2).call(this);if(n){if(Je(n)&&as.has(n)){const l=as.get(n);if(as.delete(n),as.set(n,l),as.size>99){const s=as.keys().next().value;as.delete(s)}this.$images.set(as.get(n))}else if(Je(n)){const l=b(this,Rm).call(this),s=n+"::"+l;if(!Gg.has(s)){const d=new Promise(async(p,h)=>{try{const f=await fetch(n,{credentials:Lh(l)});if(f.headers.get("content-type")==="application/json"){const w=await f.json();if(rn(w))if(w[0]&&"text"in w[0])p(k(this,Yo,aS).call(this,w));else{for(let v=0;v<w.length;v++){const C=w[v];is(DP(C),!1),is("url"in C&&Je(C.url),!1),is("startTime"in C&&Li(C.startTime),!1)}p(w)}else p(k(this,Yo,nS).call(this,w));return}Promise.resolve().then(()=>F4).then(async({parseResponse:w})=>{try{const{cues:v}=await w(f);p(k(this,Yo,aS).call(this,v))}catch(v){h(v)}})}catch(f){h(f)}}).then(p=>(as.set(s,p),p)).catch(p=>{k(this,Yo,N5).call(this,n,p)}).finally(()=>{Je(s)&&Gg.delete(s)});Gg.set(s,d)}(a=Gg.get(s))==null||a.then(d=>{this.$images.set(d||[])})}else if(rn(n))try{this.$images.set(k(this,Yo,mK).call(this,n))}catch(l){k(this,Yo,N5).call(this,n,l)}else try{this.$images.set(k(this,Yo,nS).call(this,n))}catch(l){k(this,Yo,N5).call(this,n,l)}return()=>{this.$images.set([])}}},mK=function(o){const n=k(this,Yo,rS).call(this);return o.map((a,l)=>(is(a.url&&Je(a.url)),is("startTime"in a&&Li(a.startTime)),{...a,url:Je(a.url)?k(this,Yo,lS).call(this,a.url,n):a.url}))},nS=function(o){var d;is(Je(o.url)),is(rn(o.tiles)&&((d=o.tiles)==null?void 0:d.length));const n=new URL(o.url),a=[],l="tile_width"in o?o.tile_width:o.tileWidth,s="tile_height"in o?o.tile_height:o.tileHeight;for(const p of o.tiles)a.push({url:n,startTime:"start"in p?p.start:p.startTime,width:l,height:s,coords:{x:p.x,y:p.y}});return a},aS=function(o){for(let l=0;l<o.length;l++){const s=o[l];is("startTime"in s&&Li(s.startTime)),is("text"in s&&Je(s.text))}const n=[],a=k(this,Yo,rS).call(this);for(const l of o){const[s,d]=l.text.split("#"),p=k(this,Yo,bK).call(this,d);n.push({url:k(this,Yo,lS).call(this,s,a),startTime:l.startTime,endTime:l.endTime,width:p==null?void 0:p.w,height:p==null?void 0:p.h,coords:p&&Li(p.x)&&Li(p.y)?{x:p.x,y:p.y}:void 0})}return n},rS=function(){let o=Re(b(this,_2));return!Je(o)||!/^https?:/.test(o)?location.href:o},lS=function(o,n){return/^https?:/.test(o)?new URL(o):new URL(o,n)},bK=function(o){if(!o)return{};const[n,a]=o.split("="),l=a==null?void 0:a.split(","),s={};if(!n||!l)return null;for(let d=0;d<n.length;d++){const p=+l[d];isNaN(p)||(s[n[d]]=p)}return s},N5=function(o,n){};let Mv=Zk;class Nv extends dt{constructor(){super(...arguments);P(this,Zt);V(this,"media");P(this,O2);P(this,R2,[])}onSetup(){this.media=Rt(),j(this,O2,Mv.create(this.$props.src,this.$state.crossOrigin)),k(this,Zt,sS).call(this),this.setAttributes({"data-loading":k(this,Zt,CK).bind(this),"data-error":k(this,Zt,cS).bind(this),"data-hidden":this.$state.hidden,"aria-hidden":sn(this.$state.hidden)})}onConnect(n){ue(k(this,Zt,gK).bind(this)),ue(k(this,Zt,kK).bind(this)),ue(k(this,Zt,sS).bind(this)),ue(k(this,Zt,yK).bind(this)),ue(k(this,Zt,xK).bind(this)),ue(k(this,Zt,dS).bind(this))}getTime(){return this.$props.time()}}O2=new WeakMap,R2=new WeakMap,Zt=new WeakSet,gK=function(){const n=this.$state.img();n&&new go(n).add("load",k(this,Zt,wK).bind(this)).add("error",k(this,Zt,vK).bind(this))},sS=function(){const{crossOrigin:n}=this.$props,{crossOrigin:a}=this.$state,{crossOrigin:l}=this.media.$state,s=n()!==null?n():l();a.set(s===!0?"anonymous":s)},yK=function(){const{src:n,loading:a,error:l}=this.$state;return n()&&(a.set(!0),l.set(null)),()=>{k(this,Zt,SK).call(this),a.set(!1),l.set(null)}},wK=function(){const{loading:n,error:a}=this.$state;k(this,Zt,dS).call(this),n.set(!1),a.set(null)},vK=function(n){const{loading:a,error:l}=this.$state;a.set(!1),l.set(n)},CK=function(){const{loading:n,hidden:a}=this.$state;return!a()&&n()},cS=function(){const{error:n}=this.$state;return!Yr(n())},kK=function(){const{hidden:n}=this.$state,{duration:a}=this.media.$state,l=b(this,O2).$images();n.set(k(this,Zt,cS).call(this)||!Number.isFinite(a())||l.length===0)},xK=function(){let n=b(this,O2).$images();if(!n.length)return;let a=this.getTime(),{src:l,activeThumbnail:s}=this.$state,d=-1,p=null;for(let h=n.length-1;h>=0;h--){const f=n[h];if(a>=f.startTime&&(!f.endTime||a<f.endTime)){d=h;break}}n[d]&&(p=n[d]),s.set(p),l.set((p==null?void 0:p.url.href)||"")},dS=function(){if(!this.scope||this.$state.hidden())return;const n=this.el,a=this.$state.img(),l=this.$state.activeThumbnail();if(!a||!l||!n)return;let s=l.width??a.naturalWidth,d=(l==null?void 0:l.height)??a.naturalHeight,{maxWidth:p,maxHeight:h,minWidth:f,minHeight:y,width:w,height:v}=getComputedStyle(this.el);f==="100%"&&(f=parseFloat(w)+""),y==="100%"&&(y=parseFloat(v)+"");let C=Math.max(parseInt(f)/s,parseInt(y)/d),E=Math.min(Math.max(parseInt(f),parseInt(p))/s,Math.max(parseInt(y),parseInt(h))/d),T=!isNaN(E)&&E<1?E:C>1?C:1;k(this,Zt,Od).call(this,n,"--thumbnail-width",`${s*T}px`),k(this,Zt,Od).call(this,n,"--thumbnail-height",`${d*T}px`),k(this,Zt,Od).call(this,n,"--thumbnail-aspect-ratio",String(Pi(s/d,5))),k(this,Zt,Od).call(this,a,"width",`${a.naturalWidth*T}px`),k(this,Zt,Od).call(this,a,"height",`${a.naturalHeight*T}px`),k(this,Zt,Od).call(this,a,"transform",l.coords?`translate(-${l.coords.x*T}px, -${l.coords.y*T}px)`:""),k(this,Zt,Od).call(this,a,"max-width","none")},Od=function(n,a,l){n.style.setProperty(a,l),b(this,R2).push(()=>n.style.removeProperty(a))},SK=function(){for(const n of b(this,R2))n();j(this,R2,[])},V(Nv,"props",{src:null,time:0,crossOrigin:null}),V(Nv,"state",new pc({src:"",img:null,thumbnails:[],activeThumbnail:null,crossOrigin:null,loading:!1,error:null,hidden:!1}));class jv extends dt{constructor(){super(...arguments);P(this,Zc);P(this,n5);P(this,Bm)}onSetup(){j(this,Bm,Bu(kp.state)),j(this,Zc,qo(Mu)),j(this,n5,rr(this.getValueText.bind(this)))}getValueText(){var T,A;const{type:n,format:a,decimalPlaces:l,padHours:s,padMinutes:d,showHours:p,showMs:h}=this.$props,{value:f,pointerValue:y,min:w,max:v}=b(this,Bm),C=(a==null?void 0:a())??b(this,Zc).default,E=n()==="current"?f():y();if(C==="percent"){const I=v()-w(),x=E/I*100;return(b(this,Zc).percent??Pi)(x,l())+"%"}else return C==="time"?(b(this,Zc).time??Hg)(E,{padHrs:s(),padMins:d(),showHrs:p(),showMs:h()}):(((A=(T=b(this,Zc)).value)==null?void 0:A.call(T,E))??E.toFixed(2))+""}}Zc=new WeakMap,n5=new WeakMap,Bm=new WeakMap,V(jv,"props",{type:"pointer",format:null,showHours:!1,showMs:!1,padHours:null,padMinutes:null,decimalPlaces:2});const Ake=jv.prototype;ei(Ake,"getValueText");class j$ extends dt{constructor(){super(...arguments);P(this,B2);P(this,Lm,Pu(()=>{const{disabled:n,orientation:a}=b(this,B2);if(n())return;const l=this.el,{offset:s,noClamp:d}=this.$props;l&&Dke(l,{clamp:!d(),offset:s(),orientation:a()})}))}onSetup(){j(this,B2,qo(Pv));const{active:n}=Bu(kp.state);this.setAttributes({"data-visible":n})}onAttach(n){Object.assign(n.style,{position:"absolute",top:0,left:0,width:"max-content"})}onConnect(n){const{preview:a}=b(this,B2);a.set(n),At(()=>a.set(null)),ue(b(this,Lm).bind(this));const l=new ResizeObserver(b(this,Lm).bind(this));l.observe(n),At(()=>l.disconnect())}}B2=new WeakMap,Lm=new WeakMap,V(j$,"props",{offset:0,noClamp:!1});function Dke(i,{clamp:o,offset:n,orientation:a}){const l=getComputedStyle(i),s=parseFloat(l.width),d=parseFloat(l.height),p={top:null,right:null,bottom:null,left:null};if(p[a==="horizontal"?"bottom":"left"]=`calc(100% + var(--media-slider-preview-offset, ${n}px))`,a==="horizontal"){const h=s/2;if(!o)p.left=`calc(var(--slider-pointer) - ${h}px)`;else{const f=`max(0px, calc(var(--slider-pointer) - ${h}px))`,y=`calc(100% - ${s}px)`;p.left=`min(${f}, ${y})`}}else{const h=d/2;if(!o)p.bottom=`calc(var(--slider-pointer) - ${h}px)`;else{const f=`max(${h}px, calc(var(--slider-pointer) - ${h}px))`,y=`calc(100% - ${d}px)`;p.bottom=`min(${f}, ${y})`}}Object.assign(i.style,p)}class Fv extends dt{constructor(){super(...arguments);P(this,Xi);P(this,Fa);P(this,Pm,mp(k(this,Xi,_K).bind(this),25))}onSetup(){j(this,Fa,Rt());const{audioGain:n}=b(this,Fa).$state;ma(Mu,{default:"percent",value(a){return(a*(n()??1)).toFixed(2)},percent(a){return Math.round(a*(n()??1))}}),new ya({getStep:this.$props.step,getKeyStep:this.$props.keyStep,roundValue:Math.round,isDisabled:k(this,Xi,AK).bind(this),aria:{valueMax:k(this,Xi,TK).bind(this),valueNow:k(this,Xi,IK).bind(this),valueText:k(this,Xi,EK).bind(this)},onDragValueChange:k(this,Xi,RK).bind(this),onValueChange:k(this,Xi,OK).bind(this)}).attach(this),ue(k(this,Xi,DK).bind(this))}onAttach(n){n.setAttribute("data-media-volume-slider",""),bo(n,"aria-label","Volume");const{canSetVolume:a}=b(this,Fa).$state;this.setAttributes({"data-supported":a,"aria-hidden":sn(()=>!a())})}}Fa=new WeakMap,Xi=new WeakSet,IK=function(){const{value:n}=this.$state,{audioGain:a}=b(this,Fa).$state;return Math.round(n()*(a()??1))},EK=function(){const{value:n,max:a}=this.$state,{audioGain:l}=b(this,Fa).$state;return Pi(n()/a()*(l()??1)*100,2)+"%"},TK=function(){const{audioGain:n}=b(this,Fa).$state;return this.$state.max()*(n()??1)},AK=function(){const{disabled:n}=this.$props,{canSetVolume:a}=b(this,Fa).$state;return n()||!a()},DK=function(){const{muted:n,volume:a}=b(this,Fa).$state,l=n()?0:a()*100;this.$state.value.set(l),this.dispatch("value-change",{detail:l})},Pm=new WeakMap,_K=function(n){if(!n.trigger)return;const a=Pi(n.detail/100,3);b(this,Fa).remote.changeVolume(a,n)},OK=function(n){b(this,Pm).call(this,n)},RK=function(n){b(this,Pm).call(this,n)},V(Fv,"props",{...ya.props,keyStep:5,shiftKeyMultiplier:2}),V(Fv,"state",Cp);class Wg extends dt{constructor(){super();P(this,it);P(this,zo);P(this,L2);P(this,$m,ct(null));P(this,P2,!1);const{noSwipeGesture:n}=this.$props;new ya({swipeGesture:()=>!n(),getValue:k(this,it,hS).bind(this),getStep:k(this,it,VK).bind(this),getKeyStep:k(this,it,zK).bind(this),roundValue:k(this,it,UK),isDisabled:k(this,it,HK).bind(this),aria:{valueNow:k(this,it,KK).bind(this),valueText:k(this,it,GK).bind(this)},onDragStart:k(this,it,jK).bind(this),onDragValueChange:k(this,it,FK).bind(this),onDragEnd:k(this,it,uS).bind(this),onValueChange:k(this,it,qK).bind(this)})}onSetup(){j(this,zo,Rt()),ma(Mu,{default:"time",value:k(this,it,ZK).bind(this),time:k(this,it,YK).bind(this)}),this.setAttributes({"data-chapters":k(this,it,LK).bind(this)}),this.setStyles({"--slider-progress":k(this,it,BK).bind(this)}),ue(k(this,it,$K).bind(this)),ue(k(this,it,PK).bind(this))}onAttach(n){n.setAttribute("data-media-time-slider",""),bo(n,"aria-label","Seek")}onConnect(n){ue(k(this,it,MK).bind(this)),jg(b(this,zo).textTracks,"chapters",b(this,$m).set)}}zo=new WeakMap,L2=new WeakMap,$m=new WeakMap,it=new WeakSet,BK=function(){const{bufferedEnd:n,duration:a}=b(this,zo).$state;return Pi(Math.min(n()/Math.max(a(),1),1)*100,3)+"%"},LK=function(){var a;const{duration:n}=b(this,zo).$state;return((a=b(this,$m).call(this))==null?void 0:a.cues.length)&&Number.isFinite(n())&&n()>0},PK=function(){j(this,L2,mp(k(this,it,pS).bind(this),this.$props.seekingRequestThrottle()))},$K=function(){if(this.$state.hidden())return;const{value:n,dragging:a}=this.$state,l=k(this,it,hS).call(this);Re(a)||(n.set(l),this.dispatch("value-change",{detail:l}))},MK=function(){const n=b(this,zo).player.el,{preview:a}=qo(Pv);n&&a()&&Ge(n,"data-preview",this.$state.active())},pS=function(n,a){b(this,zo).remote.seeking(n,a)},NK=function(n,a,l){b(this,L2).cancel();const{live:s}=b(this,zo).$state;if(s()&&a>=99){b(this,zo).remote.seekToLiveEdge(l);return}b(this,zo).remote.seek(n,l)},P2=new WeakMap,jK=function(n){const{pauseWhileDragging:a}=this.$props;if(a()){const{paused:l}=b(this,zo).$state;j(this,P2,!l()),b(this,zo).remote.pause(n)}},FK=function(n){b(this,L2).call(this,k(this,it,W0).call(this,n.detail),n)},uS=function(n){const{seeking:a}=b(this,zo).$state;Re(a)||k(this,it,pS).call(this,k(this,it,W0).call(this,n.detail),n);const l=n.detail;k(this,it,NK).call(this,k(this,it,W0).call(this,l),l,n);const{pauseWhileDragging:s}=this.$props;s()&&b(this,P2)&&(b(this,zo).remote.play(n),j(this,P2,!1))},qK=function(n){const{dragging:a}=this.$state;a()||!n.trigger||k(this,it,uS).call(this,n)},hS=function(){const{currentTime:n}=b(this,zo).$state;return k(this,it,WK).call(this,n())},VK=function(){const n=this.$props.step()/b(this,zo).$state.duration()*100;return Number.isFinite(n)?n:1},zK=function(){const n=this.$props.keyStep()/b(this,zo).$state.duration()*100;return Number.isFinite(n)?n:1},UK=function(n){return Pi(n,3)},HK=function(){const{disabled:n}=this.$props,{canSeek:a}=b(this,zo).$state;return n()||!a()},KK=function(){const{value:n}=this.$state;return Math.round(n())},GK=function(){const n=k(this,it,W0).call(this,this.$state.value()),{duration:a}=b(this,zo).$state;return Number.isFinite(n)?`${Kg(n)} out of ${Kg(a())}`:"live"},W0=function(n){const{duration:a}=b(this,zo).$state;return Pi(n/100*a(),5)},WK=function(n){const{liveEdge:a,duration:l}=b(this,zo).$state,s=Math.max(0,Math.min(1,a()?1:Math.min(n,l())/l()));return Number.isNaN(s)?0:Number.isFinite(s)?s*100:100},ZK=function(n){const a=k(this,it,W0).call(this,n),{live:l,duration:s}=b(this,zo).$state;return Number.isFinite(a)?(l()?a-s():a).toFixed(0):"LIVE"},YK=function(n,a){const l=k(this,it,W0).call(this,n),{live:s,duration:d}=b(this,zo).$state,p=s()?l-d():l;return Number.isFinite(l)?`${p<0?"-":""}${Hg(Math.abs(p),a)}`:"LIVE"},V(Wg,"props",{...ya.props,step:.1,keyStep:5,shiftKeyMultiplier:2,pauseWhileDragging:!1,noSwipeGesture:!1,seekingRequestThrottle:100}),V(Wg,"state",Cp);const $i=dc();function _ke(i,o){const n=Pve(i,o);for(const{el:a,top:l,left:s}of n)a.scroll({top:l,left:s,behavior:o.behavior})}function Oke(i,o={}){_ke(i,{scrollMode:"if-needed",block:"center",inline:"center",...o})}const Rke=["a[href]","[tabindex]","input","select","button"].map(i=>`${i}:not([aria-hidden='true'])`).join(","),Bke=new Set(["Escape","Tab","ArrowUp","ArrowDown","Home","PageUp","End","PageDown","Enter"," "]);class Lke{constructor(o){P(this,Po);P(this,Yc,-1);P(this,yr,null);P(this,ia,[]);P(this,Mm);j(this,Mm,o)}get items(){return b(this,ia)}attachMenu(o){uo(o,"focus",k(this,Po,XK).bind(this)),j(this,yr,o),At(()=>{j(this,yr,null)})}listen(){b(this,yr)&&(this.update(),new go(b(this,yr)).add("keyup",k(this,Po,QK).bind(this)).add("keydown",k(this,Po,JK).bind(this)),At(()=>{j(this,Yc,-1),j(this,ia,[])}))}update(){j(this,Yc,0),j(this,ia,k(this,Po,eG).call(this))}scroll(o=k(this,Po,fS).call(this)){const n=b(this,ia)[o];n&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{Oke(n,{behavior:"smooth",boundary:a=>!a.hasAttribute("data-root")})})})}focusActive(o=!0){const n=k(this,Po,fS).call(this);k(this,Po,Z0).call(this,n>=0?n:0,o)}}Yc=new WeakMap,yr=new WeakMap,ia=new WeakMap,Mm=new WeakMap,Po=new WeakSet,Z0=function(o,n=!0){var a;j(this,Yc,o),b(this,ia)[o]?(b(this,ia)[o].focus({preventScroll:!0}),n&&this.scroll(o)):(a=b(this,yr))==null||a.focus({preventScroll:!0})},fS=function(){return b(this,ia).findIndex(o=>document.activeElement===o||o.getAttribute("role")==="menuitemradio"&&o.getAttribute("aria-checked")==="true")},XK=function(){b(this,Yc)>=0||(this.update(),this.focusActive())},mS=function(o){const n=o.target;if(yve(o)&&n instanceof Element){const a=n.getAttribute("role");return!/a|input|select|button/.test(n.localName)&&!a}return Bke.has(o.key)},QK=function(o){k(this,Po,mS).call(this,o)&&(o.stopPropagation(),o.preventDefault())},JK=function(o){if(k(this,Po,mS).call(this,o))switch(o.stopPropagation(),o.preventDefault(),o.key){case"Escape":b(this,Mm).closeMenu(o);break;case"Tab":k(this,Po,Z0).call(this,k(this,Po,j5).call(this,o.shiftKey?-1:1));break;case"ArrowUp":k(this,Po,Z0).call(this,k(this,Po,j5).call(this,-1));break;case"ArrowDown":k(this,Po,Z0).call(this,k(this,Po,j5).call(this,1));break;case"Home":case"PageUp":k(this,Po,Z0).call(this,0);break;case"End":case"PageDown":k(this,Po,Z0).call(this,b(this,ia).length-1);break}},j5=function(o){var a;let n=b(this,Yc);do n=(n+o+b(this,ia).length)%b(this,ia).length;while(((a=b(this,ia)[n])==null?void 0:a.offsetParent)===null);return n},eG=function(){if(!b(this,yr))return[];const o=b(this,yr).querySelectorAll(Rke),n=[],a=l=>l.getAttribute("role")==="menu";for(const l of o)wp(l)&&l.offsetParent!==null&&l$(b(this,yr),l,a)&&n.push(l);return n};var Pke=Object.defineProperty,$ke=Object.getOwnPropertyDescriptor,jh=(i,o,n,a)=>{for(var l=$ke(o,n),s=i.length-1,d;s>=0;s--)(d=i[s])&&(l=d(o,n,l)||l);return l&&Pke(o,n,l),l};let Mke=0;class xp extends dt{constructor(){super();P(this,gt);P(this,wr);P(this,$2);P(this,M2);P(this,Mn,ct(!1));P(this,Nm,ct(!1));P(this,wl,ct(null));P(this,Qi,ct(null));P(this,Xc);P(this,Qc,new Set);P(this,h0,null);P(this,f0);P(this,Ds);P(this,m0,!1);P(this,jm,ct(!1));P(this,b0,new Set);P(this,N2,!1);P(this,a5,k(this,gt,mG).bind(this));P(this,j2,!1);P(this,r5,k(this,gt,bG).bind(this));P(this,l5,k(this,gt,gG).bind(this));P(this,F2,Pu(()=>{const n=Re(b(this,Qi));if(!n)return;let a=0,l=getComputedStyle(n),s=[...n.children];for(const d of["paddingTop","paddingBottom","borderTopWidth","borderBottomWidth"])a+=parseFloat(l[d])||0;for(const d of s)if(wp(d)&&d.style.display==="contents")s.push(...d.children);else if(d.nodeType===3)a+=parseFloat(getComputedStyle(d).fontSize);else if(wp(d)){if(!a$(d))continue;const p=getComputedStyle(d);a+=d.offsetHeight+(parseFloat(p.marginTop)||0)+(parseFloat(p.marginBottom)||0)}Zn(n,"--menu-height",a+"px")}));P(this,q2,!1);const{showDelay:n}=this.$props;j(this,f0,new D$({trigger:b(this,wl),content:b(this,Qi),showDelay:n,listen:(a,l,s)=>{mc(a,p=>{b(this,Mn).call(this)?s(p):l(p)});const d=k(this,gt,uG).call(this);d&&mc(d,p=>{p.stopPropagation(),s(p)})},onChange:k(this,gt,lG).bind(this)}))}get triggerElement(){return b(this,wl).call(this)}get contentElement(){return b(this,Qi).call(this)}get isSubmenu(){return!!b(this,Xc)}onSetup(){j(this,wr,Rt());const n=++Mke;j(this,$2,`media-menu-${n}`),j(this,M2,`media-menu-button-${n}`),j(this,Ds,new Lke({closeMenu:this.close.bind(this)})),ba($i)&&j(this,Xc,qo($i)),k(this,gt,tG).call(this),this.setAttributes({"data-open":b(this,Mn),"data-root":!this.isSubmenu,"data-submenu":this.isSubmenu,"data-disabled":k(this,gt,_3).bind(this)}),ma($i,{button:b(this,wl),content:b(this,Qi),expanded:b(this,Mn),hint:ct(""),submenu:!!b(this,Xc),disable:k(this,gt,cG).bind(this),attachMenuButton:k(this,gt,iG).bind(this),attachMenuItems:k(this,gt,nG).bind(this),attachObserver:k(this,gt,aG).bind(this),disableMenuButton:k(this,gt,rG).bind(this),addSubmenu:k(this,gt,fG).bind(this),onTransitionEvent:a=>{b(this,b0).add(a),At(()=>{b(this,b0).delete(a)})}})}onAttach(n){n.style.setProperty("display","contents")}onConnect(n){var a;ue(k(this,gt,oG).bind(this)),this.isSubmenu&&((a=b(this,Xc))==null||a.addSubmenu(this))}onDestroy(){b(this,wl).set(null),b(this,Qi).set(null),j(this,h0,null),b(this,b0).clear()}open(n){Re(b(this,Mn))||(b(this,f0).show(n),es())}close(n){Re(b(this,Mn))&&(b(this,f0).hide(n),es())}}wr=new WeakMap,$2=new WeakMap,M2=new WeakMap,Mn=new WeakMap,Nm=new WeakMap,wl=new WeakMap,Qi=new WeakMap,Xc=new WeakMap,Qc=new WeakMap,h0=new WeakMap,f0=new WeakMap,Ds=new WeakMap,m0=new WeakMap,jm=new WeakMap,b0=new WeakMap,gt=new WeakSet,tG=function(){let n=-1,a=ba(Nh)?qo(Nh):null;ma(Nh,{onDragStart:()=>{var l;(l=a==null?void 0:a.onDragStart)==null||l.call(a),window.clearTimeout(n),n=-1,j(this,m0,!0)},onDragEnd:()=>{var l;(l=a==null?void 0:a.onDragEnd)==null||l.call(a),n=window.setTimeout(()=>{j(this,m0,!1),n=-1},300)}})},oG=function(){const n=k(this,gt,sG).call(this);this.isSubmenu||b(this,F2).call(this),k(this,gt,bS).call(this,n),n&&(ue(()=>{const{height:a}=b(this,wr).$state,l=b(this,Qi).call(this);l&&Zn(l,"--player-height",a()+"px")}),b(this,Ds).listen(),this.listen("pointerup",k(this,gt,dG).bind(this)),uo(window,"pointerup",k(this,gt,pG).bind(this)))},iG=function(n){const a=n.el,l=this.isSubmenu,s=sn(k(this,gt,_3).bind(this));bo(a,"tabindex",l?"-1":"0"),bo(a,"role",l?"menuitem":"button"),Ge(a,"id",b(this,M2)),Ge(a,"aria-haspopup","menu"),Ge(a,"aria-expanded","false"),Ge(a,"data-root",!this.isSubmenu),Ge(a,"data-submenu",this.isSubmenu),ue(()=>{Ge(a,"data-open",b(this,Mn).call(this)),Ge(a,"aria-disabled",s())}),b(this,wl).set(a),At(()=>{b(this,wl).set(null)})},nG=function(n){var d;const a=n.el;a.style.setProperty("display","none"),Ge(a,"id",b(this,$2)),bo(a,"role","menu"),bo(a,"tabindex","-1"),Ge(a,"data-root",!this.isSubmenu),Ge(a,"data-submenu",this.isSubmenu),b(this,Qi).set(a),At(()=>b(this,Qi).set(null)),ue(()=>Ge(a,"data-open",b(this,Mn).call(this))),b(this,Ds).attachMenu(a),k(this,gt,bS).call(this,!1);const s=k(this,gt,yG).bind(this);this.isSubmenu?(d=b(this,Xc))==null||d.onTransitionEvent(s):(n.listen("transitionstart",s),n.listen("transitionend",s),n.listen("animationend",b(this,F2)),n.listen("vds-menu-resize",b(this,F2)))},aG=function(n){j(this,h0,n)},bS=function(n){const a=Re(b(this,Qi));a&&Ge(a,"aria-hidden",Rg(!n))},rG=function(n){b(this,jm).set(n)},N2=new WeakMap,lG=function(n,a){var d,p,h,f,y,w;if(j(this,N2,_g(a)),a==null||a.stopPropagation(),b(this,Mn).call(this)===n)return;if(k(this,gt,_3).call(this)){n&&b(this,f0).hide(a);return}(d=this.el)==null||d.dispatchEvent(new Event("vds-menu-resize",{bubbles:!0,composed:!0}));const l=b(this,wl).call(this),s=b(this,Qi).call(this);if(l&&(Ge(l,"aria-controls",n&&b(this,$2)),Ge(l,"aria-expanded",Rg(n))),s&&Ge(s,"aria-labelledby",n&&b(this,M2)),b(this,Mn).set(n),k(this,gt,hG).call(this,a),es(),b(this,N2)){n?s==null||s.focus():l==null||l.focus();for(const v of[this.el,s])v&&v.setAttribute("data-keyboard","")}else for(const v of[this.el,s])v&&v.removeAttribute("data-keyboard");if(this.dispatch(n?"open":"close",{trigger:a}),n)!this.isSubmenu&&b(this,wr).activeMenu!==this&&((p=b(this,wr).activeMenu)==null||p.close(a),b(this,wr).activeMenu=this),(f=(h=b(this,h0))==null?void 0:h.onOpen)==null||f.call(h,a);else{if(this.isSubmenu)for(const v of b(this,Qc))v.close(a);else b(this,wr).activeMenu=null;(w=(y=b(this,h0))==null?void 0:y.onClose)==null||w.call(y,a)}n&&requestAnimationFrame(k(this,gt,gS).bind(this))},gS=function(){b(this,q2)||b(this,j2)||(b(this,Ds).update(),requestAnimationFrame(()=>{b(this,N2)?b(this,Ds).focusActive():b(this,Ds).scroll()}))},sG=function(){return!k(this,gt,_3).call(this)&&b(this,Mn).call(this)},_3=function(){return b(this,Nm).call(this)||b(this,jm).call(this)},cG=function(n){b(this,Nm).set(n)},dG=function(n){const a=b(this,Qi).call(this);b(this,m0)||a&&n$(a,n)||n.stopPropagation()},pG=function(n){const a=b(this,Qi).call(this);b(this,m0)||a&&n$(a,n)||this.close(n)},uG=function(){var a;const n=(a=this.el)==null?void 0:a.querySelector('[data-part="close-target"]');return this.el&&n&&l$(this.el,n,l=>l.getAttribute("role")==="menu")?n:null},hG=function(n){this.isSubmenu||(b(this,Mn).call(this)?b(this,wr).remote.pauseControls(n):b(this,wr).remote.resumeControls(n))},fG=function(n){b(this,Qc).add(n),new go(n).add("open",b(this,r5)).add("close",b(this,l5)),At(b(this,a5))},a5=new WeakMap,mG=function(n){b(this,Qc).delete(n)},j2=new WeakMap,r5=new WeakMap,bG=function(n){var l;j(this,j2,!0);const a=b(this,Qi).call(this);this.isSubmenu&&((l=this.triggerElement)==null||l.setAttribute("aria-hidden","true"));for(const s of b(this,Qc))if(s!==n.target)for(const d of[s.el,s.triggerElement])d==null||d.setAttribute("aria-hidden","true");if(a){const s=n.target.el;for(const d of a.children)d.contains(s)?d.setAttribute("data-open",""):d!==s&&d.setAttribute("data-hidden","")}},l5=new WeakMap,gG=function(n){var l;j(this,j2,!1);const a=b(this,Qi).call(this);this.isSubmenu&&((l=this.triggerElement)==null||l.setAttribute("aria-hidden","false"));for(const s of b(this,Qc))for(const d of[s.el,s.triggerElement])d==null||d.setAttribute("aria-hidden","false");if(a)for(const s of a.children)s.removeAttribute("data-open"),s.removeAttribute("data-hidden")},F2=new WeakMap,q2=new WeakMap,yG=function(n){const a=b(this,Qi).call(this);a&&n.propertyName==="height"&&(j(this,q2,n.type==="transitionstart"),Ge(a,"data-transition",b(this,q2)?"height":null),b(this,Mn).call(this)&&k(this,gt,gS).call(this));for(const l of b(this,b0))l(n)},V(xp,"props",{showDelay:0}),jh([$t],xp.prototype,"triggerElement"),jh([$t],xp.prototype,"contentElement"),jh([$t],xp.prototype,"isSubmenu"),jh([ei],xp.prototype,"open"),jh([ei],xp.prototype,"close");class Zg extends dt{constructor(){super();P(this,_s);P(this,Jc);P(this,Fm,ct(null));new lr}get expanded(){var n;return((n=b(this,Jc))==null?void 0:n.expanded())??!1}onSetup(){j(this,Jc,qo($i))}onAttach(n){b(this,Jc).attachMenuButton(this),ue(k(this,_s,wG).bind(this)),bo(n,"type","button")}onConnect(n){ue(k(this,_s,vG).bind(this)),k(this,_s,yS).call(this);const a=new MutationObserver(k(this,_s,yS).bind(this));a.observe(n,{attributeFilter:["data-part"],childList:!0,subtree:!0}),At(()=>a.disconnect()),mc(n,l=>{this.dispatch("select",{trigger:l})})}}Jc=new WeakMap,Fm=new WeakMap,_s=new WeakSet,wG=function(){b(this,Jc).disableMenuButton(this.$props.disabled())},vG=function(){const n=b(this,Fm).call(this);n&&ue(()=>{const a=b(this,Jc).hint();a&&(n.textContent=a)})},yS=function(){var a;const n=(a=this.el)==null?void 0:a.querySelector('[data-part="hint"]');b(this,Fm).set(n??null)},V(Zg,"props",{disabled:!1});const Nke=Zg.prototype;$t(Nke,"expanded");class jke extends Zg{}class F$ extends dt{constructor(){super(...arguments);P(this,vr);P(this,na,null);P(this,qm)}onSetup(){j(this,qm,Rt()),ma(Yg,{attach:k(this,vr,CG).bind(this)})}onAttach(n){n.style.setProperty("display","contents")}onConnect(n){}onDestroy(){var n;(n=b(this,na))==null||n.remove(),j(this,na,null)}}na=new WeakMap,qm=new WeakMap,vr=new WeakSet,CG=function(n){k(this,vr,wS).call(this,!1),j(this,na,n),ns(()=>{ns(()=>{this.connectScope&&ue(k(this,vr,kG).bind(this))})})},kG=function(){const{fullscreen:n}=b(this,qm).$state,{disabled:a}=this.$props;k(this,vr,wS).call(this,a()==="fullscreen"?!n():!a())},wS=function(n){var s;if(!b(this,na))return;let a=k(this,vr,xG).call(this,this.$props.container());if(!a)return;const l=b(this,na).parentElement===a;Ge(b(this,na),"data-portal",n),n?l||(b(this,na).remove(),a.append(b(this,na))):l&&b(this,na).parentElement===a&&(b(this,na).remove(),(s=this.el)==null||s.append(b(this,na)))},xG=function(n){return wp(n)?n:n?document.querySelector(n):document.body},V(F$,"props",{container:null,disabled:!1});const Yg=dc();class q$ extends dt{constructor(){super();P(this,ed);P(this,g0);new lr;const{placement:n}=this.$props;this.setAttributes({"data-placement":n})}onAttach(n){if(j(this,g0,qo($i)),b(this,g0).attachMenuItems(this),ba(Yg)){const a=qo(Yg);a&&(ma(Yg,null),a.attach(n),At(()=>a.attach(null)))}}onConnect(n){ue(k(this,ed,SG).bind(this))}}g0=new WeakMap,ed=new WeakSet,SG=function(){const{expanded:n}=b(this,g0);if(!this.el||!n())return;const a=this.$props.placement();if(!a)return;Object.assign(this.el.style,{position:"absolute",top:0,left:0,width:"max-content"});const{offset:l,alignOffset:s}=this.$props;At(s$(this.el,k(this,ed,EG).call(this),a,{offsetVarName:"media-menu",xOffset:s(),yOffset:l()})),At(k(this,ed,IG).bind(this))},IG=function(){this.el&&(this.el.removeAttribute("style"),this.el.style.display="none")},EG=function(){return b(this,g0).button()},V(q$,"props",{placement:null,offset:0,alignOffset:0});const qv=dc();class Sp extends Pa{constructor(){super(...arguments);P(this,qa);P(this,Os,new Set);P(this,td,ct(""));P(this,Yk,null);V(this,"onValueChange");P(this,s5,k(this,qa,vS).bind(this))}get values(){return Array.from(b(this,Os)).map(n=>n.value())}get value(){return b(this,td).call(this)}set value(n){k(this,qa,vS).call(this,n)}onSetup(){ma(qv,{add:k(this,qa,TG).bind(this),remove:k(this,qa,AG).bind(this)})}onAttach(n){ba($i)||bo(n,"role","radiogroup"),this.setAttributes({value:b(this,td)})}onDestroy(){b(this,Os).clear()}}Os=new WeakMap,td=new WeakMap,Yk=new WeakMap,qa=new WeakSet,TG=function(n){b(this,Os).has(n)||(b(this,Os).add(n),n.onCheck=b(this,s5),n.check(n.value()===b(this,td).call(this)))},AG=function(n){n.onCheck=null,b(this,Os).delete(n)},s5=new WeakMap,vS=function(n,a){var p;const l=Re(b(this,td));if(!n||n===l)return;const s=k(this,qa,CS).call(this,l),d=k(this,qa,CS).call(this,n);s==null||s.check(!1,a),d==null||d.check(!0,a),b(this,td).set(n),(p=this.onValueChange)==null||p.call(this,n,a)},CS=function(n){for(const a of b(this,Os))if(n===Re(a.value))return a;return null};class Vv extends dt{constructor(){super();P(this,mn);P(this,vl,ct(!1));P(this,y0,{value:this.$props.value,check:k(this,mn,BG).bind(this),onCheck:null});new lr}get checked(){return b(this,vl).call(this)}onSetup(){this.setAttributes({value:this.$props.value,"data-checked":b(this,vl),"aria-checked":sn(b(this,vl))})}onAttach(n){const a=ba($i);bo(n,"tabindex",a?"-1":"0"),bo(n,"role",a?"menuitemradio":"radio"),ue(k(this,mn,OG).bind(this))}onConnect(n){k(this,mn,_G).call(this),mc(n,k(this,mn,RG).bind(this)),At(k(this,mn,DG).bind(this))}}vl=new WeakMap,y0=new WeakMap,mn=new WeakSet,DG=function(){kn(()=>{qo(qv).remove(b(this,y0))},this.connectScope)},_G=function(){qo(qv).add(b(this,y0))},OG=function(){var l,s;const{value:n}=this.$props,a=n();Re(b(this,vl))&&((s=(l=b(this,y0)).onCheck)==null||s.call(l,a))},RG=function(n){var a,l;Re(b(this,vl))||(k(this,mn,kS).call(this,!0,n),k(this,mn,LG).call(this,n),(l=(a=b(this,y0)).onCheck)==null||l.call(a,Re(this.$props.value),n))},BG=function(n,a){Re(b(this,vl))!==n&&k(this,mn,kS).call(this,n,a)},kS=function(n,a){b(this,vl).set(n),this.dispatch("change",{detail:n,trigger:a})},LG=function(n){this.dispatch("select",{trigger:n})},V(Vv,"props",{value:""});const Fke=Vv.prototype;$t(Fke,"checked");class zv extends dt{constructor(){super();P(this,Va);P(this,V2);P(this,Cr);P(this,w0);j(this,w0,new Sp),b(this,w0).onValueChange=k(this,Va,jG).bind(this)}get value(){return b(this,w0).value}get disabled(){const{audioTracks:n}=b(this,Cr).$state;return n().length<=1}onSetup(){j(this,Cr,Rt()),ba($i)&&j(this,V2,qo($i))}onConnect(n){ue(k(this,Va,PG).bind(this)),ue(k(this,Va,MG).bind(this)),ue(k(this,Va,$G).bind(this))}getOptions(){const{audioTracks:n}=b(this,Cr).$state;return n().map(a=>({track:a,label:a.label,value:a.label.toLowerCase()}))}}V2=new WeakMap,Cr=new WeakMap,w0=new WeakMap,Va=new WeakSet,PG=function(){b(this,w0).value=k(this,Va,NG).call(this)},$G=function(){var s;const{emptyLabel:n}=this.$props,{audioTrack:a}=b(this,Cr).$state,l=a();(s=b(this,V2))==null||s.hint.set((l==null?void 0:l.label)??n())},MG=function(){var n;(n=b(this,V2))==null||n.disable(this.disabled)},NG=function(){const{audioTrack:n}=b(this,Cr).$state,a=n();return a?a.label.toLowerCase():""},jG=function(n,a){if(this.disabled)return;const l=b(this,Cr).audioTracks.toArray().findIndex(s=>s.label.toLowerCase()===n);if(l>=0){const s=b(this,Cr).audioTracks[l];b(this,Cr).remote.changeAudioTrack(l,a),this.dispatch("change",{detail:s,trigger:a})}},V(zv,"props",{emptyLabel:"Default"});const Uv=zv.prototype;$t(Uv,"value"),$t(Uv,"disabled"),ei(Uv,"getOptions");class Hv extends dt{constructor(){super();P(this,Tn);P(this,aa);P(this,z2);P(this,v0);j(this,v0,new Sp),b(this,v0).onValueChange=k(this,Tn,UG).bind(this)}get value(){return b(this,v0).value}get disabled(){const{hasCaptions:n}=b(this,aa).$state;return!n()}onSetup(){j(this,aa,Rt()),ba($i)&&j(this,z2,qo($i))}onConnect(n){var a;(a=super.onConnect)==null||a.call(this,n),ue(k(this,Tn,FG).bind(this)),ue(k(this,Tn,VG).bind(this)),ue(k(this,Tn,qG).bind(this))}getOptions(){const{offLabel:n}=this.$props,{textTracks:a}=b(this,aa).$state;return[{value:"off",label:n},...a().filter(xn).map(l=>({track:l,label:l.label,value:k(this,Tn,F5).call(this,l)}))]}}aa=new WeakMap,z2=new WeakMap,v0=new WeakMap,Tn=new WeakSet,FG=function(){b(this,v0).value=k(this,Tn,zG).call(this)},qG=function(){var s;const{offLabel:n}=this.$props,{textTrack:a}=b(this,aa).$state,l=a();(s=b(this,z2))==null||s.hint.set(l&&xn(l)&&l.mode==="showing"?l.label:n())},VG=function(){var n;(n=b(this,z2))==null||n.disable(this.disabled)},zG=function(){const{textTrack:n}=b(this,aa).$state,a=n();return a&&xn(a)&&a.mode==="showing"?k(this,Tn,F5).call(this,a):"off"},UG=function(n,a){if(this.disabled)return;if(n==="off"){const s=b(this,aa).textTracks.selected;if(s){const d=b(this,aa).textTracks.indexOf(s);b(this,aa).remote.changeTextTrackMode(d,"disabled",a),this.dispatch("change",{detail:null,trigger:a})}return}const l=b(this,aa).textTracks.toArray().findIndex(s=>k(this,Tn,F5).call(this,s)===n);if(l>=0){const s=b(this,aa).textTracks[l];b(this,aa).remote.changeTextTrackMode(l,"showing",a),this.dispatch("change",{detail:s,trigger:a})}},F5=function(n){return n.id+":"+n.kind+"-"+n.label.toLowerCase()},V(Hv,"props",{offLabel:"Off"});const Kv=Hv.prototype;$t(Kv,"value"),$t(Kv,"disabled"),ei(Kv,"getOptions");const qke=[.25,.5,.75,1,1.25,1.5,1.75,2];class Gv extends dt{constructor(){super();P(this,za);P(this,od);P(this,U2);P(this,C0);j(this,C0,new Sp),b(this,C0).onValueChange=k(this,za,ZG).bind(this)}get value(){return b(this,C0).value}get disabled(){const{rates:n}=this.$props,{canSetPlaybackRate:a}=b(this,od).$state;return!a()||n().length===0}onSetup(){j(this,od,Rt()),ba($i)&&j(this,U2,qo($i))}onConnect(n){ue(k(this,za,HG).bind(this)),ue(k(this,za,KG).bind(this)),ue(k(this,za,GG).bind(this))}getOptions(){const{rates:n,normalLabel:a}=this.$props;return n().map(l=>({label:l===1?a:l+"×",value:l.toString()}))}}od=new WeakMap,U2=new WeakMap,C0=new WeakMap,za=new WeakSet,HG=function(){b(this,C0).value=k(this,za,WG).call(this)},KG=function(){var s;const{normalLabel:n}=this.$props,{playbackRate:a}=b(this,od).$state,l=a();(s=b(this,U2))==null||s.hint.set(l===1?n():l+"×")},GG=function(){var n;(n=b(this,U2))==null||n.disable(this.disabled)},WG=function(){const{playbackRate:n}=b(this,od).$state;return n().toString()},ZG=function(n,a){if(this.disabled)return;const l=+n;b(this,od).remote.changePlaybackRate(l,a),this.dispatch("change",{detail:l,trigger:a})},V(Gv,"props",{normalLabel:"Normal",rates:qke});const Wv=Gv.prototype;$t(Wv,"value"),$t(Wv,"disabled"),ei(Wv,"getOptions");class Zv extends dt{constructor(){super();P(this,An);P(this,kr);P(this,H2);P(this,k0);P(this,c5,rr(()=>{const{sort:n}=this.$props,{qualities:a}=b(this,kr).$state;return T$(a(),n()==="descending")}));j(this,k0,new Sp),b(this,k0).onValueChange=k(this,An,JG).bind(this)}get value(){return b(this,k0).value}get disabled(){const{canSetQuality:n,qualities:a}=b(this,kr).$state;return!n()||a().length<=1}onSetup(){j(this,kr,Rt()),ba($i)&&j(this,H2,qo($i))}onConnect(n){ue(k(this,An,YG).bind(this)),ue(k(this,An,QG).bind(this)),ue(k(this,An,XG).bind(this))}getOptions(){const{autoLabel:n,hideBitrate:a}=this.$props;return[{value:"auto",label:n},...b(this,c5).call(this).map(l=>{const s=l.bitrate&&l.bitrate>=0?`${Pi(l.bitrate/1e6,2)} Mbps`:null;return{quality:l,label:l.height+"p",value:k(this,An,q5).call(this,l),bitrate:()=>a()?null:s}})]}}kr=new WeakMap,H2=new WeakMap,k0=new WeakMap,c5=new WeakMap,An=new WeakSet,YG=function(){b(this,k0).value=k(this,An,eW).call(this)},XG=function(){var d;const{autoLabel:n}=this.$props,{autoQuality:a,quality:l}=b(this,kr).$state,s=l()?l().height+"p":"";(d=b(this,H2))==null||d.hint.set(a()?n()+(s?` (${s})`:""):s)},QG=function(){var n;(n=b(this,H2))==null||n.disable(this.disabled)},JG=function(n,a){if(this.disabled)return;if(n==="auto"){b(this,kr).remote.changeQuality(-1,a),this.dispatch("change",{detail:"auto",trigger:a});return}const{qualities:l}=b(this,kr).$state,s=Re(l).findIndex(d=>k(this,An,q5).call(this,d)===n);if(s>=0){const d=Re(l)[s];b(this,kr).remote.changeQuality(s,a),this.dispatch("change",{detail:d,trigger:a})}},eW=function(){const{quality:n,autoQuality:a}=b(this,kr).$state;if(a())return"auto";const l=n();return l?k(this,An,q5).call(this,l):"auto"},q5=function(n){return n.height+"_"+n.bitrate},V(Zv,"props",{autoLabel:"Auto",hideBitrate:!1,sort:"descending"});const Yv=Zv.prototype;$t(Yv,"value"),$t(Yv,"disabled"),ei(Yv,"getOptions");class Xv extends dt{constructor(){super(...arguments);P(this,Ai);P(this,K2);P(this,id,ct(null));P(this,Vm,ct(!0));P(this,zm,ct(!0))}onSetup(){j(this,K2,Rt()),k(this,Ai,xS).call(this);const{type:n}=this.$props;this.setAttributes({"data-type":n,"data-remainder":k(this,Ai,SS).bind(this)}),new N$({callback:k(this,Ai,tW).bind(this)}).attach(this)}onAttach(n){n.hasAttribute("role")||ue(k(this,Ai,nW).bind(this)),ue(k(this,Ai,xS).bind(this))}onConnect(n){At(r$(n,b(this,Vm).set)),ue(k(this,Ai,oW).bind(this)),ue(k(this,Ai,iW).bind(this))}}K2=new WeakMap,id=new WeakMap,Vm=new WeakMap,zm=new WeakMap,Ai=new WeakSet,tW=function(n){b(this,zm).set(n[0].isIntersecting)},oW=function(){const{hidden:n}=this.$props;this.$state.hidden.set(n()||!b(this,Vm).call(this)||!b(this,zm).call(this))},iW=function(){if(!this.$props.toggle()){b(this,id).set(null);return}this.el&&mc(this.el,k(this,Ai,rW).bind(this))},xS=function(){const{hidden:n,timeText:a}=this.$state,{duration:l}=b(this,K2).$state;if(n())return;const{type:s,padHours:d,padMinutes:p,showHours:h}=this.$props,f=k(this,Ai,aW).call(this,s()),y=l(),w=k(this,Ai,SS).call(this);if(!Number.isFinite(f+y)){a.set("LIVE");return}const v=w?Math.max(0,y-f):f,C=Hg(v,{padHrs:d(),padMins:p(),showHrs:h()});a.set((w?"-":"")+C)},nW=function(){if(!this.el)return;const{toggle:n}=this.$props;Ge(this.el,"role",n()?"timer":null),Ge(this.el,"tabindex",n()?0:null)},aW=function(n){const{bufferedEnd:a,duration:l,currentTime:s}=b(this,K2).$state;switch(n){case"buffered":return a();case"duration":return l();default:return s()}},SS=function(){return this.$props.remainder()&&b(this,id).call(this)!==!1},rW=function(n){if(n.preventDefault(),b(this,id).call(this)===null){b(this,id).set(!this.$props.remainder());return}b(this,id).set(a=>!a)},V(Xv,"props",{type:"current",showHours:!1,padHours:null,padMinutes:null,remainder:!1,toggle:!1,hidden:!1}),V(Xv,"state",new pc({timeText:"",hidden:!1}));class Qv extends dt{constructor(){super(...arguments);P(this,$o);P(this,Cl);P(this,G2,!1);P(this,nd,-1);P(this,W2,-1)}onSetup(){j(this,Cl,Rt())}onAttach(n){n.style.display="contents"}onConnect(n){n.setAttribute("data-media-announcer",""),bo(n,"role","status"),bo(n,"aria-live","polite");const{busy:a}=this.$state;this.setAttributes({"aria-busy":()=>a()?"true":null}),j(this,G2,!0),ue(k(this,$o,lW).bind(this)),ue(k(this,$o,pW).bind(this)),ue(k(this,$o,dW).bind(this)),ue(k(this,$o,sW).bind(this)),ue(k(this,$o,cW).bind(this)),ue(k(this,$o,uW).bind(this)),ue(k(this,$o,hW).bind(this)),es(),j(this,G2,!1)}}Cl=new WeakMap,G2=new WeakMap,$o=new WeakSet,lW=function(){const{paused:n}=b(this,Cl).$state;k(this,$o,Y0).call(this,n()?"Pause":"Play")},sW=function(){const{fullscreen:n}=b(this,Cl).$state;k(this,$o,Y0).call(this,n()?"Enter Fullscreen":"Exit Fullscreen")},cW=function(){const{pictureInPicture:n}=b(this,Cl).$state;k(this,$o,Y0).call(this,n()?"Enter PiP":"Exit PiP")},dW=function(){const{textTrack:n}=b(this,Cl).$state;k(this,$o,Y0).call(this,n()?"Closed-Captions On":"Closed-Captions Off")},pW=function(){const{muted:n,volume:a,audioGain:l}=b(this,Cl).$state;k(this,$o,Y0).call(this,n()||a()===0?"Mute":`${Math.round(a()*(l()??1)*100)}% ${k(this,$o,V5).call(this,"Volume")}`)},nd=new WeakMap,W2=new WeakMap,uW=function(){const{seeking:n,currentTime:a}=b(this,Cl).$state,l=n();b(this,nd)>0?(window.clearTimeout(b(this,W2)),j(this,W2,window.setTimeout(()=>{if(!this.scope)return;const s=Re(a),d=Math.abs(s-b(this,nd));if(d>=1){const p=s>=b(this,nd),h=Kg(d);k(this,$o,Y0).call(this,`${k(this,$o,V5).call(this,p?"Seek Forward":"Seek Backward")} ${h}`)}j(this,nd,-1),j(this,W2,-1)},300))):l&&j(this,nd,Re(a))},V5=function(n){var l;const{translations:a}=this.$props;return((l=a==null?void 0:a())==null?void 0:l[n||""])??n},hW=function(){const{label:n,busy:a}=this.$state,l=k(this,$o,V5).call(this,n());if(b(this,G2))return;a.set(!0);const s=window.setTimeout(()=>void a.set(!1),150);return this.el&&Ge(this.el,"aria-label",l),Je(l)&&this.dispatch("change",{detail:l}),()=>window.clearTimeout(s)},Y0=function(n){const{label:a}=this.$state;a.set(n)},V(Qv,"props",{translations:null}),V(Qv,"state",new pc({label:null,busy:!1}));class V$ extends dt{constructor(){super(...arguments);P(this,Bs);P(this,Rs)}onSetup(){j(this,Rs,Rt()),ue(k(this,Bs,mW).bind(this))}onAttach(n){const{pictureInPicture:a,fullscreen:l}=b(this,Rs).$state;Zn(n,"pointer-events","none"),bo(n,"role","group"),this.setAttributes({"data-visible":k(this,Bs,IS).bind(this),"data-fullscreen":l,"data-pip":a}),ue(()=>{this.dispatch("change",{detail:k(this,Bs,IS).call(this)})}),ue(k(this,Bs,fW).bind(this)),ue(()=>{const s=l();for(const d of["top","right","bottom","left"])Zn(n,`padding-${d}`,s&&`env(safe-area-inset-${d})`)})}}Rs=new WeakMap,Bs=new WeakSet,fW=function(){if(!this.el)return;const{nativeControls:n}=b(this,Rs).$state,a=n();Ge(this.el,"aria-hidden",a?"true":null),Zn(this.el,"display",a?"none":null)},mW=function(){const{controls:n}=b(this,Rs).player,{hideDelay:a,hideOnMouseLeave:l}=this.$props;n.defaultDelay=a()===2e3?b(this,Rs).$props.controlsDelay():a(),n.hideOnMouseLeave=l()},IS=function(){const{controlsVisible:n}=b(this,Rs).$state;return n()},V(V$,"props",{hideDelay:2e3,hideOnMouseLeave:!1});class Vke extends dt{onAttach(o){o.style.pointerEvents||Zn(o,"pointer-events","auto")}}const Ip=dc();let zke=0,Uke=(Xk=class extends dt{constructor(){super();P(this,Ua);P(this,Z2,`media-tooltip-${++zke}`);P(this,ad,ct(null));P(this,rd,ct(null));P(this,Um,ct(!1));new lr;const{showDelay:n}=this.$props;new D$({trigger:b(this,ad),content:b(this,rd),showDelay:n,listen(a,l,s){ue(()=>{Fg()&&uo(a,"focus",l),uo(a,"blur",s)}),new go(a).add("touchstart",d=>d.preventDefault(),{passive:!1}).add("mouseenter",l).add("mouseleave",s)},onChange:k(this,Ua,vW).bind(this)})}onAttach(n){n.style.setProperty("display","contents")}onSetup(){ma(Ip,{trigger:b(this,ad),content:b(this,rd),showing:b(this,Um),attachTrigger:k(this,Ua,bW).bind(this),detachTrigger:k(this,Ua,gW).bind(this),attachContent:k(this,Ua,yW).bind(this),detachContent:k(this,Ua,wW).bind(this)})}},Z2=new WeakMap,ad=new WeakMap,rd=new WeakMap,Um=new WeakMap,Ua=new WeakSet,bW=function(n){var l;b(this,ad).set(n);let a=n.getAttribute("data-media-tooltip");a&&((l=this.el)==null||l.setAttribute(`data-media-${a}-tooltip`,"")),Ge(n,"data-describedby",b(this,Z2))},gW=function(n){n.removeAttribute("data-describedby"),n.removeAttribute("aria-describedby"),b(this,ad).set(null)},yW=function(n){n.setAttribute("id",b(this,Z2)),n.style.display="none",bo(n,"role","tooltip"),b(this,rd).set(n)},wW=function(n){n.removeAttribute("id"),n.removeAttribute("role"),b(this,rd).set(null)},vW=function(n){const a=b(this,ad).call(this),l=b(this,rd).call(this);a&&Ge(a,"aria-describedby",n?b(this,Z2):null);for(const s of[this.el,a,l])s&&Ge(s,"data-visible",n);b(this,Um).set(n)},V(Xk,"props",{showDelay:700}),Xk);class Hke extends dt{constructor(){super();P(this,x0);new lr}onConnect(n){At(ns(()=>{if(!this.connectScope)return;k(this,x0,CW).call(this);const a=qo(Ip);At(()=>{const l=k(this,x0,ES).call(this);l&&a.detachTrigger(l)})}))}}x0=new WeakSet,CW=function(){const n=k(this,x0,ES).call(this),a=qo(Ip);n&&a.attachTrigger(n)},ES=function(){const n=this.el.firstElementChild;return(n==null?void 0:n.localName)==="button"||(n==null?void 0:n.getAttribute("role"))==="button"?n:this.el};class z$ extends dt{constructor(){super();P(this,Ls);new lr;const{placement:n}=this.$props;this.setAttributes({"data-placement":n})}onAttach(n){k(this,Ls,TS).call(this,n),Object.assign(n.style,{position:"absolute",top:0,left:0,width:"max-content"})}onConnect(n){k(this,Ls,TS).call(this,n);const a=qo(Ip);At(()=>a.detachContent(n)),At(ns(()=>{this.connectScope&&ue(k(this,Ls,kW).bind(this))}))}}Ls=new WeakSet,TS=function(n){qo(Ip).attachContent(n)},kW=function(){const{showing:n}=qo(Ip);if(!n())return;const{placement:a,offset:l,alignOffset:s}=this.$props;return s$(this.el,k(this,Ls,xW).call(this),a(),{offsetVarName:"media-tooltip",xOffset:s(),yOffset:l()})},xW=function(){return qo(Ip).trigger()},V(z$,"props",{placement:"top center",offset:0,alignOffset:0});let U$=(Qk=class extends dt{constructor(){super();P(this,Hm,ct(!1));new Sn({isPresssed:b(this,Hm)})}get pressed(){return b(this,Hm).call(this)}},Hm=new WeakMap,V(Qk,"props",{disabled:!1,defaultPressed:!1}),Qk);const Kke=U$.prototype;$t(Kke,"pressed");class H$ extends dt{constructor(){super();P(this,kl);P(this,Ps);new Sn({isPresssed:k(this,kl,IW).bind(this),onPress:k(this,kl,SW).bind(this)})}onSetup(){j(this,Ps,Rt());const{canGoogleCast:n,isGoogleCastConnected:a}=b(this,Ps).$state;this.setAttributes({"data-active":a,"data-supported":n,"data-state":k(this,kl,EW).bind(this),"aria-hidden":sn(()=>!n())})}onAttach(n){n.setAttribute("data-media-tooltip","google-cast"),fc(n,k(this,kl,TW).bind(this))}}Ps=new WeakMap,kl=new WeakSet,SW=function(n){b(this,Ps).remote.requestGoogleCast(n)},IW=function(){const{remotePlaybackType:n,remotePlaybackState:a}=b(this,Ps).$state;return n()==="google-cast"&&a()!=="disconnected"},EW=function(){const{remotePlaybackType:n,remotePlaybackState:a}=b(this,Ps).$state;return n()==="google-cast"&&a()},TW=function(){const{remotePlaybackState:n}=b(this,Ps).$state;return`Google Cast ${n()}`},V(H$,"props",Sn.props);class Xg extends dt{constructor(){super(...arguments);P(this,Uo);P(this,ld);P(this,Km)}get video(){return this.$state.video()}onSetup(){j(this,ld,Rt()),j(this,Km,Bu(kp.state)),k(this,Uo,AS).call(this),this.setAttributes({"data-loading":k(this,Uo,_W).bind(this),"data-hidden":this.$state.hidden,"data-error":k(this,Uo,DS).bind(this),"aria-hidden":sn(this.$state.hidden)})}onAttach(n){ue(k(this,Uo,AW).bind(this)),ue(k(this,Uo,DW).bind(this)),ue(k(this,Uo,AS).bind(this)),ue(k(this,Uo,OW).bind(this)),ue(k(this,Uo,RW).bind(this)),ue(k(this,Uo,LW).bind(this))}}ld=new WeakMap,Km=new WeakMap,Uo=new WeakSet,AW=function(){const n=this.$state.video();n&&(n.readyState>=2&&k(this,Uo,_S).call(this),new go(n).add("canplay",k(this,Uo,_S).bind(this)).add("error",k(this,Uo,BW).bind(this)))},DW=function(){const{src:n}=this.$state,{canLoad:a}=b(this,ld).$state;n.set(a()?this.$props.src():null)},AS=function(){const{crossOrigin:n}=this.$props,{crossOrigin:a}=this.$state,{crossOrigin:l}=b(this,ld).$state,s=n()!==null?n():l();a.set(s===!0?"anonymous":s)},_W=function(){const{canPlay:n,hidden:a}=this.$state;return!n()&&!a()},DS=function(){const{error:n}=this.$state;return!Yr(n)},OW=function(){const{src:n,hidden:a}=this.$state,{canLoad:l,duration:s}=b(this,ld).$state;a.set(l()&&(!n()||k(this,Uo,DS).call(this)||!Number.isFinite(s())))},RW=function(){const{src:n,canPlay:a,error:l}=this.$state;n(),a.set(!1),l.set(null)},_S=function(n){const{canPlay:a,error:l}=this.$state;a.set(!0),l.set(null),this.dispatch("can-play",{trigger:n})},BW=function(n){const{canPlay:a,error:l}=this.$state;a.set(!1),l.set(n),this.dispatch("error",{trigger:n})},LW=function(){const{video:n,canPlay:a}=this.$state,{duration:l}=b(this,ld).$state,{pointerRate:s}=b(this,Km),d=n();a()&&d&&Number.isFinite(l())&&Number.isFinite(s())&&(d.currentTime=s()*l())},V(Xg,"props",{src:null,crossOrigin:null}),V(Xg,"state",new pc({video:null,src:null,crossOrigin:null,canPlay:!1,error:null,hidden:!1}));const Gke=Xg.prototype;$t(Gke,"video");class Jv extends dt{constructor(){super(...arguments);P(this,ji);P(this,sd)}onSetup(){j(this,sd,Rt()),ma(Mu,{default:"percent",percent:(n,a)=>Pi(this.$state.value(),a)+"%"}),new ya({getStep:this.$props.step,getKeyStep:this.$props.keyStep,roundValue:Math.round,isDisabled:k(this,ji,jW).bind(this),aria:{valueNow:k(this,ji,PW).bind(this),valueText:k(this,ji,$W).bind(this)},onDragValueChange:k(this,ji,qW).bind(this),onValueChange:k(this,ji,FW).bind(this)}).attach(this),ue(k(this,ji,MW).bind(this)),ue(k(this,ji,NW).bind(this))}onAttach(n){n.setAttribute("data-media-audio-gain-slider",""),bo(n,"aria-label","Audio Boost");const{canSetAudioGain:a}=b(this,sd).$state;this.setAttributes({"data-supported":a,"aria-hidden":sn(()=>!a())})}}sd=new WeakMap,ji=new WeakSet,PW=function(){const{value:n}=this.$state;return Math.round(n())},$W=function(){const{value:n}=this.$state;return n()+"%"},MW=function(){const{min:n,max:a}=this.$props;this.$state.min.set(n()),this.$state.max.set(a())},NW=function(){const{audioGain:n}=b(this,sd).$state,a=((n()??1)-1)*100;this.$state.value.set(a),this.dispatch("value-change",{detail:a})},jW=function(){const{disabled:n}=this.$props,{canSetAudioGain:a}=b(this,sd).$state;return n()||!a()},OS=function(n){if(!n.trigger)return;const a=Pi(1+n.detail/100,2);b(this,sd).remote.changeAudioGain(a,n)},FW=function(n){k(this,ji,OS).call(this,n)},qW=function(n){k(this,ji,OS).call(this,n)},V(Jv,"props",{...ya.props,step:25,keyStep:25,shiftKeyMultiplier:2,min:0,max:300}),V(Jv,"state",Cp);class eC extends dt{constructor(){super(...arguments);P(this,Di);P(this,cd);P(this,Gm,mp(k(this,Di,WW).bind(this),25))}onSetup(){j(this,cd,Rt()),new ya({getStep:this.$props.step,getKeyStep:this.$props.keyStep,roundValue:k(this,Di,KW),isDisabled:k(this,Di,GW).bind(this),aria:{valueNow:k(this,Di,VW).bind(this),valueText:k(this,Di,zW).bind(this)},onDragValueChange:k(this,Di,YW).bind(this),onValueChange:k(this,Di,ZW).bind(this)}).attach(this),ue(k(this,Di,UW).bind(this)),ue(k(this,Di,HW).bind(this))}onAttach(n){n.setAttribute("data-media-speed-slider",""),bo(n,"aria-label","Speed");const{canSetPlaybackRate:a}=b(this,cd).$state;this.setAttributes({"data-supported":a,"aria-hidden":sn(()=>!a())})}}cd=new WeakMap,Di=new WeakSet,VW=function(){const{value:n}=this.$state;return n()},zW=function(){const{value:n}=this.$state;return n()+"x"},UW=function(){const{min:n,max:a}=this.$props;this.$state.min.set(n()),this.$state.max.set(a())},HW=function(){const{playbackRate:n}=b(this,cd).$state,a=n();this.$state.value.set(a),this.dispatch("value-change",{detail:a})},KW=function(n){return Pi(n,2)},GW=function(){const{disabled:n}=this.$props,{canSetPlaybackRate:a}=b(this,cd).$state;return n()||!a()},Gm=new WeakMap,WW=function(n){if(!n.trigger)return;const a=n.detail;b(this,cd).remote.changePlaybackRate(a,n)},ZW=function(n){b(this,Gm).call(this,n)},YW=function(n){b(this,Gm).call(this,n)},V(eC,"props",{...ya.props,step:.25,keyStep:.25,shiftKeyMultiplier:2,min:0,max:2}),V(eC,"state",Cp);class tC extends dt{constructor(){super(...arguments);P(this,Ji);P(this,xr);P(this,Y2,rr(()=>{const{qualities:n}=b(this,xr).$state;return T$(n())}));P(this,Wm,mp(k(this,Ji,oZ).bind(this),25))}onSetup(){j(this,xr,Rt()),new ya({getStep:this.$props.step,getKeyStep:this.$props.keyStep,roundValue:Math.round,isDisabled:k(this,Ji,tZ).bind(this),aria:{valueNow:k(this,Ji,XW).bind(this),valueText:k(this,Ji,QW).bind(this)},onDragValueChange:k(this,Ji,nZ).bind(this),onValueChange:k(this,Ji,iZ).bind(this)}).attach(this),ue(k(this,Ji,JW).bind(this)),ue(k(this,Ji,eZ).bind(this))}onAttach(n){n.setAttribute("data-media-quality-slider",""),bo(n,"aria-label","Video Quality");const{qualities:a,canSetQuality:l}=b(this,xr).$state,s=rr(()=>l()&&a().length>0);this.setAttributes({"data-supported":s,"aria-hidden":sn(()=>!s())})}}xr=new WeakMap,Y2=new WeakMap,Ji=new WeakSet,XW=function(){const{value:n}=this.$state;return n()},QW=function(){const{quality:n}=b(this,xr).$state;if(!n())return"";const{height:a,bitrate:l}=n(),s=l&&l>0?`${(l/1e6).toFixed(2)} Mbps`:null;return a?`${a}p${s?` (${s})`:""}`:"Auto"},JW=function(){const n=b(this,Y2).call(this);this.$state.max.set(Math.max(0,n.length-1))},eZ=function(){let{quality:n}=b(this,xr).$state,a=b(this,Y2).call(this),l=Math.max(0,a.indexOf(n()));this.$state.value.set(l),this.dispatch("value-change",{detail:l})},tZ=function(){const{disabled:n}=this.$props,{canSetQuality:a,qualities:l}=b(this,xr).$state;return n()||l().length<=1||!a()},Wm=new WeakMap,oZ=function(n){if(!n.trigger)return;const{qualities:a}=b(this,xr),l=Re(b(this,Y2))[n.detail];b(this,xr).remote.changeQuality(a.indexOf(l),n)},iZ=function(n){b(this,Wm).call(this,n)},nZ=function(n){b(this,Wm).call(this,n)},V(tC,"props",{...ya.props,step:1,keyStep:1,shiftKeyMultiplier:1}),V(tC,"state",Cp);class oC extends dt{constructor(){super(...arguments);P(this,nt);P(this,ra);P(this,S0);P(this,X2);P(this,xl,null);P(this,Nn,[]);P(this,I0,ct(null));P(this,jn,ct([]));P(this,$s,ct(-1));P(this,E0,ct(-1));P(this,dd,0);P(this,d5,Pu(n=>{var h;let a,l=b(this,jn).call(this),{seekableStart:s}=b(this,ra).$state,d=s(),p=k(this,nt,U5).call(this,l);for(let f=b(this,dd);f<b(this,Nn).length;f++)if(a=k(this,nt,H5).call(this,l[f],n,d,p),(h=b(this,Nn)[f])==null||h.style.setProperty("--chapter-progress",a+"%"),a<100){j(this,dd,f);break}}));P(this,p5,rr(k(this,nt,pZ).bind(this)));P(this,Zm,uv(()=>{const n=Re(b(this,I0));!this.scope||!n||!n.cues.length||(b(this,jn).set(k(this,nt,uZ).call(this,n.cues)),b(this,$s).set(0),j(this,dd,0))},150,!0))}get cues(){return b(this,jn).call(this)}get activeCue(){return b(this,jn).call(this)[b(this,$s).call(this)]||null}get activePointerCue(){return b(this,jn).call(this)[b(this,E0).call(this)]||null}onSetup(){j(this,ra,Rt()),j(this,S0,Bu(Wg.state))}onAttach(n){jg(b(this,ra).textTracks,"chapters",k(this,nt,RS).bind(this)),ue(k(this,nt,hZ).bind(this))}onConnect(){At(()=>k(this,nt,BS).bind(this))}onDestroy(){k(this,nt,RS).call(this,null)}setRefs(n){var a;if(j(this,Nn,n),(a=b(this,X2))==null||a.dispose(),b(this,Nn).length===1){const l=b(this,Nn)[0];l.style.width="100%",l.style.setProperty("--chapter-fill","var(--slider-fill)"),l.style.setProperty("--chapter-progress","var(--slider-progress)")}else b(this,Nn).length>0&&kn(()=>k(this,nt,aZ).call(this),j(this,X2,cc()))}}ra=new WeakMap,S0=new WeakMap,X2=new WeakMap,xl=new WeakMap,Nn=new WeakMap,I0=new WeakMap,jn=new WeakMap,$s=new WeakMap,E0=new WeakMap,dd=new WeakMap,nt=new WeakSet,RS=function(n){Re(b(this,I0))!==n&&(k(this,nt,BS).call(this),b(this,I0).set(n))},BS=function(){var n;j(this,Nn,[]),b(this,jn).set([]),b(this,$s).set(-1),b(this,E0).set(-1),j(this,dd,0),(n=b(this,X2))==null||n.dispose()},aZ=function(){b(this,Nn).length&&ue(k(this,nt,rZ).bind(this))},rZ=function(){const{hidden:n}=b(this,S0);n()||(ue(k(this,nt,lZ).bind(this)),ue(k(this,nt,sZ).bind(this)),ue(k(this,nt,cZ).bind(this)),ue(k(this,nt,dZ).bind(this)))},lZ=function(){const n=b(this,jn).call(this);if(!n.length)return;let a,{seekableStart:l,seekableEnd:s}=b(this,ra).$state,d=l(),p=s()||n[n.length-1].endTime,h=p-d,f=100;for(let y=0;y<n.length;y++)if(a=n[y],b(this,Nn)[y]){const w=y===n.length-1?f:Pi((a.endTime-Math.max(d,a.startTime))/h*100,3);b(this,Nn)[y].style.width=w+"%",f-=w}},sZ=function(){let{liveEdge:n,seekableStart:a,seekableEnd:l}=b(this,ra).$state,{fillPercent:s,value:d}=b(this,S0),p=b(this,jn).call(this),h=n(),f=Re(b(this,$s)),y=p[f],w=h?b(this,jn).length-1:k(this,nt,PS).call(this,y&&y.startTime/l()*100<=Re(d)?f:0,s());h||!y?k(this,nt,z5).call(this,0,p.length,100):w>f?k(this,nt,z5).call(this,f,w,100):w<f&&k(this,nt,z5).call(this,w+1,f+1,0);const v=h?100:k(this,nt,H5).call(this,p[w],s(),a(),k(this,nt,U5).call(this,p));k(this,nt,LS).call(this,b(this,Nn)[w],v),b(this,$s).set(w)},cZ=function(){let{hidden:n,pointerPercent:a}=b(this,S0);if(n()){b(this,E0).set(-1);return}const l=k(this,nt,PS).call(this,0,a());b(this,E0).set(l)},z5=function(n,a,l){for(let s=n;s<a;s++)k(this,nt,LS).call(this,b(this,Nn)[s],l)},LS=function(n,a){n&&(n.style.setProperty("--chapter-fill",a+"%"),Ge(n,"data-active",a>0&&a<100),Ge(n,"data-ended",a===100))},PS=function(n,a){let l=0,s=b(this,jn).call(this);if(a===0)return 0;if(a===100)return s.length-1;let{seekableStart:d}=b(this,ra).$state,p=d(),h=k(this,nt,U5).call(this,s);for(let f=n;f<s.length;f++)if(l=k(this,nt,H5).call(this,s[f],a,p,h),l>=0&&l<100)return f;return 0},dZ=function(){b(this,d5).call(this,b(this,p5).call(this))},d5=new WeakMap,p5=new WeakMap,pZ=function(){const{bufferedEnd:n,duration:a}=b(this,ra).$state;return Pi(Math.min(n()/Math.max(a(),1),1),3)*100},U5=function(n){var s;const{seekableEnd:a}=b(this,ra).$state,l=a();return Number.isFinite(l)?l:((s=n[n.length-1])==null?void 0:s.endTime)||0},H5=function(n,a,l,s){if(!n||b(this,jn).call(this).length===0)return 0;const p=s-l,h=Math.max(0,n.startTime-l),f=Math.min(s,n.endTime)-l,y=h/p,w=y*100,v=Math.min(1,y+(f-h)/p)*100;return Math.max(0,Pi(a>=v?100:(a-w)/(v-w)*100,3))},uZ=function(n){let a=[],{seekableStart:l,seekableEnd:s,duration:d}=b(this,ra).$state,p=l(),h=s();n=n.filter(w=>w.startTime<=h&&w.endTime>=p);const f=n[0];f&&f.startTime>p&&a.push(new window.VTTCue(p,f.startTime,""));for(let w=0;w<n.length-1;w++){const v=n[w],C=n[w+1];if(a.push(v),C){const E=C.startTime-v.endTime;E>0&&a.push(new window.VTTCue(v.endTime,v.endTime+E,""))}}const y=n[n.length-1];if(y){a.push(y);const w=d();w>=0&&w-y.endTime>1&&a.push(new window.VTTCue(y.endTime,d(),""))}return a},hZ=function(){const{source:n}=b(this,ra).$state;n(),k(this,nt,fZ).call(this)},fZ=function(){if(!this.scope)return;const{disabled:n}=this.$props;if(n()){b(this,jn).set([]),b(this,$s).set(0),j(this,dd,0);return}const a=b(this,I0).call(this);if(a){const l=b(this,Zm).bind(this);l(),new go(a).add("add-cue",l).add("remove-cue",l),ue(k(this,nt,mZ).bind(this))}return j(this,xl,k(this,nt,yZ).call(this)),b(this,xl)&&ue(k(this,nt,bZ).bind(this)),()=>{b(this,xl)&&(b(this,xl).textContent="",j(this,xl,null))}},mZ=function(){b(this,ra).$state.duration(),b(this,Zm).call(this)},Zm=new WeakMap,bZ=function(){const n=this.activePointerCue||this.activeCue;b(this,xl)&&(b(this,xl).textContent=(n==null?void 0:n.text)||"")},gZ=function(){let n=this.el;for(;n&&n.getAttribute("role")!=="slider";)n=n.parentElement;return n},yZ=function(){const n=k(this,nt,gZ).call(this);return n?n.querySelector('[data-part="chapter-title"]'):null},V(oC,"props",{disabled:!1});const Qg=oC.prototype;$t(Qg,"cues"),$t(Qg,"activeCue"),$t(Qg,"activePointerCue"),ei(Qg,"setRefs");class iC extends dt{constructor(){super();P(this,Q2);P(this,Ms);j(this,Ms,new Sp),b(this,Ms).onValueChange=k(this,Q2,vZ).bind(this)}get values(){return b(this,Ms).values}get value(){return b(this,Ms).value}set value(n){b(this,Ms).value=n}onSetup(){ue(k(this,Q2,wZ).bind(this))}}Ms=new WeakMap,Q2=new WeakSet,wZ=function(){b(this,Ms).value=this.$props.value()},vZ=function(n,a){const l=this.createEvent("change",{detail:n,trigger:a});this.dispatch(l)},V(iC,"props",{value:""});const K$=iC.prototype;$t(K$,"values"),$t(K$,"value");var Wke=Object.defineProperty,Zke=Object.getOwnPropertyDescriptor,nC=(i,o,n,a)=>{for(var l=Zke(o,n),s=i.length-1,d;s>=0;s--)(d=i[s])&&(l=d(o,n,l)||l);return l&&Wke(o,n,l),l};class Fh extends dt{constructor(){super();P(this,Fn);P(this,Sl);P(this,T0);P(this,Ns);P(this,J2,ct(null));P(this,Il,ct([]));j(this,Ns,new Sp),b(this,Ns).onValueChange=k(this,Fn,IZ).bind(this)}get value(){return b(this,Ns).value}get disabled(){var n;return!((n=b(this,Il).call(this))!=null&&n.length)}onSetup(){j(this,Sl,Rt()),ba($i)&&j(this,T0,qo($i));const{thumbnails:n}=this.$props;this.setAttributes({"data-thumbnails":()=>!!n()})}onAttach(n){var a;(a=b(this,T0))==null||a.attachObserver({onOpen:k(this,Fn,CZ).bind(this)})}getOptions(){const{seekableStart:n,seekableEnd:a}=b(this,Sl).$state,l=n(),s=a();return b(this,Il).call(this).map((d,p)=>({cue:d,value:p.toString(),label:d.text,startTime:Hg(Math.max(0,d.startTime-l)),duration:Kg(Math.min(s,d.endTime)-Math.max(l,d.startTime))}))}onConnect(n){ue(k(this,Fn,$S).bind(this)),ue(k(this,Fn,SZ).bind(this)),ue(k(this,Fn,kZ).bind(this)),jg(b(this,Sl).textTracks,"chapters",b(this,J2).set)}}Sl=new WeakMap,T0=new WeakMap,Ns=new WeakMap,J2=new WeakMap,Il=new WeakMap,Fn=new WeakSet,CZ=function(){Re(()=>k(this,Fn,$S).call(this))},kZ=function(){const n=b(this,J2).call(this);if(!n)return;const a=k(this,Fn,xZ).bind(this,n);return a(),new go(n).add("add-cue",a).add("remove-cue",a),()=>{b(this,Il).set([])}},xZ=function(n){const{seekableStart:a,seekableEnd:l}=b(this,Sl).$state,s=a(),d=l();b(this,Il).set([...n.cues].filter(p=>p.startTime<=d&&p.endTime>=s))},$S=function(){var y;if(!((y=b(this,T0))!=null&&y.expanded()))return;if(!b(this,J2).call(this)){b(this,Ns).value="-1";return}const{realCurrentTime:a,seekableStart:l,seekableEnd:s}=b(this,Sl).$state,d=l(),p=s(),h=a(),f=b(this,Il).call(this).findIndex(w=>bv(w,h));b(this,Ns).value=f.toString(),f>=0&&ns(()=>{if(!this.connectScope)return;const w=b(this,Il).call(this)[f],v=this.el.querySelector("[aria-checked='true']"),C=Math.max(d,w.startTime),E=Math.min(p,w.endTime)-C,T=Math.max(0,h-C)/E*100;v&&Zn(v,"--progress",Pi(T,3)+"%")})},SZ=function(){var n;(n=b(this,T0))==null||n.disable(this.disabled)},IZ=function(n,a){if(this.disabled||!a)return;const l=+n,s=b(this,Il).call(this),{clipStartTime:d}=b(this,Sl).$state;Li(l)&&(s!=null&&s[l])&&(b(this,Ns).value=l.toString(),b(this,Sl).remote.seek(s[l].startTime-d(),a),this.dispatch("change",{detail:s[l],trigger:a}))},V(Fh,"props",{thumbnails:null}),nC([$t],Fh.prototype,"value"),nC([$t],Fh.prototype,"disabled"),nC([ei],Fh.prototype,"getOptions");const Yke=[1,1.25,1.5,1.75,2,2.5,3,4];class aC extends dt{constructor(){super();P(this,Ha);P(this,pd);P(this,e1);P(this,A0);j(this,A0,new Sp),b(this,A0).onValueChange=k(this,Ha,_Z).bind(this)}get value(){return b(this,A0).value}get disabled(){const{gains:n}=this.$props,{canSetAudioGain:a}=b(this,pd).$state;return!a()||n().length===0}onSetup(){j(this,pd,Rt()),ba($i)&&j(this,e1,qo($i))}onConnect(n){ue(k(this,Ha,EZ).bind(this)),ue(k(this,Ha,TZ).bind(this)),ue(k(this,Ha,AZ).bind(this))}getOptions(){const{gains:n,normalLabel:a}=this.$props;return n().map(l=>({label:l===1||l===null?a:String(l*100)+"%",value:l.toString()}))}}pd=new WeakMap,e1=new WeakMap,A0=new WeakMap,Ha=new WeakSet,EZ=function(){b(this,A0).value=k(this,Ha,DZ).call(this)},TZ=function(){var s;const{normalLabel:n}=this.$props,{audioGain:a}=b(this,pd).$state,l=a();(s=b(this,e1))==null||s.hint.set(l===1||l==null?n():String(l*100)+"%")},AZ=function(){var n;(n=b(this,e1))==null||n.disable(this.disabled)},DZ=function(){var a;const{audioGain:n}=b(this,pd).$state;return((a=n())==null?void 0:a.toString())??"1"},_Z=function(n,a){if(this.disabled)return;const l=+n;b(this,pd).remote.changeAudioGain(l,a),this.dispatch("change",{detail:l,trigger:a})},V(aC,"props",{normalLabel:"Disabled",gains:Yke});const rC=aC.prototype;$t(rC,"value"),$t(rC,"disabled"),ei(rC,"getOptions");class G$ extends dt{constructor(){super(...arguments);P(this,qn);P(this,Ea);P(this,t1,null);P(this,El,0);P(this,Ym,-1)}onSetup(){j(this,Ea,Rt());const{event:n,action:a}=this.$props;this.setAttributes({event:n,action:a})}onAttach(n){n.setAttribute("data-media-gesture",""),n.style.setProperty("pointer-events","none")}onConnect(n){var a;j(this,t1,(a=b(this,Ea).player.el)==null?void 0:a.querySelector("[data-media-provider]")),ue(k(this,qn,OZ).bind(this))}}Ea=new WeakMap,t1=new WeakMap,qn=new WeakSet,OZ=function(){let n=this.$props.event(),a=this.$props.disabled();!b(this,t1)||!n||a||(/^dbl/.test(n)&&(n=n.split(/^dbl/)[1]),(n==="pointerup"||n==="pointerdown")&&b(this,Ea).$state.pointer()==="coarse"&&(n=n==="pointerup"?"touchend":"touchstart"),uo(b(this,t1),n,k(this,qn,RZ).bind(this),{passive:!1}))},El=new WeakMap,Ym=new WeakMap,RZ=function(n){if(this.$props.disabled()||BP(n)&&(n.button!==0||b(this,Ea).activeMenu)||Dg(n)&&b(this,Ea).activeMenu||yv(n)||!k(this,qn,BZ).call(this,n))return;n.MEDIA_GESTURE=!0,n.preventDefault();const a=Re(this.$props.event);if(!(a==null?void 0:a.startsWith("dbl")))b(this,El)===0&&setTimeout(()=>{b(this,El)===1&&k(this,qn,MS).call(this,n)},250);else if(b(this,El)===1){queueMicrotask(()=>k(this,qn,MS).call(this,n)),clearTimeout(b(this,Ym)),j(this,El,0);return}b(this,El)===0&&j(this,Ym,window.setTimeout(()=>{j(this,El,0)},275)),Cz(this,El)._++},MS=function(n){this.el.setAttribute("data-triggered",""),requestAnimationFrame(()=>{k(this,qn,LZ).call(this)&&k(this,qn,PZ).call(this,Re(this.$props.action),n),requestAnimationFrame(()=>{this.el.removeAttribute("data-triggered")})})},BZ=function(n){if(!this.el)return!1;if(BP(n)||gve(n)||Dg(n)){const a=Dg(n)?n.changedTouches[0]??n.touches[0]:void 0,l=(a==null?void 0:a.clientX)??n.clientX,s=(a==null?void 0:a.clientY)??n.clientY,d=this.el.getBoundingClientRect(),p=s>=d.top&&s<=d.bottom&&l>=d.left&&l<=d.right;return n.type.includes("leave")?!p:p}return!0},LZ=function(){const n=b(this,Ea).player.el.querySelectorAll("[data-media-gesture][data-triggered]");return Array.from(n).sort((a,l)=>+getComputedStyle(l).zIndex-+getComputedStyle(a).zIndex)[0]===this.el},PZ=function(n,a){if(!n)return;const l=new Ot("will-trigger",{detail:n,cancelable:!0,trigger:a});if(this.dispatchEvent(l),l.defaultPrevented)return;const[s,d]=n.replace(/:([a-z])/,"-$1").split(":");n.includes(":fullscreen")?b(this,Ea).remote.toggleFullscreen("prefer-media",a):n.includes("seek:")?b(this,Ea).remote.seek(Re(b(this,Ea).$state.currentTime)+(+d||0),a):b(this,Ea).remote[Tve(s)](a),this.dispatch("trigger",{detail:n,trigger:a})},V(G$,"props",{disabled:!1,event:void 0,action:void 0});class Xke{constructor(o){P(this,Xm);V(this,"priority",10);P(this,o1,null);P(this,js);P(this,Fs);j(this,js,o)}attach(){}canRender(){return!0}detach(){var o;(o=b(this,Fs))==null||o.abort(),j(this,Fs,void 0),b(this,js).reset(),j(this,o1,null)}changeTrack(o){var n;!o||b(this,o1)===o||((n=b(this,Fs))==null||n.abort(),j(this,Fs,new go(o)),o.readyState<2?(b(this,js).reset(),b(this,Fs).add("load",()=>k(this,Xm,NS).call(this,o),{once:!0})):k(this,Xm,NS).call(this,o),b(this,Fs).add("add-cue",a=>{b(this,js).addCue(a.detail)}).add("remove-cue",a=>{b(this,js).removeCue(a.detail)}),j(this,o1,o))}}o1=new WeakMap,js=new WeakMap,Fs=new WeakMap,Xm=new WeakSet,NS=function(o){b(this,js).changeTrack({cues:[...o.cues],regions:[...o.regions]})};const Tl=class Tl extends dt{constructor(){super(...arguments);P(this,Dt);P(this,la);P(this,qs,-1)}onSetup(){j(this,la,Rt()),this.setAttributes({"aria-hidden":sn(k(this,Dt,K5).bind(this))})}onAttach(n){n.style.setProperty("pointer-events","none")}onConnect(n){Tl.lib()||Promise.resolve().then(()=>F4).then(a=>Tl.lib.set(a)),ue(k(this,Dt,$Z).bind(this))}};la=new WeakMap,Dt=new WeakSet,K5=function(){const{textTrack:n,remotePlaybackState:a,iOSControls:l}=b(this,la).$state,s=n();return l()||a()==="connected"||!s||!xn(s)},$Z=function(){if(!Tl.lib())return;const{viewType:n}=b(this,la).$state;return n()==="audio"?k(this,Dt,MZ).call(this):k(this,Dt,FZ).call(this)},MZ=function(){return ue(k(this,Dt,NZ).bind(this)),k(this,Dt,FS).call(this,null),()=>{this.el.textContent=""}},NZ=function(){if(k(this,Dt,K5).call(this))return;k(this,Dt,jS).call(this);const{textTrack:n}=b(this,la).$state;uo(n(),"cue-change",k(this,Dt,jS).bind(this)),ue(k(this,Dt,jZ).bind(this))},jS=function(){this.el.textContent="",b(this,qs)>=0&&k(this,Dt,G5).call(this);const{realCurrentTime:n,textTrack:a}=b(this,la).$state,{renderVTTCueString:l}=Tl.lib(),s=Re(n),d=Re(a).activeCues;for(const p of d){const h=k(this,Dt,VS).call(this),f=k(this,Dt,zS).call(this);f.innerHTML=l(p,s),h.append(f),this.el.append(f)}},jZ=function(){const{realCurrentTime:n}=b(this,la).$state,{updateTimedVTTCueNodes:a}=Tl.lib();a(this.el,n())},FZ=function(){const{CaptionsRenderer:n}=Tl.lib(),a=new n(this.el),l=new Xke(a);return b(this,la).textRenderers.add(l),ue(k(this,Dt,qZ).bind(this,a)),ue(k(this,Dt,VZ).bind(this,a)),k(this,Dt,FS).call(this,a),()=>{this.el.textContent="",b(this,la).textRenderers.remove(l),a.destroy()}},qZ=function(n){n.dir=this.$props.textDir()},VZ=function(n){var s;if(k(this,Dt,K5).call(this))return;const{realCurrentTime:a,textTrack:l}=b(this,la).$state;n.currentTime=a(),b(this,qs)>=0&&((s=l())!=null&&s.activeCues[0])&&k(this,Dt,G5).call(this)},FS=function(n){const a=b(this,la).player;if(!a)return;const l=k(this,Dt,zZ).bind(this,n);uo(a,"vds-font-change",l)},zZ=function(n){var l;if(b(this,qs)>=0){k(this,Dt,qS).call(this);return}const{textTrack:a}=b(this,la).$state;(l=a())!=null&&l.activeCues[0]?n==null||n.update(!0):k(this,Dt,UZ).call(this)},UZ=function(){var l,s;const n=k(this,Dt,VS).call(this);Ge(n,"data-example","");const a=k(this,Dt,zS).call(this);Ge(a,"data-example",""),a.textContent=this.$props.exampleText(),n==null||n.append(a),(l=this.el)==null||l.append(n),(s=this.el)==null||s.setAttribute("data-example",""),k(this,Dt,qS).call(this)},qs=new WeakMap,qS=function(){window.clearTimeout(b(this,qs)),j(this,qs,window.setTimeout(k(this,Dt,G5).bind(this),2500))},G5=function(){var n,a;(n=this.el)==null||n.removeAttribute("data-example"),(a=this.el)!=null&&a.querySelector("[data-example]")&&(this.el.textContent=""),j(this,qs,-1)},VS=function(){const n=document.createElement("div");return Ge(n,"data-part","cue-display"),n},zS=function(){const n=document.createElement("div");return Ge(n,"data-part","cue"),n},V(Tl,"props",{textDir:"ltr",exampleText:"Captions look like this."}),V(Tl,"lib",ct(null));let lC=Tl;/**
|
|
3141
3141
|
* @license
|