@webitel/ui-sdk 25.6.24 → 25.6.25
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/ui-sdk.umd.cjs
CHANGED
|
@@ -26,5 +26,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
26
26
|
array and $emits "input" event.
|
|
27
27
|
|
|
28
28
|
True: "tag" method only $emits "tag" event. Tag addition is responsibility of client side.
|
|
29
|
-
`}},emits:["input","tag","search-change","closed"],data:()=>({defaultOptionLabel:"label",multiple:!0}),created(){this.isApiMode||this.initializeOptions()},methods:{getTagOptionLabel({optionLabel:e,option:n}){const r=this.getOptionLabel({optionLabel:e,option:n});return typeof r=="object"?n.label:r},initializeOptions(){if(!this.value)return[];const e=this.value.filter(n=>!this.options.find(r=>h1(r,n)));this.options.unshift(...e)}}},DO={class:"multiselect__loading-wrapper"};function OO(e,n,r,i,o,l){const s=a.resolveComponent("wt-label"),c=a.resolveComponent("wt-icon-btn"),d=a.resolveComponent("wt-chip"),u=a.resolveComponent("wt-loader"),h=a.resolveComponent("vue-multiselect"),p=a.resolveComponent("wt-input-info"),m=a.resolveDirective("observe-visibility");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([{"wt-tags-input--disabled":e.disabled,"wt-tags-input--invalid":e.invalid,"wt-tags-input--loading":e.isLoading},"wt-tags-input"])},[e.hasLabel?(a.openBlock(),a.createBlock(s,a.mergeProps({key:0},e.labelProps,{disabled:e.disabled,invalid:e.invalid,class:"wt-tags-input__label"}),{default:a.withCtx(()=>[a.renderSlot(e.$slots,"label",a.normalizeProps(a.guardReactiveProps({label:e.label})),()=>[a.createTextVNode(a.toDisplayString(e.requiredLabel),1)],!0)],void 0,!0),_:3},16,["disabled","invalid"])):a.createCommentVNode("",!0),a.createVNode(h,a.mergeProps(e.$attrs,{ref:"vue-multiselect","close-on-select":!1,disabled:e.disabled,"internal-search":!e.searchMethod,label:e.selectOptionLabel,loading:!1,"model-value":e.selectValue,multiple:e.multiple,options:e.selectOptions,placeholder:e.placeholder||e.label,taggable:r.taggable,"track-by":r.trackBy,class:"wt-tags-input__select"},a.toHandlers(e.listeners)),a.createSlots({tag:a.withCtx(({option:w,remove:x})=>[a.createVNode(d,{class:"multiselect__custom-tag"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(l.getTagOptionLabel({option:w,optionLabel:e.optionLabel}))+" ",1),a.createVNode(c,{color:"on-primary",icon:"close--filled",size:"sm",onClick:b=>x(w)},null,8,["onClick"])],void 0,!0),_:2},1024)]),option:a.withCtx(({option:w})=>[a.renderSlot(e.$slots,"option",a.normalizeProps(a.guardReactiveProps({option:w,optionLabel:e.optionLabel})),()=>[a.createTextVNode(a.toDisplayString(l.getTagOptionLabel({option:w,optionLabel:e.optionLabel})),1)],!0)]),caret:a.withCtx(({toggle:w})=>[a.createVNode(c,{disabled:e.disabled,class:"multiselect__select",color:"active",icon:"arrow-down",onMousedown:a.withModifiers(w,["prevent","stop"])},null,8,["disabled","onMousedown"])]),beforeList:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",DO,[a.createVNode(u,{size:"sm"})],512),[[a.vShow,e.isLoading]])]),_:2},[e.showIntersectionObserver?{name:"afterList",fn:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",null,null,512),[[m,e.handleAfterListIntersect]])]),key:"0"}:void 0]),1040,["disabled","internal-search","label","model-value","multiple","options","placeholder","taggable","track-by"]),e.isValidation?(a.openBlock(),a.createBlock(p,{key:1,invalid:e.invalid},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(e.validationText),1)],void 0,!0),_:1},8,["invalid"])):a.createCommentVNode("",!0)],2)}const VO=ye(NO,[["render",OO],["__scopeId","data-v-1714b524"]]),PO={name:"WtTextarea",mixins:[Ar],props:{value:{type:String,default:""},label:{type:String,default:""},placeholder:{type:String},disabled:{type:Boolean,default:!1,description:"Native textarea disabled attribute"},name:{type:String,default:""},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:e=>this.$emit("input",e.target.value),keypress:e=>this.handleKeypress(e)}},requiredLabel(){return this.required?`${this.label}*`:this.label}},mounted(){this.updateInputPaddings()},updated(){this.autoresize&&!this.value&&this.resetGrow()},methods:{handleKeypress(e){this.autoresize&&e.key==="Enter"&&!e.shiftKey&&(this.$emit("enter"),e.preventDefault())},autoGrow(){if(!this.autoresize)return;const e=this.$refs["wt-textarea"],n=2;e.style.height="auto",e.style.height=e.scrollHeight+n+"px"},resetGrow(){const e=this.$refs["wt-textarea"];e.style.height="auto"},updateInputPaddings(){const e=this.$refs["after-wrapper"].offsetWidth,n=this.$refs["wt-textarea"],r=getComputedStyle(document.documentElement).getPropertyValue("--textarea-padding");n.style.paddingRight=`calc(${r} * 2 + ${e}px)`}}},$O={class:"wt-textarea__wrapper"},FO=["id","disabled","placeholder","value"],IO={ref:"after-wrapper",class:"wt-textarea__after-wrapper"};function RO(e,n,r,i,o,l){const s=a.resolveComponent("wt-label"),c=a.resolveComponent("wt-icon-btn"),d=a.resolveComponent("wt-input-info");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([{"wt-textarea--disabled":r.disabled,"wt-textarea--invalid":e.invalid,"wt-textarea--autoresize":r.autoresize},"wt-textarea"])},[a.createVNode(s,a.mergeProps(r.labelProps,{disabled:r.disabled,for:r.name,invalid:e.invalid}),{default:a.withCtx(()=>[a.renderSlot(e.$slots,"label",a.normalizeProps(a.guardReactiveProps({label:r.label})),()=>[a.createTextVNode(a.toDisplayString(l.requiredLabel),1)],!0)],void 0,!0),_:3},16,["disabled","for","invalid"]),a.createElementVNode("div",$O,[a.createElementVNode("textarea",a.mergeProps({id:r.name,ref:"wt-textarea",disabled:r.disabled,placeholder:r.placeholder||r.label,value:r.value,rows:"1",class:"wt-textarea__textarea"},a.toHandlers(l.listeners,!0),{onInput:n[0]||(n[0]=(...u)=>l.autoGrow&&l.autoGrow(...u))}),null,16,FO),a.createElementVNode("div",IO,[a.renderSlot(e.$slots,"after-input",{},void 0,!0),a.createVNode(c,{class:a.normalizeClass([{hidden:!r.value},"wt-textarea__reset-icon-btn"]),disabled:r.disabled,icon:"close--filled",size:"sm",onClick:n[1]||(n[1]=u=>e.$emit("input",""))},null,8,["class","disabled"])],512)]),e.isValidation?(a.openBlock(),a.createBlock(d,{key:0,invalid:e.invalid},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(e.validationText),1)],void 0,!0),_:1},8,["invalid"])):a.createCommentVNode("",!0)],2)}const HO=ye(PO,[["render",RO],["__scopeId","data-v-f0fc77c1"]]),qO={name:"WtTimeInput",mixins:[Ar],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:e=>this.$emit("input",e.target.value)}}}},zO={class:"wt-time-input__wrapper"},UO=["disabled","max","value"];function jO(e,n,r,i,o,l){const s=a.resolveComponent("wt-label"),c=a.resolveComponent("wt-input-info");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([{"wt-time-input--disabled":r.disabled,"wt-time-input--invalid":e.invalid},"wt-time-input"])},[l.hasLabel?(a.openBlock(),a.createBlock(s,a.mergeProps({key:0},r.labelProps,{disabled:r.disabled,invalid:e.invalid}),{default:a.withCtx(()=>[a.renderSlot(e.$slots,"label",a.normalizeProps(a.guardReactiveProps({label:r.label})),()=>[a.createTextVNode(a.toDisplayString(r.label),1)],!0)],void 0,!0),_:3},16,["disabled","invalid"])):a.createCommentVNode("",!0),a.createElementVNode("div",zO,[a.createElementVNode("input",a.mergeProps({disabled:r.disabled,max:r.maxValue,min:0,value:r.value,class:"wt-time-input__input",type:"number"},a.toHandlers(l.listeners,!0)),null,16,UO)]),l.showInfo?(a.openBlock(),a.createBlock(c,{key:1,invalid:e.invalid},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(e.validationText),1)],void 0,!0),_:1},8,["invalid"])):a.createCommentVNode("",!0)],2)}const WO=ye(qO,[["render",jO],["__scopeId","data-v-ae7cf0e8"]]),f1=60*60,ls=60,ZO={name:"WtTimepicker",mixins:[Ar],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/f1)},set(e){const n=this.dateMode?new Date(this.value).setHours(e):this.value-this.hour*f1+e*f1;this.$emit("input",n)}},min:{get(){return this.dateMode?new Date(+this.value).getMinutes():Math.floor(this.value/ls%60)},set(e){const n=this.dateMode?new Date(this.value).setMinutes(e):this.value-this.min*ls+e*ls;this.$emit("input",n)}},sec:{get(){return this.dateMode?new Date(+this.value).getSeconds():Math.floor(this.value%60)},set(e){const n=this.dateMode?new Date(this.value).setSeconds(e):this.value-this.sec+ +e;this.$emit("input",n)}},requiredLabel(){return this.required?`${this.label} (${this.format})*`:`${this.label} (${this.format})`}},methods:{onHoursBlurEvent(){const e=this.dateMode?new Date(this.value).setHours(this.hour):this.value-this.hour*f1+this.hour*f1;this.$emit("input",0),this.$nextTick(()=>{this.$emit("input",e)})}}},YO={class:"wt-timepicker__wrapper"};function GO(e,n,r,i,o,l){const s=a.resolveComponent("wt-label"),c=a.resolveComponent("wt-time-input"),d=a.resolveComponent("wt-input-info");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([{"wt-timepicker--invalid":e.invalid},"wt-timepicker"])},[r.label||!r.noLabel?(a.openBlock(),a.createBlock(s,a.mergeProps({key:0},r.labelProps,{invalid:e.invalid}),{default:a.withCtx(()=>[a.renderSlot(e.$slots,"label",a.normalizeProps(a.guardReactiveProps({label:r.label})),()=>[a.createTextVNode(a.toDisplayString(l.requiredLabel),1)],!0)],void 0,!0),_:3},16,["invalid"])):a.createCommentVNode("",!0),a.createElementVNode("div",YO,[l.isHour?(a.openBlock(),a.createBlock(c,{key:0,disabled:r.disabled,label:l.labelHours,"max-value":r.dateMode?null:23,v:e.v,value:l.hour,"hide-input-info":"",onBlur:l.onHoursBlurEvent,onInput:n[0]||(n[0]=u=>l.hour=u)},null,8,["disabled","label","max-value","v","value","onBlur"])):a.createCommentVNode("",!0),l.isMin?(a.openBlock(),a.createBlock(c,{key:1,disabled:r.disabled,label:l.labelMin,"max-value":59,v:e.v,value:l.min,"hide-input-info":"",onInput:n[1]||(n[1]=u=>l.min=u)},null,8,["disabled","label","v","value"])):a.createCommentVNode("",!0),l.isSec?(a.openBlock(),a.createBlock(c,{key:2,disabled:r.disabled,label:l.labelSec,"max-value":59,v:e.v,value:l.sec,"hide-input-info":"",onInput:n[2]||(n[2]=u=>l.sec=u)},null,8,["disabled","label","v","value"])):a.createCommentVNode("",!0)]),e.isValidation?(a.openBlock(),a.createBlock(d,{key:1,invalid:e.invalid},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(e.validationText),1)],void 0,!0),_:1},8,["invalid"])):a.createCommentVNode("",!0)],2)}const KO=ye(ZO,[["render",GO],["__scopeId","data-v-e9eb3b40"]]),XO=["top","right","bottom","left"],ou=["start","end"],lu=XO.reduce((e,n)=>e.concat(n,n+"-"+ou[0],n+"-"+ou[1]),[]),Tr=Math.min,ut=Math.max,Nr=Math.round,Dr=Math.floor,m2=e=>({x:e,y:e}),QO={left:"right",right:"left",bottom:"top",top:"bottom"},JO={start:"end",end:"start"};function su(e,n,r){return ut(e,Tr(n,r))}function p1(e,n){return typeof e=="function"?e(n):e}function T2(e){return e.split("-")[0]}function N2(e){return e.split("-")[1]}function cu(e){return e==="x"?"y":"x"}function du(e){return e==="y"?"height":"width"}function Ot(e){return["top","bottom"].includes(T2(e))?"y":"x"}function uu(e){return cu(Ot(e))}function hu(e,n,r){r===void 0&&(r=!1);const i=N2(e),o=uu(e),l=du(o);let s=o==="x"?i===(r?"end":"start")?"right":"left":i==="start"?"bottom":"top";return n.reference[l]>n.floating[l]&&(s=Vr(s)),[s,Vr(s)]}function eV(e){const n=Vr(e);return[Or(e),n,Or(n)]}function Or(e){return e.replace(/start|end/g,n=>JO[n])}function tV(e,n,r){const i=["left","right"],o=["right","left"],l=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return r?n?o:i:n?i:o;case"left":case"right":return n?l:s;default:return[]}}function rV(e,n,r,i){const o=N2(e);let l=tV(T2(e),r==="start",i);return o&&(l=l.map(s=>s+"-"+o),n&&(l=l.concat(l.map(Or)))),l}function Vr(e){return e.replace(/left|right|bottom|top/g,n=>QO[n])}function nV(e){return{top:0,right:0,bottom:0,left:0,...e}}function aV(e){return typeof e!="number"?nV(e):{top:e,right:e,bottom:e,left:e}}function Pr(e){const{x:n,y:r,width:i,height:o}=e;return{width:i,height:o,top:r,left:n,right:n+i,bottom:r+o,x:n,y:r}}function fu(e,n,r){let{reference:i,floating:o}=e;const l=Ot(n),s=uu(n),c=du(s),d=T2(n),u=l==="y",h=i.x+i.width/2-o.width/2,p=i.y+i.height/2-o.height/2,m=i[c]/2-o[c]/2;let w;switch(d){case"top":w={x:h,y:i.y-o.height};break;case"bottom":w={x:h,y:i.y+i.height};break;case"right":w={x:i.x+i.width,y:p};break;case"left":w={x:i.x-o.width,y:p};break;default:w={x:i.x,y:i.y}}switch(N2(n)){case"start":w[s]-=m*(r&&u?-1:1);break;case"end":w[s]+=m*(r&&u?-1:1);break}return w}const iV=async(e,n,r)=>{const{placement:i="bottom",strategy:o="absolute",middleware:l=[],platform:s}=r,c=l.filter(Boolean),d=await(s.isRTL==null?void 0:s.isRTL(n));let u=await s.getElementRects({reference:e,floating:n,strategy:o}),{x:h,y:p}=fu(u,i,d),m=i,w={},x=0;for(let b=0;b<c.length;b++){const{name:v,fn:C}=c[b],{x:y,y:_,data:L,reset:T}=await C({x:h,y:p,initialPlacement:i,placement:m,strategy:o,middlewareData:w,rects:u,platform:s,elements:{reference:e,floating:n}});h=y??h,p=_??p,w={...w,[v]:{...w[v],...L}},T&&x<=50&&(x++,typeof T=="object"&&(T.placement&&(m=T.placement),T.rects&&(u=T.rects===!0?await s.getElementRects({reference:e,floating:n,strategy:o}):T.rects),{x:h,y:p}=fu(u,m,d)),b=-1)}return{x:h,y:p,placement:m,strategy:o,middlewareData:w}};async function ss(e,n){var r;n===void 0&&(n={});const{x:i,y:o,platform:l,rects:s,elements:c,strategy:d}=e,{boundary:u="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:m=!1,padding:w=0}=p1(n,e),x=aV(w),v=c[m?p==="floating"?"reference":"floating":p],C=Pr(await l.getClippingRect({element:(r=await(l.isElement==null?void 0:l.isElement(v)))==null||r?v:v.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(c.floating)),boundary:u,rootBoundary:h,strategy:d})),y=p==="floating"?{x:i,y:o,width:s.floating.width,height:s.floating.height}:s.reference,_=await(l.getOffsetParent==null?void 0:l.getOffsetParent(c.floating)),L=await(l.isElement==null?void 0:l.isElement(_))?await(l.getScale==null?void 0:l.getScale(_))||{x:1,y:1}:{x:1,y:1},T=Pr(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:y,offsetParent:_,strategy:d}):y);return{top:(C.top-T.top+x.top)/L.y,bottom:(T.bottom-C.bottom+x.bottom)/L.y,left:(C.left-T.left+x.left)/L.x,right:(T.right-C.right+x.right)/L.x}}function oV(e,n,r){return(e?[...r.filter(o=>N2(o)===e),...r.filter(o=>N2(o)!==e)]:r.filter(o=>T2(o)===o)).filter(o=>e?N2(o)===e||(n?Or(o)!==o:!1):!0)}const lV=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(n){var r,i,o;const{rects:l,middlewareData:s,placement:c,platform:d,elements:u}=n,{crossAxis:h=!1,alignment:p,allowedPlacements:m=lu,autoAlignment:w=!0,...x}=p1(e,n),b=p!==void 0||m===lu?oV(p||null,w,m):m,v=await ss(n,x),C=((r=s.autoPlacement)==null?void 0:r.index)||0,y=b[C];if(y==null)return{};const _=hu(y,l,await(d.isRTL==null?void 0:d.isRTL(u.floating)));if(c!==y)return{reset:{placement:b[0]}};const L=[v[T2(y)],v[_[0]],v[_[1]]],T=[...((i=s.autoPlacement)==null?void 0:i.overflows)||[],{placement:y,overflows:L}],q=b[C+1];if(q)return{data:{index:C+1,overflows:T},reset:{placement:q}};const $=T.map(Z=>{const P=N2(Z.placement);return[Z.placement,P&&h?Z.overflows.slice(0,2).reduce((Y,K)=>Y+K,0):Z.overflows[0],Z.overflows]}).sort((Z,P)=>Z[1]-P[1]),R=((o=$.filter(Z=>Z[2].slice(0,N2(Z[0])?2:3).every(P=>P<=0))[0])==null?void 0:o[0])||$[0][0];return R!==c?{data:{index:C+1,overflows:T},reset:{placement:R}}:{}}}},sV=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var r,i;const{placement:o,middlewareData:l,rects:s,initialPlacement:c,platform:d,elements:u}=n,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:b=!0,...v}=p1(e,n);if((r=l.arrow)!=null&&r.alignmentOffset)return{};const C=T2(o),y=Ot(c),_=T2(c)===c,L=await(d.isRTL==null?void 0:d.isRTL(u.floating)),T=m||(_||!b?[Vr(c)]:eV(c)),q=x!=="none";!m&&q&&T.push(...rV(c,b,x,L));const $=[c,...T],F=await ss(n,v),R=[];let Z=((i=l.flip)==null?void 0:i.overflows)||[];if(h&&R.push(F[C]),p){const oe=hu(o,s,L);R.push(F[oe[0]],F[oe[1]])}if(Z=[...Z,{placement:o,overflows:R}],!R.every(oe=>oe<=0)){var P,Y;const oe=(((P=l.flip)==null?void 0:P.index)||0)+1,fe=$[oe];if(fe)return{data:{index:oe,overflows:Z},reset:{placement:fe}};let ee=(Y=Z.filter(A=>A.overflows[0]<=0).sort((A,U)=>A.overflows[1]-U.overflows[1])[0])==null?void 0:Y.placement;if(!ee)switch(w){case"bestFit":{var K;const A=(K=Z.filter(U=>{if(q){const O=Ot(U.placement);return O===y||O==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(O=>O>0).reduce((O,j)=>O+j,0)]).sort((U,O)=>U[1]-O[1])[0])==null?void 0:K[0];A&&(ee=A);break}case"initialPlacement":ee=c;break}if(o!==ee)return{reset:{placement:ee}}}return{}}}};async function cV(e,n){const{placement:r,platform:i,elements:o}=e,l=await(i.isRTL==null?void 0:i.isRTL(o.floating)),s=T2(r),c=N2(r),d=Ot(r)==="y",u=["left","top"].includes(s)?-1:1,h=l&&d?-1:1,p=p1(n,e);let{mainAxis:m,crossAxis:w,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof x=="number"&&(w=c==="end"?x*-1:x),d?{x:w*h,y:m*u}:{x:m*u,y:w*h}}const dV=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var r,i;const{x:o,y:l,placement:s,middlewareData:c}=n,d=await cV(n,e);return s===((r=c.offset)==null?void 0:r.placement)&&(i=c.arrow)!=null&&i.alignmentOffset?{}:{x:o+d.x,y:l+d.y,data:{...d,placement:s}}}}},uV=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:r,y:i,placement:o}=n,{mainAxis:l=!0,crossAxis:s=!1,limiter:c={fn:v=>{let{x:C,y}=v;return{x:C,y}}},...d}=p1(e,n),u={x:r,y:i},h=await ss(n,d),p=Ot(T2(o)),m=cu(p);let w=u[m],x=u[p];if(l){const v=m==="y"?"top":"left",C=m==="y"?"bottom":"right",y=w+h[v],_=w-h[C];w=su(y,w,_)}if(s){const v=p==="y"?"top":"left",C=p==="y"?"bottom":"right",y=x+h[v],_=x-h[C];x=su(y,x,_)}const b=c.fn({...n,[m]:w,[p]:x});return{...b,data:{x:b.x-r,y:b.y-i,enabled:{[m]:l,[p]:s}}}}}};function $r(){return typeof window<"u"}function ht(e){return cs(e)?(e.nodeName||"").toLowerCase():"#document"}function U0(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function g2(e){var n;return(n=(cs(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function cs(e){return $r()?e instanceof Node||e instanceof U0(e).Node:!1}function e2(e){return $r()?e instanceof Element||e instanceof U0(e).Element:!1}function y2(e){return $r()?e instanceof HTMLElement||e instanceof U0(e).HTMLElement:!1}function pu(e){return!$r()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof U0(e).ShadowRoot}function m1(e){const{overflow:n,overflowX:r,overflowY:i,display:o}=t2(e);return/auto|scroll|overlay|hidden|clip/.test(n+i+r)&&!["inline","contents"].includes(o)}function hV(e){return["table","td","th"].includes(ht(e))}function Fr(e){return[":popover-open",":modal"].some(n=>{try{return e.matches(n)}catch{return!1}})}function ds(e){const n=us(),r=e2(e)?t2(e):e;return["transform","translate","scale","rotate","perspective"].some(i=>r[i]?r[i]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!n&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!n&&(r.filter?r.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(i=>(r.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(r.contain||"").includes(i))}function fV(e){let n=U2(e);for(;y2(n)&&!Vt(n);){if(ds(n))return n;if(Fr(n))return null;n=U2(n)}return null}function us(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Vt(e){return["html","body","#document"].includes(ht(e))}function t2(e){return U0(e).getComputedStyle(e)}function Ir(e){return e2(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function U2(e){if(ht(e)==="html")return e;const n=e.assignedSlot||e.parentNode||pu(e)&&e.host||g2(e);return pu(n)?n.host:n}function mu(e){const n=U2(e);return Vt(n)?e.ownerDocument?e.ownerDocument.body:e.body:y2(n)&&m1(n)?n:mu(n)}function g1(e,n,r){var i;n===void 0&&(n=[]),r===void 0&&(r=!0);const o=mu(e),l=o===((i=e.ownerDocument)==null?void 0:i.body),s=U0(o);if(l){const c=hs(s);return n.concat(s,s.visualViewport||[],m1(o)?o:[],c&&r?g1(c):[])}return n.concat(o,g1(o,[],r))}function hs(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gu(e){const n=t2(e);let r=parseFloat(n.width)||0,i=parseFloat(n.height)||0;const o=y2(e),l=o?e.offsetWidth:r,s=o?e.offsetHeight:i,c=Nr(r)!==l||Nr(i)!==s;return c&&(r=l,i=s),{width:r,height:i,$:c}}function fs(e){return e2(e)?e:e.contextElement}function Pt(e){const n=fs(e);if(!y2(n))return m2(1);const r=n.getBoundingClientRect(),{width:i,height:o,$:l}=gu(n);let s=(l?Nr(r.width):r.width)/i,c=(l?Nr(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const pV=m2(0);function yu(e){const n=U0(e);return!us()||!n.visualViewport?pV:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function mV(e,n,r){return n===void 0&&(n=!1),!r||n&&r!==U0(e)?!1:n}function ft(e,n,r,i){n===void 0&&(n=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),l=fs(e);let s=m2(1);n&&(i?e2(i)&&(s=Pt(i)):s=Pt(e));const c=mV(l,r,i)?yu(l):m2(0);let d=(o.left+c.x)/s.x,u=(o.top+c.y)/s.y,h=o.width/s.x,p=o.height/s.y;if(l){const m=U0(l),w=i&&e2(i)?U0(i):i;let x=m,b=hs(x);for(;b&&i&&w!==x;){const v=Pt(b),C=b.getBoundingClientRect(),y=t2(b),_=C.left+(b.clientLeft+parseFloat(y.paddingLeft))*v.x,L=C.top+(b.clientTop+parseFloat(y.paddingTop))*v.y;d*=v.x,u*=v.y,h*=v.x,p*=v.y,d+=_,u+=L,x=U0(b),b=hs(x)}}return Pr({width:h,height:p,x:d,y:u})}function ps(e,n){const r=Ir(e).scrollLeft;return n?n.left+r:ft(g2(e)).left+r}function wu(e,n,r){r===void 0&&(r=!1);const i=e.getBoundingClientRect(),o=i.left+n.scrollLeft-(r?0:ps(e,i)),l=i.top+n.scrollTop;return{x:o,y:l}}function gV(e){let{elements:n,rect:r,offsetParent:i,strategy:o}=e;const l=o==="fixed",s=g2(i),c=n?Fr(n.floating):!1;if(i===s||c&&l)return r;let d={scrollLeft:0,scrollTop:0},u=m2(1);const h=m2(0),p=y2(i);if((p||!p&&!l)&&((ht(i)!=="body"||m1(s))&&(d=Ir(i)),y2(i))){const w=ft(i);u=Pt(i),h.x=w.x+i.clientLeft,h.y=w.y+i.clientTop}const m=s&&!p&&!l?wu(s,d,!0):m2(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-d.scrollLeft*u.x+h.x+m.x,y:r.y*u.y-d.scrollTop*u.y+h.y+m.y}}function yV(e){return Array.from(e.getClientRects())}function wV(e){const n=g2(e),r=Ir(e),i=e.ownerDocument.body,o=ut(n.scrollWidth,n.clientWidth,i.scrollWidth,i.clientWidth),l=ut(n.scrollHeight,n.clientHeight,i.scrollHeight,i.clientHeight);let s=-r.scrollLeft+ps(e);const c=-r.scrollTop;return t2(i).direction==="rtl"&&(s+=ut(n.clientWidth,i.clientWidth)-o),{width:o,height:l,x:s,y:c}}function CV(e,n){const r=U0(e),i=g2(e),o=r.visualViewport;let l=i.clientWidth,s=i.clientHeight,c=0,d=0;if(o){l=o.width,s=o.height;const u=us();(!u||u&&n==="fixed")&&(c=o.offsetLeft,d=o.offsetTop)}return{width:l,height:s,x:c,y:d}}function bV(e,n){const r=ft(e,!0,n==="fixed"),i=r.top+e.clientTop,o=r.left+e.clientLeft,l=y2(e)?Pt(e):m2(1),s=e.clientWidth*l.x,c=e.clientHeight*l.y,d=o*l.x,u=i*l.y;return{width:s,height:c,x:d,y:u}}function Cu(e,n,r){let i;if(n==="viewport")i=CV(e,r);else if(n==="document")i=wV(g2(e));else if(e2(n))i=bV(n,r);else{const o=yu(e);i={x:n.x-o.x,y:n.y-o.y,width:n.width,height:n.height}}return Pr(i)}function bu(e,n){const r=U2(e);return r===n||!e2(r)||Vt(r)?!1:t2(r).position==="fixed"||bu(r,n)}function xV(e,n){const r=n.get(e);if(r)return r;let i=g1(e,[],!1).filter(c=>e2(c)&&ht(c)!=="body"),o=null;const l=t2(e).position==="fixed";let s=l?U2(e):e;for(;e2(s)&&!Vt(s);){const c=t2(s),d=ds(s);!d&&c.position==="fixed"&&(o=null),(l?!d&&!o:!d&&c.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||m1(s)&&!d&&bu(e,s))?i=i.filter(h=>h!==s):o=c,s=U2(s)}return n.set(e,i),i}function vV(e){let{element:n,boundary:r,rootBoundary:i,strategy:o}=e;const s=[...r==="clippingAncestors"?Fr(n)?[]:xV(n,this._c):[].concat(r),i],c=s[0],d=s.reduce((u,h)=>{const p=Cu(n,h,o);return u.top=ut(p.top,u.top),u.right=Tr(p.right,u.right),u.bottom=Tr(p.bottom,u.bottom),u.left=ut(p.left,u.left),u},Cu(n,c,o));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function _V(e){const{width:n,height:r}=gu(e);return{width:n,height:r}}function kV(e,n,r){const i=y2(n),o=g2(n),l=r==="fixed",s=ft(e,!0,l,n);let c={scrollLeft:0,scrollTop:0};const d=m2(0);if(i||!i&&!l)if((ht(n)!=="body"||m1(o))&&(c=Ir(n)),i){const m=ft(n,!0,l,n);d.x=m.x+n.clientLeft,d.y=m.y+n.clientTop}else o&&(d.x=ps(o));const u=o&&!i&&!l?wu(o,c):m2(0),h=s.left+c.scrollLeft-d.x-u.x,p=s.top+c.scrollTop-d.y-u.y;return{x:h,y:p,width:s.width,height:s.height}}function ms(e){return t2(e).position==="static"}function xu(e,n){if(!y2(e)||t2(e).position==="fixed")return null;if(n)return n(e);let r=e.offsetParent;return g2(e)===r&&(r=r.ownerDocument.body),r}function vu(e,n){const r=U0(e);if(Fr(e))return r;if(!y2(e)){let o=U2(e);for(;o&&!Vt(o);){if(e2(o)&&!ms(o))return o;o=U2(o)}return r}let i=xu(e,n);for(;i&&hV(i)&&ms(i);)i=xu(i,n);return i&&Vt(i)&&ms(i)&&!ds(i)?r:i||fV(e)||r}const EV=async function(e){const n=this.getOffsetParent||vu,r=this.getDimensions,i=await r(e.floating);return{reference:kV(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function LV(e){return t2(e).direction==="rtl"}const AV={convertOffsetParentRelativeRectToViewportRelativeRect:gV,getDocumentElement:g2,getClippingRect:vV,getOffsetParent:vu,getElementRects:EV,getClientRects:yV,getDimensions:_V,getScale:Pt,isElement:e2,isRTL:LV};function _u(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function SV(e,n){let r=null,i;const o=g2(e);function l(){var c;clearTimeout(i),(c=r)==null||c.disconnect(),r=null}function s(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),l();const u=e.getBoundingClientRect(),{left:h,top:p,width:m,height:w}=u;if(c||n(),!m||!w)return;const x=Dr(p),b=Dr(o.clientWidth-(h+m)),v=Dr(o.clientHeight-(p+w)),C=Dr(h),_={rootMargin:-x+"px "+-b+"px "+-v+"px "+-C+"px",threshold:ut(0,Tr(1,d))||1};let L=!0;function T(q){const $=q[0].intersectionRatio;if($!==d){if(!L)return s();$?s(!1,$):i=setTimeout(()=>{s(!1,1e-7)},1e3)}$===1&&!_u(u,e.getBoundingClientRect())&&s(),L=!1}try{r=new IntersectionObserver(T,{..._,root:o.ownerDocument})}catch{r=new IntersectionObserver(T,_)}r.observe(e)}return s(!0),l}function MV(e,n,r,i){i===void 0&&(i={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=i,u=fs(e),h=o||l?[...u?g1(u):[],...g1(n)]:[];h.forEach(C=>{o&&C.addEventListener("scroll",r,{passive:!0}),l&&C.addEventListener("resize",r)});const p=u&&c?SV(u,r):null;let m=-1,w=null;s&&(w=new ResizeObserver(C=>{let[y]=C;y&&y.target===u&&w&&(w.unobserve(n),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var _;(_=w)==null||_.observe(n)})),r()}),u&&!d&&w.observe(u),w.observe(n));let x,b=d?ft(e):null;d&&v();function v(){const C=ft(e);b&&!_u(b,C)&&r(),b=C,x=requestAnimationFrame(v)}return r(),()=>{var C;h.forEach(y=>{o&&y.removeEventListener("scroll",r),l&&y.removeEventListener("resize",r)}),p==null||p(),(C=w)==null||C.disconnect(),w=null,d&&cancelAnimationFrame(x)}}const BV=dV,TV=lV,NV=uV,DV=sV,OV=(e,n,r)=>{const i=new Map,o={platform:AV,...r},l={...o.platform,_c:i};return iV(e,n,{...o,platform:l})};function VV(e){return e!=null&&typeof e=="object"&&"$el"in e}function ku(e){if(VV(e)){const n=e.$el;return cs(n)&&ht(n)==="#comment"?null:n}return e}function y1(e){return typeof e=="function"?e():a.unref(e)}function Eu(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Lu(e,n){const r=Eu(e);return Math.round(n*r)/r}function PV(e,n,r){r===void 0&&(r={});const i=r.whileElementsMounted,o=a.computed(()=>{var $;return($=y1(r.open))!=null?$:!0}),l=a.computed(()=>y1(r.middleware)),s=a.computed(()=>{var $;return($=y1(r.placement))!=null?$:"bottom"}),c=a.computed(()=>{var $;return($=y1(r.strategy))!=null?$:"absolute"}),d=a.computed(()=>{var $;return($=y1(r.transform))!=null?$:!0}),u=a.computed(()=>ku(e.value)),h=a.computed(()=>ku(n.value)),p=a.ref(0),m=a.ref(0),w=a.ref(c.value),x=a.ref(s.value),b=a.shallowRef({}),v=a.ref(!1),C=a.computed(()=>{const $={position:w.value,left:"0",top:"0"};if(!h.value)return $;const F=Lu(h.value,p.value),R=Lu(h.value,m.value);return d.value?{...$,transform:"translate("+F+"px, "+R+"px)",...Eu(h.value)>=1.5&&{willChange:"transform"}}:{position:w.value,left:F+"px",top:R+"px"}});let y;function _(){if(u.value==null||h.value==null)return;const $=o.value;OV(u.value,h.value,{middleware:l.value,placement:s.value,strategy:c.value}).then(F=>{p.value=F.x,m.value=F.y,w.value=F.strategy,x.value=F.placement,b.value=F.middlewareData,v.value=$!==!1})}function L(){typeof y=="function"&&(y(),y=void 0)}function T(){if(L(),i===void 0){_();return}if(u.value!=null&&h.value!=null){y=i(u.value,h.value,_);return}}function q(){o.value||(v.value=!1)}return a.watch([l,s,c,o],_,{flush:"sync"}),a.watch([u,h],T,{flush:"sync"}),a.watch(o,q,{flush:"sync"}),a.getCurrentScope()&&a.onScopeDispose(L),{x:a.shallowReadonly(p),y:a.shallowReadonly(m),strategy:a.shallowReadonly(w),placement:a.shallowReadonly(x),middlewareData:a.shallowReadonly(b),isPositioned:a.shallowReadonly(v),floatingStyles:C,update:_}}const Au={hover:"mouseenter",focus:"focus",click:"click",touch:"touchstart",pointer:"pointerdown"},Su={hover:"mouseleave",focus:"blur",click:"click",touch:"touchend",pointer:"pointerup"},Mu=({target:e,triggers:n,show:r,hide:i})=>{const o=()=>{((c,d)=>{d.forEach(u=>{const h=Au[u];h?c.addEventListener(h,r):console.log(`No Tooltip Show event for ${u} trigger`);const p=Su[u];p?c.addEventListener(p,i):console.log(`No Tooltip Hide event for ${u} trigger`)})})(e.value,n)},l=()=>{((c,d)=>{d.forEach(u=>{const h=Au[u];h?c.removeEventListener(h,r):console.log(`No Tooltip Show event for ${u} trigger`);const p=Su[u];p?c.removeEventListener(p,i):console.log(`No Tooltip Hide event for ${u} trigger`)})})(e.value,n)};a.onMounted(()=>o()),a.onBeforeUnmount(()=>l())},$V={__name:"wt-tooltip-floating",props:{triggers:{type:Array,default:()=>[]}},emits:["show","hide"],setup(e,{emit:n}){const r=e,i=n,o=a.ref(null);return Mu({target:o,triggers:r.triggers,show:()=>i("show"),hide:()=>i("hide")}),(l,s)=>(a.openBlock(),a.createElementBlock("aside",{ref_key:"floating",ref:o,class:"wt-tooltip-floating"},[a.renderSlot(l.$slots,"default")],512))}},FV=ye({__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(e,{emit:n}){const r=e,i=n,o=a.useTemplateRef("activator"),l=a.useTemplateRef("floating"),s=a.useTemplateRef("floatingChild"),c=a.ref(r.visible),d=()=>{i("update:visible",c.value)},u=(b={})=>{r.disabled||c.value||(c.value=!0,b.usedByTooltip=!0,d(),m())},h=(b={})=>{var C;const v=(C=s.value)==null?void 0:C.contains(b.target);!c.value||b.usedByTooltip||v||(c.value=!1,d(),w())},p=(b={})=>{r.disableClickAway||h(b)},m=()=>{window.addEventListener("scroll",h,!0)},w=()=>{window.removeEventListener("scroll",h,!0)},{floatingStyles:x}=PV(o,l,{placement:r.placement==="auto"?null:r.placement,strategy:"fixed",whileElementsMounted:MV,middleware:[NV(),BV(4),r.placement==="auto"?TV():DV()]});return Mu({target:o,triggers:r.triggers,show:u,hide:h}),a.watch(()=>r.visible,b=>{b?u():h()}),a.onMounted(()=>{r.visible&&u()}),a.onBeforeUnmount(()=>{w()}),(b,v)=>{const C=a.resolveDirective("clickaway");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([{"wt-tooltip--visible":c.value},"wt-tooltip"])},[a.createElementVNode("div",{ref_key:"activator",ref:o,class:"wt-tooltip__activator"},[a.renderSlot(b.$slots,"activator",a.normalizeProps(a.guardReactiveProps({visible:c.value})),void 0,!0)],512),c.value?a.withDirectives((a.openBlock(),a.createBlock($V,{key:0,ref_key:"floating",ref:l,class:a.normalizeClass([[e.popperClass],"wt-tooltip__floating"]),style:a.normalizeStyle(a.unref(x)),triggers:e.popperTriggers,onHide:h,onShow:u},{default:a.withCtx(()=>[a.createElementVNode("div",{ref_key:"floatingChild",ref:s},[a.renderSlot(b.$slots,"default",a.normalizeProps(a.guardReactiveProps({hide:h})),void 0,!0)],512)],void 0,!0),_:3},8,["class","style","triggers"])),[[C,p]]):a.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-b8fd5806"]]),IV={class:"wt-tree-line"},RV={class:"wt-tree-line__icon-wrapper"},HV={class:"wt-tree-line__label"},qV=a.defineComponent({__name:"wt-tree-line",props:{modelValue:{},data:{},itemLabel:{},itemData:{},childrenProp:{default:"children"},nestedLevel:{default:0},lastChild:{type:Boolean,default:!1},nestedIcons:{},nextElement:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},searchedProp:{default:"searched"}},emits:["openParent","update:modelValue"],setup(e,{emit:n}){const r=e,i=n,o=a.computed(()=>r.itemLabel?r.data[r.itemLabel]:r.data),l=a.computed(()=>{const w=r.nestedIcons?[...r.nestedIcons]:[];return r.nestedLevel===0||w.push({icon:"tree-line",hidden:!r.nextElement}),w}),s=()=>r.itemData?r.modelValue.includes(r.data[r.itemData]):!!r.modelValue.find(x=>h1(x,r.data)),c=a.computed(()=>r.multiple?s():r.itemData?r.data[r.itemData]===r.modelValue:h1(r.modelValue,r.data)),d=()=>{const w=r.itemData?r.data[r.itemData]:r.data;let x;if(r.itemData?x=r.modelValue.indexOf(r.data[r.itemData]):x=r.modelValue.findIndex(v=>h1(v,r.data)),x===-1){const v=[...r.modelValue];v.push(w),i("update:modelValue",v);return}const b=[...r.modelValue];b.splice(x,1),i("update:modelValue",b)},u=()=>{var w;if(r.multiple&&!r.data.service){d();return}if((w=r.data[r.childrenProp])!=null&&w.length){h.value=!h.value;return}i("update:modelValue",r.itemData?r.data[r.itemData]:r.data)},h=a.ref(!0),p=()=>{r.nestedLevel>0&&i("openParent")},m=()=>{h.value=!1,p()};return a.onMounted(()=>{c.value&&p(),r.data[r.searchedProp]&&p()}),a.watch(()=>r.modelValue,()=>{c.value&&p()}),(w,x)=>{const b=a.resolveComponent("wt-icon"),v=a.resolveComponent("wt-icon-btn"),C=a.resolveComponent("wt-tree-line",!0);return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",IV,[a.createElementVNode("div",RV,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(w.nestedIcons,(y,_)=>(a.openBlock(),a.createBlock(b,{key:_,icon:y.icon,class:a.normalizeClass({hidden:y.hidden})},null,8,["icon","class"]))),128)),w.nestedLevel>=1?(a.openBlock(),a.createBlock(b,{key:0,icon:w.lastChild?"tree-corner":"tree-cross"},null,8,["icon"])):a.createCommentVNode("",!0),w.data[w.childrenProp]&&w.data[w.childrenProp].length?(a.openBlock(),a.createBlock(v,{key:1,icon:h.value?"plus":"minus",onClick:x[0]||(x[0]=y=>h.value=!h.value)},null,8,["icon"])):a.createCommentVNode("",!0)]),a.createElementVNode("div",{class:a.normalizeClass([{active:c.value},"wt-tree-line__label-wrapper"]),onClick:u},[a.createElementVNode("p",HV,a.toDisplayString(o.value),1),c.value?(a.openBlock(),a.createBlock(b,{key:0,icon:"chat-message-status-sent"})):a.createCommentVNode("",!0)],2)]),a.withDirectives(a.createVNode(Zo,null,{default:a.withCtx(()=>[a.createElementVNode("div",null,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(w.data[w.childrenProp],(y,_)=>(a.openBlock(),a.createBlock(C,{key:_,"model-value":w.modelValue,data:y,"children-prop":w.childrenProp,"item-label":w.itemLabel,"item-data":w.itemData,"nested-level":w.nestedLevel+1,"next-element":!!w.data[w.childrenProp][_+1],"nested-icons":l.value,"last-child":_===w.data[w.childrenProp].length-1,multiple:w.multiple,onOpenParent:m,"onUpdate:modelValue":x[1]||(x[1]=L=>i("update:modelValue",L))},null,8,["model-value","data","children-prop","item-label","item-data","nested-level","next-element","nested-icons","last-child","multiple"]))),128))])],void 0,!0),_:1},512),[[a.vShow,!h.value]])],64)}}}),gs={Tree:"tree",List:"list"},zV={class:"wt-tree"},UV={key:0,class:"wt-tree__content"},jV={key:1,class:"wt-tree__list-content"},WV=["onClick"],ZV=a.defineComponent({__name:"wt-tree",props:{modelValue:{},data:{},itemLabel:{},itemData:{},mode:{default:gs.Tree},childrenProp:{default:"children"},multiple:{type:Boolean}},emits:["select","update:modelValue"],setup(e,{emit:n}){const r=e,i=n,o=a.computed(()=>{const c=[],d=u=>{c.push(u),u[r.childrenProp]&&u[r.childrenProp].forEach(h=>{d(h)})};return r.data.forEach(u=>{d(u)}),c}),l=c=>{i("update:modelValue",r.itemData?c[r.itemData]:c)},s=c=>r.itemData?c[r.itemData]===r.modelValue:h1(r.modelValue,c);return(c,d)=>{const u=a.resolveComponent("wt-icon");return a.openBlock(),a.createElementBlock("div",zV,[c.mode===a.unref(gs).Tree?(a.openBlock(),a.createElementBlock("div",UV,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(c.data,(h,p)=>(a.openBlock(),a.createBlock(qV,{key:p,"model-value":c.modelValue,"item-label":c.itemLabel,"item-data":c.itemData,data:h,"children-prop":c.childrenProp,multiple:c.multiple,"onUpdate:modelValue":d[0]||(d[0]=m=>i("update:modelValue",m))},null,8,["model-value","item-label","item-data","data","children-prop","multiple"]))),128))])):a.createCommentVNode("",!0),c.mode===a.unref(gs).List?(a.openBlock(),a.createElementBlock("div",jV,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.value,(h,p)=>(a.openBlock(),a.createElementBlock("span",{key:p,class:a.normalizeClass(["wt-tree__label-wrapper",{active:s(h)}])},[a.createElementVNode("p",{class:"wt-tree__label",onClick:m=>l(h)},a.toDisplayString(c.itemLabel?h[c.itemLabel]:h),9,WV),s(h)?(a.openBlock(),a.createBlock(u,{key:0,icon:"chat-message-status-sent",class:"wt-tree__label-icon"})):a.createCommentVNode("",!0)],2))),128))])):a.createCommentVNode("",!0)])}}}),YV=({headers:e})=>{const{t:n}=et();return{tableHeaders:a.computed(()=>e.filter(i=>i.show===void 0||i.show).map(i=>!i.text&&i.locale?{...i,text:typeof i.locale=="string"?n(i.locale):n(...i.locale)}:i))}},GV={class:"wt-tree-table-td__content"},KV={key:0,class:"wt-tree-table-td__icon-wrapper"},XV={key:0,class:"wt-tree-table-td__actions"},QV={class:"wt-tree-table-td__content"},JV=ye(a.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(e,{emit:n}){const r=e,i=n,o=a.ref(!0),l=a.computed(()=>r.nestingLevel),s=a.computed(()=>r.nestingLevel+1),c=a.computed(()=>r.selectedElements.includes(r.data)),d=()=>{o.value=!1,i("expanded-collapse")},u=(h,p=0)=>{if(h[r.searchedProp]&&p)return!0;if(Array.isArray(h[r.childrenProp])){for(const m of h[r.childrenProp])if(u(m,p+1))return!0}return!1};return a.onMounted(()=>{r.searchedProp&&u(r.data)&&d()}),(h,p)=>{const m=a.resolveComponent("wt-tree-table-row",!0);return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("tr",{class:a.normalizeClass([[{"wt-tree-table-row--alternate":h.rowPosition%2}],"wt-tree-table-row"])},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(h.dataHeaders,(w,x)=>(a.openBlock(),a.createElementBlock("td",{key:x,class:"wt-tree-table-td"},[a.createElementVNode("div",GV,[x?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",KV,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(l.value,b=>(a.openBlock(),a.createElementBlock("div",{key:b,class:"wt-tree-table-row__tree-space"}))),128)),h.selectable?(a.openBlock(),a.createBlock(ho,{key:0,selected:c.value,onChange:p[0]||(p[0]=b=>h.$emit("update:selected",{data:h.data,select:b}))},null,8,["selected"])):a.createCommentVNode("",!0),h.data[h.childrenProp]?(a.openBlock(),a.createBlock(L7,{key:1,icon:o.value?"tree-expand":"tree-collapse",onClick:p[1]||(p[1]=b=>o.value=!o.value)},null,8,["icon"])):a.createCommentVNode("",!0)])),a.renderSlot(h.$slots,w.value,{index:h.rowPosition,item:h.data},()=>[a.createTextVNode(a.toDisplayString(h.data[w.value]),1)],!0)])]))),128)),h.gridActions?(a.openBlock(),a.createElementBlock("td",XV,[a.createElementVNode("div",QV,[a.renderSlot(h.$slots,"actions",{index:h.rowPosition,item:h.data},void 0,!0)])])):a.createCommentVNode("",!0)],2),o.value?a.createCommentVNode("",!0):(a.openBlock(!0),a.createElementBlock(a.Fragment,{key:0},a.renderList(h.data[h.childrenProp],(w,x)=>(a.openBlock(),a.createBlock(m,{key:x,"children-prop":h.childrenProp,data:w,"data-headers":h.dataHeaders,"nesting-level":s.value,"row-position":h.rowPosition,"searched-prop":h.searchedProp,selectable:h.selectable,"selected-elements":h.selectedElements,onExpandedCollapse:d,"onUpdate:selected":p[2]||(p[2]=b=>h.$emit("update:selected",{data:b.data,select:b.select}))},a.createSlots({actions:a.withCtx(({item:b})=>[a.renderSlot(h.$slots,"actions",{index:h.rowPosition,item:b},void 0,!0)]),_:2},[a.renderList(h.dataHeaders,(b,v)=>({name:b.value,fn:a.withCtx(({item:C})=>[a.renderSlot(h.$slots,b.value,{index:h.rowPosition,item:C},()=>[a.createElementVNode("div",null,a.toDisplayString(C[b.value]),1)],!0)])}))]),1032,["children-prop","data","data-headers","nesting-level","row-position","searched-prop","selectable","selected-elements"]))),128))],64)}}}),[["__scopeId","data-v-10f86df9"]]),eP={class:"wt-tree-table"},tP={class:"wt-tree-table-wrapper"},rP={class:"wt-tree-table-head"},nP={class:"wt-tree-table-tr wt-tree-table-tr-head"},aP=["onClick"],iP={class:"wt-tree-table-th__content"},oP={class:"wt-tree-table-th__text"},lP={key:0,class:"wt-tree-table-th__actions"},sP={class:"wt-tree-table-th__content"},cP={class:"wt-tree-table-body"},Bu={WtActionBar:Wv,WtImage:k7,WtEmpty:tM,WtLogo:vB,WtAvatar:P_,WtBadge:z_,WtIcon:E7,WtIndicator:HM,WtInputInfo:b7,WtButton:Y_,WtChip:ak,WtConfirmDialog:lk,WtDivider:NS,WtTooltip:FV,WtLabel:iB,WtLoader:wB,WtRoundedAction:cN,WtReplaceTransition:Hv,WtCheckbox:ho,WtDatepicker:MS,WtIconBtn:L7,WtInput:UM,WtIntersectionObserver:tB,WtHint:VM,WtNotification:eT,WtPopup:eN,WtProgressBar:nN,WtRadio:sN,WtSearchBar:pN,WtSelect:tD,WtSlider:iD,WtSwitcher:xD,WtTabs:XD,WtTagsInput:VO,WtTimeInput:WO,WtTimepicker:KO,WtTextarea:HO,WtAppHeader:Kv,WtHeadline:AM,WtHeadlineNav:NM,WtNavigationBar:KB,WtAppNavigator:w_,WtFiltersPanelWrapper:xM,WtHeaderActions:N_,WtErrorPage:uM,WtNotificationsBar:sT,WtPageWrapper:gT,WtDualPanel:FS,WtPagination:BT,WtPlayer:DT,WtStatusSelect:dD,WtTable:VD,WtTree:ZV,WtTreeTable:ye(a.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(e,{emit:n}){const r=e,i=n,o=b=>b[r.childrenProp]&&Array.isArray(b[r.childrenProp]),l=b=>{const v=[],C=y=>{if(y._isSelected)return[y];o(y)&&y[r.childrenProp].forEach(C)};return b.forEach(C),v},s=b=>{const v=[],C=y=>{v.push(y),o(y)&&y[r.childrenProp].forEach(C)};return b.forEach(C),v},c=a.computed(()=>r.selected||l(r.data)),d=a.computed(()=>c.value.length===s(r.data).length&&s(r.data).length>0),{tableHeaders:u}=YV({headers:r.headers}),h=({sort:b})=>r.sortable&&b!==void 0,p=b=>{if(!h(b))return;const v=U7(b.sort);i("sort",b,v)},m=(b,v)=>{b.forEach(C=>{C._isSelected=v,o(C)&&m(C[r.childrenProp],v)})},w=()=>{r.selected?i("update:selected",d.value?[]:[...s(r.data)]):d.value?m(r.data,!1):m(r.data,!0)},x=(b,v)=>{r.selected?v?i("update:selected",[...c.value,b]):i("update:selected",c.value.filter(C=>C!==b)):b._isSelected=!b._isSelected};return(b,v)=>{const C=a.resolveComponent("wt-icon");return a.openBlock(),a.createElementBlock("div",eP,[a.createElementVNode("table",tP,[a.createElementVNode("thead",rP,[a.createElementVNode("tr",nP,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(u),(y,_)=>(a.openBlock(),a.createElementBlock("th",{key:_,class:a.normalizeClass([[{"wt-tree-table-th--sortable":h(y)},`wt-tree-table-th--sort-${y.sort}`],"wt-tree-table-th"]),style:a.normalizeStyle(y.width?`min-width:${y.width}`:""),onClick:L=>p(y)},[a.createElementVNode("div",iP,[_===0&&b.selectable?(a.openBlock(),a.createElementBlock("div",{key:0,onClick:v[0]||(v[0]=a.withModifiers(()=>{},["stop"]))},[a.createVNode(a.unref(ho),{selected:d.value,onChange:w},null,8,["selected"])])):a.createCommentVNode("",!0),a.createElementVNode("div",oP,a.toDisplayString(y.text),1),b.sortable?(a.openBlock(),a.createBlock(C,{key:1,class:"wt-tree-table-th-sort-arrow wt-tree-table-th-sort-arrow--asc",icon:"sort-arrow-up",size:"sm"})):a.createCommentVNode("",!0),b.sortable?(a.openBlock(),a.createBlock(C,{key:2,class:"wt-tree-table-th-sort-arrow wt-tree-table-th-sort-arrow--desc",icon:"sort-arrow-down",size:"sm"})):a.createCommentVNode("",!0)])],14,aP))),128)),b.gridActions?(a.openBlock(),a.createElementBlock("th",lP,[a.createElementVNode("div",sP,[a.renderSlot(b.$slots,"actions-header",{},void 0,!0)])])):a.createCommentVNode("",!0)])]),a.createElementVNode("tbody",cP,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(b.data,(y,_)=>(a.openBlock(),a.createBlock(JV,{key:_,"row-position":_,"data-headers":a.unref(u),data:y,selectable:b.selectable,"children-prop":b.childrenProp,"selected-elements":c.value,"searched-prop":b.searchedProp,"onUpdate:selected":v[1]||(v[1]=L=>x(L.data,L.select))},a.createSlots({actions:a.withCtx(({item:L})=>[a.renderSlot(b.$slots,"actions",{item:L},void 0,!0)]),_:2},[a.renderList(a.unref(u),(L,T)=>({name:L.value,fn:a.withCtx(({item:q})=>[a.renderSlot(b.$slots,L.value,{index:_,item:q},()=>[a.createTextVNode(a.toDisplayString(q[L.value]),1)],!0)])}))]),1032,["row-position","data-headers","data","selectable","children-prop","selected-elements","searched-prop"]))),128))])])])}}}),[["__scopeId","data-v-2986559a"]]),WtTableActions:ID,WtTableColumnSelect:jD,WtButtonSelect:K_,WtContextMenu:ck,WtCopyAction:mk,WtLoadBar:cB,WtIconAction:b6,WtPageHeader:cT,WtItemLink:rB,WtDummy:jS,WtStepper:gD,WtExpansionPanel:gM,WtNavigationMenu:rw,WtStartPage:Lb,WtSelectionPopup:hb},Tu=Go?window:void 0;function w1(e){var n;const r=a.toValue(e);return(n=r==null?void 0:r.$el)!=null?n:r}function $t(...e){const n=[],r=()=>{n.forEach(c=>c()),n.length=0},i=(c,d,u,h)=>(c.addEventListener(d,u,h),()=>c.removeEventListener(d,u,h)),o=a.computed(()=>{const c=_r(a.toValue(e[0])).filter(d=>d!=null);return c.every(d=>typeof d!="string")?c:void 0}),l=KM(()=>{var c,d;return[(d=(c=o.value)==null?void 0:c.map(u=>w1(u)))!=null?d:[Tu].filter(u=>u!=null),_r(a.toValue(o.value?e[1]:e[0])),_r(a.unref(o.value?e[2]:e[1])),a.toValue(o.value?e[3]:e[2])]},([c,d,u,h])=>{if(r(),!(c!=null&&c.length)||!(d!=null&&d.length)||!(u!=null&&u.length))return;const p=ZM(h)?{...h}:h;n.push(...c.flatMap(m=>d.flatMap(w=>u.map(x=>i(m,w,x,p)))))},{flush:"post"}),s=()=>{l(),r()};return Yo(r),s}let Nu=!1;function Du(e,n,r={}){const{window:i=Tu,ignore:o=[],capture:l=!0,detectIframe:s=!1,controls:c=!1}=r;if(!i)return c?{stop:p2,cancel:p2,trigger:p2}:p2;if(Ko&&!Nu){Nu=!0;const v={passive:!0};Array.from(i.document.body.children).forEach(C=>$t(C,"click",p2,v)),$t(i.document.documentElement,"click",p2,v)}let d=!0;const u=v=>a.toValue(o).some(C=>{if(typeof C=="string")return Array.from(i.document.querySelectorAll(C)).some(y=>y===v.target||v.composedPath().includes(y));{const y=w1(C);return y&&(v.target===y||v.composedPath().includes(y))}});function h(v){const C=a.toValue(v);return C&&C.$.subTree.shapeFlag===16}function p(v,C){const y=a.toValue(v),_=y.$.subTree&&y.$.subTree.children;return _==null||!Array.isArray(_)?!1:_.some(L=>L.el===C.target||C.composedPath().includes(L.el))}const m=v=>{const C=w1(e);if(v.target!=null&&!(!(C instanceof Element)&&h(e)&&p(e,v))&&!(!C||C===v.target||v.composedPath().includes(C))){if("detail"in v&&v.detail===0&&(d=!u(v)),!d){d=!0;return}n(v)}};let w=!1;const x=[$t(i,"click",v=>{w||(w=!0,setTimeout(()=>{w=!1},0),m(v))},{passive:!0,capture:l}),$t(i,"pointerdown",v=>{const C=w1(e);d=!u(v)&&!!(C&&!v.composedPath().includes(C))},{passive:!0}),s&&$t(i,"blur",v=>{setTimeout(()=>{var C;const y=w1(e);((C=i.document.activeElement)==null?void 0:C.tagName)==="IFRAME"&&!(y!=null&&y.contains(i.document.activeElement))&&n(v)},0)},{passive:!0})].filter(Boolean),b=()=>x.forEach(v=>v());return c?{stop:b,cancel:()=>{d=!1},trigger:v=>{d=!0,m(v),d=!1}}:b}const dP={mounted(e,n){const r=!n.modifiers.bubble;if(typeof n.value=="function")e.__onClickOutside_stop=Du(e,n.value,{capture:r});else{const[i,o]=n.value;e.__onClickOutside_stop=Du(e,i,Object.assign({capture:r},o))}},unmounted(e){e.__onClickOutside_stop()}};function ys(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}function Ou(e){const n=window.getComputedStyle(e);if(n.overflowX==="scroll"||n.overflowY==="scroll"||n.overflowX==="auto"&&e.clientWidth<e.scrollWidth||n.overflowY==="auto"&&e.clientHeight<e.scrollHeight)return!0;{const r=e.parentNode;return!r||r.tagName==="BODY"?!1:Ou(r)}}function uP(e){const n=e||window.event,r=n.target;return Ou(r)?!1:n.touches.length>1?!0:(n.preventDefault&&n.preventDefault(),!1)}const ws=new WeakMap;function hP(e,n=!1){const r=a.shallowRef(n);let i=null,o="";a.watch(GM(e),c=>{const d=ys(a.toValue(c));if(d){const u=d;if(ws.get(u)||ws.set(u,u.style.overflow),u.style.overflow!=="hidden"&&(o=u.style.overflow),u.style.overflow==="hidden")return r.value=!0;if(r.value)return u.style.overflow="hidden"}},{immediate:!0});const l=()=>{const c=ys(a.toValue(e));!c||r.value||(Ko&&(i=$t(c,"touchmove",d=>{uP(d)},{passive:!1})),c.style.overflow="hidden",r.value=!0)},s=()=>{const c=ys(a.toValue(e));!c||!r.value||(Ko&&(i==null||i()),c.style.overflow=o,ws.delete(c),r.value=!1)};return Yo(s),a.computed({get(){return r.value},set(c){c?l():s()}})}function fP(){let e=!1;const n=a.shallowRef(!1);return(r,i)=>{if(n.value=i.value,e)return;e=!0;const o=hP(r,i.value);a.watch(n,l=>o.value=l)}}fP();const Vu={clickaway:dP},pP={install(e,{eventBus:n,router:r,globals:i={}}){Object.keys(Vu).forEach(o=>{e.directive(o,Vu[o])}),Object.keys(Bu).forEach(o=>{e.component(o,Bu[o])}),Object.keys(i).forEach(o=>{e.provide(o,i[o])}),e.provide("$eventBus",n),r&&e.use(r)},generateInstance:B4};function we(e,n,r){return(n=gP(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function mP(e,n){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function gP(e){var n=mP(e,"string");return typeof n=="symbol"?n:String(n)}function yP(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function Pu(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function wP(e,n,r){return n&&Pu(e.prototype,n),r&&Pu(e,r),e}function CP(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function $u(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,i)}return r}function Fu(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?$u(Object(r),!0).forEach(function(i){CP(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$u(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}var Iu={addCSS:!0,thumbWidth:15,watch:!0};function bP(e,n){return(function(){return Array.from(document.querySelectorAll(n)).includes(this)}).call(e,n)}function xP(e,n){if(e&&n){var r=new Event(n,{bubbles:!0});e.dispatchEvent(r)}}var C1=function(e){return e!=null?e.constructor:null},Cs=function(e,n){return!!(e&&n&&e instanceof n)},Ru=function(e){return e==null},Hu=function(e){return C1(e)===Object},vP=function(e){return C1(e)===Number&&!Number.isNaN(e)},qu=function(e){return C1(e)===String},_P=function(e){return C1(e)===Boolean},kP=function(e){return C1(e)===Function},zu=function(e){return Array.isArray(e)},Uu=function(e){return Cs(e,NodeList)},EP=function(e){return Cs(e,Element)},LP=function(e){return Cs(e,Event)},AP=function(e){return Ru(e)||(qu(e)||zu(e)||Uu(e))&&!e.length||Hu(e)&&!Object.keys(e).length},T0={nullOrUndefined:Ru,object:Hu,number:vP,string:qu,boolean:_P,function:kP,array:zu,nodeList:Uu,element:EP,event:LP,empty:AP};function SP(e){var n="".concat(e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return n?Math.max(0,(n[1]?n[1].length:0)-(n[2]?+n[2]:0)):0}function MP(e,n){if(1>n){var r=SP(n);return parseFloat(e.toFixed(r))}return Math.round(e/n)*n}var BP=function(){function e(n,r){yP(this,e),T0.element(n)?this.element=n:T0.string(n)&&(this.element=document.querySelector(n)),T0.element(this.element)&&T0.empty(this.element.rangeTouch)&&(this.config=Fu({},Iu,{},r),this.init())}return wP(e,[{key:"init",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="none",this.element.style.webKitUserSelect="none",this.element.style.touchAction="manipulation"),this.listeners(!0),this.element.rangeTouch=this)}},{key:"destroy",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="",this.element.style.webKitUserSelect="",this.element.style.touchAction=""),this.listeners(!1),this.element.rangeTouch=null)}},{key:"listeners",value:function(n){var r=this,i=n?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach(function(o){r.element[i](o,function(l){return r.set(l)},!1)})}},{key:"get",value:function(n){if(!e.enabled||!T0.event(n))return null;var r,i=n.target,o=n.changedTouches[0],l=parseFloat(i.getAttribute("min"))||0,s=parseFloat(i.getAttribute("max"))||100,c=parseFloat(i.getAttribute("step"))||1,d=i.getBoundingClientRect(),u=100/d.width*(this.config.thumbWidth/2)/100;return 0>(r=100/d.width*(o.clientX-d.left))?r=0:100<r&&(r=100),50>r?r-=(100-2*r)*u:50<r&&(r+=2*(r-50)*u),l+MP(r/100*(s-l),c)}},{key:"set",value:function(n){e.enabled&&T0.event(n)&&!n.target.disabled&&(n.preventDefault(),n.target.value=this.get(n),xP(n.target,n.type==="touchend"?"change":"input"))}}],[{key:"setup",value:function(n){var r=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{},i=null;if(T0.empty(n)||T0.string(n)?i=Array.from(document.querySelectorAll(T0.string(n)?n:'input[type="range"]')):T0.element(n)?i=[n]:T0.nodeList(n)?i=Array.from(n):T0.array(n)&&(i=n.filter(T0.element)),T0.empty(i))return null;var o=Fu({},Iu,{},r);if(T0.string(n)&&o.watch){var l=new MutationObserver(function(s){Array.from(s).forEach(function(c){Array.from(c.addedNodes).forEach(function(d){T0.element(d)&&bP(d,n)&&new e(d,o)})})});l.observe(document.body,{childList:!0,subtree:!0})}return i.map(function(s){return new e(s,r)})}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}]),e}();const b1=e=>e!=null?e.constructor:null,D2=(e,n)=>!!(e&&n&&e instanceof n),bs=e=>e==null,ju=e=>b1(e)===Object,TP=e=>b1(e)===Number&&!Number.isNaN(e),Rr=e=>b1(e)===String,NP=e=>b1(e)===Boolean,Wu=e=>typeof e=="function",Zu=e=>Array.isArray(e),DP=e=>D2(e,WeakMap),Yu=e=>D2(e,NodeList),OP=e=>b1(e)===Text,VP=e=>D2(e,Event),PP=e=>D2(e,KeyboardEvent),$P=e=>D2(e,window.TextTrackCue)||D2(e,window.VTTCue),FP=e=>D2(e,TextTrack)||!bs(e)&&Rr(e.kind),IP=e=>D2(e,Promise)&&Wu(e.then),RP=e=>e!==null&&typeof e=="object"&&e.nodeType===1&&typeof e.style=="object"&&typeof e.ownerDocument=="object",Gu=e=>bs(e)||(Rr(e)||Zu(e)||Yu(e))&&!e.length||ju(e)&&!Object.keys(e).length;var N={nullOrUndefined:bs,object:ju,number:TP,string:Rr,boolean:NP,function:Wu,array:Zu,weakMap:DP,nodeList:Yu,element:RP,textNode:OP,event:VP,keyboardEvent:PP,cue:$P,track:FP,promise:IP,url:e=>{if(D2(e,window.URL))return!0;if(!Rr(e))return!1;let n=e;e.startsWith("http://")&&e.startsWith("https://")||(n=`http://${e}`);try{return!Gu(new URL(n).hostname)}catch{return!1}},empty:Gu};const xs=(()=>{const e=document.createElement("span"),n={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},r=Object.keys(n).find(i=>e.style[i]!==void 0);return!!N.string(r)&&n[r]})();function Ku(e,n){setTimeout(()=>{try{e.hidden=!0,e.offsetHeight,e.hidden=!1}catch{}},n)}const HP=!!window.document.documentMode,qP=/Edge/g.test(navigator.userAgent),zP="WebkitAppearance"in document.documentElement.style&&!/Edge/g.test(navigator.userAgent),UP=/iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1,jP=navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,WP=/iPad|iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1;var b0={isIE:HP,isEdge:qP,isWebKit:zP,isIPhone:UP,isIPadOS:jP,isIos:WP};function ZP(e){return JSON.parse(JSON.stringify(e))}function Xu(e,n){return n.split(".").reduce((r,i)=>r&&r[i],e)}function h0(e={},...n){if(!n.length)return e;const r=n.shift();return N.object(r)?(Object.keys(r).forEach(i=>{N.object(r[i])?(Object.keys(e).includes(i)||Object.assign(e,{[i]:{}}),h0(e[i],r[i])):Object.assign(e,{[i]:r[i]})}),h0(e,...n)):e}function Qu(e,n){const r=e.length?e:[e];Array.from(r).reverse().forEach((i,o)=>{const l=o>0?n.cloneNode(!0):n,s=i.parentNode,c=i.nextSibling;l.appendChild(i),c?s.insertBefore(l,c):s.appendChild(l)})}function vs(e,n){N.element(e)&&!N.empty(n)&&Object.entries(n).filter(([,r])=>!N.nullOrUndefined(r)).forEach(([r,i])=>e.setAttribute(r,i))}function De(e,n,r){const i=document.createElement(e);return N.object(n)&&vs(i,n),N.string(r)&&(i.innerText=r),i}function YP(e,n){N.element(e)&&N.element(n)&&n.parentNode.insertBefore(e,n.nextSibling)}function Ju(e,n,r,i){N.element(n)&&n.appendChild(De(e,r,i))}function O2(e){N.nodeList(e)||N.array(e)?Array.from(e).forEach(O2):N.element(e)&&N.element(e.parentNode)&&e.parentNode.removeChild(e)}function Hr(e){if(!N.element(e))return;let{length:n}=e.childNodes;for(;n>0;)e.removeChild(e.lastChild),n-=1}function qr(e,n){return N.element(n)&&N.element(n.parentNode)&&N.element(e)?(n.parentNode.replaceChild(e,n),e):null}function w2(e,n){if(!N.string(e)||N.empty(e))return{};const r={},i=h0({},n);return e.split(",").forEach(o=>{const l=o.trim(),s=l.replace(".",""),c=l.replace(/[[\]]/g,"").split("="),[d]=c,u=c.length>1?c[1].replace(/["']/g,""):"";switch(l.charAt(0)){case".":N.string(i.class)?r.class=`${i.class} ${s}`:r.class=s;break;case"#":r.id=l.replace("#","");break;case"[":r[d]=u}}),h0(i,r)}function pt(e,n){if(!N.element(e))return;let r=n;N.boolean(r)||(r=!e.hidden),e.hidden=r}function Ye(e,n,r){if(N.nodeList(e))return Array.from(e).map(i=>Ye(i,n,r));if(N.element(e)){let i="toggle";return r!==void 0&&(i=r?"add":"remove"),e.classList[i](n),e.classList.contains(n)}return!1}function zr(e,n){return N.element(e)&&e.classList.contains(n)}function mt(e,n){const{prototype:r}=Element;return(r.matches||r.webkitMatchesSelector||r.mozMatchesSelector||r.msMatchesSelector||function(){return Array.from(document.querySelectorAll(n)).includes(this)}).call(e,n)}function GP(e,n){const{prototype:r}=Element;return(r.closest||function(){let i=this;do{if(mt.matches(i,n))return i;i=i.parentElement||i.parentNode}while(i!==null&&i.nodeType===1);return null}).call(e,n)}function x1(e){return this.elements.container.querySelectorAll(e)}function y0(e){return this.elements.container.querySelector(e)}function _s(e=null,n=!1){N.element(e)&&e.focus({preventScroll:!0,focusVisible:n})}const eh={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},f0={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check(e,n){const r=f0[e]||n!=="html5";return{api:r,ui:r&&f0.rangeInput}},pip:!(b0.isIPhone||!N.function(De("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||De("video").disablePictureInPicture)),airplay:N.function(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime(e){if(N.empty(e))return!1;const[n]=e.split("/");let r=e;if(!this.isHTML5||n!==this.type)return!1;Object.keys(eh).includes(r)&&(r+=`; codecs="${eh[e]}"`);try{return!!(r&&this.media.canPlayType(r).replace(/no/,""))}catch{return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(()=>{const e=document.createElement("input");return e.type="range",e.type==="range"})(),touch:"ontouchstart"in document.documentElement,transitions:xs!==!1,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},KP=(()=>{let e=!1;try{const n=Object.defineProperty({},"passive",{get:()=>(e=!0,null)});window.addEventListener("test",null,n),window.removeEventListener("test",null,n)}catch{}return e})();function v1(e,n,r,i=!1,o=!0,l=!1){if(!e||!("addEventListener"in e)||N.empty(n)||!N.function(r))return;const s=n.split(" ");let c=l;KP&&(c={passive:o,capture:l}),s.forEach(d=>{this&&this.eventListeners&&i&&this.eventListeners.push({element:e,type:d,callback:r,options:c}),e[i?"addEventListener":"removeEventListener"](d,r,c)})}function ze(e,n="",r,i=!0,o=!1){v1.call(this,e,n,r,!0,i,o)}function Ur(e,n="",r,i=!0,o=!1){v1.call(this,e,n,r,!1,i,o)}function ks(e,n="",r,i=!0,o=!1){const l=(...s)=>{Ur(e,n,l,i,o),r.apply(this,s)};v1.call(this,e,n,l,!0,i,o)}function Oe(e,n="",r=!1,i={}){if(!N.element(e)||N.empty(n))return;const o=new CustomEvent(n,{bubbles:r,detail:{...i,plyr:this}});e.dispatchEvent(o)}function XP(){this&&this.eventListeners&&(this.eventListeners.forEach(e=>{const{element:n,type:r,callback:i,options:o}=e;n.removeEventListener(r,i,o)}),this.eventListeners=[])}function QP(){return new Promise(e=>this.ready?setTimeout(e,0):ze.call(this,this.elements.container,"ready",e)).then(()=>{})}function C2(e){N.promise(e)&&e.then(null,()=>{})}function Es(e){return N.array(e)?e.filter((n,r)=>e.indexOf(n)===r):e}function th(e,n){return N.array(e)&&e.length?e.reduce((r,i)=>Math.abs(i-n)<Math.abs(r-n)?i:r):null}function rh(e){return!(!window||!window.CSS)&&window.CSS.supports(e)}const nh=[[1,1],[4,3],[3,4],[5,4],[4,5],[3,2],[2,3],[16,10],[10,16],[16,9],[9,16],[21,9],[9,21],[32,9],[9,32]].reduce((e,[n,r])=>({...e,[n/r]:[n,r]}),{});function ah(e){return N.array(e)||N.string(e)&&e.includes(":")?(N.array(e)?e:e.split(":")).map(Number).every(N.number):!1}function jr(e){if(!N.array(e)||!e.every(N.number))return null;const[n,r]=e,i=(l,s)=>s===0?l:i(s,l%s),o=i(n,r);return[n/o,r/o]}function Ls(e){const n=i=>ah(i)?i.split(":").map(Number):null;let r=n(e);if(r===null&&(r=n(this.config.ratio)),r===null&&!N.empty(this.embed)&&N.array(this.embed.ratio)&&({ratio:r}=this.embed),r===null&&this.isHTML5){const{videoWidth:i,videoHeight:o}=this.media;r=[i,o]}return jr(r)}function Ft(e){if(!this.isVideo)return{};const{wrapper:n}=this.elements,r=Ls.call(this,e);if(!N.array(r))return{};const[i,o]=jr(r),l=100/i*o;if(rh(`aspect-ratio: ${i}/${o}`)?n.style.aspectRatio=`${i}/${o}`:n.style.paddingBottom=`${l}%`,this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){const s=100/this.media.offsetWidth*parseInt(window.getComputedStyle(this.media).paddingBottom,10),c=(s-l)/(s/50);this.fullscreen.active?n.style.paddingBottom=null:this.media.style.transform=`translateY(-${c}%)`}else this.isHTML5&&n.classList.add(this.config.classNames.videoFixedRatio);return{padding:l,ratio:r}}function ih(e,n,r=.05){const i=e/n,o=th(Object.keys(nh),i);return Math.abs(o-i)<=r?nh[o]:[e,n]}function JP(){return[Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)]}const j2={getSources(){return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter(e=>{const n=e.getAttribute("type");return!!N.empty(n)||f0.mime.call(this,n)}):[]},getQualityOptions(){return this.config.quality.forced?this.config.quality.options:j2.getSources.call(this).map(e=>Number(e.getAttribute("size"))).filter(Boolean)},setup(){if(!this.isHTML5)return;const e=this;e.options.speed=e.config.speed.options,N.empty(this.config.ratio)||Ft.call(e),Object.defineProperty(e.media,"quality",{get(){const n=j2.getSources.call(e).find(r=>r.getAttribute("src")===e.source);return n&&Number(n.getAttribute("size"))},set(n){if(e.quality!==n){if(e.config.quality.forced&&N.function(e.config.quality.onChange))e.config.quality.onChange(n);else{const r=j2.getSources.call(e).find(d=>Number(d.getAttribute("size"))===n);if(!r)return;const{currentTime:i,paused:o,preload:l,readyState:s,playbackRate:c}=e.media;e.media.src=r.getAttribute("src"),(l!=="none"||s)&&(e.once("loadedmetadata",()=>{e.speed=c,e.currentTime=i,o||C2(e.play())}),e.media.load())}Oe.call(e,e.media,"qualitychange",!1,{quality:n})}}})},cancelRequests(){this.isHTML5&&(O2(j2.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function e$(e){return`${e}-${Math.floor(1e4*Math.random())}`}function As(e,...n){return N.empty(e)?e:e.toString().replace(/{(\d+)}/g,(r,i)=>n[i].toString())}function t$(e,n){return e===0||n===0||Number.isNaN(e)||Number.isNaN(n)?0:(e/n*100).toFixed(2)}const _1=(e="",n="",r="")=>e.replace(new RegExp(n.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),r.toString()),oh=(e="")=>e.toString().replace(/\w\S*/g,n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase());function r$(e=""){let n=e.toString();return n=_1(n,"-"," "),n=_1(n,"_"," "),n=oh(n),_1(n," ","")}function n$(e=""){let n=e.toString();return n=r$(n),n.charAt(0).toLowerCase()+n.slice(1)}function a$(e){const n=document.createDocumentFragment(),r=document.createElement("div");return n.appendChild(r),r.innerHTML=e,n.firstChild.innerText}function i$(e){const n=document.createElement("div");return n.appendChild(e),n.innerHTML}const lh={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},x0={get(e="",n={}){if(N.empty(e)||N.empty(n))return"";let r=Xu(n.i18n,e);if(N.empty(r))return Object.keys(lh).includes(e)?lh[e]:"";const i={"{seektime}":n.seekTime,"{title}":n.title};return Object.entries(i).forEach(([o,l])=>{r=_1(r,o,l)}),r}};class k1{constructor(n){we(this,"get",r=>{if(!k1.supported||!this.enabled)return null;const i=window.localStorage.getItem(this.key);if(N.empty(i))return null;const o=JSON.parse(i);return N.string(r)&&r.length?o[r]:o}),we(this,"set",r=>{if(!k1.supported||!this.enabled||!N.object(r))return;let i=this.get();N.empty(i)&&(i={}),h0(i,r);try{window.localStorage.setItem(this.key,JSON.stringify(i))}catch{}}),this.enabled=n.config.storage.enabled,this.key=n.config.storage.key}static get supported(){try{if(!("localStorage"in window))return!1;const n="___test";return window.localStorage.setItem(n,n),window.localStorage.removeItem(n),!0}catch{return!1}}}function E1(e,n="text"){return new Promise((r,i)=>{try{const o=new XMLHttpRequest;if(!("withCredentials"in o))return;o.addEventListener("load",()=>{if(n==="text")try{r(JSON.parse(o.responseText))}catch{r(o.responseText)}else r(o.response)}),o.addEventListener("error",()=>{throw new Error(o.status)}),o.open("GET",e,!0),o.responseType=n,o.send()}catch(o){i(o)}})}function sh(e,n){if(!N.string(e))return;const r="cache",i=N.string(n);let o=!1;const l=()=>document.getElementById(n)!==null,s=(c,d)=>{c.innerHTML=d,i&&l()||document.body.insertAdjacentElement("afterbegin",c)};if(!i||!l()){const c=k1.supported,d=document.createElement("div");if(d.setAttribute("hidden",""),i&&d.setAttribute("id",n),c){const u=window.localStorage.getItem(`${r}-${n}`);if(o=u!==null,o){const h=JSON.parse(u);s(d,h.content)}}E1(e).then(u=>{if(!N.empty(u)){if(c)try{window.localStorage.setItem(`${r}-${n}`,JSON.stringify({content:u}))}catch{}s(d,u)}}).catch(()=>{})}}const ch=e=>Math.trunc(e/60/60%60,10),o$=e=>Math.trunc(e/60%60,10),l$=e=>Math.trunc(e%60,10);function Wr(e=0,n=!1,r=!1){if(!N.number(e))return Wr(void 0,n,r);const i=c=>`0${c}`.slice(-2);let o=ch(e);const l=o$(e),s=l$(e);return o=n||o>0?`${o}:`:"",`${r&&e>0?"-":""}${o}${i(l)}:${i(s)}`}const pe={getIconUrl(){const e=new URL(this.config.iconUrl,window.location),n=window.location.host?window.location.host:window.top.location.host,r=e.host!==n||b0.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:r}},findElements(){try{return this.elements.controls=y0.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:x1.call(this,this.config.selectors.buttons.play),pause:y0.call(this,this.config.selectors.buttons.pause),restart:y0.call(this,this.config.selectors.buttons.restart),rewind:y0.call(this,this.config.selectors.buttons.rewind),fastForward:y0.call(this,this.config.selectors.buttons.fastForward),mute:y0.call(this,this.config.selectors.buttons.mute),pip:y0.call(this,this.config.selectors.buttons.pip),airplay:y0.call(this,this.config.selectors.buttons.airplay),settings:y0.call(this,this.config.selectors.buttons.settings),captions:y0.call(this,this.config.selectors.buttons.captions),fullscreen:y0.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=y0.call(this,this.config.selectors.progress),this.elements.inputs={seek:y0.call(this,this.config.selectors.inputs.seek),volume:y0.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:y0.call(this,this.config.selectors.display.buffer),currentTime:y0.call(this,this.config.selectors.display.currentTime),duration:y0.call(this,this.config.selectors.display.duration)},N.element(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(`.${this.config.classNames.tooltip}`)),!0}catch(e){return this.debug.warn("It looks like there is a problem with your custom controls HTML",e),this.toggleNativeControls(!0),!1}},createIcon(e,n){const r="http://www.w3.org/2000/svg",i=pe.getIconUrl.call(this),o=`${i.cors?"":i.url}#${this.config.iconPrefix}`,l=document.createElementNS(r,"svg");vs(l,h0(n,{"aria-hidden":"true",focusable:"false"}));const s=document.createElementNS(r,"use"),c=`${o}-${e}`;return"href"in s&&s.setAttributeNS("http://www.w3.org/1999/xlink","href",c),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c),l.appendChild(s),l},createLabel(e,n={}){const r=x0.get(e,this.config);return De("span",{...n,class:[n.class,this.config.classNames.hidden].filter(Boolean).join(" ")},r)},createBadge(e){if(N.empty(e))return null;const n=De("span",{class:this.config.classNames.menu.value});return n.appendChild(De("span",{class:this.config.classNames.menu.badge},e)),n},createButton(e,n){const r=h0({},n);let i=n$(e);const o={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach(s=>{Object.keys(r).includes(s)&&(o[s]=r[s],delete r[s])}),o.element!=="button"||Object.keys(r).includes("type")||(r.type="button"),Object.keys(r).includes("class")?r.class.split(" ").some(s=>s===this.config.classNames.control)||h0(r,{class:`${r.class} ${this.config.classNames.control}`}):r.class=this.config.classNames.control,e){case"play":o.toggle=!0,o.label="play",o.labelPressed="pause",o.icon="play",o.iconPressed="pause";break;case"mute":o.toggle=!0,o.label="mute",o.labelPressed="unmute",o.icon="volume",o.iconPressed="muted";break;case"captions":o.toggle=!0,o.label="enableCaptions",o.labelPressed="disableCaptions",o.icon="captions-off",o.iconPressed="captions-on";break;case"fullscreen":o.toggle=!0,o.label="enterFullscreen",o.labelPressed="exitFullscreen",o.icon="enter-fullscreen",o.iconPressed="exit-fullscreen";break;case"play-large":r.class+=` ${this.config.classNames.control}--overlaid`,i="play",o.label="play",o.icon="play";break;default:N.empty(o.label)&&(o.label=i),N.empty(o.icon)&&(o.icon=e)}const l=De(o.element);return o.toggle?(l.appendChild(pe.createIcon.call(this,o.iconPressed,{class:"icon--pressed"})),l.appendChild(pe.createIcon.call(this,o.icon,{class:"icon--not-pressed"})),l.appendChild(pe.createLabel.call(this,o.labelPressed,{class:"label--pressed"})),l.appendChild(pe.createLabel.call(this,o.label,{class:"label--not-pressed"}))):(l.appendChild(pe.createIcon.call(this,o.icon)),l.appendChild(pe.createLabel.call(this,o.label))),h0(r,w2(this.config.selectors.buttons[i],r)),vs(l,r),i==="play"?(N.array(this.elements.buttons[i])||(this.elements.buttons[i]=[]),this.elements.buttons[i].push(l)):this.elements.buttons[i]=l,l},createRange(e,n){const r=De("input",h0(w2(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":x0.get(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},n));return this.elements.inputs[e]=r,pe.updateRangeFill.call(this,r),BP.setup(r),r},createProgress(e,n){const r=De("progress",h0(w2(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},n));if(e!=="volume"){r.appendChild(De("span",null,"0"));const i={played:"played",buffer:"buffered"}[e],o=i?x0.get(i,this.config):"";r.innerText=`% ${o.toLowerCase()}`}return this.elements.display[e]=r,r},createTime(e,n){const r=w2(this.config.selectors.display[e],n),i=De("div",h0(r,{class:`${r.class?r.class:""} ${this.config.classNames.display.time} `.trim(),"aria-label":x0.get(e,this.config),role:"timer"}),"00:00");return this.elements.display[e]=i,i},bindMenuItemShortcuts(e,n){ze.call(this,e,"keydown keyup",r=>{if(![" ","ArrowUp","ArrowDown","ArrowRight"].includes(r.key)||(r.preventDefault(),r.stopPropagation(),r.type==="keydown"))return;const i=mt(e,'[role="menuitemradio"]');if(!i&&[" ","ArrowRight"].includes(r.key))pe.showMenuPanel.call(this,n,!0);else{let o;r.key!==" "&&(r.key==="ArrowDown"||i&&r.key==="ArrowRight"?(o=e.nextElementSibling,N.element(o)||(o=e.parentNode.firstElementChild)):(o=e.previousElementSibling,N.element(o)||(o=e.parentNode.lastElementChild)),_s.call(this,o,!0))}},!1),ze.call(this,e,"keyup",r=>{r.key==="Return"&&pe.focusFirstMenuItem.call(this,null,!0)})},createMenuItem({value:e,list:n,type:r,title:i,badge:o=null,checked:l=!1}){const s=w2(this.config.selectors.inputs[r]),c=De("button",h0(s,{type:"button",role:"menuitemradio",class:`${this.config.classNames.control} ${s.class?s.class:""}`.trim(),"aria-checked":l,value:e})),d=De("span");d.innerHTML=i,N.element(o)&&d.appendChild(o),c.appendChild(d),Object.defineProperty(c,"checked",{enumerable:!0,get:()=>c.getAttribute("aria-checked")==="true",set(u){u&&Array.from(c.parentNode.children).filter(h=>mt(h,'[role="menuitemradio"]')).forEach(h=>h.setAttribute("aria-checked","false")),c.setAttribute("aria-checked",u?"true":"false")}}),this.listeners.bind(c,"click keyup",u=>{if(!N.keyboardEvent(u)||u.key===" "){switch(u.preventDefault(),u.stopPropagation(),c.checked=!0,r){case"language":this.currentTrack=Number(e);break;case"quality":this.quality=e;break;case"speed":this.speed=parseFloat(e)}pe.showMenuPanel.call(this,"home",N.keyboardEvent(u))}},r,!1),pe.bindMenuItemShortcuts.call(this,c,r),n.appendChild(c)},formatTime(e=0,n=!1){return N.number(e)?Wr(e,ch(this.duration)>0,n):e},updateTimeDisplay(e=null,n=0,r=!1){N.element(e)&&N.number(n)&&(e.innerText=pe.formatTime(n,r))},updateVolume(){this.supported.ui&&(N.element(this.elements.inputs.volume)&&pe.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),N.element(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||this.volume===0))},setRange(e,n=0){N.element(e)&&(e.value=n,pe.updateRangeFill.call(this,e))},updateProgress(e){if(!this.supported.ui||!N.event(e))return;let n=0;const r=(i,o)=>{const l=N.number(o)?o:0,s=N.element(i)?i:this.elements.display.buffer;if(N.element(s)){s.value=l;const c=s.getElementsByTagName("span")[0];N.element(c)&&(c.childNodes[0].nodeValue=l)}};if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":n=t$(this.currentTime,this.duration),e.type==="timeupdate"&&pe.setRange.call(this,this.elements.inputs.seek,n);break;case"playing":case"progress":r(this.elements.display.buffer,100*this.buffered)}},updateRangeFill(e){const n=N.event(e)?e.target:e;if(N.element(n)&&n.getAttribute("type")==="range"){if(mt(n,this.config.selectors.inputs.seek)){n.setAttribute("aria-valuenow",this.currentTime);const r=pe.formatTime(this.currentTime),i=pe.formatTime(this.duration),o=x0.get("seekLabel",this.config);n.setAttribute("aria-valuetext",o.replace("{currentTime}",r).replace("{duration}",i))}else if(mt(n,this.config.selectors.inputs.volume)){const r=100*n.value;n.setAttribute("aria-valuenow",r),n.setAttribute("aria-valuetext",`${r.toFixed(1)}%`)}else n.setAttribute("aria-valuenow",n.value);(b0.isWebKit||b0.isIPadOS)&&n.style.setProperty("--value",n.value/n.max*100+"%")}},updateSeekTooltip(e){var n,r;if(!this.config.tooltips.seek||!N.element(this.elements.inputs.seek)||!N.element(this.elements.display.seekTooltip)||this.duration===0)return;const i=this.elements.display.seekTooltip,o=`${this.config.classNames.tooltip}--visible`,l=h=>Ye(i,o,h);if(this.touch)return void l(!1);let s=0;const c=this.elements.progress.getBoundingClientRect();if(N.event(e))s=100/c.width*(e.pageX-c.left);else{if(!zr(i,o))return;s=parseFloat(i.style.left,10)}s<0?s=0:s>100&&(s=100);const d=this.duration/100*s;i.innerText=pe.formatTime(d);const u=(n=this.config.markers)===null||n===void 0||(r=n.points)===null||r===void 0?void 0:r.find(({time:h})=>h===Math.round(d));u&&i.insertAdjacentHTML("afterbegin",`${u.label}<br>`),i.style.left=`${s}%`,N.event(e)&&["mouseenter","mouseleave"].includes(e.type)&&l(e.type==="mouseenter")},timeUpdate(e){const n=!N.element(this.elements.display.duration)&&this.config.invertTime;pe.updateTimeDisplay.call(this,this.elements.display.currentTime,n?this.duration-this.currentTime:this.currentTime,n),e&&e.type==="timeupdate"&&this.media.seeking||pe.updateProgress.call(this,e)},durationUpdate(){if(!this.supported.ui||!this.config.invertTime&&this.currentTime)return;if(this.duration>=2**32)return pt(this.elements.display.currentTime,!0),void pt(this.elements.progress,!0);N.element(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);const e=N.element(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&pe.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&pe.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),this.config.markers.enabled&&pe.setMarkers.call(this),pe.updateSeekTooltip.call(this)},toggleMenuButton(e,n){pt(this.elements.settings.buttons[e],!n)},updateSetting(e,n,r){const i=this.elements.settings.panels[e];let o=null,l=n;if(e==="captions")o=this.currentTrack;else{if(o=N.empty(r)?this[e]:r,N.empty(o)&&(o=this.config[e].default),!N.empty(this.options[e])&&!this.options[e].includes(o))return void this.debug.warn(`Unsupported value of '${o}' for ${e}`);if(!this.config[e].options.includes(o))return void this.debug.warn(`Disabled value of '${o}' for ${e}`)}if(N.element(l)||(l=i&&i.querySelector('[role="menu"]')),!N.element(l))return;this.elements.settings.buttons[e].querySelector(`.${this.config.classNames.menu.value}`).innerHTML=pe.getLabel.call(this,e,o);const s=l&&l.querySelector(`[value="${o}"]`);N.element(s)&&(s.checked=!0)},getLabel(e,n){switch(e){case"speed":return n===1?x0.get("normal",this.config):`${n}×`;case"quality":if(N.number(n)){const r=x0.get(`qualityLabel.${n}`,this.config);return r.length?r:`${n}p`}return oh(n);case"captions":return We.getLabel.call(this);default:return null}},setQualityMenu(e){if(!N.element(this.elements.settings.panels.quality))return;const n="quality",r=this.elements.settings.panels.quality.querySelector('[role="menu"]');N.array(e)&&(this.options.quality=Es(e).filter(l=>this.config.quality.options.includes(l)));const i=!N.empty(this.options.quality)&&this.options.quality.length>1;if(pe.toggleMenuButton.call(this,n,i),Hr(r),pe.checkMenu.call(this),!i)return;const o=l=>{const s=x0.get(`qualityBadge.${l}`,this.config);return s.length?pe.createBadge.call(this,s):null};this.options.quality.sort((l,s)=>{const c=this.config.quality.options;return c.indexOf(l)>c.indexOf(s)?1:-1}).forEach(l=>{pe.createMenuItem.call(this,{value:l,list:r,type:n,title:pe.getLabel.call(this,"quality",l),badge:o(l)})}),pe.updateSetting.call(this,n,r)},setCaptionsMenu(){if(!N.element(this.elements.settings.panels.captions))return;const e="captions",n=this.elements.settings.panels.captions.querySelector('[role="menu"]'),r=We.getTracks.call(this),i=!!r.length;if(pe.toggleMenuButton.call(this,e,i),Hr(n),pe.checkMenu.call(this),!i)return;const o=r.map((l,s)=>({value:s,checked:this.captions.toggled&&this.currentTrack===s,title:We.getLabel.call(this,l),badge:l.language&&pe.createBadge.call(this,l.language.toUpperCase()),list:n,type:"language"}));o.unshift({value:-1,checked:!this.captions.toggled,title:x0.get("disabled",this.config),list:n,type:"language"}),o.forEach(pe.createMenuItem.bind(this)),pe.updateSetting.call(this,e,n)},setSpeedMenu(){if(!N.element(this.elements.settings.panels.speed))return;const e="speed",n=this.elements.settings.panels.speed.querySelector('[role="menu"]');this.options.speed=this.options.speed.filter(i=>i>=this.minimumSpeed&&i<=this.maximumSpeed);const r=!N.empty(this.options.speed)&&this.options.speed.length>1;pe.toggleMenuButton.call(this,e,r),Hr(n),pe.checkMenu.call(this),r&&(this.options.speed.forEach(i=>{pe.createMenuItem.call(this,{value:i,list:n,type:e,title:pe.getLabel.call(this,"speed",i)})}),pe.updateSetting.call(this,e,n))},checkMenu(){const{buttons:e}=this.elements.settings,n=!N.empty(e)&&Object.values(e).some(r=>!r.hidden);pt(this.elements.settings.menu,!n)},focusFirstMenuItem(e,n=!1){if(this.elements.settings.popup.hidden)return;let r=e;N.element(r)||(r=Object.values(this.elements.settings.panels).find(o=>!o.hidden));const i=r.querySelector('[role^="menuitem"]');_s.call(this,i,n)},toggleMenu(e){const{popup:n}=this.elements.settings,r=this.elements.buttons.settings;if(!N.element(n)||!N.element(r))return;const{hidden:i}=n;let o=i;if(N.boolean(e))o=e;else if(N.keyboardEvent(e)&&e.key==="Escape")o=!1;else if(N.event(e)){const l=N.function(e.composedPath)?e.composedPath()[0]:e.target,s=n.contains(l);if(s||!s&&e.target!==r&&o)return}r.setAttribute("aria-expanded",o),pt(n,!o),Ye(this.elements.container,this.config.classNames.menu.open,o),o&&N.keyboardEvent(e)?pe.focusFirstMenuItem.call(this,null,!0):o||i||_s.call(this,r,N.keyboardEvent(e))},getMenuSize(e){const n=e.cloneNode(!0);n.style.position="absolute",n.style.opacity=0,n.removeAttribute("hidden"),e.parentNode.appendChild(n);const r=n.scrollWidth,i=n.scrollHeight;return O2(n),{width:r,height:i}},showMenuPanel(e="",n=!1){const r=this.elements.container.querySelector(`#plyr-settings-${this.id}-${e}`);if(!N.element(r))return;const i=r.parentNode,o=Array.from(i.children).find(l=>!l.hidden);if(f0.transitions&&!f0.reducedMotion){i.style.width=`${o.scrollWidth}px`,i.style.height=`${o.scrollHeight}px`;const l=pe.getMenuSize.call(this,r),s=c=>{c.target===i&&["width","height"].includes(c.propertyName)&&(i.style.width="",i.style.height="",Ur.call(this,i,xs,s))};ze.call(this,i,xs,s),i.style.width=`${l.width}px`,i.style.height=`${l.height}px`}pt(o,!0),pt(r,!1),pe.focusFirstMenuItem.call(this,r,n)},setDownloadUrl(){const e=this.elements.buttons.download;N.element(e)&&e.setAttribute("href",this.download)},create(e){const{bindMenuItemShortcuts:n,createButton:r,createProgress:i,createRange:o,createTime:l,setQualityMenu:s,setSpeedMenu:c,showMenuPanel:d}=pe;this.elements.controls=null,N.array(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(r.call(this,"play-large"));const u=De("div",w2(this.config.selectors.controls.wrapper));this.elements.controls=u;const h={class:"plyr__controls__item"};return Es(N.array(this.config.controls)?this.config.controls:[]).forEach(p=>{if(p==="restart"&&u.appendChild(r.call(this,"restart",h)),p==="rewind"&&u.appendChild(r.call(this,"rewind",h)),p==="play"&&u.appendChild(r.call(this,"play",h)),p==="fast-forward"&&u.appendChild(r.call(this,"fast-forward",h)),p==="progress"){const m=De("div",{class:`${h.class} plyr__progress__container`}),w=De("div",w2(this.config.selectors.progress));if(w.appendChild(o.call(this,"seek",{id:`plyr-seek-${e.id}`})),w.appendChild(i.call(this,"buffer")),this.config.tooltips.seek){const x=De("span",{class:this.config.classNames.tooltip},"00:00");w.appendChild(x),this.elements.display.seekTooltip=x}this.elements.progress=w,m.appendChild(this.elements.progress),u.appendChild(m)}if(p==="current-time"&&u.appendChild(l.call(this,"currentTime",h)),p==="duration"&&u.appendChild(l.call(this,"duration",h)),p==="mute"||p==="volume"){let{volume:m}=this.elements;if(N.element(m)&&u.contains(m)||(m=De("div",h0({},h,{class:`${h.class} plyr__volume`.trim()})),this.elements.volume=m,u.appendChild(m)),p==="mute"&&m.appendChild(r.call(this,"mute")),p==="volume"&&!b0.isIos&&!b0.isIPadOS){const w={max:1,step:.05,value:this.config.volume};m.appendChild(o.call(this,"volume",h0(w,{id:`plyr-volume-${e.id}`})))}}if(p==="captions"&&u.appendChild(r.call(this,"captions",h)),p==="settings"&&!N.empty(this.config.settings)){const m=De("div",h0({},h,{class:`${h.class} plyr__menu`.trim(),hidden:""}));m.appendChild(r.call(this,"settings",{"aria-haspopup":!0,"aria-controls":`plyr-settings-${e.id}`,"aria-expanded":!1}));const w=De("div",{class:"plyr__menu__container",id:`plyr-settings-${e.id}`,hidden:""}),x=De("div"),b=De("div",{id:`plyr-settings-${e.id}-home`}),v=De("div",{role:"menu"});b.appendChild(v),x.appendChild(b),this.elements.settings.panels.home=b,this.config.settings.forEach(C=>{const y=De("button",h0(w2(this.config.selectors.buttons.settings),{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--forward`,role:"menuitem","aria-haspopup":!0,hidden:""}));n.call(this,y,C),ze.call(this,y,"click",()=>{d.call(this,C,!1)});const _=De("span",null,x0.get(C,this.config)),L=De("span",{class:this.config.classNames.menu.value});L.innerHTML=e[C],_.appendChild(L),y.appendChild(_),v.appendChild(y);const T=De("div",{id:`plyr-settings-${e.id}-${C}`,hidden:""}),q=De("button",{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--back`});q.appendChild(De("span",{"aria-hidden":!0},x0.get(C,this.config))),q.appendChild(De("span",{class:this.config.classNames.hidden},x0.get("menuBack",this.config))),ze.call(this,T,"keydown",$=>{$.key==="ArrowLeft"&&($.preventDefault(),$.stopPropagation(),d.call(this,"home",!0))},!1),ze.call(this,q,"click",()=>{d.call(this,"home",!1)}),T.appendChild(q),T.appendChild(De("div",{role:"menu"})),x.appendChild(T),this.elements.settings.buttons[C]=y,this.elements.settings.panels[C]=T}),w.appendChild(x),m.appendChild(w),u.appendChild(m),this.elements.settings.popup=w,this.elements.settings.menu=m}if(p==="pip"&&f0.pip&&u.appendChild(r.call(this,"pip",h)),p==="airplay"&&f0.airplay&&u.appendChild(r.call(this,"airplay",h)),p==="download"){const m=h0({},h,{element:"a",href:this.download,target:"_blank"});this.isHTML5&&(m.download="");const{download:w}=this.config.urls;!N.url(w)&&this.isEmbed&&h0(m,{icon:`logo-${this.provider}`,label:this.provider}),u.appendChild(r.call(this,"download",m))}p==="fullscreen"&&u.appendChild(r.call(this,"fullscreen",h))}),this.isHTML5&&s.call(this,j2.getQualityOptions.call(this)),c.call(this),u},inject(){if(this.config.loadSprite){const o=pe.getIconUrl.call(this);o.cors&&sh(o.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());let e=null;this.elements.controls=null;const n={id:this.id,seektime:this.config.seekTime,title:this.config.title};let r=!0;N.function(this.config.controls)&&(this.config.controls=this.config.controls.call(this,n)),this.config.controls||(this.config.controls=[]),N.element(this.config.controls)||N.string(this.config.controls)?e=this.config.controls:(e=pe.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:We.getLabel.call(this)}),r=!1);let i;if(r&&N.string(this.config.controls)&&(e=(o=>{let l=o;return Object.entries(n).forEach(([s,c])=>{l=_1(l,`{${s}}`,c)}),l})(e)),N.string(this.config.selectors.controls.container)&&(i=document.querySelector(this.config.selectors.controls.container)),N.element(i)||(i=this.elements.container),i[N.element(e)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",e),N.element(this.elements.controls)||pe.findElements.call(this),!N.empty(this.elements.buttons)){const o=l=>{const s=this.config.classNames.controlPressed;l.setAttribute("aria-pressed","false"),Object.defineProperty(l,"pressed",{configurable:!0,enumerable:!0,get:()=>zr(l,s),set(c=!1){Ye(l,s,c),l.setAttribute("aria-pressed",c?"true":"false")}})};Object.values(this.elements.buttons).filter(Boolean).forEach(l=>{N.array(l)||N.nodeList(l)?Array.from(l).filter(Boolean).forEach(o):o(l)})}if(b0.isEdge&&Ku(i),this.config.tooltips.controls){const{classNames:o,selectors:l}=this.config,s=`${l.controls.wrapper} ${l.labels} .${o.hidden}`,c=x1.call(this,s);Array.from(c).forEach(d=>{Ye(d,this.config.classNames.hidden,!1),Ye(d,this.config.classNames.tooltip,!0)})}},setMediaMetadata(){try{"mediaSession"in navigator&&(navigator.mediaSession.metadata=new window.MediaMetadata({title:this.config.mediaMetadata.title,artist:this.config.mediaMetadata.artist,album:this.config.mediaMetadata.album,artwork:this.config.mediaMetadata.artwork}))}catch{}},setMarkers(){var e,n;if(!this.duration||this.elements.markers)return;const r=(e=this.config.markers)===null||e===void 0||(n=e.points)===null||n===void 0?void 0:n.filter(({time:d})=>d>0&&d<this.duration);if(r==null||!r.length)return;const i=document.createDocumentFragment(),o=document.createDocumentFragment();let l=null;const s=`${this.config.classNames.tooltip}--visible`,c=d=>Ye(l,s,d);r.forEach(d=>{const u=De("span",{class:this.config.classNames.marker},""),h=d.time/this.duration*100+"%";l&&(u.addEventListener("mouseenter",()=>{d.label||(l.style.left=h,l.innerHTML=d.label,c(!0))}),u.addEventListener("mouseleave",()=>{c(!1)})),u.addEventListener("click",()=>{this.currentTime=d.time}),u.style.left=h,o.appendChild(u)}),i.appendChild(o),this.config.tooltips.seek||(l=De("span",{class:this.config.classNames.tooltip},""),i.appendChild(l)),this.elements.markers={points:o,tip:l},this.elements.progress.appendChild(i)}};function dh(e,n=!0){let r=e;if(n){const i=document.createElement("a");i.href=r,r=i.href}try{return new URL(r)}catch{return null}}function uh(e){const n=new URLSearchParams;return N.object(e)&&Object.entries(e).forEach(([r,i])=>{n.set(r,i)}),n}const We={setup(){if(!this.supported.ui)return;if(!this.isVideo||this.isYouTube||this.isHTML5&&!f0.textTracks)return void(N.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&pe.setCaptionsMenu.call(this));if(N.element(this.elements.captions)||(this.elements.captions=De("div",w2(this.config.selectors.captions)),this.elements.captions.setAttribute("dir","auto"),YP(this.elements.captions,this.elements.wrapper)),b0.isIE&&window.URL){const i=this.media.querySelectorAll("track");Array.from(i).forEach(o=>{const l=o.getAttribute("src"),s=dh(l);s!==null&&s.hostname!==window.location.href.hostname&&["http:","https:"].includes(s.protocol)&&E1(l,"blob").then(c=>{o.setAttribute("src",window.URL.createObjectURL(c))}).catch(()=>{O2(o)})})}const e=Es((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map(i=>i.split("-")[0]));let n=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();n==="auto"&&([n]=e);let r=this.storage.get("captions");if(N.boolean(r)||({active:r}=this.config.captions),Object.assign(this.captions,{toggled:!1,active:r,language:n,languages:e}),this.isHTML5){const i=this.config.captions.update?"addtrack removetrack":"removetrack";ze.call(this,this.media.textTracks,i,We.update.bind(this))}setTimeout(We.update.bind(this),0)},update(){const e=We.getTracks.call(this,!0),{active:n,language:r,meta:i,currentTrackNode:o}=this.captions,l=!!e.find(s=>s.language===r);this.isHTML5&&this.isVideo&&e.filter(s=>!i.get(s)).forEach(s=>{this.debug.log("Track added",s),i.set(s,{default:s.mode==="showing"}),s.mode==="showing"&&(s.mode="hidden"),ze.call(this,s,"cuechange",()=>We.updateCues.call(this))}),(l&&this.language!==r||!e.includes(o))&&(We.setLanguage.call(this,r),We.toggle.call(this,n&&l)),this.elements&&Ye(this.elements.container,this.config.classNames.captions.enabled,!N.empty(e)),N.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&pe.setCaptionsMenu.call(this)},toggle(e,n=!0){if(!this.supported.ui)return;const{toggled:r}=this.captions,i=this.config.classNames.captions.active,o=N.nullOrUndefined(e)?!r:e;if(o!==r){if(n||(this.captions.active=o,this.storage.set({captions:o})),!this.language&&o&&!n){const l=We.getTracks.call(this),s=We.findTrack.call(this,[this.captions.language,...this.captions.languages],!0);return this.captions.language=s.language,void We.set.call(this,l.indexOf(s))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=o),Ye(this.elements.container,i,o),this.captions.toggled=o,pe.updateSetting.call(this,"captions"),Oe.call(this,this.media,o?"captionsenabled":"captionsdisabled")}setTimeout(()=>{o&&this.captions.toggled&&(this.captions.currentTrackNode.mode="hidden")})},set(e,n=!0){const r=We.getTracks.call(this);if(e!==-1)if(N.number(e))if(e in r){if(this.captions.currentTrack!==e){this.captions.currentTrack=e;const i=r[e],{language:o}=i||{};this.captions.currentTrackNode=i,pe.updateSetting.call(this,"captions"),n||(this.captions.language=o,this.storage.set({language:o})),this.isVimeo&&this.embed.enableTextTrack(o),Oe.call(this,this.media,"languagechange")}We.toggle.call(this,!0,n),this.isHTML5&&this.isVideo&&We.updateCues.call(this)}else this.debug.warn("Track not found",e);else this.debug.warn("Invalid caption argument",e);else We.toggle.call(this,!1,n)},setLanguage(e,n=!0){if(!N.string(e))return void this.debug.warn("Invalid language argument",e);const r=e.toLowerCase();this.captions.language=r;const i=We.getTracks.call(this),o=We.findTrack.call(this,[r]);We.set.call(this,i.indexOf(o),n)},getTracks(e=!1){return Array.from((this.media||{}).textTracks||[]).filter(n=>!this.isHTML5||e||this.captions.meta.has(n)).filter(n=>["captions","subtitles"].includes(n.kind))},findTrack(e,n=!1){const r=We.getTracks.call(this),i=s=>Number((this.captions.meta.get(s)||{}).default),o=Array.from(r).sort((s,c)=>i(c)-i(s));let l;return e.every(s=>(l=o.find(c=>c.language===s),!l)),l||(n?o[0]:void 0)},getCurrentTrack(){return We.getTracks.call(this)[this.currentTrack]},getLabel(e){let n=e;return!N.track(n)&&f0.textTracks&&this.captions.toggled&&(n=We.getCurrentTrack.call(this)),N.track(n)?N.empty(n.label)?N.empty(n.language)?x0.get("enabled",this.config):e.language.toUpperCase():n.label:x0.get("disabled",this.config)},updateCues(e){if(!this.supported.ui)return;if(!N.element(this.elements.captions))return void this.debug.warn("No captions element to render to");if(!N.nullOrUndefined(e)&&!Array.isArray(e))return void this.debug.warn("updateCues: Invalid input",e);let n=e;if(!n){const i=We.getCurrentTrack.call(this);n=Array.from((i||{}).activeCues||[]).map(o=>o.getCueAsHTML()).map(i$)}const r=n.map(i=>i.trim()).join(`
|
|
29
|
+
`}},emits:["input","tag","search-change","closed"],data:()=>({defaultOptionLabel:"label",multiple:!0}),created(){this.isApiMode||this.initializeOptions()},methods:{getTagOptionLabel({optionLabel:e,option:n}){const r=this.getOptionLabel({optionLabel:e,option:n});return typeof r=="object"?n.label:r},initializeOptions(){if(!this.value)return[];const e=this.value.filter(n=>!this.options.find(r=>h1(r,n)));this.options.unshift(...e)}}},DO={class:"multiselect__loading-wrapper"};function OO(e,n,r,i,o,l){const s=a.resolveComponent("wt-label"),c=a.resolveComponent("wt-icon-btn"),d=a.resolveComponent("wt-chip"),u=a.resolveComponent("wt-loader"),h=a.resolveComponent("vue-multiselect"),p=a.resolveComponent("wt-input-info"),m=a.resolveDirective("observe-visibility");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([{"wt-tags-input--disabled":e.disabled,"wt-tags-input--invalid":e.invalid,"wt-tags-input--loading":e.isLoading},"wt-tags-input"])},[e.hasLabel?(a.openBlock(),a.createBlock(s,a.mergeProps({key:0},e.labelProps,{disabled:e.disabled,invalid:e.invalid,class:"wt-tags-input__label"}),{default:a.withCtx(()=>[a.renderSlot(e.$slots,"label",a.normalizeProps(a.guardReactiveProps({label:e.label})),()=>[a.createTextVNode(a.toDisplayString(e.requiredLabel),1)],!0)],void 0,!0),_:3},16,["disabled","invalid"])):a.createCommentVNode("",!0),a.createVNode(h,a.mergeProps(e.$attrs,{ref:"vue-multiselect","close-on-select":!1,disabled:e.disabled,"internal-search":!e.searchMethod,label:e.selectOptionLabel,loading:!1,"model-value":e.selectValue,multiple:e.multiple,options:e.selectOptions,placeholder:e.placeholder||e.label,taggable:r.taggable,"track-by":r.trackBy,class:"wt-tags-input__select"},a.toHandlers(e.listeners)),a.createSlots({tag:a.withCtx(({option:w,remove:x})=>[a.createVNode(d,{class:"multiselect__custom-tag"},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(l.getTagOptionLabel({option:w,optionLabel:e.optionLabel}))+" ",1),a.createVNode(c,{color:"on-primary",icon:"close--filled",size:"sm",onClick:b=>x(w)},null,8,["onClick"])],void 0,!0),_:2},1024)]),option:a.withCtx(({option:w})=>[a.renderSlot(e.$slots,"option",a.normalizeProps(a.guardReactiveProps({option:w,optionLabel:e.optionLabel})),()=>[a.createTextVNode(a.toDisplayString(l.getTagOptionLabel({option:w,optionLabel:e.optionLabel})),1)],!0)]),caret:a.withCtx(({toggle:w})=>[a.createVNode(c,{disabled:e.disabled,class:"multiselect__select",color:"active",icon:"arrow-down",onMousedown:a.withModifiers(w,["prevent","stop"])},null,8,["disabled","onMousedown"])]),beforeList:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",DO,[a.createVNode(u,{size:"sm"})],512),[[a.vShow,e.isLoading]])]),_:2},[e.showIntersectionObserver?{name:"afterList",fn:a.withCtx(()=>[a.withDirectives(a.createElementVNode("div",null,null,512),[[m,e.handleAfterListIntersect]])]),key:"0"}:void 0]),1040,["disabled","internal-search","label","model-value","multiple","options","placeholder","taggable","track-by"]),e.isValidation?(a.openBlock(),a.createBlock(p,{key:1,invalid:e.invalid},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(e.validationText),1)],void 0,!0),_:1},8,["invalid"])):a.createCommentVNode("",!0)],2)}const VO=ye(NO,[["render",OO],["__scopeId","data-v-1714b524"]]),PO={name:"WtTextarea",mixins:[Ar],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"},name:{type:String,default:""},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:e=>this.$emit("input",e.target.value),keypress:e=>this.handleKeypress(e)}},requiredLabel(){return this.required?`${this.label}*`:this.label}},mounted(){this.updateInputPaddings()},updated(){this.autoresize&&!this.value&&this.resetGrow()},methods:{handleKeypress(e){this.autoresize&&e.key==="Enter"&&!e.shiftKey&&(this.$emit("enter"),e.preventDefault())},autoGrow(){if(!this.autoresize)return;const e=this.$refs["wt-textarea"],n=2;e.style.height="auto",e.style.height=e.scrollHeight+n+"px"},resetGrow(){const e=this.$refs["wt-textarea"];e.style.height="auto"},updateInputPaddings(){const e=this.$refs["after-wrapper"].offsetWidth,n=this.$refs["wt-textarea"],r=getComputedStyle(document.documentElement).getPropertyValue("--textarea-padding");n.style.paddingRight=`calc(${r} * 2 + ${e}px)`}}},$O={class:"wt-textarea__wrapper"},FO=["id","disabled","placeholder","value","readonly"],IO={ref:"after-wrapper",class:"wt-textarea__after-wrapper"};function RO(e,n,r,i,o,l){const s=a.resolveComponent("wt-label"),c=a.resolveComponent("wt-icon-btn"),d=a.resolveComponent("wt-input-info");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([{"wt-textarea--disabled":r.disabled,"wt-textarea--invalid":e.invalid,"wt-textarea--autoresize":r.autoresize},"wt-textarea"])},[a.createVNode(s,a.mergeProps(r.labelProps,{disabled:r.disabled,for:r.name,invalid:e.invalid}),{default:a.withCtx(()=>[a.renderSlot(e.$slots,"label",a.normalizeProps(a.guardReactiveProps({label:r.label})),()=>[a.createTextVNode(a.toDisplayString(l.requiredLabel),1)],!0)],void 0,!0),_:3},16,["disabled","for","invalid"]),a.createElementVNode("div",$O,[a.createElementVNode("textarea",a.mergeProps({id:r.name,ref:"wt-textarea",disabled:r.disabled,placeholder:r.placeholder||r.label,value:r.value,rows:"1",readonly:r.readonly,class:"wt-textarea__textarea"},a.toHandlers(l.listeners,!0),{onInput:n[0]||(n[0]=(...u)=>l.autoGrow&&l.autoGrow(...u))}),null,16,FO),a.createElementVNode("div",IO,[a.renderSlot(e.$slots,"after-input",{},void 0,!0),a.createVNode(c,{class:a.normalizeClass([{hidden:!r.value},"wt-textarea__reset-icon-btn"]),disabled:r.disabled,icon:"close--filled",size:"sm",onClick:n[1]||(n[1]=u=>e.$emit("input",""))},null,8,["class","disabled"])],512)]),e.isValidation?(a.openBlock(),a.createBlock(d,{key:0,invalid:e.invalid},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(e.validationText),1)],void 0,!0),_:1},8,["invalid"])):a.createCommentVNode("",!0)],2)}const HO=ye(PO,[["render",RO],["__scopeId","data-v-c9c1cb76"]]),qO={name:"WtTimeInput",mixins:[Ar],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:e=>this.$emit("input",e.target.value)}}}},zO={class:"wt-time-input__wrapper"},UO=["disabled","max","value"];function jO(e,n,r,i,o,l){const s=a.resolveComponent("wt-label"),c=a.resolveComponent("wt-input-info");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([{"wt-time-input--disabled":r.disabled,"wt-time-input--invalid":e.invalid},"wt-time-input"])},[l.hasLabel?(a.openBlock(),a.createBlock(s,a.mergeProps({key:0},r.labelProps,{disabled:r.disabled,invalid:e.invalid}),{default:a.withCtx(()=>[a.renderSlot(e.$slots,"label",a.normalizeProps(a.guardReactiveProps({label:r.label})),()=>[a.createTextVNode(a.toDisplayString(r.label),1)],!0)],void 0,!0),_:3},16,["disabled","invalid"])):a.createCommentVNode("",!0),a.createElementVNode("div",zO,[a.createElementVNode("input",a.mergeProps({disabled:r.disabled,max:r.maxValue,min:0,value:r.value,class:"wt-time-input__input",type:"number"},a.toHandlers(l.listeners,!0)),null,16,UO)]),l.showInfo?(a.openBlock(),a.createBlock(c,{key:1,invalid:e.invalid},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(e.validationText),1)],void 0,!0),_:1},8,["invalid"])):a.createCommentVNode("",!0)],2)}const WO=ye(qO,[["render",jO],["__scopeId","data-v-ae7cf0e8"]]),f1=60*60,ls=60,ZO={name:"WtTimepicker",mixins:[Ar],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/f1)},set(e){const n=this.dateMode?new Date(this.value).setHours(e):this.value-this.hour*f1+e*f1;this.$emit("input",n)}},min:{get(){return this.dateMode?new Date(+this.value).getMinutes():Math.floor(this.value/ls%60)},set(e){const n=this.dateMode?new Date(this.value).setMinutes(e):this.value-this.min*ls+e*ls;this.$emit("input",n)}},sec:{get(){return this.dateMode?new Date(+this.value).getSeconds():Math.floor(this.value%60)},set(e){const n=this.dateMode?new Date(this.value).setSeconds(e):this.value-this.sec+ +e;this.$emit("input",n)}},requiredLabel(){return this.required?`${this.label} (${this.format})*`:`${this.label} (${this.format})`}},methods:{onHoursBlurEvent(){const e=this.dateMode?new Date(this.value).setHours(this.hour):this.value-this.hour*f1+this.hour*f1;this.$emit("input",0),this.$nextTick(()=>{this.$emit("input",e)})}}},YO={class:"wt-timepicker__wrapper"};function GO(e,n,r,i,o,l){const s=a.resolveComponent("wt-label"),c=a.resolveComponent("wt-time-input"),d=a.resolveComponent("wt-input-info");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([{"wt-timepicker--invalid":e.invalid},"wt-timepicker"])},[r.label||!r.noLabel?(a.openBlock(),a.createBlock(s,a.mergeProps({key:0},r.labelProps,{invalid:e.invalid}),{default:a.withCtx(()=>[a.renderSlot(e.$slots,"label",a.normalizeProps(a.guardReactiveProps({label:r.label})),()=>[a.createTextVNode(a.toDisplayString(l.requiredLabel),1)],!0)],void 0,!0),_:3},16,["invalid"])):a.createCommentVNode("",!0),a.createElementVNode("div",YO,[l.isHour?(a.openBlock(),a.createBlock(c,{key:0,disabled:r.disabled,label:l.labelHours,"max-value":r.dateMode?null:23,v:e.v,value:l.hour,"hide-input-info":"",onBlur:l.onHoursBlurEvent,onInput:n[0]||(n[0]=u=>l.hour=u)},null,8,["disabled","label","max-value","v","value","onBlur"])):a.createCommentVNode("",!0),l.isMin?(a.openBlock(),a.createBlock(c,{key:1,disabled:r.disabled,label:l.labelMin,"max-value":59,v:e.v,value:l.min,"hide-input-info":"",onInput:n[1]||(n[1]=u=>l.min=u)},null,8,["disabled","label","v","value"])):a.createCommentVNode("",!0),l.isSec?(a.openBlock(),a.createBlock(c,{key:2,disabled:r.disabled,label:l.labelSec,"max-value":59,v:e.v,value:l.sec,"hide-input-info":"",onInput:n[2]||(n[2]=u=>l.sec=u)},null,8,["disabled","label","v","value"])):a.createCommentVNode("",!0)]),e.isValidation?(a.openBlock(),a.createBlock(d,{key:1,invalid:e.invalid},{default:a.withCtx(()=>[a.createTextVNode(a.toDisplayString(e.validationText),1)],void 0,!0),_:1},8,["invalid"])):a.createCommentVNode("",!0)],2)}const KO=ye(ZO,[["render",GO],["__scopeId","data-v-e9eb3b40"]]),XO=["top","right","bottom","left"],ou=["start","end"],lu=XO.reduce((e,n)=>e.concat(n,n+"-"+ou[0],n+"-"+ou[1]),[]),Tr=Math.min,ut=Math.max,Nr=Math.round,Dr=Math.floor,m2=e=>({x:e,y:e}),QO={left:"right",right:"left",bottom:"top",top:"bottom"},JO={start:"end",end:"start"};function su(e,n,r){return ut(e,Tr(n,r))}function p1(e,n){return typeof e=="function"?e(n):e}function T2(e){return e.split("-")[0]}function N2(e){return e.split("-")[1]}function cu(e){return e==="x"?"y":"x"}function du(e){return e==="y"?"height":"width"}function Ot(e){return["top","bottom"].includes(T2(e))?"y":"x"}function uu(e){return cu(Ot(e))}function hu(e,n,r){r===void 0&&(r=!1);const i=N2(e),o=uu(e),l=du(o);let s=o==="x"?i===(r?"end":"start")?"right":"left":i==="start"?"bottom":"top";return n.reference[l]>n.floating[l]&&(s=Vr(s)),[s,Vr(s)]}function eV(e){const n=Vr(e);return[Or(e),n,Or(n)]}function Or(e){return e.replace(/start|end/g,n=>JO[n])}function tV(e,n,r){const i=["left","right"],o=["right","left"],l=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return r?n?o:i:n?i:o;case"left":case"right":return n?l:s;default:return[]}}function rV(e,n,r,i){const o=N2(e);let l=tV(T2(e),r==="start",i);return o&&(l=l.map(s=>s+"-"+o),n&&(l=l.concat(l.map(Or)))),l}function Vr(e){return e.replace(/left|right|bottom|top/g,n=>QO[n])}function nV(e){return{top:0,right:0,bottom:0,left:0,...e}}function aV(e){return typeof e!="number"?nV(e):{top:e,right:e,bottom:e,left:e}}function Pr(e){const{x:n,y:r,width:i,height:o}=e;return{width:i,height:o,top:r,left:n,right:n+i,bottom:r+o,x:n,y:r}}function fu(e,n,r){let{reference:i,floating:o}=e;const l=Ot(n),s=uu(n),c=du(s),d=T2(n),u=l==="y",h=i.x+i.width/2-o.width/2,p=i.y+i.height/2-o.height/2,m=i[c]/2-o[c]/2;let w;switch(d){case"top":w={x:h,y:i.y-o.height};break;case"bottom":w={x:h,y:i.y+i.height};break;case"right":w={x:i.x+i.width,y:p};break;case"left":w={x:i.x-o.width,y:p};break;default:w={x:i.x,y:i.y}}switch(N2(n)){case"start":w[s]-=m*(r&&u?-1:1);break;case"end":w[s]+=m*(r&&u?-1:1);break}return w}const iV=async(e,n,r)=>{const{placement:i="bottom",strategy:o="absolute",middleware:l=[],platform:s}=r,c=l.filter(Boolean),d=await(s.isRTL==null?void 0:s.isRTL(n));let u=await s.getElementRects({reference:e,floating:n,strategy:o}),{x:h,y:p}=fu(u,i,d),m=i,w={},x=0;for(let b=0;b<c.length;b++){const{name:v,fn:C}=c[b],{x:y,y:_,data:L,reset:T}=await C({x:h,y:p,initialPlacement:i,placement:m,strategy:o,middlewareData:w,rects:u,platform:s,elements:{reference:e,floating:n}});h=y??h,p=_??p,w={...w,[v]:{...w[v],...L}},T&&x<=50&&(x++,typeof T=="object"&&(T.placement&&(m=T.placement),T.rects&&(u=T.rects===!0?await s.getElementRects({reference:e,floating:n,strategy:o}):T.rects),{x:h,y:p}=fu(u,m,d)),b=-1)}return{x:h,y:p,placement:m,strategy:o,middlewareData:w}};async function ss(e,n){var r;n===void 0&&(n={});const{x:i,y:o,platform:l,rects:s,elements:c,strategy:d}=e,{boundary:u="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:m=!1,padding:w=0}=p1(n,e),x=aV(w),v=c[m?p==="floating"?"reference":"floating":p],C=Pr(await l.getClippingRect({element:(r=await(l.isElement==null?void 0:l.isElement(v)))==null||r?v:v.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(c.floating)),boundary:u,rootBoundary:h,strategy:d})),y=p==="floating"?{x:i,y:o,width:s.floating.width,height:s.floating.height}:s.reference,_=await(l.getOffsetParent==null?void 0:l.getOffsetParent(c.floating)),L=await(l.isElement==null?void 0:l.isElement(_))?await(l.getScale==null?void 0:l.getScale(_))||{x:1,y:1}:{x:1,y:1},T=Pr(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:y,offsetParent:_,strategy:d}):y);return{top:(C.top-T.top+x.top)/L.y,bottom:(T.bottom-C.bottom+x.bottom)/L.y,left:(C.left-T.left+x.left)/L.x,right:(T.right-C.right+x.right)/L.x}}function oV(e,n,r){return(e?[...r.filter(o=>N2(o)===e),...r.filter(o=>N2(o)!==e)]:r.filter(o=>T2(o)===o)).filter(o=>e?N2(o)===e||(n?Or(o)!==o:!1):!0)}const lV=function(e){return e===void 0&&(e={}),{name:"autoPlacement",options:e,async fn(n){var r,i,o;const{rects:l,middlewareData:s,placement:c,platform:d,elements:u}=n,{crossAxis:h=!1,alignment:p,allowedPlacements:m=lu,autoAlignment:w=!0,...x}=p1(e,n),b=p!==void 0||m===lu?oV(p||null,w,m):m,v=await ss(n,x),C=((r=s.autoPlacement)==null?void 0:r.index)||0,y=b[C];if(y==null)return{};const _=hu(y,l,await(d.isRTL==null?void 0:d.isRTL(u.floating)));if(c!==y)return{reset:{placement:b[0]}};const L=[v[T2(y)],v[_[0]],v[_[1]]],T=[...((i=s.autoPlacement)==null?void 0:i.overflows)||[],{placement:y,overflows:L}],q=b[C+1];if(q)return{data:{index:C+1,overflows:T},reset:{placement:q}};const $=T.map(Z=>{const P=N2(Z.placement);return[Z.placement,P&&h?Z.overflows.slice(0,2).reduce((Y,K)=>Y+K,0):Z.overflows[0],Z.overflows]}).sort((Z,P)=>Z[1]-P[1]),R=((o=$.filter(Z=>Z[2].slice(0,N2(Z[0])?2:3).every(P=>P<=0))[0])==null?void 0:o[0])||$[0][0];return R!==c?{data:{index:C+1,overflows:T},reset:{placement:R}}:{}}}},sV=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(n){var r,i;const{placement:o,middlewareData:l,rects:s,initialPlacement:c,platform:d,elements:u}=n,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:b=!0,...v}=p1(e,n);if((r=l.arrow)!=null&&r.alignmentOffset)return{};const C=T2(o),y=Ot(c),_=T2(c)===c,L=await(d.isRTL==null?void 0:d.isRTL(u.floating)),T=m||(_||!b?[Vr(c)]:eV(c)),q=x!=="none";!m&&q&&T.push(...rV(c,b,x,L));const $=[c,...T],F=await ss(n,v),R=[];let Z=((i=l.flip)==null?void 0:i.overflows)||[];if(h&&R.push(F[C]),p){const oe=hu(o,s,L);R.push(F[oe[0]],F[oe[1]])}if(Z=[...Z,{placement:o,overflows:R}],!R.every(oe=>oe<=0)){var P,Y;const oe=(((P=l.flip)==null?void 0:P.index)||0)+1,fe=$[oe];if(fe)return{data:{index:oe,overflows:Z},reset:{placement:fe}};let ee=(Y=Z.filter(A=>A.overflows[0]<=0).sort((A,U)=>A.overflows[1]-U.overflows[1])[0])==null?void 0:Y.placement;if(!ee)switch(w){case"bestFit":{var K;const A=(K=Z.filter(U=>{if(q){const O=Ot(U.placement);return O===y||O==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(O=>O>0).reduce((O,j)=>O+j,0)]).sort((U,O)=>U[1]-O[1])[0])==null?void 0:K[0];A&&(ee=A);break}case"initialPlacement":ee=c;break}if(o!==ee)return{reset:{placement:ee}}}return{}}}};async function cV(e,n){const{placement:r,platform:i,elements:o}=e,l=await(i.isRTL==null?void 0:i.isRTL(o.floating)),s=T2(r),c=N2(r),d=Ot(r)==="y",u=["left","top"].includes(s)?-1:1,h=l&&d?-1:1,p=p1(n,e);let{mainAxis:m,crossAxis:w,alignmentAxis:x}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof x=="number"&&(w=c==="end"?x*-1:x),d?{x:w*h,y:m*u}:{x:m*u,y:w*h}}const dV=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(n){var r,i;const{x:o,y:l,placement:s,middlewareData:c}=n,d=await cV(n,e);return s===((r=c.offset)==null?void 0:r.placement)&&(i=c.arrow)!=null&&i.alignmentOffset?{}:{x:o+d.x,y:l+d.y,data:{...d,placement:s}}}}},uV=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(n){const{x:r,y:i,placement:o}=n,{mainAxis:l=!0,crossAxis:s=!1,limiter:c={fn:v=>{let{x:C,y}=v;return{x:C,y}}},...d}=p1(e,n),u={x:r,y:i},h=await ss(n,d),p=Ot(T2(o)),m=cu(p);let w=u[m],x=u[p];if(l){const v=m==="y"?"top":"left",C=m==="y"?"bottom":"right",y=w+h[v],_=w-h[C];w=su(y,w,_)}if(s){const v=p==="y"?"top":"left",C=p==="y"?"bottom":"right",y=x+h[v],_=x-h[C];x=su(y,x,_)}const b=c.fn({...n,[m]:w,[p]:x});return{...b,data:{x:b.x-r,y:b.y-i,enabled:{[m]:l,[p]:s}}}}}};function $r(){return typeof window<"u"}function ht(e){return cs(e)?(e.nodeName||"").toLowerCase():"#document"}function U0(e){var n;return(e==null||(n=e.ownerDocument)==null?void 0:n.defaultView)||window}function g2(e){var n;return(n=(cs(e)?e.ownerDocument:e.document)||window.document)==null?void 0:n.documentElement}function cs(e){return $r()?e instanceof Node||e instanceof U0(e).Node:!1}function e2(e){return $r()?e instanceof Element||e instanceof U0(e).Element:!1}function y2(e){return $r()?e instanceof HTMLElement||e instanceof U0(e).HTMLElement:!1}function pu(e){return!$r()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof U0(e).ShadowRoot}function m1(e){const{overflow:n,overflowX:r,overflowY:i,display:o}=t2(e);return/auto|scroll|overlay|hidden|clip/.test(n+i+r)&&!["inline","contents"].includes(o)}function hV(e){return["table","td","th"].includes(ht(e))}function Fr(e){return[":popover-open",":modal"].some(n=>{try{return e.matches(n)}catch{return!1}})}function ds(e){const n=us(),r=e2(e)?t2(e):e;return["transform","translate","scale","rotate","perspective"].some(i=>r[i]?r[i]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!n&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!n&&(r.filter?r.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(i=>(r.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(r.contain||"").includes(i))}function fV(e){let n=U2(e);for(;y2(n)&&!Vt(n);){if(ds(n))return n;if(Fr(n))return null;n=U2(n)}return null}function us(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Vt(e){return["html","body","#document"].includes(ht(e))}function t2(e){return U0(e).getComputedStyle(e)}function Ir(e){return e2(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function U2(e){if(ht(e)==="html")return e;const n=e.assignedSlot||e.parentNode||pu(e)&&e.host||g2(e);return pu(n)?n.host:n}function mu(e){const n=U2(e);return Vt(n)?e.ownerDocument?e.ownerDocument.body:e.body:y2(n)&&m1(n)?n:mu(n)}function g1(e,n,r){var i;n===void 0&&(n=[]),r===void 0&&(r=!0);const o=mu(e),l=o===((i=e.ownerDocument)==null?void 0:i.body),s=U0(o);if(l){const c=hs(s);return n.concat(s,s.visualViewport||[],m1(o)?o:[],c&&r?g1(c):[])}return n.concat(o,g1(o,[],r))}function hs(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gu(e){const n=t2(e);let r=parseFloat(n.width)||0,i=parseFloat(n.height)||0;const o=y2(e),l=o?e.offsetWidth:r,s=o?e.offsetHeight:i,c=Nr(r)!==l||Nr(i)!==s;return c&&(r=l,i=s),{width:r,height:i,$:c}}function fs(e){return e2(e)?e:e.contextElement}function Pt(e){const n=fs(e);if(!y2(n))return m2(1);const r=n.getBoundingClientRect(),{width:i,height:o,$:l}=gu(n);let s=(l?Nr(r.width):r.width)/i,c=(l?Nr(r.height):r.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const pV=m2(0);function yu(e){const n=U0(e);return!us()||!n.visualViewport?pV:{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}}function mV(e,n,r){return n===void 0&&(n=!1),!r||n&&r!==U0(e)?!1:n}function ft(e,n,r,i){n===void 0&&(n=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),l=fs(e);let s=m2(1);n&&(i?e2(i)&&(s=Pt(i)):s=Pt(e));const c=mV(l,r,i)?yu(l):m2(0);let d=(o.left+c.x)/s.x,u=(o.top+c.y)/s.y,h=o.width/s.x,p=o.height/s.y;if(l){const m=U0(l),w=i&&e2(i)?U0(i):i;let x=m,b=hs(x);for(;b&&i&&w!==x;){const v=Pt(b),C=b.getBoundingClientRect(),y=t2(b),_=C.left+(b.clientLeft+parseFloat(y.paddingLeft))*v.x,L=C.top+(b.clientTop+parseFloat(y.paddingTop))*v.y;d*=v.x,u*=v.y,h*=v.x,p*=v.y,d+=_,u+=L,x=U0(b),b=hs(x)}}return Pr({width:h,height:p,x:d,y:u})}function ps(e,n){const r=Ir(e).scrollLeft;return n?n.left+r:ft(g2(e)).left+r}function wu(e,n,r){r===void 0&&(r=!1);const i=e.getBoundingClientRect(),o=i.left+n.scrollLeft-(r?0:ps(e,i)),l=i.top+n.scrollTop;return{x:o,y:l}}function gV(e){let{elements:n,rect:r,offsetParent:i,strategy:o}=e;const l=o==="fixed",s=g2(i),c=n?Fr(n.floating):!1;if(i===s||c&&l)return r;let d={scrollLeft:0,scrollTop:0},u=m2(1);const h=m2(0),p=y2(i);if((p||!p&&!l)&&((ht(i)!=="body"||m1(s))&&(d=Ir(i)),y2(i))){const w=ft(i);u=Pt(i),h.x=w.x+i.clientLeft,h.y=w.y+i.clientTop}const m=s&&!p&&!l?wu(s,d,!0):m2(0);return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-d.scrollLeft*u.x+h.x+m.x,y:r.y*u.y-d.scrollTop*u.y+h.y+m.y}}function yV(e){return Array.from(e.getClientRects())}function wV(e){const n=g2(e),r=Ir(e),i=e.ownerDocument.body,o=ut(n.scrollWidth,n.clientWidth,i.scrollWidth,i.clientWidth),l=ut(n.scrollHeight,n.clientHeight,i.scrollHeight,i.clientHeight);let s=-r.scrollLeft+ps(e);const c=-r.scrollTop;return t2(i).direction==="rtl"&&(s+=ut(n.clientWidth,i.clientWidth)-o),{width:o,height:l,x:s,y:c}}function CV(e,n){const r=U0(e),i=g2(e),o=r.visualViewport;let l=i.clientWidth,s=i.clientHeight,c=0,d=0;if(o){l=o.width,s=o.height;const u=us();(!u||u&&n==="fixed")&&(c=o.offsetLeft,d=o.offsetTop)}return{width:l,height:s,x:c,y:d}}function bV(e,n){const r=ft(e,!0,n==="fixed"),i=r.top+e.clientTop,o=r.left+e.clientLeft,l=y2(e)?Pt(e):m2(1),s=e.clientWidth*l.x,c=e.clientHeight*l.y,d=o*l.x,u=i*l.y;return{width:s,height:c,x:d,y:u}}function Cu(e,n,r){let i;if(n==="viewport")i=CV(e,r);else if(n==="document")i=wV(g2(e));else if(e2(n))i=bV(n,r);else{const o=yu(e);i={x:n.x-o.x,y:n.y-o.y,width:n.width,height:n.height}}return Pr(i)}function bu(e,n){const r=U2(e);return r===n||!e2(r)||Vt(r)?!1:t2(r).position==="fixed"||bu(r,n)}function xV(e,n){const r=n.get(e);if(r)return r;let i=g1(e,[],!1).filter(c=>e2(c)&&ht(c)!=="body"),o=null;const l=t2(e).position==="fixed";let s=l?U2(e):e;for(;e2(s)&&!Vt(s);){const c=t2(s),d=ds(s);!d&&c.position==="fixed"&&(o=null),(l?!d&&!o:!d&&c.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||m1(s)&&!d&&bu(e,s))?i=i.filter(h=>h!==s):o=c,s=U2(s)}return n.set(e,i),i}function vV(e){let{element:n,boundary:r,rootBoundary:i,strategy:o}=e;const s=[...r==="clippingAncestors"?Fr(n)?[]:xV(n,this._c):[].concat(r),i],c=s[0],d=s.reduce((u,h)=>{const p=Cu(n,h,o);return u.top=ut(p.top,u.top),u.right=Tr(p.right,u.right),u.bottom=Tr(p.bottom,u.bottom),u.left=ut(p.left,u.left),u},Cu(n,c,o));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function _V(e){const{width:n,height:r}=gu(e);return{width:n,height:r}}function kV(e,n,r){const i=y2(n),o=g2(n),l=r==="fixed",s=ft(e,!0,l,n);let c={scrollLeft:0,scrollTop:0};const d=m2(0);if(i||!i&&!l)if((ht(n)!=="body"||m1(o))&&(c=Ir(n)),i){const m=ft(n,!0,l,n);d.x=m.x+n.clientLeft,d.y=m.y+n.clientTop}else o&&(d.x=ps(o));const u=o&&!i&&!l?wu(o,c):m2(0),h=s.left+c.scrollLeft-d.x-u.x,p=s.top+c.scrollTop-d.y-u.y;return{x:h,y:p,width:s.width,height:s.height}}function ms(e){return t2(e).position==="static"}function xu(e,n){if(!y2(e)||t2(e).position==="fixed")return null;if(n)return n(e);let r=e.offsetParent;return g2(e)===r&&(r=r.ownerDocument.body),r}function vu(e,n){const r=U0(e);if(Fr(e))return r;if(!y2(e)){let o=U2(e);for(;o&&!Vt(o);){if(e2(o)&&!ms(o))return o;o=U2(o)}return r}let i=xu(e,n);for(;i&&hV(i)&&ms(i);)i=xu(i,n);return i&&Vt(i)&&ms(i)&&!ds(i)?r:i||fV(e)||r}const EV=async function(e){const n=this.getOffsetParent||vu,r=this.getDimensions,i=await r(e.floating);return{reference:kV(e.reference,await n(e.floating),e.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function LV(e){return t2(e).direction==="rtl"}const AV={convertOffsetParentRelativeRectToViewportRelativeRect:gV,getDocumentElement:g2,getClippingRect:vV,getOffsetParent:vu,getElementRects:EV,getClientRects:yV,getDimensions:_V,getScale:Pt,isElement:e2,isRTL:LV};function _u(e,n){return e.x===n.x&&e.y===n.y&&e.width===n.width&&e.height===n.height}function SV(e,n){let r=null,i;const o=g2(e);function l(){var c;clearTimeout(i),(c=r)==null||c.disconnect(),r=null}function s(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),l();const u=e.getBoundingClientRect(),{left:h,top:p,width:m,height:w}=u;if(c||n(),!m||!w)return;const x=Dr(p),b=Dr(o.clientWidth-(h+m)),v=Dr(o.clientHeight-(p+w)),C=Dr(h),_={rootMargin:-x+"px "+-b+"px "+-v+"px "+-C+"px",threshold:ut(0,Tr(1,d))||1};let L=!0;function T(q){const $=q[0].intersectionRatio;if($!==d){if(!L)return s();$?s(!1,$):i=setTimeout(()=>{s(!1,1e-7)},1e3)}$===1&&!_u(u,e.getBoundingClientRect())&&s(),L=!1}try{r=new IntersectionObserver(T,{..._,root:o.ownerDocument})}catch{r=new IntersectionObserver(T,_)}r.observe(e)}return s(!0),l}function MV(e,n,r,i){i===void 0&&(i={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=i,u=fs(e),h=o||l?[...u?g1(u):[],...g1(n)]:[];h.forEach(C=>{o&&C.addEventListener("scroll",r,{passive:!0}),l&&C.addEventListener("resize",r)});const p=u&&c?SV(u,r):null;let m=-1,w=null;s&&(w=new ResizeObserver(C=>{let[y]=C;y&&y.target===u&&w&&(w.unobserve(n),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var _;(_=w)==null||_.observe(n)})),r()}),u&&!d&&w.observe(u),w.observe(n));let x,b=d?ft(e):null;d&&v();function v(){const C=ft(e);b&&!_u(b,C)&&r(),b=C,x=requestAnimationFrame(v)}return r(),()=>{var C;h.forEach(y=>{o&&y.removeEventListener("scroll",r),l&&y.removeEventListener("resize",r)}),p==null||p(),(C=w)==null||C.disconnect(),w=null,d&&cancelAnimationFrame(x)}}const BV=dV,TV=lV,NV=uV,DV=sV,OV=(e,n,r)=>{const i=new Map,o={platform:AV,...r},l={...o.platform,_c:i};return iV(e,n,{...o,platform:l})};function VV(e){return e!=null&&typeof e=="object"&&"$el"in e}function ku(e){if(VV(e)){const n=e.$el;return cs(n)&&ht(n)==="#comment"?null:n}return e}function y1(e){return typeof e=="function"?e():a.unref(e)}function Eu(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Lu(e,n){const r=Eu(e);return Math.round(n*r)/r}function PV(e,n,r){r===void 0&&(r={});const i=r.whileElementsMounted,o=a.computed(()=>{var $;return($=y1(r.open))!=null?$:!0}),l=a.computed(()=>y1(r.middleware)),s=a.computed(()=>{var $;return($=y1(r.placement))!=null?$:"bottom"}),c=a.computed(()=>{var $;return($=y1(r.strategy))!=null?$:"absolute"}),d=a.computed(()=>{var $;return($=y1(r.transform))!=null?$:!0}),u=a.computed(()=>ku(e.value)),h=a.computed(()=>ku(n.value)),p=a.ref(0),m=a.ref(0),w=a.ref(c.value),x=a.ref(s.value),b=a.shallowRef({}),v=a.ref(!1),C=a.computed(()=>{const $={position:w.value,left:"0",top:"0"};if(!h.value)return $;const F=Lu(h.value,p.value),R=Lu(h.value,m.value);return d.value?{...$,transform:"translate("+F+"px, "+R+"px)",...Eu(h.value)>=1.5&&{willChange:"transform"}}:{position:w.value,left:F+"px",top:R+"px"}});let y;function _(){if(u.value==null||h.value==null)return;const $=o.value;OV(u.value,h.value,{middleware:l.value,placement:s.value,strategy:c.value}).then(F=>{p.value=F.x,m.value=F.y,w.value=F.strategy,x.value=F.placement,b.value=F.middlewareData,v.value=$!==!1})}function L(){typeof y=="function"&&(y(),y=void 0)}function T(){if(L(),i===void 0){_();return}if(u.value!=null&&h.value!=null){y=i(u.value,h.value,_);return}}function q(){o.value||(v.value=!1)}return a.watch([l,s,c,o],_,{flush:"sync"}),a.watch([u,h],T,{flush:"sync"}),a.watch(o,q,{flush:"sync"}),a.getCurrentScope()&&a.onScopeDispose(L),{x:a.shallowReadonly(p),y:a.shallowReadonly(m),strategy:a.shallowReadonly(w),placement:a.shallowReadonly(x),middlewareData:a.shallowReadonly(b),isPositioned:a.shallowReadonly(v),floatingStyles:C,update:_}}const Au={hover:"mouseenter",focus:"focus",click:"click",touch:"touchstart",pointer:"pointerdown"},Su={hover:"mouseleave",focus:"blur",click:"click",touch:"touchend",pointer:"pointerup"},Mu=({target:e,triggers:n,show:r,hide:i})=>{const o=()=>{((c,d)=>{d.forEach(u=>{const h=Au[u];h?c.addEventListener(h,r):console.log(`No Tooltip Show event for ${u} trigger`);const p=Su[u];p?c.addEventListener(p,i):console.log(`No Tooltip Hide event for ${u} trigger`)})})(e.value,n)},l=()=>{((c,d)=>{d.forEach(u=>{const h=Au[u];h?c.removeEventListener(h,r):console.log(`No Tooltip Show event for ${u} trigger`);const p=Su[u];p?c.removeEventListener(p,i):console.log(`No Tooltip Hide event for ${u} trigger`)})})(e.value,n)};a.onMounted(()=>o()),a.onBeforeUnmount(()=>l())},$V={__name:"wt-tooltip-floating",props:{triggers:{type:Array,default:()=>[]}},emits:["show","hide"],setup(e,{emit:n}){const r=e,i=n,o=a.ref(null);return Mu({target:o,triggers:r.triggers,show:()=>i("show"),hide:()=>i("hide")}),(l,s)=>(a.openBlock(),a.createElementBlock("aside",{ref_key:"floating",ref:o,class:"wt-tooltip-floating"},[a.renderSlot(l.$slots,"default")],512))}},FV=ye({__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(e,{emit:n}){const r=e,i=n,o=a.useTemplateRef("activator"),l=a.useTemplateRef("floating"),s=a.useTemplateRef("floatingChild"),c=a.ref(r.visible),d=()=>{i("update:visible",c.value)},u=(b={})=>{r.disabled||c.value||(c.value=!0,b.usedByTooltip=!0,d(),m())},h=(b={})=>{var C;const v=(C=s.value)==null?void 0:C.contains(b.target);!c.value||b.usedByTooltip||v||(c.value=!1,d(),w())},p=(b={})=>{r.disableClickAway||h(b)},m=()=>{window.addEventListener("scroll",h,!0)},w=()=>{window.removeEventListener("scroll",h,!0)},{floatingStyles:x}=PV(o,l,{placement:r.placement==="auto"?null:r.placement,strategy:"fixed",whileElementsMounted:MV,middleware:[NV(),BV(4),r.placement==="auto"?TV():DV()]});return Mu({target:o,triggers:r.triggers,show:u,hide:h}),a.watch(()=>r.visible,b=>{b?u():h()}),a.onMounted(()=>{r.visible&&u()}),a.onBeforeUnmount(()=>{w()}),(b,v)=>{const C=a.resolveDirective("clickaway");return a.openBlock(),a.createElementBlock("div",{class:a.normalizeClass([{"wt-tooltip--visible":c.value},"wt-tooltip"])},[a.createElementVNode("div",{ref_key:"activator",ref:o,class:"wt-tooltip__activator"},[a.renderSlot(b.$slots,"activator",a.normalizeProps(a.guardReactiveProps({visible:c.value})),void 0,!0)],512),c.value?a.withDirectives((a.openBlock(),a.createBlock($V,{key:0,ref_key:"floating",ref:l,class:a.normalizeClass([[e.popperClass],"wt-tooltip__floating"]),style:a.normalizeStyle(a.unref(x)),triggers:e.popperTriggers,onHide:h,onShow:u},{default:a.withCtx(()=>[a.createElementVNode("div",{ref_key:"floatingChild",ref:s},[a.renderSlot(b.$slots,"default",a.normalizeProps(a.guardReactiveProps({hide:h})),void 0,!0)],512)],void 0,!0),_:3},8,["class","style","triggers"])),[[C,p]]):a.createCommentVNode("",!0)],2)}}},[["__scopeId","data-v-b8fd5806"]]),IV={class:"wt-tree-line"},RV={class:"wt-tree-line__icon-wrapper"},HV={class:"wt-tree-line__label"},qV=a.defineComponent({__name:"wt-tree-line",props:{modelValue:{},data:{},itemLabel:{},itemData:{},childrenProp:{default:"children"},nestedLevel:{default:0},lastChild:{type:Boolean,default:!1},nestedIcons:{},nextElement:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},searchedProp:{default:"searched"}},emits:["openParent","update:modelValue"],setup(e,{emit:n}){const r=e,i=n,o=a.computed(()=>r.itemLabel?r.data[r.itemLabel]:r.data),l=a.computed(()=>{const w=r.nestedIcons?[...r.nestedIcons]:[];return r.nestedLevel===0||w.push({icon:"tree-line",hidden:!r.nextElement}),w}),s=()=>r.itemData?r.modelValue.includes(r.data[r.itemData]):!!r.modelValue.find(x=>h1(x,r.data)),c=a.computed(()=>r.multiple?s():r.itemData?r.data[r.itemData]===r.modelValue:h1(r.modelValue,r.data)),d=()=>{const w=r.itemData?r.data[r.itemData]:r.data;let x;if(r.itemData?x=r.modelValue.indexOf(r.data[r.itemData]):x=r.modelValue.findIndex(v=>h1(v,r.data)),x===-1){const v=[...r.modelValue];v.push(w),i("update:modelValue",v);return}const b=[...r.modelValue];b.splice(x,1),i("update:modelValue",b)},u=()=>{var w;if(r.multiple&&!r.data.service){d();return}if((w=r.data[r.childrenProp])!=null&&w.length){h.value=!h.value;return}i("update:modelValue",r.itemData?r.data[r.itemData]:r.data)},h=a.ref(!0),p=()=>{r.nestedLevel>0&&i("openParent")},m=()=>{h.value=!1,p()};return a.onMounted(()=>{c.value&&p(),r.data[r.searchedProp]&&p()}),a.watch(()=>r.modelValue,()=>{c.value&&p()}),(w,x)=>{const b=a.resolveComponent("wt-icon"),v=a.resolveComponent("wt-icon-btn"),C=a.resolveComponent("wt-tree-line",!0);return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("div",IV,[a.createElementVNode("div",RV,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(w.nestedIcons,(y,_)=>(a.openBlock(),a.createBlock(b,{key:_,icon:y.icon,class:a.normalizeClass({hidden:y.hidden})},null,8,["icon","class"]))),128)),w.nestedLevel>=1?(a.openBlock(),a.createBlock(b,{key:0,icon:w.lastChild?"tree-corner":"tree-cross"},null,8,["icon"])):a.createCommentVNode("",!0),w.data[w.childrenProp]&&w.data[w.childrenProp].length?(a.openBlock(),a.createBlock(v,{key:1,icon:h.value?"plus":"minus",onClick:x[0]||(x[0]=y=>h.value=!h.value)},null,8,["icon"])):a.createCommentVNode("",!0)]),a.createElementVNode("div",{class:a.normalizeClass([{active:c.value},"wt-tree-line__label-wrapper"]),onClick:u},[a.createElementVNode("p",HV,a.toDisplayString(o.value),1),c.value?(a.openBlock(),a.createBlock(b,{key:0,icon:"chat-message-status-sent"})):a.createCommentVNode("",!0)],2)]),a.withDirectives(a.createVNode(Zo,null,{default:a.withCtx(()=>[a.createElementVNode("div",null,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(w.data[w.childrenProp],(y,_)=>(a.openBlock(),a.createBlock(C,{key:_,"model-value":w.modelValue,data:y,"children-prop":w.childrenProp,"item-label":w.itemLabel,"item-data":w.itemData,"nested-level":w.nestedLevel+1,"next-element":!!w.data[w.childrenProp][_+1],"nested-icons":l.value,"last-child":_===w.data[w.childrenProp].length-1,multiple:w.multiple,onOpenParent:m,"onUpdate:modelValue":x[1]||(x[1]=L=>i("update:modelValue",L))},null,8,["model-value","data","children-prop","item-label","item-data","nested-level","next-element","nested-icons","last-child","multiple"]))),128))])],void 0,!0),_:1},512),[[a.vShow,!h.value]])],64)}}}),gs={Tree:"tree",List:"list"},zV={class:"wt-tree"},UV={key:0,class:"wt-tree__content"},jV={key:1,class:"wt-tree__list-content"},WV=["onClick"],ZV=a.defineComponent({__name:"wt-tree",props:{modelValue:{},data:{},itemLabel:{},itemData:{},mode:{default:gs.Tree},childrenProp:{default:"children"},multiple:{type:Boolean}},emits:["select","update:modelValue"],setup(e,{emit:n}){const r=e,i=n,o=a.computed(()=>{const c=[],d=u=>{c.push(u),u[r.childrenProp]&&u[r.childrenProp].forEach(h=>{d(h)})};return r.data.forEach(u=>{d(u)}),c}),l=c=>{i("update:modelValue",r.itemData?c[r.itemData]:c)},s=c=>r.itemData?c[r.itemData]===r.modelValue:h1(r.modelValue,c);return(c,d)=>{const u=a.resolveComponent("wt-icon");return a.openBlock(),a.createElementBlock("div",zV,[c.mode===a.unref(gs).Tree?(a.openBlock(),a.createElementBlock("div",UV,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(c.data,(h,p)=>(a.openBlock(),a.createBlock(qV,{key:p,"model-value":c.modelValue,"item-label":c.itemLabel,"item-data":c.itemData,data:h,"children-prop":c.childrenProp,multiple:c.multiple,"onUpdate:modelValue":d[0]||(d[0]=m=>i("update:modelValue",m))},null,8,["model-value","item-label","item-data","data","children-prop","multiple"]))),128))])):a.createCommentVNode("",!0),c.mode===a.unref(gs).List?(a.openBlock(),a.createElementBlock("div",jV,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(o.value,(h,p)=>(a.openBlock(),a.createElementBlock("span",{key:p,class:a.normalizeClass(["wt-tree__label-wrapper",{active:s(h)}])},[a.createElementVNode("p",{class:"wt-tree__label",onClick:m=>l(h)},a.toDisplayString(c.itemLabel?h[c.itemLabel]:h),9,WV),s(h)?(a.openBlock(),a.createBlock(u,{key:0,icon:"chat-message-status-sent",class:"wt-tree__label-icon"})):a.createCommentVNode("",!0)],2))),128))])):a.createCommentVNode("",!0)])}}}),YV=({headers:e})=>{const{t:n}=et();return{tableHeaders:a.computed(()=>e.filter(i=>i.show===void 0||i.show).map(i=>!i.text&&i.locale?{...i,text:typeof i.locale=="string"?n(i.locale):n(...i.locale)}:i))}},GV={class:"wt-tree-table-td__content"},KV={key:0,class:"wt-tree-table-td__icon-wrapper"},XV={key:0,class:"wt-tree-table-td__actions"},QV={class:"wt-tree-table-td__content"},JV=ye(a.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(e,{emit:n}){const r=e,i=n,o=a.ref(!0),l=a.computed(()=>r.nestingLevel),s=a.computed(()=>r.nestingLevel+1),c=a.computed(()=>r.selectedElements.includes(r.data)),d=()=>{o.value=!1,i("expanded-collapse")},u=(h,p=0)=>{if(h[r.searchedProp]&&p)return!0;if(Array.isArray(h[r.childrenProp])){for(const m of h[r.childrenProp])if(u(m,p+1))return!0}return!1};return a.onMounted(()=>{r.searchedProp&&u(r.data)&&d()}),(h,p)=>{const m=a.resolveComponent("wt-tree-table-row",!0);return a.openBlock(),a.createElementBlock(a.Fragment,null,[a.createElementVNode("tr",{class:a.normalizeClass([[{"wt-tree-table-row--alternate":h.rowPosition%2}],"wt-tree-table-row"])},[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(h.dataHeaders,(w,x)=>(a.openBlock(),a.createElementBlock("td",{key:x,class:"wt-tree-table-td"},[a.createElementVNode("div",GV,[x?a.createCommentVNode("",!0):(a.openBlock(),a.createElementBlock("div",KV,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(l.value,b=>(a.openBlock(),a.createElementBlock("div",{key:b,class:"wt-tree-table-row__tree-space"}))),128)),h.selectable?(a.openBlock(),a.createBlock(ho,{key:0,selected:c.value,onChange:p[0]||(p[0]=b=>h.$emit("update:selected",{data:h.data,select:b}))},null,8,["selected"])):a.createCommentVNode("",!0),h.data[h.childrenProp]?(a.openBlock(),a.createBlock(L7,{key:1,icon:o.value?"tree-expand":"tree-collapse",onClick:p[1]||(p[1]=b=>o.value=!o.value)},null,8,["icon"])):a.createCommentVNode("",!0)])),a.renderSlot(h.$slots,w.value,{index:h.rowPosition,item:h.data},()=>[a.createTextVNode(a.toDisplayString(h.data[w.value]),1)],!0)])]))),128)),h.gridActions?(a.openBlock(),a.createElementBlock("td",XV,[a.createElementVNode("div",QV,[a.renderSlot(h.$slots,"actions",{index:h.rowPosition,item:h.data},void 0,!0)])])):a.createCommentVNode("",!0)],2),o.value?a.createCommentVNode("",!0):(a.openBlock(!0),a.createElementBlock(a.Fragment,{key:0},a.renderList(h.data[h.childrenProp],(w,x)=>(a.openBlock(),a.createBlock(m,{key:x,"children-prop":h.childrenProp,data:w,"data-headers":h.dataHeaders,"nesting-level":s.value,"row-position":h.rowPosition,"searched-prop":h.searchedProp,selectable:h.selectable,"selected-elements":h.selectedElements,onExpandedCollapse:d,"onUpdate:selected":p[2]||(p[2]=b=>h.$emit("update:selected",{data:b.data,select:b.select}))},a.createSlots({actions:a.withCtx(({item:b})=>[a.renderSlot(h.$slots,"actions",{index:h.rowPosition,item:b},void 0,!0)]),_:2},[a.renderList(h.dataHeaders,(b,v)=>({name:b.value,fn:a.withCtx(({item:C})=>[a.renderSlot(h.$slots,b.value,{index:h.rowPosition,item:C},()=>[a.createElementVNode("div",null,a.toDisplayString(C[b.value]),1)],!0)])}))]),1032,["children-prop","data","data-headers","nesting-level","row-position","searched-prop","selectable","selected-elements"]))),128))],64)}}}),[["__scopeId","data-v-10f86df9"]]),eP={class:"wt-tree-table"},tP={class:"wt-tree-table-wrapper"},rP={class:"wt-tree-table-head"},nP={class:"wt-tree-table-tr wt-tree-table-tr-head"},aP=["onClick"],iP={class:"wt-tree-table-th__content"},oP={class:"wt-tree-table-th__text"},lP={key:0,class:"wt-tree-table-th__actions"},sP={class:"wt-tree-table-th__content"},cP={class:"wt-tree-table-body"},Bu={WtActionBar:Wv,WtImage:k7,WtEmpty:tM,WtLogo:vB,WtAvatar:P_,WtBadge:z_,WtIcon:E7,WtIndicator:HM,WtInputInfo:b7,WtButton:Y_,WtChip:ak,WtConfirmDialog:lk,WtDivider:NS,WtTooltip:FV,WtLabel:iB,WtLoader:wB,WtRoundedAction:cN,WtReplaceTransition:Hv,WtCheckbox:ho,WtDatepicker:MS,WtIconBtn:L7,WtInput:UM,WtIntersectionObserver:tB,WtHint:VM,WtNotification:eT,WtPopup:eN,WtProgressBar:nN,WtRadio:sN,WtSearchBar:pN,WtSelect:tD,WtSlider:iD,WtSwitcher:xD,WtTabs:XD,WtTagsInput:VO,WtTimeInput:WO,WtTimepicker:KO,WtTextarea:HO,WtAppHeader:Kv,WtHeadline:AM,WtHeadlineNav:NM,WtNavigationBar:KB,WtAppNavigator:w_,WtFiltersPanelWrapper:xM,WtHeaderActions:N_,WtErrorPage:uM,WtNotificationsBar:sT,WtPageWrapper:gT,WtDualPanel:FS,WtPagination:BT,WtPlayer:DT,WtStatusSelect:dD,WtTable:VD,WtTree:ZV,WtTreeTable:ye(a.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(e,{emit:n}){const r=e,i=n,o=b=>b[r.childrenProp]&&Array.isArray(b[r.childrenProp]),l=b=>{const v=[],C=y=>{if(y._isSelected)return[y];o(y)&&y[r.childrenProp].forEach(C)};return b.forEach(C),v},s=b=>{const v=[],C=y=>{v.push(y),o(y)&&y[r.childrenProp].forEach(C)};return b.forEach(C),v},c=a.computed(()=>r.selected||l(r.data)),d=a.computed(()=>c.value.length===s(r.data).length&&s(r.data).length>0),{tableHeaders:u}=YV({headers:r.headers}),h=({sort:b})=>r.sortable&&b!==void 0,p=b=>{if(!h(b))return;const v=U7(b.sort);i("sort",b,v)},m=(b,v)=>{b.forEach(C=>{C._isSelected=v,o(C)&&m(C[r.childrenProp],v)})},w=()=>{r.selected?i("update:selected",d.value?[]:[...s(r.data)]):d.value?m(r.data,!1):m(r.data,!0)},x=(b,v)=>{r.selected?v?i("update:selected",[...c.value,b]):i("update:selected",c.value.filter(C=>C!==b)):b._isSelected=!b._isSelected};return(b,v)=>{const C=a.resolveComponent("wt-icon");return a.openBlock(),a.createElementBlock("div",eP,[a.createElementVNode("table",tP,[a.createElementVNode("thead",rP,[a.createElementVNode("tr",nP,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(a.unref(u),(y,_)=>(a.openBlock(),a.createElementBlock("th",{key:_,class:a.normalizeClass([[{"wt-tree-table-th--sortable":h(y)},`wt-tree-table-th--sort-${y.sort}`],"wt-tree-table-th"]),style:a.normalizeStyle(y.width?`min-width:${y.width}`:""),onClick:L=>p(y)},[a.createElementVNode("div",iP,[_===0&&b.selectable?(a.openBlock(),a.createElementBlock("div",{key:0,onClick:v[0]||(v[0]=a.withModifiers(()=>{},["stop"]))},[a.createVNode(a.unref(ho),{selected:d.value,onChange:w},null,8,["selected"])])):a.createCommentVNode("",!0),a.createElementVNode("div",oP,a.toDisplayString(y.text),1),b.sortable?(a.openBlock(),a.createBlock(C,{key:1,class:"wt-tree-table-th-sort-arrow wt-tree-table-th-sort-arrow--asc",icon:"sort-arrow-up",size:"sm"})):a.createCommentVNode("",!0),b.sortable?(a.openBlock(),a.createBlock(C,{key:2,class:"wt-tree-table-th-sort-arrow wt-tree-table-th-sort-arrow--desc",icon:"sort-arrow-down",size:"sm"})):a.createCommentVNode("",!0)])],14,aP))),128)),b.gridActions?(a.openBlock(),a.createElementBlock("th",lP,[a.createElementVNode("div",sP,[a.renderSlot(b.$slots,"actions-header",{},void 0,!0)])])):a.createCommentVNode("",!0)])]),a.createElementVNode("tbody",cP,[(a.openBlock(!0),a.createElementBlock(a.Fragment,null,a.renderList(b.data,(y,_)=>(a.openBlock(),a.createBlock(JV,{key:_,"row-position":_,"data-headers":a.unref(u),data:y,selectable:b.selectable,"children-prop":b.childrenProp,"selected-elements":c.value,"searched-prop":b.searchedProp,"onUpdate:selected":v[1]||(v[1]=L=>x(L.data,L.select))},a.createSlots({actions:a.withCtx(({item:L})=>[a.renderSlot(b.$slots,"actions",{item:L},void 0,!0)]),_:2},[a.renderList(a.unref(u),(L,T)=>({name:L.value,fn:a.withCtx(({item:q})=>[a.renderSlot(b.$slots,L.value,{index:_,item:q},()=>[a.createTextVNode(a.toDisplayString(q[L.value]),1)],!0)])}))]),1032,["row-position","data-headers","data","selectable","children-prop","selected-elements","searched-prop"]))),128))])])])}}}),[["__scopeId","data-v-2986559a"]]),WtTableActions:ID,WtTableColumnSelect:jD,WtButtonSelect:K_,WtContextMenu:ck,WtCopyAction:mk,WtLoadBar:cB,WtIconAction:b6,WtPageHeader:cT,WtItemLink:rB,WtDummy:jS,WtStepper:gD,WtExpansionPanel:gM,WtNavigationMenu:rw,WtStartPage:Lb,WtSelectionPopup:hb},Tu=Go?window:void 0;function w1(e){var n;const r=a.toValue(e);return(n=r==null?void 0:r.$el)!=null?n:r}function $t(...e){const n=[],r=()=>{n.forEach(c=>c()),n.length=0},i=(c,d,u,h)=>(c.addEventListener(d,u,h),()=>c.removeEventListener(d,u,h)),o=a.computed(()=>{const c=_r(a.toValue(e[0])).filter(d=>d!=null);return c.every(d=>typeof d!="string")?c:void 0}),l=KM(()=>{var c,d;return[(d=(c=o.value)==null?void 0:c.map(u=>w1(u)))!=null?d:[Tu].filter(u=>u!=null),_r(a.toValue(o.value?e[1]:e[0])),_r(a.unref(o.value?e[2]:e[1])),a.toValue(o.value?e[3]:e[2])]},([c,d,u,h])=>{if(r(),!(c!=null&&c.length)||!(d!=null&&d.length)||!(u!=null&&u.length))return;const p=ZM(h)?{...h}:h;n.push(...c.flatMap(m=>d.flatMap(w=>u.map(x=>i(m,w,x,p)))))},{flush:"post"}),s=()=>{l(),r()};return Yo(r),s}let Nu=!1;function Du(e,n,r={}){const{window:i=Tu,ignore:o=[],capture:l=!0,detectIframe:s=!1,controls:c=!1}=r;if(!i)return c?{stop:p2,cancel:p2,trigger:p2}:p2;if(Ko&&!Nu){Nu=!0;const v={passive:!0};Array.from(i.document.body.children).forEach(C=>$t(C,"click",p2,v)),$t(i.document.documentElement,"click",p2,v)}let d=!0;const u=v=>a.toValue(o).some(C=>{if(typeof C=="string")return Array.from(i.document.querySelectorAll(C)).some(y=>y===v.target||v.composedPath().includes(y));{const y=w1(C);return y&&(v.target===y||v.composedPath().includes(y))}});function h(v){const C=a.toValue(v);return C&&C.$.subTree.shapeFlag===16}function p(v,C){const y=a.toValue(v),_=y.$.subTree&&y.$.subTree.children;return _==null||!Array.isArray(_)?!1:_.some(L=>L.el===C.target||C.composedPath().includes(L.el))}const m=v=>{const C=w1(e);if(v.target!=null&&!(!(C instanceof Element)&&h(e)&&p(e,v))&&!(!C||C===v.target||v.composedPath().includes(C))){if("detail"in v&&v.detail===0&&(d=!u(v)),!d){d=!0;return}n(v)}};let w=!1;const x=[$t(i,"click",v=>{w||(w=!0,setTimeout(()=>{w=!1},0),m(v))},{passive:!0,capture:l}),$t(i,"pointerdown",v=>{const C=w1(e);d=!u(v)&&!!(C&&!v.composedPath().includes(C))},{passive:!0}),s&&$t(i,"blur",v=>{setTimeout(()=>{var C;const y=w1(e);((C=i.document.activeElement)==null?void 0:C.tagName)==="IFRAME"&&!(y!=null&&y.contains(i.document.activeElement))&&n(v)},0)},{passive:!0})].filter(Boolean),b=()=>x.forEach(v=>v());return c?{stop:b,cancel:()=>{d=!1},trigger:v=>{d=!0,m(v),d=!1}}:b}const dP={mounted(e,n){const r=!n.modifiers.bubble;if(typeof n.value=="function")e.__onClickOutside_stop=Du(e,n.value,{capture:r});else{const[i,o]=n.value;e.__onClickOutside_stop=Du(e,i,Object.assign({capture:r},o))}},unmounted(e){e.__onClickOutside_stop()}};function ys(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}function Ou(e){const n=window.getComputedStyle(e);if(n.overflowX==="scroll"||n.overflowY==="scroll"||n.overflowX==="auto"&&e.clientWidth<e.scrollWidth||n.overflowY==="auto"&&e.clientHeight<e.scrollHeight)return!0;{const r=e.parentNode;return!r||r.tagName==="BODY"?!1:Ou(r)}}function uP(e){const n=e||window.event,r=n.target;return Ou(r)?!1:n.touches.length>1?!0:(n.preventDefault&&n.preventDefault(),!1)}const ws=new WeakMap;function hP(e,n=!1){const r=a.shallowRef(n);let i=null,o="";a.watch(GM(e),c=>{const d=ys(a.toValue(c));if(d){const u=d;if(ws.get(u)||ws.set(u,u.style.overflow),u.style.overflow!=="hidden"&&(o=u.style.overflow),u.style.overflow==="hidden")return r.value=!0;if(r.value)return u.style.overflow="hidden"}},{immediate:!0});const l=()=>{const c=ys(a.toValue(e));!c||r.value||(Ko&&(i=$t(c,"touchmove",d=>{uP(d)},{passive:!1})),c.style.overflow="hidden",r.value=!0)},s=()=>{const c=ys(a.toValue(e));!c||!r.value||(Ko&&(i==null||i()),c.style.overflow=o,ws.delete(c),r.value=!1)};return Yo(s),a.computed({get(){return r.value},set(c){c?l():s()}})}function fP(){let e=!1;const n=a.shallowRef(!1);return(r,i)=>{if(n.value=i.value,e)return;e=!0;const o=hP(r,i.value);a.watch(n,l=>o.value=l)}}fP();const Vu={clickaway:dP},pP={install(e,{eventBus:n,router:r,globals:i={}}){Object.keys(Vu).forEach(o=>{e.directive(o,Vu[o])}),Object.keys(Bu).forEach(o=>{e.component(o,Bu[o])}),Object.keys(i).forEach(o=>{e.provide(o,i[o])}),e.provide("$eventBus",n),r&&e.use(r)},generateInstance:B4};function we(e,n,r){return(n=gP(n))in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function mP(e,n){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function gP(e){var n=mP(e,"string");return typeof n=="symbol"?n:String(n)}function yP(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function Pu(e,n){for(var r=0;r<n.length;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function wP(e,n,r){return n&&Pu(e.prototype,n),r&&Pu(e,r),e}function CP(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function $u(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);n&&(i=i.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,i)}return r}function Fu(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?$u(Object(r),!0).forEach(function(i){CP(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$u(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}var Iu={addCSS:!0,thumbWidth:15,watch:!0};function bP(e,n){return(function(){return Array.from(document.querySelectorAll(n)).includes(this)}).call(e,n)}function xP(e,n){if(e&&n){var r=new Event(n,{bubbles:!0});e.dispatchEvent(r)}}var C1=function(e){return e!=null?e.constructor:null},Cs=function(e,n){return!!(e&&n&&e instanceof n)},Ru=function(e){return e==null},Hu=function(e){return C1(e)===Object},vP=function(e){return C1(e)===Number&&!Number.isNaN(e)},qu=function(e){return C1(e)===String},_P=function(e){return C1(e)===Boolean},kP=function(e){return C1(e)===Function},zu=function(e){return Array.isArray(e)},Uu=function(e){return Cs(e,NodeList)},EP=function(e){return Cs(e,Element)},LP=function(e){return Cs(e,Event)},AP=function(e){return Ru(e)||(qu(e)||zu(e)||Uu(e))&&!e.length||Hu(e)&&!Object.keys(e).length},T0={nullOrUndefined:Ru,object:Hu,number:vP,string:qu,boolean:_P,function:kP,array:zu,nodeList:Uu,element:EP,event:LP,empty:AP};function SP(e){var n="".concat(e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return n?Math.max(0,(n[1]?n[1].length:0)-(n[2]?+n[2]:0)):0}function MP(e,n){if(1>n){var r=SP(n);return parseFloat(e.toFixed(r))}return Math.round(e/n)*n}var BP=function(){function e(n,r){yP(this,e),T0.element(n)?this.element=n:T0.string(n)&&(this.element=document.querySelector(n)),T0.element(this.element)&&T0.empty(this.element.rangeTouch)&&(this.config=Fu({},Iu,{},r),this.init())}return wP(e,[{key:"init",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="none",this.element.style.webKitUserSelect="none",this.element.style.touchAction="manipulation"),this.listeners(!0),this.element.rangeTouch=this)}},{key:"destroy",value:function(){e.enabled&&(this.config.addCSS&&(this.element.style.userSelect="",this.element.style.webKitUserSelect="",this.element.style.touchAction=""),this.listeners(!1),this.element.rangeTouch=null)}},{key:"listeners",value:function(n){var r=this,i=n?"addEventListener":"removeEventListener";["touchstart","touchmove","touchend"].forEach(function(o){r.element[i](o,function(l){return r.set(l)},!1)})}},{key:"get",value:function(n){if(!e.enabled||!T0.event(n))return null;var r,i=n.target,o=n.changedTouches[0],l=parseFloat(i.getAttribute("min"))||0,s=parseFloat(i.getAttribute("max"))||100,c=parseFloat(i.getAttribute("step"))||1,d=i.getBoundingClientRect(),u=100/d.width*(this.config.thumbWidth/2)/100;return 0>(r=100/d.width*(o.clientX-d.left))?r=0:100<r&&(r=100),50>r?r-=(100-2*r)*u:50<r&&(r+=2*(r-50)*u),l+MP(r/100*(s-l),c)}},{key:"set",value:function(n){e.enabled&&T0.event(n)&&!n.target.disabled&&(n.preventDefault(),n.target.value=this.get(n),xP(n.target,n.type==="touchend"?"change":"input"))}}],[{key:"setup",value:function(n){var r=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{},i=null;if(T0.empty(n)||T0.string(n)?i=Array.from(document.querySelectorAll(T0.string(n)?n:'input[type="range"]')):T0.element(n)?i=[n]:T0.nodeList(n)?i=Array.from(n):T0.array(n)&&(i=n.filter(T0.element)),T0.empty(i))return null;var o=Fu({},Iu,{},r);if(T0.string(n)&&o.watch){var l=new MutationObserver(function(s){Array.from(s).forEach(function(c){Array.from(c.addedNodes).forEach(function(d){T0.element(d)&&bP(d,n)&&new e(d,o)})})});l.observe(document.body,{childList:!0,subtree:!0})}return i.map(function(s){return new e(s,r)})}},{key:"enabled",get:function(){return"ontouchstart"in document.documentElement}}]),e}();const b1=e=>e!=null?e.constructor:null,D2=(e,n)=>!!(e&&n&&e instanceof n),bs=e=>e==null,ju=e=>b1(e)===Object,TP=e=>b1(e)===Number&&!Number.isNaN(e),Rr=e=>b1(e)===String,NP=e=>b1(e)===Boolean,Wu=e=>typeof e=="function",Zu=e=>Array.isArray(e),DP=e=>D2(e,WeakMap),Yu=e=>D2(e,NodeList),OP=e=>b1(e)===Text,VP=e=>D2(e,Event),PP=e=>D2(e,KeyboardEvent),$P=e=>D2(e,window.TextTrackCue)||D2(e,window.VTTCue),FP=e=>D2(e,TextTrack)||!bs(e)&&Rr(e.kind),IP=e=>D2(e,Promise)&&Wu(e.then),RP=e=>e!==null&&typeof e=="object"&&e.nodeType===1&&typeof e.style=="object"&&typeof e.ownerDocument=="object",Gu=e=>bs(e)||(Rr(e)||Zu(e)||Yu(e))&&!e.length||ju(e)&&!Object.keys(e).length;var N={nullOrUndefined:bs,object:ju,number:TP,string:Rr,boolean:NP,function:Wu,array:Zu,weakMap:DP,nodeList:Yu,element:RP,textNode:OP,event:VP,keyboardEvent:PP,cue:$P,track:FP,promise:IP,url:e=>{if(D2(e,window.URL))return!0;if(!Rr(e))return!1;let n=e;e.startsWith("http://")&&e.startsWith("https://")||(n=`http://${e}`);try{return!Gu(new URL(n).hostname)}catch{return!1}},empty:Gu};const xs=(()=>{const e=document.createElement("span"),n={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},r=Object.keys(n).find(i=>e.style[i]!==void 0);return!!N.string(r)&&n[r]})();function Ku(e,n){setTimeout(()=>{try{e.hidden=!0,e.offsetHeight,e.hidden=!1}catch{}},n)}const HP=!!window.document.documentMode,qP=/Edge/g.test(navigator.userAgent),zP="WebkitAppearance"in document.documentElement.style&&!/Edge/g.test(navigator.userAgent),UP=/iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1,jP=navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,WP=/iPad|iPhone|iPod/gi.test(navigator.userAgent)&&navigator.maxTouchPoints>1;var b0={isIE:HP,isEdge:qP,isWebKit:zP,isIPhone:UP,isIPadOS:jP,isIos:WP};function ZP(e){return JSON.parse(JSON.stringify(e))}function Xu(e,n){return n.split(".").reduce((r,i)=>r&&r[i],e)}function h0(e={},...n){if(!n.length)return e;const r=n.shift();return N.object(r)?(Object.keys(r).forEach(i=>{N.object(r[i])?(Object.keys(e).includes(i)||Object.assign(e,{[i]:{}}),h0(e[i],r[i])):Object.assign(e,{[i]:r[i]})}),h0(e,...n)):e}function Qu(e,n){const r=e.length?e:[e];Array.from(r).reverse().forEach((i,o)=>{const l=o>0?n.cloneNode(!0):n,s=i.parentNode,c=i.nextSibling;l.appendChild(i),c?s.insertBefore(l,c):s.appendChild(l)})}function vs(e,n){N.element(e)&&!N.empty(n)&&Object.entries(n).filter(([,r])=>!N.nullOrUndefined(r)).forEach(([r,i])=>e.setAttribute(r,i))}function De(e,n,r){const i=document.createElement(e);return N.object(n)&&vs(i,n),N.string(r)&&(i.innerText=r),i}function YP(e,n){N.element(e)&&N.element(n)&&n.parentNode.insertBefore(e,n.nextSibling)}function Ju(e,n,r,i){N.element(n)&&n.appendChild(De(e,r,i))}function O2(e){N.nodeList(e)||N.array(e)?Array.from(e).forEach(O2):N.element(e)&&N.element(e.parentNode)&&e.parentNode.removeChild(e)}function Hr(e){if(!N.element(e))return;let{length:n}=e.childNodes;for(;n>0;)e.removeChild(e.lastChild),n-=1}function qr(e,n){return N.element(n)&&N.element(n.parentNode)&&N.element(e)?(n.parentNode.replaceChild(e,n),e):null}function w2(e,n){if(!N.string(e)||N.empty(e))return{};const r={},i=h0({},n);return e.split(",").forEach(o=>{const l=o.trim(),s=l.replace(".",""),c=l.replace(/[[\]]/g,"").split("="),[d]=c,u=c.length>1?c[1].replace(/["']/g,""):"";switch(l.charAt(0)){case".":N.string(i.class)?r.class=`${i.class} ${s}`:r.class=s;break;case"#":r.id=l.replace("#","");break;case"[":r[d]=u}}),h0(i,r)}function pt(e,n){if(!N.element(e))return;let r=n;N.boolean(r)||(r=!e.hidden),e.hidden=r}function Ye(e,n,r){if(N.nodeList(e))return Array.from(e).map(i=>Ye(i,n,r));if(N.element(e)){let i="toggle";return r!==void 0&&(i=r?"add":"remove"),e.classList[i](n),e.classList.contains(n)}return!1}function zr(e,n){return N.element(e)&&e.classList.contains(n)}function mt(e,n){const{prototype:r}=Element;return(r.matches||r.webkitMatchesSelector||r.mozMatchesSelector||r.msMatchesSelector||function(){return Array.from(document.querySelectorAll(n)).includes(this)}).call(e,n)}function GP(e,n){const{prototype:r}=Element;return(r.closest||function(){let i=this;do{if(mt.matches(i,n))return i;i=i.parentElement||i.parentNode}while(i!==null&&i.nodeType===1);return null}).call(e,n)}function x1(e){return this.elements.container.querySelectorAll(e)}function y0(e){return this.elements.container.querySelector(e)}function _s(e=null,n=!1){N.element(e)&&e.focus({preventScroll:!0,focusVisible:n})}const eh={"audio/ogg":"vorbis","audio/wav":"1","video/webm":"vp8, vorbis","video/mp4":"avc1.42E01E, mp4a.40.2","video/ogg":"theora"},f0={audio:"canPlayType"in document.createElement("audio"),video:"canPlayType"in document.createElement("video"),check(e,n){const r=f0[e]||n!=="html5";return{api:r,ui:r&&f0.rangeInput}},pip:!(b0.isIPhone||!N.function(De("video").webkitSetPresentationMode)&&(!document.pictureInPictureEnabled||De("video").disablePictureInPicture)),airplay:N.function(window.WebKitPlaybackTargetAvailabilityEvent),playsinline:"playsInline"in document.createElement("video"),mime(e){if(N.empty(e))return!1;const[n]=e.split("/");let r=e;if(!this.isHTML5||n!==this.type)return!1;Object.keys(eh).includes(r)&&(r+=`; codecs="${eh[e]}"`);try{return!!(r&&this.media.canPlayType(r).replace(/no/,""))}catch{return!1}},textTracks:"textTracks"in document.createElement("video"),rangeInput:(()=>{const e=document.createElement("input");return e.type="range",e.type==="range"})(),touch:"ontouchstart"in document.documentElement,transitions:xs!==!1,reducedMotion:"matchMedia"in window&&window.matchMedia("(prefers-reduced-motion)").matches},KP=(()=>{let e=!1;try{const n=Object.defineProperty({},"passive",{get:()=>(e=!0,null)});window.addEventListener("test",null,n),window.removeEventListener("test",null,n)}catch{}return e})();function v1(e,n,r,i=!1,o=!0,l=!1){if(!e||!("addEventListener"in e)||N.empty(n)||!N.function(r))return;const s=n.split(" ");let c=l;KP&&(c={passive:o,capture:l}),s.forEach(d=>{this&&this.eventListeners&&i&&this.eventListeners.push({element:e,type:d,callback:r,options:c}),e[i?"addEventListener":"removeEventListener"](d,r,c)})}function ze(e,n="",r,i=!0,o=!1){v1.call(this,e,n,r,!0,i,o)}function Ur(e,n="",r,i=!0,o=!1){v1.call(this,e,n,r,!1,i,o)}function ks(e,n="",r,i=!0,o=!1){const l=(...s)=>{Ur(e,n,l,i,o),r.apply(this,s)};v1.call(this,e,n,l,!0,i,o)}function Oe(e,n="",r=!1,i={}){if(!N.element(e)||N.empty(n))return;const o=new CustomEvent(n,{bubbles:r,detail:{...i,plyr:this}});e.dispatchEvent(o)}function XP(){this&&this.eventListeners&&(this.eventListeners.forEach(e=>{const{element:n,type:r,callback:i,options:o}=e;n.removeEventListener(r,i,o)}),this.eventListeners=[])}function QP(){return new Promise(e=>this.ready?setTimeout(e,0):ze.call(this,this.elements.container,"ready",e)).then(()=>{})}function C2(e){N.promise(e)&&e.then(null,()=>{})}function Es(e){return N.array(e)?e.filter((n,r)=>e.indexOf(n)===r):e}function th(e,n){return N.array(e)&&e.length?e.reduce((r,i)=>Math.abs(i-n)<Math.abs(r-n)?i:r):null}function rh(e){return!(!window||!window.CSS)&&window.CSS.supports(e)}const nh=[[1,1],[4,3],[3,4],[5,4],[4,5],[3,2],[2,3],[16,10],[10,16],[16,9],[9,16],[21,9],[9,21],[32,9],[9,32]].reduce((e,[n,r])=>({...e,[n/r]:[n,r]}),{});function ah(e){return N.array(e)||N.string(e)&&e.includes(":")?(N.array(e)?e:e.split(":")).map(Number).every(N.number):!1}function jr(e){if(!N.array(e)||!e.every(N.number))return null;const[n,r]=e,i=(l,s)=>s===0?l:i(s,l%s),o=i(n,r);return[n/o,r/o]}function Ls(e){const n=i=>ah(i)?i.split(":").map(Number):null;let r=n(e);if(r===null&&(r=n(this.config.ratio)),r===null&&!N.empty(this.embed)&&N.array(this.embed.ratio)&&({ratio:r}=this.embed),r===null&&this.isHTML5){const{videoWidth:i,videoHeight:o}=this.media;r=[i,o]}return jr(r)}function Ft(e){if(!this.isVideo)return{};const{wrapper:n}=this.elements,r=Ls.call(this,e);if(!N.array(r))return{};const[i,o]=jr(r),l=100/i*o;if(rh(`aspect-ratio: ${i}/${o}`)?n.style.aspectRatio=`${i}/${o}`:n.style.paddingBottom=`${l}%`,this.isVimeo&&!this.config.vimeo.premium&&this.supported.ui){const s=100/this.media.offsetWidth*parseInt(window.getComputedStyle(this.media).paddingBottom,10),c=(s-l)/(s/50);this.fullscreen.active?n.style.paddingBottom=null:this.media.style.transform=`translateY(-${c}%)`}else this.isHTML5&&n.classList.add(this.config.classNames.videoFixedRatio);return{padding:l,ratio:r}}function ih(e,n,r=.05){const i=e/n,o=th(Object.keys(nh),i);return Math.abs(o-i)<=r?nh[o]:[e,n]}function JP(){return[Math.max(document.documentElement.clientWidth||0,window.innerWidth||0),Math.max(document.documentElement.clientHeight||0,window.innerHeight||0)]}const j2={getSources(){return this.isHTML5?Array.from(this.media.querySelectorAll("source")).filter(e=>{const n=e.getAttribute("type");return!!N.empty(n)||f0.mime.call(this,n)}):[]},getQualityOptions(){return this.config.quality.forced?this.config.quality.options:j2.getSources.call(this).map(e=>Number(e.getAttribute("size"))).filter(Boolean)},setup(){if(!this.isHTML5)return;const e=this;e.options.speed=e.config.speed.options,N.empty(this.config.ratio)||Ft.call(e),Object.defineProperty(e.media,"quality",{get(){const n=j2.getSources.call(e).find(r=>r.getAttribute("src")===e.source);return n&&Number(n.getAttribute("size"))},set(n){if(e.quality!==n){if(e.config.quality.forced&&N.function(e.config.quality.onChange))e.config.quality.onChange(n);else{const r=j2.getSources.call(e).find(d=>Number(d.getAttribute("size"))===n);if(!r)return;const{currentTime:i,paused:o,preload:l,readyState:s,playbackRate:c}=e.media;e.media.src=r.getAttribute("src"),(l!=="none"||s)&&(e.once("loadedmetadata",()=>{e.speed=c,e.currentTime=i,o||C2(e.play())}),e.media.load())}Oe.call(e,e.media,"qualitychange",!1,{quality:n})}}})},cancelRequests(){this.isHTML5&&(O2(j2.getSources.call(this)),this.media.setAttribute("src",this.config.blankVideo),this.media.load(),this.debug.log("Cancelled network requests"))}};function e$(e){return`${e}-${Math.floor(1e4*Math.random())}`}function As(e,...n){return N.empty(e)?e:e.toString().replace(/{(\d+)}/g,(r,i)=>n[i].toString())}function t$(e,n){return e===0||n===0||Number.isNaN(e)||Number.isNaN(n)?0:(e/n*100).toFixed(2)}const _1=(e="",n="",r="")=>e.replace(new RegExp(n.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1"),"g"),r.toString()),oh=(e="")=>e.toString().replace(/\w\S*/g,n=>n.charAt(0).toUpperCase()+n.slice(1).toLowerCase());function r$(e=""){let n=e.toString();return n=_1(n,"-"," "),n=_1(n,"_"," "),n=oh(n),_1(n," ","")}function n$(e=""){let n=e.toString();return n=r$(n),n.charAt(0).toLowerCase()+n.slice(1)}function a$(e){const n=document.createDocumentFragment(),r=document.createElement("div");return n.appendChild(r),r.innerHTML=e,n.firstChild.innerText}function i$(e){const n=document.createElement("div");return n.appendChild(e),n.innerHTML}const lh={pip:"PIP",airplay:"AirPlay",html5:"HTML5",vimeo:"Vimeo",youtube:"YouTube"},x0={get(e="",n={}){if(N.empty(e)||N.empty(n))return"";let r=Xu(n.i18n,e);if(N.empty(r))return Object.keys(lh).includes(e)?lh[e]:"";const i={"{seektime}":n.seekTime,"{title}":n.title};return Object.entries(i).forEach(([o,l])=>{r=_1(r,o,l)}),r}};class k1{constructor(n){we(this,"get",r=>{if(!k1.supported||!this.enabled)return null;const i=window.localStorage.getItem(this.key);if(N.empty(i))return null;const o=JSON.parse(i);return N.string(r)&&r.length?o[r]:o}),we(this,"set",r=>{if(!k1.supported||!this.enabled||!N.object(r))return;let i=this.get();N.empty(i)&&(i={}),h0(i,r);try{window.localStorage.setItem(this.key,JSON.stringify(i))}catch{}}),this.enabled=n.config.storage.enabled,this.key=n.config.storage.key}static get supported(){try{if(!("localStorage"in window))return!1;const n="___test";return window.localStorage.setItem(n,n),window.localStorage.removeItem(n),!0}catch{return!1}}}function E1(e,n="text"){return new Promise((r,i)=>{try{const o=new XMLHttpRequest;if(!("withCredentials"in o))return;o.addEventListener("load",()=>{if(n==="text")try{r(JSON.parse(o.responseText))}catch{r(o.responseText)}else r(o.response)}),o.addEventListener("error",()=>{throw new Error(o.status)}),o.open("GET",e,!0),o.responseType=n,o.send()}catch(o){i(o)}})}function sh(e,n){if(!N.string(e))return;const r="cache",i=N.string(n);let o=!1;const l=()=>document.getElementById(n)!==null,s=(c,d)=>{c.innerHTML=d,i&&l()||document.body.insertAdjacentElement("afterbegin",c)};if(!i||!l()){const c=k1.supported,d=document.createElement("div");if(d.setAttribute("hidden",""),i&&d.setAttribute("id",n),c){const u=window.localStorage.getItem(`${r}-${n}`);if(o=u!==null,o){const h=JSON.parse(u);s(d,h.content)}}E1(e).then(u=>{if(!N.empty(u)){if(c)try{window.localStorage.setItem(`${r}-${n}`,JSON.stringify({content:u}))}catch{}s(d,u)}}).catch(()=>{})}}const ch=e=>Math.trunc(e/60/60%60,10),o$=e=>Math.trunc(e/60%60,10),l$=e=>Math.trunc(e%60,10);function Wr(e=0,n=!1,r=!1){if(!N.number(e))return Wr(void 0,n,r);const i=c=>`0${c}`.slice(-2);let o=ch(e);const l=o$(e),s=l$(e);return o=n||o>0?`${o}:`:"",`${r&&e>0?"-":""}${o}${i(l)}:${i(s)}`}const pe={getIconUrl(){const e=new URL(this.config.iconUrl,window.location),n=window.location.host?window.location.host:window.top.location.host,r=e.host!==n||b0.isIE&&!window.svg4everybody;return{url:this.config.iconUrl,cors:r}},findElements(){try{return this.elements.controls=y0.call(this,this.config.selectors.controls.wrapper),this.elements.buttons={play:x1.call(this,this.config.selectors.buttons.play),pause:y0.call(this,this.config.selectors.buttons.pause),restart:y0.call(this,this.config.selectors.buttons.restart),rewind:y0.call(this,this.config.selectors.buttons.rewind),fastForward:y0.call(this,this.config.selectors.buttons.fastForward),mute:y0.call(this,this.config.selectors.buttons.mute),pip:y0.call(this,this.config.selectors.buttons.pip),airplay:y0.call(this,this.config.selectors.buttons.airplay),settings:y0.call(this,this.config.selectors.buttons.settings),captions:y0.call(this,this.config.selectors.buttons.captions),fullscreen:y0.call(this,this.config.selectors.buttons.fullscreen)},this.elements.progress=y0.call(this,this.config.selectors.progress),this.elements.inputs={seek:y0.call(this,this.config.selectors.inputs.seek),volume:y0.call(this,this.config.selectors.inputs.volume)},this.elements.display={buffer:y0.call(this,this.config.selectors.display.buffer),currentTime:y0.call(this,this.config.selectors.display.currentTime),duration:y0.call(this,this.config.selectors.display.duration)},N.element(this.elements.progress)&&(this.elements.display.seekTooltip=this.elements.progress.querySelector(`.${this.config.classNames.tooltip}`)),!0}catch(e){return this.debug.warn("It looks like there is a problem with your custom controls HTML",e),this.toggleNativeControls(!0),!1}},createIcon(e,n){const r="http://www.w3.org/2000/svg",i=pe.getIconUrl.call(this),o=`${i.cors?"":i.url}#${this.config.iconPrefix}`,l=document.createElementNS(r,"svg");vs(l,h0(n,{"aria-hidden":"true",focusable:"false"}));const s=document.createElementNS(r,"use"),c=`${o}-${e}`;return"href"in s&&s.setAttributeNS("http://www.w3.org/1999/xlink","href",c),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c),l.appendChild(s),l},createLabel(e,n={}){const r=x0.get(e,this.config);return De("span",{...n,class:[n.class,this.config.classNames.hidden].filter(Boolean).join(" ")},r)},createBadge(e){if(N.empty(e))return null;const n=De("span",{class:this.config.classNames.menu.value});return n.appendChild(De("span",{class:this.config.classNames.menu.badge},e)),n},createButton(e,n){const r=h0({},n);let i=n$(e);const o={element:"button",toggle:!1,label:null,icon:null,labelPressed:null,iconPressed:null};switch(["element","icon","label"].forEach(s=>{Object.keys(r).includes(s)&&(o[s]=r[s],delete r[s])}),o.element!=="button"||Object.keys(r).includes("type")||(r.type="button"),Object.keys(r).includes("class")?r.class.split(" ").some(s=>s===this.config.classNames.control)||h0(r,{class:`${r.class} ${this.config.classNames.control}`}):r.class=this.config.classNames.control,e){case"play":o.toggle=!0,o.label="play",o.labelPressed="pause",o.icon="play",o.iconPressed="pause";break;case"mute":o.toggle=!0,o.label="mute",o.labelPressed="unmute",o.icon="volume",o.iconPressed="muted";break;case"captions":o.toggle=!0,o.label="enableCaptions",o.labelPressed="disableCaptions",o.icon="captions-off",o.iconPressed="captions-on";break;case"fullscreen":o.toggle=!0,o.label="enterFullscreen",o.labelPressed="exitFullscreen",o.icon="enter-fullscreen",o.iconPressed="exit-fullscreen";break;case"play-large":r.class+=` ${this.config.classNames.control}--overlaid`,i="play",o.label="play",o.icon="play";break;default:N.empty(o.label)&&(o.label=i),N.empty(o.icon)&&(o.icon=e)}const l=De(o.element);return o.toggle?(l.appendChild(pe.createIcon.call(this,o.iconPressed,{class:"icon--pressed"})),l.appendChild(pe.createIcon.call(this,o.icon,{class:"icon--not-pressed"})),l.appendChild(pe.createLabel.call(this,o.labelPressed,{class:"label--pressed"})),l.appendChild(pe.createLabel.call(this,o.label,{class:"label--not-pressed"}))):(l.appendChild(pe.createIcon.call(this,o.icon)),l.appendChild(pe.createLabel.call(this,o.label))),h0(r,w2(this.config.selectors.buttons[i],r)),vs(l,r),i==="play"?(N.array(this.elements.buttons[i])||(this.elements.buttons[i]=[]),this.elements.buttons[i].push(l)):this.elements.buttons[i]=l,l},createRange(e,n){const r=De("input",h0(w2(this.config.selectors.inputs[e]),{type:"range",min:0,max:100,step:.01,value:0,autocomplete:"off",role:"slider","aria-label":x0.get(e,this.config),"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":0},n));return this.elements.inputs[e]=r,pe.updateRangeFill.call(this,r),BP.setup(r),r},createProgress(e,n){const r=De("progress",h0(w2(this.config.selectors.display[e]),{min:0,max:100,value:0,role:"progressbar","aria-hidden":!0},n));if(e!=="volume"){r.appendChild(De("span",null,"0"));const i={played:"played",buffer:"buffered"}[e],o=i?x0.get(i,this.config):"";r.innerText=`% ${o.toLowerCase()}`}return this.elements.display[e]=r,r},createTime(e,n){const r=w2(this.config.selectors.display[e],n),i=De("div",h0(r,{class:`${r.class?r.class:""} ${this.config.classNames.display.time} `.trim(),"aria-label":x0.get(e,this.config),role:"timer"}),"00:00");return this.elements.display[e]=i,i},bindMenuItemShortcuts(e,n){ze.call(this,e,"keydown keyup",r=>{if(![" ","ArrowUp","ArrowDown","ArrowRight"].includes(r.key)||(r.preventDefault(),r.stopPropagation(),r.type==="keydown"))return;const i=mt(e,'[role="menuitemradio"]');if(!i&&[" ","ArrowRight"].includes(r.key))pe.showMenuPanel.call(this,n,!0);else{let o;r.key!==" "&&(r.key==="ArrowDown"||i&&r.key==="ArrowRight"?(o=e.nextElementSibling,N.element(o)||(o=e.parentNode.firstElementChild)):(o=e.previousElementSibling,N.element(o)||(o=e.parentNode.lastElementChild)),_s.call(this,o,!0))}},!1),ze.call(this,e,"keyup",r=>{r.key==="Return"&&pe.focusFirstMenuItem.call(this,null,!0)})},createMenuItem({value:e,list:n,type:r,title:i,badge:o=null,checked:l=!1}){const s=w2(this.config.selectors.inputs[r]),c=De("button",h0(s,{type:"button",role:"menuitemradio",class:`${this.config.classNames.control} ${s.class?s.class:""}`.trim(),"aria-checked":l,value:e})),d=De("span");d.innerHTML=i,N.element(o)&&d.appendChild(o),c.appendChild(d),Object.defineProperty(c,"checked",{enumerable:!0,get:()=>c.getAttribute("aria-checked")==="true",set(u){u&&Array.from(c.parentNode.children).filter(h=>mt(h,'[role="menuitemradio"]')).forEach(h=>h.setAttribute("aria-checked","false")),c.setAttribute("aria-checked",u?"true":"false")}}),this.listeners.bind(c,"click keyup",u=>{if(!N.keyboardEvent(u)||u.key===" "){switch(u.preventDefault(),u.stopPropagation(),c.checked=!0,r){case"language":this.currentTrack=Number(e);break;case"quality":this.quality=e;break;case"speed":this.speed=parseFloat(e)}pe.showMenuPanel.call(this,"home",N.keyboardEvent(u))}},r,!1),pe.bindMenuItemShortcuts.call(this,c,r),n.appendChild(c)},formatTime(e=0,n=!1){return N.number(e)?Wr(e,ch(this.duration)>0,n):e},updateTimeDisplay(e=null,n=0,r=!1){N.element(e)&&N.number(n)&&(e.innerText=pe.formatTime(n,r))},updateVolume(){this.supported.ui&&(N.element(this.elements.inputs.volume)&&pe.setRange.call(this,this.elements.inputs.volume,this.muted?0:this.volume),N.element(this.elements.buttons.mute)&&(this.elements.buttons.mute.pressed=this.muted||this.volume===0))},setRange(e,n=0){N.element(e)&&(e.value=n,pe.updateRangeFill.call(this,e))},updateProgress(e){if(!this.supported.ui||!N.event(e))return;let n=0;const r=(i,o)=>{const l=N.number(o)?o:0,s=N.element(i)?i:this.elements.display.buffer;if(N.element(s)){s.value=l;const c=s.getElementsByTagName("span")[0];N.element(c)&&(c.childNodes[0].nodeValue=l)}};if(e)switch(e.type){case"timeupdate":case"seeking":case"seeked":n=t$(this.currentTime,this.duration),e.type==="timeupdate"&&pe.setRange.call(this,this.elements.inputs.seek,n);break;case"playing":case"progress":r(this.elements.display.buffer,100*this.buffered)}},updateRangeFill(e){const n=N.event(e)?e.target:e;if(N.element(n)&&n.getAttribute("type")==="range"){if(mt(n,this.config.selectors.inputs.seek)){n.setAttribute("aria-valuenow",this.currentTime);const r=pe.formatTime(this.currentTime),i=pe.formatTime(this.duration),o=x0.get("seekLabel",this.config);n.setAttribute("aria-valuetext",o.replace("{currentTime}",r).replace("{duration}",i))}else if(mt(n,this.config.selectors.inputs.volume)){const r=100*n.value;n.setAttribute("aria-valuenow",r),n.setAttribute("aria-valuetext",`${r.toFixed(1)}%`)}else n.setAttribute("aria-valuenow",n.value);(b0.isWebKit||b0.isIPadOS)&&n.style.setProperty("--value",n.value/n.max*100+"%")}},updateSeekTooltip(e){var n,r;if(!this.config.tooltips.seek||!N.element(this.elements.inputs.seek)||!N.element(this.elements.display.seekTooltip)||this.duration===0)return;const i=this.elements.display.seekTooltip,o=`${this.config.classNames.tooltip}--visible`,l=h=>Ye(i,o,h);if(this.touch)return void l(!1);let s=0;const c=this.elements.progress.getBoundingClientRect();if(N.event(e))s=100/c.width*(e.pageX-c.left);else{if(!zr(i,o))return;s=parseFloat(i.style.left,10)}s<0?s=0:s>100&&(s=100);const d=this.duration/100*s;i.innerText=pe.formatTime(d);const u=(n=this.config.markers)===null||n===void 0||(r=n.points)===null||r===void 0?void 0:r.find(({time:h})=>h===Math.round(d));u&&i.insertAdjacentHTML("afterbegin",`${u.label}<br>`),i.style.left=`${s}%`,N.event(e)&&["mouseenter","mouseleave"].includes(e.type)&&l(e.type==="mouseenter")},timeUpdate(e){const n=!N.element(this.elements.display.duration)&&this.config.invertTime;pe.updateTimeDisplay.call(this,this.elements.display.currentTime,n?this.duration-this.currentTime:this.currentTime,n),e&&e.type==="timeupdate"&&this.media.seeking||pe.updateProgress.call(this,e)},durationUpdate(){if(!this.supported.ui||!this.config.invertTime&&this.currentTime)return;if(this.duration>=2**32)return pt(this.elements.display.currentTime,!0),void pt(this.elements.progress,!0);N.element(this.elements.inputs.seek)&&this.elements.inputs.seek.setAttribute("aria-valuemax",this.duration);const e=N.element(this.elements.display.duration);!e&&this.config.displayDuration&&this.paused&&pe.updateTimeDisplay.call(this,this.elements.display.currentTime,this.duration),e&&pe.updateTimeDisplay.call(this,this.elements.display.duration,this.duration),this.config.markers.enabled&&pe.setMarkers.call(this),pe.updateSeekTooltip.call(this)},toggleMenuButton(e,n){pt(this.elements.settings.buttons[e],!n)},updateSetting(e,n,r){const i=this.elements.settings.panels[e];let o=null,l=n;if(e==="captions")o=this.currentTrack;else{if(o=N.empty(r)?this[e]:r,N.empty(o)&&(o=this.config[e].default),!N.empty(this.options[e])&&!this.options[e].includes(o))return void this.debug.warn(`Unsupported value of '${o}' for ${e}`);if(!this.config[e].options.includes(o))return void this.debug.warn(`Disabled value of '${o}' for ${e}`)}if(N.element(l)||(l=i&&i.querySelector('[role="menu"]')),!N.element(l))return;this.elements.settings.buttons[e].querySelector(`.${this.config.classNames.menu.value}`).innerHTML=pe.getLabel.call(this,e,o);const s=l&&l.querySelector(`[value="${o}"]`);N.element(s)&&(s.checked=!0)},getLabel(e,n){switch(e){case"speed":return n===1?x0.get("normal",this.config):`${n}×`;case"quality":if(N.number(n)){const r=x0.get(`qualityLabel.${n}`,this.config);return r.length?r:`${n}p`}return oh(n);case"captions":return We.getLabel.call(this);default:return null}},setQualityMenu(e){if(!N.element(this.elements.settings.panels.quality))return;const n="quality",r=this.elements.settings.panels.quality.querySelector('[role="menu"]');N.array(e)&&(this.options.quality=Es(e).filter(l=>this.config.quality.options.includes(l)));const i=!N.empty(this.options.quality)&&this.options.quality.length>1;if(pe.toggleMenuButton.call(this,n,i),Hr(r),pe.checkMenu.call(this),!i)return;const o=l=>{const s=x0.get(`qualityBadge.${l}`,this.config);return s.length?pe.createBadge.call(this,s):null};this.options.quality.sort((l,s)=>{const c=this.config.quality.options;return c.indexOf(l)>c.indexOf(s)?1:-1}).forEach(l=>{pe.createMenuItem.call(this,{value:l,list:r,type:n,title:pe.getLabel.call(this,"quality",l),badge:o(l)})}),pe.updateSetting.call(this,n,r)},setCaptionsMenu(){if(!N.element(this.elements.settings.panels.captions))return;const e="captions",n=this.elements.settings.panels.captions.querySelector('[role="menu"]'),r=We.getTracks.call(this),i=!!r.length;if(pe.toggleMenuButton.call(this,e,i),Hr(n),pe.checkMenu.call(this),!i)return;const o=r.map((l,s)=>({value:s,checked:this.captions.toggled&&this.currentTrack===s,title:We.getLabel.call(this,l),badge:l.language&&pe.createBadge.call(this,l.language.toUpperCase()),list:n,type:"language"}));o.unshift({value:-1,checked:!this.captions.toggled,title:x0.get("disabled",this.config),list:n,type:"language"}),o.forEach(pe.createMenuItem.bind(this)),pe.updateSetting.call(this,e,n)},setSpeedMenu(){if(!N.element(this.elements.settings.panels.speed))return;const e="speed",n=this.elements.settings.panels.speed.querySelector('[role="menu"]');this.options.speed=this.options.speed.filter(i=>i>=this.minimumSpeed&&i<=this.maximumSpeed);const r=!N.empty(this.options.speed)&&this.options.speed.length>1;pe.toggleMenuButton.call(this,e,r),Hr(n),pe.checkMenu.call(this),r&&(this.options.speed.forEach(i=>{pe.createMenuItem.call(this,{value:i,list:n,type:e,title:pe.getLabel.call(this,"speed",i)})}),pe.updateSetting.call(this,e,n))},checkMenu(){const{buttons:e}=this.elements.settings,n=!N.empty(e)&&Object.values(e).some(r=>!r.hidden);pt(this.elements.settings.menu,!n)},focusFirstMenuItem(e,n=!1){if(this.elements.settings.popup.hidden)return;let r=e;N.element(r)||(r=Object.values(this.elements.settings.panels).find(o=>!o.hidden));const i=r.querySelector('[role^="menuitem"]');_s.call(this,i,n)},toggleMenu(e){const{popup:n}=this.elements.settings,r=this.elements.buttons.settings;if(!N.element(n)||!N.element(r))return;const{hidden:i}=n;let o=i;if(N.boolean(e))o=e;else if(N.keyboardEvent(e)&&e.key==="Escape")o=!1;else if(N.event(e)){const l=N.function(e.composedPath)?e.composedPath()[0]:e.target,s=n.contains(l);if(s||!s&&e.target!==r&&o)return}r.setAttribute("aria-expanded",o),pt(n,!o),Ye(this.elements.container,this.config.classNames.menu.open,o),o&&N.keyboardEvent(e)?pe.focusFirstMenuItem.call(this,null,!0):o||i||_s.call(this,r,N.keyboardEvent(e))},getMenuSize(e){const n=e.cloneNode(!0);n.style.position="absolute",n.style.opacity=0,n.removeAttribute("hidden"),e.parentNode.appendChild(n);const r=n.scrollWidth,i=n.scrollHeight;return O2(n),{width:r,height:i}},showMenuPanel(e="",n=!1){const r=this.elements.container.querySelector(`#plyr-settings-${this.id}-${e}`);if(!N.element(r))return;const i=r.parentNode,o=Array.from(i.children).find(l=>!l.hidden);if(f0.transitions&&!f0.reducedMotion){i.style.width=`${o.scrollWidth}px`,i.style.height=`${o.scrollHeight}px`;const l=pe.getMenuSize.call(this,r),s=c=>{c.target===i&&["width","height"].includes(c.propertyName)&&(i.style.width="",i.style.height="",Ur.call(this,i,xs,s))};ze.call(this,i,xs,s),i.style.width=`${l.width}px`,i.style.height=`${l.height}px`}pt(o,!0),pt(r,!1),pe.focusFirstMenuItem.call(this,r,n)},setDownloadUrl(){const e=this.elements.buttons.download;N.element(e)&&e.setAttribute("href",this.download)},create(e){const{bindMenuItemShortcuts:n,createButton:r,createProgress:i,createRange:o,createTime:l,setQualityMenu:s,setSpeedMenu:c,showMenuPanel:d}=pe;this.elements.controls=null,N.array(this.config.controls)&&this.config.controls.includes("play-large")&&this.elements.container.appendChild(r.call(this,"play-large"));const u=De("div",w2(this.config.selectors.controls.wrapper));this.elements.controls=u;const h={class:"plyr__controls__item"};return Es(N.array(this.config.controls)?this.config.controls:[]).forEach(p=>{if(p==="restart"&&u.appendChild(r.call(this,"restart",h)),p==="rewind"&&u.appendChild(r.call(this,"rewind",h)),p==="play"&&u.appendChild(r.call(this,"play",h)),p==="fast-forward"&&u.appendChild(r.call(this,"fast-forward",h)),p==="progress"){const m=De("div",{class:`${h.class} plyr__progress__container`}),w=De("div",w2(this.config.selectors.progress));if(w.appendChild(o.call(this,"seek",{id:`plyr-seek-${e.id}`})),w.appendChild(i.call(this,"buffer")),this.config.tooltips.seek){const x=De("span",{class:this.config.classNames.tooltip},"00:00");w.appendChild(x),this.elements.display.seekTooltip=x}this.elements.progress=w,m.appendChild(this.elements.progress),u.appendChild(m)}if(p==="current-time"&&u.appendChild(l.call(this,"currentTime",h)),p==="duration"&&u.appendChild(l.call(this,"duration",h)),p==="mute"||p==="volume"){let{volume:m}=this.elements;if(N.element(m)&&u.contains(m)||(m=De("div",h0({},h,{class:`${h.class} plyr__volume`.trim()})),this.elements.volume=m,u.appendChild(m)),p==="mute"&&m.appendChild(r.call(this,"mute")),p==="volume"&&!b0.isIos&&!b0.isIPadOS){const w={max:1,step:.05,value:this.config.volume};m.appendChild(o.call(this,"volume",h0(w,{id:`plyr-volume-${e.id}`})))}}if(p==="captions"&&u.appendChild(r.call(this,"captions",h)),p==="settings"&&!N.empty(this.config.settings)){const m=De("div",h0({},h,{class:`${h.class} plyr__menu`.trim(),hidden:""}));m.appendChild(r.call(this,"settings",{"aria-haspopup":!0,"aria-controls":`plyr-settings-${e.id}`,"aria-expanded":!1}));const w=De("div",{class:"plyr__menu__container",id:`plyr-settings-${e.id}`,hidden:""}),x=De("div"),b=De("div",{id:`plyr-settings-${e.id}-home`}),v=De("div",{role:"menu"});b.appendChild(v),x.appendChild(b),this.elements.settings.panels.home=b,this.config.settings.forEach(C=>{const y=De("button",h0(w2(this.config.selectors.buttons.settings),{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--forward`,role:"menuitem","aria-haspopup":!0,hidden:""}));n.call(this,y,C),ze.call(this,y,"click",()=>{d.call(this,C,!1)});const _=De("span",null,x0.get(C,this.config)),L=De("span",{class:this.config.classNames.menu.value});L.innerHTML=e[C],_.appendChild(L),y.appendChild(_),v.appendChild(y);const T=De("div",{id:`plyr-settings-${e.id}-${C}`,hidden:""}),q=De("button",{type:"button",class:`${this.config.classNames.control} ${this.config.classNames.control}--back`});q.appendChild(De("span",{"aria-hidden":!0},x0.get(C,this.config))),q.appendChild(De("span",{class:this.config.classNames.hidden},x0.get("menuBack",this.config))),ze.call(this,T,"keydown",$=>{$.key==="ArrowLeft"&&($.preventDefault(),$.stopPropagation(),d.call(this,"home",!0))},!1),ze.call(this,q,"click",()=>{d.call(this,"home",!1)}),T.appendChild(q),T.appendChild(De("div",{role:"menu"})),x.appendChild(T),this.elements.settings.buttons[C]=y,this.elements.settings.panels[C]=T}),w.appendChild(x),m.appendChild(w),u.appendChild(m),this.elements.settings.popup=w,this.elements.settings.menu=m}if(p==="pip"&&f0.pip&&u.appendChild(r.call(this,"pip",h)),p==="airplay"&&f0.airplay&&u.appendChild(r.call(this,"airplay",h)),p==="download"){const m=h0({},h,{element:"a",href:this.download,target:"_blank"});this.isHTML5&&(m.download="");const{download:w}=this.config.urls;!N.url(w)&&this.isEmbed&&h0(m,{icon:`logo-${this.provider}`,label:this.provider}),u.appendChild(r.call(this,"download",m))}p==="fullscreen"&&u.appendChild(r.call(this,"fullscreen",h))}),this.isHTML5&&s.call(this,j2.getQualityOptions.call(this)),c.call(this),u},inject(){if(this.config.loadSprite){const o=pe.getIconUrl.call(this);o.cors&&sh(o.url,"sprite-plyr")}this.id=Math.floor(1e4*Math.random());let e=null;this.elements.controls=null;const n={id:this.id,seektime:this.config.seekTime,title:this.config.title};let r=!0;N.function(this.config.controls)&&(this.config.controls=this.config.controls.call(this,n)),this.config.controls||(this.config.controls=[]),N.element(this.config.controls)||N.string(this.config.controls)?e=this.config.controls:(e=pe.create.call(this,{id:this.id,seektime:this.config.seekTime,speed:this.speed,quality:this.quality,captions:We.getLabel.call(this)}),r=!1);let i;if(r&&N.string(this.config.controls)&&(e=(o=>{let l=o;return Object.entries(n).forEach(([s,c])=>{l=_1(l,`{${s}}`,c)}),l})(e)),N.string(this.config.selectors.controls.container)&&(i=document.querySelector(this.config.selectors.controls.container)),N.element(i)||(i=this.elements.container),i[N.element(e)?"insertAdjacentElement":"insertAdjacentHTML"]("afterbegin",e),N.element(this.elements.controls)||pe.findElements.call(this),!N.empty(this.elements.buttons)){const o=l=>{const s=this.config.classNames.controlPressed;l.setAttribute("aria-pressed","false"),Object.defineProperty(l,"pressed",{configurable:!0,enumerable:!0,get:()=>zr(l,s),set(c=!1){Ye(l,s,c),l.setAttribute("aria-pressed",c?"true":"false")}})};Object.values(this.elements.buttons).filter(Boolean).forEach(l=>{N.array(l)||N.nodeList(l)?Array.from(l).filter(Boolean).forEach(o):o(l)})}if(b0.isEdge&&Ku(i),this.config.tooltips.controls){const{classNames:o,selectors:l}=this.config,s=`${l.controls.wrapper} ${l.labels} .${o.hidden}`,c=x1.call(this,s);Array.from(c).forEach(d=>{Ye(d,this.config.classNames.hidden,!1),Ye(d,this.config.classNames.tooltip,!0)})}},setMediaMetadata(){try{"mediaSession"in navigator&&(navigator.mediaSession.metadata=new window.MediaMetadata({title:this.config.mediaMetadata.title,artist:this.config.mediaMetadata.artist,album:this.config.mediaMetadata.album,artwork:this.config.mediaMetadata.artwork}))}catch{}},setMarkers(){var e,n;if(!this.duration||this.elements.markers)return;const r=(e=this.config.markers)===null||e===void 0||(n=e.points)===null||n===void 0?void 0:n.filter(({time:d})=>d>0&&d<this.duration);if(r==null||!r.length)return;const i=document.createDocumentFragment(),o=document.createDocumentFragment();let l=null;const s=`${this.config.classNames.tooltip}--visible`,c=d=>Ye(l,s,d);r.forEach(d=>{const u=De("span",{class:this.config.classNames.marker},""),h=d.time/this.duration*100+"%";l&&(u.addEventListener("mouseenter",()=>{d.label||(l.style.left=h,l.innerHTML=d.label,c(!0))}),u.addEventListener("mouseleave",()=>{c(!1)})),u.addEventListener("click",()=>{this.currentTime=d.time}),u.style.left=h,o.appendChild(u)}),i.appendChild(o),this.config.tooltips.seek||(l=De("span",{class:this.config.classNames.tooltip},""),i.appendChild(l)),this.elements.markers={points:o,tip:l},this.elements.progress.appendChild(i)}};function dh(e,n=!0){let r=e;if(n){const i=document.createElement("a");i.href=r,r=i.href}try{return new URL(r)}catch{return null}}function uh(e){const n=new URLSearchParams;return N.object(e)&&Object.entries(e).forEach(([r,i])=>{n.set(r,i)}),n}const We={setup(){if(!this.supported.ui)return;if(!this.isVideo||this.isYouTube||this.isHTML5&&!f0.textTracks)return void(N.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&pe.setCaptionsMenu.call(this));if(N.element(this.elements.captions)||(this.elements.captions=De("div",w2(this.config.selectors.captions)),this.elements.captions.setAttribute("dir","auto"),YP(this.elements.captions,this.elements.wrapper)),b0.isIE&&window.URL){const i=this.media.querySelectorAll("track");Array.from(i).forEach(o=>{const l=o.getAttribute("src"),s=dh(l);s!==null&&s.hostname!==window.location.href.hostname&&["http:","https:"].includes(s.protocol)&&E1(l,"blob").then(c=>{o.setAttribute("src",window.URL.createObjectURL(c))}).catch(()=>{O2(o)})})}const e=Es((navigator.languages||[navigator.language||navigator.userLanguage||"en"]).map(i=>i.split("-")[0]));let n=(this.storage.get("language")||this.config.captions.language||"auto").toLowerCase();n==="auto"&&([n]=e);let r=this.storage.get("captions");if(N.boolean(r)||({active:r}=this.config.captions),Object.assign(this.captions,{toggled:!1,active:r,language:n,languages:e}),this.isHTML5){const i=this.config.captions.update?"addtrack removetrack":"removetrack";ze.call(this,this.media.textTracks,i,We.update.bind(this))}setTimeout(We.update.bind(this),0)},update(){const e=We.getTracks.call(this,!0),{active:n,language:r,meta:i,currentTrackNode:o}=this.captions,l=!!e.find(s=>s.language===r);this.isHTML5&&this.isVideo&&e.filter(s=>!i.get(s)).forEach(s=>{this.debug.log("Track added",s),i.set(s,{default:s.mode==="showing"}),s.mode==="showing"&&(s.mode="hidden"),ze.call(this,s,"cuechange",()=>We.updateCues.call(this))}),(l&&this.language!==r||!e.includes(o))&&(We.setLanguage.call(this,r),We.toggle.call(this,n&&l)),this.elements&&Ye(this.elements.container,this.config.classNames.captions.enabled,!N.empty(e)),N.array(this.config.controls)&&this.config.controls.includes("settings")&&this.config.settings.includes("captions")&&pe.setCaptionsMenu.call(this)},toggle(e,n=!0){if(!this.supported.ui)return;const{toggled:r}=this.captions,i=this.config.classNames.captions.active,o=N.nullOrUndefined(e)?!r:e;if(o!==r){if(n||(this.captions.active=o,this.storage.set({captions:o})),!this.language&&o&&!n){const l=We.getTracks.call(this),s=We.findTrack.call(this,[this.captions.language,...this.captions.languages],!0);return this.captions.language=s.language,void We.set.call(this,l.indexOf(s))}this.elements.buttons.captions&&(this.elements.buttons.captions.pressed=o),Ye(this.elements.container,i,o),this.captions.toggled=o,pe.updateSetting.call(this,"captions"),Oe.call(this,this.media,o?"captionsenabled":"captionsdisabled")}setTimeout(()=>{o&&this.captions.toggled&&(this.captions.currentTrackNode.mode="hidden")})},set(e,n=!0){const r=We.getTracks.call(this);if(e!==-1)if(N.number(e))if(e in r){if(this.captions.currentTrack!==e){this.captions.currentTrack=e;const i=r[e],{language:o}=i||{};this.captions.currentTrackNode=i,pe.updateSetting.call(this,"captions"),n||(this.captions.language=o,this.storage.set({language:o})),this.isVimeo&&this.embed.enableTextTrack(o),Oe.call(this,this.media,"languagechange")}We.toggle.call(this,!0,n),this.isHTML5&&this.isVideo&&We.updateCues.call(this)}else this.debug.warn("Track not found",e);else this.debug.warn("Invalid caption argument",e);else We.toggle.call(this,!1,n)},setLanguage(e,n=!0){if(!N.string(e))return void this.debug.warn("Invalid language argument",e);const r=e.toLowerCase();this.captions.language=r;const i=We.getTracks.call(this),o=We.findTrack.call(this,[r]);We.set.call(this,i.indexOf(o),n)},getTracks(e=!1){return Array.from((this.media||{}).textTracks||[]).filter(n=>!this.isHTML5||e||this.captions.meta.has(n)).filter(n=>["captions","subtitles"].includes(n.kind))},findTrack(e,n=!1){const r=We.getTracks.call(this),i=s=>Number((this.captions.meta.get(s)||{}).default),o=Array.from(r).sort((s,c)=>i(c)-i(s));let l;return e.every(s=>(l=o.find(c=>c.language===s),!l)),l||(n?o[0]:void 0)},getCurrentTrack(){return We.getTracks.call(this)[this.currentTrack]},getLabel(e){let n=e;return!N.track(n)&&f0.textTracks&&this.captions.toggled&&(n=We.getCurrentTrack.call(this)),N.track(n)?N.empty(n.label)?N.empty(n.language)?x0.get("enabled",this.config):e.language.toUpperCase():n.label:x0.get("disabled",this.config)},updateCues(e){if(!this.supported.ui)return;if(!N.element(this.elements.captions))return void this.debug.warn("No captions element to render to");if(!N.nullOrUndefined(e)&&!Array.isArray(e))return void this.debug.warn("updateCues: Invalid input",e);let n=e;if(!n){const i=We.getCurrentTrack.call(this);n=Array.from((i||{}).activeCues||[]).map(o=>o.getCueAsHTML()).map(i$)}const r=n.map(i=>i.trim()).join(`
|
|
30
30
|
`);if(r!==this.elements.captions.innerHTML){Hr(this.elements.captions);const i=De("span",w2(this.config.selectors.caption));i.innerHTML=r,this.elements.captions.appendChild(i),Oe.call(this,this.media,"cuechange")}}},hh={enabled:!0,title:"",debug:!1,autoplay:!1,autopause:!0,playsinline:!0,seekTime:10,volume:1,muted:!1,duration:null,displayDuration:!0,invertTime:!0,toggleInvert:!0,ratio:null,clickToPlay:!0,hideControls:!0,resetOnEnd:!1,disableContextMenu:!0,loadSprite:!0,iconPrefix:"plyr",iconUrl:"https://cdn.plyr.io/3.7.8/plyr.svg",blankVideo:"https://cdn.plyr.io/static/blank.mp4",quality:{default:576,options:[4320,2880,2160,1440,1080,720,576,480,360,240],forced:!1,onChange:null},loop:{active:!1},speed:{selected:1,options:[.5,.75,1,1.25,1.5,1.75,2,4]},keyboard:{focused:!0,global:!1},tooltips:{controls:!1,seek:!0},captions:{active:!1,language:"auto",update:!1},fullscreen:{enabled:!0,fallback:!0,iosNative:!1},storage:{enabled:!0,key:"plyr"},controls:["play-large","play","progress","current-time","mute","volume","captions","settings","pip","airplay","fullscreen"],settings:["captions","quality","speed"],i18n:{restart:"Restart",rewind:"Rewind {seektime}s",play:"Play",pause:"Pause",fastForward:"Forward {seektime}s",seek:"Seek",seekLabel:"{currentTime} of {duration}",played:"Played",buffered:"Buffered",currentTime:"Current time",duration:"Duration",volume:"Volume",mute:"Mute",unmute:"Unmute",enableCaptions:"Enable captions",disableCaptions:"Disable captions",download:"Download",enterFullscreen:"Enter fullscreen",exitFullscreen:"Exit fullscreen",frameTitle:"Player for {title}",captions:"Captions",settings:"Settings",pip:"PIP",menuBack:"Go back to previous menu",speed:"Speed",normal:"Normal",quality:"Quality",loop:"Loop",start:"Start",end:"End",all:"All",reset:"Reset",disabled:"Disabled",enabled:"Enabled",advertisement:"Ad",qualityBadge:{2160:"4K",1440:"HD",1080:"HD",720:"HD",576:"SD",480:"SD"}},urls:{download:null,vimeo:{sdk:"https://player.vimeo.com/api/player.js",iframe:"https://player.vimeo.com/video/{0}?{1}",api:"https://vimeo.com/api/oembed.json?url={0}"},youtube:{sdk:"https://www.youtube.com/iframe_api",api:"https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}"},googleIMA:{sdk:"https://imasdk.googleapis.com/js/sdkloader/ima3.js"}},listeners:{seek:null,play:null,pause:null,restart:null,rewind:null,fastForward:null,mute:null,volume:null,captions:null,download:null,fullscreen:null,pip:null,airplay:null,speed:null,quality:null,loop:null,language:null},events:["ended","progress","stalled","playing","waiting","canplay","canplaythrough","loadstart","loadeddata","loadedmetadata","timeupdate","volumechange","play","pause","error","seeking","seeked","emptied","ratechange","cuechange","download","enterfullscreen","exitfullscreen","captionsenabled","captionsdisabled","languagechange","controlshidden","controlsshown","ready","statechange","qualitychange","adsloaded","adscontentpause","adscontentresume","adstarted","adsmidpoint","adscomplete","adsallcomplete","adsimpression","adsclick"],selectors:{editable:"input, textarea, select, [contenteditable]",container:".plyr",controls:{container:null,wrapper:".plyr__controls"},labels:"[data-plyr]",buttons:{play:'[data-plyr="play"]',pause:'[data-plyr="pause"]',restart:'[data-plyr="restart"]',rewind:'[data-plyr="rewind"]',fastForward:'[data-plyr="fast-forward"]',mute:'[data-plyr="mute"]',captions:'[data-plyr="captions"]',download:'[data-plyr="download"]',fullscreen:'[data-plyr="fullscreen"]',pip:'[data-plyr="pip"]',airplay:'[data-plyr="airplay"]',settings:'[data-plyr="settings"]',loop:'[data-plyr="loop"]'},inputs:{seek:'[data-plyr="seek"]',volume:'[data-plyr="volume"]',speed:'[data-plyr="speed"]',language:'[data-plyr="language"]',quality:'[data-plyr="quality"]'},display:{currentTime:".plyr__time--current",duration:".plyr__time--duration",buffer:".plyr__progress__buffer",loop:".plyr__progress__loop",volume:".plyr__volume--display"},progress:".plyr__progress",captions:".plyr__captions",caption:".plyr__caption"},classNames:{type:"plyr--{0}",provider:"plyr--{0}",video:"plyr__video-wrapper",embed:"plyr__video-embed",videoFixedRatio:"plyr__video-wrapper--fixed-ratio",embedContainer:"plyr__video-embed__container",poster:"plyr__poster",posterEnabled:"plyr__poster-enabled",ads:"plyr__ads",control:"plyr__control",controlPressed:"plyr__control--pressed",playing:"plyr--playing",paused:"plyr--paused",stopped:"plyr--stopped",loading:"plyr--loading",hover:"plyr--hover",tooltip:"plyr__tooltip",cues:"plyr__cues",marker:"plyr__progress__marker",hidden:"plyr__sr-only",hideControls:"plyr--hide-controls",isTouch:"plyr--is-touch",uiSupported:"plyr--full-ui",noTransition:"plyr--no-transition",display:{time:"plyr__time"},menu:{value:"plyr__menu__value",badge:"plyr__badge",open:"plyr--menu-open"},captions:{enabled:"plyr--captions-enabled",active:"plyr--captions-active"},fullscreen:{enabled:"plyr--fullscreen-enabled",fallback:"plyr--fullscreen-fallback"},pip:{supported:"plyr--pip-supported",active:"plyr--pip-active"},airplay:{supported:"plyr--airplay-supported",active:"plyr--airplay-active"},previewThumbnails:{thumbContainer:"plyr__preview-thumb",thumbContainerShown:"plyr__preview-thumb--is-shown",imageContainer:"plyr__preview-thumb__image-container",timeContainer:"plyr__preview-thumb__time-container",scrubbingContainer:"plyr__preview-scrubbing",scrubbingContainerShown:"plyr__preview-scrubbing--is-shown"}},attributes:{embed:{provider:"data-plyr-provider",id:"data-plyr-embed-id",hash:"data-plyr-embed-hash"}},ads:{enabled:!1,publisherId:"",tagUrl:""},previewThumbnails:{enabled:!1,src:""},vimeo:{byline:!1,portrait:!1,title:!1,speed:!0,transparent:!1,customControls:!0,referrerPolicy:null,premium:!1},youtube:{rel:0,showinfo:0,iv_load_policy:3,modestbranding:1,customControls:!0,noCookie:!1},mediaMetadata:{title:"",artist:"",album:"",artwork:[]},markers:{enabled:!1,points:[]}},Ss={active:"picture-in-picture",inactive:"inline"},W2={html5:"html5",youtube:"youtube",vimeo:"vimeo"},Ms={audio:"audio",video:"video"};function s$(e){return/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(e)?W2.youtube:/^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)?W2.vimeo:null}const Bs=()=>{};class c${constructor(n=!1){this.enabled=window.console&&n,this.enabled&&this.log("Debugging enabled")}get log(){return this.enabled?Function.prototype.bind.call(console.log,console):Bs}get warn(){return this.enabled?Function.prototype.bind.call(console.warn,console):Bs}get error(){return this.enabled?Function.prototype.bind.call(console.error,console):Bs}}class r2{constructor(n){we(this,"onChange",()=>{if(!this.supported)return;const r=this.player.elements.buttons.fullscreen;N.element(r)&&(r.pressed=this.active);const i=this.target===this.player.media?this.target:this.player.elements.container;Oe.call(this.player,i,this.active?"enterfullscreen":"exitfullscreen",!0)}),we(this,"toggleFallback",(r=!1)=>{if(r?this.scrollPosition={x:window.scrollX??0,y:window.scrollY??0}:window.scrollTo(this.scrollPosition.x,this.scrollPosition.y),document.body.style.overflow=r?"hidden":"",Ye(this.target,this.player.config.classNames.fullscreen.fallback,r),b0.isIos){let i=document.head.querySelector('meta[name="viewport"]');const o="viewport-fit=cover";i||(i=document.createElement("meta"),i.setAttribute("name","viewport"));const l=N.string(i.content)&&i.content.includes(o);r?(this.cleanupViewport=!l,l||(i.content+=`,${o}`)):this.cleanupViewport&&(i.content=i.content.split(",").filter(s=>s.trim()!==o).join(","))}this.onChange()}),we(this,"trapFocus",r=>{if(b0.isIos||b0.isIPadOS||!this.active||r.key!=="Tab")return;const i=document.activeElement,o=x1.call(this.player,"a[href], button:not(:disabled), input:not(:disabled), [tabindex]"),[l]=o,s=o[o.length-1];i!==s||r.shiftKey?i===l&&r.shiftKey&&(s.focus(),r.preventDefault()):(l.focus(),r.preventDefault())}),we(this,"update",()=>{if(this.supported){let r;r=this.forceFallback?"Fallback (forced)":r2.nativeSupported?"Native":"Fallback",this.player.debug.log(`${r} fullscreen enabled`)}else this.player.debug.log("Fullscreen not supported and fallback disabled");Ye(this.player.elements.container,this.player.config.classNames.fullscreen.enabled,this.supported)}),we(this,"enter",()=>{this.supported&&(b0.isIos&&this.player.config.fullscreen.iosNative?this.player.isVimeo?this.player.embed.requestFullscreen():this.target.webkitEnterFullscreen():!r2.nativeSupported||this.forceFallback?this.toggleFallback(!0):this.prefix?N.empty(this.prefix)||this.target[`${this.prefix}Request${this.property}`]():this.target.requestFullscreen({navigationUI:"hide"}))}),we(this,"exit",()=>{if(this.supported)if(b0.isIos&&this.player.config.fullscreen.iosNative)this.player.isVimeo?this.player.embed.exitFullscreen():this.target.webkitEnterFullscreen(),C2(this.player.play());else if(!r2.nativeSupported||this.forceFallback)this.toggleFallback(!1);else if(this.prefix){if(!N.empty(this.prefix)){const r=this.prefix==="moz"?"Cancel":"Exit";document[`${this.prefix}${r}${this.property}`]()}}else(document.cancelFullScreen||document.exitFullscreen).call(document)}),we(this,"toggle",()=>{this.active?this.exit():this.enter()}),this.player=n,this.prefix=r2.prefix,this.property=r2.property,this.scrollPosition={x:0,y:0},this.forceFallback=n.config.fullscreen.fallback==="force",this.player.elements.fullscreen=n.config.fullscreen.container&&GP(this.player.elements.container,n.config.fullscreen.container),ze.call(this.player,document,this.prefix==="ms"?"MSFullscreenChange":`${this.prefix}fullscreenchange`,()=>{this.onChange()}),ze.call(this.player,this.player.elements.container,"dblclick",r=>{N.element(this.player.elements.controls)&&this.player.elements.controls.contains(r.target)||this.player.listeners.proxy(r,this.toggle,"fullscreen")}),ze.call(this,this.player.elements.container,"keydown",r=>this.trapFocus(r)),this.update()}static get nativeSupported(){return!!(document.fullscreenEnabled||document.webkitFullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled)}get useNative(){return r2.nativeSupported&&!this.forceFallback}static get prefix(){if(N.function(document.exitFullscreen))return"";let n="";return["webkit","moz","ms"].some(r=>!(!N.function(document[`${r}ExitFullscreen`])&&!N.function(document[`${r}CancelFullScreen`]))&&(n=r,!0)),n}static get property(){return this.prefix==="moz"?"FullScreen":"Fullscreen"}get supported(){return[this.player.config.fullscreen.enabled,this.player.isVideo,r2.nativeSupported||this.player.config.fullscreen.fallback,!this.player.isYouTube||r2.nativeSupported||!b0.isIos||this.player.config.playsinline&&!this.player.config.fullscreen.iosNative].every(Boolean)}get active(){if(!this.supported)return!1;if(!r2.nativeSupported||this.forceFallback)return zr(this.target,this.player.config.classNames.fullscreen.fallback);const n=this.prefix?this.target.getRootNode()[`${this.prefix}${this.property}Element`]:this.target.getRootNode().fullscreenElement;return n&&n.shadowRoot?n===this.target.getRootNode().host:n===this.target}get target(){return b0.isIos&&this.player.config.fullscreen.iosNative?this.player.media:this.player.elements.fullscreen??this.player.elements.container}}function Zr(e,n=1){return new Promise((r,i)=>{const o=new Image,l=()=>{delete o.onload,delete o.onerror,(o.naturalWidth>=n?r:i)(o)};Object.assign(o,{onload:l,onerror:l,src:e})})}const Je={addStyleHook(){Ye(this.elements.container,this.config.selectors.container.replace(".",""),!0),Ye(this.elements.container,this.config.classNames.uiSupported,this.supported.ui)},toggleNativeControls(e=!1){e&&this.isHTML5?this.media.setAttribute("controls",""):this.media.removeAttribute("controls")},build(){if(this.listeners.media(),!this.supported.ui)return this.debug.warn(`Basic support only for ${this.provider} ${this.type}`),void Je.toggleNativeControls.call(this,!0);N.element(this.elements.controls)||(pe.inject.call(this),this.listeners.controls()),Je.toggleNativeControls.call(this),this.isHTML5&&We.setup.call(this),this.volume=null,this.muted=null,this.loop=null,this.quality=null,this.speed=null,pe.updateVolume.call(this),pe.timeUpdate.call(this),pe.durationUpdate.call(this),Je.checkPlaying.call(this),Ye(this.elements.container,this.config.classNames.pip.supported,f0.pip&&this.isHTML5&&this.isVideo),Ye(this.elements.container,this.config.classNames.airplay.supported,f0.airplay&&this.isHTML5),Ye(this.elements.container,this.config.classNames.isTouch,this.touch),this.ready=!0,setTimeout(()=>{Oe.call(this,this.media,"ready")},0),Je.setTitle.call(this),this.poster&&Je.setPoster.call(this,this.poster,!1).catch(()=>{}),this.config.duration&&pe.durationUpdate.call(this),this.config.mediaMetadata&&pe.setMediaMetadata.call(this)},setTitle(){let e=x0.get("play",this.config);if(N.string(this.config.title)&&!N.empty(this.config.title)&&(e+=`, ${this.config.title}`),Array.from(this.elements.buttons.play||[]).forEach(n=>{n.setAttribute("aria-label",e)}),this.isEmbed){const n=y0.call(this,"iframe");if(!N.element(n))return;const r=N.empty(this.config.title)?"video":this.config.title,i=x0.get("frameTitle",this.config);n.setAttribute("title",i.replace("{title}",r))}},togglePoster(e){Ye(this.elements.container,this.config.classNames.posterEnabled,e)},setPoster(e,n=!0){return n&&this.poster?Promise.reject(new Error("Poster already set")):(this.media.setAttribute("data-poster",e),this.elements.poster.removeAttribute("hidden"),QP.call(this).then(()=>Zr(e)).catch(r=>{throw e===this.poster&&Je.togglePoster.call(this,!1),r}).then(()=>{if(e!==this.poster)throw new Error("setPoster cancelled by later call to setPoster")}).then(()=>(Object.assign(this.elements.poster.style,{backgroundImage:`url('${e}')`,backgroundSize:""}),Je.togglePoster.call(this,!0),e)))},checkPlaying(e){Ye(this.elements.container,this.config.classNames.playing,this.playing),Ye(this.elements.container,this.config.classNames.paused,this.paused),Ye(this.elements.container,this.config.classNames.stopped,this.stopped),Array.from(this.elements.buttons.play||[]).forEach(n=>{Object.assign(n,{pressed:this.playing}),n.setAttribute("aria-label",x0.get(this.playing?"pause":"play",this.config))}),N.event(e)&&e.type==="timeupdate"||Je.toggleControls.call(this)},checkLoading(e){this.loading=["stalled","waiting"].includes(e.type),clearTimeout(this.timers.loading),this.timers.loading=setTimeout(()=>{Ye(this.elements.container,this.config.classNames.loading,this.loading),Je.toggleControls.call(this)},this.loading?250:0)},toggleControls(e){const{controls:n}=this.elements;if(n&&this.config.hideControls){const r=this.touch&&this.lastSeekTime+2e3>Date.now();this.toggleControls(!!(e||this.loading||this.paused||n.pressed||n.hover||r))}},migrateStyles(){Object.values({...this.media.style}).filter(e=>!N.empty(e)&&N.string(e)&&e.startsWith("--plyr")).forEach(e=>{this.elements.container.style.setProperty(e,this.media.style.getPropertyValue(e)),this.media.style.removeProperty(e)}),N.empty(this.media.style)&&this.media.removeAttribute("style")}};class d${constructor(n){we(this,"firstTouch",()=>{const{player:r}=this,{elements:i}=r;r.touch=!0,Ye(i.container,r.config.classNames.isTouch,!0)}),we(this,"global",(r=!0)=>{const{player:i}=this;i.config.keyboard.global&&v1.call(i,window,"keydown keyup",this.handleKey,r,!1),v1.call(i,document.body,"click",this.toggleMenu,r),ks.call(i,document.body,"touchstart",this.firstTouch)}),we(this,"container",()=>{const{player:r}=this,{config:i,elements:o,timers:l}=r;!i.keyboard.global&&i.keyboard.focused&&ze.call(r,o.container,"keydown keyup",this.handleKey,!1),ze.call(r,o.container,"mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen",d=>{const{controls:u}=o;u&&d.type==="enterfullscreen"&&(u.pressed=!1,u.hover=!1);let h=0;["touchstart","touchmove","mousemove"].includes(d.type)&&(Je.toggleControls.call(r,!0),h=r.touch?3e3:2e3),clearTimeout(l.controls),l.controls=setTimeout(()=>Je.toggleControls.call(r,!1),h)});const s=()=>{if(!r.isVimeo||r.config.vimeo.premium)return;const d=o.wrapper,{active:u}=r.fullscreen,[h,p]=Ls.call(r),m=rh(`aspect-ratio: ${h} / ${p}`);if(!u)return void(m?(d.style.width=null,d.style.height=null):(d.style.maxWidth=null,d.style.margin=null));const[w,x]=JP(),b=w/x>h/p;m?(d.style.width=b?"auto":"100%",d.style.height=b?"100%":"auto"):(d.style.maxWidth=b?x/p*h+"px":null,d.style.margin=b?"0 auto":null)},c=()=>{clearTimeout(l.resized),l.resized=setTimeout(s,50)};ze.call(r,o.container,"enterfullscreen exitfullscreen",d=>{const{target:u}=r.fullscreen;u===o.container&&(!r.isEmbed&&N.empty(r.config.ratio)||(s(),(d.type==="enterfullscreen"?ze:Ur).call(r,window,"resize",c)))})}),we(this,"media",()=>{const{player:r}=this,{elements:i}=r;if(ze.call(r,r.media,"timeupdate seeking seeked",l=>pe.timeUpdate.call(r,l)),ze.call(r,r.media,"durationchange loadeddata loadedmetadata",l=>pe.durationUpdate.call(r,l)),ze.call(r,r.media,"ended",()=>{r.isHTML5&&r.isVideo&&r.config.resetOnEnd&&(r.restart(),r.pause())}),ze.call(r,r.media,"progress playing seeking seeked",l=>pe.updateProgress.call(r,l)),ze.call(r,r.media,"volumechange",l=>pe.updateVolume.call(r,l)),ze.call(r,r.media,"playing play pause ended emptied timeupdate",l=>Je.checkPlaying.call(r,l)),ze.call(r,r.media,"waiting canplay seeked playing",l=>Je.checkLoading.call(r,l)),r.supported.ui&&r.config.clickToPlay&&!r.isAudio){const l=y0.call(r,`.${r.config.classNames.video}`);if(!N.element(l))return;ze.call(r,i.container,"click",s=>{([i.container,l].includes(s.target)||l.contains(s.target))&&(r.touch&&r.config.hideControls||(r.ended?(this.proxy(s,r.restart,"restart"),this.proxy(s,()=>{C2(r.play())},"play")):this.proxy(s,()=>{C2(r.togglePlay())},"play")))})}r.supported.ui&&r.config.disableContextMenu&&ze.call(r,i.wrapper,"contextmenu",l=>{l.preventDefault()},!1),ze.call(r,r.media,"volumechange",()=>{r.storage.set({volume:r.volume,muted:r.muted})}),ze.call(r,r.media,"ratechange",()=>{pe.updateSetting.call(r,"speed"),r.storage.set({speed:r.speed})}),ze.call(r,r.media,"qualitychange",l=>{pe.updateSetting.call(r,"quality",null,l.detail.quality)}),ze.call(r,r.media,"ready qualitychange",()=>{pe.setDownloadUrl.call(r)});const o=r.config.events.concat(["keyup","keydown"]).join(" ");ze.call(r,r.media,o,l=>{let{detail:s={}}=l;l.type==="error"&&(s=r.media.error),Oe.call(r,i.container,l.type,!0,s)})}),we(this,"proxy",(r,i,o)=>{const{player:l}=this,s=l.config.listeners[o];let c=!0;N.function(s)&&(c=s.call(l,r)),c!==!1&&N.function(i)&&i.call(l,r)}),we(this,"bind",(r,i,o,l,s=!0)=>{const{player:c}=this,d=c.config.listeners[l],u=N.function(d);ze.call(c,r,i,h=>this.proxy(h,o,l),s&&!u)}),we(this,"controls",()=>{const{player:r}=this,{elements:i}=r,o=b0.isIE?"change":"input";if(i.buttons.play&&Array.from(i.buttons.play).forEach(l=>{this.bind(l,"click",()=>{C2(r.togglePlay())},"play")}),this.bind(i.buttons.restart,"click",r.restart,"restart"),this.bind(i.buttons.rewind,"click",()=>{r.lastSeekTime=Date.now(),r.rewind()},"rewind"),this.bind(i.buttons.fastForward,"click",()=>{r.lastSeekTime=Date.now(),r.forward()},"fastForward"),this.bind(i.buttons.mute,"click",()=>{r.muted=!r.muted},"mute"),this.bind(i.buttons.captions,"click",()=>r.toggleCaptions()),this.bind(i.buttons.download,"click",()=>{Oe.call(r,r.media,"download")},"download"),this.bind(i.buttons.fullscreen,"click",()=>{r.fullscreen.toggle()},"fullscreen"),this.bind(i.buttons.pip,"click",()=>{r.pip="toggle"},"pip"),this.bind(i.buttons.airplay,"click",r.airplay,"airplay"),this.bind(i.buttons.settings,"click",l=>{l.stopPropagation(),l.preventDefault(),pe.toggleMenu.call(r,l)},null,!1),this.bind(i.buttons.settings,"keyup",l=>{[" ","Enter"].includes(l.key)&&(l.key!=="Enter"?(l.preventDefault(),l.stopPropagation(),pe.toggleMenu.call(r,l)):pe.focusFirstMenuItem.call(r,null,!0))},null,!1),this.bind(i.settings.menu,"keydown",l=>{l.key==="Escape"&&pe.toggleMenu.call(r,l)}),this.bind(i.inputs.seek,"mousedown mousemove",l=>{const s=i.progress.getBoundingClientRect(),c=100/s.width*(l.pageX-s.left);l.currentTarget.setAttribute("seek-value",c)}),this.bind(i.inputs.seek,"mousedown mouseup keydown keyup touchstart touchend",l=>{const s=l.currentTarget,c="play-on-seeked";if(N.keyboardEvent(l)&&!["ArrowLeft","ArrowRight"].includes(l.key))return;r.lastSeekTime=Date.now();const d=s.hasAttribute(c),u=["mouseup","touchend","keyup"].includes(l.type);d&&u?(s.removeAttribute(c),C2(r.play())):!u&&r.playing&&(s.setAttribute(c,""),r.pause())}),b0.isIos){const l=x1.call(r,'input[type="range"]');Array.from(l).forEach(s=>this.bind(s,o,c=>Ku(c.target)))}this.bind(i.inputs.seek,o,l=>{const s=l.currentTarget;let c=s.getAttribute("seek-value");N.empty(c)&&(c=s.value),s.removeAttribute("seek-value"),r.currentTime=c/s.max*r.duration},"seek"),this.bind(i.progress,"mouseenter mouseleave mousemove",l=>pe.updateSeekTooltip.call(r,l)),this.bind(i.progress,"mousemove touchmove",l=>{const{previewThumbnails:s}=r;s&&s.loaded&&s.startMove(l)}),this.bind(i.progress,"mouseleave touchend click",()=>{const{previewThumbnails:l}=r;l&&l.loaded&&l.endMove(!1,!0)}),this.bind(i.progress,"mousedown touchstart",l=>{const{previewThumbnails:s}=r;s&&s.loaded&&s.startScrubbing(l)}),this.bind(i.progress,"mouseup touchend",l=>{const{previewThumbnails:s}=r;s&&s.loaded&&s.endScrubbing(l)}),b0.isWebKit&&Array.from(x1.call(r,'input[type="range"]')).forEach(l=>{this.bind(l,"input",s=>pe.updateRangeFill.call(r,s.target))}),r.config.toggleInvert&&!N.element(i.display.duration)&&this.bind(i.display.currentTime,"click",()=>{r.currentTime!==0&&(r.config.invertTime=!r.config.invertTime,pe.timeUpdate.call(r))}),this.bind(i.inputs.volume,o,l=>{r.volume=l.target.value},"volume"),this.bind(i.controls,"mouseenter mouseleave",l=>{i.controls.hover=!r.touch&&l.type==="mouseenter"}),i.fullscreen&&Array.from(i.fullscreen.children).filter(l=>!l.contains(i.container)).forEach(l=>{this.bind(l,"mouseenter mouseleave",s=>{i.controls&&(i.controls.hover=!r.touch&&s.type==="mouseenter")})}),this.bind(i.controls,"mousedown mouseup touchstart touchend touchcancel",l=>{i.controls.pressed=["mousedown","touchstart"].includes(l.type)}),this.bind(i.controls,"focusin",()=>{const{config:l,timers:s}=r;Ye(i.controls,l.classNames.noTransition,!0),Je.toggleControls.call(r,!0),setTimeout(()=>{Ye(i.controls,l.classNames.noTransition,!1)},0);const c=this.touch?3e3:4e3;clearTimeout(s.controls),s.controls=setTimeout(()=>Je.toggleControls.call(r,!1),c)}),this.bind(i.inputs.volume,"wheel",l=>{const s=l.webkitDirectionInvertedFromDevice,[c,d]=[l.deltaX,-l.deltaY].map(p=>s?-p:p),u=Math.sign(Math.abs(c)>Math.abs(d)?c:d);r.increaseVolume(u/50);const{volume:h}=r.media;(u===1&&h<1||u===-1&&h>0)&&l.preventDefault()},"volume",!1)}),this.player=n,this.lastKey=null,this.focusTimer=null,this.lastKeyDown=null,this.handleKey=this.handleKey.bind(this),this.toggleMenu=this.toggleMenu.bind(this),this.firstTouch=this.firstTouch.bind(this)}handleKey(n){const{player:r}=this,{elements:i}=r,{key:o,type:l,altKey:s,ctrlKey:c,metaKey:d,shiftKey:u}=n,h=l==="keydown",p=h&&o===this.lastKey;if(!(s||c||d||u)&&o){if(h){const w=document.activeElement;if(N.element(w)){const{editable:x}=r.config.selectors,{seek:b}=i.inputs;if(w!==b&&mt(w,x)||n.key===" "&&mt(w,'button, [role^="menuitem"]'))return}switch([" ","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","0","1","2","3","4","5","6","7","8","9","c","f","k","l","m"].includes(o)&&(n.preventDefault(),n.stopPropagation()),o){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":p||(m=parseInt(o,10),r.currentTime=r.duration/10*m);break;case" ":case"k":p||C2(r.togglePlay());break;case"ArrowUp":r.increaseVolume(.1);break;case"ArrowDown":r.decreaseVolume(.1);break;case"m":p||(r.muted=!r.muted);break;case"ArrowRight":r.forward();break;case"ArrowLeft":r.rewind();break;case"f":r.fullscreen.toggle();break;case"c":p||r.toggleCaptions();break;case"l":r.loop=!r.loop}o==="Escape"&&!r.fullscreen.usingNative&&r.fullscreen.active&&r.fullscreen.toggle(),this.lastKey=o}else this.lastKey=null;var m}}toggleMenu(n){pe.toggleMenu.call(this.player,n)}}function u$(e,n){return e(n={exports:{}},n.exports),n.exports}var h$=u$(function(e,n){e.exports=function(){var r=function(){},i={},o={},l={};function s(m,w){m=m.push?m:[m];var x,b,v,C=[],y=m.length,_=y;for(x=function(L,T){T.length&&C.push(L),--_||w(C)};y--;)b=m[y],(v=o[b])?x(b,v):(l[b]=l[b]||[]).push(x)}function c(m,w){if(m){var x=l[m];if(o[m]=w,x)for(;x.length;)x[0](m,w),x.splice(0,1)}}function d(m,w){m.call&&(m={success:m}),w.length?(m.error||r)(w):(m.success||r)(m)}function u(m,w,x,b){var v,C,y=document,_=x.async,L=(x.numRetries||0)+1,T=x.before||r,q=m.replace(/[\?|#].*$/,""),$=m.replace(/^(css|img)!/,"");b=b||0,/(^css!|\.css$)/.test(q)?((C=y.createElement("link")).rel="stylesheet",C.href=$,(v="hideFocus"in C)&&C.relList&&(v=0,C.rel="preload",C.as="style")):/(^img!|\.(png|gif|jpg|svg|webp)$)/.test(q)?(C=y.createElement("img")).src=$:((C=y.createElement("script")).src=m,C.async=_===void 0||_),C.onload=C.onerror=C.onbeforeload=function(F){var R=F.type[0];if(v)try{C.sheet.cssText.length||(R="e")}catch(Z){Z.code!=18&&(R="e")}if(R=="e"){if((b+=1)<L)return u(m,w,x,b)}else if(C.rel=="preload"&&C.as=="style")return C.rel="stylesheet";w(m,R,F.defaultPrevented)},T(m,C)!==!1&&y.head.appendChild(C)}function h(m,w,x){var b,v,C=(m=m.push?m:[m]).length,y=C,_=[];for(b=function(L,T,q){if(T=="e"&&_.push(L),T=="b"){if(!q)return;_.push(L)}--C||w(_)},v=0;v<y;v++)u(m[v],b,x)}function p(m,w,x){var b,v;if(w&&w.trim&&(b=w),v=(b?x:w)||{},b){if(b in i)throw"LoadJS";i[b]=!0}function C(y,_){h(m,function(L){d(v,L),y&&d({success:y,error:_},L),c(b,L)},v)}if(v.returnPromise)return new Promise(C);C()}return p.ready=function(m,w){return s(m,function(x){d(w,x)}),p},p.done=function(m){c(m,[])},p.reset=function(){i={},o={},l={}},p.isDefined=function(m){return m in i},p}()});function Ts(e){return new Promise((n,r)=>{h$(e,{success:n,error:r})})}function f$(e){return N.empty(e)?null:N.number(Number(e))?e:e.match(/^.*(vimeo.com\/|video\/)(\d+).*/)?RegExp.$2:e}function p$(e){const n=e.match(/^.*(vimeo.com\/|video\/)(\d+)(\?.*&*h=|\/)+([\d,a-f]+)/);return n&&n.length===5?n[4]:null}function L1(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,Oe.call(this,this.media,e?"play":"pause"))}const Ns={setup(){const e=this;Ye(e.elements.wrapper,e.config.classNames.embed,!0),e.options.speed=e.config.speed.options,Ft.call(e),N.object(window.Vimeo)?Ns.ready.call(e):Ts(e.config.urls.vimeo.sdk).then(()=>{Ns.ready.call(e)}).catch(n=>{e.debug.warn("Vimeo SDK (player.js) failed to load",n)})},ready(){const e=this,n=e.config.vimeo,{premium:r,referrerPolicy:i,...o}=n;let l=e.media.getAttribute("src"),s="";N.empty(l)?(l=e.media.getAttribute(e.config.attributes.embed.id),s=e.media.getAttribute(e.config.attributes.embed.hash)):s=p$(l);const c=s?{h:s}:{};r&&Object.assign(o,{controls:!1,sidedock:!1});const d=uh({loop:e.config.loop.active,autoplay:e.autoplay,muted:e.muted,gesture:"media",playsinline:e.config.playsinline,...c,...o}),u=f$(l),h=De("iframe"),p=As(e.config.urls.vimeo.iframe,u,d);if(h.setAttribute("src",p),h.setAttribute("allowfullscreen",""),h.setAttribute("allow",["autoplay","fullscreen","picture-in-picture","encrypted-media","accelerometer","gyroscope"].join("; ")),N.empty(i)||h.setAttribute("referrerPolicy",i),r||!n.customControls)h.setAttribute("data-poster",e.poster),e.media=qr(h,e.media);else{const y=De("div",{class:e.config.classNames.embedContainer,"data-poster":e.poster});y.appendChild(h),e.media=qr(y,e.media)}n.customControls||E1(As(e.config.urls.vimeo.api,p)).then(y=>{!N.empty(y)&&y.thumbnail_url&&Je.setPoster.call(e,y.thumbnail_url).catch(()=>{})}),e.embed=new window.Vimeo.Player(h,{autopause:e.config.autopause,muted:e.muted}),e.media.paused=!0,e.media.currentTime=0,e.supported.ui&&e.embed.disableTextTrack(),e.media.play=()=>(L1.call(e,!0),e.embed.play()),e.media.pause=()=>(L1.call(e,!1),e.embed.pause()),e.media.stop=()=>{e.pause(),e.currentTime=0};let{currentTime:m}=e.media;Object.defineProperty(e.media,"currentTime",{get:()=>m,set(y){const{embed:_,media:L,paused:T,volume:q}=e,$=T&&!_.hasPlayed;L.seeking=!0,Oe.call(e,L,"seeking"),Promise.resolve($&&_.setVolume(0)).then(()=>_.setCurrentTime(y)).then(()=>$&&_.pause()).then(()=>$&&_.setVolume(q)).catch(()=>{})}});let w=e.config.speed.selected;Object.defineProperty(e.media,"playbackRate",{get:()=>w,set(y){e.embed.setPlaybackRate(y).then(()=>{w=y,Oe.call(e,e.media,"ratechange")}).catch(()=>{e.options.speed=[1]})}});let{volume:x}=e.config;Object.defineProperty(e.media,"volume",{get:()=>x,set(y){e.embed.setVolume(y).then(()=>{x=y,Oe.call(e,e.media,"volumechange")})}});let{muted:b}=e.config;Object.defineProperty(e.media,"muted",{get:()=>b,set(y){const _=!!N.boolean(y)&&y;e.embed.setMuted(!!_||e.config.muted).then(()=>{b=_,Oe.call(e,e.media,"volumechange")})}});let v,{loop:C}=e.config;Object.defineProperty(e.media,"loop",{get:()=>C,set(y){const _=N.boolean(y)?y:e.config.loop.active;e.embed.setLoop(_).then(()=>{C=_})}}),e.embed.getVideoUrl().then(y=>{v=y,pe.setDownloadUrl.call(e)}).catch(y=>{this.debug.warn(y)}),Object.defineProperty(e.media,"currentSrc",{get:()=>v}),Object.defineProperty(e.media,"ended",{get:()=>e.currentTime===e.duration}),Promise.all([e.embed.getVideoWidth(),e.embed.getVideoHeight()]).then(y=>{const[_,L]=y;e.embed.ratio=ih(_,L),Ft.call(this)}),e.embed.setAutopause(e.config.autopause).then(y=>{e.config.autopause=y}),e.embed.getVideoTitle().then(y=>{e.config.title=y,Je.setTitle.call(this)}),e.embed.getCurrentTime().then(y=>{m=y,Oe.call(e,e.media,"timeupdate")}),e.embed.getDuration().then(y=>{e.media.duration=y,Oe.call(e,e.media,"durationchange")}),e.embed.getTextTracks().then(y=>{e.media.textTracks=y,We.setup.call(e)}),e.embed.on("cuechange",({cues:y=[]})=>{const _=y.map(L=>a$(L.text));We.updateCues.call(e,_)}),e.embed.on("loaded",()=>{e.embed.getPaused().then(y=>{L1.call(e,!y),y||Oe.call(e,e.media,"playing")}),N.element(e.embed.element)&&e.supported.ui&&e.embed.element.setAttribute("tabindex",-1)}),e.embed.on("bufferstart",()=>{Oe.call(e,e.media,"waiting")}),e.embed.on("bufferend",()=>{Oe.call(e,e.media,"playing")}),e.embed.on("play",()=>{L1.call(e,!0),Oe.call(e,e.media,"playing")}),e.embed.on("pause",()=>{L1.call(e,!1)}),e.embed.on("timeupdate",y=>{e.media.seeking=!1,m=y.seconds,Oe.call(e,e.media,"timeupdate")}),e.embed.on("progress",y=>{e.media.buffered=y.percent,Oe.call(e,e.media,"progress"),parseInt(y.percent,10)===1&&Oe.call(e,e.media,"canplaythrough"),e.embed.getDuration().then(_=>{_!==e.media.duration&&(e.media.duration=_,Oe.call(e,e.media,"durationchange"))})}),e.embed.on("seeked",()=>{e.media.seeking=!1,Oe.call(e,e.media,"seeked")}),e.embed.on("ended",()=>{e.media.paused=!0,Oe.call(e,e.media,"ended")}),e.embed.on("error",y=>{e.media.error=y,Oe.call(e,e.media,"error")}),n.customControls&&setTimeout(()=>Je.build.call(e),0)}};function m$(e){return N.empty(e)?null:e.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/)?RegExp.$2:e}function A1(e){e&&!this.embed.hasPlayed&&(this.embed.hasPlayed=!0),this.media.paused===e&&(this.media.paused=!e,Oe.call(this,this.media,e?"play":"pause"))}function g$(e){return e.noCookie?"https://www.youtube-nocookie.com":window.location.protocol==="http:"?"http://www.youtube.com":void 0}const Yr={setup(){if(Ye(this.elements.wrapper,this.config.classNames.embed,!0),N.object(window.YT)&&N.function(window.YT.Player))Yr.ready.call(this);else{const e=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{N.function(e)&&e(),Yr.ready.call(this)},Ts(this.config.urls.youtube.sdk).catch(n=>{this.debug.warn("YouTube API failed to load",n)})}},getTitle(e){E1(As(this.config.urls.youtube.api,e)).then(n=>{if(N.object(n)){const{title:r,height:i,width:o}=n;this.config.title=r,Je.setTitle.call(this),this.embed.ratio=ih(o,i)}Ft.call(this)}).catch(()=>{Ft.call(this)})},ready(){const e=this,n=e.config.youtube,r=e.media&&e.media.getAttribute("id");if(!N.empty(r)&&r.startsWith("youtube-"))return;let i=e.media.getAttribute("src");N.empty(i)&&(i=e.media.getAttribute(this.config.attributes.embed.id));const o=m$(i),l=De("div",{id:e$(e.provider),"data-poster":n.customControls?e.poster:void 0});if(e.media=qr(l,e.media),n.customControls){const s=c=>`https://i.ytimg.com/vi/${o}/${c}default.jpg`;Zr(s("maxres"),121).catch(()=>Zr(s("sd"),121)).catch(()=>Zr(s("hq"))).then(c=>Je.setPoster.call(e,c.src)).then(c=>{c.includes("maxres")||(e.elements.poster.style.backgroundSize="cover")}).catch(()=>{})}e.embed=new window.YT.Player(e.media,{videoId:o,host:g$(n),playerVars:h0({},{autoplay:e.config.autoplay?1:0,hl:e.config.hl,controls:e.supported.ui&&n.customControls?0:1,disablekb:1,playsinline:e.config.playsinline&&!e.config.fullscreen.iosNative?1:0,cc_load_policy:e.captions.active?1:0,cc_lang_pref:e.config.captions.language,widget_referrer:window?window.location.href:null},n),events:{onError(s){if(!e.media.error){const c=s.data,d={2:"The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.",5:"The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.",100:"The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.",101:"The owner of the requested video does not allow it to be played in embedded players.",150:"The owner of the requested video does not allow it to be played in embedded players."}[c]||"An unknown error occurred";e.media.error={code:c,message:d},Oe.call(e,e.media,"error")}},onPlaybackRateChange(s){const c=s.target;e.media.playbackRate=c.getPlaybackRate(),Oe.call(e,e.media,"ratechange")},onReady(s){if(N.function(e.media.play))return;const c=s.target;Yr.getTitle.call(e,o),e.media.play=()=>{A1.call(e,!0),c.playVideo()},e.media.pause=()=>{A1.call(e,!1),c.pauseVideo()},e.media.stop=()=>{c.stopVideo()},e.media.duration=c.getDuration(),e.media.paused=!0,e.media.currentTime=0,Object.defineProperty(e.media,"currentTime",{get:()=>Number(c.getCurrentTime()),set(p){e.paused&&!e.embed.hasPlayed&&e.embed.mute(),e.media.seeking=!0,Oe.call(e,e.media,"seeking"),c.seekTo(p)}}),Object.defineProperty(e.media,"playbackRate",{get:()=>c.getPlaybackRate(),set(p){c.setPlaybackRate(p)}});let{volume:d}=e.config;Object.defineProperty(e.media,"volume",{get:()=>d,set(p){d=p,c.setVolume(100*d),Oe.call(e,e.media,"volumechange")}});let{muted:u}=e.config;Object.defineProperty(e.media,"muted",{get:()=>u,set(p){const m=N.boolean(p)?p:u;u=m,c[m?"mute":"unMute"](),c.setVolume(100*d),Oe.call(e,e.media,"volumechange")}}),Object.defineProperty(e.media,"currentSrc",{get:()=>c.getVideoUrl()}),Object.defineProperty(e.media,"ended",{get:()=>e.currentTime===e.duration});const h=c.getAvailablePlaybackRates();e.options.speed=h.filter(p=>e.config.speed.options.includes(p)),e.supported.ui&&n.customControls&&e.media.setAttribute("tabindex",-1),Oe.call(e,e.media,"timeupdate"),Oe.call(e,e.media,"durationchange"),clearInterval(e.timers.buffering),e.timers.buffering=setInterval(()=>{e.media.buffered=c.getVideoLoadedFraction(),(e.media.lastBuffered===null||e.media.lastBuffered<e.media.buffered)&&Oe.call(e,e.media,"progress"),e.media.lastBuffered=e.media.buffered,e.media.buffered===1&&(clearInterval(e.timers.buffering),Oe.call(e,e.media,"canplaythrough"))},200),n.customControls&&setTimeout(()=>Je.build.call(e),50)},onStateChange(s){const c=s.target;switch(clearInterval(e.timers.playing),e.media.seeking&&[1,2].includes(s.data)&&(e.media.seeking=!1,Oe.call(e,e.media,"seeked")),s.data){case-1:Oe.call(e,e.media,"timeupdate"),e.media.buffered=c.getVideoLoadedFraction(),Oe.call(e,e.media,"progress");break;case 0:A1.call(e,!1),e.media.loop?(c.stopVideo(),c.playVideo()):Oe.call(e,e.media,"ended");break;case 1:n.customControls&&!e.config.autoplay&&e.media.paused&&!e.embed.hasPlayed?e.media.pause():(A1.call(e,!0),Oe.call(e,e.media,"playing"),e.timers.playing=setInterval(()=>{Oe.call(e,e.media,"timeupdate")},50),e.media.duration!==c.getDuration()&&(e.media.duration=c.getDuration(),Oe.call(e,e.media,"durationchange")));break;case 2:e.muted||e.embed.unMute(),A1.call(e,!1);break;case 3:Oe.call(e,e.media,"waiting")}Oe.call(e,e.elements.container,"statechange",!1,{code:s.data})}}})}},fh={setup(){this.media?(Ye(this.elements.container,this.config.classNames.type.replace("{0}",this.type),!0),Ye(this.elements.container,this.config.classNames.provider.replace("{0}",this.provider),!0),this.isEmbed&&Ye(this.elements.container,this.config.classNames.type.replace("{0}","video"),!0),this.isVideo&&(this.elements.wrapper=De("div",{class:this.config.classNames.video}),Qu(this.media,this.elements.wrapper),this.elements.poster=De("div",{class:this.config.classNames.poster}),this.elements.wrapper.appendChild(this.elements.poster)),this.isHTML5?j2.setup.call(this):this.isYouTube?Yr.setup.call(this):this.isVimeo&&Ns.setup.call(this)):this.debug.warn("No media element found!")}};class y${constructor(n){we(this,"load",()=>{this.enabled&&(N.object(window.google)&&N.object(window.google.ima)?this.ready():Ts(this.player.config.urls.googleIMA.sdk).then(()=>{this.ready()}).catch(()=>{this.trigger("error",new Error("Google IMA SDK failed to load"))}))}),we(this,"ready",()=>{var r;this.enabled||((r=this).manager&&r.manager.destroy(),r.elements.displayContainer&&r.elements.displayContainer.destroy(),r.elements.container.remove()),this.startSafetyTimer(12e3,"ready()"),this.managerPromise.then(()=>{this.clearSafetyTimer("onAdsManagerLoaded()")}),this.listeners(),this.setupIMA()}),we(this,"setupIMA",()=>{this.elements.container=De("div",{class:this.player.config.classNames.ads}),this.player.elements.container.appendChild(this.elements.container),google.ima.settings.setVpaidMode(google.ima.ImaSdkSettings.VpaidMode.ENABLED),google.ima.settings.setLocale(this.player.config.ads.language),google.ima.settings.setDisableCustomPlaybackForIOS10Plus(this.player.config.playsinline),this.elements.displayContainer=new google.ima.AdDisplayContainer(this.elements.container,this.player.media),this.loader=new google.ima.AdsLoader(this.elements.displayContainer),this.loader.addEventListener(google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,r=>this.onAdsManagerLoaded(r),!1),this.loader.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,r=>this.onAdError(r),!1),this.requestAds()}),we(this,"requestAds",()=>{const{container:r}=this.player.elements;try{const i=new google.ima.AdsRequest;i.adTagUrl=this.tagUrl,i.linearAdSlotWidth=r.offsetWidth,i.linearAdSlotHeight=r.offsetHeight,i.nonLinearAdSlotWidth=r.offsetWidth,i.nonLinearAdSlotHeight=r.offsetHeight,i.forceNonLinearFullSlot=!1,i.setAdWillPlayMuted(!this.player.muted),this.loader.requestAds(i)}catch(i){this.onAdError(i)}}),we(this,"pollCountdown",(r=!1)=>{if(!r)return clearInterval(this.countdownTimer),void this.elements.container.removeAttribute("data-badge-text");this.countdownTimer=setInterval(()=>{const i=Wr(Math.max(this.manager.getRemainingTime(),0)),o=`${x0.get("advertisement",this.player.config)} - ${i}`;this.elements.container.setAttribute("data-badge-text",o)},100)}),we(this,"onAdsManagerLoaded",r=>{if(!this.enabled)return;const i=new google.ima.AdsRenderingSettings;i.restoreCustomPlaybackStateOnAdBreakComplete=!0,i.enablePreloading=!0,this.manager=r.getAdsManager(this.player,i),this.cuePoints=this.manager.getCuePoints(),this.manager.addEventListener(google.ima.AdErrorEvent.Type.AD_ERROR,o=>this.onAdError(o)),Object.keys(google.ima.AdEvent.Type).forEach(o=>{this.manager.addEventListener(google.ima.AdEvent.Type[o],l=>this.onAdEvent(l))}),this.trigger("loaded")}),we(this,"addCuePoints",()=>{N.empty(this.cuePoints)||this.cuePoints.forEach(r=>{if(r!==0&&r!==-1&&r<this.player.duration){const i=this.player.elements.progress;if(N.element(i)){const o=100/this.player.duration*r,l=De("span",{class:this.player.config.classNames.cues});l.style.left=`${o.toString()}%`,i.appendChild(l)}}})}),we(this,"onAdEvent",r=>{const{container:i}=this.player.elements,o=r.getAd(),l=r.getAdData();switch((s=>{Oe.call(this.player,this.player.media,`ads${s.replace(/_/g,"").toLowerCase()}`)})(r.type),r.type){case google.ima.AdEvent.Type.LOADED:this.trigger("loaded"),this.pollCountdown(!0),o.isLinear()||(o.width=i.offsetWidth,o.height=i.offsetHeight);break;case google.ima.AdEvent.Type.STARTED:this.manager.setVolume(this.player.volume);break;case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:this.player.ended?this.loadAds():this.loader.contentComplete();break;case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:this.pauseContent();break;case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:this.pollCountdown(),this.resumeContent();break;case google.ima.AdEvent.Type.LOG:l.adError&&this.player.debug.warn(`Non-fatal ad error: ${l.adError.getMessage()}`)}}),we(this,"onAdError",r=>{this.cancel(),this.player.debug.warn("Ads error",r)}),we(this,"listeners",()=>{const{container:r}=this.player.elements;let i;this.player.on("canplay",()=>{this.addCuePoints()}),this.player.on("ended",()=>{this.loader.contentComplete()}),this.player.on("timeupdate",()=>{i=this.player.currentTime}),this.player.on("seeked",()=>{const o=this.player.currentTime;N.empty(this.cuePoints)||this.cuePoints.forEach((l,s)=>{i<l&&l<o&&(this.manager.discardAdBreak(),this.cuePoints.splice(s,1))})}),window.addEventListener("resize",()=>{this.manager&&this.manager.resize(r.offsetWidth,r.offsetHeight,google.ima.ViewMode.NORMAL)})}),we(this,"play",()=>{const{container:r}=this.player.elements;this.managerPromise||this.resumeContent(),this.managerPromise.then(()=>{this.manager.setVolume(this.player.volume),this.elements.displayContainer.initialize();try{this.initialized||(this.manager.init(r.offsetWidth,r.offsetHeight,google.ima.ViewMode.NORMAL),this.manager.start()),this.initialized=!0}catch(i){this.onAdError(i)}}).catch(()=>{})}),we(this,"resumeContent",()=>{this.elements.container.style.zIndex="",this.playing=!1,C2(this.player.media.play())}),we(this,"pauseContent",()=>{this.elements.container.style.zIndex=3,this.playing=!0,this.player.media.pause()}),we(this,"cancel",()=>{this.initialized&&this.resumeContent(),this.trigger("error"),this.loadAds()}),we(this,"loadAds",()=>{this.managerPromise.then(()=>{this.manager&&this.manager.destroy(),this.managerPromise=new Promise(r=>{this.on("loaded",r),this.player.debug.log(this.manager)}),this.initialized=!1,this.requestAds()}).catch(()=>{})}),we(this,"trigger",(r,...i)=>{const o=this.events[r];N.array(o)&&o.forEach(l=>{N.function(l)&&l.apply(this,i)})}),we(this,"on",(r,i)=>(N.array(this.events[r])||(this.events[r]=[]),this.events[r].push(i),this)),we(this,"startSafetyTimer",(r,i)=>{this.player.debug.log(`Safety timer invoked from: ${i}`),this.safetyTimer=setTimeout(()=>{this.cancel(),this.clearSafetyTimer("startSafetyTimer()")},r)}),we(this,"clearSafetyTimer",r=>{N.nullOrUndefined(this.safetyTimer)||(this.player.debug.log(`Safety timer cleared from: ${r}`),clearTimeout(this.safetyTimer),this.safetyTimer=null)}),this.player=n,this.config=n.config.ads,this.playing=!1,this.initialized=!1,this.elements={container:null,displayContainer:null},this.manager=null,this.loader=null,this.cuePoints=null,this.events={},this.safetyTimer=null,this.countdownTimer=null,this.managerPromise=new Promise((r,i)=>{this.on("loaded",r),this.on("error",i)}),this.load()}get enabled(){const{config:n}=this;return this.player.isHTML5&&this.player.isVideo&&n.enabled&&(!N.empty(n.publisherId)||N.url(n.tagUrl))}get tagUrl(){const{config:n}=this;return N.url(n.tagUrl)?n.tagUrl:`https://go.aniview.com/api/adserver6/vast/?${uh({AV_PUBLISHERID:"58c25bb0073ef448b1087ad6",AV_CHANNELID:"5a0458dc28a06145e4519d21",AV_URL:window.location.hostname,cb:Date.now(),AV_WIDTH:640,AV_HEIGHT:480,AV_CDIM2:n.publisherId})}`}}function ph(e=0,n=0,r=255){return Math.min(Math.max(e,n),r)}const w$=e=>{const n=[];return e.split(/\r\n\r\n|\n\n|\r\r/).forEach(r=>{const i={};r.split(/\r\n|\n|\r/).forEach(o=>{if(N.number(i.startTime)){if(!N.empty(o.trim())&&N.empty(i.text)){const l=o.trim().split("#xywh=");[i.text]=l,l[1]&&([i.x,i.y,i.w,i.h]=l[1].split(","))}}else{const l=o.match(/([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})( ?--> ?)([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})/);l&&(i.startTime=60*Number(l[1]||0)*60+60*Number(l[2])+Number(l[3])+ +`0.${l[4]}`,i.endTime=60*Number(l[6]||0)*60+60*Number(l[7])+Number(l[8])+ +`0.${l[9]}`)}}),i.text&&n.push(i)}),n},mh=(e,n)=>{const r={};return e>n.width/n.height?(r.width=n.width,r.height=1/e*n.width):(r.height=n.height,r.width=e*n.height),r};class Ds{constructor(n){we(this,"load",()=>{this.player.elements.display.seekTooltip&&(this.player.elements.display.seekTooltip.hidden=this.enabled),this.enabled&&this.getThumbnails().then(()=>{this.enabled&&(this.render(),this.determineContainerAutoSizing(),this.listeners(),this.loaded=!0)})}),we(this,"getThumbnails",()=>new Promise(r=>{const{src:i}=this.player.config.previewThumbnails;if(N.empty(i))throw new Error("Missing previewThumbnails.src config attribute");const o=()=>{this.thumbnails.sort((l,s)=>l.height-s.height),this.player.debug.log("Preview thumbnails",this.thumbnails),r()};if(N.function(i))i(l=>{this.thumbnails=l,o()});else{const l=(N.string(i)?[i]:i).map(s=>this.getThumbnail(s));Promise.all(l).then(o)}})),we(this,"getThumbnail",r=>new Promise(i=>{E1(r).then(o=>{const l={frames:w$(o),height:null,urlPrefix:""};l.frames[0].text.startsWith("/")||l.frames[0].text.startsWith("http://")||l.frames[0].text.startsWith("https://")||(l.urlPrefix=r.substring(0,r.lastIndexOf("/")+1));const s=new Image;s.onload=()=>{l.height=s.naturalHeight,l.width=s.naturalWidth,this.thumbnails.push(l),i()},s.src=l.urlPrefix+l.frames[0].text})})),we(this,"startMove",r=>{if(this.loaded&&N.event(r)&&["touchmove","mousemove"].includes(r.type)&&this.player.media.duration){if(r.type==="touchmove")this.seekTime=this.player.media.duration*(this.player.elements.inputs.seek.value/100);else{var i,o;const l=this.player.elements.progress.getBoundingClientRect(),s=100/l.width*(r.pageX-l.left);this.seekTime=this.player.media.duration*(s/100),this.seekTime<0&&(this.seekTime=0),this.seekTime>this.player.media.duration-1&&(this.seekTime=this.player.media.duration-1),this.mousePosX=r.pageX,this.elements.thumb.time.innerText=Wr(this.seekTime);const c=(i=this.player.config.markers)===null||i===void 0||(o=i.points)===null||o===void 0?void 0:o.find(({time:d})=>d===Math.round(this.seekTime));c&&this.elements.thumb.time.insertAdjacentHTML("afterbegin",`${c.label}<br>`)}this.showImageAtCurrentTime()}}),we(this,"endMove",()=>{this.toggleThumbContainer(!1,!0)}),we(this,"startScrubbing",r=>{(N.nullOrUndefined(r.button)||r.button===!1||r.button===0)&&(this.mouseDown=!0,this.player.media.duration&&(this.toggleScrubbingContainer(!0),this.toggleThumbContainer(!1,!0),this.showImageAtCurrentTime()))}),we(this,"endScrubbing",()=>{this.mouseDown=!1,Math.ceil(this.lastTime)===Math.ceil(this.player.media.currentTime)?this.toggleScrubbingContainer(!1):ks.call(this.player,this.player.media,"timeupdate",()=>{this.mouseDown||this.toggleScrubbingContainer(!1)})}),we(this,"listeners",()=>{this.player.on("play",()=>{this.toggleThumbContainer(!1,!0)}),this.player.on("seeked",()=>{this.toggleThumbContainer(!1)}),this.player.on("timeupdate",()=>{this.lastTime=this.player.media.currentTime})}),we(this,"render",()=>{this.elements.thumb.container=De("div",{class:this.player.config.classNames.previewThumbnails.thumbContainer}),this.elements.thumb.imageContainer=De("div",{class:this.player.config.classNames.previewThumbnails.imageContainer}),this.elements.thumb.container.appendChild(this.elements.thumb.imageContainer);const r=De("div",{class:this.player.config.classNames.previewThumbnails.timeContainer});this.elements.thumb.time=De("span",{},"00:00"),r.appendChild(this.elements.thumb.time),this.elements.thumb.imageContainer.appendChild(r),N.element(this.player.elements.progress)&&this.player.elements.progress.appendChild(this.elements.thumb.container),this.elements.scrubbing.container=De("div",{class:this.player.config.classNames.previewThumbnails.scrubbingContainer}),this.player.elements.wrapper.appendChild(this.elements.scrubbing.container)}),we(this,"destroy",()=>{this.elements.thumb.container&&this.elements.thumb.container.remove(),this.elements.scrubbing.container&&this.elements.scrubbing.container.remove()}),we(this,"showImageAtCurrentTime",()=>{this.mouseDown?this.setScrubbingContainerSize():this.setThumbContainerSizeAndPos();const r=this.thumbnails[0].frames.findIndex(l=>this.seekTime>=l.startTime&&this.seekTime<=l.endTime),i=r>=0;let o=0;this.mouseDown||this.toggleThumbContainer(i),i&&(this.thumbnails.forEach((l,s)=>{this.loadedImages.includes(l.frames[r].text)&&(o=s)}),r!==this.showingThumb&&(this.showingThumb=r,this.loadImage(o)))}),we(this,"loadImage",(r=0)=>{const i=this.showingThumb,o=this.thumbnails[r],{urlPrefix:l}=o,s=o.frames[i],c=o.frames[i].text,d=l+c;if(this.currentImageElement&&this.currentImageElement.dataset.filename===c)this.showImage(this.currentImageElement,s,r,i,c,!1),this.currentImageElement.dataset.index=i,this.removeOldImages(this.currentImageElement);else{this.loadingImage&&this.usingSprites&&(this.loadingImage.onload=null);const u=new Image;u.src=d,u.dataset.index=i,u.dataset.filename=c,this.showingThumbFilename=c,this.player.debug.log(`Loading image: ${d}`),u.onload=()=>this.showImage(u,s,r,i,c,!0),this.loadingImage=u,this.removeOldImages(u)}}),we(this,"showImage",(r,i,o,l,s,c=!0)=>{this.player.debug.log(`Showing thumb: ${s}. num: ${l}. qual: ${o}. newimg: ${c}`),this.setImageSizeAndOffset(r,i),c&&(this.currentImageContainer.appendChild(r),this.currentImageElement=r,this.loadedImages.includes(s)||this.loadedImages.push(s)),this.preloadNearby(l,!0).then(this.preloadNearby(l,!1)).then(this.getHigherQuality(o,r,i,s))}),we(this,"removeOldImages",r=>{Array.from(this.currentImageContainer.children).forEach(i=>{if(i.tagName.toLowerCase()!=="img")return;const o=this.usingSprites?500:1e3;if(i.dataset.index!==r.dataset.index&&!i.dataset.deleting){i.dataset.deleting=!0;const{currentImageContainer:l}=this;setTimeout(()=>{l.removeChild(i),this.player.debug.log(`Removing thumb: ${i.dataset.filename}`)},o)}})}),we(this,"preloadNearby",(r,i=!0)=>new Promise(o=>{setTimeout(()=>{const l=this.thumbnails[0].frames[r].text;if(this.showingThumbFilename===l){let s;s=i?this.thumbnails[0].frames.slice(r):this.thumbnails[0].frames.slice(0,r).reverse();let c=!1;s.forEach(d=>{const u=d.text;if(u!==l&&!this.loadedImages.includes(u)){c=!0,this.player.debug.log(`Preloading thumb filename: ${u}`);const{urlPrefix:h}=this.thumbnails[0],p=h+u,m=new Image;m.src=p,m.onload=()=>{this.player.debug.log(`Preloaded thumb filename: ${u}`),this.loadedImages.includes(u)||this.loadedImages.push(u),o()}}}),c||o()}},300)})),we(this,"getHigherQuality",(r,i,o,l)=>{if(r<this.thumbnails.length-1){let s=i.naturalHeight;this.usingSprites&&(s=o.h),s<this.thumbContainerHeight&&setTimeout(()=>{this.showingThumbFilename===l&&(this.player.debug.log(`Showing higher quality thumb for: ${l}`),this.loadImage(r+1))},300)}}),we(this,"toggleThumbContainer",(r=!1,i=!1)=>{const o=this.player.config.classNames.previewThumbnails.thumbContainerShown;this.elements.thumb.container.classList.toggle(o,r),!r&&i&&(this.showingThumb=null,this.showingThumbFilename=null)}),we(this,"toggleScrubbingContainer",(r=!1)=>{const i=this.player.config.classNames.previewThumbnails.scrubbingContainerShown;this.elements.scrubbing.container.classList.toggle(i,r),r||(this.showingThumb=null,this.showingThumbFilename=null)}),we(this,"determineContainerAutoSizing",()=>{(this.elements.thumb.imageContainer.clientHeight>20||this.elements.thumb.imageContainer.clientWidth>20)&&(this.sizeSpecifiedInCSS=!0)}),we(this,"setThumbContainerSizeAndPos",()=>{const{imageContainer:r}=this.elements.thumb;if(this.sizeSpecifiedInCSS){if(r.clientHeight>20&&r.clientWidth<20){const i=Math.floor(r.clientHeight*this.thumbAspectRatio);r.style.width=`${i}px`}else if(r.clientHeight<20&&r.clientWidth>20){const i=Math.floor(r.clientWidth/this.thumbAspectRatio);r.style.height=`${i}px`}}else{const i=Math.floor(this.thumbContainerHeight*this.thumbAspectRatio);r.style.height=`${this.thumbContainerHeight}px`,r.style.width=`${i}px`}this.setThumbContainerPos()}),we(this,"setThumbContainerPos",()=>{const r=this.player.elements.progress.getBoundingClientRect(),i=this.player.elements.container.getBoundingClientRect(),{container:o}=this.elements.thumb,l=i.left-r.left+10,s=i.right-r.left-o.clientWidth-10,c=this.mousePosX-r.left-o.clientWidth/2,d=ph(c,l,s);o.style.left=`${d}px`,o.style.setProperty("--preview-arrow-offset",c-d+"px")}),we(this,"setScrubbingContainerSize",()=>{const{width:r,height:i}=mh(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});this.elements.scrubbing.container.style.width=`${r}px`,this.elements.scrubbing.container.style.height=`${i}px`}),we(this,"setImageSizeAndOffset",(r,i)=>{if(!this.usingSprites)return;const o=this.thumbContainerHeight/i.h;r.style.height=r.naturalHeight*o+"px",r.style.width=r.naturalWidth*o+"px",r.style.left=`-${i.x*o}px`,r.style.top=`-${i.y*o}px`}),this.player=n,this.thumbnails=[],this.loaded=!1,this.lastMouseMoveTime=Date.now(),this.mouseDown=!1,this.loadedImages=[],this.elements={thumb:{},scrubbing:{}},this.load()}get enabled(){return this.player.isHTML5&&this.player.isVideo&&this.player.config.previewThumbnails.enabled}get currentImageContainer(){return this.mouseDown?this.elements.scrubbing.container:this.elements.thumb.imageContainer}get usingSprites(){return Object.keys(this.thumbnails[0].frames[0]).includes("w")}get thumbAspectRatio(){return this.usingSprites?this.thumbnails[0].frames[0].w/this.thumbnails[0].frames[0].h:this.thumbnails[0].width/this.thumbnails[0].height}get thumbContainerHeight(){if(this.mouseDown){const{height:n}=mh(this.thumbAspectRatio,{width:this.player.media.clientWidth,height:this.player.media.clientHeight});return n}return this.sizeSpecifiedInCSS?this.elements.thumb.imageContainer.clientHeight:Math.floor(this.player.media.clientWidth/this.thumbAspectRatio/4)}get currentImageElement(){return this.mouseDown?this.currentScrubbingImageElement:this.currentThumbnailImageElement}set currentImageElement(n){this.mouseDown?this.currentScrubbingImageElement=n:this.currentThumbnailImageElement=n}}const Os={insertElements(e,n){N.string(n)?Ju(e,this.media,{src:n}):N.array(n)&&n.forEach(r=>{Ju(e,this.media,r)})},change(e){Xu(e,"sources.length")?(j2.cancelRequests.call(this),this.destroy.call(this,()=>{this.options.quality=[],O2(this.media),this.media=null,N.element(this.elements.container)&&this.elements.container.removeAttribute("class");const{sources:n,type:r}=e,[{provider:i=W2.html5,src:o}]=n,l=i==="html5"?r:"div",s=i==="html5"?{}:{src:o};Object.assign(this,{provider:i,type:r,supported:f0.check(r,i,this.config.playsinline),media:De(l,s)}),this.elements.container.appendChild(this.media),N.boolean(e.autoplay)&&(this.config.autoplay=e.autoplay),this.isHTML5&&(this.config.crossorigin&&this.media.setAttribute("crossorigin",""),this.config.autoplay&&this.media.setAttribute("autoplay",""),N.empty(e.poster)||(this.poster=e.poster),this.config.loop.active&&this.media.setAttribute("loop",""),this.config.muted&&this.media.setAttribute("muted",""),this.config.playsinline&&this.media.setAttribute("playsinline","")),Je.addStyleHook.call(this),this.isHTML5&&Os.insertElements.call(this,"source",n),this.config.title=e.title,fh.setup.call(this),this.isHTML5&&Object.keys(e).includes("tracks")&&Os.insertElements.call(this,"track",e.tracks),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&Je.build.call(this),this.isHTML5&&this.media.load(),N.empty(e.previewThumbnails)||(Object.assign(this.config.previewThumbnails,e.previewThumbnails),this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new Ds(this))),this.fullscreen.update()},!0)):this.debug.warn("Invalid source format")}};class S1{constructor(n,r){if(we(this,"play",()=>N.function(this.media.play)?(this.ads&&this.ads.enabled&&this.ads.managerPromise.then(()=>this.ads.play()).catch(()=>C2(this.media.play())),this.media.play()):null),we(this,"pause",()=>this.playing&&N.function(this.media.pause)?this.media.pause():null),we(this,"togglePlay",c=>(N.boolean(c)?c:!this.playing)?this.play():this.pause()),we(this,"stop",()=>{this.isHTML5?(this.pause(),this.restart()):N.function(this.media.stop)&&this.media.stop()}),we(this,"restart",()=>{this.currentTime=0}),we(this,"rewind",c=>{this.currentTime-=N.number(c)?c:this.config.seekTime}),we(this,"forward",c=>{this.currentTime+=N.number(c)?c:this.config.seekTime}),we(this,"increaseVolume",c=>{const d=this.media.muted?0:this.volume;this.volume=d+(N.number(c)?c:0)}),we(this,"decreaseVolume",c=>{this.increaseVolume(-c)}),we(this,"airplay",()=>{f0.airplay&&this.media.webkitShowPlaybackTargetPicker()}),we(this,"toggleControls",c=>{if(this.supported.ui&&!this.isAudio){const d=zr(this.elements.container,this.config.classNames.hideControls),u=c===void 0?void 0:!c,h=Ye(this.elements.container,this.config.classNames.hideControls,u);if(h&&N.array(this.config.controls)&&this.config.controls.includes("settings")&&!N.empty(this.config.settings)&&pe.toggleMenu.call(this,!1),h!==d){const p=h?"controlshidden":"controlsshown";Oe.call(this,this.media,p)}return!h}return!1}),we(this,"on",(c,d)=>{ze.call(this,this.elements.container,c,d)}),we(this,"once",(c,d)=>{ks.call(this,this.elements.container,c,d)}),we(this,"off",(c,d)=>{Ur(this.elements.container,c,d)}),we(this,"destroy",(c,d=!1)=>{if(!this.ready)return;const u=()=>{document.body.style.overflow="",this.embed=null,d?(Object.keys(this.elements).length&&(O2(this.elements.buttons.play),O2(this.elements.captions),O2(this.elements.controls),O2(this.elements.wrapper),this.elements.buttons.play=null,this.elements.captions=null,this.elements.controls=null,this.elements.wrapper=null),N.function(c)&&c()):(XP.call(this),j2.cancelRequests.call(this),qr(this.elements.original,this.elements.container),Oe.call(this,this.elements.original,"destroyed",!0),N.function(c)&&c.call(this.elements.original),this.ready=!1,setTimeout(()=>{this.elements=null,this.media=null},200))};this.stop(),clearTimeout(this.timers.loading),clearTimeout(this.timers.controls),clearTimeout(this.timers.resized),this.isHTML5?(Je.toggleNativeControls.call(this,!0),u()):this.isYouTube?(clearInterval(this.timers.buffering),clearInterval(this.timers.playing),this.embed!==null&&N.function(this.embed.destroy)&&this.embed.destroy(),u()):this.isVimeo&&(this.embed!==null&&this.embed.unload().then(u),setTimeout(u,200))}),we(this,"supports",c=>f0.mime.call(this,c)),this.timers={},this.ready=!1,this.loading=!1,this.failed=!1,this.touch=f0.touch,this.media=n,N.string(this.media)&&(this.media=document.querySelectorAll(this.media)),(window.jQuery&&this.media instanceof jQuery||N.nodeList(this.media)||N.array(this.media))&&(this.media=this.media[0]),this.config=h0({},hh,S1.defaults,r||{},(()=>{try{return JSON.parse(this.media.getAttribute("data-plyr-config"))}catch{return{}}})()),this.elements={container:null,fullscreen:null,captions:null,buttons:{},display:{},progress:{},inputs:{},settings:{popup:null,menu:null,panels:{},buttons:{}}},this.captions={active:null,currentTrack:-1,meta:new WeakMap},this.fullscreen={active:!1},this.options={speed:[],quality:[]},this.debug=new c$(this.config.debug),this.debug.log("Config",this.config),this.debug.log("Support",f0),N.nullOrUndefined(this.media)||!N.element(this.media))return void this.debug.error("Setup failed: no suitable element passed");if(this.media.plyr)return void this.debug.warn("Target already setup");if(!this.config.enabled)return void this.debug.error("Setup failed: disabled by config");if(!f0.check().api)return void this.debug.error("Setup failed: no support");const i=this.media.cloneNode(!0);i.autoplay=!1,this.elements.original=i;const o=this.media.tagName.toLowerCase();let l=null,s=null;switch(o){case"div":if(l=this.media.querySelector("iframe"),N.element(l)){if(s=dh(l.getAttribute("src")),this.provider=s$(s.toString()),this.elements.container=this.media,this.media=l,this.elements.container.className="",s.search.length){const c=["1","true"];c.includes(s.searchParams.get("autoplay"))&&(this.config.autoplay=!0),c.includes(s.searchParams.get("loop"))&&(this.config.loop.active=!0),this.isYouTube?(this.config.playsinline=c.includes(s.searchParams.get("playsinline")),this.config.youtube.hl=s.searchParams.get("hl")):this.config.playsinline=!0}}else this.provider=this.media.getAttribute(this.config.attributes.embed.provider),this.media.removeAttribute(this.config.attributes.embed.provider);if(N.empty(this.provider)||!Object.values(W2).includes(this.provider))return void this.debug.error("Setup failed: Invalid provider");this.type=Ms.video;break;case"video":case"audio":this.type=o,this.provider=W2.html5,this.media.hasAttribute("crossorigin")&&(this.config.crossorigin=!0),this.media.hasAttribute("autoplay")&&(this.config.autoplay=!0),(this.media.hasAttribute("playsinline")||this.media.hasAttribute("webkit-playsinline"))&&(this.config.playsinline=!0),this.media.hasAttribute("muted")&&(this.config.muted=!0),this.media.hasAttribute("loop")&&(this.config.loop.active=!0);break;default:return void this.debug.error("Setup failed: unsupported type")}this.supported=f0.check(this.type,this.provider),this.supported.api?(this.eventListeners=[],this.listeners=new d$(this),this.storage=new k1(this),this.media.plyr=this,N.element(this.elements.container)||(this.elements.container=De("div"),Qu(this.media,this.elements.container)),Je.migrateStyles.call(this),Je.addStyleHook.call(this),fh.setup.call(this),this.config.debug&&ze.call(this,this.elements.container,this.config.events.join(" "),c=>{this.debug.log(`event: ${c.type}`)}),this.fullscreen=new r2(this),(this.isHTML5||this.isEmbed&&!this.supported.ui)&&Je.build.call(this),this.listeners.container(),this.listeners.global(),this.config.ads.enabled&&(this.ads=new y$(this)),this.isHTML5&&this.config.autoplay&&this.once("canplay",()=>C2(this.play())),this.lastSeekTime=0,this.config.previewThumbnails.enabled&&(this.previewThumbnails=new Ds(this))):this.debug.error("Setup failed: no support")}get isHTML5(){return this.provider===W2.html5}get isEmbed(){return this.isYouTube||this.isVimeo}get isYouTube(){return this.provider===W2.youtube}get isVimeo(){return this.provider===W2.vimeo}get isVideo(){return this.type===Ms.video}get isAudio(){return this.type===Ms.audio}get playing(){return!!(this.ready&&!this.paused&&!this.ended)}get paused(){return!!this.media.paused}get stopped(){return!!(this.paused&&this.currentTime===0)}get ended(){return!!this.media.ended}set currentTime(n){if(!this.duration)return;const r=N.number(n)&&n>0;this.media.currentTime=r?Math.min(n,this.duration):0,this.debug.log(`Seeking to ${this.currentTime} seconds`)}get currentTime(){return Number(this.media.currentTime)}get buffered(){const{buffered:n}=this.media;return N.number(n)?n:n&&n.length&&this.duration>0?n.end(0)/this.duration:0}get seeking(){return!!this.media.seeking}get duration(){const n=parseFloat(this.config.duration),r=(this.media||{}).duration,i=N.number(r)&&r!==1/0?r:0;return n||i}set volume(n){let r=n;N.string(r)&&(r=Number(r)),N.number(r)||(r=this.storage.get("volume")),N.number(r)||({volume:r}=this.config),r>1&&(r=1),r<0&&(r=0),this.config.volume=r,this.media.volume=r,!N.empty(n)&&this.muted&&r>0&&(this.muted=!1)}get volume(){return Number(this.media.volume)}set muted(n){let r=n;N.boolean(r)||(r=this.storage.get("muted")),N.boolean(r)||(r=this.config.muted),this.config.muted=r,this.media.muted=r}get muted(){return!!this.media.muted}get hasAudio(){return!this.isHTML5||!!this.isAudio||!!this.media.mozHasAudio||!!this.media.webkitAudioDecodedByteCount||!!(this.media.audioTracks&&this.media.audioTracks.length)}set speed(n){let r=null;N.number(n)&&(r=n),N.number(r)||(r=this.storage.get("speed")),N.number(r)||(r=this.config.speed.selected);const{minimumSpeed:i,maximumSpeed:o}=this;r=ph(r,i,o),this.config.speed.selected=r,setTimeout(()=>{this.media&&(this.media.playbackRate=r)},0)}get speed(){return Number(this.media.playbackRate)}get minimumSpeed(){return this.isYouTube?Math.min(...this.options.speed):this.isVimeo?.5:.0625}get maximumSpeed(){return this.isYouTube?Math.max(...this.options.speed):this.isVimeo?2:16}set quality(n){const r=this.config.quality,i=this.options.quality;if(!i.length)return;let o=[!N.empty(n)&&Number(n),this.storage.get("quality"),r.selected,r.default].find(N.number),l=!0;if(!i.includes(o)){const s=th(i,o);this.debug.warn(`Unsupported quality option: ${o}, using ${s} instead`),o=s,l=!1}r.selected=o,this.media.quality=o,l&&this.storage.set({quality:o})}get quality(){return this.media.quality}set loop(n){const r=N.boolean(n)?n:this.config.loop.active;this.config.loop.active=r,this.media.loop=r}get loop(){return!!this.media.loop}set source(n){Os.change.call(this,n)}get source(){return this.media.currentSrc}get download(){const{download:n}=this.config.urls;return N.url(n)?n:this.source}set download(n){N.url(n)&&(this.config.urls.download=n,pe.setDownloadUrl.call(this))}set poster(n){this.isVideo?Je.setPoster.call(this,n,!1).catch(()=>{}):this.debug.warn("Poster can only be set for video")}get poster(){return this.isVideo?this.media.getAttribute("poster")||this.media.getAttribute("data-poster"):null}get ratio(){if(!this.isVideo)return null;const n=jr(Ls.call(this));return N.array(n)?n.join(":"):n}set ratio(n){this.isVideo?N.string(n)&&ah(n)?(this.config.ratio=jr(n),Ft.call(this)):this.debug.error(`Invalid aspect ratio specified (${n})`):this.debug.warn("Aspect ratio can only be set for video")}set autoplay(n){this.config.autoplay=N.boolean(n)?n:this.config.autoplay}get autoplay(){return!!this.config.autoplay}toggleCaptions(n){We.toggle.call(this,n,!1)}set currentTrack(n){We.set.call(this,n,!1),We.setup.call(this)}get currentTrack(){const{toggled:n,currentTrack:r}=this.captions;return n?r:-1}set language(n){We.setLanguage.call(this,n,!1)}get language(){return(We.getCurrentTrack.call(this)||{}).language}set pip(n){if(!f0.pip)return;const r=N.boolean(n)?n:!this.pip;N.function(this.media.webkitSetPresentationMode)&&this.media.webkitSetPresentationMode(r?Ss.active:Ss.inactive),N.function(this.media.requestPictureInPicture)&&(!this.pip&&r?this.media.requestPictureInPicture():this.pip&&!r&&document.exitPictureInPicture())}get pip(){return f0.pip?N.empty(this.media.webkitPresentationMode)?this.media===document.pictureInPictureElement:this.media.webkitPresentationMode===Ss.active:null}setPreviewThumbnails(n){this.previewThumbnails&&this.previewThumbnails.loaded&&(this.previewThumbnails.destroy(),this.previewThumbnails=null),Object.assign(this.config.previewThumbnails,n),this.config.previewThumbnails.enabled&&(this.previewThumbnails=new Ds(this))}static supported(n,r){return f0.check(n,r)}static loadSprite(n,r){return sh(n,r)}static setup(n,r={}){let i=null;return N.string(n)?i=Array.from(document.querySelectorAll(n)):N.nodeList(n)?i=Array.from(n):N.array(n)&&(i=n.filter(N.element)),N.empty(i)?null:i.map(o=>new S1(o,r))}}S1.defaults=ZP(hh);const C$=Object.freeze(Object.defineProperty({__proto__:null,default:S1},Symbol.toStringTag,{value:"Module"}));return pP});
|