hx-live-client-plus 1.0.58 → 1.0.59
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/lib/assets/addressBook/add.png +0 -0
- package/lib/assets/addressBook/search.png +0 -0
- package/lib/assets/addressBook/tradd.png +0 -0
- package/lib/assets/addressBook/trmin.png +0 -0
- package/lib/assets/addressBook/user.png +0 -0
- package/lib/assets/audio/README.txt +2 -0
- package/lib/assets/font/PingFang-Medium.ttf +0 -0
- package/lib/assets/img/entry/add_icon.png +0 -0
- package/lib/assets/img/entry/audio_level_icon.png +0 -0
- package/lib/assets/img/entry/empty_logo.png +0 -0
- package/lib/assets/img/entry/entry_logo.png +0 -0
- package/lib/assets/img/entry/icon_date.png +0 -0
- package/lib/assets/img/entry/icon_more.png +0 -0
- package/lib/assets/img/entry/icon_room.png +0 -0
- package/lib/assets/img/entry/join_dialog_logo.png +0 -0
- package/lib/assets/img/entry/join_icon.png +0 -0
- package/lib/assets/img/entry/launch_dialog_logo.png +0 -0
- package/lib/assets/img/entry/launch_icon.png +0 -0
- package/lib/assets/img/entry/preview_dialog_logo.png +0 -0
- package/lib/assets/img/entry/preview_icon.png +0 -0
- package/lib/assets/img/entry/video_bg.png +0 -0
- package/lib/assets/img/index/avatar.png +0 -0
- package/lib/assets/img/index/bgc.png +0 -0
- package/lib/assets/img/index/jt.png +0 -0
- package/lib/assets/img/index/jx.png +0 -0
- package/lib/assets/img/index/kg.png +0 -0
- package/lib/assets/img/index/logo.png +0 -0
- package/lib/assets/img/index/mkf.png +0 -0
- package/lib/assets/img/index/sjt.png +0 -0
- package/lib/assets/img/index/sxt.png +0 -0
- package/lib/assets/img/index/tex.png +0 -0
- package/lib/assets/img/index/tx.png +0 -0
- package/lib/assets/img/index/xtx.png +0 -0
- package/lib/assets/img/index/yq.png +0 -0
- package/lib/assets/img/meeting/board-bg.png +0 -0
- package/lib/assets/img/meeting/btn_icon_call.png +0 -0
- package/lib/assets/img/meeting/btn_icon_mini.png +0 -0
- package/lib/assets/img/meeting/call_board_icon.png +0 -0
- package/lib/assets/img/meeting/camera-off-large.png +0 -0
- package/lib/assets/img/meeting/camera-off-small.png +0 -0
- package/lib/assets/img/meeting/camera-on-large.png +0 -0
- package/lib/assets/img/meeting/camera-on-small.png +0 -0
- package/lib/assets/img/meeting/chat-large.png +0 -0
- package/lib/assets/img/meeting/chat.png +0 -0
- package/lib/assets/img/meeting/check-icon.png +0 -0
- package/lib/assets/img/meeting/checked_icon.png +0 -0
- package/lib/assets/img/meeting/clock.png +0 -0
- package/lib/assets/img/meeting/close.png +0 -0
- package/lib/assets/img/meeting/copy-icon.png +0 -0
- package/lib/assets/img/meeting/des-ava.png +0 -0
- package/lib/assets/img/meeting/emoji-logo.png +0 -0
- package/lib/assets/img/meeting/invite.png +0 -0
- package/lib/assets/img/meeting/layout-active-logo.png +0 -0
- package/lib/assets/img/meeting/layout-active1.png +0 -0
- package/lib/assets/img/meeting/layout-active2.png +0 -0
- package/lib/assets/img/meeting/layout-active3.png +0 -0
- package/lib/assets/img/meeting/layout-active4.png +0 -0
- package/lib/assets/img/meeting/layout-logo.png +0 -0
- package/lib/assets/img/meeting/layout1.png +0 -0
- package/lib/assets/img/meeting/layout2.png +0 -0
- package/lib/assets/img/meeting/layout3.png +0 -0
- package/lib/assets/img/meeting/layout4.png +0 -0
- package/lib/assets/img/meeting/member-large.png +0 -0
- package/lib/assets/img/meeting/member.png +0 -0
- package/lib/assets/img/meeting/mic-off-large.png +0 -0
- package/lib/assets/img/meeting/mic-off-small.png +0 -0
- package/lib/assets/img/meeting/mic-on-large.png +0 -0
- package/lib/assets/img/meeting/mic-on-small.png +0 -0
- package/lib/assets/img/meeting/more.png +0 -0
- package/lib/assets/img/meeting/more_icon.png +0 -0
- package/lib/assets/img/meeting/pic-logo.png +0 -0
- package/lib/assets/img/meeting/record.png +0 -0
- package/lib/assets/img/meeting/screen.png +0 -0
- package/lib/assets/img/meeting/search-input-icon.png +0 -0
- package/lib/assets/img/meeting/send-logo.png +0 -0
- package/lib/assets/img/meeting/setting.png +0 -0
- package/lib/assets/img/meeting/share.png +0 -0
- package/lib/assets/img/meeting/signal.png +0 -0
- package/lib/assets/img/meeting/signal_good.png +0 -0
- package/lib/assets/img/meeting/signal_poor.png +0 -0
- package/lib/assets/img/meeting/theme_logo.png +0 -0
- package/lib/assets/img/meeting/to-bottom.png +0 -0
- package/lib/assets/img/meeting/to-top.png +0 -0
- package/lib/assets/img/multi/add.png +0 -0
- package/lib/assets/img/multi/add_user_icon.png +0 -0
- package/lib/assets/img/multi/close_icon.png +0 -0
- package/lib/assets/img/multi/item_close.png +0 -0
- package/lib/assets/img/multi/join_icon.png +0 -0
- package/lib/assets/img/multi/launch_icon.png +0 -0
- package/lib/assets/img/multi/preview_icon.png +0 -0
- package/lib/assets/img/multi/quick_icon.png +0 -0
- package/lib/assets/img/multi/screen_icon.png +0 -0
- package/lib/assets/img/multi/search.png +0 -0
- package/lib/assets/img/multi/tree_expand.png +0 -0
- package/lib/assets/img/multi/tree_slide.png +0 -0
- package/lib/assets/img/multi/user.png +0 -0
- package/lib/assets/img/point/avatar_icon.png +0 -0
- package/lib/assets/img/point/cam-off.png +0 -0
- package/lib/assets/img/point/cam-on.png +0 -0
- package/lib/assets/img/point/cancel_icon.png +0 -0
- package/lib/assets/img/point/clear_icon.png +0 -0
- package/lib/assets/img/point/close_icon.png +0 -0
- package/lib/assets/img/point/duration_icon.png +0 -0
- package/lib/assets/img/point/full_screen_icon.png +0 -0
- package/lib/assets/img/point/hang_off_icon.png +0 -0
- package/lib/assets/img/point/hang_on_icon.png +0 -0
- package/lib/assets/img/point/mic-mini-on.png +0 -0
- package/lib/assets/img/point/mic-off.png +0 -0
- package/lib/assets/img/point/mic-on.png +0 -0
- package/lib/assets/img/point/mini_icon.png +0 -0
- package/lib/assets/img/point/preview_icon.png +0 -0
- package/lib/assets/img/point/share_icon.png +0 -0
- package/lib/assets/img/point/speaker-off.png +0 -0
- package/lib/assets/img/point/speaker-on.png +0 -0
- package/lib/assets/img/point/tx.png +0 -0
- package/lib/assets/img/point/video_icon.png +0 -0
- package/lib/assets/img/point/voice_icon.png +0 -0
- package/lib/favicon.ico +0 -0
- package/lib/hx-live-client-plus.css +1 -0
- package/lib/hx-live-client-plus.js +65331 -0
- package/lib/hx-live-client-plus.umd.cjs +384 -0
- package/package.json +1 -1
@@ -0,0 +1,384 @@
|
|
1
|
+
(function(di,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],l):(di=typeof globalThis<"u"?globalThis:di||self,l(di.hxLiveClientPlus={},di.Vue))})(this,function(di,l){"use strict";const Yg=i=>{let e,t,n,r=Math.floor(i%3600);return Math.floor(i/3600)>0?e=Math.floor(i/3600)<=9?"0"+Math.floor(i/3600):Math.floor(i/3600):e="00",Math.floor(r/60)>0?t=Math.floor(r/60)<=9?"0"+Math.floor(r/60):Math.floor(r/60):t="00",Math.floor(r%60)>0?n=Math.floor(r%60)<=9?"0"+Math.floor(r%60):Math.floor(r%60):n="00",`${e}:${t}:${n}`},hx=(i=16)=>{let e=String(new Date().getTime());const t="0123456789";for(let n=0;n<=i-e.length;n++){const r=Math.floor(Math.random()*t.length);e+=t[r]}return e},fx=(i,e)=>typeof window.getComputedStyle<"u"?window.getComputedStyle(i,null)[e]:typeof i.currentStyle!="undefiend"?i.currentStyle[e]:"",px=(i,e,t)=>{e===""?t(new Error("请输入手机号")):/^1[345789]\d{9}$/.test(e)?t():t(new Error("请输入正确手机号"))},mx='a[href],button:not([disabled]),button:not([hidden]),:not([tabindex="-1"]),input:not([disabled]),input:not([type="hidden"]),select:not([disabled]),textarea:not([disabled])',gx=i=>process.env.NODE_ENV==="test"?!0:getComputedStyle(i).position==="fixed"?!1:i.offsetParent!==null,Jg=i=>Array.from(i.querySelectorAll(mx)).filter(e=>vx(e)&&gx(e)),vx=i=>{if(i.tabIndex>0||i.tabIndex===0&&i.getAttribute("tabIndex")!==null)return!0;if(i.disabled)return!1;switch(i.nodeName){case"A":return!!i.href&&i.rel!=="ignore";case"INPUT":return!(i.type==="hidden"||i.type==="file");case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}};var Qg;const zn=typeof window<"u",yx=i=>typeof i=="string",bx=()=>{};zn&&((Qg=window==null?void 0:window.navigator)!=null&&Qg.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function fh(i){return typeof i=="function"?i():l.unref(i)}function _x(i){return i}function ph(i){return l.getCurrentScope()?(l.onScopeDispose(i),!0):!1}function kx(i,e=!0){l.getCurrentInstance()?l.onMounted(i):e?i():l.nextTick(i)}function Tx(i,e,t={}){const{immediate:n=!0}=t,r=l.ref(!1);let s=null;function a(){s&&(clearTimeout(s),s=null)}function o(){r.value=!1,a()}function c(...u){a(),r.value=!0,s=setTimeout(()=>{r.value=!1,s=null,i(...u)},fh(e))}return n&&(r.value=!0,zn&&c()),ph(o),{isPending:l.readonly(r),start:c,stop:o}}function Zg(i){var e;const t=fh(i);return(e=t==null?void 0:t.$el)!=null?e:t}const e0=zn?window:void 0;function fa(...i){let e,t,n,r;if(yx(i[0])||Array.isArray(i[0])?([t,n,r]=i,e=e0):[e,t,n,r]=i,!e)return bx;Array.isArray(t)||(t=[t]),Array.isArray(n)||(n=[n]);const s=[],a=()=>{s.forEach(d=>d()),s.length=0},o=(d,h,b,v)=>(d.addEventListener(h,b,v),()=>d.removeEventListener(h,b,v)),c=l.watch(()=>[Zg(e),fh(r)],([d,h])=>{a(),d&&s.push(...t.flatMap(b=>n.map(v=>o(d,b,v,h))))},{immediate:!0,flush:"post"}),u=()=>{c(),a()};return ph(u),u}function Sx(i,e=!1){const t=l.ref(),n=()=>t.value=!!i();return n(),kx(n,e),t}const t0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n0="__vueuse_ssr_handlers__";t0[n0]=t0[n0]||{};var i0=Object.getOwnPropertySymbols,Cx=Object.prototype.hasOwnProperty,xx=Object.prototype.propertyIsEnumerable,Ex=(i,e)=>{var t={};for(var n in i)Cx.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&i0)for(var n of i0(i))e.indexOf(n)<0&&xx.call(i,n)&&(t[n]=i[n]);return t};function r0(i,e,t={}){const n=t,{window:r=e0}=n,s=Ex(n,["window"]);let a;const o=Sx(()=>r&&"ResizeObserver"in r),c=()=>{a&&(a.disconnect(),a=void 0)},u=l.watch(()=>Zg(i),h=>{c(),o.value&&r&&h&&(a=new ResizeObserver(e),a.observe(h,s))},{immediate:!0,flush:"post"}),d=()=>{c(),u()};return ph(d),{isSupported:o,stop:d}}var s0;(function(i){i.UP="UP",i.RIGHT="RIGHT",i.DOWN="DOWN",i.LEFT="LEFT",i.NONE="NONE"})(s0||(s0={}));var wx=Object.defineProperty,a0=Object.getOwnPropertySymbols,Dx=Object.prototype.hasOwnProperty,Ax=Object.prototype.propertyIsEnumerable,o0=(i,e,t)=>e in i?wx(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t,Ix=(i,e)=>{for(var t in e||(e={}))Dx.call(e,t)&&o0(i,t,e[t]);if(a0)for(var t of a0(e))Ax.call(e,t)&&o0(i,t,e[t]);return i};Ix({linear:_x},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const Nx=()=>zn&&/firefox/i.test(window.navigator.userAgent);/**
|
2
|
+
* @vue/shared v3.5.13
|
3
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
4
|
+
* @license MIT
|
5
|
+
**/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const Lo=()=>{},Px=Object.prototype.hasOwnProperty,fc=(i,e)=>Px.call(i,e),Kr=i=>typeof i=="function",Ri=i=>typeof i=="string",Bo=i=>i!==null&&typeof i=="object",Ox=i=>{const e=Object.create(null);return t=>e[t]||(e[t]=i(t))},Mx=/-(\w)/g,Rx=Ox(i=>i.replace(Mx,(e,t)=>t?t.toUpperCase():""));var Lx=typeof global=="object"&&global&&global.Object===Object&&global,Bx=typeof self=="object"&&self&&self.Object===Object&&self,mh=Lx||Bx||Function("return this")(),Xr=mh.Symbol,l0=Object.prototype,Ux=l0.hasOwnProperty,Fx=l0.toString,Uo=Xr?Xr.toStringTag:void 0;function Vx(i){var e=Ux.call(i,Uo),t=i[Uo];try{i[Uo]=void 0;var n=!0}catch{}var r=Fx.call(i);return n&&(e?i[Uo]=t:delete i[Uo]),r}var jx=Object.prototype,$x=jx.toString;function Hx(i){return $x.call(i)}var qx="[object Null]",zx="[object Undefined]",c0=Xr?Xr.toStringTag:void 0;function gh(i){return i==null?i===void 0?zx:qx:c0&&c0 in Object(i)?Vx(i):Hx(i)}function vh(i){return i!=null&&typeof i=="object"}var Gx="[object Symbol]";function yh(i){return typeof i=="symbol"||vh(i)&&gh(i)==Gx}function Wx(i,e){for(var t=-1,n=i==null?0:i.length,r=Array(n);++t<n;)r[t]=e(i[t],t,i);return r}var Fo=Array.isArray,u0=Xr?Xr.prototype:void 0,d0=u0?u0.toString:void 0;function h0(i){if(typeof i=="string")return i;if(Fo(i))return Wx(i,h0)+"";if(yh(i))return d0?d0.call(i):"";var e=i+"";return e=="0"&&1/i==-1/0?"-0":e}function pc(i){var e=typeof i;return i!=null&&(e=="object"||e=="function")}function Kx(i){return i}var Xx="[object AsyncFunction]",Yx="[object Function]",Jx="[object GeneratorFunction]",Qx="[object Proxy]";function Zx(i){if(!pc(i))return!1;var e=gh(i);return e==Yx||e==Jx||e==Xx||e==Qx}var bh=mh["__core-js_shared__"],f0=function(){var i=/[^.]+$/.exec(bh&&bh.keys&&bh.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""}();function eE(i){return!!f0&&f0 in i}var tE=Function.prototype,nE=tE.toString;function iE(i){if(i!=null){try{return nE.call(i)}catch{}try{return i+""}catch{}}return""}var rE=/[\\^$.*+?()[\]{}|]/g,sE=/^\[object .+?Constructor\]$/,aE=Function.prototype,oE=Object.prototype,lE=aE.toString,cE=oE.hasOwnProperty,uE=RegExp("^"+lE.call(cE).replace(rE,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function dE(i){if(!pc(i)||eE(i))return!1;var e=Zx(i)?uE:sE;return e.test(iE(i))}function hE(i,e){return i==null?void 0:i[e]}function _h(i,e){var t=hE(i,e);return dE(t)?t:void 0}function fE(i,e,t){switch(t.length){case 0:return i.call(e);case 1:return i.call(e,t[0]);case 2:return i.call(e,t[0],t[1]);case 3:return i.call(e,t[0],t[1],t[2])}return i.apply(e,t)}var pE=800,mE=16,gE=Date.now;function vE(i){var e=0,t=0;return function(){var n=gE(),r=mE-(n-t);if(t=n,r>0){if(++e>=pE)return arguments[0]}else e=0;return i.apply(void 0,arguments)}}function yE(i){return function(){return i}}var mc=function(){try{var i=_h(Object,"defineProperty");return i({},"",{}),i}catch{}}(),bE=mc?function(i,e){return mc(i,"toString",{configurable:!0,enumerable:!1,value:yE(e),writable:!0})}:Kx,_E=vE(bE),kE=9007199254740991,TE=/^(?:0|[1-9]\d*)$/;function p0(i,e){var t=typeof i;return e=e??kE,!!e&&(t=="number"||t!="symbol"&&TE.test(i))&&i>-1&&i%1==0&&i<e}function SE(i,e,t){e=="__proto__"&&mc?mc(i,e,{configurable:!0,enumerable:!0,value:t,writable:!0}):i[e]=t}function m0(i,e){return i===e||i!==i&&e!==e}var CE=Object.prototype,xE=CE.hasOwnProperty;function EE(i,e,t){var n=i[e];(!(xE.call(i,e)&&m0(n,t))||t===void 0&&!(e in i))&&SE(i,e,t)}var g0=Math.max;function wE(i,e,t){return e=g0(e===void 0?i.length-1:e,0),function(){for(var n=arguments,r=-1,s=g0(n.length-e,0),a=Array(s);++r<s;)a[r]=n[e+r];r=-1;for(var o=Array(e+1);++r<e;)o[r]=n[r];return o[e]=t(a),fE(i,this,o)}}var DE=9007199254740991;function AE(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=DE}var IE="[object Arguments]";function v0(i){return vh(i)&&gh(i)==IE}var y0=Object.prototype,NE=y0.hasOwnProperty,PE=y0.propertyIsEnumerable,b0=v0(function(){return arguments}())?v0:function(i){return vh(i)&&NE.call(i,"callee")&&!PE.call(i,"callee")},OE=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ME=/^\w*$/;function RE(i,e){if(Fo(i))return!1;var t=typeof i;return t=="number"||t=="symbol"||t=="boolean"||i==null||yh(i)?!0:ME.test(i)||!OE.test(i)||e!=null&&i in Object(e)}var Vo=_h(Object,"create");function LE(){this.__data__=Vo?Vo(null):{},this.size=0}function BE(i){var e=this.has(i)&&delete this.__data__[i];return this.size-=e?1:0,e}var UE="__lodash_hash_undefined__",FE=Object.prototype,VE=FE.hasOwnProperty;function jE(i){var e=this.__data__;if(Vo){var t=e[i];return t===UE?void 0:t}return VE.call(e,i)?e[i]:void 0}var $E=Object.prototype,HE=$E.hasOwnProperty;function qE(i){var e=this.__data__;return Vo?e[i]!==void 0:HE.call(e,i)}var zE="__lodash_hash_undefined__";function GE(i,e){var t=this.__data__;return this.size+=this.has(i)?0:1,t[i]=Vo&&e===void 0?zE:e,this}function Cs(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var n=i[e];this.set(n[0],n[1])}}Cs.prototype.clear=LE,Cs.prototype.delete=BE,Cs.prototype.get=jE,Cs.prototype.has=qE,Cs.prototype.set=GE;function WE(){this.__data__=[],this.size=0}function gc(i,e){for(var t=i.length;t--;)if(m0(i[t][0],e))return t;return-1}var KE=Array.prototype,XE=KE.splice;function YE(i){var e=this.__data__,t=gc(e,i);if(t<0)return!1;var n=e.length-1;return t==n?e.pop():XE.call(e,t,1),--this.size,!0}function JE(i){var e=this.__data__,t=gc(e,i);return t<0?void 0:e[t][1]}function QE(i){return gc(this.__data__,i)>-1}function ZE(i,e){var t=this.__data__,n=gc(t,i);return n<0?(++this.size,t.push([i,e])):t[n][1]=e,this}function pa(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var n=i[e];this.set(n[0],n[1])}}pa.prototype.clear=WE,pa.prototype.delete=YE,pa.prototype.get=JE,pa.prototype.has=QE,pa.prototype.set=ZE;var ew=_h(mh,"Map");function tw(){this.size=0,this.__data__={hash:new Cs,map:new(ew||pa),string:new Cs}}function nw(i){var e=typeof i;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?i!=="__proto__":i===null}function vc(i,e){var t=i.__data__;return nw(e)?t[typeof e=="string"?"string":"hash"]:t.map}function iw(i){var e=vc(this,i).delete(i);return this.size-=e?1:0,e}function rw(i){return vc(this,i).get(i)}function sw(i){return vc(this,i).has(i)}function aw(i,e){var t=vc(this,i),n=t.size;return t.set(i,e),this.size+=t.size==n?0:1,this}function xs(i){var e=-1,t=i==null?0:i.length;for(this.clear();++e<t;){var n=i[e];this.set(n[0],n[1])}}xs.prototype.clear=tw,xs.prototype.delete=iw,xs.prototype.get=rw,xs.prototype.has=sw,xs.prototype.set=aw;var ow="Expected a function";function kh(i,e){if(typeof i!="function"||e!=null&&typeof e!="function")throw new TypeError(ow);var t=function(){var n=arguments,r=e?e.apply(this,n):n[0],s=t.cache;if(s.has(r))return s.get(r);var a=i.apply(this,n);return t.cache=s.set(r,a)||s,a};return t.cache=new(kh.Cache||xs),t}kh.Cache=xs;var lw=500;function cw(i){var e=kh(i,function(n){return t.size===lw&&t.clear(),n}),t=e.cache;return e}var uw=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,dw=/\\(\\)?/g,hw=cw(function(i){var e=[];return i.charCodeAt(0)===46&&e.push(""),i.replace(uw,function(t,n,r,s){e.push(r?s.replace(dw,"$1"):n||t)}),e});function fw(i){return i==null?"":h0(i)}function yc(i,e){return Fo(i)?i:RE(i,e)?[i]:hw(fw(i))}function Th(i){if(typeof i=="string"||yh(i))return i;var e=i+"";return e=="0"&&1/i==-1/0?"-0":e}function _0(i,e){e=yc(e,i);for(var t=0,n=e.length;i!=null&&t<n;)i=i[Th(e[t++])];return t&&t==n?i:void 0}function pw(i,e,t){var n=i==null?void 0:_0(i,e);return n===void 0?t:n}function mw(i,e){for(var t=-1,n=e.length,r=i.length;++t<n;)i[r+t]=e[t];return i}var k0=Xr?Xr.isConcatSpreadable:void 0;function gw(i){return Fo(i)||b0(i)||!!(k0&&i&&i[k0])}function vw(i,e,t,n,r){var s=-1,a=i.length;for(t||(t=gw),r||(r=[]);++s<a;){var o=i[s];t(o)?mw(r,o):r[r.length]=o}return r}function yw(i){var e=i==null?0:i.length;return e?vw(i):[]}function bw(i){return _E(wE(i,void 0,yw),i+"")}function _w(i,e){return i!=null&&e in Object(i)}function kw(i,e,t){e=yc(e,i);for(var n=-1,r=e.length,s=!1;++n<r;){var a=Th(e[n]);if(!(s=i!=null&&t(i,a)))break;i=i[a]}return s||++n!=r?s:(r=i==null?0:i.length,!!r&&AE(r)&&p0(a,r)&&(Fo(i)||b0(i)))}function Tw(i,e){return i!=null&&kw(i,e,_w)}function T0(i){for(var e=-1,t=i==null?0:i.length,n={};++e<t;){var r=i[e];n[r[0]]=r[1]}return n}function S0(i){return i==null}function Sw(i,e,t,n){if(!pc(i))return i;e=yc(e,i);for(var r=-1,s=e.length,a=s-1,o=i;o!=null&&++r<s;){var c=Th(e[r]),u=t;if(c==="__proto__"||c==="constructor"||c==="prototype")return i;if(r!=a){var d=o[c];u=void 0,u===void 0&&(u=pc(d)?d:p0(e[r+1])?[]:{})}EE(o,c,u),o=o[c]}return i}function Cw(i,e,t){for(var n=-1,r=e.length,s={};++n<r;){var a=e[n],o=_0(i,a);t(o,a)&&Sw(s,yc(a,i),o)}return s}function xw(i,e){return Cw(i,e,function(t,n){return Tw(i,n)})}var Ew=bw(function(i,e){return i==null?{}:xw(i,e)});const C0=i=>i===void 0,Es=i=>typeof i=="number",bc=i=>typeof Element>"u"?!1:i instanceof Element,ww=i=>Ri(i)?!Number.isNaN(Number(i)):!1,x0=i=>Object.keys(i);class E0 extends Error{constructor(e){super(e),this.name="ElementPlusError"}}function Dw(i,e){throw new E0(`[${i}] ${e}`)}function Li(i,e){if(process.env.NODE_ENV!=="production"){const t=Ri(i)?new E0(`[${i}] ${e}`):i;console.warn(t)}}const Aw="utils/dom/style",w0=(i="")=>i.split(" ").filter(e=>!!e.trim()),D0=(i,e)=>{if(!i||!e)return!1;if(e.includes(" "))throw new Error("className should not contain space.");return i.classList.contains(e)},Iw=(i,e)=>{!i||!e.trim()||i.classList.add(...w0(e))},Nw=(i,e)=>{!i||!e.trim()||i.classList.remove(...w0(e))},Pw=(i,e)=>{var t;if(!zn||!i)return"";let n=Rx(e);n==="float"&&(n="cssFloat");try{const r=i.style[n];if(r)return r;const s=(t=document.defaultView)==null?void 0:t.getComputedStyle(i,"");return s?s[n]:""}catch{return i.style[n]}};function jo(i,e="px"){if(!i)return"";if(Es(i)||ww(i))return`${i}${e}`;if(Ri(i))return i;Li(Aw,"binding value must be a string or number")}let _c;const Ow=i=>{var e;if(!zn)return 0;if(_c!==void 0)return _c;const t=document.createElement("div");t.className=`${i}-scrollbar__wrap`,t.style.visibility="hidden",t.style.width="100px",t.style.position="absolute",t.style.top="-9999px",document.body.appendChild(t);const n=t.offsetWidth;t.style.overflow="scroll";const r=document.createElement("div");r.style.width="100%",t.appendChild(r);const s=r.offsetWidth;return(e=t.parentNode)==null||e.removeChild(t),_c=n-s,_c};/*! Element Plus Icons Vue v2.3.1 */var Mw=l.defineComponent({name:"CircleCheck",__name:"circle-check",setup(i){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),l.createElementVNode("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752l265.344-265.408z"})]))}}),Rw=Mw,Lw=l.defineComponent({name:"CircleCloseFilled",__name:"circle-close-filled",setup(i){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"})]))}}),A0=Lw,Bw=l.defineComponent({name:"CircleClose",__name:"circle-close",setup(i){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),l.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),I0=Bw,Uw=l.defineComponent({name:"Close",__name:"close",setup(i){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),Sh=Uw,Fw=l.defineComponent({name:"Hide",__name:"hide",setup(i){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z"}),l.createElementVNode("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z"})]))}}),Vw=Fw,jw=l.defineComponent({name:"InfoFilled",__name:"info-filled",setup(i){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64m67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344M590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.992 12.992 0 0 1-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 0 1 7.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"})]))}}),N0=jw,$w=l.defineComponent({name:"Loading",__name:"loading",setup(i){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248zm452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248zM828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0z"})]))}}),kc=$w,Hw=l.defineComponent({name:"SuccessFilled",__name:"success-filled",setup(i){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m-55.808 536.384-99.52-99.584a38.4 38.4 0 1 0-54.336 54.336l126.72 126.72a38.272 38.272 0 0 0 54.336 0l262.4-262.464a38.4 38.4 0 1 0-54.272-54.336z"})]))}}),P0=Hw,qw=l.defineComponent({name:"View",__name:"view",setup(i){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288zm0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.192 160.192 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}}),zw=qw,Gw=l.defineComponent({name:"WarningFilled",__name:"warning-filled",setup(i){return(e,t)=>(l.openBlock(),l.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[l.createElementVNode("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 192a58.432 58.432 0 0 0-58.24 63.744l23.36 256.384a35.072 35.072 0 0 0 69.76 0l23.296-256.384A58.432 58.432 0 0 0 512 256m0 512a51.2 51.2 0 1 0 0-102.4 51.2 51.2 0 0 0 0 102.4"})]))}}),O0=Gw;const M0="__epPropKey",Mn=i=>i,Ww=i=>Bo(i)&&!!i[M0],R0=(i,e)=>{if(!Bo(i)||Ww(i))return i;const{values:t,required:n,default:r,type:s,validator:a}=i,c={type:s,required:!!n,validator:t||a?u=>{let d=!1,h=[];if(t&&(h=Array.from(t),fc(i,"default")&&h.push(r),d||(d=h.includes(u))),a&&(d||(d=a(u))),!d&&h.length>0){const b=[...new Set(h)].map(v=>JSON.stringify(v)).join(", ");l.warn(`Invalid prop: validation failed${e?` for prop "${e}"`:""}. Expected one of [${b}], got value ${JSON.stringify(u)}.`)}return d}:void 0,[M0]:!0};return fc(i,"default")&&(c.default=r),c},Er=i=>T0(Object.entries(i).map(([e,t])=>[e,R0(t,e)])),$o=Mn([String,Object,Function]),L0={Close:Sh,SuccessFilled:P0,InfoFilled:N0,WarningFilled:O0,CircleCloseFilled:A0},Tc={success:P0,warning:O0,error:A0,info:N0},Kw={validating:kc,success:Rw,error:I0},Sc=(i,e)=>{if(i.install=t=>{for(const n of[i,...Object.values(e??{})])t.component(n.name,n)},e)for(const[t,n]of Object.entries(e))i[t]=n;return i},Xw=(i,e)=>(i.install=t=>{i._context=t._context,t.config.globalProperties[e]=i},i),Yw=i=>(i.install=Lo,i),Cc={tab:"Tab",esc:"Escape"},Ch="update:modelValue",B0=["","default","small","large"],Jw=i=>["",...B0].includes(i);var xc=(i=>(i[i.TEXT=1]="TEXT",i[i.CLASS=2]="CLASS",i[i.STYLE=4]="STYLE",i[i.PROPS=8]="PROPS",i[i.FULL_PROPS=16]="FULL_PROPS",i[i.HYDRATE_EVENTS=32]="HYDRATE_EVENTS",i[i.STABLE_FRAGMENT=64]="STABLE_FRAGMENT",i[i.KEYED_FRAGMENT=128]="KEYED_FRAGMENT",i[i.UNKEYED_FRAGMENT=256]="UNKEYED_FRAGMENT",i[i.NEED_PATCH=512]="NEED_PATCH",i[i.DYNAMIC_SLOTS=1024]="DYNAMIC_SLOTS",i[i.HOISTED=-1]="HOISTED",i[i.BAIL=-2]="BAIL",i))(xc||{});const Qw=i=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(i),U0=i=>i,Zw=["class","style"],e3=/^on[A-Z]/,t3=(i={})=>{const{excludeListeners:e=!1,excludeKeys:t}=i,n=l.computed(()=>((t==null?void 0:t.value)||[]).concat(Zw)),r=l.getCurrentInstance();return r?l.computed(()=>{var s;return T0(Object.entries((s=r.proxy)==null?void 0:s.$attrs).filter(([a])=>!n.value.includes(a)&&!(e&&e3.test(a))))}):(Li("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),l.computed(()=>({})))},n3=({from:i,replacement:e,scope:t,version:n,ref:r,type:s="API"},a)=>{l.watch(()=>l.unref(a),o=>{o&&Li(t,`[${s}] ${i} is about to be deprecated in version ${n}, please use ${e} instead.
|
6
|
+
For more detail, please visit: ${r}
|
7
|
+
`)},{immediate:!0})},i3=(i,e,t,n)=>{let r={offsetX:0,offsetY:0};const s=u=>{const d=u.clientX,h=u.clientY,{offsetX:b,offsetY:v}=r,y=i.value.getBoundingClientRect(),p=y.left,f=y.top,m=y.width,_=y.height,k=document.documentElement.clientWidth,D=document.documentElement.clientHeight,E=-p+b,A=-f+v,w=k-p-m+b,N=D-f-_+v,S=F=>{let V=b+F.clientX-d,J=v+F.clientY-h;n!=null&&n.value||(V=Math.min(Math.max(V,E),w),J=Math.min(Math.max(J,A),N)),r={offsetX:V,offsetY:J},i.value&&(i.value.style.transform=`translate(${jo(V)}, ${jo(J)})`)},P=()=>{document.removeEventListener("mousemove",S),document.removeEventListener("mouseup",P)};document.addEventListener("mousemove",S),document.addEventListener("mouseup",P)},a=()=>{e.value&&i.value&&e.value.addEventListener("mousedown",s)},o=()=>{e.value&&i.value&&e.value.removeEventListener("mousedown",s)},c=()=>{r={offsetX:0,offsetY:0},i.value&&(i.value.style.transform="none")};return l.onMounted(()=>{l.watchEffect(()=>{t.value?a():o()})}),l.onBeforeUnmount(()=>{o()}),{resetPostion:c}};var r3={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const s3=i=>(e,t)=>a3(e,t,l.unref(i)),a3=(i,e,t)=>pw(t,i,i).replace(/\{(\w+)\}/g,(n,r)=>{var s;return`${(s=e==null?void 0:e[r])!=null?s:`{${r}}`}`}),o3=i=>{const e=l.computed(()=>l.unref(i).name),t=l.isRef(i)?i:l.ref(i);return{lang:e,locale:t,t:s3(i)}},F0=Symbol("localeContextKey"),l3=i=>{const e=i||l.inject(F0,l.ref());return o3(l.computed(()=>e.value||r3))},Ec="el",c3="is-",ws=(i,e,t,n,r)=>{let s=`${i}-${e}`;return t&&(s+=`-${t}`),n&&(s+=`__${n}`),r&&(s+=`--${r}`),s},V0=Symbol("namespaceContextKey"),j0=i=>{const e=i||(l.getCurrentInstance()?l.inject(V0,l.ref(Ec)):l.ref(Ec));return l.computed(()=>l.unref(e)||Ec)},er=(i,e)=>{const t=j0(e);return{namespace:t,b:(p="")=>ws(t.value,i,p,"",""),e:p=>p?ws(t.value,i,"",p,""):"",m:p=>p?ws(t.value,i,"","",p):"",be:(p,f)=>p&&f?ws(t.value,i,p,f,""):"",em:(p,f)=>p&&f?ws(t.value,i,"",p,f):"",bm:(p,f)=>p&&f?ws(t.value,i,p,"",f):"",bem:(p,f,m)=>p&&f&&m?ws(t.value,i,p,f,m):"",is:(p,...f)=>{const m=f.length>=1?f[0]:!0;return p&&m?`${c3}${p}`:""},cssVar:p=>{const f={};for(const m in p)p[m]&&(f[`--${t.value}-${m}`]=p[m]);return f},cssVarName:p=>`--${t.value}-${p}`,cssVarBlock:p=>{const f={};for(const m in p)p[m]&&(f[`--${t.value}-${i}-${m}`]=p[m]);return f},cssVarBlockName:p=>`--${t.value}-${i}-${p}`}},u3=(i,e={})=>{l.isRef(i)||Dw("[useLockscreen]","You need to pass a ref param to this function");const t=e.ns||er("popup"),n=l.computed(()=>t.bm("parent","hidden"));if(!zn||D0(document.body,n.value))return;let r=0,s=!1,a="0";const o=()=>{setTimeout(()=>{Nw(document==null?void 0:document.body,n.value),s&&document&&(document.body.style.width=a)},200)};l.watch(i,c=>{if(!c){o();return}s=!D0(document.body,n.value),s&&(a=document.body.style.width),r=Ow(t.namespace.value);const u=document.documentElement.clientHeight<document.body.scrollHeight,d=Pw(document.body,"overflowY");r>0&&(u||d==="scroll")&&s&&(document.body.style.width=`calc(100% - ${r}px)`),Iw(document.body,n.value)}),l.onScopeDispose(()=>o())},$0=i=>{const e=l.getCurrentInstance();return l.computed(()=>{var t,n;return(n=(t=e==null?void 0:e.proxy)==null?void 0:t.$props)==null?void 0:n[i]})},H0=i=>{if(!i)return{onClick:Lo,onMousedown:Lo,onMouseup:Lo};let e=!1,t=!1;return{onClick:a=>{e&&t&&i(a),e=t=!1},onMousedown:a=>{e=a.target===a.currentTarget},onMouseup:a=>{t=a.target===a.currentTarget}}},xh={prefix:Math.floor(Math.random()*1e4),current:0},d3=Symbol("elIdInjection"),h3=()=>l.getCurrentInstance()?l.inject(d3,xh):xh,Eh=i=>{const e=h3();!zn&&e===xh&&Li("IdInjection",`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed
|
8
|
+
usage: app.provide(ID_INJECTION_KEY, {
|
9
|
+
prefix: number,
|
10
|
+
current: number,
|
11
|
+
})`);const t=j0();return l.computed(()=>l.unref(i)||`${t.value}-id-${e.prefix}-${e.current++}`)};let ma=[];const q0=i=>{const e=i;e.key===Cc.esc&&ma.forEach(t=>t(e))},f3=i=>{l.onMounted(()=>{ma.length===0&&document.addEventListener("keydown",q0),zn&&ma.push(i)}),l.onBeforeUnmount(()=>{ma=ma.filter(e=>e!==i),ma.length===0&&zn&&document.removeEventListener("keydown",q0)})},z0={current:0},G0=l.ref(0),W0=2e3,K0=Symbol("elZIndexContextKey"),X0=Symbol("zIndexContextKey"),p3=i=>{const e=l.getCurrentInstance()?l.inject(K0,z0):z0,t=i||(l.getCurrentInstance()?l.inject(X0,void 0):void 0),n=l.computed(()=>{const a=l.unref(t);return Es(a)?a:W0}),r=l.computed(()=>n.value+G0.value),s=()=>(e.current++,G0.value=e.current,r.value);return!zn&&!l.inject(K0)&&Li("ZIndexInjection",`Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed
|
12
|
+
usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:n,currentZIndex:r,nextZIndex:s}};function m3(i){let e;function t(){if(i.value==null)return;const{selectionStart:r,selectionEnd:s,value:a}=i.value;if(r==null||s==null)return;const o=a.slice(0,Math.max(0,r)),c=a.slice(Math.max(0,s));e={selectionStart:r,selectionEnd:s,value:a,beforeTxt:o,afterTxt:c}}function n(){if(i.value==null||e==null)return;const{value:r}=i.value,{beforeTxt:s,afterTxt:a,selectionStart:o}=e;if(s==null||a==null||o==null)return;let c=r.length;if(r.endsWith(a))c=r.length-a.length;else if(r.startsWith(s))c=s.length;else{const u=s[o-1],d=r.indexOf(u,o-1);d!==-1&&(c=d+1)}i.value.setSelectionRange(c,c)}return[t,n]}const wh=R0({type:String,values:B0,required:!1}),Y0=Symbol("size"),g3=()=>{const i=l.inject(Y0,{});return l.computed(()=>l.unref(i.size)||"")};function v3(i,{beforeFocus:e,afterFocus:t,beforeBlur:n,afterBlur:r}={}){const s=l.getCurrentInstance(),{emit:a}=s,o=l.shallowRef(),c=l.ref(!1),u=b=>{Kr(e)&&e(b)||c.value||(c.value=!0,a("focus",b),t==null||t())},d=b=>{var v;Kr(n)&&n(b)||b.relatedTarget&&((v=o.value)!=null&&v.contains(b.relatedTarget))||(c.value=!1,a("blur",b),r==null||r())},h=()=>{var b,v;(b=o.value)!=null&&b.contains(document.activeElement)&&o.value!==document.activeElement||(v=i.value)==null||v.focus()};return l.watch(o,b=>{b&&b.setAttribute("tabindex","-1")}),fa(o,"focus",u,!0),fa(o,"blur",d,!0),fa(o,"click",h,!0),process.env.NODE_ENV==="test"&&l.onMounted(()=>{const b=bc(i.value)?i.value:document.querySelector("input,textarea");b&&(fa(b,"focus",u,!0),fa(b,"blur",d,!0))}),{isFocused:c,wrapperRef:o,handleFocus:u,handleBlur:d}}function y3({afterComposition:i,emit:e}){const t=l.ref(!1),n=o=>{e==null||e("compositionstart",o),t.value=!0},r=o=>{var c;e==null||e("compositionupdate",o);const u=(c=o.target)==null?void 0:c.value,d=u[u.length-1]||"";t.value=!Qw(d)},s=o=>{e==null||e("compositionend",o),t.value&&(t.value=!1,l.nextTick(()=>i(o)))};return{isComposing:t,handleComposition:o=>{o.type==="compositionend"?s(o):r(o)},handleCompositionStart:n,handleCompositionUpdate:r,handleCompositionEnd:s}}const b3=Symbol("emptyValuesContextKey"),_3=Er({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:i=>Kr(i)?!i():!i}}),k3=Er({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),T3=i=>Ew(k3,i),J0=Symbol(),wc=l.ref();function Dh(i,e=void 0){const t=l.getCurrentInstance()?l.inject(J0,wc):wc;return i?l.computed(()=>{var n,r;return(r=(n=t.value)==null?void 0:n[i])!=null?r:e}):t}function Q0(i,e){const t=Dh(),n=er(i,l.computed(()=>{var o;return((o=t.value)==null?void 0:o.namespace)||Ec})),r=l3(l.computed(()=>{var o;return(o=t.value)==null?void 0:o.locale})),s=p3(l.computed(()=>{var o;return((o=t.value)==null?void 0:o.zIndex)||W0})),a=l.computed(()=>{var o;return l.unref(e)||((o=t.value)==null?void 0:o.size)||""});return Z0(l.computed(()=>l.unref(t)||{})),{ns:n,locale:r,zIndex:s,size:a}}const Z0=(i,e,t=!1)=>{var n;const r=!!l.getCurrentInstance(),s=r?Dh():void 0,a=(n=void 0)!=null?n:r?l.provide:void 0;if(!a){Li("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const o=l.computed(()=>{const c=l.unref(i);return s!=null&&s.value?S3(s.value,c):c});return a(J0,o),a(F0,l.computed(()=>o.value.locale)),a(V0,l.computed(()=>o.value.namespace)),a(X0,l.computed(()=>o.value.zIndex)),a(Y0,{size:l.computed(()=>o.value.size||"")}),a(b3,l.computed(()=>({emptyValues:o.value.emptyValues,valueOnClear:o.value.valueOnClear}))),(t||!wc.value)&&(wc.value=o.value),o},S3=(i,e)=>{const t=[...new Set([...x0(i),...x0(e)])],n={};for(const r of t)n[r]=e[r]!==void 0?e[r]:i[r];return n},C3=Er({a11y:{type:Boolean,default:!0},locale:{type:Mn(Object)},size:wh,button:{type:Mn(Object)},experimentalFeatures:{type:Mn(Object)},keyboardNavigation:{type:Boolean,default:!0},message:{type:Mn(Object)},zIndex:Number,namespace:{type:String,default:"el"},..._3}),Ah={};l.defineComponent({name:"ElConfigProvider",props:C3,setup(i,{slots:e}){l.watch(()=>i.message,n=>{Object.assign(Ah,n??{})},{immediate:!0,deep:!0});const t=Z0(i);return()=>l.renderSlot(e,"default",{config:t==null?void 0:t.value})}});var Yr=(i,e)=>{const t=i.__vccOpts||i;for(const[n,r]of e)t[n]=r;return t};const x3=Er({size:{type:Mn([Number,String])},color:{type:String}}),E3=l.defineComponent({name:"ElIcon",inheritAttrs:!1}),w3=l.defineComponent({...E3,props:x3,setup(i){const e=i,t=er("icon"),n=l.computed(()=>{const{size:r,color:s}=e;return!r&&!s?{}:{fontSize:C0(r)?void 0:jo(r),"--color":s}});return(r,s)=>(l.openBlock(),l.createElementBlock("i",l.mergeProps({class:l.unref(t).b(),style:l.unref(n)},r.$attrs),[l.renderSlot(r.$slots,"default")],16))}});var D3=Yr(w3,[["__file","icon.vue"]]);const tr=Sc(D3),Ih=Symbol("formContextKey"),ev=Symbol("formItemContextKey"),tv=(i,e={})=>{const t=l.ref(void 0),n=e.prop?t:$0("size"),r=e.global?t:g3(),s=e.form?{size:void 0}:l.inject(Ih,void 0),a=e.formItem?{size:void 0}:l.inject(ev,void 0);return l.computed(()=>n.value||l.unref(i)||(a==null?void 0:a.size)||(s==null?void 0:s.size)||r.value||"")},Nh=i=>{const e=$0("disabled"),t=l.inject(Ih,void 0);return l.computed(()=>e.value||l.unref(i)||(t==null?void 0:t.disabled)||!1)},nv=()=>{const i=l.inject(Ih,void 0),e=l.inject(ev,void 0);return{form:i,formItem:e}},A3=(i,{formItemContext:e,disableIdGeneration:t,disableIdManagement:n})=>{t||(t=l.ref(!1)),n||(n=l.ref(!1));const r=l.ref();let s;const a=l.computed(()=>{var o;return!!(!(i.label||i.ariaLabel)&&e&&e.inputIds&&((o=e.inputIds)==null?void 0:o.length)<=1)});return l.onMounted(()=>{s=l.watch([l.toRef(i,"id"),t],([o,c])=>{const u=o??(c?void 0:Eh().value);u!==r.value&&(e!=null&&e.removeInputId&&(r.value&&e.removeInputId(r.value),!(n!=null&&n.value)&&!c&&u&&e.addInputId(u)),r.value=u)},{immediate:!0})}),l.onUnmounted(()=>{s&&s(),e!=null&&e.removeInputId&&r.value&&e.removeInputId(r.value)}),{isLabeledByFormItem:a,inputId:r}};let Bi;const I3=`
|
13
|
+
height:0 !important;
|
14
|
+
visibility:hidden !important;
|
15
|
+
${Nx()?"":"overflow:hidden !important;"}
|
16
|
+
position:absolute !important;
|
17
|
+
z-index:-1000 !important;
|
18
|
+
top:0 !important;
|
19
|
+
right:0 !important;
|
20
|
+
`,N3=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function P3(i){const e=window.getComputedStyle(i),t=e.getPropertyValue("box-sizing"),n=Number.parseFloat(e.getPropertyValue("padding-bottom"))+Number.parseFloat(e.getPropertyValue("padding-top")),r=Number.parseFloat(e.getPropertyValue("border-bottom-width"))+Number.parseFloat(e.getPropertyValue("border-top-width"));return{contextStyle:N3.map(a=>`${a}:${e.getPropertyValue(a)}`).join(";"),paddingSize:n,borderSize:r,boxSizing:t}}function iv(i,e=1,t){var n;Bi||(Bi=document.createElement("textarea"),document.body.appendChild(Bi));const{paddingSize:r,borderSize:s,boxSizing:a,contextStyle:o}=P3(i);Bi.setAttribute("style",`${o};${I3}`),Bi.value=i.value||i.placeholder||"";let c=Bi.scrollHeight;const u={};a==="border-box"?c=c+s:a==="content-box"&&(c=c-r),Bi.value="";const d=Bi.scrollHeight-r;if(Es(e)){let h=d*e;a==="border-box"&&(h=h+r+s),c=Math.max(h,c),u.minHeight=`${h}px`}if(Es(t)){let h=d*t;a==="border-box"&&(h=h+r+s),c=Math.min(h,c)}return u.height=`${c}px`,(n=Bi.parentNode)==null||n.removeChild(Bi),Bi=void 0,u}const O3=Er({id:{type:String,default:void 0},size:wh,disabled:Boolean,modelValue:{type:Mn([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:Mn([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:$o},prefixIcon:{type:$o},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:Mn([Object,Array,String]),default:()=>U0({})},autofocus:Boolean,rows:{type:Number,default:2},...T3(["ariaLabel"])}),M3={[Ch]:i=>Ri(i),input:i=>Ri(i),change:i=>Ri(i),focus:i=>i instanceof FocusEvent,blur:i=>i instanceof FocusEvent,clear:()=>!0,mouseleave:i=>i instanceof MouseEvent,mouseenter:i=>i instanceof MouseEvent,keydown:i=>i instanceof Event,compositionstart:i=>i instanceof CompositionEvent,compositionupdate:i=>i instanceof CompositionEvent,compositionend:i=>i instanceof CompositionEvent},R3=l.defineComponent({name:"ElInput",inheritAttrs:!1}),L3=l.defineComponent({...R3,props:O3,emits:M3,setup(i,{expose:e,emit:t}){const n=i,r=l.useAttrs(),s=l.useSlots(),a=l.computed(()=>{const ke={};return n.containerRole==="combobox"&&(ke["aria-haspopup"]=r["aria-haspopup"],ke["aria-owns"]=r["aria-owns"],ke["aria-expanded"]=r["aria-expanded"]),ke}),o=l.computed(()=>[n.type==="textarea"?f.b():p.b(),p.m(v.value),p.is("disabled",y.value),p.is("exceed",z.value),{[p.b("group")]:s.prepend||s.append,[p.m("prefix")]:s.prefix||n.prefixIcon,[p.m("suffix")]:s.suffix||n.suffixIcon||n.clearable||n.showPassword,[p.bm("suffix","password-clear")]:$.value&&j.value,[p.b("hidden")]:n.type==="hidden"},r.class]),c=l.computed(()=>[p.e("wrapper"),p.is("focus",S.value)]),u=t3({excludeKeys:l.computed(()=>Object.keys(a.value))}),{form:d,formItem:h}=nv(),{inputId:b}=A3(n,{formItemContext:h}),v=tv(),y=Nh(),p=er("input"),f=er("textarea"),m=l.shallowRef(),_=l.shallowRef(),k=l.ref(!1),D=l.ref(!1),E=l.ref(),A=l.shallowRef(n.inputStyle),w=l.computed(()=>m.value||_.value),{wrapperRef:N,isFocused:S}=v3(w,{afterBlur(){var ke;n.validateEvent&&((ke=h==null?void 0:h.validate)==null||ke.call(h,"blur").catch(Me=>Li(Me)))}}),P=l.computed(()=>{var ke;return(ke=d==null?void 0:d.statusIcon)!=null?ke:!1}),F=l.computed(()=>(h==null?void 0:h.validateState)||""),V=l.computed(()=>F.value&&Kw[F.value]),J=l.computed(()=>D.value?zw:Vw),ie=l.computed(()=>[r.style]),X=l.computed(()=>[n.inputStyle,A.value,{resize:n.resize}]),H=l.computed(()=>S0(n.modelValue)?"":String(n.modelValue)),$=l.computed(()=>n.clearable&&!y.value&&!n.readonly&&!!H.value&&(S.value||k.value)),j=l.computed(()=>n.showPassword&&!y.value&&!n.readonly&&!!H.value&&(!!H.value||S.value)),B=l.computed(()=>n.showWordLimit&&!!n.maxlength&&(n.type==="text"||n.type==="textarea")&&!y.value&&!n.readonly&&!n.showPassword),q=l.computed(()=>H.value.length),z=l.computed(()=>!!B.value&&q.value>Number(n.maxlength)),oe=l.computed(()=>!!s.suffix||!!n.suffixIcon||$.value||n.showPassword||B.value||!!F.value&&P.value),[we,be]=m3(m);r0(_,ke=>{if(Te(),!B.value||n.resize!=="both")return;const Me=ke[0],{width:Pe}=Me.contentRect;E.value={right:`calc(100% - ${Pe+15+6}px)`}});const Z=()=>{const{type:ke,autosize:Me}=n;if(!(!zn||ke!=="textarea"||!_.value))if(Me){const Pe=Bo(Me)?Me.minRows:void 0,it=Bo(Me)?Me.maxRows:void 0,bt=iv(_.value,Pe,it);A.value={overflowY:"hidden",...bt},l.nextTick(()=>{_.value.offsetHeight,A.value=bt})}else A.value={minHeight:iv(_.value).minHeight}},Te=(ke=>{let Me=!1;return()=>{var Pe;if(Me||!n.autosize)return;((Pe=_.value)==null?void 0:Pe.offsetParent)===null||(ke(),Me=!0)}})(Z),Ue=()=>{const ke=w.value,Me=n.formatter?n.formatter(H.value):H.value;!ke||ke.value===Me||(ke.value=Me)},We=async ke=>{we();let{value:Me}=ke.target;if(n.formatter&&(Me=n.parser?n.parser(Me):Me),!Ne.value){if(Me===H.value){Ue();return}t(Ch,Me),t("input",Me),await l.nextTick(),Ue(),be()}},pe=ke=>{t("change",ke.target.value)},{isComposing:Ne,handleCompositionStart:nt,handleCompositionUpdate:le,handleCompositionEnd:Ke}=y3({emit:t,afterComposition:We}),ae=()=>{D.value=!D.value,ue()},ue=async()=>{var ke;await l.nextTick(),(ke=w.value)==null||ke.focus()},Be=()=>{var ke;return(ke=w.value)==null?void 0:ke.blur()},Ie=ke=>{k.value=!1,t("mouseleave",ke)},tt=ke=>{k.value=!0,t("mouseenter",ke)},ze=ke=>{t("keydown",ke)},Se=()=>{var ke;(ke=w.value)==null||ke.select()},Ve=()=>{t(Ch,""),t("change",""),t("clear"),t("input","")};return l.watch(()=>n.modelValue,()=>{var ke;l.nextTick(()=>Z()),n.validateEvent&&((ke=h==null?void 0:h.validate)==null||ke.call(h,"change").catch(Me=>Li(Me)))}),l.watch(H,()=>Ue()),l.watch(()=>n.type,async()=>{await l.nextTick(),Ue(),Z()}),l.onMounted(()=>{!n.formatter&&n.parser&&Li("ElInput","If you set the parser, you also need to set the formatter."),Ue(),l.nextTick(Z)}),e({input:m,textarea:_,ref:w,textareaStyle:X,autosize:l.toRef(n,"autosize"),isComposing:Ne,focus:ue,blur:Be,select:Se,clear:Ve,resizeTextarea:Z}),(ke,Me)=>(l.openBlock(),l.createElementBlock("div",l.mergeProps(l.unref(a),{class:[l.unref(o),{[l.unref(p).bm("group","append")]:ke.$slots.append,[l.unref(p).bm("group","prepend")]:ke.$slots.prepend}],style:l.unref(ie),role:ke.containerRole,onMouseenter:tt,onMouseleave:Ie}),[l.createCommentVNode(" input "),ke.type!=="textarea"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createCommentVNode(" prepend slot "),ke.$slots.prepend?(l.openBlock(),l.createElementBlock("div",{key:0,class:l.normalizeClass(l.unref(p).be("group","prepend"))},[l.renderSlot(ke.$slots,"prepend")],2)):l.createCommentVNode("v-if",!0),l.createElementVNode("div",{ref_key:"wrapperRef",ref:N,class:l.normalizeClass(l.unref(c))},[l.createCommentVNode(" prefix slot "),ke.$slots.prefix||ke.prefixIcon?(l.openBlock(),l.createElementBlock("span",{key:0,class:l.normalizeClass(l.unref(p).e("prefix"))},[l.createElementVNode("span",{class:l.normalizeClass(l.unref(p).e("prefix-inner"))},[l.renderSlot(ke.$slots,"prefix"),ke.prefixIcon?(l.openBlock(),l.createBlock(l.unref(tr),{key:0,class:l.normalizeClass(l.unref(p).e("icon"))},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(ke.prefixIcon)))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0)],2)],2)):l.createCommentVNode("v-if",!0),l.createElementVNode("input",l.mergeProps({id:l.unref(b),ref_key:"input",ref:m,class:l.unref(p).e("inner")},l.unref(u),{minlength:ke.minlength,maxlength:ke.maxlength,type:ke.showPassword?D.value?"text":"password":ke.type,disabled:l.unref(y),readonly:ke.readonly,autocomplete:ke.autocomplete,tabindex:ke.tabindex,"aria-label":ke.ariaLabel,placeholder:ke.placeholder,style:ke.inputStyle,form:ke.form,autofocus:ke.autofocus,onCompositionstart:l.unref(nt),onCompositionupdate:l.unref(le),onCompositionend:l.unref(Ke),onInput:We,onChange:pe,onKeydown:ze}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),l.createCommentVNode(" suffix slot "),l.unref(oe)?(l.openBlock(),l.createElementBlock("span",{key:1,class:l.normalizeClass(l.unref(p).e("suffix"))},[l.createElementVNode("span",{class:l.normalizeClass(l.unref(p).e("suffix-inner"))},[!l.unref($)||!l.unref(j)||!l.unref(B)?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.renderSlot(ke.$slots,"suffix"),ke.suffixIcon?(l.openBlock(),l.createBlock(l.unref(tr),{key:0,class:l.normalizeClass(l.unref(p).e("icon"))},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(ke.suffixIcon)))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0)],64)):l.createCommentVNode("v-if",!0),l.unref($)?(l.openBlock(),l.createBlock(l.unref(tr),{key:1,class:l.normalizeClass([l.unref(p).e("icon"),l.unref(p).e("clear")]),onMousedown:l.withModifiers(l.unref(Lo),["prevent"]),onClick:Ve},{default:l.withCtx(()=>[l.createVNode(l.unref(I0))]),_:1},8,["class","onMousedown"])):l.createCommentVNode("v-if",!0),l.unref(j)?(l.openBlock(),l.createBlock(l.unref(tr),{key:2,class:l.normalizeClass([l.unref(p).e("icon"),l.unref(p).e("password")]),onClick:ae},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(l.unref(J))))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0),l.unref(B)?(l.openBlock(),l.createElementBlock("span",{key:3,class:l.normalizeClass(l.unref(p).e("count"))},[l.createElementVNode("span",{class:l.normalizeClass(l.unref(p).e("count-inner"))},l.toDisplayString(l.unref(q))+" / "+l.toDisplayString(ke.maxlength),3)],2)):l.createCommentVNode("v-if",!0),l.unref(F)&&l.unref(V)&&l.unref(P)?(l.openBlock(),l.createBlock(l.unref(tr),{key:4,class:l.normalizeClass([l.unref(p).e("icon"),l.unref(p).e("validateIcon"),l.unref(p).is("loading",l.unref(F)==="validating")])},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(l.unref(V))))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0)],2)],2)):l.createCommentVNode("v-if",!0)],2),l.createCommentVNode(" append slot "),ke.$slots.append?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(l.unref(p).be("group","append"))},[l.renderSlot(ke.$slots,"append")],2)):l.createCommentVNode("v-if",!0)],64)):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createCommentVNode(" textarea "),l.createElementVNode("textarea",l.mergeProps({id:l.unref(b),ref_key:"textarea",ref:_,class:[l.unref(f).e("inner"),l.unref(p).is("focus",l.unref(S))]},l.unref(u),{minlength:ke.minlength,maxlength:ke.maxlength,tabindex:ke.tabindex,disabled:l.unref(y),readonly:ke.readonly,autocomplete:ke.autocomplete,style:l.unref(X),"aria-label":ke.ariaLabel,placeholder:ke.placeholder,form:ke.form,autofocus:ke.autofocus,rows:ke.rows,onCompositionstart:l.unref(nt),onCompositionupdate:l.unref(le),onCompositionend:l.unref(Ke),onInput:We,onChange:pe,onKeydown:ze}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend"]),l.unref(B)?(l.openBlock(),l.createElementBlock("span",{key:0,style:l.normalizeStyle(E.value),class:l.normalizeClass(l.unref(p).e("count"))},l.toDisplayString(l.unref(q))+" / "+l.toDisplayString(ke.maxlength),7)):l.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var B3=Yr(L3,[["__file","input.vue"]]);const U3=Sc(B3),Ph="focus-trap.focus-after-trapped",Oh="focus-trap.focus-after-released",F3="focus-trap.focusout-prevented",rv={cancelable:!0,bubbles:!1},V3={cancelable:!0,bubbles:!1},sv="focusAfterTrapped",av="focusAfterReleased",j3=Symbol("elFocusTrap"),Mh=l.ref(),Dc=l.ref(0),Rh=l.ref(0);let Ac=0;const ov=i=>{const e=[],t=document.createTreeWalker(i,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const r=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||r?NodeFilter.FILTER_SKIP:n.tabIndex>=0||n===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)e.push(t.currentNode);return e},lv=(i,e)=>{for(const t of i)if(!$3(t,e))return t},$3=(i,e)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(i).visibility==="hidden")return!0;for(;i;){if(e&&i===e)return!1;if(getComputedStyle(i).display==="none")return!0;i=i.parentElement}return!1},H3=i=>{const e=ov(i),t=lv(e,i),n=lv(e.reverse(),i);return[t,n]},q3=i=>i instanceof HTMLInputElement&&"select"in i,Jr=(i,e)=>{if(i&&i.focus){const t=document.activeElement;i.focus({preventScroll:!0}),Rh.value=window.performance.now(),i!==t&&q3(i)&&e&&i.select()}};function cv(i,e){const t=[...i],n=i.indexOf(e);return n!==-1&&t.splice(n,1),t}const z3=()=>{let i=[];return{push:n=>{const r=i[0];r&&n!==r&&r.pause(),i=cv(i,n),i.unshift(n)},remove:n=>{var r,s;i=cv(i,n),(s=(r=i[0])==null?void 0:r.resume)==null||s.call(r)}}},G3=(i,e=!1)=>{const t=document.activeElement;for(const n of i)if(Jr(n,e),document.activeElement!==t)return},uv=z3(),W3=()=>Dc.value>Rh.value,Ic=()=>{Mh.value="pointer",Dc.value=window.performance.now()},dv=()=>{Mh.value="keyboard",Dc.value=window.performance.now()},K3=()=>(l.onMounted(()=>{Ac===0&&(document.addEventListener("mousedown",Ic),document.addEventListener("touchstart",Ic),document.addEventListener("keydown",dv)),Ac++}),l.onBeforeUnmount(()=>{Ac--,Ac<=0&&(document.removeEventListener("mousedown",Ic),document.removeEventListener("touchstart",Ic),document.removeEventListener("keydown",dv))}),{focusReason:Mh,lastUserFocusTimestamp:Dc,lastAutomatedFocusTimestamp:Rh}),Nc=i=>new CustomEvent(F3,{...V3,detail:i}),X3=l.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[sv,av,"focusin","focusout","focusout-prevented","release-requested"],setup(i,{emit:e}){const t=l.ref();let n,r;const{focusReason:s}=K3();f3(y=>{i.trapped&&!a.paused&&e("release-requested",y)});const a={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},o=y=>{if(!i.loop&&!i.trapped||a.paused)return;const{key:p,altKey:f,ctrlKey:m,metaKey:_,currentTarget:k,shiftKey:D}=y,{loop:E}=i,A=p===Cc.tab&&!f&&!m&&!_,w=document.activeElement;if(A&&w){const N=k,[S,P]=H3(N);if(S&&P){if(!D&&w===P){const V=Nc({focusReason:s.value});e("focusout-prevented",V),V.defaultPrevented||(y.preventDefault(),E&&Jr(S,!0))}else if(D&&[S,N].includes(w)){const V=Nc({focusReason:s.value});e("focusout-prevented",V),V.defaultPrevented||(y.preventDefault(),E&&Jr(P,!0))}}else if(w===N){const V=Nc({focusReason:s.value});e("focusout-prevented",V),V.defaultPrevented||y.preventDefault()}}};l.provide(j3,{focusTrapRef:t,onKeydown:o}),l.watch(()=>i.focusTrapEl,y=>{y&&(t.value=y)},{immediate:!0}),l.watch([t],([y],[p])=>{y&&(y.addEventListener("keydown",o),y.addEventListener("focusin",d),y.addEventListener("focusout",h)),p&&(p.removeEventListener("keydown",o),p.removeEventListener("focusin",d),p.removeEventListener("focusout",h))});const c=y=>{e(sv,y)},u=y=>e(av,y),d=y=>{const p=l.unref(t);if(!p)return;const f=y.target,m=y.relatedTarget,_=f&&p.contains(f);i.trapped||m&&p.contains(m)||(n=m),_&&e("focusin",y),!a.paused&&i.trapped&&(_?r=f:Jr(r,!0))},h=y=>{const p=l.unref(t);if(!(a.paused||!p))if(i.trapped){const f=y.relatedTarget;!S0(f)&&!p.contains(f)&&setTimeout(()=>{if(!a.paused&&i.trapped){const m=Nc({focusReason:s.value});e("focusout-prevented",m),m.defaultPrevented||Jr(r,!0)}},0)}else{const f=y.target;f&&p.contains(f)||e("focusout",y)}};async function b(){await l.nextTick();const y=l.unref(t);if(y){uv.push(a);const p=y.contains(document.activeElement)?n:document.activeElement;if(n=p,!y.contains(p)){const m=new Event(Ph,rv);y.addEventListener(Ph,c),y.dispatchEvent(m),m.defaultPrevented||l.nextTick(()=>{let _=i.focusStartEl;Ri(_)||(Jr(_),document.activeElement!==_&&(_="first")),_==="first"&&G3(ov(y),!0),(document.activeElement===p||_==="container")&&Jr(y)})}}}function v(){const y=l.unref(t);if(y){y.removeEventListener(Ph,c);const p=new CustomEvent(Oh,{...rv,detail:{focusReason:s.value}});y.addEventListener(Oh,u),y.dispatchEvent(p),!p.defaultPrevented&&(s.value=="keyboard"||!W3()||y.contains(document.activeElement))&&Jr(n??document.body),y.removeEventListener(Oh,u),uv.remove(a)}}return l.onMounted(()=>{i.trapped&&b(),l.watch(()=>i.trapped,y=>{y?b():v()})}),l.onBeforeUnmount(()=>{i.trapped&&v(),t.value&&(t.value.removeEventListener("keydown",o),t.value.removeEventListener("focusin",d),t.value.removeEventListener("focusout",h),t.value=void 0)}),{onKeydown:o}}});function Y3(i,e,t,n,r,s){return l.renderSlot(i.$slots,"default",{handleKeydown:i.onKeydown})}var J3=Yr(X3,[["render",Y3],["__file","focus-trap.vue"]]);const Q3=Er({value:{type:[String,Number],default:""},max:{type:Number,default:99},isDot:Boolean,hidden:Boolean,type:{type:String,values:["primary","success","warning","info","danger"],default:"danger"},showZero:{type:Boolean,default:!0},color:String,badgeStyle:{type:Mn([String,Object,Array])},offset:{type:Mn(Array),default:[0,0]},badgeClass:{type:String}}),Z3=l.defineComponent({name:"ElBadge"}),e4=l.defineComponent({...Z3,props:Q3,setup(i,{expose:e}){const t=i,n=er("badge"),r=l.computed(()=>t.isDot?"":Es(t.value)&&Es(t.max)?t.max<t.value?`${t.max}+`:t.value===0&&!t.showZero?"":`${t.value}`:`${t.value}`),s=l.computed(()=>{var a,o,c,u,d;return[{backgroundColor:t.color,marginRight:jo(-((o=(a=t.offset)==null?void 0:a[0])!=null?o:0)),marginTop:jo((u=(c=t.offset)==null?void 0:c[1])!=null?u:0)},(d=t.badgeStyle)!=null?d:{}]});return e({content:r}),(a,o)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(l.unref(n).b())},[l.renderSlot(a.$slots,"default"),l.createVNode(l.Transition,{name:`${l.unref(n).namespace.value}-zoom-in-center`,persisted:""},{default:l.withCtx(()=>[l.withDirectives(l.createElementVNode("sup",{class:l.normalizeClass([l.unref(n).e("content"),l.unref(n).em("content",a.type),l.unref(n).is("fixed",!!a.$slots.default),l.unref(n).is("dot",a.isDot),a.badgeClass]),style:l.normalizeStyle(l.unref(s)),textContent:l.toDisplayString(l.unref(r))},null,14,["textContent"]),[[l.vShow,!a.hidden&&(l.unref(r)||a.isDot)]])]),_:1},8,["name"])],2))}});var t4=Yr(e4,[["__file","badge.vue"]]);const n4=Sc(t4),hv=Symbol("buttonGroupContextKey"),i4=(i,e)=>{n3({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},l.computed(()=>i.type==="text"));const t=l.inject(hv,void 0),n=Dh("button"),{form:r}=nv(),s=tv(l.computed(()=>t==null?void 0:t.size)),a=Nh(),o=l.ref(),c=l.useSlots(),u=l.computed(()=>i.type||(t==null?void 0:t.type)||""),d=l.computed(()=>{var y,p,f;return(f=(p=i.autoInsertSpace)!=null?p:(y=n.value)==null?void 0:y.autoInsertSpace)!=null?f:!1}),h=l.computed(()=>i.tag==="button"?{ariaDisabled:a.value||i.loading,disabled:a.value||i.loading,autofocus:i.autofocus,type:i.nativeType}:{}),b=l.computed(()=>{var y;const p=(y=c.default)==null?void 0:y.call(c);if(d.value&&(p==null?void 0:p.length)===1){const f=p[0];if((f==null?void 0:f.type)===l.Text){const m=f.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(m.trim())}}return!1});return{_disabled:a,_size:s,_type:u,_ref:o,_props:h,shouldAddSpace:b,handleClick:y=>{i.nativeType==="reset"&&(r==null||r.resetFields()),e("click",y)}}},Lh=Er({size:wh,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:$o},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:$o,default:()=>kc},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:Mn([String,Object]),default:"button"}}),r4={click:i=>i instanceof MouseEvent};function En(i,e){s4(i)&&(i="100%");var t=a4(i);return i=e===360?i:Math.min(e,Math.max(0,parseFloat(i))),t&&(i=parseInt(String(i*e),10)/100),Math.abs(i-e)<1e-6?1:(e===360?i=(i<0?i%e+e:i%e)/parseFloat(String(e)):i=i%e/parseFloat(String(e)),i)}function Pc(i){return Math.min(1,Math.max(0,i))}function s4(i){return typeof i=="string"&&i.indexOf(".")!==-1&&parseFloat(i)===1}function a4(i){return typeof i=="string"&&i.indexOf("%")!==-1}function fv(i){return i=parseFloat(i),(isNaN(i)||i<0||i>1)&&(i=1),i}function Oc(i){return i<=1?"".concat(Number(i)*100,"%"):i}function Ds(i){return i.length===1?"0"+i:String(i)}function o4(i,e,t){return{r:En(i,255)*255,g:En(e,255)*255,b:En(t,255)*255}}function pv(i,e,t){i=En(i,255),e=En(e,255),t=En(t,255);var n=Math.max(i,e,t),r=Math.min(i,e,t),s=0,a=0,o=(n+r)/2;if(n===r)a=0,s=0;else{var c=n-r;switch(a=o>.5?c/(2-n-r):c/(n+r),n){case i:s=(e-t)/c+(e<t?6:0);break;case e:s=(t-i)/c+2;break;case t:s=(i-e)/c+4;break}s/=6}return{h:s,s:a,l:o}}function Bh(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*(6*t):t<1/2?e:t<2/3?i+(e-i)*(2/3-t)*6:i}function l4(i,e,t){var n,r,s;if(i=En(i,360),e=En(e,100),t=En(t,100),e===0)r=t,s=t,n=t;else{var a=t<.5?t*(1+e):t+e-t*e,o=2*t-a;n=Bh(o,a,i+1/3),r=Bh(o,a,i),s=Bh(o,a,i-1/3)}return{r:n*255,g:r*255,b:s*255}}function mv(i,e,t){i=En(i,255),e=En(e,255),t=En(t,255);var n=Math.max(i,e,t),r=Math.min(i,e,t),s=0,a=n,o=n-r,c=n===0?0:o/n;if(n===r)s=0;else{switch(n){case i:s=(e-t)/o+(e<t?6:0);break;case e:s=(t-i)/o+2;break;case t:s=(i-e)/o+4;break}s/=6}return{h:s,s:c,v:a}}function c4(i,e,t){i=En(i,360)*6,e=En(e,100),t=En(t,100);var n=Math.floor(i),r=i-n,s=t*(1-e),a=t*(1-r*e),o=t*(1-(1-r)*e),c=n%6,u=[t,a,s,s,o,t][c],d=[o,t,t,a,s,s][c],h=[s,s,o,t,t,a][c];return{r:u*255,g:d*255,b:h*255}}function gv(i,e,t,n){var r=[Ds(Math.round(i).toString(16)),Ds(Math.round(e).toString(16)),Ds(Math.round(t).toString(16))];return n&&r[0].startsWith(r[0].charAt(1))&&r[1].startsWith(r[1].charAt(1))&&r[2].startsWith(r[2].charAt(1))?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function u4(i,e,t,n,r){var s=[Ds(Math.round(i).toString(16)),Ds(Math.round(e).toString(16)),Ds(Math.round(t).toString(16)),Ds(d4(n))];return r&&s[0].startsWith(s[0].charAt(1))&&s[1].startsWith(s[1].charAt(1))&&s[2].startsWith(s[2].charAt(1))&&s[3].startsWith(s[3].charAt(1))?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}function d4(i){return Math.round(parseFloat(i)*255).toString(16)}function vv(i){return hi(i)/255}function hi(i){return parseInt(i,16)}function h4(i){return{r:i>>16,g:(i&65280)>>8,b:i&255}}var Uh={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function f4(i){var e={r:0,g:0,b:0},t=1,n=null,r=null,s=null,a=!1,o=!1;return typeof i=="string"&&(i=g4(i)),typeof i=="object"&&(wr(i.r)&&wr(i.g)&&wr(i.b)?(e=o4(i.r,i.g,i.b),a=!0,o=String(i.r).substr(-1)==="%"?"prgb":"rgb"):wr(i.h)&&wr(i.s)&&wr(i.v)?(n=Oc(i.s),r=Oc(i.v),e=c4(i.h,n,r),a=!0,o="hsv"):wr(i.h)&&wr(i.s)&&wr(i.l)&&(n=Oc(i.s),s=Oc(i.l),e=l4(i.h,n,s),a=!0,o="hsl"),Object.prototype.hasOwnProperty.call(i,"a")&&(t=i.a)),t=fv(t),{ok:a,format:i.format||o,r:Math.min(255,Math.max(e.r,0)),g:Math.min(255,Math.max(e.g,0)),b:Math.min(255,Math.max(e.b,0)),a:t}}var p4="[-\\+]?\\d+%?",m4="[-\\+]?\\d*\\.\\d+%?",Qr="(?:".concat(m4,")|(?:").concat(p4,")"),Fh="[\\s|\\(]+(".concat(Qr,")[,|\\s]+(").concat(Qr,")[,|\\s]+(").concat(Qr,")\\s*\\)?"),Vh="[\\s|\\(]+(".concat(Qr,")[,|\\s]+(").concat(Qr,")[,|\\s]+(").concat(Qr,")[,|\\s]+(").concat(Qr,")\\s*\\)?"),Ui={CSS_UNIT:new RegExp(Qr),rgb:new RegExp("rgb"+Fh),rgba:new RegExp("rgba"+Vh),hsl:new RegExp("hsl"+Fh),hsla:new RegExp("hsla"+Vh),hsv:new RegExp("hsv"+Fh),hsva:new RegExp("hsva"+Vh),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function g4(i){if(i=i.trim().toLowerCase(),i.length===0)return!1;var e=!1;if(Uh[i])i=Uh[i],e=!0;else if(i==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=Ui.rgb.exec(i);return t?{r:t[1],g:t[2],b:t[3]}:(t=Ui.rgba.exec(i),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Ui.hsl.exec(i),t?{h:t[1],s:t[2],l:t[3]}:(t=Ui.hsla.exec(i),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Ui.hsv.exec(i),t?{h:t[1],s:t[2],v:t[3]}:(t=Ui.hsva.exec(i),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Ui.hex8.exec(i),t?{r:hi(t[1]),g:hi(t[2]),b:hi(t[3]),a:vv(t[4]),format:e?"name":"hex8"}:(t=Ui.hex6.exec(i),t?{r:hi(t[1]),g:hi(t[2]),b:hi(t[3]),format:e?"name":"hex"}:(t=Ui.hex4.exec(i),t?{r:hi(t[1]+t[1]),g:hi(t[2]+t[2]),b:hi(t[3]+t[3]),a:vv(t[4]+t[4]),format:e?"name":"hex8"}:(t=Ui.hex3.exec(i),t?{r:hi(t[1]+t[1]),g:hi(t[2]+t[2]),b:hi(t[3]+t[3]),format:e?"name":"hex"}:!1)))))))))}function wr(i){return!!Ui.CSS_UNIT.exec(String(i))}var v4=function(){function i(e,t){e===void 0&&(e=""),t===void 0&&(t={});var n;if(e instanceof i)return e;typeof e=="number"&&(e=h4(e)),this.originalInput=e;var r=f4(e);this.originalInput=e,this.r=r.r,this.g=r.g,this.b=r.b,this.a=r.a,this.roundA=Math.round(100*this.a)/100,this.format=(n=t.format)!==null&&n!==void 0?n:r.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=r.ok}return i.prototype.isDark=function(){return this.getBrightness()<128},i.prototype.isLight=function(){return!this.isDark()},i.prototype.getBrightness=function(){var e=this.toRgb();return(e.r*299+e.g*587+e.b*114)/1e3},i.prototype.getLuminance=function(){var e=this.toRgb(),t,n,r,s=e.r/255,a=e.g/255,o=e.b/255;return s<=.03928?t=s/12.92:t=Math.pow((s+.055)/1.055,2.4),a<=.03928?n=a/12.92:n=Math.pow((a+.055)/1.055,2.4),o<=.03928?r=o/12.92:r=Math.pow((o+.055)/1.055,2.4),.2126*t+.7152*n+.0722*r},i.prototype.getAlpha=function(){return this.a},i.prototype.setAlpha=function(e){return this.a=fv(e),this.roundA=Math.round(100*this.a)/100,this},i.prototype.isMonochrome=function(){var e=this.toHsl().s;return e===0},i.prototype.toHsv=function(){var e=mv(this.r,this.g,this.b);return{h:e.h*360,s:e.s,v:e.v,a:this.a}},i.prototype.toHsvString=function(){var e=mv(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.v*100);return this.a===1?"hsv(".concat(t,", ").concat(n,"%, ").concat(r,"%)"):"hsva(".concat(t,", ").concat(n,"%, ").concat(r,"%, ").concat(this.roundA,")")},i.prototype.toHsl=function(){var e=pv(this.r,this.g,this.b);return{h:e.h*360,s:e.s,l:e.l,a:this.a}},i.prototype.toHslString=function(){var e=pv(this.r,this.g,this.b),t=Math.round(e.h*360),n=Math.round(e.s*100),r=Math.round(e.l*100);return this.a===1?"hsl(".concat(t,", ").concat(n,"%, ").concat(r,"%)"):"hsla(".concat(t,", ").concat(n,"%, ").concat(r,"%, ").concat(this.roundA,")")},i.prototype.toHex=function(e){return e===void 0&&(e=!1),gv(this.r,this.g,this.b,e)},i.prototype.toHexString=function(e){return e===void 0&&(e=!1),"#"+this.toHex(e)},i.prototype.toHex8=function(e){return e===void 0&&(e=!1),u4(this.r,this.g,this.b,this.a,e)},i.prototype.toHex8String=function(e){return e===void 0&&(e=!1),"#"+this.toHex8(e)},i.prototype.toHexShortString=function(e){return e===void 0&&(e=!1),this.a===1?this.toHexString(e):this.toHex8String(e)},i.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},i.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return this.a===1?"rgb(".concat(e,", ").concat(t,", ").concat(n,")"):"rgba(".concat(e,", ").concat(t,", ").concat(n,", ").concat(this.roundA,")")},i.prototype.toPercentageRgb=function(){var e=function(t){return"".concat(Math.round(En(t,255)*100),"%")};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},i.prototype.toPercentageRgbString=function(){var e=function(t){return Math.round(En(t,255)*100)};return this.a===1?"rgb(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%)"):"rgba(".concat(e(this.r),"%, ").concat(e(this.g),"%, ").concat(e(this.b),"%, ").concat(this.roundA,")")},i.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var e="#"+gv(this.r,this.g,this.b,!1),t=0,n=Object.entries(Uh);t<n.length;t++){var r=n[t],s=r[0],a=r[1];if(e===a)return s}return!1},i.prototype.toString=function(e){var t=!!e;e=e??this.format;var n=!1,r=this.a<1&&this.a>=0,s=!t&&r&&(e.startsWith("hex")||e==="name");return s?e==="name"&&this.a===0?this.toName():this.toRgbString():(e==="rgb"&&(n=this.toRgbString()),e==="prgb"&&(n=this.toPercentageRgbString()),(e==="hex"||e==="hex6")&&(n=this.toHexString()),e==="hex3"&&(n=this.toHexString(!0)),e==="hex4"&&(n=this.toHex8String(!0)),e==="hex8"&&(n=this.toHex8String()),e==="name"&&(n=this.toName()),e==="hsl"&&(n=this.toHslString()),e==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},i.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},i.prototype.clone=function(){return new i(this.toString())},i.prototype.lighten=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l+=e/100,t.l=Pc(t.l),new i(t)},i.prototype.brighten=function(e){e===void 0&&(e=10);var t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(e/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(e/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(e/100)))),new i(t)},i.prototype.darken=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.l-=e/100,t.l=Pc(t.l),new i(t)},i.prototype.tint=function(e){return e===void 0&&(e=10),this.mix("white",e)},i.prototype.shade=function(e){return e===void 0&&(e=10),this.mix("black",e)},i.prototype.desaturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s-=e/100,t.s=Pc(t.s),new i(t)},i.prototype.saturate=function(e){e===void 0&&(e=10);var t=this.toHsl();return t.s+=e/100,t.s=Pc(t.s),new i(t)},i.prototype.greyscale=function(){return this.desaturate(100)},i.prototype.spin=function(e){var t=this.toHsl(),n=(t.h+e)%360;return t.h=n<0?360+n:n,new i(t)},i.prototype.mix=function(e,t){t===void 0&&(t=50);var n=this.toRgb(),r=new i(e).toRgb(),s=t/100,a={r:(r.r-n.r)*s+n.r,g:(r.g-n.g)*s+n.g,b:(r.b-n.b)*s+n.b,a:(r.a-n.a)*s+n.a};return new i(a)},i.prototype.analogous=function(e,t){e===void 0&&(e=6),t===void 0&&(t=30);var n=this.toHsl(),r=360/t,s=[this];for(n.h=(n.h-(r*e>>1)+720)%360;--e;)n.h=(n.h+r)%360,s.push(new i(n));return s},i.prototype.complement=function(){var e=this.toHsl();return e.h=(e.h+180)%360,new i(e)},i.prototype.monochromatic=function(e){e===void 0&&(e=6);for(var t=this.toHsv(),n=t.h,r=t.s,s=t.v,a=[],o=1/e;e--;)a.push(new i({h:n,s:r,v:s})),s=(s+o)%1;return a},i.prototype.splitcomplement=function(){var e=this.toHsl(),t=e.h;return[this,new i({h:(t+72)%360,s:e.s,l:e.l}),new i({h:(t+216)%360,s:e.s,l:e.l})]},i.prototype.onBackground=function(e){var t=this.toRgb(),n=new i(e).toRgb(),r=t.a+n.a*(1-t.a);return new i({r:(t.r*t.a+n.r*n.a*(1-t.a))/r,g:(t.g*t.a+n.g*n.a*(1-t.a))/r,b:(t.b*t.a+n.b*n.a*(1-t.a))/r,a:r})},i.prototype.triad=function(){return this.polyad(3)},i.prototype.tetrad=function(){return this.polyad(4)},i.prototype.polyad=function(e){for(var t=this.toHsl(),n=t.h,r=[this],s=360/e,a=1;a<e;a++)r.push(new i({h:(n+a*s)%360,s:t.s,l:t.l}));return r},i.prototype.equals=function(e){return this.toRgbString()===new i(e).toRgbString()},i}();function Zr(i,e=20){return i.mix("#141414",e).toString()}function y4(i){const e=Nh(),t=er("button");return l.computed(()=>{let n={},r=i.color;if(r){const s=r.match(/var\((.*?)\)/);s&&(r=window.getComputedStyle(window.document.documentElement).getPropertyValue(s[1]));const a=new v4(r),o=i.dark?a.tint(20).toString():Zr(a,20);if(i.plain)n=t.cssVarBlock({"bg-color":i.dark?Zr(a,90):a.tint(90).toString(),"text-color":r,"border-color":i.dark?Zr(a,50):a.tint(50).toString(),"hover-text-color":`var(${t.cssVarName("color-white")})`,"hover-bg-color":r,"hover-border-color":r,"active-bg-color":o,"active-text-color":`var(${t.cssVarName("color-white")})`,"active-border-color":o}),e.value&&(n[t.cssVarBlockName("disabled-bg-color")]=i.dark?Zr(a,90):a.tint(90).toString(),n[t.cssVarBlockName("disabled-text-color")]=i.dark?Zr(a,50):a.tint(50).toString(),n[t.cssVarBlockName("disabled-border-color")]=i.dark?Zr(a,80):a.tint(80).toString());else{const c=i.dark?Zr(a,30):a.tint(30).toString(),u=a.isDark()?`var(${t.cssVarName("color-white")})`:`var(${t.cssVarName("color-black")})`;if(n=t.cssVarBlock({"bg-color":r,"text-color":u,"border-color":r,"hover-bg-color":c,"hover-text-color":u,"hover-border-color":c,"active-bg-color":o,"active-border-color":o}),e.value){const d=i.dark?Zr(a,50):a.tint(50).toString();n[t.cssVarBlockName("disabled-bg-color")]=d,n[t.cssVarBlockName("disabled-text-color")]=i.dark?"rgba(255, 255, 255, 0.5)":`var(${t.cssVarName("color-white")})`,n[t.cssVarBlockName("disabled-border-color")]=d}}}return n})}const b4=l.defineComponent({name:"ElButton"}),_4=l.defineComponent({...b4,props:Lh,emits:r4,setup(i,{expose:e,emit:t}){const n=i,r=y4(n),s=er("button"),{_ref:a,_size:o,_type:c,_disabled:u,_props:d,shouldAddSpace:h,handleClick:b}=i4(n,t),v=l.computed(()=>[s.b(),s.m(c.value),s.m(o.value),s.is("disabled",u.value),s.is("loading",n.loading),s.is("plain",n.plain),s.is("round",n.round),s.is("circle",n.circle),s.is("text",n.text),s.is("link",n.link),s.is("has-bg",n.bg)]);return e({ref:a,size:o,type:c,disabled:u,shouldAddSpace:h}),(y,p)=>(l.openBlock(),l.createBlock(l.resolveDynamicComponent(y.tag),l.mergeProps({ref_key:"_ref",ref:a},l.unref(d),{class:l.unref(v),style:l.unref(r),onClick:l.unref(b)}),{default:l.withCtx(()=>[y.loading?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[y.$slots.loading?l.renderSlot(y.$slots,"loading",{key:0}):(l.openBlock(),l.createBlock(l.unref(tr),{key:1,class:l.normalizeClass(l.unref(s).is("loading"))},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(y.loadingIcon)))]),_:1},8,["class"]))],64)):y.icon||y.$slots.icon?(l.openBlock(),l.createBlock(l.unref(tr),{key:1},{default:l.withCtx(()=>[y.icon?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(y.icon),{key:0})):l.renderSlot(y.$slots,"icon",{key:1})]),_:3})):l.createCommentVNode("v-if",!0),y.$slots.default?(l.openBlock(),l.createElementBlock("span",{key:2,class:l.normalizeClass({[l.unref(s).em("text","expand")]:l.unref(h)})},[l.renderSlot(y.$slots,"default")],2)):l.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var k4=Yr(_4,[["__file","button.vue"]]);const T4={size:Lh.size,type:Lh.type},S4=l.defineComponent({name:"ElButtonGroup"}),C4=l.defineComponent({...S4,props:T4,setup(i){const e=i;l.provide(hv,l.reactive({size:l.toRef(e,"size"),type:l.toRef(e,"type")}));const t=er("button");return(n,r)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(l.unref(t).b("group"))},[l.renderSlot(n.$slots,"default")],2))}});var yv=Yr(C4,[["__file","button-group.vue"]]);const Mc=Sc(k4,{ButtonGroup:yv});Yw(yv);var Rc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ga(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function x4(i){if(i.__esModule)return i;var e=i.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(i).forEach(function(n){var r=Object.getOwnPropertyDescriptor(i,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return i[n]}})}),t}var Lc={exports:{}},E4=Lc.exports,bv;function w4(){return bv||(bv=1,function(i,e){(function(t,n){i.exports=n()})(E4,function(){var t=1e3,n=6e4,r=36e5,s="millisecond",a="second",o="minute",c="hour",u="day",d="week",h="month",b="quarter",v="year",y="date",p="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,_={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(ie){var X=["th","st","nd","rd"],H=ie%100;return"["+ie+(X[(H-20)%10]||X[H]||X[0])+"]"}},k=function(ie,X,H){var $=String(ie);return!$||$.length>=X?ie:""+Array(X+1-$.length).join(H)+ie},D={s:k,z:function(ie){var X=-ie.utcOffset(),H=Math.abs(X),$=Math.floor(H/60),j=H%60;return(X<=0?"+":"-")+k($,2,"0")+":"+k(j,2,"0")},m:function ie(X,H){if(X.date()<H.date())return-ie(H,X);var $=12*(H.year()-X.year())+(H.month()-X.month()),j=X.clone().add($,h),B=H-j<0,q=X.clone().add($+(B?-1:1),h);return+(-($+(H-j)/(B?j-q:q-j))||0)},a:function(ie){return ie<0?Math.ceil(ie)||0:Math.floor(ie)},p:function(ie){return{M:h,y:v,w:d,d:u,D:y,h:c,m:o,s:a,ms:s,Q:b}[ie]||String(ie||"").toLowerCase().replace(/s$/,"")},u:function(ie){return ie===void 0}},E="en",A={};A[E]=_;var w="$isDayjsObject",N=function(ie){return ie instanceof V||!(!ie||!ie[w])},S=function ie(X,H,$){var j;if(!X)return E;if(typeof X=="string"){var B=X.toLowerCase();A[B]&&(j=B),H&&(A[B]=H,j=B);var q=X.split("-");if(!j&&q.length>1)return ie(q[0])}else{var z=X.name;A[z]=X,j=z}return!$&&j&&(E=j),j||!$&&E},P=function(ie,X){if(N(ie))return ie.clone();var H=typeof X=="object"?X:{};return H.date=ie,H.args=arguments,new V(H)},F=D;F.l=S,F.i=N,F.w=function(ie,X){return P(ie,{locale:X.$L,utc:X.$u,x:X.$x,$offset:X.$offset})};var V=function(){function ie(H){this.$L=S(H.locale,null,!0),this.parse(H),this.$x=this.$x||H.x||{},this[w]=!0}var X=ie.prototype;return X.parse=function(H){this.$d=function($){var j=$.date,B=$.utc;if(j===null)return new Date(NaN);if(F.u(j))return new Date;if(j instanceof Date)return new Date(j);if(typeof j=="string"&&!/Z$/i.test(j)){var q=j.match(f);if(q){var z=q[2]-1||0,oe=(q[7]||"0").substring(0,3);return B?new Date(Date.UTC(q[1],z,q[3]||1,q[4]||0,q[5]||0,q[6]||0,oe)):new Date(q[1],z,q[3]||1,q[4]||0,q[5]||0,q[6]||0,oe)}}return new Date(j)}(H),this.init()},X.init=function(){var H=this.$d;this.$y=H.getFullYear(),this.$M=H.getMonth(),this.$D=H.getDate(),this.$W=H.getDay(),this.$H=H.getHours(),this.$m=H.getMinutes(),this.$s=H.getSeconds(),this.$ms=H.getMilliseconds()},X.$utils=function(){return F},X.isValid=function(){return this.$d.toString()!==p},X.isSame=function(H,$){var j=P(H);return this.startOf($)<=j&&j<=this.endOf($)},X.isAfter=function(H,$){return P(H)<this.startOf($)},X.isBefore=function(H,$){return this.endOf($)<P(H)},X.$g=function(H,$,j){return F.u(H)?this[$]:this.set(j,H)},X.unix=function(){return Math.floor(this.valueOf()/1e3)},X.valueOf=function(){return this.$d.getTime()},X.startOf=function(H,$){var j=this,B=!!F.u($)||$,q=F.p(H),z=function(We,pe){var Ne=F.w(j.$u?Date.UTC(j.$y,pe,We):new Date(j.$y,pe,We),j);return B?Ne:Ne.endOf(u)},oe=function(We,pe){return F.w(j.toDate()[We].apply(j.toDate("s"),(B?[0,0,0,0]:[23,59,59,999]).slice(pe)),j)},we=this.$W,be=this.$M,Z=this.$D,_e="set"+(this.$u?"UTC":"");switch(q){case v:return B?z(1,0):z(31,11);case h:return B?z(1,be):z(0,be+1);case d:var Te=this.$locale().weekStart||0,Ue=(we<Te?we+7:we)-Te;return z(B?Z-Ue:Z+(6-Ue),be);case u:case y:return oe(_e+"Hours",0);case c:return oe(_e+"Minutes",1);case o:return oe(_e+"Seconds",2);case a:return oe(_e+"Milliseconds",3);default:return this.clone()}},X.endOf=function(H){return this.startOf(H,!1)},X.$set=function(H,$){var j,B=F.p(H),q="set"+(this.$u?"UTC":""),z=(j={},j[u]=q+"Date",j[y]=q+"Date",j[h]=q+"Month",j[v]=q+"FullYear",j[c]=q+"Hours",j[o]=q+"Minutes",j[a]=q+"Seconds",j[s]=q+"Milliseconds",j)[B],oe=B===u?this.$D+($-this.$W):$;if(B===h||B===v){var we=this.clone().set(y,1);we.$d[z](oe),we.init(),this.$d=we.set(y,Math.min(this.$D,we.daysInMonth())).$d}else z&&this.$d[z](oe);return this.init(),this},X.set=function(H,$){return this.clone().$set(H,$)},X.get=function(H){return this[F.p(H)]()},X.add=function(H,$){var j,B=this;H=Number(H);var q=F.p($),z=function(be){var Z=P(B);return F.w(Z.date(Z.date()+Math.round(be*H)),B)};if(q===h)return this.set(h,this.$M+H);if(q===v)return this.set(v,this.$y+H);if(q===u)return z(1);if(q===d)return z(7);var oe=(j={},j[o]=n,j[c]=r,j[a]=t,j)[q]||1,we=this.$d.getTime()+H*oe;return F.w(we,this)},X.subtract=function(H,$){return this.add(-1*H,$)},X.format=function(H){var $=this,j=this.$locale();if(!this.isValid())return j.invalidDate||p;var B=H||"YYYY-MM-DDTHH:mm:ssZ",q=F.z(this),z=this.$H,oe=this.$m,we=this.$M,be=j.weekdays,Z=j.months,_e=j.meridiem,Te=function(pe,Ne,nt,le){return pe&&(pe[Ne]||pe($,B))||nt[Ne].slice(0,le)},Ue=function(pe){return F.s(z%12||12,pe,"0")},We=_e||function(pe,Ne,nt){var le=pe<12?"AM":"PM";return nt?le.toLowerCase():le};return B.replace(m,function(pe,Ne){return Ne||function(nt){switch(nt){case"YY":return String($.$y).slice(-2);case"YYYY":return F.s($.$y,4,"0");case"M":return we+1;case"MM":return F.s(we+1,2,"0");case"MMM":return Te(j.monthsShort,we,Z,3);case"MMMM":return Te(Z,we);case"D":return $.$D;case"DD":return F.s($.$D,2,"0");case"d":return String($.$W);case"dd":return Te(j.weekdaysMin,$.$W,be,2);case"ddd":return Te(j.weekdaysShort,$.$W,be,3);case"dddd":return be[$.$W];case"H":return String(z);case"HH":return F.s(z,2,"0");case"h":return Ue(1);case"hh":return Ue(2);case"a":return We(z,oe,!0);case"A":return We(z,oe,!1);case"m":return String(oe);case"mm":return F.s(oe,2,"0");case"s":return String($.$s);case"ss":return F.s($.$s,2,"0");case"SSS":return F.s($.$ms,3,"0");case"Z":return q}return null}(pe)||q.replace(":","")})},X.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},X.diff=function(H,$,j){var B,q=this,z=F.p($),oe=P(H),we=(oe.utcOffset()-this.utcOffset())*n,be=this-oe,Z=function(){return F.m(q,oe)};switch(z){case v:B=Z()/12;break;case h:B=Z();break;case b:B=Z()/3;break;case d:B=(be-we)/6048e5;break;case u:B=(be-we)/864e5;break;case c:B=be/r;break;case o:B=be/n;break;case a:B=be/t;break;default:B=be}return j?B:F.a(B)},X.daysInMonth=function(){return this.endOf(h).$D},X.$locale=function(){return A[this.$L]},X.locale=function(H,$){if(!H)return this.$L;var j=this.clone(),B=S(H,$,!0);return B&&(j.$L=B),j},X.clone=function(){return F.w(this.$d,this)},X.toDate=function(){return new Date(this.valueOf())},X.toJSON=function(){return this.isValid()?this.toISOString():null},X.toISOString=function(){return this.$d.toISOString()},X.toString=function(){return this.$d.toUTCString()},ie}(),J=V.prototype;return P.prototype=J,[["$ms",s],["$s",a],["$m",o],["$H",c],["$W",u],["$M",h],["$y",v],["$D",y]].forEach(function(ie){J[ie[1]]=function(X){return this.$g(X,ie[0],ie[1])}}),P.extend=function(ie,X){return ie.$i||(ie(X,V,P),ie.$i=!0),P},P.locale=S,P.isDayjs=N,P.unix=function(ie){return P(1e3*ie)},P.en=A[E],P.Ls=A,P.p={},P})}(Lc)),Lc.exports}var D4=w4();const Qn=ga(D4),jh="_trap-focus-children",As=[],_v=i=>{var e;if(As.length===0)return;const t=As[As.length-1][jh];if(t.length>0&&i.code===Cc.tab){if(t.length===1){i.preventDefault(),document.activeElement!==t[0]&&t[0].focus();return}const n=i.shiftKey,r=i.target===t[0],s=i.target===t[t.length-1];if(r&&n&&(i.preventDefault(),t[t.length-1].focus()),s&&!n&&(i.preventDefault(),t[0].focus()),process.env.NODE_ENV==="test"){const a=t.indexOf(i.target);a!==-1&&((e=t[n?a-1:a+1])==null||e.focus())}}},A4={beforeMount(i){i[jh]=Jg(i),As.push(i),As.length<=1&&document.addEventListener("keydown",_v)},updated(i){l.nextTick(()=>{i[jh]=Jg(i)})},unmounted(){As.shift(),As.length===0&&document.removeEventListener("keydown",_v)}},I4=Er({mask:{type:Boolean,default:!0},customMaskEvent:Boolean,overlayClass:{type:Mn([String,Array,Object])},zIndex:{type:Mn([String,Number])}}),N4={click:i=>i instanceof MouseEvent},P4="overlay";var O4=l.defineComponent({name:"ElOverlay",props:I4,emits:N4,setup(i,{slots:e,emit:t}){const n=er(P4),r=c=>{t("click",c)},{onClick:s,onMousedown:a,onMouseup:o}=H0(i.customMaskEvent?void 0:r);return()=>i.mask?l.createVNode("div",{class:[n.b(),i.overlayClass],style:{zIndex:i.zIndex},onClick:s,onMousedown:a,onMouseup:o},[l.renderSlot(e,"default")],xc.STYLE|xc.CLASS|xc.PROPS,["onClick","onMouseup","onMousedown"]):l.h("div",{class:i.overlayClass,style:{zIndex:i.zIndex,position:"fixed",top:"0px",right:"0px",bottom:"0px",left:"0px"}},[l.renderSlot(e,"default")])}});const M4=O4,kv=["success","info","warning","error"],Rn=U0({customClass:"",center:!1,dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",plain:!1,offset:16,zIndex:0,grouping:!1,repeatNum:1,appendTo:zn?document.body:void 0}),R4=Er({customClass:{type:String,default:Rn.customClass},center:{type:Boolean,default:Rn.center},dangerouslyUseHTMLString:{type:Boolean,default:Rn.dangerouslyUseHTMLString},duration:{type:Number,default:Rn.duration},icon:{type:$o,default:Rn.icon},id:{type:String,default:Rn.id},message:{type:Mn([String,Object,Function]),default:Rn.message},onClose:{type:Mn(Function),default:Rn.onClose},showClose:{type:Boolean,default:Rn.showClose},type:{type:String,values:kv,default:Rn.type},plain:{type:Boolean,default:Rn.plain},offset:{type:Number,default:Rn.offset},zIndex:{type:Number,default:Rn.zIndex},grouping:{type:Boolean,default:Rn.grouping},repeatNum:{type:Number,default:Rn.repeatNum}}),L4={destroy:()=>!0},Fi=l.shallowReactive([]),B4=i=>{const e=Fi.findIndex(r=>r.id===i),t=Fi[e];let n;return e>0&&(n=Fi[e-1]),{current:t,prev:n}},U4=i=>{const{prev:e}=B4(i);return e?e.vm.exposed.bottom.value:0},F4=(i,e)=>Fi.findIndex(n=>n.id===i)>0?16:e,V4=l.defineComponent({name:"ElMessage"}),j4=l.defineComponent({...V4,props:R4,emits:L4,setup(i,{expose:e}){const t=i,{Close:n}=L0,{ns:r,zIndex:s}=Q0("message"),{currentZIndex:a,nextZIndex:o}=s,c=l.ref(),u=l.ref(!1),d=l.ref(0);let h;const b=l.computed(()=>t.type?t.type==="error"?"danger":t.type:"info"),v=l.computed(()=>{const w=t.type;return{[r.bm("icon",w)]:w&&Tc[w]}}),y=l.computed(()=>t.icon||Tc[t.type]||""),p=l.computed(()=>U4(t.id)),f=l.computed(()=>F4(t.id,t.offset)+p.value),m=l.computed(()=>d.value+f.value),_=l.computed(()=>({top:`${f.value}px`,zIndex:a.value}));function k(){t.duration!==0&&({stop:h}=Tx(()=>{E()},t.duration))}function D(){h==null||h()}function E(){u.value=!1}function A({code:w}){w===Cc.esc&&E()}return l.onMounted(()=>{k(),o(),u.value=!0}),l.watch(()=>t.repeatNum,()=>{D(),k()}),fa(document,"keydown",A),r0(c,()=>{d.value=c.value.getBoundingClientRect().height}),e({visible:u,bottom:m,close:E}),(w,N)=>(l.openBlock(),l.createBlock(l.Transition,{name:l.unref(r).b("fade"),onBeforeLeave:w.onClose,onAfterLeave:S=>w.$emit("destroy"),persisted:""},{default:l.withCtx(()=>[l.withDirectives(l.createElementVNode("div",{id:w.id,ref_key:"messageRef",ref:c,class:l.normalizeClass([l.unref(r).b(),{[l.unref(r).m(w.type)]:w.type},l.unref(r).is("center",w.center),l.unref(r).is("closable",w.showClose),l.unref(r).is("plain",w.plain),w.customClass]),style:l.normalizeStyle(l.unref(_)),role:"alert",onMouseenter:D,onMouseleave:k},[w.repeatNum>1?(l.openBlock(),l.createBlock(l.unref(n4),{key:0,value:w.repeatNum,type:l.unref(b),class:l.normalizeClass(l.unref(r).e("badge"))},null,8,["value","type","class"])):l.createCommentVNode("v-if",!0),l.unref(y)?(l.openBlock(),l.createBlock(l.unref(tr),{key:1,class:l.normalizeClass([l.unref(r).e("icon"),l.unref(v)])},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(l.unref(y))))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0),l.renderSlot(w.$slots,"default",{},()=>[w.dangerouslyUseHTMLString?(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createCommentVNode(" Caution here, message could've been compromised, never use user's input as message "),l.createElementVNode("p",{class:l.normalizeClass(l.unref(r).e("content")),innerHTML:w.message},null,10,["innerHTML"])],2112)):(l.openBlock(),l.createElementBlock("p",{key:0,class:l.normalizeClass(l.unref(r).e("content"))},l.toDisplayString(w.message),3))]),w.showClose?(l.openBlock(),l.createBlock(l.unref(tr),{key:2,class:l.normalizeClass(l.unref(r).e("closeBtn")),onClick:l.withModifiers(E,["stop"])},{default:l.withCtx(()=>[l.createVNode(l.unref(n))]),_:1},8,["class","onClick"])):l.createCommentVNode("v-if",!0)],46,["id"]),[[l.vShow,u.value]])]),_:3},8,["name","onBeforeLeave","onAfterLeave"]))}});var $4=Yr(j4,[["__file","message.vue"]]);let H4=1;const Tv=i=>{const e=!i||Ri(i)||l.isVNode(i)||Kr(i)?{message:i}:i,t={...Rn,...e};if(!t.appendTo)t.appendTo=document.body;else if(Ri(t.appendTo)){let n=document.querySelector(t.appendTo);bc(n)||(Li("ElMessage","the appendTo option is not an HTMLElement. Falling back to document.body."),n=document.body),t.appendTo=n}return t},q4=i=>{const e=Fi.indexOf(i);if(e===-1)return;Fi.splice(e,1);const{handler:t}=i;t.close()},z4=({appendTo:i,...e},t)=>{const n=`message_${H4++}`,r=e.onClose,s=document.createElement("div"),a={...e,id:n,onClose:()=>{r==null||r(),q4(d)},onDestroy:()=>{l.render(null,s)}},o=l.createVNode($4,a,Kr(a.message)||l.isVNode(a.message)?{default:Kr(a.message)?a.message:()=>a.message}:null);o.appContext=t||va._context,l.render(o,s),i.appendChild(s.firstElementChild);const c=o.component,d={id:n,vnode:o,vm:c,handler:{close:()=>{c.exposed.visible.value=!1}},props:o.component.props};return d},va=(i={},e)=>{if(!zn)return{close:()=>{}};if(Es(Ah.max)&&Fi.length>=Ah.max)return{close:()=>{}};const t=Tv(i);if(t.grouping&&Fi.length){const r=Fi.find(({vnode:s})=>{var a;return((a=s.props)==null?void 0:a.message)===t.message});if(r)return r.props.repeatNum+=1,r.props.type=t.type,r.handler}const n=z4(t,e);return Fi.push(n),n.handler};kv.forEach(i=>{va[i]=(e={},t)=>{const n=Tv(e);return va({...n,type:i},t)}});function G4(i){for(const e of Fi)(!i||i===e.props.type)&&e.handler.close()}va.closeAll=G4,va._context=null;const Ln=Xw(va,"$message"),W4=l.defineComponent({name:"ElMessageBox",directives:{TrapFocus:A4},components:{ElButton:Mc,ElFocusTrap:J3,ElInput:U3,ElOverlay:M4,ElIcon:tr,...L0},inheritAttrs:!1,props:{buttonSize:{type:String,validator:Jw},modal:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},closeOnHashChange:{type:Boolean,default:!0},center:Boolean,draggable:Boolean,overflow:Boolean,roundButton:{default:!1,type:Boolean},container:{type:String,default:"body"},boxType:{type:String,default:""}},emits:["vanish","action"],setup(i,{emit:e}){const{locale:t,zIndex:n,ns:r,size:s}=Q0("message-box",l.computed(()=>i.buttonSize)),{t:a}=t,{nextZIndex:o}=n,c=l.ref(!1),u=l.reactive({autofocus:!0,beforeClose:null,callback:null,cancelButtonText:"",cancelButtonClass:"",confirmButtonText:"",confirmButtonClass:"",customClass:"",customStyle:{},dangerouslyUseHTMLString:!1,distinguishCancelAndClose:!1,icon:"",inputPattern:null,inputPlaceholder:"",inputType:"text",inputValue:null,inputValidator:null,inputErrorMessage:"",message:null,modalFade:!0,modalClass:"",showCancelButton:!1,showConfirmButton:!0,type:"",title:void 0,showInput:!1,action:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonLoadingIcon:l.markRaw(kc),cancelButtonLoadingIcon:l.markRaw(kc),confirmButtonDisabled:!1,editorErrorMessage:"",validateError:!1,zIndex:o()}),d=l.computed(()=>{const H=u.type;return{[r.bm("icon",H)]:H&&Tc[H]}}),h=Eh(),b=Eh(),v=l.computed(()=>u.icon||Tc[u.type]||""),y=l.computed(()=>!!u.message),p=l.ref(),f=l.ref(),m=l.ref(),_=l.ref(),k=l.ref(),D=l.computed(()=>u.confirmButtonClass);l.watch(()=>u.inputValue,async H=>{await l.nextTick(),i.boxType==="prompt"&&H!==null&&V()},{immediate:!0}),l.watch(()=>c.value,H=>{var $,j;H&&(i.boxType!=="prompt"&&(u.autofocus?m.value=(j=($=k.value)==null?void 0:$.$el)!=null?j:p.value:m.value=p.value),u.zIndex=o()),i.boxType==="prompt"&&(H?l.nextTick().then(()=>{var B;_.value&&_.value.$el&&(u.autofocus?m.value=(B=J())!=null?B:p.value:m.value=p.value)}):(u.editorErrorMessage="",u.validateError=!1))});const E=l.computed(()=>i.draggable),A=l.computed(()=>i.overflow);i3(p,f,E,A),l.onMounted(async()=>{await l.nextTick(),i.closeOnHashChange&&window.addEventListener("hashchange",w)}),l.onBeforeUnmount(()=>{i.closeOnHashChange&&window.removeEventListener("hashchange",w)});function w(){c.value&&(c.value=!1,l.nextTick(()=>{u.action&&e("action",u.action)}))}const N=()=>{i.closeOnClickModal&&F(u.distinguishCancelAndClose?"close":"cancel")},S=H0(N),P=H=>{if(u.inputType!=="textarea")return H.preventDefault(),F("confirm")},F=H=>{var $;i.boxType==="prompt"&&H==="confirm"&&!V()||(u.action=H,u.beforeClose?($=u.beforeClose)==null||$.call(u,H,u,w):w())},V=()=>{if(i.boxType==="prompt"){const H=u.inputPattern;if(H&&!H.test(u.inputValue||""))return u.editorErrorMessage=u.inputErrorMessage||a("el.messagebox.error"),u.validateError=!0,!1;const $=u.inputValidator;if(typeof $=="function"){const j=$(u.inputValue);if(j===!1)return u.editorErrorMessage=u.inputErrorMessage||a("el.messagebox.error"),u.validateError=!0,!1;if(typeof j=="string")return u.editorErrorMessage=j,u.validateError=!0,!1}}return u.editorErrorMessage="",u.validateError=!1,!0},J=()=>{const H=_.value.$refs;return H.input||H.textarea},ie=()=>{F("close")},X=()=>{i.closeOnPressEscape&&ie()};return i.lockScroll&&u3(c),{...l.toRefs(u),ns:r,overlayEvent:S,visible:c,hasMessage:y,typeClass:d,contentId:h,inputId:b,btnSize:s,iconComponent:v,confirmButtonClasses:D,rootRef:p,focusStartRef:m,headerRef:f,inputRef:_,confirmRef:k,doClose:w,handleClose:ie,onCloseRequested:X,handleWrapperClick:N,handleInputEnter:P,handleAction:F,t:a}}});function K4(i,e,t,n,r,s){const a=l.resolveComponent("el-icon"),o=l.resolveComponent("close"),c=l.resolveComponent("el-input"),u=l.resolveComponent("el-button"),d=l.resolveComponent("el-focus-trap"),h=l.resolveComponent("el-overlay");return l.openBlock(),l.createBlock(l.Transition,{name:"fade-in-linear",onAfterLeave:b=>i.$emit("vanish"),persisted:""},{default:l.withCtx(()=>[l.withDirectives(l.createVNode(h,{"z-index":i.zIndex,"overlay-class":[i.ns.is("message-box"),i.modalClass],mask:i.modal},{default:l.withCtx(()=>[l.createElementVNode("div",{role:"dialog","aria-label":i.title,"aria-modal":"true","aria-describedby":i.showInput?void 0:i.contentId,class:l.normalizeClass(`${i.ns.namespace.value}-overlay-message-box`),onClick:i.overlayEvent.onClick,onMousedown:i.overlayEvent.onMousedown,onMouseup:i.overlayEvent.onMouseup},[l.createVNode(d,{loop:"",trapped:i.visible,"focus-trap-el":i.rootRef,"focus-start-el":i.focusStartRef,onReleaseRequested:i.onCloseRequested},{default:l.withCtx(()=>[l.createElementVNode("div",{ref:"rootRef",class:l.normalizeClass([i.ns.b(),i.customClass,i.ns.is("draggable",i.draggable),{[i.ns.m("center")]:i.center}]),style:l.normalizeStyle(i.customStyle),tabindex:"-1",onClick:l.withModifiers(()=>{},["stop"])},[i.title!==null&&i.title!==void 0?(l.openBlock(),l.createElementBlock("div",{key:0,ref:"headerRef",class:l.normalizeClass([i.ns.e("header"),{"show-close":i.showClose}])},[l.createElementVNode("div",{class:l.normalizeClass(i.ns.e("title"))},[i.iconComponent&&i.center?(l.openBlock(),l.createBlock(a,{key:0,class:l.normalizeClass([i.ns.e("status"),i.typeClass])},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(i.iconComponent)))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0),l.createElementVNode("span",null,l.toDisplayString(i.title),1)],2),i.showClose?(l.openBlock(),l.createElementBlock("button",{key:0,type:"button",class:l.normalizeClass(i.ns.e("headerbtn")),"aria-label":i.t("el.messagebox.close"),onClick:b=>i.handleAction(i.distinguishCancelAndClose?"close":"cancel"),onKeydown:l.withKeys(l.withModifiers(b=>i.handleAction(i.distinguishCancelAndClose?"close":"cancel"),["prevent"]),["enter"])},[l.createVNode(a,{class:l.normalizeClass(i.ns.e("close"))},{default:l.withCtx(()=>[l.createVNode(o)]),_:1},8,["class"])],42,["aria-label","onClick","onKeydown"])):l.createCommentVNode("v-if",!0)],2)):l.createCommentVNode("v-if",!0),l.createElementVNode("div",{id:i.contentId,class:l.normalizeClass(i.ns.e("content"))},[l.createElementVNode("div",{class:l.normalizeClass(i.ns.e("container"))},[i.iconComponent&&!i.center&&i.hasMessage?(l.openBlock(),l.createBlock(a,{key:0,class:l.normalizeClass([i.ns.e("status"),i.typeClass])},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(i.iconComponent)))]),_:1},8,["class"])):l.createCommentVNode("v-if",!0),i.hasMessage?(l.openBlock(),l.createElementBlock("div",{key:1,class:l.normalizeClass(i.ns.e("message"))},[l.renderSlot(i.$slots,"default",{},()=>[i.dangerouslyUseHTMLString?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(i.showInput?"label":"p"),{key:1,for:i.showInput?i.inputId:void 0,innerHTML:i.message},null,8,["for","innerHTML"])):(l.openBlock(),l.createBlock(l.resolveDynamicComponent(i.showInput?"label":"p"),{key:0,for:i.showInput?i.inputId:void 0},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(i.dangerouslyUseHTMLString?"":i.message),1)]),_:1},8,["for"]))])],2)):l.createCommentVNode("v-if",!0)],2),l.withDirectives(l.createElementVNode("div",{class:l.normalizeClass(i.ns.e("input"))},[l.createVNode(c,{id:i.inputId,ref:"inputRef",modelValue:i.inputValue,"onUpdate:modelValue":b=>i.inputValue=b,type:i.inputType,placeholder:i.inputPlaceholder,"aria-invalid":i.validateError,class:l.normalizeClass({invalid:i.validateError}),onKeydown:l.withKeys(i.handleInputEnter,["enter"])},null,8,["id","modelValue","onUpdate:modelValue","type","placeholder","aria-invalid","class","onKeydown"]),l.createElementVNode("div",{class:l.normalizeClass(i.ns.e("errormsg")),style:l.normalizeStyle({visibility:i.editorErrorMessage?"visible":"hidden"})},l.toDisplayString(i.editorErrorMessage),7)],2),[[l.vShow,i.showInput]])],10,["id"]),l.createElementVNode("div",{class:l.normalizeClass(i.ns.e("btns"))},[i.showCancelButton?(l.openBlock(),l.createBlock(u,{key:0,loading:i.cancelButtonLoading,"loading-icon":i.cancelButtonLoadingIcon,class:l.normalizeClass([i.cancelButtonClass]),round:i.roundButton,size:i.btnSize,onClick:b=>i.handleAction("cancel"),onKeydown:l.withKeys(l.withModifiers(b=>i.handleAction("cancel"),["prevent"]),["enter"])},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(i.cancelButtonText||i.t("el.messagebox.cancel")),1)]),_:1},8,["loading","loading-icon","class","round","size","onClick","onKeydown"])):l.createCommentVNode("v-if",!0),l.withDirectives(l.createVNode(u,{ref:"confirmRef",type:"primary",loading:i.confirmButtonLoading,"loading-icon":i.confirmButtonLoadingIcon,class:l.normalizeClass([i.confirmButtonClasses]),round:i.roundButton,disabled:i.confirmButtonDisabled,size:i.btnSize,onClick:b=>i.handleAction("confirm"),onKeydown:l.withKeys(l.withModifiers(b=>i.handleAction("confirm"),["prevent"]),["enter"])},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(i.confirmButtonText||i.t("el.messagebox.confirm")),1)]),_:1},8,["loading","loading-icon","class","round","disabled","size","onClick","onKeydown"]),[[l.vShow,i.showConfirmButton]])],2)],14,["onClick"])]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])],42,["aria-label","aria-describedby","onClick","onMousedown","onMouseup"])]),_:3},8,["z-index","overlay-class","mask"]),[[l.vShow,i.visible]])]),_:3},8,["onAfterLeave"])}var X4=Yr(W4,[["render",K4],["__file","index.vue"]]);const Ho=new Map,Y4=i=>{let e=document.body;return i.appendTo&&(Ri(i.appendTo)&&(e=document.querySelector(i.appendTo)),bc(i.appendTo)&&(e=i.appendTo),bc(e)||(Li("ElMessageBox","the appendTo option is not an HTMLElement. Falling back to document.body."),e=document.body)),e},J4=(i,e,t=null)=>{const n=l.createVNode(X4,i,Kr(i.message)||l.isVNode(i.message)?{default:Kr(i.message)?i.message:()=>i.message}:null);return n.appContext=t,l.render(n,e),Y4(i).appendChild(e.firstElementChild),n.component},Q4=()=>document.createElement("div"),Z4=(i,e)=>{const t=Q4();i.onVanish=()=>{l.render(null,t),Ho.delete(r)},i.onAction=s=>{const a=Ho.get(r);let o;i.showInput?o={value:r.inputValue,action:s}:o=s,i.callback?i.callback(o,n.proxy):s==="cancel"||s==="close"?i.distinguishCancelAndClose&&s!=="cancel"?a.reject("close"):a.reject("cancel"):a.resolve(o)};const n=J4(i,t,e),r=n.proxy;for(const s in i)fc(i,s)&&!fc(r.$props,s)&&(r[s]=i[s]);return r.visible=!0,r};function ya(i,e=null){if(!zn)return Promise.reject();let t;return Ri(i)||l.isVNode(i)?i={message:i}:t=i.callback,new Promise((n,r)=>{const s=Z4(i,e??ya._context);Ho.set(s,{options:i,callback:t,resolve:n,reject:r})})}const e5=["alert","confirm","prompt"],t5={alert:{closeOnPressEscape:!1,closeOnClickModal:!1},confirm:{showCancelButton:!0},prompt:{showCancelButton:!0,showInput:!0}};e5.forEach(i=>{ya[i]=n5(i)});function n5(i){return(e,t,n,r)=>{let s="";return Bo(t)?(n=t,s=""):C0(t)?s="":s=t,ya(Object.assign({title:s,message:e,type:"",...t5[i]},n,{boxType:i}),r)}}ya.close=()=>{Ho.forEach((i,e)=>{e.doClose()}),Ho.clear()},ya._context=null;const es=ya;es.install=i=>{es._context=i._context,i.config.globalProperties.$msgbox=es,i.config.globalProperties.$messageBox=es,i.config.globalProperties.$alert=es.alert,i.config.globalProperties.$confirm=es.confirm,i.config.globalProperties.$prompt=es.prompt};const Sv=es;class wn{constructor(){}success(e){Ln({type:"success",...e})}error(e){Ln({type:"error",...e})}warning(e){Ln({type:"warning",...e})}info(e){Ln({type:"info",...e})}message(e,t){const n=document.getElementsByClassName("el-message")[0];n&&(n==null||n.remove()),Ln({type:e,message:t})}}function i5(i){return{all:i=i||new Map,on:function(e,t){var n=i.get(e);n?n.push(t):i.set(e,[t])},off:function(e,t){var n=i.get(e);n&&(t?n.splice(n.indexOf(t)>>>0,1):i.set(e,[]))},emit:function(e,t){var n=i.get(e);n&&n.slice().map(function(r){r(t)}),(n=i.get("*"))&&n.slice().map(function(r){r(e,t)})}}}const ut=i5();function Cv(i,e){return function(){return i.apply(e,arguments)}}const{toString:r5}=Object.prototype,{getPrototypeOf:$h}=Object,Bc=(i=>e=>{const t=r5.call(e);return i[t]||(i[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),Vi=i=>(i=i.toLowerCase(),e=>Bc(e)===i),Uc=i=>e=>typeof e===i,{isArray:ba}=Array,qo=Uc("undefined");function s5(i){return i!==null&&!qo(i)&&i.constructor!==null&&!qo(i.constructor)&&fi(i.constructor.isBuffer)&&i.constructor.isBuffer(i)}const xv=Vi("ArrayBuffer");function a5(i){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(i):e=i&&i.buffer&&xv(i.buffer),e}const o5=Uc("string"),fi=Uc("function"),Ev=Uc("number"),Fc=i=>i!==null&&typeof i=="object",l5=i=>i===!0||i===!1,Vc=i=>{if(Bc(i)!=="object")return!1;const e=$h(i);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in i)&&!(Symbol.iterator in i)},c5=Vi("Date"),u5=Vi("File"),d5=Vi("Blob"),h5=Vi("FileList"),f5=i=>Fc(i)&&fi(i.pipe),p5=i=>{let e;return i&&(typeof FormData=="function"&&i instanceof FormData||fi(i.append)&&((e=Bc(i))==="formdata"||e==="object"&&fi(i.toString)&&i.toString()==="[object FormData]"))},m5=Vi("URLSearchParams"),[g5,v5,y5,b5]=["ReadableStream","Request","Response","Headers"].map(Vi),_5=i=>i.trim?i.trim():i.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function zo(i,e,{allOwnKeys:t=!1}={}){if(i===null||typeof i>"u")return;let n,r;if(typeof i!="object"&&(i=[i]),ba(i))for(n=0,r=i.length;n<r;n++)e.call(null,i[n],n,i);else{const s=t?Object.getOwnPropertyNames(i):Object.keys(i),a=s.length;let o;for(n=0;n<a;n++)o=s[n],e.call(null,i[o],o,i)}}function wv(i,e){e=e.toLowerCase();const t=Object.keys(i);let n=t.length,r;for(;n-- >0;)if(r=t[n],e===r.toLowerCase())return r;return null}const Is=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Dv=i=>!qo(i)&&i!==Is;function Hh(){const{caseless:i}=Dv(this)&&this||{},e={},t=(n,r)=>{const s=i&&wv(e,r)||r;Vc(e[s])&&Vc(n)?e[s]=Hh(e[s],n):Vc(n)?e[s]=Hh({},n):ba(n)?e[s]=n.slice():e[s]=n};for(let n=0,r=arguments.length;n<r;n++)arguments[n]&&zo(arguments[n],t);return e}const k5=(i,e,t,{allOwnKeys:n}={})=>(zo(e,(r,s)=>{t&&fi(r)?i[s]=Cv(r,t):i[s]=r},{allOwnKeys:n}),i),T5=i=>(i.charCodeAt(0)===65279&&(i=i.slice(1)),i),S5=(i,e,t,n)=>{i.prototype=Object.create(e.prototype,n),i.prototype.constructor=i,Object.defineProperty(i,"super",{value:e.prototype}),t&&Object.assign(i.prototype,t)},C5=(i,e,t,n)=>{let r,s,a;const o={};if(e=e||{},i==null)return e;do{for(r=Object.getOwnPropertyNames(i),s=r.length;s-- >0;)a=r[s],(!n||n(a,i,e))&&!o[a]&&(e[a]=i[a],o[a]=!0);i=t!==!1&&$h(i)}while(i&&(!t||t(i,e))&&i!==Object.prototype);return e},x5=(i,e,t)=>{i=String(i),(t===void 0||t>i.length)&&(t=i.length),t-=e.length;const n=i.indexOf(e,t);return n!==-1&&n===t},E5=i=>{if(!i)return null;if(ba(i))return i;let e=i.length;if(!Ev(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=i[e];return t},w5=(i=>e=>i&&e instanceof i)(typeof Uint8Array<"u"&&$h(Uint8Array)),D5=(i,e)=>{const n=(i&&i[Symbol.iterator]).call(i);let r;for(;(r=n.next())&&!r.done;){const s=r.value;e.call(i,s[0],s[1])}},A5=(i,e)=>{let t;const n=[];for(;(t=i.exec(e))!==null;)n.push(t);return n},I5=Vi("HTMLFormElement"),N5=i=>i.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,n,r){return n.toUpperCase()+r}),Av=(({hasOwnProperty:i})=>(e,t)=>i.call(e,t))(Object.prototype),P5=Vi("RegExp"),Iv=(i,e)=>{const t=Object.getOwnPropertyDescriptors(i),n={};zo(t,(r,s)=>{let a;(a=e(r,s,i))!==!1&&(n[s]=a||r)}),Object.defineProperties(i,n)},O5=i=>{Iv(i,(e,t)=>{if(fi(i)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const n=i[t];if(fi(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},M5=(i,e)=>{const t={},n=r=>{r.forEach(s=>{t[s]=!0})};return ba(i)?n(i):n(String(i).split(e)),t},R5=()=>{},L5=(i,e)=>i!=null&&Number.isFinite(i=+i)?i:e,qh="abcdefghijklmnopqrstuvwxyz",Nv="0123456789",Pv={DIGIT:Nv,ALPHA:qh,ALPHA_DIGIT:qh+qh.toUpperCase()+Nv},B5=(i=16,e=Pv.ALPHA_DIGIT)=>{let t="";const{length:n}=e;for(;i--;)t+=e[Math.random()*n|0];return t};function U5(i){return!!(i&&fi(i.append)&&i[Symbol.toStringTag]==="FormData"&&i[Symbol.iterator])}const F5=i=>{const e=new Array(10),t=(n,r)=>{if(Fc(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[r]=n;const s=ba(n)?[]:{};return zo(n,(a,o)=>{const c=t(a,r+1);!qo(c)&&(s[o]=c)}),e[r]=void 0,s}}return n};return t(i,0)},V5=Vi("AsyncFunction"),j5=i=>i&&(Fc(i)||fi(i))&&fi(i.then)&&fi(i.catch),Ov=((i,e)=>i?setImmediate:e?((t,n)=>(Is.addEventListener("message",({source:r,data:s})=>{r===Is&&s===t&&n.length&&n.shift()()},!1),r=>{n.push(r),Is.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",fi(Is.postMessage)),$5=typeof queueMicrotask<"u"?queueMicrotask.bind(Is):typeof process<"u"&&process.nextTick||Ov,xe={isArray:ba,isArrayBuffer:xv,isBuffer:s5,isFormData:p5,isArrayBufferView:a5,isString:o5,isNumber:Ev,isBoolean:l5,isObject:Fc,isPlainObject:Vc,isReadableStream:g5,isRequest:v5,isResponse:y5,isHeaders:b5,isUndefined:qo,isDate:c5,isFile:u5,isBlob:d5,isRegExp:P5,isFunction:fi,isStream:f5,isURLSearchParams:m5,isTypedArray:w5,isFileList:h5,forEach:zo,merge:Hh,extend:k5,trim:_5,stripBOM:T5,inherits:S5,toFlatObject:C5,kindOf:Bc,kindOfTest:Vi,endsWith:x5,toArray:E5,forEachEntry:D5,matchAll:A5,isHTMLForm:I5,hasOwnProperty:Av,hasOwnProp:Av,reduceDescriptors:Iv,freezeMethods:O5,toObjectSet:M5,toCamelCase:N5,noop:R5,toFiniteNumber:L5,findKey:wv,global:Is,isContextDefined:Dv,ALPHABET:Pv,generateString:B5,isSpecCompliantForm:U5,toJSONObject:F5,isAsyncFn:V5,isThenable:j5,setImmediate:Ov,asap:$5};function vt(i,e,t,n,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=i,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),n&&(this.request=n),r&&(this.response=r,this.status=r.status?r.status:null)}xe.inherits(vt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:xe.toJSONObject(this.config),code:this.code,status:this.status}}});const Mv=vt.prototype,Rv={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(i=>{Rv[i]={value:i}}),Object.defineProperties(vt,Rv),Object.defineProperty(Mv,"isAxiosError",{value:!0}),vt.from=(i,e,t,n,r,s)=>{const a=Object.create(Mv);return xe.toFlatObject(i,a,function(c){return c!==Error.prototype},o=>o!=="isAxiosError"),vt.call(a,i.message,e,t,n,r),a.cause=i,a.name=i.name,s&&Object.assign(a,s),a};const H5=null;function zh(i){return xe.isPlainObject(i)||xe.isArray(i)}function Lv(i){return xe.endsWith(i,"[]")?i.slice(0,-2):i}function Bv(i,e,t){return i?i.concat(e).map(function(r,s){return r=Lv(r),!t&&s?"["+r+"]":r}).join(t?".":""):e}function q5(i){return xe.isArray(i)&&!i.some(zh)}const z5=xe.toFlatObject(xe,{},null,function(e){return/^is[A-Z]/.test(e)});function jc(i,e,t){if(!xe.isObject(i))throw new TypeError("target must be an object");e=e||new FormData,t=xe.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(p,f){return!xe.isUndefined(f[p])});const n=t.metaTokens,r=t.visitor||d,s=t.dots,a=t.indexes,c=(t.Blob||typeof Blob<"u"&&Blob)&&xe.isSpecCompliantForm(e);if(!xe.isFunction(r))throw new TypeError("visitor must be a function");function u(y){if(y===null)return"";if(xe.isDate(y))return y.toISOString();if(!c&&xe.isBlob(y))throw new vt("Blob is not supported. Use a Buffer instead.");return xe.isArrayBuffer(y)||xe.isTypedArray(y)?c&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function d(y,p,f){let m=y;if(y&&!f&&typeof y=="object"){if(xe.endsWith(p,"{}"))p=n?p:p.slice(0,-2),y=JSON.stringify(y);else if(xe.isArray(y)&&q5(y)||(xe.isFileList(y)||xe.endsWith(p,"[]"))&&(m=xe.toArray(y)))return p=Lv(p),m.forEach(function(k,D){!(xe.isUndefined(k)||k===null)&&e.append(a===!0?Bv([p],D,s):a===null?p:p+"[]",u(k))}),!1}return zh(y)?!0:(e.append(Bv(f,p,s),u(y)),!1)}const h=[],b=Object.assign(z5,{defaultVisitor:d,convertValue:u,isVisitable:zh});function v(y,p){if(!xe.isUndefined(y)){if(h.indexOf(y)!==-1)throw Error("Circular reference detected in "+p.join("."));h.push(y),xe.forEach(y,function(m,_){(!(xe.isUndefined(m)||m===null)&&r.call(e,m,xe.isString(_)?_.trim():_,p,b))===!0&&v(m,p?p.concat(_):[_])}),h.pop()}}if(!xe.isObject(i))throw new TypeError("data must be an object");return v(i),e}function Uv(i){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(i).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function Gh(i,e){this._pairs=[],i&&jc(i,this,e)}const Fv=Gh.prototype;Fv.append=function(e,t){this._pairs.push([e,t])},Fv.toString=function(e){const t=e?function(n){return e.call(this,n,Uv)}:Uv;return this._pairs.map(function(r){return t(r[0])+"="+t(r[1])},"").join("&")};function G5(i){return encodeURIComponent(i).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Vv(i,e,t){if(!e)return i;const n=t&&t.encode||G5;xe.isFunction(t)&&(t={serialize:t});const r=t&&t.serialize;let s;if(r?s=r(e,t):s=xe.isURLSearchParams(e)?e.toString():new Gh(e,t).toString(n),s){const a=i.indexOf("#");a!==-1&&(i=i.slice(0,a)),i+=(i.indexOf("?")===-1?"?":"&")+s}return i}class jv{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){xe.forEach(this.handlers,function(n){n!==null&&e(n)})}}const $v={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},W5={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:Gh,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Wh=typeof window<"u"&&typeof document<"u",Kh=typeof navigator=="object"&&navigator||void 0,K5=Wh&&(!Kh||["ReactNative","NativeScript","NS"].indexOf(Kh.product)<0),X5=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Y5=Wh&&window.location.href||"http://localhost",Bn={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Wh,hasStandardBrowserEnv:K5,hasStandardBrowserWebWorkerEnv:X5,navigator:Kh,origin:Y5},Symbol.toStringTag,{value:"Module"})),...W5};function J5(i,e){return jc(i,new Bn.classes.URLSearchParams,Object.assign({visitor:function(t,n,r,s){return Bn.isNode&&xe.isBuffer(t)?(this.append(n,t.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function Q5(i){return xe.matchAll(/\w+|\[(\w*)]/g,i).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Z5(i){const e={},t=Object.keys(i);let n;const r=t.length;let s;for(n=0;n<r;n++)s=t[n],e[s]=i[s];return e}function Hv(i){function e(t,n,r,s){let a=t[s++];if(a==="__proto__")return!0;const o=Number.isFinite(+a),c=s>=t.length;return a=!a&&xe.isArray(r)?r.length:a,c?(xe.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!o):((!r[a]||!xe.isObject(r[a]))&&(r[a]=[]),e(t,n,r[a],s)&&xe.isArray(r[a])&&(r[a]=Z5(r[a])),!o)}if(xe.isFormData(i)&&xe.isFunction(i.entries)){const t={};return xe.forEachEntry(i,(n,r)=>{e(Q5(n),r,t,0)}),t}return null}function e8(i,e,t){if(xe.isString(i))try{return(e||JSON.parse)(i),xe.trim(i)}catch(n){if(n.name!=="SyntaxError")throw n}return(t||JSON.stringify)(i)}const Go={transitional:$v,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,s=xe.isObject(e);if(s&&xe.isHTMLForm(e)&&(e=new FormData(e)),xe.isFormData(e))return r?JSON.stringify(Hv(e)):e;if(xe.isArrayBuffer(e)||xe.isBuffer(e)||xe.isStream(e)||xe.isFile(e)||xe.isBlob(e)||xe.isReadableStream(e))return e;if(xe.isArrayBufferView(e))return e.buffer;if(xe.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return J5(e,this.formSerializer).toString();if((o=xe.isFileList(e))||n.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return jc(o?{"files[]":e}:e,c&&new c,this.formSerializer)}}return s||r?(t.setContentType("application/json",!1),e8(e)):e}],transformResponse:[function(e){const t=this.transitional||Go.transitional,n=t&&t.forcedJSONParsing,r=this.responseType==="json";if(xe.isResponse(e)||xe.isReadableStream(e))return e;if(e&&xe.isString(e)&&(n&&!this.responseType||r)){const a=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(o){if(a)throw o.name==="SyntaxError"?vt.from(o,vt.ERR_BAD_RESPONSE,this,null,this.response):o}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Bn.classes.FormData,Blob:Bn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};xe.forEach(["delete","get","head","post","put","patch"],i=>{Go.headers[i]={}});const t8=xe.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),n8=i=>{const e={};let t,n,r;return i&&i.split(`
|
21
|
+
`).forEach(function(a){r=a.indexOf(":"),t=a.substring(0,r).trim().toLowerCase(),n=a.substring(r+1).trim(),!(!t||e[t]&&t8[t])&&(t==="set-cookie"?e[t]?e[t].push(n):e[t]=[n]:e[t]=e[t]?e[t]+", "+n:n)}),e},qv=Symbol("internals");function Wo(i){return i&&String(i).trim().toLowerCase()}function $c(i){return i===!1||i==null?i:xe.isArray(i)?i.map($c):String(i)}function i8(i){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=t.exec(i);)e[n[1]]=n[2];return e}const r8=i=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(i.trim());function Xh(i,e,t,n,r){if(xe.isFunction(n))return n.call(this,e,t);if(r&&(e=t),!!xe.isString(e)){if(xe.isString(n))return e.indexOf(n)!==-1;if(xe.isRegExp(n))return n.test(e)}}function s8(i){return i.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function a8(i,e){const t=xe.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(i,n+t,{value:function(r,s,a){return this[n].call(this,e,r,s,a)},configurable:!0})})}let Zn=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function s(o,c,u){const d=Wo(c);if(!d)throw new Error("header name must be a non-empty string");const h=xe.findKey(r,d);(!h||r[h]===void 0||u===!0||u===void 0&&r[h]!==!1)&&(r[h||c]=$c(o))}const a=(o,c)=>xe.forEach(o,(u,d)=>s(u,d,c));if(xe.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(xe.isString(e)&&(e=e.trim())&&!r8(e))a(n8(e),t);else if(xe.isHeaders(e))for(const[o,c]of e.entries())s(c,o,n);else e!=null&&s(t,e,n);return this}get(e,t){if(e=Wo(e),e){const n=xe.findKey(this,e);if(n){const r=this[n];if(!t)return r;if(t===!0)return i8(r);if(xe.isFunction(t))return t.call(this,r,n);if(xe.isRegExp(t))return t.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Wo(e),e){const n=xe.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||Xh(this,this[n],n,t)))}return!1}delete(e,t){const n=this;let r=!1;function s(a){if(a=Wo(a),a){const o=xe.findKey(n,a);o&&(!t||Xh(n,n[o],o,t))&&(delete n[o],r=!0)}}return xe.isArray(e)?e.forEach(s):s(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const s=t[n];(!e||Xh(this,this[s],s,e,!0))&&(delete this[s],r=!0)}return r}normalize(e){const t=this,n={};return xe.forEach(this,(r,s)=>{const a=xe.findKey(n,s);if(a){t[a]=$c(r),delete t[s];return}const o=e?s8(s):String(s).trim();o!==s&&delete t[s],t[o]=$c(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return xe.forEach(this,(n,r)=>{n!=null&&n!==!1&&(t[r]=e&&xe.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
|
22
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(r=>n.set(r)),n}static accessor(e){const n=(this[qv]=this[qv]={accessors:{}}).accessors,r=this.prototype;function s(a){const o=Wo(a);n[o]||(a8(r,a),n[o]=!0)}return xe.isArray(e)?e.forEach(s):s(e),this}};Zn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),xe.reduceDescriptors(Zn.prototype,({value:i},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>i,set(n){this[t]=n}}}),xe.freezeMethods(Zn);function Yh(i,e){const t=this||Go,n=e||t,r=Zn.from(n.headers);let s=n.data;return xe.forEach(i,function(o){s=o.call(t,s,r.normalize(),e?e.status:void 0)}),r.normalize(),s}function zv(i){return!!(i&&i.__CANCEL__)}function _a(i,e,t){vt.call(this,i??"canceled",vt.ERR_CANCELED,e,t),this.name="CanceledError"}xe.inherits(_a,vt,{__CANCEL__:!0});function Gv(i,e,t){const n=t.config.validateStatus;!t.status||!n||n(t.status)?i(t):e(new vt("Request failed with status code "+t.status,[vt.ERR_BAD_REQUEST,vt.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function o8(i){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(i);return e&&e[1]||""}function l8(i,e){i=i||10;const t=new Array(i),n=new Array(i);let r=0,s=0,a;return e=e!==void 0?e:1e3,function(c){const u=Date.now(),d=n[s];a||(a=u),t[r]=c,n[r]=u;let h=s,b=0;for(;h!==r;)b+=t[h++],h=h%i;if(r=(r+1)%i,r===s&&(s=(s+1)%i),u-a<e)return;const v=d&&u-d;return v?Math.round(b*1e3/v):void 0}}function c8(i,e){let t=0,n=1e3/e,r,s;const a=(u,d=Date.now())=>{t=d,r=null,s&&(clearTimeout(s),s=null),i.apply(null,u)};return[(...u)=>{const d=Date.now(),h=d-t;h>=n?a(u,d):(r=u,s||(s=setTimeout(()=>{s=null,a(r)},n-h)))},()=>r&&a(r)]}const Hc=(i,e,t=3)=>{let n=0;const r=l8(50,250);return c8(s=>{const a=s.loaded,o=s.lengthComputable?s.total:void 0,c=a-n,u=r(c),d=a<=o;n=a;const h={loaded:a,total:o,progress:o?a/o:void 0,bytes:c,rate:u||void 0,estimated:u&&o&&d?(o-a)/u:void 0,event:s,lengthComputable:o!=null,[e?"download":"upload"]:!0};i(h)},t)},Wv=(i,e)=>{const t=i!=null;return[n=>e[0]({lengthComputable:t,total:i,loaded:n}),e[1]]},Kv=i=>(...e)=>xe.asap(()=>i(...e)),u8=Bn.hasStandardBrowserEnv?((i,e)=>t=>(t=new URL(t,Bn.origin),i.protocol===t.protocol&&i.host===t.host&&(e||i.port===t.port)))(new URL(Bn.origin),Bn.navigator&&/(msie|trident)/i.test(Bn.navigator.userAgent)):()=>!0,d8=Bn.hasStandardBrowserEnv?{write(i,e,t,n,r,s){const a=[i+"="+encodeURIComponent(e)];xe.isNumber(t)&&a.push("expires="+new Date(t).toGMTString()),xe.isString(n)&&a.push("path="+n),xe.isString(r)&&a.push("domain="+r),s===!0&&a.push("secure"),document.cookie=a.join("; ")},read(i){const e=document.cookie.match(new RegExp("(^|;\\s*)("+i+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(i){this.write(i,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function h8(i){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(i)}function f8(i,e){return e?i.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):i}function Xv(i,e){return i&&!h8(e)?f8(i,e):e}const Yv=i=>i instanceof Zn?{...i}:i;function Ns(i,e){e=e||{};const t={};function n(u,d,h,b){return xe.isPlainObject(u)&&xe.isPlainObject(d)?xe.merge.call({caseless:b},u,d):xe.isPlainObject(d)?xe.merge({},d):xe.isArray(d)?d.slice():d}function r(u,d,h,b){if(xe.isUndefined(d)){if(!xe.isUndefined(u))return n(void 0,u,h,b)}else return n(u,d,h,b)}function s(u,d){if(!xe.isUndefined(d))return n(void 0,d)}function a(u,d){if(xe.isUndefined(d)){if(!xe.isUndefined(u))return n(void 0,u)}else return n(void 0,d)}function o(u,d,h){if(h in e)return n(u,d);if(h in i)return n(void 0,u)}const c={url:s,method:s,data:s,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:o,headers:(u,d,h)=>r(Yv(u),Yv(d),h,!0)};return xe.forEach(Object.keys(Object.assign({},i,e)),function(d){const h=c[d]||r,b=h(i[d],e[d],d);xe.isUndefined(b)&&h!==o||(t[d]=b)}),t}const Jv=i=>{const e=Ns({},i);let{data:t,withXSRFToken:n,xsrfHeaderName:r,xsrfCookieName:s,headers:a,auth:o}=e;e.headers=a=Zn.from(a),e.url=Vv(Xv(e.baseURL,e.url),i.params,i.paramsSerializer),o&&a.set("Authorization","Basic "+btoa((o.username||"")+":"+(o.password?unescape(encodeURIComponent(o.password)):"")));let c;if(xe.isFormData(t)){if(Bn.hasStandardBrowserEnv||Bn.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((c=a.getContentType())!==!1){const[u,...d]=c?c.split(";").map(h=>h.trim()).filter(Boolean):[];a.setContentType([u||"multipart/form-data",...d].join("; "))}}if(Bn.hasStandardBrowserEnv&&(n&&xe.isFunction(n)&&(n=n(e)),n||n!==!1&&u8(e.url))){const u=r&&s&&d8.read(s);u&&a.set(r,u)}return e},p8=typeof XMLHttpRequest<"u"&&function(i){return new Promise(function(t,n){const r=Jv(i);let s=r.data;const a=Zn.from(r.headers).normalize();let{responseType:o,onUploadProgress:c,onDownloadProgress:u}=r,d,h,b,v,y;function p(){v&&v(),y&&y(),r.cancelToken&&r.cancelToken.unsubscribe(d),r.signal&&r.signal.removeEventListener("abort",d)}let f=new XMLHttpRequest;f.open(r.method.toUpperCase(),r.url,!0),f.timeout=r.timeout;function m(){if(!f)return;const k=Zn.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders()),E={data:!o||o==="text"||o==="json"?f.responseText:f.response,status:f.status,statusText:f.statusText,headers:k,config:i,request:f};Gv(function(w){t(w),p()},function(w){n(w),p()},E),f=null}"onloadend"in f?f.onloadend=m:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(m)},f.onabort=function(){f&&(n(new vt("Request aborted",vt.ECONNABORTED,i,f)),f=null)},f.onerror=function(){n(new vt("Network Error",vt.ERR_NETWORK,i,f)),f=null},f.ontimeout=function(){let D=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const E=r.transitional||$v;r.timeoutErrorMessage&&(D=r.timeoutErrorMessage),n(new vt(D,E.clarifyTimeoutError?vt.ETIMEDOUT:vt.ECONNABORTED,i,f)),f=null},s===void 0&&a.setContentType(null),"setRequestHeader"in f&&xe.forEach(a.toJSON(),function(D,E){f.setRequestHeader(E,D)}),xe.isUndefined(r.withCredentials)||(f.withCredentials=!!r.withCredentials),o&&o!=="json"&&(f.responseType=r.responseType),u&&([b,y]=Hc(u,!0),f.addEventListener("progress",b)),c&&f.upload&&([h,v]=Hc(c),f.upload.addEventListener("progress",h),f.upload.addEventListener("loadend",v)),(r.cancelToken||r.signal)&&(d=k=>{f&&(n(!k||k.type?new _a(null,i,f):k),f.abort(),f=null)},r.cancelToken&&r.cancelToken.subscribe(d),r.signal&&(r.signal.aborted?d():r.signal.addEventListener("abort",d)));const _=o8(r.url);if(_&&Bn.protocols.indexOf(_)===-1){n(new vt("Unsupported protocol "+_+":",vt.ERR_BAD_REQUEST,i));return}f.send(s||null)})},m8=(i,e)=>{const{length:t}=i=i?i.filter(Boolean):[];if(e||t){let n=new AbortController,r;const s=function(u){if(!r){r=!0,o();const d=u instanceof Error?u:this.reason;n.abort(d instanceof vt?d:new _a(d instanceof Error?d.message:d))}};let a=e&&setTimeout(()=>{a=null,s(new vt(`timeout ${e} of ms exceeded`,vt.ETIMEDOUT))},e);const o=()=>{i&&(a&&clearTimeout(a),a=null,i.forEach(u=>{u.unsubscribe?u.unsubscribe(s):u.removeEventListener("abort",s)}),i=null)};i.forEach(u=>u.addEventListener("abort",s));const{signal:c}=n;return c.unsubscribe=()=>xe.asap(o),c}},g8=function*(i,e){let t=i.byteLength;if(t<e){yield i;return}let n=0,r;for(;n<t;)r=n+e,yield i.slice(n,r),n=r},v8=async function*(i,e){for await(const t of y8(i))yield*g8(t,e)},y8=async function*(i){if(i[Symbol.asyncIterator]){yield*i;return}const e=i.getReader();try{for(;;){const{done:t,value:n}=await e.read();if(t)break;yield n}}finally{await e.cancel()}},Qv=(i,e,t,n)=>{const r=v8(i,e);let s=0,a,o=c=>{a||(a=!0,n&&n(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await r.next();if(u){o(),c.close();return}let h=d.byteLength;if(t){let b=s+=h;t(b)}c.enqueue(new Uint8Array(d))}catch(u){throw o(u),u}},cancel(c){return o(c),r.return()}},{highWaterMark:2})},qc=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Zv=qc&&typeof ReadableStream=="function",b8=qc&&(typeof TextEncoder=="function"?(i=>e=>i.encode(e))(new TextEncoder):async i=>new Uint8Array(await new Response(i).arrayBuffer())),ey=(i,...e)=>{try{return!!i(...e)}catch{return!1}},_8=Zv&&ey(()=>{let i=!1;const e=new Request(Bn.origin,{body:new ReadableStream,method:"POST",get duplex(){return i=!0,"half"}}).headers.has("Content-Type");return i&&!e}),ty=64*1024,Jh=Zv&&ey(()=>xe.isReadableStream(new Response("").body)),zc={stream:Jh&&(i=>i.body)};qc&&(i=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!zc[e]&&(zc[e]=xe.isFunction(i[e])?t=>t[e]():(t,n)=>{throw new vt(`Response type '${e}' is not supported`,vt.ERR_NOT_SUPPORT,n)})})})(new Response);const k8=async i=>{if(i==null)return 0;if(xe.isBlob(i))return i.size;if(xe.isSpecCompliantForm(i))return(await new Request(Bn.origin,{method:"POST",body:i}).arrayBuffer()).byteLength;if(xe.isArrayBufferView(i)||xe.isArrayBuffer(i))return i.byteLength;if(xe.isURLSearchParams(i)&&(i=i+""),xe.isString(i))return(await b8(i)).byteLength},T8=async(i,e)=>{const t=xe.toFiniteNumber(i.getContentLength());return t??k8(e)},Qh={http:H5,xhr:p8,fetch:qc&&(async i=>{let{url:e,method:t,data:n,signal:r,cancelToken:s,timeout:a,onDownloadProgress:o,onUploadProgress:c,responseType:u,headers:d,withCredentials:h="same-origin",fetchOptions:b}=Jv(i);u=u?(u+"").toLowerCase():"text";let v=m8([r,s&&s.toAbortSignal()],a),y;const p=v&&v.unsubscribe&&(()=>{v.unsubscribe()});let f;try{if(c&&_8&&t!=="get"&&t!=="head"&&(f=await T8(d,n))!==0){let E=new Request(e,{method:"POST",body:n,duplex:"half"}),A;if(xe.isFormData(n)&&(A=E.headers.get("content-type"))&&d.setContentType(A),E.body){const[w,N]=Wv(f,Hc(Kv(c)));n=Qv(E.body,ty,w,N)}}xe.isString(h)||(h=h?"include":"omit");const m="credentials"in Request.prototype;y=new Request(e,{...b,signal:v,method:t.toUpperCase(),headers:d.normalize().toJSON(),body:n,duplex:"half",credentials:m?h:void 0});let _=await fetch(y);const k=Jh&&(u==="stream"||u==="response");if(Jh&&(o||k&&p)){const E={};["status","statusText","headers"].forEach(S=>{E[S]=_[S]});const A=xe.toFiniteNumber(_.headers.get("content-length")),[w,N]=o&&Wv(A,Hc(Kv(o),!0))||[];_=new Response(Qv(_.body,ty,w,()=>{N&&N(),p&&p()}),E)}u=u||"text";let D=await zc[xe.findKey(zc,u)||"text"](_,i);return!k&&p&&p(),await new Promise((E,A)=>{Gv(E,A,{data:D,headers:Zn.from(_.headers),status:_.status,statusText:_.statusText,config:i,request:y})})}catch(m){throw p&&p(),m&&m.name==="TypeError"&&/fetch/i.test(m.message)?Object.assign(new vt("Network Error",vt.ERR_NETWORK,i,y),{cause:m.cause||m}):vt.from(m,m&&m.code,i,y)}})};xe.forEach(Qh,(i,e)=>{if(i){try{Object.defineProperty(i,"name",{value:e})}catch{}Object.defineProperty(i,"adapterName",{value:e})}});const ny=i=>`- ${i}`,S8=i=>xe.isFunction(i)||i===null||i===!1,iy={getAdapter:i=>{i=xe.isArray(i)?i:[i];const{length:e}=i;let t,n;const r={};for(let s=0;s<e;s++){t=i[s];let a;if(n=t,!S8(t)&&(n=Qh[(a=String(t)).toLowerCase()],n===void 0))throw new vt(`Unknown adapter '${a}'`);if(n)break;r[a||"#"+s]=n}if(!n){const s=Object.entries(r).map(([o,c])=>`adapter ${o} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=e?s.length>1?`since :
|
23
|
+
`+s.map(ny).join(`
|
24
|
+
`):" "+ny(s[0]):"as no adapter specified";throw new vt("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return n},adapters:Qh};function Zh(i){if(i.cancelToken&&i.cancelToken.throwIfRequested(),i.signal&&i.signal.aborted)throw new _a(null,i)}function ry(i){return Zh(i),i.headers=Zn.from(i.headers),i.data=Yh.call(i,i.transformRequest),["post","put","patch"].indexOf(i.method)!==-1&&i.headers.setContentType("application/x-www-form-urlencoded",!1),iy.getAdapter(i.adapter||Go.adapter)(i).then(function(n){return Zh(i),n.data=Yh.call(i,i.transformResponse,n),n.headers=Zn.from(n.headers),n},function(n){return zv(n)||(Zh(i),n&&n.response&&(n.response.data=Yh.call(i,i.transformResponse,n.response),n.response.headers=Zn.from(n.response.headers))),Promise.reject(n)})}const sy="1.7.9",Gc={};["object","boolean","number","function","string","symbol"].forEach((i,e)=>{Gc[i]=function(n){return typeof n===i||"a"+(e<1?"n ":" ")+i}});const ay={};Gc.transitional=function(e,t,n){function r(s,a){return"[Axios v"+sy+"] Transitional option '"+s+"'"+a+(n?". "+n:"")}return(s,a,o)=>{if(e===!1)throw new vt(r(a," has been removed"+(t?" in "+t:"")),vt.ERR_DEPRECATED);return t&&!ay[a]&&(ay[a]=!0,console.warn(r(a," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(s,a,o):!0}},Gc.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function C8(i,e,t){if(typeof i!="object")throw new vt("options must be an object",vt.ERR_BAD_OPTION_VALUE);const n=Object.keys(i);let r=n.length;for(;r-- >0;){const s=n[r],a=e[s];if(a){const o=i[s],c=o===void 0||a(o,s,i);if(c!==!0)throw new vt("option "+s+" must be "+c,vt.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new vt("Unknown option "+s,vt.ERR_BAD_OPTION)}}const Wc={assertOptions:C8,validators:Gc},nr=Wc.validators;let Ps=class{constructor(e){this.defaults=e,this.interceptors={request:new jv,response:new jv}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const s=r.stack?r.stack.replace(/^.+\n/,""):"";try{n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
25
|
+
`+s):n.stack=s}catch{}}throw n}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Ns(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:s}=t;n!==void 0&&Wc.assertOptions(n,{silentJSONParsing:nr.transitional(nr.boolean),forcedJSONParsing:nr.transitional(nr.boolean),clarifyTimeoutError:nr.transitional(nr.boolean)},!1),r!=null&&(xe.isFunction(r)?t.paramsSerializer={serialize:r}:Wc.assertOptions(r,{encode:nr.function,serialize:nr.function},!0)),Wc.assertOptions(t,{baseUrl:nr.spelling("baseURL"),withXsrfToken:nr.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=s&&xe.merge(s.common,s[t.method]);s&&xe.forEach(["delete","get","head","post","put","patch","common"],y=>{delete s[y]}),t.headers=Zn.concat(a,s);const o=[];let c=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(t)===!1||(c=c&&p.synchronous,o.unshift(p.fulfilled,p.rejected))});const u=[];this.interceptors.response.forEach(function(p){u.push(p.fulfilled,p.rejected)});let d,h=0,b;if(!c){const y=[ry.bind(this),void 0];for(y.unshift.apply(y,o),y.push.apply(y,u),b=y.length,d=Promise.resolve(t);h<b;)d=d.then(y[h++],y[h++]);return d}b=o.length;let v=t;for(h=0;h<b;){const y=o[h++],p=o[h++];try{v=y(v)}catch(f){p.call(this,f);break}}try{d=ry.call(this,v)}catch(y){return Promise.reject(y)}for(h=0,b=u.length;h<b;)d=d.then(u[h++],u[h++]);return d}getUri(e){e=Ns(this.defaults,e);const t=Xv(e.baseURL,e.url);return Vv(t,e.params,e.paramsSerializer)}};xe.forEach(["delete","get","head","options"],function(e){Ps.prototype[e]=function(t,n){return this.request(Ns(n||{},{method:e,url:t,data:(n||{}).data}))}}),xe.forEach(["post","put","patch"],function(e){function t(n){return function(s,a,o){return this.request(Ns(o||{},{method:e,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}Ps.prototype[e]=t(),Ps.prototype[e+"Form"]=t(!0)});let x8=class dx{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(s){t=s});const n=this;this.promise.then(r=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](r);n._listeners=null}),this.promise.then=r=>{let s;const a=new Promise(o=>{n.subscribe(o),s=o}).then(r);return a.cancel=function(){n.unsubscribe(s)},a},e(function(s,a,o){n.reason||(n.reason=new _a(s,a,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=n=>{e.abort(n)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new dx(function(r){e=r}),cancel:e}}};function E8(i){return function(t){return i.apply(null,t)}}function w8(i){return xe.isObject(i)&&i.isAxiosError===!0}const ef={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ef).forEach(([i,e])=>{ef[e]=i});function oy(i){const e=new Ps(i),t=Cv(Ps.prototype.request,e);return xe.extend(t,Ps.prototype,e,{allOwnKeys:!0}),xe.extend(t,e,null,{allOwnKeys:!0}),t.create=function(r){return oy(Ns(i,r))},t}const cn=oy(Go);cn.Axios=Ps,cn.CanceledError=_a,cn.CancelToken=x8,cn.isCancel=zv,cn.VERSION=sy,cn.toFormData=jc,cn.AxiosError=vt,cn.Cancel=cn.CanceledError,cn.all=function(e){return Promise.all(e)},cn.spread=E8,cn.isAxiosError=w8,cn.mergeConfig=Ns,cn.AxiosHeaders=Zn,cn.formToJSON=i=>Hv(xe.isHTMLForm(i)?new FormData(i):i),cn.getAdapter=iy.getAdapter,cn.HttpStatusCode=ef,cn.default=cn;const{Axios:nH,AxiosError:iH,CanceledError:rH,isCancel:sH,CancelToken:aH,VERSION:oH,all:lH,Cancel:cH,isAxiosError:uH,spread:dH,toFormData:hH,AxiosHeaders:fH,HttpStatusCode:pH,formToJSON:mH,getAdapter:gH,mergeConfig:vH}=cn,Et=cn.create({timeout:6e4});Et.defaults.headers.post["Content-Type"]="application/json; charset=utf-8",Et.interceptors.request.use(function(i){return i},function(i){return Promise.reject(i)}),Et.interceptors.response.use(function(i){return i},function(i){return Promise.reject(i)});const D8=(i={},{baseUrl:e,token:t}={})=>Et.get("/api/conferenceRoom/getReserveConferenceByLoginUser",{params:i,baseURL:e,headers:{satoken:t}}),A8=(i={},{baseUrl:e,token:t}={})=>Et.post("/api/v1/scheduleMeeting",i,{baseURL:e,headers:{satoken:t}}),I8=(i={},{baseUrl:e,token:t}={})=>Et.post("/api/v1/modifyAppointMeeting",i,{baseURL:e,headers:{satoken:t}}),ly=(i={},{baseUrl:e,token:t}={})=>Et.post("/api/v1/deleteAppointMeeting",i,{baseURL:e,headers:{satoken:t}}),cy=(i={},{baseUrl:e,token:t}={})=>Et.get("/api/conferenceRoom/getInviteParticipantsByRoomName",{params:i,baseURL:e,headers:{satoken:t}}),Ko=(i={},{baseUrl:e,token:t}={})=>Et.post("/api/conferenceRoom/addInviteParticipants",i,{baseURL:e,headers:{satoken:t}}),uy=(i={},{baseUrl:e,token:t}={})=>Et.post("/api/sysOffices/queryOfficeAndUserTree",i,{baseURL:e,headers:{satoken:t}}),N8=(i={},{baseUrl:e,token:t}={})=>Et.get("/api/commonGroup/getCommonGroups",{params:i,baseURL:e,headers:{satoken:t}}),P8=(i={},{baseUrl:e,token:t}={})=>Et.post("/api/commonGroup/addCommonGroup",i,{baseURL:e,headers:{satoken:t}}),O8=(i={},{baseUrl:e,token:t}={})=>Et.put("/api/commonGroup/updateCommonGroup",i,{baseURL:e,headers:{satoken:t}}),M8=(i="",{baseUrl:e,token:t}={})=>Et.delete("/api/commonGroup/deleteCommonGroup/"+i,{baseURL:e,headers:{satoken:t}}),R8=(i={},{baseUrl:e,token:t}={})=>Et.post("/api/weChat/getWeChatUrl",i,{baseURL:e,headers:{satoken:t}}),tf=(i={},{baseUrl:e,token:t}={})=>Et.post("/api/conferenceRoom/sendMsgAndNoticeMakeCallByZX",i,{baseURL:e,headers:{satoken:t}}),L8=(i={},{baseUrl:e,token:t}={})=>Et.post("/api/wx/sendWxNotify",i,{baseURL:e,headers:{satoken:t}}),nf=(i={},{baseUrl:e,token:t}={})=>Et.post("/api/v1/makeCall",i,{baseURL:e,headers:{satoken:t}}),B8=(i={},{baseUrl:e,token:t}={})=>Et.get("/api/smc/querySites",{params:i,baseURL:e,headers:{satoken:t}}),dy=(i,e={},{baseUrl:t,token:n}={})=>Et.post(`/api/smc/scheduleConf?roomName=${i}`,e,{baseURL:t,headers:{satoken:n}}),U8=(i,e={},{baseUrl:t,token:n}={})=>Et.post(`/api/smc/disconnectSites?roomName=${i}`,e,{baseURL:t,headers:{satoken:n}}),F8=(i,e={},{baseUrl:t,token:n}={})=>Et.post(`/api/smc/connectSites?roomName=${i}`,e,{baseURL:t,headers:{satoken:n}}),hy=(i={},{baseUrl:e,token:t}={})=>Et.post(`/api/smc/queryConfSitesStatus?roomName=${i}`,null,{baseURL:e,headers:{satoken:t}}),rf=(i={},{baseUrl:e,token:t}={})=>Et.post(`/api/smc/delScheduleConf?roomName=${i}`,null,{baseURL:e,headers:{satoken:t}}),fy=(i={},{baseUrl:e,token:t}={})=>Et.post(`/api/smc/getScheduleConfCode?roomName=${i}`,null,{baseURL:e,headers:{satoken:t}});var sf,py;function Kc(){if(py)return sf;py=1;var i;return typeof window<"u"?i=window:typeof Rc<"u"?i=Rc:typeof self<"u"?i=self:i={},sf=i,sf}var V8=Kc();const te=ga(V8),j8=x4(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var af,my;function gy(){if(my)return af;my=1;var i=typeof Rc<"u"?Rc:typeof window<"u"?window:{},e=j8,t;return typeof document<"u"?t=document:(t=i["__GLOBAL_DOCUMENT_CACHE@4"],t||(t=i["__GLOBAL_DOCUMENT_CACHE@4"]=e)),af=t,af}var $8=gy();const Fe=ga($8);var Xc={exports:{}},of={exports:{}},vy;function H8(){return vy||(vy=1,function(i){function e(){return i.exports=e=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var s in r)({}).hasOwnProperty.call(r,s)&&(t[s]=r[s])}return t},i.exports.__esModule=!0,i.exports.default=i.exports,e.apply(null,arguments)}i.exports=e,i.exports.__esModule=!0,i.exports.default=i.exports}(of)),of.exports}var lf,yy;function q8(){if(yy)return lf;yy=1,lf=e;var i=Object.prototype.toString;function e(t){if(!t)return!1;var n=i.call(t);return n==="[object Function]"||typeof t=="function"&&n!=="[object RegExp]"||typeof window<"u"&&(t===window.setTimeout||t===window.alert||t===window.confirm||t===window.prompt)}return lf}var cf,by;function z8(){if(by)return cf;by=1;function i(r,s){var a=typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(a)return(a=a.call(r)).next.bind(a);if(Array.isArray(r)||(a=e(r))||s){a&&(r=a);var o=0;return function(){return o>=r.length?{done:!0}:{done:!1,value:r[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
26
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e(r,s){if(r){if(typeof r=="string")return t(r,s);var a=Object.prototype.toString.call(r).slice(8,-1);if(a==="Object"&&r.constructor&&(a=r.constructor.name),a==="Map"||a==="Set")return Array.from(r);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return t(r,s)}}function t(r,s){(s==null||s>r.length)&&(s=r.length);for(var a=0,o=new Array(s);a<s;a++)o[a]=r[a];return o}var n=function(){function r(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1}var s=r.prototype;return s.getIsEnabled=function(){return this.enabled_},s.enable=function(){this.enabled_=!0},s.disable=function(){this.enabled_=!1},s.reset=function(){this.typeToInterceptorsMap_=new Map,this.enabled_=!1},s.addInterceptor=function(o,c){this.typeToInterceptorsMap_.has(o)||this.typeToInterceptorsMap_.set(o,new Set);var u=this.typeToInterceptorsMap_.get(o);return u.has(c)?!1:(u.add(c),!0)},s.removeInterceptor=function(o,c){var u=this.typeToInterceptorsMap_.get(o);return u&&u.has(c)?(u.delete(c),!0):!1},s.clearInterceptorsByType=function(o){var c=this.typeToInterceptorsMap_.get(o);return c?(this.typeToInterceptorsMap_.delete(o),this.typeToInterceptorsMap_.set(o,new Set),!0):!1},s.clear=function(){return this.typeToInterceptorsMap_.size?(this.typeToInterceptorsMap_=new Map,!0):!1},s.getForType=function(o){return this.typeToInterceptorsMap_.get(o)||new Set},s.execute=function(o,c){for(var u=this.getForType(o),d=i(u),h;!(h=d()).done;){var b=h.value;try{c=b(c)}catch{}}return c},r}();return cf=n,cf}var uf,_y;function G8(){if(_y)return uf;_y=1;var i=function(){function t(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1}var n=t.prototype;return n.getIsEnabled=function(){return this.enabled_},n.enable=function(){this.enabled_=!0},n.disable=function(){this.enabled_=!1},n.reset=function(){this.maxAttempts_=1,this.delayFactor_=.1,this.fuzzFactor_=.1,this.initialDelay_=1e3,this.enabled_=!1},n.getMaxAttempts=function(){return this.maxAttempts_},n.setMaxAttempts=function(s){this.maxAttempts_=s},n.getDelayFactor=function(){return this.delayFactor_},n.setDelayFactor=function(s){this.delayFactor_=s},n.getFuzzFactor=function(){return this.fuzzFactor_},n.setFuzzFactor=function(s){this.fuzzFactor_=s},n.getInitialDelay=function(){return this.initialDelay_},n.setInitialDelay=function(s){this.initialDelay_=s},n.createRetry=function(s){var a=s===void 0?{}:s,o=a.maxAttempts,c=a.delayFactor,u=a.fuzzFactor,d=a.initialDelay;return new e({maxAttempts:o||this.maxAttempts_,delayFactor:c||this.delayFactor_,fuzzFactor:u||this.fuzzFactor_,initialDelay:d||this.initialDelay_})},t}(),e=function(){function t(r){this.maxAttempts_=r.maxAttempts,this.delayFactor_=r.delayFactor,this.fuzzFactor_=r.fuzzFactor,this.currentDelay_=r.initialDelay,this.currentAttempt_=1}var n=t.prototype;return n.moveToNextAttempt=function(){this.currentAttempt_++;var s=this.currentDelay_*this.delayFactor_;this.currentDelay_=this.currentDelay_+s},n.shouldRetry=function(){return this.currentAttempt_<this.maxAttempts_},n.getCurrentDelay=function(){return this.currentDelay_},n.getCurrentMinPossibleDelay=function(){return(1-this.fuzzFactor_)*this.currentDelay_},n.getCurrentMaxPossibleDelay=function(){return(1+this.fuzzFactor_)*this.currentDelay_},n.getCurrentFuzzedDelay=function(){var s=this.getCurrentMinPossibleDelay(),a=this.getCurrentMaxPossibleDelay();return s+Math.random()*(a-s)},t}();return uf=i,uf}var df,ky;function W8(){if(ky)return df;ky=1;var i=Kc(),e=function(r,s){return s===void 0&&(s=!1),function(a,o,c){if(a){r(a);return}if(o.statusCode>=400&&o.statusCode<=599){var u=c;if(s)if(i.TextDecoder){var d=t(o.headers&&o.headers["content-type"]);try{u=new TextDecoder(d).decode(c)}catch{}}else u=String.fromCharCode.apply(null,new Uint8Array(c));r({cause:u});return}r(null,c)}};function t(n){return n===void 0&&(n=""),n.toLowerCase().split(";").reduce(function(r,s){var a=s.split("="),o=a[0],c=a[1];return o.trim()==="charset"?c.trim():r},"utf-8")}return df=e,df}var Ty;function K8(){if(Ty)return Xc.exports;Ty=1;var i=Kc(),e=H8(),t=q8(),n=z8(),r=G8();u.httpHandler=W8(),u.requestInterceptorsStorage=new n,u.responseInterceptorsStorage=new n,u.retryManager=new r;/**
|
27
|
+
* @license
|
28
|
+
* slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
|
29
|
+
* Copyright (c) 2014 David Björklund
|
30
|
+
* Available under the MIT license
|
31
|
+
* <https://github.com/kesla/parse-headers/blob/master/LICENCE>
|
32
|
+
*/var s=function(y){var p={};return y&&y.trim().split(`
|
33
|
+
`).forEach(function(f){var m=f.indexOf(":"),_=f.slice(0,m).trim().toLowerCase(),k=f.slice(m+1).trim();typeof p[_]>"u"?p[_]=k:Array.isArray(p[_])?p[_].push(k):p[_]=[p[_],k]}),p};Xc.exports=u,Xc.exports.default=u,u.XMLHttpRequest=i.XMLHttpRequest||b,u.XDomainRequest="withCredentials"in new u.XMLHttpRequest?u.XMLHttpRequest:i.XDomainRequest,a(["get","put","post","patch","head","delete"],function(v){u[v==="delete"?"del":v]=function(y,p,f){return p=c(y,p,f),p.method=v.toUpperCase(),d(p)}});function a(v,y){for(var p=0;p<v.length;p++)y(v[p])}function o(v){for(var y in v)if(v.hasOwnProperty(y))return!1;return!0}function c(v,y,p){var f=v;return t(y)?(p=y,typeof v=="string"&&(f={uri:v})):f=e({},y,{uri:v}),f.callback=p,f}function u(v,y,p){return y=c(v,y,p),d(y)}function d(v){if(typeof v.callback>"u")throw new Error("callback argument missing");if(v.requestType&&u.requestInterceptorsStorage.getIsEnabled()){var y={uri:v.uri||v.url,headers:v.headers||{},body:v.body,metadata:v.metadata||{},retry:v.retry,timeout:v.timeout},p=u.requestInterceptorsStorage.execute(v.requestType,y);v.uri=p.uri,v.headers=p.headers,v.body=p.body,v.metadata=p.metadata,v.retry=p.retry,v.timeout=p.timeout}var f=!1,m=function(j,B,q){f||(f=!0,v.callback(j,B,q))};function _(){A.readyState===4&&!u.responseInterceptorsStorage.getIsEnabled()&&setTimeout(E,0)}function k(){var $=void 0;if(A.response?$=A.response:$=A.responseText||h(A),ie)try{$=JSON.parse($)}catch{}return $}function D($){if(clearTimeout(X),clearTimeout(v.retryTimeout),$ instanceof Error||($=new Error(""+($||"Unknown XMLHttpRequest Error"))),$.statusCode=0,!N&&u.retryManager.getIsEnabled()&&v.retry&&v.retry.shouldRetry()){v.retryTimeout=setTimeout(function(){v.retry.moveToNextAttempt(),v.xhr=A,d(v)},v.retry.getCurrentFuzzedDelay());return}if(v.requestType&&u.responseInterceptorsStorage.getIsEnabled()){var j={headers:H.headers||{},body:H.body,responseUrl:A.responseURL,responseType:A.responseType},B=u.responseInterceptorsStorage.execute(v.requestType,j);H.body=B.body,H.headers=B.headers}return m($,H)}function E(){if(!N){var $;clearTimeout(X),clearTimeout(v.retryTimeout),v.useXDR&&A.status===void 0?$=200:$=A.status===1223?204:A.status;var j=H,B=null;if($!==0?(j={body:k(),statusCode:$,method:P,headers:{},url:S,rawRequest:A},A.getAllResponseHeaders&&(j.headers=s(A.getAllResponseHeaders()))):B=new Error("Internal XMLHttpRequest Error"),v.requestType&&u.responseInterceptorsStorage.getIsEnabled()){var q={headers:j.headers||{},body:j.body,responseUrl:A.responseURL,responseType:A.responseType},z=u.responseInterceptorsStorage.execute(v.requestType,q);j.body=z.body,j.headers=z.headers}return m(B,j,j.body)}}var A=v.xhr||null;A||(v.cors||v.useXDR?A=new u.XDomainRequest:A=new u.XMLHttpRequest);var w,N,S=A.url=v.uri||v.url,P=A.method=v.method||"GET",F=v.body||v.data,V=A.headers=v.headers||{},J=!!v.sync,ie=!1,X,H={body:void 0,headers:{},statusCode:0,method:P,url:S,rawRequest:A};if("json"in v&&v.json!==!1&&(ie=!0,V.accept||V.Accept||(V.Accept="application/json"),P!=="GET"&&P!=="HEAD"&&(V["content-type"]||V["Content-Type"]||(V["Content-Type"]="application/json"),F=JSON.stringify(v.json===!0?F:v.json))),A.onreadystatechange=_,A.onload=E,A.onerror=D,A.onprogress=function(){},A.onabort=function(){N=!0,clearTimeout(v.retryTimeout)},A.ontimeout=D,A.open(P,S,!J,v.username,v.password),J||(A.withCredentials=!!v.withCredentials),!J&&v.timeout>0&&(X=setTimeout(function(){if(!N){N=!0,A.abort("timeout");var $=new Error("XMLHttpRequest timeout");$.code="ETIMEDOUT",D($)}},v.timeout)),A.setRequestHeader)for(w in V)V.hasOwnProperty(w)&&A.setRequestHeader(w,V[w]);else if(v.headers&&!o(v.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in v&&(A.responseType=v.responseType),"beforeSend"in v&&typeof v.beforeSend=="function"&&v.beforeSend(A),A.send(F||null),A}function h(v){try{if(v.responseType==="document")return v.responseXML;var y=v.responseXML&&v.responseXML.documentElement.nodeName==="parsererror";if(v.responseType===""&&!y)return v.responseXML}catch{}return null}function b(){}return Xc.exports}var X8=K8();const Sy=ga(X8);var hf={exports:{}},ff,Cy;function Y8(){if(Cy)return ff;Cy=1;var i=gy(),e=Object.create||function(){function S(){}return function(P){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return S.prototype=P,new S}}();function t(S,P){this.name="ParsingError",this.code=S.code,this.message=P||S.message}t.prototype=e(Error.prototype),t.prototype.constructor=t,t.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function n(S){function P(V,J,ie,X){return(V|0)*3600+(J|0)*60+(ie|0)+(X|0)/1e3}var F=S.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return F?F[3]?P(F[1],F[2],F[3].replace(":",""),F[4]):F[1]>59?P(F[1],F[2],0,F[4]):P(0,F[1],F[2],F[4]):null}function r(){this.values=e(null)}r.prototype={set:function(S,P){!this.get(S)&&P!==""&&(this.values[S]=P)},get:function(S,P,F){return F?this.has(S)?this.values[S]:P[F]:this.has(S)?this.values[S]:P},has:function(S){return S in this.values},alt:function(S,P,F){for(var V=0;V<F.length;++V)if(P===F[V]){this.set(S,P);break}},integer:function(S,P){/^-?\d+$/.test(P)&&this.set(S,parseInt(P,10))},percent:function(S,P){return P.match(/^([\d]{1,3})(\.[\d]*)?%$/)&&(P=parseFloat(P),P>=0&&P<=100)?(this.set(S,P),!0):!1}};function s(S,P,F,V){var J=V?S.split(V):[S];for(var ie in J)if(typeof J[ie]=="string"){var X=J[ie].split(F);if(X.length===2){var H=X[0].trim(),$=X[1].trim();P(H,$)}}}function a(S,P,F){var V=S;function J(){var H=n(S);if(H===null)throw new t(t.Errors.BadTimeStamp,"Malformed timestamp: "+V);return S=S.replace(/^[^\sa-zA-Z-]+/,""),H}function ie(H,$){var j=new r;s(H,function(B,q){switch(B){case"region":for(var z=F.length-1;z>=0;z--)if(F[z].id===q){j.set(B,F[z].region);break}break;case"vertical":j.alt(B,q,["rl","lr"]);break;case"line":var oe=q.split(","),we=oe[0];j.integer(B,we),j.percent(B,we)&&j.set("snapToLines",!1),j.alt(B,we,["auto"]),oe.length===2&&j.alt("lineAlign",oe[1],["start","center","end"]);break;case"position":oe=q.split(","),j.percent(B,oe[0]),oe.length===2&&j.alt("positionAlign",oe[1],["start","center","end"]);break;case"size":j.percent(B,q);break;case"align":j.alt(B,q,["start","center","end","left","right"]);break}},/:/,/\s/),$.region=j.get("region",null),$.vertical=j.get("vertical","");try{$.line=j.get("line","auto")}catch{}$.lineAlign=j.get("lineAlign","start"),$.snapToLines=j.get("snapToLines",!0),$.size=j.get("size",100);try{$.align=j.get("align","center")}catch{$.align=j.get("align","middle")}try{$.position=j.get("position","auto")}catch{$.position=j.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},$.align)}$.positionAlign=j.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},$.align)}function X(){S=S.replace(/^\s+/,"")}if(X(),P.startTime=J(),X(),S.substr(0,3)!=="-->")throw new t(t.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+V);S=S.substr(3),X(),P.endTime=J(),X(),ie(S,P)}var o=i.createElement&&i.createElement("textarea"),c={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},u={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},d={v:"title",lang:"lang"},h={rt:"ruby"};function b(S,P){function F(){if(!P)return null;function we(Z){return P=P.substr(Z.length),Z}var be=P.match(/^([^<]*)(<[^>]*>?)?/);return we(be[1]?be[1]:be[2])}function V(we){return o.innerHTML=we,we=o.textContent,o.textContent="",we}function J(we,be){return!h[be.localName]||h[be.localName]===we.localName}function ie(we,be){var Z=c[we];if(!Z)return null;var _e=S.document.createElement(Z),Te=d[we];return Te&&be&&(_e[Te]=be.trim()),_e}for(var X=S.document.createElement("div"),H=X,$,j=[];($=F())!==null;){if($[0]==="<"){if($[1]==="/"){j.length&&j[j.length-1]===$.substr(2).replace(">","")&&(j.pop(),H=H.parentNode);continue}var B=n($.substr(1,$.length-2)),q;if(B){q=S.document.createProcessingInstruction("timestamp",B),H.appendChild(q);continue}var z=$.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!z||(q=ie(z[1],z[3]),!q)||!J(H,q))continue;if(z[2]){var oe=z[2].split(".");oe.forEach(function(we){var be=/^bg_/.test(we),Z=be?we.slice(3):we;if(u.hasOwnProperty(Z)){var _e=be?"background-color":"color",Te=u[Z];q.style[_e]=Te}}),q.className=oe.join(" ")}j.push(z[1]),H.appendChild(q),H=q;continue}H.appendChild(S.document.createTextNode(V($)))}return X}var v=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function y(S){for(var P=0;P<v.length;P++){var F=v[P];if(S>=F[0]&&S<=F[1])return!0}return!1}function p(S){var P=[],F="",V;if(!S||!S.childNodes)return"ltr";function J(H,$){for(var j=$.childNodes.length-1;j>=0;j--)H.push($.childNodes[j])}function ie(H){if(!H||!H.length)return null;var $=H.pop(),j=$.textContent||$.innerText;if(j){var B=j.match(/^.*(\n|\r)/);return B?(H.length=0,B[0]):j}if($.tagName==="ruby")return ie(H);if($.childNodes)return J(H,$),ie(H)}for(J(P,S);F=ie(P);)for(var X=0;X<F.length;X++)if(V=F.charCodeAt(X),y(V))return"rtl";return"ltr"}function f(S){if(typeof S.line=="number"&&(S.snapToLines||S.line>=0&&S.line<=100))return S.line;if(!S.track||!S.track.textTrackList||!S.track.textTrackList.mediaElement)return-1;for(var P=S.track,F=P.textTrackList,V=0,J=0;J<F.length&&F[J]!==P;J++)F[J].mode==="showing"&&V++;return++V*-1}function m(){}m.prototype.applyStyles=function(S,P){P=P||this.div;for(var F in S)S.hasOwnProperty(F)&&(P.style[F]=S[F])},m.prototype.formatStyle=function(S,P){return S===0?0:S+P};function _(S,P,F){m.call(this),this.cue=P,this.cueDiv=b(S,P.text);var V={color:"rgba(255, 255, 255, 1)",backgroundColor:"rgba(0, 0, 0, 0.8)",position:"relative",left:0,right:0,top:0,bottom:0,display:"inline",writingMode:P.vertical===""?"horizontal-tb":P.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext"};this.applyStyles(V,this.cueDiv),this.div=S.document.createElement("div"),V={direction:p(this.cueDiv),writingMode:P.vertical===""?"horizontal-tb":P.vertical==="lr"?"vertical-lr":"vertical-rl",unicodeBidi:"plaintext",textAlign:P.align==="middle"?"center":P.align,font:F.font,whiteSpace:"pre-line",position:"absolute"},this.applyStyles(V),this.div.appendChild(this.cueDiv);var J=0;switch(P.positionAlign){case"start":case"line-left":J=P.position;break;case"center":J=P.position-P.size/2;break;case"end":case"line-right":J=P.position-P.size;break}P.vertical===""?this.applyStyles({left:this.formatStyle(J,"%"),width:this.formatStyle(P.size,"%")}):this.applyStyles({top:this.formatStyle(J,"%"),height:this.formatStyle(P.size,"%")}),this.move=function(ie){this.applyStyles({top:this.formatStyle(ie.top,"px"),bottom:this.formatStyle(ie.bottom,"px"),left:this.formatStyle(ie.left,"px"),right:this.formatStyle(ie.right,"px"),height:this.formatStyle(ie.height,"px"),width:this.formatStyle(ie.width,"px")})}}_.prototype=e(m.prototype),_.prototype.constructor=_;function k(S){var P,F,V,J;if(S.div){F=S.div.offsetHeight,V=S.div.offsetWidth,J=S.div.offsetTop;var ie=(ie=S.div.childNodes)&&(ie=ie[0])&&ie.getClientRects&&ie.getClientRects();S=S.div.getBoundingClientRect(),P=ie?Math.max(ie[0]&&ie[0].height||0,S.height/ie.length):0}this.left=S.left,this.right=S.right,this.top=S.top||J,this.height=S.height||F,this.bottom=S.bottom||J+(S.height||F),this.width=S.width||V,this.lineHeight=P!==void 0?P:S.lineHeight}k.prototype.move=function(S,P){switch(P=P!==void 0?P:this.lineHeight,S){case"+x":this.left+=P,this.right+=P;break;case"-x":this.left-=P,this.right-=P;break;case"+y":this.top+=P,this.bottom+=P;break;case"-y":this.top-=P,this.bottom-=P;break}},k.prototype.overlaps=function(S){return this.left<S.right&&this.right>S.left&&this.top<S.bottom&&this.bottom>S.top},k.prototype.overlapsAny=function(S){for(var P=0;P<S.length;P++)if(this.overlaps(S[P]))return!0;return!1},k.prototype.within=function(S){return this.top>=S.top&&this.bottom<=S.bottom&&this.left>=S.left&&this.right<=S.right},k.prototype.overlapsOppositeAxis=function(S,P){switch(P){case"+x":return this.left<S.left;case"-x":return this.right>S.right;case"+y":return this.top<S.top;case"-y":return this.bottom>S.bottom}},k.prototype.intersectPercentage=function(S){var P=Math.max(0,Math.min(this.right,S.right)-Math.max(this.left,S.left)),F=Math.max(0,Math.min(this.bottom,S.bottom)-Math.max(this.top,S.top)),V=P*F;return V/(this.height*this.width)},k.prototype.toCSSCompatValues=function(S){return{top:this.top-S.top,bottom:S.bottom-this.bottom,left:this.left-S.left,right:S.right-this.right,height:this.height,width:this.width}},k.getSimpleBoxPosition=function(S){var P=S.div?S.div.offsetHeight:S.tagName?S.offsetHeight:0,F=S.div?S.div.offsetWidth:S.tagName?S.offsetWidth:0,V=S.div?S.div.offsetTop:S.tagName?S.offsetTop:0;S=S.div?S.div.getBoundingClientRect():S.tagName?S.getBoundingClientRect():S;var J={left:S.left,right:S.right,top:S.top||V,height:S.height||P,bottom:S.bottom||V+(S.height||P),width:S.width||F};return J};function D(S,P,F,V){function J(Z,_e){for(var Te,Ue=new k(Z),We=1,pe=0;pe<_e.length;pe++){for(;Z.overlapsOppositeAxis(F,_e[pe])||Z.within(F)&&Z.overlapsAny(V);)Z.move(_e[pe]);if(Z.within(F))return Z;var Ne=Z.intersectPercentage(F);We>Ne&&(Te=new k(Z),We=Ne),Z=new k(Ue)}return Te||Ue}var ie=new k(P),X=P.cue,H=f(X),$=[];if(X.snapToLines){var j;switch(X.vertical){case"":$=["+y","-y"],j="height";break;case"rl":$=["+x","-x"],j="width";break;case"lr":$=["-x","+x"],j="width";break}var B=ie.lineHeight,q=B*Math.round(H),z=F[j]+B,oe=$[0];Math.abs(q)>z&&(q=q<0?-1:1,q*=Math.ceil(z/B)*B),H<0&&(q+=X.vertical===""?F.height:F.width,$=$.reverse()),ie.move(oe,q)}else{var we=ie.lineHeight/F.height*100;switch(X.lineAlign){case"center":H-=we/2;break;case"end":H-=we;break}switch(X.vertical){case"":P.applyStyles({top:P.formatStyle(H,"%")});break;case"rl":P.applyStyles({left:P.formatStyle(H,"%")});break;case"lr":P.applyStyles({right:P.formatStyle(H,"%")});break}$=["+y","-x","+x","-y"],ie=new k(P)}var be=J(ie,$);P.move(be.toCSSCompatValues(F))}function E(){}E.StringDecoder=function(){return{decode:function(S){if(!S)return"";if(typeof S!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(S))}}},E.convertCueToDOMTree=function(S,P){return!S||!P?null:b(S,P)};var A=.05,w="sans-serif",N="1.5%";return E.processCues=function(S,P,F){if(!S||!P||!F)return null;for(;F.firstChild;)F.removeChild(F.firstChild);var V=S.document.createElement("div");V.style.position="absolute",V.style.left="0",V.style.right="0",V.style.top="0",V.style.bottom="0",V.style.margin=N,F.appendChild(V);function J(B){for(var q=0;q<B.length;q++)if(B[q].hasBeenReset||!B[q].displayState)return!0;return!1}if(!J(P)){for(var ie=0;ie<P.length;ie++)V.appendChild(P[ie].displayState);return}var X=[],H=k.getSimpleBoxPosition(V),$=Math.round(H.height*A*100)/100,j={font:$+"px "+w};(function(){for(var B,q,z=0;z<P.length;z++)q=P[z],B=new _(S,q,j),V.appendChild(B.div),D(S,B,H,X),q.displayState=B.div,X.push(k.getSimpleBoxPosition(B))})()},E.Parser=function(S,P,F){F||(F=P,P={}),P||(P={}),this.window=S,this.vttjs=P,this.state="INITIAL",this.buffer="",this.decoder=F||new TextDecoder("utf8"),this.regionList=[]},E.Parser.prototype={reportOrThrowError:function(S){if(S instanceof t)this.onparsingerror&&this.onparsingerror(S);else throw S},parse:function(S){var P=this;S&&(P.buffer+=P.decoder.decode(S,{stream:!0}));function F(){for(var B=P.buffer,q=0;q<B.length&&B[q]!=="\r"&&B[q]!==`
|
34
|
+
`;)++q;var z=B.substr(0,q);return B[q]==="\r"&&++q,B[q]===`
|
35
|
+
`&&++q,P.buffer=B.substr(q),z}function V(B){var q=new r;if(s(B,function(oe,we){switch(oe){case"id":q.set(oe,we);break;case"width":q.percent(oe,we);break;case"lines":q.integer(oe,we);break;case"regionanchor":case"viewportanchor":var be=we.split(",");if(be.length!==2)break;var Z=new r;if(Z.percent("x",be[0]),Z.percent("y",be[1]),!Z.has("x")||!Z.has("y"))break;q.set(oe+"X",Z.get("x")),q.set(oe+"Y",Z.get("y"));break;case"scroll":q.alt(oe,we,["up"]);break}},/=/,/\s/),q.has("id")){var z=new(P.vttjs.VTTRegion||P.window.VTTRegion);z.width=q.get("width",100),z.lines=q.get("lines",3),z.regionAnchorX=q.get("regionanchorX",0),z.regionAnchorY=q.get("regionanchorY",100),z.viewportAnchorX=q.get("viewportanchorX",0),z.viewportAnchorY=q.get("viewportanchorY",100),z.scroll=q.get("scroll",""),P.onregion&&P.onregion(z),P.regionList.push({id:q.get("id"),region:z})}}function J(B){var q=new r;s(B,function(z,oe){switch(z){case"MPEGT":q.integer(z+"S",oe);break;case"LOCA":q.set(z+"L",n(oe));break}},/[^\d]:/,/,/),P.ontimestampmap&&P.ontimestampmap({MPEGTS:q.get("MPEGTS"),LOCAL:q.get("LOCAL")})}function ie(B){B.match(/X-TIMESTAMP-MAP/)?s(B,function(q,z){switch(q){case"X-TIMESTAMP-MAP":J(z);break}},/=/):s(B,function(q,z){switch(q){case"Region":V(z);break}},/:/)}try{var X;if(P.state==="INITIAL"){if(!/\r\n|\n/.test(P.buffer))return this;X=F();var H=X.match(/^WEBVTT([ \t].*)?$/);if(!H||!H[0])throw new t(t.Errors.BadSignature);P.state="HEADER"}for(var $=!1;P.buffer;){if(!/\r\n|\n/.test(P.buffer))return this;switch($?$=!1:X=F(),P.state){case"HEADER":/:/.test(X)?ie(X):X||(P.state="ID");continue;case"NOTE":X||(P.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(X)){P.state="NOTE";break}if(!X)continue;P.cue=new(P.vttjs.VTTCue||P.window.VTTCue)(0,0,"");try{P.cue.align="center"}catch{P.cue.align="middle"}if(P.state="CUE",X.indexOf("-->")===-1){P.cue.id=X;continue}case"CUE":try{a(X,P.cue,P.regionList)}catch(B){P.reportOrThrowError(B),P.cue=null,P.state="BADCUE";continue}P.state="CUETEXT";continue;case"CUETEXT":var j=X.indexOf("-->")!==-1;if(!X||j&&($=!0)){P.oncue&&P.oncue(P.cue),P.cue=null,P.state="ID";continue}P.cue.text&&(P.cue.text+=`
|
36
|
+
`),P.cue.text+=X.replace(/\u2028/g,`
|
37
|
+
`).replace(/u2029/g,`
|
38
|
+
`);continue;case"BADCUE":X||(P.state="ID");continue}}}catch(B){P.reportOrThrowError(B),P.state==="CUETEXT"&&P.cue&&P.oncue&&P.oncue(P.cue),P.cue=null,P.state=P.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var S=this;try{if(S.buffer+=S.decoder.decode(),(S.cue||S.state==="HEADER")&&(S.buffer+=`
|
39
|
+
|
40
|
+
`,S.parse()),S.state==="INITIAL")throw new t(t.Errors.BadSignature)}catch(P){S.reportOrThrowError(P)}return S.onflush&&S.onflush(),this}},ff=E,ff}var pf,xy;function J8(){if(xy)return pf;xy=1;var i="auto",e={"":1,lr:1,rl:1},t={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function n(a){if(typeof a!="string")return!1;var o=e[a.toLowerCase()];return o?a.toLowerCase():!1}function r(a){if(typeof a!="string")return!1;var o=t[a.toLowerCase()];return o?a.toLowerCase():!1}function s(a,o,c){this.hasBeenReset=!1;var u="",d=!1,h=a,b=o,v=c,y=null,p="",f=!0,m="auto",_="start",k="auto",D="auto",E=100,A="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return u},set:function(w){u=""+w}},pauseOnExit:{enumerable:!0,get:function(){return d},set:function(w){d=!!w}},startTime:{enumerable:!0,get:function(){return h},set:function(w){if(typeof w!="number")throw new TypeError("Start time must be set to a number.");h=w,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return b},set:function(w){if(typeof w!="number")throw new TypeError("End time must be set to a number.");b=w,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return v},set:function(w){v=""+w,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return y},set:function(w){y=w,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return p},set:function(w){var N=n(w);if(N===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");p=N,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return f},set:function(w){f=!!w,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return m},set:function(w){if(typeof w!="number"&&w!==i)throw new SyntaxError("Line: an invalid number or illegal string was specified.");m=w,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return _},set:function(w){var N=r(w);N?(_=N,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return k},set:function(w){if(w<0||w>100)throw new Error("Position must be between 0 and 100.");k=w,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return D},set:function(w){var N=r(w);N?(D=N,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return E},set:function(w){if(w<0||w>100)throw new Error("Size must be between 0 and 100.");E=w,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return A},set:function(w){var N=r(w);if(!N)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");A=N,this.hasBeenReset=!0}}}),this.displayState=void 0}return s.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)},pf=s,pf}var mf,Ey;function Q8(){if(Ey)return mf;Ey=1;var i={"":!0,up:!0};function e(r){if(typeof r!="string")return!1;var s=i[r.toLowerCase()];return s?r.toLowerCase():!1}function t(r){return typeof r=="number"&&r>=0&&r<=100}function n(){var r=100,s=3,a=0,o=100,c=0,u=100,d="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return r},set:function(h){if(!t(h))throw new Error("Width must be between 0 and 100.");r=h}},lines:{enumerable:!0,get:function(){return s},set:function(h){if(typeof h!="number")throw new TypeError("Lines must be set to a number.");s=h}},regionAnchorY:{enumerable:!0,get:function(){return o},set:function(h){if(!t(h))throw new Error("RegionAnchorX must be between 0 and 100.");o=h}},regionAnchorX:{enumerable:!0,get:function(){return a},set:function(h){if(!t(h))throw new Error("RegionAnchorY must be between 0 and 100.");a=h}},viewportAnchorY:{enumerable:!0,get:function(){return u},set:function(h){if(!t(h))throw new Error("ViewportAnchorY must be between 0 and 100.");u=h}},viewportAnchorX:{enumerable:!0,get:function(){return c},set:function(h){if(!t(h))throw new Error("ViewportAnchorX must be between 0 and 100.");c=h}},scroll:{enumerable:!0,get:function(){return d},set:function(h){var b=e(h);b===!1?console.warn("Scroll: an invalid or illegal string was specified."):d=b}}})}return mf=n,mf}var wy;function Z8(){if(wy)return hf.exports;wy=1;var i=Kc(),e=hf.exports={WebVTT:Y8(),VTTCue:J8(),VTTRegion:Q8()};i.vttjs=e,i.WebVTT=e.WebVTT;var t=e.VTTCue,n=e.VTTRegion,r=i.VTTCue,s=i.VTTRegion;return e.shim=function(){i.VTTCue=t,i.VTTRegion=n},e.restore=function(){i.VTTCue=r,i.VTTRegion=s},i.VTTCue||e.shim(),hf.exports}var e6=Z8();const Dy=ga(e6);function un(){return un=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},un.apply(null,arguments)}var Ay="https://example.com",Yc=function(e,t){if(/^[a-z]+:/i.test(t))return t;/^data:/.test(e)&&(e=te.location&&te.location.href||"");var n=/^\/\//.test(e),r=!te.location&&!/\/\//i.test(e);e=new te.URL(e,te.location||Ay);var s=new URL(t,e);return r?s.href.slice(Ay.length):n?s.href.slice(s.protocol.length):s.href},gf=function(){function i(){this.listeners={}}var e=i.prototype;return e.on=function(n,r){this.listeners[n]||(this.listeners[n]=[]),this.listeners[n].push(r)},e.off=function(n,r){if(!this.listeners[n])return!1;var s=this.listeners[n].indexOf(r);return this.listeners[n]=this.listeners[n].slice(0),this.listeners[n].splice(s,1),s>-1},e.trigger=function(n){var r=this.listeners[n];if(r)if(arguments.length===2)for(var s=r.length,a=0;a<s;++a)r[a].call(this,arguments[1]);else for(var o=Array.prototype.slice.call(arguments,1),c=r.length,u=0;u<c;++u)r[u].apply(this,o)},e.dispose=function(){this.listeners={}},e.pipe=function(n){this.on("data",function(r){n.push(r)})},i}(),t6=function(e){return te.atob?te.atob(e):Buffer.from(e,"base64").toString("binary")};function Iy(i){for(var e=t6(i),t=new Uint8Array(e.length),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}/*! @name m3u8-parser @version 7.2.0 @license Apache-2.0 */class n6 extends gf{constructor(){super(),this.buffer=""}push(e){let t;for(this.buffer+=e,t=this.buffer.indexOf(`
|
41
|
+
`);t>-1;t=this.buffer.indexOf(`
|
42
|
+
`))this.trigger("data",this.buffer.substring(0,t)),this.buffer=this.buffer.substring(t+1)}}const i6=" ",vf=function(i){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(i||""),t={};return e[1]&&(t.length=parseInt(e[1],10)),e[2]&&(t.offset=parseInt(e[2],10)),t},r6=function(){const t="(?:"+"[^=]*"+")=(?:"+'"[^"]*"|[^,]*'+")";return new RegExp("(?:^|,)("+t+")")},Gn=function(i){const e={};if(!i)return e;const t=i.split(r6());let n=t.length,r;for(;n--;)t[n]!==""&&(r=/([^=]*)=(.*)/.exec(t[n]).slice(1),r[0]=r[0].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^['"](.*)['"]$/g,"$1"),e[r[0]]=r[1]);return e},Ny=i=>{const e=i.split("x"),t={};return e[0]&&(t.width=parseInt(e[0],10)),e[1]&&(t.height=parseInt(e[1],10)),t};class s6 extends gf{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let t,n;if(e=e.trim(),e.length===0)return;if(e[0]!=="#"){this.trigger("data",{type:"uri",uri:e});return}this.tagMappers.reduce((s,a)=>{const o=a(e);return o===e?s:s.concat([o])},[e]).forEach(s=>{for(let a=0;a<this.customParsers.length;a++)if(this.customParsers[a].call(this,s))return;if(s.indexOf("#EXT")!==0){this.trigger("data",{type:"comment",text:s.slice(1)});return}if(s=s.replace("\r",""),t=/^#EXTM3U/.exec(s),t){this.trigger("data",{type:"tag",tagType:"m3u"});return}if(t=/^#EXTINF:([0-9\.]*)?,?(.*)?$/.exec(s),t){n={type:"tag",tagType:"inf"},t[1]&&(n.duration=parseFloat(t[1])),t[2]&&(n.title=t[2]),this.trigger("data",n);return}if(t=/^#EXT-X-TARGETDURATION:([0-9.]*)?/.exec(s),t){n={type:"tag",tagType:"targetduration"},t[1]&&(n.duration=parseInt(t[1],10)),this.trigger("data",n);return}if(t=/^#EXT-X-VERSION:([0-9.]*)?/.exec(s),t){n={type:"tag",tagType:"version"},t[1]&&(n.version=parseInt(t[1],10)),this.trigger("data",n);return}if(t=/^#EXT-X-MEDIA-SEQUENCE:(\-?[0-9.]*)?/.exec(s),t){n={type:"tag",tagType:"media-sequence"},t[1]&&(n.number=parseInt(t[1],10)),this.trigger("data",n);return}if(t=/^#EXT-X-DISCONTINUITY-SEQUENCE:(\-?[0-9.]*)?/.exec(s),t){n={type:"tag",tagType:"discontinuity-sequence"},t[1]&&(n.number=parseInt(t[1],10)),this.trigger("data",n);return}if(t=/^#EXT-X-PLAYLIST-TYPE:(.*)?$/.exec(s),t){n={type:"tag",tagType:"playlist-type"},t[1]&&(n.playlistType=t[1]),this.trigger("data",n);return}if(t=/^#EXT-X-BYTERANGE:(.*)?$/.exec(s),t){n=un(vf(t[1]),{type:"tag",tagType:"byterange"}),this.trigger("data",n);return}if(t=/^#EXT-X-ALLOW-CACHE:(YES|NO)?/.exec(s),t){n={type:"tag",tagType:"allow-cache"},t[1]&&(n.allowed=!/NO/.test(t[1])),this.trigger("data",n);return}if(t=/^#EXT-X-MAP:(.*)$/.exec(s),t){if(n={type:"tag",tagType:"map"},t[1]){const a=Gn(t[1]);a.URI&&(n.uri=a.URI),a.BYTERANGE&&(n.byterange=vf(a.BYTERANGE))}this.trigger("data",n);return}if(t=/^#EXT-X-STREAM-INF:(.*)$/.exec(s),t){n={type:"tag",tagType:"stream-inf"},t[1]&&(n.attributes=Gn(t[1]),n.attributes.RESOLUTION&&(n.attributes.RESOLUTION=Ny(n.attributes.RESOLUTION)),n.attributes.BANDWIDTH&&(n.attributes.BANDWIDTH=parseInt(n.attributes.BANDWIDTH,10)),n.attributes["FRAME-RATE"]&&(n.attributes["FRAME-RATE"]=parseFloat(n.attributes["FRAME-RATE"])),n.attributes["PROGRAM-ID"]&&(n.attributes["PROGRAM-ID"]=parseInt(n.attributes["PROGRAM-ID"],10))),this.trigger("data",n);return}if(t=/^#EXT-X-MEDIA:(.*)$/.exec(s),t){n={type:"tag",tagType:"media"},t[1]&&(n.attributes=Gn(t[1])),this.trigger("data",n);return}if(t=/^#EXT-X-ENDLIST/.exec(s),t){this.trigger("data",{type:"tag",tagType:"endlist"});return}if(t=/^#EXT-X-DISCONTINUITY/.exec(s),t){this.trigger("data",{type:"tag",tagType:"discontinuity"});return}if(t=/^#EXT-X-PROGRAM-DATE-TIME:(.*)$/.exec(s),t){n={type:"tag",tagType:"program-date-time"},t[1]&&(n.dateTimeString=t[1],n.dateTimeObject=new Date(t[1])),this.trigger("data",n);return}if(t=/^#EXT-X-KEY:(.*)$/.exec(s),t){n={type:"tag",tagType:"key"},t[1]&&(n.attributes=Gn(t[1]),n.attributes.IV&&(n.attributes.IV.substring(0,2).toLowerCase()==="0x"&&(n.attributes.IV=n.attributes.IV.substring(2)),n.attributes.IV=n.attributes.IV.match(/.{8}/g),n.attributes.IV[0]=parseInt(n.attributes.IV[0],16),n.attributes.IV[1]=parseInt(n.attributes.IV[1],16),n.attributes.IV[2]=parseInt(n.attributes.IV[2],16),n.attributes.IV[3]=parseInt(n.attributes.IV[3],16),n.attributes.IV=new Uint32Array(n.attributes.IV))),this.trigger("data",n);return}if(t=/^#EXT-X-START:(.*)$/.exec(s),t){n={type:"tag",tagType:"start"},t[1]&&(n.attributes=Gn(t[1]),n.attributes["TIME-OFFSET"]=parseFloat(n.attributes["TIME-OFFSET"]),n.attributes.PRECISE=/YES/.test(n.attributes.PRECISE)),this.trigger("data",n);return}if(t=/^#EXT-X-CUE-OUT-CONT:(.*)?$/.exec(s),t){n={type:"tag",tagType:"cue-out-cont"},t[1]?n.data=t[1]:n.data="",this.trigger("data",n);return}if(t=/^#EXT-X-CUE-OUT:(.*)?$/.exec(s),t){n={type:"tag",tagType:"cue-out"},t[1]?n.data=t[1]:n.data="",this.trigger("data",n);return}if(t=/^#EXT-X-CUE-IN:?(.*)?$/.exec(s),t){n={type:"tag",tagType:"cue-in"},t[1]?n.data=t[1]:n.data="",this.trigger("data",n);return}if(t=/^#EXT-X-SKIP:(.*)$/.exec(s),t&&t[1]){n={type:"tag",tagType:"skip"},n.attributes=Gn(t[1]),n.attributes.hasOwnProperty("SKIPPED-SEGMENTS")&&(n.attributes["SKIPPED-SEGMENTS"]=parseInt(n.attributes["SKIPPED-SEGMENTS"],10)),n.attributes.hasOwnProperty("RECENTLY-REMOVED-DATERANGES")&&(n.attributes["RECENTLY-REMOVED-DATERANGES"]=n.attributes["RECENTLY-REMOVED-DATERANGES"].split(i6)),this.trigger("data",n);return}if(t=/^#EXT-X-PART:(.*)$/.exec(s),t&&t[1]){n={type:"tag",tagType:"part"},n.attributes=Gn(t[1]),["DURATION"].forEach(function(a){n.attributes.hasOwnProperty(a)&&(n.attributes[a]=parseFloat(n.attributes[a]))}),["INDEPENDENT","GAP"].forEach(function(a){n.attributes.hasOwnProperty(a)&&(n.attributes[a]=/YES/.test(n.attributes[a]))}),n.attributes.hasOwnProperty("BYTERANGE")&&(n.attributes.byterange=vf(n.attributes.BYTERANGE)),this.trigger("data",n);return}if(t=/^#EXT-X-SERVER-CONTROL:(.*)$/.exec(s),t&&t[1]){n={type:"tag",tagType:"server-control"},n.attributes=Gn(t[1]),["CAN-SKIP-UNTIL","PART-HOLD-BACK","HOLD-BACK"].forEach(function(a){n.attributes.hasOwnProperty(a)&&(n.attributes[a]=parseFloat(n.attributes[a]))}),["CAN-SKIP-DATERANGES","CAN-BLOCK-RELOAD"].forEach(function(a){n.attributes.hasOwnProperty(a)&&(n.attributes[a]=/YES/.test(n.attributes[a]))}),this.trigger("data",n);return}if(t=/^#EXT-X-PART-INF:(.*)$/.exec(s),t&&t[1]){n={type:"tag",tagType:"part-inf"},n.attributes=Gn(t[1]),["PART-TARGET"].forEach(function(a){n.attributes.hasOwnProperty(a)&&(n.attributes[a]=parseFloat(n.attributes[a]))}),this.trigger("data",n);return}if(t=/^#EXT-X-PRELOAD-HINT:(.*)$/.exec(s),t&&t[1]){n={type:"tag",tagType:"preload-hint"},n.attributes=Gn(t[1]),["BYTERANGE-START","BYTERANGE-LENGTH"].forEach(function(a){if(n.attributes.hasOwnProperty(a)){n.attributes[a]=parseInt(n.attributes[a],10);const o=a==="BYTERANGE-LENGTH"?"length":"offset";n.attributes.byterange=n.attributes.byterange||{},n.attributes.byterange[o]=n.attributes[a],delete n.attributes[a]}}),this.trigger("data",n);return}if(t=/^#EXT-X-RENDITION-REPORT:(.*)$/.exec(s),t&&t[1]){n={type:"tag",tagType:"rendition-report"},n.attributes=Gn(t[1]),["LAST-MSN","LAST-PART"].forEach(function(a){n.attributes.hasOwnProperty(a)&&(n.attributes[a]=parseInt(n.attributes[a],10))}),this.trigger("data",n);return}if(t=/^#EXT-X-DATERANGE:(.*)$/.exec(s),t&&t[1]){n={type:"tag",tagType:"daterange"},n.attributes=Gn(t[1]),["ID","CLASS"].forEach(function(o){n.attributes.hasOwnProperty(o)&&(n.attributes[o]=String(n.attributes[o]))}),["START-DATE","END-DATE"].forEach(function(o){n.attributes.hasOwnProperty(o)&&(n.attributes[o]=new Date(n.attributes[o]))}),["DURATION","PLANNED-DURATION"].forEach(function(o){n.attributes.hasOwnProperty(o)&&(n.attributes[o]=parseFloat(n.attributes[o]))}),["END-ON-NEXT"].forEach(function(o){n.attributes.hasOwnProperty(o)&&(n.attributes[o]=/YES/i.test(n.attributes[o]))}),["SCTE35-CMD"," SCTE35-OUT","SCTE35-IN"].forEach(function(o){n.attributes.hasOwnProperty(o)&&(n.attributes[o]=n.attributes[o].toString(16))});const a=/^X-([A-Z]+-)+[A-Z]+$/;for(const o in n.attributes){if(!a.test(o))continue;const c=/[0-9A-Fa-f]{6}/g.test(n.attributes[o]),u=/^\d+(\.\d+)?$/.test(n.attributes[o]);n.attributes[o]=c?n.attributes[o].toString(16):u?parseFloat(n.attributes[o]):String(n.attributes[o])}this.trigger("data",n);return}if(t=/^#EXT-X-INDEPENDENT-SEGMENTS/.exec(s),t){this.trigger("data",{type:"tag",tagType:"independent-segments"});return}if(t=/^#EXT-X-I-FRAMES-ONLY/.exec(s),t){this.trigger("data",{type:"tag",tagType:"i-frames-only"});return}if(t=/^#EXT-X-CONTENT-STEERING:(.*)$/.exec(s),t){n={type:"tag",tagType:"content-steering"},n.attributes=Gn(t[1]),this.trigger("data",n);return}if(t=/^#EXT-X-I-FRAME-STREAM-INF:(.*)$/.exec(s),t){n={type:"tag",tagType:"i-frame-playlist"},n.attributes=Gn(t[1]),n.attributes.URI&&(n.uri=n.attributes.URI),n.attributes.BANDWIDTH&&(n.attributes.BANDWIDTH=parseInt(n.attributes.BANDWIDTH,10)),n.attributes.RESOLUTION&&(n.attributes.RESOLUTION=Ny(n.attributes.RESOLUTION)),n.attributes["AVERAGE-BANDWIDTH"]&&(n.attributes["AVERAGE-BANDWIDTH"]=parseInt(n.attributes["AVERAGE-BANDWIDTH"],10)),n.attributes["FRAME-RATE"]&&(n.attributes["FRAME-RATE"]=parseFloat(n.attributes["FRAME-RATE"])),this.trigger("data",n);return}if(t=/^#EXT-X-DEFINE:(.*)$/.exec(s),t){n={type:"tag",tagType:"define"},n.attributes=Gn(t[1]),this.trigger("data",n);return}this.trigger("data",{type:"tag",data:s.slice(4)})})}addParser({expression:e,customType:t,dataParser:n,segment:r}){typeof n!="function"&&(n=s=>s),this.customParsers.push(s=>{if(e.exec(s))return this.trigger("data",{type:"custom",data:n(s),customType:t,segment:r}),!0})}addTagMapper({expression:e,map:t}){const n=r=>e.test(r)?t(r):r;this.tagMappers.push(n)}}const a6=i=>i.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),ts=function(i){const e={};return Object.keys(i).forEach(function(t){e[a6(t)]=i[t]}),e},yf=function(i){const{serverControl:e,targetDuration:t,partTargetDuration:n}=i;if(!e)return;const r="#EXT-X-SERVER-CONTROL",s="holdBack",a="partHoldBack",o=t&&t*3,c=n&&n*2;t&&!e.hasOwnProperty(s)&&(e[s]=o,this.trigger("info",{message:`${r} defaulting HOLD-BACK to targetDuration * 3 (${o}).`})),o&&e[s]<o&&(this.trigger("warn",{message:`${r} clamping HOLD-BACK (${e[s]}) to targetDuration * 3 (${o})`}),e[s]=o),n&&!e.hasOwnProperty(a)&&(e[a]=n*3,this.trigger("info",{message:`${r} defaulting PART-HOLD-BACK to partTargetDuration * 3 (${e[a]}).`})),n&&e[a]<c&&(this.trigger("warn",{message:`${r} clamping PART-HOLD-BACK (${e[a]}) to partTargetDuration * 2 (${c}).`}),e[a]=c)};class o6 extends gf{constructor(e={}){super(),this.lineStream=new n6,this.parseStream=new s6,this.lineStream.pipe(this.parseStream),this.mainDefinitions=e.mainDefinitions||{},this.params=new URL(e.uri,"https://a.com").searchParams,this.lastProgramDateTime=null;const t=this,n=[];let r={},s,a,o=!1;const c=function(){},u={AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},d="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed";let h=0;this.manifest={allowCache:!0,discontinuityStarts:[],dateRanges:[],iFramePlaylists:[],segments:[]};let b=0,v=0;const y={};this.on("end",()=>{r.uri||!r.parts&&!r.preloadHints||(!r.map&&s&&(r.map=s),!r.key&&a&&(r.key=a),!r.timeline&&typeof h=="number"&&(r.timeline=h),this.manifest.preloadSegment=r)}),this.parseStream.on("data",function(p){let f,m;if(t.manifest.definitions){for(const _ in t.manifest.definitions)if(p.uri&&(p.uri=p.uri.replace(`{$${_}}`,t.manifest.definitions[_])),p.attributes)for(const k in p.attributes)typeof p.attributes[k]=="string"&&(p.attributes[k]=p.attributes[k].replace(`{$${_}}`,t.manifest.definitions[_]))}({tag(){({version(){p.version&&(this.manifest.version=p.version)},"allow-cache"(){this.manifest.allowCache=p.allowed,"allowed"in p||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const _={};"length"in p&&(r.byterange=_,_.length=p.length,"offset"in p||(p.offset=b)),"offset"in p&&(r.byterange=_,_.offset=p.offset),b=_.offset+_.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),p.title&&(r.title=p.title),p.duration>0&&(r.duration=p.duration),p.duration===0&&(r.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=n},key(){if(!p.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(p.attributes.METHOD==="NONE"){a=null;return}if(!p.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(p.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:p.attributes};return}if(p.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:p.attributes.URI};return}if(p.attributes.KEYFORMAT===d){if(["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(p.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(p.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),p.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(p.attributes.KEYID&&p.attributes.KEYID.substring(0,2)==="0x")){this.trigger("warn",{message:"invalid key ID provided for Widevine"});return}this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:p.attributes.KEYFORMAT,keyId:p.attributes.KEYID.substring(2)},pssh:Iy(p.attributes.URI.split(",")[1])};return}p.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),a={method:p.attributes.METHOD||"AES-128",uri:p.attributes.URI},typeof p.attributes.IV<"u"&&(a.iv=p.attributes.IV)},"media-sequence"(){if(!isFinite(p.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+p.number});return}this.manifest.mediaSequence=p.number},"discontinuity-sequence"(){if(!isFinite(p.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+p.number});return}this.manifest.discontinuitySequence=p.number,h=p.number},"playlist-type"(){if(!/VOD|EVENT/.test(p.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+p.playlist});return}this.manifest.playlistType=p.playlistType},map(){s={},p.uri&&(s.uri=p.uri),p.byterange&&(s.byterange=p.byterange),a&&(s.key=a)},"stream-inf"(){if(this.manifest.playlists=n,this.manifest.mediaGroups=this.manifest.mediaGroups||u,!p.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}r.attributes||(r.attributes={}),un(r.attributes,p.attributes)},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||u,!(p.attributes&&p.attributes.TYPE&&p.attributes["GROUP-ID"]&&p.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const _=this.manifest.mediaGroups[p.attributes.TYPE];_[p.attributes["GROUP-ID"]]=_[p.attributes["GROUP-ID"]]||{},f=_[p.attributes["GROUP-ID"]],m={default:/yes/i.test(p.attributes.DEFAULT)},m.default?m.autoselect=!0:m.autoselect=/yes/i.test(p.attributes.AUTOSELECT),p.attributes.LANGUAGE&&(m.language=p.attributes.LANGUAGE),p.attributes.URI&&(m.uri=p.attributes.URI),p.attributes["INSTREAM-ID"]&&(m.instreamId=p.attributes["INSTREAM-ID"]),p.attributes.CHARACTERISTICS&&(m.characteristics=p.attributes.CHARACTERISTICS),p.attributes.FORCED&&(m.forced=/yes/i.test(p.attributes.FORCED)),f[p.attributes.NAME]=m},discontinuity(){h+=1,r.discontinuity=!0,this.manifest.discontinuityStarts.push(n.length)},"program-date-time"(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=p.dateTimeString,this.manifest.dateTimeObject=p.dateTimeObject),r.dateTimeString=p.dateTimeString,r.dateTimeObject=p.dateTimeObject;const{lastProgramDateTime:_}=this;this.lastProgramDateTime=new Date(p.dateTimeString).getTime(),_===null&&this.manifest.segments.reduceRight((k,D)=>(D.programDateTime=k-D.duration*1e3,D.programDateTime),this.lastProgramDateTime)},targetduration(){if(!isFinite(p.duration)||p.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+p.duration});return}this.manifest.targetDuration=p.duration,yf.call(this,this.manifest)},start(){if(!p.attributes||isNaN(p.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:p.attributes["TIME-OFFSET"],precise:p.attributes.PRECISE}},"cue-out"(){r.cueOut=p.data},"cue-out-cont"(){r.cueOutCont=p.data},"cue-in"(){r.cueIn=p.data},skip(){this.manifest.skip=ts(p.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",p.attributes,["SKIPPED-SEGMENTS"])},part(){o=!0;const _=this.manifest.segments.length,k=ts(p.attributes);r.parts=r.parts||[],r.parts.push(k),k.byterange&&(k.byterange.hasOwnProperty("offset")||(k.byterange.offset=v),v=k.byterange.offset+k.byterange.length);const D=r.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${D} for segment #${_}`,p.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((E,A)=>{E.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${A} lacks required attribute(s): LAST-PART`})})},"server-control"(){const _=this.manifest.serverControl=ts(p.attributes);_.hasOwnProperty("canBlockReload")||(_.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),yf.call(this,this.manifest),_.canSkipDateranges&&!_.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const _=this.manifest.segments.length,k=ts(p.attributes),D=k.type&&k.type==="PART";r.preloadHints=r.preloadHints||[],r.preloadHints.push(k),k.byterange&&(k.byterange.hasOwnProperty("offset")||(k.byterange.offset=D?v:0,D&&(v=k.byterange.offset+k.byterange.length)));const E=r.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${E} for segment #${_}`,p.attributes,["TYPE","URI"]),!!k.type)for(let A=0;A<r.preloadHints.length-1;A++){const w=r.preloadHints[A];w.type&&w.type===k.type&&this.trigger("warn",{message:`#EXT-X-PRELOAD-HINT #${E} for segment #${_} has the same TYPE ${k.type} as preload hint #${A}`})}},"rendition-report"(){const _=ts(p.attributes);this.manifest.renditionReports=this.manifest.renditionReports||[],this.manifest.renditionReports.push(_);const k=this.manifest.renditionReports.length-1,D=["LAST-MSN","URI"];o&&D.push("LAST-PART"),this.warnOnMissingAttributes_(`#EXT-X-RENDITION-REPORT #${k}`,p.attributes,D)},"part-inf"(){this.manifest.partInf=ts(p.attributes),this.warnOnMissingAttributes_("#EXT-X-PART-INF",p.attributes,["PART-TARGET"]),this.manifest.partInf.partTarget&&(this.manifest.partTargetDuration=this.manifest.partInf.partTarget),yf.call(this,this.manifest)},daterange(){this.manifest.dateRanges.push(ts(p.attributes));const _=this.manifest.dateRanges.length-1;this.warnOnMissingAttributes_(`#EXT-X-DATERANGE #${_}`,p.attributes,["ID","START-DATE"]);const k=this.manifest.dateRanges[_];k.endDate&&k.startDate&&new Date(k.endDate)<new Date(k.startDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE END-DATE must be equal to or later than the value of the START-DATE"}),k.duration&&k.duration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE DURATION must not be negative"}),k.plannedDuration&&k.plannedDuration<0&&this.trigger("warn",{message:"EXT-X-DATERANGE PLANNED-DURATION must not be negative"});const D=!!k.endOnNext;if(D&&!k.class&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must have a CLASS attribute"}),D&&(k.duration||k.endDate)&&this.trigger("warn",{message:"EXT-X-DATERANGE with an END-ON-NEXT=YES attribute must not contain DURATION or END-DATE attributes"}),k.duration&&k.endDate){const A=k.startDate.getTime()+k.duration*1e3;this.manifest.dateRanges[_].endDate=new Date(A)}if(!y[k.id])y[k.id]=k;else{for(const A in y[k.id])if(k[A]&&JSON.stringify(y[k.id][A])!==JSON.stringify(k[A])){this.trigger("warn",{message:"EXT-X-DATERANGE tags with the same ID in a playlist must have the same attributes values"});break}const E=this.manifest.dateRanges.findIndex(A=>A.id===k.id);this.manifest.dateRanges[E]=un(this.manifest.dateRanges[E],k),y[k.id]=un(y[k.id],k),this.manifest.dateRanges.pop()}},"independent-segments"(){this.manifest.independentSegments=!0},"i-frames-only"(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=ts(p.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",p.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const _=(k,D)=>{if(k in this.manifest.definitions){this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${k}`});return}this.manifest.definitions[k]=D};if("QUERYPARAM"in p.attributes){if("NAME"in p.attributes||"IMPORT"in p.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}const k=this.params.get(p.attributes.QUERYPARAM);if(!k){this.trigger("error",{message:`EXT-X-DEFINE: No query param ${p.attributes.QUERYPARAM}`});return}_(p.attributes.QUERYPARAM,decodeURIComponent(k));return}if("NAME"in p.attributes){if("IMPORT"in p.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}if(!("VALUE"in p.attributes)||typeof p.attributes.VALUE!="string"){this.trigger("error",{message:`EXT-X-DEFINE: No value for ${p.attributes.NAME}`});return}_(p.attributes.NAME,p.attributes.VALUE);return}if("IMPORT"in p.attributes){if(!this.mainDefinitions[p.attributes.IMPORT]){this.trigger("error",{message:`EXT-X-DEFINE: No value ${p.attributes.IMPORT} to import, or IMPORT used on main playlist`});return}_(p.attributes.IMPORT,this.mainDefinitions[p.attributes.IMPORT]);return}this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:p.attributes,uri:p.uri,timeline:h}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",p.attributes,["BANDWIDTH","URI"])}}[p.tagType]||c).call(t)},uri(){r.uri=p.uri,n.push(r),this.manifest.targetDuration&&!("duration"in r)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),r.duration=this.manifest.targetDuration),a&&(r.key=a),r.timeline=h,s&&(r.map=s),v=0,this.lastProgramDateTime!==null&&(r.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=r.duration*1e3),r={}},comment(){},custom(){p.segment?(r.custom=r.custom||{},r.custom[p.customType]=p.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[p.customType]=p.data)}})[p.type].call(t)})}requiredCompatibilityversion(e,t){(e<t||!e)&&this.trigger("warn",{message:`manifest must be at least version ${t}`})}warnOnMissingAttributes_(e,t,n){const r=[];n.forEach(function(s){t.hasOwnProperty(s)||r.push(s)}),r.length&&this.trigger("warn",{message:`${e} lacks required attribute(s): ${r.join(", ")}`})}push(e){this.lineStream.push(e)}end(){this.lineStream.push(`
|
43
|
+
`),this.manifest.dateRanges.length&&this.lastProgramDateTime===null&&this.trigger("warn",{message:"A playlist with EXT-X-DATERANGE tag must contain atleast one EXT-X-PROGRAM-DATE-TIME tag"}),this.lastProgramDateTime=null,this.trigger("end")}addParser(e){this.parseStream.addParser(e)}addTagMapper(e){this.parseStream.addTagMapper(e)}}var Os={mp4:/^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,webm:/^(vp0?[89]|av0?1|opus|vorbis)/,ogg:/^(vp0?[89]|theora|flac|opus|vorbis)/,video:/^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,audio:/^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,text:/^(stpp.ttml.im1t)/,muxerVideo:/^(avc0?1)/,muxerAudio:/^(mp4a)/,muxerText:/a^/},l6=["video","audio","text"],Py=["Video","Audio","Text"],Oy=function(e){return e&&e.replace(/avc1\.(\d+)\.(\d+)/i,function(t,n,r){var s=("00"+Number(n).toString(16)).slice(-2),a=("00"+Number(r).toString(16)).slice(-2);return"avc1."+s+"00"+a})},ir=function(e){e===void 0&&(e="");var t=e.split(","),n=[];return t.forEach(function(r){r=r.trim();var s;l6.forEach(function(a){var o=Os[a].exec(r.toLowerCase());if(!(!o||o.length<=1)){s=a;var c=r.substring(0,o[1].length),u=r.replace(c,"");n.push({type:c,details:u,mediaType:a})}}),s||n.push({type:r,details:"",mediaType:"unknown"})}),n},c6=function(e,t){if(!e.mediaGroups.AUDIO||!t)return null;var n=e.mediaGroups.AUDIO[t];if(!n)return null;for(var r in n){var s=n[r];if(s.default&&s.playlists)return ir(s.playlists[0].attributes.CODECS)}return null},My=function(e){return e===void 0&&(e=""),Os.audio.test(e.trim().toLowerCase())},u6=function(e){return e===void 0&&(e=""),Os.text.test(e.trim().toLowerCase())},ka=function(e){if(!(!e||typeof e!="string")){var t=e.toLowerCase().split(",").map(function(s){return Oy(s.trim())}),n="video";t.length===1&&My(t[0])?n="audio":t.length===1&&u6(t[0])&&(n="application");var r="mp4";return t.every(function(s){return Os.mp4.test(s)})?r="mp4":t.every(function(s){return Os.webm.test(s)})?r="webm":t.every(function(s){return Os.ogg.test(s)})&&(r="ogg"),n+"/"+r+';codecs="'+e+'"'}},Xo=function(e,t){return e===void 0&&(e=""),t===void 0&&(t=!1),te.MediaSource&&te.MediaSource.isTypeSupported&&te.MediaSource.isTypeSupported(ka(e))||t&&te.ManagedMediaSource&&te.ManagedMediaSource.isTypeSupported&&te.ManagedMediaSource.isTypeSupported(ka(e))||!1},bf=function(e){return e===void 0&&(e=""),e.toLowerCase().split(",").every(function(t){t=t.trim();for(var n=0;n<Py.length;n++){var r=Py[n];if(Os["muxer"+r].test(t))return!0}return!1})},Ry="mp4a.40.2",d6="avc1.4d400d",h6=/^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,f6=/^application\/dash\+xml/i,Ly=function(e){return h6.test(e)?"hls":f6.test(e)?"dash":e==="application/vnd.videojs.vhs+json"?"vhs-json":null},p6=function(e){return e.toString(2).length},m6=function(e){return Math.ceil(p6(e)/8)},By=function(e){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer},g6=function(e){return By(e)},st=function(e){return e instanceof Uint8Array?e:(!Array.isArray(e)&&!g6(e)&&!(e instanceof ArrayBuffer)&&(typeof e!="number"||typeof e=="number"&&e!==e?e=0:e=[e]),new Uint8Array(e&&e.buffer||e,e&&e.byteOffset||0,e&&e.byteLength||0))},Dn=te.BigInt||Number,_f=[Dn("0x1"),Dn("0x100"),Dn("0x10000"),Dn("0x1000000"),Dn("0x100000000"),Dn("0x10000000000"),Dn("0x1000000000000"),Dn("0x100000000000000"),Dn("0x10000000000000000")];(function(){var i=new Uint16Array([65484]),e=new Uint8Array(i.buffer,i.byteOffset,i.byteLength);return e[0]===255?"big":e[0]===204?"little":"unknown"})();var v6=function(e,t){var n=t===void 0?{}:t,r=n.signed,s=r===void 0?!1:r,a=n.le,o=a===void 0?!1:a;e=st(e);var c=o?"reduce":"reduceRight",u=e[c]?e[c]:Array.prototype[c],d=u.call(e,function(b,v,y){var p=o?y:Math.abs(y+1-e.length);return b+Dn(v)*_f[p]},Dn(0));if(s){var h=_f[e.length]/Dn(2)-Dn(1);d=Dn(d),d>h&&(d-=h,d-=h,d-=Dn(2))}return Number(d)},y6=function(e,t){var n={},r=n.le,s=r===void 0?!1:r;(typeof e!="bigint"&&typeof e!="number"||typeof e=="number"&&e!==e)&&(e=0),e=Dn(e);for(var a=m6(e),o=new Uint8Array(new ArrayBuffer(a)),c=0;c<a;c++){var u=s?c:Math.abs(c+1-o.length);o[u]=Number(e/_f[c]&Dn(255)),e<0&&(o[u]=Math.abs(~o[u]),o[u]-=c===0?1:2)}return o},Uy=function(e,t){if(typeof e!="string"&&e&&typeof e.toString=="function"&&(e=e.toString()),typeof e!="string")return new Uint8Array;t||(e=unescape(encodeURIComponent(e)));for(var n=new Uint8Array(e.length),r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return n},b6=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(t=t.filter(function(o){return o&&(o.byteLength||o.length)&&typeof o!="string"}),t.length<=1)return st(t[0]);var r=t.reduce(function(o,c,u){return o+(c.byteLength||c.length)},0),s=new Uint8Array(r),a=0;return t.forEach(function(o){o=st(o),s.set(o,a),a+=o.byteLength}),s},Xt=function(e,t,n){var r=n===void 0?{}:n,s=r.offset,a=s===void 0?0:s,o=r.mask,c=o===void 0?[]:o;e=st(e),t=st(t);var u=t.every?t.every:Array.prototype.every;return t.length&&e.length-a>=t.length&&u.call(t,function(d,h){var b=c[h]?c[h]&e[a+h]:e[a+h];return d===b})},_6=function(e,t,n){t.forEach(function(r){for(var s in e.mediaGroups[r])for(var a in e.mediaGroups[r][s]){var o=e.mediaGroups[r][s][a];n(o,r,s,a)}})},Yo={},Dr={},Ms={},Fy;function Jc(){if(Fy)return Ms;Fy=1;function i(s,a,o){if(o===void 0&&(o=Array.prototype),s&&typeof o.find=="function")return o.find.call(s,a);for(var c=0;c<s.length;c++)if(Object.prototype.hasOwnProperty.call(s,c)){var u=s[c];if(a.call(void 0,u,c,s))return u}}function e(s,a){return a===void 0&&(a=Object),a&&typeof a.freeze=="function"?a.freeze(s):s}function t(s,a){if(s===null||typeof s!="object")throw new TypeError("target is not an object");for(var o in a)Object.prototype.hasOwnProperty.call(a,o)&&(s[o]=a[o]);return s}var n=e({HTML:"text/html",isHTML:function(s){return s===n.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),r=e({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(s){return s===r.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});return Ms.assign=t,Ms.find=i,Ms.freeze=e,Ms.MIME_TYPE=n,Ms.NAMESPACE=r,Ms}var Vy;function jy(){if(Vy)return Dr;Vy=1;var i=Jc(),e=i.find,t=i.NAMESPACE;function n(U){return U!==""}function r(U){return U?U.split(/[\t\n\f\r ]+/).filter(n):[]}function s(U,G){return U.hasOwnProperty(G)||(U[G]=!0),U}function a(U){if(!U)return[];var G=r(U);return Object.keys(G.reduce(s,{}))}function o(U){return function(G){return U&&U.indexOf(G)!==-1}}function c(U,G){for(var re in U)Object.prototype.hasOwnProperty.call(U,re)&&(G[re]=U[re])}function u(U,G){var re=U.prototype;if(!(re instanceof G)){let ve=function(){};ve.prototype=G.prototype,ve=new ve,c(re,ve),U.prototype=re=ve}re.constructor!=U&&(typeof U!="function"&&console.error("unknown Class:"+U),re.constructor=U)}var d={},h=d.ELEMENT_NODE=1,b=d.ATTRIBUTE_NODE=2,v=d.TEXT_NODE=3,y=d.CDATA_SECTION_NODE=4,p=d.ENTITY_REFERENCE_NODE=5,f=d.ENTITY_NODE=6,m=d.PROCESSING_INSTRUCTION_NODE=7,_=d.COMMENT_NODE=8,k=d.DOCUMENT_NODE=9,D=d.DOCUMENT_TYPE_NODE=10,E=d.DOCUMENT_FRAGMENT_NODE=11,A=d.NOTATION_NODE=12,w={},N={};w.INDEX_SIZE_ERR=(N[1]="Index size error",1),w.DOMSTRING_SIZE_ERR=(N[2]="DOMString size error",2);var S=w.HIERARCHY_REQUEST_ERR=(N[3]="Hierarchy request error",3);w.WRONG_DOCUMENT_ERR=(N[4]="Wrong document",4),w.INVALID_CHARACTER_ERR=(N[5]="Invalid character",5),w.NO_DATA_ALLOWED_ERR=(N[6]="No data allowed",6),w.NO_MODIFICATION_ALLOWED_ERR=(N[7]="No modification allowed",7);var P=w.NOT_FOUND_ERR=(N[8]="Not found",8);w.NOT_SUPPORTED_ERR=(N[9]="Not supported",9);var F=w.INUSE_ATTRIBUTE_ERR=(N[10]="Attribute in use",10);w.INVALID_STATE_ERR=(N[11]="Invalid state",11),w.SYNTAX_ERR=(N[12]="Syntax error",12),w.INVALID_MODIFICATION_ERR=(N[13]="Invalid modification",13),w.NAMESPACE_ERR=(N[14]="Invalid namespace",14),w.INVALID_ACCESS_ERR=(N[15]="Invalid access",15);function V(U,G){if(G instanceof Error)var re=G;else re=this,Error.call(this,N[U]),this.message=N[U],Error.captureStackTrace&&Error.captureStackTrace(this,V);return re.code=U,G&&(this.message=this.message+": "+G),re}V.prototype=Error.prototype,c(w,V);function J(){}J.prototype={length:0,item:function(U){return U>=0&&U<this.length?this[U]:null},toString:function(U,G){for(var re=[],ve=0;ve<this.length;ve++)ki(this[ve],re,U,G);return re.join("")},filter:function(U){return Array.prototype.filter.call(this,U)},indexOf:function(U){return Array.prototype.indexOf.call(this,U)}};function ie(U,G){this._node=U,this._refresh=G,X(this)}function X(U){var G=U._node._inc||U._node.ownerDocument._inc;if(U._inc!==G){var re=U._refresh(U._node);if(qr(U,"length",re.length),!U.$$length||re.length<U.$$length)for(var ve=re.length;ve in U;ve++)Object.prototype.hasOwnProperty.call(U,ve)&&delete U[ve];c(re,U),U._inc=G}}ie.prototype.item=function(U){return X(this),this[U]||null},u(ie,J);function H(){}function $(U,G){for(var re=U.length;re--;)if(U[re]===G)return re}function j(U,G,re,ve){if(ve?G[$(G,ve)]=re:G[G.length++]=re,U){re.ownerElement=U;var He=U.ownerDocument;He&&(ve&&_e(He,U,ve),Z(He,U,re))}}function B(U,G,re){var ve=$(G,re);if(ve>=0){for(var He=G.length-1;ve<He;)G[ve]=G[++ve];if(G.length=He,U){var at=U.ownerDocument;at&&(_e(at,U,re),re.ownerElement=null)}}else throw new V(P,new Error(U.tagName+"@"+re))}H.prototype={length:0,item:J.prototype.item,getNamedItem:function(U){for(var G=this.length;G--;){var re=this[G];if(re.nodeName==U)return re}},setNamedItem:function(U){var G=U.ownerElement;if(G&&G!=this._ownerElement)throw new V(F);var re=this.getNamedItem(U.nodeName);return j(this._ownerElement,this,U,re),re},setNamedItemNS:function(U){var G=U.ownerElement,re;if(G&&G!=this._ownerElement)throw new V(F);return re=this.getNamedItemNS(U.namespaceURI,U.localName),j(this._ownerElement,this,U,re),re},removeNamedItem:function(U){var G=this.getNamedItem(U);return B(this._ownerElement,this,G),G},removeNamedItemNS:function(U,G){var re=this.getNamedItemNS(U,G);return B(this._ownerElement,this,re),re},getNamedItemNS:function(U,G){for(var re=this.length;re--;){var ve=this[re];if(ve.localName==G&&ve.namespaceURI==U)return ve}return null}};function q(){}q.prototype={hasFeature:function(U,G){return!0},createDocument:function(U,G,re){var ve=new be;if(ve.implementation=this,ve.childNodes=new J,ve.doctype=re||null,re&&ve.appendChild(re),G){var He=ve.createElementNS(U,G);ve.appendChild(He)}return ve},createDocumentType:function(U,G,re){var ve=new bt;return ve.name=U,ve.nodeName=U,ve.publicId=G||"",ve.systemId=re||"",ve}};function z(){}z.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(U,G){return tt(this,U,G)},replaceChild:function(U,G){tt(this,U,G,Ie),G&&this.removeChild(G)},removeChild:function(U){return Ue(this,U)},appendChild:function(U){return this.insertBefore(U,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(U){return Hr(this.ownerDocument||this,this,U)},normalize:function(){for(var U=this.firstChild;U;){var G=U.nextSibling;G&&G.nodeType==v&&U.nodeType==v?(this.removeChild(G),U.appendData(G.data)):(U.normalize(),U=G)}},isSupported:function(U,G){return this.ownerDocument.implementation.hasFeature(U,G)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(U){for(var G=this;G;){var re=G._nsMap;if(re){for(var ve in re)if(Object.prototype.hasOwnProperty.call(re,ve)&&re[ve]===U)return ve}G=G.nodeType==b?G.ownerDocument:G.parentNode}return null},lookupNamespaceURI:function(U){for(var G=this;G;){var re=G._nsMap;if(re&&Object.prototype.hasOwnProperty.call(re,U))return re[U];G=G.nodeType==b?G.ownerDocument:G.parentNode}return null},isDefaultNamespace:function(U){var G=this.lookupPrefix(U);return G==null}};function oe(U){return U=="<"&&"<"||U==">"&&">"||U=="&"&&"&"||U=='"'&&"""||"&#"+U.charCodeAt()+";"}c(d,z),c(d,z.prototype);function we(U,G){if(G(U))return!0;if(U=U.firstChild)do if(we(U,G))return!0;while(U=U.nextSibling)}function be(){this.ownerDocument=this}function Z(U,G,re){U&&U._inc++;var ve=re.namespaceURI;ve===t.XMLNS&&(G._nsMap[re.prefix?re.localName:""]=re.value)}function _e(U,G,re,ve){U&&U._inc++;var He=re.namespaceURI;He===t.XMLNS&&delete G._nsMap[re.prefix?re.localName:""]}function Te(U,G,re){if(U&&U._inc){U._inc++;var ve=G.childNodes;if(re)ve[ve.length++]=re;else{for(var He=G.firstChild,at=0;He;)ve[at++]=He,He=He.nextSibling;ve.length=at,delete ve[ve.length]}}}function Ue(U,G){var re=G.previousSibling,ve=G.nextSibling;return re?re.nextSibling=ve:U.firstChild=ve,ve?ve.previousSibling=re:U.lastChild=re,G.parentNode=null,G.previousSibling=null,G.nextSibling=null,Te(U.ownerDocument,U),G}function We(U){return U&&(U.nodeType===z.DOCUMENT_NODE||U.nodeType===z.DOCUMENT_FRAGMENT_NODE||U.nodeType===z.ELEMENT_NODE)}function pe(U){return U&&(nt(U)||le(U)||Ne(U)||U.nodeType===z.DOCUMENT_FRAGMENT_NODE||U.nodeType===z.COMMENT_NODE||U.nodeType===z.PROCESSING_INSTRUCTION_NODE)}function Ne(U){return U&&U.nodeType===z.DOCUMENT_TYPE_NODE}function nt(U){return U&&U.nodeType===z.ELEMENT_NODE}function le(U){return U&&U.nodeType===z.TEXT_NODE}function Ke(U,G){var re=U.childNodes||[];if(e(re,nt)||Ne(G))return!1;var ve=e(re,Ne);return!(G&&ve&&re.indexOf(ve)>re.indexOf(G))}function ae(U,G){var re=U.childNodes||[];function ve(at){return nt(at)&&at!==G}if(e(re,ve))return!1;var He=e(re,Ne);return!(G&&He&&re.indexOf(He)>re.indexOf(G))}function ue(U,G,re){if(!We(U))throw new V(S,"Unexpected parent node type "+U.nodeType);if(re&&re.parentNode!==U)throw new V(P,"child not in parent");if(!pe(G)||Ne(G)&&U.nodeType!==z.DOCUMENT_NODE)throw new V(S,"Unexpected node type "+G.nodeType+" for parent node type "+U.nodeType)}function Be(U,G,re){var ve=U.childNodes||[],He=G.childNodes||[];if(G.nodeType===z.DOCUMENT_FRAGMENT_NODE){var at=He.filter(nt);if(at.length>1||e(He,le))throw new V(S,"More than one element or text in fragment");if(at.length===1&&!Ke(U,re))throw new V(S,"Element in fragment can not be inserted before doctype")}if(nt(G)&&!Ke(U,re))throw new V(S,"Only one element can be added and only after doctype");if(Ne(G)){if(e(ve,Ne))throw new V(S,"Only one doctype is allowed");var Xe=e(ve,nt);if(re&&ve.indexOf(Xe)<ve.indexOf(re))throw new V(S,"Doctype can only be inserted before an element");if(!re&&Xe)throw new V(S,"Doctype can not be appended since element is present")}}function Ie(U,G,re){var ve=U.childNodes||[],He=G.childNodes||[];if(G.nodeType===z.DOCUMENT_FRAGMENT_NODE){var at=He.filter(nt);if(at.length>1||e(He,le))throw new V(S,"More than one element or text in fragment");if(at.length===1&&!ae(U,re))throw new V(S,"Element in fragment can not be inserted before doctype")}if(nt(G)&&!ae(U,re))throw new V(S,"Only one element can be added and only after doctype");if(Ne(G)){if(e(ve,function(yn){return Ne(yn)&&yn!==re}))throw new V(S,"Only one doctype is allowed");var Xe=e(ve,nt);if(re&&ve.indexOf(Xe)<ve.indexOf(re))throw new V(S,"Doctype can only be inserted before an element")}}function tt(U,G,re,ve){ue(U,G,re),U.nodeType===z.DOCUMENT_NODE&&(ve||Be)(U,G,re);var He=G.parentNode;if(He&&He.removeChild(G),G.nodeType===E){var at=G.firstChild;if(at==null)return G;var Xe=G.lastChild}else at=Xe=G;var Re=re?re.previousSibling:U.lastChild;at.previousSibling=Re,Xe.nextSibling=re,Re?Re.nextSibling=at:U.firstChild=at,re==null?U.lastChild=Xe:re.previousSibling=Xe;do at.parentNode=U;while(at!==Xe&&(at=at.nextSibling));return Te(U.ownerDocument||U,U),G.nodeType==E&&(G.firstChild=G.lastChild=null),G}function ze(U,G){return G.parentNode&&G.parentNode.removeChild(G),G.parentNode=U,G.previousSibling=U.lastChild,G.nextSibling=null,G.previousSibling?G.previousSibling.nextSibling=G:U.firstChild=G,U.lastChild=G,Te(U.ownerDocument,U,G),G}be.prototype={nodeName:"#document",nodeType:k,doctype:null,documentElement:null,_inc:1,insertBefore:function(U,G){if(U.nodeType==E){for(var re=U.firstChild;re;){var ve=re.nextSibling;this.insertBefore(re,G),re=ve}return U}return tt(this,U,G),U.ownerDocument=this,this.documentElement===null&&U.nodeType===h&&(this.documentElement=U),U},removeChild:function(U){return this.documentElement==U&&(this.documentElement=null),Ue(this,U)},replaceChild:function(U,G){tt(this,U,G,Ie),U.ownerDocument=this,G&&this.removeChild(G),nt(U)&&(this.documentElement=U)},importNode:function(U,G){return Yn(this,U,G)},getElementById:function(U){var G=null;return we(this.documentElement,function(re){if(re.nodeType==h&&re.getAttribute("id")==U)return G=re,!0}),G},getElementsByClassName:function(U){var G=a(U);return new ie(this,function(re){var ve=[];return G.length>0&&we(re.documentElement,function(He){if(He!==re&&He.nodeType===h){var at=He.getAttribute("class");if(at){var Xe=U===at;if(!Xe){var Re=a(at);Xe=G.every(o(Re))}Xe&&ve.push(He)}}}),ve})},createElement:function(U){var G=new Se;G.ownerDocument=this,G.nodeName=U,G.tagName=U,G.localName=U,G.childNodes=new J;var re=G.attributes=new H;return re._ownerElement=G,G},createDocumentFragment:function(){var U=new ai;return U.ownerDocument=this,U.childNodes=new J,U},createTextNode:function(U){var G=new Me;return G.ownerDocument=this,G.appendData(U),G},createComment:function(U){var G=new Pe;return G.ownerDocument=this,G.appendData(U),G},createCDATASection:function(U){var G=new it;return G.ownerDocument=this,G.appendData(U),G},createProcessingInstruction:function(U,G){var re=new St;return re.ownerDocument=this,re.tagName=re.nodeName=re.target=U,re.nodeValue=re.data=G,re},createAttribute:function(U){var G=new Ve;return G.ownerDocument=this,G.name=U,G.nodeName=U,G.localName=U,G.specified=!0,G},createEntityReference:function(U){var G=new _i;return G.ownerDocument=this,G.nodeName=U,G},createElementNS:function(U,G){var re=new Se,ve=G.split(":"),He=re.attributes=new H;return re.childNodes=new J,re.ownerDocument=this,re.nodeName=G,re.tagName=G,re.namespaceURI=U,ve.length==2?(re.prefix=ve[0],re.localName=ve[1]):re.localName=G,He._ownerElement=re,re},createAttributeNS:function(U,G){var re=new Ve,ve=G.split(":");return re.ownerDocument=this,re.nodeName=G,re.name=G,re.namespaceURI=U,re.specified=!0,ve.length==2?(re.prefix=ve[0],re.localName=ve[1]):re.localName=G,re}},u(be,z);function Se(){this._nsMap={}}Se.prototype={nodeType:h,hasAttribute:function(U){return this.getAttributeNode(U)!=null},getAttribute:function(U){var G=this.getAttributeNode(U);return G&&G.value||""},getAttributeNode:function(U){return this.attributes.getNamedItem(U)},setAttribute:function(U,G){var re=this.ownerDocument.createAttribute(U);re.value=re.nodeValue=""+G,this.setAttributeNode(re)},removeAttribute:function(U){var G=this.getAttributeNode(U);G&&this.removeAttributeNode(G)},appendChild:function(U){return U.nodeType===E?this.insertBefore(U,null):ze(this,U)},setAttributeNode:function(U){return this.attributes.setNamedItem(U)},setAttributeNodeNS:function(U){return this.attributes.setNamedItemNS(U)},removeAttributeNode:function(U){return this.attributes.removeNamedItem(U.nodeName)},removeAttributeNS:function(U,G){var re=this.getAttributeNodeNS(U,G);re&&this.removeAttributeNode(re)},hasAttributeNS:function(U,G){return this.getAttributeNodeNS(U,G)!=null},getAttributeNS:function(U,G){var re=this.getAttributeNodeNS(U,G);return re&&re.value||""},setAttributeNS:function(U,G,re){var ve=this.ownerDocument.createAttributeNS(U,G);ve.value=ve.nodeValue=""+re,this.setAttributeNode(ve)},getAttributeNodeNS:function(U,G){return this.attributes.getNamedItemNS(U,G)},getElementsByTagName:function(U){return new ie(this,function(G){var re=[];return we(G,function(ve){ve!==G&&ve.nodeType==h&&(U==="*"||ve.tagName==U)&&re.push(ve)}),re})},getElementsByTagNameNS:function(U,G){return new ie(this,function(re){var ve=[];return we(re,function(He){He!==re&&He.nodeType===h&&(U==="*"||He.namespaceURI===U)&&(G==="*"||He.localName==G)&&ve.push(He)}),ve})}},be.prototype.getElementsByTagName=Se.prototype.getElementsByTagName,be.prototype.getElementsByTagNameNS=Se.prototype.getElementsByTagNameNS,u(Se,z);function Ve(){}Ve.prototype.nodeType=b,u(Ve,z);function ke(){}ke.prototype={data:"",substringData:function(U,G){return this.data.substring(U,U+G)},appendData:function(U){U=this.data+U,this.nodeValue=this.data=U,this.length=U.length},insertData:function(U,G){this.replaceData(U,0,G)},appendChild:function(U){throw new Error(N[S])},deleteData:function(U,G){this.replaceData(U,G,"")},replaceData:function(U,G,re){var ve=this.data.substring(0,U),He=this.data.substring(U+G);re=ve+re+He,this.nodeValue=this.data=re,this.length=re.length}},u(ke,z);function Me(){}Me.prototype={nodeName:"#text",nodeType:v,splitText:function(U){var G=this.data,re=G.substring(U);G=G.substring(0,U),this.data=this.nodeValue=G,this.length=G.length;var ve=this.ownerDocument.createTextNode(re);return this.parentNode&&this.parentNode.insertBefore(ve,this.nextSibling),ve}},u(Me,ke);function Pe(){}Pe.prototype={nodeName:"#comment",nodeType:_},u(Pe,ke);function it(){}it.prototype={nodeName:"#cdata-section",nodeType:y},u(it,ke);function bt(){}bt.prototype.nodeType=D,u(bt,z);function Wt(){}Wt.prototype.nodeType=A,u(Wt,z);function On(){}On.prototype.nodeType=f,u(On,z);function _i(){}_i.prototype.nodeType=p,u(_i,z);function ai(){}ai.prototype.nodeName="#document-fragment",ai.prototype.nodeType=E,u(ai,z);function St(){}St.prototype.nodeType=m,u(St,z);function kr(){}kr.prototype.serializeToString=function(U,G,re){return Cn.call(U,G,re)},z.prototype.toString=Cn;function Cn(U,G){var re=[],ve=this.nodeType==9&&this.documentElement||this,He=ve.prefix,at=ve.namespaceURI;if(at&&He==null){var He=ve.lookupPrefix(at);if(He==null)var Xe=[{namespace:at,prefix:null}]}return ki(this,re,U,G,Xe),re.join("")}function $r(U,G,re){var ve=U.prefix||"",He=U.namespaceURI;if(!He||ve==="xml"&&He===t.XML||He===t.XMLNS)return!1;for(var at=re.length;at--;){var Xe=re[at];if(Xe.prefix===ve)return Xe.namespace!==He}return!0}function Xi(U,G,re){U.push(" ",G,'="',re.replace(/[<>&"\t\n\r]/g,oe),'"')}function ki(U,G,re,ve,He){if(He||(He=[]),ve)if(U=ve(U),U){if(typeof U=="string"){G.push(U);return}}else return;switch(U.nodeType){case h:var at=U.attributes,Xe=at.length,rn=U.firstChild,Re=U.tagName;re=t.isHTML(U.namespaceURI)||re;var yn=Re;if(!re&&!U.prefix&&U.namespaceURI){for(var Qt,Gt=0;Gt<at.length;Gt++)if(at.item(Gt).name==="xmlns"){Qt=at.item(Gt).value;break}if(!Qt)for(var Mi=He.length-1;Mi>=0;Mi--){var Ft=He[Mi];if(Ft.prefix===""&&Ft.namespace===U.namespaceURI){Qt=Ft.namespace;break}}if(Qt!==U.namespaceURI)for(var Mi=He.length-1;Mi>=0;Mi--){var Ft=He[Mi];if(Ft.namespace===U.namespaceURI){Ft.prefix&&(yn=Ft.prefix+":"+Re);break}}}G.push("<",yn);for(var bn=0;bn<Xe;bn++){var Nt=at.item(bn);Nt.prefix=="xmlns"?He.push({prefix:Nt.localName,namespace:Nt.value}):Nt.nodeName=="xmlns"&&He.push({prefix:"",namespace:Nt.value})}for(var bn=0;bn<Xe;bn++){var Nt=at.item(bn);if($r(Nt,re,He)){var Yi=Nt.prefix||"",zr=Nt.namespaceURI;Xi(G,Yi?"xmlns:"+Yi:"xmlns",zr),He.push({prefix:Yi,namespace:zr})}ki(Nt,G,re,ve,He)}if(Re===yn&&$r(U,re,He)){var Yi=U.prefix||"",zr=U.namespaceURI;Xi(G,Yi?"xmlns:"+Yi:"xmlns",zr),He.push({prefix:Yi,namespace:zr})}if(rn||re&&!/^(?:meta|link|img|br|hr|input)$/i.test(Re)){if(G.push(">"),re&&/^script$/i.test(Re))for(;rn;)rn.data?G.push(rn.data):ki(rn,G,re,ve,He.slice()),rn=rn.nextSibling;else for(;rn;)ki(rn,G,re,ve,He.slice()),rn=rn.nextSibling;G.push("</",yn,">")}else G.push("/>");return;case k:case E:for(var rn=U.firstChild;rn;)ki(rn,G,re,ve,He.slice()),rn=rn.nextSibling;return;case b:return Xi(G,U.name,U.value);case v:return G.push(U.data.replace(/[<&>]/g,oe));case y:return G.push("<![CDATA[",U.data,"]]>");case _:return G.push("<!--",U.data,"-->");case D:var oi=U.publicId,Ti=U.systemId;if(G.push("<!DOCTYPE ",U.name),oi)G.push(" PUBLIC ",oi),Ti&&Ti!="."&&G.push(" ",Ti),G.push(">");else if(Ti&&Ti!=".")G.push(" SYSTEM ",Ti,">");else{var xt=U.internalSubset;xt&&G.push(" [",xt,"]"),G.push(">")}return;case m:return G.push("<?",U.target," ",U.data,"?>");case p:return G.push("&",U.nodeName,";");default:G.push("??",U.nodeName)}}function Yn(U,G,re){var ve;switch(G.nodeType){case h:ve=G.cloneNode(!1),ve.ownerDocument=U;case E:break;case b:re=!0;break}if(ve||(ve=G.cloneNode(!1)),ve.ownerDocument=U,ve.parentNode=null,re)for(var He=G.firstChild;He;)ve.appendChild(Yn(U,He,re)),He=He.nextSibling;return ve}function Hr(U,G,re){var ve=new G.constructor;for(var He in G)if(Object.prototype.hasOwnProperty.call(G,He)){var at=G[He];typeof at!="object"&&at!=ve[He]&&(ve[He]=at)}switch(G.childNodes&&(ve.childNodes=new J),ve.ownerDocument=U,ve.nodeType){case h:var Xe=G.attributes,Re=ve.attributes=new H,yn=Xe.length;Re._ownerElement=ve;for(var Qt=0;Qt<yn;Qt++)ve.setAttributeNode(Hr(U,Xe.item(Qt),!0));break;case b:re=!0}if(re)for(var Gt=G.firstChild;Gt;)ve.appendChild(Hr(U,Gt,re)),Gt=Gt.nextSibling;return ve}function qr(U,G,re){U[G]=re}try{if(Object.defineProperty){let U=function(G){switch(G.nodeType){case h:case E:var re=[];for(G=G.firstChild;G;)G.nodeType!==7&&G.nodeType!==8&&re.push(U(G)),G=G.nextSibling;return re.join("");default:return G.nodeValue}};Object.defineProperty(ie.prototype,"length",{get:function(){return X(this),this.$$length}}),Object.defineProperty(z.prototype,"textContent",{get:function(){return U(this)},set:function(G){switch(this.nodeType){case h:case E:for(;this.firstChild;)this.removeChild(this.firstChild);(G||String(G))&&this.appendChild(this.ownerDocument.createTextNode(G));break;default:this.data=G,this.value=G,this.nodeValue=G}}}),qr=function(G,re,ve){G["$$"+re]=ve}}}catch{}return Dr.DocumentType=bt,Dr.DOMException=V,Dr.DOMImplementation=q,Dr.Element=Se,Dr.Node=z,Dr.NodeList=J,Dr.XMLSerializer=kr,Dr}var Jo={},kf={},$y;function k6(){return $y||($y=1,function(i){var e=Jc().freeze;i.XML_ENTITIES=e({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),i.HTML_ENTITIES=e({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"",InvisibleTimes:"",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"",NegativeThickSpace:"",NegativeThinSpace:"",NegativeVeryThinSpace:"",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:`
|
44
|
+
`,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:" ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"",zwnj:""}),i.entityMap=i.HTML_ENTITIES}(kf)),kf}var Qc={},Hy;function T6(){if(Hy)return Qc;Hy=1;var i=Jc().NAMESPACE,e=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,t=new RegExp("[\\-\\.0-9"+e.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),n=new RegExp("^"+e.source+t.source+"*(?::"+e.source+t.source+"*)?$"),r=0,s=1,a=2,o=3,c=4,u=5,d=6,h=7;function b(S,P){this.message=S,this.locator=P,Error.captureStackTrace&&Error.captureStackTrace(this,b)}b.prototype=new Error,b.prototype.name=b.name;function v(){}v.prototype={parse:function(S,P,F){var V=this.domBuilder;V.startDocument(),D(P,P={}),y(S,P,F,V,this.errorHandler),V.endDocument()}};function y(S,P,F,V,J){function ie(Se){if(Se>65535){Se-=65536;var Ve=55296+(Se>>10),ke=56320+(Se&1023);return String.fromCharCode(Ve,ke)}else return String.fromCharCode(Se)}function X(Se){var Ve=Se.slice(1,-1);return Object.hasOwnProperty.call(F,Ve)?F[Ve]:Ve.charAt(0)==="#"?ie(parseInt(Ve.substr(1).replace("x","0x"))):(J.error("entity not found:"+Se),Se)}function H(Se){if(Se>be){var Ve=S.substring(be,Se).replace(/&#?\w+;/g,X);z&&$(be),V.characters(Ve,0,Se-be),be=Se}}function $(Se,Ve){for(;Se>=B&&(Ve=q.exec(S));)j=Ve.index,B=j+Ve[0].length,z.lineNumber++;z.columnNumber=Se-j+1}for(var j=0,B=0,q=/.*(?:\r\n?|\n)|.*$/g,z=V.locator,oe=[{currentNSMap:P}],we={},be=0;;){try{var Z=S.indexOf("<",be);if(Z<0){if(!S.substr(be).match(/^\s*$/)){var _e=V.doc,Te=_e.createTextNode(S.substr(be));_e.appendChild(Te),V.currentElement=Te}return}switch(Z>be&&H(Z),S.charAt(Z+1)){case"/":var ue=S.indexOf(">",Z+3),Ue=S.substring(Z+2,ue).replace(/[ \t\n\r]+$/g,""),We=oe.pop();ue<0?(Ue=S.substring(Z+2).replace(/[\s<].*/,""),J.error("end tag name: "+Ue+" is not complete:"+We.tagName),ue=Z+1+Ue.length):Ue.match(/\s</)&&(Ue=Ue.replace(/[\s<].*/,""),J.error("end tag name: "+Ue+" maybe not complete"),ue=Z+1+Ue.length);var pe=We.localNSMap,Ne=We.tagName==Ue,nt=Ne||We.tagName&&We.tagName.toLowerCase()==Ue.toLowerCase();if(nt){if(V.endElement(We.uri,We.localName,Ue),pe)for(var le in pe)Object.prototype.hasOwnProperty.call(pe,le)&&V.endPrefixMapping(le);Ne||J.fatalError("end tag name: "+Ue+" is not match the current start tagName:"+We.tagName)}else oe.push(We);ue++;break;case"?":z&&$(Z),ue=A(S,Z,V);break;case"!":z&&$(Z),ue=E(S,Z,V,J);break;default:z&&$(Z);var Ke=new w,ae=oe[oe.length-1].currentNSMap,ue=f(S,Z,Ke,ae,X,J),Be=Ke.length;if(!Ke.closed&&k(S,ue,Ke.tagName,we)&&(Ke.closed=!0,F.nbsp||J.warning("unclosed xml attribute")),z&&Be){for(var Ie=p(z,{}),tt=0;tt<Be;tt++){var ze=Ke[tt];$(ze.offset),ze.locator=p(z,{})}V.locator=Ie,m(Ke,V,ae)&&oe.push(Ke),V.locator=z}else m(Ke,V,ae)&&oe.push(Ke);i.isHTML(Ke.uri)&&!Ke.closed?ue=_(S,ue,Ke.tagName,X,V):ue++}}catch(Se){if(Se instanceof b)throw Se;J.error("element parse error: "+Se),ue=-1}ue>be?be=ue:H(Math.max(Z,be)+1)}}function p(S,P){return P.lineNumber=S.lineNumber,P.columnNumber=S.columnNumber,P}function f(S,P,F,V,J,ie){function X(z,oe,we){F.attributeNames.hasOwnProperty(z)&&ie.fatalError("Attribute "+z+" redefined"),F.addValue(z,oe.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,J),we)}for(var H,$,j=++P,B=r;;){var q=S.charAt(j);switch(q){case"=":if(B===s)H=S.slice(P,j),B=o;else if(B===a)B=o;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(B===o||B===s)if(B===s&&(ie.warning('attribute value must after "="'),H=S.slice(P,j)),P=j+1,j=S.indexOf(q,P),j>0)$=S.slice(P,j),X(H,$,P-1),B=u;else throw new Error("attribute value no end '"+q+"' match");else if(B==c)$=S.slice(P,j),X(H,$,P),ie.warning('attribute "'+H+'" missed start quot('+q+")!!"),P=j+1,B=u;else throw new Error('attribute value must after "="');break;case"/":switch(B){case r:F.setTagName(S.slice(P,j));case u:case d:case h:B=h,F.closed=!0;case c:case s:break;case a:F.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return ie.error("unexpected end of input"),B==r&&F.setTagName(S.slice(P,j)),j;case">":switch(B){case r:F.setTagName(S.slice(P,j));case u:case d:case h:break;case c:case s:$=S.slice(P,j),$.slice(-1)==="/"&&(F.closed=!0,$=$.slice(0,-1));case a:B===a&&($=H),B==c?(ie.warning('attribute "'+$+'" missed quot(")!'),X(H,$,P)):((!i.isHTML(V[""])||!$.match(/^(?:disabled|checked|selected)$/i))&&ie.warning('attribute "'+$+'" missed value!! "'+$+'" instead!!'),X($,$,P));break;case o:throw new Error("attribute value missed!!")}return j;case"":q=" ";default:if(q<=" ")switch(B){case r:F.setTagName(S.slice(P,j)),B=d;break;case s:H=S.slice(P,j),B=a;break;case c:var $=S.slice(P,j);ie.warning('attribute "'+$+'" missed quot(")!!'),X(H,$,P);case u:B=d;break}else switch(B){case a:F.tagName,(!i.isHTML(V[""])||!H.match(/^(?:disabled|checked|selected)$/i))&&ie.warning('attribute "'+H+'" missed value!! "'+H+'" instead2!!'),X(H,H,P),P=j,B=s;break;case u:ie.warning('attribute space is required"'+H+'"!!');case d:B=s,P=j;break;case o:B=c,P=j;break;case h:throw new Error("elements closed character '/' and '>' must be connected to")}}j++}}function m(S,P,F){for(var V=S.tagName,J=null,q=S.length;q--;){var ie=S[q],X=ie.qName,H=ie.value,z=X.indexOf(":");if(z>0)var $=ie.prefix=X.slice(0,z),j=X.slice(z+1),B=$==="xmlns"&&j;else j=X,$=null,B=X==="xmlns"&&"";ie.localName=j,B!==!1&&(J==null&&(J={},D(F,F={})),F[B]=J[B]=H,ie.uri=i.XMLNS,P.startPrefixMapping(B,H))}for(var q=S.length;q--;){ie=S[q];var $=ie.prefix;$&&($==="xml"&&(ie.uri=i.XML),$!=="xmlns"&&(ie.uri=F[$||""]))}var z=V.indexOf(":");z>0?($=S.prefix=V.slice(0,z),j=S.localName=V.slice(z+1)):($=null,j=S.localName=V);var oe=S.uri=F[$||""];if(P.startElement(oe,j,V,S),S.closed){if(P.endElement(oe,j,V),J)for($ in J)Object.prototype.hasOwnProperty.call(J,$)&&P.endPrefixMapping($)}else return S.currentNSMap=F,S.localNSMap=J,!0}function _(S,P,F,V,J){if(/^(?:script|textarea)$/i.test(F)){var ie=S.indexOf("</"+F+">",P),X=S.substring(P+1,ie);if(/[&<]/.test(X))return/^script$/i.test(F)?(J.characters(X,0,X.length),ie):(X=X.replace(/&#?\w+;/g,V),J.characters(X,0,X.length),ie)}return P+1}function k(S,P,F,V){var J=V[F];return J==null&&(J=S.lastIndexOf("</"+F+">"),J<P&&(J=S.lastIndexOf("</"+F)),V[F]=J),J<P}function D(S,P){for(var F in S)Object.prototype.hasOwnProperty.call(S,F)&&(P[F]=S[F])}function E(S,P,F,V){var J=S.charAt(P+2);switch(J){case"-":if(S.charAt(P+3)==="-"){var ie=S.indexOf("-->",P+4);return ie>P?(F.comment(S,P+4,ie-P-4),ie+3):(V.error("Unclosed comment"),-1)}else return-1;default:if(S.substr(P+3,6)=="CDATA["){var ie=S.indexOf("]]>",P+9);return F.startCDATA(),F.characters(S,P+9,ie-P-9),F.endCDATA(),ie+3}var X=N(S,P),H=X.length;if(H>1&&/!doctype/i.test(X[0][0])){var $=X[1][0],j=!1,B=!1;H>3&&(/^public$/i.test(X[2][0])?(j=X[3][0],B=H>4&&X[4][0]):/^system$/i.test(X[2][0])&&(B=X[3][0]));var q=X[H-1];return F.startDTD($,j,B),F.endDTD(),q.index+q[0].length}}return-1}function A(S,P,F){var V=S.indexOf("?>",P);if(V){var J=S.substring(P,V).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return J?(J[0].length,F.processingInstruction(J[1],J[2]),V+2):-1}return-1}function w(){this.attributeNames={}}w.prototype={setTagName:function(S){if(!n.test(S))throw new Error("invalid tagName:"+S);this.tagName=S},addValue:function(S,P,F){if(!n.test(S))throw new Error("invalid attribute:"+S);this.attributeNames[S]=this.length,this[this.length++]={qName:S,value:P,offset:F}},length:0,getLocalName:function(S){return this[S].localName},getLocator:function(S){return this[S].locator},getQName:function(S){return this[S].qName},getURI:function(S){return this[S].uri},getValue:function(S){return this[S].value}};function N(S,P){var F,V=[],J=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(J.lastIndex=P,J.exec(S);F=J.exec(S);)if(V.push(F),F[1])return V}return Qc.XMLReader=v,Qc.ParseError=b,Qc}var qy;function S6(){if(qy)return Jo;qy=1;var i=Jc(),e=jy(),t=k6(),n=T6(),r=e.DOMImplementation,s=i.NAMESPACE,a=n.ParseError,o=n.XMLReader;function c(f){return f.replace(/\r[\n\u0085]/g,`
|
45
|
+
`).replace(/[\r\u0085\u2028]/g,`
|
46
|
+
`)}function u(f){this.options=f||{locator:{}}}u.prototype.parseFromString=function(f,m){var _=this.options,k=new o,D=_.domBuilder||new h,E=_.errorHandler,A=_.locator,w=_.xmlns||{},N=/\/x?html?$/.test(m),S=N?t.HTML_ENTITIES:t.XML_ENTITIES;A&&D.setDocumentLocator(A),k.errorHandler=d(E,D,A),k.domBuilder=_.domBuilder||D,N&&(w[""]=s.HTML),w.xml=w.xml||s.XML;var P=_.normalizeLineEndings||c;return f&&typeof f=="string"?k.parse(P(f),w,S):k.errorHandler.error("invalid doc source"),D.doc};function d(f,m,_){if(!f){if(m instanceof h)return m;f=m}var k={},D=f instanceof Function;_=_||{};function E(A){var w=f[A];!w&&D&&(w=f.length==2?function(N){f(A,N)}:f),k[A]=w&&function(N){w("[xmldom "+A+"] "+N+v(_))}||function(){}}return E("warning"),E("error"),E("fatalError"),k}function h(){this.cdata=!1}function b(f,m){m.lineNumber=f.lineNumber,m.columnNumber=f.columnNumber}h.prototype={startDocument:function(){this.doc=new r().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(f,m,_,k){var D=this.doc,E=D.createElementNS(f,_||m),A=k.length;p(this,E),this.currentElement=E,this.locator&&b(this.locator,E);for(var w=0;w<A;w++){var f=k.getURI(w),N=k.getValue(w),_=k.getQName(w),S=D.createAttributeNS(f,_);this.locator&&b(k.getLocator(w),S),S.value=S.nodeValue=N,E.setAttributeNode(S)}},endElement:function(f,m,_){var k=this.currentElement;k.tagName,this.currentElement=k.parentNode},startPrefixMapping:function(f,m){},endPrefixMapping:function(f){},processingInstruction:function(f,m){var _=this.doc.createProcessingInstruction(f,m);this.locator&&b(this.locator,_),p(this,_)},ignorableWhitespace:function(f,m,_){},characters:function(f,m,_){if(f=y.apply(this,arguments),f){if(this.cdata)var k=this.doc.createCDATASection(f);else var k=this.doc.createTextNode(f);this.currentElement?this.currentElement.appendChild(k):/^\s*$/.test(f)&&this.doc.appendChild(k),this.locator&&b(this.locator,k)}},skippedEntity:function(f){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(f){(this.locator=f)&&(f.lineNumber=0)},comment:function(f,m,_){f=y.apply(this,arguments);var k=this.doc.createComment(f);this.locator&&b(this.locator,k),p(this,k)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(f,m,_){var k=this.doc.implementation;if(k&&k.createDocumentType){var D=k.createDocumentType(f,m,_);this.locator&&b(this.locator,D),p(this,D),this.doc.doctype=D}},warning:function(f){console.warn("[xmldom warning] "+f,v(this.locator))},error:function(f){console.error("[xmldom error] "+f,v(this.locator))},fatalError:function(f){throw new a(f,this.locator)}};function v(f){if(f)return`
|
47
|
+
@`+(f.systemId||"")+"#[line:"+f.lineNumber+",col:"+f.columnNumber+"]"}function y(f,m,_){return typeof f=="string"?f.substr(m,_):f.length>=m+_||m?new java.lang.String(f,m,_)+"":f}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(f){h.prototype[f]=function(){return null}});function p(f,m){f.currentElement?f.currentElement.appendChild(m):f.doc.appendChild(m)}return Jo.__DOMHandler=h,Jo.normalizeLineEndings=c,Jo.DOMParser=u,Jo}var zy;function C6(){if(zy)return Yo;zy=1;var i=jy();return Yo.DOMImplementation=i.DOMImplementation,Yo.XMLSerializer=i.XMLSerializer,Yo.DOMParser=S6().DOMParser,Yo}var x6=C6();/*! @name mpd-parser @version 1.3.1 @license Apache-2.0 */const Gy=i=>!!i&&typeof i=="object",_n=(...i)=>i.reduce((e,t)=>(typeof t!="object"||Object.keys(t).forEach(n=>{Array.isArray(e[n])&&Array.isArray(t[n])?e[n]=e[n].concat(t[n]):Gy(e[n])&&Gy(t[n])?e[n]=_n(e[n],t[n]):e[n]=t[n]}),e),{}),Wy=i=>Object.keys(i).map(e=>i[e]),E6=(i,e)=>{const t=[];for(let n=i;n<e;n++)t.push(n);return t},Ta=i=>i.reduce((e,t)=>e.concat(t),[]),Ky=i=>{if(!i.length)return[];const e=[];for(let t=0;t<i.length;t++)e.push(i[t]);return e},w6=(i,e)=>i.reduce((t,n,r)=>(n[e]&&t.push(r),t),[]),D6=(i,e)=>Wy(i.reduce((t,n)=>(n.forEach(r=>{t[e(r)]=r}),t),{}));var Sa={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};const Qo=({baseUrl:i="",source:e="",range:t="",indexRange:n=""})=>{const r={uri:e,resolvedUri:Yc(i||"",e)};if(t||n){const a=(t||n).split("-");let o=te.BigInt?te.BigInt(a[0]):parseInt(a[0],10),c=te.BigInt?te.BigInt(a[1]):parseInt(a[1],10);o<Number.MAX_SAFE_INTEGER&&typeof o=="bigint"&&(o=Number(o)),c<Number.MAX_SAFE_INTEGER&&typeof c=="bigint"&&(c=Number(c));let u;typeof c=="bigint"||typeof o=="bigint"?u=te.BigInt(c)-te.BigInt(o)+te.BigInt(1):u=c-o+1,typeof u=="bigint"&&u<Number.MAX_SAFE_INTEGER&&(u=Number(u)),r.byterange={length:u,offset:o}}return r},A6=i=>{let e;return typeof i.offset=="bigint"||typeof i.length=="bigint"?e=te.BigInt(i.offset)+te.BigInt(i.length)-te.BigInt(1):e=i.offset+i.length-1,`${i.offset}-${e}`},Xy=i=>(i&&typeof i!="number"&&(i=parseInt(i,10)),isNaN(i)?null:i),I6={static(i){const{duration:e,timescale:t=1,sourceDuration:n,periodDuration:r}=i,s=Xy(i.endNumber),a=e/t;return typeof s=="number"?{start:0,end:s}:typeof r=="number"?{start:0,end:r/a}:{start:0,end:n/a}},dynamic(i){const{NOW:e,clientOffset:t,availabilityStartTime:n,timescale:r=1,duration:s,periodStart:a=0,minimumUpdatePeriod:o=0,timeShiftBufferDepth:c=1/0}=i,u=Xy(i.endNumber),d=(e+t)/1e3,h=n+a,v=d+o-h,y=Math.ceil(v*r/s),p=Math.floor((d-h-c)*r/s),f=Math.floor((d-h)*r/s);return{start:Math.max(0,p),end:typeof u=="number"?u:Math.min(y,f)}}},N6=i=>e=>{const{duration:t,timescale:n=1,periodStart:r,startNumber:s=1}=i;return{number:s+e,duration:t/n,timeline:r,time:e*t}},Tf=i=>{const{type:e,duration:t,timescale:n=1,periodDuration:r,sourceDuration:s}=i,{start:a,end:o}=I6[e](i),c=E6(a,o).map(N6(i));if(e==="static"){const u=c.length-1,d=typeof r=="number"?r:s;c[u].duration=d-t/n*u}return c},Yy=i=>{const{baseUrl:e,initialization:t={},sourceDuration:n,indexRange:r="",periodStart:s,presentationTime:a,number:o=0,duration:c}=i;if(!e)throw new Error(Sa.NO_BASE_URL);const u=Qo({baseUrl:e,source:t.sourceURL,range:t.range}),d=Qo({baseUrl:e,source:e,indexRange:r});if(d.map=u,c){const h=Tf(i);h.length&&(d.duration=h[0].duration,d.timeline=h[0].timeline)}else n&&(d.duration=n,d.timeline=s);return d.presentationTime=a||s,d.number=o,[d]},Sf=(i,e,t)=>{const n=i.sidx.map?i.sidx.map:null,r=i.sidx.duration,s=i.timeline||0,a=i.sidx.byterange,o=a.offset+a.length,c=e.timescale,u=e.references.filter(f=>f.referenceType!==1),d=[],h=i.endList?"static":"dynamic",b=i.sidx.timeline;let v=b,y=i.mediaSequence||0,p;typeof e.firstOffset=="bigint"?p=te.BigInt(o)+e.firstOffset:p=o+e.firstOffset;for(let f=0;f<u.length;f++){const m=e.references[f],_=m.referencedSize,k=m.subsegmentDuration;let D;typeof p=="bigint"?D=p+te.BigInt(_)-te.BigInt(1):D=p+_-1;const E=`${p}-${D}`,w=Yy({baseUrl:t,timescale:c,timeline:s,periodStart:b,presentationTime:v,number:y,duration:k,sourceDuration:r,indexRange:E,type:h})[0];n&&(w.map=n),d.push(w),typeof p=="bigint"?p+=te.BigInt(_):p+=_,v+=k/c,y++}return i.segments=d,i},P6=["AUDIO","SUBTITLES"],O6=1/60,Jy=i=>D6(i,({timeline:e})=>e).sort((e,t)=>e.timeline>t.timeline?1:-1),M6=(i,e)=>{for(let t=0;t<i.length;t++)if(i[t].attributes.NAME===e)return i[t];return null},Qy=i=>{let e=[];return _6(i,P6,(t,n,r,s)=>{e=e.concat(t.playlists||[])}),e},Zy=({playlist:i,mediaSequence:e})=>{i.mediaSequence=e,i.segments.forEach((t,n)=>{t.number=i.mediaSequence+n})},R6=({oldPlaylists:i,newPlaylists:e,timelineStarts:t})=>{e.forEach(n=>{n.discontinuitySequence=t.findIndex(function({timeline:c}){return c===n.timeline});const r=M6(i,n.attributes.NAME);if(!r||n.sidx)return;const s=n.segments[0],a=r.segments.findIndex(function(c){return Math.abs(c.presentationTime-s.presentationTime)<O6});if(a===-1){Zy({playlist:n,mediaSequence:r.mediaSequence+r.segments.length}),n.segments[0].discontinuity=!0,n.discontinuityStarts.unshift(0),(!r.segments.length&&n.timeline>r.timeline||r.segments.length&&n.timeline>r.segments[r.segments.length-1].timeline)&&n.discontinuitySequence--;return}r.segments[a].discontinuity&&!s.discontinuity&&(s.discontinuity=!0,n.discontinuityStarts.unshift(0),n.discontinuitySequence--),Zy({playlist:n,mediaSequence:r.segments[a].number})})},L6=({oldManifest:i,newManifest:e})=>{const t=i.playlists.concat(Qy(i)),n=e.playlists.concat(Qy(e));return e.timelineStarts=Jy([i.timelineStarts,e.timelineStarts]),R6({oldPlaylists:t,newPlaylists:n,timelineStarts:e.timelineStarts}),e},Zc=i=>i&&i.uri+"-"+A6(i.byterange),Cf=i=>{const e=i.reduce(function(n,r){return n[r.attributes.baseUrl]||(n[r.attributes.baseUrl]=[]),n[r.attributes.baseUrl].push(r),n},{});let t=[];return Object.values(e).forEach(n=>{const r=Wy(n.reduce((s,a)=>{const o=a.attributes.id+(a.attributes.lang||"");return s[o]?(a.segments&&(a.segments[0]&&(a.segments[0].discontinuity=!0),s[o].segments.push(...a.segments)),a.attributes.contentProtection&&(s[o].attributes.contentProtection=a.attributes.contentProtection)):(s[o]=a,s[o].attributes.timelineStarts=[]),s[o].attributes.timelineStarts.push({start:a.attributes.periodStart,timeline:a.attributes.periodStart}),s},{}));t=t.concat(r)}),t.map(n=>(n.discontinuityStarts=w6(n.segments||[],"discontinuity"),n))},xf=(i,e)=>{const t=Zc(i.sidx),n=t&&e[t]&&e[t].sidx;return n&&Sf(i,n,i.sidx.resolvedUri),i},B6=(i,e={})=>{if(!Object.keys(e).length)return i;for(const t in i)i[t]=xf(i[t],e);return i},U6=({attributes:i,segments:e,sidx:t,mediaSequence:n,discontinuitySequence:r,discontinuityStarts:s},a)=>{const o={attributes:{NAME:i.id,BANDWIDTH:i.bandwidth,CODECS:i.codecs,"PROGRAM-ID":1},uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,discontinuitySequence:r,discontinuityStarts:s,timelineStarts:i.timelineStarts,mediaSequence:n,segments:e};return i.contentProtection&&(o.contentProtection=i.contentProtection),i.serviceLocation&&(o.attributes.serviceLocation=i.serviceLocation),t&&(o.sidx=t),a&&(o.attributes.AUDIO="audio",o.attributes.SUBTITLES="subs"),o},F6=({attributes:i,segments:e,mediaSequence:t,discontinuityStarts:n,discontinuitySequence:r})=>{typeof e>"u"&&(e=[{uri:i.baseUrl,timeline:i.periodStart,resolvedUri:i.baseUrl||"",duration:i.sourceDuration,number:0}],i.duration=i.sourceDuration);const s={NAME:i.id,BANDWIDTH:i.bandwidth,"PROGRAM-ID":1};i.codecs&&(s.CODECS=i.codecs);const a={attributes:s,uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,timelineStarts:i.timelineStarts,discontinuityStarts:n,discontinuitySequence:r,mediaSequence:t,segments:e};return i.serviceLocation&&(a.attributes.serviceLocation=i.serviceLocation),a},V6=(i,e={},t=!1)=>{let n;const r=i.reduce((s,a)=>{const o=a.attributes.role&&a.attributes.role.value||"",c=a.attributes.lang||"";let u=a.attributes.label||"main";if(c&&!a.attributes.label){const h=o?` (${o})`:"";u=`${a.attributes.lang}${h}`}s[u]||(s[u]={language:c,autoselect:!0,default:o==="main",playlists:[],uri:""});const d=xf(U6(a,t),e);return s[u].playlists.push(d),typeof n>"u"&&o==="main"&&(n=a,n.default=!0),s},{});if(!n){const s=Object.keys(r)[0];r[s].default=!0}return r},j6=(i,e={})=>i.reduce((t,n)=>{const r=n.attributes.label||n.attributes.lang||"text",s=n.attributes.lang||"und";return t[r]||(t[r]={language:s,default:!1,autoselect:!1,playlists:[],uri:""}),t[r].playlists.push(xf(F6(n),e)),t},{}),$6=i=>i.reduce((e,t)=>(t&&t.forEach(n=>{const{channel:r,language:s}=n;e[s]={autoselect:!1,default:!1,instreamId:r,language:s},n.hasOwnProperty("aspectRatio")&&(e[s].aspectRatio=n.aspectRatio),n.hasOwnProperty("easyReader")&&(e[s].easyReader=n.easyReader),n.hasOwnProperty("3D")&&(e[s]["3D"]=n["3D"])}),e),{}),H6=({attributes:i,segments:e,sidx:t,discontinuityStarts:n})=>{const r={attributes:{NAME:i.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:i.width,height:i.height},CODECS:i.codecs,BANDWIDTH:i.bandwidth,"PROGRAM-ID":1},uri:"",endList:i.type==="static",timeline:i.periodStart,resolvedUri:i.baseUrl||"",targetDuration:i.duration,discontinuityStarts:n,timelineStarts:i.timelineStarts,segments:e};return i.frameRate&&(r.attributes["FRAME-RATE"]=i.frameRate),i.contentProtection&&(r.contentProtection=i.contentProtection),i.serviceLocation&&(r.attributes.serviceLocation=i.serviceLocation),t&&(r.sidx=t),r},q6=({attributes:i})=>i.mimeType==="video/mp4"||i.mimeType==="video/webm"||i.contentType==="video",z6=({attributes:i})=>i.mimeType==="audio/mp4"||i.mimeType==="audio/webm"||i.contentType==="audio",G6=({attributes:i})=>i.mimeType==="text/vtt"||i.contentType==="text",W6=(i,e)=>{i.forEach(t=>{t.mediaSequence=0,t.discontinuitySequence=e.findIndex(function({timeline:n}){return n===t.timeline}),t.segments&&t.segments.forEach((n,r)=>{n.number=r})})},e1=i=>i?Object.keys(i).reduce((e,t)=>{const n=i[t];return e.concat(n.playlists)},[]):[],K6=({dashPlaylists:i,locations:e,contentSteering:t,sidxMapping:n={},previousManifest:r,eventStream:s})=>{if(!i.length)return{};const{sourceDuration:a,type:o,suggestedPresentationDelay:c,minimumUpdatePeriod:u}=i[0].attributes,d=Cf(i.filter(q6)).map(H6),h=Cf(i.filter(z6)),b=Cf(i.filter(G6)),v=i.map(D=>D.attributes.captionServices).filter(Boolean),y={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:a,playlists:B6(d,n)};u>=0&&(y.minimumUpdatePeriod=u*1e3),e&&(y.locations=e),t&&(y.contentSteering=t),o==="dynamic"&&(y.suggestedPresentationDelay=c),s&&s.length>0&&(y.eventStream=s);const p=y.playlists.length===0,f=h.length?V6(h,n,p):null,m=b.length?j6(b,n):null,_=d.concat(e1(f),e1(m)),k=_.map(({timelineStarts:D})=>D);return y.timelineStarts=Jy(k),W6(_,y.timelineStarts),f&&(y.mediaGroups.AUDIO.audio=f),m&&(y.mediaGroups.SUBTITLES.subs=m),v.length&&(y.mediaGroups["CLOSED-CAPTIONS"].cc=$6(v)),r?L6({oldManifest:r,newManifest:y}):y},X6=(i,e,t)=>{const{NOW:n,clientOffset:r,availabilityStartTime:s,timescale:a=1,periodStart:o=0,minimumUpdatePeriod:c=0}=i,u=(n+r)/1e3,d=s+o,b=u+c-d;return Math.ceil((b*a-e)/t)},t1=(i,e)=>{const{type:t,minimumUpdatePeriod:n=0,media:r="",sourceDuration:s,timescale:a=1,startNumber:o=1,periodStart:c}=i,u=[];let d=-1;for(let h=0;h<e.length;h++){const b=e[h],v=b.d,y=b.r||0,p=b.t||0;d<0&&(d=p),p&&p>d&&(d=p);let f;if(y<0){const k=h+1;k===e.length?t==="dynamic"&&n>0&&r.indexOf("$Number$")>0?f=X6(i,d,v):f=(s*a-d)/v:f=(e[k].t-d)/v}else f=y+1;const m=o+u.length+f;let _=o+u.length;for(;_<m;)u.push({number:_,duration:v/a,time:d,timeline:c}),d+=v,_++}return u},Y6=/\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,J6=i=>(e,t,n,r)=>{if(e==="$$")return"$";if(typeof i[t]>"u")return e;const s=""+i[t];return t==="RepresentationID"||(n?r=parseInt(r,10):r=1,s.length>=r)?s:`${new Array(r-s.length+1).join("0")}${s}`},n1=(i,e)=>i.replace(Y6,J6(e)),Q6=(i,e)=>!i.duration&&!e?[{number:i.startNumber||1,duration:i.sourceDuration,time:0,timeline:i.periodStart}]:i.duration?Tf(i):t1(i,e),Z6=(i,e)=>{const t={RepresentationID:i.id,Bandwidth:i.bandwidth||0},{initialization:n={sourceURL:"",range:""}}=i,r=Qo({baseUrl:i.baseUrl,source:n1(n.sourceURL,t),range:n.range});return Q6(i,e).map(a=>{t.Number=a.number,t.Time=a.time;const o=n1(i.media||"",t),c=i.timescale||1,u=i.presentationTimeOffset||0,d=i.periodStart+(a.time-u)/c;return{uri:o,timeline:a.timeline,duration:a.duration,resolvedUri:Yc(i.baseUrl||"",o),map:r,number:a.number,presentationTime:d}})},eD=(i,e)=>{const{baseUrl:t,initialization:n={}}=i,r=Qo({baseUrl:t,source:n.sourceURL,range:n.range}),s=Qo({baseUrl:t,source:e.media,range:e.mediaRange});return s.map=r,s},tD=(i,e)=>{const{duration:t,segmentUrls:n=[],periodStart:r}=i;if(!t&&!e||t&&e)throw new Error(Sa.SEGMENT_TIME_UNSPECIFIED);const s=n.map(c=>eD(i,c));let a;return t&&(a=Tf(i)),e&&(a=t1(i,e)),a.map((c,u)=>{if(s[u]){const d=s[u],h=i.timescale||1,b=i.presentationTimeOffset||0;return d.timeline=c.timeline,d.duration=c.duration,d.number=c.number,d.presentationTime=r+(c.time-b)/h,d}}).filter(c=>c)},nD=({attributes:i,segmentInfo:e})=>{let t,n;e.template?(n=Z6,t=_n(i,e.template)):e.base?(n=Yy,t=_n(i,e.base)):e.list&&(n=tD,t=_n(i,e.list));const r={attributes:i};if(!n)return r;const s=n(t,e.segmentTimeline);if(t.duration){const{duration:a,timescale:o=1}=t;t.duration=a/o}else s.length?t.duration=s.reduce((a,o)=>Math.max(a,Math.ceil(o.duration)),0):t.duration=0;return r.attributes=t,r.segments=s,e.base&&t.indexRange&&(r.sidx=s[0],r.segments=[]),r},iD=i=>i.map(nD),Yt=(i,e)=>Ky(i.childNodes).filter(({tagName:t})=>t===e),Zo=i=>i.textContent.trim(),rD=i=>parseFloat(i.split("/").reduce((e,t)=>e/t)),Ca=i=>{const o=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(i);if(!o)return 0;const[c,u,d,h,b,v]=o.slice(1);return parseFloat(c||0)*31536e3+parseFloat(u||0)*2592e3+parseFloat(d||0)*86400+parseFloat(h||0)*3600+parseFloat(b||0)*60+parseFloat(v||0)},sD=i=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(i)&&(i+="Z"),Date.parse(i)),i1={mediaPresentationDuration(i){return Ca(i)},availabilityStartTime(i){return sD(i)/1e3},minimumUpdatePeriod(i){return Ca(i)},suggestedPresentationDelay(i){return Ca(i)},type(i){return i},timeShiftBufferDepth(i){return Ca(i)},start(i){return Ca(i)},width(i){return parseInt(i,10)},height(i){return parseInt(i,10)},bandwidth(i){return parseInt(i,10)},frameRate(i){return rD(i)},startNumber(i){return parseInt(i,10)},timescale(i){return parseInt(i,10)},presentationTimeOffset(i){return parseInt(i,10)},duration(i){const e=parseInt(i,10);return isNaN(e)?Ca(i):e},d(i){return parseInt(i,10)},t(i){return parseInt(i,10)},r(i){return parseInt(i,10)},presentationTime(i){return parseInt(i,10)},DEFAULT(i){return i}},mn=i=>i&&i.attributes?Ky(i.attributes).reduce((e,t)=>{const n=i1[t.name]||i1.DEFAULT;return e[t.name]=n(t.value),e},{}):{},aD={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},eu=(i,e)=>e.length?Ta(i.map(function(t){return e.map(function(n){const r=Zo(n),s=Yc(t.baseUrl,r),a=_n(mn(n),{baseUrl:s});return s!==r&&!a.serviceLocation&&t.serviceLocation&&(a.serviceLocation=t.serviceLocation),a})})):i,Ef=i=>{const e=Yt(i,"SegmentTemplate")[0],t=Yt(i,"SegmentList")[0],n=t&&Yt(t,"SegmentURL").map(h=>_n({tag:"SegmentURL"},mn(h))),r=Yt(i,"SegmentBase")[0],s=t||e,a=s&&Yt(s,"SegmentTimeline")[0],o=t||r||e,c=o&&Yt(o,"Initialization")[0],u=e&&mn(e);u&&c?u.initialization=c&&mn(c):u&&u.initialization&&(u.initialization={sourceURL:u.initialization});const d={template:u,segmentTimeline:a&&Yt(a,"S").map(h=>mn(h)),list:t&&_n(mn(t),{segmentUrls:n,initialization:mn(c)}),base:r&&_n(mn(r),{initialization:mn(c)})};return Object.keys(d).forEach(h=>{d[h]||delete d[h]}),d},oD=(i,e,t)=>n=>{const r=Yt(n,"BaseURL"),s=eu(e,r),a=_n(i,mn(n)),o=Ef(n);return s.map(c=>({segmentInfo:_n(t,o),attributes:_n(a,c)}))},lD=i=>i.reduce((e,t)=>{const n=mn(t);n.schemeIdUri&&(n.schemeIdUri=n.schemeIdUri.toLowerCase());const r=aD[n.schemeIdUri];if(r){e[r]={attributes:n};const s=Yt(t,"cenc:pssh")[0];if(s){const a=Zo(s);e[r].pssh=a&&Iy(a)}}return e},{}),cD=i=>{if(i.schemeIdUri==="urn:scte:dash:cc:cea-608:2015")return(typeof i.value!="string"?[]:i.value.split(";")).map(t=>{let n,r;return r=t,/^CC\d=/.test(t)?[n,r]=t.split("="):/^CC\d$/.test(t)&&(n=t),{channel:n,language:r}});if(i.schemeIdUri==="urn:scte:dash:cc:cea-708:2015")return(typeof i.value!="string"?[]:i.value.split(";")).map(t=>{const n={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(t)){const[r,s=""]=t.split("=");n.channel=r,n.language=t,s.split(",").forEach(a=>{const[o,c]=a.split(":");o==="lang"?n.language=c:o==="er"?n.easyReader=Number(c):o==="war"?n.aspectRatio=Number(c):o==="3D"&&(n["3D"]=Number(c))})}else n.language=t;return n.channel&&(n.channel="SERVICE"+n.channel),n})},uD=i=>Ta(Yt(i.node,"EventStream").map(e=>{const t=mn(e),n=t.schemeIdUri;return Yt(e,"Event").map(r=>{const s=mn(r),a=s.presentationTime||0,o=t.timescale||1,c=s.duration||0,u=a/o+i.attributes.start;return{schemeIdUri:n,value:t.value,id:s.id,start:u,end:u+c/o,messageData:Zo(r)||s.messageData,contentEncoding:t.contentEncoding,presentationTimeOffset:t.presentationTimeOffset||0}})})),dD=(i,e,t)=>n=>{const r=mn(n),s=eu(e,Yt(n,"BaseURL")),a=Yt(n,"Role")[0],o={role:mn(a)};let c=_n(i,r,o);const u=Yt(n,"Accessibility")[0],d=cD(mn(u));d&&(c=_n(c,{captionServices:d}));const h=Yt(n,"Label")[0];if(h&&h.childNodes.length){const f=h.childNodes[0].nodeValue.trim();c=_n(c,{label:f})}const b=lD(Yt(n,"ContentProtection"));Object.keys(b).length&&(c=_n(c,{contentProtection:b}));const v=Ef(n),y=Yt(n,"Representation"),p=_n(t,v);return Ta(y.map(oD(c,s,p)))},hD=(i,e)=>(t,n)=>{const r=eu(e,Yt(t.node,"BaseURL")),s=_n(i,{periodStart:t.attributes.start});typeof t.attributes.duration=="number"&&(s.periodDuration=t.attributes.duration);const a=Yt(t.node,"AdaptationSet"),o=Ef(t.node);return Ta(a.map(dD(s,r,o)))},fD=(i,e)=>{if(i.length>1&&e({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!i.length)return null;const t=_n({serverURL:Zo(i[0])},mn(i[0]));return t.queryBeforeStart=t.queryBeforeStart==="true",t},pD=({attributes:i,priorPeriodAttributes:e,mpdType:t})=>typeof i.start=="number"?i.start:e&&typeof e.start=="number"&&typeof e.duration=="number"?e.start+e.duration:!e&&t==="static"?0:null,mD=(i,e={})=>{const{manifestUri:t="",NOW:n=Date.now(),clientOffset:r=0,eventHandler:s=function(){}}=e,a=Yt(i,"Period");if(!a.length)throw new Error(Sa.INVALID_NUMBER_OF_PERIOD);const o=Yt(i,"Location"),c=mn(i),u=eu([{baseUrl:t}],Yt(i,"BaseURL")),d=Yt(i,"ContentSteering");c.type=c.type||"static",c.sourceDuration=c.mediaPresentationDuration||0,c.NOW=n,c.clientOffset=r,o.length&&(c.locations=o.map(Zo));const h=[];return a.forEach((b,v)=>{const y=mn(b),p=h[v-1];y.start=pD({attributes:y,priorPeriodAttributes:p?p.attributes:null,mpdType:c.type}),h.push({node:b,attributes:y})}),{locations:c.locations,contentSteeringInfo:fD(d,s),representationInfo:Ta(h.map(hD(c,u))),eventStream:Ta(h.map(uD))}},r1=i=>{if(i==="")throw new Error(Sa.DASH_EMPTY_MANIFEST);const e=new x6.DOMParser;let t,n;try{t=e.parseFromString(i,"application/xml"),n=t&&t.documentElement.tagName==="MPD"?t.documentElement:null}catch{}if(!n||n&&n.getElementsByTagName("parsererror").length>0)throw new Error(Sa.DASH_INVALID_XML);return n},gD=i=>{const e=Yt(i,"UTCTiming")[0];if(!e)return null;const t=mn(e);switch(t.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":t.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":t.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":t.method="DIRECT",t.value=Date.parse(t.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(Sa.UNSUPPORTED_UTC_TIMING_SCHEME)}return t},vD=(i,e={})=>{const t=mD(r1(i),e),n=iD(t.representationInfo);return K6({dashPlaylists:n,locations:t.locations,contentSteering:t.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:t.eventStream})},yD=i=>gD(r1(i));var wf,s1;function bD(){if(s1)return wf;s1=1;var i=Math.pow(2,32),e=function(t){var n=new DataView(t.buffer,t.byteOffset,t.byteLength),r;return n.getBigUint64?(r=n.getBigUint64(0),r<Number.MAX_SAFE_INTEGER?Number(r):r):n.getUint32(0)*i+n.getUint32(4)};return wf={getUint64:e,MAX_UINT32:i},wf}var Df,a1;function _D(){if(a1)return Df;a1=1;var i=bD().getUint64,e=function(t){var n=new DataView(t.buffer,t.byteOffset,t.byteLength),r={version:t[0],flags:new Uint8Array(t.subarray(1,4)),references:[],referenceId:n.getUint32(4),timescale:n.getUint32(8)},s=12;r.version===0?(r.earliestPresentationTime=n.getUint32(s),r.firstOffset=n.getUint32(s+4),s+=8):(r.earliestPresentationTime=i(t.subarray(s)),r.firstOffset=i(t.subarray(s+8)),s+=16),s+=2;var a=n.getUint16(s);for(s+=2;a>0;s+=12,a--)r.references.push({referenceType:(t[s]&128)>>>7,referencedSize:n.getUint32(s)&2147483647,subsegmentDuration:n.getUint32(s+4),startsWithSap:!!(t[s+8]&128),sapType:(t[s+8]&112)>>>4,sapDeltaTime:n.getUint32(s+8)&268435455});return r};return Df=e,Df}var kD=_D();const TD=ga(kD);var SD=st([73,68,51]),CD=function(e,t){t===void 0&&(t=0),e=st(e);var n=e[t+5],r=e[t+6]<<21|e[t+7]<<14|e[t+8]<<7|e[t+9],s=(n&16)>>4;return s?r+20:r+10},el=function i(e,t){return t===void 0&&(t=0),e=st(e),e.length-t<10||!Xt(e,SD,{offset:t})?t:(t+=CD(e,t),i(e,t))},o1=function(e){return typeof e=="string"?Uy(e):e},xD=function(e){return Array.isArray(e)?e.map(function(t){return o1(t)}):[o1(e)]},ED=function i(e,t,n){n===void 0&&(n=!1),t=xD(t),e=st(e);var r=[];if(!t.length)return r;for(var s=0;s<e.length;){var a=(e[s]<<24|e[s+1]<<16|e[s+2]<<8|e[s+3])>>>0,o=e.subarray(s+4,s+8);if(a===0)break;var c=s+a;if(c>e.length){if(n)break;c=e.length}var u=e.subarray(s+8,c);Xt(o,t[0])&&(t.length===1?r.push(u):r.push.apply(r,i(u,t.slice(1),n))),s=c}return r},tu={EBML:st([26,69,223,163]),DocType:st([66,130]),Segment:st([24,83,128,103]),SegmentInfo:st([21,73,169,102]),Tracks:st([22,84,174,107]),Track:st([174]),TrackNumber:st([215]),DefaultDuration:st([35,227,131]),TrackEntry:st([174]),TrackType:st([131]),FlagDefault:st([136]),CodecID:st([134]),CodecPrivate:st([99,162]),VideoTrack:st([224]),AudioTrack:st([225]),Cluster:st([31,67,182,117]),Timestamp:st([231]),TimestampScale:st([42,215,177]),BlockGroup:st([160]),BlockDuration:st([155]),Block:st([161]),SimpleBlock:st([163])},Af=[128,64,32,16,8,4,2,1],wD=function(e){for(var t=1,n=0;n<Af.length&&!(e&Af[n]);n++)t++;return t},nu=function(e,t,n,r){n===void 0&&(n=!0),r===void 0&&(r=!1);var s=wD(e[t]),a=e.subarray(t,t+s);return n&&(a=Array.prototype.slice.call(e,t,t+s),a[0]^=Af[s-1]),{length:s,value:v6(a,{signed:r}),bytes:a}},l1=function i(e){return typeof e=="string"?e.match(/.{1,2}/g).map(function(t){return i(t)}):typeof e=="number"?y6(e):e},DD=function(e){return Array.isArray(e)?e.map(function(t){return l1(t)}):[l1(e)]},AD=function i(e,t,n){if(n>=t.length)return t.length;var r=nu(t,n,!1);if(Xt(e.bytes,r.bytes))return n;var s=nu(t,n+r.length);return i(e,t,n+s.length+s.value+r.length)},c1=function i(e,t){t=DD(t),e=st(e);var n=[];if(!t.length)return n;for(var r=0;r<e.length;){var s=nu(e,r,!1),a=nu(e,r+s.length),o=r+s.length+a.length;a.value===127&&(a.value=AD(s,e,o),a.value!==e.length&&(a.value-=o));var c=o+a.value>e.length?e.length:o+a.value,u=e.subarray(o,c);Xt(t[0],s.bytes)&&(t.length===1?n.push(u):n=n.concat(i(u,t.slice(1))));var d=s.length+a.length+u.length;r+=d}return n},ID=st([0,0,0,1]),ND=st([0,0,1]),PD=st([0,0,3]),OD=function(e){for(var t=[],n=1;n<e.length-2;)Xt(e.subarray(n,n+3),PD)&&(t.push(n+2),n++),n++;if(t.length===0)return e;var r=e.length-t.length,s=new Uint8Array(r),a=0;for(n=0;n<r;a++,n++)a===t[0]&&(a++,t.shift()),s[n]=e[a];return s},u1=function(e,t,n,r){e=st(e),n=[].concat(n);for(var s=0,a,o=0;s<e.length&&(o<r||a);){var c=void 0;if(Xt(e.subarray(s),ID)?c=4:Xt(e.subarray(s),ND)&&(c=3),!c){s++;continue}if(o++,a)return OD(e.subarray(a,s));var u=void 0;t==="h264"?u=e[s+c]&31:t==="h265"&&(u=e[s+c]>>1&63),n.indexOf(u)!==-1&&(a=s+c),s+=c+(t==="h264"?1:2)}return e.subarray(0,0)},MD=function(e,t,n){return u1(e,"h264",t,n)},RD=function(e,t,n){return u1(e,"h265",t,n)},Wn={webm:st([119,101,98,109]),matroska:st([109,97,116,114,111,115,107,97]),flac:st([102,76,97,67]),ogg:st([79,103,103,83]),ac3:st([11,119]),riff:st([82,73,70,70]),avi:st([65,86,73]),wav:st([87,65,86,69]),"3gp":st([102,116,121,112,51,103]),mp4:st([102,116,121,112]),fmp4:st([115,116,121,112]),mov:st([102,116,121,112,113,116]),moov:st([109,111,111,118]),moof:st([109,111,111,102])},xa={aac:function(e){var t=el(e);return Xt(e,[255,16],{offset:t,mask:[255,22]})},mp3:function(e){var t=el(e);return Xt(e,[255,2],{offset:t,mask:[255,6]})},webm:function(e){var t=c1(e,[tu.EBML,tu.DocType])[0];return Xt(t,Wn.webm)},mkv:function(e){var t=c1(e,[tu.EBML,tu.DocType])[0];return Xt(t,Wn.matroska)},mp4:function(e){if(xa["3gp"](e)||xa.mov(e))return!1;if(Xt(e,Wn.mp4,{offset:4})||Xt(e,Wn.fmp4,{offset:4})||Xt(e,Wn.moof,{offset:4})||Xt(e,Wn.moov,{offset:4}))return!0},mov:function(e){return Xt(e,Wn.mov,{offset:4})},"3gp":function(e){return Xt(e,Wn["3gp"],{offset:4})},ac3:function(e){var t=el(e);return Xt(e,Wn.ac3,{offset:t})},ts:function(e){if(e.length<189&&e.length>=1)return e[0]===71;for(var t=0;t+188<e.length&&t<188;){if(e[t]===71&&e[t+188]===71)return!0;t+=1}return!1},flac:function(e){var t=el(e);return Xt(e,Wn.flac,{offset:t})},ogg:function(e){return Xt(e,Wn.ogg)},avi:function(e){return Xt(e,Wn.riff)&&Xt(e,Wn.avi,{offset:8})},wav:function(e){return Xt(e,Wn.riff)&&Xt(e,Wn.wav,{offset:8})},h264:function(e){return MD(e,7,3).length},h265:function(e){return RD(e,[32,33],3).length}},If=Object.keys(xa).filter(function(i){return i!=="ts"&&i!=="h264"&&i!=="h265"}).concat(["ts","h264","h265"]);If.forEach(function(i){var e=xa[i];xa[i]=function(t){return e(st(t))}});var LD=xa,Nf=function(e){e=st(e);for(var t=0;t<If.length;t++){var n=If[t];if(LD[n](e))return n}return""},BD=function(e){return ED(e,["moof"]).length>0},Pf,d1;function UD(){if(d1)return Pf;d1=1;var i=9e4,e,t,n,r,s,a,o;return e=function(c){return c*i},t=function(c,u){return c*u},n=function(c){return c/i},r=function(c,u){return c/u},s=function(c,u){return e(r(c,u))},a=function(c,u){return t(n(c),u)},o=function(c,u,d){return n(d?c:c-u)},Pf={ONE_SECOND_IN_TS:i,secondsToVideoTs:e,secondsToAudioTs:t,videoTsToSeconds:n,audioTsToSeconds:r,audioTsToVideoTs:s,videoTsToAudioTs:a,metadataTsToSeconds:o},Pf}var Rs=UD();/**
|
48
|
+
* @license
|
49
|
+
* Video.js 8.23.3 <http://videojs.com/>
|
50
|
+
* Copyright Brightcove, Inc. <https://www.brightcove.com/>
|
51
|
+
* Available under Apache License Version 2.0
|
52
|
+
* <https://github.com/videojs/video.js/blob/main/LICENSE>
|
53
|
+
*
|
54
|
+
* Includes vtt.js <https://github.com/mozilla/vtt.js>
|
55
|
+
* Available under Apache License Version 2.0
|
56
|
+
* <https://github.com/mozilla/vtt.js/blob/main/LICENSE>
|
57
|
+
*/var Of="8.23.3";const Ar={},ns=function(i,e){return Ar[i]=Ar[i]||[],e&&(Ar[i]=Ar[i].concat(e)),Ar[i]},FD=function(i,e){ns(i,e)},h1=function(i,e){const t=ns(i).indexOf(e);return t<=-1?!1:(Ar[i]=Ar[i].slice(),Ar[i].splice(t,1),!0)},VD=function(i,e){ns(i,[].concat(e).map(t=>{const n=(...r)=>(h1(i,n),t(...r));return n}))},iu={prefixed:!0},ru=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],f1=ru[0];let tl;for(let i=0;i<ru.length;i++)if(ru[i][1]in Fe){tl=ru[i];break}if(tl){for(let i=0;i<tl.length;i++)iu[f1[i]]=tl[i];iu.prefixed=tl[0]!==f1[0]}let ei=[];const jD=(i,e,t)=>(n,r,s)=>{const a=e.levels[r],o=new RegExp(`^(${a})$`);let c=i;if(n!=="log"&&s.unshift(n.toUpperCase()+":"),t&&(c=`%c${i}`,s.unshift(t)),s.unshift(c+":"),ei){ei.push([].concat(s));const d=ei.length-1e3;ei.splice(0,d>0?d:0)}if(!te.console)return;let u=te.console[n];!u&&n==="debug"&&(u=te.console.info||te.console.log),!(!u||!a||!o.test(n))&&u[Array.isArray(s)?"apply":"call"](te.console,s)};function Mf(i,e=":",t=""){let n="info",r;function s(...a){r("log",n,a)}return r=jD(i,s,t),s.createLogger=(a,o,c)=>{const u=o!==void 0?o:e,d=c!==void 0?c:t,h=`${i} ${u} ${a}`;return Mf(h,u,d)},s.createNewLogger=(a,o,c)=>Mf(a,o,c),s.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:n},s.level=a=>{if(typeof a=="string"){if(!s.levels.hasOwnProperty(a))throw new Error(`"${a}" in not a valid log level`);n=a}return n},s.history=()=>ei?[].concat(ei):[],s.history.filter=a=>(ei||[]).filter(o=>new RegExp(`.*${a}.*`).test(o[0])),s.history.clear=()=>{ei&&(ei.length=0)},s.history.disable=()=>{ei!==null&&(ei.length=0,ei=null)},s.history.enable=()=>{ei===null&&(ei=[])},s.error=(...a)=>r("error",n,a),s.warn=(...a)=>r("warn",n,a),s.debug=(...a)=>r("debug",n,a),s}const _t=Mf("VIDEOJS"),p1=_t.createLogger,$D=Object.prototype.toString,m1=function(i){return rr(i)?Object.keys(i):[]};function Ea(i,e){m1(i).forEach(t=>e(i[t],t))}function g1(i,e,t=0){return m1(i).reduce((n,r)=>e(n,i[r],r),t)}function rr(i){return!!i&&typeof i=="object"}function wa(i){return rr(i)&&$D.call(i)==="[object Object]"&&i.constructor===Object}function Ot(...i){const e={};return i.forEach(t=>{t&&Ea(t,(n,r)=>{if(!wa(n)){e[r]=n;return}wa(e[r])||(e[r]={}),e[r]=Ot(e[r],n)})}),e}function v1(i={}){const e=[];for(const t in i)if(i.hasOwnProperty(t)){const n=i[t];e.push(n)}return e}function su(i,e,t,n=!0){const r=a=>Object.defineProperty(i,e,{value:a,enumerable:!0,writable:!0}),s={configurable:!0,enumerable:!0,get(){const a=t();return r(a),a}};return n&&(s.set=r),Object.defineProperty(i,e,s)}var HD=Object.freeze({__proto__:null,each:Ea,reduce:g1,isObject:rr,isPlain:wa,merge:Ot,values:v1,defineLazyProperty:su});let Rf=!1,y1=null,ji=!1,b1,_1=!1,Da=!1,Aa=!1,sr=!1,Lf=null,au=null;const qD=!!(te.cast&&te.cast.framework&&te.cast.framework.CastReceiverContext);let k1=null,ou=!1,lu=!1,cu=!1,uu=!1,du=!1,hu=!1,fu=!1;const nl=!!(Ia()&&("ontouchstart"in te||te.navigator.maxTouchPoints||te.DocumentTouch&&te.document instanceof te.DocumentTouch)),is=te.navigator&&te.navigator.userAgentData;if(is&&is.platform&&is.brands&&(ji=is.platform==="Android",Da=!!is.brands.find(i=>i.brand==="Microsoft Edge"),Aa=!!is.brands.find(i=>i.brand==="Chromium"),sr=!Da&&Aa,Lf=au=(is.brands.find(i=>i.brand==="Chromium")||{}).version||null,lu=is.platform==="Windows"),!Aa){const i=te.navigator&&te.navigator.userAgent||"";Rf=/iPod/i.test(i),y1=function(){const e=i.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),ji=/Android/i.test(i),b1=function(){const e=i.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const t=e[1]&&parseFloat(e[1]),n=e[2]&&parseFloat(e[2]);return t&&n?parseFloat(e[1]+"."+e[2]):t||null}(),_1=/Firefox/i.test(i),Da=/Edg/i.test(i),Aa=/Chrome/i.test(i)||/CriOS/i.test(i),sr=!Da&&Aa,Lf=au=function(){const e=i.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),k1=function(){const e=/MSIE\s(\d+)\.\d/.exec(i);let t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(i)&&/rv:11.0/.test(i)&&(t=11),t}(),du=/Tizen/i.test(i),hu=/Web0S/i.test(i),fu=du||hu,ou=/Safari/i.test(i)&&!sr&&!ji&&!Da&&!fu,lu=/Windows/i.test(i),cu=/iPad/i.test(i)||ou&&nl&&!/iPhone/i.test(i),uu=/iPhone/i.test(i)&&!cu}const Un=uu||cu||Rf,pu=(ou||Un)&&!sr;var T1=Object.freeze({__proto__:null,get IS_IPOD(){return Rf},get IOS_VERSION(){return y1},get IS_ANDROID(){return ji},get ANDROID_VERSION(){return b1},get IS_FIREFOX(){return _1},get IS_EDGE(){return Da},get IS_CHROMIUM(){return Aa},get IS_CHROME(){return sr},get CHROMIUM_VERSION(){return Lf},get CHROME_VERSION(){return au},IS_CHROMECAST_RECEIVER:qD,get IE_VERSION(){return k1},get IS_SAFARI(){return ou},get IS_WINDOWS(){return lu},get IS_IPAD(){return cu},get IS_IPHONE(){return uu},get IS_TIZEN(){return du},get IS_WEBOS(){return hu},get IS_SMART_TV(){return fu},TOUCH_ENABLED:nl,IS_IOS:Un,IS_ANY_SAFARI:pu});function S1(i){return typeof i=="string"&&!!i.trim()}function zD(i){if(i.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function Ia(){return Fe===te.document}function Na(i){return rr(i)&&i.nodeType===1}function C1(){try{return te.parent!==te.self}catch{return!0}}function x1(i){return function(e,t){if(!S1(e))return Fe[i](null);S1(t)&&(t=Fe.querySelector(t));const n=Na(t)?t:Fe;return n[i]&&n[i](e)}}function ot(i="div",e={},t={},n){const r=Fe.createElement(i);return Object.getOwnPropertyNames(e).forEach(function(s){const a=e[s];s==="textContent"?rs(r,a):(r[s]!==a||s==="tabIndex")&&(r[s]=a)}),Object.getOwnPropertyNames(t).forEach(function(s){r.setAttribute(s,t[s])}),n&&Uf(r,n),r}function rs(i,e){return typeof i.textContent>"u"?i.innerText=e:i.textContent=e,i}function Bf(i,e){e.firstChild?e.insertBefore(i,e.firstChild):e.appendChild(i)}function il(i,e){return zD(e),i.classList.contains(e)}function Ls(i,...e){return i.classList.add(...e.reduce((t,n)=>t.concat(n.split(/\s+/)),[])),i}function mu(i,...e){return i?(i.classList.remove(...e.reduce((t,n)=>t.concat(n.split(/\s+/)),[])),i):(_t.warn("removeClass was called with an element that doesn't exist"),null)}function E1(i,e,t){return typeof t=="function"&&(t=t(i,e)),typeof t!="boolean"&&(t=void 0),e.split(/\s+/).forEach(n=>i.classList.toggle(n,t)),i}function w1(i,e){Object.getOwnPropertyNames(e).forEach(function(t){const n=e[t];n===null||typeof n>"u"||n===!1?i.removeAttribute(t):i.setAttribute(t,n===!0?"":n)})}function ss(i){const e={},t=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(i&&i.attributes&&i.attributes.length>0){const n=i.attributes;for(let r=n.length-1;r>=0;r--){const s=n[r].name;let a=n[r].value;t.includes(s)&&(a=a!==null),e[s]=a}}return e}function D1(i,e){return i.getAttribute(e)}function Pa(i,e,t){i.setAttribute(e,t)}function gu(i,e){i.removeAttribute(e)}function A1(){Fe.body.focus(),Fe.onselectstart=function(){return!1}}function I1(){Fe.onselectstart=function(){return!0}}function Oa(i){if(i&&i.getBoundingClientRect&&i.parentNode){const e=i.getBoundingClientRect(),t={};return["bottom","height","left","right","top","width"].forEach(n=>{e[n]!==void 0&&(t[n]=e[n])}),t.height||(t.height=parseFloat(Ma(i,"height"))),t.width||(t.width=parseFloat(Ma(i,"width"))),t}}function rl(i){if(!i||i&&!i.offsetParent)return{left:0,top:0,width:0,height:0};const e=i.offsetWidth,t=i.offsetHeight;let n=0,r=0;for(;i.offsetParent&&i!==Fe[iu.fullscreenElement];)n+=i.offsetLeft,r+=i.offsetTop,i=i.offsetParent;return{left:n,top:r,width:e,height:t}}function vu(i,e){const t={x:0,y:0};if(Un){let d=i;for(;d&&d.nodeName.toLowerCase()!=="html";){const h=Ma(d,"transform");if(/^matrix/.test(h)){const b=h.slice(7,-1).split(/,\s/).map(Number);t.x+=b[4],t.y+=b[5]}else if(/^matrix3d/.test(h)){const b=h.slice(9,-1).split(/,\s/).map(Number);t.x+=b[12],t.y+=b[13]}if(d.assignedSlot&&d.assignedSlot.parentElement&&te.WebKitCSSMatrix){const b=te.getComputedStyle(d.assignedSlot.parentElement).transform,v=new te.WebKitCSSMatrix(b);t.x+=v.m41,t.y+=v.m42}d=d.parentNode||d.host}}const n={},r=rl(e.target),s=rl(i),a=s.width,o=s.height;let c=e.offsetY-(s.top-r.top),u=e.offsetX-(s.left-r.left);return e.changedTouches&&(u=e.changedTouches[0].pageX-s.left,c=e.changedTouches[0].pageY+s.top,Un&&(u-=t.x,c-=t.y)),n.y=1-Math.max(0,Math.min(1,c/o)),n.x=Math.max(0,Math.min(1,u/a)),n}function N1(i){return rr(i)&&i.nodeType===3}function yu(i){for(;i.firstChild;)i.removeChild(i.firstChild);return i}function P1(i){return typeof i=="function"&&(i=i()),(Array.isArray(i)?i:[i]).map(e=>{if(typeof e=="function"&&(e=e()),Na(e)||N1(e))return e;if(typeof e=="string"&&/\S/.test(e))return Fe.createTextNode(e)}).filter(e=>e)}function Uf(i,e){return P1(e).forEach(t=>i.appendChild(t)),i}function O1(i,e){return Uf(yu(i),e)}function sl(i){return i.button===void 0&&i.buttons===void 0||i.button===0&&i.buttons===void 0||i.type==="mouseup"&&i.button===0&&i.buttons===0||i.type==="mousedown"&&i.button===0&&i.buttons===0?!0:!(i.button!==0||i.buttons!==1)}const as=x1("querySelector"),M1=x1("querySelectorAll");function Ma(i,e){if(!i||!e)return"";if(typeof te.getComputedStyle=="function"){let t;try{t=te.getComputedStyle(i)}catch{return""}return t?t.getPropertyValue(e)||t[e]:""}return""}function R1(i){[...Fe.styleSheets].forEach(e=>{try{const t=[...e.cssRules].map(r=>r.cssText).join(""),n=Fe.createElement("style");n.textContent=t,i.document.head.appendChild(n)}catch{const n=Fe.createElement("link");n.rel="stylesheet",n.type=e.type,n.media=e.media.mediaText,n.href=e.href,i.document.head.appendChild(n)}})}var L1=Object.freeze({__proto__:null,isReal:Ia,isEl:Na,isInFrame:C1,createEl:ot,textContent:rs,prependTo:Bf,hasClass:il,addClass:Ls,removeClass:mu,toggleClass:E1,setAttributes:w1,getAttributes:ss,getAttribute:D1,setAttribute:Pa,removeAttribute:gu,blockTextSelection:A1,unblockTextSelection:I1,getBoundingClientRect:Oa,findPosition:rl,getPointerPosition:vu,isTextNode:N1,emptyEl:yu,normalizeContent:P1,appendContent:Uf,insertContent:O1,isSingleLeftClick:sl,$:as,$$:M1,computedStyle:Ma,copyStyleSheetsToWindow:R1});let B1=!1,Ff;const GD=function(){if(Ff.options.autoSetup===!1)return;const i=Array.prototype.slice.call(Fe.getElementsByTagName("video")),e=Array.prototype.slice.call(Fe.getElementsByTagName("audio")),t=Array.prototype.slice.call(Fe.getElementsByTagName("video-js")),n=i.concat(e,t);if(n&&n.length>0)for(let r=0,s=n.length;r<s;r++){const a=n[r];if(a&&a.getAttribute)a.player===void 0&&a.getAttribute("data-setup")!==null&&Ff(a);else{Vf(1);break}}else B1||Vf(1)};function Vf(i,e){Ia()&&(e&&(Ff=e),te.setTimeout(GD,i))}function jf(){B1=!0,te.removeEventListener("load",jf)}Ia()&&(Fe.readyState==="complete"?jf():te.addEventListener("load",jf));const U1=function(i){const e=Fe.createElement("style");return e.className=i,e},F1=function(i,e){i.styleSheet?i.styleSheet.cssText=e:i.textContent=e};var Kn=new WeakMap;let WD=3;function xi(){return WD++}function V1(i,e){if(!Kn.has(i))return;const t=Kn.get(i);t.handlers[e].length===0&&(delete t.handlers[e],i.removeEventListener?i.removeEventListener(e,t.dispatcher,!1):i.detachEvent&&i.detachEvent("on"+e,t.dispatcher)),Object.getOwnPropertyNames(t.handlers).length<=0&&(delete t.handlers,delete t.dispatcher,delete t.disabled),Object.getOwnPropertyNames(t).length===0&&Kn.delete(i)}function $f(i,e,t,n){t.forEach(function(r){i(e,r,n)})}function bu(i){if(i.fixed_)return i;function e(){return!0}function t(){return!1}if(!i||!i.isPropagationStopped||!i.isImmediatePropagationStopped){const n=i||te.event;i={};const r=["layerX","layerY","keyLocation","path","webkitMovementX","webkitMovementY","mozPressure","mozInputSource"];for(const s in n)r.includes(s)||s==="returnValue"&&n.preventDefault||(i[s]=n[s]);if(i.target||(i.target=i.srcElement||Fe),i.relatedTarget||(i.relatedTarget=i.fromElement===i.target?i.toElement:i.fromElement),i.preventDefault=function(){n.preventDefault&&n.preventDefault(),i.returnValue=!1,n.returnValue=!1,i.defaultPrevented=!0},i.defaultPrevented=!1,i.stopPropagation=function(){n.stopPropagation&&n.stopPropagation(),i.cancelBubble=!0,n.cancelBubble=!0,i.isPropagationStopped=e},i.isPropagationStopped=t,i.stopImmediatePropagation=function(){n.stopImmediatePropagation&&n.stopImmediatePropagation(),i.isImmediatePropagationStopped=e,i.stopPropagation()},i.isImmediatePropagationStopped=t,i.clientX!==null&&i.clientX!==void 0){const s=Fe.documentElement,a=Fe.body;i.pageX=i.clientX+(s&&s.scrollLeft||a&&a.scrollLeft||0)-(s&&s.clientLeft||a&&a.clientLeft||0),i.pageY=i.clientY+(s&&s.scrollTop||a&&a.scrollTop||0)-(s&&s.clientTop||a&&a.clientTop||0)}i.which=i.charCode||i.keyCode,i.button!==null&&i.button!==void 0&&(i.button=i.button&1?0:i.button&4?1:i.button&2?2:0)}return i.fixed_=!0,i}let _u;const KD=function(){if(typeof _u!="boolean"){_u=!1;try{const i=Object.defineProperty({},"passive",{get(){_u=!0}});te.addEventListener("test",null,i),te.removeEventListener("test",null,i)}catch{}}return _u},XD=["touchstart","touchmove"];function pi(i,e,t){if(Array.isArray(e))return $f(pi,i,e,t);Kn.has(i)||Kn.set(i,{});const n=Kn.get(i);if(n.handlers||(n.handlers={}),n.handlers[e]||(n.handlers[e]=[]),t.guid||(t.guid=xi()),n.handlers[e].push(t),n.dispatcher||(n.disabled=!1,n.dispatcher=function(r,s){if(n.disabled)return;r=bu(r);const a=n.handlers[r.type];if(a){const o=a.slice(0);for(let c=0,u=o.length;c<u&&!r.isImmediatePropagationStopped();c++)try{o[c].call(i,r,s)}catch(d){_t.error(d)}}}),n.handlers[e].length===1)if(i.addEventListener){let r=!1;KD()&&XD.indexOf(e)>-1&&(r={passive:!0}),i.addEventListener(e,n.dispatcher,r)}else i.attachEvent&&i.attachEvent("on"+e,n.dispatcher)}function Fn(i,e,t){if(!Kn.has(i))return;const n=Kn.get(i);if(!n.handlers)return;if(Array.isArray(e))return $f(Fn,i,e,t);const r=function(a,o){n.handlers[o]=[],V1(a,o)};if(e===void 0){for(const a in n.handlers)Object.prototype.hasOwnProperty.call(n.handlers||{},a)&&r(i,a);return}const s=n.handlers[e];if(s){if(!t){r(i,e);return}if(t.guid)for(let a=0;a<s.length;a++)s[a].guid===t.guid&&s.splice(a--,1);V1(i,e)}}function Ra(i,e,t){const n=Kn.has(i)?Kn.get(i):{},r=i.parentNode||i.ownerDocument;if(typeof e=="string"?e={type:e,target:i}:e.target||(e.target=i),e=bu(e),n.dispatcher&&n.dispatcher.call(i,e,t),r&&!e.isPropagationStopped()&&e.bubbles===!0)Ra.call(null,r,e,t);else if(!r&&!e.defaultPrevented&&e.target&&e.target[e.type]){Kn.has(e.target)||Kn.set(e.target,{});const s=Kn.get(e.target);e.target[e.type]&&(s.disabled=!0,typeof e.target[e.type]=="function"&&e.target[e.type](),s.disabled=!1)}return!e.defaultPrevented}function ku(i,e,t){if(Array.isArray(e))return $f(ku,i,e,t);const n=function(){Fn(i,e,n),t.apply(this,arguments)};n.guid=t.guid=t.guid||xi(),pi(i,e,n)}function Hf(i,e,t){const n=function(){Fn(i,e,n),t.apply(this,arguments)};n.guid=t.guid=t.guid||xi(),pi(i,e,n)}var YD=Object.freeze({__proto__:null,fixEvent:bu,on:pi,off:Fn,trigger:Ra,one:ku,any:Hf});const Ei=30,Ht=function(i,e,t){e.guid||(e.guid=xi());const n=e.bind(i);return n.guid=t?t+"_"+e.guid:e.guid,n},ar=function(i,e){let t=te.performance.now();return function(...r){const s=te.performance.now();s-t>=e&&(i(...r),t=s)}},j1=function(i,e,t,n=te){let r;const s=()=>{n.clearTimeout(r),r=null},a=function(){const o=this,c=arguments;let u=function(){r=null,u=null,t||i.apply(o,c)};!r&&t&&i.apply(o,c),n.clearTimeout(r),r=n.setTimeout(u,e)};return a.cancel=s,a};var JD=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:Ei,bind_:Ht,throttle:ar,debounce:j1});let al;class mi{on(e,t){const n=this.addEventListener;this.addEventListener=()=>{},pi(this,e,t),this.addEventListener=n}off(e,t){Fn(this,e,t)}one(e,t){const n=this.addEventListener;this.addEventListener=()=>{},ku(this,e,t),this.addEventListener=n}any(e,t){const n=this.addEventListener;this.addEventListener=()=>{},Hf(this,e,t),this.addEventListener=n}trigger(e){const t=e.type||e;typeof e=="string"&&(e={type:t}),e=bu(e),this.allowedEvents_[t]&&this["on"+t]&&this["on"+t](e),Ra(this,e)}queueTrigger(e){al||(al=new Map);const t=e.type||e;let n=al.get(this);n||(n=new Map,al.set(this,n));const r=n.get(t);n.delete(t),te.clearTimeout(r);const s=te.setTimeout(()=>{n.delete(t),n.size===0&&(n=null,al.delete(this)),this.trigger(e)},0);n.set(t,s)}}mi.prototype.allowedEvents_={},mi.prototype.addEventListener=mi.prototype.on,mi.prototype.removeEventListener=mi.prototype.off,mi.prototype.dispatchEvent=mi.prototype.trigger;const Tu=i=>typeof i.name=="function"?i.name():typeof i.name=="string"?i.name:i.name_?i.name_:i.constructor&&i.constructor.name?i.constructor.name:typeof i,Ir=i=>i instanceof mi||!!i.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof i[e]=="function"),QD=(i,e)=>{Ir(i)?e():(i.eventedCallbacks||(i.eventedCallbacks=[]),i.eventedCallbacks.push(e))},qf=i=>typeof i=="string"&&/\S/.test(i)||Array.isArray(i)&&!!i.length,Su=(i,e,t)=>{if(!i||!i.nodeName&&!Ir(i))throw new Error(`Invalid target for ${Tu(e)}#${t}; must be a DOM node or evented object.`)},$1=(i,e,t)=>{if(!qf(i))throw new Error(`Invalid event type for ${Tu(e)}#${t}; must be a non-empty string or array.`)},H1=(i,e,t)=>{if(typeof i!="function")throw new Error(`Invalid listener for ${Tu(e)}#${t}; must be a function.`)},zf=(i,e,t)=>{const n=e.length<3||e[0]===i||e[0]===i.eventBusEl_;let r,s,a;return n?(r=i.eventBusEl_,e.length>=3&&e.shift(),[s,a]=e):(r=e[0],s=e[1],a=e[2]),Su(r,i,t),$1(s,i,t),H1(a,i,t),a=Ht(i,a),{isTargetingSelf:n,target:r,type:s,listener:a}},Bs=(i,e,t,n)=>{Su(i,i,e),i.nodeName?YD[e](i,t,n):i[e](t,n)},ZD={on(...i){const{isTargetingSelf:e,target:t,type:n,listener:r}=zf(this,i,"on");if(Bs(t,"on",n,r),!e){const s=()=>this.off(t,n,r);s.guid=r.guid;const a=()=>this.off("dispose",s);a.guid=r.guid,Bs(this,"on","dispose",s),Bs(t,"on","dispose",a)}},one(...i){const{isTargetingSelf:e,target:t,type:n,listener:r}=zf(this,i,"one");if(e)Bs(t,"one",n,r);else{const s=(...a)=>{this.off(t,n,s),r.apply(null,a)};s.guid=r.guid,Bs(t,"one",n,s)}},any(...i){const{isTargetingSelf:e,target:t,type:n,listener:r}=zf(this,i,"any");if(e)Bs(t,"any",n,r);else{const s=(...a)=>{this.off(t,n,s),r.apply(null,a)};s.guid=r.guid,Bs(t,"any",n,s)}},off(i,e,t){if(!i||qf(i))Fn(this.eventBusEl_,i,e);else{const n=i,r=e;Su(n,this,"off"),$1(r,this,"off"),H1(t,this,"off"),t=Ht(this,t),this.off("dispose",t),n.nodeName?(Fn(n,r,t),Fn(n,"dispose",t)):Ir(n)&&(n.off(r,t),n.off("dispose",t))}},trigger(i,e){Su(this.eventBusEl_,this,"trigger");const t=i&&typeof i!="string"?i.type:i;if(!qf(t))throw new Error(`Invalid event type for ${Tu(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return Ra(this.eventBusEl_,i,e)}};function Gf(i,e={}){const{eventBusKey:t}=e;if(t){if(!i[t].nodeName)throw new Error(`The eventBusKey "${t}" does not refer to an element.`);i.eventBusEl_=i[t]}else i.eventBusEl_=ot("span",{className:"vjs-event-bus"});return Object.assign(i,ZD),i.eventedCallbacks&&i.eventedCallbacks.forEach(n=>{n()}),i.on("dispose",()=>{i.off(),[i,i.el_,i.eventBusEl_].forEach(function(n){n&&Kn.has(n)&&Kn.delete(n)}),te.setTimeout(()=>{i.eventBusEl_=null},0)}),i}const eA={state:{},setState(i){typeof i=="function"&&(i=i());let e;return Ea(i,(t,n)=>{this.state[n]!==t&&(e=e||{},e[n]={from:this.state[n],to:t}),this.state[n]=t}),e&&Ir(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function q1(i,e){return Object.assign(i,eA),i.state=Object.assign({},i.state,e),typeof i.handleStateChanged=="function"&&Ir(i)&&i.on("statechanged",i.handleStateChanged),i}const ol=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toLowerCase())},an=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toUpperCase())},z1=function(i,e){return an(i)===an(e)};var tA=Object.freeze({__proto__:null,toLowerCase:ol,toTitleCase:an,titleCaseEquals:z1});class Ee{constructor(e,t,n){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=Ot({},this.options_),t=this.options_=Ot(this.options_,t),this.id_=t.id||t.el&&t.el.id,!this.id_){const r=e&&e.id&&e.id()||"no_player";this.id_=`${r}_component_${xi()}`}this.name_=t.name||null,t.el?this.el_=t.el:t.createEl!==!1&&(this.el_=this.createEl()),t.className&&this.el_&&t.className.split(" ").forEach(r=>this.addClass(r)),["on","off","one","any","trigger"].forEach(r=>{this[r]=void 0}),t.evented!==!1&&(Gf(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),q1(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,t.initChildren!==!1&&this.initChildren(),this.ready(n),t.reportTouchActivity!==!1&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let t=this.children_.length-1;t>=0;t--)this.children_[t].dispose&&this.children_[t].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(e){return e?(this.options_=Ot(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,t,n){return ot(e,t,n)}localize(e,t,n=e){const r=this.player_.language&&this.player_.language(),s=this.player_.languages&&this.player_.languages(),a=s&&s[r],o=r&&r.split("-")[0],c=s&&s[o];let u=n;return a&&a[e]?u=a[e]:c&&c[e]&&(u=c[e]),t&&(u=u.replace(/\{(\d+)\}/g,function(d,h){const b=t[h-1];let v=b;return typeof b>"u"&&(v=d),v})),u}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce((n,r)=>n.concat(r),[]);let t=this;for(let n=0;n<e.length;n++)if(t=t.getChild(e[n]),!t||!t.getChild)return;return t}setIcon(e,t=this.el()){if(!this.player_.options_.experimentalSvgIcons)return;const n="http://www.w3.org/2000/svg",r=ot("span",{className:"vjs-icon-placeholder vjs-svg-icon"},{"aria-hidden":"true"}),s=Fe.createElementNS(n,"svg");s.setAttributeNS(null,"viewBox","0 0 512 512");const a=Fe.createElementNS(n,"use");return s.appendChild(a),a.setAttributeNS(null,"href",`#vjs-icon-${e}`),r.appendChild(s),this.iconIsSet_?t.replaceChild(r,t.querySelector(".vjs-icon-placeholder")):t.appendChild(r),this.iconIsSet_=!0,r}addChild(e,t={},n=this.children_.length){let r,s;if(typeof e=="string"){s=an(e);const a=t.componentClass||s;t.name=s;const o=Ee.getComponent(a);if(!o)throw new Error(`Component ${a} does not exist`);if(typeof o!="function")return null;r=new o(this.player_||this,t)}else r=e;if(r.parentComponent_&&r.parentComponent_.removeChild(r),this.children_.splice(n,0,r),r.parentComponent_=this,typeof r.id=="function"&&(this.childIndex_[r.id()]=r),s=s||r.name&&an(r.name()),s&&(this.childNameIndex_[s]=r,this.childNameIndex_[ol(s)]=r),typeof r.el=="function"&&r.el()){let a=null;this.children_[n+1]&&(this.children_[n+1].el_?a=this.children_[n+1].el_:Na(this.children_[n+1])&&(a=this.children_[n+1])),this.contentEl().insertBefore(r.el(),a)}return r}removeChild(e){if(typeof e=="string"&&(e=this.getChild(e)),!e||!this.children_)return;let t=!1;for(let r=this.children_.length-1;r>=0;r--)if(this.children_[r]===e){t=!0,this.children_.splice(r,1);break}if(!t)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[an(e.name())]=null,this.childNameIndex_[ol(e.name())]=null;const n=e.el();n&&n.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const t=this.options_,n=a=>{const o=a.name;let c=a.opts;if(t[o]!==void 0&&(c=t[o]),c===!1)return;c===!0&&(c={}),c.playerOptions=this.options_.playerOptions;const u=this.addChild(o,c);u&&(this[o]=u)};let r;const s=Ee.getComponent("Tech");Array.isArray(e)?r=e:r=Object.keys(e),r.concat(Object.keys(this.options_).filter(function(a){return!r.some(function(o){return typeof o=="string"?a===o:a===o.name})})).map(a=>{let o,c;return typeof a=="string"?(o=a,c=e[o]||this.options_[o]||{}):(o=a.name,c=a),{name:o,opts:c}}).filter(a=>{const o=Ee.getComponent(a.opts.componentClass||an(a.name));return o&&!s.isTech(o)}).forEach(n)}}buildCSSClass(){return""}ready(e,t=!1){if(e){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(e);return}t?e.call(this):this.setTimeout(e,1)}}triggerReady(){this.isReady_=!0,this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(t){t.call(this)},this),this.trigger("ready")},1)}$(e,t){return as(e,t||this.contentEl())}$$(e,t){return M1(e,t||this.contentEl())}hasClass(e){return il(this.el_,e)}addClass(...e){Ls(this.el_,...e)}removeClass(...e){mu(this.el_,...e)}toggleClass(e,t){E1(this.el_,e,t)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return D1(this.el_,e)}setAttribute(e,t){Pa(this.el_,e,t)}removeAttribute(e){gu(this.el_,e)}width(e,t){return this.dimension("width",e,t)}height(e,t){return this.dimension("height",e,t)}dimensions(e,t){this.width(e,!0),this.height(t)}dimension(e,t,n){if(t!==void 0){(t===null||t!==t)&&(t=0),(""+t).indexOf("%")!==-1||(""+t).indexOf("px")!==-1?this.el_.style[e]=t:t==="auto"?this.el_.style[e]="":this.el_.style[e]=t+"px",n||this.trigger("componentresize");return}if(!this.el_)return 0;const r=this.el_.style[e],s=r.indexOf("px");return parseInt(s!==-1?r.slice(0,s):this.el_["offset"+an(e)],10)}currentDimension(e){let t=0;if(e!=="width"&&e!=="height")throw new Error("currentDimension only accepts width or height value");if(t=Ma(this.el_,e),t=parseFloat(t),t===0||isNaN(t)){const n=`offset${an(e)}`;t=this.el_[n]}return t}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){const e=this.el_.getBoundingClientRect(),t={x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},n={x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2};return{boundingClientRect:t,center:n}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(e.key!=="Tab"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)&&e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,t=null;const n=10,r=200;let s;this.on("touchstart",function(o){o.touches.length===1&&(t={pageX:o.touches[0].pageX,pageY:o.touches[0].pageY},e=te.performance.now(),s=!0)}),this.on("touchmove",function(o){if(o.touches.length>1)s=!1;else if(t){const c=o.touches[0].pageX-t.pageX,u=o.touches[0].pageY-t.pageY;Math.sqrt(c*c+u*u)>n&&(s=!1)}});const a=function(){s=!1};this.on("touchleave",a),this.on("touchcancel",a),this.on("touchend",function(o){t=null,s===!0&&te.performance.now()-e<r&&(o.preventDefault(),this.trigger("tap"))})}enableTouchActivity(){if(!this.player()||!this.player().reportUserActivity)return;const e=Ht(this.player(),this.player().reportUserActivity);let t;this.on("touchstart",function(){e(),this.clearInterval(t),t=this.setInterval(e,250)});const n=function(r){e(),this.clearInterval(t)};this.on("touchmove",e),this.on("touchend",n),this.on("touchcancel",n)}setTimeout(e,t){var n;return e=Ht(this,e),this.clearTimersOnDispose_(),n=te.setTimeout(()=>{this.setTimeoutIds_.has(n)&&this.setTimeoutIds_.delete(n),e()},t),this.setTimeoutIds_.add(n),n}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),te.clearTimeout(e)),e}setInterval(e,t){e=Ht(this,e),this.clearTimersOnDispose_();const n=te.setInterval(e,t);return this.setIntervalIds_.add(n),n}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),te.clearInterval(e)),e}requestAnimationFrame(e){this.clearTimersOnDispose_();var t;return e=Ht(this,e),t=te.requestAnimationFrame(()=>{this.rafIds_.has(t)&&this.rafIds_.delete(t),e()}),this.rafIds_.add(t),t}requestNamedAnimationFrame(e,t){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),t=Ht(this,t);const n=this.requestAnimationFrame(()=>{t(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,n),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),te.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,t])=>{this[e].forEach((n,r)=>this[t](r))}),this.clearingTimersOnDispose_=!1}))}getIsDisabled(){return!!this.el_.disabled}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){function t(s){const a=te.getComputedStyle(s,null),o=a.getPropertyValue("visibility");return a.getPropertyValue("display")!=="none"&&!["hidden","collapse"].includes(o)}function n(s){return!(!t(s.parentElement)||!t(s)||s.style.opacity==="0"||te.getComputedStyle(s).height==="0px"||te.getComputedStyle(s).width==="0px")}function r(s){if(s.offsetWidth+s.offsetHeight+s.getBoundingClientRect().height+s.getBoundingClientRect().width===0)return!1;const a={x:s.getBoundingClientRect().left+s.offsetWidth/2,y:s.getBoundingClientRect().top+s.offsetHeight/2};if(a.x<0||a.x>(Fe.documentElement.clientWidth||te.innerWidth)||a.y<0||a.y>(Fe.documentElement.clientHeight||te.innerHeight))return!1;let o=Fe.elementFromPoint(a.x,a.y);for(;o;){if(o===s)return!0;if(o.parentNode)o=o.parentNode;else return!1}}return e||(e=this.el()),!!(r(e)&&n(e)&&(!e.parentElement||e.tabIndex>=0))}static registerComponent(e,t){if(typeof e!="string"||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const n=Ee.getComponent("Tech"),r=n&&n.isTech(t),s=Ee===t||Ee.prototype.isPrototypeOf(t.prototype);if(r||!s){let o;throw r?o="techs must be registered using Tech.registerTech()":o="must be a Component subclass",new Error(`Illegal component, "${e}"; ${o}.`)}e=an(e),Ee.components_||(Ee.components_={});const a=Ee.getComponent("Player");if(e==="Player"&&a&&a.players){const o=a.players,c=Object.keys(o);if(o&&c.length>0){for(let u=0;u<c.length;u++)if(o[c[u]]!==null)throw new Error("Can not register Player component after player has been created.")}}return Ee.components_[e]=t,Ee.components_[ol(e)]=t,t}static getComponent(e){if(!(!e||!Ee.components_))return Ee.components_[e]}}Ee.registerComponent("Component",Ee);function nA(i,e,t){if(typeof e!="number"||e<0||e>t)throw new Error(`Failed to execute '${i}' on 'TimeRanges': The index provided (${e}) is non-numeric or out of bounds (0-${t}).`)}function G1(i,e,t,n){return nA(i,n,t.length-1),t[n][e]}function Wf(i){let e;return i===void 0||i.length===0?e={length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:e={length:i.length,start:G1.bind(null,"start",0,i),end:G1.bind(null,"end",1,i)},te.Symbol&&te.Symbol.iterator&&(e[te.Symbol.iterator]=()=>(i||[]).values()),e}function $i(i,e){return Array.isArray(i)?Wf(i):i===void 0||e===void 0?Wf():Wf([[i,e]])}const W1=function(i,e){i=i<0?0:i;let t=Math.floor(i%60),n=Math.floor(i/60%60),r=Math.floor(i/3600);const s=Math.floor(e/60%60),a=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(r=n=t="-"),r=r>0||a>0?r+":":"",n=((r||s>=10)&&n<10?"0"+n:n)+":",t=t<10?"0"+t:t,r+n+t};let Kf=W1;function K1(i){Kf=i}function X1(){Kf=W1}function Us(i,e=i){return Kf(i,e)}var iA=Object.freeze({__proto__:null,createTimeRanges:$i,createTimeRange:$i,setFormatTime:K1,resetFormatTime:X1,formatTime:Us});function Y1(i,e){let t=0,n,r;if(!e)return 0;(!i||!i.length)&&(i=$i(0,0));for(let s=0;s<i.length;s++)n=i.start(s),r=i.end(s),r>e&&(r=e),t+=r-n;return t/e}function Zt(i){if(i instanceof Zt)return i;typeof i=="number"?this.code=i:typeof i=="string"?this.message=i:rr(i)&&(typeof i.code=="number"&&(this.code=i.code),Object.assign(this,i)),this.message||(this.message=Zt.defaultMessages[this.code]||"")}Zt.prototype.code=0,Zt.prototype.message="",Zt.prototype.status=null,Zt.prototype.metadata=null,Zt.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Zt.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."},Zt.MEDIA_ERR_CUSTOM=0,Zt.prototype.MEDIA_ERR_CUSTOM=0,Zt.MEDIA_ERR_ABORTED=1,Zt.prototype.MEDIA_ERR_ABORTED=1,Zt.MEDIA_ERR_NETWORK=2,Zt.prototype.MEDIA_ERR_NETWORK=2,Zt.MEDIA_ERR_DECODE=3,Zt.prototype.MEDIA_ERR_DECODE=3,Zt.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Zt.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Zt.MEDIA_ERR_ENCRYPTED=5,Zt.prototype.MEDIA_ERR_ENCRYPTED=5;function ll(i){return i!=null&&typeof i.then=="function"}function or(i){ll(i)&&i.then(null,e=>{})}const Xf=function(i){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((t,n,r)=>(i[n]&&(t[n]=i[n]),t),{cues:i.cues&&Array.prototype.map.call(i.cues,function(t){return{startTime:t.startTime,endTime:t.endTime,text:t.text,id:t.id}})})};var Yf={textTracksToJson:function(i){const e=i.$$("track"),t=Array.prototype.map.call(e,r=>r.track);return Array.prototype.map.call(e,function(r){const s=Xf(r.track);return r.src&&(s.src=r.src),s}).concat(Array.prototype.filter.call(i.textTracks(),function(r){return t.indexOf(r)===-1}).map(Xf))},jsonToTextTracks:function(i,e){return i.forEach(function(t){const n=e.addRemoteTextTrack(t).track;!t.src&&t.cues&&t.cues.forEach(r=>n.addCue(r))}),e.textTracks()},trackToJson:Xf};const Jf="vjs-modal-dialog";class La extends Ee{constructor(e,t){super(e,t),this.handleKeyDown_=n=>this.handleKeyDown(n),this.close_=n=>this.close(n),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=ot("div",{className:`${Jf}-content`},{role:"document"}),this.descEl_=ot("p",{className:`${Jf}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),rs(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${Jf} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_){this.options_.fillAlways&&this.fill();return}const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return typeof e=="boolean"&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if(typeof e=="boolean"){const t=this.closeable_=!!e;let n=this.getChild("closeButton");if(t&&!n){const r=this.contentEl_;this.contentEl_=this.el_,n=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=r,this.on(n,"close",this.close_)}!t&&n&&(this.off(n,"close",this.close_),this.removeChild(n),n.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const t=this.contentEl(),n=t.parentNode,r=t.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,n.removeChild(t),this.empty(),O1(t,e),this.trigger("modalfill"),r?n.insertBefore(t,r):n.appendChild(t);const s=this.getChild("closeButton");s&&n.appendChild(s.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),yu(this.contentEl()),this.trigger("modalempty")}content(e){return typeof e<"u"&&(this.content_=e),this.content_}conditionalFocus_(){const e=Fe.activeElement,t=this.player_.el_;this.previouslyActiveEl_=null,(t.contains(e)||t===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),e.key==="Escape"&&this.closeable()){e.preventDefault(),this.close();return}if(e.key!=="Tab")return;const t=this.focusableEls_(),n=this.el_.querySelector(":focus");let r;for(let s=0;s<t.length;s++)if(n===t[s]){r=s;break}Fe.activeElement===this.el_&&(r=0),e.shiftKey&&r===0?(t[t.length-1].focus(),e.preventDefault()):!e.shiftKey&&r===t.length-1&&(t[0].focus(),e.preventDefault())}focusableEls_(){const e=this.el_.querySelectorAll("*");return Array.prototype.filter.call(e,t=>(t instanceof te.HTMLAnchorElement||t instanceof te.HTMLAreaElement)&&t.hasAttribute("href")||(t instanceof te.HTMLInputElement||t instanceof te.HTMLSelectElement||t instanceof te.HTMLTextAreaElement||t instanceof te.HTMLButtonElement)&&!t.hasAttribute("disabled")||t instanceof te.HTMLIFrameElement||t instanceof te.HTMLObjectElement||t instanceof te.HTMLEmbedElement||t.hasAttribute("tabindex")&&t.getAttribute("tabindex")!==-1||t.hasAttribute("contenteditable"))}}La.prototype.options_={pauseOnOpen:!0,temporary:!0},Ee.registerComponent("ModalDialog",La);class Fs extends mi{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let t=0;t<e.length;t++)this.addTrack(e[t])}addTrack(e){const t=this.tracks_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.tracks_[t]}}),this.tracks_.indexOf(e)===-1&&(this.tracks_.push(e),this.trigger({track:e,type:"addtrack",target:this})),e.labelchange_=()=>{this.trigger({track:e,type:"labelchange",target:this})},Ir(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let t;for(let n=0,r=this.length;n<r;n++)if(this[n]===e){t=this[n],t.off&&t.off(),this.tracks_.splice(n,1);break}t&&this.trigger({track:t,type:"removetrack",target:this})}getTrackById(e){let t=null;for(let n=0,r=this.length;n<r;n++){const s=this[n];if(s.id===e){t=s;break}}return t}}Fs.prototype.allowedEvents_={change:"change",addtrack:"addtrack",removetrack:"removetrack",labelchange:"labelchange"};for(const i in Fs.prototype.allowedEvents_)Fs.prototype["on"+i]=null;const Qf=function(i,e){for(let t=0;t<i.length;t++)!Object.keys(i[t]).length||e.id===i[t].id||(i[t].enabled=!1)};class J1 extends Fs{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].enabled){Qf(e,e[t]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&Qf(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,Qf(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}}const Zf=function(i,e){for(let t=0;t<i.length;t++)!Object.keys(i[t]).length||e.id===i[t].id||(i[t].selected=!1)};class Q1 extends Fs{constructor(e=[]){for(let t=e.length-1;t>=0;t--)if(e[t].selected){Zf(e,e[t]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let t=0;t<this.length;t++)if(this[t].selected)return t;return-1},set(){}})}addTrack(e){e.selected&&Zf(this,e),super.addTrack(e),e.addEventListener&&(e.selectedChange_=()=>{this.changing_||(this.changing_=!0,Zf(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}}class ep extends Fs{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),["metadata","chapters"].indexOf(e.kind)===-1&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}toJSON(){return this.tracks_.map(e=>e.toJSON())}}class rA{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let t=0,n=e.length;t<n;t++)this.addTrackElement_(e[t])}addTrackElement_(e){const t=this.trackElements_.length;""+t in this||Object.defineProperty(this,t,{get(){return this.trackElements_[t]}}),this.trackElements_.indexOf(e)===-1&&this.trackElements_.push(e)}getTrackElementByTrack_(e){let t;for(let n=0,r=this.trackElements_.length;n<r;n++)if(e===this.trackElements_[n].track){t=this.trackElements_[n];break}return t}removeTrackElement_(e){for(let t=0,n=this.trackElements_.length;t<n;t++)if(e===this.trackElements_[t]){this.trackElements_[t].track&&typeof this.trackElements_[t].track.off=="function"&&this.trackElements_[t].track.off(),typeof this.trackElements_[t].off=="function"&&this.trackElements_[t].off(),this.trackElements_.splice(t,1);break}}}class Cu{constructor(e){Cu.prototype.setCues_.call(this,e),Object.defineProperty(this,"length",{get(){return this.length_}})}setCues_(e){const t=this.length||0;let n=0;const r=e.length;this.cues_=e,this.length_=e.length;const s=function(a){""+a in this||Object.defineProperty(this,""+a,{get(){return this.cues_[a]}})};if(t<r)for(n=t;n<r;n++)s.call(this,n)}getCueById(e){let t=null;for(let n=0,r=this.length;n<r;n++){const s=this[n];if(s.id===e){t=s;break}}return t}}const sA={alternative:"alternative",captions:"captions",main:"main",sign:"sign",subtitles:"subtitles",commentary:"commentary"},aA={alternative:"alternative",descriptions:"descriptions",main:"main","main-desc":"main-desc",translation:"translation",commentary:"commentary"},oA={subtitles:"subtitles",captions:"captions",descriptions:"descriptions",chapters:"chapters",metadata:"metadata"},Z1={disabled:"disabled",hidden:"hidden",showing:"showing"};class tp extends mi{constructor(e={}){super();const t={id:e.id||"vjs_track_"+xi(),kind:e.kind||"",language:e.language||""};let n=e.label||"";for(const r in t)Object.defineProperty(this,r,{get(){return t[r]},set(){}});Object.defineProperty(this,"label",{get(){return n},set(r){r!==n&&(n=r,this.trigger("labelchange"))}})}}const np=function(i){return new URL(i,Fe.baseURI)},eb=function(i){return new URL(i,Fe.baseURI).href},ip=function(i){if(typeof i=="string"){const t=i.split("?")[0].replace(/\/+$/,"").match(/\.([^.\/]+)$/);return t?t[1].toLowerCase():""}return""},xu=function(i,e=te.location){return np(i).origin!==e.origin};var lA=Object.freeze({__proto__:null,parseUrl:np,getAbsoluteURL:eb,getFileExtension:ip,isCrossOrigin:xu});const tb=function(i,e){const t=new te.WebVTT.Parser(te,te.vttjs,te.WebVTT.StringDecoder()),n=[];t.oncue=function(r){e.addCue(r)},t.onparsingerror=function(r){n.push(r)},t.onflush=function(){e.trigger({type:"loadeddata",target:e})},t.parse(i),n.length>0&&(te.console&&te.console.groupCollapsed&&te.console.groupCollapsed(`Text Track parsing errors for ${e.src}`),n.forEach(r=>_t.error(r)),te.console&&te.console.groupEnd&&te.console.groupEnd()),t.flush()},nb=function(i,e){const t={uri:i},n=xu(i);n&&(t.cors=n);const r=e.tech_.crossOrigin()==="use-credentials";r&&(t.withCredentials=r),Sy(t,Ht(this,function(s,a,o){if(s)return _t.error(s,a);e.loaded_=!0,typeof te.WebVTT!="function"?e.tech_&&e.tech_.any(["vttjsloaded","vttjserror"],c=>{if(c.type==="vttjserror"){_t.error(`vttjs failed to load, stopping trying to process ${e.src}`);return}return tb(o,e)}):tb(o,e)}))};class cl extends tp{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const t=Ot(e,{kind:oA[e.kind]||"subtitles",language:e.language||e.srclang||""});let n=Z1[t.mode]||"disabled";const r=t.default;(t.kind==="metadata"||t.kind==="chapters")&&(n="hidden"),super(t),this.tech_=t.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;const s=new Cu(this.cues_),a=new Cu(this.activeCues_);let o=!1;this.timeupdateHandler=Ht(this,function(u={}){if(!this.tech_.isDisposed()){if(!this.tech_.isReady_){u.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,o&&(this.trigger("cuechange"),o=!1),u.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});const c=()=>{this.stopTracking()};this.tech_.one("dispose",c),n!=="disabled"&&this.startTracking(),Object.defineProperties(this,{default:{get(){return r},set(){}},mode:{get(){return n},set(u){Z1[u]&&n!==u&&(n=u,!this.preload_&&n!=="disabled"&&this.cues.length===0&&nb(this.src,this),this.stopTracking(),n!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?s:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(this.cues.length===0)return a;const u=this.tech_.currentTime(),d=[];for(let h=0,b=this.cues.length;h<b;h++){const v=this.cues[h];v.startTime<=u&&v.endTime>=u&&d.push(v)}if(o=!1,d.length!==this.activeCues_.length)o=!0;else for(let h=0;h<d.length;h++)this.activeCues_.indexOf(d[h])===-1&&(o=!0);return this.activeCues_=d,a.setCues_(this.activeCues_),a},set(){}}}),t.src?(this.src=t.src,this.preload_||(this.loaded_=!0),(this.preload_||t.kind!=="subtitles"&&t.kind!=="captions")&&nb(this.src,this)):this.loaded_=!0}startTracking(){this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler),this.tech_.on("timeupdate",this.timeupdateHandler)}stopTracking(){this.rvf_&&(this.tech_.cancelVideoFrameCallback(this.rvf_),this.rvf_=void 0),this.tech_.off("timeupdate",this.timeupdateHandler)}addCue(e){let t=e;if(!("getCueAsHTML"in t)){t=new te.vttjs.VTTCue(e.startTime,e.endTime,e.text);for(const r in e)r in t||(t[r]=e[r]);t.id=e.id,t.originalCue_=e}const n=this.tech_.textTracks();for(let r=0;r<n.length;r++)n[r]!==this&&n[r].removeCue(t);this.cues_.push(t),this.cues.setCues_(this.cues_)}toJSON(){return Yf.trackToJson(this)}removeCue(e){let t=this.cues_.length;for(;t--;){const n=this.cues_[t];if(n===e||n.originalCue_&&n.originalCue_===e){this.cues_.splice(t,1),this.cues.setCues_(this.cues_);break}}}}cl.prototype.allowedEvents_={cuechange:"cuechange"};class ib extends tp{constructor(e={}){const t=Ot(e,{kind:aA[e.kind]||""});super(t);let n=!1;Object.defineProperty(this,"enabled",{get(){return n},set(r){typeof r!="boolean"||r===n||(n=r,this.trigger("enabledchange"))}}),t.enabled&&(this.enabled=t.enabled),this.loaded_=!0}}class rb extends tp{constructor(e={}){const t=Ot(e,{kind:sA[e.kind]||""});super(t);let n=!1;Object.defineProperty(this,"selected",{get(){return n},set(r){typeof r!="boolean"||r===n||(n=r,this.trigger("selectedchange"))}}),t.selected&&(this.selected=t.selected)}}class Nr extends mi{constructor(e={}){super();let t;const n=new cl(e);this.kind=n.kind,this.src=n.src,this.srclang=n.language,this.label=n.label,this.default=n.default,Object.defineProperties(this,{readyState:{get(){return t}},track:{get(){return n}}}),t=Nr.NONE,n.addEventListener("loadeddata",()=>{t=Nr.LOADED,this.trigger({type:"load",target:this})})}}Nr.prototype.allowedEvents_={load:"load"},Nr.NONE=0,Nr.LOADING=1,Nr.LOADED=2,Nr.ERROR=3;const wi={audio:{ListClass:J1,TrackClass:ib,capitalName:"Audio"},video:{ListClass:Q1,TrackClass:rb,capitalName:"Video"},text:{ListClass:ep,TrackClass:cl,capitalName:"Text"}};Object.keys(wi).forEach(function(i){wi[i].getterName=`${i}Tracks`,wi[i].privateName=`${i}Tracks_`});const Ba={remoteText:{ListClass:ep,TrackClass:cl,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:rA,TrackClass:Nr,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},Xn=Object.assign({},wi,Ba);Ba.names=Object.keys(Ba),wi.names=Object.keys(wi),Xn.names=[].concat(Ba.names).concat(wi.names);function cA(i,e,t,n,r={}){const s=i.textTracks();r.kind=e,t&&(r.label=t),n&&(r.language=n),r.tech=i;const a=new Xn.text.TrackClass(r);return s.addTrack(a),a}class gt extends Ee{constructor(e={},t=function(){}){e.reportTouchActivity=!1,super(null,e,t),this.onDurationChange_=n=>this.onDurationChange(n),this.trackProgress_=n=>this.trackProgress(n),this.trackCurrentTime_=n=>this.trackCurrentTime(n),this.stopTrackingCurrentTime_=n=>this.stopTrackingCurrentTime(n),this.disposeSourceHandler_=n=>this.disposeSourceHandler(n),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),Xn.names.forEach(n=>{const r=Xn[n];e&&e[r.getterName]&&(this[r.privateName]=e[r.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(n=>{e[`native${n}Tracks`]===!1&&(this[`featuresNative${n}Tracks`]=!1)}),e.nativeCaptions===!1||e.nativeTextTracks===!1?this.featuresNativeTextTracks=!1:(e.nativeCaptions===!0||e.nativeTextTracks===!0)&&(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=e.preloadTextTracks!==!1,this.autoRemoteTextTracks_=new Xn.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(Ht(this,function(){const t=this.bufferedPercent();this.bufferedPercent_!==t&&this.trigger("progress"),this.bufferedPercent_=t,t===1&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return $i(0,0)}bufferedPercent(){return Y1(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(wi.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){e=[].concat(e),e.forEach(t=>{const n=this[`${t}Tracks`]()||[];let r=n.length;for(;r--;){const s=n[r];t==="text"&&this.removeRemoteTextTrack(s),n.removeTrack(s)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let t=e.length;for(;t--;){const n=e[t];this.removeRemoteTextTrack(n)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return e!==void 0&&(this.error_=new Zt(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?$i(0,0):$i()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){wi.names.forEach(e=>{const t=wi[e],n=()=>{this.trigger(`${e}trackchange`)},r=this[t.getterName]();r.addEventListener("removetrack",n),r.addEventListener("addtrack",n),this.on("dispose",()=>{r.removeEventListener("removetrack",n),r.removeEventListener("addtrack",n)})})}addWebVttScript_(){if(!te.WebVTT)if(Fe.body.contains(this.el())){if(!this.options_["vtt.js"]&&wa(Dy)&&Object.keys(Dy).length>0){this.trigger("vttjsloaded");return}const e=Fe.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",()=>{e.onload=null,e.onerror=null}),te.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),t=this.remoteTextTracks(),n=o=>e.addTrack(o.track),r=o=>e.removeTrack(o.track);t.on("addtrack",n),t.on("removetrack",r),this.addWebVttScript_();const s=()=>this.trigger("texttrackchange"),a=()=>{s();for(let o=0;o<e.length;o++){const c=e[o];c.removeEventListener("cuechange",s),c.mode==="showing"&&c.addEventListener("cuechange",s)}};a(),e.addEventListener("change",a),e.addEventListener("addtrack",a),e.addEventListener("removetrack",a),this.on("dispose",function(){t.off("addtrack",n),t.off("removetrack",r),e.removeEventListener("change",a),e.removeEventListener("addtrack",a),e.removeEventListener("removetrack",a);for(let o=0;o<e.length;o++)e[o].removeEventListener("cuechange",s)})}addTextTrack(e,t,n){if(!e)throw new Error("TextTrack kind is required but was not provided");return cA(this,e,t,n)}createRemoteTextTrack(e){const t=Ot(e,{tech:this});return new Ba.remoteTextEl.TrackClass(t)}addRemoteTextTrack(e={},t){const n=this.createRemoteTextTrack(e);return typeof t!="boolean"&&(t=!1),this.remoteTextTrackEls().addTrackElement_(n),this.remoteTextTracks().addTrack(n.track),t===!1&&this.ready(()=>this.autoRemoteTextTracks_.addTrack(n.track)),n}removeRemoteTextTrack(e){const t=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(t),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const t=xi();return!this.isReady_||this.paused()?(this.queuedHanders_.add(t),this.one("playing",()=>{this.queuedHanders_.has(t)&&(this.queuedHanders_.delete(t),e())})):this.requestNamedAnimationFrame(t,e),t}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,t){return gt.canPlayType(e.type)}static isTech(e){return e.prototype instanceof gt||e instanceof gt||e===gt}static registerTech(e,t){if(gt.techs_||(gt.techs_={}),!gt.isTech(t))throw new Error(`Tech ${e} must be a Tech`);if(!gt.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!gt.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=an(e),gt.techs_[e]=t,gt.techs_[ol(e)]=t,e!=="Tech"&>.defaultTechOrder_.push(e),t}static getTech(e){if(e){if(gt.techs_&>.techs_[e])return gt.techs_[e];if(e=an(e),te&&te.videojs&&te.videojs[e])return _t.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),te.videojs[e]}}}Xn.names.forEach(function(i){const e=Xn[i];gt.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}}),gt.prototype.featuresVolumeControl=!0,gt.prototype.featuresMuteControl=!0,gt.prototype.featuresFullscreenResize=!1,gt.prototype.featuresPlaybackRate=!1,gt.prototype.featuresProgressEvents=!1,gt.prototype.featuresSourceset=!1,gt.prototype.featuresTimeupdateEvents=!1,gt.prototype.featuresNativeTextTracks=!1,gt.prototype.featuresVideoFrameCallback=!1,gt.withSourceHandlers=function(i){i.registerSourceHandler=function(t,n){let r=i.sourceHandlers;r||(r=i.sourceHandlers=[]),n===void 0&&(n=r.length),r.splice(n,0,t)},i.canPlayType=function(t){const n=i.sourceHandlers||[];let r;for(let s=0;s<n.length;s++)if(r=n[s].canPlayType(t),r)return r;return""},i.selectSourceHandler=function(t,n){const r=i.sourceHandlers||[];let s;for(let a=0;a<r.length;a++)if(s=r[a].canHandleSource(t,n),s)return r[a];return null},i.canPlaySource=function(t,n){const r=i.selectSourceHandler(t,n);return r?r.canHandleSource(t,n):""},["seekable","seeking","duration"].forEach(function(t){const n=this[t];typeof n=="function"&&(this[t]=function(){return this.sourceHandler_&&this.sourceHandler_[t]?this.sourceHandler_[t].apply(this.sourceHandler_,arguments):n.apply(this,arguments)})},i.prototype),i.prototype.setSource=function(t){let n=i.selectSourceHandler(t,this.options_);n||(i.nativeSourceHandler?n=i.nativeSourceHandler:_t.error("No source handler found for the current source.")),this.disposeSourceHandler(),this.off("dispose",this.disposeSourceHandler_),n!==i.nativeSourceHandler&&(this.currentSource_=t),this.sourceHandler_=n.handleSource(t,this,this.options_),this.one("dispose",this.disposeSourceHandler_)},i.prototype.disposeSourceHandler=function(){this.currentSource_&&(this.clearTracks(["audio","video"]),this.currentSource_=null),this.cleanupAutoTextTracks(),this.sourceHandler_&&(this.sourceHandler_.dispose&&this.sourceHandler_.dispose(),this.sourceHandler_=null)}},Ee.registerComponent("Tech",gt),gt.registerTech("Tech",gt),gt.defaultTechOrder_=[];const Vs={},Eu={},wu={};function uA(i,e){Vs[i]=Vs[i]||[],Vs[i].push(e)}function dA(i,e,t){i.setTimeout(()=>js(e,Vs[e.type],t,i),1)}function hA(i,e){i.forEach(t=>t.setTech&&t.setTech(e))}function fA(i,e,t){return i.reduceRight(rp(t),e[t]())}function pA(i,e,t,n){return e[t](i.reduce(rp(t),n))}function sb(i,e,t,n=null){const r="call"+an(t),s=i.reduce(rp(r),n),a=s===wu,o=a?null:e[t](s);return vA(i,t,o,a),o}const mA={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},gA={setCurrentTime:1,setMuted:1,setVolume:1},ab={play:1,pause:1};function rp(i){return(e,t)=>e===wu?wu:t[i]?t[i](e):e}function vA(i,e,t,n){for(let r=i.length-1;r>=0;r--){const s=i[r];s[e]&&s[e](n,t)}}function yA(i){Eu.hasOwnProperty(i.id())&&delete Eu[i.id()]}function bA(i,e){const t=Eu[i.id()];let n=null;if(t==null)return n=e(i),Eu[i.id()]=[[e,n]],n;for(let r=0;r<t.length;r++){const[s,a]=t[r];s===e&&(n=a)}return n===null&&(n=e(i),t.push([e,n])),n}function js(i={},e=[],t,n,r=[],s=!1){const[a,...o]=e;if(typeof a=="string")js(i,Vs[a],t,n,r,s);else if(a){const c=bA(n,a);if(!c.setSource)return r.push(c),js(i,o,t,n,r,s);c.setSource(Object.assign({},i),function(u,d){if(u)return js(i,o,t,n,r,s);r.push(c),js(d,i.type===d.type?o:Vs[d.type],t,n,r,s)})}else o.length?js(i,o,t,n,r,s):s?t(i,r):js(i,Vs["*"],t,n,r,!0)}const _A={opus:"video/ogg",ogv:"video/ogg",mp4:"video/mp4",mov:"video/mp4",m4v:"video/mp4",mkv:"video/x-matroska",m4a:"audio/mp4",mp3:"audio/mpeg",aac:"audio/aac",caf:"audio/x-caf",flac:"audio/flac",oga:"audio/ogg",wav:"audio/wav",m3u8:"application/x-mpegURL",mpd:"application/dash+xml",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",png:"image/png",svg:"image/svg+xml",webp:"image/webp"},Du=function(i=""){const e=ip(i);return _A[e.toLowerCase()]||""},kA=(i,e)=>{if(!e)return"";if(i.cache_.source.src===e&&i.cache_.source.type)return i.cache_.source.type;const t=i.cache_.sources.filter(r=>r.src===e);if(t.length)return t[0].type;const n=i.$$("source");for(let r=0;r<n.length;r++){const s=n[r];if(s.type&&s.src&&s.src===e)return s.type}return Du(e)},ob=function(i){if(Array.isArray(i)){let e=[];i.forEach(function(t){t=ob(t),Array.isArray(t)?e=e.concat(t):rr(t)&&e.push(t)}),i=e}else typeof i=="string"&&i.trim()?i=[lb({src:i})]:rr(i)&&typeof i.src=="string"&&i.src&&i.src.trim()?i=[lb(i)]:i=[];return i};function lb(i){if(!i.type){const e=Du(i.src);e&&(i.type=e)}return i}var TA=`<svg xmlns="http://www.w3.org/2000/svg">
|
58
|
+
<defs>
|
59
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-play">
|
60
|
+
<path d="M16 10v28l22-14z"></path>
|
61
|
+
</symbol>
|
62
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-pause">
|
63
|
+
<path d="M12 38h8V10h-8v28zm16-28v28h8V10h-8z"></path>
|
64
|
+
</symbol>
|
65
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-audio">
|
66
|
+
<path d="M24 2C14.06 2 6 10.06 6 20v14c0 3.31 2.69 6 6 6h6V24h-8v-4c0-7.73 6.27-14 14-14s14 6.27 14 14v4h-8v16h6c3.31 0 6-2.69 6-6V20c0-9.94-8.06-18-18-18z"></path>
|
67
|
+
</symbol>
|
68
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-captions">
|
69
|
+
<path d="M38 8H10c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h28c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM22 22h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2zm14 0h-3v-1h-4v6h4v-1h3v2a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2z"></path>
|
70
|
+
</symbol>
|
71
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-subtitles">
|
72
|
+
<path d="M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z"></path>
|
73
|
+
</symbol>
|
74
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-enter">
|
75
|
+
<path d="M14 28h-4v10h10v-4h-6v-6zm-4-8h4v-6h6v-4H10v10zm24 14h-6v4h10V28h-4v6zm-6-24v4h6v6h4V10H28z"></path>
|
76
|
+
</symbol>
|
77
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-fullscreen-exit">
|
78
|
+
<path d="M10 32h6v6h4V28H10v4zm6-16h-6v4h10V10h-4v6zm12 22h4v-6h6v-4H28v10zm4-22v-6h-4v10h10v-4h-6z"></path>
|
79
|
+
</symbol>
|
80
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-play-circle">
|
81
|
+
<path d="M20 33l12-9-12-9v18zm4-29C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>
|
82
|
+
</symbol>
|
83
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-volume-mute">
|
84
|
+
<path d="M33 24c0-3.53-2.04-6.58-5-8.05v4.42l4.91 4.91c.06-.42.09-.85.09-1.28zm5 0c0 1.88-.41 3.65-1.08 5.28l3.03 3.03C41.25 29.82 42 27 42 24c0-8.56-5.99-15.72-14-17.54v4.13c5.78 1.72 10 7.07 10 13.41zM8.55 6L6 8.55 15.45 18H6v12h8l10 10V26.55l8.51 8.51c-1.34 1.03-2.85 1.86-4.51 2.36v4.13a17.94 17.94 0 0 0 7.37-3.62L39.45 42 42 39.45l-18-18L8.55 6zM24 8l-4.18 4.18L24 16.36V8z"></path>
|
85
|
+
</symbol>
|
86
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-volume-low">
|
87
|
+
<path d="M14 18v12h8l10 10V8L22 18h-8z"></path>
|
88
|
+
</symbol>
|
89
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-volume-medium">
|
90
|
+
<path d="M37 24c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zm-27-6v12h8l10 10V8L18 18h-8z"></path>
|
91
|
+
</symbol>
|
92
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-volume-high">
|
93
|
+
<path d="M6 18v12h8l10 10V8L14 18H6zm27 6c0-3.53-2.04-6.58-5-8.05v16.11c2.96-1.48 5-4.53 5-8.06zM28 6.46v4.13c5.78 1.72 10 7.07 10 13.41s-4.22 11.69-10 13.41v4.13c8.01-1.82 14-8.97 14-17.54S36.01 8.28 28 6.46z"></path>
|
94
|
+
</symbol>
|
95
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-spinner">
|
96
|
+
<path d="M18.8 21l9.53-16.51C26.94 4.18 25.49 4 24 4c-4.8 0-9.19 1.69-12.64 4.51l7.33 12.69.11-.2zm24.28-3c-1.84-5.85-6.3-10.52-11.99-12.68L23.77 18h19.31zm.52 2H28.62l.58 1 9.53 16.5C41.99 33.94 44 29.21 44 24c0-1.37-.14-2.71-.4-4zm-26.53 4l-7.8-13.5C6.01 14.06 4 18.79 4 24c0 1.37.14 2.71.4 4h14.98l-2.31-4zM4.92 30c1.84 5.85 6.3 10.52 11.99 12.68L24.23 30H4.92zm22.54 0l-7.8 13.51c1.4.31 2.85.49 4.34.49 4.8 0 9.19-1.69 12.64-4.51L29.31 26.8 27.46 30z"></path>
|
97
|
+
</symbol>
|
98
|
+
<symbol viewBox="0 0 24 24" id="vjs-icon-hd">
|
99
|
+
<path d="M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-8 12H9.5v-2h-2v2H6V9h1.5v2.5h2V9H11v6zm2-6h4c.55 0 1 .45 1 1v4c0 .55-.45 1-1 1h-4V9zm1.5 4.5h2v-3h-2v3z"></path>
|
100
|
+
</symbol>
|
101
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-chapters">
|
102
|
+
<path d="M6 26h4v-4H6v4zm0 8h4v-4H6v4zm0-16h4v-4H6v4zm8 8h28v-4H14v4zm0 8h28v-4H14v4zm0-20v4h28v-4H14z"></path>
|
103
|
+
</symbol>
|
104
|
+
<symbol viewBox="0 0 40 40" id="vjs-icon-downloading">
|
105
|
+
<path d="M18.208 36.875q-3.208-.292-5.979-1.729-2.771-1.438-4.812-3.729-2.042-2.292-3.188-5.229-1.146-2.938-1.146-6.23 0-6.583 4.334-11.416 4.333-4.834 10.833-5.5v3.166q-5.167.75-8.583 4.646Q6.25 14.75 6.25 19.958q0 5.209 3.396 9.104 3.396 3.896 8.562 4.646zM20 28.417L11.542 20l2.083-2.083 4.917 4.916v-11.25h2.916v11.25l4.875-4.916L28.417 20zm1.792 8.458v-3.167q1.833-.25 3.541-.958 1.709-.708 3.167-1.875l2.333 2.292q-1.958 1.583-4.25 2.541-2.291.959-4.791 1.167zm6.791-27.792q-1.541-1.125-3.25-1.854-1.708-.729-3.541-1.021V3.042q2.5.25 4.77 1.208 2.271.958 4.271 2.5zm4.584 21.584l-2.25-2.25q1.166-1.5 1.854-3.209.687-1.708.937-3.541h3.209q-.292 2.5-1.229 4.791-.938 2.292-2.521 4.209zm.541-12.417q-.291-1.833-.958-3.562-.667-1.73-1.833-3.188l2.375-2.208q1.541 1.916 2.458 4.208.917 2.292 1.167 4.75z"></path>
|
106
|
+
</symbol>
|
107
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-file-download">
|
108
|
+
<path d="M10.8 40.55q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h26.35v-7.7h3.4v7.7q0 1.4-1 2.4t-2.4 1zM24 32.1L13.9 22.05l2.45-2.45 5.95 5.95V7.15h3.4v18.4l5.95-5.95 2.45 2.45z"></path>
|
109
|
+
</symbol>
|
110
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-file-download-done">
|
111
|
+
<path d="M9.8 40.5v-3.45h28.4v3.45zm9.2-9.05L7.4 19.85l2.45-2.35L19 26.65l19.2-19.2 2.4 2.4z"></path>
|
112
|
+
</symbol>
|
113
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-file-download-off">
|
114
|
+
<path d="M4.9 4.75L43.25 43.1 41 45.3l-4.75-4.75q-.05.05-.075.025-.025-.025-.075-.025H10.8q-1.35 0-2.375-1T7.4 37.15v-7.7h3.4v7.7h22.05l-7-7-1.85 1.8L13.9 21.9l1.85-1.85L2.7 7zm26.75 14.7l2.45 2.45-3.75 3.8-2.45-2.5zM25.7 7.15V21.1l-3.4-3.45V7.15z"></path>
|
115
|
+
</symbol>
|
116
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-share">
|
117
|
+
<path d="M36 32.17c-1.52 0-2.89.59-3.93 1.54L17.82 25.4c.11-.45.18-.92.18-1.4s-.07-.95-.18-1.4l14.1-8.23c1.07 1 2.5 1.62 4.08 1.62 3.31 0 6-2.69 6-6s-2.69-6-6-6-6 2.69-6 6c0 .48.07.95.18 1.4l-14.1 8.23c-1.07-1-2.5-1.62-4.08-1.62-3.31 0-6 2.69-6 6s2.69 6 6 6c1.58 0 3.01-.62 4.08-1.62l14.25 8.31c-.1.42-.16.86-.16 1.31A5.83 5.83 0 1 0 36 32.17z"></path>
|
118
|
+
</symbol>
|
119
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-cog">
|
120
|
+
<path d="M38.86 25.95c.08-.64.14-1.29.14-1.95s-.06-1.31-.14-1.95l4.23-3.31c.38-.3.49-.84.24-1.28l-4-6.93c-.25-.43-.77-.61-1.22-.43l-4.98 2.01c-1.03-.79-2.16-1.46-3.38-1.97L29 4.84c-.09-.47-.5-.84-1-.84h-8c-.5 0-.91.37-.99.84l-.75 5.3a14.8 14.8 0 0 0-3.38 1.97L9.9 10.1a1 1 0 0 0-1.22.43l-4 6.93c-.25.43-.14.97.24 1.28l4.22 3.31C9.06 22.69 9 23.34 9 24s.06 1.31.14 1.95l-4.22 3.31c-.38.3-.49.84-.24 1.28l4 6.93c.25.43.77.61 1.22.43l4.98-2.01c1.03.79 2.16 1.46 3.38 1.97l.75 5.3c.08.47.49.84.99.84h8c.5 0 .91-.37.99-.84l.75-5.3a14.8 14.8 0 0 0 3.38-1.97l4.98 2.01a1 1 0 0 0 1.22-.43l4-6.93c.25-.43.14-.97-.24-1.28l-4.22-3.31zM24 31c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"></path>
|
121
|
+
</symbol>
|
122
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-square">
|
123
|
+
<path d="M36 8H12c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h24c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zm0 28H12V12h24v24z"></path>
|
124
|
+
</symbol>
|
125
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-circle">
|
126
|
+
<circle cx="24" cy="24" r="20"></circle>
|
127
|
+
</symbol>
|
128
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-circle-outline">
|
129
|
+
<path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16z"></path>
|
130
|
+
</symbol>
|
131
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-circle-inner-circle">
|
132
|
+
<path d="M24 4C12.97 4 4 12.97 4 24s8.97 20 20 20 20-8.97 20-20S35.03 4 24 4zm0 36c-8.82 0-16-7.18-16-16S15.18 8 24 8s16 7.18 16 16-7.18 16-16 16zm6-16c0 3.31-2.69 6-6 6s-6-2.69-6-6 2.69-6 6-6 6 2.69 6 6z"></path>
|
133
|
+
</symbol>
|
134
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-cancel">
|
135
|
+
<path d="M24 4C12.95 4 4 12.95 4 24s8.95 20 20 20 20-8.95 20-20S35.05 4 24 4zm10 27.17L31.17 34 24 26.83 16.83 34 14 31.17 21.17 24 14 16.83 16.83 14 24 21.17 31.17 14 34 16.83 26.83 24 34 31.17z"></path>
|
136
|
+
</symbol>
|
137
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-replay">
|
138
|
+
<path d="M24 10V2L14 12l10 10v-8c6.63 0 12 5.37 12 12s-5.37 12-12 12-12-5.37-12-12H8c0 8.84 7.16 16 16 16s16-7.16 16-16-7.16-16-16-16z"></path>
|
139
|
+
</symbol>
|
140
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-repeat">
|
141
|
+
<path d="M14 14h20v6l8-8-8-8v6H10v12h4v-8zm20 20H14v-6l-8 8 8 8v-6h24V26h-4v8z"></path>
|
142
|
+
</symbol>
|
143
|
+
<symbol viewBox="0 96 48 48" id="vjs-icon-replay-5">
|
144
|
+
<path d="M17.689 98l-8.697 8.696 8.697 8.697 2.486-2.485-4.32-4.319h1.302c4.93 0 9.071 1.722 12.424 5.165 3.352 3.443 5.029 7.638 5.029 12.584h3.55c0-2.958-.553-5.73-1.658-8.313-1.104-2.583-2.622-4.841-4.555-6.774-1.932-1.932-4.19-3.45-6.773-4.555-2.584-1.104-5.355-1.657-8.313-1.657H15.5l4.615-4.615zm-8.08 21.659v13.861h11.357v5.008H9.609V143h12.7c.834 0 1.55-.298 2.146-.894.596-.597.895-1.31.895-2.145v-7.781c0-.835-.299-1.55-.895-2.147a2.929 2.929 0 0 0-2.147-.894h-8.227v-5.096H25.35v-4.384z"></path>
|
145
|
+
</symbol>
|
146
|
+
<symbol viewBox="0 96 48 48" id="vjs-icon-replay-10">
|
147
|
+
<path d="M42.315 125.63c0-4.997-1.694-9.235-5.08-12.713-3.388-3.479-7.571-5.218-12.552-5.218h-1.315l4.363 4.363-2.51 2.51-8.787-8.786L25.221 97l2.45 2.45-4.662 4.663h1.375c2.988 0 5.788.557 8.397 1.673 2.61 1.116 4.892 2.65 6.844 4.602 1.953 1.953 3.487 4.234 4.602 6.844 1.116 2.61 1.674 5.41 1.674 8.398zM8.183 142v-19.657H3.176V117.8h9.643V142zm13.63 0c-1.156 0-2.127-.393-2.912-1.178-.778-.778-1.168-1.746-1.168-2.902v-16.04c0-1.156.393-2.127 1.178-2.912.779-.779 1.746-1.168 2.902-1.168h7.696c1.156 0 2.126.392 2.911 1.177.779.78 1.168 1.747 1.168 2.903v16.04c0 1.156-.392 2.127-1.177 2.912-.779.779-1.746 1.168-2.902 1.168zm.556-4.636h6.583v-15.02H22.37z"></path>
|
148
|
+
</symbol>
|
149
|
+
<symbol viewBox="0 96 48 48" id="vjs-icon-replay-30">
|
150
|
+
<path d="M26.047 97l-8.733 8.732 8.733 8.733 2.496-2.494-4.336-4.338h1.307c4.95 0 9.108 1.73 12.474 5.187 3.367 3.458 5.051 7.668 5.051 12.635h3.565c0-2.97-.556-5.751-1.665-8.346-1.109-2.594-2.633-4.862-4.574-6.802-1.94-1.941-4.208-3.466-6.803-4.575-2.594-1.109-5.375-1.664-8.345-1.664H23.85l4.634-4.634zM2.555 117.531v4.688h10.297v5.25H5.873v4.687h6.979v5.156H2.555V142H13.36c1.061 0 1.95-.395 2.668-1.186.718-.79 1.076-1.772 1.076-2.94v-16.218c0-1.168-.358-2.149-1.076-2.94-.717-.79-1.607-1.185-2.668-1.185zm22.482.14c-1.149 0-2.11.39-2.885 1.165-.78.78-1.172 1.744-1.172 2.893v15.943c0 1.149.388 2.11 1.163 2.885.78.78 1.745 1.172 2.894 1.172h7.649c1.148 0 2.11-.388 2.884-1.163.78-.78 1.17-1.745 1.17-2.894v-15.943c0-1.15-.386-2.111-1.16-2.885-.78-.78-1.746-1.172-2.894-1.172zm.553 4.518h6.545v14.93H25.59z"></path>
|
151
|
+
</symbol>
|
152
|
+
<symbol viewBox="0 96 48 48" id="vjs-icon-forward-5">
|
153
|
+
<path d="M29.508 97l-2.431 2.43 4.625 4.625h-1.364c-2.965 0-5.742.554-8.332 1.66-2.589 1.107-4.851 2.629-6.788 4.566-1.937 1.937-3.458 4.2-4.565 6.788-1.107 2.59-1.66 5.367-1.66 8.331h3.557c0-4.957 1.68-9.16 5.04-12.611 3.36-3.45 7.51-5.177 12.451-5.177h1.304l-4.326 4.33 2.49 2.49 8.715-8.716zm-9.783 21.61v13.89h11.382v5.018H19.725V142h12.727a2.93 2.93 0 0 0 2.15-.896 2.93 2.93 0 0 0 .896-2.15v-7.798c0-.837-.299-1.554-.896-2.152a2.93 2.93 0 0 0-2.15-.896h-8.245V123h11.29v-4.392z"></path>
|
154
|
+
</symbol>
|
155
|
+
<symbol viewBox="0 96 48 48" id="vjs-icon-forward-10">
|
156
|
+
<path d="M23.119 97l-2.386 2.383 4.538 4.538h-1.339c-2.908 0-5.633.543-8.173 1.63-2.54 1.085-4.76 2.577-6.66 4.478-1.9 1.9-3.392 4.12-4.478 6.66-1.085 2.54-1.629 5.264-1.629 8.172h3.49c0-4.863 1.648-8.986 4.944-12.372 3.297-3.385 7.368-5.078 12.216-5.078h1.279l-4.245 4.247 2.443 2.442 8.55-8.55zm-9.52 21.45v4.42h4.871V142h4.513v-23.55zm18.136 0c-1.125 0-2.066.377-2.824 1.135-.764.764-1.148 1.709-1.148 2.834v15.612c0 1.124.38 2.066 1.139 2.824.764.764 1.708 1.145 2.833 1.145h7.489c1.125 0 2.066-.378 2.824-1.136.764-.764 1.145-1.709 1.145-2.833v-15.612c0-1.125-.378-2.067-1.136-2.825-.764-.764-1.708-1.145-2.833-1.145zm.54 4.42h6.408v14.617h-6.407z"></path>
|
157
|
+
</symbol>
|
158
|
+
<symbol viewBox="0 96 48 48" id="vjs-icon-forward-30">
|
159
|
+
<path d="M25.549 97l-2.437 2.434 4.634 4.635H26.38c-2.97 0-5.753.555-8.347 1.664-2.594 1.109-4.861 2.633-6.802 4.574-1.94 1.94-3.465 4.207-4.574 6.802-1.109 2.594-1.664 5.377-1.664 8.347h3.565c0-4.967 1.683-9.178 5.05-12.636 3.366-3.458 7.525-5.187 12.475-5.187h1.307l-4.335 4.338 2.495 2.494 8.732-8.732zm-11.553 20.53v4.689h10.297v5.249h-6.978v4.688h6.978v5.156H13.996V142h10.808c1.06 0 1.948-.395 2.666-1.186.718-.79 1.077-1.771 1.077-2.94v-16.217c0-1.169-.36-2.15-1.077-2.94-.718-.79-1.605-1.186-2.666-1.186zm21.174.168c-1.149 0-2.11.389-2.884 1.163-.78.78-1.172 1.745-1.172 2.894v15.942c0 1.15.388 2.11 1.162 2.885.78.78 1.745 1.17 2.894 1.17h7.649c1.149 0 2.11-.386 2.885-1.16.78-.78 1.17-1.746 1.17-2.895v-15.942c0-1.15-.387-2.11-1.161-2.885-.78-.78-1.745-1.172-2.894-1.172zm.552 4.516h6.542v14.931h-6.542z"></path>
|
160
|
+
</symbol>
|
161
|
+
<symbol viewBox="0 0 512 512" id="vjs-icon-audio-description">
|
162
|
+
<g fill-rule="evenodd"><path d="M227.29 381.351V162.993c50.38-1.017 89.108-3.028 117.631 17.126 27.374 19.342 48.734 56.965 44.89 105.325-4.067 51.155-41.335 94.139-89.776 98.475-24.085 2.155-71.972 0-71.972 0s-.84-1.352-.773-2.568m48.755-54.804c31.43 1.26 53.208-16.633 56.495-45.386 4.403-38.51-21.188-63.552-58.041-60.796v103.612c-.036 1.466.575 2.22 1.546 2.57"></path><path d="M383.78 381.328c13.336 3.71 17.387-11.06 23.215-21.408 12.722-22.571 22.294-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.226 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M425.154 381.328c13.336 3.71 17.384-11.061 23.215-21.408 12.721-22.571 22.291-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.511c-.586 3.874 2.226 7.315 3.866 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894"></path><path d="M466.26 381.328c13.337 3.71 17.385-11.061 23.216-21.408 12.722-22.571 22.292-51.594 22.445-84.774.221-47.594-18.343-82.517-35.6-106.182h-8.51c-.587 3.874 2.225 7.315 3.865 10.276 13.166 23.762 25.367 56.553 25.54 94.194.2 43.176-14.162 79.278-30.955 107.894M4.477 383.005H72.58l18.573-28.484 64.169-.135s.065 19.413.065 28.62h48.756V160.307h-58.816c-5.653 9.537-140.85 222.697-140.85 222.697zm152.667-145.282v71.158l-40.453-.27 40.453-70.888z"></path></g>
|
163
|
+
</symbol>
|
164
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-next-item">
|
165
|
+
<path d="M12 36l17-12-17-12v24zm20-24v24h4V12h-4z"></path>
|
166
|
+
</symbol>
|
167
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-previous-item">
|
168
|
+
<path d="M12 12h4v24h-4zm7 12l17 12V12z"></path>
|
169
|
+
</symbol>
|
170
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-shuffle">
|
171
|
+
<path d="M21.17 18.34L10.83 8 8 10.83l10.34 10.34 2.83-2.83zM29 8l4.09 4.09L8 37.17 10.83 40l25.09-25.09L40 19V8H29zm.66 18.83l-2.83 2.83 6.26 6.26L29 40h11V29l-4.09 4.09-6.25-6.26z"></path>
|
172
|
+
</symbol>
|
173
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-cast">
|
174
|
+
<path d="M42 6H6c-2.21 0-4 1.79-4 4v6h4v-6h36v28H28v4h14c2.21 0 4-1.79 4-4V10c0-2.21-1.79-4-4-4zM2 36v6h6c0-3.31-2.69-6-6-6zm0-8v4c5.52 0 10 4.48 10 10h4c0-7.73-6.27-14-14-14zm0-8v4c9.94 0 18 8.06 18 18h4c0-12.15-9.85-22-22-22z"></path>
|
175
|
+
</symbol>
|
176
|
+
<symbol viewBox="0 0 48 48" id="vjs-icon-picture-in-picture-enter">
|
177
|
+
<path d="M38 22H22v11.99h16V22zm8 16V9.96C46 7.76 44.2 6 42 6H6C3.8 6 2 7.76 2 9.96V38c0 2.2 1.8 4 4 4h36c2.2 0 4-1.8 4-4zm-4 .04H6V9.94h36v28.1z"></path>
|
178
|
+
</symbol>
|
179
|
+
<symbol viewBox="0 0 22 18" id="vjs-icon-picture-in-picture-exit">
|
180
|
+
<path d="M18 4H4v10h14V4zm4 12V1.98C22 .88 21.1 0 20 0H2C.9 0 0 .88 0 1.98V16c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2zm-2 .02H2V1.97h18v14.05z"></path>
|
181
|
+
<path fill="none" d="M-1-3h24v24H-1z"></path>
|
182
|
+
</symbol>
|
183
|
+
<symbol viewBox="0 0 1792 1792" id="vjs-icon-facebook">
|
184
|
+
<path d="M1343 12v264h-157q-86 0-116 36t-30 108v189h293l-39 296h-254v759H734V905H479V609h255V391q0-186 104-288.5T1115 0q147 0 228 12z"></path>
|
185
|
+
</symbol>
|
186
|
+
<symbol viewBox="0 0 1792 1792" id="vjs-icon-linkedin">
|
187
|
+
<path d="M477 625v991H147V625h330zm21-306q1 73-50.5 122T312 490h-2q-82 0-132-49t-50-122q0-74 51.5-122.5T314 148t133 48.5T498 319zm1166 729v568h-329v-530q0-105-40.5-164.5T1168 862q-63 0-105.5 34.5T999 982q-11 30-11 81v553H659q2-399 2-647t-1-296l-1-48h329v144h-2q20-32 41-56t56.5-52 87-43.5T1285 602q171 0 275 113.5t104 332.5z"></path>
|
188
|
+
</symbol>
|
189
|
+
<symbol viewBox="0 0 1200 1227" id="vjs-icon-twitter">
|
190
|
+
<path d="M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z"/>
|
191
|
+
</symbol>
|
192
|
+
<symbol viewBox="0 0 1792 1792" id="vjs-icon-tumblr">
|
193
|
+
<path d="M1328 1329l80 237q-23 35-111 66t-177 32q-104 2-190.5-26T787 1564t-95-106-55.5-120-16.5-118V676H452V461q72-26 129-69.5t91-90 58-102 34-99T779 12q1-5 4.5-8.5T791 0h244v424h333v252h-334v518q0 30 6.5 56t22.5 52.5 49.5 41.5 81.5 14q78-2 134-29z"></path>
|
194
|
+
</symbol>
|
195
|
+
<symbol viewBox="0 0 1792 1792" id="vjs-icon-pinterest">
|
196
|
+
<path d="M1664 896q0 209-103 385.5T1281.5 1561 896 1664q-111 0-218-32 59-93 78-164 9-34 54-211 20 39 73 67.5t114 28.5q121 0 216-68.5t147-188.5 52-270q0-114-59.5-214T1180 449t-255-63q-105 0-196 29t-154.5 77-109 110.5-67 129.5T377 866q0 104 40 183t117 111q30 12 38-20 2-7 8-31t8-30q6-23-11-43-51-61-51-151 0-151 104.5-259.5T904 517q151 0 235.5 82t84.5 213q0 170-68.5 289T980 1220q-61 0-98-43.5T859 1072q8-35 26.5-93.5t30-103T927 800q0-50-27-83t-77-33q-62 0-105 57t-43 142q0 73 25 122l-99 418q-17 70-13 177-206-91-333-281T128 896q0-209 103-385.5T510.5 231 896 128t385.5 103T1561 510.5 1664 896z"></path>
|
197
|
+
</symbol>
|
198
|
+
</defs>
|
199
|
+
</svg>`;const cb=du?10009:hu?461:8,Ua={codes:{play:415,pause:19,ff:417,rw:412,back:cb},names:{415:"play",19:"pause",417:"ff",412:"rw",[cb]:"back"},isEventKey(i,e){return e=e.toLowerCase(),!!(this.names[i.keyCode]&&this.names[i.keyCode]===e)},getEventName(i){if(this.names[i.keyCode])return this.names[i.keyCode];if(this.codes[i.code]){const e=this.codes[i.code];return this.names[e]}return null}},ub=5;class SA extends mi{constructor(e){super(),this.player_=e,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}start(){this.isListening_||(this.player_.on("keydown",this.onKeyDown_),this.player_.on("modalKeydown",this.onKeyDown_),this.player_.on("loadedmetadata",()=>{this.focus(this.updateFocusableComponents()[0])}),this.player_.on("modalclose",()=>{this.refocusComponent()}),this.player_.on("focusin",this.handlePlayerFocus_.bind(this)),this.player_.on("focusout",this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on("aftermodalfill",()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())}))}stop(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}onKeyDown_(e){const t=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(t.key)){if(this.isPaused_)return;t.preventDefault();const n=t.key.substring(5).toLowerCase();this.move(n)}else if(Ua.isEventKey(t,"play")||Ua.isEventKey(t,"pause")||Ua.isEventKey(t,"ff")||Ua.isEventKey(t,"rw")){t.preventDefault();const n=Ua.getEventName(t);this.performMediaAction_(n)}else Ua.isEventKey(t,"Back")&&e.target&&typeof e.target.closeable=="function"&&e.target.closeable()&&(t.preventDefault(),e.target.close())}performMediaAction_(e){if(this.player_)switch(e){case"play":this.player_.paused()&&this.player_.play();break;case"pause":this.player_.paused()||this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+ub);break;case"rw":this.userSeek_(this.player_.currentTime()-ub);break}}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(e){const t=e.relatedTarget;let n=null;const r=this.getCurrentComponent(e.target);t&&(n=!!t.closest(".video-js"),t.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(!e.currentTarget.contains(e.relatedTarget)&&!n||!t)&&(r&&r.name()==="CloseButton"?this.refocusComponent():(this.pause(),r&&r.el()&&(this.lastFocusedComponent_=r)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){const e=this.player_,t=[];function n(r){for(const s of r)s.hasOwnProperty("el_")&&s.getIsFocusable()&&s.getIsAvailableToBeFocused(s.el())&&t.push(s),s.hasOwnProperty("children_")&&s.children_.length>0&&n(s.children_)}return e.children_.forEach(r=>{if(r.hasOwnProperty("el_"))if(r.getIsFocusable&&r.getIsAvailableToBeFocused&&r.getIsFocusable()&&r.getIsAvailableToBeFocused(r.el())){t.push(r);return}else r.hasOwnProperty("children_")&&r.children_.length>0?n(r.children_):r.hasOwnProperty("items")&&r.items.length>0?n(r.items):this.findSuitableDOMChild(r)&&t.push(r);if(r.name_==="ErrorDisplay"&&r.opened_){const s=r.el_.querySelector(".vjs-errors-ok-button-container");s&&s.querySelectorAll("button").forEach((o,c)=>{t.push({name:()=>"ModalButton"+(c+1),el:()=>o,getPositions:()=>{const u=o.getBoundingClientRect(),d={x:u.x,y:u.y,width:u.width,height:u.height,top:u.top,right:u.right,bottom:u.bottom,left:u.left},h={x:u.left+u.width/2,y:u.top+u.height/2,width:0,height:0,top:u.top+u.height/2,right:u.left+u.width/2,bottom:u.top+u.height/2,left:u.left+u.width/2};return{boundingClientRect:d,center:h}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:u=>!0,focus:()=>o.focus()})})}}),this.focusableComponents=t,this.focusableComponents}findSuitableDOMChild(e){function t(n){if(e.getIsFocusable(n)&&e.getIsAvailableToBeFocused(n))return n;for(let r=0;r<n.children.length;r++){const s=n.children[r],a=t(s);if(a)return a}return null}return e.el()?t(e.el()):null}getCurrentComponent(e){this.updateFocusableComponents();const t=e||document.activeElement;if(this.focusableComponents.length){for(const n of this.focusableComponents)if(n.el()===t)return n}}add(e){const t=[...this.focusableComponents];e.hasOwnProperty("el_")&&e.getIsFocusable()&&e.getIsAvailableToBeFocused(e.el())&&t.push(e),this.focusableComponents=t,this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents})}remove(e){for(let t=0;t<this.focusableComponents.length;t++)if(this.focusableComponents[t].name()===e.name()){this.focusableComponents.splice(t,1),this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents});return}}clear(){this.focusableComponents.length>0&&(this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents}))}move(e){const t=this.getCurrentComponent();if(!t)return;const n=t.getPositions(),r=this.focusableComponents.filter(a=>a!==t&&this.isInDirection_(n.boundingClientRect,a.getPositions().boundingClientRect,e)),s=this.findBestCandidate_(n.center,r,e);s?this.focus(s):this.trigger({type:"endOfFocusableComponents",direction:e,focusedComponent:t})}findBestCandidate_(e,t,n){let r=1/0,s=null;for(const a of t){const o=a.getPositions().center,c=this.calculateDistance_(e,o,n);c<r&&(r=c,s=a)}return s}isInDirection_(e,t,n){switch(n){case"right":return t.left>=e.right;case"left":return t.right<=e.left;case"down":return t.top>=e.bottom;case"up":return t.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let e=0;e<this.focusableComponents.length;e++)if(this.focusableComponents[e].name()===this.lastFocusedComponent_.name()){this.focus(this.focusableComponents[e]);return}}else this.focus(this.updateFocusableComponents()[0])}focus(e){typeof e=="object"&&(e.getIsAvailableToBeFocused(e.el())?e.focus():this.findSuitableDOMChild(e)&&this.findSuitableDOMChild(e).focus())}calculateDistance_(e,t,n){const r=Math.abs(e.x-t.x),s=Math.abs(e.y-t.y);let a;switch(n){case"right":case"left":a=r+s*100;break;case"up":a=s*2+r*.5;break;case"down":a=s*5+r;break;default:a=r+s}return a}searchForTrackSelect_(){const e=this;for(const t of e.updateFocusableComponents())if(t.constructor.name==="TextTrackSelect"){e.focus(t);break}}}class CA extends Ee{constructor(e,t,n){const r=Ot({createEl:!1},t);if(super(e,r,n),!t.playerOptions.sources||t.playerOptions.sources.length===0)for(let s=0,a=t.playerOptions.techOrder;s<a.length;s++){const o=an(a[s]);let c=gt.getTech(o);if(o||(c=Ee.getComponent(o)),c&&c.isSupported()){e.loadTech_(o);break}}else e.src(t.playerOptions.sources)}}Ee.registerComponent("MediaLoader",CA);class Au extends Ee{constructor(e,t){super(e,t),this.options_.controlText&&this.controlText(this.options_.controlText),this.handleMouseOver_=n=>this.handleMouseOver(n),this.handleMouseOut_=n=>this.handleMouseOut(n),this.handleClick_=n=>this.handleClick(n),this.handleKeyDown_=n=>this.handleKeyDown(n),this.emitTapEvents(),this.enable()}createEl(e="div",t={},n={}){t=Object.assign({className:this.buildCSSClass(),tabIndex:0},t),e==="button"&&_t.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),n=Object.assign({role:"button"},n),this.tabIndex_=t.tabIndex;const r=ot(e,t,n);return this.player_.options_.experimentalSvgIcons||r.appendChild(ot("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=ot("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,t=this.el()){if(e===void 0)return this.controlText_||"Need Text";const n=this.localize(e);this.controlText_=e,rs(this.controlTextEl_,n),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&t.setAttribute("title",n)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),typeof this.tabIndex_<"u"&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),typeof this.tabIndex_<"u"&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){e.key===" "||e.key==="Enter"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}Ee.registerComponent("ClickableComponent",Au);class sp extends Au{constructor(e,t){super(e,t),this.update(),this.update_=n=>this.update(n),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return ot("div",{className:"vjs-poster"})}crossOrigin(e){if(typeof e>"u")return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.$("img")&&(this.$("img").crossOrigin=e)}update(e){const t=this.player().poster();this.setSrc(t),t?this.show():this.hide()}setSrc(e){if(!e){this.el_.textContent="";return}this.$("img")||this.el_.appendChild(ot("picture",{className:"vjs-poster",tabIndex:-1},{},ot("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?or(this.player_.play()):this.player_.pause())}}sp.prototype.crossorigin=sp.prototype.crossOrigin,Ee.registerComponent("PosterImage",sp);const Di="#222",db="#ccc",xA={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function ap(i,e){let t;if(i.length===4)t=i[1]+i[1]+i[2]+i[2]+i[3]+i[3];else if(i.length===7)t=i.slice(1);else throw new Error("Invalid color code provided, "+i+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(t.slice(0,2),16)+","+parseInt(t.slice(2,4),16)+","+parseInt(t.slice(4,6),16)+","+e+")"}function lr(i,e,t){try{i.style[e]=t}catch{return}}function hb(i){return i?`${i}px`:""}class EA extends Ee{constructor(e,t,n){super(e,t,n);const r=a=>this.updateDisplay(a),s=a=>{this.updateDisplayOverlay(),this.updateDisplay(a)};e.on("loadstart",a=>this.toggleDisplay(a)),e.on("useractive",r),e.on("userinactive",r),e.on("texttrackchange",r),e.on("loadedmetadata",a=>{this.updateDisplayOverlay(),this.preselectTrack(a)}),e.ready(Ht(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks){this.hide();return}e.on("fullscreenchange",s),e.on("playerresize",s);const a=te.screen.orientation||te,o=te.screen.orientation?"change":"orientationchange";a.addEventListener(o,s),e.on("dispose",()=>a.removeEventListener(o,s));const c=this.options_.playerOptions.tracks||[];for(let u=0;u<c.length;u++)this.player_.addRemoteTextTrack(c[u],!0);this.preselectTrack()}))}preselectTrack(){const e={captions:1,subtitles:1},t=this.player_.textTracks(),n=this.player_.cache_.selectedLanguage;let r,s,a;for(let o=0;o<t.length;o++){const c=t[o];n&&n.enabled&&n.language&&n.language===c.language&&c.kind in e?c.kind===n.kind?a=c:a||(a=c):n&&!n.enabled?(a=null,r=null,s=null):c.default&&(c.kind==="descriptions"&&!r?r=c:c.kind in e&&!s&&(s=c))}a?a.mode="showing":s?s.mode="showing":r&&(r.mode="showing")}toggleDisplay(){this.player_.tech_&&this.player_.tech_.featuresNativeTextTracks?this.hide():this.show()}createEl(){return super.createEl("div",{className:"vjs-text-track-display"},{translate:"yes","aria-live":"off","aria-atomic":"true"})}clearDisplay(){typeof te.WebVTT=="function"&&te.WebVTT.processCues(te,[],this.el_)}updateDisplay(){const e=this.player_.textTracks(),t=this.options_.allowMultipleShowingTracks;if(this.clearDisplay(),t){const a=[];for(let o=0;o<e.length;++o){const c=e[o];c.mode==="showing"&&a.push(c)}this.updateForTrack(a);return}let n=null,r=null,s=e.length;for(;s--;){const a=e[s];a.mode==="showing"&&(a.kind==="descriptions"?n=a:r=a)}if(r?(this.getAttribute("aria-live")!=="off"&&this.setAttribute("aria-live","off"),this.updateForTrack(r)):n&&(this.getAttribute("aria-live")!=="assertive"&&this.setAttribute("aria-live","assertive"),this.updateForTrack(n)),!te.CSS.supports("inset","10px")){const a=this.el_,o=a.querySelectorAll(".vjs-text-track-cue"),c=this.player_.controlBar.el_.getBoundingClientRect().height,u=this.player_.el_.getBoundingClientRect().height;a.style="",lr(a,"position","relative"),lr(a,"height",u-c+"px"),lr(a,"top","unset"),fu?lr(a,"bottom",u+"px"):lr(a,"bottom","0px"),o.length>0&&o.forEach(d=>{if(d.style.inset){const h=d.style.inset.split(" ");h.length===3&&Object.assign(d.style,{top:h[0],right:h[1],bottom:h[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!te.CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),t=this.player_.currentHeight(),n=e/t,r=this.player_.videoWidth()/this.player_.videoHeight();let s=0,a=0;Math.abs(n-r)>.1&&(n>r?s=Math.round((e-t*r)/2):a=Math.round((t-e/r)/2)),lr(this.el_,"insetInline",hb(s)),lr(this.el_,"insetBlock",hb(a))}updateDisplayState(e){const t=this.player_.textTrackSettings.getValues(),n=e.activeCues;let r=n.length;for(;r--;){const s=n[r];if(!s)continue;const a=s.displayState;if(t.color&&(a.firstChild.style.color=t.color),t.textOpacity&&lr(a.firstChild,"color",ap(t.color||"#fff",t.textOpacity)),t.backgroundColor&&(a.firstChild.style.backgroundColor=t.backgroundColor),t.backgroundOpacity&&lr(a.firstChild,"backgroundColor",ap(t.backgroundColor||"#000",t.backgroundOpacity)),t.windowColor&&(t.windowOpacity?lr(a,"backgroundColor",ap(t.windowColor,t.windowOpacity)):a.style.backgroundColor=t.windowColor),t.edgeStyle&&(t.edgeStyle==="dropshadow"?a.firstChild.style.textShadow=`2px 2px 3px ${Di}, 2px 2px 4px ${Di}, 2px 2px 5px ${Di}`:t.edgeStyle==="raised"?a.firstChild.style.textShadow=`1px 1px ${Di}, 2px 2px ${Di}, 3px 3px ${Di}`:t.edgeStyle==="depressed"?a.firstChild.style.textShadow=`1px 1px ${db}, 0 1px ${db}, -1px -1px ${Di}, 0 -1px ${Di}`:t.edgeStyle==="uniform"&&(a.firstChild.style.textShadow=`0 0 4px ${Di}, 0 0 4px ${Di}, 0 0 4px ${Di}, 0 0 4px ${Di}`)),t.fontPercent&&t.fontPercent!==1){const o=te.parseFloat(a.style.fontSize);a.style.fontSize=o*t.fontPercent+"px",a.style.height="auto",a.style.top="auto"}t.fontFamily&&t.fontFamily!=="default"&&(t.fontFamily==="small-caps"?a.firstChild.style.fontVariant="small-caps":a.firstChild.style.fontFamily=xA[t.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof te.WebVTT!="function"||e.every(n=>!n.activeCues))return;const t=[];for(let n=0;n<e.length;++n){const r=e[n];for(let s=0;s<r.activeCues.length;++s)t.push(r.activeCues[s])}te.WebVTT.processCues(te,t,this.el_);for(let n=0;n<e.length;++n){const r=e[n];for(let s=0;s<r.activeCues.length;++s){const a=r.activeCues[s].displayState;Ls(a,"vjs-text-track-cue","vjs-text-track-cue-"+(r.language?r.language:n)),r.language&&Pa(a,"lang",r.language)}this.player_.textTrackSettings&&this.updateDisplayState(r)}}}Ee.registerComponent("TextTrackDisplay",EA);class wA extends Ee{createEl(){const e=this.player_.isAudio(),t=this.localize(e?"Audio Player":"Video Player"),n=ot("span",{className:"vjs-control-text",textContent:this.localize("{1} is loading.",[t])}),r=super.createEl("div",{className:"vjs-loading-spinner",dir:"ltr"});return r.appendChild(n),r}handleLanguagechange(){this.$(".vjs-control-text").textContent=this.localize("{1} is loading.",[this.player_.isAudio()?"Audio Player":"Video Player"])}}Ee.registerComponent("LoadingSpinner",wA);class Vn extends Au{createEl(e,t={},n={}){e="button",t=Object.assign({className:this.buildCSSClass()},t),n=Object.assign({type:"button"},n);const r=ot(e,t,n);return this.player_.options_.experimentalSvgIcons||r.appendChild(ot("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}addChild(e,t={}){const n=this.constructor.name;return _t.warn(`Adding an actionable (user controllable) child to a Button (${n}) is not supported; use a ClickableComponent instead.`),Ee.prototype.addChild.call(this,e,t)}enable(){super.enable(),this.el_.removeAttribute("disabled")}disable(){super.disable(),this.el_.setAttribute("disabled","disabled")}handleKeyDown(e){if(e.key===" "||e.key==="Enter"){e.stopPropagation();return}super.handleKeyDown(e)}}Ee.registerComponent("Button",Vn);class fb extends Vn{constructor(e,t){super(e,t),this.mouseused_=!1,this.setIcon("play"),this.on("mousedown",n=>this.handleMouseDown(n))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const t=this.player_.play();if(e.type==="tap"||this.mouseused_&&"clientX"in e&&"clientY"in e){or(t),this.player_.tech(!0)&&this.player_.tech(!0).focus();return}const n=this.player_.getChild("controlBar"),r=n&&n.getChild("playToggle");if(!r){this.player_.tech(!0).focus();return}const s=()=>r.focus();ll(t)?t.then(s,()=>{}):this.setTimeout(s,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}fb.prototype.controlText_="Play Video",Ee.registerComponent("BigPlayButton",fb);class DA extends Vn{constructor(e,t){super(e,t),this.setIcon("cancel"),this.controlText(t&&t.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){e.key==="Escape"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}Ee.registerComponent("CloseButton",DA);class pb extends Vn{constructor(e,t={}){super(e,t),t.replay=t.replay===void 0||t.replay,this.setIcon("play"),this.on(e,"play",n=>this.handlePlay(n)),this.on(e,"pause",n=>this.handlePause(n)),t.replay&&this.on(e,"ended",n=>this.handleEnded(n))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?or(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",t=>this.handleSeeked(t))}}pb.prototype.controlText_="Play",Ee.registerComponent("PlayToggle",pb);class Fa extends Ee{constructor(e,t){super(e,t),this.on(e,["timeupdate","ended","seeking"],n=>this.update(n)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),t=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),n=ot("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return t.appendChild(n),this.contentEl_=ot("span",{className:`${e}-display`},{role:"presentation"}),t.appendChild(this.contentEl_),t}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){!this.player_.options_.enableSmoothSeeking&&e.type==="seeking"||this.updateContent(e)}updateTextNode_(e=0){e=Us(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let t=this.textNode_;t&&this.contentEl_.firstChild!==t&&(t=null,_t.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=Fe.createTextNode(this.formattedTime_),this.textNode_&&(t?this.contentEl_.replaceChild(this.textNode_,t):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}Fa.prototype.labelText_="Time",Fa.prototype.controlText_="Time",Ee.registerComponent("TimeDisplay",Fa);class op extends Fa{buildCSSClass(){return"vjs-current-time"}updateContent(e){let t;this.player_.ended()?t=this.player_.duration():e&&e.target&&typeof e.target.pendingSeekTime=="function"?t=e.target.pendingSeekTime():t=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(t)}}op.prototype.labelText_="Current Time",op.prototype.controlText_="Current Time",Ee.registerComponent("CurrentTimeDisplay",op);class lp extends Fa{constructor(e,t){super(e,t);const n=r=>this.updateContent(r);this.on(e,"durationchange",n),this.on(e,"loadstart",n),this.on(e,"loadedmetadata",n)}buildCSSClass(){return"vjs-duration"}updateContent(e){const t=this.player_.duration();this.updateTextNode_(t)}}lp.prototype.labelText_="Duration",lp.prototype.controlText_="Duration",Ee.registerComponent("DurationDisplay",lp);class AA extends Ee{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),t=super.createEl("div"),n=super.createEl("span",{textContent:"/"});return t.appendChild(n),e.appendChild(t),e}}Ee.registerComponent("TimeDivider",AA);class cp extends Fa{constructor(e,t){super(e,t),this.on(e,"durationchange",n=>this.updateContent(n))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return this.options_.displayNegative!==!1&&e.insertBefore(ot("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if(typeof this.player_.duration()!="number")return;let t;this.player_.ended()?t=0:this.player_.remainingTimeDisplay?t=this.player_.remainingTimeDisplay():t=this.player_.remainingTime(),this.updateTextNode_(t)}}cp.prototype.labelText_="Remaining Time",cp.prototype.controlText_="Remaining Time",Ee.registerComponent("RemainingTimeDisplay",cp);class IA extends Ee{constructor(e,t){super(e,t),this.updateShowing(),this.on(this.player(),"durationchange",n=>this.updateShowing(n))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=ot("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild(ot("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(Fe.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}}Ee.registerComponent("LiveDisplay",IA);class mb extends Vn{constructor(e,t){super(e,t),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=n=>this.updateLiveEdgeStatus(n),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=ot("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}mb.prototype.controlText_="Seek to live, currently playing live",Ee.registerComponent("SeekToLive",mb);function ul(i,e,t){return i=Number(i),Math.min(t,Math.max(e,isNaN(i)?e:i))}var NA=Object.freeze({__proto__:null,clamp:ul});class up extends Ee{constructor(e,t){super(e,t),this.handleMouseDown_=n=>this.handleMouseDown(n),this.handleMouseUp_=n=>this.handleMouseUp(n),this.handleKeyDown_=n=>this.handleKeyDown(n),this.handleClick_=n=>this.handleClick(n),this.handleMouseMove_=n=>this.handleMouseMove(n),this.update_=n=>this.update(n),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,t={},n={}){return t.className=t.className+" vjs-slider",t=Object.assign({tabIndex:0},t),n=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},n),super.createEl(e,t,n)}handleMouseDown(e){const t=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type==="touchstart"&&!sr&&e.preventDefault(),A1(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(t,"mousemove",this.handleMouseMove_),this.on(t,"mouseup",this.handleMouseUp_),this.on(t,"touchmove",this.handleMouseMove_),this.on(t,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const t=this.bar.el_.ownerDocument;I1(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(t,"mousemove",this.handleMouseMove_),this.off(t,"mouseup",this.handleMouseUp_),this.off(t,"touchmove",this.handleMouseMove_),this.off(t,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{const t=this.vertical()?"height":"width";this.bar.el().style[t]=(e*100).toFixed(2)+"%"})),e}getProgress(){return Number(ul(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const t=vu(this.el_,e);return this.vertical()?t.y:t.x}handleKeyDown(e){const t=this.options_.playerOptions.spatialNavigation,n=t&&t.enabled,r=t&&t.horizontalSeek;n?r&&e.key==="ArrowLeft"||!r&&e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):r&&e.key==="ArrowRight"||!r&&e.key==="ArrowUp"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(this.pendingSeekTime()&&(this.pendingSeekTime(null),this.userSeek_(this.player_.currentTime())),super.handleKeyDown(e)):e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):e.key==="ArrowUp"||e.key==="ArrowRight"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}Ee.registerComponent("Slider",up);const dp=(i,e)=>ul(i/e*100,0,100).toFixed(2)+"%";class PA extends Ee{constructor(e,t){super(e,t),this.partEls_=[],this.on(e,"progress",n=>this.update(n))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),t=ot("span",{className:"vjs-control-text"}),n=ot("span",{textContent:this.localize("Loaded")}),r=Fe.createTextNode(": ");return this.percentageEl_=ot("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(t),t.appendChild(n),t.appendChild(r),t.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const t=this.player_.liveTracker,n=this.player_.buffered(),r=t&&t.isLive()?t.seekableEnd():this.player_.duration(),s=this.player_.bufferedEnd(),a=this.partEls_,o=dp(s,r);this.percent_!==o&&(this.el_.style.width=o,rs(this.percentageEl_,o),this.percent_=o);for(let c=0;c<n.length;c++){const u=n.start(c),d=n.end(c);let h=a[c];h||(h=this.el_.appendChild(ot()),a[c]=h),!(h.dataset.start===u&&h.dataset.end===d)&&(h.dataset.start=u,h.dataset.end=d,h.style.left=dp(u,s),h.style.width=dp(d-u,s))}for(let c=a.length;c>n.length;c--)this.el_.removeChild(a[c-1]);a.length=n.length})}}Ee.registerComponent("LoadProgressBar",PA);class OA extends Ee{constructor(e,t){super(e,t),this.update=ar(Ht(this,this.update),Ei)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,t,n){const r=rl(this.el_),s=Oa(this.player_.el()),a=e.width*t;if(!s||!r)return;let o=e.left-s.left+a,c=e.width-a+(s.right-e.right);c||(c=e.width-a,o=a);let u=r.width/2;o<u?u+=u-o:c<u&&(u=c),u<0?u=0:u>r.width&&(u=r.width),u=Math.round(u),this.el_.style.right=`-${u}px`,this.write(n)}write(e){rs(this.el_,e)}updateTime(e,t,n,r){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let s;const a=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const o=this.player_.liveTracker.liveWindow(),c=o-t*o;s=(c<1?"":"-")+Us(c,o)}else s=Us(n,a);this.update(e,t,s),r&&r()})}}Ee.registerComponent("TimeTooltip",OA);class hp extends Ee{constructor(e,t){super(e,t),this.setIcon("circle"),this.update=ar(Ht(this,this.update),Ei)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,t,n){const r=this.getChild("timeTooltip");if(!r)return;const s=n&&n.target&&typeof n.target.pendingSeekTime=="function"?n.target.pendingSeekTime():this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();r.updateTime(e,t,s)}}hp.prototype.options_={children:[]},!Un&&!ji&&hp.prototype.options_.children.push("timeTooltip"),Ee.registerComponent("PlayProgressBar",hp);class gb extends Ee{constructor(e,t){super(e,t),this.update=ar(Ht(this,this.update),Ei)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t){const n=t*this.player_.duration();this.getChild("timeTooltip").updateTime(e,t,n,()=>{this.el_.style.left=`${e.width*t}px`})}}gb.prototype.options_={children:["timeTooltip"]},Ee.registerComponent("MouseTimeDisplay",gb);class Iu extends up{constructor(e,t){t=Ot(Iu.prototype.options_,t),t.children=[...t.children];const n=e.options_.disableSeekWhileScrubbingOnMobile&&(Un||ji)||e.options_.disableSeekWhileScrubbingOnSTV;(!Un&&!ji||n)&&t.children.splice(1,0,"mouseTimeDisplay"),super(e,t),this.shouldDisableSeekWhileScrubbing_=n,this.pendingSeekTime_=null,this.setEventHandlers_()}setEventHandlers_(){this.update_=Ht(this,this.update),this.update=ar(this.update_,Ei),this.on(this.player_,["durationchange","timeupdate"],this.update),this.on(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in Fe&&"visibilityState"in Fe&&this.on(Fe,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){Fe.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,Ei))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if(Fe.visibilityState==="hidden")return;const t=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const n=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),r=this.player_.liveTracker;let s=this.player_.duration();r&&r.isLive()&&(s=this.player_.liveTracker.liveCurrentTime()),this.percent_!==t&&(this.el_.setAttribute("aria-valuenow",(t*100).toFixed(2)),this.percent_=t),(this.currentTime_!==n||this.duration_!==s)&&(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[Us(n,s),Us(s,s)],"{1} of {2}")),this.currentTime_=n,this.duration_=s),this.bar&&this.bar.update(Oa(this.el()),this.getProgress(),e)}),t}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}pendingSeekTime(e){if(e!==void 0)if(e!==null){const t=this.player_.duration();this.pendingSeekTime_=Math.max(0,Math.min(e,t))}else this.pendingSeekTime_=null;return this.pendingSeekTime_}getPercent(){if(this.pendingSeekTime()!==null)return this.pendingSeekTime()/this.player_.duration();const e=this.getCurrentTime_();let t;const n=this.player_.liveTracker;return n&&n.isLive()?(t=(e-n.seekableStart())/n.liveWindow(),n.atLiveEdge()&&(t=1)):t=e/this.player_.duration(),t}handleMouseDown(e){sl(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.shouldDisableSeekWhileScrubbing_||this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,t=!1){if(!sl(e)||isNaN(this.player_.duration()))return;!t&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);let n;const r=this.calculateDistance(e),s=this.player_.liveTracker;if(!s||!s.isLive())n=r*this.player_.duration(),n===this.player_.duration()&&(n=n-.1);else{if(r>=.99){s.seekToLiveEdge();return}const a=s.seekableStart(),o=s.liveCurrentTime();if(n=a+r*s.liveWindow(),n>=o&&(n=o),n<=a&&(n=a+.1),n===1/0)return}this.shouldDisableSeekWhileScrubbing_?this.pendingSeekTime(n):this.userSeek_(n),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.pendingSeekTime()!==null&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?or(this.player_.play()):this.update_()}handlePendingSeek_(e){this.player_.paused()||this.player_.pause();const t=this.pendingSeekTime()!==null?this.pendingSeekTime():this.player_.currentTime();this.pendingSeekTime(t+e),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}stepForward(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(this.options().stepSeconds):this.userSeek_(this.player_.currentTime()+this.options().stepSeconds)}stepBack(){this.shouldDisableSeekWhileScrubbing_?this.handlePendingSeek_(-this.options().stepSeconds):this.userSeek_(this.player_.currentTime()-this.options().stepSeconds)}handleAction(e){this.pendingSeekTime()!==null&&(this.userSeek_(this.pendingSeekTime()),this.pendingSeekTime(null)),this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const t=this.player_.liveTracker;if(e.key===" "||e.key==="Enter")e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(e.key==="Home")e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(e.key==="End")e.preventDefault(),e.stopPropagation(),t&&t.isLive()?this.userSeek_(t.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();const n=parseInt(e.key,10)*.1;t&&t.isLive()?this.userSeek_(t.seekableStart()+t.liveWindow()*n):this.userSeek_(this.player_.duration()*n)}else e.key==="PageDown"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-this.options().stepSeconds*this.options().pageMultiplier)):e.key==="PageUp"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+this.options().stepSeconds*this.options().pageMultiplier)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in Fe&&"visibilityState"in Fe&&this.off(Fe,"visibilitychange",this.toggleVisibility_),super.dispose()}}Iu.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar",stepSeconds:5,pageMultiplier:12},Ee.registerComponent("SeekBar",Iu);class vb extends Ee{constructor(e,t){super(e,t),this.handleMouseMove=ar(Ht(this,this.handleMouseMove),Ei),this.throttledHandleMouseSeek=ar(Ht(this,this.handleMouseSeek),Ei),this.handleMouseUpHandler_=n=>this.handleMouseUp(n),this.handleMouseDownHandler_=n=>this.handleMouseDown(n),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const t=this.getChild("seekBar");if(!t)return;const n=t.getChild("playProgressBar"),r=t.getChild("mouseTimeDisplay");if(!n&&!r)return;const s=t.el(),a=rl(s);let o=vu(s,e).x;o=ul(o,0,1),r&&r.update(a,o),n&&n.update(a,t.getProgress())}handleMouseSeek(e){const t=this.getChild("seekBar");t&&t.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach(e=>e.disable&&e.disable()),!!this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&or(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const t=this.el_.ownerDocument,n=this.getChild("seekBar");n&&n.handleMouseDown(e),this.on(t,"mousemove",this.throttledHandleMouseSeek),this.on(t,"touchmove",this.throttledHandleMouseSeek),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.getChild("seekBar");t&&t.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}vb.prototype.options_={children:["seekBar"]},Ee.registerComponent("ProgressControl",vb);class yb extends Vn{constructor(e,t){super(e,t),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],n=>this.handlePictureInPictureChange(n)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],n=>this.handlePictureInPictureEnabledChange(n)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){if(!(this.player_.currentType().substring(0,5)==="audio"||this.player_.audioPosterMode()||this.player_.audioOnlyMode())){this.show();return}this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()}handlePictureInPictureEnabledChange(){Fe.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in te?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){typeof Fe.exitPictureInPicture=="function"&&super.show()}}yb.prototype.controlText_="Picture-in-Picture",Ee.registerComponent("PictureInPictureToggle",yb);class bb extends Vn{constructor(e,t){super(e,t),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",n=>this.handleFullscreenChange(n)),Fe[e.fsApi_.fullscreenEnabled]===!1&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}bb.prototype.controlText_="Fullscreen",Ee.registerComponent("FullscreenToggle",bb);const MA=function(i,e){e.tech_&&!e.tech_.featuresVolumeControl&&i.addClass("vjs-hidden"),i.on(e,"loadstart",function(){e.tech_.featuresVolumeControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")})};class RA extends Ee{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}Ee.registerComponent("VolumeLevel",RA);class LA extends Ee{constructor(e,t){super(e,t),this.update=ar(Ht(this,this.update),Ei)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,t,n,r){if(!n){const s=Oa(this.el_),a=Oa(this.player_.el()),o=e.width*t;if(!a||!s)return;const c=e.left-a.left+o,u=e.width-o+(a.right-e.right);let d=s.width/2;c<d?d+=d-c:u<d&&(d=u),d<0?d=0:d>s.width&&(d=s.width),this.el_.style.right=`-${d}px`}this.write(`${r}%`)}write(e){rs(this.el_,e)}updateVolume(e,t,n,r,s){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,t,n,r.toFixed(0)),s&&s()})}}Ee.registerComponent("VolumeLevelTooltip",LA);class _b extends Ee{constructor(e,t){super(e,t),this.update=ar(Ht(this,this.update),Ei)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,t,n){const r=100*t;this.getChild("volumeLevelTooltip").updateVolume(e,t,n,r,()=>{n?this.el_.style.bottom=`${e.height*t}px`:this.el_.style.left=`${e.width*t}px`})}}_b.prototype.options_={children:["volumeLevelTooltip"]},Ee.registerComponent("MouseVolumeLevelDisplay",_b);class Nu extends up{constructor(e,t){super(e,t),this.on("slideractive",n=>this.updateLastVolume_(n)),this.on(e,"volumechange",n=>this.updateARIAAttributes(n)),e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){sl(e)&&super.handleMouseDown(e)}handleMouseMove(e){const t=this.getChild("mouseVolumeLevelDisplay");if(t){const n=this.el(),r=Oa(n),s=this.vertical();let a=vu(n,e);a=s?a.y:a.x,a=ul(a,0,1),t.update(r,a,s)}sl(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const t=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",t),this.el_.setAttribute("aria-valuetext",t+"%")}volumeAsPercentage_(){return Math.round(this.player_.volume()*100)}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{this.player_.volume()===0&&this.player_.lastVolume_(e)})}}Nu.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},!Un&&!ji&&Nu.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),Nu.prototype.playerEvent="volumechange",Ee.registerComponent("VolumeBar",Nu);class kb extends Ee{constructor(e,t={}){t.vertical=t.vertical||!1,(typeof t.volumeBar>"u"||wa(t.volumeBar))&&(t.volumeBar=t.volumeBar||{},t.volumeBar.vertical=t.vertical),super(e,t),MA(this,e),this.throttledHandleMouseMove=ar(Ht(this,this.handleMouseMove),Ei),this.handleMouseUpHandler_=n=>this.handleMouseUp(n),this.on("mousedown",n=>this.handleMouseDown(n)),this.on("touchstart",n=>this.handleMouseDown(n)),this.on("mousemove",n=>this.handleMouseMove(n)),this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")}),this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const t=this.el_.ownerDocument;this.on(t,"mousemove",this.throttledHandleMouseMove),this.on(t,"touchmove",this.throttledHandleMouseMove),this.on(t,"mouseup",this.handleMouseUpHandler_),this.on(t,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const t=this.el_.ownerDocument;this.off(t,"mousemove",this.throttledHandleMouseMove),this.off(t,"touchmove",this.throttledHandleMouseMove),this.off(t,"mouseup",this.handleMouseUpHandler_),this.off(t,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}kb.prototype.options_={children:["volumeBar"]},Ee.registerComponent("VolumeControl",kb);const BA=function(i,e){e.tech_&&!e.tech_.featuresMuteControl&&i.addClass("vjs-hidden"),i.on(e,"loadstart",function(){e.tech_.featuresMuteControl?i.removeClass("vjs-hidden"):i.addClass("vjs-hidden")})};class Tb extends Vn{constructor(e,t){super(e,t),BA(this,e),this.on(e,["loadstart","volumechange"],n=>this.update(n))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.volume(),n=this.player_.lastVolume_();if(t===0){const r=n<.1?.1:n;this.player_.volume(r),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let t=3;this.setIcon("volume-high"),Un&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?(this.setIcon("volume-mute"),t=0):e<.33?(this.setIcon("volume-low"),t=1):e<.67&&(this.setIcon("volume-medium"),t=2),mu(this.el_,[0,1,2,3].reduce((n,r)=>n+`${r?" ":""}vjs-vol-${r}`,"")),Ls(this.el_,`vjs-vol-${t}`)}updateControlText_(){const t=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==t&&this.controlText(t)}}Tb.prototype.controlText_="Mute",Ee.registerComponent("MuteToggle",Tb);class Sb extends Ee{constructor(e,t={}){typeof t.inline<"u"?t.inline=t.inline:t.inline=!0,(typeof t.volumeControl>"u"||wa(t.volumeControl))&&(t.volumeControl=t.volumeControl||{},t.volumeControl.vertical=!t.inline),super(e,t),this.handleKeyPressHandler_=n=>this.handleKeyPress(n),this.on(e,["loadstart"],n=>this.volumePanelState_(n)),this.on(this.muteToggle,"keyup",n=>this.handleKeyPress(n)),this.on(this.volumeControl,"keyup",n=>this.handleVolumeControlKeyUp(n)),this.on("keydown",n=>this.handleKeyPress(n)),this.on("mouseover",n=>this.handleMouseOver(n)),this.on("mouseout",n=>this.handleMouseOut(n)),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){e.key==="Escape"&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),pi(Fe,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),Fn(Fe,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){e.key==="Escape"&&this.handleMouseOut()}}Sb.prototype.options_={children:["muteToggle","volumeControl"]},Ee.registerComponent("VolumePanel",Sb);class Cb extends Vn{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const t=this.player_.currentTime(),n=this.player_.liveTracker,r=n&&n.isLive()?n.seekableEnd():this.player_.duration();let s;t+this.skipTime<=r?s=t+this.skipTime:s=r,this.player_.currentTime(s)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}Cb.prototype.controlText_="Skip Forward",Ee.registerComponent("SkipForward",Cb);class xb extends Vn{constructor(e,t){super(e,t),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const t=this.player_.currentTime(),n=this.player_.liveTracker,r=n&&n.isLive()&&n.seekableStart();let s;r&&t-this.skipTime<=r?s=r:t>=this.skipTime?s=t-this.skipTime:s=0,this.player_.currentTime(s)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}xb.prototype.controlText_="Skip Backward",Ee.registerComponent("SkipBackward",xb);class Eb extends Ee{constructor(e,t){super(e,t),t&&(this.menuButton_=t.menuButton),this.focusedChild_=-1,this.on("keydown",n=>this.handleKeyDown(n)),this.boundHandleBlur_=n=>this.handleBlur(n),this.boundHandleTapClick_=n=>this.handleTapClick(n)}addEventListenerForItem(e){e instanceof Ee&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof Ee&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){typeof e=="string"&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const t=this.addChild(e);t&&this.addEventListenerForItem(t)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=ot(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const t=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return t.appendChild(this.contentEl_),pi(t,"click",function(n){n.preventDefault(),n.stopImmediatePropagation()}),t}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const t=e.relatedTarget||Fe.activeElement;if(!this.children().some(n=>n.el()===t)){const n=this.menuButton_;n&&n.buttonPressed_&&t!==n.el().firstChild&&n.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const t=this.children();if(!Array.isArray(t))return;const n=t.filter(r=>r.el()===e.target)[0];if(!n)return;n.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}}handleKeyDown(e){e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(e.key==="ArrowRight"||e.key==="ArrowUp")&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const t=this.children().slice();t.length&&t[0].hasClass("vjs-menu-title")&&t.shift(),t.length>0&&(e<0?e=0:e>=t.length&&(e=t.length-1),this.focusedChild_=e,t[e].el_.focus())}}Ee.registerComponent("Menu",Eb);class fp extends Ee{constructor(e,t={}){super(e,t),this.menuButton_=new Vn(e,t),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const n=Vn.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+n,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const r=s=>this.handleClick(s);this.handleMenuKeyUp_=s=>this.handleMenuKeyUp(s),this.on(this.menuButton_,"tap",r),this.on(this.menuButton_,"click",r),this.on(this.menuButton_,"keydown",s=>this.handleKeyDown(s)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),pi(Fe,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",s=>this.handleMouseLeave(s)),this.on("keydown",s=>this.handleSubmenuKeyDown(s))}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new Eb(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const t=ot("li",{className:"vjs-menu-title",textContent:an(this.options_.title),tabIndex:-1}),n=new Ee(this.player_,{el:t});e.addItem(n)}if(this.items=this.createItems(),this.items)for(let t=0;t<this.items.length;t++)e.addItem(this.items[t]);return e}createItems(){}createEl(){return super.createEl("div",{className:this.buildWrapperCSSClass()},{})}setIcon(e){super.setIcon(e,this.menuButton_.el_)}buildWrapperCSSClass(){let e="vjs-menu-button";this.options_.inline===!0?e+="-inline":e+="-popup";const t=Vn.prototype.buildCSSClass();return`vjs-menu-button ${e} ${t} ${super.buildCSSClass()}`}buildCSSClass(){let e="vjs-menu-button";return this.options_.inline===!0?e+="-inline":e+="-popup",`vjs-menu-button ${e} ${super.buildCSSClass()}`}controlText(e,t=this.menuButton_.el()){return this.menuButton_.controlText(e,t)}dispose(){this.handleMouseLeave(),super.dispose()}handleClick(e){this.buttonPressed_?this.unpressButton():this.pressButton()}handleMouseLeave(e){this.removeClass("vjs-hover"),Fn(Fe,"keyup",this.handleMenuKeyUp_)}focus(){this.menuButton_.focus()}blur(){this.menuButton_.blur()}handleKeyDown(e){e.key==="Escape"||e.key==="Tab"?(this.buttonPressed_&&this.unpressButton(),!e.key==="Tab"&&(e.preventDefault(),this.menuButton_.focus())):(e.key==="Up"||e.key==="Down"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled))&&(this.buttonPressed_||(e.preventDefault(),this.pressButton()))}handleMenuKeyUp(e){(e.key==="Escape"||e.key==="Tab")&&this.removeClass("vjs-hover")}handleSubmenuKeyPress(e){this.handleSubmenuKeyDown(e)}handleSubmenuKeyDown(e){(e.key==="Escape"||e.key==="Tab")&&(this.buttonPressed_&&this.unpressButton(),!e.key==="Tab"&&(e.preventDefault(),this.menuButton_.focus()))}pressButton(){if(this.enabled_){if(this.buttonPressed_=!0,this.menu.show(),this.menu.lockShowing(),this.menuButton_.el_.setAttribute("aria-expanded","true"),Un&&C1())return;this.menu.focus()}}unpressButton(){this.enabled_&&(this.buttonPressed_=!1,this.menu.unlockShowing(),this.menu.hide(),this.menuButton_.el_.setAttribute("aria-expanded","false"))}disable(){this.unpressButton(),this.enabled_=!1,this.addClass("vjs-disabled"),this.menuButton_.disable()}enable(){this.enabled_=!0,this.removeClass("vjs-disabled"),this.menuButton_.enable()}}Ee.registerComponent("MenuButton",fp);class pp extends fp{constructor(e,t){const n=t.tracks;if(super(e,t),this.items.length<=1&&this.hide(),!n)return;const r=Ht(this,this.update);n.addEventListener("removetrack",r),n.addEventListener("addtrack",r),n.addEventListener("labelchange",r),this.player_.on("ready",r),this.player_.on("dispose",function(){n.removeEventListener("removetrack",r),n.removeEventListener("addtrack",r),n.removeEventListener("labelchange",r)})}}Ee.registerComponent("TrackButton",pp);class dl extends Au{constructor(e,t){super(e,t),this.selectable=t.selectable,this.isSelected_=t.selected||!1,this.multiSelectable=t.multiSelectable,this.selected(this.isSelected_),this.selectable?this.multiSelectable?this.el_.setAttribute("role","menuitemcheckbox"):this.el_.setAttribute("role","menuitemradio"):this.el_.setAttribute("role","menuitem")}createEl(e,t,n){this.nonIconControl=!0;const r=super.createEl("li",Object.assign({className:"vjs-menu-item",tabIndex:-1},t),n),s=ot("span",{className:"vjs-menu-item-text",textContent:this.localize(this.options_.label)});return this.player_.options_.experimentalSvgIcons?r.appendChild(s):r.replaceChild(s,r.querySelector(".vjs-icon-placeholder")),r}handleKeyDown(e){["Tab","Escape","ArrowUp","ArrowLeft","ArrowRight","ArrowDown"].includes(e.key)||super.handleKeyDown(e)}handleClick(e){this.selected(!0)}selected(e){this.selectable&&(e?(this.addClass("vjs-selected"),this.el_.setAttribute("aria-checked","true"),this.controlText(", selected"),this.isSelected_=!0):(this.removeClass("vjs-selected"),this.el_.setAttribute("aria-checked","false"),this.controlText(""),this.isSelected_=!1))}}Ee.registerComponent("MenuItem",dl);class hl extends dl{constructor(e,t){const n=t.track,r=e.textTracks();t.label=n.label||n.language||"Unknown",t.selected=n.mode==="showing",super(e,t),this.track=n,this.kinds=(t.kinds||[t.kind||this.track.kind]).filter(Boolean);const s=(...o)=>{this.handleTracksChange.apply(this,o)},a=(...o)=>{this.handleSelectedLanguageChange.apply(this,o)};if(e.on(["loadstart","texttrackchange"],s),r.addEventListener("change",s),r.addEventListener("selectedlanguagechange",a),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],s),r.removeEventListener("change",s),r.removeEventListener("selectedlanguagechange",a)}),r.onchange===void 0){let o;this.on(["tap","click"],function(){if(typeof te.Event!="object")try{o=new te.Event("change")}catch{}o||(o=Fe.createEvent("Event"),o.initEvent("change",!0,!0)),r.dispatchEvent(o)})}this.handleTracksChange()}handleClick(e){const t=this.track,n=this.player_.textTracks();if(super.handleClick(e),!!n)for(let r=0;r<n.length;r++){const s=n[r];this.kinds.indexOf(s.kind)!==-1&&(s===t?s.mode!=="showing"&&(s.mode="showing"):s.mode!=="disabled"&&(s.mode="disabled"))}}handleTracksChange(e){const t=this.track.mode==="showing";t!==this.isSelected_&&this.selected(t)}handleSelectedLanguageChange(e){if(this.track.mode==="showing"){const t=this.player_.cache_.selectedLanguage;if(t&&t.enabled&&t.language===this.track.language&&t.kind!==this.track.kind)return;this.player_.cache_.selectedLanguage={enabled:!0,language:this.track.language,kind:this.track.kind}}}dispose(){this.track=null,super.dispose()}}Ee.registerComponent("TextTrackMenuItem",hl);class wb extends hl{constructor(e,t){t.track={player:e,kind:t.kind,kinds:t.kinds,default:!1,mode:"disabled"},t.kinds||(t.kinds=[t.kind]),t.label?t.track.label=t.label:t.track.label=t.kinds.join(" and ")+" off",t.selectable=!0,t.multiSelectable=!1,super(e,t)}handleTracksChange(e){const t=this.player().textTracks();let n=!0;for(let r=0,s=t.length;r<s;r++){const a=t[r];if(this.options_.kinds.indexOf(a.kind)>-1&&a.mode==="showing"){n=!1;break}}n!==this.isSelected_&&this.selected(n)}handleSelectedLanguageChange(e){const t=this.player().textTracks();let n=!0;for(let r=0,s=t.length;r<s;r++){const a=t[r];if(["captions","descriptions","subtitles"].indexOf(a.kind)>-1&&a.mode==="showing"){n=!1;break}}n&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}Ee.registerComponent("OffTextTrackMenuItem",wb);class Va extends pp{constructor(e,t={}){t.tracks=e.textTracks(),super(e,t)}createItems(e=[],t=hl){let n;this.label_&&(n=`${this.label_} off`),e.push(new wb(this.player_,{kinds:this.kinds_,kind:this.kind_,label:n})),this.hideThreshold_+=1;const r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let s=0;s<r.length;s++){const a=r[s];if(this.kinds_.indexOf(a.kind)>-1){const o=new t(this.player_,{track:a,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});o.addClass(`vjs-${a.kind}-menu-item`),e.push(o)}}return e}}Ee.registerComponent("TextTrackButton",Va);class Db extends dl{constructor(e,t){const n=t.track,r=t.cue,s=e.currentTime();t.selectable=!0,t.multiSelectable=!1,t.label=r.text,t.selected=r.startTime<=s&&s<r.endTime,super(e,t),this.track=n,this.cue=r}handleClick(e){super.handleClick(),this.player_.currentTime(this.cue.startTime)}}Ee.registerComponent("ChaptersTrackMenuItem",Db);class mp extends Va{constructor(e,t,n){super(e,t,n),this.setIcon("chapters"),this.selectCurrentItem_=()=>{this.items.forEach(r=>{r.selected(this.track_.activeCues[0]===r.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&e.track.kind!=="chapters")return;const t=this.findChaptersTrack();t!==this.track_?(this.setTrack(t),super.update()):(!this.items||t&&t.cues&&t.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const t=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);t&&t.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.kind===this.kind_)return n}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(an(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const t=this.track_.cues;if(!t)return e;for(let n=0,r=t.length;n<r;n++){const s=t[n],a=new Db(this.player_,{track:this.track_,cue:s});e.push(a)}return e}}mp.prototype.kind_="chapters",mp.prototype.controlText_="Chapters",Ee.registerComponent("ChaptersButton",mp);class gp extends Va{constructor(e,t,n){super(e,t,n),this.setIcon("audio-description");const r=e.textTracks(),s=Ht(this,this.handleTracksChange);r.addEventListener("change",s),this.on("dispose",function(){r.removeEventListener("change",s)})}handleTracksChange(e){const t=this.player().textTracks();let n=!1;for(let r=0,s=t.length;r<s;r++){const a=t[r];if(a.kind!==this.kind_&&a.mode==="showing"){n=!0;break}}n?this.disable():this.enable()}buildCSSClass(){return`vjs-descriptions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-descriptions-button ${super.buildWrapperCSSClass()}`}}gp.prototype.kind_="descriptions",gp.prototype.controlText_="Descriptions",Ee.registerComponent("DescriptionsButton",gp);class vp extends Va{constructor(e,t,n){super(e,t,n),this.setIcon("subtitles")}buildCSSClass(){return`vjs-subtitles-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subtitles-button ${super.buildWrapperCSSClass()}`}}vp.prototype.kind_="subtitles",vp.prototype.controlText_="Subtitles",Ee.registerComponent("SubtitlesButton",vp);class yp extends hl{constructor(e,t){t.track={player:e,kind:t.kind,label:t.kind+" settings",selectable:!1,default:!1,mode:"disabled"},t.selectable=!1,t.name="CaptionSettingsMenuItem",super(e,t),this.addClass("vjs-texttrack-settings"),this.controlText(", opens "+t.kind+" settings dialog")}handleClick(e){this.player().getChild("textTrackSettings").open()}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.kind+" settings"),super.handleLanguagechange()}}Ee.registerComponent("CaptionSettingsMenuItem",yp);class bp extends Va{constructor(e,t,n){super(e,t,n),this.setIcon("captions")}buildCSSClass(){return`vjs-captions-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-captions-button ${super.buildWrapperCSSClass()}`}createItems(){const e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new yp(this.player_,{kind:this.kind_})),this.hideThreshold_+=1),super.createItems(e)}}bp.prototype.kind_="captions",bp.prototype.controlText_="Captions",Ee.registerComponent("CaptionsButton",bp);class Ab extends hl{createEl(e,t,n){const r=super.createEl(e,t,n),s=r.querySelector(".vjs-menu-item-text");return this.options_.track.kind==="captions"&&(this.player_.options_.experimentalSvgIcons?this.setIcon("captions",r):s.appendChild(ot("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),s.appendChild(ot("span",{className:"vjs-control-text",textContent:` ${this.localize("Captions")}`}))),r}}Ee.registerComponent("SubsCapsMenuItem",Ab);class _p extends Va{constructor(e,t={}){super(e,t),this.label_="subtitles",this.setIcon("subtitles"),["en","en-us","en-ca","fr-ca"].indexOf(this.player_.language_)>-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(an(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new yp(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,Ab),e}}_p.prototype.kinds_=["captions","subtitles"],_p.prototype.controlText_="Subtitles",Ee.registerComponent("SubsCapsButton",_p);class Ib extends dl{constructor(e,t){const n=t.track,r=e.audioTracks();t.label=n.label||n.language||"Unknown",t.selected=n.enabled,super(e,t),this.track=n,this.addClass(`vjs-${n.kind}-menu-item`);const s=(...a)=>{this.handleTracksChange.apply(this,a)};r.addEventListener("change",s),this.on("dispose",()=>{r.removeEventListener("change",s)})}createEl(e,t,n){const r=super.createEl(e,t,n),s=r.querySelector(".vjs-menu-item-text");return["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0&&(s.appendChild(ot("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),s.appendChild(ot("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),r}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const t=this.player_.audioTracks();for(let n=0;n<t.length;n++){const r=t[n];r!==this.track&&(r.enabled=r===this.track)}}}handleTracksChange(e){this.selected(this.track.enabled)}}Ee.registerComponent("AudioTrackMenuItem",Ib);class Nb extends pp{constructor(e,t={}){t.tracks=e.audioTracks(),super(e,t),this.setIcon("audio")}buildCSSClass(){return`vjs-audio-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-audio-button ${super.buildWrapperCSSClass()}`}createItems(e=[]){this.hideThreshold_=1;const t=this.player_.audioTracks();for(let n=0;n<t.length;n++){const r=t[n];e.push(new Ib(this.player_,{track:r,selectable:!0,multiSelectable:!1}))}return e}}Nb.prototype.controlText_="Audio Track",Ee.registerComponent("AudioTrackButton",Nb);class kp extends dl{constructor(e,t){const n=t.rate,r=parseFloat(n,10);t.label=n,t.selected=r===e.playbackRate(),t.selectable=!0,t.multiSelectable=!1,super(e,t),this.label=n,this.rate=r,this.on(e,"ratechange",s=>this.update(s))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}kp.prototype.contentElType="button",Ee.registerComponent("PlaybackRateMenuItem",kp);class Pb extends fp{constructor(e,t){super(e,t),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",n=>this.updateVisibility(n)),this.on(e,"ratechange",n=>this.updateLabel(n)),this.on(e,"playbackrateschange",n=>this.handlePlaybackRateschange(n))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=ot("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),t=[];for(let n=e.length-1;n>=0;n--)t.push(new kp(this.player(),{rate:e[n]+"x"}));return t}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}Pb.prototype.controlText_="Playback Rate",Ee.registerComponent("PlaybackRateMenuButton",Pb);class Ob extends Ee{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",t={},n={}){return t.className||(t.className=this.buildCSSClass()),super.createEl(e,t,n)}}Ee.registerComponent("Spacer",Ob);class UA extends Ob{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}}Ee.registerComponent("CustomControlSpacer",UA);class Mb extends Ee{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}Mb.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]},Ee.registerComponent("ControlBar",Mb);class Rb extends La{constructor(e,t){super(e,t),this.on(e,"error",n=>{this.open(n)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}Rb.prototype.options_=Object.assign({},La.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),Ee.registerComponent("ErrorDisplay",Rb);class Lb extends Ee{constructor(e,t={}){super(e,t),this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){return this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim(),ot("select",{id:this.options_.id},{},this.options_.SelectOptions.map(t=>{const n=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${xi()}`)+"-"+t[1].replace(/\W+/g,""),r=ot("option",{id:n,value:this.localize(t[0]),textContent:this.localize(t[1])});return r.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${n}`),r}))}}Ee.registerComponent("TextTrackSelect",Lb);class $s extends Ee{constructor(e,t={}){super(e,t);const n=ot("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(n);const r=this.options_.selects;for(const s of r){const a=this.options_.selectConfigs[s],o=a.className,c=a.id.replace("%s",this.options_.id_);let u=null;const d=`vjs_select_${xi()}`;if(this.options_.type==="colors"){u=ot("span",{className:o});const b=ot("label",{id:c,className:"vjs-label",textContent:this.localize(a.label)});b.setAttribute("for",d),u.appendChild(b)}const h=new Lb(e,{SelectOptions:a.options,legendId:this.options_.legendId,id:d,labelId:c});this.addChild(h),this.options_.type==="colors"&&(u.appendChild(h.el()),this.el().appendChild(u))}}createEl(){return ot("fieldset",{className:this.options_.className})}}Ee.registerComponent("TextTrackFieldset",$s);class Bb extends Ee{constructor(e,t={}){super(e,t);const n=this.options_.textTrackComponentid,r=new $s(e,{id_:n,legendId:`captions-text-legend-${n}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(r);const s=new $s(e,{id_:n,legendId:`captions-background-${n}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(s);const a=new $s(e,{id_:n,legendId:`captions-window-${n}`,legendText:this.localize("Caption Area Background"),className:"vjs-window vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(a)}createEl(){return ot("div",{className:"vjs-track-settings-colors"})}}Ee.registerComponent("TextTrackSettingsColors",Bb);class Ub extends Ee{constructor(e,t={}){super(e,t);const n=this.options_.textTrackComponentid,r=new $s(e,{id_:n,legendId:`captions-font-size-${n}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(r);const s=new $s(e,{id_:n,legendId:`captions-edge-style-${n}`,legendText:this.localize("Text Edge Style"),className:"vjs-edge-style vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(s);const a=new $s(e,{id_:n,legendId:`captions-font-family-${n}`,legendText:this.localize("Font Family"),className:"vjs-font-family vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(a)}createEl(){return ot("div",{className:"vjs-track-settings-font"})}}Ee.registerComponent("TextTrackSettingsFont",Ub);class Fb extends Ee{constructor(e,t={}){super(e,t);const n=new Vn(e,{controlText:this.localize("restore all settings to the default values"),className:"vjs-default-button"});n.el().classList.remove("vjs-control","vjs-button"),n.el().textContent=this.localize("Reset"),this.addChild(n);const r=this.localize("Done"),s=new Vn(e,{controlText:r,className:"vjs-done-button"});s.el().classList.remove("vjs-control","vjs-button"),s.el().textContent=r,this.addChild(s)}createEl(){return ot("div",{className:"vjs-track-settings-controls"})}}Ee.registerComponent("TrackSettingsControls",Fb);const Tp="vjs-text-track-settings",Vb=["#000","Black"],jb=["#00F","Blue"],$b=["#0FF","Cyan"],Hb=["#0F0","Green"],qb=["#F0F","Magenta"],zb=["#F00","Red"],Gb=["#FFF","White"],Wb=["#FF0","Yellow"],Sp=["1","Opaque"],Cp=["0.5","Semi-Transparent"],Kb=["0","Transparent"],os={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[Vb,Gb,zb,Hb,jb,Wb,qb,$b],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[Sp,Cp,Kb],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[Gb,Vb,zb,Hb,jb,Wb,qb,$b],className:"vjs-text-color"},edgeStyle:{selector:".vjs-edge-style > select",id:"",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:i=>i==="1.00"?null:Number(i)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[Sp,Cp],className:"vjs-text-opacity vjs-opacity"},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color",className:"vjs-window-color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[Kb,Cp,Sp],className:"vjs-window-opacity vjs-opacity"}};os.windowColor.options=os.backgroundColor.options;function Xb(i,e){if(e&&(i=e(i)),i&&i!=="none")return i}function FA(i,e){const t=i.options[i.options.selectedIndex].value;return Xb(t,e)}function VA(i,e,t){if(e){for(let n=0;n<i.options.length;n++)if(Xb(i.options[n].value,t)===e){i.selectedIndex=n;break}}}class jA extends La{constructor(e,t){t.temporary=!1,super(e,t),this.updateDisplay=this.updateDisplay.bind(this),this.fill(),this.hasBeenOpened_=this.hasBeenFilled_=!0,this.renderModalComponents(e),this.endDialog=ot("p",{className:"vjs-control-text",textContent:this.localize("End of dialog window.")}),this.el().appendChild(this.endDialog),this.setDefaults(),t.persistTextTrackSettings===void 0&&(this.options_.persistTextTrackSettings=this.options_.playerOptions.persistTextTrackSettings),this.bindFunctionsToSelectsAndButtons(),this.options_.persistTextTrackSettings&&this.restoreSettings()}renderModalComponents(e){const t=new Bb(e,{textTrackComponentid:this.id_,selectConfigs:os,fieldSets:[["color","textOpacity"],["backgroundColor","backgroundOpacity"],["windowColor","windowOpacity"]]});this.addChild(t);const n=new Ub(e,{textTrackComponentid:this.id_,selectConfigs:os,fieldSets:[["fontPercent"],["edgeStyle"],["fontFamily"]]});this.addChild(n);const r=new Fb(e);this.addChild(r)}bindFunctionsToSelectsAndButtons(){this.on(this.$(".vjs-done-button"),["click","tap"],()=>{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),["click","tap"],()=>{this.setDefaults(),this.updateDisplay()}),Ea(os,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})}dispose(){this.endDialog=null,super.dispose()}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return g1(os,(e,t,n)=>{const r=FA(this.$(t.selector),t.parser);return r!==void 0&&(e[n]=r),e},{})}setValues(e){Ea(os,(t,n)=>{VA(this.$(t.selector),e[n],t.parser)})}setDefaults(){Ea(os,e=>{const t=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=t})}restoreSettings(){let e;try{e=JSON.parse(te.localStorage.getItem(Tp))}catch(t){_t.warn(t)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?te.localStorage.setItem(Tp,JSON.stringify(e)):te.localStorage.removeItem(Tp)}catch(t){_t.warn(t)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}}Ee.registerComponent("TextTrackSettings",jA);class $A extends Ee{constructor(e,t){let n=t.ResizeObserver||te.ResizeObserver;t.ResizeObserver===null&&(n=!1);const r=Ot({createEl:!n,reportTouchActivity:!1},t);super(e,r),this.ResizeObserver=t.ResizeObserver||te.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=j1(()=>{this.resizeHandler()},100,!1,this),n?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const s=this.debouncedHandler_;let a=this.unloadListener_=function(){Fn(this,"resize",s),Fn(this,"unload",a),a=null};pi(this.el_.contentWindow,"unload",a),pi(this.el_.contentWindow,"resize",s)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){!this.player_||!this.player_.trigger||this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}}Ee.registerComponent("ResizeManager",$A);const HA={trackingThreshold:20,liveTolerance:15};class qA extends Ee{constructor(e,t){const n=Ot(HA,t,{createEl:!1});super(e,n),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=r=>this.handlePlay(r),this.handleFirstTimeupdate_=r=>this.handleFirstTimeupdate(r),this.handleSeeked_=r=>this.handleSeeked(r),this.seekToLiveEdge_=r=>this.seekToLiveEdge(r),this.reset_(),this.on(this.player_,"durationchange",r=>this.handleDurationchange(r)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const t=Number(te.performance.now().toFixed(4)),n=this.lastTime_===-1?0:(t-this.lastTime_)/1e3;this.lastTime_=t,this.pastSeekEnd_=this.pastSeekEnd()+n;const r=this.liveCurrentTime(),s=this.player_.currentTime();let a=this.player_.paused()||this.seekedBehindLive_||Math.abs(r-s)>this.options_.liveTolerance;(!this.timeupdateSeen_||r===1/0)&&(a=!1),a!==this.behindLiveEdge_&&(this.behindLiveEdge_=a,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,Ei),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),t=[];let n=e?e.length:0;for(;n--;)t.push(e.end(n));return t.length?t.sort()[t.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),t=[];let n=e?e.length:0;for(;n--;)t.push(e.start(n));return t.length?t.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return typeof this.trackingInterval_=="number"}seekToLiveEdge(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}Ee.registerComponent("LiveTracker",qA);class zA extends Ee{constructor(e,t){super(e,t),this.on("statechanged",n=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:ot("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${xi()}`}),description:ot("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${xi()}`})},ot("div",{className:"vjs-title-bar"},{},v1(this.els))}updateDom_(){const e=this.player_.tech_,t=e&&e.el_,n={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(r=>{const s=this.state[r],a=this.els[r],o=n[r];yu(a),s&&rs(a,s),t&&(t.removeAttribute(o),s&&t.setAttribute(o,a.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,t=e&&e.el_;t&&(t.removeAttribute("aria-labelledby"),t.removeAttribute("aria-describedby")),super.dispose(),this.els=null}}Ee.registerComponent("TitleBar",zA);const GA={initialDisplay:4e3,position:[],takeFocus:!1};class WA extends Vn{constructor(e,t){t=Ot(GA,t),super(e,t),this.controlText(t.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],n=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){const e=ot("button",{},{type:"button",class:this.buildCSSClass()},ot("span"));return this.controlTextEl_=e.querySelector("span"),e}show(){super.show(),this.addClass("force-display"),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout(()=>{this.removeClass("force-display")},this.options_.initialDisplay)}hide(){this.removeClass("force-display"),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}}Ee.registerComponent("TransientButton",WA);const xp=i=>{const e=i.el();if(e.hasAttribute("src"))return i.triggerSourceset(e.src),!0;const t=i.$$("source"),n=[];let r="";if(!t.length)return!1;for(let s=0;s<t.length;s++){const a=t[s].src;a&&n.indexOf(a)===-1&&n.push(a)}return n.length?(n.length===1&&(r=n[0]),i.triggerSourceset(r),!0):!1},KA=Object.defineProperty({},"innerHTML",{get(){return this.cloneNode(!0).innerHTML},set(i){const e=Fe.createElement(this.nodeName.toLowerCase());e.innerHTML=i;const t=Fe.createDocumentFragment();for(;e.childNodes.length;)t.appendChild(e.childNodes[0]);return this.innerText="",te.Element.prototype.appendChild.call(this,t),this.innerHTML}}),Yb=(i,e)=>{let t={};for(let n=0;n<i.length&&(t=Object.getOwnPropertyDescriptor(i[n],e),!(t&&t.set&&t.get));n++);return t.enumerable=!0,t.configurable=!0,t},XA=i=>Yb([i.el(),te.HTMLMediaElement.prototype,te.Element.prototype,KA],"innerHTML"),Jb=function(i){const e=i.el();if(e.resetSourceWatch_)return;const t={},n=XA(i),r=s=>(...a)=>{const o=s.apply(e,a);return xp(i),o};["append","appendChild","insertAdjacentHTML"].forEach(s=>{e[s]&&(t[s]=e[s],e[s]=r(t[s]))}),Object.defineProperty(e,"innerHTML",Ot(n,{set:r(n.set)})),e.resetSourceWatch_=()=>{e.resetSourceWatch_=null,Object.keys(t).forEach(s=>{e[s]=t[s]}),Object.defineProperty(e,"innerHTML",n)},i.one("sourceset",e.resetSourceWatch_)},YA=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?eb(te.Element.prototype.getAttribute.call(this,"src")):""},set(i){return te.Element.prototype.setAttribute.call(this,"src",i),i}}),JA=i=>Yb([i.el(),te.HTMLMediaElement.prototype,YA],"src"),QA=function(i){if(!i.featuresSourceset)return;const e=i.el();if(e.resetSourceset_)return;const t=JA(i),n=e.setAttribute,r=e.load;Object.defineProperty(e,"src",Ot(t,{set:s=>{const a=t.set.call(e,s);return i.triggerSourceset(e.src),a}})),e.setAttribute=(s,a)=>{const o=n.call(e,s,a);return/src/i.test(s)&&i.triggerSourceset(e.src),o},e.load=()=>{const s=r.call(e);return xp(i)||(i.triggerSourceset(""),Jb(i)),s},e.currentSrc?i.triggerSourceset(e.currentSrc):xp(i)||Jb(i),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=r,e.setAttribute=n,Object.defineProperty(e,"src",t),e.resetSourceWatch_&&e.resetSourceWatch_()}};class Je extends gt{constructor(e,t){super(e,t);const n=e.source;let r=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO",n&&(this.el_.currentSrc!==n.src||e.tag&&e.tag.initNetworkState_===3)?this.setSource(n):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const s=this.el_.childNodes;let a=s.length;const o=[];for(;a--;){const c=s[a];c.nodeName.toLowerCase()==="track"&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(c),this.remoteTextTracks().addTrack(c.track),this.textTracks().addTrack(c.track),!r&&!this.el_.hasAttribute("crossorigin")&&xu(c.src)&&(r=!0)):o.push(c))}for(let c=0;c<o.length;c++)this.el_.removeChild(o[c])}this.proxyNativeTracks_(),this.featuresNativeTextTracks&&r&&_t.warn(`Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.
|
200
|
+
This may prevent text tracks from loading.`),this.restoreMetadataTracksInIOSNativePlayer_(),(nl||uu)&&e.nativeControlsForTouch===!0&&this.setControls(!0),this.proxyWebkitFullscreen_(),this.triggerReady()}dispose(){this.el_&&this.el_.resetSourceset_&&this.el_.resetSourceset_(),Je.disposeMediaElement(this.el_),this.options_=null,super.dispose()}setupSourcesetHandling_(){QA(this)}restoreMetadataTracksInIOSNativePlayer_(){const e=this.textTracks();let t;const n=()=>{t=[];for(let s=0;s<e.length;s++){const a=e[s];a.kind==="metadata"&&t.push({track:a,storedMode:a.mode})}};n(),e.addEventListener("change",n),this.on("dispose",()=>e.removeEventListener("change",n));const r=()=>{for(let s=0;s<t.length;s++){const a=t[s];a.track.mode==="disabled"&&a.track.mode!==a.storedMode&&(a.track.mode=a.storedMode)}e.removeEventListener("change",r)};this.on("webkitbeginfullscreen",()=>{e.removeEventListener("change",n),e.removeEventListener("change",r),e.addEventListener("change",r)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",n),e.addEventListener("change",n),e.removeEventListener("change",r)})}overrideNative_(e,t){if(t!==this[`featuresNative${e}Tracks`])return;const n=e.toLowerCase();this[`${n}TracksListeners_`]&&Object.keys(this[`${n}TracksListeners_`]).forEach(r=>{this.el()[`${n}Tracks`].removeEventListener(r,this[`${n}TracksListeners_`][r])}),this[`featuresNative${e}Tracks`]=!t,this[`${n}TracksListeners_`]=null,this.proxyNativeTracksForType_(n)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const t=wi[e],n=this.el()[t.getterName],r=this[t.getterName]();if(!this[`featuresNative${t.capitalName}Tracks`]||!n||!n.addEventListener)return;const s={change:o=>{const c={type:"change",target:r,currentTarget:r,srcElement:r};r.trigger(c),e==="text"&&this[Ba.remoteText.getterName]().trigger(c)},addtrack(o){r.addTrack(o.track)},removetrack(o){r.removeTrack(o.track)}},a=function(){const o=[];for(let c=0;c<r.length;c++){let u=!1;for(let d=0;d<n.length;d++)if(n[d]===r[c]){u=!0;break}u||o.push(r[c])}for(;o.length;)r.removeTrack(o.shift())};this[t.getterName+"Listeners_"]=s,Object.keys(s).forEach(o=>{const c=s[o];n.addEventListener(o,c),this.on("dispose",u=>n.removeEventListener(o,c))}),this.on("loadstart",a),this.on("dispose",o=>this.off("loadstart",a))}proxyNativeTracks_(){wi.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){const n=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(n,e),Je.disposeMediaElement(e),e=n}else{e=Fe.createElement("video");const n=this.options_.tag&&ss(this.options_.tag),r=Ot({},n);(!nl||this.options_.nativeControlsForTouch!==!0)&&delete r.controls,w1(e,Object.assign(r,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&Pa(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const t=["loop","muted","playsinline","autoplay"];for(let n=0;n<t.length;n++){const r=t[n],s=this.options_[r];typeof s<"u"&&(s?Pa(e,r,r):gu(e,r),e[r]=s)}return e}handleLateInit_(e){if(e.networkState===0||e.networkState===3)return;if(e.readyState===0){let n=!1;const r=function(){n=!0};this.on("loadstart",r);const s=function(){n||this.trigger("loadstart")};this.on("loadedmetadata",s),this.ready(function(){this.off("loadstart",r),this.off("loadedmetadata",s),n||this.trigger("loadstart")});return}const t=["loadstart"];t.push("loadedmetadata"),e.readyState>=2&&t.push("loadeddata"),e.readyState>=3&&t.push("canplay"),e.readyState>=4&&t.push("canplaythrough"),this.ready(function(){t.forEach(function(n){this.trigger(n)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&pu?this.el_.fastSeek(e):this.el_.currentTime=e}catch(t){_t(t,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&ji&&sr&&this.el_.currentTime===0){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},t=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",t),this.on("dispose",()=>{this.off("webkitbeginfullscreen",t),this.off("webkitendfullscreen",e)})}supportsFullScreen(){return typeof this.el_.webkitEnterFullScreen=="function"}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)or(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}},0);else try{e.webkitEnterFullScreen()}catch(t){this.trigger("fullscreenerror",t)}}exitFullScreen(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(e===void 0)return this.el_.src;this.setSrc(e)}addSourceElement(e,t){if(!e)return _t.error("Invalid source URL."),!1;const n={src:e};t&&(n.type=t);const r=ot("source",{},n);return this.el_.appendChild(r),!0}removeSourceElement(e){if(!e)return _t.error("Source URL is required to remove the source element."),!1;const t=this.el_.querySelectorAll("source");for(const n of t)if(n.src===e)return this.el_.removeChild(n),!0;return _t.warn(`No matching source element found with src: ${e}`),!1}reset(){Je.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,t,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,t,n):super.addTextTrack(e,t,n)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const t=Fe.createElement("track");return e.kind&&(t.kind=e.kind),e.label&&(t.label=e.label),(e.language||e.srclang)&&(t.srclang=e.language||e.srclang),e.default&&(t.default=e.default),e.id&&(t.id=e.id),e.src&&(t.src=e.src),t}addRemoteTextTrack(e,t){const n=super.addRemoteTextTrack(e,t);return this.featuresNativeTextTracks&&this.el().appendChild(n),n}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const t=this.$$("track");let n=t.length;for(;n--;)(e===t[n]||e===t[n].track)&&this.el().removeChild(t[n])}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();const e={};return typeof this.el().webkitDroppedFrameCount<"u"&&typeof this.el().webkitDecodedFrameCount<"u"&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),te.performance&&(e.creationTime=te.performance.now()),e}}su(Je,"TEST_VID",function(){if(!Ia())return;const i=Fe.createElement("video"),e=Fe.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",i.appendChild(e),i}),Je.isSupported=function(){try{Je.TEST_VID.volume=.5}catch{return!1}return!!(Je.TEST_VID&&Je.TEST_VID.canPlayType)},Je.canPlayType=function(i){return Je.TEST_VID.canPlayType(i)},Je.canPlaySource=function(i,e){return Je.canPlayType(i.type)},Je.canControlVolume=function(){try{const i=Je.TEST_VID.volume;Je.TEST_VID.volume=i/2+.1;const e=i!==Je.TEST_VID.volume;return e&&Un?(te.setTimeout(()=>{Je&&Je.prototype&&(Je.prototype.featuresVolumeControl=i!==Je.TEST_VID.volume)}),!1):e}catch{return!1}},Je.canMuteVolume=function(){try{const i=Je.TEST_VID.muted;return Je.TEST_VID.muted=!i,Je.TEST_VID.muted?Pa(Je.TEST_VID,"muted","muted"):gu(Je.TEST_VID,"muted","muted"),i!==Je.TEST_VID.muted}catch{return!1}},Je.canControlPlaybackRate=function(){if(ji&&sr&&au<58)return!1;try{const i=Je.TEST_VID.playbackRate;return Je.TEST_VID.playbackRate=i/2+.1,i!==Je.TEST_VID.playbackRate}catch{return!1}},Je.canOverrideAttributes=function(){try{const i=()=>{};Object.defineProperty(Fe.createElement("video"),"src",{get:i,set:i}),Object.defineProperty(Fe.createElement("audio"),"src",{get:i,set:i}),Object.defineProperty(Fe.createElement("video"),"innerHTML",{get:i,set:i}),Object.defineProperty(Fe.createElement("audio"),"innerHTML",{get:i,set:i})}catch{return!1}return!0},Je.supportsNativeTextTracks=function(){return pu||Un&&sr},Je.supportsNativeVideoTracks=function(){return!!(Je.TEST_VID&&Je.TEST_VID.videoTracks)},Je.supportsNativeAudioTracks=function(){return!!(Je.TEST_VID&&Je.TEST_VID.audioTracks)},Je.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function([i,e]){su(Je.prototype,i,()=>Je[e](),!0)}),Je.prototype.featuresVolumeControl=Je.canControlVolume(),Je.prototype.movingMediaElementInDOM=!Un,Je.prototype.featuresFullscreenResize=!0,Je.prototype.featuresProgressEvents=!0,Je.prototype.featuresTimeupdateEvents=!0,Je.prototype.featuresVideoFrameCallback=!!(Je.TEST_VID&&Je.TEST_VID.requestVideoFrameCallback),Je.disposeMediaElement=function(i){if(i){for(i.parentNode&&i.parentNode.removeChild(i);i.hasChildNodes();)i.removeChild(i.firstChild);i.removeAttribute("src"),typeof i.load=="function"&&function(){try{i.load()}catch{}}()}},Je.resetMediaElement=function(i){if(!i)return;const e=i.querySelectorAll("source");let t=e.length;for(;t--;)i.removeChild(e[t]);i.removeAttribute("src"),typeof i.load=="function"&&function(){try{i.load()}catch{}}()},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(i){Je.prototype[i]=function(){return this.el_[i]||this.el_.hasAttribute(i)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(i){Je.prototype["set"+an(i)]=function(e){this.el_[i]=e,e?this.el_.setAttribute(i,i):this.el_.removeAttribute(i)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(i){Je.prototype[i]=function(){return this.el_[i]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(i){Je.prototype["set"+an(i)]=function(e){this.el_[i]=e}}),["pause","load","play"].forEach(function(i){Je.prototype[i]=function(){return this.el_[i]()}}),gt.withSourceHandlers(Je),Je.nativeSourceHandler={},Je.nativeSourceHandler.canPlayType=function(i){try{return Je.TEST_VID.canPlayType(i)}catch{return""}},Je.nativeSourceHandler.canHandleSource=function(i,e){if(i.type)return Je.nativeSourceHandler.canPlayType(i.type);if(i.src){const t=ip(i.src);return Je.nativeSourceHandler.canPlayType(`video/${t}`)}return""},Je.nativeSourceHandler.handleSource=function(i,e,t){e.setSrc(i.src)},Je.nativeSourceHandler.dispose=function(){},Je.registerSourceHandler(Je.nativeSourceHandler),gt.registerTech("Html5",Je);const Qb=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Ep={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},wp=["tiny","xsmall","small","medium","large","xlarge","huge"],Pu={};wp.forEach(i=>{const e=i.charAt(0)==="x"?`x-${i.substring(1)}`:i;Pu[i]=`vjs-layout-${e}`});const ZA={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class wt extends Ee{constructor(e,t,n){if(e.id=e.id||t.id||`vjs_video_${xi()}`,t=Object.assign(wt.getTagSettings(e),t),t.initChildren=!1,t.createEl=!1,t.evented=!1,t.reportTouchActivity=!1,!t.language){const a=e.closest("[lang]");a&&(t.language=a.getAttribute("lang"))}if(super(null,t,n),this.boundDocumentFullscreenChange_=a=>this.documentFullscreenChange_(a),this.boundFullWindowOnEscKey_=a=>this.fullWindowOnEscKey(a),this.boundUpdateStyleEl_=a=>this.updateStyleEl_(a),this.boundApplyInitTime_=a=>this.applyInitTime_(a),this.boundUpdateCurrentBreakpoint_=a=>this.updateCurrentBreakpoint_(a),this.boundHandleTechClick_=a=>this.handleTechClick_(a),this.boundHandleTechDoubleClick_=a=>this.handleTechDoubleClick_(a),this.boundHandleTechTouchStart_=a=>this.handleTechTouchStart_(a),this.boundHandleTechTouchMove_=a=>this.handleTechTouchMove_(a),this.boundHandleTechTouchEnd_=a=>this.handleTechTouchEnd_(a),this.boundHandleTechTap_=a=>this.handleTechTap_(a),this.boundUpdatePlayerHeightOnAudioOnlyMode_=a=>this.updatePlayerHeightOnAudioOnlyMode_(a),this.isFullscreen_=!1,this.log=p1(this.id_),this.fsApi_=iu,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&ss(e),this.language(this.options_.language),t.languages){const a={};Object.getOwnPropertyNames(t.languages).forEach(function(o){a[o.toLowerCase()]=t.languages[o]}),this.languages_=a}else this.languages_=wt.prototype.options_.languages;this.resetCache_(),this.poster_=t.poster||"",this.controls_=!!t.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),t.plugins&&Object.keys(t.plugins).forEach(a=>{if(typeof this[a]!="function")throw new Error(`plugin "${a}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),Gf(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(pi(Fe,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const r=Ot(this.options_);if(t.plugins&&Object.keys(t.plugins).forEach(a=>{this[a](t.plugins[a])}),t.debug&&this.debug(!0),this.options_.playerOptions=r,this.middleware_=[],this.playbackRates(t.playbackRates),t.experimentalSvgIcons){const o=new te.DOMParser().parseFromString(TA,"image/svg+xml");if(o.querySelector("parsererror"))_t.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const u=o.documentElement;u.style.display="none",this.el_.appendChild(u),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio(e.nodeName.toLowerCase()==="audio"),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),t.spatialNavigation&&t.spatialNavigation.enabled&&(this.spatialNavigation=new SA(this),this.addClass("vjs-spatial-navigation-enabled")),nl&&this.addClass("vjs-touch-enabled"),Un||this.addClass("vjs-workinghover"),wt.players[this.id_]=this;const s=Of.split(".")[0];this.addClass(`vjs-v${s}`),this.userActive(!0),this.reportUserActivity(),this.one("play",a=>this.listenForUserActivity_(a)),this.on("keydown",a=>this.handleKeyDown(a)),this.on("languagechange",a=>this.handleLanguagechange(a)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose"),this.off("dispose"),Fn(Fe,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),Fn(Fe,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),wt.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),yA(this),Xn.names.forEach(e=>{const t=Xn[e],n=this[t.getterName]();n&&n.off&&n.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e=this.tag,t,n=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player");const r=this.tag.tagName.toLowerCase()==="video-js";n?t=this.el_=e.parentNode:r||(t=this.el_=super.createEl("div"));const s=ss(e);if(r){for(t=this.el_=e,e=this.tag=Fe.createElement("video");t.children.length;)e.appendChild(t.firstChild);il(t,"video-js")||Ls(t,"video-js"),t.appendChild(e),n=this.playerElIngest_=t,Object.keys(t).forEach(c=>{try{e[c]=t[c]}catch{}})}e.setAttribute("tabindex","-1"),s.tabindex="-1",sr&&lu&&(e.setAttribute("role","application"),s.role="application"),e.removeAttribute("width"),e.removeAttribute("height"),"width"in s&&delete s.width,"height"in s&&delete s.height,Object.getOwnPropertyNames(s).forEach(function(c){r&&c==="class"||t.setAttribute(c,s[c]),r&&e.setAttribute(c,s[c])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=t.player=this,this.addClass("vjs-paused");const a=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter(c=>T1[c]).map(c=>"vjs-device-"+c.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...a),te.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=U1("vjs-styles-dimensions");const c=as(".vjs-styles-defaults"),u=as("head");u.insertBefore(this.styleEl_,c?c.nextSibling:u.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const o=e.getElementsByTagName("a");for(let c=0;c<o.length;c++){const u=o.item(c);Ls(u,"vjs-hidden"),u.setAttribute("hidden","hidden")}return e.initNetworkState_=e.networkState,e.parentNode&&!n&&e.parentNode.insertBefore(t,e),Bf(e,t),this.children_.unshift(e),this.el_.setAttribute("lang",this.language_),this.el_.setAttribute("translate","no"),this.el_=t,t}crossOrigin(e){if(typeof e>"u")return this.techGet_("crossOrigin");if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){_t.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e)}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,t){const n=e+"_";if(t===void 0)return this[n]||0;if(t===""||t==="auto"){this[n]=void 0,this.updateStyleEl_();return}const r=parseFloat(t);if(isNaN(r)){_t.error(`Improper value "${t}" supplied for for ${e}`);return}this[n]=r,this.updateStyleEl_()}fluid(e){if(e===void 0)return!!this.fluid_;this.fluid_=!!e,Ir(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),QD(this,()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(e===void 0)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(e===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(te.VIDEOJS_NO_DYNAMIC_STYLE===!0){const o=typeof this.width_=="number"?this.width_:this.options_.width,c=typeof this.height_=="number"?this.height_:this.options_.height,u=this.tech_&&this.tech_.el();u&&(o>=0&&(u.width=o),c>=0&&(u.height=c));return}let e,t,n,r;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?n=this.aspectRatio_:this.videoWidth()>0?n=this.videoWidth()+":"+this.videoHeight():n="16:9";const s=n.split(":"),a=s[1]/s[0];this.width_!==void 0?e=this.width_:this.height_!==void 0?e=this.height_/a:e=this.videoWidth()||300,this.height_!==void 0?t=this.height_:t=e*a,/^[^a-zA-Z]/.test(this.id())?r="dimensions-"+this.id():r=this.id()+"-dimensions",this.addClass(r),F1(this.styleEl_,`
|
201
|
+
.${r} {
|
202
|
+
width: ${e}px;
|
203
|
+
height: ${t}px;
|
204
|
+
}
|
205
|
+
|
206
|
+
.${r}.vjs-fluid:not(.vjs-audio-only-mode) {
|
207
|
+
padding-top: ${a*100}%;
|
208
|
+
}
|
209
|
+
`)}loadTech_(e,t){this.tech_&&this.unloadTech_();const n=an(e),r=e.charAt(0).toLowerCase()+e.slice(1);n!=="Html5"&&this.tag&&(gt.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=n,this.isReady_=!1;let s=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(s=!1);const a={source:t,autoplay:s,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${r}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};Xn.names.forEach(c=>{const u=Xn[c];a[u.getterName]=this[u.privateName]}),Object.assign(a,this.options_[n]),Object.assign(a,this.options_[r]),Object.assign(a,this.options_[e.toLowerCase()]),this.tag&&(a.tag=this.tag),t&&t.src===this.cache_.src&&this.cache_.currentTime>0&&(a.startTime=this.cache_.currentTime);const o=gt.getTech(e);if(!o)throw new Error(`No Tech named '${n}' exists! '${n}' should be registered using videojs.registerTech()'`);this.tech_=new o(a),this.tech_.ready(Ht(this,this.handleTechReady_),!0),Yf.jsonToTextTracks(this.textTracksJson_||[],this.tech_),Qb.forEach(c=>{this.on(this.tech_,c,u=>this[`handleTech${an(c)}_`](u))}),Object.keys(Ep).forEach(c=>{this.on(this.tech_,c,u=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${Ep[c]}_`].bind(this),event:u});return}this[`handleTech${Ep[c]}_`](u)})}),this.on(this.tech_,"loadstart",c=>this.handleTechLoadStart_(c)),this.on(this.tech_,"sourceset",c=>this.handleTechSourceset_(c)),this.on(this.tech_,"waiting",c=>this.handleTechWaiting_(c)),this.on(this.tech_,"ended",c=>this.handleTechEnded_(c)),this.on(this.tech_,"seeking",c=>this.handleTechSeeking_(c)),this.on(this.tech_,"play",c=>this.handleTechPlay_(c)),this.on(this.tech_,"pause",c=>this.handleTechPause_(c)),this.on(this.tech_,"durationchange",c=>this.handleTechDurationChange_(c)),this.on(this.tech_,"fullscreenchange",(c,u)=>this.handleTechFullscreenChange_(c,u)),this.on(this.tech_,"fullscreenerror",(c,u)=>this.handleTechFullscreenError_(c,u)),this.on(this.tech_,"enterpictureinpicture",c=>this.handleTechEnterPictureInPicture_(c)),this.on(this.tech_,"leavepictureinpicture",c=>this.handleTechLeavePictureInPicture_(c)),this.on(this.tech_,"error",c=>this.handleTechError_(c)),this.on(this.tech_,"posterchange",c=>this.handleTechPosterChange_(c)),this.on(this.tech_,"textdata",c=>this.handleTechTextData_(c)),this.on(this.tech_,"ratechange",c=>this.handleTechRateChange_(c)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(n!=="Html5"||!this.tag)&&Bf(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){Xn.names.forEach(e=>{const t=Xn[e];this[t.privateName]=this[t.getterName]()}),this.textTracksJson_=Yf.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return e===void 0&&_t.warn(`Using the tech directly can be dangerous. I hope you know what you're doing.
|
210
|
+
See https://github.com/videojs/video.js/issues/2617 for more info.
|
211
|
+
`),this.tech_}version(){return{"video.js":Of}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||typeof e!="string")return;const t=()=>{const r=this.muted();this.muted(!0);const s=()=>{this.muted(r)};this.playTerminatedQueue_.push(s);const a=this.play();if(ll(a))return a.catch(o=>{throw s(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${o||""}`)})};let n;if(e==="any"&&!this.muted()?(n=this.play(),ll(n)&&(n=n.catch(t))):e==="muted"&&!this.muted()?n=t():n=this.play(),!!ll(n))return n.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})})}updateSourceCaches_(e=""){let t=e,n="";typeof t!="string"&&(t=e.src,n=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],t&&!n&&(n=kA(this,t)),this.cache_.source=Ot({},e,{src:t,type:n});const r=this.cache_.sources.filter(c=>c.src&&c.src===t),s=[],a=this.$$("source"),o=[];for(let c=0;c<a.length;c++){const u=ss(a[c]);s.push(u),u.src&&u.src===t&&o.push(u.src)}o.length&&!r.length?this.cache_.sources=s:r.length||(this.cache_.sources=[this.cache_.source]),this.cache_.src=t}handleTechSourceset_(e){if(!this.changingSrc_){let t=s=>this.updateSourceCaches_(s);const n=this.currentSource().src,r=e.src;n&&!/^blob:/.test(n)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==n)&&(t=()=>{}),t(r),e.src||this.tech_.any(["sourceset","loadstart"],s=>{if(s.type==="sourceset")return;const a=this.techGet_("currentSrc");this.lastSource_.tech=a,this.updateSourceCaches_(a)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(e===void 0)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),t=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",t))};this.on("timeupdate",t)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.click===void 0||this.options_.userActions.click!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,e):this.paused()?or(this.play()):this.pause())}handleTechDoubleClick_(e){if(!this.controls_)return;Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),n=>n.contains(e.target))||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||this.options_.userActions.doubleClick!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,e):this.isInPictureInPicture()&&!Fe.pictureInPictureElement?this.exitPictureInPicture():this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const t=e.target.player;if(t&&t!==this)return;const n=this.el();let r=Fe[this.fsApi_.fullscreenElement]===n;!r&&n.matches&&(r=n.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(r)}handleTechFullscreenChange_(e,t){t&&(t.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(t.isFullscreen))}handleTechFullscreenError_(e,t){this.trigger("fullscreenerror",t)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,t){this.ready(function(){if(e in gA)return pA(this.middleware_,this.tech_,e,t);if(e in ab)return sb(this.middleware_,this.tech_,e,t);try{this.tech_&&this.tech_[e](t)}catch(n){throw _t(n),n}},!0)}techGet_(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in mA)return fA(this.middleware_,this.tech_,e);if(e in ab)return sb(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(t){throw this.tech_[e]===void 0?(_t(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,t),t):t.name==="TypeError"?(_t(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,t),this.tech_.isReady_=!1,t):(_t(t),t)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=or){this.playCallbacks_.push(e);const t=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),n=!!(pu||Un);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!t){this.waitToPlay_=a=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!t&&n&&this.load();return}const r=this.techGet_("play");n&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),r===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(t){t()})}runPlayCallbacks_(e){const t=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],t.forEach(function(n){n(e)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")!==!1}played(){return this.techGet_("played")||$i(0,0)}scrubbing(e){if(typeof e>"u")return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){if(e===void 0)return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime;if(e<0&&(e=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",e),this.cache_.initTime=0,isFinite(e)&&(this.cache_.currentTime=Number(e))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(e===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;e=parseFloat(e),e<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return(!e||!e.length)&&(e=$i(0,0)),e}seekable(){let e=this.techGet_("seekable");return(!e||!e.length)&&(e=$i(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return Y1(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),t=this.duration();let n=e.end(e.length-1);return n>t&&(n=t),n}volume(e){let t;if(e!==void 0){t=Math.max(0,Math.min(1,e)),this.cache_.volume=t,this.techCall_("setVolume",t),t>0&&this.lastVolume_(t);return}return t=parseFloat(this.techGet_("volume")),isNaN(t)?1:t}muted(e){if(e!==void 0){this.techCall_("setMuted",e);return}return this.techGet_("muted")||!1}defaultMuted(e){return e!==void 0&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(e!==void 0&&e!==0){this.cache_.lastVolume=e;return}return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(e!==void 0){const t=this.isFullscreen_;this.isFullscreen_=!!e,this.isFullscreen_!==t&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const t=this;return new Promise((n,r)=>{function s(){t.off("fullscreenerror",o),t.off("fullscreenchange",a)}function a(){s(),n()}function o(u,d){s(),r(d)}t.one("fullscreenchange",a),t.one("fullscreenerror",o);const c=t.requestFullscreenHelper_(e);c&&(c.then(s,s),c.then(n,r))})}requestFullscreenHelper_(e){let t;if(this.fsApi_.prefixed||(t=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(t=e)),this.fsApi_.requestFullscreen){const n=this.el_[this.fsApi_.requestFullscreen](t);return n&&n.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),n}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((t,n)=>{function r(){e.off("fullscreenerror",a),e.off("fullscreenchange",s)}function s(){r(),t()}function a(c,u){r(),n(u)}e.one("fullscreenchange",s),e.one("fullscreenerror",a);const o=e.exitFullscreenHelper_();o&&(o.then(r,r),o.then(t,n))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=Fe[this.fsApi_.exitFullscreen]();return e&&or(e.then(()=>this.isFullscreen(!1))),e}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=Fe.documentElement.style.overflow,pi(Fe,"keydown",this.boundFullWindowOnEscKey_),Fe.documentElement.style.overflow="hidden",Ls(Fe.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){e.key==="Escape"&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,Fn(Fe,"keydown",this.boundFullWindowOnEscKey_),Fe.documentElement.style.overflow=this.docOrigOverflow,mu(Fe.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(e===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){if(e!==void 0){this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&te.documentPictureInPicture){const e=Fe.createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild(ot("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),te.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(t=>(R1(t),this.el_.parentNode.insertBefore(e,this.el_),t.document.body.appendChild(this.el_),t.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:t}),t.addEventListener("pagehide",n=>{const r=n.target.querySelector(".video-js");e.parentNode.replaceChild(r,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),t))}return"pictureInPictureEnabled"in Fe&&this.disablePictureInPicture()===!1?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(te.documentPictureInPicture&&te.documentPictureInPicture.window)return te.documentPictureInPicture.window.close(),Promise.resolve();if("pictureInPictureEnabled"in Fe)return Fe.exitPictureInPicture()}handleKeyDown(e){const{userActions:t}=this.options_;!t||!t.hotkeys||(r=>{const s=r.tagName.toLowerCase();if(r.isContentEditable)return!0;const a=["button","checkbox","hidden","radio","reset","submit"];return s==="input"?a.indexOf(r.type)===-1:["textarea"].indexOf(s)!==-1})(this.el_.ownerDocument.activeElement)||(typeof t.hotkeys=="function"?t.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){const t=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:n=a=>e.key.toLowerCase()==="f",muteKey:r=a=>e.key.toLowerCase()==="m",playPauseKey:s=a=>e.key.toLowerCase()==="k"||e.key.toLowerCase()===" "}=t;if(n.call(this,e)){e.preventDefault(),e.stopPropagation();const a=Ee.getComponent("FullscreenToggle");Fe[this.fsApi_.fullscreenEnabled]!==!1&&a.prototype.handleClick.call(this,e)}else r.call(this,e)?(e.preventDefault(),e.stopPropagation(),Ee.getComponent("MuteToggle").prototype.handleClick.call(this,e)):s.call(this,e)&&(e.preventDefault(),e.stopPropagation(),Ee.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let t;for(let n=0,r=this.options_.techOrder;n<r.length;n++){const s=r[n];let a=gt.getTech(s);if(a||(a=Ee.getComponent(s)),!a){_t.error(`The "${s}" tech is undefined. Skipped browser support check for that tech.`);continue}if(a.isSupported()&&(t=a.canPlayType(e),t))return t}return""}selectSource(e){const t=this.options_.techOrder.map(o=>[o,gt.getTech(o)]).filter(([o,c])=>c?c.isSupported():(_t.error(`The "${o}" tech is undefined. Skipped browser support check for that tech.`),!1)),n=function(o,c,u){let d;return o.some(h=>c.some(b=>{if(d=u(h,b),d)return!0})),d};let r;const s=o=>(c,u)=>o(u,c),a=([o,c],u)=>{if(c.canPlaySource(u,this.options_[o.toLowerCase()]))return{source:u,tech:o}};return this.options_.sourceOrder?r=n(e,t,s(a)):r=n(t,e,a),r||!1}handleSrc_(e,t){if(typeof e>"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const n=ob(e);if(!n.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,t||(this.cache_.sources=n),this.updateSourceCaches_(n[0]),dA(this,n[0],(r,s)=>{if(this.middleware_=s,t||(this.cache_.sources=n),this.updateSourceCaches_(r),this.src_(r)){if(n.length>1)return this.handleSrc_(n.slice(1));this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),this.triggerReady();return}hA(s,this.tech_)}),n.length>1){const r=()=>{this.error(null),this.handleSrc_(n.slice(1),!0)},s=()=>{this.off("error",r)};this.one("error",r),this.one("playing",s),this.resetRetryOnError_=()=>{this.off("error",r),this.off("playing",s)}}}src(e){return this.handleSrc_(e,!1)}src_(e){const t=this.selectSource([e]);return t?z1(t.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(t.tech,t.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1):!0}addSourceElement(e,t){return this.tech_?this.tech_.addSourceElement(e,t):!1}removeSourceElement(e){return this.tech_?this.tech_.removeSourceElement(e):!1}load(){if(this.tech_&&this.tech_.vhs){this.src(this.currentSource());return}this.techCall_("load")}reset(){if(this.paused())this.doReset_();else{const e=this.play();or(e.then(()=>this.doReset_()))}}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),Ir(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:t,progressControl:n,remainingTimeDisplay:r}=this.controlBar||{},{seekBar:s}=n||{};e&&e.updateContent(),t&&t.updateContent(),r&&r.updateContent(),s&&(s.update(),s.loadProgressBar&&s.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),t=[];return Object.keys(e).length!==0&&t.push(e),this.cache_.sources||t}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){if(e!==void 0){this.techCall_("setPreload",e),this.options_.preload=e;return}return this.techGet_("preload")}autoplay(e){if(e===void 0)return this.options_.autoplay||!1;let t;typeof e=="string"&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e=="string"?e:"play"),t=!1):e?this.options_.autoplay=!0:this.options_.autoplay=!1,t=typeof t>"u"?this.options_.autoplay:t,this.tech_&&this.techCall_("setAutoplay",t)}playsinline(e){return e!==void 0&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){if(e!==void 0){this.techCall_("setLoop",e),this.options_.loop=e;return}return this.techGet_("loop")}poster(e){if(e===void 0)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(e===void 0)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(e===void 0)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(e===void 0)return this.error_||null;if(ns("beforeerror").forEach(t=>{const n=t(this,e);if(!(rr(n)&&!Array.isArray(n)||typeof n=="string"||typeof n=="number"||n===null)){this.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=n}),this.options_.suppressNotSupportedError&&e&&e.code===4){const t=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],t),this.one("loadstart",function(){this.off(["click","touchstart"],t)});return}if(e===null){this.error_=null,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new Zt(e),this.addClass("vjs-error"),_t.error(`(CODE:${this.error_.code} ${Zt.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),ns("error").forEach(t=>t(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(e===void 0)return this.userActive_;if(e=!!e,e!==this.userActive_){if(this.userActive_=e,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(t){t.stopPropagation(),t.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,t,n;const r=Ht(this,this.reportUserActivity),s=function(h){(h.screenX!==t||h.screenY!==n)&&(t=h.screenX,n=h.screenY,r())},a=function(){r(),this.clearInterval(e),e=this.setInterval(r,250)},o=function(h){r(),this.clearInterval(e)};this.on("mousedown",a),this.on("mousemove",s),this.on("mouseup",o),this.on("mouseleave",o);const c=this.getChild("controlBar");c&&!Un&&!ji&&(c.on("mouseenter",function(h){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),c.on("mouseleave",function(h){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",r),this.on("keyup",r);let u;const d=function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(u);const h=this.options_.inactivityTimeout;h<=0||(u=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},h))};this.setInterval(d,250)}playbackRate(e){if(e!==void 0){this.techCall_("setPlaybackRate",e);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1}defaultPlaybackRate(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(e!==void 0){this.isAudio_=!!e;return}return!!this.isAudio_}updatePlayerHeightOnAudioOnlyMode_(){const e=this.getChild("ControlBar");!e||this.audioOnlyCache_.controlBarHeight===e.currentHeight()||(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),t=this.getChild("ControlBar"),n=t&&t.currentHeight();e.forEach(r=>{r!==t&&r.el_&&!r.hasClass("vjs-hidden")&&(r.hide(),this.audioOnlyCache_.hiddenChildren.push(r))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=n,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(n),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if(typeof e!="boolean"||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const t=[];return this.isInPictureInPicture()&&t.push(this.exitPictureInPicture()),this.isFullscreen()&&t.push(this.exitFullscreen()),this.audioPosterMode()&&t.push(this.audioPosterMode(!1)),Promise.all(t).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return typeof e!="boolean"||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.disablePosterModeUI_()}))}addTextTrack(e,t,n){if(this.tech_)return this.tech_.addTextTrack(e,t,n)}addRemoteTextTrack(e,t){if(this.tech_)return this.tech_.addRemoteTextTrack(e,t)}removeRemoteTextTrack(e={}){let{track:t}=e;if(t||(t=e),this.tech_)return this.tech_.removeRemoteTextTrack(t)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),Ir(this)&&this.trigger("languagechange"))}languages(){return Ot(wt.prototype.options_.languages,this.languages_)}toJSON(){const e=Ot(this.options_),t=e.tracks;e.tracks=[];for(let n=0;n<t.length;n++){let r=t[n];r=Ot(r),r.player=void 0,e.tracks[n]=r}return e}createModal(e,t){t=t||{},t.content=e||"";const n=new La(this,t);return this.addChild(n),n.on("dispose",()=>{this.removeChild(n)}),n.open(),n}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),t=this.currentWidth();for(let n=0;n<wp.length;n++){const r=wp[n],s=this.breakpoints_[r];if(t<=s){if(e===r)return;e&&this.removeClass(Pu[e]),this.addClass(Pu[r]),this.breakpoint_=r;break}}}removeCurrentBreakpoint_(){const e=this.currentBreakpointClass();this.breakpoint_="",e&&this.removeClass(e)}breakpoints(e){return e===void 0?Object.assign(this.breakpoints_):(this.breakpoint_="",this.breakpoints_=Object.assign({},ZA,e),this.updateCurrentBreakpoint_(),Object.assign(this.breakpoints_))}responsive(e){if(e===void 0)return this.responsive_;e=!!e;const t=this.responsive_;if(e!==t)return this.responsive_=e,e?(this.on("playerresize",this.boundUpdateCurrentBreakpoint_),this.updateCurrentBreakpoint_()):(this.off("playerresize",this.boundUpdateCurrentBreakpoint_),this.removeCurrentBreakpoint_()),e}currentBreakpoint(){return this.breakpoint_}currentBreakpointClass(){return Pu[this.breakpoint_]||""}loadMedia(e,t){if(!e||typeof e!="object")return;const n=this.crossOrigin();this.reset(),this.cache_.media=Ot(e);const{artist:r,artwork:s,description:a,poster:o,src:c,textTracks:u,title:d}=this.cache_.media;!s&&o&&(this.cache_.media.artwork=[{src:o,type:Du(o)}]),n&&this.crossOrigin(n),c&&this.src(c),o&&this.poster(o),Array.isArray(u)&&u.forEach(h=>this.addRemoteTextTrack(h,!1)),this.titleBar&&this.titleBar.update({title:d,description:a||r||""}),this.ready(t)}getMedia(){if(!this.cache_.media){const e=this.poster(),t=this.currentSources(),n=Array.prototype.map.call(this.remoteTextTracks(),s=>({kind:s.kind,label:s.label,language:s.language,src:s.src})),r={src:t,textTracks:n};return e&&(r.poster=e,r.artwork=[{src:r.poster,type:Du(r.poster)}]),r}return Ot(this.cache_.media)}static getTagSettings(e){const t={sources:[],tracks:[]},n=ss(e),r=n["data-setup"];if(il(e,"vjs-fill")&&(n.fill=!0),il(e,"vjs-fluid")&&(n.fluid=!0),r!==null)try{Object.assign(n,JSON.parse(r||"{}"))}catch(s){_t.error("data-setup",s)}if(Object.assign(t,n),e.hasChildNodes()){const s=e.childNodes;for(let a=0,o=s.length;a<o;a++){const c=s[a],u=c.nodeName.toLowerCase();u==="source"?t.sources.push(ss(c)):u==="track"&&t.tracks.push(ss(c))}}return t}debug(e){if(e===void 0)return this.debugEnabled_;e?(this.trigger("debugon"),this.previousLogLevel_=this.log.level,this.log.level("debug"),this.debugEnabled_=!0):(this.trigger("debugoff"),this.log.level(this.previousLogLevel_),this.previousLogLevel_=void 0,this.debugEnabled_=!1)}playbackRates(e){if(e===void 0)return this.cache_.playbackRates;Array.isArray(e)&&e.every(t=>typeof t=="number")&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}}wt.prototype.videoTracks=()=>{},wt.prototype.audioTracks=()=>{},wt.prototype.textTracks=()=>{},wt.prototype.remoteTextTracks=()=>{},wt.prototype.remoteTextTrackEls=()=>{},Xn.names.forEach(function(i){const e=Xn[i];wt.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}}),wt.prototype.crossorigin=wt.prototype.crossOrigin,wt.players={};const fl=te.navigator;wt.prototype.options_={techOrder:gt.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:fl&&(fl.languages&&fl.languages[0]||fl.userLanguage||fl.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1,disableSeekWhileScrubbingOnMobile:!1,disableSeekWhileScrubbingOnSTV:!1},Qb.forEach(function(i){wt.prototype[`handleTech${an(i)}_`]=function(){return this.trigger(i)}}),Ee.registerComponent("Player",wt);const Ou="plugin",ja="activePlugins_",$a={},Mu=i=>$a.hasOwnProperty(i),Ru=i=>Mu(i)?$a[i]:void 0,Zb=(i,e)=>{i[ja]=i[ja]||{},i[ja][e]=!0},Lu=(i,e,t)=>{const n=(t?"before":"")+"pluginsetup";i.trigger(n,e),i.trigger(n+":"+e.name,e)},eI=function(i,e){const t=function(){Lu(this,{name:i,plugin:e,instance:null},!0);const n=e.apply(this,arguments);return Zb(this,i),Lu(this,{name:i,plugin:e,instance:n}),n};return Object.keys(e).forEach(function(n){t[n]=e[n]}),t},e2=(i,e)=>(e.prototype.name=i,function(...t){Lu(this,{name:i,plugin:e,instance:null},!0);const n=new e(this,...t);return this[i]=()=>n,Lu(this,n.getEventHash()),n});class ti{constructor(e){if(this.constructor===ti)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),Gf(this),delete this.trigger,q1(this,this.constructor.defaultState),Zb(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,t={}){return Ra(this.eventBusEl_,e,this.getEventHash(t))}handleStateChanged(e){}dispose(){const{name:e,player:t}=this;this.trigger("dispose"),this.off(),t.off("dispose",this.dispose),t[ja][e]=!1,this.player=this.state=null,t[e]=e2(e,$a[e])}static isBasic(e){const t=typeof e=="string"?Ru(e):e;return typeof t=="function"&&!ti.prototype.isPrototypeOf(t.prototype)}static registerPlugin(e,t){if(typeof e!="string")throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(Mu(e))_t.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(wt.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if(typeof t!="function")throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof t}.`);return $a[e]=t,e!==Ou&&(ti.isBasic(t)?wt.prototype[e]=eI(e,t):wt.prototype[e]=e2(e,t)),t}static deregisterPlugin(e){if(e===Ou)throw new Error("Cannot de-register base plugin.");Mu(e)&&(delete $a[e],delete wt.prototype[e])}static getPlugins(e=Object.keys($a)){let t;return e.forEach(n=>{const r=Ru(n);r&&(t=t||{},t[n]=r)}),t}static getPluginVersion(e){const t=Ru(e);return t&&t.VERSION||""}}ti.getPlugin=Ru,ti.BASE_PLUGIN_NAME=Ou,ti.registerPlugin(Ou,ti),wt.prototype.usingPlugin=function(i){return!!this[ja]&&this[ja][i]===!0},wt.prototype.hasPlugin=function(i){return!!Mu(i)};function tI(i,e){let t=!1;return function(...n){return t||_t.warn(i),t=!0,e.apply(this,n)}}function Hi(i,e,t,n){return tI(`${e} is deprecated and will be removed in ${i}.0; please use ${t} instead.`,n)}var nI={NetworkBadStatus:"networkbadstatus",NetworkRequestFailed:"networkrequestfailed",NetworkRequestAborted:"networkrequestaborted",NetworkRequestTimeout:"networkrequesttimeout",NetworkBodyParserFailed:"networkbodyparserfailed",StreamingHlsPlaylistParserError:"streaminghlsplaylistparsererror",StreamingDashManifestParserError:"streamingdashmanifestparsererror",StreamingContentSteeringParserError:"streamingcontentsteeringparsererror",StreamingVttParserError:"streamingvttparsererror",StreamingFailedToSelectNextSegment:"streamingfailedtoselectnextsegment",StreamingFailedToDecryptSegment:"streamingfailedtodecryptsegment",StreamingFailedToTransmuxSegment:"streamingfailedtotransmuxsegment",StreamingFailedToAppendSegment:"streamingfailedtoappendsegment",StreamingCodecsChangeError:"streamingcodecschangeerror"};const t2=i=>i.indexOf("#")===0?i.slice(1):i;function fe(i,e,t){let n=fe.getPlayer(i);if(n)return e&&_t.warn(`Player "${i}" is already initialised. Options will not be applied.`),t&&n.ready(t),n;const r=typeof i=="string"?as("#"+t2(i)):i;if(!Na(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");const a=("getRootNode"in r?r.getRootNode()instanceof te.ShadowRoot:!1)?r.getRootNode():r.ownerDocument.body;(!r.ownerDocument.defaultView||!a.contains(r))&&_t.warn("The element supplied is not included in the DOM"),e=e||{},e.restoreEl===!0&&(e.restoreEl=(r.parentNode&&r.parentNode.hasAttribute&&r.parentNode.hasAttribute("data-vjs-player")?r.parentNode:r).cloneNode(!0)),ns("beforesetup").forEach(c=>{const u=c(r,Ot(e));if(!rr(u)||Array.isArray(u)){_t.error("please return an object in beforesetup hooks");return}e=Ot(e,u)});const o=Ee.getComponent("Player");return n=new o(r,e,t),ns("setup").forEach(c=>c(n)),n}if(fe.hooks_=Ar,fe.hooks=ns,fe.hook=FD,fe.hookOnce=VD,fe.removeHook=h1,te.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&Ia()){let i=as(".vjs-styles-defaults");if(!i){i=U1("vjs-styles-defaults");const e=as("head");e&&e.insertBefore(i,e.firstChild),F1(i,`
|
212
|
+
.video-js {
|
213
|
+
width: 300px;
|
214
|
+
height: 150px;
|
215
|
+
}
|
216
|
+
|
217
|
+
.vjs-fluid:not(.vjs-audio-only-mode) {
|
218
|
+
padding-top: 56.25%
|
219
|
+
}
|
220
|
+
`)}}Vf(1,fe),fe.VERSION=Of,fe.options=wt.prototype.options_,fe.getPlayers=()=>wt.players,fe.getPlayer=i=>{const e=wt.players;let t;if(typeof i=="string"){const n=t2(i),r=e[n];if(r)return r;t=as("#"+n)}else t=i;if(Na(t)){const{player:n,playerId:r}=t;if(n||e[r])return n||e[r]}},fe.getAllPlayers=()=>Object.keys(wt.players).map(i=>wt.players[i]).filter(Boolean),fe.players=wt.players,fe.getComponent=Ee.getComponent,fe.registerComponent=(i,e)=>(gt.isTech(e)&&_t.warn(`The ${i} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),Ee.registerComponent.call(Ee,i,e)),fe.getTech=gt.getTech,fe.registerTech=gt.registerTech,fe.use=uA,Object.defineProperty(fe,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(fe.middleware,"TERMINATOR",{value:wu,writeable:!1,enumerable:!0}),fe.browser=T1,fe.obj=HD,fe.mergeOptions=Hi(9,"videojs.mergeOptions","videojs.obj.merge",Ot),fe.defineLazyProperty=Hi(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",su),fe.bind=Hi(9,"videojs.bind","native Function.prototype.bind",Ht),fe.registerPlugin=ti.registerPlugin,fe.deregisterPlugin=ti.deregisterPlugin,fe.plugin=(i,e)=>(_t.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),ti.registerPlugin(i,e)),fe.getPlugins=ti.getPlugins,fe.getPlugin=ti.getPlugin,fe.getPluginVersion=ti.getPluginVersion,fe.addLanguage=function(i,e){return i=(""+i).toLowerCase(),fe.options.languages=Ot(fe.options.languages,{[i]:e}),fe.options.languages[i]},fe.log=_t,fe.createLogger=p1,fe.time=iA,fe.createTimeRange=Hi(9,"videojs.createTimeRange","videojs.time.createTimeRanges",$i),fe.createTimeRanges=Hi(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",$i),fe.formatTime=Hi(9,"videojs.formatTime","videojs.time.formatTime",Us),fe.setFormatTime=Hi(9,"videojs.setFormatTime","videojs.time.setFormatTime",K1),fe.resetFormatTime=Hi(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",X1),fe.parseUrl=Hi(9,"videojs.parseUrl","videojs.url.parseUrl",np),fe.isCrossOrigin=Hi(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",xu),fe.EventTarget=mi,fe.any=Hf,fe.on=pi,fe.one=ku,fe.off=Fn,fe.trigger=Ra,fe.xhr=Sy,fe.TrackList=Fs,fe.TextTrack=cl,fe.TextTrackList=ep,fe.AudioTrack=ib,fe.AudioTrackList=J1,fe.VideoTrack=rb,fe.VideoTrackList=Q1,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(i=>{fe[i]=function(){return _t.warn(`videojs.${i}() is deprecated; use videojs.dom.${i}() instead`),L1[i].apply(null,arguments)}}),fe.computedStyle=Hi(9,"videojs.computedStyle","videojs.dom.computedStyle",Ma),fe.dom=L1,fe.fn=JD,fe.num=NA,fe.str=tA,fe.url=lA,fe.Error=nI;/*! @name videojs-contrib-quality-levels @version 4.1.0 @license Apache-2.0 */class iI{constructor(e){let t=this;return t.id=e.id,t.label=t.id,t.width=e.width,t.height=e.height,t.bitrate=e.bandwidth,t.frameRate=e.frameRate,t.enabled_=e.enabled,Object.defineProperty(t,"enabled",{get(){return t.enabled_()},set(n){t.enabled_(n)}}),t}}class Bu extends fe.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get(){return e.selectedIndex_}}),Object.defineProperty(e,"length",{get(){return e.levels_.length}}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let t=this.getQualityLevelById(e.id);if(t)return t;const n=this.levels_.length;return t=new iI(e),""+n in this||Object.defineProperty(this,n,{get(){return this.levels_[n]}}),this.levels_.push(t),this.trigger({qualityLevel:t,type:"addqualitylevel"}),t}removeQualityLevel(e){let t=null;for(let n=0,r=this.length;n<r;n++)if(this[n]===e){t=this.levels_.splice(n,1)[0],this.selectedIndex_===n?this.selectedIndex_=-1:this.selectedIndex_>n&&this.selectedIndex_--;break}return t&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),t}getQualityLevelById(e){for(let t=0,n=this.length;t<n;t++){const r=this[t];if(r.id===e)return r}return null}dispose(){this.selectedIndex_=-1,this.levels_.length=0}}Bu.prototype.allowedEvents_={change:"change",addqualitylevel:"addqualitylevel",removequalitylevel:"removequalitylevel"};for(const i in Bu.prototype.allowedEvents_)Bu.prototype["on"+i]=null;var n2="4.1.0";const rI=function(i,e){const t=i.qualityLevels,n=new Bu,r=function(){n.dispose(),i.qualityLevels=t,i.off("dispose",r)};return i.on("dispose",r),i.qualityLevels=()=>n,i.qualityLevels.VERSION=n2,n},i2=function(i){return rI(this,fe.obj.merge({},i))};fe.registerPlugin("qualityLevels",i2),i2.VERSION=n2;/*! @name @videojs/http-streaming @version 3.17.0 @license Apache-2.0 */const ni=Yc,Uu=(i,e)=>e&&e.responseURL&&i!==e.responseURL?e.responseURL:i,Ai=i=>fe.log.debug?fe.log.debug.bind(fe,"VHS:",`${i} >`):function(){};function Dt(...i){const e=fe.obj||fe;return(e.merge||e.mergeOptions).apply(e,i)}function kn(...i){const e=fe.time||fe;return(e.createTimeRanges||e.createTimeRanges).apply(e,i)}function sI(i){if(i.length===0)return"Buffered Ranges are empty";let e=`Buffered Ranges:
|
221
|
+
`;for(let t=0;t<i.length;t++){const n=i.start(t),r=i.end(t);e+=`${n} --> ${r}. Duration (${r-n})
|
222
|
+
`}return e}const cr=1/30,ur=cr*3,r2=function(i,e){const t=[];let n;if(i&&i.length)for(n=0;n<i.length;n++)e(i.start(n),i.end(n))&&t.push([i.start(n),i.end(n)]);return kn(t)},Ha=function(i,e){return r2(i,function(t,n){return t-ur<=e&&n+ur>=e})},Fu=function(i,e){return r2(i,function(t){return t-cr>=e})},aI=function(i){if(i.length<2)return kn();const e=[];for(let t=1;t<i.length;t++){const n=i.end(t-1),r=i.start(t);e.push([n,r])}return kn(e)},oI=function(i,e){let t=null,n=null,r=0;const s=[],a=[];if(!i||!i.length||!e||!e.length)return kn();let o=i.length;for(;o--;)s.push({time:i.start(o),type:"start"}),s.push({time:i.end(o),type:"end"});for(o=e.length;o--;)s.push({time:e.start(o),type:"start"}),s.push({time:e.end(o),type:"end"});for(s.sort(function(c,u){return c.time-u.time}),o=0;o<s.length;o++)s[o].type==="start"?(r++,r===2&&(t=s[o].time)):s[o].type==="end"&&(r--,r===1&&(n=s[o].time)),t!==null&&n!==null&&(a.push([t,n]),t=null,n=null);return kn(a)},s2=i=>{const e=[];if(!i||!i.length)return"";for(let t=0;t<i.length;t++)e.push(i.start(t)+" => "+i.end(t));return e.join(", ")},lI=function(i,e,t=1){return((i.length?i.end(i.length-1):0)-e)/t},Hs=i=>{const e=[];for(let t=0;t<i.length;t++)e.push({start:i.start(t),end:i.end(t)});return e},cI=function(i,e){if(i===e)return!1;if(!i&&e||!e&&i||i.length!==e.length)return!0;for(let t=0;t<i.length;t++)if(i.start(t)!==e.start(t)||i.end(t)!==e.end(t))return!0;return!1},Dp=function(i){if(!(!i||!i.length||!i.end))return i.end(i.length-1)},Ap=function(i,e){let t=0;if(!i||!i.length)return t;for(let n=0;n<i.length;n++){const r=i.start(n),s=i.end(n);if(!(e>s)){if(e>r&&e<=s){t+=s-e;continue}t+=s-r}}return t},Ip=(i,e)=>{if(!e.preload)return e.duration;let t=0;return(e.parts||[]).forEach(function(n){t+=n.duration}),(e.preloadHints||[]).forEach(function(n){n.type==="PART"&&(t+=i.partTargetDuration)}),t},Np=i=>(i.segments||[]).reduce((e,t,n)=>(t.parts?t.parts.forEach(function(r,s){e.push({duration:r.duration,segmentIndex:n,partIndex:s,part:r,segment:t})}):e.push({duration:t.duration,segmentIndex:n,partIndex:null,segment:t,part:null}),e),[]),a2=i=>{const e=i.segments&&i.segments.length&&i.segments[i.segments.length-1];return e&&e.parts||[]},o2=({preloadSegment:i})=>{if(!i)return;const{parts:e,preloadHints:t}=i;let n=(t||[]).reduce((r,s)=>r+(s.type==="PART"?1:0),0);return n+=e&&e.length?e.length:0,n},l2=(i,e)=>{if(e.endList)return 0;if(i&&i.suggestedPresentationDelay)return i.suggestedPresentationDelay;const t=a2(e).length>0;return t&&e.serverControl&&e.serverControl.partHoldBack?e.serverControl.partHoldBack:t&&e.partTargetDuration?e.partTargetDuration*3:e.serverControl&&e.serverControl.holdBack?e.serverControl.holdBack:e.targetDuration?e.targetDuration*3:0},uI=function(i,e){let t=0,n=e-i.mediaSequence,r=i.segments[n];if(r){if(typeof r.start<"u")return{result:r.start,precise:!0};if(typeof r.end<"u")return{result:r.end-r.duration,precise:!0}}for(;n--;){if(r=i.segments[n],typeof r.end<"u")return{result:t+r.end,precise:!0};if(t+=Ip(i,r),typeof r.start<"u")return{result:t+r.start,precise:!0}}return{result:t,precise:!1}},dI=function(i,e){let t=0,n,r=e-i.mediaSequence;for(;r<i.segments.length;r++){if(n=i.segments[r],typeof n.start<"u")return{result:n.start-t,precise:!0};if(t+=Ip(i,n),typeof n.end<"u")return{result:n.end-t,precise:!0}}return{result:-1,precise:!1}},c2=function(i,e,t){if(typeof e>"u"&&(e=i.mediaSequence+i.segments.length),e<i.mediaSequence)return 0;const n=uI(i,e);if(n.precise)return n.result;const r=dI(i,e);return r.precise?r.result:n.result+t},u2=function(i,e,t){if(!i)return 0;if(typeof t!="number"&&(t=0),typeof e>"u"){if(i.totalDuration)return i.totalDuration;if(!i.endList)return te.Infinity}return c2(i,e,t)},pl=function({defaultDuration:i,durationList:e,startIndex:t,endIndex:n}){let r=0;if(t>n&&([t,n]=[n,t]),t<0){for(let s=t;s<Math.min(0,n);s++)r+=i;t=0}for(let s=t;s<n;s++)r+=e[s].duration;return r},d2=function(i,e,t,n){if(!i||!i.segments)return null;if(i.endList)return u2(i);if(e===null)return null;e=e||0;let r=c2(i,i.mediaSequence+i.segments.length,e);return t&&(n=typeof n=="number"?n:l2(null,i),r-=n),Math.max(0,r)},hI=function(i,e,t){const r=e||0;let s=d2(i,e,!0,t);return s===null?kn():(s<r&&(s=r),kn(r,s))},fI=function({playlist:i,currentTime:e,startingSegmentIndex:t,startingPartIndex:n,startTime:r,exactManifestTimings:s}){let a=e-r;const o=Np(i);let c=0;for(let u=0;u<o.length;u++){const d=o[u];if(t===d.segmentIndex&&!(typeof n=="number"&&typeof d.partIndex=="number"&&n!==d.partIndex)){c=u;break}}if(a<0){if(c>0)for(let u=c-1;u>=0;u--){const d=o[u];if(a+=d.duration,s){if(a<0)continue}else if(a+cr<=0)continue;return{partIndex:d.partIndex,segmentIndex:d.segmentIndex,startTime:r-pl({defaultDuration:i.targetDuration,durationList:o,startIndex:c,endIndex:u})}}return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:e}}if(c<0){for(let u=c;u<0;u++)if(a-=i.targetDuration,a<0)return{partIndex:o[0]&&o[0].partIndex||null,segmentIndex:o[0]&&o[0].segmentIndex||0,startTime:e};c=0}for(let u=c;u<o.length;u++){const d=o[u];a-=d.duration;const h=d.duration>cr,b=a===0,v=h&&a+cr>=0;if(!((b||v)&&u!==o.length-1)){if(s){if(a>0)continue}else if(a-cr>=0)continue;return{partIndex:d.partIndex,segmentIndex:d.segmentIndex,startTime:r+pl({defaultDuration:i.targetDuration,durationList:o,startIndex:c,endIndex:u})}}}return{segmentIndex:o[o.length-1].segmentIndex,partIndex:o[o.length-1].partIndex,startTime:e}},h2=function(i){return i.excludeUntil&&i.excludeUntil>Date.now()},Pp=function(i){return i.excludeUntil&&i.excludeUntil===1/0},Vu=function(i){const e=h2(i);return!i.disabled&&!e},pI=function(i){return i.disabled},mI=function(i){for(let e=0;e<i.segments.length;e++)if(i.segments[e].key)return!0;return!1},f2=function(i,e){return e.attributes&&e.attributes[i]},gI=function(i,e,t,n=0){return f2("BANDWIDTH",t)?(i*t.attributes.BANDWIDTH-n*8)/e:NaN},Op=(i,e)=>{if(i.playlists.length===1)return!0;const t=e.attributes.BANDWIDTH||Number.MAX_VALUE;return i.playlists.filter(n=>Vu(n)?(n.attributes.BANDWIDTH||0)<t:!1).length===0},Mp=(i,e)=>!i&&!e||!i&&e||i&&!e?!1:!!(i===e||i.id&&e.id&&i.id===e.id||i.resolvedUri&&e.resolvedUri&&i.resolvedUri===e.resolvedUri||i.uri&&e.uri&&i.uri===e.uri),p2=function(i,e){const t=i&&i.mediaGroups&&i.mediaGroups.AUDIO||{};let n=!1;for(const r in t){for(const s in t[r])if(n=e(t[r][s]),n)break;if(n)break}return!!n},ml=i=>{if(!i||!i.playlists||!i.playlists.length)return p2(i,t=>t.playlists&&t.playlists.length||t.uri);for(let e=0;e<i.playlists.length;e++){const t=i.playlists[e],n=t.attributes&&t.attributes.CODECS;if(!(n&&n.split(",").every(s=>My(s))||p2(i,s=>Mp(t,s))))return!1}return!0};var ii={liveEdgeDelay:l2,duration:u2,seekable:hI,getMediaInfoForTime:fI,isEnabled:Vu,isDisabled:pI,isExcluded:h2,isIncompatible:Pp,playlistEnd:d2,isAes:mI,hasAttribute:f2,estimateSegmentRequestTime:gI,isLowestEnabledRendition:Op,isAudioOnly:ml,playlistMatch:Mp,segmentDurationWithParts:Ip};const{log:m2}=fe,qa=(i,e)=>`${i}-${e}`,g2=(i,e,t)=>`placeholder-uri-${i}-${e}-${t}`,vI=({onwarn:i,oninfo:e,manifestString:t,customTagParsers:n=[],customTagMappers:r=[],llhls:s})=>{const a=new o6;i&&a.on("warn",i),e&&a.on("info",e),n.forEach(u=>a.addParser(u)),r.forEach(u=>a.addTagMapper(u)),a.push(t),a.end();const o=a.manifest;if(s||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(u){o.hasOwnProperty(u)&&delete o[u]}),o.segments&&o.segments.forEach(function(u){["parts","preloadHints"].forEach(function(d){u.hasOwnProperty(d)&&delete u[d]})})),!o.targetDuration){let u=10;o.segments&&o.segments.length&&(u=o.segments.reduce((d,h)=>Math.max(d,h.duration),0)),i&&i({message:`manifest has no targetDuration defaulting to ${u}`}),o.targetDuration=u}const c=a2(o);if(c.length&&!o.partTargetDuration){const u=c.reduce((d,h)=>Math.max(d,h.duration),0);i&&(i({message:`manifest has no partTargetDuration defaulting to ${u}`}),m2.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),o.partTargetDuration=u}return o},za=(i,e)=>{i.mediaGroups&&["AUDIO","SUBTITLES"].forEach(t=>{if(i.mediaGroups[t])for(const n in i.mediaGroups[t])for(const r in i.mediaGroups[t][n]){const s=i.mediaGroups[t][n][r];e(s,t,n,r)}})},v2=({playlist:i,uri:e,id:t})=>{i.id=t,i.playlistErrors_=0,e&&(i.uri=e),i.attributes=i.attributes||{}},yI=i=>{let e=i.playlists.length;for(;e--;){const t=i.playlists[e];v2({playlist:t,id:qa(e,t.uri)}),t.resolvedUri=ni(i.uri,t.uri),i.playlists[t.id]=t,i.playlists[t.uri]=t,t.attributes.BANDWIDTH||m2.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},bI=i=>{za(i,e=>{e.uri&&(e.resolvedUri=ni(i.uri,e.uri))})},_I=(i,e)=>{const t=qa(0,e),n={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:te.location.href,resolvedUri:te.location.href,playlists:[{uri:e,id:t,resolvedUri:e,attributes:{}}]};return n.playlists[t]=n.playlists[0],n.playlists[e]=n.playlists[0],n},y2=(i,e,t=g2)=>{i.uri=e;for(let r=0;r<i.playlists.length;r++)if(!i.playlists[r].uri){const s=`placeholder-uri-${r}`;i.playlists[r].uri=s}const n=ml(i);za(i,(r,s,a,o)=>{if(!r.playlists||!r.playlists.length){if(n&&s==="AUDIO"&&!r.uri)for(let c=0;c<i.playlists.length;c++){const u=i.playlists[c];if(u.attributes&&u.attributes.AUDIO&&u.attributes.AUDIO===a)return}r.playlists=[un({},r)]}r.playlists.forEach(function(c,u){const d=t(s,a,o,c),h=qa(u,d);c.uri?c.resolvedUri=c.resolvedUri||ni(i.uri,c.uri):(c.uri=u===0?d:h,c.resolvedUri=c.uri),c.id=c.id||h,c.attributes=c.attributes||{},i.playlists[c.id]=c,i.playlists[c.uri]=c})}),yI(i),bI(i)};class b2{constructor(){this.offset_=null,this.pendingDateRanges_=new Map,this.processedDateRanges_=new Map}setOffset(e=[]){if(this.offset_!==null||!e.length)return;const[t]=e;t.programDateTime!==void 0&&(this.offset_=t.programDateTime/1e3)}setPendingDateRanges(e=[]){if(!e.length)return;const[t]=e,n=t.startDate.getTime();this.trimProcessedDateRanges_(n),this.pendingDateRanges_=e.reduce((r,s)=>(r.set(s.id,s),r),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(this.offset_===null)return[];const e={},t=[];this.pendingDateRanges_.forEach((n,r)=>{if(!this.processedDateRanges_.has(r)&&(n.startTime=n.startDate.getTime()/1e3-this.offset_,n.processDateRange=()=>this.processDateRange(n),t.push(n),!!n.class))if(e[n.class]){const s=e[n.class].push(n);n.classListIndex=s-1}else e[n.class]=[n],n.classListIndex=0});for(const n of t){const r=e[n.class]||[];n.endDate?n.endTime=n.endDate.getTime()/1e3-this.offset_:n.endOnNext&&r[n.classListIndex+1]?n.endTime=r[n.classListIndex+1].startTime:n.duration?n.endTime=n.startTime+n.duration:n.plannedDuration?n.endTime=n.startTime+n.plannedDuration:n.endTime=n.startTime}return t}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((n,r)=>{n.startDate.getTime()<e&&this.processedDateRanges_.delete(r)})}}const _2=22,qs=({requestType:i,request:e,error:t,parseFailure:n})=>{const r=e.status<200||e.status>299,s=e.status>=400&&e.status<=499,a={uri:e.uri,requestType:i},o=r&&!s||n;if(t&&s)a.error=un({},t),a.errorType=fe.Error.NetworkRequestFailed;else if(e.aborted)a.errorType=fe.Error.NetworkRequestAborted;else if(e.timedout)a.erroType=fe.Error.NetworkRequestTimeout;else if(o){const c=n?fe.Error.NetworkBodyParserFailed:fe.Error.NetworkBadStatus;a.errorType=c,a.status=e.status,a.headers=e.headers}return a},kI=Ai("CodecUtils"),k2=function(i){const e=i.attributes||{};if(e.CODECS)return ir(e.CODECS)},T2=(i,e)=>{const t=e.attributes||{};return i&&i.mediaGroups&&i.mediaGroups.AUDIO&&t.AUDIO&&i.mediaGroups.AUDIO[t.AUDIO]},TI=(i,e)=>{if(!T2(i,e))return!0;const t=e.attributes||{},n=i.mediaGroups.AUDIO[t.AUDIO];for(const r in n)if(!n[r].uri&&!n[r].playlists)return!0;return!1},gl=function(i){const e={};return i.forEach(({mediaType:t,type:n,details:r})=>{e[t]=e[t]||[],e[t].push(Oy(`${n}${r}`))}),Object.keys(e).forEach(function(t){if(e[t].length>1){kI(`multiple ${t} codecs found as attributes: ${e[t].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),e[t]=null;return}e[t]=e[t][0]}),e},S2=function(i){let e=0;return i.audio&&e++,i.video&&e++,e},vl=function(i,e){const t=e.attributes||{},n=gl(k2(e)||[]);if(T2(i,e)&&!n.audio&&!TI(i,e)){const r=gl(c6(i,t.AUDIO)||[]);r.audio&&(n.audio=r.audio)}return n},{EventTarget:SI}=fe,CI=(i,e)=>{if(e.endList||!e.serverControl)return i;const t={};if(e.serverControl.canBlockReload){const{preloadSegment:n}=e;let r=e.mediaSequence+e.segments.length;if(n){const s=n.parts||[],a=o2(e)-1;a>-1&&a!==s.length-1&&(t._HLS_part=a),(a>-1||s.length)&&r--}t._HLS_msn=r}if(e.serverControl&&e.serverControl.canSkipUntil&&(t._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(t).length){const n=new te.URL(i);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(r){t.hasOwnProperty(r)&&n.searchParams.set(r,t[r])}),i=n.toString()}return i},xI=(i,e)=>{if(!i)return e;const t=Dt(i,e);if(i.preloadHints&&!e.preloadHints&&delete t.preloadHints,i.parts&&!e.parts)delete t.parts;else if(i.parts&&e.parts)for(let n=0;n<e.parts.length;n++)i.parts&&i.parts[n]&&(t.parts[n]=Dt(i.parts[n],e.parts[n]));return!i.skipped&&e.skipped&&(t.skipped=!1),i.preload&&!e.preload&&(t.preload=!1),t},EI=(i,e,t)=>{const n=i.slice(),r=e.slice();t=t||0;const s=[];let a;for(let o=0;o<r.length;o++){const c=n[o+t],u=r[o];c?(a=c.map||a,s.push(xI(c,u))):(a&&!u.map&&(u.map=a),s.push(u))}return s},C2=(i,e)=>{!i.resolvedUri&&i.uri&&(i.resolvedUri=ni(e,i.uri)),i.key&&!i.key.resolvedUri&&(i.key.resolvedUri=ni(e,i.key.uri)),i.map&&!i.map.resolvedUri&&(i.map.resolvedUri=ni(e,i.map.uri)),i.map&&i.map.key&&!i.map.key.resolvedUri&&(i.map.key.resolvedUri=ni(e,i.map.key.uri)),i.parts&&i.parts.length&&i.parts.forEach(t=>{t.resolvedUri||(t.resolvedUri=ni(e,t.uri))}),i.preloadHints&&i.preloadHints.length&&i.preloadHints.forEach(t=>{t.resolvedUri||(t.resolvedUri=ni(e,t.uri))})},x2=function(i){const e=i.segments||[],t=i.preloadSegment;if(t&&t.parts&&t.parts.length){if(t.preloadHints){for(let n=0;n<t.preloadHints.length;n++)if(t.preloadHints[n].type==="MAP")return e}t.duration=i.targetDuration,t.preload=!0,e.push(t)}return e},E2=(i,e)=>i===e||i.segments&&e.segments&&i.segments.length===e.segments.length&&i.endList===e.endList&&i.mediaSequence===e.mediaSequence&&i.preloadSegment===e.preloadSegment,Rp=(i,e,t=E2)=>{const n=Dt(i,{}),r=n.playlists[e.id];if(!r||t(r,e))return null;e.segments=x2(e);const s=Dt(r,e);if(s.preloadSegment&&!e.preloadSegment&&delete s.preloadSegment,r.segments){if(e.skip){e.segments=e.segments||[];for(let a=0;a<e.skip.skippedSegments;a++)e.segments.unshift({skipped:!0})}s.segments=EI(r.segments,e.segments,e.mediaSequence-r.mediaSequence)}s.segments.forEach(a=>{C2(a,s.resolvedUri)});for(let a=0;a<n.playlists.length;a++)n.playlists[a].id===e.id&&(n.playlists[a]=s);return n.playlists[e.id]=s,n.playlists[e.uri]=s,za(i,(a,o,c,u)=>{if(a.playlists)for(let d=0;d<a.playlists.length;d++)e.id===a.playlists[d].id&&(a.playlists[d]=s)}),n},Lp=(i,e)=>{const t=i.segments||[],n=t[t.length-1],r=n&&n.parts&&n.parts[n.parts.length-1],s=r&&r.duration||n&&n.duration;return e&&s?s*1e3:(i.partTargetDuration||i.targetDuration||10)*500},w2=(i,e,t)=>{if(!i)return;const n=[];return i.forEach(r=>{if(!r.attributes)return;const{BANDWIDTH:s,RESOLUTION:a,CODECS:o}=r.attributes;n.push({id:r.id,bandwidth:s,resolution:a,codecs:o})}),{type:e,isLive:t,renditions:n}};class Ga extends SI{constructor(e,t,n={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=Ai("PlaylistLoader");const{withCredentials:r=!1}=n;this.src=e,this.vhs_=t,this.withCredentials=r,this.addDateRangesToTextTrack_=n.addDateRangesToTextTrack;const s=t.options_;this.customTagParsers=s&&s.customTagParsers||[],this.customTagMappers=s&&s.customTagMappers||[],this.llhls=s&&s.llhls,this.dateRangesStorage_=new b2,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const t=this.dateRangesStorage_.getDateRangesToProcess();!t.length||!this.addDateRangesToTextTrack_||this.addDateRangesToTextTrack_(t)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA")return;const e=this.media();let t=ni(this.main.uri,e.uri);this.llhls&&(t=CI(t,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:t,withCredentials:this.withCredentials,requestType:"hls-playlist"},(n,r)=>{if(this.request){if(n)return this.playlistRequestError(this.request,this.media(),"HAVE_METADATA");this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}})}playlistRequestError(e,t,n){const{uri:r,id:s}=t;this.request=null,n&&(this.state=n),this.error={playlist:this.main.playlists[s],status:e.status,message:`HLS playlist request error at URL: ${r}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:qs({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:t}){try{const n=vI({onwarn:({message:r})=>this.logger_(`m3u8-parser warn for ${e}: ${r}`),oninfo:({message:r})=>this.logger_(`m3u8-parser info for ${e}: ${r}`),manifestString:t,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls});return!n.playlists||!n.playlists.length||this.excludeAudioOnlyVariants(n.playlists),n}catch(n){this.error=n,this.error.metadata={errorType:fe.Error.StreamingHlsPlaylistParserError,error:n}}}excludeAudioOnlyVariants(e){const t=n=>{const r=n.attributes||{},{width:s,height:a}=r.RESOLUTION||{};if(s&&a)return!0;const o=k2(n)||[];return!!gl(o).video};e.some(t)&&e.forEach(n=>{t(n)||(n.excludeUntil=1/0)})}haveMetadata({playlistString:e,playlistObject:t,url:n,id:r}){this.request=null,this.state="HAVE_METADATA";const s={playlistInfo:{type:"media",uri:n}};this.trigger({type:"playlistparsestart",metadata:s});const a=t||this.parseManifest_({url:n,manifestString:e});a.lastRequest=Date.now(),v2({playlist:a,uri:n,id:r});const o=Rp(this.main,a);this.targetDuration=a.partTargetDuration||a.targetDuration,this.pendingMedia_=null,o?(this.main=o,this.media_=this.main.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(Lp(this.media(),!!o)),s.parsedPlaylist=w2(this.main.playlists,s.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:s}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),te.clearTimeout(this.mediaUpdateTimeout),te.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new b2,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,t){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof e=="string"){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(te.clearTimeout(this.finalRenditionTimeout),t){const o=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=te.setTimeout(this.media.bind(this,e,!1),o);return}const n=this.state,r=!this.media_||e.id!==this.media_.id,s=this.main.playlists[e.id];if(s&&s.endList||e.endList&&e.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,r&&(this.trigger("mediachanging"),n==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(Lp(e,!0)),!r)return;if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e;const a={playlistInfo:{type:"media",uri:e.uri}};this.trigger({type:"playlistrequeststart",metadata:a}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(o,c)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=Uu(e.resolvedUri,c),o)return this.playlistRequestError(this.request,e,n);this.trigger({type:"playlistrequestcomplete",metadata:a}),this.haveMetadata({playlistString:c.responseText,url:e.uri,id:e.id}),n==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&(te.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(te.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const t=this.media();if(e){const n=t?(t.partTargetDuration||t.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=te.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},n);return}if(!this.started){this.start();return}t&&!t.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(te.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=te.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,typeof this.src=="object"){this.src.uri||(this.src.uri=te.location.href),this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}const e={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:e}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(t,n)=>{if(!this.request)return;if(this.request=null,t)return this.error={status:n.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:n.responseText,code:2,metadata:qs({requestType:n.requestType,request:n,error:t})},this.state==="HAVE_NOTHING"&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=Uu(this.src,n),this.trigger({type:"playlistparsestart",metadata:e});const r=this.parseManifest_({manifestString:n.responseText,url:this.src});e.parsedPlaylist=w2(r.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(r)})}srcUri(){return typeof this.src=="string"?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists){this.main=e,y2(this.main,this.srcUri()),e.playlists.forEach(n=>{n.segments=x2(n),n.segments.forEach(r=>{C2(r,n.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);return}const t=this.srcUri()||te.location.href;this.main=_I(e,t),this.haveMetadata({playlistObject:e,url:t,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,t){const n=this.main,r=e.ID;let s=n.playlists.length;for(;s--;){const a=n.playlists[s];if(a.attributes["PATHWAY-ID"]===r){const o=a.resolvedUri,c=a.id;if(t){const u=this.createCloneURI_(a.resolvedUri,e),d=qa(r,u),h=this.createCloneAttributes_(r,a.attributes),b=this.createClonePlaylist_(a,d,e,h);n.playlists[s]=b,n.playlists[d]=b,n.playlists[u]=b}else n.playlists.splice(s,1);delete n.playlists[c],delete n.playlists[o]}}this.updateOrDeleteCloneMedia(e,t)}updateOrDeleteCloneMedia(e,t){const n=this.main,r=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(s=>{if(!(!n.mediaGroups[s]||!n.mediaGroups[s][r])){for(const a in n.mediaGroups[s])if(a===r){for(const o in n.mediaGroups[s][a])n.mediaGroups[s][a][o].playlists.forEach((u,d)=>{const h=n.playlists[u.id],b=h.id,v=h.resolvedUri;delete n.playlists[b],delete n.playlists[v]});delete n.mediaGroups[s][a]}}}),t&&this.createClonedMediaGroups_(e)}addClonePathway(e,t={}){const n=this.main,r=n.playlists.length,s=this.createCloneURI_(t.resolvedUri,e),a=qa(e.ID,s),o=this.createCloneAttributes_(e.ID,t.attributes),c=this.createClonePlaylist_(t,a,e,o);n.playlists[r]=c,n.playlists[a]=c,n.playlists[s]=c,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const t=e.ID,n=e["BASE-ID"],r=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(s=>{if(!(!r.mediaGroups[s]||r.mediaGroups[s][t]))for(const a in r.mediaGroups[s]){if(a===n)r.mediaGroups[s][t]={};else continue;for(const o in r.mediaGroups[s][a]){const c=r.mediaGroups[s][a][o];r.mediaGroups[s][t][o]=un({},c);const u=r.mediaGroups[s][t][o],d=this.createCloneURI_(c.resolvedUri,e);u.resolvedUri=d,u.uri=d,u.playlists=[],c.playlists.forEach((h,b)=>{const v=r.playlists[h.id],y=g2(s,t,o),p=qa(t,y);if(v&&!r.playlists[p]){const f=this.createClonePlaylist_(v,p,e),m=f.resolvedUri;r.playlists[p]=f,r.playlists[m]=f}u.playlists[b]=this.createClonePlaylist_(h,p,e)})}}})}createClonePlaylist_(e,t,n,r){const s=this.createCloneURI_(e.resolvedUri,n),a={resolvedUri:s,uri:s,id:t};return e.segments&&(a.segments=[]),r&&(a.attributes=r),Dt(e,a)}createCloneURI_(e,t){const n=new URL(e);n.hostname=t["URI-REPLACEMENT"].HOST;const r=t["URI-REPLACEMENT"].PARAMS;for(const s of Object.keys(r))n.searchParams.set(s,r[s]);return n.href}createCloneAttributes_(e,t){const n={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(r=>{t[r]&&(n[r]=e)}),n}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const n in e.contentProtection){const r=e.contentProtection[n].attributes.keyId;r&&t.add(r.toLowerCase())}return t}}}const Bp=function(i,e,t,n){const r=i.responseType==="arraybuffer"?i.response:i.responseText;!e&&r&&(i.responseTime=Date.now(),i.roundTripTime=i.responseTime-i.requestTime,i.bytesReceived=r.byteLength||r.length,i.bandwidth||(i.bandwidth=Math.floor(i.bytesReceived/i.roundTripTime*8*1e3))),t.headers&&(i.responseHeaders=t.headers),e&&e.code==="ETIMEDOUT"&&(i.timedout=!0),!e&&!i.aborted&&t.statusCode!==200&&t.statusCode!==206&&t.statusCode!==0&&(e=new Error("XHR Failed with a response of: "+(i&&(r||i.responseText)))),n(e,i)},wI=(i,e)=>{if(!i||!i.size)return;let t=e;return i.forEach(n=>{t=n(t)}),t},DI=(i,e,t,n)=>{!i||!i.size||i.forEach(r=>{r(e,t,n)})},D2=function(){const i=function e(t,n){t=Dt({timeout:45e3},t);const r=e.beforeRequest||fe.Vhs.xhr.beforeRequest,s=e._requestCallbackSet||fe.Vhs.xhr._requestCallbackSet||new Set,a=e._responseCallbackSet||fe.Vhs.xhr._responseCallbackSet;r&&typeof r=="function"&&(fe.log.warn("beforeRequest is deprecated, use onRequest instead."),s.add(r));const o=fe.Vhs.xhr.original===!0?fe.xhr:fe.Vhs.xhr,c=wI(s,t);s.delete(r);const u=o(c||t,function(h,b){return DI(a,u,h,b),Bp(u,h,b,n)}),d=u.abort;return u.abort=function(){return u.aborted=!0,d.apply(u,arguments)},u.uri=t.uri,u.requestType=t.requestType,u.requestTime=Date.now(),u};return i.original=!0,i},AI=function(i){let e;const t=i.offset;return typeof i.offset=="bigint"||typeof i.length=="bigint"?e=te.BigInt(i.offset)+te.BigInt(i.length)-te.BigInt(1):e=i.offset+i.length-1,"bytes="+t+"-"+e},Up=function(i){const e={};return i.byterange&&(e.Range=AI(i.byterange)),e},II=function(i,e){return i.start(e)+"-"+i.end(e)},NI=function(i,e){const t=i.toString(16);return"00".substring(0,2-t.length)+t+(e%2?" ":"")},PI=function(i){return i>=32&&i<126?String.fromCharCode(i):"."},A2=function(i){const e={};return Object.keys(i).forEach(t=>{const n=i[t];By(n)?e[t]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:e[t]=n}),e},ju=function(i){const e=i.byterange||{length:1/0,offset:0};return[e.length,e.offset,i.resolvedUri].join(",")},I2=function(i){return i.resolvedUri},N2=i=>{const e=Array.prototype.slice.call(i),t=16;let n="",r,s;for(let a=0;a<e.length/t;a++)r=e.slice(a*t,a*t+t).map(NI).join(""),s=e.slice(a*t,a*t+t).map(PI).join(""),n+=r+" "+s+`
|
223
|
+
`;return n};var OI=Object.freeze({__proto__:null,createTransferableMessage:A2,initSegmentId:ju,segmentKeyId:I2,hexDump:N2,tagDump:({bytes:i})=>N2(i),textRanges:i=>{let e="",t;for(t=0;t<i.length;t++)e+=II(i,t)+" ";return e}});const P2=.25,MI=(i,e)=>{if(!e.dateTimeObject)return null;const t=e.videoTimingInfo.transmuxerPrependedSeconds,r=e.videoTimingInfo.transmuxedPresentationStart+t,s=i-r;return new Date(e.dateTimeObject.getTime()+s*1e3)},RI=i=>i.transmuxedPresentationEnd-i.transmuxedPresentationStart-i.transmuxerPrependedSeconds,LI=(i,e)=>{let t;try{t=new Date(i)}catch{return null}if(!e||!e.segments||e.segments.length===0)return null;let n=e.segments[0];if(t<new Date(n.dateTimeObject))return null;for(let c=0;c<e.segments.length-1;c++){n=e.segments[c];const u=new Date(e.segments[c+1].dateTimeObject);if(t<u)break}const r=e.segments[e.segments.length-1],s=r.dateTimeObject,a=r.videoTimingInfo?RI(r.videoTimingInfo):r.duration+r.duration*P2,o=new Date(s.getTime()+a*1e3);return t>o?null:(t>new Date(s)&&(n=r),{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:ii.duration(e,e.mediaSequence+e.segments.indexOf(n)),type:n.videoTimingInfo?"accurate":"estimate"})},BI=(i,e)=>{if(!e||!e.segments||e.segments.length===0)return null;let t=0,n;for(let s=0;s<e.segments.length&&(n=e.segments[s],t=n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationEnd:t+n.duration,!(i<=t));s++);const r=e.segments[e.segments.length-1];if(r.videoTimingInfo&&r.videoTimingInfo.transmuxedPresentationEnd<i)return null;if(i>t){if(i>t+r.duration*P2)return null;n=r}return{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:t-n.duration,type:n.videoTimingInfo?"accurate":"estimate"}},UI=(i,e)=>{let t,n;try{t=new Date(i),n=new Date(e)}catch{}const r=t.getTime();return(n.getTime()-r)/1e3},FI=i=>{if(!i.segments||i.segments.length===0)return!1;for(let e=0;e<i.segments.length;e++)if(!i.segments[e].dateTimeObject)return!1;return!0},VI=({playlist:i,time:e=void 0,callback:t})=>{if(!t)throw new Error("getProgramTime: callback must be provided");if(!i||e===void 0)return t({message:"getProgramTime: playlist and time must be provided"});const n=BI(e,i);if(!n)return t({message:"valid programTime was not found"});if(n.type==="estimate")return t({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:n.estimatedStart});const r={mediaSeconds:e},s=MI(e,n.segment);return s&&(r.programDateTime=s.toISOString()),t(null,r)},O2=({programTime:i,playlist:e,retryCount:t=2,seekTo:n,pauseAfterSeek:r=!0,tech:s,callback:a})=>{if(!a)throw new Error("seekToProgramTime: callback must be provided");if(typeof i>"u"||!e||!n)return a({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!e.endList&&!s.hasStarted_)return a({message:"player must be playing a live stream to start buffering"});if(!FI(e))return a({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const o=LI(i,e);if(!o)return a({message:`${i} was not found in the stream`});const c=o.segment,u=UI(c.dateTimeObject,i);if(o.type==="estimate"){if(t===0)return a({message:`${i} is not buffered yet. Try again`});n(o.estimatedStart+u),s.one("seeked",()=>{O2({programTime:i,playlist:e,retryCount:t-1,seekTo:n,pauseAfterSeek:r,tech:s,callback:a})});return}const d=c.start+u,h=()=>a(null,s.currentTime());s.one("seeked",h),r&&s.pause(),n(d)},Fp=(i,e)=>{if(i.readyState===4)return e()},jI=(i,e,t,n)=>{let r=[],s,a=!1;const o=function(h,b,v,y){return b.abort(),a=!0,t(h,b,v,y)},c=function(h,b){if(a)return;if(h)return h.metadata=qs({requestType:n,request:b,error:h}),o(h,b,"",r);const v=b.responseText.substring(r&&r.byteLength||0,b.responseText.length);if(r=b6(r,Uy(v,!0)),s=s||el(r),r.length<10||s&&r.length<s+2)return Fp(b,()=>o(h,b,"",r));const y=Nf(r);return y==="ts"&&r.length<188?Fp(b,()=>o(h,b,"",r)):!y&&r.length<376?Fp(b,()=>o(h,b,"",r)):o(null,b,y,r)},d=e({uri:i,beforeSend(h){h.overrideMimeType("text/plain; charset=x-user-defined"),h.addEventListener("progress",function({total:b,loaded:v}){return Bp(h,null,{statusCode:h.status},c)})}},function(h,b){return Bp(d,h,b,c)});return d},{EventTarget:$I}=fe,M2=function(i,e){if(!E2(i,e)||i.sidx&&e.sidx&&(i.sidx.offset!==e.sidx.offset||i.sidx.length!==e.sidx.length))return!1;if(!i.sidx&&e.sidx||i.sidx&&!e.sidx||i.segments&&!e.segments||!i.segments&&e.segments)return!1;if(!i.segments&&!e.segments)return!0;for(let t=0;t<i.segments.length;t++){const n=i.segments[t],r=e.segments[t];if(n.uri!==r.uri)return!1;if(!n.byterange&&!r.byterange)continue;const s=n.byterange,a=r.byterange;if(s&&!a||!s&&a||s.offset!==a.offset||s.length!==a.length)return!1}return!0},HI=(i,e,t,n)=>{const r=n.attributes.NAME||t;return`placeholder-uri-${i}-${e}-${r}`},qI=({mainXml:i,srcUrl:e,clientOffset:t,sidxMapping:n,previousManifest:r})=>{const s=vD(i,{manifestUri:e,clientOffset:t,sidxMapping:n,previousManifest:r});return y2(s,e,HI),s},zI=(i,e)=>{za(i,(t,n,r,s)=>{(!e.mediaGroups[n][r]||!(s in e.mediaGroups[n][r]))&&delete i.mediaGroups[n][r][s]})},GI=(i,e,t)=>{let n=!0,r=Dt(i,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod,timelineStarts:e.timelineStarts});for(let s=0;s<e.playlists.length;s++){const a=e.playlists[s];if(a.sidx){const c=Zc(a.sidx);t&&t[c]&&t[c].sidx&&Sf(a,t[c].sidx,a.sidx.resolvedUri)}const o=Rp(r,a,M2);o&&(r=o,n=!1)}return za(e,(s,a,o,c)=>{if(s.playlists&&s.playlists.length){const u=s.playlists[0].id,d=Rp(r,s.playlists[0],M2);d&&(r=d,c in r.mediaGroups[a][o]||(r.mediaGroups[a][o][c]=s),r.mediaGroups[a][o][c].playlists[0]=r.playlists[u],n=!1)}}),zI(r,e),e.minimumUpdatePeriod!==i.minimumUpdatePeriod&&(n=!1),n?null:r},WI=(i,e)=>(!i.map&&!e.map||!!(i.map&&e.map&&i.map.byterange.offset===e.map.byterange.offset&&i.map.byterange.length===e.map.byterange.length))&&i.uri===e.uri&&i.byterange.offset===e.byterange.offset&&i.byterange.length===e.byterange.length,R2=(i,e)=>{const t={};for(const n in i){const s=i[n].sidx;if(s){const a=Zc(s);if(!e[a])break;const o=e[a].sidxInfo;WI(o,s)&&(t[a]=e[a])}}return t},KI=(i,e)=>{let n=R2(i.playlists,e);return za(i,(r,s,a,o)=>{if(r.playlists&&r.playlists.length){const c=r.playlists;n=Dt(n,R2(c,e))}}),n};class Vp extends $I{constructor(e,t,n={},r){super(),this.isPaused_=!0,this.mainPlaylistLoader_=r||this,r||(this.isMain_=!0);const{withCredentials:s=!1}=n;if(this.vhs_=t,this.withCredentials=s,this.addMetadataToTextTrack=n.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=Ai("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}get isPaused(){return this.isPaused_}requestErrored_(e,t,n){if(!this.request)return!0;if(this.request=null,e)return this.error=typeof e=="object"&&!(e instanceof Error)?e:{status:t.status,message:"DASH request error at URL: "+t.uri,response:t.response,code:2,metadata:e.metadata},n&&(this.state=n),this.trigger("error"),!0}addSidxSegments_(e,t,n){const r=e.sidx&&Zc(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r]){te.clearTimeout(this.mediaRequest_),this.mediaRequest_=te.setTimeout(()=>n(!1),0);return}const s=Uu(e.sidx.resolvedUri),a=(c,u)=>{if(this.requestErrored_(c,u,t))return;const d=this.mainPlaylistLoader_.sidxMapping_,{requestType:h}=u;let b;try{b=TD(st(u.response).subarray(8))}catch(v){v.metadata=qs({requestType:h,request:u,parseFailure:!0}),this.requestErrored_(v,u,t);return}return d[r]={sidxInfo:e.sidx,sidx:b},Sf(e,b,e.sidx.resolvedUri),n(!0)},o="dash-sidx";this.request=jI(s,this.vhs_.xhr,(c,u,d,h)=>{if(c)return a(c,u);if(!d||d!=="mp4"){const y=d||"unknown";return a({status:u.status,message:`Unsupported ${y} container type for sidx segment at URL: ${s}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},u)}const{offset:b,length:v}=e.sidx.byterange;if(h.length>=v+b)return a(c,{response:h.subarray(b,b+v),status:u.status,uri:u.uri});this.request=this.vhs_.xhr({uri:s,responseType:"arraybuffer",requestType:"dash-sidx",headers:Up({byterange:e.sidx.byterange})},a)},o)}dispose(){this.isPaused_=!0,this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},te.clearTimeout(this.minimumUpdatePeriodTimeout_),te.clearTimeout(this.mediaRequest_),te.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);const t=this.state;if(typeof e=="string"){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const n=!this.media_||e.id!==this.media_.id;if(n&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,n&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}n&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,t,r=>{this.haveMetadata({startingState:t,playlist:e})}))}haveMetadata({startingState:e,playlist:t}){this.state="HAVE_METADATA",this.loadedPlaylists_[t.id]=t,te.clearTimeout(this.mediaRequest_),this.mediaRequest_=null,this.refreshMedia_(t.id),e==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.isPaused_=!0,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),te.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(te.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){this.isPaused_=!1,te.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const t=this.media();if(e){const n=t?t.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=te.setTimeout(()=>this.load(),n);return}if(!this.started){this.start();return}t&&!t.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")}start(){if(this.started=!0,!this.isMain_){te.clearTimeout(this.mediaRequest_),this.mediaRequest_=te.setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,t)=>{this.haveMain_(),!this.hasPendingRequest()&&!this.media_&&this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(e){const t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:t}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(n,r)=>{if(n){const{requestType:a}=r;n.metadata=qs({requestType:a,request:r,error:n})}if(this.requestErrored_(n,r)){this.state==="HAVE_NOTHING"&&(this.started=!1);return}this.trigger({type:"manifestrequestcomplete",metadata:t});const s=r.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=r.responseText,r.responseHeaders&&r.responseHeaders.date?this.mainLoaded_=Date.parse(r.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=Uu(this.mainPlaylistLoader_.srcUrl,r),s){this.handleMain_(),this.syncClientServerClock_(()=>e(r,s));return}return e(r,s)})}syncClientServerClock_(e){const t=yD(this.mainPlaylistLoader_.mainXml_);if(t===null)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();if(t.method==="DIRECT")return this.mainPlaylistLoader_.clientOffset_=t.value-Date.now(),e();this.request=this.vhs_.xhr({uri:ni(this.mainPlaylistLoader_.srcUrl,t.value),method:t.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(n,r)=>{if(!this.request)return;if(n){const{requestType:a}=r;return this.error.metadata=qs({requestType:a,request:r,error:n}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let s;t.method==="HEAD"?!r.responseHeaders||!r.responseHeaders.date?s=this.mainLoaded_:s=Date.parse(r.responseHeaders.date):s=Date.parse(r.responseText),this.mainPlaylistLoader_.clientOffset_=s-Date.now(),e()})}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){te.clearTimeout(this.mediaRequest_),this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main,t={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestparsestart",metadata:t});let n;try{n=qI({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(s){this.error=s,this.error.metadata={errorType:fe.Error.StreamingDashManifestParserError,error:s},this.trigger("error")}e&&(n=GI(e,n,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=n||e;const r=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(r&&r!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=r),(!e||n&&n.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(n),n){const{duration:s,endList:a}=n,o=[];n.playlists.forEach(u=>{o.push({id:u.id,bandwidth:u.attributes.BANDWIDTH,resolution:u.attributes.RESOLUTION,codecs:u.attributes.CODECS})});const c={duration:s,isLive:!a,renditions:o};t.parsedManifest=c,this.trigger({type:"manifestparsecomplete",metadata:t})}return!!n}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(te.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let t=e.main&&e.main.minimumUpdatePeriod;if(t===0&&(e.media()?t=e.media().targetDuration*1e3:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),typeof t!="number"||t<=0){t<0&&this.logger_(`found invalid minimumUpdatePeriod of ${t}, not setting a timeout`);return}this.createMUPTimeout_(t)}createMUPTimeout_(e){const t=this.mainPlaylistLoader_;t.minimumUpdatePeriodTimeout_=te.setTimeout(()=>{t.minimumUpdatePeriodTimeout_=null,t.trigger("minimumUpdatePeriod"),t.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,t)=>{t&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=KI(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,n=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const t=this.mainPlaylistLoader_.main.playlists,n=!this.media_||this.media_!==t[e];if(n?this.media_=t[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const r=()=>{this.media().endList||(this.mediaUpdateTimeout=te.setTimeout(()=>{this.trigger("mediaupdatetimeout"),r()},Lp(this.media(),!!n)))};r()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const t=this.mainPlaylistLoader_.main.eventStream.map(n=>({cueTime:n.start,frames:[{data:n.messageData}]}));this.addMetadataToTextTrack("EventStream",t,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const t=new Set;for(const n in e.contentProtection){const r=e.contentProtection[n].attributes["cenc:default_KID"];r&&t.add(r.replace(/-/g,"").toLowerCase())}return t}}}var Tn={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const XI=i=>{const e=new Uint8Array(new ArrayBuffer(i.length));for(let t=0;t<i.length;t++)e[t]=i.charCodeAt(t);return e.buffer},L2=function(i){return i.on=i.addEventListener,i.off=i.removeEventListener,i},YI=function(i){try{return URL.createObjectURL(new Blob([i],{type:"application/javascript"}))}catch{const t=new BlobBuilder;return t.append(i),URL.createObjectURL(t.getBlob())}},B2=function(i){return function(){const e=YI(i),t=L2(new Worker(e));t.objURL=e;const n=t.terminate;return t.on=t.addEventListener,t.off=t.removeEventListener,t.terminate=function(){return URL.revokeObjectURL(e),n.call(this)},t}},U2=function(i){return`var browserWorkerPolyFill = ${L2.toString()};
|
224
|
+
browserWorkerPolyFill(self);
|
225
|
+
`+i},F2=function(i){return i.toString().replace(/^function.+?{/,"").slice(0,-1)},JI=U2(F2(function(){var i=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=function(){this.init=function(){var g={};this.on=function(T,x){g[T]||(g[T]=[]),g[T]=g[T].concat(x)},this.off=function(T,x){var C;return g[T]?(C=g[T].indexOf(x),g[T]=g[T].slice(),g[T].splice(C,1),C>-1):!1},this.trigger=function(T){var x,C,I,O;if(x=g[T],!!x)if(arguments.length===2)for(I=x.length,C=0;C<I;++C)x[C].call(this,arguments[1]);else{for(O=[],C=arguments.length,C=1;C<arguments.length;++C)O.push(arguments[C]);for(I=x.length,C=0;C<I;++C)x[C].apply(this,O)}},this.dispose=function(){g={}}}};e.prototype.pipe=function(g){return this.on("data",function(T){g.push(T)}),this.on("done",function(T){g.flush(T)}),this.on("partialdone",function(T){g.partialFlush(T)}),this.on("endedtimeline",function(T){g.endTimeline(T)}),this.on("reset",function(T){g.reset(T)}),g},e.prototype.push=function(g){this.trigger("data",g)},e.prototype.flush=function(g){this.trigger("done",g)},e.prototype.partialFlush=function(g){this.trigger("partialdone",g)},e.prototype.endTimeline=function(g){this.trigger("endedtimeline",g)},e.prototype.reset=function(g){this.trigger("reset",g)};var t=e,n=Math.pow(2,32),r=function(g){var T=new DataView(g.buffer,g.byteOffset,g.byteLength),x;return T.getBigUint64?(x=T.getBigUint64(0),x<Number.MAX_SAFE_INTEGER?Number(x):x):T.getUint32(0)*n+T.getUint32(4)},s={getUint64:r,MAX_UINT32:n},a=s.MAX_UINT32,o,c,u,d,h,b,v,y,p,f,m,_,k,D,E,A,w,N,S,P,F,V,J,ie,X,H,$,j,B,q,z,oe,we,be,Z,_e;(function(){var g;if(J={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],pasp:[],sdtp:[],smhd:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],styp:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[]},!(typeof Uint8Array>"u")){for(g in J)J.hasOwnProperty(g)&&(J[g]=[g.charCodeAt(0),g.charCodeAt(1),g.charCodeAt(2),g.charCodeAt(3)]);ie=new Uint8Array([105,115,111,109]),H=new Uint8Array([97,118,99,49]),X=new Uint8Array([0,0,0,1]),$=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),j=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]),B={video:$,audio:j},oe=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),z=new Uint8Array([0,0,0,0,0,0,0,0]),we=new Uint8Array([0,0,0,0,0,0,0,0]),be=we,Z=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),_e=we,q=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),o=function(g){var T=[],x=0,C,I,O;for(C=1;C<arguments.length;C++)T.push(arguments[C]);for(C=T.length;C--;)x+=T[C].byteLength;for(I=new Uint8Array(x+8),O=new DataView(I.buffer,I.byteOffset,I.byteLength),O.setUint32(0,I.byteLength),I.set(g,4),C=0,x=8;C<T.length;C++)I.set(T[C],x),x+=T[C].byteLength;return I},c=function(){return o(J.dinf,o(J.dref,oe))},u=function(g){return o(J.esds,new Uint8Array([0,0,0,0,3,25,0,0,0,4,17,64,21,0,6,0,0,0,218,192,0,0,218,192,5,2,g.audioobjecttype<<3|g.samplingfrequencyindex>>>1,g.samplingfrequencyindex<<7|g.channelcount<<3,6,1,2]))},d=function(){return o(J.ftyp,ie,X,ie,H)},A=function(g){return o(J.hdlr,B[g])},h=function(g){return o(J.mdat,g)},E=function(g){var T=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,g.duration>>>24&255,g.duration>>>16&255,g.duration>>>8&255,g.duration&255,85,196,0,0]);return g.samplerate&&(T[12]=g.samplerate>>>24&255,T[13]=g.samplerate>>>16&255,T[14]=g.samplerate>>>8&255,T[15]=g.samplerate&255),o(J.mdhd,T)},D=function(g){return o(J.mdia,E(g),A(g.type),v(g))},b=function(g){return o(J.mfhd,new Uint8Array([0,0,0,0,(g&4278190080)>>24,(g&16711680)>>16,(g&65280)>>8,g&255]))},v=function(g){return o(J.minf,g.type==="video"?o(J.vmhd,q):o(J.smhd,z),c(),N(g))},y=function(g,T){for(var x=[],C=T.length;C--;)x[C]=P(T[C]);return o.apply(null,[J.moof,b(g)].concat(x))},p=function(g){for(var T=g.length,x=[];T--;)x[T]=_(g[T]);return o.apply(null,[J.moov,m(4294967295)].concat(x).concat(f(g)))},f=function(g){for(var T=g.length,x=[];T--;)x[T]=F(g[T]);return o.apply(null,[J.mvex].concat(x))},m=function(g){var T=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(g&4278190080)>>24,(g&16711680)>>16,(g&65280)>>8,g&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return o(J.mvhd,T)},w=function(g){var T=g.samples||[],x=new Uint8Array(4+T.length),C,I;for(I=0;I<T.length;I++)C=T[I].flags,x[I+4]=C.dependsOn<<4|C.isDependedOn<<2|C.hasRedundancy;return o(J.sdtp,x)},N=function(g){return o(J.stbl,S(g),o(J.stts,_e),o(J.stsc,be),o(J.stsz,Z),o(J.stco,we))},function(){var g,T;S=function(x){return o(J.stsd,new Uint8Array([0,0,0,0,0,0,0,1]),x.type==="video"?g(x):T(x))},g=function(x){var C=x.sps||[],I=x.pps||[],O=[],K=[],Y,ee;for(Y=0;Y<C.length;Y++)O.push((C[Y].byteLength&65280)>>>8),O.push(C[Y].byteLength&255),O=O.concat(Array.prototype.slice.call(C[Y]));for(Y=0;Y<I.length;Y++)K.push((I[Y].byteLength&65280)>>>8),K.push(I[Y].byteLength&255),K=K.concat(Array.prototype.slice.call(I[Y]));if(ee=[J.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,(x.width&65280)>>8,x.width&255,(x.height&65280)>>8,x.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o(J.avcC,new Uint8Array([1,x.profileIdc,x.profileCompatibility,x.levelIdc,255].concat([C.length],O,[I.length],K))),o(J.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],x.sarRatio){var ne=x.sarRatio[0],ce=x.sarRatio[1];ee.push(o(J.pasp,new Uint8Array([(ne&4278190080)>>24,(ne&16711680)>>16,(ne&65280)>>8,ne&255,(ce&4278190080)>>24,(ce&16711680)>>16,(ce&65280)>>8,ce&255])))}return o.apply(null,ee)},T=function(x){return o(J.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(x.channelcount&65280)>>8,x.channelcount&255,(x.samplesize&65280)>>8,x.samplesize&255,0,0,0,0,(x.samplerate&65280)>>8,x.samplerate&255,0,0]),u(x))}}(),k=function(g){var T=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(g.id&4278190080)>>24,(g.id&16711680)>>16,(g.id&65280)>>8,g.id&255,0,0,0,0,(g.duration&4278190080)>>24,(g.duration&16711680)>>16,(g.duration&65280)>>8,g.duration&255,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(g.width&65280)>>8,g.width&255,0,0,(g.height&65280)>>8,g.height&255,0,0]);return o(J.tkhd,T)},P=function(g){var T,x,C,I,O,K,Y;return T=o(J.tfhd,new Uint8Array([0,0,0,58,(g.id&4278190080)>>24,(g.id&16711680)>>16,(g.id&65280)>>8,g.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),K=Math.floor(g.baseMediaDecodeTime/a),Y=Math.floor(g.baseMediaDecodeTime%a),x=o(J.tfdt,new Uint8Array([1,0,0,0,K>>>24&255,K>>>16&255,K>>>8&255,K&255,Y>>>24&255,Y>>>16&255,Y>>>8&255,Y&255])),O=92,g.type==="audio"?(C=V(g,O),o(J.traf,T,x,C)):(I=w(g),C=V(g,I.length+O),o(J.traf,T,x,C,I))},_=function(g){return g.duration=g.duration||4294967295,o(J.trak,k(g),D(g))},F=function(g){var T=new Uint8Array([0,0,0,0,(g.id&4278190080)>>24,(g.id&16711680)>>16,(g.id&65280)>>8,g.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return g.type!=="video"&&(T[T.length-1]=0),o(J.trex,T)},function(){var g,T,x;x=function(C,I){var O=0,K=0,Y=0,ee=0;return C.length&&(C[0].duration!==void 0&&(O=1),C[0].size!==void 0&&(K=2),C[0].flags!==void 0&&(Y=4),C[0].compositionTimeOffset!==void 0&&(ee=8)),[0,0,O|K|Y|ee,1,(C.length&4278190080)>>>24,(C.length&16711680)>>>16,(C.length&65280)>>>8,C.length&255,(I&4278190080)>>>24,(I&16711680)>>>16,(I&65280)>>>8,I&255]},T=function(C,I){var O,K,Y,ee,ne,ce;for(ee=C.samples||[],I+=20+16*ee.length,Y=x(ee,I),K=new Uint8Array(Y.length+ee.length*16),K.set(Y),O=Y.length,ce=0;ce<ee.length;ce++)ne=ee[ce],K[O++]=(ne.duration&4278190080)>>>24,K[O++]=(ne.duration&16711680)>>>16,K[O++]=(ne.duration&65280)>>>8,K[O++]=ne.duration&255,K[O++]=(ne.size&4278190080)>>>24,K[O++]=(ne.size&16711680)>>>16,K[O++]=(ne.size&65280)>>>8,K[O++]=ne.size&255,K[O++]=ne.flags.isLeading<<2|ne.flags.dependsOn,K[O++]=ne.flags.isDependedOn<<6|ne.flags.hasRedundancy<<4|ne.flags.paddingValue<<1|ne.flags.isNonSyncSample,K[O++]=ne.flags.degradationPriority&61440,K[O++]=ne.flags.degradationPriority&15,K[O++]=(ne.compositionTimeOffset&4278190080)>>>24,K[O++]=(ne.compositionTimeOffset&16711680)>>>16,K[O++]=(ne.compositionTimeOffset&65280)>>>8,K[O++]=ne.compositionTimeOffset&255;return o(J.trun,K)},g=function(C,I){var O,K,Y,ee,ne,ce;for(ee=C.samples||[],I+=20+8*ee.length,Y=x(ee,I),O=new Uint8Array(Y.length+ee.length*8),O.set(Y),K=Y.length,ce=0;ce<ee.length;ce++)ne=ee[ce],O[K++]=(ne.duration&4278190080)>>>24,O[K++]=(ne.duration&16711680)>>>16,O[K++]=(ne.duration&65280)>>>8,O[K++]=ne.duration&255,O[K++]=(ne.size&4278190080)>>>24,O[K++]=(ne.size&16711680)>>>16,O[K++]=(ne.size&65280)>>>8,O[K++]=ne.size&255;return o(J.trun,O)},V=function(C,I){return C.type==="audio"?g(C,I):T(C,I)}}();var Te={ftyp:d,mdat:h,moof:y,moov:p,initSegment:function(g){var T=d(),x=p(g),C;return C=new Uint8Array(T.byteLength+x.byteLength),C.set(T),C.set(x,T.byteLength),C}},Ue=function(g){var T,x,C=[],I=[];for(I.byteLength=0,I.nalCount=0,I.duration=0,C.byteLength=0,T=0;T<g.length;T++)x=g[T],x.nalUnitType==="access_unit_delimiter_rbsp"?(C.length&&(C.duration=x.dts-C.dts,I.byteLength+=C.byteLength,I.nalCount+=C.length,I.duration+=C.duration,I.push(C)),C=[x],C.byteLength=x.data.byteLength,C.pts=x.pts,C.dts=x.dts):(x.nalUnitType==="slice_layer_without_partitioning_rbsp_idr"&&(C.keyFrame=!0),C.duration=x.dts-C.dts,C.byteLength+=x.data.byteLength,C.push(x));return I.length&&(!C.duration||C.duration<=0)&&(C.duration=I[I.length-1].duration),I.byteLength+=C.byteLength,I.nalCount+=C.length,I.duration+=C.duration,I.push(C),I},We=function(g){var T,x,C=[],I=[];for(C.byteLength=0,C.nalCount=0,C.duration=0,C.pts=g[0].pts,C.dts=g[0].dts,I.byteLength=0,I.nalCount=0,I.duration=0,I.pts=g[0].pts,I.dts=g[0].dts,T=0;T<g.length;T++)x=g[T],x.keyFrame?(C.length&&(I.push(C),I.byteLength+=C.byteLength,I.nalCount+=C.nalCount,I.duration+=C.duration),C=[x],C.nalCount=x.length,C.byteLength=x.byteLength,C.pts=x.pts,C.dts=x.dts,C.duration=x.duration):(C.duration+=x.duration,C.nalCount+=x.length,C.byteLength+=x.byteLength,C.push(x));return I.length&&C.duration<=0&&(C.duration=I[I.length-1].duration),I.byteLength+=C.byteLength,I.nalCount+=C.nalCount,I.duration+=C.duration,I.push(C),I},pe=function(g){var T;return!g[0][0].keyFrame&&g.length>1&&(T=g.shift(),g.byteLength-=T.byteLength,g.nalCount-=T.nalCount,g[0][0].dts=T.dts,g[0][0].pts=T.pts,g[0][0].duration+=T.duration),g},Ne=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},nt=function(g,T){var x=Ne();return x.dataOffset=T,x.compositionTimeOffset=g.pts-g.dts,x.duration=g.duration,x.size=4*g.length,x.size+=g.byteLength,g.keyFrame&&(x.flags.dependsOn=2,x.flags.isNonSyncSample=0),x},le=function(g,T){var x,C,I,O,K,Y=T||0,ee=[];for(x=0;x<g.length;x++)for(O=g[x],C=0;C<O.length;C++)K=O[C],I=nt(K,Y),Y+=I.size,ee.push(I);return ee},Ke=function(g){var T,x,C,I,O,K,Y=0,ee=g.byteLength,ne=g.nalCount,ce=ee+4*ne,Ce=new Uint8Array(ce),Ge=new DataView(Ce.buffer);for(T=0;T<g.length;T++)for(I=g[T],x=0;x<I.length;x++)for(O=I[x],C=0;C<O.length;C++)K=O[C],Ge.setUint32(Y,K.data.byteLength),Y+=4,Ce.set(K.data,Y),Y+=K.data.byteLength;return Ce},ae=function(g,T){var x,C=T||0,I=[];return x=nt(g,C),I.push(x),I},ue=function(g){var T,x,C=0,I=g.byteLength,O=g.length,K=I+4*O,Y=new Uint8Array(K),ee=new DataView(Y.buffer);for(T=0;T<g.length;T++)x=g[T],ee.setUint32(C,x.data.byteLength),C+=4,Y.set(x.data,C),C+=x.data.byteLength;return Y},Be={groupNalsIntoFrames:Ue,groupFramesIntoGops:We,extendFirstKeyFrame:pe,generateSampleTable:le,concatenateNalData:Ke,generateSampleTableForFrame:ae,concatenateNalDataForFrame:ue},Ie=[33,16,5,32,164,27],tt=[33,65,108,84,1,2,4,8,168,2,4,8,17,191,252],ze=function(g){for(var T=[];g--;)T.push(0);return T},Se=function(g){return Object.keys(g).reduce(function(T,x){return T[x]=new Uint8Array(g[x].reduce(function(C,I){return C.concat(I)},[])),T},{})},Ve,ke=function(){if(!Ve){var g={96e3:[Ie,[227,64],ze(154),[56]],88200:[Ie,[231],ze(170),[56]],64e3:[Ie,[248,192],ze(240),[56]],48e3:[Ie,[255,192],ze(268),[55,148,128],ze(54),[112]],44100:[Ie,[255,192],ze(268),[55,163,128],ze(84),[112]],32e3:[Ie,[255,192],ze(268),[55,234],ze(226),[112]],24e3:[Ie,[255,192],ze(268),[55,255,128],ze(268),[111,112],ze(126),[224]],16e3:[Ie,[255,192],ze(268),[55,255,128],ze(268),[111,255],ze(269),[223,108],ze(195),[1,192]],12e3:[tt,ze(268),[3,127,248],ze(268),[6,255,240],ze(268),[13,255,224],ze(268),[27,253,128],ze(259),[56]],11025:[tt,ze(268),[3,127,248],ze(268),[6,255,240],ze(268),[13,255,224],ze(268),[27,255,192],ze(268),[55,175,128],ze(108),[112]],8e3:[tt,ze(268),[3,121,16],ze(47),[7]]};Ve=Se(g)}return Ve},Me=9e4,Pe,it,bt,Wt,On,_i,ai;Pe=function(g){return g*Me},it=function(g,T){return g*T},bt=function(g){return g/Me},Wt=function(g,T){return g/T},On=function(g,T){return Pe(Wt(g,T))},_i=function(g,T){return it(bt(g),T)},ai=function(g,T,x){return bt(x?g:g-T)};var St={ONE_SECOND_IN_TS:Me,secondsToVideoTs:Pe,secondsToAudioTs:it,videoTsToSeconds:bt,audioTsToSeconds:Wt,audioTsToVideoTs:On,videoTsToAudioTs:_i,metadataTsToSeconds:ai},kr=ke,Cn=St,$r=function(g){var T,x,C=0;for(T=0;T<g.length;T++)x=g[T],C+=x.data.byteLength;return C},Xi=function(g,T,x,C){var I,O=0,K=0,Y=0,ee=0,ne,ce,Ce;if(T.length&&(I=Cn.audioTsToVideoTs(g.baseMediaDecodeTime,g.samplerate),O=Math.ceil(Cn.ONE_SECOND_IN_TS/(g.samplerate/1024)),x&&C&&(K=I-Math.max(x,C),Y=Math.floor(K/O),ee=Y*O),!(Y<1||ee>Cn.ONE_SECOND_IN_TS/2))){for(ne=kr()[g.samplerate],ne||(ne=T[0].data),ce=0;ce<Y;ce++)Ce=T[0],T.splice(0,0,{data:ne,dts:Ce.dts-O,pts:Ce.pts-O});return g.baseMediaDecodeTime-=Math.floor(Cn.videoTsToAudioTs(ee,g.samplerate)),ee}},ki=function(g,T,x){return T.minSegmentDts>=x?g:(T.minSegmentDts=1/0,g.filter(function(C){return C.dts>=x?(T.minSegmentDts=Math.min(T.minSegmentDts,C.dts),T.minSegmentPts=T.minSegmentDts,!0):!1}))},Yn=function(g){var T,x,C=[];for(T=0;T<g.length;T++)x=g[T],C.push({size:x.data.byteLength,duration:1024});return C},Hr=function(g){var T,x,C=0,I=new Uint8Array($r(g));for(T=0;T<g.length;T++)x=g[T],I.set(x.data,C),C+=x.data.byteLength;return I},qr={prefixWithSilence:Xi,trimAdtsFramesByEarliestDts:ki,generateSampleTable:Yn,concatenateFrameData:Hr},U=St.ONE_SECOND_IN_TS,G=function(g,T){typeof T.pts=="number"&&(g.timelineStartInfo.pts===void 0&&(g.timelineStartInfo.pts=T.pts),g.minSegmentPts===void 0?g.minSegmentPts=T.pts:g.minSegmentPts=Math.min(g.minSegmentPts,T.pts),g.maxSegmentPts===void 0?g.maxSegmentPts=T.pts:g.maxSegmentPts=Math.max(g.maxSegmentPts,T.pts)),typeof T.dts=="number"&&(g.timelineStartInfo.dts===void 0&&(g.timelineStartInfo.dts=T.dts),g.minSegmentDts===void 0?g.minSegmentDts=T.dts:g.minSegmentDts=Math.min(g.minSegmentDts,T.dts),g.maxSegmentDts===void 0?g.maxSegmentDts=T.dts:g.maxSegmentDts=Math.max(g.maxSegmentDts,T.dts))},re=function(g){delete g.minSegmentDts,delete g.maxSegmentDts,delete g.minSegmentPts,delete g.maxSegmentPts},ve=function(g,T){var x,C,I=g.minSegmentDts;return T||(I-=g.timelineStartInfo.dts),x=g.timelineStartInfo.baseMediaDecodeTime,x+=I,x=Math.max(0,x),g.type==="audio"&&(C=g.samplerate/U,x*=C,x=Math.floor(x)),x},He={clearDtsInfo:re,calculateTrackBaseMediaDecodeTime:ve,collectDtsInfo:G},at=4,Xe=128,Re=function(g){for(var T=0,x={payloadType:-1,payloadSize:0},C=0,I=0;T<g.byteLength&&g[T]!==Xe;){for(;g[T]===255;)C+=255,T++;for(C+=g[T++];g[T]===255;)I+=255,T++;if(I+=g[T++],!x.payload&&C===at){var O=String.fromCharCode(g[T+3],g[T+4],g[T+5],g[T+6]);if(O==="GA94"){x.payloadType=C,x.payloadSize=I,x.payload=g.subarray(T,T+I);break}else x.payload=void 0}T+=I,C=0,I=0}return x},yn=function(g){return g.payload[0]!==181||(g.payload[1]<<8|g.payload[2])!==49||String.fromCharCode(g.payload[3],g.payload[4],g.payload[5],g.payload[6])!=="GA94"||g.payload[7]!==3?null:g.payload.subarray(8,g.payload.length-1)},Qt=function(g,T){var x=[],C,I,O,K;if(!(T[0]&64))return x;for(I=T[0]&31,C=0;C<I;C++)O=C*3,K={type:T[O+2]&3,pts:g},T[O+2]&4&&(K.ccData=T[O+3]<<8|T[O+4],x.push(K));return x},Gt=function(g){for(var T=g.byteLength,x=[],C=1,I,O;C<T-2;)g[C]===0&&g[C+1]===0&&g[C+2]===3?(x.push(C+2),C+=2):C++;if(x.length===0)return g;I=T-x.length,O=new Uint8Array(I);var K=0;for(C=0;C<I;K++,C++)K===x[0]&&(K++,x.shift()),O[C]=g[K];return O},Mi={parseSei:Re,parseUserData:yn,parseCaptionPackets:Qt,discardEmulationPreventionBytes:Gt,USER_DATA_REGISTERED_ITU_T_T35:at},Ft=t,bn=Mi,Nt=function(g){g=g||{},Nt.prototype.init.call(this),this.parse708captions_=typeof g.parse708captions=="boolean"?g.parse708captions:!0,this.captionPackets_=[],this.ccStreams_=[new jt(0,0),new jt(0,1),new jt(1,0),new jt(1,1)],this.parse708captions_&&(this.cc708Stream_=new xt({captionServices:g.captionServices})),this.reset(),this.ccStreams_.forEach(function(T){T.on("data",this.trigger.bind(this,"data")),T.on("partialdone",this.trigger.bind(this,"partialdone")),T.on("done",this.trigger.bind(this,"done"))},this),this.parse708captions_&&(this.cc708Stream_.on("data",this.trigger.bind(this,"data")),this.cc708Stream_.on("partialdone",this.trigger.bind(this,"partialdone")),this.cc708Stream_.on("done",this.trigger.bind(this,"done")))};Nt.prototype=new Ft,Nt.prototype.push=function(g){var T,x,C;if(g.nalUnitType==="sei_rbsp"&&(T=bn.parseSei(g.escapedRBSP),!!T.payload&&T.payloadType===bn.USER_DATA_REGISTERED_ITU_T_T35&&(x=bn.parseUserData(T),!!x))){if(g.dts<this.latestDts_){this.ignoreNextEqualDts_=!0;return}else if(g.dts===this.latestDts_&&this.ignoreNextEqualDts_){this.numSameDts_--,this.numSameDts_||(this.ignoreNextEqualDts_=!1);return}C=bn.parseCaptionPackets(g.pts,x),this.captionPackets_=this.captionPackets_.concat(C),this.latestDts_!==g.dts&&(this.numSameDts_=0),this.numSameDts_++,this.latestDts_=g.dts}},Nt.prototype.flushCCStreams=function(g){this.ccStreams_.forEach(function(T){return g==="flush"?T.flush():T.partialFlush()},this)},Nt.prototype.flushStream=function(g){if(!this.captionPackets_.length){this.flushCCStreams(g);return}this.captionPackets_.forEach(function(T,x){T.presortIndex=x}),this.captionPackets_.sort(function(T,x){return T.pts===x.pts?T.presortIndex-x.presortIndex:T.pts-x.pts}),this.captionPackets_.forEach(function(T){T.type<2?this.dispatchCea608Packet(T):this.dispatchCea708Packet(T)},this),this.captionPackets_.length=0,this.flushCCStreams(g)},Nt.prototype.flush=function(){return this.flushStream("flush")},Nt.prototype.partialFlush=function(){return this.flushStream("partialFlush")},Nt.prototype.reset=function(){this.latestDts_=null,this.ignoreNextEqualDts_=!1,this.numSameDts_=0,this.activeCea608Channel_=[null,null],this.ccStreams_.forEach(function(g){g.reset()})},Nt.prototype.dispatchCea608Packet=function(g){this.setsTextOrXDSActive(g)?this.activeCea608Channel_[g.type]=null:this.setsChannel1Active(g)?this.activeCea608Channel_[g.type]=0:this.setsChannel2Active(g)&&(this.activeCea608Channel_[g.type]=1),this.activeCea608Channel_[g.type]!==null&&this.ccStreams_[(g.type<<1)+this.activeCea608Channel_[g.type]].push(g)},Nt.prototype.setsChannel1Active=function(g){return(g.ccData&30720)===4096},Nt.prototype.setsChannel2Active=function(g){return(g.ccData&30720)===6144},Nt.prototype.setsTextOrXDSActive=function(g){return(g.ccData&28928)===256||(g.ccData&30974)===4138||(g.ccData&30974)===6186},Nt.prototype.dispatchCea708Packet=function(g){this.parse708captions_&&this.cc708Stream_.push(g)};var Yi={127:9834,4128:32,4129:160,4133:8230,4138:352,4140:338,4144:9608,4145:8216,4146:8217,4147:8220,4148:8221,4149:8226,4153:8482,4154:353,4156:339,4157:8480,4159:376,4214:8539,4215:8540,4216:8541,4217:8542,4218:9168,4219:9124,4220:9123,4221:9135,4222:9126,4223:9121,4256:12600},zr=function(g){var T=Yi[g]||g;return g&4096&&g===T?"":String.fromCharCode(T)},rn=function(g){return 32<=g&&g<=127||160<=g&&g<=255},oi=function(g){this.windowNum=g,this.reset()};oi.prototype.reset=function(){this.clearText(),this.pendingNewLine=!1,this.winAttr={},this.penAttr={},this.penLoc={},this.penColor={},this.visible=0,this.rowLock=0,this.columnLock=0,this.priority=0,this.relativePositioning=0,this.anchorVertical=0,this.anchorHorizontal=0,this.anchorPoint=0,this.rowCount=1,this.virtualRowCount=this.rowCount+1,this.columnCount=41,this.windowStyle=0,this.penStyle=0},oi.prototype.getText=function(){return this.rows.join(`
|
226
|
+
`)},oi.prototype.clearText=function(){this.rows=[""],this.rowIdx=0},oi.prototype.newLine=function(g){for(this.rows.length>=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(g),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},oi.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},oi.prototype.addText=function(g){this.rows[this.rowIdx]+=g},oi.prototype.backspace=function(){if(!this.isEmpty()){var g=this.rows[this.rowIdx];this.rows[this.rowIdx]=g.substr(0,g.length-1)}};var Ti=function(g,T,x){this.serviceNum=g,this.text="",this.currentWindow=new oi(-1),this.windows=[],this.stream=x,typeof T=="string"&&this.createTextDecoder(T)};Ti.prototype.init=function(g,T){this.startPts=g;for(var x=0;x<8;x++)this.windows[x]=new oi(x),typeof T=="function"&&(this.windows[x].beforeRowOverflow=T)},Ti.prototype.setCurrentWindow=function(g){this.currentWindow=this.windows[g]},Ti.prototype.createTextDecoder=function(g){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(g)}catch(T){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+g+" encoding. "+T})}};var xt=function(g){g=g||{},xt.prototype.init.call(this);var T=this,x=g.captionServices||{},C={},I;Object.keys(x).forEach(O=>{I=x[O],/^SERVICE/.test(O)&&(C[O]=I.encoding)}),this.serviceEncodings=C,this.current708Packet=null,this.services={},this.push=function(O){O.type===3?(T.new708Packet(),T.add708Bytes(O)):(T.current708Packet===null&&T.new708Packet(),T.add708Bytes(O))}};xt.prototype=new Ft,xt.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},xt.prototype.add708Bytes=function(g){var T=g.ccData,x=T>>>8,C=T&255;this.current708Packet.ptsVals.push(g.pts),this.current708Packet.data.push(x),this.current708Packet.data.push(C)},xt.prototype.push708Packet=function(){var g=this.current708Packet,T=g.data,x=null,C=null,I=0,O=T[I++];for(g.seq=O>>6,g.sizeCode=O&63;I<T.length;I++)O=T[I++],x=O>>5,C=O&31,x===7&&C>0&&(O=T[I++],x=O),this.pushServiceBlock(x,I,C),C>0&&(I+=C-1)},xt.prototype.pushServiceBlock=function(g,T,x){var C,I=T,O=this.current708Packet.data,K=this.services[g];for(K||(K=this.initService(g,I));I<T+x&&I<O.length;I++)C=O[I],rn(C)?I=this.handleText(I,K):C===24?I=this.multiByteCharacter(I,K):C===16?I=this.extendedCommands(I,K):128<=C&&C<=135?I=this.setCurrentWindow(I,K):152<=C&&C<=159?I=this.defineWindow(I,K):C===136?I=this.clearWindows(I,K):C===140?I=this.deleteWindows(I,K):C===137?I=this.displayWindows(I,K):C===138?I=this.hideWindows(I,K):C===139?I=this.toggleWindows(I,K):C===151?I=this.setWindowAttributes(I,K):C===144?I=this.setPenAttributes(I,K):C===145?I=this.setPenColor(I,K):C===146?I=this.setPenLocation(I,K):C===143?K=this.reset(I,K):C===8?K.currentWindow.backspace():C===12?K.currentWindow.clearText():C===13?K.currentWindow.pendingNewLine=!0:C===14?K.currentWindow.clearText():C===141&&I++},xt.prototype.extendedCommands=function(g,T){var x=this.current708Packet.data,C=x[++g];return rn(C)&&(g=this.handleText(g,T,{isExtended:!0})),g},xt.prototype.getPts=function(g){return this.current708Packet.ptsVals[Math.floor(g/2)]},xt.prototype.initService=function(g,T){var C="SERVICE"+g,x=this,C,I;return C in this.serviceEncodings&&(I=this.serviceEncodings[C]),this.services[g]=new Ti(g,I,x),this.services[g].init(this.getPts(T),function(O){x.flushDisplayed(O,x.services[g])}),this.services[g]},xt.prototype.handleText=function(g,T,x){var C=x&&x.isExtended,I=x&&x.isMultiByte,O=this.current708Packet.data,K=C?4096:0,Y=O[g],ee=O[g+1],ne=T.currentWindow,ce,Ce;function Ge(Ae){return Ae.map(rt=>("0"+(rt&255).toString(16)).slice(-2)).join("")}if(I?(Ce=[Y,ee],g++):Ce=[Y],T.textDecoder_&&!C)ce=T.textDecoder_.decode(new Uint8Array(Ce));else if(I){const Ae=Ge(Ce);ce=String.fromCharCode(parseInt(Ae,16))}else ce=zr(K|Y);return ne.pendingNewLine&&!ne.isEmpty()&&ne.newLine(this.getPts(g)),ne.pendingNewLine=!1,ne.addText(ce),g},xt.prototype.multiByteCharacter=function(g,T){var x=this.current708Packet.data,C=x[g+1],I=x[g+2];return rn(C)&&rn(I)&&(g=this.handleText(++g,T,{isMultiByte:!0})),g},xt.prototype.setCurrentWindow=function(g,T){var x=this.current708Packet.data,C=x[g],I=C&7;return T.setCurrentWindow(I),g},xt.prototype.defineWindow=function(g,T){var x=this.current708Packet.data,C=x[g],I=C&7;T.setCurrentWindow(I);var O=T.currentWindow;return C=x[++g],O.visible=(C&32)>>5,O.rowLock=(C&16)>>4,O.columnLock=(C&8)>>3,O.priority=C&7,C=x[++g],O.relativePositioning=(C&128)>>7,O.anchorVertical=C&127,C=x[++g],O.anchorHorizontal=C,C=x[++g],O.anchorPoint=(C&240)>>4,O.rowCount=C&15,C=x[++g],O.columnCount=C&63,C=x[++g],O.windowStyle=(C&56)>>3,O.penStyle=C&7,O.virtualRowCount=O.rowCount+1,g},xt.prototype.setWindowAttributes=function(g,T){var x=this.current708Packet.data,C=x[g],I=T.currentWindow.winAttr;return C=x[++g],I.fillOpacity=(C&192)>>6,I.fillRed=(C&48)>>4,I.fillGreen=(C&12)>>2,I.fillBlue=C&3,C=x[++g],I.borderType=(C&192)>>6,I.borderRed=(C&48)>>4,I.borderGreen=(C&12)>>2,I.borderBlue=C&3,C=x[++g],I.borderType+=(C&128)>>5,I.wordWrap=(C&64)>>6,I.printDirection=(C&48)>>4,I.scrollDirection=(C&12)>>2,I.justify=C&3,C=x[++g],I.effectSpeed=(C&240)>>4,I.effectDirection=(C&12)>>2,I.displayEffect=C&3,g},xt.prototype.flushDisplayed=function(g,T){for(var x=[],C=0;C<8;C++)T.windows[C].visible&&!T.windows[C].isEmpty()&&x.push(T.windows[C].getText());T.endPts=g,T.text=x.join(`
|
227
|
+
|
228
|
+
`),this.pushCaption(T),T.startPts=g},xt.prototype.pushCaption=function(g){g.text!==""&&(this.trigger("data",{startPts:g.startPts,endPts:g.endPts,text:g.text,stream:"cc708_"+g.serviceNum}),g.text="",g.startPts=g.endPts)},xt.prototype.displayWindows=function(g,T){var x=this.current708Packet.data,C=x[++g],I=this.getPts(g);this.flushDisplayed(I,T);for(var O=0;O<8;O++)C&1<<O&&(T.windows[O].visible=1);return g},xt.prototype.hideWindows=function(g,T){var x=this.current708Packet.data,C=x[++g],I=this.getPts(g);this.flushDisplayed(I,T);for(var O=0;O<8;O++)C&1<<O&&(T.windows[O].visible=0);return g},xt.prototype.toggleWindows=function(g,T){var x=this.current708Packet.data,C=x[++g],I=this.getPts(g);this.flushDisplayed(I,T);for(var O=0;O<8;O++)C&1<<O&&(T.windows[O].visible^=1);return g},xt.prototype.clearWindows=function(g,T){var x=this.current708Packet.data,C=x[++g],I=this.getPts(g);this.flushDisplayed(I,T);for(var O=0;O<8;O++)C&1<<O&&T.windows[O].clearText();return g},xt.prototype.deleteWindows=function(g,T){var x=this.current708Packet.data,C=x[++g],I=this.getPts(g);this.flushDisplayed(I,T);for(var O=0;O<8;O++)C&1<<O&&T.windows[O].reset();return g},xt.prototype.setPenAttributes=function(g,T){var x=this.current708Packet.data,C=x[g],I=T.currentWindow.penAttr;return C=x[++g],I.textTag=(C&240)>>4,I.offset=(C&12)>>2,I.penSize=C&3,C=x[++g],I.italics=(C&128)>>7,I.underline=(C&64)>>6,I.edgeType=(C&56)>>3,I.fontStyle=C&7,g},xt.prototype.setPenColor=function(g,T){var x=this.current708Packet.data,C=x[g],I=T.currentWindow.penColor;return C=x[++g],I.fgOpacity=(C&192)>>6,I.fgRed=(C&48)>>4,I.fgGreen=(C&12)>>2,I.fgBlue=C&3,C=x[++g],I.bgOpacity=(C&192)>>6,I.bgRed=(C&48)>>4,I.bgGreen=(C&12)>>2,I.bgBlue=C&3,C=x[++g],I.edgeRed=(C&48)>>4,I.edgeGreen=(C&12)>>2,I.edgeBlue=C&3,g},xt.prototype.setPenLocation=function(g,T){var x=this.current708Packet.data,C=x[g],I=T.currentWindow.penLoc;return T.currentWindow.pendingNewLine=!0,C=x[++g],I.row=C&15,C=x[++g],I.column=C&63,g},xt.prototype.reset=function(g,T){var x=this.getPts(g);return this.flushDisplayed(x,T),this.initService(T.serviceNum,g)};var Ud={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},go=function(g){return g===null?"":(g=Ud[g]||g,String.fromCharCode(g))},li=14,Fd=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Ji=function(){for(var g=[],T=li+1;T--;)g.push({text:"",indent:0,offset:0});return g},jt=function(g,T){jt.prototype.init.call(this),this.field_=g||0,this.dataChannel_=T||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(x){var C,I,O,K,Y;if(C=x.ccData&32639,C===this.lastControlCode_){this.lastControlCode_=null;return}if((C&61440)===4096?this.lastControlCode_=C:C!==this.PADDING_&&(this.lastControlCode_=null),O=C>>>8,K=C&255,C!==this.PADDING_)if(C===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(C===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(x.pts),this.flushDisplayed(x.pts),I=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=I,this.startPts_=x.pts;else if(C===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(x.pts);else if(C===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(x.pts);else if(C===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(x.pts);else if(C===this.CARRIAGE_RETURN_)this.clearFormatting(x.pts),this.flushDisplayed(x.pts),this.shiftRowsUp_(),this.startPts_=x.pts;else if(C===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(C===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(x.pts),this.displayed_=Ji();else if(C===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Ji();else if(C===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(x.pts),this.displayed_=Ji()),this.mode_="paintOn",this.startPts_=x.pts;else if(this.isSpecialCharacter(O,K))O=(O&3)<<8,Y=go(O|K),this[this.mode_](x.pts,Y),this.column_++;else if(this.isExtCharacter(O,K))this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),O=(O&3)<<8,Y=go(O|K),this[this.mode_](x.pts,Y),this.column_++;else if(this.isMidRowCode(O,K))this.clearFormatting(x.pts),this[this.mode_](x.pts," "),this.column_++,(K&14)===14&&this.addFormatting(x.pts,["i"]),(K&1)===1&&this.addFormatting(x.pts,["u"]);else if(this.isOffsetControlCode(O,K)){const ne=K&3;this.nonDisplayed_[this.row_].offset=ne,this.column_+=ne}else if(this.isPAC(O,K)){var ee=Fd.indexOf(C&7968);if(this.mode_==="rollUp"&&(ee-this.rollUpRows_+1<0&&(ee=this.rollUpRows_-1),this.setRollUp(x.pts,ee)),ee!==this.row_&&ee>=0&&ee<=14&&(this.clearFormatting(x.pts),this.row_=ee),K&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(x.pts,["u"]),(C&16)===16){const ne=(C&14)>>1;this.column_=ne*4,this.nonDisplayed_[this.row_].indent+=ne}this.isColorPAC(K)&&(K&14)===14&&this.addFormatting(x.pts,["i"])}else this.isNormalChar(O)&&(K===0&&(K=null),Y=go(O),Y+=go(K),this[this.mode_](x.pts,Y),this.column_+=Y.length)}};jt.prototype=new Ft,jt.prototype.flushDisplayed=function(g){const T=C=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+C+"."})},x=[];this.displayed_.forEach((C,I)=>{if(C&&C.text&&C.text.length){try{C.text=C.text.trim()}catch{T(I)}C.text.length&&x.push({text:C.text,line:I+1,position:10+Math.min(70,C.indent*10)+C.offset*2.5})}else C==null&&T(I)}),x.length&&this.trigger("data",{startPts:this.startPts_,endPts:g,content:x,stream:this.name_})},jt.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Ji(),this.nonDisplayed_=Ji(),this.lastControlCode_=null,this.column_=0,this.row_=li,this.rollUpRows_=2,this.formatting_=[]},jt.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=this.CONTROL_|32,this.END_OF_CAPTION_=this.CONTROL_|47,this.ROLL_UP_2_ROWS_=this.CONTROL_|37,this.ROLL_UP_3_ROWS_=this.CONTROL_|38,this.ROLL_UP_4_ROWS_=this.CONTROL_|39,this.CARRIAGE_RETURN_=this.CONTROL_|45,this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41,this.BACKSPACE_=this.CONTROL_|33,this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44,this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46},jt.prototype.isSpecialCharacter=function(g,T){return g===this.EXT_&&T>=48&&T<=63},jt.prototype.isExtCharacter=function(g,T){return(g===this.EXT_+1||g===this.EXT_+2)&&T>=32&&T<=63},jt.prototype.isMidRowCode=function(g,T){return g===this.EXT_&&T>=32&&T<=47},jt.prototype.isOffsetControlCode=function(g,T){return g===this.OFFSET_&&T>=33&&T<=35},jt.prototype.isPAC=function(g,T){return g>=this.BASE_&&g<this.BASE_+8&&T>=64&&T<=127},jt.prototype.isColorPAC=function(g){return g>=64&&g<=79||g>=96&&g<=127},jt.prototype.isNormalChar=function(g){return g>=32&&g<=127},jt.prototype.setRollUp=function(g,T){if(this.mode_!=="rollUp"&&(this.row_=li,this.mode_="rollUp",this.flushDisplayed(g),this.nonDisplayed_=Ji(),this.displayed_=Ji()),T!==void 0&&T!==this.row_)for(var x=0;x<this.rollUpRows_;x++)this.displayed_[T-x]=this.displayed_[this.row_-x],this.displayed_[this.row_-x]={text:"",indent:0,offset:0};T===void 0&&(T=this.row_),this.topRow_=T-this.rollUpRows_+1},jt.prototype.addFormatting=function(g,T){this.formatting_=this.formatting_.concat(T);var x=T.reduce(function(C,I){return C+"<"+I+">"},"");this[this.mode_](g,x)},jt.prototype.clearFormatting=function(g){if(this.formatting_.length){var T=this.formatting_.reverse().reduce(function(x,C){return x+"</"+C+">"},"");this.formatting_=[],this[this.mode_](g,T)}},jt.prototype.popOn=function(g,T){var x=this.nonDisplayed_[this.row_].text;x+=T,this.nonDisplayed_[this.row_].text=x},jt.prototype.rollUp=function(g,T){var x=this.displayed_[this.row_].text;x+=T,this.displayed_[this.row_].text=x},jt.prototype.shiftRowsUp_=function(){var g;for(g=0;g<this.topRow_;g++)this.displayed_[g]={text:"",indent:0,offset:0};for(g=this.row_+1;g<li+1;g++)this.displayed_[g]={text:"",indent:0,offset:0};for(g=this.topRow_;g<this.row_;g++)this.displayed_[g]=this.displayed_[g+1];this.displayed_[this.row_]={text:"",indent:0,offset:0}},jt.prototype.paintOn=function(g,T){var x=this.displayed_[this.row_].text;x+=T,this.displayed_[this.row_].text=x};var Vd={CaptionStream:Nt,Cea608Stream:jt,Cea708Stream:xt},vo={H264_STREAM_TYPE:27,ADTS_STREAM_TYPE:15,METADATA_STREAM_TYPE:21},yo=t,yg=8589934592,bg=4294967296,jd="shared",bo=function(g,T){var x=1;for(g>T&&(x=-1);Math.abs(T-g)>bg;)g+=x*yg;return g},Kl=function(g){var T,x;Kl.prototype.init.call(this),this.type_=g||jd,this.push=function(C){if(C.type==="metadata"){this.trigger("data",C);return}this.type_!==jd&&C.type!==this.type_||(x===void 0&&(x=C.dts),C.dts=bo(C.dts,x),C.pts=bo(C.pts,x),T=C.dts,this.trigger("data",C))},this.flush=function(){x=T,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){x=void 0,T=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};Kl.prototype=new yo;var Xl={TimestampRolloverStream:Kl,handleRollover:bo},_g=(g,T,x)=>{if(!g)return-1;for(var C=x;C<g.length;C++)if(g[C]===T)return C;return-1},Yl={typedArrayIndexOf:_g},ra=Yl.typedArrayIndexOf,_o={Utf8:3},$d=function(g,T,x){var C,I="";for(C=T;C<x;C++)I+="%"+("00"+g[C].toString(16)).slice(-2);return I},sa=function(g,T,x){return decodeURIComponent($d(g,T,x))},aa=function(g,T,x){return unescape($d(g,T,x))},$t=function(g){return g[0]<<21|g[1]<<14|g[2]<<7|g[3]},oa={APIC:function(g){var T=1,x,C,I="-->";g.data[0]===_o.Utf8&&(x=ra(g.data,0,T),!(x<0)&&(g.mimeType=aa(g.data,T,x),T=x+1,g.pictureType=g.data[T],T++,C=ra(g.data,0,T),!(C<0)&&(g.description=sa(g.data,T,C),T=C+1,g.mimeType===I?g.url=aa(g.data,T,g.data.length):g.pictureData=g.data.subarray(T,g.data.length))))},"T*":function(g){g.data[0]===_o.Utf8&&(g.value=sa(g.data,1,g.data.length).replace(/\0*$/,""),g.values=g.value.split("\0"))},TXXX:function(g){var T;g.data[0]===_o.Utf8&&(T=ra(g.data,0,1),T!==-1&&(g.description=sa(g.data,1,T),g.value=sa(g.data,T+1,g.data.length).replace(/\0*$/,""),g.data=g.value))},"W*":function(g){g.url=aa(g.data,0,g.data.length).replace(/\0.*$/,"")},WXXX:function(g){var T;g.data[0]===_o.Utf8&&(T=ra(g.data,0,1),T!==-1&&(g.description=sa(g.data,1,T),g.url=aa(g.data,T+1,g.data.length).replace(/\0.*$/,"")))},PRIV:function(g){var T;for(T=0;T<g.data.length;T++)if(g.data[T]===0){g.owner=aa(g.data,0,T);break}g.privateData=g.data.subarray(T+1),g.data=g.privateData}},kg=function(g){var T,x,C=10,I=0,O=[];if(!(g.length<10||g[0]!==73||g[1]!==68||g[2]!==51)){I=$t(g.subarray(6,10)),I+=10;var K=g[5]&64;K&&(C+=4,C+=$t(g.subarray(10,14)),I-=$t(g.subarray(16,20)));do{if(T=$t(g.subarray(C+4,C+8)),T<1)break;x=String.fromCharCode(g[C],g[C+1],g[C+2],g[C+3]);var Y={id:x,data:g.subarray(C+10,C+T+10)};Y.key=Y.id,oa[Y.id]?oa[Y.id](Y):Y.id[0]==="T"?oa["T*"](Y):Y.id[0]==="W"&&oa["W*"](Y),O.push(Y),C+=10,C+=T}while(C<I);return O}},Hd={parseId3Frames:kg,parseSyncSafeInteger:$t,frameParsers:oa},la=t,ko=vo,Tr=Hd,To;To=function(g){var T={descriptor:g&&g.descriptor},x=0,C=[],I=0,O;if(To.prototype.init.call(this),this.dispatchType=ko.METADATA_STREAM_TYPE.toString(16),T.descriptor)for(O=0;O<T.descriptor.length;O++)this.dispatchType+=("00"+T.descriptor[O].toString(16)).slice(-2);this.push=function(K){var Y,ee,ne,ce,Ce,Ge;if(K.type==="timed-metadata"){if(K.dataAlignmentIndicator&&(I=0,C.length=0),C.length===0&&(K.data.length<10||K.data[0]!==73||K.data[1]!==68||K.data[2]!==51)){this.trigger("log",{level:"warn",message:"Skipping unrecognized metadata packet"});return}if(C.push(K),I+=K.data.byteLength,C.length===1&&(x=Tr.parseSyncSafeInteger(K.data.subarray(6,10)),x+=10),!(I<x)){for(Y={data:new Uint8Array(x),frames:[],pts:C[0].pts,dts:C[0].dts},Ce=0;Ce<x;)Y.data.set(C[0].data.subarray(0,x-Ce),Ce),Ce+=C[0].data.byteLength,I-=C[0].data.byteLength,C.shift();ee=10,Y.data[5]&64&&(ee+=4,ee+=Tr.parseSyncSafeInteger(Y.data.subarray(10,14)),x-=Tr.parseSyncSafeInteger(Y.data.subarray(16,20)));do{if(ne=Tr.parseSyncSafeInteger(Y.data.subarray(ee+4,ee+8)),ne<1){this.trigger("log",{level:"warn",message:"Malformed ID3 frame encountered. Skipping remaining metadata parsing."});break}if(Ge=String.fromCharCode(Y.data[ee],Y.data[ee+1],Y.data[ee+2],Y.data[ee+3]),ce={id:Ge,data:Y.data.subarray(ee+10,ee+ne+10)},ce.key=ce.id,Tr.frameParsers[ce.id]?Tr.frameParsers[ce.id](ce):ce.id[0]==="T"?Tr.frameParsers["T*"](ce):ce.id[0]==="W"&&Tr.frameParsers["W*"](ce),ce.owner==="com.apple.streaming.transportStreamTimestamp"){var Ae=ce.data,rt=(Ae[3]&1)<<30|Ae[4]<<22|Ae[5]<<14|Ae[6]<<6|Ae[7]>>>2;rt*=4,rt+=Ae[7]&3,ce.timeStamp=rt,Y.pts===void 0&&Y.dts===void 0&&(Y.pts=ce.timeStamp,Y.dts=ce.timeStamp),this.trigger("timestamp",ce)}Y.frames.push(ce),ee+=10,ee+=ne}while(ee<x);this.trigger("data",Y)}}}},To.prototype=new la;var qd=To,Jl=t,Ql=Vd,Si=vo,zd=Xl.TimestampRolloverStream,So,Gr,Co,ys=188,Zl=71;So=function(){var g=new Uint8Array(ys),T=0;So.prototype.init.call(this),this.push=function(x){var C=0,I=ys,O;for(T?(O=new Uint8Array(x.byteLength+T),O.set(g.subarray(0,T)),O.set(x,T),T=0):O=x;I<O.byteLength;){if(O[C]===Zl&&O[I]===Zl){this.trigger("data",O.subarray(C,I)),C+=ys,I+=ys;continue}C++,I++}C<O.byteLength&&(g.set(O.subarray(C),0),T=O.byteLength-C)},this.flush=function(){T===ys&&g[0]===Zl&&(this.trigger("data",g),T=0),this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.reset=function(){T=0,this.trigger("reset")}},So.prototype=new Jl,Gr=function(){var g,T,x,C;Gr.prototype.init.call(this),C=this,this.packetsWaitingForPmt=[],this.programMapTable=void 0,g=function(I,O){var K=0;O.payloadUnitStartIndicator&&(K+=I[K]+1),O.type==="pat"?T(I.subarray(K),O):x(I.subarray(K),O)},T=function(I,O){O.section_number=I[7],O.last_section_number=I[8],C.pmtPid=(I[10]&31)<<8|I[11],O.pmtPid=C.pmtPid},x=function(I,O){var K,Y,ee,ne;if(I[5]&1){for(C.programMapTable={video:null,audio:null,"timed-metadata":{}},K=(I[1]&15)<<8|I[2],Y=3+K-4,ee=(I[10]&15)<<8|I[11],ne=12+ee;ne<Y;){var ce=I[ne],Ce=(I[ne+1]&31)<<8|I[ne+2];ce===Si.H264_STREAM_TYPE&&C.programMapTable.video===null?C.programMapTable.video=Ce:ce===Si.ADTS_STREAM_TYPE&&C.programMapTable.audio===null?C.programMapTable.audio=Ce:ce===Si.METADATA_STREAM_TYPE&&(C.programMapTable["timed-metadata"][Ce]=ce),ne+=((I[ne+3]&15)<<8|I[ne+4])+5}O.programMapTable=C.programMapTable}},this.push=function(I){var O={},K=4;if(O.payloadUnitStartIndicator=!!(I[1]&64),O.pid=I[1]&31,O.pid<<=8,O.pid|=I[2],(I[3]&48)>>>4>1&&(K+=I[K]+1),O.pid===0)O.type="pat",g(I.subarray(K),O),this.trigger("data",O);else if(O.pid===this.pmtPid)for(O.type="pmt",g(I.subarray(K),O),this.trigger("data",O);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([I,K,O]):this.processPes_(I,K,O)},this.processPes_=function(I,O,K){K.pid===this.programMapTable.video?K.streamType=Si.H264_STREAM_TYPE:K.pid===this.programMapTable.audio?K.streamType=Si.ADTS_STREAM_TYPE:K.streamType=this.programMapTable["timed-metadata"][K.pid],K.type="pes",K.data=I.subarray(O),this.trigger("data",K)}},Gr.prototype=new Jl,Gr.STREAM_TYPES={h264:27,adts:15},Co=function(){var g=this,T=!1,x={data:[],size:0},C={data:[],size:0},I={data:[],size:0},O,K=function(ee,ne){var ce;const Ce=ee[0]<<16|ee[1]<<8|ee[2];ne.data=new Uint8Array,Ce===1&&(ne.packetLength=6+(ee[4]<<8|ee[5]),ne.dataAlignmentIndicator=(ee[6]&4)!==0,ce=ee[7],ce&192&&(ne.pts=(ee[9]&14)<<27|(ee[10]&255)<<20|(ee[11]&254)<<12|(ee[12]&255)<<5|(ee[13]&254)>>>3,ne.pts*=4,ne.pts+=(ee[13]&6)>>>1,ne.dts=ne.pts,ce&64&&(ne.dts=(ee[14]&14)<<27|(ee[15]&255)<<20|(ee[16]&254)<<12|(ee[17]&255)<<5|(ee[18]&254)>>>3,ne.dts*=4,ne.dts+=(ee[18]&6)>>>1)),ne.data=ee.subarray(9+ee[8]))},Y=function(ee,ne,ce){var Ce=new Uint8Array(ee.size),Ge={type:ne},Ae=0,rt=0,yt=!1,xn;if(!(!ee.data.length||ee.size<9)){for(Ge.trackId=ee.data[0].pid,Ae=0;Ae<ee.data.length;Ae++)xn=ee.data[Ae],Ce.set(xn.data,rt),rt+=xn.data.byteLength;K(Ce,Ge),yt=ne==="video"||Ge.packetLength<=ee.size,(ce||yt)&&(ee.size=0,ee.data.length=0),yt&&g.trigger("data",Ge)}};Co.prototype.init.call(this),this.push=function(ee){({pat:function(){},pes:function(){var ne,ce;switch(ee.streamType){case Si.H264_STREAM_TYPE:ne=x,ce="video";break;case Si.ADTS_STREAM_TYPE:ne=C,ce="audio";break;case Si.METADATA_STREAM_TYPE:ne=I,ce="timed-metadata";break;default:return}ee.payloadUnitStartIndicator&&Y(ne,ce,!0),ne.data.push(ee),ne.size+=ee.data.byteLength},pmt:function(){var ne={type:"metadata",tracks:[]};O=ee.programMapTable,O.video!==null&&ne.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+O.video,codec:"avc",type:"video"}),O.audio!==null&&ne.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+O.audio,codec:"adts",type:"audio"}),T=!0,g.trigger("data",ne)}})[ee.type]()},this.reset=function(){x.size=0,x.data.length=0,C.size=0,C.data.length=0,this.trigger("reset")},this.flushStreams_=function(){Y(x,"video"),Y(C,"audio"),Y(I,"timed-metadata")},this.flush=function(){if(!T&&O){var ee={type:"metadata",tracks:[]};O.video!==null&&ee.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+O.video,codec:"avc",type:"video"}),O.audio!==null&&ee.tracks.push({timelineStartInfo:{baseMediaDecodeTime:0},id:+O.audio,codec:"adts",type:"audio"}),g.trigger("data",ee)}T=!1,this.flushStreams_(),this.trigger("done")}},Co.prototype=new Jl;var Gd={PAT_PID:0,MP2T_PACKET_LENGTH:ys,TransportPacketStream:So,TransportParseStream:Gr,ElementaryStream:Co,TimestampRolloverStream:zd,CaptionStream:Ql.CaptionStream,Cea608Stream:Ql.Cea608Stream,Cea708Stream:Ql.Cea708Stream,MetadataStream:qd};for(var bs in Si)Si.hasOwnProperty(bs)&&(Gd[bs]=Si[bs]);var Tg=Gd,Sg=t,Wd=St.ONE_SECOND_IN_TS,xo,Kd=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];xo=function(g){var T,x=0;xo.prototype.init.call(this),this.skipWarn_=function(C,I){this.trigger("log",{level:"warn",message:`adts skiping bytes ${C} to ${I} in frame ${x} outside syncword`})},this.push=function(C){var I=0,O,K,Y,ee,ne;if(g||(x=0),C.type==="audio"){T&&T.length?(Y=T,T=new Uint8Array(Y.byteLength+C.data.byteLength),T.set(Y),T.set(C.data,Y.byteLength)):T=C.data;for(var ce;I+7<T.length;){if(T[I]!==255||(T[I+1]&246)!==240){typeof ce!="number"&&(ce=I),I++;continue}if(typeof ce=="number"&&(this.skipWarn_(ce,I),ce=null),K=(~T[I+1]&1)*2,O=(T[I+3]&3)<<11|T[I+4]<<3|(T[I+5]&224)>>5,ee=((T[I+6]&3)+1)*1024,ne=ee*Wd/Kd[(T[I+2]&60)>>>2],T.byteLength-I<O)break;this.trigger("data",{pts:C.pts+x*ne,dts:C.dts+x*ne,sampleCount:ee,audioobjecttype:(T[I+2]>>>6&3)+1,channelcount:(T[I+2]&1)<<2|(T[I+3]&192)>>>6,samplerate:Kd[(T[I+2]&60)>>>2],samplingfrequencyindex:(T[I+2]&60)>>>2,samplesize:16,data:T.subarray(I+7+K,I+O)}),x++,I+=O}typeof ce=="number"&&(this.skipWarn_(ce,I),ce=null),T=T.subarray(I)}},this.flush=function(){x=0,this.trigger("done")},this.reset=function(){T=void 0,this.trigger("reset")},this.endTimeline=function(){T=void 0,this.trigger("endedtimeline")}},xo.prototype=new Sg;var Cg=xo,Xd;Xd=function(g){var T=g.byteLength,x=0,C=0;this.length=function(){return 8*T},this.bitsAvailable=function(){return 8*T+C},this.loadWord=function(){var I=g.byteLength-T,O=new Uint8Array(4),K=Math.min(4,T);if(K===0)throw new Error("no bytes available");O.set(g.subarray(I,I+K)),x=new DataView(O.buffer).getUint32(0),C=K*8,T-=K},this.skipBits=function(I){var O;C>I?(x<<=I,C-=I):(I-=C,O=Math.floor(I/8),I-=O*8,T-=O,this.loadWord(),x<<=I,C-=I)},this.readBits=function(I){var O=Math.min(C,I),K=x>>>32-O;return C-=O,C>0?x<<=O:T>0&&this.loadWord(),O=I-O,O>0?K<<O|this.readBits(O):K},this.skipLeadingZeros=function(){var I;for(I=0;I<C;++I)if(x&2147483648>>>I)return x<<=I,C-=I,I;return this.loadWord(),I+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var I=this.skipLeadingZeros();return this.readBits(I+1)-1},this.readExpGolomb=function(){var I=this.readUnsignedExpGolomb();return 1&I?1+I>>>1:-1*(I>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var xg=Xd,Eo=t,Eg=xg,wo,Do,Ao;Do=function(){var g=0,T,x;Do.prototype.init.call(this),this.push=function(C){var I;x?(I=new Uint8Array(x.byteLength+C.data.byteLength),I.set(x),I.set(C.data,x.byteLength),x=I):x=C.data;for(var O=x.byteLength;g<O-3;g++)if(x[g+2]===1){T=g+5;break}for(;T<O;)switch(x[T]){case 0:if(x[T-1]!==0){T+=2;break}else if(x[T-2]!==0){T++;break}g+3!==T-2&&this.trigger("data",x.subarray(g+3,T-2));do T++;while(x[T]!==1&&T<O);g=T-2,T+=3;break;case 1:if(x[T-1]!==0||x[T-2]!==0){T+=3;break}this.trigger("data",x.subarray(g+3,T-2)),g=T-2,T+=3;break;default:T+=3;break}x=x.subarray(g),T-=g,g=0},this.reset=function(){x=null,g=0,this.trigger("reset")},this.flush=function(){x&&x.byteLength>3&&this.trigger("data",x.subarray(g+3)),x=null,g=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},Do.prototype=new Eo,Ao={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},wo=function(){var g=new Do,T,x,C,I,O,K,Y;wo.prototype.init.call(this),T=this,this.push=function(ee){ee.type==="video"&&(x=ee.trackId,C=ee.pts,I=ee.dts,g.push(ee))},g.on("data",function(ee){var ne={trackId:x,pts:C,dts:I,data:ee,nalUnitTypeCode:ee[0]&31};switch(ne.nalUnitTypeCode){case 5:ne.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:ne.nalUnitType="sei_rbsp",ne.escapedRBSP=O(ee.subarray(1));break;case 7:ne.nalUnitType="seq_parameter_set_rbsp",ne.escapedRBSP=O(ee.subarray(1)),ne.config=K(ne.escapedRBSP);break;case 8:ne.nalUnitType="pic_parameter_set_rbsp";break;case 9:ne.nalUnitType="access_unit_delimiter_rbsp";break}T.trigger("data",ne)}),g.on("done",function(){T.trigger("done")}),g.on("partialdone",function(){T.trigger("partialdone")}),g.on("reset",function(){T.trigger("reset")}),g.on("endedtimeline",function(){T.trigger("endedtimeline")}),this.flush=function(){g.flush()},this.partialFlush=function(){g.partialFlush()},this.reset=function(){g.reset()},this.endTimeline=function(){g.endTimeline()},Y=function(ee,ne){var ce=8,Ce=8,Ge,Ae;for(Ge=0;Ge<ee;Ge++)Ce!==0&&(Ae=ne.readExpGolomb(),Ce=(ce+Ae+256)%256),ce=Ce===0?ce:Ce},O=function(ee){for(var ne=ee.byteLength,ce=[],Ce=1,Ge,Ae;Ce<ne-2;)ee[Ce]===0&&ee[Ce+1]===0&&ee[Ce+2]===3?(ce.push(Ce+2),Ce+=2):Ce++;if(ce.length===0)return ee;Ge=ne-ce.length,Ae=new Uint8Array(Ge);var rt=0;for(Ce=0;Ce<Ge;rt++,Ce++)rt===ce[0]&&(rt++,ce.shift()),Ae[Ce]=ee[rt];return Ae},K=function(ee){var ne=0,ce=0,Ce=0,Ge=0,Ae,rt,yt,xn,Ci,Ss,lc,cc,uc,dc,hh,Kt=[1,1],hc,Zi;if(Ae=new Eg(ee),rt=Ae.readUnsignedByte(),xn=Ae.readUnsignedByte(),yt=Ae.readUnsignedByte(),Ae.skipUnsignedExpGolomb(),Ao[rt]&&(Ci=Ae.readUnsignedExpGolomb(),Ci===3&&Ae.skipBits(1),Ae.skipUnsignedExpGolomb(),Ae.skipUnsignedExpGolomb(),Ae.skipBits(1),Ae.readBoolean()))for(hh=Ci!==3?8:12,Zi=0;Zi<hh;Zi++)Ae.readBoolean()&&(Zi<6?Y(16,Ae):Y(64,Ae));if(Ae.skipUnsignedExpGolomb(),Ss=Ae.readUnsignedExpGolomb(),Ss===0)Ae.readUnsignedExpGolomb();else if(Ss===1)for(Ae.skipBits(1),Ae.skipExpGolomb(),Ae.skipExpGolomb(),lc=Ae.readUnsignedExpGolomb(),Zi=0;Zi<lc;Zi++)Ae.skipExpGolomb();if(Ae.skipUnsignedExpGolomb(),Ae.skipBits(1),cc=Ae.readUnsignedExpGolomb(),uc=Ae.readUnsignedExpGolomb(),dc=Ae.readBits(1),dc===0&&Ae.skipBits(1),Ae.skipBits(1),Ae.readBoolean()&&(ne=Ae.readUnsignedExpGolomb(),ce=Ae.readUnsignedExpGolomb(),Ce=Ae.readUnsignedExpGolomb(),Ge=Ae.readUnsignedExpGolomb()),Ae.readBoolean()&&Ae.readBoolean()){switch(hc=Ae.readUnsignedByte(),hc){case 1:Kt=[1,1];break;case 2:Kt=[12,11];break;case 3:Kt=[10,11];break;case 4:Kt=[16,11];break;case 5:Kt=[40,33];break;case 6:Kt=[24,11];break;case 7:Kt=[20,11];break;case 8:Kt=[32,11];break;case 9:Kt=[80,33];break;case 10:Kt=[18,11];break;case 11:Kt=[15,11];break;case 12:Kt=[64,33];break;case 13:Kt=[160,99];break;case 14:Kt=[4,3];break;case 15:Kt=[3,2];break;case 16:Kt=[2,1];break;case 255:{Kt=[Ae.readUnsignedByte()<<8|Ae.readUnsignedByte(),Ae.readUnsignedByte()<<8|Ae.readUnsignedByte()];break}}Kt&&Kt[0]/Kt[1]}return{profileIdc:rt,levelIdc:yt,profileCompatibility:xn,width:(cc+1)*16-ne*2-ce*2,height:(2-dc)*(uc+1)*16-Ce*2-Ge*2,sarRatio:Kt}}},wo.prototype=new Eo;var wg={H264Stream:wo},Dg=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],Yd=function(g,T){var x=g[T+6]<<21|g[T+7]<<14|g[T+8]<<7|g[T+9],C=g[T+5],I=(C&16)>>4;return x=x>=0?x:0,I?x+20:x+10},Jd=function(g,T){return g.length-T<10||g[T]!==73||g[T+1]!==68||g[T+2]!==51?T:(T+=Yd(g,T),Jd(g,T))},Ag=function(g){var T=Jd(g,0);return g.length>=T+2&&(g[T]&255)===255&&(g[T+1]&240)===240&&(g[T+1]&22)===16},Qd=function(g){return g[0]<<21|g[1]<<14|g[2]<<7|g[3]},Ig=function(g,T,x){var C,I="";for(C=T;C<x;C++)I+="%"+("00"+g[C].toString(16)).slice(-2);return I},Zd=function(g,T,x){return unescape(Ig(g,T,x))},eh=function(g,T){var x=(g[T+5]&224)>>5,C=g[T+4]<<3,I=g[T+3]&6144;return I|C|x},Ng=function(g,T){return g[T]===73&&g[T+1]===68&&g[T+2]===51?"timed-metadata":g[T]&!0&&(g[T+1]&240)===240?"audio":null},th=function(g){for(var T=0;T+5<g.length;){if(g[T]!==255||(g[T+1]&246)!==240){T++;continue}return Dg[(g[T+2]&60)>>>2]}return null},nh=function(g){var T,x,C,I;T=10,g[5]&64&&(T+=4,T+=Qd(g.subarray(10,14)));do{if(x=Qd(g.subarray(T+4,T+8)),x<1)return null;if(I=String.fromCharCode(g[T],g[T+1],g[T+2],g[T+3]),I==="PRIV"){C=g.subarray(T+10,T+x+10);for(var O=0;O<C.byteLength;O++)if(C[O]===0){var K=Zd(C,0,O);if(K==="com.apple.streaming.transportStreamTimestamp"){var Y=C.subarray(O+1),ee=(Y[3]&1)<<30|Y[4]<<22|Y[5]<<14|Y[6]<<6|Y[7]>>>2;return ee*=4,ee+=Y[7]&3,ee}break}}T+=10,T+=x}while(T<g.byteLength);return null},ec={isLikelyAacData:Ag,parseId3TagSize:Yd,parseAdtsSize:eh,parseType:Ng,parseSampleRate:th,parseAacTimestamp:nh},Pg=t,ih=ec,Io;Io=function(){var g=new Uint8Array,T=0;Io.prototype.init.call(this),this.setTimestamp=function(x){T=x},this.push=function(x){var C=0,I=0,O,K,Y,ee;for(g.length?(ee=g.length,g=new Uint8Array(x.byteLength+ee),g.set(g.subarray(0,ee)),g.set(x,ee)):g=x;g.length-I>=3;){if(g[I]===73&&g[I+1]===68&&g[I+2]===51){if(g.length-I<10||(C=ih.parseId3TagSize(g,I),I+C>g.length))break;K={type:"timed-metadata",data:g.subarray(I,I+C)},this.trigger("data",K),I+=C;continue}else if((g[I]&255)===255&&(g[I+1]&240)===240){if(g.length-I<7||(C=ih.parseAdtsSize(g,I),I+C>g.length))break;Y={type:"audio",data:g.subarray(I,I+C),pts:T,dts:T},this.trigger("data",Y),I+=C;continue}I++}O=g.length-I,O>0?g=g.subarray(I):g=new Uint8Array},this.reset=function(){g=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){g=new Uint8Array,this.trigger("endedtimeline")}},Io.prototype=new Pg;var Og=Io,Mg=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Rg=Mg,Lg=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Bg=Lg,No=t,ca=Te,ua=Be,Po=qr,ci=He,Qi=Tg,ui=St,tc=Cg,Ug=wg.H264Stream,Fg=Og,Vg=ec.isLikelyAacData,jg=St.ONE_SECOND_IN_TS,da=Rg,rh=Bg,_s,ks,Oo,Sr,$g=function(g,T){T.stream=g,this.trigger("log",T)},sh=function(g,T){for(var x=Object.keys(T),C=0;C<x.length;C++){var I=x[C];I==="headOfPipeline"||!T[I].on||T[I].on("log",$g.bind(g,I))}},ah=function(g,T){var x;if(g.length!==T.length)return!1;for(x=0;x<g.length;x++)if(g[x]!==T[x])return!1;return!0},oh=function(g,T,x,C,I,O){var K=x-T,Y=C-T,ee=I-x;return{start:{dts:g,pts:g+K},end:{dts:g+Y,pts:g+ee},prependedContentDuration:O,baseMediaDecodeTime:g}};ks=function(g,T){var x=[],C,I=0,O=0,K=1/0;T=T||{},C=T.firstSequenceNumber||0,ks.prototype.init.call(this),this.push=function(Y){ci.collectDtsInfo(g,Y),g&&da.forEach(function(ee){g[ee]=Y[ee]}),x.push(Y)},this.setEarliestDts=function(Y){I=Y},this.setVideoBaseMediaDecodeTime=function(Y){K=Y},this.setAudioAppendStart=function(Y){O=Y},this.flush=function(){var Y,ee,ne,ce,Ce,Ge,Ae;if(x.length===0){this.trigger("done","AudioSegmentStream");return}Y=Po.trimAdtsFramesByEarliestDts(x,g,I),g.baseMediaDecodeTime=ci.calculateTrackBaseMediaDecodeTime(g,T.keepOriginalTimestamps),Ae=Po.prefixWithSilence(g,Y,O,K),g.samples=Po.generateSampleTable(Y),ne=ca.mdat(Po.concatenateFrameData(Y)),x=[],ee=ca.moof(C,[g]),ce=new Uint8Array(ee.byteLength+ne.byteLength),C++,ce.set(ee),ce.set(ne,ee.byteLength),ci.clearDtsInfo(g),Ce=Math.ceil(jg*1024/g.samplerate),Y.length&&(Ge=Y.length*Ce,this.trigger("segmentTimingInfo",oh(ui.audioTsToVideoTs(g.baseMediaDecodeTime,g.samplerate),Y[0].dts,Y[0].pts,Y[0].dts+Ge,Y[0].pts+Ge,Ae||0)),this.trigger("timingInfo",{start:Y[0].pts,end:Y[0].pts+Ge})),this.trigger("data",{track:g,boxes:ce}),this.trigger("done","AudioSegmentStream")},this.reset=function(){ci.clearDtsInfo(g),x=[],this.trigger("reset")}},ks.prototype=new No,_s=function(g,T){var x,C=[],I=[],O,K;T=T||{},x=T.firstSequenceNumber||0,_s.prototype.init.call(this),delete g.minPTS,this.gopCache_=[],this.push=function(Y){ci.collectDtsInfo(g,Y),Y.nalUnitType==="seq_parameter_set_rbsp"&&!O&&(O=Y.config,g.sps=[Y.data],rh.forEach(function(ee){g[ee]=O[ee]},this)),Y.nalUnitType==="pic_parameter_set_rbsp"&&!K&&(K=Y.data,g.pps=[Y.data]),C.push(Y)},this.flush=function(){for(var Y,ee,ne,ce,Ce,Ge,Ae=0,rt,yt;C.length&&C[0].nalUnitType!=="access_unit_delimiter_rbsp";)C.shift();if(C.length===0){this.resetStream_(),this.trigger("done","VideoSegmentStream");return}if(Y=ua.groupNalsIntoFrames(C),ne=ua.groupFramesIntoGops(Y),ne[0][0].keyFrame||(ee=this.getGopForFusion_(C[0],g),ee?(Ae=ee.duration,ne.unshift(ee),ne.byteLength+=ee.byteLength,ne.nalCount+=ee.nalCount,ne.pts=ee.pts,ne.dts=ee.dts,ne.duration+=ee.duration):ne=ua.extendFirstKeyFrame(ne)),I.length){var xn;if(T.alignGopsAtEnd?xn=this.alignGopsAtEnd_(ne):xn=this.alignGopsAtStart_(ne),!xn){this.gopCache_.unshift({gop:ne.pop(),pps:g.pps,sps:g.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),C=[],this.resetStream_(),this.trigger("done","VideoSegmentStream");return}ci.clearDtsInfo(g),ne=xn}ci.collectDtsInfo(g,ne),g.samples=ua.generateSampleTable(ne),Ce=ca.mdat(ua.concatenateNalData(ne)),g.baseMediaDecodeTime=ci.calculateTrackBaseMediaDecodeTime(g,T.keepOriginalTimestamps),this.trigger("processedGopsInfo",ne.map(function(Ci){return{pts:Ci.pts,dts:Ci.dts,byteLength:Ci.byteLength}})),rt=ne[0],yt=ne[ne.length-1],this.trigger("segmentTimingInfo",oh(g.baseMediaDecodeTime,rt.dts,rt.pts,yt.dts+yt.duration,yt.pts+yt.duration,Ae)),this.trigger("timingInfo",{start:ne[0].pts,end:ne[ne.length-1].pts+ne[ne.length-1].duration}),this.gopCache_.unshift({gop:ne.pop(),pps:g.pps,sps:g.sps}),this.gopCache_.length=Math.min(6,this.gopCache_.length),C=[],this.trigger("baseMediaDecodeTime",g.baseMediaDecodeTime),this.trigger("timelineStartInfo",g.timelineStartInfo),ce=ca.moof(x,[g]),Ge=new Uint8Array(ce.byteLength+Ce.byteLength),x++,Ge.set(ce),Ge.set(Ce,ce.byteLength),this.trigger("data",{track:g,boxes:Ge}),this.resetStream_(),this.trigger("done","VideoSegmentStream")},this.reset=function(){this.resetStream_(),C=[],this.gopCache_.length=0,I.length=0,this.trigger("reset")},this.resetStream_=function(){ci.clearDtsInfo(g),O=void 0,K=void 0},this.getGopForFusion_=function(Y){var ee=45e3,ne=1/0,ce,Ce,Ge,Ae,rt;for(rt=0;rt<this.gopCache_.length;rt++)Ae=this.gopCache_[rt],Ge=Ae.gop,!(!(g.pps&&ah(g.pps[0],Ae.pps[0]))||!(g.sps&&ah(g.sps[0],Ae.sps[0])))&&(Ge.dts<g.timelineStartInfo.dts||(ce=Y.dts-Ge.dts-Ge.duration,ce>=-1e4&&ce<=ee&&(!Ce||ne>ce)&&(Ce=Ae,ne=ce)));return Ce?Ce.gop:null},this.alignGopsAtStart_=function(Y){var ee,ne,ce,Ce,Ge,Ae,rt,yt;for(Ge=Y.byteLength,Ae=Y.nalCount,rt=Y.duration,ee=ne=0;ee<I.length&&ne<Y.length&&(ce=I[ee],Ce=Y[ne],ce.pts!==Ce.pts);){if(Ce.pts>ce.pts){ee++;continue}ne++,Ge-=Ce.byteLength,Ae-=Ce.nalCount,rt-=Ce.duration}return ne===0?Y:ne===Y.length?null:(yt=Y.slice(ne),yt.byteLength=Ge,yt.duration=rt,yt.nalCount=Ae,yt.pts=yt[0].pts,yt.dts=yt[0].dts,yt)},this.alignGopsAtEnd_=function(Y){var ee,ne,ce,Ce,Ge,Ae;for(ee=I.length-1,ne=Y.length-1,Ge=null,Ae=!1;ee>=0&&ne>=0;){if(ce=I[ee],Ce=Y[ne],ce.pts===Ce.pts){Ae=!0;break}if(ce.pts>Ce.pts){ee--;continue}ee===I.length-1&&(Ge=ne),ne--}if(!Ae&&Ge===null)return null;var rt;if(Ae?rt=ne:rt=Ge,rt===0)return Y;var yt=Y.slice(rt),xn=yt.reduce(function(Ci,Ss){return Ci.byteLength+=Ss.byteLength,Ci.duration+=Ss.duration,Ci.nalCount+=Ss.nalCount,Ci},{byteLength:0,duration:0,nalCount:0});return yt.byteLength=xn.byteLength,yt.duration=xn.duration,yt.nalCount=xn.nalCount,yt.pts=yt[0].pts,yt.dts=yt[0].dts,yt},this.alignGopsWith=function(Y){I=Y}},_s.prototype=new No,Sr=function(g,T){this.numberOfTracks=0,this.metadataStream=T,g=g||{},typeof g.remux<"u"?this.remuxTracks=!!g.remux:this.remuxTracks=!0,typeof g.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=g.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,Sr.prototype.init.call(this),this.push=function(x){if(x.content||x.text)return this.pendingCaptions.push(x);if(x.frames)return this.pendingMetadata.push(x);this.pendingTracks.push(x.track),this.pendingBytes+=x.boxes.byteLength,x.track.type==="video"&&(this.videoTrack=x.track,this.pendingBoxes.push(x.boxes)),x.track.type==="audio"&&(this.audioTrack=x.track,this.pendingBoxes.unshift(x.boxes))}},Sr.prototype=new No,Sr.prototype.flush=function(g){var T=0,x={captions:[],captionStreams:{},metadata:[],info:{}},C,I,O,K=0,Y;if(this.pendingTracks.length<this.numberOfTracks){if(g!=="VideoSegmentStream"&&g!=="AudioSegmentStream")return;if(this.remuxTracks)return;if(this.pendingTracks.length===0){this.emittedTracks++,this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(K=this.videoTrack.timelineStartInfo.pts,rh.forEach(function(ee){x.info[ee]=this.videoTrack[ee]},this)):this.audioTrack&&(K=this.audioTrack.timelineStartInfo.pts,da.forEach(function(ee){x.info[ee]=this.audioTrack[ee]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?x.type=this.pendingTracks[0].type:x.type="combined",this.emittedTracks+=this.pendingTracks.length,O=ca.initSegment(this.pendingTracks),x.initSegment=new Uint8Array(O.byteLength),x.initSegment.set(O),x.data=new Uint8Array(this.pendingBytes),Y=0;Y<this.pendingBoxes.length;Y++)x.data.set(this.pendingBoxes[Y],T),T+=this.pendingBoxes[Y].byteLength;for(Y=0;Y<this.pendingCaptions.length;Y++)C=this.pendingCaptions[Y],C.startTime=ui.metadataTsToSeconds(C.startPts,K,this.keepOriginalTimestamps),C.endTime=ui.metadataTsToSeconds(C.endPts,K,this.keepOriginalTimestamps),x.captionStreams[C.stream]=!0,x.captions.push(C);for(Y=0;Y<this.pendingMetadata.length;Y++)I=this.pendingMetadata[Y],I.cueTime=ui.metadataTsToSeconds(I.pts,K,this.keepOriginalTimestamps),x.metadata.push(I);for(x.metadata.dispatchType=this.metadataStream.dispatchType,this.pendingTracks.length=0,this.videoTrack=null,this.pendingBoxes.length=0,this.pendingCaptions.length=0,this.pendingBytes=0,this.pendingMetadata.length=0,this.trigger("data",x),Y=0;Y<x.captions.length;Y++)C=x.captions[Y],this.trigger("caption",C);for(Y=0;Y<x.metadata.length;Y++)I=x.metadata[Y],this.trigger("id3Frame",I)}this.emittedTracks>=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},Sr.prototype.setRemux=function(g){this.remuxTracks=g},Oo=function(g){var T=this,x=!0,C,I;Oo.prototype.init.call(this),g=g||{},this.baseMediaDecodeTime=g.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var O={};this.transmuxPipeline_=O,O.type="aac",O.metadataStream=new Qi.MetadataStream,O.aacStream=new Fg,O.audioTimestampRolloverStream=new Qi.TimestampRolloverStream("audio"),O.timedMetadataTimestampRolloverStream=new Qi.TimestampRolloverStream("timed-metadata"),O.adtsStream=new tc,O.coalesceStream=new Sr(g,O.metadataStream),O.headOfPipeline=O.aacStream,O.aacStream.pipe(O.audioTimestampRolloverStream).pipe(O.adtsStream),O.aacStream.pipe(O.timedMetadataTimestampRolloverStream).pipe(O.metadataStream).pipe(O.coalesceStream),O.metadataStream.on("timestamp",function(K){O.aacStream.setTimestamp(K.timeStamp)}),O.aacStream.on("data",function(K){K.type!=="timed-metadata"&&K.type!=="audio"||O.audioSegmentStream||(I=I||{timelineStartInfo:{baseMediaDecodeTime:T.baseMediaDecodeTime},codec:"adts",type:"audio"},O.coalesceStream.numberOfTracks++,O.audioSegmentStream=new ks(I,g),O.audioSegmentStream.on("log",T.getLogTrigger_("audioSegmentStream")),O.audioSegmentStream.on("timingInfo",T.trigger.bind(T,"audioTimingInfo")),O.adtsStream.pipe(O.audioSegmentStream).pipe(O.coalesceStream),T.trigger("trackinfo",{hasAudio:!!I,hasVideo:!!C}))}),O.coalesceStream.on("data",this.trigger.bind(this,"data")),O.coalesceStream.on("done",this.trigger.bind(this,"done")),sh(this,O)},this.setupTsPipeline=function(){var O={};this.transmuxPipeline_=O,O.type="ts",O.metadataStream=new Qi.MetadataStream,O.packetStream=new Qi.TransportPacketStream,O.parseStream=new Qi.TransportParseStream,O.elementaryStream=new Qi.ElementaryStream,O.timestampRolloverStream=new Qi.TimestampRolloverStream,O.adtsStream=new tc,O.h264Stream=new Ug,O.captionStream=new Qi.CaptionStream(g),O.coalesceStream=new Sr(g,O.metadataStream),O.headOfPipeline=O.packetStream,O.packetStream.pipe(O.parseStream).pipe(O.elementaryStream).pipe(O.timestampRolloverStream),O.timestampRolloverStream.pipe(O.h264Stream),O.timestampRolloverStream.pipe(O.adtsStream),O.timestampRolloverStream.pipe(O.metadataStream).pipe(O.coalesceStream),O.h264Stream.pipe(O.captionStream).pipe(O.coalesceStream),O.elementaryStream.on("data",function(K){var Y;if(K.type==="metadata"){for(Y=K.tracks.length;Y--;)!C&&K.tracks[Y].type==="video"?(C=K.tracks[Y],C.timelineStartInfo.baseMediaDecodeTime=T.baseMediaDecodeTime):!I&&K.tracks[Y].type==="audio"&&(I=K.tracks[Y],I.timelineStartInfo.baseMediaDecodeTime=T.baseMediaDecodeTime);C&&!O.videoSegmentStream&&(O.coalesceStream.numberOfTracks++,O.videoSegmentStream=new _s(C,g),O.videoSegmentStream.on("log",T.getLogTrigger_("videoSegmentStream")),O.videoSegmentStream.on("timelineStartInfo",function(ee){I&&!g.keepOriginalTimestamps&&(I.timelineStartInfo=ee,O.audioSegmentStream.setEarliestDts(ee.dts-T.baseMediaDecodeTime))}),O.videoSegmentStream.on("processedGopsInfo",T.trigger.bind(T,"gopInfo")),O.videoSegmentStream.on("segmentTimingInfo",T.trigger.bind(T,"videoSegmentTimingInfo")),O.videoSegmentStream.on("baseMediaDecodeTime",function(ee){I&&O.audioSegmentStream.setVideoBaseMediaDecodeTime(ee)}),O.videoSegmentStream.on("timingInfo",T.trigger.bind(T,"videoTimingInfo")),O.h264Stream.pipe(O.videoSegmentStream).pipe(O.coalesceStream)),I&&!O.audioSegmentStream&&(O.coalesceStream.numberOfTracks++,O.audioSegmentStream=new ks(I,g),O.audioSegmentStream.on("log",T.getLogTrigger_("audioSegmentStream")),O.audioSegmentStream.on("timingInfo",T.trigger.bind(T,"audioTimingInfo")),O.audioSegmentStream.on("segmentTimingInfo",T.trigger.bind(T,"audioSegmentTimingInfo")),O.adtsStream.pipe(O.audioSegmentStream).pipe(O.coalesceStream)),T.trigger("trackinfo",{hasAudio:!!I,hasVideo:!!C})}}),O.coalesceStream.on("data",this.trigger.bind(this,"data")),O.coalesceStream.on("id3Frame",function(K){K.dispatchType=O.metadataStream.dispatchType,T.trigger("id3Frame",K)}),O.coalesceStream.on("caption",this.trigger.bind(this,"caption")),O.coalesceStream.on("done",this.trigger.bind(this,"done")),sh(this,O)},this.setBaseMediaDecodeTime=function(O){var K=this.transmuxPipeline_;g.keepOriginalTimestamps||(this.baseMediaDecodeTime=O),I&&(I.timelineStartInfo.dts=void 0,I.timelineStartInfo.pts=void 0,ci.clearDtsInfo(I),K.audioTimestampRolloverStream&&K.audioTimestampRolloverStream.discontinuity()),C&&(K.videoSegmentStream&&(K.videoSegmentStream.gopCache_=[]),C.timelineStartInfo.dts=void 0,C.timelineStartInfo.pts=void 0,ci.clearDtsInfo(C),K.captionStream.reset()),K.timestampRolloverStream&&K.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(O){I&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(O)},this.setRemux=function(O){var K=this.transmuxPipeline_;g.remux=O,K&&K.coalesceStream&&K.coalesceStream.setRemux(O)},this.alignGopsWith=function(O){C&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(O)},this.getLogTrigger_=function(O){var K=this;return function(Y){Y.stream=O,K.trigger("log",Y)}},this.push=function(O){if(x){var K=Vg(O);K&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!K&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),x=!1}this.transmuxPipeline_.headOfPipeline.push(O)},this.flush=function(){x=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},Oo.prototype=new No;var M={Transmuxer:Oo},R=function(g){return g>>>0},W=function(g){return("00"+g.toString(16)).slice(-2)},Q={toUnsigned:R,toHexString:W},se=function(g){var T="";return T+=String.fromCharCode(g[0]),T+=String.fromCharCode(g[1]),T+=String.fromCharCode(g[2]),T+=String.fromCharCode(g[3]),T},de=se,ye=Q.toUnsigned,ge=de,me=function(g,T){var x=[],C,I,O,K,Y;if(!T.length)return null;for(C=0;C<g.byteLength;)I=ye(g[C]<<24|g[C+1]<<16|g[C+2]<<8|g[C+3]),O=ge(g.subarray(C+4,C+8)),K=I>1?C+I:g.byteLength,O===T[0]&&(T.length===1?x.push(g.subarray(C+8,K)):(Y=me(g.subarray(C+8,K),T.slice(1)),Y.length&&(x=x.concat(Y)))),C=K;return x},Ze=me,Ye=Q.toUnsigned,kt=s.getUint64,Wr=function(g){var T={version:g[0],flags:new Uint8Array(g.subarray(1,4))};return T.version===1?T.baseMediaDecodeTime=kt(g.subarray(4)):T.baseMediaDecodeTime=Ye(g[4]<<24|g[5]<<16|g[6]<<8|g[7]),T},sn=Wr,qn=function(g){var T=new DataView(g.buffer,g.byteOffset,g.byteLength),x={version:g[0],flags:new Uint8Array(g.subarray(1,4)),trackId:T.getUint32(4)},C=x.flags[2]&1,I=x.flags[2]&2,O=x.flags[2]&8,K=x.flags[2]&16,Y=x.flags[2]&32,ee=x.flags[0]&65536,ne=x.flags[0]&131072,ce;return ce=8,C&&(ce+=4,x.baseDataOffset=T.getUint32(12),ce+=4),I&&(x.sampleDescriptionIndex=T.getUint32(ce),ce+=4),O&&(x.defaultSampleDuration=T.getUint32(ce),ce+=4),K&&(x.defaultSampleSize=T.getUint32(ce),ce+=4),Y&&(x.defaultSampleFlags=T.getUint32(ce)),ee&&(x.durationIsEmpty=!0),!C&&ne&&(x.baseDataOffsetIsMoof=!0),x},nc=qn,mt=function(g){return{isLeading:(g[0]&12)>>>2,dependsOn:g[0]&3,isDependedOn:(g[1]&192)>>>6,hasRedundancy:(g[1]&48)>>>4,paddingValue:(g[1]&14)>>>1,isNonSyncSample:g[1]&1,degradationPriority:g[2]<<8|g[3]}},fn=mt,Cr=fn,Hg=function(g){var T={version:g[0],flags:new Uint8Array(g.subarray(1,4)),samples:[]},x=new DataView(g.buffer,g.byteOffset,g.byteLength),C=T.flags[2]&1,I=T.flags[2]&4,O=T.flags[1]&1,K=T.flags[1]&2,Y=T.flags[1]&4,ee=T.flags[1]&8,ne=x.getUint32(4),ce=8,Ce;for(C&&(T.dataOffset=x.getInt32(ce),ce+=4),I&&ne&&(Ce={flags:Cr(g.subarray(ce,ce+4))},ce+=4,O&&(Ce.duration=x.getUint32(ce),ce+=4),K&&(Ce.size=x.getUint32(ce),ce+=4),ee&&(T.version===1?Ce.compositionTimeOffset=x.getInt32(ce):Ce.compositionTimeOffset=x.getUint32(ce),ce+=4),T.samples.push(Ce),ne--);ne--;)Ce={},O&&(Ce.duration=x.getUint32(ce),ce+=4),K&&(Ce.size=x.getUint32(ce),ce+=4),Y&&(Ce.flags=Cr(g.subarray(ce,ce+4)),ce+=4),ee&&(T.version===1?Ce.compositionTimeOffset=x.getInt32(ce):Ce.compositionTimeOffset=x.getUint32(ce),ce+=4),T.samples.push(Ce);return T},ic=Hg,rc={tfdt:sn,trun:ic},KC={parseTfdt:rc.tfdt,parseTrun:rc.trun},t$=function(g){for(var T=0,x=String.fromCharCode(g[T]),C="";x!=="\0";)C+=x,T++,x=String.fromCharCode(g[T]);return C+=x,C},n$={uint8ToCString:t$},lh=n$.uint8ToCString,i$=s.getUint64,r$=function(g){var T=4,x=g[0],C,I,O,K,Y,ee,ne,ce;if(x===0){C=lh(g.subarray(T)),T+=C.length,I=lh(g.subarray(T)),T+=I.length;var Ce=new DataView(g.buffer);O=Ce.getUint32(T),T+=4,Y=Ce.getUint32(T),T+=4,ee=Ce.getUint32(T),T+=4,ne=Ce.getUint32(T),T+=4}else if(x===1){var Ce=new DataView(g.buffer);O=Ce.getUint32(T),T+=4,K=i$(g.subarray(T)),T+=8,ee=Ce.getUint32(T),T+=4,ne=Ce.getUint32(T),T+=4,C=lh(g.subarray(T)),T+=C.length,I=lh(g.subarray(T)),T+=I.length}ce=new Uint8Array(g.subarray(T,g.byteLength));var Ge={scheme_id_uri:C,value:I,timescale:O||1,presentation_time:K,presentation_time_delta:Y,event_duration:ee,id:ne,message_data:ce};return a$(x,Ge)?Ge:void 0},s$=function(g,T,x,C){return g||g===0?g/T:C+x/T},a$=function(g,T){var x=T.scheme_id_uri!=="\0",C=g===0&&XC(T.presentation_time_delta)&&x,I=g===1&&XC(T.presentation_time)&&x;return!(g>1)&&C||I},XC=function(g){return g!==void 0||g!==null},o$={parseEmsgBox:r$,scaleTime:s$},sc;typeof window<"u"?sc=window:typeof i<"u"?sc=i:typeof self<"u"?sc=self:sc={};var YC=sc,ch=Q.toUnsigned,ac=Q.toHexString,pn=Ze,Mo=de,qg=o$,l$=nc,c$=ic,u$=sn,d$=s.getUint64,JC,QC,ZC,ex,tx,zg,nx,Gg=YC,h$=Hd.parseId3Frames;JC=function(g){var T={},x=pn(g,["moov","trak"]);return x.reduce(function(C,I){var O,K,Y,ee,ne;return O=pn(I,["tkhd"])[0],!O||(K=O[0],Y=K===0?12:20,ee=ch(O[Y]<<24|O[Y+1]<<16|O[Y+2]<<8|O[Y+3]),ne=pn(I,["mdia","mdhd"])[0],!ne)?null:(K=ne[0],Y=K===0?12:20,C[ee]=ch(ne[Y]<<24|ne[Y+1]<<16|ne[Y+2]<<8|ne[Y+3]),C)},T)},QC=function(g,T){var x;x=pn(T,["moof","traf"]);var C=x.reduce(function(I,O){var K=pn(O,["tfhd"])[0],Y=ch(K[4]<<24|K[5]<<16|K[6]<<8|K[7]),ee=g[Y]||9e4,ne=pn(O,["tfdt"])[0],ce=new DataView(ne.buffer,ne.byteOffset,ne.byteLength),Ce;ne[0]===1?Ce=d$(ne.subarray(4,12)):Ce=ce.getUint32(4);let Ge;return typeof Ce=="bigint"?Ge=Ce/Gg.BigInt(ee):typeof Ce=="number"&&!isNaN(Ce)&&(Ge=Ce/ee),Ge<Number.MAX_SAFE_INTEGER&&(Ge=Number(Ge)),Ge<I&&(I=Ge),I},1/0);return typeof C=="bigint"||isFinite(C)?C:0},ZC=function(g,T){var x=pn(T,["moof","traf"]),C=0,I=0,O;if(x&&x.length){var K=pn(x[0],["tfhd"])[0],Y=pn(x[0],["trun"])[0],ee=pn(x[0],["tfdt"])[0];if(K){var ne=l$(K);O=ne.trackId}if(ee){var ce=u$(ee);C=ce.baseMediaDecodeTime}if(Y){var Ce=c$(Y);Ce.samples&&Ce.samples.length&&(I=Ce.samples[0].compositionTimeOffset||0)}}var Ge=g[O]||9e4;typeof C=="bigint"&&(I=Gg.BigInt(I),Ge=Gg.BigInt(Ge));var Ae=(C+I)/Ge;return typeof Ae=="bigint"&&Ae<Number.MAX_SAFE_INTEGER&&(Ae=Number(Ae)),Ae},ex=function(g){var T=pn(g,["moov","trak"]),x=[];return T.forEach(function(C){var I=pn(C,["mdia","hdlr"]),O=pn(C,["tkhd"]);I.forEach(function(K,Y){var ee=Mo(K.subarray(8,12)),ne=O[Y],ce,Ce,Ge;ee==="vide"&&(ce=new DataView(ne.buffer,ne.byteOffset,ne.byteLength),Ce=ce.getUint8(0),Ge=Ce===0?ce.getUint32(12):ce.getUint32(20),x.push(Ge))})}),x},zg=function(g){var T=g[0],x=T===0?12:20;return ch(g[x]<<24|g[x+1]<<16|g[x+2]<<8|g[x+3])},tx=function(g){var T=pn(g,["moov","trak"]),x=[];return T.forEach(function(C){var I={},O=pn(C,["tkhd"])[0],K,Y;O&&(K=new DataView(O.buffer,O.byteOffset,O.byteLength),Y=K.getUint8(0),I.id=Y===0?K.getUint32(12):K.getUint32(20));var ee=pn(C,["mdia","hdlr"])[0];if(ee){var ne=Mo(ee.subarray(8,12));ne==="vide"?I.type="video":ne==="soun"?I.type="audio":I.type=ne}var ce=pn(C,["mdia","minf","stbl","stsd"])[0];if(ce){var Ce=ce.subarray(8);I.codec=Mo(Ce.subarray(4,8));var Ge=pn(Ce,[I.codec])[0],Ae,rt;Ge&&(/^[asm]vc[1-9]$/i.test(I.codec)?(Ae=Ge.subarray(78),rt=Mo(Ae.subarray(4,8)),rt==="avcC"&&Ae.length>11?(I.codec+=".",I.codec+=ac(Ae[9]),I.codec+=ac(Ae[10]),I.codec+=ac(Ae[11])):I.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(I.codec)?(Ae=Ge.subarray(28),rt=Mo(Ae.subarray(4,8)),rt==="esds"&&Ae.length>20&&Ae[19]!==0?(I.codec+="."+ac(Ae[19]),I.codec+="."+ac(Ae[20]>>>2&63).replace(/^0/,"")):I.codec="mp4a.40.2"):I.codec=I.codec.toLowerCase())}var yt=pn(C,["mdia","mdhd"])[0];yt&&(I.timescale=zg(yt)),x.push(I)}),x},nx=function(g,T=0){var x=pn(g,["emsg"]);return x.map(C=>{var I=qg.parseEmsgBox(new Uint8Array(C)),O=h$(I.message_data);return{cueTime:qg.scaleTime(I.presentation_time,I.timescale,I.presentation_time_delta,T),duration:qg.scaleTime(I.event_duration,I.timescale),frames:O}})};var oc={findBox:pn,parseType:Mo,timescale:JC,startTime:QC,compositionStartTime:ZC,videoTrackIds:ex,tracks:tx,getTimescaleFromMediaHeader:zg,getEmsgID3:nx};const{parseTrun:f$}=KC,{findBox:ix}=oc;var rx=YC,p$=function(g){var T=ix(g,["moof","traf"]),x=ix(g,["mdat"]),C=[];return x.forEach(function(I,O){var K=T[O];C.push({mdat:I,traf:K})}),C},m$=function(g,T,x){var C=T,I=x.defaultSampleDuration||0,O=x.defaultSampleSize||0,K=x.trackId,Y=[];return g.forEach(function(ee){var ne=f$(ee),ce=ne.samples;ce.forEach(function(Ce){Ce.duration===void 0&&(Ce.duration=I),Ce.size===void 0&&(Ce.size=O),Ce.trackId=K,Ce.dts=C,Ce.compositionTimeOffset===void 0&&(Ce.compositionTimeOffset=0),typeof C=="bigint"?(Ce.pts=C+rx.BigInt(Ce.compositionTimeOffset),C+=rx.BigInt(Ce.duration)):(Ce.pts=C+Ce.compositionTimeOffset,C+=Ce.duration)}),Y=Y.concat(ce)}),Y},sx={getMdatTrafPairs:p$,parseSamples:m$},g$=Mi.discardEmulationPreventionBytes,v$=Vd.CaptionStream,Wg=Ze,y$=sn,b$=nc,{getMdatTrafPairs:_$,parseSamples:k$}=sx,T$=function(g,T){for(var x=g,C=0;C<T.length;C++){var I=T[C];if(x<I.size)return I;x-=I.size}return null},S$=function(g,T,x){var C=new DataView(g.buffer,g.byteOffset,g.byteLength),I={logs:[],seiNals:[]},O,K,Y,ee;for(K=0;K+4<g.length;K+=Y)if(Y=C.getUint32(K),K+=4,!(Y<=0))switch(g[K]&31){case 6:var ne=g.subarray(K+1,K+1+Y),ce=T$(K,T);if(O={nalUnitType:"sei_rbsp",size:Y,data:ne,escapedRBSP:g$(ne),trackId:x},ce)O.pts=ce.pts,O.dts=ce.dts,ee=ce;else if(ee)O.pts=ee.pts,O.dts=ee.dts;else{I.logs.push({level:"warn",message:"We've encountered a nal unit without data at "+K+" for trackId "+x+". See mux.js#223."});break}I.seiNals.push(O);break}return I},C$=function(g,T){var x={},C=_$(g);return C.forEach(function(I){var O=I.mdat,K=I.traf,Y=Wg(K,["tfhd"]),ee=b$(Y[0]),ne=ee.trackId,ce=Wg(K,["tfdt"]),Ce=ce.length>0?y$(ce[0]).baseMediaDecodeTime:0,Ge=Wg(K,["trun"]),Ae,rt;T===ne&&Ge.length>0&&(Ae=k$(Ge,Ce,ee),rt=S$(O,Ae,ne),x[ne]||(x[ne]={seiNals:[],logs:[]}),x[ne].seiNals=x[ne].seiNals.concat(rt.seiNals),x[ne].logs=x[ne].logs.concat(rt.logs))}),x},x$=function(g,T,x){var C;if(T===null)return null;C=C$(g,T);var I=C[T]||{};return{seiNals:I.seiNals,logs:I.logs,timescale:x}},E$=function(){var g=!1,T,x,C,I,O,K;this.isInitialized=function(){return g},this.init=function(Y){T=new v$,g=!0,K=Y?Y.isPartial:!1,T.on("data",function(ee){ee.startTime=ee.startPts/I,ee.endTime=ee.endPts/I,O.captions.push(ee),O.captionStreams[ee.stream]=!0}),T.on("log",function(ee){O.logs.push(ee)})},this.isNewInit=function(Y,ee){return Y&&Y.length===0||ee&&typeof ee=="object"&&Object.keys(ee).length===0?!1:C!==Y[0]||I!==ee[C]},this.parse=function(Y,ee,ne){var ce;if(this.isInitialized()){if(!ee||!ne)return null;if(this.isNewInit(ee,ne))C=ee[0],I=ne[C];else if(C===null||!I)return x.push(Y),null}else return null;for(;x.length>0;){var Ce=x.shift();this.parse(Ce,ee,ne)}return ce=x$(Y,C,I),ce&&ce.logs&&(O.logs=O.logs.concat(ce.logs)),ce===null||!ce.seiNals?O.logs.length?{logs:O.logs,captions:[],captionStreams:[]}:null:(this.pushNals(ce.seiNals),this.flushStream(),O)},this.pushNals=function(Y){if(!this.isInitialized()||!Y||Y.length===0)return null;Y.forEach(function(ee){T.push(ee)})},this.flushStream=function(){if(!this.isInitialized())return null;K?T.partialFlush():T.flush()},this.clearParsedCaptions=function(){O.captions=[],O.captionStreams={},O.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;T.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){x=[],C=null,I=null,O?this.clearParsedCaptions():O={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},w$=E$;const{parseTfdt:D$}=KC,Ts=Ze,{getTimescaleFromMediaHeader:A$}=oc,{parseSamples:I$,getMdatTrafPairs:N$}=sx;var ax=function(){let g=9e4;this.init=function(T){const x=Ts(T,["moov","trak","mdia","mdhd"])[0];x&&(g=A$(x))},this.parseSegment=function(T){const x=[],C=N$(T);let I=0;return C.forEach(function(O){const K=O.mdat,Y=O.traf,ee=Ts(Y,["tfdt"])[0],ne=Ts(Y,["tfhd"])[0],ce=Ts(Y,["trun"]);if(ee&&(I=D$(ee).baseMediaDecodeTime),ce.length&&ne){const Ce=I$(ce,I,ne);let Ge=0;Ce.forEach(function(Ae){const rt="utf-8",yt=new TextDecoder(rt),xn=K.slice(Ge,Ge+Ae.size);if(Ts(xn,["vtte"])[0]){Ge+=Ae.size;return}Ts(xn,["vttc"]).forEach(function(lc){const cc=Ts(lc,["payl"])[0],uc=Ts(lc,["sttg"])[0],dc=Ae.pts/g,hh=(Ae.pts+Ae.duration)/g;let Kt,hc;if(cc)try{Kt=yt.decode(cc)}catch(Zi){console.error(Zi)}if(uc)try{hc=yt.decode(uc)}catch(Zi){console.error(Zi)}Ae.duration&&Kt&&x.push({cueText:Kt,start:dc,end:hh,settings:hc})}),Ge+=Ae.size})}}),x}},Kg=vo,ox=function(g){var T=g[1]&31;return T<<=8,T|=g[2],T},uh=function(g){return!!(g[1]&64)},dh=function(g){var T=0;return(g[3]&48)>>>4>1&&(T+=g[4]+1),T},P$=function(g,T){var x=ox(g);return x===0?"pat":x===T?"pmt":T?"pes":null},O$=function(g){var T=uh(g),x=4+dh(g);return T&&(x+=g[x]+1),(g[x+10]&31)<<8|g[x+11]},M$=function(g){var T={},x=uh(g),C=4+dh(g);if(x&&(C+=g[C]+1),!!(g[C+5]&1)){var I,O,K;I=(g[C+1]&15)<<8|g[C+2],O=3+I-4,K=(g[C+10]&15)<<8|g[C+11];for(var Y=12+K;Y<O;){var ee=C+Y;T[(g[ee+1]&31)<<8|g[ee+2]]=g[ee],Y+=((g[ee+3]&15)<<8|g[ee+4])+5}return T}},R$=function(g,T){var x=ox(g),C=T[x];switch(C){case Kg.H264_STREAM_TYPE:return"video";case Kg.ADTS_STREAM_TYPE:return"audio";case Kg.METADATA_STREAM_TYPE:return"timed-metadata";default:return null}},L$=function(g){var T=uh(g);if(!T)return null;var x=4+dh(g);if(x>=g.byteLength)return null;var C=null,I;return I=g[x+7],I&192&&(C={},C.pts=(g[x+9]&14)<<27|(g[x+10]&255)<<20|(g[x+11]&254)<<12|(g[x+12]&255)<<5|(g[x+13]&254)>>>3,C.pts*=4,C.pts+=(g[x+13]&6)>>>1,C.dts=C.pts,I&64&&(C.dts=(g[x+14]&14)<<27|(g[x+15]&255)<<20|(g[x+16]&254)<<12|(g[x+17]&255)<<5|(g[x+18]&254)>>>3,C.dts*=4,C.dts+=(g[x+18]&6)>>>1)),C},Xg=function(g){switch(g){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},B$=function(g){for(var T=4+dh(g),x=g.subarray(T),C=0,I=0,O=!1,K;I<x.byteLength-3;I++)if(x[I+2]===1){C=I+5;break}for(;C<x.byteLength;)switch(x[C]){case 0:if(x[C-1]!==0){C+=2;break}else if(x[C-2]!==0){C++;break}I+3!==C-2&&(K=Xg(x[I+3]&31),K==="slice_layer_without_partitioning_rbsp_idr"&&(O=!0));do C++;while(x[C]!==1&&C<x.length);I=C-2,C+=3;break;case 1:if(x[C-1]!==0||x[C-2]!==0){C+=3;break}K=Xg(x[I+3]&31),K==="slice_layer_without_partitioning_rbsp_idr"&&(O=!0),I=C-2,C+=3;break;default:C+=3;break}return x=x.subarray(I),C-=I,I=0,x&&x.byteLength>3&&(K=Xg(x[I+3]&31),K==="slice_layer_without_partitioning_rbsp_idr"&&(O=!0)),O},U$={parseType:P$,parsePat:O$,parsePmt:M$,parsePayloadUnitStartIndicator:uh,parsePesType:R$,parsePesTime:L$,videoPacketContainsKeyFrame:B$},lx=vo,Ro=Xl.handleRollover,Pt={};Pt.ts=U$,Pt.aac=ec;var ha=St.ONE_SECOND_IN_TS,Jn=188,xr=71,F$=function(g,T){for(var x=0,C=Jn,I,O;C<g.byteLength;){if(g[x]===xr&&g[C]===xr){switch(I=g.subarray(x,C),O=Pt.ts.parseType(I,T.pid),O){case"pat":T.pid=Pt.ts.parsePat(I);break;case"pmt":var K=Pt.ts.parsePmt(I);T.table=T.table||{},Object.keys(K).forEach(function(Y){T.table[Y]=K[Y]});break}x+=Jn,C+=Jn;continue}x++,C++}},cx=function(g,T,x){for(var C=0,I=Jn,O,K,Y,ee,ne,ce=!1;I<=g.byteLength;){if(g[C]===xr&&(g[I]===xr||I===g.byteLength)){switch(O=g.subarray(C,I),K=Pt.ts.parseType(O,T.pid),K){case"pes":Y=Pt.ts.parsePesType(O,T.table),ee=Pt.ts.parsePayloadUnitStartIndicator(O),Y==="audio"&&ee&&(ne=Pt.ts.parsePesTime(O),ne&&(ne.type="audio",x.audio.push(ne),ce=!0));break}if(ce)break;C+=Jn,I+=Jn;continue}C++,I++}for(I=g.byteLength,C=I-Jn,ce=!1;C>=0;){if(g[C]===xr&&(g[I]===xr||I===g.byteLength)){switch(O=g.subarray(C,I),K=Pt.ts.parseType(O,T.pid),K){case"pes":Y=Pt.ts.parsePesType(O,T.table),ee=Pt.ts.parsePayloadUnitStartIndicator(O),Y==="audio"&&ee&&(ne=Pt.ts.parsePesTime(O),ne&&(ne.type="audio",x.audio.push(ne),ce=!0));break}if(ce)break;C-=Jn,I-=Jn;continue}C--,I--}},V$=function(g,T,x){for(var C=0,I=Jn,O,K,Y,ee,ne,ce,Ce,Ge,Ae=!1,rt={data:[],size:0};I<g.byteLength;){if(g[C]===xr&&g[I]===xr){switch(O=g.subarray(C,I),K=Pt.ts.parseType(O,T.pid),K){case"pes":if(Y=Pt.ts.parsePesType(O,T.table),ee=Pt.ts.parsePayloadUnitStartIndicator(O),Y==="video"&&(ee&&!Ae&&(ne=Pt.ts.parsePesTime(O),ne&&(ne.type="video",x.video.push(ne),Ae=!0)),!x.firstKeyFrame)){if(ee&&rt.size!==0){for(ce=new Uint8Array(rt.size),Ce=0;rt.data.length;)Ge=rt.data.shift(),ce.set(Ge,Ce),Ce+=Ge.byteLength;if(Pt.ts.videoPacketContainsKeyFrame(ce)){var yt=Pt.ts.parsePesTime(ce);yt?(x.firstKeyFrame=yt,x.firstKeyFrame.type="video"):console.warn("Failed to extract PTS/DTS from PES at first keyframe. This could be an unusual TS segment, or else mux.js did not parse your TS segment correctly. If you know your TS segments do contain PTS/DTS on keyframes please file a bug report! You can try ffprobe to double check for yourself.")}rt.size=0}rt.data.push(O),rt.size+=O.byteLength}break}if(Ae&&x.firstKeyFrame)break;C+=Jn,I+=Jn;continue}C++,I++}for(I=g.byteLength,C=I-Jn,Ae=!1;C>=0;){if(g[C]===xr&&g[I]===xr){switch(O=g.subarray(C,I),K=Pt.ts.parseType(O,T.pid),K){case"pes":Y=Pt.ts.parsePesType(O,T.table),ee=Pt.ts.parsePayloadUnitStartIndicator(O),Y==="video"&&ee&&(ne=Pt.ts.parsePesTime(O),ne&&(ne.type="video",x.video.push(ne),Ae=!0));break}if(Ae)break;C-=Jn,I-=Jn;continue}C--,I--}},j$=function(g,T){if(g.audio&&g.audio.length){var x=T;(typeof x>"u"||isNaN(x))&&(x=g.audio[0].dts),g.audio.forEach(function(O){O.dts=Ro(O.dts,x),O.pts=Ro(O.pts,x),O.dtsTime=O.dts/ha,O.ptsTime=O.pts/ha})}if(g.video&&g.video.length){var C=T;if((typeof C>"u"||isNaN(C))&&(C=g.video[0].dts),g.video.forEach(function(O){O.dts=Ro(O.dts,C),O.pts=Ro(O.pts,C),O.dtsTime=O.dts/ha,O.ptsTime=O.pts/ha}),g.firstKeyFrame){var I=g.firstKeyFrame;I.dts=Ro(I.dts,C),I.pts=Ro(I.pts,C),I.dtsTime=I.dts/ha,I.ptsTime=I.pts/ha}}},$$=function(g){for(var T=!1,x=0,C=null,I=null,O=0,K=0,Y;g.length-K>=3;){var ee=Pt.aac.parseType(g,K);switch(ee){case"timed-metadata":if(g.length-K<10){T=!0;break}if(O=Pt.aac.parseId3TagSize(g,K),O>g.length){T=!0;break}I===null&&(Y=g.subarray(K,K+O),I=Pt.aac.parseAacTimestamp(Y)),K+=O;break;case"audio":if(g.length-K<7){T=!0;break}if(O=Pt.aac.parseAdtsSize(g,K),O>g.length){T=!0;break}C===null&&(Y=g.subarray(K,K+O),C=Pt.aac.parseSampleRate(Y)),x++,K+=O;break;default:K++;break}if(T)return null}if(C===null||I===null)return null;var ne=ha/C,ce={audio:[{type:"audio",dts:I,pts:I},{type:"audio",dts:I+x*1024*ne,pts:I+x*1024*ne}]};return ce},H$=function(g){var T={pid:null,table:null},x={};F$(g,T);for(var C in T.table)if(T.table.hasOwnProperty(C)){var I=T.table[C];switch(I){case lx.H264_STREAM_TYPE:x.video=[],V$(g,T,x),x.video.length===0&&delete x.video;break;case lx.ADTS_STREAM_TYPE:x.audio=[],cx(g,T,x),x.audio.length===0&&delete x.audio;break}}return x},q$=function(g,T){var x=Pt.aac.isLikelyAacData(g),C;return x?C=$$(g):C=H$(g),!C||!C.audio&&!C.video?null:(j$(C,T),C)},z$={inspect:q$,parseAudioPes_:cx};const G$=function(g,T){T.on("data",function(x){const C=x.initSegment;x.initSegment={data:C.buffer,byteOffset:C.byteOffset,byteLength:C.byteLength};const I=x.data;x.data=I.buffer,g.postMessage({action:"data",segment:x,byteOffset:I.byteOffset,byteLength:I.byteLength},[x.data])}),T.on("done",function(x){g.postMessage({action:"done"})}),T.on("gopInfo",function(x){g.postMessage({action:"gopInfo",gopInfo:x})}),T.on("videoSegmentTimingInfo",function(x){const C={start:{decode:St.videoTsToSeconds(x.start.dts),presentation:St.videoTsToSeconds(x.start.pts)},end:{decode:St.videoTsToSeconds(x.end.dts),presentation:St.videoTsToSeconds(x.end.pts)},baseMediaDecodeTime:St.videoTsToSeconds(x.baseMediaDecodeTime)};x.prependedContentDuration&&(C.prependedContentDuration=St.videoTsToSeconds(x.prependedContentDuration)),g.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:C})}),T.on("audioSegmentTimingInfo",function(x){const C={start:{decode:St.videoTsToSeconds(x.start.dts),presentation:St.videoTsToSeconds(x.start.pts)},end:{decode:St.videoTsToSeconds(x.end.dts),presentation:St.videoTsToSeconds(x.end.pts)},baseMediaDecodeTime:St.videoTsToSeconds(x.baseMediaDecodeTime)};x.prependedContentDuration&&(C.prependedContentDuration=St.videoTsToSeconds(x.prependedContentDuration)),g.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:C})}),T.on("id3Frame",function(x){g.postMessage({action:"id3Frame",id3Frame:x})}),T.on("caption",function(x){g.postMessage({action:"caption",caption:x})}),T.on("trackinfo",function(x){g.postMessage({action:"trackinfo",trackInfo:x})}),T.on("audioTimingInfo",function(x){g.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:St.videoTsToSeconds(x.start),end:St.videoTsToSeconds(x.end)}})}),T.on("videoTimingInfo",function(x){g.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:St.videoTsToSeconds(x.start),end:St.videoTsToSeconds(x.end)}})}),T.on("log",function(x){g.postMessage({action:"log",log:x})})};class ux{constructor(T,x){this.options=x||{},this.self=T,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new M.Transmuxer(this.options),G$(this.self,this.transmuxer)}pushMp4Captions(T){this.captionParser||(this.captionParser=new w$,this.captionParser.init());const x=new Uint8Array(T.data,T.byteOffset,T.byteLength),C=this.captionParser.parse(x,T.trackIds,T.timescales);this.self.postMessage({action:"mp4Captions",captions:C&&C.captions||[],logs:C&&C.logs||[],data:x.buffer},[x.buffer])}initMp4WebVttParser(T){this.webVttParser||(this.webVttParser=new ax);const x=new Uint8Array(T.data,T.byteOffset,T.byteLength);this.webVttParser.init(x)}getMp4WebVttText(T){this.webVttParser||(this.webVttParser=new ax);const x=new Uint8Array(T.data,T.byteOffset,T.byteLength),C=this.webVttParser.parseSegment(x);this.self.postMessage({action:"getMp4WebVttText",mp4VttCues:C||[],data:x.buffer},[x.buffer])}probeMp4StartTime({timescales:T,data:x}){const C=oc.startTime(T,x);this.self.postMessage({action:"probeMp4StartTime",startTime:C,data:x},[x.buffer])}probeMp4Tracks({data:T}){const x=oc.tracks(T);this.self.postMessage({action:"probeMp4Tracks",tracks:x,data:T},[T.buffer])}probeEmsgID3({data:T,offset:x}){const C=oc.getEmsgID3(T,x);this.self.postMessage({action:"probeEmsgID3",id3Frames:C,emsgData:T},[T.buffer])}probeTs({data:T,baseStartTime:x}){const C=typeof x=="number"&&!isNaN(x)?x*St.ONE_SECOND_IN_TS:void 0,I=z$.inspect(T,C);let O=null;I&&(O={hasVideo:I.video&&I.video.length===2||!1,hasAudio:I.audio&&I.audio.length===2||!1},O.hasVideo&&(O.videoStart=I.video[0].ptsTime),O.hasAudio&&(O.audioStart=I.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:O,data:T},[T.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(T){const x=new Uint8Array(T.data,T.byteOffset,T.byteLength);this.transmuxer.push(x)}reset(){this.transmuxer.reset()}setTimestampOffset(T){const x=T.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(St.secondsToVideoTs(x)))}setAudioAppendStart(T){this.transmuxer.setAudioAppendStart(Math.ceil(St.secondsToVideoTs(T.appendStart)))}setRemux(T){this.transmuxer.setRemux(T.remux)}flush(T){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(T){this.transmuxer.alignGopsWith(T.gopsToAlignWith.slice())}}self.onmessage=function(g){if(g.data.action==="init"&&g.data.options){this.messageHandlers=new ux(self,g.data.options);return}this.messageHandlers||(this.messageHandlers=new ux(self)),g.data&&g.data.action&&g.data.action!=="init"&&this.messageHandlers[g.data.action]&&this.messageHandlers[g.data.action](g.data)}}));var QI=B2(JI);const ZI=(i,e,t)=>{const{type:n,initSegment:r,captions:s,captionStreams:a,metadata:o,videoFrameDtsTime:c,videoFramePtsTime:u}=i.data.segment;e.buffer.push({captions:s,captionStreams:a,metadata:o});const d=i.data.segment.boxes||{data:i.data.segment.data},h={type:n,data:new Uint8Array(d.data,d.data.byteOffset,d.data.byteLength),initSegment:new Uint8Array(r.data,r.byteOffset,r.byteLength)};typeof c<"u"&&(h.videoFrameDtsTime=c),typeof u<"u"&&(h.videoFramePtsTime=u),t(h)},eN=({transmuxedData:i,callback:e})=>{i.buffer=[],e(i)},tN=(i,e)=>{e.gopInfo=i.data.gopInfo},V2=i=>{const{transmuxer:e,bytes:t,audioAppendStart:n,gopsToAlignWith:r,remux:s,onData:a,onTrackInfo:o,onAudioTimingInfo:c,onVideoTimingInfo:u,onVideoSegmentTimingInfo:d,onAudioSegmentTimingInfo:h,onId3:b,onCaptions:v,onDone:y,onEndedTimeline:p,onTransmuxerLog:f,isEndOfTimeline:m,segment:_,triggerSegmentEventFn:k}=i,D={buffer:[]};let E=m;const A=N=>{e.currentTransmux===i&&(N.data.action==="data"&&ZI(N,D,a),N.data.action==="trackinfo"&&o(N.data.trackInfo),N.data.action==="gopInfo"&&tN(N,D),N.data.action==="audioTimingInfo"&&c(N.data.audioTimingInfo),N.data.action==="videoTimingInfo"&&u(N.data.videoTimingInfo),N.data.action==="videoSegmentTimingInfo"&&d(N.data.videoSegmentTimingInfo),N.data.action==="audioSegmentTimingInfo"&&h(N.data.audioSegmentTimingInfo),N.data.action==="id3Frame"&&b([N.data.id3Frame],N.data.id3Frame.dispatchType),N.data.action==="caption"&&v(N.data.caption),N.data.action==="endedtimeline"&&(E=!1,p()),N.data.action==="log"&&f(N.data.log),N.data.type==="transmuxed"&&(E||(e.onmessage=null,eN({transmuxedData:D,callback:y}),j2(e))))},w=()=>{const N={message:"Received an error message from the transmuxer worker",metadata:{errorType:fe.Error.StreamingFailedToTransmuxSegment,segmentInfo:zs({segment:_})}};y(null,N)};if(e.onmessage=A,e.onerror=w,n&&e.postMessage({action:"setAudioAppendStart",appendStart:n}),Array.isArray(r)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),typeof s<"u"&&e.postMessage({action:"setRemux",remux:s}),t.byteLength){const N=t instanceof ArrayBuffer?t:t.buffer,S=t instanceof ArrayBuffer?0:t.byteOffset;k({type:"segmenttransmuxingstart",segment:_}),e.postMessage({action:"push",data:N,byteOffset:S,byteLength:t.byteLength},[N])}m&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},j2=i=>{i.currentTransmux=null,i.transmuxQueue.length&&(i.currentTransmux=i.transmuxQueue.shift(),typeof i.currentTransmux=="function"?i.currentTransmux():V2(i.currentTransmux))},$2=(i,e)=>{i.postMessage({action:e}),j2(i)},H2=(i,e)=>{if(!e.currentTransmux){e.currentTransmux=i,$2(e,i);return}e.transmuxQueue.push($2.bind(null,e,i))},nN=i=>{H2("reset",i)},iN=i=>{H2("endTimeline",i)},q2=i=>{if(!i.transmuxer.currentTransmux){i.transmuxer.currentTransmux=i,V2(i);return}i.transmuxer.transmuxQueue.push(i)};var jp={reset:nN,endTimeline:iN,transmux:q2,createTransmuxer:i=>{const e=new QI;e.currentTransmux=null,e.transmuxQueue=[];const t=e.terminate;return e.terminate=()=>(e.currentTransmux=null,e.transmuxQueue.length=0,t.call(e)),e.postMessage({action:"init",options:i}),e}};const Wa=function(i){const e=i.transmuxer,t=i.endAction||i.action,n=i.callback,r=un({},i,{endAction:null,transmuxer:null,callback:null}),s=a=>{a.data.action===t&&(e.removeEventListener("message",s),a.data.data&&(a.data.data=new Uint8Array(a.data.data,i.byteOffset||0,i.byteLength||a.data.data.byteLength),i.data&&(i.data=a.data.data)),n(a.data))};if(e.addEventListener("message",s),i.data){const a=i.data instanceof ArrayBuffer;r.byteOffset=a?0:i.data.byteOffset,r.byteLength=i.data.byteLength;const o=[a?i.data:i.data.buffer];e.postMessage(r,o)}else e.postMessage(r)},dr={FAILURE:2,TIMEOUT:-101,ABORTED:-102},z2="wvtt",$p=i=>{i.forEach(e=>{e.abort()})},rN=i=>({bandwidth:i.bandwidth,bytesReceived:i.bytesReceived||0,roundTripTime:i.roundTripTime||0}),sN=i=>{const e=i.target,n={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return n.bytesReceived=i.loaded,n.bandwidth=Math.floor(n.bytesReceived/n.roundTripTime*8*1e3),n},Hp=(i,e)=>{const{requestType:t}=e,n=qs({requestType:t,request:e,error:i});return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:dr.TIMEOUT,xhr:e,metadata:n}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:dr.ABORTED,xhr:e,metadata:n}:i?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:dr.FAILURE,xhr:e,metadata:n}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:dr.FAILURE,xhr:e,metadata:n}:null},G2=(i,e,t,n)=>(r,s)=>{const a=s.response,o=Hp(r,s);if(o)return t(o,i);if(a.byteLength!==16)return t({status:s.status,message:"Invalid HLS key at URL: "+s.uri,code:dr.FAILURE,xhr:s},i);const c=new DataView(a),u=new Uint32Array([c.getUint32(0),c.getUint32(4),c.getUint32(8),c.getUint32(12)]);for(let h=0;h<e.length;h++)e[h].bytes=u;const d={uri:s.uri};return n({type:"segmentkeyloadcomplete",segment:i,keyInfo:d}),t(null,i)},aN=(i,e)=>{e===z2&&i.transmuxer.postMessage({action:"initMp4WebVttParser",data:i.map.bytes})},oN=(i,e,t)=>{e===z2&&Wa({action:"getMp4WebVttText",data:i.bytes,transmuxer:i.transmuxer,callback:({data:n,mp4VttCues:r})=>{i.bytes=n,t(null,i,{mp4VttCues:r})}})},W2=(i,e)=>{const t=Nf(i.map.bytes);if(t!=="mp4"){const n=i.map.resolvedUri||i.map.uri,r=t||"unknown";return e({internal:!0,message:`Found unsupported ${r} container for initialization segment at URL: ${n}`,code:dr.FAILURE,metadata:{mediaType:r}})}Wa({action:"probeMp4Tracks",data:i.map.bytes,transmuxer:i.transmuxer,callback:({tracks:n,data:r})=>(i.map.bytes=r,n.forEach(function(s){i.map.tracks=i.map.tracks||{},!i.map.tracks[s.type]&&(i.map.tracks[s.type]=s,typeof s.id=="number"&&s.timescale&&(i.map.timescales=i.map.timescales||{},i.map.timescales[s.id]=s.timescale),s.type==="text"&&aN(i,s.codec))}),e(null))})},lN=({segment:i,finishProcessingFn:e,triggerSegmentEventFn:t})=>(n,r)=>{const s=Hp(n,r);if(s)return e(s,i);const a=new Uint8Array(r.response);if(t({type:"segmentloaded",segment:i}),i.map.key)return i.map.encryptedBytes=a,e(null,i);i.map.bytes=a,W2(i,function(o){if(o)return o.xhr=r,o.status=r.status,e(o,i);e(null,i)})},cN=({segment:i,finishProcessingFn:e,responseType:t,triggerSegmentEventFn:n})=>(r,s)=>{const a=Hp(r,s);if(a)return e(a,i);n({type:"segmentloaded",segment:i});const o=t==="arraybuffer"||!s.responseText?s.response:XI(s.responseText.substring(i.lastReachedChar||0));return i.stats=rN(s),i.key?i.encryptedBytes=new Uint8Array(o):i.bytes=new Uint8Array(o),e(null,i)},uN=({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:c,endedTimelineFn:u,dataFn:d,doneFn:h,onTransmuxerLog:b,triggerSegmentEventFn:v})=>{const y=i.map&&i.map.tracks||{},p=!!(y.audio&&y.video);let f=n.bind(null,i,"audio","start");const m=n.bind(null,i,"audio","end");let _=n.bind(null,i,"video","start");const k=n.bind(null,i,"video","end"),D=()=>q2({bytes:e,transmuxer:i.transmuxer,audioAppendStart:i.audioAppendStart,gopsToAlignWith:i.gopsToAlignWith,remux:p,onData:E=>{E.type=E.type==="combined"?"video":E.type,d(i,E)},onTrackInfo:E=>{t&&(p&&(E.isMuxed=!0),t(i,E))},onAudioTimingInfo:E=>{f&&typeof E.start<"u"&&(f(E.start),f=null),m&&typeof E.end<"u"&&m(E.end)},onVideoTimingInfo:E=>{_&&typeof E.start<"u"&&(_(E.start),_=null),k&&typeof E.end<"u"&&k(E.end)},onVideoSegmentTimingInfo:E=>{const A={pts:{start:E.start.presentation,end:E.end.presentation},dts:{start:E.start.decode,end:E.end.decode}};v({type:"segmenttransmuxingtiminginfoavailable",segment:i,timingInfo:A}),r(E)},onAudioSegmentTimingInfo:E=>{const A={pts:{start:E.start.pts,end:E.end.pts},dts:{start:E.start.dts,end:E.end.dts}};v({type:"segmenttransmuxingtiminginfoavailable",segment:i,timingInfo:A}),s(E)},onId3:(E,A)=>{a(i,E,A)},onCaptions:E=>{o(i,[E])},isEndOfTimeline:c,onEndedTimeline:()=>{u()},onTransmuxerLog:b,onDone:(E,A)=>{h&&(E.type=E.type==="combined"?"video":E.type,v({type:"segmenttransmuxingcomplete",segment:i}),h(A,i,E))},segment:i,triggerSegmentEventFn:v});Wa({action:"probeTs",transmuxer:i.transmuxer,data:e,baseStartTime:i.baseStartTime,callback:E=>{i.bytes=e=E.data;const A=E.result;A&&(t(i,{hasAudio:A.hasAudio,hasVideo:A.hasVideo,isMuxed:p}),t=null),D()}})},K2=({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:c,endedTimelineFn:u,dataFn:d,doneFn:h,onTransmuxerLog:b,triggerSegmentEventFn:v})=>{let y=new Uint8Array(e);if(BD(y)){i.isFmp4=!0;const{tracks:p}=i.map;if(p.text&&(!p.audio||!p.video)){d(i,{data:y,type:"text"}),oN(i,p.text.codec,h);return}const m={isFmp4:!0,hasVideo:!!p.video,hasAudio:!!p.audio};p.audio&&p.audio.codec&&p.audio.codec!=="enca"&&(m.audioCodec=p.audio.codec),p.video&&p.video.codec&&p.video.codec!=="encv"&&(m.videoCodec=p.video.codec),p.video&&p.audio&&(m.isMuxed=!0),t(i,m);const _=(k,D)=>{d(i,{data:y,type:m.hasAudio&&!m.isMuxed?"audio":"video"}),D&&D.length&&a(i,D),k&&k.length&&o(i,k),h(null,i,{})};Wa({action:"probeMp4StartTime",timescales:i.map.timescales,data:y,transmuxer:i.transmuxer,callback:({data:k,startTime:D})=>{e=k.buffer,i.bytes=y=k,m.hasAudio&&!m.isMuxed&&n(i,"audio","start",D),m.hasVideo&&n(i,"video","start",D),Wa({action:"probeEmsgID3",data:y,transmuxer:i.transmuxer,offset:D,callback:({emsgData:E,id3Frames:A})=>{if(e=E.buffer,i.bytes=y=E,!p.video||!E.byteLength||!i.transmuxer){_(void 0,A);return}Wa({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:i.transmuxer,data:y,timescales:i.map.timescales,trackIds:[p.video.id],callback:w=>{e=w.data.buffer,i.bytes=y=w.data,w.logs.forEach(function(N){b(Dt(N,{stream:"mp4CaptionParser"}))}),_(w.captions,A)}})}})}});return}if(!i.transmuxer){h(null,i,{});return}if(typeof i.container>"u"&&(i.container=Nf(y)),i.container!=="ts"&&i.container!=="aac"){t(i,{hasAudio:!1,hasVideo:!1}),h(null,i,{});return}uN({segment:i,bytes:e,trackInfoFn:t,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:c,endedTimelineFn:u,dataFn:d,doneFn:h,onTransmuxerLog:b,triggerSegmentEventFn:v})},X2=function({id:i,key:e,encryptedBytes:t,decryptionWorker:n,segment:r,doneFn:s},a){const o=u=>{if(u.data.source===i){n.removeEventListener("message",o);const d=u.data.decrypted;a(new Uint8Array(d.bytes,d.byteOffset,d.byteLength))}};n.onerror=()=>{const u="An error occurred in the decryption worker",d=zs({segment:r}),h={message:u,metadata:{error:new Error(u),errorType:fe.Error.StreamingFailedToDecryptSegment,segmentInfo:d,keyInfo:{uri:r.key.resolvedUri||r.map.key.resolvedUri}}};s(h,r)},n.addEventListener("message",o);let c;e.bytes.slice?c=e.bytes.slice():c=new Uint32Array(Array.prototype.slice.call(e.bytes)),n.postMessage(A2({source:i,encrypted:t,key:c,iv:e.iv}),[t.buffer,c.buffer])},dN=({decryptionWorker:i,segment:e,trackInfoFn:t,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:c,endedTimelineFn:u,dataFn:d,doneFn:h,onTransmuxerLog:b,triggerSegmentEventFn:v})=>{v({type:"segmentdecryptionstart"}),X2({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:i,segment:e,doneFn:h},y=>{e.bytes=y,v({type:"segmentdecryptioncomplete",segment:e}),K2({segment:e,bytes:e.bytes,trackInfoFn:t,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:c,endedTimelineFn:u,dataFn:d,doneFn:h,onTransmuxerLog:b,triggerSegmentEventFn:v})})},hN=({activeXhrs:i,decryptionWorker:e,trackInfoFn:t,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:c,endedTimelineFn:u,dataFn:d,doneFn:h,onTransmuxerLog:b,triggerSegmentEventFn:v})=>{let y=0,p=!1;return(f,m)=>{if(!p){if(f)return p=!0,$p(i),h(f,m);if(y+=1,y===i.length){const _=function(){if(m.encryptedBytes)return dN({decryptionWorker:e,segment:m,trackInfoFn:t,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:c,endedTimelineFn:u,dataFn:d,doneFn:h,onTransmuxerLog:b,triggerSegmentEventFn:v});K2({segment:m,bytes:m.bytes,trackInfoFn:t,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:c,endedTimelineFn:u,dataFn:d,doneFn:h,onTransmuxerLog:b,triggerSegmentEventFn:v})};if(m.endOfAllRequests=Date.now(),m.map&&m.map.encryptedBytes&&!m.map.bytes)return v({type:"segmentdecryptionstart",segment:m}),X2({decryptionWorker:e,id:m.requestId+"-init",encryptedBytes:m.map.encryptedBytes,key:m.map.key,segment:m,doneFn:h},k=>{m.map.bytes=k,v({type:"segmentdecryptioncomplete",segment:m}),W2(m,D=>{if(D)return $p(i),h(D,m);_()})});_()}}}},fN=({loadendState:i,abortFn:e})=>t=>{t.target.aborted&&e&&!i.calledAbortFn&&(e(),i.calledAbortFn=!0)},pN=({segment:i,progressFn:e,trackInfoFn:t,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:a,captionsFn:o,isEndOfTimeline:c,endedTimelineFn:u,dataFn:d})=>h=>{if(!h.target.aborted)return i.stats=Dt(i.stats,sN(h)),!i.stats.firstBytesReceivedAt&&i.stats.bytesReceived&&(i.stats.firstBytesReceivedAt=Date.now()),e(h,i)},mN=({xhr:i,xhrOptions:e,decryptionWorker:t,segment:n,abortFn:r,progressFn:s,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:u,id3Fn:d,captionsFn:h,isEndOfTimeline:b,endedTimelineFn:v,dataFn:y,doneFn:p,onTransmuxerLog:f,triggerSegmentEventFn:m})=>{const _=[],k=hN({activeXhrs:_,decryptionWorker:t,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:u,id3Fn:d,captionsFn:h,isEndOfTimeline:b,endedTimelineFn:v,dataFn:y,doneFn:p,onTransmuxerLog:f,triggerSegmentEventFn:m});if(n.key&&!n.key.bytes){const N=[n.key];n.map&&!n.map.bytes&&n.map.key&&n.map.key.resolvedUri===n.key.resolvedUri&&N.push(n.map.key);const S=Dt(e,{uri:n.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),P=G2(n,N,k,m),F={uri:n.key.resolvedUri};m({type:"segmentkeyloadstart",segment:n,keyInfo:F});const V=i(S,P);_.push(V)}if(n.map&&!n.map.bytes){if(n.map.key&&(!n.key||n.key.resolvedUri!==n.map.key.resolvedUri)){const V=Dt(e,{uri:n.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),J=G2(n,[n.map.key],k,m),ie={uri:n.map.key.resolvedUri};m({type:"segmentkeyloadstart",segment:n,keyInfo:ie});const X=i(V,J);_.push(X)}const S=Dt(e,{uri:n.map.resolvedUri,responseType:"arraybuffer",headers:Up(n.map),requestType:"segment-media-initialization"}),P=lN({segment:n,finishProcessingFn:k,triggerSegmentEventFn:m});m({type:"segmentloadstart",segment:n});const F=i(S,P);_.push(F)}const D=Dt(e,{uri:n.part&&n.part.resolvedUri||n.resolvedUri,responseType:"arraybuffer",headers:Up(n),requestType:"segment"}),E=cN({segment:n,finishProcessingFn:k,responseType:D.responseType,triggerSegmentEventFn:m});m({type:"segmentloadstart",segment:n});const A=i(D,E);A.addEventListener("progress",pN({segment:n,progressFn:s,trackInfoFn:a,timingInfoFn:o,videoSegmentTimingInfoFn:c,audioSegmentTimingInfoFn:u,id3Fn:d,captionsFn:h,isEndOfTimeline:b,endedTimelineFn:v,dataFn:y})),_.push(A);const w={};return _.forEach(N=>{N.addEventListener("loadend",fN({loadendState:w,abortFn:r}))}),()=>$p(_)},$u=Ai("PlaylistSelector"),Y2=function(i){if(!i||!i.playlist)return;const e=i.playlist;return JSON.stringify({id:e.id,bandwidth:i.bandwidth,width:i.width,height:i.height,codecs:e.attributes&&e.attributes.CODECS||""})},Ka=function(i,e){if(!i)return"";const t=te.getComputedStyle(i);return t?t[e]:""},Xa=function(i,e){const t=i.slice();i.sort(function(n,r){const s=e(n,r);return s===0?t.indexOf(n)-t.indexOf(r):s})},qp=function(i,e){let t,n;return i.attributes.BANDWIDTH&&(t=i.attributes.BANDWIDTH),t=t||te.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(n=e.attributes.BANDWIDTH),n=n||te.Number.MAX_VALUE,t-n},gN=function(i,e){let t,n;return i.attributes.RESOLUTION&&i.attributes.RESOLUTION.width&&(t=i.attributes.RESOLUTION.width),t=t||te.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(n=e.attributes.RESOLUTION.width),n=n||te.Number.MAX_VALUE,t===n&&i.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?i.attributes.BANDWIDTH-e.attributes.BANDWIDTH:t-n};let J2=function(i){const{main:e,bandwidth:t,playerWidth:n,playerHeight:r,playerObjectFit:s,limitRenditionByPlayerDimensions:a,playlistController:o}=i;if(!e)return;const c={bandwidth:t,width:n,height:r,limitRenditionByPlayerDimensions:a};let u=e.playlists;ii.isAudioOnly(e)&&(u=o.getAudioTrackPlaylists_(),c.audioOnly=!0);let d=u.map(w=>{let N;const S=w.attributes&&w.attributes.RESOLUTION&&w.attributes.RESOLUTION.width,P=w.attributes&&w.attributes.RESOLUTION&&w.attributes.RESOLUTION.height;return N=w.attributes&&w.attributes.BANDWIDTH,N=N||te.Number.MAX_VALUE,{bandwidth:N,width:S,height:P,playlist:w}});Xa(d,(w,N)=>w.bandwidth-N.bandwidth),d=d.filter(w=>!ii.isIncompatible(w.playlist));let h=d.filter(w=>ii.isEnabled(w.playlist));h.length||(h=d.filter(w=>!ii.isDisabled(w.playlist)));const b=h.filter(w=>w.bandwidth*Tn.BANDWIDTH_VARIANCE<t);let v=b[b.length-1];const y=b.filter(w=>w.bandwidth===v.bandwidth)[0];if(a===!1){const w=y||h[0]||d[0];if(w&&w.playlist){let N="sortedPlaylistReps";return y&&(N="bandwidthBestRep"),h[0]&&(N="enabledPlaylistReps"),$u(`choosing ${Y2(w)} using ${N} with options`,c),w.playlist}return $u("could not choose a playlist with options",c),null}const p=b.filter(w=>w.width&&w.height);Xa(p,(w,N)=>w.width-N.width);const f=p.filter(w=>w.width===n&&w.height===r);v=f[f.length-1];const m=f.filter(w=>w.bandwidth===v.bandwidth)[0];let _,k,D;m||(_=p.filter(w=>s==="cover"?w.width>n&&w.height>r:w.width>n||w.height>r),k=_.filter(w=>w.width===_[0].width&&w.height===_[0].height),v=k[k.length-1],D=k.filter(w=>w.bandwidth===v.bandwidth)[0]);let E;if(o.leastPixelDiffSelector){const w=p.map(N=>(N.pixelDiff=Math.abs(N.width-n)+Math.abs(N.height-r),N));Xa(w,(N,S)=>N.pixelDiff===S.pixelDiff?S.bandwidth-N.bandwidth:N.pixelDiff-S.pixelDiff),E=w[0]}const A=E||D||m||y||h[0]||d[0];if(A&&A.playlist){let w="sortedPlaylistReps";return E?w="leastPixelDiffRep":D?w="resolutionPlusOneRep":m?w="resolutionBestRep":y?w="bandwidthBestRep":h[0]&&(w="enabledPlaylistReps"),$u(`choosing ${Y2(A)} using ${w} with options`,c),A.playlist}return $u("could not choose a playlist with options",c),null};const Q2=function(){let i=this.useDevicePixelRatio&&te.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(i=this.customPixelRatio),J2({main:this.playlists.main,bandwidth:this.systemBandwidth,playerWidth:parseInt(Ka(this.tech_.el(),"width"),10)*i,playerHeight:parseInt(Ka(this.tech_.el(),"height"),10)*i,playerObjectFit:this.usePlayerObjectFit?Ka(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})},vN=function(i){let e=-1,t=-1;if(i<0||i>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let n=this.useDevicePixelRatio&&te.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(n=this.customPixelRatio),e<0&&(e=this.systemBandwidth,t=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==t&&(e=i*this.systemBandwidth+(1-i)*e,t=this.systemBandwidth),J2({main:this.playlists.main,bandwidth:e,playerWidth:parseInt(Ka(this.tech_.el(),"width"),10)*n,playerHeight:parseInt(Ka(this.tech_.el(),"height"),10)*n,playerObjectFit:this.usePlayerObjectFit?Ka(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})}},yN=function(i){const{main:e,currentTime:t,bandwidth:n,duration:r,segmentDuration:s,timeUntilRebuffer:a,currentTimeline:o,syncController:c}=i,u=e.playlists.filter(y=>!ii.isIncompatible(y));let d=u.filter(ii.isEnabled);d.length||(d=u.filter(y=>!ii.isDisabled(y)));const b=d.filter(ii.hasAttribute.bind(null,"BANDWIDTH")).map(y=>{const f=c.getSyncPoint(y,r,o,t)?1:2,_=ii.estimateSegmentRequestTime(s,n,y)*f-a;return{playlist:y,rebufferingImpact:_}}),v=b.filter(y=>y.rebufferingImpact<=0);return Xa(v,(y,p)=>qp(p.playlist,y.playlist)),v.length?v[0]:(Xa(b,(y,p)=>y.rebufferingImpact-p.rebufferingImpact),b[0]||null)},bN=function(){const i=this.playlists.main.playlists.filter(ii.isEnabled);return Xa(i,(t,n)=>qp(t,n)),i.filter(t=>!!vl(this.playlists.main,t).video)[0]||null},_N=i=>{let e=0,t;return i.bytes&&(t=new Uint8Array(i.bytes),i.segments.forEach(n=>{t.set(n,e),e+=n.byteLength})),t};function Z2(i){try{return new URL(i).pathname.split("/").slice(-2).join("/")}catch{return""}}const kN=function(i,e,t){if(!i[t]){e.trigger({type:"usage",name:"vhs-608"});let n=t;/^cc708_/.test(t)&&(n="SERVICE"+t.split("_")[1]);const r=e.textTracks().getTrackById(n);if(r)i[t]=r;else{const s=e.options_.vhs&&e.options_.vhs.captionServices||{};let a=t,o=t,c=!1;const u=s[n];u&&(a=u.label,o=u.language,c=u.default),i[t]=e.addRemoteTextTrack({kind:"captions",id:n,default:c,label:a,language:o},!1).track}}},TN=function({inbandTextTracks:i,captionArray:e,timestampOffset:t}){if(!e)return;const n=te.WebKitDataCue||te.VTTCue;e.forEach(r=>{const s=r.stream;r.content?r.content.forEach(a=>{const o=new n(r.startTime+t,r.endTime+t,a.text);o.line=a.line,o.align="left",o.position=a.position,o.positionAlign="line-left",i[s].addCue(o)}):i[s].addCue(new n(r.startTime+t,r.endTime+t,r.text))})},SN=function(i){Object.defineProperties(i.frame,{id:{get(){return fe.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),i.value.key}},value:{get(){return fe.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),i.value.data}},privateData:{get(){return fe.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),i.value.data}}})},CN=({inbandTextTracks:i,metadataArray:e,timestampOffset:t,videoDuration:n})=>{if(!e)return;const r=te.WebKitDataCue||te.VTTCue,s=i.metadataTrack_;if(!s||(e.forEach(d=>{const h=d.cueTime+t;typeof h!="number"||te.isNaN(h)||h<0||!(h<1/0)||!d.frames||!d.frames.length||d.frames.forEach(b=>{const v=new r(h,h,b.value||b.url||b.data||"");v.frame=b,v.value=b,SN(v),s.addCue(v)})}),!s.cues||!s.cues.length))return;const a=s.cues,o=[];for(let d=0;d<a.length;d++)a[d]&&o.push(a[d]);const c=o.reduce((d,h)=>{const b=d[h.startTime]||[];return b.push(h),d[h.startTime]=b,d},{}),u=Object.keys(c).sort((d,h)=>Number(d)-Number(h));u.forEach((d,h)=>{const b=c[d],v=isFinite(n)?n:d,y=Number(u[h+1])||v;b.forEach(p=>{p.endTime=y})})},xN={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},EN=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),wN=({inbandTextTracks:i,dateRanges:e})=>{const t=i.metadataTrack_;if(!t)return;const n=te.WebKitDataCue||te.VTTCue;e.forEach(r=>{for(const s of Object.keys(r)){if(EN.has(s))continue;const a=new n(r.startTime,r.endTime,"");a.id=r.id,a.type="com.apple.quicktime.HLS",a.value={key:xN[s],data:r[s]},(s==="scte35Out"||s==="scte35In")&&(a.value.data=new Uint8Array(a.value.data.match(/[\da-f]{2}/gi)).buffer),t.addCue(a)}r.processDateRange()})},e_=(i,e,t)=>{i.metadataTrack_||(i.metadataTrack_=t.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,fe.browser.IS_ANY_SAFARI||(i.metadataTrack_.inBandMetadataTrackDispatchType=e))},yl=function(i,e,t){let n,r;if(t&&t.cues)for(n=t.cues.length;n--;)r=t.cues[n],r.startTime>=i&&r.endTime<=e&&t.removeCue(r)},DN=function(i){const e=i.cues;if(!e)return;const t={};for(let n=e.length-1;n>=0;n--){const r=e[n],s=`${r.startTime}-${r.endTime}-${r.text}`;t[s]?i.removeCue(r):t[s]=r}},AN=(i,e,t)=>{if(typeof e>"u"||e===null||!i.length)return[];const n=Math.ceil((e-t+3)*Rs.ONE_SECOND_IN_TS);let r;for(r=0;r<i.length&&!(i[r].pts>n);r++);return i.slice(r)},IN=(i,e,t)=>{if(!e.length)return i;if(t)return e.slice();const n=e[0].pts;let r=0;for(r;r<i.length&&!(i[r].pts>=n);r++);return i.slice(0,r).concat(e)},NN=(i,e,t,n)=>{const r=Math.ceil((e-n)*Rs.ONE_SECOND_IN_TS),s=Math.ceil((t-n)*Rs.ONE_SECOND_IN_TS),a=i.slice();let o=i.length;for(;o--&&!(i[o].pts<=s););if(o===-1)return a;let c=o+1;for(;c--&&!(i[c].pts<=r););return c=Math.max(c,0),a.splice(c,o-c+1),a},PN=function(i,e){if(!i&&!e||!i&&e||i&&!e)return!1;if(i===e)return!0;const t=Object.keys(i).sort(),n=Object.keys(e).sort();if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++){const s=t[r];if(s!==n[r]||i[s]!==e[s])return!1}return!0},ON=function(i,e,t){e=e||[];const n=[];let r=0;for(let s=0;s<e.length;s++){const a=e[s];if(i===a.timeline&&(n.push(s),r+=a.duration,r>t))return s}return n.length===0?0:n[n.length-1]},bl=1,MN=500,t_=i=>typeof i=="number"&&isFinite(i),Hu=1/60,RN=(i,e,t)=>i!=="main"||!e||!t?null:!t.hasAudio&&!t.hasVideo?"Neither audio nor video found in segment.":e.hasVideo&&!t.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!e.hasVideo&&t.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null,LN=(i,e,t)=>{let n=e-Tn.BACK_BUFFER_LENGTH;i.length&&(n=Math.max(n,i.start(0)));const r=e-t;return Math.min(r,n)},Ya=i=>{const{startOfSegment:e,duration:t,segment:n,part:r,playlist:{mediaSequence:s,id:a,segments:o=[]},mediaIndex:c,partIndex:u,timeline:d}=i,h=o.length-1;let b="mediaIndex/partIndex increment";i.getMediaInfoForTime?b=`getMediaInfoForTime (${i.getMediaInfoForTime})`:i.isSyncRequest&&(b="getSyncSegmentCandidate (isSyncRequest)"),i.independent&&(b+=` with independent ${i.independent}`);const v=typeof u=="number",y=i.segment.uri?"segment":"pre-segment",p=v?o2({preloadSegment:n})-1:0;return`${y} [${s+c}/${s+h}]`+(v?` part [${u}/${p}]`:"")+` segment start/end [${n.start} => ${n.end}]`+(v?` part start/end [${r.start} => ${r.end}]`:"")+` startOfSegment [${e}] duration [${t}] timeline [${d}] selected by [${b}] playlist [${a}]`},n_=i=>`${i}TimingInfo`,BN=({segmentTimeline:i,currentTimeline:e,startOfSegment:t,buffered:n,overrideCheck:r})=>!r&&i===e?null:i<e?t:n.length?n.end(n.length-1):t,zp=({timelineChangeController:i,currentTimeline:e,segmentTimeline:t,loaderType:n,audioDisabled:r})=>{if(e===t)return!1;if(n==="audio"){const s=i.lastTimelineChange({type:"main"});return!s||s.to!==t}if(n==="main"&&r){const s=i.pendingTimelineChange({type:"audio"});return!(s&&s.to===t)}return!1},UN=i=>{if(!i)return!1;const e=i.pendingTimelineChange({type:"audio"}),t=i.pendingTimelineChange({type:"main"}),n=e&&t,r=n&&e.to!==t.to;return!!(n&&e.from!==-1&&t.from!==-1&&r)},FN=i=>{const e=i.timelineChangeController_.pendingTimelineChange({type:"audio"}),t=i.timelineChangeController_.pendingTimelineChange({type:"main"});return e&&t&&e.to<t.to},ls=i=>{const e=i.pendingSegment_;if(!e)return;if(zp({timelineChangeController:i.timelineChangeController_,currentTimeline:i.currentTimeline_,segmentTimeline:e.timeline,loaderType:i.loaderType_,audioDisabled:i.audioDisabled_})&&UN(i.timelineChangeController_)){if(FN(i)){i.timelineChangeController_.trigger("audioTimelineBehind");return}i.timelineChangeController_.trigger("fixBadTimelineChange")}},VN=i=>{let e=0;return["video","audio"].forEach(function(t){const n=i[`${t}TimingInfo`];if(!n)return;const{start:r,end:s}=n;let a;typeof r=="bigint"||typeof s=="bigint"?a=te.BigInt(s)-te.BigInt(r):typeof r=="number"&&typeof s=="number"&&(a=s-r),typeof a<"u"&&a>e&&(e=a)}),typeof e=="bigint"&&e<Number.MAX_SAFE_INTEGER&&(e=Number(e)),e},i_=({segmentDuration:i,maxDuration:e})=>i?Math.round(i)>e+cr:!1,jN=(i,e)=>{if(e!=="hls")return null;const t=VN({audioTimingInfo:i.audioTimingInfo,videoTimingInfo:i.videoTimingInfo});if(!t)return null;const n=i.playlist.targetDuration,r=i_({segmentDuration:t,maxDuration:n*2}),s=i_({segmentDuration:t,maxDuration:n}),a=`Segment with index ${i.mediaIndex} from playlist ${i.playlist.id} has a duration of ${t} when the reported duration is ${i.duration} and the target duration is ${n}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return r||s?{severity:r?"warn":"info",message:a}:null},zs=({type:i,segment:e})=>{if(!e)return;const t=!!(e.key||e.map&&e.map.ke),n=!!(e.map&&!e.map.bytes),r=e.startOfSegment===void 0?e.start:e.startOfSegment;return{type:i||e.type,uri:e.resolvedUri||e.uri,start:r,duration:e.duration,isEncrypted:t,isMediaInitialization:n}};class Gp extends fe.EventTarget{constructor(e,t={}){if(super(),!e)throw new TypeError("Initialization settings are required");if(typeof e.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=Ai(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(n){n!==this.state_&&(this.logger_(`${this.state_} -> ${n}`),this.state_=n,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():ls(this)}),this.sourceUpdater_.on("codecschange",n=>{this.trigger(un({type:"codecschange"},n))}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():ls(this)}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",n=>{this.trigger(un({type:"timelinechange"},n)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():ls(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():ls(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return jp.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&te.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null),this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,te.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==e}error(e){return typeof e<"u"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&jp.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return kn();if(this.loaderType_==="main"){const{hasAudio:t,hasVideo:n,isMuxed:r}=e;if(n&&t&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(n)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,t=!1){if(!e)return null;const n=ju(e);let r=this.initSegments_[n];return t&&!r&&e.bytes&&(this.initSegments_[n]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),r||e}segmentKey(e,t=!1){if(!e)return null;const n=I2(e);let r=this.keyCache_[n];this.cacheEncryptionKeys_&&t&&!r&&e.bytes&&(this.keyCache_[n]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});const s={resolvedUri:(r||e).resolvedUri};return r&&(s.bytes=r.bytes),s}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,t={}){if(!e||this.playlist_&&this.playlist_.endList&&e.endList&&this.playlist_.uri===e.uri)return;const n=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=t,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));let s=null;if(n&&(n.id?s=n.id:n.uri&&(s=n.uri)),this.logger_(`playlist update [${s} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update:
|
229
|
+
currentTime: ${this.currentTime_()}
|
230
|
+
bufferedEnd: ${Dp(this.buffered_())}
|
231
|
+
`,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!n||n.uri!==e.uri){this.mediaIndex!==null&&(!e.endList&&typeof e.partTargetDuration=="number"?this.resetLoader():this.resyncLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}const a=e.mediaSequence-n.mediaSequence;if(this.logger_(`live window shift [${a}]`),this.mediaIndex!==null)if(this.mediaIndex-=a,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const o=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!o.parts||!o.parts.length||!o.parts[this.partIndex])){const c=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=c}}r&&(r.mediaIndex-=a,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex]),r.partIndex>=0&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(n,e)}pause(){this.checkBufferTimeout_&&(te.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&jp.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;this.sourceType_==="hls"&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,t,n=()=>{},r=!1){if(t===1/0&&(t=this.duration_()),t<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}let s=1;const a=()=>{s--,s===0&&n()};(r||!this.audioDisabled_)&&(s++,this.sourceUpdater_.removeAudio(e,t,a)),(r||this.loaderType_==="main")&&(this.gopBuffer_=NN(this.gopBuffer_,e,t,this.timeMapping_),s++,this.sourceUpdater_.removeVideo(e,t,a));for(const o in this.inbandTextTracks_)yl(e,t,this.inbandTextTracks_[o]);yl(e,t,this.segmentMetadataTrack_),a()}monitorBuffer_(){this.checkBufferTimeout_&&te.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=te.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&te.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=te.setTimeout(this.monitorBufferTick_.bind(this),MN)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const t={segmentInfo:zs({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:t}),typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,t=this.playlist_,n=this.partIndex){if(!t||!this.mediaSource_)return!1;const r=typeof e=="number"&&t.segments[e],s=e+1===t.segments.length,a=!r||!r.parts||n+1===r.parts.length;return t.endList&&this.mediaSource_.readyState==="open"&&s&&a}chooseNextRequest_(){const e=this.buffered_(),t=Dp(e)||0,n=Ap(e,this.currentTime_()),r=!this.hasPlayed_()&&n>=1,s=n>=this.goalBufferLength_(),a=this.playlist_.segments;if(!a.length||r||s)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const o={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(o.isSyncRequest)o.mediaIndex=ON(this.currentTimeline_,a,t),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${o.mediaIndex}`);else if(this.mediaIndex!==null){const b=a[this.mediaIndex],v=typeof this.partIndex=="number"?this.partIndex:-1;o.startOfSegment=b.end?b.end:t,b.parts&&b.parts[v+1]?(o.mediaIndex=this.mediaIndex,o.partIndex=v+1):o.mediaIndex=this.mediaIndex+1}else{let b,v,y;const p=this.fetchAtBuffer_?t:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch:
|
232
|
+
For TargetTime: ${p}.
|
233
|
+
CurrentTime: ${this.currentTime_()}
|
234
|
+
BufferedEnd: ${t}
|
235
|
+
Fetch At Buffer: ${this.fetchAtBuffer_}
|
236
|
+
`,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const f=this.getSyncInfoFromMediaSequenceSync_(p);if(!f){const m="No sync info found while using media sequence sync";return this.error({message:m,metadata:{errorType:fe.Error.StreamingFailedToSelectNextSegment,error:new Error(m)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${f.start} --> ${f.end})`),b=f.segmentIndex,v=f.partIndex,y=f.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const f=ii.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:p,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});b=f.segmentIndex,v=f.partIndex,y=f.startTime}o.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${p}`:`currentTime ${p}`,o.mediaIndex=b,o.startOfSegment=y,o.partIndex=v,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${o.mediaIndex} `)}const c=a[o.mediaIndex];let u=c&&typeof o.partIndex=="number"&&c.parts&&c.parts[o.partIndex];if(!c||typeof o.partIndex=="number"&&!u)return null;typeof o.partIndex!="number"&&c.parts&&(o.partIndex=0,u=c.parts[0]);const d=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!n&&u&&!d&&!u.independent)if(o.partIndex===0){const b=a[o.mediaIndex-1],v=b.parts&&b.parts.length&&b.parts[b.parts.length-1];v&&v.independent&&(o.mediaIndex-=1,o.partIndex=b.parts.length-1,o.independent="previous segment")}else c.parts[o.partIndex-1].independent&&(o.partIndex-=1,o.independent="previous part");const h=this.mediaSource_&&this.mediaSource_.readyState==="ended";return o.mediaIndex>=a.length-1&&h&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,o.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(o))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const t=Math.max(e,this.mediaSequenceSync_.start);e!==t&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${t}`);const n=this.mediaSequenceSync_.getSyncInfoForTime(t);if(!n)return null;if(!n.isAppended)return n;const r=this.mediaSequenceSync_.getSyncInfoForTime(n.end);return r?(r.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),r):null}generateSegmentInfo_(e){const{independent:t,playlist:n,mediaIndex:r,startOfSegment:s,isSyncRequest:a,partIndex:o,forceTimestampOffset:c,getMediaInfoForTime:u}=e,d=n.segments[r],h=typeof o=="number"&&d.parts[o],b={requestId:"segment-loader-"+Math.random(),uri:h&&h.resolvedUri||d.resolvedUri,mediaIndex:r,partIndex:h?o:null,isSyncRequest:a,startOfSegment:s,playlist:n,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:d.timeline,duration:h&&h.duration||d.duration,segment:d,part:h,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:u,independent:t},v=typeof c<"u"?c:this.isPendingTimestampOffset_;b.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:d.timeline,currentTimeline:this.currentTimeline_,startOfSegment:s,buffered:this.buffered_(),overrideCheck:v});const y=Dp(this.sourceUpdater_.audioBuffered());return typeof y=="number"&&(b.audioAppendStart=y-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(b.gopsToAlignWith=AN(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),b}timestampOffsetForSegment_(e){return BN(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const t=this.currentTime_(),n=e.bandwidth,r=this.pendingSegment_.duration,s=ii.estimateSegmentRequestTime(r,n,this.playlist_,e.bytesReceived),a=lI(this.buffered_(),t,this.vhs_.tech_.playbackRate())-1;if(s<=a)return;const o=yN({main:this.vhs_.playlists.main,currentTime:t,bandwidth:n,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:a,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!o)return;const u=s-a-o.rebufferingImpact;let d=.5;a<=cr&&(d=1),!(!o.playlist||o.playlist.uri===this.playlist_.uri||u<d)&&(this.bandwidth=o.playlist.attributes.BANDWIDTH*Tn.BANDWIDTH_VARIANCE+1,this.trigger("earlyabort"))}handleAbort_(e){this.logger_(`Aborting ${Ya(e)}`),this.mediaRequestsAborted+=1}handleProgress_(e,t){this.earlyAbortWhenNeeded_(t.stats),!this.checkForAbort_(t.requestId)&&this.trigger("progress")}handleTrackInfo_(e,t){const{hasAudio:n,hasVideo:r}=t,s={segmentInfo:zs({type:this.loaderType_,segment:e}),trackInfo:{hasAudio:n,hasVideo:r}};this.trigger({type:"segmenttransmuxingtrackinfoavailable",metadata:s}),this.earlyAbortWhenNeeded_(e.stats),!this.checkForAbort_(e.requestId)&&(this.checkForIllegalMediaSwitch(t)||(t=t||{},PN(this.currentMediaInfo_,t)||(this.appendInitSegment_={audio:!0,video:!0},this.startingMediaInfo_=t,this.currentMediaInfo_=t,this.logger_("trackinfo update",t),this.trigger("trackinfo")),!this.checkForAbort_(e.requestId)&&(this.pendingSegment_.trackInfo=t,this.hasEnoughInfoToAppend_()?this.processCallQueue_():ls(this))))}handleTimingInfo_(e,t,n,r){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;const s=this.pendingSegment_,a=n_(t);s[a]=s[a]||{},s[a][n]=r,this.logger_(`timinginfo: ${t} - ${n} - ${r}`),this.hasEnoughInfoToAppend_()?this.processCallQueue_():ls(this)}handleCaptions_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(t.length===0){this.logger_("SegmentLoader received no captions from a caption event");return}if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.caption.push(this.handleCaptions_.bind(this,e,t));return}const r=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset(),s={};t.forEach(a=>{s[a.stream]=s[a.stream]||{startTime:1/0,captions:[],endTime:0};const o=s[a.stream];o.startTime=Math.min(o.startTime,a.startTime+r),o.endTime=Math.max(o.endTime,a.endTime+r),o.captions.push(a)}),Object.keys(s).forEach(a=>{const{startTime:o,endTime:c,captions:u}=s[a],d=this.inbandTextTracks_;this.logger_(`adding cues from ${o} -> ${c} for ${a}`),kN(d,this.vhs_.tech_,a),yl(o,c,d[a]),TN({captionArray:u,inbandTextTracks:d,timestampOffset:r})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,t,n){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,t,n));return}this.addMetadataToTextTrack(n,t,this.duration_())}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(t=>t())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(t=>t())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio")return!0;const e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!zp({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,t=this.getCurrentMediaInfo_();if(!e||!t)return!1;const{hasAudio:n,hasVideo:r,isMuxed:s}=t;return!(r&&!e.videoTimingInfo||n&&!this.audioDisabled_&&!s&&!e.audioTimingInfo||zp({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,t){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){ls(this),this.callQueue_.push(this.handleData_.bind(this,e,t));return}const n=this.pendingSegment_;if(this.setTimeMapping_(n.timeline),this.updateMediaSecondsLoaded_(n.part||n.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),n.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),n.isFmp4=e.isFmp4,n.timingInfo=n.timingInfo||{},n.isFmp4)this.trigger("fmp4"),n.timingInfo.start=n[n_(t.type)].start;else{const r=this.getCurrentMediaInfo_(),s=this.loaderType_==="main"&&r&&r.hasVideo;let a;s&&(a=n.videoTimingInfo.start),n.timingInfo.start=this.trueSegmentStart_({currentStart:n.timingInfo.start,playlist:n.playlist,mediaIndex:n.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:s,firstVideoFrameTimeForData:a,videoTimingInfo:n.videoTimingInfo,audioTimingInfo:n.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(n,t.type),this.updateSourceBufferTimestampOffset_(n),n.isSyncRequest){this.updateTimingInfoEnd_(n),this.syncController_.saveSegmentTimingInfo({segmentInfo:n,shouldSaveTimelineMapping:this.loaderType_==="main"});const r=this.chooseNextRequest_();if(r.mediaIndex!==n.mediaIndex||r.partIndex!==n.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}n.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(n,t)}}updateAppendInitSegmentStatus(e,t){this.loaderType_==="main"&&typeof e.timestampOffset=="number"&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[t]!==e.playlist&&(this.appendInitSegment_[t]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:t,map:n,playlist:r}){if(n){const s=ju(n);if(this.activeInitSegmentId_===s)return null;t=this.initSegmentForMap(n,!0).bytes,this.activeInitSegmentId_=s}return t&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=r,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,t):null}handleQuotaExceededError_({segmentInfo:e,type:t,bytes:n},r){const s=this.sourceUpdater_.audioBuffered(),a=this.sourceUpdater_.videoBuffered();s.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Hs(s).join(", ")),a.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Hs(a).join(", "));const o=s.length?s.start(0):0,c=s.length?s.end(s.length-1):0,u=a.length?a.start(0):0,d=a.length?a.end(a.length-1):0;if(c-o<=bl&&d-u<=bl){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${n.byteLength}, audio buffer: ${Hs(s).join(", ")}, video buffer: ${Hs(a).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:t,bytes:n}));const b=this.currentTime_()-bl;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${b}`),this.remove(0,b,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${bl}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=te.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},bl*1e3)},!0)}handleAppendError_({segmentInfo:e,type:t,bytes:n},r){if(r){if(r.code===_2){this.handleQuotaExceededError_({segmentInfo:e,type:t,bytes:n});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error({message:`${t} append of ${n.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:fe.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:t,initSegment:n,data:r,bytes:s}){if(!s){const o=[r];let c=r.byteLength;n&&(o.unshift(n),c+=n.byteLength),s=_N({bytes:c,segments:o})}const a={segmentInfo:zs({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:a}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:t,bytes:s},this.handleAppendError_.bind(this,{segmentInfo:e,type:t,bytes:s}))}handleSegmentTimingInfo_(e,t,n){if(!this.pendingSegment_||t!==this.pendingSegment_.requestId)return;const r=this.pendingSegment_.segment,s=`${e}TimingInfo`;r[s]||(r[s]={}),r[s].transmuxerPrependedSeconds=n.prependedContentDuration||0,r[s].transmuxedPresentationStart=n.start.presentation,r[s].transmuxedDecodeStart=n.start.decode,r[s].transmuxedPresentationEnd=n.end.presentation,r[s].transmuxedDecodeEnd=n.end.decode,r[s].baseMediaDecodeTime=n.baseMediaDecodeTime}appendData_(e,t){const{type:n,data:r}=t;if(!r||!r.byteLength||n==="audio"&&this.audioDisabled_)return;const s=this.getInitSegmentAndUpdateState_({type:n,initSegment:t.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:n,initSegment:s,data:r})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){ls(this),this.loadQueue_.push(()=>{const t=un({},e,{forceTimestampOffset:!0});un(e,this.generateSegmentInfo_(t)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const t=this.createSimplifiedSegmentObj_(e),n=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=this.mediaIndex!==null,s=e.timeline!==this.currentTimeline_&&e.timeline>0,a=n||r&&s;this.logger_(`Requesting
|
237
|
+
${Z2(e.uri)}
|
238
|
+
${Ya(e)}`),t.map&&!t.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=mN({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:t,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:a,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:o,level:c,stream:u})=>{this.logger_(`${Ya(e)} logged from transmuxer stream ${u} as a ${c}: ${o}`)},triggerSegmentEventFn:({type:o,segment:c,keyInfo:u,trackInfo:d,timingInfo:h})=>{const v={segmentInfo:zs({segment:c})};u&&(v.keyInfo=u),d&&(v.trackInfo=d),h&&(v.timingInfo=h),this.trigger({type:o,metadata:v})}})}trimBackBuffer_(e){const t=LN(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);t>0&&this.remove(0,t)}createSimplifiedSegmentObj_(e){const t=e.segment,n=e.part,r=e.segment.key||e.segment.map&&e.segment.map.key,s=e.segment.map&&!e.segment.map.bytes,a={resolvedUri:n?n.resolvedUri:t.resolvedUri,byterange:n?n.byterange:t.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:r,isMediaInitialization:s},o=e.playlist.segments[e.mediaIndex-1];if(o&&o.timeline===t.timeline&&(o.videoTimingInfo?a.baseStartTime=o.videoTimingInfo.transmuxedDecodeEnd:o.audioTimingInfo&&(a.baseStartTime=o.audioTimingInfo.transmuxedDecodeEnd)),t.key){const c=t.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);a.key=this.segmentKey(t.key),a.key.iv=c}return t.map&&(a.map=this.initSegmentForMap(t.map)),a}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,t){if(this.pendingSegment_.byteLength=t.bytesReceived,e<Hu){this.logger_(`Ignoring segment's bandwidth because its duration of ${e} is less than the min to record ${Hu}`);return}const n={bandwidthInfo:{from:this.bandwidth,to:t.bandwidth}};this.trigger({type:"bandwidthupdated",metadata:n}),this.bandwidth=t.bandwidth,this.roundTrip=t.roundTripTime}handleTimeout_(){this.mediaRequestsTimedout+=1,this.bandwidth=1,this.roundTrip=NaN,this.trigger("bandwidthupdate"),this.trigger("timeout")}segmentRequestFinished_(e,t,n){if(this.callQueue_.length){this.callQueue_.push(this.segmentRequestFinished_.bind(this,e,t,n));return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_||t.requestId!==this.pendingSegment_.requestId)return;if(e){if(this.pendingSegment_=null,this.state="READY",e.code===dr.ABORTED)return;if(this.pause(),e.code===dr.TIMEOUT){this.handleTimeout_();return}this.mediaRequestsErrored+=1,this.error(e),this.trigger("error");return}const r=this.pendingSegment_;this.saveBandwidthRelatedStats_(r.duration,t.stats),r.endOfAllRequests=t.endOfAllRequests,n.gopInfo&&(this.gopBuffer_=IN(this.gopBuffer_,n.gopInfo,this.safeAppend_)),this.state="APPENDING",this.trigger("appending"),this.waitForAppendsToComplete_(r)}setTimeMapping_(e){const t=this.syncController_.mappingForTimeline(e);t!==null&&(this.timeMapping_=t)}updateMediaSecondsLoaded_(e){typeof e.start=="number"&&typeof e.end=="number"?this.mediaSecondsLoaded+=e.end-e.start:this.mediaSecondsLoaded+=e.duration}shouldUpdateTransmuxerTimestampOffset_(e){return e===null?!1:this.loaderType_==="main"&&e!==this.sourceUpdater_.videoTimestampOffset()||!this.audioDisabled_&&e!==this.sourceUpdater_.audioTimestampOffset()}trueSegmentStart_({currentStart:e,playlist:t,mediaIndex:n,firstVideoFrameTimeForData:r,currentVideoTimestampOffset:s,useVideoTimingInfo:a,videoTimingInfo:o,audioTimingInfo:c}){if(typeof e<"u")return e;if(!a)return c.start;const u=t.segments[n-1];return n===0||!u||typeof u.start>"u"||u.end!==r+s?r:o.start}waitForAppendsToComplete_(e){const t=this.getCurrentMediaInfo_(e);if(!t){this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),this.trigger("error");return}const{hasAudio:n,hasVideo:r,isMuxed:s}=t,a=this.loaderType_==="main"&&r,o=!this.audioDisabled_&&n&&!s;if(e.waitingOnAppends=0,!e.hasAppendedData_){!e.timingInfo&&typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e);return}a&&e.waitingOnAppends++,o&&e.waitingOnAppends++,a&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),o&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const t=RN(this.loaderType_,this.getCurrentMediaInfo_(),e);return t?(this.error({message:t,playlistExclusionDuration:1/0}),this.trigger("error"),!0):!1}updateSourceBufferTimestampOffset_(e){if(e.timestampOffset===null||typeof e.timingInfo.start!="number"||e.changedTimestampOffset||this.loaderType_!=="main")return;let t=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),t=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),t=!0),t&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:t,timingInfo:n}){return this.useDtsForTimestampOffset_?e&&typeof e.transmuxedDecodeStart=="number"?e.transmuxedDecodeStart:t&&typeof t.transmuxedDecodeStart=="number"?t.transmuxedDecodeStart:n.start:n.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const t=this.getMediaInfo_(),r=this.loaderType_==="main"&&t&&t.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;r&&(e.timingInfo.end=typeof r.end=="number"?r.end:r.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){const c={segmentInfo:zs({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:c})}if(!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}const e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_==="main"});const t=jN(e,this.sourceType_);if(t&&(t.severity==="warn"?fe.log.warn(t.message):this.logger_(t.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_)){this.logger_(`Throwing away un-appended sync request ${Ya(e)}`);return}this.logger_(`Appended ${Ya(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const n=e.segment,r=e.part,s=n.end&&this.currentTime_()-n.end>e.playlist.targetDuration*3,a=r&&r.end&&this.currentTime_()-r.end>e.playlist.partTargetDuration*3;if(s||a){this.logger_(`bad ${s?"segment":"part"} ${Ya(e)}`),this.resetEverything();return}this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duration<Hu){this.logger_(`Ignoring segment's throughput because its duration of ${e.duration} is less than the min to record ${Hu}`);return}const t=this.throughput.rate,n=Date.now()-e.endOfAllRequests+1,r=Math.floor(e.byteLength/n*8*1e3);this.throughput.rate+=(r-t)/++this.throughput.count}addSegmentMetadataCue_(e){if(!this.segmentMetadataTrack_)return;const t=e.segment,n=t.start,r=t.end;if(!t_(n)||!t_(r))return;yl(n,r,this.segmentMetadataTrack_);const s=te.WebKitDataCue||te.VTTCue,a={custom:t.custom,dateTimeObject:t.dateTimeObject,dateTimeString:t.dateTimeString,programDateTime:t.programDateTime,bandwidth:e.playlist.attributes.BANDWIDTH,resolution:e.playlist.attributes.RESOLUTION,codecs:e.playlist.attributes.CODECS,byteLength:e.byteLength,uri:e.uri,timeline:e.timeline,playlist:e.playlist.id,start:n,end:r},o=JSON.stringify(a),c=new s(n,r,o);c.value=a,this.segmentMetadataTrack_.addCue(c)}}function Pr(){}const r_=function(i){return typeof i!="string"?i:i.replace(/./,e=>e.toUpperCase())},$N=["video","audio"],Wp=(i,e)=>{const t=e[`${i}Buffer`];return t&&t.updating||e.queuePending[i]},HN=(i,e)=>{for(let t=0;t<e.length;t++){const n=e[t];if(n.type==="mediaSource")return null;if(n.type===i)return t}return null},Ja=(i,e)=>{if(e.queue.length===0)return;let t=0,n=e.queue[t];if(n.type==="mediaSource"){!e.updating()&&e.mediaSource.readyState!=="closed"&&(e.queue.shift(),n.action(e),n.doneFn&&n.doneFn(),Ja("audio",e),Ja("video",e));return}if(i!=="mediaSource"&&!(!e.ready()||e.mediaSource.readyState==="closed"||Wp(i,e))){if(n.type!==i){if(t=HN(i,e.queue),t===null)return;n=e.queue[t]}if(e.queue.splice(t,1),e.queuePending[i]=n,n.action(i,e),!n.doneFn){e.queuePending[i]=null,Ja(i,e);return}}},s_=(i,e)=>{const t=e[`${i}Buffer`],n=r_(i);t&&(t.removeEventListener("updateend",e[`on${n}UpdateEnd_`]),t.removeEventListener("error",e[`on${n}Error_`]),e.codecs[i]=null,e[`${i}Buffer`]=null)},hr=(i,e)=>i&&e&&Array.prototype.indexOf.call(i.sourceBuffers,e)!==-1,gi={appendBuffer:(i,e,t)=>(n,r)=>{const s=r[`${n}Buffer`];if(hr(r.mediaSource,s)){r.logger_(`Appending segment ${e.mediaIndex}'s ${i.length} bytes to ${n}Buffer`);try{s.appendBuffer(i)}catch(a){r.logger_(`Error with code ${a.code} `+(a.code===_2?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${n}Buffer`),r.queuePending[n]=null,t(a)}}},remove:(i,e)=>(t,n)=>{const r=n[`${t}Buffer`];if(hr(n.mediaSource,r)){n.logger_(`Removing ${i} to ${e} from ${t}Buffer`);try{r.remove(i,e)}catch{n.logger_(`Remove ${i} to ${e} from ${t}Buffer failed`)}}},timestampOffset:i=>(e,t)=>{const n=t[`${e}Buffer`];hr(t.mediaSource,n)&&(t.logger_(`Setting ${e}timestampOffset to ${i}`),n.timestampOffset=i)},callback:i=>(e,t)=>{i()},endOfStream:i=>e=>{if(e.mediaSource.readyState==="open"){e.logger_(`Calling mediaSource endOfStream(${i||""})`);try{e.mediaSource.endOfStream(i)}catch(t){fe.log.warn("Failed to call media source endOfStream",t)}}},duration:i=>e=>{e.logger_(`Setting mediaSource duration to ${i}`);try{e.mediaSource.duration=i}catch(t){fe.log.warn("Failed to set media source duration",t)}},abort:()=>(i,e)=>{if(e.mediaSource.readyState!=="open")return;const t=e[`${i}Buffer`];if(hr(e.mediaSource,t)){e.logger_(`calling abort on ${i}Buffer`);try{t.abort()}catch(n){fe.log.warn(`Failed to abort on ${i}Buffer`,n)}}},addSourceBuffer:(i,e)=>t=>{const n=r_(i),r=ka(e);t.logger_(`Adding ${i}Buffer with codec ${e} to mediaSource`);const s=t.mediaSource.addSourceBuffer(r);s.addEventListener("updateend",t[`on${n}UpdateEnd_`]),s.addEventListener("error",t[`on${n}Error_`]),t.codecs[i]=e,t[`${i}Buffer`]=s},removeSourceBuffer:i=>e=>{const t=e[`${i}Buffer`];if(s_(i,e),!!hr(e.mediaSource,t)){e.logger_(`Removing ${i}Buffer with codec ${e.codecs[i]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(t)}catch(n){fe.log.warn(`Failed to removeSourceBuffer ${i}Buffer`,n)}}},changeType:i=>(e,t)=>{const n=t[`${e}Buffer`],r=ka(i);if(!hr(t.mediaSource,n))return;const s=i.substring(0,i.indexOf(".")),a=t.codecs[e];if(a.substring(0,a.indexOf("."))===s)return;const c={codecsChangeInfo:{from:a,to:i}};t.trigger({type:"codecschange",metadata:c}),t.logger_(`changing ${e}Buffer codec from ${a} to ${i}`);try{n.changeType(r),t.codecs[e]=i}catch(u){c.errorType=fe.Error.StreamingCodecsChangeError,c.error=u,u.metadata=c,t.error_=u,t.trigger("error"),fe.log.warn(`Failed to changeType on ${e}Buffer`,u)}}},vi=({type:i,sourceUpdater:e,action:t,doneFn:n,name:r})=>{e.queue.push({type:i,action:t,doneFn:n,name:r}),Ja(i,e)},a_=(i,e)=>t=>{const n=e[`${i}Buffered`](),r=sI(n);if(e.logger_(`received "updateend" event for ${i} Source Buffer: `,r),e.queuePending[i]){const s=e.queuePending[i].doneFn;e.queuePending[i]=null,s&&s(e[`${i}Error_`])}Ja(i,e)};class o_ extends fe.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>Ja("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=Ai("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=a_("video",this),this.onAudioUpdateEnd_=a_("audio",this),this.onVideoError_=t=>{this.videoError_=t},this.onAudioError_=t=>{this.audioError_=t},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,t){vi({type:"mediaSource",sourceUpdater:this,action:gi.addSourceBuffer(e,t),name:"addSourceBuffer"})}abort(e){vi({type:e,sourceUpdater:this,action:gi.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){fe.log.error("removeSourceBuffer is not supported!");return}vi({type:"mediaSource",sourceUpdater:this,action:gi.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!fe.browser.IS_FIREFOX&&te.MediaSource&&te.MediaSource.prototype&&typeof te.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return te.SourceBuffer&&te.SourceBuffer.prototype&&typeof te.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,t){if(!this.canChangeType()){fe.log.error("changeType is not supported!");return}vi({type:e,sourceUpdater:this,action:gi.changeType(t),name:"changeType"})}addOrChangeSourceBuffers(e){if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(t=>{const n=e[t];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(t,n);this.canChangeType()&&this.changeType(t,n)})}appendBuffer(e,t){const{segmentInfo:n,type:r,bytes:s}=e;if(this.processedAppend_=!0,r==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,t]),this.logger_(`delayed audio append of ${s.length} until video append`);return}const a=t;if(vi({type:r,sourceUpdater:this,action:gi.appendBuffer(s,n||{mediaIndex:-1},a),doneFn:t,name:"appendBuffer"}),r==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const o=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${o.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,o.forEach(c=>{this.appendBuffer.apply(this,c)})}}audioBuffered(){return hr(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:kn()}videoBuffered(){return hr(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:kn()}buffered(){const e=hr(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,t=hr(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return t&&!e?this.audioBuffered():e&&!t?this.videoBuffered():oI(this.audioBuffered(),this.videoBuffered())}setDuration(e,t=Pr){vi({type:"mediaSource",sourceUpdater:this,action:gi.duration(e),name:"duration",doneFn:t})}endOfStream(e=null,t=Pr){typeof e!="string"&&(e=void 0),vi({type:"mediaSource",sourceUpdater:this,action:gi.endOfStream(e),name:"endOfStream",doneFn:t})}removeAudio(e,t,n=Pr){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){n();return}vi({type:"audio",sourceUpdater:this,action:gi.remove(e,t),doneFn:n,name:"remove"})}removeVideo(e,t,n=Pr){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){n();return}vi({type:"video",sourceUpdater:this,action:gi.remove(e,t),doneFn:n,name:"remove"})}updating(){return!!(Wp("audio",this)||Wp("video",this))}audioTimestampOffset(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(vi({type:"audio",sourceUpdater:this,action:gi.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(vi({type:"video",sourceUpdater:this,action:gi.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&vi({type:"audio",sourceUpdater:this,action:gi.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&vi({type:"video",sourceUpdater:this,action:gi.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),$N.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>s_(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const l_=i=>decodeURIComponent(escape(String.fromCharCode.apply(null,i))),qN=i=>{const e=new Uint8Array(i);return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")},c_=new Uint8Array(`
|
239
|
+
|
240
|
+
`.split("").map(i=>i.charCodeAt(0)));class zN extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class GN extends Gp{constructor(e,t={}){super(e,t),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return kn();const e=this.subtitlesTrack_.cues,t=e[0].startTime,n=e[e.length-1].startTime;return kn([[t,n]])}initSegmentForMap(e,t=!1){if(!e)return null;const n=ju(e);let r=this.initSegments_[n];if(t&&!r&&e.bytes){const s=c_.byteLength+e.bytes.byteLength,a=new Uint8Array(s);a.set(e.bytes),a.set(c_,e.bytes.byteLength),this.initSegments_[n]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:a}}return r||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return typeof e>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)}remove(e,t){yl(e,t,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const t=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};this.syncController_.one("timestampoffset",t),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,t,n){if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(t.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===dr.TIMEOUT&&this.handleTimeout_(),e.code===dr.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}const r=this.pendingSegment_,s=n.mp4VttCues&&n.mp4VttCues.length;s&&(r.mp4VttCues=n.mp4VttCues),this.saveBandwidthRelatedStats_(r.duration,t.stats),t.key&&this.segmentKey(t.key,!0),this.state="APPENDING",this.trigger("appending");const a=r.segment;if(a.map&&(a.map.bytes=t.map.bytes),r.bytes=t.bytes,typeof te.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,t,n),()=>this.stopForError({message:"Error loading vtt.js"}));return}a.requested=!0;try{this.parseVTTCues_(r)}catch(o){this.stopForError({message:o.message,metadata:{errorType:fe.Error.StreamingVttParserError,error:o}});return}if(s||this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=a.duration,r.cues.forEach(o=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new te.VTTCue(o.startTime,o.endTime,o.text):o)}),DN(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(e,t){const n=e&&e.type==="vtt",r=t&&t.type==="text";n&&r&&super.handleData_(e,t)}updateTimingInfoEnd_(){}parseMp4VttCues_(e){const t=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();e.mp4VttCues.forEach(n=>{const r=n.start+t,s=n.end+t,a=new te.VTTCue(r,s,n.cueText);n.settings&&n.settings.split(" ").forEach(o=>{const c=o.split(":"),u=c[0],d=c[1];a[u]=isNaN(d)?d:Number(d)}),e.cues.push(a)})}parseVTTCues_(e){let t,n=!1;if(typeof te.WebVTT!="function")throw new zN;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues){this.parseMp4VttCues_(e);return}typeof te.TextDecoder=="function"?t=new te.TextDecoder("utf8"):(t=te.WebVTT.StringDecoder(),n=!0);const r=new te.WebVTT.Parser(te,te.vttjs,t);if(r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=a=>{e.timestampmap=a},r.onparsingerror=a=>{fe.log.warn("Error encountered when parsing cues: "+a.message)},e.segment.map){let a=e.segment.map.bytes;n&&(a=l_(a)),r.parse(a)}let s=e.bytes;n&&(s=l_(s)),r.parse(s),r.flush()}updateTimeMapping_(e,t,n){const r=e.segment;if(!t)return;if(!e.cues.length){r.empty=!0;return}const{MPEGTS:s,LOCAL:a}=e.timestampmap,c=s/Rs.ONE_SECOND_IN_TS-a+t.mapping;if(e.cues.forEach(u=>{const d=u.endTime-u.startTime,h=this.handleRollover_(u.startTime+c,t.time);u.startTime=Math.max(h,0),u.endTime=Math.max(h+d,0)}),!n.syncInfo){const u=e.cues[0].startTime,d=e.cues[e.cues.length-1].startTime;n.syncInfo={mediaSequence:n.mediaSequence+e.mediaIndex,time:Math.min(u,d-r.duration)}}}handleRollover_(e,t){if(t===null)return e;let n=e*Rs.ONE_SECOND_IN_TS;const r=t*Rs.ONE_SECOND_IN_TS;let s;for(r<n?s=-8589934592:s=8589934592;Math.abs(n-r)>4294967296;)n+=s;return n/Rs.ONE_SECOND_IN_TS}}const WN=function(i,e){const t=i.cues;for(let n=0;n<t.length;n++){const r=t[n];if(e>=r.adStartTime&&e<=r.adEndTime)return r}return null},KN=function(i,e,t=0){if(!i.segments)return;let n=t,r;for(let s=0;s<i.segments.length;s++){const a=i.segments[s];if(r||(r=WN(e,n+a.duration/2)),r){if("cueIn"in a){r.endTime=n,r.adEndTime=n,n+=a.duration,r=null;continue}if(n<r.endTime){n+=a.duration;continue}r.endTime+=a.duration}else if("cueOut"in a&&(r=new te.VTTCue(n,n+a.duration,a.cueOut),r.adStartTime=n,r.adEndTime=n+parseFloat(a.cueOut),e.addCue(r)),"cueOutCont"in a){const[o,c]=a.cueOutCont.split("/").map(parseFloat);r=new te.VTTCue(n,n+a.duration,""),r.adStartTime=n-o,r.adEndTime=r.adStartTime+c,e.addCue(r)}n+=a.duration}};class u_{constructor({start:e,end:t,segmentIndex:n,partIndex:r=null,appended:s=!1}){this.start_=e,this.end_=t,this.segmentIndex_=n,this.partIndex_=r,this.appended_=s}isInRange(e){return e>=this.start&&e<this.end}markAppended(){this.appended_=!0}resetAppendedStatus(){this.appended_=!1}get isAppended(){return this.appended_}get start(){return this.start_}get end(){return this.end_}get segmentIndex(){return this.segmentIndex_}get partIndex(){return this.partIndex_}}class XN{constructor(e,t=[]){this.segmentSyncInfo_=e,this.partsSyncInfo_=t}get segmentSyncInfo(){return this.segmentSyncInfo_}get partsSyncInfo(){return this.partsSyncInfo_}get hasPartsSyncInfo(){return this.partsSyncInfo_.length>0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class d_{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,t){const{mediaSequence:n,segments:r}=e;if(this.isReliable_=this.isReliablePlaylist_(n,r),!!this.isReliable_)return this.updateStorage_(r,n,this.calculateBaseTime_(n,r,t))}getSyncInfoForTime(e){for(const{segmentSyncInfo:t,partsSyncInfo:n}of this.storage_.values())if(n.length){for(const r of n)if(r.isInRange(e))return r}else if(t.isInRange(e))return t;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,t,n){const r=new Map;let s=`
|
241
|
+
`,a=n,o=t;this.start_=a,e.forEach((c,u)=>{const d=this.storage_.get(o),h=a,b=h+c.duration,v=!!(d&&d.segmentSyncInfo&&d.segmentSyncInfo.isAppended),y=new u_({start:h,end:b,appended:v,segmentIndex:u});c.syncInfo=y;let p=a;const f=(c.parts||[]).map((m,_)=>{const k=p,D=p+m.duration,E=!!(d&&d.partsSyncInfo&&d.partsSyncInfo[_]&&d.partsSyncInfo[_].isAppended),A=new u_({start:k,end:D,appended:E,segmentIndex:u,partIndex:_});return p=D,s+=`Media Sequence: ${o}.${_} | Range: ${k} --> ${D} | Appended: ${E}
|
242
|
+
`,m.syncInfo=A,A});r.set(o,new XN(y,f)),s+=`${Z2(c.resolvedUri)} | Media Sequence: ${o} | Range: ${h} --> ${b} | Appended: ${v}
|
243
|
+
`,o++,a=b}),this.end_=a,this.storage_=r,this.diagnostics_=s}calculateBaseTime_(e,t,n){if(!this.storage_.size)return 0;if(this.storage_.has(e))return this.storage_.get(e).segmentSyncInfo.start;const r=Math.min(...this.storage_.keys());if(e<r){const s=r-e;let a=this.storage_.get(r).segmentSyncInfo.start;for(let o=0;o<s;o++){const c=t[o];a-=c.duration}return a}return n}isReliablePlaylist_(e,t){return e!=null&&Array.isArray(t)&&t.length}}class h_ extends d_{constructor(e){super(),this.parent_=e}calculateBaseTime_(e,t,n){if(!this.storage_.size){const r=this.parent_.getSyncInfoForMediaSequence(e);return r?r.segmentSyncInfo.start:0}return super.calculateBaseTime_(e,t,n)}}const YN=86400,Kp=[{name:"VOD",run:(i,e,t,n,r)=>t!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(i,e,t,n,r,s)=>{const a=i.getMediaSequenceSync(s);if(!a||!a.isReliable)return null;const o=a.getSyncInfoForTime(r);return o?{time:o.start,partIndex:o.partIndex,segmentIndex:o.segmentIndex}:null}},{name:"ProgramDateTime",run:(i,e,t,n,r)=>{if(!Object.keys(i.timelineToDatetimeMappings).length)return null;let s=null,a=null;const o=Np(e);r=r||0;for(let c=0;c<o.length;c++){const u=e.endList||r===0?c:o.length-(c+1),d=o[u],h=d.segment,b=i.timelineToDatetimeMappings[h.timeline];if(!b||!h.dateTimeObject)continue;let y=h.dateTimeObject.getTime()/1e3+b;if(h.parts&&typeof d.partIndex=="number")for(let f=0;f<d.partIndex;f++)y+=h.parts[f].duration;const p=Math.abs(r-y);if(a!==null&&(p===0||a<p))break;a=p,s={time:y,segmentIndex:d.segmentIndex,partIndex:d.partIndex}}return s}},{name:"Segment",run:(i,e,t,n,r)=>{let s=null,a=null;r=r||0;const o=Np(e);for(let c=0;c<o.length;c++){const u=e.endList||r===0?c:o.length-(c+1),d=o[u],h=d.segment,b=d.part&&d.part.start||h&&h.start;if(h.timeline===n&&typeof b<"u"){const v=Math.abs(r-b);if(a!==null&&a<v)break;(!s||a===null||a>=v)&&(a=v,s={time:b,segmentIndex:d.segmentIndex,partIndex:d.partIndex})}}return s}},{name:"Discontinuity",run:(i,e,t,n,r)=>{let s=null;if(r=r||0,e.discontinuityStarts&&e.discontinuityStarts.length){let a=null;for(let o=0;o<e.discontinuityStarts.length;o++){const c=e.discontinuityStarts[o],u=e.discontinuitySequence+o+1,d=i.discontinuities[u];if(d){const h=Math.abs(r-d.time);if(a!==null&&a<h)break;(!s||a===null||a>=h)&&(a=h,s={time:d.time,segmentIndex:c,partIndex:null})}}}return s}},{name:"Playlist",run:(i,e,t,n,r)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];class JN extends fe.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const t=new d_,n=new h_(t),r=new h_(t);this.mediaSequenceStorage_={main:t,audio:n,vtt:r},this.logger_=Ai("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,t,n,r,s){if(t!==1/0)return Kp.find(({name:c})=>c==="VOD").run(this,e,t);const a=this.runStrategies_(e,t,n,r,s);if(!a.length)return null;for(const o of a){const{syncPoint:c,strategy:u}=o,{segmentIndex:d,time:h}=c;if(d<0)continue;const b=e.segments[d],v=h,y=v+b.duration;if(this.logger_(`Strategy: ${u}. Current time: ${r}. selected segment: ${d}. Time: [${v} -> ${y}]}`),r>=v&&r<y)return this.logger_("Found sync point with exact match: ",c),c}return this.selectSyncPoint_(a,{key:"time",value:r})}getExpiredTime(e,t){if(!e||!e.segments)return null;const n=this.runStrategies_(e,t,e.discontinuitySequence,0);if(!n.length)return null;const r=this.selectSyncPoint_(n,{key:"segmentIndex",value:0});return r.segmentIndex>0&&(r.time*=-1),Math.abs(r.time+pl({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,t,n,r,s){const a=[];for(let o=0;o<Kp.length;o++){const c=Kp[o],u=c.run(this,e,t,n,r,s);u&&(u.strategy=c.name,a.push({strategy:c.name,syncPoint:u}))}return a}selectSyncPoint_(e,t){let n=e[0].syncPoint,r=Math.abs(e[0].syncPoint[t.key]-t.value),s=e[0].strategy;for(let a=1;a<e.length;a++){const o=Math.abs(e[a].syncPoint[t.key]-t.value);o<r&&(r=o,n=e[a].syncPoint,s=e[a].strategy)}return this.logger_(`syncPoint for [${t.key}: ${t.value}] chosen with strategy [${s}]: [time:${n.time}, segmentIndex:${n.segmentIndex}`+(typeof n.partIndex=="number"?`,partIndex:${n.partIndex}`:"")+"]"),n}saveExpiredSegmentInfo(e,t){const n=t.mediaSequence-e.mediaSequence;if(n>YN){fe.log.warn(`Not saving expired segment info. Media sequence gap ${n} is too large.`);return}for(let r=n-1;r>=0;r--){const s=e.segments[r];if(s&&typeof s.start<"u"){t.syncInfo={mediaSequence:e.mediaSequence+r,time:s.start},this.logger_(`playlist refresh sync: [time:${t.syncInfo.time}, mediaSequence: ${t.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const t=e.segments[0],n=t.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[t.timeline]=-n}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:t}){const n=this.calculateSegmentTimeMapping_(e,e.timingInfo,t),r=e.segment;n&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:r.start}));const s=r.dateTimeObject;r.discontinuity&&t&&s&&(this.timelineToDatetimeMappings[r.timeline]=-(s.getTime()/1e3))}timestampOffsetForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].time}mappingForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,t,n){const r=e.segment,s=e.part;let a=this.timelines[e.timeline],o,c;if(typeof e.timestampOffset=="number")a={time:e.startOfSegment,mapping:e.startOfSegment-t.start},n&&(this.timelines[e.timeline]=a,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${a.time}] [mapping: ${a.mapping}]`)),o=e.startOfSegment,c=t.end+a.mapping;else if(a)o=t.start+a.mapping,c=t.end+a.mapping;else return!1;return s&&(s.start=o,s.end=c),(!r.start||o<r.start)&&(r.start=o),r.end=c,!0}saveDiscontinuitySyncInfo_(e){const t=e.playlist,n=e.segment;if(n.discontinuity)this.discontinuities[n.timeline]={time:n.start,accuracy:0};else if(t.discontinuityStarts&&t.discontinuityStarts.length)for(let r=0;r<t.discontinuityStarts.length;r++){const s=t.discontinuityStarts[r],a=t.discontinuitySequence+r+1,o=s-e.mediaIndex,c=Math.abs(o);if(!this.discontinuities[a]||this.discontinuities[a].accuracy>c){let u;o<0?u=n.start-pl({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex,endIndex:s}):u=n.end+pl({defaultDuration:t.targetDuration,durationList:t.segments,startIndex:e.mediaIndex+1,endIndex:s}),this.discontinuities[a]={time:u,accuracy:c}}}}dispose(){this.trigger("dispose"),this.off()}}class QN extends fe.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:t,to:n}){return typeof t=="number"&&typeof n=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:t,to:n},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:t,to:n}){if(typeof t=="number"&&typeof n=="number"){this.lastTimelineChanges_[e]={type:e,from:t,to:n},delete this.pendingTimelineChanges_[e];const r={timelineChangeInfo:{from:t,to:n}};this.trigger({type:"timelinechange",metadata:r})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const ZN=U2(F2(function(){var i=function(){function p(){this.listeners={}}var f=p.prototype;return f.on=function(_,k){this.listeners[_]||(this.listeners[_]=[]),this.listeners[_].push(k)},f.off=function(_,k){if(!this.listeners[_])return!1;var D=this.listeners[_].indexOf(k);return this.listeners[_]=this.listeners[_].slice(0),this.listeners[_].splice(D,1),D>-1},f.trigger=function(_){var k=this.listeners[_];if(k)if(arguments.length===2)for(var D=k.length,E=0;E<D;++E)k[E].call(this,arguments[1]);else for(var A=Array.prototype.slice.call(arguments,1),w=k.length,N=0;N<w;++N)k[N].apply(this,A)},f.dispose=function(){this.listeners={}},f.pipe=function(_){this.on("data",function(k){_.push(k)})},p}();/*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */function e(p){return p.subarray(0,p.byteLength-p[p.byteLength-1])}/*! @name aes-decrypter @version 4.0.2 @license Apache-2.0 */const t=function(){const p=[[[],[],[],[],[]],[[],[],[],[],[]]],f=p[0],m=p[1],_=f[4],k=m[4];let D,E,A;const w=[],N=[];let S,P,F,V,J,ie;for(D=0;D<256;D++)N[(w[D]=D<<1^(D>>7)*283)^D]=D;for(E=A=0;!_[E];E^=S||1,A=N[A]||1)for(V=A^A<<1^A<<2^A<<3^A<<4,V=V>>8^V&255^99,_[E]=V,k[V]=E,F=w[P=w[S=w[E]]],ie=F*16843009^P*65537^S*257^E*16843008,J=w[V]*257^V*16843008,D=0;D<4;D++)f[D][E]=J=J<<24^J>>>8,m[D][V]=ie=ie<<24^ie>>>8;for(D=0;D<5;D++)f[D]=f[D].slice(0),m[D]=m[D].slice(0);return p};let n=null;class r{constructor(f){n||(n=t()),this._tables=[[n[0][0].slice(),n[0][1].slice(),n[0][2].slice(),n[0][3].slice(),n[0][4].slice()],[n[1][0].slice(),n[1][1].slice(),n[1][2].slice(),n[1][3].slice(),n[1][4].slice()]];let m,_,k;const D=this._tables[0][4],E=this._tables[1],A=f.length;let w=1;if(A!==4&&A!==6&&A!==8)throw new Error("Invalid aes key size");const N=f.slice(0),S=[];for(this._key=[N,S],m=A;m<4*A+28;m++)k=N[m-1],(m%A===0||A===8&&m%A===4)&&(k=D[k>>>24]<<24^D[k>>16&255]<<16^D[k>>8&255]<<8^D[k&255],m%A===0&&(k=k<<8^k>>>24^w<<24,w=w<<1^(w>>7)*283)),N[m]=N[m-A]^k;for(_=0;m;_++,m--)k=N[_&3?m:m-4],m<=4||_<4?S[_]=k:S[_]=E[0][D[k>>>24]]^E[1][D[k>>16&255]]^E[2][D[k>>8&255]]^E[3][D[k&255]]}decrypt(f,m,_,k,D,E){const A=this._key[1];let w=f^A[0],N=k^A[1],S=_^A[2],P=m^A[3],F,V,J;const ie=A.length/4-2;let X,H=4;const $=this._tables[1],j=$[0],B=$[1],q=$[2],z=$[3],oe=$[4];for(X=0;X<ie;X++)F=j[w>>>24]^B[N>>16&255]^q[S>>8&255]^z[P&255]^A[H],V=j[N>>>24]^B[S>>16&255]^q[P>>8&255]^z[w&255]^A[H+1],J=j[S>>>24]^B[P>>16&255]^q[w>>8&255]^z[N&255]^A[H+2],P=j[P>>>24]^B[w>>16&255]^q[N>>8&255]^z[S&255]^A[H+3],H+=4,w=F,N=V,S=J;for(X=0;X<4;X++)D[(3&-X)+E]=oe[w>>>24]<<24^oe[N>>16&255]<<16^oe[S>>8&255]<<8^oe[P&255]^A[H++],F=w,w=N,N=S,S=P,P=F}}class s extends i{constructor(){super(i),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(f){this.jobs.push(f),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const a=function(p){return p<<24|(p&65280)<<8|(p&16711680)>>8|p>>>24},o=function(p,f,m){const _=new Int32Array(p.buffer,p.byteOffset,p.byteLength>>2),k=new r(Array.prototype.slice.call(f)),D=new Uint8Array(p.byteLength),E=new Int32Array(D.buffer);let A,w,N,S,P,F,V,J,ie;for(A=m[0],w=m[1],N=m[2],S=m[3],ie=0;ie<_.length;ie+=4)P=a(_[ie]),F=a(_[ie+1]),V=a(_[ie+2]),J=a(_[ie+3]),k.decrypt(P,F,V,J,E,ie),E[ie]=a(E[ie]^A),E[ie+1]=a(E[ie+1]^w),E[ie+2]=a(E[ie+2]^N),E[ie+3]=a(E[ie+3]^S),A=P,w=F,N=V,S=J;return D};class c{constructor(f,m,_,k){const D=c.STEP,E=new Int32Array(f.buffer),A=new Uint8Array(f.byteLength);let w=0;for(this.asyncStream_=new s,this.asyncStream_.push(this.decryptChunk_(E.subarray(w,w+D),m,_,A)),w=D;w<E.length;w+=D)_=new Uint32Array([a(E[w-4]),a(E[w-3]),a(E[w-2]),a(E[w-1])]),this.asyncStream_.push(this.decryptChunk_(E.subarray(w,w+D),m,_,A));this.asyncStream_.push(function(){k(null,e(A))})}static get STEP(){return 32e3}decryptChunk_(f,m,_,k){return function(){const D=o(f,m,_);k.set(D,f.byteOffset)}}}var u=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},d;typeof window<"u"?d=window:typeof u<"u"?d=u:typeof self<"u"?d=self:d={};var h=d,b=function(f){return ArrayBuffer.isView==="function"?ArrayBuffer.isView(f):f&&f.buffer instanceof ArrayBuffer},v=h.BigInt||Number;v("0x1"),v("0x100"),v("0x10000"),v("0x1000000"),v("0x100000000"),v("0x10000000000"),v("0x1000000000000"),v("0x100000000000000"),v("0x10000000000000000"),function(){var p=new Uint16Array([65484]),f=new Uint8Array(p.buffer,p.byteOffset,p.byteLength);return f[0]===255?"big":f[0]===204?"little":"unknown"}();const y=function(p){const f={};return Object.keys(p).forEach(m=>{const _=p[m];b(_)?f[m]={bytes:_.buffer,byteOffset:_.byteOffset,byteLength:_.byteLength}:f[m]=_}),f};self.onmessage=function(p){const f=p.data,m=new Uint8Array(f.encrypted.bytes,f.encrypted.byteOffset,f.encrypted.byteLength),_=new Uint32Array(f.key.bytes,f.key.byteOffset,f.key.byteLength/4),k=new Uint32Array(f.iv.bytes,f.iv.byteOffset,f.iv.byteLength/4);new c(m,_,k,function(D,E){self.postMessage(y({source:f.source,decrypted:E}),[E.buffer])})}}));var eP=B2(ZN);const tP=i=>{let e=i.default?"main":"alternative";return i.characteristics&&i.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},f_=(i,e)=>{i.abort(),i.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},Xp=(i,e)=>{e.activePlaylistLoader=i,i.load()},nP=(i,e)=>()=>{const{segmentLoaders:{[i]:t,main:n},mediaTypes:{[i]:r}}=e,s=r.activeTrack(),a=r.getActiveGroup(),o=r.activePlaylistLoader,c=r.lastGroup_;if(!(a&&c&&a.id===c.id)&&(r.lastGroup_=a,r.lastTrack_=s,f_(t,r),!(!a||a.isMainPlaylist))){if(!a.playlistLoader){o&&n.resetEverything();return}t.resyncLoader(),Xp(a.playlistLoader,r)}},iP=(i,e)=>()=>{const{segmentLoaders:{[i]:t},mediaTypes:{[i]:n}}=e;n.lastGroup_=null,t.abort(),t.pause()},rP=(i,e)=>()=>{const{mainPlaylistLoader:t,segmentLoaders:{[i]:n,main:r},mediaTypes:{[i]:s}}=e,a=s.activeTrack(),o=s.getActiveGroup(),c=s.activePlaylistLoader,u=s.lastTrack_;if(!(u&&a&&u.id===a.id)&&(s.lastGroup_=o,s.lastTrack_=a,f_(n,s),!!o)){if(o.isMainPlaylist){if(!a||!u||a.id===u.id)return;const d=e.vhs.playlistController_,h=d.selectPlaylist();if(d.media()===h)return;s.logger_(`track change. Switching main audio from ${u.id} to ${a.id}`),t.pause(),r.resetEverything(),d.fastQualityChange_(h);return}if(i==="AUDIO"){if(!o.playlistLoader){r.setAudio(!0),r.resetEverything();return}n.setAudio(!0),r.setAudio(!1)}if(c===o.playlistLoader){Xp(o.playlistLoader,s);return}n.track&&n.track(a),n.resetEverything(),Xp(o.playlistLoader,s)}},qu={AUDIO:(i,e)=>()=>{const{mediaTypes:{[i]:t},excludePlaylist:n}=e,r=t.activeTrack(),s=t.activeGroup(),a=(s.filter(c=>c.default)[0]||s[0]).id,o=t.tracks[a];if(r===o){n({error:{message:"Problem encountered loading the default audio track."}});return}fe.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const c in t.tracks)t.tracks[c].enabled=t.tracks[c]===o;t.onTrackChanged()},SUBTITLES:(i,e)=>()=>{const{mediaTypes:{[i]:t}}=e;fe.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const n=t.activeTrack();n&&(n.mode="disabled"),t.onTrackChanged()}},p_={AUDIO:(i,e,t)=>{if(!e)return;const{tech:n,requestOptions:r,segmentLoaders:{[i]:s}}=t;e.on("loadedmetadata",()=>{const a=e.media();s.playlist(a,r),(!n.paused()||a.endList&&n.preload()!=="none")&&s.load()}),e.on("loadedplaylist",()=>{s.playlist(e.media(),r),n.paused()||s.load()}),e.on("error",qu[i](i,t))},SUBTITLES:(i,e,t)=>{const{tech:n,requestOptions:r,segmentLoaders:{[i]:s},mediaTypes:{[i]:a}}=t;e.on("loadedmetadata",()=>{const o=e.media();s.playlist(o,r),s.track(a.activeTrack()),(!n.paused()||o.endList&&n.preload()!=="none")&&s.load()}),e.on("loadedplaylist",()=>{s.playlist(e.media(),r),n.paused()||s.load()}),e.on("error",qu[i](i,t))}},sP={AUDIO:(i,e)=>{const{vhs:t,sourceType:n,segmentLoaders:{[i]:r},requestOptions:s,main:{mediaGroups:a},mediaTypes:{[i]:{groups:o,tracks:c,logger_:u}},mainPlaylistLoader:d}=e,h=ml(d.main);(!a[i]||Object.keys(a[i]).length===0)&&(a[i]={main:{default:{default:!0}}},h&&(a[i].main.default.playlists=d.main.playlists));for(const b in a[i]){o[b]||(o[b]=[]);for(const v in a[i][b]){let y=a[i][b][v],p;if(h?(u(`AUDIO group '${b}' label '${v}' is a main playlist`),y.isMainPlaylist=!0,p=null):n==="vhs-json"&&y.playlists?p=new Ga(y.playlists[0],t,s):y.resolvedUri?p=new Ga(y.resolvedUri,t,s):y.playlists&&n==="dash"?p=new Vp(y.playlists[0],t,s,d):p=null,y=Dt({id:v,playlistLoader:p},y),p_[i](i,y.playlistLoader,e),o[b].push(y),typeof c[v]>"u"){const f=new fe.AudioTrack({id:v,kind:tP(y),enabled:!1,language:y.language,default:y.default,label:v});c[v]=f}}}r.on("error",qu[i](i,e))},SUBTITLES:(i,e)=>{const{tech:t,vhs:n,sourceType:r,segmentLoaders:{[i]:s},requestOptions:a,main:{mediaGroups:o},mediaTypes:{[i]:{groups:c,tracks:u}},mainPlaylistLoader:d}=e;for(const h in o[i]){c[h]||(c[h]=[]);for(const b in o[i][h]){if(!n.options_.useForcedSubtitles&&o[i][h][b].forced)continue;let v=o[i][h][b],y;if(r==="hls")y=new Ga(v.resolvedUri,n,a);else if(r==="dash"){if(!v.playlists.filter(f=>f.excludeUntil!==1/0).length)return;y=new Vp(v.playlists[0],n,a,d)}else r==="vhs-json"&&(y=new Ga(v.playlists?v.playlists[0]:v.resolvedUri,n,a));if(v=Dt({id:b,playlistLoader:y},v),p_[i](i,v.playlistLoader,e),c[h].push(v),typeof u[b]>"u"){const p=t.addRemoteTextTrack({id:b,kind:"subtitles",default:v.default&&v.autoselect,language:v.language,label:b},!1).track;u[b]=p}}}s.on("error",qu[i](i,e))},"CLOSED-CAPTIONS":(i,e)=>{const{tech:t,main:{mediaGroups:n},mediaTypes:{[i]:{groups:r,tracks:s}}}=e;for(const a in n[i]){r[a]||(r[a]=[]);for(const o in n[i][a]){const c=n[i][a][o];if(!/^(?:CC|SERVICE)/.test(c.instreamId))continue;const u=t.options_.vhs&&t.options_.vhs.captionServices||{};let d={label:o,language:c.language,instreamId:c.instreamId,default:c.default&&c.autoselect};if(u[d.instreamId]&&(d=Dt(d,u[d.instreamId])),d.default===void 0&&delete d.default,r[a].push(Dt({id:o},c)),typeof s[o]>"u"){const h=t.addRemoteTextTrack({id:d.instreamId,kind:"captions",default:d.default,language:d.language,label:d.label},!1).track;s[o]=h}}}}},m_=(i,e)=>{for(let t=0;t<i.length;t++)if(Mp(e,i[t])||i[t].playlists&&m_(i[t].playlists,e))return!0;return!1},aP=(i,e)=>t=>{const{mainPlaylistLoader:n,mediaTypes:{[i]:{groups:r}}}=e,s=n.media();if(!s)return null;let a=null;s.attributes[i]&&(a=r[s.attributes[i]]);const o=Object.keys(r);if(!a)if(i==="AUDIO"&&o.length>1&&ml(e.main))for(let c=0;c<o.length;c++){const u=r[o[c]];if(m_(u,s)){a=u;break}}else r.main?a=r.main:o.length===1&&(a=r[o[0]]);return typeof t>"u"?a:t===null||!a?null:a.filter(c=>c.id===t.id)[0]||null},oP={AUDIO:(i,e)=>()=>{const{mediaTypes:{[i]:{tracks:t}}}=e;for(const n in t)if(t[n].enabled)return t[n];return null},SUBTITLES:(i,e)=>()=>{const{mediaTypes:{[i]:{tracks:t}}}=e;for(const n in t)if(t[n].mode==="showing"||t[n].mode==="hidden")return t[n];return null}},lP=(i,{mediaTypes:e})=>()=>{const t=e[i].activeTrack();return t?e[i].activeGroup(t):null},cP=i=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(u=>{sP[u](u,i)});const{mediaTypes:e,mainPlaylistLoader:t,tech:n,vhs:r,segmentLoaders:{["AUDIO"]:s,main:a}}=i;["AUDIO","SUBTITLES"].forEach(u=>{e[u].activeGroup=aP(u,i),e[u].activeTrack=oP[u](u,i),e[u].onGroupChanged=nP(u,i),e[u].onGroupChanging=iP(u,i),e[u].onTrackChanged=rP(u,i),e[u].getActiveGroup=lP(u,i)});const o=e.AUDIO.activeGroup();if(o){const u=(o.filter(h=>h.default)[0]||o[0]).id;e.AUDIO.tracks[u].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(a.setAudio(!1),s.setAudio(!0)):a.setAudio(!0)}t.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(u=>e[u].onGroupChanged())}),t.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(u=>e[u].onGroupChanging())});const c=()=>{e.AUDIO.onTrackChanged(),n.trigger({type:"usage",name:"vhs-audio-change"})};n.audioTracks().addEventListener("change",c),n.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),r.on("dispose",()=>{n.audioTracks().removeEventListener("change",c),n.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),n.clearTracks("audio");for(const u in e.AUDIO.tracks)n.audioTracks().addTrack(e.AUDIO.tracks[u])},uP=()=>{const i={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{i[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:Pr,activeTrack:Pr,getActiveGroup:Pr,onGroupChanged:Pr,onTrackChanged:Pr,lastTrack_:null,logger_:Ai(`MediaGroups[${e}]`)}}),i};class g_{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){e===1&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=ni(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(t=>[t.ID,t])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class dP extends fe.EventTarget{constructor(e,t){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new g_,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=Ai("Content Steering"),this.xhr_=e,this.getBandwidth_=t}assignTagProperties(e,t){this.manifestType_=t.serverUri?"HLS":"DASH";const n=t.serverUri||t.serverURL;if(!n){this.logger_(`steering manifest URL is ${n}, cannot request steering manifest.`),this.trigger("error");return}if(n.startsWith("data:")){this.decodeDataUriManifest_(n.substring(n.indexOf(",")+1));return}this.steeringManifest.reloadUri=ni(e,n),this.defaultPathway=t.pathwayId||t.defaultServiceLocation,this.queryBeforeStart=t.queryBeforeStart,this.proxyServerUrl_=t.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(e){const t=this.steeringManifest.reloadUri;if(!t)return;const n=e?t:this.getRequestURI(t);if(!n){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}const r={contentSteeringInfo:{uri:n}};this.trigger({type:"contentsteeringloadstart",metadata:r}),this.request_=this.xhr_({uri:n,requestType:"content-steering-manifest"},(s,a)=>{if(s){if(a.status===410){this.logger_(`manifest request 410 ${s}.`),this.logger_(`There will be no more content steering requests to ${n} this session.`),this.excludedSteeringManifestURLs.add(n);return}if(a.status===429){const u=a.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${s}.`),this.logger_(`content steering will retry in ${u} seconds.`),this.startTTLTimeout_(parseInt(u,10));return}this.logger_(`manifest failed to load ${s}.`),this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:r});let o;try{o=JSON.parse(this.request_.responseText)}catch(u){const d={errorType:fe.Error.StreamingContentSteeringParserError,error:u};this.trigger({type:"error",metadata:d})}this.assignSteeringProperties_(o);const c={contentSteeringInfo:r.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:c}),this.startTTLTimeout_()})}setProxyServerUrl_(e){const t=new te.URL(e),n=new te.URL(this.proxyServerUrl_);return n.searchParams.set("url",encodeURI(t.toString())),this.setSteeringParams_(n.toString())}decodeDataUriManifest_(e){const t=JSON.parse(te.atob(e));this.assignSteeringProperties_(t)}setSteeringParams_(e){const t=new te.URL(e),n=this.getPathway(),r=this.getBandwidth_();if(n){const s=`_${this.manifestType_}_pathway`;t.searchParams.set(s,n)}if(r){const s=`_${this.manifestType_}_throughput`;t.searchParams.set(s,r)}return t.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),this.trigger("error");return}this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const n=(r=>{for(const s of r)if(this.availablePathways_.has(s))return s;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==n&&(this.currentPathway=n,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const t=r=>this.excludedSteeringManifestURLs.has(r);if(this.proxyServerUrl_){const r=this.setProxyServerUrl_(e);if(!t(r))return r}const n=this.setSteeringParams_(e);return t(n)?null:n}startTTLTimeout_(e=this.steeringManifest.ttl){const t=e*1e3;this.ttlTimeout_=te.setTimeout(()=>{this.requestSteeringManifest()},t)}clearTTLTimeout_(){te.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new g_}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,t){return!t&&this.steeringManifest.reloadUri||t&&(ni(e,t.serverURL)!==this.steeringManifest.reloadUri||t.defaultServiceLocation!==this.defaultPathway||t.queryBeforeStart!==this.queryBeforeStart||t.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const hP=(i,e)=>{let t=null;return(...n)=>{clearTimeout(t),t=setTimeout(()=>{i.apply(null,n)},e)}},fP=10;let cs;const pP=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],mP=function(i){return this.audioSegmentLoader_[i]+this.mainSegmentLoader_[i]},gP=function({currentPlaylist:i,buffered:e,currentTime:t,nextPlaylist:n,bufferLowWaterLine:r,bufferHighWaterLine:s,duration:a,bufferBasedABR:o,log:c}){if(!n)return fe.log.warn("We received no playlist to switch to. Please check your stream."),!1;const u=`allowing switch ${i&&i.id||"null"} -> ${n.id}`;if(!i)return c(`${u} as current playlist is not set`),!0;if(n.id===i.id)return!1;const d=!!Ha(e,t).length;if(!i.endList)return!d&&typeof i.partTargetDuration=="number"?(c(`not ${u} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(c(`${u} as current playlist is live`),!0);const h=Ap(e,t),b=o?Tn.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Tn.MAX_BUFFER_LOW_WATER_LINE;if(a<b)return c(`${u} as duration < max low water line (${a} < ${b})`),!0;const v=n.attributes.BANDWIDTH,y=i.attributes.BANDWIDTH;if(v<y&&(!o||h<s)){let p=`${u} as next bandwidth < current bandwidth (${v} < ${y})`;return o&&(p+=` and forwardBuffer < bufferHighWaterLine (${h} < ${s})`),c(p),!0}if((!o||v>y)&&h>=r){let p=`${u} as forwardBuffer >= bufferLowWaterLine (${h} >= ${r})`;return o&&(p+=` and next bandwidth > current bandwidth (${v} > ${y})`),c(p),!0}return c(`not ${u} as no switching criteria met`),!1};class vP extends fe.EventTarget{constructor(e){super(),this.fastQualityChange_=hP(this.fastQualityChange_.bind(this),100);const{src:t,withCredentials:n,tech:r,bandwidth:s,externVhs:a,useCueTags:o,playlistExclusionDuration:c,enableLowInitialPlaylist:u,sourceType:d,cacheEncryptionKeys:h,bufferBasedABR:b,leastPixelDiffSelector:v,captionServices:y,experimentalUseMMS:p}=e;if(!t)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:f}=e;(f===null||typeof f>"u")&&(f=1/0),cs=a,this.bufferBasedABR=!!b,this.leastPixelDiffSelector=!!v,this.withCredentials=n,this.tech_=r,this.vhs_=r.vhs,this.player_=e.player_,this.sourceType_=d,this.useCueTags_=o,this.playlistExclusionDuration=c,this.maxPlaylistRetries=f,this.enableLowInitialPlaylist=u,this.usingManagedMediaSource_=!1,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:n,maxPlaylistRetries:f,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=uP(),p&&te.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new te.ManagedMediaSource,this.usingManagedMediaSource_=!0,fe.log("Using ManagedMediaSource")):te.MediaSource&&(this.mediaSource=new te.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.load=this.load.bind(this),this.pause=this.pause.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.mediaSource.addEventListener("startstreaming",this.load),this.mediaSource.addEventListener("endstreaming",this.pause),this.seekable_=kn(),this.hasPlayed_=!1,this.syncController_=new JN(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.segmentMetadataTrack_.mode="hidden",this.decrypter_=new eP,this.sourceUpdater_=new o_(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new QN,this.keyStatusMap_=new Map;const m={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:y,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:s,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:h,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new Vp(t,this.vhs_,Dt(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new Ga(t,this.vhs_,Dt(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new Gp(Dt(m,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new Gp(Dt(m,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new GN(Dt(m,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((D,E)=>{function A(){r.off("vttjserror",w),D()}function w(){r.off("vttjsloaded",A),E()}r.one("vttjsloaded",A),r.one("vttjserror",w),r.addWebVttScript_()})}),e);const _=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new dP(this.vhs_.xhr,_),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),pP.forEach(D=>{this[D+"_"]=mP.bind(this,D)}),this.logger_=Ai("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const k=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(k,()=>{const D=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-D,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),t=this.audioAppendsToLoadedData_();return e===-1||t===-1?-1:e+t}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const t=this.selectPlaylist();t&&this.shouldSwitchToMedia_(t)&&this.switchMedia_(t,e)}switchMedia_(e,t,n){const r=this.media(),s=r&&(r.id||r.uri),a=e&&(e.id||e.uri);if(s&&s!==a){this.logger_(`switch media ${s} -> ${a} from ${t}`);const o={renditionInfo:{id:a,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:t};this.trigger({type:"renditionselected",metadata:o}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${t}`})}this.mainPlaylistLoader_.media(e,n)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const t=this.mediaTypes_[e],n=t?t.activeGroup():null,r=this.contentSteeringController_.getPathway();if(n&&r){const a=(n.length?n[0].playlists:n.playlists).filter(o=>o.attributes.serviceLocation===r);a.length&&this.mediaTypes_[e].activePlaylistLoader.media(a[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=te.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(te.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),t=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return t;const n=e.mediaGroups.AUDIO,r=Object.keys(n);let s;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)s=this.mediaTypes_.AUDIO.activeTrack();else{const o=n.main||r.length&&n[r[0]];for(const c in o)if(o[c].default){s={label:c};break}}if(!s)return t;const a=[];for(const o in n)if(n[o][s.label]){const c=n[o][s.label];if(c.playlists&&c.playlists.length)a.push.apply(a,c.playlists);else if(c.uri)a.push(c);else if(e.playlists.length)for(let u=0;u<e.playlists.length;u++){const d=e.playlists[u];d.attributes&&d.attributes.AUDIO&&d.attributes.AUDIO===o&&a.push(d)}}return a.length?a:t}setupMainPlaylistLoaderListeners_(){this.mainPlaylistLoader_.on("loadedmetadata",()=>{const t=this.mainPlaylistLoader_.media(),n=t.targetDuration*1.5*1e3;Op(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=n,t.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.mainSegmentLoader_.load()),cP({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),t),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let t=this.mainPlaylistLoader_.media();if(!t){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let n;if(this.enableLowInitialPlaylist&&(n=this.selectInitialPlaylist()),n||(n=this.selectPlaylist()),!n||!this.shouldSwitchToMedia_(n)||(this.initialMedia_=n,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;t=this.initialMedia_}this.handleUpdatedMediaPlaylist(t)}),this.mainPlaylistLoader_.on("error",()=>{const t=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:t.playlist,error:t})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const t=this.mainPlaylistLoader_.media(),n=t.targetDuration*1.5*1e3;Op(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=n,this.sourceType_==="dash"&&this.mainPlaylistLoader_.isPaused&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(t,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const t=this.mainPlaylistLoader_.media();if(t.lastExcludeReason_==="playlist-unchanged")return;this.stuckAtPlaylistEnd_(t)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(t=>{this.mainPlaylistLoader_.on(t,n=>{this.player_.trigger(un({},n))})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,t){const n=e.mediaGroups||{};let r=!0;const s=Object.keys(n.AUDIO);for(const a in n.AUDIO)for(const o in n.AUDIO[a])n.AUDIO[a][o].uri||(r=!1);r&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(n.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),cs.Playlist.isAes(t)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),s.length&&Object.keys(n.AUDIO[s[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const t=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,n=this.tech_.currentTime(),r=this.bufferLowWaterLine(),s=this.bufferHighWaterLine(),a=this.tech_.buffered();return gP({buffered:a,currentTime:n,currentPlaylist:t,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:s,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const n=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:n.playlist,error:n})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{const n=this.audioSegmentLoader_.pendingSegment_;if(!n||!n.segment||!n.segment.syncInfo)return;const r=n.segment.syncInfo.end+.01;this.tech_.setCurrentTime(r)}),this.timelineChangeController_.on("fixBadTimelineChange",()=>{this.logger_("Fix bad timeline change. Restarting al segment loaders..."),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}),this.mainSegmentLoader_.on("earlyabort",n=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:fP}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const n=this.getCodecsOrExclude_();n&&this.sourceUpdater_.addOrChangeSourceBuffers(n)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(n=>{this.mainSegmentLoader_.on(n,r=>{this.player_.trigger(un({},r))}),this.audioSegmentLoader_.on(n,r=>{this.player_.trigger(un({},r))}),this.subtitleSegmentLoader_.on(n,r=>{this.player_.trigger(un({},r))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}pause(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}fastQualityChange_(e=this.selectPlaylist()){if(e&&e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime()<e.start(0))return this.tech_.setCurrentTime(e.end(e.length-1))}setupFirstPlay(){const e=this.mainPlaylistLoader_.media();if(!e||this.tech_.paused()||this.hasPlayed_)return!1;if(!e.endList||e.start){const t=this.seekable();if(!t.length)return!1;const n=t.end(0);let r=n;if(e.start){const s=e.start.timeOffset;s<0?r=Math.max(n+s,t.start(0)):r=Math.min(n,s)}this.trigger("firstplay"),this.tech_.setCurrentTime(r)}return this.hasPlayed_=!0,this.load(),!0}handleSourceOpen_(){if(this.tryToCreateSourceBuffers_(),this.tech_.autoplay()){const e=this.tech_.play();typeof e<"u"&&typeof e.then=="function"&&e.then(null,t=>{})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const t=this.duration();e[e.length-1].endTime=isNaN(t)||Math.abs(t)===1/0?Number.MAX_VALUE:t}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const t=this.mainSegmentLoader_.getCurrentMediaInfo_();!t||t.hasVideo?e=e&&this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const n=this.syncController_.getExpiredTime(e,this.duration());if(n===null)return!1;const r=cs.Playlist.playlistEnd(e,n),s=this.tech_.currentTime(),a=this.tech_.buffered();if(!a.length)return r-s<=ur;const o=a.end(a.length-1);return o-s<=ur&&r-o<=ur}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:t={},playlistExclusionDuration:n}){if(e=e||this.mainPlaylistLoader_.media(),n=n||t.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=t,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}e.playlistErrors_++;const r=this.mainPlaylistLoader_.main.playlists,s=r.filter(Vu),a=s.length===1&&s[0]===e;if(r.length===1&&n!==1/0)return fe.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(a);if(a){if(this.main().contentSteering){const y=this.pathwayAttribute_(e),p=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(y),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(y)},p);return}let v=!1;r.forEach(y=>{if(y===e)return;const p=y.excludeUntil;typeof p<"u"&&p!==1/0&&(v=!0,delete y.excludeUntil)}),v&&(fe.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let o;e.playlistErrors_>this.maxPlaylistRetries?o=1/0:o=Date.now()+n*1e3,e.excludeUntil=o,t.reason&&(e.lastExcludeReason_=t.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const c=this.selectPlaylist();if(!c){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const u=t.internal?this.logger_:fe.log.warn,d=t.message?" "+t.message:"";u(`${t.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${d} Switching to playlist ${c.id}.`),c.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),c.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const h=c.targetDuration/2*1e3||5*1e3,b=typeof c.lastRequest=="number"&&Date.now()-c.lastRequest<=h;return this.switchMedia_(c,"exclude",a||b)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,t){const n=[],r=e==="all";(r||e==="main")&&n.push(this.mainPlaylistLoader_);const s=[];(r||e==="audio")&&s.push("AUDIO"),(r||e==="subtitle")&&(s.push("CLOSED-CAPTIONS"),s.push("SUBTITLES")),s.forEach(a=>{const o=this.mediaTypes_[a]&&this.mediaTypes_[a].activePlaylistLoader;o&&n.push(o)}),["main","audio","subtitle"].forEach(a=>{const o=this[`${a}SegmentLoader_`];o&&(e===a||e==="all")&&n.push(o)}),n.forEach(a=>t.forEach(o=>{typeof a[o]=="function"&&a[o]()}))}setCurrentTime(e){const t=Ha(this.tech_.buffered(),e);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())||!this.mainPlaylistLoader_.media().segments)return 0;if(t&&t.length)return e;this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:cs.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}getSeekableRange_(e,t){const n=e.media();if(!n)return null;const r=this.syncController_.getMediaSequenceSync(t);if(r&&r.isReliable){const o=r.start,c=r.end;if(!isFinite(o)||!isFinite(c))return null;const u=cs.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,n),d=Math.max(o,c-u);return kn([[o,d]])}const s=this.syncController_.getExpiredTime(n,this.duration());if(s===null)return null;const a=cs.Playlist.seekable(n,s,cs.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,n));return a.length?a:null}computeFinalSeekable_(e,t){if(!t)return e;const n=e.start(0),r=e.end(0),s=t.start(0),a=t.end(0);return s>r||n>a?e:kn([[Math.max(n,s),Math.min(r,a)]])}onSyncInfoUpdate_(){if(!this.mainPlaylistLoader_)return;const e=this.getSeekableRange_(this.mainPlaylistLoader_,"main");if(!e)return;let t;if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(t=this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader,"audio"),!t))return;const n=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(e,t),!this.seekable_||n&&n.length&&this.seekable_.length&&n.start(0)===this.seekable_.start(0)&&n.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${s2(this.seekable_)}]`);const r={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:r}),this.tech_.trigger("seekablechanged")}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,e),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(e){const r=this.seekable();if(!r.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration<r.end(r.length-1))&&this.sourceUpdater_.setDuration(r.end(r.length-1));return}const t=this.tech_.buffered();let n=cs.Playlist.duration(this.mainPlaylistLoader_.media());t.length>0&&(n=Math.max(n,t.end(t.length-1))),this.mediaSource.duration!==n&&this.sourceUpdater_.setDuration(n)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const t=this.mediaTypes_[e].groups;for(const n in t)t[n].forEach(r=>{r.playlistLoader&&r.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,t=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),n=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!t||!n)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},t=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const n=vl(this.main(),t),r={},s=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=n.video||e.main.videoCodec||d6),e.main.isMuxed&&(r.video+=`,${n.audio||e.main.audioCodec||Ry}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||s)&&(r.audio=n.audio||e.main.audioCodec||e.audio.audioCodec||Ry,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!r.audio&&!r.video){this.excludePlaylist({playlistToExclude:t,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}const a=(u,d)=>u?Xo(d,this.usingManagedMediaSource_):bf(d),o={};let c;if(["video","audio"].forEach(function(u){if(r.hasOwnProperty(u)&&!a(e[u].isFmp4,r[u])){const d=e[u].isFmp4?"browser":"muxer";o[d]=o[d]||[],o[d].push(r[u]),u==="audio"&&(c=d)}}),s&&c&&t.attributes.AUDIO){const u=t.attributes.AUDIO;this.main().playlists.forEach(d=>{(d.attributes&&d.attributes.AUDIO)===u&&d!==t&&(d.excludeUntil=1/0)}),this.logger_(`excluding audio group ${u} as ${c} does not support codec(s): "${r.audio}"`)}if(Object.keys(o).length){const u=Object.keys(o).reduce((d,h)=>(d&&(d+=", "),d+=`${h} does not support codec(s): "${o[h].join(",")}"`,d),"")+".";this.excludePlaylist({playlistToExclude:t,error:{internal:!0,message:u},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const u=[];if(["video","audio"].forEach(d=>{const h=(ir(this.sourceUpdater_.codecs[d]||"")[0]||{}).type,b=(ir(r[d]||"")[0]||{}).type;h&&b&&h.toLowerCase()!==b.toLowerCase()&&u.push(`"${this.sourceUpdater_.codecs[d]}" -> "${r[d]}"`)}),u.length){this.excludePlaylist({playlistToExclude:t,error:{message:`Codec switching not supported: ${u.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return r}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const t=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(t)}excludeUnsupportedVariants_(){const e=this.main().playlists,t=[];Object.keys(e).forEach(n=>{const r=e[n];if(t.indexOf(r.id)!==-1)return;t.push(r.id);const s=vl(this.main,r),a=[];s.audio&&!bf(s.audio)&&!Xo(s.audio,this.usingManagedMediaSource_)&&a.push(`audio codec ${s.audio}`),s.video&&!bf(s.video)&&!Xo(s.video,this.usingManagedMediaSource_)&&a.push(`video codec ${s.video}`),s.text&&s.text==="stpp.ttml.im1t"&&a.push(`text codec ${s.text}`),a.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${a.join(", ")}`))})}excludeIncompatibleVariants_(e){const t=[],n=this.main().playlists,r=gl(ir(e)),s=S2(r),a=r.video&&ir(r.video)[0]||null,o=r.audio&&ir(r.audio)[0]||null;Object.keys(n).forEach(c=>{const u=n[c];if(t.indexOf(u.id)!==-1||u.excludeUntil===1/0)return;t.push(u.id);const d=[],h=vl(this.mainPlaylistLoader_.main,u),b=S2(h);if(!(!h.audio&&!h.video)){if(b!==s&&d.push(`codec count "${b}" !== "${s}"`),!this.sourceUpdater_.canChangeType()){const v=h.video&&ir(h.video)[0]||null,y=h.audio&&ir(h.audio)[0]||null;v&&a&&v.type.toLowerCase()!==a.type.toLowerCase()&&d.push(`video codec "${v.type}" !== "${a.type}"`),y&&o&&y.type.toLowerCase()!==o.type.toLowerCase()&&d.push(`audio codec "${y.type}" !== "${o.type}"`)}d.length&&(u.excludeUntil=1/0,this.logger_(`excluding ${u.id}: ${d.join(" && ")}`))}})}updateAdCues_(e){let t=0;const n=this.seekable();n.length&&(t=n.start(0)),KN(e,this.cueTagsTrack_,t)}goalBufferLength(){const e=this.tech_.currentTime(),t=Tn.GOAL_BUFFER_LENGTH,n=Tn.GOAL_BUFFER_LENGTH_RATE,r=Math.max(t,Tn.MAX_GOAL_BUFFER_LENGTH);return Math.min(t+e*n,r)}bufferLowWaterLine(){const e=this.tech_.currentTime(),t=Tn.BUFFER_LOW_WATER_LINE,n=Tn.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(t,Tn.MAX_BUFFER_LOW_WATER_LINE),s=Math.max(t,Tn.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(t+e*n,this.bufferBasedABR?s:r)}bufferHighWaterLine(){return Tn.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){e_(this.inbandTextTracks_,"com.apple.streaming",this.tech_),wN({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,t,n){const r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();e_(this.inbandTextTracks_,e,this.tech_),CN({inbandTextTracks:this.inbandTextTracks_,metadataArray:t,timestampOffset:r,videoDuration:n})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const t of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(t));if(this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(!0);return}this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(t=>{this.contentSteeringController_.on(t,n=>{this.trigger(un({},n))})}),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const t=this.main();(this.contentSteeringController_.didDASHTagChange(t.uri,t.contentSteering)||(()=>{const s=this.contentSteeringController_.getAvailablePathways(),a=[];for(const o of t.playlists){const c=o.attributes.serviceLocation;if(c&&(a.push(c),!s.has(c)))return!0}return!!(!a.length&&s.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const n=this.main().playlists,r=new Set;let s=!1;Object.keys(n).forEach(a=>{const o=n[a],c=this.pathwayAttribute_(o),u=c&&e!==c;o.excludeUntil===1/0&&o.lastExcludeReason_==="content-steering"&&!u&&(delete o.excludeUntil,delete o.lastExcludeReason_,s=!0);const h=!o.excludeUntil&&o.excludeUntil!==1/0;!r.has(o.id)&&u&&h&&(r.add(o.id),o.excludeUntil=1/0,o.lastExcludeReason_="content-steering",this.logger_(`excluding ${o.id} for ${o.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(a=>{const o=this.mediaTypes_[a];if(o.activePlaylistLoader){const c=o.activePlaylistLoader.media_;c&&c.attributes.serviceLocation!==e&&(s=!0)}}),s&&this.changeSegmentPathway_()}handlePathwayClones_(){const t=this.main().playlists,n=this.contentSteeringController_.currentPathwayClones,r=this.contentSteeringController_.nextPathwayClones;if(n&&n.size||r&&r.size){for(const[a,o]of n.entries())r.get(a)||(this.mainPlaylistLoader_.updateOrDeleteClone(o),this.contentSteeringController_.excludePathway(a));for(const[a,o]of r.entries()){const c=n.get(a);if(!c){t.filter(d=>d.attributes["PATHWAY-ID"]===o["BASE-ID"]).forEach(d=>{this.mainPlaylistLoader_.addClonePathway(o,d)}),this.contentSteeringController_.addAvailablePathway(a);continue}this.equalPathwayClones_(c,o)||(this.mainPlaylistLoader_.updateOrDeleteClone(o,!0),this.contentSteeringController_.addAvailablePathway(a))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...r])))}}equalPathwayClones_(e,t){if(e["BASE-ID"]!==t["BASE-ID"]||e.ID!==t.ID||e["URI-REPLACEMENT"].HOST!==t["URI-REPLACEMENT"].HOST)return!1;const n=e["URI-REPLACEMENT"].PARAMS,r=t["URI-REPLACEMENT"].PARAMS;for(const s in n)if(n[s]!==r[s])return!1;for(const s in r)if(n[s]!==r[s])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const t="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(n=>{const r=this.mainPlaylistLoader_.getKeyIdSet(n);!r||!r.size||r.forEach(s=>{const a="usable",o=this.keyStatusMap_.has(s)&&this.keyStatusMap_.get(s)===a,c=n.lastExcludeReason_===t&&n.excludeUntil===1/0;o?o&&c&&(delete n.excludeUntil,delete n.lastExcludeReason_,this.logger_(`enabling playlist ${n.id} because key ID ${s} is ${a}`)):(n.excludeUntil!==1/0&&n.lastExcludeReason_!==t&&(n.excludeUntil=1/0,n.lastExcludeReason_=t,this.logger_(`excluding playlist ${n.id} because the key ID ${s} doesn't exist in the keyStatusMap or is not ${a}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(n=>{const r=n&&n.attributes&&n.attributes.RESOLUTION&&n.attributes.RESOLUTION.height<720,s=n.excludeUntil===1/0&&n.lastExcludeReason_===t;r&&s&&(delete n.excludeUntil,fe.log.warn(`enabling non-HD playlist ${n.id} because all playlists were excluded due to ${t} key IDs`))})}addKeyStatus_(e,t){const s=(typeof e=="string"?e:qN(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${t}' with key ID ${s} added to the keyStatusMap`),this.keyStatusMap_.set(s,t)}updatePlaylistByKeyStatus(e,t){this.addKeyStatus_(e,t),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const yP=(i,e,t)=>n=>{const r=i.main.playlists[e],s=Pp(r),a=Vu(r);if(typeof n>"u")return a;n?delete r.disabled:r.disabled=!0;const o={renditionInfo:{id:e,bandwidth:r.attributes.BANDWIDTH,resolution:r.attributes.RESOLUTION,codecs:r.attributes.CODECS},cause:"fast-quality"};return n!==a&&!s&&(n?(t(r),i.trigger({type:"renditionenabled",metadata:o})):i.trigger({type:"renditiondisabled",metadata:o})),n};class bP{constructor(e,t,n){const{playlistController_:r}=e,s=r.fastQualityChange_.bind(r);if(t.attributes){const a=t.attributes.RESOLUTION;this.width=a&&a.width,this.height=a&&a.height,this.bandwidth=t.attributes.BANDWIDTH,this.frameRate=t.attributes["FRAME-RATE"]}this.codecs=vl(r.main(),t),this.playlist=t,this.id=n,this.enabled=yP(e.playlists,t.id,s)}}const _P=function(i){i.representations=()=>{const e=i.playlistController_.main(),t=ml(e)?i.playlistController_.getAudioTrackPlaylists_():e.playlists;return t?t.filter(n=>!Pp(n)).map((n,r)=>new bP(i,n,n.id)):[]}},v_=["seeking","seeked","pause","playing","error"];class kP extends fe.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=Ai("PlaybackWatcher"),this.logger_("initialize");const t=()=>this.monitorCurrentTime_(),n=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),s=()=>this.resetTimeUpdate_(),a=this.playlistController_,o=["main","subtitle","audio"],c={};o.forEach(d=>{c[d]={reset:()=>this.resetSegmentDownloads_(d),updateend:()=>this.checkSegmentDownloads_(d)},a[`${d}SegmentLoader_`].on("appendsdone",c[d].updateend),a[`${d}SegmentLoader_`].on("playlistupdate",c[d].reset),this.tech_.on(["seeked","seeking"],c[d].reset)});const u=d=>{["main","audio"].forEach(h=>{a[`${h}SegmentLoader_`][d]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),u("off"))},this.clearSeekingAppendCheck_=()=>u("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),u("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(v_,s),this.tech_.on("canplay",n),this.tech_.one("play",t),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",r),this.tech_.off(v_,s),this.tech_.off("canplay",n),this.tech_.off("play",t),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),o.forEach(d=>{a[`${d}SegmentLoader_`].off("appendsdone",c[d].updateend),a[`${d}SegmentLoader_`].off("playlistupdate",c[d].reset),this.tech_.off(["seeked","seeking"],c[d].reset)}),this.checkCurrentTimeTimeout_&&te.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&te.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=te.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const t=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=t.buffered_()}checkSegmentDownloads_(e){const t=this.playlistController_,n=t[`${e}SegmentLoader_`],r=n.buffered_(),s=cI(this[`${e}Buffered_`],r);if(this[`${e}Buffered_`]=r,s){const a={bufferedRanges:r};t.trigger({type:"bufferedrangeschanged",metadata:a}),this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:n.playlist_&&n.playlist_.id,buffered:Hs(r)}),!(this[`${e}StalledDownloads_`]<10)&&(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),e!=="subtitle"&&t.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),t=this.tech_.buffered();if(this.lastRecordedTime===e&&(!t.length||e+ur>=t.end(t.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(kn([this.lastRecordedTime,e]));const n={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:n}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const t=this.seekable(),n=this.tech_.currentTime(),r=this.afterSeekableWindow_(t,n,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let s;if(r&&(s=t.end(t.length-1)),this.beforeSeekableWindow_(t,n)){const y=t.start(0);s=y+(y===t.end(0)?0:ur)}if(typeof s<"u")return this.logger_(`Trying to seek outside of seekable at time ${n} with seekable range ${s2(t)}. Seeking to ${s}.`),this.tech_.setCurrentTime(s),!0;const a=this.playlistController_.sourceUpdater_,o=this.tech_.buffered(),c=a.audioBuffer?a.audioBuffered():null,u=a.videoBuffer?a.videoBuffered():null,d=this.media(),h=d.partTargetDuration?d.partTargetDuration:(d.targetDuration-cr)*2,b=[c,u];for(let y=0;y<b.length;y++){if(!b[y])continue;if(Ap(b[y],n)<h)return!1}const v=Fu(o,n);return v.length===0?!1:(s=v.start(0)+ur,this.logger_(`Buffered region starts (${v.start(0)}) just beyond seek point (${n}). Seeking to ${s}.`),this.tech_.setCurrentTime(s),!0)}waiting_(){if(this.techWaiting_())return;const e=this.tech_.currentTime(),t=this.tech_.buffered(),n=Ha(t,e);if(n.length&&e+3<=n.end(0)){this.resetTimeUpdate_(),this.tech_.setCurrentTime(e),this.logger_(`Stopped at ${e} while inside a buffered region [${n.start(0)} -> ${n.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const e=this.seekable(),t=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,t)){const o=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${t}. Seeking to live point (seekable end) ${o}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(o),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const n=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:n.audioBuffered(),videoBuffered:n.videoBuffered(),currentTime:t}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(t),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const a=Fu(r,t);return a.length>0?(this.logger_(`Stopped at ${t} and seeking to ${a.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(t),!0):!1}afterSeekableWindow_(e,t,n,r=!1){if(!e.length)return!1;let s=e.end(e.length-1)+ur;const a=!n.endList,o=typeof n.partTargetDuration=="number";return a&&(o||r)&&(s=e.end(e.length-1)+n.targetDuration*3),t>s}beforeSeekableWindow_(e,t){return!!(e.length&&e.start(0)>0&&t<e.start(0)-this.liveRangeSafeTimeDelta)}videoUnderflow_({videoBuffered:e,audioBuffered:t,currentTime:n}){if(!e)return;let r;if(e.length&&t.length){const s=Ha(e,n-3),a=Ha(e,n),o=Ha(t,n);o.length&&!a.length&&s.length&&(r={start:s.end(0),end:o.end(0)})}else Fu(e,n).length||(r=this.gapFromVideoUnderflow_(e,n));return r?(this.logger_(`Encountered a gap in video from ${r.start} to ${r.end}. Seeking to current time ${n}`),!0):!1}skipTheGap_(e){const t=this.tech_.buffered(),n=this.tech_.currentTime(),r=Fu(t,n);if(this.resetTimeUpdate_(),r.length===0||n!==e)return;this.logger_("skipTheGap_:","currentTime:",n,"scheduled currentTime:",e,"nextRange start:",r.start(0)),this.tech_.setCurrentTime(r.start(0)+cr);const s={gapInfo:{from:n,to:r.start(0)}};this.playlistController_.trigger({type:"gapjumped",metadata:s}),this.tech_.trigger({type:"usage",name:"vhs-gap-skip"})}gapFromVideoUnderflow_(e,t){const n=aI(e);for(let r=0;r<n.length;r++){const s=n.start(r),a=n.end(r);if(t-s<4&&t-s>2)return{start:s,end:a}}return null}}const TP={errorInterval:30,getSource(i){const t=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return i(t)}},y_=function(i,e){let t=0,n=0;const r=Dt(TP,e);i.ready(()=>{i.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const s=function(){n&&i.currentTime(n)},a=function(d){d!=null&&(n=i.duration()!==1/0&&i.currentTime()||0,i.one("loadedmetadata",s),i.src(d),i.trigger({type:"usage",name:"vhs-error-reload"}),i.play())},o=function(){if(Date.now()-t<r.errorInterval*1e3){i.trigger({type:"usage",name:"vhs-error-reload-canceled"});return}if(!r.getSource||typeof r.getSource!="function"){fe.log.error("ERROR: reloadSourceOnError - The option getSource must be a function!");return}return t=Date.now(),r.getSource.call(i,a)},c=function(){i.off("loadedmetadata",s),i.off("error",o),i.off("dispose",c)},u=function(d){c(),y_(i,d)};i.on("error",o),i.on("dispose",c),i.reloadSourceOnError=u},SP=function(i){y_(this,i)};var b_="3.17.0",CP="7.1.0",xP="1.3.1",EP="7.2.0",wP="4.0.2";const en={PlaylistLoader:Ga,Playlist:ii,utils:OI,STANDARD_PLAYLIST_SELECTOR:Q2,INITIAL_PLAYLIST_SELECTOR:bN,lastBandwidthSelector:Q2,movingAverageBandwidthSelector:vN,comparePlaylistBandwidth:qp,comparePlaylistResolution:gN,xhr:D2()};Object.keys(Tn).forEach(i=>{Object.defineProperty(en,i,{get(){return fe.log.warn(`using Vhs.${i} is UNSAFE be sure you know what you are doing`),Tn[i]},set(e){if(fe.log.warn(`using Vhs.${i} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){fe.log.warn(`value of Vhs.${i} must be greater than or equal to 0`);return}Tn[i]=e}})});const __="videojs-vhs",k_=function(i,e){const t=e.media();let n=-1;for(let r=0;r<i.length;r++)if(i[r].id===t.id){n=r;break}i.selectedIndex_=n,i.trigger({selectedIndex:n,type:"change"})},DP=function(i,e){e.representations().forEach(t=>{i.addQualityLevel(t)}),k_(i,e.playlists)};en.canPlaySource=function(){return fe.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const AP=(i,e,t)=>{if(!i)return i;let n={};e&&e.attributes&&e.attributes.CODECS&&(n=gl(ir(e.attributes.CODECS))),t&&t.attributes&&t.attributes.CODECS&&(n.audio=t.attributes.CODECS);const r=ka(n.video),s=ka(n.audio),a={};for(const o in i)a[o]={},s&&(a[o].audioContentType=s),r&&(a[o].videoContentType=r),e.contentProtection&&e.contentProtection[o]&&e.contentProtection[o].pssh&&(a[o].pssh=e.contentProtection[o].pssh),typeof i[o]=="string"&&(a[o].url=i[o]);return Dt(i,a)},IP=(i,e)=>i.reduce((t,n)=>{if(!n.contentProtection)return t;const r=e.reduce((s,a)=>{const o=n.contentProtection[a];return o&&o.pssh&&(s[a]={pssh:o.pssh}),s},{});return Object.keys(r).length&&t.push(r),t},[]),NP=({player:i,sourceKeySystems:e,audioMedia:t,mainPlaylists:n})=>{if(!i.eme.initializeMediaKeys)return Promise.resolve();const r=t?n.concat([t]):n,s=IP(r,Object.keys(e)),a=[],o=[];return s.forEach(c=>{o.push(new Promise((u,d)=>{i.tech_.one("keysessioncreated",u)})),a.push(new Promise((u,d)=>{i.eme.initializeMediaKeys({keySystems:c},h=>{if(h){d(h);return}u()})}))}),Promise.race([Promise.all(a),Promise.race(o)])},PP=({player:i,sourceKeySystems:e,media:t,audioMedia:n})=>{const r=AP(e,t,n);return r?(i.currentSource().keySystems=r,r&&!i.eme?(fe.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},T_=()=>{if(!te.localStorage)return null;const i=te.localStorage.getItem(__);if(!i)return null;try{return JSON.parse(i)}catch{return null}},OP=i=>{if(!te.localStorage)return!1;let e=T_();e=e?Dt(e,i):i;try{te.localStorage.setItem(__,JSON.stringify(e))}catch{return!1}return e},MP=i=>i.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(i.substring(i.indexOf(",")+1)):i,S_=(i,e)=>{i._requestCallbackSet||(i._requestCallbackSet=new Set),i._requestCallbackSet.add(e)},C_=(i,e)=>{i._responseCallbackSet||(i._responseCallbackSet=new Set),i._responseCallbackSet.add(e)},x_=(i,e)=>{i._requestCallbackSet&&(i._requestCallbackSet.delete(e),i._requestCallbackSet.size||delete i._requestCallbackSet)},E_=(i,e)=>{i._responseCallbackSet&&(i._responseCallbackSet.delete(e),i._responseCallbackSet.size||delete i._responseCallbackSet)};en.supportsNativeHls=function(){if(!Fe||!Fe.createElement)return!1;const i=Fe.createElement("video");return fe.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(t){return/maybe|probably/i.test(i.canPlayType(t))}):!1}(),en.supportsNativeDash=function(){return!Fe||!Fe.createElement||!fe.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(Fe.createElement("video").canPlayType("application/dash+xml"))}(),en.supportsTypeNatively=i=>i==="hls"?en.supportsNativeHls:i==="dash"?en.supportsNativeDash:!1,en.isSupported=function(){return fe.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},en.xhr.onRequest=function(i){S_(en.xhr,i)},en.xhr.onResponse=function(i){C_(en.xhr,i)},en.xhr.offRequest=function(i){x_(en.xhr,i)},en.xhr.offResponse=function(i){E_(en.xhr,i)};const RP=fe.getComponent("Component");class w_ extends RP{constructor(e,t,n){if(super(t,n.vhs),typeof n.initialBandwidth=="number"&&(this.options_.bandwidth=n.initialBandwidth),this.logger_=Ai("VhsHandler"),t.options_&&t.options_.playerId){const r=fe.getPlayer(t.options_.playerId);this.player_=r}if(this.tech_=t,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&t.overrideNativeAudioTracks&&t.overrideNativeVideoTracks)t.overrideNativeAudioTracks(!0),t.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(t.featuresNativeVideoTracks||t.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(Fe,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],r=>{const s=Fe.fullscreenElement||Fe.webkitFullscreenElement||Fe.mozFullScreenElement||Fe.msFullscreenElement;s&&s.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=Dt(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.usePlayerObjectFit=this.options_.usePlayerObjectFit||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=typeof this.options_.useNetworkInformationApi<"u"?this.options_.useNetworkInformationApi:!0,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const n=T_();n&&n.bandwidth&&(this.options_.bandwidth=n.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),n&&n.throughput&&(this.options_.throughput=n.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=Tn.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Tn.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","usePlayerObjectFit","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(n=>{typeof this.source_[n]<"u"&&(this.options_[n]=this.source_[n])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio,this.usePlayerObjectFit=this.options_.usePlayerObjectFit;const t=this.options_.customPixelRatio;typeof t=="number"&&t>=0&&(this.customPixelRatio=t)}setOptions(e={}){this.setOptions_(e)}src(e,t){if(!e)return;this.setOptions_(),this.options_.src=MP(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=en,this.options_.sourceType=Ly(t),this.options_.seekTo=s=>{this.tech_.setCurrentTime(s)},this.options_.player_=this.player_,this.playlistController_=new vP(this.options_);const n=Dt({liveRangeSafeTimeDelta:ur},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new kP(n),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const s=fe.players[this.tech_.options_.playerId];let a=this.playlistController_.error;typeof a=="object"&&!a.code?a.code=3:typeof a=="string"&&(a={message:a,code:3}),s.error(a)});const r=this.options_.bufferBasedABR?en.movingAverageBandwidthSelector(.55):en.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=en.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(s){this.playlistController_.selectPlaylist=s.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(s){this.playlistController_.mainSegmentLoader_.throughput.rate=s,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let s=this.playlistController_.mainSegmentLoader_.bandwidth;const a=te.navigator.connection||te.navigator.mozConnection||te.navigator.webkitConnection,o=1e7;if(this.options_.useNetworkInformationApi&&a){const c=a.downlink*1e3*1e3;c>=o&&s>=o?s=Math.max(s,c):s=c}return s},set(s){this.playlistController_.mainSegmentLoader_.bandwidth=s,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const s=1/(this.bandwidth||1);let a;return this.throughput>0?a=1/this.throughput:a=0,Math.floor(1/(s+a))},set(){fe.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>Hs(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>Hs(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&OP({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{_P(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=te.URL.createObjectURL(this.playlistController_.mediaSource),(fe.browser.IS_ANY_SAFARI||fe.browser.IS_IOS)&&this.options_.overrideNative&&this.options_.sourceType==="hls"&&typeof this.tech_.addSourceElement=="function"?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),NP({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(t=>{this.logger_("error while creating EME key session",t),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,t=PP({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",n=>{this.playlistController_.updatePlaylistByKeyStatus(n.keyId,n.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!t){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const e=fe.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{DP(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{k_(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":b_,"mux.js":CP,"mpd-parser":xP,"m3u8-parser":EP,"aes-decrypter":wP}}version(){return this.constructor.version()}canChangeType(){return o_.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&te.URL.revokeObjectURL&&(te.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,t){return VI({playlist:this.playlistController_.media(),time:e,callback:t})}seekToProgramTime(e,t,n=!0,r=2){return O2({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:n,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:t})}setupXhrHooks_(){this.xhr.onRequest=e=>{S_(this.xhr,e)},this.xhr.onResponse=e=>{C_(this.xhr,e)},this.xhr.offRequest=e=>{x_(this.xhr,e)},this.xhr.offResponse=e=>{E_(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const e=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"],t=["gapjumped","playedrangeschanged"];e.forEach(n=>{this.playlistController_.on(n,r=>{this.player_.trigger(un({},r))})}),t.forEach(n=>{this.playbackWatcher_.on(n,r=>{this.player_.trigger(un({},r))})})}}const zu={name:"videojs-http-streaming",VERSION:b_,canHandleSource(i,e={}){const t=Dt(fe.options,e);return!t.vhs.experimentalUseMMS&&!Xo("avc1.4d400d,mp4a.40.2",!1)?!1:zu.canPlayType(i.type,t)},handleSource(i,e,t={}){const n=Dt(fe.options,t);return e.vhs=new w_(i,e,n),e.vhs.xhr=D2(),e.vhs.setupXhrHooks_(),e.vhs.src(i.src,i.type),e.vhs},canPlayType(i,e){const t=Ly(i);if(!t)return"";const n=zu.getOverrideNative(e);return!en.supportsTypeNatively(t)||n?"maybe":""},getOverrideNative(i={}){const{vhs:e={}}=i,t=!(fe.browser.IS_ANY_SAFARI||fe.browser.IS_IOS),{overrideNative:n=t}=e;return n}};Xo("avc1.4d400d,mp4a.40.2",!0)&&fe.getTech("Html5").registerSourceHandler(zu,0),fe.VhsHandler=w_,fe.VhsSourceHandler=zu,fe.Vhs=en,fe.use||fe.registerComponent("Vhs",en),fe.options.vhs=fe.options.vhs||{},(!fe.getPlugin||!fe.getPlugin("reloadSourceOnError"))&&fe.registerPlugin("reloadSourceOnError",SP);class LP{constructor(){this.isInitialized=!1,this.pollingInterval=null,this.currentPollingIndex=0,this.pollingParticipants=[],this.ctx=null,this.pollingDisabled=!1,this.voiceActivatedIdentity=null,this.voiceActivatedParticipant=null}init(e){this.isInitialized||(this.ctx=Object.assign({getParticipants:()=>[],getCurrentLayout:()=>"grid",getCurrentRoomMode:()=>"normal",pollingIntervalMs:null},e||{}),this.isInitialized=!0,this._setupMittListeners())}destroy(){this.stopScreenPolling(),this.isInitialized=!1,this.ctx=null}getMaxVisibleParticipantsByLayout(){var n,r,s,a;const e=((r=(n=this.ctx)==null?void 0:n.getCurrentLayout)==null?void 0:r.call(n))||"grid";return(((a=(s=this.ctx)==null?void 0:s.getCurrentRoomMode)==null?void 0:a.call(s))||"normal")==="pointTurn"?10:e==="rightSide"?5:e==="grid"?16:4}shouldStartPolling(){var s,a,o,c,u,d,h;const e=((a=(s=this.ctx)==null?void 0:s.getParticipants)==null?void 0:a.call(s))||[],t=((c=(o=this.ctx)==null?void 0:o.getCurrentLayout)==null?void 0:c.call(o))||"grid",n=((d=(u=this.ctx)==null?void 0:u.getCurrentRoomMode)==null?void 0:d.call(u))||"normal",r=(h=this.ctx)==null?void 0:h.pollingIntervalMs;return this.pollingDisabled||!r||r<=0?!1:n==="pointTurn"?e.length>11:t==="rightSide"?e.length>5:e.length>4}adjustPollingState(){if(!this.isInitialized)return;if(this.pollingDisabled){this.stopScreenPolling();return}const e=this.shouldStartPolling(),t=!!this.pollingInterval;e&&!t?this.startScreenPolling():!e&&t&&this.stopScreenPolling()}startScreenPolling(){if(!this.isInitialized||this.pollingInterval||!this.shouldStartPolling())return;this.currentPollingIndex=0,this.pollingParticipants=[];const e=this.ctx.pollingIntervalMs;if(!e||e<=0){console.warn("轮询间隔未设置或无效,无法启动轮询");return}this.executeScreenPolling(),this.pollingInterval=setInterval(()=>{this.executeScreenPolling()},e),setTimeout(()=>{this.pollingInterval&&this.executeScreenPolling()},100)}stopScreenPolling(){this.pollingInterval&&(clearInterval(this.pollingInterval),this.pollingInterval=null),this.currentPollingIndex=0,this.pollingParticipants=[]}executeScreenPolling(){var t,n,r,s;if(!this.isInitialized||!this.shouldStartPolling())return;const e=((n=(t=this.ctx)==null?void 0:t.getCurrentRoomMode)==null?void 0:n.call(t))||"normal";if((s=(r=this.ctx)==null?void 0:r.getCurrentLayout)!=null&&s.call(r),e==="pointTurn"){this.executePointTurnPolling();return}this.updatePollingIndex(),this.emitScreenPollingEvent()}executePointTurnPolling(){var a,o,c,u;const e=((o=(a=this.ctx)==null?void 0:a.getParticipants)==null?void 0:o.call(a))||[],t=10;let n=null;try{n=((u=(c=this.ctx)==null?void 0:c.getHostIdentity)==null?void 0:u.call(c))||null}catch{n=null}let r=[...e];if(n){const d=r.findIndex(h=>h&&h.identity===n);d!==-1&&r.splice(d,1)}if(r.length<=t){this.stopScreenPolling(),this.emitPointTurnPollingEvent(r.slice(0,t));return}this.currentPollingIndex=this.currentPollingIndex%r.length;const s=[];for(let d=0;d<t;d++){const h=(this.currentPollingIndex+d)%r.length;s.push(r[h])}this.emitPointTurnPollingEvent(s),this.currentPollingIndex=(this.currentPollingIndex+5)%r.length}updatePollingIndex(){var a,o,c,u,d,h,b,v;const e=((o=(a=this.ctx)==null?void 0:a.getParticipants)==null?void 0:o.call(a))||[],t=e.length;if(t===0)return;const n=this.getMaxVisibleParticipantsByLayout(),r=((u=(c=this.ctx)==null?void 0:c.getCurrentLayout)==null?void 0:u.call(c))||"grid",s=((h=(d=this.ctx)==null?void 0:d.getCurrentRoomMode)==null?void 0:h.call(d))||"normal";if(t<=n){this.currentPollingIndex=0;return}if(r==="rightSide"&&s==="normal"){let y=null;try{y=((v=(b=this.ctx)==null?void 0:b.getHostIdentity)==null?void 0:v.call(b))||null}catch{y=null}const p=this.voiceActivatedParticipant&&this.voiceActivatedParticipant.identity||this.voiceActivatedIdentity;let f=!1;if(y&&e.find(m=>m&&m.identity===y)&&(f=!0),!f&&p&&e.find(m=>m&&m.identity===p)&&(f=!0),f){const m=Math.max(t-1,1);this.currentPollingIndex=(this.currentPollingIndex+1)%m}else{const m=Math.max(t,1);this.currentPollingIndex=(this.currentPollingIndex+1)%m}}else{const y=Math.max(t-n,1);this.currentPollingIndex=(this.currentPollingIndex+1)%y}}getPollingParticipants(){var c,u,d,h,b,v;const e=[...((u=(c=this.ctx)==null?void 0:c.getParticipants)==null?void 0:u.call(c))||[]],t=this.getMaxVisibleParticipantsByLayout(),n=((h=(d=this.ctx)==null?void 0:d.getCurrentLayout)==null?void 0:h.call(d))||"grid",r=((v=(b=this.ctx)==null?void 0:b.getCurrentRoomMode)==null?void 0:v.call(b))||"normal",s=this.currentPollingIndex,a=[];if(this.shouldStartPolling())if(n==="rightSide"&&r==="normal")a.push(...this._getRightSidePollingParticipants(e,t,s));else for(let y=0;y<t&&y<e.length;y++)a.push(e[(s+y)%e.length]);else for(let y=0;y<t&&y<e.length;y++)a.push(e[y]);const o=this.voiceActivatedParticipant&&this.voiceActivatedParticipant.identity||this.voiceActivatedIdentity;if(o){const y=a.findIndex(p=>p&&p.identity===o);if(y>0){const[p]=a.splice(y,1);a.unshift(p)}}return a}_getRightSidePollingParticipants(e,t,n){var b,v;const r=[];let s=null;try{s=((v=(b=this.ctx)==null?void 0:b.getHostIdentity)==null?void 0:v.call(b))||null}catch{s=null}const a=this.voiceActivatedParticipant&&this.voiceActivatedParticipant.identity||this.voiceActivatedIdentity;let o=null,c=!1;if(s){const y=e.find(p=>p&&p.identity===s);y&&(o=y,c=!0)}if(!c&&a){const y=e.find(p=>p&&p.identity===a);y&&(o=y,c=!0)}if(!o){const y=n%e.length;o=e[y]}o&&r.push(o);const u=new Set;o&&u.add(o.identity);let d=1,h=n;for(;d<t&&d<e.length;){const y=e[h%e.length];if(y&&!u.has(y.identity)&&(r.push(y),u.add(y.identity),d++),h++,h-n>=e.length)break}return r}_setupMittListeners(){try{typeof ut<"u"&&ut&&(ut.on("voiceActivated",e=>{if(e){typeof e=="string"?(this.voiceActivatedIdentity=e,this.voiceActivatedParticipant=null):typeof e=="object"&&(this.voiceActivatedParticipant=e,this.voiceActivatedIdentity=e.identity||null);try{const t=this.getPollingParticipants();ut.emit("updateVisibleParticipants",{participants:t,currentIndex:this.currentPollingIndex,isPolling:!!this.pollingInterval,action:"replace"})}catch(t){console.warn("同步语音激励到可见列表失败",t)}}}),ut.on("setPollingEnabled",e=>{this.setPollingEnabled(!!e)}))}catch(e){console.warn("autoPolling mitt listeners setup failed",e)}}emitScreenPollingEvent(){const e=this.getPollingParticipants();ut.emit("screenPolling",{timestamp:Date.now(),currentIndex:this.currentPollingIndex,participants:this.pollingParticipants,visibleParticipants:e,interval:this.ctx.pollingIntervalMs}),ut.emit("updateVisibleParticipants",{participants:e,currentIndex:this.currentPollingIndex,isPolling:!0,action:"replace"})}emitPointTurnPollingEvent(e){ut.emit("pointTurnPolling",{timestamp:Date.now(),currentIndex:this.currentPollingIndex,participants:e,interval:this.ctx.pollingIntervalMs})}setPollingInterval(e){this.ctx&&(this.ctx.pollingIntervalMs=e,!this.pollingDisabled&&this.pollingInterval&&(this.stopScreenPolling(),this.startScreenPolling()))}setPollingEnabled(e){this.pollingDisabled=!e,e?(this.adjustPollingState(),this.pollingInterval&&this.shouldStartPolling()&&setTimeout(()=>{this.executeScreenPolling()},50)):this.stopScreenPolling()}setVoiceActivatedIdentity(e){this.voiceActivatedIdentity=e||null}getPollingStatus(){var e;return{isActive:!!this.pollingInterval,currentIndex:this.currentPollingIndex,interval:(e=this.ctx)==null?void 0:e.pollingIntervalMs}}}const _l=new LP,BP=i=>_l.init(i),UP=()=>_l.stopScreenPolling(),kl=()=>_l.adjustPollingState(),D_=i=>_l.setPollingInterval(i),Gu=i=>_l.setPollingEnabled(i),A_="/assets/img/point/close_icon.png",FP="/assets/img/point/clear_icon.png",Mt=(i,e)=>{const t=i.__vccOpts||i;for(const[n,r]of e)t[n]=r;return t},Wu=i=>(l.pushScopeId("data-v-d6406cb6"),i=i(),l.popScopeId(),i),VP={class:"live-call-board"},jP={class:"live-call-board-title"},$P=Wu(()=>l.createElementVNode("span",null,"拨号盘",-1)),HP={class:"live-call-board-list"},qP=["onClick"],zP={class:"live-call-board-foot"},GP=[Wu(()=>l.createElementVNode("div",{class:"btn-icon"},null,-1))],WP=[Wu(()=>l.createElementVNode("div",{class:"btn-icon"},null,-1))],KP=[Wu(()=>l.createElementVNode("div",{class:"btn-icon"},null,-1))],Tl=Mt({__name:"LiveCallBoard",props:{defaultCallNum:{type:String,default:""},defaultCallingMethod:{type:Array,default:()=>["voice","video","mini"]}},emits:["callBoardClose","voiceCall","videoCall","miniCall"],setup(i,{emit:e}){const t=new wn,n=i,r=l.ref(""),s=e;function a(b){return/^[\d#*]+$/.test(b)}function o(b){r.value+=b}function c(){r.value?a(r.value)?(s("voiceCall",r.value),s("callBoardClose")):t.message("error","手机号中包含不合法字符"):t.message("error","联系方式不能为空")}function u(){r.value?a(r.value)?(s("videoCall",r.value),s("callBoardClose")):t.message("error","手机号中包含不合法字符"):t.message("error","联系方式不能为空")}function d(){r.value?a(r.value)?(s("miniCall",r.value),s("callBoardClose")):t.message("error","手机号中包含不合法字符"):t.message("error",{message:"联系方式不能为空"})}function h(){r.value.length>0&&(r.value=r.value.substring(0,r.value.length-1))}return l.onMounted(()=>{r.value=n.defaultCallNum}),(b,v)=>{const y=l.resolveComponent("el-input");return l.openBlock(),l.createElementBlock("div",VP,[l.createElementVNode("div",jP,[$P,l.createElementVNode("img",{class:"title-close-icon",src:A_,alt:"",onClick:v[0]||(v[0]=p=>b.$emit("callBoardClose"))})]),l.createVNode(y,{modelValue:r.value,"onUpdate:modelValue":v[1]||(v[1]=p=>r.value=p),type:"mobile",placeholder:"请输入号码",disabled:"",clearable:""},{suffix:l.withCtx(()=>[l.createElementVNode("img",{class:"del-icon",src:FP,alt:"",onClick:h})]),_:1},8,["modelValue"]),l.createElementVNode("div",HP,[(l.openBlock(),l.createElementBlock(l.Fragment,null,l.renderList("123456789*0#",(p,f)=>l.createElementVNode("div",{class:"live-call-board-list-item",key:f,onClick:m=>o(p)},l.toDisplayString(p),9,qP)),64))]),l.createElementVNode("div",zP,[i.defaultCallingMethod.includes("voice")?(l.openBlock(),l.createElementBlock("div",{key:0,class:"live-call-board-foot-btn voice-btn",onClick:c},GP)):l.createCommentVNode("",!0),i.defaultCallingMethod.includes("video")?(l.openBlock(),l.createElementBlock("div",{key:1,class:"live-call-board-foot-btn video-btn",onClick:u},WP)):l.createCommentVNode("",!0),i.defaultCallingMethod.includes("mini")?(l.openBlock(),l.createElementBlock("div",{key:2,class:"live-call-board-foot-btn mini-btn",onClick:d},KP)):l.createCommentVNode("",!0)])])}}},[["__scopeId","data-v-d6406cb6"]]),XP="/assets/img/point/hang_on_icon.png",YP="/assets/img/point/hang_off_icon.png",Ku=i=>(l.pushScopeId("data-v-380eda98"),i=i(),l.popScopeId(),i),JP={class:"receive-board"},QP={class:"receive-board-title"},ZP={class:"receive-board-msg"},e7=[Ku(()=>l.createElementVNode("img",{class:"btn-icon",src:XP,alt:""},null,-1)),Ku(()=>l.createElementVNode("span",null,"接听",-1))],t7=[Ku(()=>l.createElementVNode("img",{class:"btn-icon",src:YP,alt:""},null,-1)),Ku(()=>l.createElementVNode("span",null,"挂断",-1))],n7=Mt({__name:"LiveInviteReceive",props:{meetingType:{type:String,default:"video"},inviteData:{type:Object,default:()=>{}}},emits:["receiveBoardClose","acceptInviteCall","refuseInviteCall"],setup(i,{emit:e}){const t=i,n=e;function r(){n("acceptInviteCall",{roomNum:t.inviteData.roomNum,fromIdentity:t.inviteData.fromIdentity,fromOrg:t.inviteData.fromOrg,meetingType:t.meetingType})}function s(){n("refuseInviteCall",{roomNum:t.inviteData.roomNum,fromIdentity:t.inviteData.fromIdentity,fromOrg:t.inviteData.fromOrg,meetingType:t.meetingType})}return(a,o)=>{var c;return l.openBlock(),l.createElementBlock("div",JP,[l.createElementVNode("div",QP,[l.createElementVNode("span",null,l.toDisplayString(i.meetingType==="voice"?"语音呼叫":"视频呼叫"),1),l.createElementVNode("img",{class:"title-close-icon",src:A_,alt:"",onClick:o[0]||(o[0]=u=>a.$emit("receiveBoardClose"))})]),l.createElementVNode("div",ZP,[l.createElementVNode("img",{class:l.normalizeClass(["receive-type-icon",i.meetingType==="voice"?"receive-type-icon-voice":"receive-type-icon-video"]),src:"",alt:""},null,2),l.createElementVNode("span",null,l.toDisplayString(`【${((c=i.inviteData)==null?void 0:c.fromIdentity)??"会议发起人"}】邀请您进行${i.meetingType==="voice"?"语音":"视频"}通话`),1)]),l.createElementVNode("div",{class:"receive-board-foot"},[l.createElementVNode("div",{class:"receive-board-foot-btn accept-btn",onClick:r},e7),l.createElementVNode("div",{class:"receive-board-foot-btn refuse-btn",onClick:s},t7)])])}}},[["__scopeId","data-v-380eda98"]]),An=i=>(l.pushScopeId("data-v-0afc60d4"),i=i(),l.popScopeId(),i),i7={class:"point-meeting-top"},r7={class:"top-group"},s7=An(()=>l.createElementVNode("div",{class:"duration-icon"},null,-1)),a7={class:"point-meeting-wrapper"},o7={key:0,class:"waiting-mask-video"},l7=[An(()=>l.createElementVNode("div",{class:"icon"},null,-1)),An(()=>l.createElementVNode("div",{class:"title"},"麦克风",-1))],c7=[An(()=>l.createElementVNode("div",{class:"icon"},null,-1)),An(()=>l.createElementVNode("div",{class:"title"},"麦克风",-1))],u7=[An(()=>l.createElementVNode("div",{class:"icon"},null,-1)),An(()=>l.createElementVNode("div",{class:"title"},"摄像头",-1))],d7=[An(()=>l.createElementVNode("div",{class:"icon"},null,-1)),An(()=>l.createElementVNode("div",{class:"title"},"摄像头",-1))],h7=[An(()=>l.createElementVNode("div",{class:"icon"},null,-1)),An(()=>l.createElementVNode("div",{class:"title"},"扬声器",-1))],f7=[An(()=>l.createElementVNode("div",{class:"icon"},null,-1)),An(()=>l.createElementVNode("div",{class:"title"},"扬声器",-1))],p7=An(()=>l.createElementVNode("div",{class:"icon"},null,-1)),m7={class:"title"},g7=An(()=>l.createElementVNode("div",{class:"icon"},null,-1)),v7={class:"title"},y7=[An(()=>l.createElementVNode("div",{class:"icon"},null,-1)),An(()=>l.createElementVNode("div",{class:"title"},"结束通话",-1))],Sl=Mt({__name:"LivePointMeeting",props:{joinType:{type:String,default:"join"},meetingNum:{type:String,default:""},meetingType:{type:String,default:"video"},invitePhone:{type:String,default:""},isDraggable:{type:Boolean,default:!1},inviteWays:{type:String,default:"phoneCall"},inviteIdentity:{type:String,default:""}},emits:["meetingStarted","miniLinkSend","meetingEnded","meetingDialogClose"],setup(i,{emit:e}){const t=new wn;let n=null,r=null,s=null;const a=i,o=e,c=l.ref(),u=l.ref(""),d=l.ref(""),h=l.ref(""),b=l.ref(null),v=l.ref([]);l.ref([]);const y=l.ref([]),p=l.ref(!1),f=l.ref(!1),m=l.ref(!1),_=l.ref(!1),k=l.ref(!0),D=l.ref(!1),E=l.ref(!1),A=l.ref(0),w=l.ref(!0),N=l.ref(!1),S=l.ref(3),P=l.computed(()=>y.value.length),F=l.computed(()=>Yg(A.value)),V={mounted:(le,Ke)=>{Ke.value&&(le.style.cursor="move",le.onmousedown=ae=>{ae.stopPropagation(),ae.preventDefault();const ue=document.getElementById("point-meeting"),Be=/^matrix3d\((?:[-\d.]+,\s*){12}([-\d.]+),\s*([-\d.]+)(?:,\s*[-\d.]+){2}\)/,Ie=/^matrix\((?:[-\d.]+,\s*){4}([-\d.]+),\s*([-\d.]+)\)$/;let tt=fx(ue,"transform"),ze=tt.match(Be)||tt.match(Ie),Se=ae.clientX,Ve=ae.clientY,ke=ze[1],Me=ze[2],Pe=Se-ke,it=Ve-Me;le.onmousemove=function(bt){bt.stopPropagation(),bt.preventDefault();let Wt=bt.clientX-Pe,On=bt.clientY-it;ue.style.transform=`translate(${Wt}px, ${On}px)`},le.onmouseup=function(bt){le.onmousemove=null,le.onmouseup=null},window.onmouseup=function(bt){le.onmousemove=null,le.onmouseup=null}})}};l.watch(()=>S.value,le=>{le<=0&&(N.value=!1,r&&clearInterval(r))});async function J(){s&&await s.createRoom()}async function ie(){if(!s)return;const le={echoCancellation:!0,noiseSuppression:!0,roomNum:a.joinType==="launch"?h.value:a.meetingNum};try{await s.joinRoom(le)}catch{t.message("error","加入会议失败")}}function X(le){v.value.indexOf(le)<0&&v.value.push(le)}function H(){s&&v.value.length>0&&v.value.forEach(le=>{s.off(le)})}function $(){n&&(clearInterval(n),n=null)}async function j(){await s.changeCameraStatus()}async function B(){await s.changeMicrophoneStatus()}async function q(){await s.changeScreenShareStatus()}async function z(){await s.setParticipantDeafness(u.value)}async function oe(){await s.cancelParticipantDeafness(u.value)}function we(le){S.value=le,N.value=!0,r&&clearInterval(r),r=setInterval(()=>{S.value>0&&S.value--},1e3)}function be(){if(!D.value)return;const le=document.querySelector("#point-meeting-contain .layout-blur"),Ke=document.querySelector("#point-meeting-contain .layout-normal");if(k.value){if(le.hasChildNodes){const ae=le.firstElementChild;if(ae.id===`participant-${u.value}`)le.style.visibility="hidden",k.value=!1;else if(Ke.hasChildNodes){const ue=Ke.firstElementChild;le.appendChild(ue),Ke.appendChild(ae),le.style.visibility="hidden",k.value=!1}else Ke.appendChild(ae),le.style.visibility="hidden",k.value=!1}}else if(_.value){t.message("error","当前正在共享屏幕,无法开启预览");return}else le.style.visibility="visible",k.value=!0}function Z(){if(!s){t.message("error","liveClient未能成功初始化");return}s.on("errorPush",le=>{X("errorPush"),console.error("出错位置"+le.type+":",le.message)}),s.on("roomCreatedSuccess",async le=>{X("roomCreatedSuccess"),t.message("success","会议房间创建成功"),h.value=le,await ie()}),s.on("roomCreatedFail",le=>{X("roomCreatedFail"),t.message("error","会议房间创建失败")}),s.on("joinRoomError",le=>{X("joinRoomError"),console.error("加入会议失败",le),t.message("error","加入会议失败")}),s.on("roomConnected",le=>{if(X("roomConnected"),s!=null&&s.room&&(b.value=JSON.parse(s.room.metadata),D.value=!0,o("meetingStarted"),a.joinType==="launch")){if(a.inviteWays==="phoneCall")a.meetingType==="video"||a.meetingType==="voice"?s.makeCall(a.invitePhone,a.invitePhone).then(()=>{t.message("success","外呼邀请发送成功"),E.value=!0}).catch(Ke=>{t.message("error","外呼邀请发送失败"),console.error(Ke)}):a.meetingType==="miniLink"&&(o("miniLinkSend",{roomNum:h.value,phone:a.invitePhone}),E.value=!0);else if(a.inviteWays==="identity"){const Ke=JSON.stringify({meetingType:a.meetingType});s.inviteThirdParty(a.inviteIdentity,s.org,Ke).then(()=>{t.message("success","PC邀请发送成功")}).catch(()=>{t.message("error","PC邀请发送失败")})}}}),s.on("localCameraChange",le=>{X("localCameraChange"),f.value=le,f.value?t.message("success","摄像头已开启"):t.message("success","摄像头已关闭")}),s.on("localMicrophoneChange",le=>{X("localMicrophoneChange"),p.value=le,p.value?t.message("success","麦克风已开启"):t.message("success","麦克风已关闭")}),s.on("localScreenShareChange",le=>{X("localScreenShareChange"),_.value=le,_.value?t.success({messsage:"屏幕共享已开启"}):t.success({messsage:"屏幕共享已关闭"})}),s.on("videoCallRender",le=>{X("videoCallRender"),Ne(le)}),s.on("audioCallRender",le=>{X("audioCallRender"),nt(le)}),s.on("roomDisconnected",()=>{if(X("roomDisconnected"),t.message("info","房间链接已断开"),D.value=!1,o("meetingEnded"),s){s._eventsInitialized=!1;try{s.removeAllListeners()}catch(le){console.warn("清理liveClient事件监听器失败:",le)}}s.deleteRoom(u.value).then(()=>{$(),_e()}).catch(le=>{console.error(le),$(),_e()})})}function _e(){o("meetingDialogClose")}async function Te(){s&&await s.leaveRoom()}async function Ue(le){document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement?document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen():(await l.nextTick(),c.value.requestFullscreen&&c.value.requestFullscreen())}function We(le){if(P.value<=0)y.value.push(le);else{const Ke=y.value.findIndex(ae=>ae.identity===le.identity);Ke!==-1?y.value.splice(Ke,1,le):y.value.push(le)}}function pe(le){if(!(P.value<=0)){const Ke=y.value.findIndex(ae=>ae.identity===le.identity);Ke!==-1&&y.value.splice(Ke,1)}}function Ne(le){if(console.log("视频通话渲染"+le.identity+":",le),le.isLocal){const Pe=JSON.parse(le.metadata);f.value=le.isCameraEnabled,p.value=le.isMicrophoneEnabled,_.value=le.isScreenShareEnabled,m.value=!Pe.isDeafness,u.value=le.identity,d.value=le.name}const Ke=document.getElementById("point-meeting-contain");let ae=document.getElementById(`participant-${le.identity}`),ue=document.querySelector("#point-meeting-contain .layout-blur"),Be=document.querySelector("#point-meeting-contain .layout-normal");if(ue||(ue=document.createElement("div"),ue.className="layout-blur",Ke.appendChild(ue)),Be||(Be=document.createElement("div"),Be.className="layout-normal",Ke.insertBefore(Be,Ke.firstElementChild??null)),!Ke){t.message("error","会议容器不存在");return}if(!ae&&!le.remove){if(ae=document.createElement("div"),ae.id=`participant-${le.identity}`,ae.className=le.isLocal?"participant local":"participant",le.isScreenShareEnabled||le.isCameraEnabled?ae.innerHTML=`
|
244
|
+
<video id="video-${le.identity}" class="p-video" autoplay webkit-playsinline playsinline x5-video-player-type="h5"></video>
|
245
|
+
<div id="describe-${le.identity}" class="describe">
|
246
|
+
<div class="describe-left">
|
247
|
+
<div class="avatar"></div>
|
248
|
+
<div id="${le.identity}" class="identity">${le.isLocal?le.name+"(我)":le.name}</div>
|
249
|
+
</div>
|
250
|
+
<div class="tools">
|
251
|
+
<div id="microphone-${le.identity}" class="microphone"></div>
|
252
|
+
</div>
|
253
|
+
</div>
|
254
|
+
`:ae.innerHTML=`
|
255
|
+
<video id="video-${le.identity}" class="p-video" autoplay webkit-playsinline playsinline x5-video-player-type="h5"></video>
|
256
|
+
<div id="board-${le.identity}" class="board">
|
257
|
+
<div class="board-icon"></div>
|
258
|
+
<div class="board-title">
|
259
|
+
<span class="board-title-text">${le.name}</span>
|
260
|
+
<div id="microphone-${le.identity}" class="microphone"></div>
|
261
|
+
</div>
|
262
|
+
</div>
|
263
|
+
`,le.isLocal){if(ue.hasChildNodes){let Pe=null;for(;Pe=ue.firstElementChild;)Be.insertBefore(Pe,Be.firstElementChild??null)}ue.appendChild(ae)}else{if(P.value>=2)return;if(Be.hasChildNodes){let Pe=null;for(;Pe=Be.firstElementChild;)ue.appendChild(Pe)}Be.appendChild(ae)}We(le)}let Ie=document.getElementById(`video-${le.identity}`);if(le.remove){Ie&&(Ie.srcObject=null,Ie.src="",Ie.remove()),ae&&ae.remove(),pe(le),le.videoTrack&&le.videoTrack.detach(),le.audioTrack&&le.audioTrack.detach();return}a.joinType==="launch"&&!le.isLocal&&(a.meetingType==="miniLink"?le.isLocal||(E.value=!1):!le.isLocal&&(le!=null&&le.audioTrack)&&(E.value=!1));let tt=document.getElementById(`describe-${le.identity}`),ze=document.getElementById(`board-${le.identity}`),Se=document.getElementById(`microphone-${le.identity}`);const Ve=()=>{s.changeParticipantMicrophoneStatus(le.identity,!0)},ke=()=>{s.changeParticipantMicrophoneStatus(le.identity,!1)},Me=()=>{if(!k.value)return;let Pe=document.querySelector("#point-meeting-contain .layout-blur"),it=document.querySelector("#point-meeting-contain .layout-normal"),bt=Pe.firstElementChild,Wt=document.getElementById(`participant-${le.identity}`);if(bt){if(bt.id===`participant-${le.identity}`)return;it.insertBefore(bt,it.firstChild??null),Wt&&Pe.appendChild(Wt)}else Pe.appendChild(Wt)};ae&&(ae.onclick=Me),le.isScreenShareEnabled||le.isCameraEnabled?(ze&&(ae.removeChild(ze),ze=null),tt||(tt=document.createElement("div"),tt.className="describe",tt.id=`describe-${le.identity}`,tt.innerHTML=`
|
264
|
+
<div class="describe-left">
|
265
|
+
<div class="avatar"></div>
|
266
|
+
<div id="${le.identity}" class="identity">${le.isLocal?le.name+"(我)":le.name}</div>
|
267
|
+
</div>
|
268
|
+
<div class="tools">
|
269
|
+
<div id="microphone-${le.identity}" class="microphone"></div>
|
270
|
+
</div>
|
271
|
+
`,ae.appendChild(tt))):(tt&&(ae.removeChild(tt),tt=null),ze||(ze=document.createElement("div"),ze.className="board",ze.id=`board-${le.identity}`,ze.innerHTML=`
|
272
|
+
<div class="board-icon"></div>
|
273
|
+
<div class="board-title">
|
274
|
+
<span class="board-title-text">${le.name}</span>
|
275
|
+
<div id="microphone-${le.identity}" class="microphone"></div>
|
276
|
+
</div>
|
277
|
+
`,ze&&ae.appendChild(ze))),Se=document.getElementById(`microphone-${le.identity}`),Se&&le.isMicrophoneEnabled?(Se.className="microphone microphone-active",Se.onclick=Ve):Se&&!le.isMicrophoneEnabled&&(Se.className="microphone microphone-inactive",Se.onclick=ke),le.videoTrack&&le.videoTrack.attach(Ie),le.isLocal||le.audioTrack&&le.audioTrack.attach(Ie),We(le),y.value.length>=1&&(JSON.parse(s.room.metadata),w.value&&(n&&(clearInterval(n),n=null),n=setInterval(()=>{A.value++,w.value=!1},1e3)))}function nt(le){if(console.log("语音通话渲染"+le.identity+":",le),le.isLocal){const Ke=JSON.parse(le.metadata);p.value=le.isMicrophoneEnabled,m.value=!Ke.isDeafness,u.value=le.identity,d.value=le.name}if(!le.isLocal){const Ke=document.getElementById("point-meeting-contain");let ae=document.getElementById(`participant-${le.identity}`);if(!Ke){t.message("error","会议容器不存在");return}!ae&&!le.remove&&(ae=document.createElement("div"),ae.id=`participant-${le.identity}`,ae.className=le.isLocal?"participant local":"participant",ae.innerHTML=`
|
278
|
+
<audio id="audio-${le.identity}" class="p-audio" autoplay></audio>
|
279
|
+
<div class="participant-icon"></div>
|
280
|
+
<div class="participant-title">
|
281
|
+
<span class="participant-title-text">${le.name}</span>
|
282
|
+
<div id="microphone-${le.identity}" class="microphone"></div>
|
283
|
+
</div>
|
284
|
+
`,le.isLocal?Ke.insertBefore(ae,Ke.firstChild??null):Ke.appendChild(ae),We(le));let ue=document.getElementById(`audio=${le.identity}`);le.remove&&(ue&&(ue.srcObject=null,ue.src="",ue.remove()),ae&&ae.remove(),pe(le),le.audioTrack&&le.audioTrack.detach()),a.joinType==="launch"&&le!=null&&le.audioTrack&&(E.value=!1);let Be=document.getElementById(`microphone-${le.identity}`);const Ie=()=>{s.changeParticipantMicrophoneStatus(le.identity,!0)},tt=()=>{s.changeParticipantMicrophoneStatus(le.identity,!1)};Be&&le.isMicrophoneEnabled?(Be.className="microphone microphone-active",Be.onclick=Ie):Be&&!le.isMicrophoneEnabled&&(Be.className="microphone microphone-inactive",Be.onclick=tt),le.audioTrack&&le.audioTrack.attach(ue)}if(We(le),y.value.length>=1){const Ke=JSON.parse(s.room.metadata);console.log("metadata2222:",Ke),w.value&&(n&&(clearInterval(n),n=null),n=setInterval(()=>{A.value++,w.value=!1},1e3))}}return l.onMounted(()=>{s=window.liveClient,console.log("liveClient",s),Z(),a.joinType==="launch"?(a.meetingType==="video"||a.meetingType==="miniLink"?s.roomMode="auto":a.meetingType==="voice"&&(s.roomMode="audio"),J()):(a.meetingType==="video"||a.meetingType==="miniLink"?s.roomMode="auto":a.meetingType==="voice"&&(s.roomMode="audio"),ie()),we(4)}),l.onBeforeUnmount(()=>{D.value&&Te(),H()}),(le,Ke)=>(l.openBlock(),l.createElementBlock("div",{ref_key:"rootElm",ref:c,class:"point-meeting",id:"point-meeting",style:l.normalizeStyle({resize:i.isDraggable?"both":"none"})},[l.withDirectives((l.openBlock(),l.createElementBlock("div",i7,[l.createElementVNode("div",r7,[s7,l.createElementVNode("span",null,l.toDisplayString(F.value),1)]),l.createElementVNode("div",{class:"top-group"},[l.createElementVNode("div",{class:"full-screen-btn",onClick:Ue}),l.createElementVNode("div",{class:"close-btn",onClick:_e})])])),[[V,i.isDraggable]]),l.createElementVNode("div",a7,[l.createElementVNode("div",{id:"point-meeting-contain",class:l.normalizeClass(["meeting-contain",i.meetingType==="video"||i.meetingType==="miniLink"?"meeting-contain-video":"meeting-contain-audio"]),onMousemove:Ke[0]||(Ke[0]=ae=>we(4))},[E.value?(l.openBlock(),l.createElementBlock("div",o7,"呼叫中...")):l.createCommentVNode("",!0)],34)]),l.createElementVNode("div",{class:l.normalizeClass(["point-meeting-foot",{"point-meeting-foot-show":N.value}])},[p.value?(l.openBlock(),l.createElementBlock("div",{key:0,class:"point-meeting-foot-btn mic-on",onClick:B},l7)):(l.openBlock(),l.createElementBlock("div",{key:1,class:"point-meeting-foot-btn mic-off",onClick:B},c7)),i.meetingType!=="voice"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:2},[f.value?(l.openBlock(),l.createElementBlock("div",{key:0,class:"point-meeting-foot-btn cam-on",onClick:j},u7)):(l.openBlock(),l.createElementBlock("div",{key:1,class:"point-meeting-foot-btn cam-off",onClick:j},d7))],64)):l.createCommentVNode("",!0),m.value?(l.openBlock(),l.createElementBlock("div",{key:3,class:"point-meeting-foot-btn speaker-on",onClick:z},h7)):(l.openBlock(),l.createElementBlock("div",{key:4,class:"point-meeting-foot-btn speaker-off",onClick:oe},f7)),i.meetingType!=="voice"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:5},[l.createElementVNode("div",{class:"point-meeting-foot-btn screen-share",onClick:q},[p7,l.createElementVNode("div",m7,l.toDisplayString(_.value?"结束共享":"共享屏幕"),1)]),l.createElementVNode("div",{class:"point-meeting-foot-btn preview",onClick:be},[g7,l.createElementVNode("div",v7,l.toDisplayString(k.value?"关闭预览":"开启预览"),1)])],64)):l.createCommentVNode("",!0),l.createElementVNode("div",{class:"point-meeting-foot-btn cancel",onClick:Te},y7)],2)],4))}},[["__scopeId","data-v-0afc60d4"]]),Xu={__name:"LivePoint",props:{isCallBoardShow:{type:Boolean,default:!1},defaultCallNum:{type:String,default:""},isDraggable:{type:Boolean,default:!1},isInviteReceiveShow:{type:Boolean,default:!1},inviteMeetingType:{type:String,default:"video"},inviteData:{type:Object,default:()=>({})},defaultCallingMethod:{type:Array,default:()=>["voice","video","mini"]}},emits:["callBoardClose","inviteReceiveClose","miniLinkInvite"],setup(i,{expose:e,emit:t}){let n=null;const r=new wn,s=t,a=l.ref(!1),o=l.reactive({joinType:"join",meetingNum:"",meetingType:"video",invitePhone:""}),c=l.ref("phoneCall"),u=l.ref("");function d(m){o.joinType="launch",o.meetingType="voice",o.invitePhone=m,c.value="phoneCall",a.value=!0}function h(m){o.joinType="launch",o.meetingType="video",o.invitePhone=m,c.value="phoneCall",a.value=!0}function b(m){o.joinType="launch",o.meetingType="miniLink",o.invitePhone=m,c.value="phoneCall",a.value=!0}function v(m){n.acceptInvite(m.roomNum,m.fromIdentity,m.fromOrg).then(()=>{o.joinType="join",o.meetingType=m.meetingType,o.meetingNum=m.roomNum,a.value=!0,s("inviteReceiveClose")}).catch(()=>{r.message("error","接受会议邀请失败,请重试")})}function y(m){n.refuseInvite(m.roomNum,m.fromIdentity,m.fromOrg).then(()=>{s("inviteReceiveClose")}).catch(()=>{r.message("error","拒绝会议邀请失败,请重试")})}function p(m){s("miniLinkInvite",m)}function f(){a.value=!1}return l.onMounted(async()=>{await l.nextTick(),n=window.liveClient}),e({makeVoiceCall:d,makeVideoCall:h,makeMiniCall:b}),(m,_)=>(l.openBlock(),l.createElementBlock("div",null,[(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[i.isCallBoardShow?(l.openBlock(),l.createBlock(Tl,{key:0,"default-call-num":i.defaultCallNum,defaultCallingMethod:i.defaultCallingMethod,onVoiceCall:d,onVideoCall:h,onMiniCall:b,onCallBoardClose:_[0]||(_[0]=k=>m.$emit("callBoardClose"))},null,8,["default-call-num","defaultCallingMethod"])):l.createCommentVNode("",!0)])),(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[i.isInviteReceiveShow?(l.openBlock(),l.createBlock(n7,{key:0,meetingType:i.inviteMeetingType,inviteData:i.inviteData,onReceiveBoardClose:m.inviteReceiveClose,onAcceptInviteCall:v,onRefuseInviteCall:y},null,8,["meetingType","inviteData","onReceiveBoardClose"])):l.createCommentVNode("",!0)])),(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[a.value?(l.openBlock(),l.createBlock(Sl,{key:0,joinType:o.joinType,meetingNum:o.meetingNum,meetingType:o.meetingType,invitePhone:o.invitePhone,inviteWays:c.value,inviteIdentity:u.value,isDraggable:i.isDraggable,onMeetingDialogClose:f,onMiniLinkSend:p},null,8,["joinType","meetingNum","meetingType","invitePhone","inviteWays","inviteIdentity","isDraggable"])):l.createCommentVNode("",!0)]))]))}};Xu.install=function(i){i.component("LivePoint",Xu)},Tl.install=function(i){i.component("LiveCallBoard",Tl)},Sl.install=function(i){i.component("LivePointMeeting",Sl)};const b7="/assets/img/multi/tree_slide.png",_7="/assets/img/multi/tree_expand.png",k7="/assets/img/multi/launch_icon.png",T7="/assets/img/entry/icon_date.png",S7="/assets/img/index/yq.png",I_="/assets/img/multi/user.png",C7="/assets/img/multi/add.png",x7=i=>(l.pushScopeId("data-v-aa1de33f"),i=i(),l.popScopeId(),i),E7={class:"telephone-invite"},w7={class:"CustomHeader"},D7=x7(()=>l.createElementVNode("div",{class:"ivits"},"邀请非通讯录人员",-1)),A7={class:"contentsinit"},I7=Mt({__name:"TelephoneInvitation",emits:["inviteCancel","inviteConfirm"],setup(i,{emit:e}){const t=e,n=l.ref(!1),r=l.ref(),s=l.reactive({name:"",phone:""}),a=l.reactive({name:[{required:!0,message:"请输入姓名",trigger:"blur"}],phone:[{validator:px,trigger:"blur"}]});ut.on("getinvitTions",()=>{n.value=!0});const o=()=>{t("inviteCancel"),n.value=!1},c=async()=>{await l.nextTick(),r.value.validate(u=>{console.log("valid",u),u?(t("inviteConfirm",{name:s.name,phone:s.phone}),n.value=!1):console.log("表单校验不通过")})};return l.watch(()=>n.value,u=>{u&&(s.name="",s.phone="")}),(u,d)=>{const h=l.resolveComponent("el-input"),b=l.resolveComponent("el-form-item"),v=l.resolveComponent("el-form"),y=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",E7,[l.createVNode(y,{modelValue:n.value,"onUpdate:modelValue":d[3]||(d[3]=p=>n.value=p),"show-close":!1,class:"telephoneInvit",width:"460"},{header:l.withCtx(()=>[l.createElementVNode("div",w7,[D7,l.createElementVNode("div",{class:"close",onClick:d[0]||(d[0]=p=>n.value=!1)})])]),default:l.withCtx(()=>[l.createElementVNode("div",A7,[l.createVNode(v,{model:s,"hide-required-asterisk":"",ref_key:"createForm",ref:r,rules:a,"label-width":"70",class:"customForm"},{default:l.withCtx(()=>[l.createVNode(b,{label:"姓名",prop:"name"},{default:l.withCtx(()=>[l.createVNode(h,{modelValue:s.name,"onUpdate:modelValue":d[1]||(d[1]=p=>s.name=p)},null,8,["modelValue"])]),_:1}),l.createVNode(b,{label:"电话",prop:"phone"},{default:l.withCtx(()=>[l.createVNode(h,{modelValue:s.phone,"onUpdate:modelValue":d[2]||(d[2]=p=>s.phone=p)},null,8,["modelValue"])]),_:1}),l.createVNode(b,{"label-width":"0"},{default:l.withCtx(()=>[l.createElementVNode("div",{class:"isokmul"},[l.createElementVNode("div",{onClick:o},"取消"),l.createElementVNode("div",{onClick:c},"确定")])]),_:1})]),_:1},8,["model","rules"])])]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-aa1de33f"]]),N7=i=>(l.pushScopeId("data-v-c23caf5b"),i=i(),l.popScopeId(),i),P7={class:"CustomHeader"},O7=N7(()=>l.createElementVNode("div",{class:"ivits"},"添加人员到常用分组",-1)),M7={class:"contentsinit"},R7=Mt({__name:"AddGroupDialog",emits:["addGroupCancel","addGroupConfirm"],setup(i,{emit:e}){const t=e,n=l.ref(!1),r=l.ref(),s=l.reactive({name:"",sort:1}),a=l.reactive({name:[{required:!0,message:"请输入分组名",trigger:"blur"},{max:10,message:"分组名不能超过10个字符",trigger:"blur"}],sort:[{required:!0,message:"请输入序号",trigger:"change"}]});ut.on("groupAddOpen",()=>{n.value=!0});const o=()=>{t("addGroupCancel"),n.value=!1},c=async()=>{await l.nextTick(),r.value.validate(u=>{console.log("valid",u),u?(t("addGroupConfirm",{name:s.name,sort:s.sort}),n.value=!1):console.log("表单校验不通过")})};return l.watch(()=>n.value,u=>{u&&(s.name="",s.sort=1)}),(u,d)=>{const h=l.resolveComponent("el-input"),b=l.resolveComponent("el-form-item"),v=l.resolveComponent("el-input-number"),y=l.resolveComponent("el-form"),p=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",null,[l.createVNode(p,{modelValue:n.value,"onUpdate:modelValue":d[3]||(d[3]=f=>n.value=f),"show-close":!1,class:"telephoneInvit",width:"460"},{header:l.withCtx(()=>[l.createElementVNode("div",P7,[O7,l.createElementVNode("div",{class:"close",onClick:d[0]||(d[0]=f=>n.value=!1)})])]),default:l.withCtx(()=>[l.createElementVNode("div",M7,[l.createVNode(y,{model:s,"hide-required-asterisk":"",ref_key:"createForm",ref:r,rules:a,"label-width":"70",class:"customForm"},{default:l.withCtx(()=>[l.createVNode(b,{label:"分组名",prop:"name"},{default:l.withCtx(()=>[l.createVNode(h,{modelValue:s.name,"onUpdate:modelValue":d[1]||(d[1]=f=>s.name=f)},null,8,["modelValue"])]),_:1}),l.createVNode(b,{label:"排序",prop:"sort"},{default:l.withCtx(()=>[l.createVNode(v,{modelValue:s.sort,"onUpdate:modelValue":d[2]||(d[2]=f=>s.sort=f),min:0,"controls-position":"right",size:"large"},null,8,["modelValue"])]),_:1}),l.createVNode(b,{"label-width":"0"},{default:l.withCtx(()=>[l.createElementVNode("div",{class:"isokmul"},[l.createElementVNode("div",{onClick:o},"取消"),l.createElementVNode("div",{onClick:c},"确定")])]),_:1})]),_:1},8,["model","rules"])])]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-c23caf5b"]]),L7=i=>(l.pushScopeId("data-v-1174fbdd"),i=i(),l.popScopeId(),i),B7={class:"CustomHeader"},U7=L7(()=>l.createElementVNode("div",{class:"ivits"},"编辑分组",-1)),F7={class:"contentsinit"},V7=Mt({__name:"EditGroupDialog",emits:["editGroupCancel","editGroupConfirm"],setup(i,{emit:e}){const t=e,n=l.ref(!1),r=l.ref(),s=l.reactive({name:"",sort:1}),a=l.ref(""),o=l.reactive({name:[{required:!0,message:"请输入分组名称",trigger:"blur"},{max:10,message:"分组名不能超过10个字符",trigger:"blur"}],sort:[{required:!0,message:"请输入序号",trigger:"change"}]});ut.on("groupEditOpen",async d=>{n.value=!0,await l.nextTick(),a.value=d.groupId,s.name=d.label,s.sort=d.sort});const c=()=>{t("editGroupCancel"),n.value=!1},u=async()=>{await l.nextTick(),r.value.validate(d=>{d?(t("editGroupConfirm",{name:s.name,sort:s.sort,groupId:a.value}),n.value=!1):console.log("表单校验不通过")})};return l.watch(()=>n.value,d=>{d&&(s.name="",s.sort=0)}),(d,h)=>{const b=l.resolveComponent("el-input"),v=l.resolveComponent("el-form-item"),y=l.resolveComponent("el-input-number"),p=l.resolveComponent("el-form"),f=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",null,[l.createVNode(f,{modelValue:n.value,"onUpdate:modelValue":h[3]||(h[3]=m=>n.value=m),"show-close":!1,class:"telephoneInvit",width:"460"},{header:l.withCtx(()=>[l.createElementVNode("div",B7,[U7,l.createElementVNode("div",{class:"close",onClick:h[0]||(h[0]=m=>n.value=!1)})])]),default:l.withCtx(()=>[l.createElementVNode("div",F7,[l.createVNode(p,{model:s,"hide-required-asterisk":"",ref_key:"createForm",ref:r,rules:o,"label-width":"70",class:"customForm"},{default:l.withCtx(()=>[l.createVNode(v,{label:"分组名",prop:"name"},{default:l.withCtx(()=>[l.createVNode(b,{modelValue:s.name,"onUpdate:modelValue":h[1]||(h[1]=m=>s.name=m)},null,8,["modelValue"])]),_:1}),l.createVNode(v,{label:"排序",prop:"sort"},{default:l.withCtx(()=>[l.createVNode(y,{modelValue:s.sort,"onUpdate:modelValue":h[2]||(h[2]=m=>s.sort=m),min:0,"controls-position":"right",size:"large"},null,8,["modelValue"])]),_:1}),l.createVNode(v,{"label-width":"0"},{default:l.withCtx(()=>[l.createElementVNode("div",{class:"isokmul"},[l.createElementVNode("div",{onClick:c},"取消"),l.createElementVNode("div",{onClick:u},"确定")])]),_:1})]),_:1},8,["model","rules"])])]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-1174fbdd"]]),us=i=>(l.pushScopeId("data-v-b45f3337"),i=i(),l.popScopeId(),i),j7={class:"addressbox"},$7={class:"CustomHeader"},H7={class:"tabs"},q7=["onClick"],z7=us(()=>l.createElementVNode("div",{class:"fgx"},null,-1)),G7={class:"checkBox"},W7={class:"userLeft"},K7=us(()=>l.createElementVNode("i",{class:"el-input__icon el-icon-search"},null,-1)),X7={class:"custom-tree-node"},Y7=["title"],J7={key:1,class:"custom-tree-node-user"},Q7=us(()=>l.createElementVNode("span",{class:l.normalizeClass(["custom-tree-node-icon"])},null,-1)),Z7=["title"],eO={class:"treeFlexInof1"},tO={class:"iconS"},nO=["src"],iO=["src"],rO=["src"],sO={class:"custom-tree-node"},aO={style:{"max-width":"300px","text-overflow":"ellipsis",overflow:"hidden"}},oO={class:"custom-tree-node"},lO={key:0,class:"custom-tree-node-editable"},cO=["title"],uO={key:0,class:"node-options"},dO=["onClick"],hO=["onClick"],fO={key:1,class:"custom-tree-node-user"},pO=us(()=>l.createElementVNode("span",{class:l.normalizeClass(["custom-tree-node-icon"])},null,-1)),mO=["title"],gO={class:"userRight"},vO={class:"checkUse"},yO=us(()=>l.createElementVNode("div",{class:"titl"},"已选",-1)),bO={class:"count"},_O=[us(()=>l.createElementVNode("img",{src:S7,alt:""},null,-1))],kO={class:"checkutl"},TO={class:"label"},SO=us(()=>l.createElementVNode("img",{src:I_,alt:""},null,-1)),CO=["onClick"],xO=us(()=>l.createElementVNode("img",{src:C7,alt:""},null,-1)),Yp=Mt({__name:"AddressBook",props:{inviteList:{type:Array,default:()=>[]},baseUrl:{type:String,default:""},token:{type:String,default:""},componentType:{type:String,default:""}},emits:["inviteListUpdate","appendInvitePeople"],setup(i,{emit:e}){const t=new wn,n=[{id:0,name:"组织机构"},{id:2,name:"会场列表"},{id:1,name:"常用分组"}],r=i,s=e,a=l.ref(!1),o=l.ref(0),c=l.ref(""),u=l.ref(),d=l.ref(),h=l.ref(),b=l.reactive({arr:[],usualArr:[],meetingArr:[]}),v=l.ref([]),y=l.ref([]),p=l.ref(!1),f=l.ref(!1),m=l.ref([]),_=l.computed(()=>f.value?n.filter(Z=>Z.id!==2):n);l.watch(f,Z=>{Z&&o.value===2&&(o.value=0)});const k=l.computed(()=>m.value.length),D=l.computed(()=>m.value.length>0?m.value.filter(Z=>Z.sourceTab===o.value).map(Z=>o.value===2?Z.id??Z.uri??Z.userId:Z.userId):[]),E=async Z=>{c.value="";const _e=[],Te=new Map;(r.inviteList||[]).forEach(Ue=>{const We={...Ue};if(We.uri){We.id=We.id??We.uri,(We.sourceTab===void 0||We.sourceTab===null)&&(We.sourceTab=2);const pe=We.id;Te.has(pe)||(Te.set(pe,!0),_e.push(We))}else{(We.sourceTab===void 0||We.sourceTab===null)&&(We.sourceTab=0);const pe=We.userId;Te.has(pe)||(Te.set(pe,!0),_e.push(We))}}),m.value=_e,a.value=!0,Z?(p.value=Z.isInner,f.value=Z.isVolte||!1,f.value&&(m.value=[],await l.nextTick(),u.value&&u.value.setCheckedKeys([],!1),d.value&&d.value.setCheckedKeys([],!1))):(p.value=!1,f.value=!1)};(r.componentType==="meeting"||r.componentType==="")&&ut.on("getaddressBookUserForMeeting",E),(r.componentType==="voiceBroadcast"||r.componentType==="")&&ut.on("getaddressBookUserForVoiceBroadcast",E),(r.componentType==="preview"||r.componentType==="")&&ut.on("getaddressBookUserForPreview",E),(r.componentType==="addressBook"||r.componentType==="")&&ut.on("getaddressBookUserForAddressBook",E),r.componentType===""&&ut.on("getaddressBookUser",E);const A=Z=>{m.value.findIndex(_e=>_e.userId===Z.userId)===-1&&m.value.push(Z)},w=Z=>{const _e=m.value.findIndex(Te=>Te.userId===Z);_e!==-1&&m.value.splice(_e,1)},N=()=>{ut.emit("getinvitTions")},S=()=>{ut.emit("groupAddOpen")},P=(Z,_e)=>Z?o.value===2?_e.name.includes(Z):_e.label.includes(Z):!0,F=(Z,_e)=>{let Te;if(_e!==void 0?Te=_e:(Z==null?void 0:Z.type)==="SITE_TYPE_IP"||(Z==null?void 0:Z.type)==="SITE_TYPE_SIP"?Te=2:(Z==null||Z.classify,Te=0),(Z==null?void 0:Z.classify)==="人员")return{userId:Z.id,userName:Z.label,mobile:Z.phone,sourceTab:Te,...Z};if((Z==null?void 0:Z.type)==="SITE_TYPE_IP"||(Z==null?void 0:Z.type)==="SITE_TYPE_SIP")return{userId:Z.uri,userName:Z.name,mobile:Z.ipAddress,label:Z.name,id:Z.uri,classify:"会场",sourceTab:Te,...Z};{const Ue={userId:Z.id,userName:Z.label,mobile:Z.equipmentCode,sourceTab:Te,...Z};return Ue.mobile=Z.equipmentCode,Ue}},V=async(Z,_e)=>{await l.nextTick();let Te=[];o.value===0?Te=u.value.getCheckedNodes(!0,!1):o.value===2&&(Te=h.value.getCheckedNodes(!0,!1)),m.value=m.value.filter(Ue=>Ue.sourceTab!==o.value),Te.forEach(Ue=>{const We=F(Ue,o.value);A(We)})},J=async()=>{await l.nextTick();let Z=d.value.getCheckedNodes(!0,!1).filter(_e=>_e.label.includes(c.value)&&!_e.children);y.value=Z.map(_e=>F(_e)),console.log("所有选中节点(常用分组)",y.value)},ie=()=>new Promise((Z,_e)=>{uy({},{baseUrl:r.baseUrl,token:r.token}).then(Te=>{var Ue,We;console.log("获取通讯录组织树",Te),((Ue=Te.data)==null?void 0:Ue.code)===0?(We=Te.data)!=null&&We.data&&(b.arr=Te.data.data,Z()):(t.message("error","获取通讯录组织数据失败"),_e())})}),X=()=>new Promise((Z,_e)=>{N8({},{baseUrl:r.baseUrl,token:r.token}).then(Te=>{console.log("获取常用组织树",Te),Te.data&&Te.data.length>=0?(b.usualArr=Te.data,Z()):(b.usualArr=[],_e())})}),H=()=>new Promise((Z,_e)=>{B8({},{baseUrl:r.baseUrl,token:r.token}).then(Te=>{var Ue,We,pe;console.log("获取会场列表",Te),((Ue=Te.data)==null?void 0:Ue.code)===0?(We=Te.data)!=null&&We.data&&Array.isArray(Te.data.data)?(b.meetingArr=Te.data.data.map(Ne=>({...Ne,id:Ne.uri,name:Ne.name||Ne.uri,label:Ne.name||Ne.uri})),console.log("会场列表数据已加载:",b.meetingArr),Z()):(console.log("会场列表数据为空或格式不正确:",Te.data),b.meetingArr=[],Z()):(console.error("获取会场列表失败:",Te.data),t.message("error",`获取会场列表数据失败: ${((pe=Te.data)==null?void 0:pe.msg)||"未知错误"}`),b.meetingArr=[],_e())}).catch(Te=>{console.error("获取会场列表API调用失败:",Te),t.message("error","获取会场列表失败,请检查网络连接"),b.meetingArr=[],_e(Te)})}),$=Z=>{const _e=hx(17);A({userName:Z.name,userId:_e,mobile:Z.phone,id:_e,label:Z.name,phone:Z.phone,classify:"人员"})},j=Z=>{let _e={name:Z.name,sort:Z.sort,userList:k.value>0?m.value.map(Te=>{const Ue=JSON.parse(JSON.stringify(Te));return delete Ue.userId,delete Ue.userName,delete Ue.mobile,Ue}):[]};P8(_e,{baseUrl:r.baseUrl,token:r.token}).then(async Te=>{Te.data.code==0?(t.message("success","添加到常用分组成功"),await X(),await l.nextTick(),d.value.setCheckedKeys(D.value,!1),y.value=d.value.getCheckedNodes(!0,!1).map(Ue=>F(Ue))):_e.userList.length<=0&&t.message("error","添加到常用分组失败,请先勾选要添加的用户")})},B=Z=>{ut.emit("groupEditOpen",{groupId:Z.id,label:Z.label,sort:Z.sort})},q=Z=>{console.log("编辑分组确认",Z);let _e={id:Z.groupId,name:Z.name,sort:Z.sort};O8(_e,{baseUrl:r.baseUrl,token:r.token}).then(async Te=>{console.log("更新常用分组",Te),Te.data.code==0&&(t.message("success","分组更新成功"),await X(),await l.nextTick(),d.value.setCheckedKeys(D.value,!1),y.value=d.value.getCheckedNodes(!0,!1).map(Ue=>F(Ue)))})},z=Z=>{M8(Z.id,{baseUrl:r.baseUrl,token:r.token}).then(async _e=>{console.log("删除分组",_e),_e.data.code===0&&(t.message("success","删除分组成功"),await X(),await l.nextTick(),d.value.setCheckedKeys(D.value,!1),y.value=d.value.getCheckedNodes(!0,!1).map(Te=>F(Te)))})},oe=Z=>{w(Z.userId),o.value===0?(u.value.setCheckedKeys(D.value,!1),v.value=u.value.getCheckedNodes(!0,!1).map(_e=>F(_e))):o.value===2?h.value.setCheckedKeys(D.value,!1):(d.value.setCheckedKeys(D.value,!1),y.value=d.value.getCheckedNodes(!0,!1).map(_e=>F(_e)))},we=()=>{m.value=[],a.value=!1},be=()=>{f.value?m.value.forEach(Z=>{ut.emit("startVideoCall",Z.mobile)}):(s("inviteListUpdate",m.value),p.value&&s("appendInvitePeople",m.value)),a.value=!1};return l.watch(()=>c.value,async Z=>{await l.nextTick(),o.value===0?u.value.filter(Z):o.value===2?h.value.filter(Z):d.value.filter(Z)}),l.watch(()=>a.value,async Z=>{Z&&(await ie(),await X(),await H(),await l.nextTick(),o.value===0?(console.log("inviteKeysNum",k.value),u.value.setCheckedKeys(D.value,!0),v.value=u.value.getCheckedNodes(!0,!1).map(_e=>F(_e))):o.value===2?h.value.setCheckedKeys(D.value,!0):(d.value.setCheckedKeys(D.value,!0),y.value=d.value.getCheckedNodes(!0,!1).map(_e=>F(_e))))}),l.watch(()=>o.value,async Z=>{await l.nextTick(),console.log("newActiveIndex",Z),Z===0?(console.log("inviteKeysNum",k.value),k.value>0?(u.value.setCheckedKeys(D.value,!1),v.value=u.value.getCheckedNodes(!0,!1).map(_e=>F(_e))):(b.arr=b.arr,v.value=[]),u.value.filter(c.value)):Z===2?((!b.meetingArr||b.meetingArr.length===0)&&await H(),await l.nextTick(),k.value>0&&h.value.setCheckedKeys(D.value,!1),h.value.filter(c.value)):(k.value>0?(d.value.setCheckedKeys(D.value,!1),y.value=d.value.getCheckedNodes(!0,!1).map(_e=>F(_e))):(b.usualArr=b.usualArr,y.value=[]),d.value.filter(c.value))}),l.watch(()=>v.value,(Z,_e)=>{console.log("checkedNodes",Z,_e),Z.length>0&&Z.forEach(Te=>{A(Te)}),console.log("inviteList111",m.value),console.log("inviteList222",m.value)},{deep:!0}),l.watch(()=>y.value,(Z,_e)=>{console.log("usualCheckedNodes",Z,_e),Z.length>0&&Z.forEach(Te=>{A(Te)}),console.log("inviteList111111",m.value),console.log("inviteList222222",m.value)},{deep:!0}),(Z,_e)=>{const Te=l.resolveComponent("el-input"),Ue=l.resolveComponent("el-tree"),We=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createElementVNode("div",j7,[l.createVNode(We,{modelValue:a.value,"onUpdate:modelValue":_e[2]||(_e[2]=pe=>a.value=pe),"show-close":!1,class:"addresslogClass",width:"878"},{header:l.withCtx(()=>[l.createElementVNode("div",$7,[l.createElementVNode("div",H7,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(_.value,pe=>(l.openBlock(),l.createElementBlock("div",{key:pe.id,class:l.normalizeClass(["tabItem",o.value==pe.id?"activeBorder":""]),onClick:Ne=>o.value=pe.id},l.toDisplayString(pe.name),11,q7))),128))]),l.createElementVNode("div",{class:"close",onClick:_e[0]||(_e[0]=pe=>a.value=!1)})])]),default:l.withCtx(()=>[z7,l.createElementVNode("div",G7,[l.createElementVNode("div",W7,[l.createVNode(Te,{class:"search-input",modelValue:c.value,"onUpdate:modelValue":_e[1]||(_e[1]=pe=>c.value=pe),placeholder:"请输入名称进行搜索"},{suffix:l.withCtx(()=>[K7]),_:1},8,["modelValue"]),l.withDirectives(l.createVNode(Ue,{ref_key:"treeRef",ref:u,class:"tree-content","show-checkbox":"","node-key":"id",data:b.arr,onCheck:V,"filter-node-method":P},{default:l.withCtx(({node:pe,data:Ne})=>[l.createElementVNode("span",X7,[Ne.children?(l.openBlock(),l.createElementBlock("span",{key:0,class:"custom-tree-node-label",title:pe.label},l.toDisplayString(pe.label),9,Y7)):(l.openBlock(),l.createElementBlock("span",J7,[Q7,l.createElementVNode("span",{class:"custom-tree-node-label",title:pe.label},l.toDisplayString(pe.label),9,Z7)]))])]),_:1},8,["data"]),[[l.vShow,o.value===0]]),l.withDirectives(l.createVNode(Ue,{ref_key:"meetingHomeRef",ref:h,class:"custom-tree","show-checkbox":"","node-key":"id",data:b.meetingArr,onCheck:V,"filter-node-method":P},{default:l.withCtx(({node:pe,data:Ne})=>[l.createElementVNode("div",eO,[l.createElementVNode("span",tO,[Ne.children?pe.expanded?(l.openBlock(),l.createElementBlock("img",{key:1,src:Z.splic,alt:""},null,8,iO)):(l.openBlock(),l.createElementBlock("img",{key:2,src:Z.add,alt:""},null,8,rO)):(l.openBlock(),l.createElementBlock("img",{key:0,src:l.unref(I_),class:"user"},null,8,nO))]),l.createElementVNode("div",sO,[l.createElementVNode("div",aO,l.toDisplayString(Ne.name),1)])])]),_:1},8,["data"]),[[l.vShow,o.value===2]]),l.withDirectives(l.createVNode(Ue,{ref_key:"treeUsualRef",ref:d,class:"tree-content","show-checkbox":"","node-key":"id",data:b.usualArr,onCheck:J,"filter-node-method":P},{default:l.withCtx(({node:pe,data:Ne})=>[l.createElementVNode("span",oO,[Ne.children?(l.openBlock(),l.createElementBlock("div",lO,[l.createElementVNode("span",{class:"custom-tree-node-label",title:pe.label},l.toDisplayString(pe.label),9,cO),Ne.children?(l.openBlock(),l.createElementBlock("div",uO,[l.createElementVNode("div",{class:"node-option",onClick:nt=>B(Ne)}," 编辑 ",8,dO),l.createElementVNode("div",{class:"node-option",onClick:nt=>z(Ne)}," 删除 ",8,hO)])):l.createCommentVNode("",!0)])):(l.openBlock(),l.createElementBlock("span",fO,[pO,l.createElementVNode("span",{class:"custom-tree-node-label",title:pe.label},l.toDisplayString(pe.label),9,mO)]))])]),_:1},8,["data"]),[[l.vShow,o.value===1]])]),l.createElementVNode("div",gO,[l.createElementVNode("div",vO,[yO,l.createElementVNode("div",bO,l.toDisplayString(k.value),1),l.createElementVNode("div",{class:"adds",onClick:N},_O)]),l.createElementVNode("div",kO,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(m.value,pe=>(l.openBlock(),l.createElementBlock("div",{key:pe.userId??pe.id??pe.uri,class:"userFlex"},[l.createElementVNode("div",TO,[SO,l.createTextVNode(" "+l.toDisplayString(pe.userName||pe.name),1)]),l.createElementVNode("div",{class:"close",onClick:Ne=>oe(pe)},null,8,CO)]))),128))])])]),l.createElementVNode("div",{class:"footersFull"},[l.createElementVNode("div",{class:"addfz",onClick:S},[xO,l.createTextVNode(" 添加分组 ")]),l.createElementVNode("div",{class:"isokmul"},[l.createElementVNode("div",{onClick:we},"取消"),l.createElementVNode("div",{onClick:be},"确定")])])]),_:1},8,["modelValue"])]),l.createVNode(I7,{onInviteConfirm:$}),l.createVNode(R7,{onAddGroupConfirm:j}),l.createVNode(V7,{onEditGroupConfirm:q})],64)}}},[["__scopeId","data-v-b45f3337"]]),EO=["onClick"],wO=Mt({__name:"PreviewMoreOption",props:{previewMeetingData:{type:Object},optionDialogOffset:{type:Object,default:{left:"0px",top:"0px"}},mobile:{type:String,default:""}},emits:["close","endMeeting","checkMeetingDetail","updateMeetingDetail","cancelMeeting"],setup(i,{emit:e}){const t=i,n=e,r=l.computed(()=>{var a,o;if(((a=t.previewMeetingData)==null?void 0:a.status)==0)return t.mobile===t.previewMeetingData.owner?["查看会议详情","修改会议信息","取消会议"]:["查看会议详情"];if(((o=t.previewMeetingData)==null?void 0:o.status)==1)return t.mobile===t.previewMeetingData.owner?["查看会议详情","结束会议"]:["查看会议详情"]}),s=a=>{switch(a){case"查看会议详情":n("checkMeetingDetail",t.previewMeetingData);break;case"修改会议信息":n("updateMeetingDetail",t.previewMeetingData);break;case"取消会议":n("cancelMeeting",t.previewMeetingData);break;case"结束会议":n("endMeeting",t.previewMeetingData);break}n("close")};return l.onMounted(()=>{}),(a,o)=>(l.openBlock(),l.createElementBlock("div",{class:"more-option",style:l.normalizeStyle(t.optionDialogOffset)},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(r.value,(c,u)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["more-option-item",{"more-option-item-danger":c==="结束会议"}]),key:"o"+u,onClick:d=>s(c)},l.toDisplayString(c),11,EO))),128))],4))}},[["__scopeId","data-v-a2b8a447"]]),DO="/assets/img/entry/preview_dialog_logo.png",Cl=i=>(l.pushScopeId("data-v-5376302e"),i=i(),l.popScopeId(),i),AO={class:"dialog-head"},IO={class:"dialog-head-group"},NO=Cl(()=>l.createElementVNode("img",{class:"dialog-logo",src:DO},null,-1)),PO={class:"dialog-head-group"},OO={class:"dialog-contain"},MO={class:"box-form"},RO={class:"yaoq"},LO=Cl(()=>l.createElementVNode("div",{class:"yaoq-title"},"邀请参会人",-1)),BO={class:"invite-list"},UO=[Cl(()=>l.createElementVNode("div",{class:"icon"},null,-1))],FO=Cl(()=>l.createElementVNode("div",{class:"split"},"...",-1)),VO={class:"badge"},jO=[Cl(()=>l.createElementVNode("div",{class:"icon"},null,-1))],$O={class:"time-range"},HO={class:"time-range"},qO={class:"meeting-remind"},zO={class:"meeting-remind-wrap"},GO=["onClick"],WO={key:1},KO={class:"meeting-setter"},XO={key:0,class:"foot-btns"},YO=Mt({__name:"PreviewMeetingDialog",props:{width:{type:String,default:"auto"},height:{type:String,default:"auto"},title:{type:String,default:"发起会议"},previewType:{type:String,default:"add"},previewMeetingData:{type:Object,default:()=>({})},userData:{type:Object,default:()=>({})},org:{type:String,default:"default"},baseUrl:{type:String,default:""},inviteList:{type:Array,default:()=>[]},token:{type:String,default:""}},emits:["close","previewSuccess","updateSuccess","previewResetInviteList","previewUpdateInviteList"],setup(i,{emit:e}){const t=e,n=i;let r=null;const s=new wn,a=l.reactive({roomName:"",venueName:"",organizingUnit:"",beginDate:"",beginTime:"",endDate:"",endTime:"",timeZone:"",joinBeforeHostEnabled:!1,inviteOtherEnabled:!1,joinMute:!1,autoRecord:!1}),o=l.ref(),c=l.ref([{label:"(GMT+8:00)中国标准时间-北京",value:"Asia/Shanghai"}]),u=l.ref([{remind:0,unit:"min"}]),d=l.ref([{label:"分钟",value:"min"},{label:"小时",value:"h"}]),h=l.computed(()=>n.inviteList.length),b=()=>{n.previewType!=="detail"&&ut.emit("getaddressBookUserForPreview")},v=E=>{u.value.length<=1?s.message("info","至少保留一条数据"):u.value.splice(E,1)},y=()=>{u.value.push({remind:0,unit:"min"})},p=()=>{const E=Qn(a.beginDate).format("YYYY-MM-DD")+" "+Qn(Qn(a.beginDate).format("YYYY-MM-DD")+" "+a.beginTime).format("HH:mm:ss"),A=Qn(a.endDate).format("YYYY-MM-DD")+" "+Qn(Qn(a.endDate).format("YYYY-MM-DD")+" "+a.endTime).format("HH:mm:ss");return a.roomName.length<=0?(s.message("error","会议主题不能为空"),!1):a.roomName.length>20?(s.message("error","会议主题字数不能超过20个字符"),!1):a.beginDate?a.beginTime?a.endDate?a.endTime?new Date(E).getTime()-Date.now()<=0?(s.message("error","开始时间不能在当前时间之前"),!1):new Date(A).getTime()-new Date(E).getTime()<0?(s.message("error","结束时间不能在开始时间之前"),!1):a.timeZone?(a.beginFullTime=E,a.endFullTime=A,!0):(s.message("error","时区不能为空"),!1):(s.message("error","会议结束时间不能为空"),!1):(s.message("error","会议结束日期不能为空"),!1):(s.message("error","会议开始时间不能为空"),!1):(s.message("error","会议开始日期不能为空"),!1)};function f(){t("previewResetInviteList"),t("close")}const m=()=>{let E=[],A=[];if(h.value>0?(E=(n.inviteList||[]).filter(S=>!(S!=null&&S.uri)).map(S=>(S==null?void 0:S.classify)==="人员"?{userId:S==null?void 0:S.userId,org:n.org,userName:S==null?void 0:S.userName,officeName:S==null?void 0:S.officeName,metadata:{phone:S.mobile,classify:S.classify}}:{userId:S==null?void 0:S.userId,org:n.org,userName:S==null?void 0:S.userName,officeName:S==null?void 0:S.officeName,metadata:{classify:S==null?void 0:S.classify,phone:"",equipmentCode:S==null?void 0:S.mobile,equipmentPassword:S==null?void 0:S.equipmentPassword,equipmentType:S==null?void 0:S.equipmentType}}),E.findIndex(S=>S.metadata.classify==="人员"&&S.metadata.phone==n.userData.mobile)<0&&E.push({userId:n.userData.userId,userName:n.userData.username,phone:n.userData.mobile,org:n.org,metadata:{phone:n.userData.mobile,classify:"人员"}})):E.push({userId:n.userData.userId,userName:n.userData.username,phone:n.userData.mobile,org:n.org,metadata:{phone:n.userData.mobile,classify:"人员"}}),u.value.length>0?(u.value.forEach(w=>{w.remind&&(w.unit=="min"?A.push(Number(w.remind)+"m"):A.push(Number(w.remind)+"h"))}),A=Array.from(new Set(A))):A=[],p()){console.log("beginFullTime111",a.beginTime),console.log("endFullTime111",a.endTime);const w={owner:n.userData.mobile,ownerName:n.userData.username,roomAlias:a.roomName,phone:n.userData.mobile,org:n.org,inviteParticipants:E,appointmentStart:new Date(a.beginFullTime).toISOString(),appointmentEnd:new Date(a.endFullTime).toISOString(),zone:a.timeZone,joinBefore:a.joinBeforeHostEnabled,inviteOther:a.inviteOtherEnabled,mute:a.joinMute,autoRecord:a.autoRecord,preMeetingNotify:A.join(","),metadata:{venueName:a.venueName,meetingCompany:a.organizingUnit}};A8(w,{baseUrl:r.baseUrl,token:n.token}).then(N=>{if((N==null?void 0:N.data.code)===200){s.message("success","会议预约成功");try{const S=Array.isArray(n.inviteList)?n.inviteList.filter(P=>P&&P.uri):[];S.length>0&&dy(N.data.data,S,{baseUrl:n.baseUrl,token:n.token}).catch(P=>console.error("scheduleConf error",P))}catch(S){console.error(S)}t("previewSuccess"),t("close")}})}},_=()=>{let E=[],A=[];if(h.value>0?(E=(n.inviteList||[]).filter(S=>!(S!=null&&S.uri)).map(S=>(S==null?void 0:S.classify)==="人员"?{userId:S==null?void 0:S.userId,userName:S==null?void 0:S.userName,officeName:S==null?void 0:S.officeName,org:n.org,metadata:{classify:S==null?void 0:S.classify,phone:S==null?void 0:S.mobile}}:{userId:S==null?void 0:S.userId,userName:S==null?void 0:S.userName,officeName:S==null?void 0:S.officeName,org:n.org,metadata:{classify:S==null?void 0:S.classify,phone:"",equipmentCode:S==null?void 0:S.mobile,equipmentPassword:S==null?void 0:S.equipmentPassword,equipmentType:S==null?void 0:S.equipmentType}}),E.findIndex(S=>S.metadata.classify==="人员"&&S.metadata.phone==n.userData.mobile)<0&&E.push({userId:n.userData.userId,userName:n.userData.username,phone:n.userData.mobile,org:n.org,metadata:{phone:n.userData.mobile,classify:"人员"}})):E.push({userId:n.userData.userId,userName:n.userData.username,phone:n.userData.mobile,org:n.org,metadata:{phone:n.userData.mobile,classify:"人员"}}),u.value.length>0?(u.value.forEach(w=>{w.remind&&(w.unit=="min"?A.push(Number(w.remind)+"m"):A.push(Number(w.remind)+"h"))}),A=Array.from(new Set(A))):A=[],p()){const w={room:n.previewMeetingData.roomNum,owner:n.userData.mobile,ownerName:n.userData.username,roomAlias:a.roomName,phone:n.userData.mobile,org:n.org,inviteParticipants:E,appointmentStart:new Date(a.beginFullTime).toISOString(),appointmentEnd:new Date(a.endFullTime).toISOString(),zone:a.timeZone,joinBefore:a.joinBeforeHostEnabled,inviteOther:a.inviteOtherEnabled,mute:a.joinMute,autoRecord:a.autoRecord,preMeetingNotify:A.join(","),metadata:{venueName:a.venueName,meetingCompany:a.organizingUnit}};I8(w,{baseUrl:r.baseUrl,token:n.token}).then(N=>{console.log("修改预约会议",N),(N==null?void 0:N.data.code)===200&&(s.message("success","更新预约成功"),t("updateSuccess"),t("close"))})}},k=(E,A)=>{typeof E=="string"&&Number(E)<0&&(u.value[A].remind=0)};function D(){r=window.liveClient}return l.onMounted(async()=>{if(D(),n.previewType==="add")t("previewResetInviteList");else if(n.previewType==="edit"||n.previewType==="detail"){console.log("传参",n.previewMeetingData),a.roomName=n.previewMeetingData.roomName,a.beginDate=Qn(n.previewMeetingData.beginFullTime).format("YYYY/MM/DD"),a.beginTime=Qn(n.previewMeetingData.beginFullTime).format("HH:mm"),a.endDate=Qn(n.previewMeetingData.endFullTime).format("YYYY/MM/DD"),a.endTime=Qn(n.previewMeetingData.endFullTime).format("HH:mm"),a.venueName=n.previewMeetingData.venueName,a.organizingUnit=n.previewMeetingData.meetingCompany,a.timeZone=n.previewMeetingData.zone,a.joinBeforeHostEnabled=n.previewMeetingData.joinBefore,a.inviteOtherEnabled=n.previewMeetingData.inviteOthers,a.joinMute=n.previewMeetingData.joinMute,a.autoRecord=n.previewMeetingData.autoRecord;const E=n.previewMeetingData.preMeetingNotify.split(",");E.length>0&&(u.value=[],E.forEach(A=>{A.endsWith("m")?u.value.push({remind:A.substring(0,A.length-1),unit:"min"}):u.value.push({remind:A.substring(0,A.length-1),unit:"h"})})),cy({roomName:n.previewMeetingData.roomNum},{baseUrl:n.baseUrl,token:n.token}).then(A=>{if(console.log("获取预约邀请人列表",A),A.data.code===0)if(A.data.data.length>0){const w=A.data.data.filter(N=>JSON.parse(N.metadata).phone!==n.userData.mobile).map(N=>{const S=JSON.parse(N.metadata);return S.classify==="人员"?{classify:S.classify,userName:N.userName,userId:N.userId,mobile:S.phone,officeName:N.officeName,id:N.userId,label:N.userName,phone:S.phone,sourceTab:0}:{classify:S.classify,userName:N.userName,userId:N.userId,mobile:S.equipmentCode,officeName:N.officeName,phone:S.phone,equipmentCode:S.equipmentCode,equipmentPassword:S.equipmentPassword,equipmentType:S.equipmentType,id:N.userId,label:N.userName,sourceTab:0}});t("previewUpdateInviteList",w)}else t("previewUpdateInviteList",[]);else s.message("error","获取被邀请人列表失败"),t("previewUpdateInviteList",[])}),hy(n.previewMeetingData.roomNum,{baseUrl:n.baseUrl,token:n.token}).then(A=>{var w,N;((w=A==null?void 0:A.data)==null?void 0:w.code)===0&&Array.isArray((N=A==null?void 0:A.data)==null?void 0:N.data)&&t("previewUpdateInviteList",[...n.inviteList,...A.data.data])}).catch(A=>console.error("queryConfSitesStatus error",A))}}),l.onBeforeUnmount(()=>{}),(E,A)=>{const w=l.resolveComponent("el-input"),N=l.resolveComponent("el-form-item"),S=l.resolveComponent("el-date-picker"),P=l.resolveComponent("el-time-select"),F=l.resolveComponent("el-option"),V=l.resolveComponent("el-select"),J=l.resolveComponent("el-checkbox"),ie=l.resolveComponent("el-form");return l.openBlock(),l.createElementBlock("div",{class:"mask",onClick:A[14]||(A[14]=l.withModifiers(X=>t("close"),["self"]))},[l.createElementVNode("div",{class:"dialog",style:l.normalizeStyle({width:n.width,height:n.height})},[l.createElementVNode("div",AO,[l.createElementVNode("div",IO,[NO,l.createElementVNode("span",null,l.toDisplayString(n.title),1)]),l.createElementVNode("div",PO,[l.createElementVNode("div",{class:"close-icon",onClick:A[0]||(A[0]=X=>t("close"))})])]),l.createElementVNode("div",OO,[l.createElementVNode("div",MO,[l.createVNode(ie,{model:a,"hide-required-asterisk":"",ref_key:"previewForm",ref:o,"label-width":"100","label-position":"right",class:"customForm"},{default:l.withCtx(()=>[l.createVNode(N,{label:"会议主题"},{default:l.withCtx(()=>[l.createVNode(w,{modelValue:a.roomName,"onUpdate:modelValue":A[1]||(A[1]=X=>a.roomName=X),disabled:n.previewType==="detail",placeholder:"请输入"},null,8,["modelValue","disabled"])]),_:1}),l.createVNode(N,{label:"会场名称"},{default:l.withCtx(()=>[l.createVNode(w,{modelValue:a.venueName,"onUpdate:modelValue":A[2]||(A[2]=X=>a.venueName=X),disabled:n.previewType==="detail",placeholder:"请输入"},null,8,["modelValue","disabled"])]),_:1}),l.createVNode(N,{label:"组会单位"},{default:l.withCtx(()=>[l.createVNode(w,{modelValue:a.organizingUnit,"onUpdate:modelValue":A[3]||(A[3]=X=>a.organizingUnit=X),disabled:n.previewType==="detail",placeholder:"请输入"},null,8,["modelValue","disabled"])]),_:1}),l.createElementVNode("div",RO,[LO,l.createElementVNode("div",BO,[h.value<=3?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.inviteList,(X,H)=>(l.openBlock(),l.createElementBlock("div",{class:"invite-list-item invite-list-item-user",key:"i"+H}))),128)),l.createElementVNode("div",{class:"invite-list-item invite-list-item-system",onClick:b},UO)],64)):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.inviteList.slice(0,3),(X,H)=>(l.openBlock(),l.createElementBlock("div",{class:"invite-list-item invite-list-item-user",key:"i"+H}))),128)),FO,l.createElementVNode("div",VO,l.toDisplayString(h.value),1),l.createElementVNode("div",{class:"invite-list-item invite-list-item-system",onClick:b},jO)],64))])]),l.createVNode(N,{label:"开始时间"},{default:l.withCtx(()=>[l.createElementVNode("div",$O,[l.createVNode(S,{modelValue:a.beginDate,"onUpdate:modelValue":A[4]||(A[4]=X=>a.beginDate=X),disabled:n.previewType==="detail",type:"date",placeholder:"请选择",format:"YYYY/MM/DD",style:{"margin-right":"10px"}},null,8,["modelValue","disabled"]),l.createVNode(P,{modelValue:a.beginTime,"onUpdate:modelValue":A[5]||(A[5]=X=>a.beginTime=X),disabled:n.previewType==="detail",style:{width:"50%"},start:"00:00",step:"00:30",end:"23:59",placeholder:"请选择"},null,8,["modelValue","disabled"])])]),_:1}),l.createVNode(N,{label:"结束时间"},{default:l.withCtx(()=>[l.createElementVNode("div",HO,[l.createVNode(S,{modelValue:a.endDate,"onUpdate:modelValue":A[6]||(A[6]=X=>a.endDate=X),disabled:n.previewType==="detail",type:"date",placeholder:"请选择",format:"YYYY/MM/DD",style:{"margin-right":"5px"}},null,8,["modelValue","disabled"]),l.createVNode(P,{modelValue:a.endTime,"onUpdate:modelValue":A[7]||(A[7]=X=>a.endTime=X),disabled:n.previewType==="detail",style:{width:"50%"},start:"00:00",step:"00:30",end:"23:59",placeholder:"请选择"},null,8,["modelValue","disabled"])])]),_:1}),l.createVNode(N,{label:"时区"},{default:l.withCtx(()=>[l.createVNode(V,{modelValue:a.timeZone,"onUpdate:modelValue":A[8]||(A[8]=X=>a.timeZone=X),disabled:n.previewType==="detail",placeholder:"请选择"},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(c.value,X=>(l.openBlock(),l.createBlock(F,{key:X.value,label:X.label,value:X.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","disabled"])]),_:1}),l.createVNode(N,{label:"会前提醒"},{default:l.withCtx(()=>[l.createElementVNode("div",qO,[l.createElementVNode("div",zO,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(u.value,(X,H)=>(l.openBlock(),l.createElementBlock("div",{class:"meeting-remind-list",key:"r"+H},[l.createVNode(w,{modelValue:X.remind,"onUpdate:modelValue":$=>X.remind=$,type:"number",disabled:n.previewType==="detail",style:{width:"90px","margin-right":"10px"},min:0,onInput:$=>k($,H)},null,8,["modelValue","onUpdate:modelValue","disabled","onInput"]),l.createVNode(V,{modelValue:X.unit,"onUpdate:modelValue":$=>X.unit=$,disabled:n.previewType==="detail",placeholder:"请选择",style:{width:"68px","margin-right":"10px"}},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(d.value,$=>(l.openBlock(),l.createBlock(F,{key:$.value,label:$.label,value:$.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","disabled"]),n.previewType!=="detail"?(l.openBlock(),l.createElementBlock("div",{key:0,class:"del-btn",onClick:$=>v(H)}," 删除 ",8,GO)):l.createCommentVNode("",!0)]))),128))]),n.previewType!=="detail"?(l.openBlock(),l.createElementBlock("div",{key:0,class:"btn-add",onClick:A[9]||(A[9]=X=>y())}," 添加提醒 ")):(l.openBlock(),l.createElementBlock("div",WO))])]),_:1}),l.createVNode(N,{label:"会议设置"},{default:l.withCtx(()=>[l.createElementVNode("div",KO,[l.createVNode(J,{modelValue:a.joinBeforeHostEnabled,"onUpdate:modelValue":A[10]||(A[10]=X=>a.joinBeforeHostEnabled=X),disabled:n.previewType==="detail",label:"允许在主持人入会之前加入"},null,8,["modelValue","disabled"]),l.createVNode(J,{modelValue:a.inviteOtherEnabled,"onUpdate:modelValue":A[11]||(A[11]=X=>a.inviteOtherEnabled=X),disabled:n.previewType==="detail",label:"允许参会者邀请其他人"},null,8,["modelValue","disabled"]),l.createVNode(J,{modelValue:a.joinMute,"onUpdate:modelValue":A[12]||(A[12]=X=>a.joinMute=X),disabled:n.previewType==="detail",label:"参会人加入会议时静音"},null,8,["modelValue","disabled"]),l.createVNode(J,{modelValue:a.autoRecord,"onUpdate:modelValue":A[13]||(A[13]=X=>a.autoRecord=X),disabled:n.previewType==="detail",label:"自动录制"},null,8,["modelValue","disabled"])])]),_:1})]),_:1},8,["model"]),n.previewType!=="detail"?(l.openBlock(),l.createElementBlock("div",XO,[l.createElementVNode("div",{class:"btn btn-cancel",onClick:f},"取消"),n.previewType==="add"?(l.openBlock(),l.createElementBlock("div",{key:0,class:"btn btn-confirm",onClick:m}," 预约会议 ")):l.createCommentVNode("",!0),n.previewType==="edit"?(l.openBlock(),l.createElementBlock("div",{key:1,class:"btn btn-confirm",onClick:_}," 修改预约 ")):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)])])],4)])}}},[["__scopeId","data-v-5376302e"]]),JO="/assets/img/index/jx.png",N_="/assets/img/index/sjt.png",P_="/assets/img/meeting/setting.png";function Rt(i,e,t){return e=lt(e),function(n,r){if(r&&(typeof r=="object"||typeof r=="function"))return r;if(r!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ct(n)}(i,Jp()?Reflect.construct(e,t||[],lt(i).constructor):e.apply(i,t))}function Jp(){try{var i=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Jp=function(){return!!i})()}function L(){L=function(){return e};var i,e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(H,$,j){H[$]=j.value},s=typeof Symbol=="function"?Symbol:{},a=s.iterator||"@@iterator",o=s.asyncIterator||"@@asyncIterator",c=s.toStringTag||"@@toStringTag";function u(H,$,j){return Object.defineProperty(H,$,{value:j,enumerable:!0,configurable:!0,writable:!0}),H[$]}try{u({},"")}catch{u=function($,j,B){return $[j]=B}}function d(H,$,j,B){var q=$&&$.prototype instanceof m?$:m,z=Object.create(q.prototype),oe=new ie(B||[]);return r(z,"_invoke",{value:P(H,j,oe)}),z}function h(H,$,j){try{return{type:"normal",arg:H.call($,j)}}catch(B){return{type:"throw",arg:B}}}e.wrap=d;var b="suspendedStart",v="suspendedYield",y="executing",p="completed",f={};function m(){}function _(){}function k(){}var D={};u(D,a,function(){return this});var E=Object.getPrototypeOf,A=E&&E(E(X([])));A&&A!==t&&n.call(A,a)&&(D=A);var w=k.prototype=m.prototype=Object.create(D);function N(H){["next","throw","return"].forEach(function($){u(H,$,function(j){return this._invoke($,j)})})}function S(H,$){function j(q,z,oe,we){var be=h(H[q],H,z);if(be.type!=="throw"){var Z=be.arg,_e=Z.value;return _e&&typeof _e=="object"&&n.call(_e,"__await")?$.resolve(_e.__await).then(function(Te){j("next",Te,oe,we)},function(Te){j("throw",Te,oe,we)}):$.resolve(_e).then(function(Te){Z.value=Te,oe(Z)},function(Te){return j("throw",Te,oe,we)})}we(be.arg)}var B;r(this,"_invoke",{value:function(q,z){function oe(){return new $(function(we,be){j(q,z,we,be)})}return B=B?B.then(oe,oe):oe()}})}function P(H,$,j){var B=b;return function(q,z){if(B===y)throw new Error("Generator is already running");if(B===p){if(q==="throw")throw z;return{value:i,done:!0}}for(j.method=q,j.arg=z;;){var oe=j.delegate;if(oe){var we=F(oe,j);if(we){if(we===f)continue;return we}}if(j.method==="next")j.sent=j._sent=j.arg;else if(j.method==="throw"){if(B===b)throw B=p,j.arg;j.dispatchException(j.arg)}else j.method==="return"&&j.abrupt("return",j.arg);B=y;var be=h(H,$,j);if(be.type==="normal"){if(B=j.done?p:v,be.arg===f)continue;return{value:be.arg,done:j.done}}be.type==="throw"&&(B=p,j.method="throw",j.arg=be.arg)}}}function F(H,$){var j=$.method,B=H.iterator[j];if(B===i)return $.delegate=null,j==="throw"&&H.iterator.return&&($.method="return",$.arg=i,F(H,$),$.method==="throw")||j!=="return"&&($.method="throw",$.arg=new TypeError("The iterator does not provide a '"+j+"' method")),f;var q=h(B,H.iterator,$.arg);if(q.type==="throw")return $.method="throw",$.arg=q.arg,$.delegate=null,f;var z=q.arg;return z?z.done?($[H.resultName]=z.value,$.next=H.nextLoc,$.method!=="return"&&($.method="next",$.arg=i),$.delegate=null,f):z:($.method="throw",$.arg=new TypeError("iterator result is not an object"),$.delegate=null,f)}function V(H){var $={tryLoc:H[0]};1 in H&&($.catchLoc=H[1]),2 in H&&($.finallyLoc=H[2],$.afterLoc=H[3]),this.tryEntries.push($)}function J(H){var $=H.completion||{};$.type="normal",delete $.arg,H.completion=$}function ie(H){this.tryEntries=[{tryLoc:"root"}],H.forEach(V,this),this.reset(!0)}function X(H){if(H||H===""){var $=H[a];if($)return $.call(H);if(typeof H.next=="function")return H;if(!isNaN(H.length)){var j=-1,B=function q(){for(;++j<H.length;)if(n.call(H,j))return q.value=H[j],q.done=!1,q;return q.value=i,q.done=!0,q};return B.next=B}}throw new TypeError(typeof H+" is not iterable")}return _.prototype=k,r(w,"constructor",{value:k,configurable:!0}),r(k,"constructor",{value:_,configurable:!0}),_.displayName=u(k,c,"GeneratorFunction"),e.isGeneratorFunction=function(H){var $=typeof H=="function"&&H.constructor;return!!$&&($===_||($.displayName||$.name)==="GeneratorFunction")},e.mark=function(H){return Object.setPrototypeOf?Object.setPrototypeOf(H,k):(H.__proto__=k,u(H,c,"GeneratorFunction")),H.prototype=Object.create(w),H},e.awrap=function(H){return{__await:H}},N(S.prototype),u(S.prototype,o,function(){return this}),e.AsyncIterator=S,e.async=function(H,$,j,B,q){q===void 0&&(q=Promise);var z=new S(d(H,$,j,B),q);return e.isGeneratorFunction($)?z:z.next().then(function(oe){return oe.done?oe.value:z.next()})},N(w),u(w,c,"Generator"),u(w,a,function(){return this}),u(w,"toString",function(){return"[object Generator]"}),e.keys=function(H){var $=Object(H),j=[];for(var B in $)j.push(B);return j.reverse(),function q(){for(;j.length;){var z=j.pop();if(z in $)return q.value=z,q.done=!1,q}return q.done=!0,q}},e.values=X,ie.prototype={constructor:ie,reset:function(H){if(this.prev=0,this.next=0,this.sent=this._sent=i,this.done=!1,this.delegate=null,this.method="next",this.arg=i,this.tryEntries.forEach(J),!H)for(var $ in this)$.charAt(0)==="t"&&n.call(this,$)&&!isNaN(+$.slice(1))&&(this[$]=i)},stop:function(){this.done=!0;var H=this.tryEntries[0].completion;if(H.type==="throw")throw H.arg;return this.rval},dispatchException:function(H){if(this.done)throw H;var $=this;function j(be,Z){return z.type="throw",z.arg=H,$.next=be,Z&&($.method="next",$.arg=i),!!Z}for(var B=this.tryEntries.length-1;B>=0;--B){var q=this.tryEntries[B],z=q.completion;if(q.tryLoc==="root")return j("end");if(q.tryLoc<=this.prev){var oe=n.call(q,"catchLoc"),we=n.call(q,"finallyLoc");if(oe&&we){if(this.prev<q.catchLoc)return j(q.catchLoc,!0);if(this.prev<q.finallyLoc)return j(q.finallyLoc)}else if(oe){if(this.prev<q.catchLoc)return j(q.catchLoc,!0)}else{if(!we)throw new Error("try statement without catch or finally");if(this.prev<q.finallyLoc)return j(q.finallyLoc)}}}},abrupt:function(H,$){for(var j=this.tryEntries.length-1;j>=0;--j){var B=this.tryEntries[j];if(B.tryLoc<=this.prev&&n.call(B,"finallyLoc")&&this.prev<B.finallyLoc){var q=B;break}}q&&(H==="break"||H==="continue")&&q.tryLoc<=$&&$<=q.finallyLoc&&(q=null);var z=q?q.completion:{};return z.type=H,z.arg=$,q?(this.method="next",this.next=q.finallyLoc,f):this.complete(z)},complete:function(H,$){if(H.type==="throw")throw H.arg;return H.type==="break"||H.type==="continue"?this.next=H.arg:H.type==="return"?(this.rval=this.arg=H.arg,this.method="return",this.next="end"):H.type==="normal"&&$&&(this.next=$),f},finish:function(H){for(var $=this.tryEntries.length-1;$>=0;--$){var j=this.tryEntries[$];if(j.finallyLoc===H)return this.complete(j.completion,j.afterLoc),J(j),f}},catch:function(H){for(var $=this.tryEntries.length-1;$>=0;--$){var j=this.tryEntries[$];if(j.tryLoc===H){var B=j.completion;if(B.type==="throw"){var q=B.arg;J(j)}return q}}throw new Error("illegal catch attempt")},delegateYield:function(H,$,j){return this.delegate={iterator:X(H),resultName:$,nextLoc:j},this.method==="next"&&(this.arg=i),f}},e}function O_(i){var e=function(t,n){if(typeof t!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var s=r.call(t,n);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(t)}(i,"string");return typeof e=="symbol"?e:String(e)}function et(i){return et=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},et(i)}function M_(i,e,t,n,r,s,a){try{var o=i[s](a),c=o.value}catch(u){return void t(u)}o.done?e(c):Promise.resolve(c).then(n,r)}function In(i){return function(){var e=this,t=arguments;return new Promise(function(n,r){var s=i.apply(e,t);function a(c){M_(s,n,r,a,o,"next",c)}function o(c){M_(s,n,r,a,o,"throw",c)}a(void 0)})}}function ht(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function R_(i,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(i,O_(n.key),n)}}function ft(i,e,t){return e&&R_(i.prototype,e),t&&R_(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}function Qa(i,e,t){return(e=O_(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Lt(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),e&&xl(i,e)}function lt(i){return lt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},lt(i)}function xl(i,e){return xl=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},xl(i,e)}function Yu(i){var e=typeof Map=="function"?new Map:void 0;return Yu=function(t){if(t===null||!function(r){try{return Function.toString.call(r).indexOf("[native code]")!==-1}catch{return typeof r=="function"}}(t))return t;if(typeof t!="function")throw new TypeError("Super expression must either be null or a function");if(e!==void 0){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return function(r,s,a){if(Jp())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,s);var c=new(r.bind.apply(r,o));return a&&xl(c,a.prototype),c}(t,arguments,lt(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),xl(n,t)},Yu(i)}function ct(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function pt(){return pt=typeof Reflect<"u"&&Reflect.get?Reflect.get.bind():function(i,e,t){var n=function(s,a){for(;!Object.prototype.hasOwnProperty.call(s,a)&&(s=lt(s))!==null;);return s}(i,e);if(n){var r=Object.getOwnPropertyDescriptor(n,e);return r.get?r.get.call(3>arguments.length?i:t):r.value}},pt.apply(this,arguments)}function At(i,e){return function(t){if(Array.isArray(t))return t}(i)||function(t,n){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var s,a,o,c,u=[],d=!0,h=!1;try{if(o=(r=r.call(t)).next,n===0){if(Object(r)!==r)return;d=!1}else for(;!(d=(s=o.call(r)).done)&&(u.push(s.value),u.length!==n);d=!0);}catch(b){h=!0,a=b}finally{try{if(!d&&r.return!=null&&(c=r.return(),Object(c)!==c))return}finally{if(h)throw a}}return u}}(i,e)||Qp(i,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
285
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Ii(i){return function(e){if(Array.isArray(e))return Zp(e)}(i)||function(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}(i)||Qp(i)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
286
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Qp(i,e){if(i){if(typeof i=="string")return Zp(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);return t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set"?Array.from(i):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Zp(i,e):void 0}}function Zp(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,n=new Array(e);e>t;t++)n[t]=i[t];return n}function dt(i,e){var t=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(!t){if(Array.isArray(i)||(t=Qp(i))||e){t&&(i=t);var n=0,r=function(){};return{s:r,n:function(){return n<i.length?{done:!1,value:i[n++]}:{done:!0}},e:function(c){throw c},f:r}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
287
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s,a=!0,o=!1;return{s:function(){t=t.call(i)},n:function(){var c=t.next();return a=c.done,c},e:function(c){o=!0,s=c},f:function(){try{a||t.return==null||t.return()}finally{if(o)throw s}}}}function It(i,e){return function(t,n){return n.get?n.get.call(t):n.value}(i,L_(i,e,"get"))}function Or(i,e,t){return function(n,r,s){if(r.set)r.set.call(n,s);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=s}}(i,L_(i,e,"set"),t),t}function L_(i,e,t){if(!e.has(i))throw new TypeError("attempted to "+t+" private field on non-instance");return e.get(i)}function tn(i,e,t){if(!e.has(i))throw new TypeError("attempted to get private field on non-instance");return t}function B_(i,e){if(e.has(i))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Mr(i,e,t){B_(i,e),e.set(i,t)}function qi(i,e){B_(i,e),e.add(i)}function QO(i,e){return e.forEach(function(t){t&&typeof t!="string"&&!Array.isArray(t)&&Object.keys(t).forEach(function(n){if(n!=="default"&&!(n in i)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(i,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}})}),Object.freeze(i)}function on(i,e){if(!i)throw new Error(e)}var ZO=34028234663852886e22,eM=-34028234663852886e22,tM=4294967295,nM=2147483647,iM=-2147483648;function Ju(i){if(typeof i!="number")throw new Error("invalid int 32: "+et(i));if(!Number.isInteger(i)||i>nM||iM>i)throw new Error("invalid int 32: "+i)}function em(i){if(typeof i!="number")throw new Error("invalid uint 32: "+et(i));if(!Number.isInteger(i)||i>tM||0>i)throw new Error("invalid uint 32: "+i)}function U_(i){if(typeof i!="number")throw new Error("invalid float 32: "+et(i));if(Number.isFinite(i)&&(i>ZO||eM>i))throw new Error("invalid float 32: "+i)}var F_=Symbol("@bufbuild/protobuf/enum-type");function rM(i){var e=i[F_];return on(e,"missing enum type on enum object"),e}function V_(i,e,t,n){i[F_]=j_(e,t.map(function(r){return{no:r.no,name:r.name,localName:i[r.no]}}))}function j_(i,e,t){var n,r=Object.create(null),s=Object.create(null),a=[],o=dt(e);try{for(o.s();!(n=o.n()).done;){var c=n.value,u=$_(c);a.push(u),r[c.name]=u,s[c.no]=u}}catch(d){o.e(d)}finally{o.f()}return{typeName:i,values:a,findName:function(d){return r[d]},findNumber:function(d){return s[d]}}}function sM(i,e,t){var n,r={},s=dt(e);try{for(s.s();!(n=s.n()).done;){var a=$_(n.value);r[a.localName]=a.no,r[a.no]=a.localName}}catch(o){s.e(o)}finally{s.f()}return V_(r,i,e),r}function $_(i){return"localName"in i?i:Object.assign(Object.assign({},i),{localName:i.name})}var tm=function(){function i(){ht(this,i)}return ft(i,[{key:"equals",value:function(e){return this.getType().runtime.util.equals(this.getType(),this,e)}},{key:"clone",value:function(){return this.getType().runtime.util.clone(this)}},{key:"fromBinary",value:function(e,t){var n=this.getType().runtime.bin,r=n.makeReadOptions(t);return n.readMessage(this,r.readerFactory(e),e.byteLength,r),this}},{key:"fromJson",value:function(e,t){var n=this.getType(),r=n.runtime.json,s=r.makeReadOptions(t);return r.readMessage(n,e,s,this),this}},{key:"fromJsonString",value:function(e,t){var n;try{n=JSON.parse(e)}catch(r){throw new Error("cannot decode ".concat(this.getType().typeName," from JSON: ").concat(r instanceof Error?r.message:String(r)))}return this.fromJson(n,t)}},{key:"toBinary",value:function(e){var t=this.getType().runtime.bin,n=t.makeWriteOptions(e),r=n.writerFactory();return t.writeMessage(this,r,n),r.finish()}},{key:"toJson",value:function(e){var t=this.getType().runtime.json,n=t.makeWriteOptions(e);return t.writeMessage(this,n)}},{key:"toJsonString",value:function(e){var t,n=this.toJson(e);return JSON.stringify(n,null,(t=e==null?void 0:e.prettySpaces)!==null&&t!==void 0?t:0)}},{key:"toJSON",value:function(){return this.toJson({emitDefaultValues:!0})}},{key:"getType",value:function(){return Object.getPrototypeOf(this).constructor}}]),i}();function aM(){for(var i=0,e=0,t=0;28>t;t+=7){var n=this.buf[this.pos++];if(i|=(127&n)<<t,(128&n)==0)return this.assertBounds(),[i,e]}var r=this.buf[this.pos++];if(i|=(15&r)<<28,e=(112&r)>>4,(128&r)==0)return this.assertBounds(),[i,e];for(var s=3;31>=s;s+=7){var a=this.buf[this.pos++];if(e|=(127&a)<<s,(128&a)==0)return this.assertBounds(),[i,e]}throw new Error("invalid varint")}function nm(i,e,t){for(var n=0;28>n;n+=7){var r=i>>>n,s=!(!(r>>>7)&&e==0),a=255&(s?128|r:r);if(t.push(a),!s)return}var o=i>>>28&15|(7&e)<<4,c=!!(e>>3);if(t.push(255&(c?128|o:o)),c){for(var u=3;31>u;u+=7){var d=e>>>u,h=!!(d>>>7),b=255&(h?128|d:d);if(t.push(b),!h)return}t.push(e>>>31&1)}}var Qu=4294967296;function H_(i){var e=i[0]==="-";e&&(i=i.slice(1));var t=1e6,n=0,r=0;function s(a,o){var c=Number(i.slice(a,o));r*=t,Qu>(n=n*t+c)||(r+=n/Qu|0,n%=Qu)}return s(-24,-18),s(-18,-12),s(-12,-6),s(-6),e?z_(n,r):im(n,r)}function q_(i,e){var t=function(u,d){return{lo:u>>>0,hi:d>>>0}}(i,e);if(i=t.lo,2097151>=(e=t.hi))return String(Qu*e+i);var n=16777215&(i>>>24|e<<8),r=e>>16&65535,s=(16777215&i)+6777216*n+6710656*r,a=n+8147497*r,o=2*r,c=1e7;return c>s||(a+=Math.floor(s/c),s%=c),c>a||(o+=Math.floor(a/c),a%=c),o.toString()+G_(a)+G_(s)}function im(i,e){return{lo:0|i,hi:0|e}}function z_(i,e){return e=~e,i?i=1+~i:e+=1,im(i,e)}var G_=function(i){var e=String(i);return"0000000".slice(e.length)+e};function W_(i,e){if(i<0){for(var t=0;9>t;t++)e.push(127&i|128),i>>=7;e.push(1)}else{for(;i>127;)e.push(127&i|128),i>>>=7;e.push(i)}}function oM(){var i=this.buf[this.pos++],e=127&i;if(!(128&i))return this.assertBounds(),e;if(e|=(127&(i=this.buf[this.pos++]))<<7,(128&i)==0)return this.assertBounds(),e;if(e|=(127&(i=this.buf[this.pos++]))<<14,(128&i)==0)return this.assertBounds(),e;if(e|=(127&(i=this.buf[this.pos++]))<<21,(128&i)==0)return this.assertBounds(),e;e|=(15&(i=this.buf[this.pos++]))<<28;for(var t=5;128&i&&10>t;t++)i=this.buf[this.pos++];if(128&i)throw new Error("invalid varint");return this.assertBounds(),e>>>0}var Oe,ds,dn,qt=function(){var i=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof i.getBigInt64=="function"&&typeof i.getBigUint64=="function"&&typeof i.setBigInt64=="function"&&typeof i.setBigUint64=="function"&&((typeof process>"u"?"undefined":et(process))!="object"||et(process.env)!="object"||process.env.BUF_BIGINT_DISABLE!=="1")){var e=BigInt("-9223372036854775808"),t=BigInt("9223372036854775807"),n=BigInt("0"),r=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse:function(o){var c=typeof o=="bigint"?o:BigInt(o);if(c>t||e>c)throw new Error("int64 invalid: ".concat(o));return c},uParse:function(o){var c=typeof o=="bigint"?o:BigInt(o);if(c>r||n>c)throw new Error("uint64 invalid: ".concat(o));return c},enc:function(o){return i.setBigInt64(0,this.parse(o),!0),{lo:i.getInt32(0,!0),hi:i.getInt32(4,!0)}},uEnc:function(o){return i.setBigInt64(0,this.uParse(o),!0),{lo:i.getInt32(0,!0),hi:i.getInt32(4,!0)}},dec:function(o,c){return i.setInt32(0,o,!0),i.setInt32(4,c,!0),i.getBigInt64(0,!0)},uDec:function(o,c){return i.setInt32(0,o,!0),i.setInt32(4,c,!0),i.getBigUint64(0,!0)}}}var s=function(o){return on(/^-?[0-9]+$/.test(o),"int64 invalid: ".concat(o))},a=function(o){return on(/^[0-9]+$/.test(o),"uint64 invalid: ".concat(o))};return{zero:"0",supported:!1,parse:function(o){return typeof o!="string"&&(o=o.toString()),s(o),o},uParse:function(o){return typeof o!="string"&&(o=o.toString()),a(o),o},enc:function(o){return typeof o!="string"&&(o=o.toString()),s(o),H_(o)},uEnc:function(o){return typeof o!="string"&&(o=o.toString()),a(o),H_(o)},dec:function(o,c){return function(u,d){var h=im(u,d),b=2147483648&h.hi;b&&(h=z_(h.lo,h.hi));var v=q_(h.lo,h.hi);return b?"-"+v:v}(o,c)},uDec:function(o,c){return q_(o,c)}}}();function hs(i,e,t){if(e===t)return!0;if(i==Oe.BYTES){if(!(e instanceof Uint8Array&&t instanceof Uint8Array)||e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}switch(i){case Oe.UINT64:case Oe.FIXED64:case Oe.INT64:case Oe.SFIXED64:case Oe.SINT64:return e==t}return!1}function Za(i,e){switch(i){case Oe.BOOL:return!1;case Oe.UINT64:case Oe.FIXED64:case Oe.INT64:case Oe.SFIXED64:case Oe.SINT64:return e==0?qt.zero:"0";case Oe.DOUBLE:case Oe.FLOAT:return 0;case Oe.BYTES:return new Uint8Array(0);case Oe.STRING:return"";default:return 0}}function K_(i,e){switch(i){case Oe.BOOL:return e===!1;case Oe.STRING:return e==="";case Oe.BYTES:return e instanceof Uint8Array&&!e.byteLength;default:return e==0}}(function(i){i[i.DOUBLE=1]="DOUBLE",i[i.FLOAT=2]="FLOAT",i[i.INT64=3]="INT64",i[i.UINT64=4]="UINT64",i[i.INT32=5]="INT32",i[i.FIXED64=6]="FIXED64",i[i.FIXED32=7]="FIXED32",i[i.BOOL=8]="BOOL",i[i.STRING=9]="STRING",i[i.BYTES=12]="BYTES",i[i.UINT32=13]="UINT32",i[i.SFIXED32=15]="SFIXED32",i[i.SFIXED64=16]="SFIXED64",i[i.SINT32=17]="SINT32",i[i.SINT64=18]="SINT64"})(Oe||(Oe={})),function(i){i[i.BIGINT=0]="BIGINT",i[i.STRING=1]="STRING"}(ds||(ds={})),function(i){i[i.Varint=0]="Varint",i[i.Bit64=1]="Bit64",i[i.LengthDelimited=2]="LengthDelimited",i[i.StartGroup=3]="StartGroup",i[i.EndGroup=4]="EndGroup",i[i.Bit32=5]="Bit32"}(dn||(dn={}));var lM=function(){function i(e){ht(this,i),this.stack=[],this.textEncoder=e??new TextEncoder,this.chunks=[],this.buf=[]}return ft(i,[{key:"finish",value:function(){this.chunks.push(new Uint8Array(this.buf));for(var e=0,t=0;t<this.chunks.length;t++)e+=this.chunks[t].length;for(var n=new Uint8Array(e),r=0,s=0;s<this.chunks.length;s++)n.set(this.chunks[s],r),r+=this.chunks[s].length;return this.chunks=[],n}},{key:"fork",value:function(){return this.stack.push({chunks:this.chunks,buf:this.buf}),this.chunks=[],this.buf=[],this}},{key:"join",value:function(){var e=this.finish(),t=this.stack.pop();if(!t)throw new Error("invalid state, fork stack empty");return this.chunks=t.chunks,this.buf=t.buf,this.uint32(e.byteLength),this.raw(e)}},{key:"tag",value:function(e,t){return this.uint32((e<<3|t)>>>0)}},{key:"raw",value:function(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}},{key:"uint32",value:function(e){for(em(e);e>127;)this.buf.push(127&e|128),e>>>=7;return this.buf.push(e),this}},{key:"int32",value:function(e){return Ju(e),W_(e,this.buf),this}},{key:"bool",value:function(e){return this.buf.push(e?1:0),this}},{key:"bytes",value:function(e){return this.uint32(e.byteLength),this.raw(e)}},{key:"string",value:function(e){var t=this.textEncoder.encode(e);return this.uint32(t.byteLength),this.raw(t)}},{key:"float",value:function(e){U_(e);var t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}},{key:"double",value:function(e){var t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}},{key:"fixed32",value:function(e){em(e);var t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}},{key:"sfixed32",value:function(e){Ju(e);var t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}},{key:"sint32",value:function(e){return Ju(e),W_(e=(e<<1^e>>31)>>>0,this.buf),this}},{key:"sfixed64",value:function(e){var t=new Uint8Array(8),n=new DataView(t.buffer),r=qt.enc(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}},{key:"fixed64",value:function(e){var t=new Uint8Array(8),n=new DataView(t.buffer),r=qt.uEnc(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}},{key:"int64",value:function(e){var t=qt.enc(e);return nm(t.lo,t.hi,this.buf),this}},{key:"sint64",value:function(e){var t=qt.enc(e),n=t.hi>>31;return nm(t.lo<<1^n,(t.hi<<1|t.lo>>>31)^n,this.buf),this}},{key:"uint64",value:function(e){var t=qt.uEnc(e);return nm(t.lo,t.hi,this.buf),this}}]),i}(),cM=function(){function i(e,t){ht(this,i),this.varint64=aM,this.uint32=oM,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength),this.textDecoder=t??new TextDecoder}return ft(i,[{key:"tag",value:function(){var e=this.uint32(),t=e>>>3,n=7&e;if(0>=t||0>n||n>5)throw new Error("illegal tag: field no "+t+" wire type "+n);return[t,n]}},{key:"skip",value:function(e,t){var n=this.pos;switch(e){case dn.Varint:for(;128&this.buf[this.pos++];);break;case dn.Bit64:this.pos+=4;case dn.Bit32:this.pos+=4;break;case dn.LengthDelimited:var r=this.uint32();this.pos+=r;break;case dn.StartGroup:for(;;){var s=At(this.tag(),2),a=s[0],o=s[1];if(o===dn.EndGroup){if(t!==void 0&&a!==t)throw new Error("invalid end group tag");break}this.skip(o,a)}break;default:throw new Error("cant skip wire type "+e)}return this.assertBounds(),this.buf.subarray(n,this.pos)}},{key:"assertBounds",value:function(){if(this.pos>this.len)throw new RangeError("premature EOF")}},{key:"int32",value:function(){return 0|this.uint32()}},{key:"sint32",value:function(){var e=this.uint32();return e>>>1^-(1&e)}},{key:"int64",value:function(){return qt.dec.apply(qt,Ii(this.varint64()))}},{key:"uint64",value:function(){return qt.uDec.apply(qt,Ii(this.varint64()))}},{key:"sint64",value:function(){var e=At(this.varint64(),2),t=e[0],n=e[1],r=-(1&t);return t=(t>>>1|(1&n)<<31)^r,n=n>>>1^r,qt.dec(t,n)}},{key:"bool",value:function(){var e=At(this.varint64(),2),t=e[0],n=e[1];return t!==0||n!==0}},{key:"fixed32",value:function(){return this.view.getUint32((this.pos+=4)-4,!0)}},{key:"sfixed32",value:function(){return this.view.getInt32((this.pos+=4)-4,!0)}},{key:"fixed64",value:function(){return qt.uDec(this.sfixed32(),this.sfixed32())}},{key:"sfixed64",value:function(){return qt.dec(this.sfixed32(),this.sfixed32())}},{key:"float",value:function(){return this.view.getFloat32((this.pos+=4)-4,!0)}},{key:"double",value:function(){return this.view.getFloat64((this.pos+=8)-8,!0)}},{key:"bytes",value:function(){var e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}},{key:"string",value:function(){return this.textDecoder.decode(this.bytes())}}]),i}();function X_(i){var e=i.field.localName,t=Object.create(null);return t[e]=function(n){var r=n.field;if(r.repeated)return[];if(r.default!==void 0)return r.default;switch(r.kind){case"enum":return r.T.values[0].no;case"scalar":return Za(r.T,r.L);case"message":var s=r.T,a=new s;return s.fieldWrapper?s.fieldWrapper.unwrapField(a):a;case"map":throw"map fields are not allowed to be extensions"}}(i),[t,function(){return t[e]}]}for(var Rr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),Zu=[],ed=0;ed<Rr.length;ed++)Zu[Rr[ed].charCodeAt(0)]=ed;Zu[45]=Rr.indexOf("+"),Zu[95]=Rr.indexOf("/");var Y_={dec:function(i){var e=3*i.length/4;i[i.length-2]=="="?e-=2:i[i.length-1]=="="&&(e-=1);for(var t,n=new Uint8Array(e),r=0,s=0,a=0,o=0;o<i.length;o++){if((t=Zu[i.charCodeAt(o)])===void 0)switch(i[o]){case"=":s=0;case`
|
288
|
+
`:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string.")}switch(s){case 0:a=t,s=1;break;case 1:n[r++]=a<<2|(48&t)>>4,a=t,s=2;break;case 2:n[r++]=(15&a)<<4|(60&t)>>2,a=t,s=3;break;case 3:n[r++]=(3&a)<<6|t,s=0;break}}if(s==1)throw Error("invalid base64 string.");return n.subarray(0,r)},enc:function(i){for(var e,t="",n=0,r=0,s=0;s<i.length;s++)switch(e=i[s],n){case 0:t+=Rr[e>>2],r=(3&e)<<4,n=1;break;case 1:t+=Rr[r|e>>4],r=(15&e)<<2,n=2;break;case 2:t+=Rr[r|e>>6],t+=Rr[63&e],n=0;break}return n&&(t+=Rr[r],t+="=",n==1&&(t+="=")),t}};function uM(i,e,t){Q_(e,i);var n,r=e.runtime.bin.makeReadOptions(t),s=function(h,b){if(!b.repeated&&(b.kind=="enum"||b.kind=="scalar")){for(var v=h.length-1;v>=0;--v)if(h[v].no==b.no)return[h[v]];return[]}return h.filter(function(y){return y.no===b.no})}(i.getType().runtime.bin.listUnknownFields(i),e.field),a=At(X_(e),2),o=a[0],c=a[1],u=dt(s);try{for(u.s();!(n=u.n()).done;){var d=n.value;e.runtime.bin.readField(o,r.readerFactory(d.data),e.field,d.wireType,r)}}catch(h){u.e(h)}finally{u.f()}return c()}function dM(i,e,t,n){Q_(e,i);var r=e.runtime.bin.makeReadOptions(n),s=e.runtime.bin.makeWriteOptions(n);if(J_(i,e)){var a=i.getType().runtime.bin.listUnknownFields(i).filter(function(m){return m.no!=e.field.no});i.getType().runtime.bin.discardUnknownFields(i);var o,c=dt(a);try{for(c.s();!(o=c.n()).done;){var u=o.value;i.getType().runtime.bin.onUnknownField(i,u.no,u.wireType,u.data)}}catch(m){c.e(m)}finally{c.f()}}var d=s.writerFactory(),h=e.field;h.opt||h.repeated||h.kind!="enum"&&h.kind!="scalar"||(h=Object.assign(Object.assign({},e.field),{opt:!0})),e.runtime.bin.writeField(h,t,d,s);for(var b=r.readerFactory(d.finish());b.pos<b.len;){var v=At(b.tag(),2),y=v[0],p=v[1],f=b.skip(p,y);i.getType().runtime.bin.onUnknownField(i,y,p,f)}}function J_(i,e){var t=i.getType();return e.extendee.typeName===t.typeName&&!!t.runtime.bin.listUnknownFields(i).find(function(n){return n.no==e.field.no})}function Q_(i,e){on(i.extendee.typeName==e.getType().typeName,"extension ".concat(i.typeName," can only be applied to message ").concat(i.extendee.typeName))}function Z_(i,e){var t=i.localName;if(i.repeated)return e[t].length>0;if(i.oneof)return e[i.oneof.localName].case===t;switch(i.kind){case"enum":case"scalar":return i.opt||i.req?e[t]!==void 0:i.kind=="enum"?e[t]!==i.T.values[0].no:!K_(i.T,e[t]);case"message":return e[t]!==void 0;case"map":return Object.keys(e[t]).length>0}}function ek(i,e){var t=i.localName,n=!i.opt&&!i.req;if(i.repeated)e[t]=[];else if(i.oneof)e[i.oneof.localName]={case:void 0};else switch(i.kind){case"map":e[t]={};break;case"enum":e[t]=n?i.T.values[0].no:void 0;break;case"scalar":e[t]=n?Za(i.T,i.L):void 0;break;case"message":e[t]=void 0;break}}function Gs(i,e){if(i===null||et(i)!="object"||!Object.getOwnPropertyNames(tm.prototype).every(function(n){return n in i&&typeof i[n]=="function"}))return!1;var t=i.getType();return t!==null&&typeof t=="function"&&"typeName"in t&&typeof t.typeName=="string"&&(e===void 0||t.typeName==e.typeName)}function tk(i,e){return Gs(e)||!i.fieldWrapper?e:i.fieldWrapper.wrapField(e)}Oe.DOUBLE,Oe.FLOAT,Oe.INT64,Oe.UINT64,Oe.INT32,Oe.UINT32,Oe.BOOL,Oe.STRING,Oe.BYTES;var nk={ignoreUnknownFields:!1},ik={emitDefaultValues:!1,enumAsInteger:!1,useProtoFieldName:!1,prettySpaces:0};function hM(i){return i?Object.assign(Object.assign({},nk),i):nk}function fM(i){return i?Object.assign(Object.assign({},ik),i):ik}var td=Symbol(),nd=Symbol();function fr(i){if(i===null)return"null";switch(et(i)){case"object":return Array.isArray(i)?"array":"object";case"string":return i.length>100?"string":'"'.concat(i.split('"').join('\\"'),'"');default:return String(i)}}function rk(i,e,t,n,r){var s=t.localName;if(t.repeated){if(on(t.kind!="map"),e===null)return;if(!Array.isArray(e))throw new Error("cannot decode field ".concat(r.typeName,".").concat(t.name," from JSON: ").concat(fr(e)));var a,o=i[s],c=dt(e);try{for(c.s();!(a=c.n()).done;){var u=a.value;if(u===null)throw new Error("cannot decode field ".concat(r.typeName,".").concat(t.name," from JSON: ").concat(fr(u)));switch(t.kind){case"message":o.push(t.T.fromJson(u,n));break;case"enum":var d=rm(t.T,u,n.ignoreUnknownFields,!0);d!==nd&&o.push(d);break;case"scalar":try{o.push(El(t.T,u,t.L,!0))}catch(F){var h="cannot decode field ".concat(r.typeName,".").concat(t.name," from JSON: ").concat(fr(u));throw F instanceof Error&&F.message.length>0&&(h+=": ".concat(F.message)),new Error(h)}break}}}catch(F){c.e(F)}finally{c.f()}}else if(t.kind=="map"){if(e===null)return;if(et(e)!="object"||Array.isArray(e))throw new Error("cannot decode field ".concat(r.typeName,".").concat(t.name," from JSON: ").concat(fr(e)));for(var b=i[s],v=0,y=Object.entries(e);v<y.length;v++){var p=At(y[v],2),f=p[0],m=p[1];if(m===null)throw new Error("cannot decode field ".concat(r.typeName,".").concat(t.name," from JSON: map value null"));var _=void 0;try{_=pM(t.K,f)}catch(F){var k="cannot decode map key for field ".concat(r.typeName,".").concat(t.name," from JSON: ").concat(fr(e));throw F instanceof Error&&F.message.length>0&&(k+=": ".concat(F.message)),new Error(k)}switch(t.V.kind){case"message":b[_]=t.V.T.fromJson(m,n);break;case"enum":var D=rm(t.V.T,m,n.ignoreUnknownFields,!0);D!==nd&&(b[_]=D);break;case"scalar":try{b[_]=El(t.V.T,m,ds.BIGINT,!0)}catch(F){var E="cannot decode map value for field ".concat(r.typeName,".").concat(t.name," from JSON: ").concat(fr(e));throw F instanceof Error&&F.message.length>0&&(E+=": ".concat(F.message)),new Error(E)}break}}}else switch(t.oneof&&(i=i[t.oneof.localName]={case:s},s="value"),t.kind){case"message":var A=t.T;if(e===null&&A.typeName!="google.protobuf.Value")return;var w=i[s];Gs(w)?w.fromJson(e,n):(i[s]=w=A.fromJson(e,n),A.fieldWrapper&&!t.oneof&&(i[s]=A.fieldWrapper.unwrapField(w)));break;case"enum":var N=rm(t.T,e,n.ignoreUnknownFields,!1);switch(N){case td:ek(t,i);break;case nd:break;default:i[s]=N;break}break;case"scalar":try{var S=El(t.T,e,t.L,!1);switch(S){case td:ek(t,i);break;default:i[s]=S;break}}catch(F){var P="cannot decode field ".concat(r.typeName,".").concat(t.name," from JSON: ").concat(fr(e));throw F instanceof Error&&F.message.length>0&&(P+=": ".concat(F.message)),new Error(P)}break}}function pM(i,e){if(i===Oe.BOOL)switch(e){case"true":e=!0;break;case"false":e=!1;break}return El(i,e,ds.BIGINT,!0).toString()}function El(i,e,t,n){if(e===null)return n?Za(i,t):td;switch(i){case Oe.DOUBLE:case Oe.FLOAT:if(e==="NaN")return Number.NaN;if(e==="Infinity")return Number.POSITIVE_INFINITY;if(e==="-Infinity")return Number.NEGATIVE_INFINITY;if(e===""||typeof e=="string"&&e.trim().length!==e.length||typeof e!="string"&&typeof e!="number")break;var r=Number(e);if(Number.isNaN(r)||!Number.isFinite(r))break;return i==Oe.FLOAT&&U_(r),r;case Oe.INT32:case Oe.FIXED32:case Oe.SFIXED32:case Oe.SINT32:case Oe.UINT32:var s;if(typeof e=="number"?s=e:typeof e=="string"&&e.length>0&&e.trim().length===e.length&&(s=Number(e)),s===void 0)break;return i==Oe.UINT32||i==Oe.FIXED32?em(s):Ju(s),s;case Oe.INT64:case Oe.SFIXED64:case Oe.SINT64:if(typeof e!="number"&&typeof e!="string")break;var a=qt.parse(e);return t?a.toString():a;case Oe.FIXED64:case Oe.UINT64:if(typeof e!="number"&&typeof e!="string")break;var o=qt.uParse(e);return t?o.toString():o;case Oe.BOOL:if(typeof e!="boolean")break;return e;case Oe.STRING:if(typeof e!="string")break;try{encodeURIComponent(e)}catch{throw new Error("invalid UTF8")}return e;case Oe.BYTES:if(e==="")return new Uint8Array(0);if(typeof e!="string")break;return Y_.dec(e)}throw new Error}function rm(i,e,t,n){if(e===null)return i.typeName=="google.protobuf.NullValue"?0:n?i.values[0].no:td;switch(et(e)){case"number":if(Number.isInteger(e))return e;break;case"string":var r=i.findName(e);if(r!==void 0)return r.no;if(t)return nd;break}throw new Error("cannot decode enum ".concat(i.typeName," from JSON: ").concat(fr(e)))}function mM(i){return!(!i.repeated&&i.kind!="map")||!i.oneof&&i.kind!="message"&&!i.opt&&!i.req}function sk(i,e,t){if(i.kind=="map"){on(et(e)=="object"&&e!=null);var n={},r=Object.entries(e);switch(i.V.kind){case"scalar":var s,a=dt(r);try{for(a.s();!(s=a.n()).done;){var o=At(s.value,2),c=o[0],u=o[1];n[c.toString()]=id(i.V.T,u)}}catch(S){a.e(S)}finally{a.f()}break;case"message":var d,h=dt(r);try{for(h.s();!(d=h.n()).done;){var b=At(d.value,2),v=b[0],y=b[1];n[v.toString()]=y.toJson(t)}}catch(S){h.e(S)}finally{h.f()}break;case"enum":var p,f=i.V.T,m=dt(r);try{for(m.s();!(p=m.n()).done;){var _=At(p.value,2),k=_[0],D=_[1];n[k.toString()]=sm(f,D,t.enumAsInteger)}}catch(S){m.e(S)}finally{m.f()}break}return t.emitDefaultValues||r.length>0?n:void 0}if(i.repeated){on(Array.isArray(e));var E=[];switch(i.kind){case"scalar":for(var A=0;A<e.length;A++)E.push(id(i.T,e[A]));break;case"enum":for(var w=0;w<e.length;w++)E.push(sm(i.T,e[w],t.enumAsInteger));break;case"message":for(var N=0;N<e.length;N++)E.push(e[N].toJson(t));break}return t.emitDefaultValues||E.length>0?E:void 0}switch(i.kind){case"scalar":return id(i.T,e);case"enum":return sm(i.T,e,t.enumAsInteger);case"message":return tk(i.T,e).toJson(t)}}function sm(i,e,t){var n;if(on(typeof e=="number"),i.typeName=="google.protobuf.NullValue")return null;if(t)return e;var r=i.findNumber(e);return(n=r==null?void 0:r.name)!==null&&n!==void 0?n:e}function id(i,e){switch(i){case Oe.INT32:case Oe.SFIXED32:case Oe.SINT32:case Oe.FIXED32:case Oe.UINT32:return on(typeof e=="number"),e;case Oe.FLOAT:case Oe.DOUBLE:return on(typeof e=="number"),Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":e;case Oe.STRING:return on(typeof e=="string"),e;case Oe.BOOL:return on(typeof e=="boolean"),e;case Oe.UINT64:case Oe.FIXED64:case Oe.INT64:case Oe.SFIXED64:case Oe.SINT64:return on(typeof e=="bigint"||typeof e=="string"||typeof e=="number"),e.toString();case Oe.BYTES:return on(e instanceof Uint8Array),Y_.enc(e)}}var eo=Symbol("@bufbuild/protobuf/unknown-fields"),ak={readUnknownFields:!0,readerFactory:function(i){return new cM(i)}},ok={writeUnknownFields:!0,writerFactory:function(){return new lM}};function gM(i){return i?Object.assign(Object.assign({},ak),i):ak}function vM(i){return i?Object.assign(Object.assign({},ok),i):ok}function lk(i,e,t,n,r){var s=t.repeated,a=t.localName;switch(t.oneof&&((i=i[t.oneof.localName]).case!=a&&delete i.value,i.case=a,a="value"),t.kind){case"scalar":case"enum":var o=t.kind=="enum"?Oe.INT32:t.T,c=sd;if(t.kind=="scalar"&&t.L>0&&(c=yM),s){var u=i[a];if(n==dn.LengthDelimited&&o!=Oe.STRING&&o!=Oe.BYTES)for(var d=e.uint32()+e.pos;e.pos<d;)u.push(c(e,o));else u.push(c(e,o))}else i[a]=c(e,o);break;case"message":var h=t.T;s?i[a].push(rd(e,new h,r,t)):Gs(i[a])?rd(e,i[a],r,t):(i[a]=rd(e,new h,r,t),!h.fieldWrapper||t.oneof||t.repeated||(i[a]=h.fieldWrapper.unwrapField(i[a])));break;case"map":var b=function(f,m,_){for(var k,D,E=m.uint32(),A=m.pos+E;m.pos<A;)switch(At(m.tag(),1)[0]){case 1:k=sd(m,f.K);break;case 2:switch(f.V.kind){case"scalar":D=sd(m,f.V.T);break;case"enum":D=m.int32();break;case"message":D=rd(m,new f.V.T,_,void 0);break}break}if(k===void 0&&(k=Za(f.K,ds.BIGINT)),typeof k!="string"&&typeof k!="number"&&(k=k.toString()),D===void 0)switch(f.V.kind){case"scalar":D=Za(f.V.T,ds.BIGINT);break;case"enum":D=f.V.T.values[0].no;break;case"message":D=new f.V.T;break}return[k,D]}(t,e,r),v=At(b,2),y=v[0],p=v[1];i[a][y]=p;break}}function rd(i,e,t,n){var r=e.getType().runtime.bin,s=n==null?void 0:n.delimited;return r.readMessage(e,i,s?n.no:i.uint32(),t,s),e}function yM(i,e){var t=sd(i,e);return typeof t=="bigint"?t.toString():t}function sd(i,e){switch(e){case Oe.STRING:return i.string();case Oe.BOOL:return i.bool();case Oe.DOUBLE:return i.double();case Oe.FLOAT:return i.float();case Oe.INT32:return i.int32();case Oe.INT64:return i.int64();case Oe.UINT64:return i.uint64();case Oe.FIXED64:return i.fixed64();case Oe.BYTES:return i.bytes();case Oe.FIXED32:return i.fixed32();case Oe.SFIXED32:return i.sfixed32();case Oe.SFIXED64:return i.sfixed64();case Oe.SINT64:return i.sint64();case Oe.UINT32:return i.uint32();case Oe.SINT32:return i.sint32()}}function ck(i,e,t,n){on(e!==void 0);var r=i.repeated;switch(i.kind){case"scalar":case"enum":var s=i.kind=="enum"?Oe.INT32:i.T;if(r)if(on(Array.isArray(e)),i.packed)(function(y,p,f,m){if(m.length){y.tag(f,dn.LengthDelimited).fork();for(var _=At(dk(p),2)[1],k=0;k<m.length;k++)y[_](m[k]);y.join()}})(t,s,i.no,e);else{var a,o=dt(e);try{for(o.s();!(a=o.n()).done;){var c=a.value;wl(t,s,i.no,c)}}catch(y){o.e(y)}finally{o.f()}}else wl(t,s,i.no,e);break;case"message":if(r){on(Array.isArray(e));var u,d=dt(e);try{for(d.s();!(u=d.n()).done;)uk(t,n,i,u.value)}catch(y){d.e(y)}finally{d.f()}}else uk(t,n,i,e);break;case"map":on(et(e)=="object"&&e!=null);for(var h=0,b=Object.entries(e);h<b.length;h++){var v=At(b[h],2);bM(t,n,i,v[0],v[1])}break}}function bM(i,e,t,n,r){i.tag(t.no,dn.LengthDelimited),i.fork();var s=n;switch(t.K){case Oe.INT32:case Oe.FIXED32:case Oe.UINT32:case Oe.SFIXED32:case Oe.SINT32:s=Number.parseInt(n);break;case Oe.BOOL:on(n=="true"||n=="false"),s=n=="true";break}switch(wl(i,t.K,1,s),t.V.kind){case"scalar":wl(i,t.V.T,2,r);break;case"enum":wl(i,Oe.INT32,2,r);break;case"message":on(r!==void 0),i.tag(2,dn.LengthDelimited).bytes(r.toBinary(e));break}i.join()}function uk(i,e,t,n){var r=tk(t.T,n);t.delimited?i.tag(t.no,dn.StartGroup).raw(r.toBinary(e)).tag(t.no,dn.EndGroup):i.tag(t.no,dn.LengthDelimited).bytes(r.toBinary(e))}function wl(i,e,t,n){on(n!==void 0);var r=At(dk(e),2),s=r[0],a=r[1];i.tag(t,s)[a](n)}function dk(i){var e=dn.Varint;switch(i){case Oe.BYTES:case Oe.STRING:e=dn.LengthDelimited;break;case Oe.DOUBLE:case Oe.FIXED64:case Oe.SFIXED64:e=dn.Bit64;break;case Oe.FIXED32:case Oe.SFIXED32:case Oe.FLOAT:e=dn.Bit32;break}return[e,Oe[i].toLowerCase()]}function ad(i){if(i===void 0)return i;if(Gs(i))return i.clone();if(i instanceof Uint8Array){var e=new Uint8Array(i.byteLength);return e.set(i),e}return i}function Dl(i){return i instanceof Uint8Array?i:new Uint8Array(i)}var _M=function(){function i(e,t){ht(this,i),this._fields=e,this._normalizer=t}return ft(i,[{key:"findJsonName",value:function(e){if(!this.jsonNames){var t,n={},r=dt(this.list());try{for(r.s();!(t=r.n()).done;){var s=t.value;n[s.jsonName]=n[s.name]=s}}catch(a){r.e(a)}finally{r.f()}this.jsonNames=n}return this.jsonNames[e]}},{key:"find",value:function(e){if(!this.numbers){var t,n={},r=dt(this.list());try{for(r.s();!(t=r.n()).done;){var s=t.value;n[s.no]=s}}catch(a){r.e(a)}finally{r.f()}this.numbers=n}return this.numbers[e]}},{key:"list",value:function(){return this.all||(this.all=this._normalizer(this._fields)),this.all}},{key:"byNumber",value:function(){return this.numbersAsc||(this.numbersAsc=this.list().concat().sort(function(e,t){return e.no-t.no})),this.numbersAsc}},{key:"byMember",value:function(){if(!this.members){this.members=[];var e,t,n=this.members,r=dt(this.list());try{for(r.s();!(t=r.n()).done;){var s=t.value;s.oneof?s.oneof!==e&&(e=s.oneof,n.push(e)):n.push(s)}}catch(a){r.e(a)}finally{r.f()}}return this.members}}]),i}();function hk(i,e){var t=fk(i);return e?t:xM(CM(t))}var kM=fk;function fk(i){for(var e=!1,t=[],n=0;n<i.length;n++){var r=i.charAt(n);switch(r){case"_":e=!0;break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":t.push(r),e=!1;break;default:e&&(e=!1,r=r.toUpperCase()),t.push(r);break}}return t.join("")}var TM=new Set(["constructor","toString","toJSON","valueOf"]),SM=new Set(["getType","clone","equals","fromBinary","fromJson","fromJsonString","toBinary","toJson","toJsonString","toObject"]),pk=function(i){return"".concat(i,"$")},CM=function(i){return SM.has(i)?pk(i):i},xM=function(i){return TM.has(i)?pk(i):i},EM=function(){function i(e){ht(this,i),this.kind="oneof",this.repeated=!1,this.packed=!1,this.opt=!1,this.req=!1,this.default=void 0,this.fields=[],this.name=e,this.localName=hk(e,!1)}return ft(i,[{key:"addField",value:function(e){on(e.oneof===this,"field ".concat(e.name," not one of ").concat(this.name)),this.fields.push(e)}},{key:"findField",value:function(e){if(!this._lookup){this._lookup=Object.create(null);for(var t=0;t<this.fields.length;t++)this._lookup[this.fields[t].localName]=this.fields[t]}return this._lookup[e]}}]),i}(),mk,gk,De=(mk=function(i){return new _M(i,function(e){return function(t,n){var r,s,a,o,c,u,d,h,b=[],v=dt(typeof t=="function"?t():t);try{for(v.s();!(h=v.n()).done;){var y=h.value,p=y;if(p.localName=hk(y.name,y.oneof!==void 0),p.jsonName=(r=y.jsonName)!==null&&r!==void 0?r:kM(y.name),p.repeated=(s=y.repeated)!==null&&s!==void 0&&s,y.kind=="scalar"&&(p.L=(a=y.L)!==null&&a!==void 0?a:ds.BIGINT),p.delimited=(o=y.delimited)!==null&&o!==void 0&&o,p.req=(c=y.req)!==null&&c!==void 0&&c,p.opt=(u=y.opt)!==null&&u!==void 0&&u,y.packed===void 0&&(p.packed=y.kind=="enum"||y.kind=="scalar"&&y.T!=Oe.BYTES&&y.T!=Oe.STRING),y.oneof!==void 0){var f=typeof y.oneof=="string"?y.oneof:y.oneof.name;d&&d.name==f||(d=new EM(f)),p.oneof=d,d.addField(p)}b.push(p)}}catch(m){v.e(m)}finally{v.f()}return b}(e)})},gk=function(i){var e,t=dt(i.getType().fields.byMember());try{for(t.s();!(e=t.n()).done;){var n=e.value;if(!n.opt){var r=n.localName,s=i;if(n.repeated)s[r]=[];else switch(n.kind){case"oneof":s[r]={case:void 0};break;case"enum":s[r]=0;break;case"map":s[r]={};break;case"scalar":s[r]=Za(n.T,n.L);break}}}}catch(a){t.e(a)}finally{t.f()}},{syntax:"proto3",json:{makeReadOptions:hM,makeWriteOptions:fM,readMessage:function(i,e,t,n){if(e==null||Array.isArray(e)||et(e)!="object")throw new Error("cannot decode message ".concat(i.typeName," from JSON: ").concat(fr(e)));n=n??new i;for(var r=new Map,s=t.typeRegistry,a=0,o=Object.entries(e);a<o.length;a++){var c=At(o[a],2),u=c[0],d=c[1],h=i.fields.findJsonName(u);if(h){if(h.oneof){if(d===null&&h.kind=="scalar")continue;var b=r.get(h.oneof);if(b!==void 0)throw new Error("cannot decode message ".concat(i.typeName,' from JSON: multiple keys for oneof "').concat(h.oneof.name,'" present: "').concat(b,'", "').concat(u,'"'));r.set(h.oneof,u)}rk(n,d,h,t,i)}else{var v=!1;if(s!=null&&s.findExtension&&u.startsWith("[")&&u.endsWith("]")){var y=s.findExtension(u.substring(1,u.length-1));if(y&&y.extendee.typeName==i.typeName){v=!0;var p=At(X_(y),2),f=p[0],m=p[1];rk(f,d,y.field,t,y),dM(n,y,m(),t)}}if(!v&&!t.ignoreUnknownFields)throw new Error("cannot decode message ".concat(i.typeName,' from JSON: key "').concat(u,'" is unknown'))}}return n},writeMessage:function(i,e){var t,n=i.getType(),r={};try{var s,a=dt(n.fields.byNumber());try{for(a.s();!(s=a.n()).done;){if(!Z_(t=s.value,i)){if(t.req)throw"required field not set";if(!e.emitDefaultValues||!mM(t))continue}var o=sk(t,t.oneof?i[t.oneof.localName].value:i[t.localName],e);o!==void 0&&(r[e.useProtoFieldName?t.name:t.jsonName]=o)}}catch(m){a.e(m)}finally{a.f()}var c=e.typeRegistry;if(c!=null&&c.findExtensionFor){var u,d=dt(n.runtime.bin.listUnknownFields(i));try{for(d.s();!(u=d.n()).done;){var h=u.value,b=c.findExtensionFor(n.typeName,h.no);if(b&&J_(i,b)){var v=uM(i,b,e),y=sk(b.field,v,e);y!==void 0&&(r[b.field.jsonName]=y)}}}catch(m){d.e(m)}finally{d.f()}}}catch(m){var p=t?"cannot encode field ".concat(n.typeName,".").concat(t.name," to JSON"):"cannot encode message ".concat(n.typeName," to JSON"),f=m instanceof Error?m.message:String(m);throw new Error(p+(f.length>0?": ".concat(f):""))}return r},readScalar:function(i,e,t){return El(i,e,t??ds.BIGINT,!0)},writeScalar:function(i,e,t){if(e!==void 0)return t||K_(i,e)?id(i,e):void 0},debug:fr},bin:{makeReadOptions:gM,makeWriteOptions:vM,listUnknownFields:function(i){var e;return(e=i[eo])!==null&&e!==void 0?e:[]},discardUnknownFields:function(i){delete i[eo]},writeUnknownFields:function(i,e){var t=i[eo];if(t){var n,r=dt(t);try{for(r.s();!(n=r.n()).done;){var s=n.value;e.tag(s.no,s.wireType).raw(s.data)}}catch(a){r.e(a)}finally{r.f()}}},onUnknownField:function(i,e,t,n){var r=i;Array.isArray(r[eo])||(r[eo]=[]),r[eo].push({no:e,wireType:t,data:n})},readMessage:function(i,e,t,n,r){for(var s,a,o=i.getType(),c=r?e.len:e.pos+t;e.pos<c;){var u=At(e.tag(),2);if(s=u[0],a=u[1],r===!0&&a==dn.EndGroup)break;var d=o.fields.find(s);if(d)lk(i,e,d,a,n);else{var h=e.skip(a,s);n.readUnknownFields&&this.onUnknownField(i,s,a,h)}}if(r&&(a!=dn.EndGroup||s!==t))throw new Error("invalid end group tag")},readField:lk,writeMessage:function(i,e,t){var n,r=i.getType(),s=dt(r.fields.byNumber());try{for(s.s();!(n=s.n()).done;){var a=n.value;if(Z_(a,i))ck(a,a.oneof?i[a.oneof.localName].value:i[a.localName],e,t);else if(a.req)throw new Error("cannot encode field ".concat(r.typeName,".").concat(a.name," to binary: required field not set"))}}catch(o){s.e(o)}finally{s.f()}return t.writeUnknownFields&&this.writeUnknownFields(i,e),e},writeField:function(i,e,t,n){e!==void 0&&ck(i,e,t,n)}},util:Object.assign(Object.assign({},{setEnumType:V_,initPartial:function(i,e){if(i!==void 0){var t,n=dt(e.getType().fields.byMember());try{var r=function(){var s=t.value,a=s.localName,o=e,c=i;if(c[a]==null)return 0;switch(s.kind){case"oneof":var u=c[a].case;if(u===void 0)return 0;var d=s.findField(u),h=c[a].value;d&&d.kind=="message"&&!Gs(h,d.T)?h=new d.T(h):d&&d.kind==="scalar"&&d.T===Oe.BYTES&&(h=Dl(h)),o[a]={case:u,value:h};break;case"scalar":case"enum":var b=c[a];s.T===Oe.BYTES&&(b=s.repeated?b.map(Dl):Dl(b)),o[a]=b;break;case"map":switch(s.V.kind){case"scalar":case"enum":if(s.V.T===Oe.BYTES)for(var v=0,y=Object.entries(c[a]);v<y.length;v++){var p=At(y[v],2),f=p[0],m=p[1];o[a][f]=Dl(m)}else Object.assign(o[a],c[a]);break;case"message":for(var _=s.V.T,k=0,D=Object.keys(c[a]);k<D.length;k++){var E=D[k],A=c[a][E];_.fieldWrapper||(A=new _(A)),o[a][E]=A}break}break;case"message":var w=s.T;if(s.repeated)o[a]=c[a].map(function(S){return Gs(S,w)?S:new w(S)});else{var N=c[a];w.fieldWrapper?w.typeName==="google.protobuf.BytesValue"?o[a]=Dl(N):o[a]=N:o[a]=Gs(N,w)?N:new w(N)}break}};for(n.s();!(t=n.n()).done;)r()}catch(s){n.e(s)}finally{n.f()}}},equals:function(i,e,t){return e===t||!(!e||!t)&&i.fields.byMember().every(function(n){var r=e[n.localName],s=t[n.localName];if(n.repeated){if(r.length!==s.length)return!1;switch(n.kind){case"message":return r.every(function(d,h){return n.T.equals(d,s[h])});case"scalar":return r.every(function(d,h){return hs(n.T,d,s[h])});case"enum":return r.every(function(d,h){return hs(Oe.INT32,d,s[h])})}throw new Error("repeated cannot contain ".concat(n.kind))}switch(n.kind){case"message":return n.T.equals(r,s);case"enum":return hs(Oe.INT32,r,s);case"scalar":return hs(n.T,r,s);case"oneof":if(r.case!==s.case)return!1;var a=n.findField(r.case);if(a===void 0)return!0;switch(a.kind){case"message":return a.T.equals(r.value,s.value);case"enum":return hs(Oe.INT32,r.value,s.value);case"scalar":return hs(a.T,r.value,s.value)}throw new Error("oneof cannot contain ".concat(a.kind));case"map":var o=Object.keys(r).concat(Object.keys(s));switch(n.V.kind){case"message":var c=n.V.T;return o.every(function(d){return c.equals(r[d],s[d])});case"enum":return o.every(function(d){return hs(Oe.INT32,r[d],s[d])});case"scalar":var u=n.V.T;return o.every(function(d){return hs(u,r[d],s[d])})}break}})},clone:function(i){var e,t=i.getType(),n=new t,r=n,s=dt(t.fields.byMember());try{for(s.s();!(e=s.n()).done;){var a=e.value,o=i[a.localName],c=void 0;if(a.repeated)c=o.map(ad);else if(a.kind=="map"){c=r[a.localName];for(var u=0,d=Object.entries(o);u<d.length;u++){var h=At(d[u],2),b=h[0],v=h[1];c[b]=ad(v)}}else c=a.kind=="oneof"?a.findField(o.case)?{case:o.case,value:ad(o.value)}:{case:void 0}:ad(o);r[a.localName]=c}}catch(m){s.e(m)}finally{s.f()}var y,p=dt(t.runtime.bin.listUnknownFields(i));try{for(p.s();!(y=p.n()).done;){var f=y.value;t.runtime.bin.onUnknownField(r,f.no,f.wireType,f.data)}}catch(m){p.e(m)}finally{p.f()}return n}}),{newFieldList:mk,initFields:gk}),makeMessageType:function(i,e,t){return function(n,r,s,a){var o,c=(o=a==null?void 0:a.localName)!==null&&o!==void 0?o:r.substring(r.lastIndexOf(".")+1),u=Qa({},c,function(d){n.util.initFields(this),n.util.initPartial(d,this)})[c];return Object.setPrototypeOf(u.prototype,new tm),Object.assign(u,{runtime:n,typeName:r,fields:n.util.newFieldList(s),fromBinary:function(d,h){return new u().fromBinary(d,h)},fromJson:function(d,h){return new u().fromJson(d,h)},fromJsonString:function(d,h){return new u().fromJsonString(d,h)},equals:function(d,h){return n.util.equals(u,d,h)}}),u}(this,i,e,t)},makeEnum:sM,makeEnumType:j_,getEnumType:rM,makeExtension:function(i,e,t){return function(n,r,s,a){var o;return{typeName:r,extendee:s,get field(){if(!o){var c=typeof a=="function"?a():a;c.name=r.split(".").pop(),c.jsonName="[".concat(r,"]"),o=n.util.newFieldList([c]).list()[0]}return o},runtime:n}}(this,i,e,t)}}),Ws=function(i){function e(t){var n;return ht(this,e),(n=Rt(this,e)).seconds=qt.zero,n.nanos=0,De.util.initPartial(t,ct(n)),n}return Lt(e,tm),ft(e,[{key:"fromJson",value:function(t,n){if(typeof t!="string")throw new Error("cannot decode google.protobuf.Timestamp from JSON: ".concat(De.json.debug(t)));var r=t.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:Z|\.([0-9]{3,9})Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!r)throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");var s=Date.parse(r[1]+"-"+r[2]+"-"+r[3]+"T"+r[4]+":"+r[5]+":"+r[6]+(r[8]?r[8]:"Z"));if(Number.isNaN(s))throw new Error("cannot decode google.protobuf.Timestamp from JSON: invalid RFC 3339 string");if(s<Date.parse("0001-01-01T00:00:00Z")||s>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot decode message google.protobuf.Timestamp from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");return this.seconds=qt.parse(s/1e3),this.nanos=0,r[7]&&(this.nanos=parseInt("1"+r[7]+"0".repeat(9-r[7].length))-1e9),this}},{key:"toJson",value:function(t){var n=1e3*Number(this.seconds);if(n<Date.parse("0001-01-01T00:00:00Z")||n>Date.parse("9999-12-31T23:59:59Z"))throw new Error("cannot encode google.protobuf.Timestamp to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive");if(0>this.nanos)throw new Error("cannot encode google.protobuf.Timestamp to JSON: nanos must not be negative");var r="Z";if(this.nanos>0){var s=(this.nanos+1e9).toString().substring(1);r=s.substring(3)==="000000"?"."+s.substring(0,3)+"Z":s.substring(6)==="000"?"."+s.substring(0,6)+"Z":"."+s+"Z"}return new Date(n).toISOString().replace(".000Z",r)}},{key:"toDate",value:function(){return new Date(1e3*Number(this.seconds)+Math.ceil(this.nanos/1e6))}}],[{key:"now",value:function(){return e.fromDate(new Date)}},{key:"fromDate",value:function(t){var n=t.getTime();return new e({seconds:qt.parse(Math.floor(n/1e3)),nanos:n%1e3*1e6})}},{key:"fromBinary",value:function(t,n){return new e().fromBinary(t,n)}},{key:"fromJson",value:function(t,n){return new e().fromJson(t,n)}},{key:"fromJsonString",value:function(t,n){return new e().fromJsonString(t,n)}},{key:"equals",value:function(t,n){return De.util.equals(e,t,n)}}]),e}();Ws.runtime=De,Ws.typeName="google.protobuf.Timestamp",Ws.fields=De.util.newFieldList(function(){return[{no:1,name:"seconds",kind:"scalar",T:3},{no:2,name:"nanos",kind:"scalar",T:5}]});var wM=De.makeMessageType("livekit.MetricsBatch",function(){return[{no:1,name:"timestamp_ms",kind:"scalar",T:3},{no:2,name:"normalized_timestamp",kind:"message",T:Ws},{no:3,name:"str_data",kind:"scalar",T:9,repeated:!0},{no:4,name:"time_series",kind:"message",T:DM,repeated:!0},{no:5,name:"events",kind:"message",T:IM,repeated:!0}]}),DM=De.makeMessageType("livekit.TimeSeriesMetric",function(){return[{no:1,name:"label",kind:"scalar",T:13},{no:2,name:"participant_identity",kind:"scalar",T:13},{no:3,name:"track_sid",kind:"scalar",T:13},{no:4,name:"samples",kind:"message",T:AM,repeated:!0},{no:5,name:"rid",kind:"scalar",T:13}]}),AM=De.makeMessageType("livekit.MetricSample",function(){return[{no:1,name:"timestamp_ms",kind:"scalar",T:3},{no:2,name:"normalized_timestamp",kind:"message",T:Ws},{no:3,name:"value",kind:"scalar",T:2}]}),IM=De.makeMessageType("livekit.EventMetric",function(){return[{no:1,name:"label",kind:"scalar",T:13},{no:2,name:"participant_identity",kind:"scalar",T:13},{no:3,name:"track_sid",kind:"scalar",T:13},{no:4,name:"start_timestamp_ms",kind:"scalar",T:3},{no:5,name:"end_timestamp_ms",kind:"scalar",T:3,opt:!0},{no:6,name:"normalized_start_timestamp",kind:"message",T:Ws},{no:7,name:"normalized_end_timestamp",kind:"message",T:Ws,opt:!0},{no:8,name:"metadata",kind:"scalar",T:9},{no:9,name:"rid",kind:"scalar",T:13}]}),zi=De.makeEnum("livekit.TrackType",[{no:0,name:"AUDIO"},{no:1,name:"VIDEO"},{no:2,name:"DATA"}]),jn=De.makeEnum("livekit.TrackSource",[{no:0,name:"UNKNOWN"},{no:1,name:"CAMERA"},{no:2,name:"MICROPHONE"},{no:3,name:"SCREEN_SHARE"},{no:4,name:"SCREEN_SHARE_AUDIO"}]),am=De.makeEnum("livekit.VideoQuality",[{no:0,name:"LOW"},{no:1,name:"MEDIUM"},{no:2,name:"HIGH"},{no:3,name:"OFF"}]),Al=De.makeEnum("livekit.ConnectionQuality",[{no:0,name:"POOR"},{no:1,name:"GOOD"},{no:2,name:"EXCELLENT"},{no:3,name:"LOST"}]),Il=De.makeEnum("livekit.ClientConfigSetting",[{no:0,name:"UNSET"},{no:1,name:"DISABLED"},{no:2,name:"ENABLED"}]),to=De.makeEnum("livekit.DisconnectReason",[{no:0,name:"UNKNOWN_REASON"},{no:1,name:"CLIENT_INITIATED"},{no:2,name:"DUPLICATE_IDENTITY"},{no:3,name:"SERVER_SHUTDOWN"},{no:4,name:"PARTICIPANT_REMOVED"},{no:5,name:"ROOM_DELETED"},{no:6,name:"STATE_MISMATCH"},{no:7,name:"JOIN_FAILURE"},{no:8,name:"MIGRATION"},{no:9,name:"SIGNAL_CLOSE"},{no:10,name:"ROOM_CLOSED"},{no:11,name:"USER_UNAVAILABLE"},{no:12,name:"USER_REJECTED"}]),no=De.makeEnum("livekit.ReconnectReason",[{no:0,name:"RR_UNKNOWN"},{no:1,name:"RR_SIGNAL_DISCONNECTED"},{no:2,name:"RR_PUBLISHER_FAILED"},{no:3,name:"RR_SUBSCRIBER_FAILED"},{no:4,name:"RR_SWITCH_CANDIDATE"}]),NM=De.makeEnum("livekit.SubscriptionError",[{no:0,name:"SE_UNKNOWN"},{no:1,name:"SE_CODEC_UNSUPPORTED"},{no:2,name:"SE_TRACK_NOTFOUND"}]),pr=De.makeEnum("livekit.AudioTrackFeature",[{no:0,name:"TF_STEREO"},{no:1,name:"TF_NO_DTX"},{no:2,name:"TF_AUTO_GAIN_CONTROL"},{no:3,name:"TF_ECHO_CANCELLATION"},{no:4,name:"TF_NOISE_SUPPRESSION"},{no:5,name:"TF_ENHANCED_NOISE_CANCELLATION"}]),om=De.makeMessageType("livekit.Room",function(){return[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"empty_timeout",kind:"scalar",T:13},{no:14,name:"departure_timeout",kind:"scalar",T:13},{no:4,name:"max_participants",kind:"scalar",T:13},{no:5,name:"creation_time",kind:"scalar",T:3},{no:6,name:"turn_password",kind:"scalar",T:9},{no:7,name:"enabled_codecs",kind:"message",T:od,repeated:!0},{no:8,name:"metadata",kind:"scalar",T:9},{no:9,name:"num_participants",kind:"scalar",T:13},{no:11,name:"num_publishers",kind:"scalar",T:13},{no:10,name:"active_recording",kind:"scalar",T:8},{no:13,name:"version",kind:"message",T:Ck}]}),od=De.makeMessageType("livekit.Codec",function(){return[{no:1,name:"mime",kind:"scalar",T:9},{no:2,name:"fmtp_line",kind:"scalar",T:9}]}),PM=De.makeMessageType("livekit.ParticipantPermission",function(){return[{no:1,name:"can_subscribe",kind:"scalar",T:8},{no:2,name:"can_publish",kind:"scalar",T:8},{no:3,name:"can_publish_data",kind:"scalar",T:8},{no:9,name:"can_publish_sources",kind:"enum",T:De.getEnumType(jn),repeated:!0},{no:7,name:"hidden",kind:"scalar",T:8},{no:8,name:"recorder",kind:"scalar",T:8},{no:10,name:"can_update_metadata",kind:"scalar",T:8},{no:11,name:"agent",kind:"scalar",T:8},{no:12,name:"can_subscribe_metrics",kind:"scalar",T:8}]}),Nl=De.makeMessageType("livekit.ParticipantInfo",function(){return[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"identity",kind:"scalar",T:9},{no:3,name:"state",kind:"enum",T:De.getEnumType(lm)},{no:4,name:"tracks",kind:"message",T:io,repeated:!0},{no:5,name:"metadata",kind:"scalar",T:9},{no:6,name:"joined_at",kind:"scalar",T:3},{no:9,name:"name",kind:"scalar",T:9},{no:10,name:"version",kind:"scalar",T:13},{no:11,name:"permission",kind:"message",T:PM},{no:12,name:"region",kind:"scalar",T:9},{no:13,name:"is_publisher",kind:"scalar",T:8},{no:14,name:"kind",kind:"enum",T:De.getEnumType(ld)},{no:15,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:16,name:"disconnect_reason",kind:"enum",T:De.getEnumType(to)}]}),lm=De.makeEnum("livekit.ParticipantInfo.State",[{no:0,name:"JOINING"},{no:1,name:"JOINED"},{no:2,name:"ACTIVE"},{no:3,name:"DISCONNECTED"}]),ld=De.makeEnum("livekit.ParticipantInfo.Kind",[{no:0,name:"STANDARD"},{no:1,name:"INGRESS"},{no:2,name:"EGRESS"},{no:3,name:"SIP"},{no:4,name:"AGENT"}]),Ni=De.makeEnum("livekit.Encryption.Type",[{no:0,name:"NONE"},{no:1,name:"GCM"},{no:2,name:"CUSTOM"}]),OM=De.makeMessageType("livekit.SimulcastCodecInfo",function(){return[{no:1,name:"mime_type",kind:"scalar",T:9},{no:2,name:"mid",kind:"scalar",T:9},{no:3,name:"cid",kind:"scalar",T:9},{no:4,name:"layers",kind:"message",T:Ks,repeated:!0}]}),io=De.makeMessageType("livekit.TrackInfo",function(){return[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"type",kind:"enum",T:De.getEnumType(zi)},{no:3,name:"name",kind:"scalar",T:9},{no:4,name:"muted",kind:"scalar",T:8},{no:5,name:"width",kind:"scalar",T:13},{no:6,name:"height",kind:"scalar",T:13},{no:7,name:"simulcast",kind:"scalar",T:8},{no:8,name:"disable_dtx",kind:"scalar",T:8},{no:9,name:"source",kind:"enum",T:De.getEnumType(jn)},{no:10,name:"layers",kind:"message",T:Ks,repeated:!0},{no:11,name:"mime_type",kind:"scalar",T:9},{no:12,name:"mid",kind:"scalar",T:9},{no:13,name:"codecs",kind:"message",T:OM,repeated:!0},{no:14,name:"stereo",kind:"scalar",T:8},{no:15,name:"disable_red",kind:"scalar",T:8},{no:16,name:"encryption",kind:"enum",T:De.getEnumType(Ni)},{no:17,name:"stream",kind:"scalar",T:9},{no:18,name:"version",kind:"message",T:Ck},{no:19,name:"audio_features",kind:"enum",T:De.getEnumType(pr),repeated:!0}]}),Ks=De.makeMessageType("livekit.VideoLayer",function(){return[{no:1,name:"quality",kind:"enum",T:De.getEnumType(am)},{no:2,name:"width",kind:"scalar",T:13},{no:3,name:"height",kind:"scalar",T:13},{no:4,name:"bitrate",kind:"scalar",T:13},{no:5,name:"ssrc",kind:"scalar",T:13}]}),Pl=De.makeMessageType("livekit.DataPacket",function(){return[{no:1,name:"kind",kind:"enum",T:De.getEnumType(gn)},{no:4,name:"participant_identity",kind:"scalar",T:9},{no:5,name:"destination_identities",kind:"scalar",T:9,repeated:!0},{no:2,name:"user",kind:"message",T:yk,oneof:"value"},{no:3,name:"speaker",kind:"message",T:MM,oneof:"value"},{no:6,name:"sip_dtmf",kind:"message",T:bk,oneof:"value"},{no:7,name:"transcription",kind:"message",T:RM,oneof:"value"},{no:8,name:"metrics",kind:"message",T:wM,oneof:"value"},{no:9,name:"chat_message",kind:"message",T:cm,oneof:"value"},{no:10,name:"rpc_request",kind:"message",T:BM,oneof:"value"},{no:11,name:"rpc_ack",kind:"message",T:UM,oneof:"value"},{no:12,name:"rpc_response",kind:"message",T:FM,oneof:"value"}]}),gn=De.makeEnum("livekit.DataPacket.Kind",[{no:0,name:"RELIABLE"},{no:1,name:"LOSSY"}]),MM=De.makeMessageType("livekit.ActiveSpeakerUpdate",function(){return[{no:1,name:"speakers",kind:"message",T:vk,repeated:!0}]}),vk=De.makeMessageType("livekit.SpeakerInfo",function(){return[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"level",kind:"scalar",T:2},{no:3,name:"active",kind:"scalar",T:8}]}),yk=De.makeMessageType("livekit.UserPacket",function(){return[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:5,name:"participant_identity",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:12},{no:3,name:"destination_sids",kind:"scalar",T:9,repeated:!0},{no:6,name:"destination_identities",kind:"scalar",T:9,repeated:!0},{no:4,name:"topic",kind:"scalar",T:9,opt:!0},{no:8,name:"id",kind:"scalar",T:9,opt:!0},{no:9,name:"start_time",kind:"scalar",T:4,opt:!0},{no:10,name:"end_time",kind:"scalar",T:4,opt:!0}]}),bk=De.makeMessageType("livekit.SipDTMF",function(){return[{no:3,name:"code",kind:"scalar",T:13},{no:4,name:"digit",kind:"scalar",T:9}]}),RM=De.makeMessageType("livekit.Transcription",function(){return[{no:2,name:"transcribed_participant_identity",kind:"scalar",T:9},{no:3,name:"track_id",kind:"scalar",T:9},{no:4,name:"segments",kind:"message",T:LM,repeated:!0}]}),LM=De.makeMessageType("livekit.TranscriptionSegment",function(){return[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"text",kind:"scalar",T:9},{no:3,name:"start_time",kind:"scalar",T:4},{no:4,name:"end_time",kind:"scalar",T:4},{no:5,name:"final",kind:"scalar",T:8},{no:6,name:"language",kind:"scalar",T:9}]}),cm=De.makeMessageType("livekit.ChatMessage",function(){return[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"timestamp",kind:"scalar",T:3},{no:3,name:"edit_timestamp",kind:"scalar",T:3,opt:!0},{no:4,name:"message",kind:"scalar",T:9},{no:5,name:"deleted",kind:"scalar",T:8},{no:6,name:"generated",kind:"scalar",T:8}]}),BM=De.makeMessageType("livekit.RpcRequest",function(){return[{no:1,name:"id",kind:"scalar",T:9},{no:2,name:"method",kind:"scalar",T:9},{no:3,name:"payload",kind:"scalar",T:9},{no:4,name:"response_timeout_ms",kind:"scalar",T:13},{no:5,name:"version",kind:"scalar",T:13}]}),UM=De.makeMessageType("livekit.RpcAck",function(){return[{no:1,name:"request_id",kind:"scalar",T:9}]}),FM=De.makeMessageType("livekit.RpcResponse",function(){return[{no:1,name:"request_id",kind:"scalar",T:9},{no:2,name:"payload",kind:"scalar",T:9,oneof:"value"},{no:3,name:"error",kind:"message",T:VM,oneof:"value"}]}),VM=De.makeMessageType("livekit.RpcError",function(){return[{no:1,name:"code",kind:"scalar",T:13},{no:2,name:"message",kind:"scalar",T:9},{no:3,name:"data",kind:"scalar",T:9}]}),_k=De.makeMessageType("livekit.ParticipantTracks",function(){return[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sids",kind:"scalar",T:9,repeated:!0}]}),jM=De.makeMessageType("livekit.ServerInfo",function(){return[{no:1,name:"edition",kind:"enum",T:De.getEnumType($M)},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"protocol",kind:"scalar",T:5},{no:4,name:"region",kind:"scalar",T:9},{no:5,name:"node_id",kind:"scalar",T:9},{no:6,name:"debug_info",kind:"scalar",T:9},{no:7,name:"agent_protocol",kind:"scalar",T:5}]}),$M=De.makeEnum("livekit.ServerInfo.Edition",[{no:0,name:"Standard"},{no:1,name:"Cloud"}]),HM=De.makeMessageType("livekit.ClientInfo",function(){return[{no:1,name:"sdk",kind:"enum",T:De.getEnumType(kk)},{no:2,name:"version",kind:"scalar",T:9},{no:3,name:"protocol",kind:"scalar",T:5},{no:4,name:"os",kind:"scalar",T:9},{no:5,name:"os_version",kind:"scalar",T:9},{no:6,name:"device_model",kind:"scalar",T:9},{no:7,name:"browser",kind:"scalar",T:9},{no:8,name:"browser_version",kind:"scalar",T:9},{no:9,name:"address",kind:"scalar",T:9},{no:10,name:"network",kind:"scalar",T:9},{no:11,name:"other_sdks",kind:"scalar",T:9}]}),kk=De.makeEnum("livekit.ClientInfo.SDK",[{no:0,name:"UNKNOWN"},{no:1,name:"JS"},{no:2,name:"SWIFT"},{no:3,name:"ANDROID"},{no:4,name:"FLUTTER"},{no:5,name:"GO"},{no:6,name:"UNITY"},{no:7,name:"REACT_NATIVE"},{no:8,name:"RUST"},{no:9,name:"PYTHON"},{no:10,name:"CPP"},{no:11,name:"UNITY_WEB"},{no:12,name:"NODE"}]),Tk=De.makeMessageType("livekit.ClientConfiguration",function(){return[{no:1,name:"video",kind:"message",T:Sk},{no:2,name:"screen",kind:"message",T:Sk},{no:3,name:"resume_connection",kind:"enum",T:De.getEnumType(Il)},{no:4,name:"disabled_codecs",kind:"message",T:qM},{no:5,name:"force_relay",kind:"enum",T:De.getEnumType(Il)}]}),Sk=De.makeMessageType("livekit.VideoConfiguration",function(){return[{no:1,name:"hardware_encoder",kind:"enum",T:De.getEnumType(Il)}]}),qM=De.makeMessageType("livekit.DisabledCodecs",function(){return[{no:1,name:"codecs",kind:"message",T:od,repeated:!0},{no:2,name:"publish",kind:"message",T:od,repeated:!0}]}),Ck=De.makeMessageType("livekit.TimedVersion",function(){return[{no:1,name:"unix_micro",kind:"scalar",T:3},{no:2,name:"ticks",kind:"scalar",T:5}]}),Gi=De.makeEnum("livekit.SignalTarget",[{no:0,name:"PUBLISHER"},{no:1,name:"SUBSCRIBER"}]),um=De.makeEnum("livekit.StreamState",[{no:0,name:"ACTIVE"},{no:1,name:"PAUSED"}]),zM=De.makeEnum("livekit.CandidateProtocol",[{no:0,name:"UDP"},{no:1,name:"TCP"},{no:2,name:"TLS"}]),GM=De.makeMessageType("livekit.SignalRequest",function(){return[{no:1,name:"offer",kind:"message",T:Xs,oneof:"message"},{no:2,name:"answer",kind:"message",T:Xs,oneof:"message"},{no:3,name:"trickle",kind:"message",T:fm,oneof:"message"},{no:4,name:"add_track",kind:"message",T:hm,oneof:"message"},{no:5,name:"mute",kind:"message",T:pm,oneof:"message"},{no:6,name:"subscription",kind:"message",T:cd,oneof:"message"},{no:7,name:"track_setting",kind:"message",T:Ek,oneof:"message"},{no:8,name:"leave",kind:"message",T:ud,oneof:"message"},{no:10,name:"update_layers",kind:"message",T:Dk,oneof:"message"},{no:11,name:"subscription_permission",kind:"message",T:Pk,oneof:"message"},{no:12,name:"sync_state",kind:"message",T:Ok,oneof:"message"},{no:13,name:"simulate",kind:"message",T:mr,oneof:"message"},{no:14,name:"ping",kind:"scalar",T:3,oneof:"message"},{no:15,name:"update_metadata",kind:"message",T:Ak,oneof:"message"},{no:16,name:"ping_req",kind:"message",T:Rk,oneof:"message"},{no:17,name:"update_audio_track",kind:"message",T:wk,oneof:"message"},{no:18,name:"update_video_track",kind:"message",T:JM,oneof:"message"}]}),xk=De.makeMessageType("livekit.SignalResponse",function(){return[{no:1,name:"join",kind:"message",T:WM,oneof:"message"},{no:2,name:"answer",kind:"message",T:Xs,oneof:"message"},{no:3,name:"offer",kind:"message",T:Xs,oneof:"message"},{no:4,name:"trickle",kind:"message",T:fm,oneof:"message"},{no:5,name:"update",kind:"message",T:YM,oneof:"message"},{no:6,name:"track_published",kind:"message",T:mm,oneof:"message"},{no:8,name:"leave",kind:"message",T:ud,oneof:"message"},{no:9,name:"mute",kind:"message",T:pm,oneof:"message"},{no:10,name:"speakers_changed",kind:"message",T:QM,oneof:"message"},{no:11,name:"room_update",kind:"message",T:ZM,oneof:"message"},{no:12,name:"connection_quality",kind:"message",T:t9,oneof:"message"},{no:13,name:"stream_state_update",kind:"message",T:i9,oneof:"message"},{no:14,name:"subscribed_quality_update",kind:"message",T:s9,oneof:"message"},{no:15,name:"subscription_permission_update",kind:"message",T:a9,oneof:"message"},{no:16,name:"refresh_token",kind:"scalar",T:9,oneof:"message"},{no:17,name:"track_unpublished",kind:"message",T:XM,oneof:"message"},{no:18,name:"pong",kind:"scalar",T:3,oneof:"message"},{no:19,name:"reconnect",kind:"message",T:KM,oneof:"message"},{no:20,name:"pong_resp",kind:"message",T:o9,oneof:"message"},{no:21,name:"subscription_response",kind:"message",T:u9,oneof:"message"},{no:22,name:"request_response",kind:"message",T:d9,oneof:"message"},{no:23,name:"track_subscribed",kind:"message",T:h9,oneof:"message"}]}),dm=De.makeMessageType("livekit.SimulcastCodec",function(){return[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"cid",kind:"scalar",T:9}]}),hm=De.makeMessageType("livekit.AddTrackRequest",function(){return[{no:1,name:"cid",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"type",kind:"enum",T:De.getEnumType(zi)},{no:4,name:"width",kind:"scalar",T:13},{no:5,name:"height",kind:"scalar",T:13},{no:6,name:"muted",kind:"scalar",T:8},{no:7,name:"disable_dtx",kind:"scalar",T:8},{no:8,name:"source",kind:"enum",T:De.getEnumType(jn)},{no:9,name:"layers",kind:"message",T:Ks,repeated:!0},{no:10,name:"simulcast_codecs",kind:"message",T:dm,repeated:!0},{no:11,name:"sid",kind:"scalar",T:9},{no:12,name:"stereo",kind:"scalar",T:8},{no:13,name:"disable_red",kind:"scalar",T:8},{no:14,name:"encryption",kind:"enum",T:De.getEnumType(Ni)},{no:15,name:"stream",kind:"scalar",T:9}]}),fm=De.makeMessageType("livekit.TrickleRequest",function(){return[{no:1,name:"candidateInit",kind:"scalar",T:9},{no:2,name:"target",kind:"enum",T:De.getEnumType(Gi)},{no:3,name:"final",kind:"scalar",T:8}]}),pm=De.makeMessageType("livekit.MuteTrackRequest",function(){return[{no:1,name:"sid",kind:"scalar",T:9},{no:2,name:"muted",kind:"scalar",T:8}]}),WM=De.makeMessageType("livekit.JoinResponse",function(){return[{no:1,name:"room",kind:"message",T:om},{no:2,name:"participant",kind:"message",T:Nl},{no:3,name:"other_participants",kind:"message",T:Nl,repeated:!0},{no:4,name:"server_version",kind:"scalar",T:9},{no:5,name:"ice_servers",kind:"message",T:Ik,repeated:!0},{no:6,name:"subscriber_primary",kind:"scalar",T:8},{no:7,name:"alternative_url",kind:"scalar",T:9},{no:8,name:"client_configuration",kind:"message",T:Tk},{no:9,name:"server_region",kind:"scalar",T:9},{no:10,name:"ping_timeout",kind:"scalar",T:5},{no:11,name:"ping_interval",kind:"scalar",T:5},{no:12,name:"server_info",kind:"message",T:jM},{no:13,name:"sif_trailer",kind:"scalar",T:12},{no:14,name:"enabled_publish_codecs",kind:"message",T:od,repeated:!0},{no:15,name:"fast_publish",kind:"scalar",T:8}]}),KM=De.makeMessageType("livekit.ReconnectResponse",function(){return[{no:1,name:"ice_servers",kind:"message",T:Ik,repeated:!0},{no:2,name:"client_configuration",kind:"message",T:Tk}]}),mm=De.makeMessageType("livekit.TrackPublishedResponse",function(){return[{no:1,name:"cid",kind:"scalar",T:9},{no:2,name:"track",kind:"message",T:io}]}),XM=De.makeMessageType("livekit.TrackUnpublishedResponse",function(){return[{no:1,name:"track_sid",kind:"scalar",T:9}]}),Xs=De.makeMessageType("livekit.SessionDescription",function(){return[{no:1,name:"type",kind:"scalar",T:9},{no:2,name:"sdp",kind:"scalar",T:9}]}),YM=De.makeMessageType("livekit.ParticipantUpdate",function(){return[{no:1,name:"participants",kind:"message",T:Nl,repeated:!0}]}),cd=De.makeMessageType("livekit.UpdateSubscription",function(){return[{no:1,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:2,name:"subscribe",kind:"scalar",T:8},{no:3,name:"participant_tracks",kind:"message",T:_k,repeated:!0}]}),Ek=De.makeMessageType("livekit.UpdateTrackSettings",function(){return[{no:1,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:3,name:"disabled",kind:"scalar",T:8},{no:4,name:"quality",kind:"enum",T:De.getEnumType(am)},{no:5,name:"width",kind:"scalar",T:13},{no:6,name:"height",kind:"scalar",T:13},{no:7,name:"fps",kind:"scalar",T:13},{no:8,name:"priority",kind:"scalar",T:13}]}),wk=De.makeMessageType("livekit.UpdateLocalAudioTrack",function(){return[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"features",kind:"enum",T:De.getEnumType(pr),repeated:!0}]}),JM=De.makeMessageType("livekit.UpdateLocalVideoTrack",function(){return[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"width",kind:"scalar",T:13},{no:3,name:"height",kind:"scalar",T:13}]}),ud=De.makeMessageType("livekit.LeaveRequest",function(){return[{no:1,name:"can_reconnect",kind:"scalar",T:8},{no:2,name:"reason",kind:"enum",T:De.getEnumType(to)},{no:3,name:"action",kind:"enum",T:De.getEnumType(ro)},{no:4,name:"regions",kind:"message",T:l9}]}),ro=De.makeEnum("livekit.LeaveRequest.Action",[{no:0,name:"DISCONNECT"},{no:1,name:"RESUME"},{no:2,name:"RECONNECT"}]),Dk=De.makeMessageType("livekit.UpdateVideoLayers",function(){return[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"layers",kind:"message",T:Ks,repeated:!0}]}),Ak=De.makeMessageType("livekit.UpdateParticipantMetadata",function(){return[{no:1,name:"metadata",kind:"scalar",T:9},{no:2,name:"name",kind:"scalar",T:9},{no:3,name:"attributes",kind:"map",K:9,V:{kind:"scalar",T:9}},{no:4,name:"request_id",kind:"scalar",T:13}]}),Ik=De.makeMessageType("livekit.ICEServer",function(){return[{no:1,name:"urls",kind:"scalar",T:9,repeated:!0},{no:2,name:"username",kind:"scalar",T:9},{no:3,name:"credential",kind:"scalar",T:9}]}),QM=De.makeMessageType("livekit.SpeakersChanged",function(){return[{no:1,name:"speakers",kind:"message",T:vk,repeated:!0}]}),ZM=De.makeMessageType("livekit.RoomUpdate",function(){return[{no:1,name:"room",kind:"message",T:om}]}),e9=De.makeMessageType("livekit.ConnectionQualityInfo",function(){return[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"quality",kind:"enum",T:De.getEnumType(Al)},{no:3,name:"score",kind:"scalar",T:2}]}),t9=De.makeMessageType("livekit.ConnectionQualityUpdate",function(){return[{no:1,name:"updates",kind:"message",T:e9,repeated:!0}]}),n9=De.makeMessageType("livekit.StreamStateInfo",function(){return[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sid",kind:"scalar",T:9},{no:3,name:"state",kind:"enum",T:De.getEnumType(um)}]}),i9=De.makeMessageType("livekit.StreamStateUpdate",function(){return[{no:1,name:"stream_states",kind:"message",T:n9,repeated:!0}]}),gm=De.makeMessageType("livekit.SubscribedQuality",function(){return[{no:1,name:"quality",kind:"enum",T:De.getEnumType(am)},{no:2,name:"enabled",kind:"scalar",T:8}]}),r9=De.makeMessageType("livekit.SubscribedCodec",function(){return[{no:1,name:"codec",kind:"scalar",T:9},{no:2,name:"qualities",kind:"message",T:gm,repeated:!0}]}),s9=De.makeMessageType("livekit.SubscribedQualityUpdate",function(){return[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"subscribed_qualities",kind:"message",T:gm,repeated:!0},{no:3,name:"subscribed_codecs",kind:"message",T:r9,repeated:!0}]}),Nk=De.makeMessageType("livekit.TrackPermission",function(){return[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"all_tracks",kind:"scalar",T:8},{no:3,name:"track_sids",kind:"scalar",T:9,repeated:!0},{no:4,name:"participant_identity",kind:"scalar",T:9}]}),Pk=De.makeMessageType("livekit.SubscriptionPermission",function(){return[{no:1,name:"all_participants",kind:"scalar",T:8},{no:2,name:"track_permissions",kind:"message",T:Nk,repeated:!0}]}),a9=De.makeMessageType("livekit.SubscriptionPermissionUpdate",function(){return[{no:1,name:"participant_sid",kind:"scalar",T:9},{no:2,name:"track_sid",kind:"scalar",T:9},{no:3,name:"allowed",kind:"scalar",T:8}]}),Ok=De.makeMessageType("livekit.SyncState",function(){return[{no:1,name:"answer",kind:"message",T:Xs},{no:2,name:"subscription",kind:"message",T:cd},{no:3,name:"publish_tracks",kind:"message",T:mm,repeated:!0},{no:4,name:"data_channels",kind:"message",T:Mk,repeated:!0},{no:5,name:"offer",kind:"message",T:Xs},{no:6,name:"track_sids_disabled",kind:"scalar",T:9,repeated:!0}]}),Mk=De.makeMessageType("livekit.DataChannelInfo",function(){return[{no:1,name:"label",kind:"scalar",T:9},{no:2,name:"id",kind:"scalar",T:13},{no:3,name:"target",kind:"enum",T:De.getEnumType(Gi)}]}),mr=De.makeMessageType("livekit.SimulateScenario",function(){return[{no:1,name:"speaker_update",kind:"scalar",T:5,oneof:"scenario"},{no:2,name:"node_failure",kind:"scalar",T:8,oneof:"scenario"},{no:3,name:"migration",kind:"scalar",T:8,oneof:"scenario"},{no:4,name:"server_leave",kind:"scalar",T:8,oneof:"scenario"},{no:5,name:"switch_candidate_protocol",kind:"enum",T:De.getEnumType(zM),oneof:"scenario"},{no:6,name:"subscriber_bandwidth",kind:"scalar",T:3,oneof:"scenario"},{no:7,name:"disconnect_signal_on_resume",kind:"scalar",T:8,oneof:"scenario"},{no:8,name:"disconnect_signal_on_resume_no_messages",kind:"scalar",T:8,oneof:"scenario"},{no:9,name:"leave_request_full_reconnect",kind:"scalar",T:8,oneof:"scenario"}]}),Rk=De.makeMessageType("livekit.Ping",function(){return[{no:1,name:"timestamp",kind:"scalar",T:3},{no:2,name:"rtt",kind:"scalar",T:3}]}),o9=De.makeMessageType("livekit.Pong",function(){return[{no:1,name:"last_ping_timestamp",kind:"scalar",T:3},{no:2,name:"timestamp",kind:"scalar",T:3}]}),l9=De.makeMessageType("livekit.RegionSettings",function(){return[{no:1,name:"regions",kind:"message",T:c9,repeated:!0}]}),c9=De.makeMessageType("livekit.RegionInfo",function(){return[{no:1,name:"region",kind:"scalar",T:9},{no:2,name:"url",kind:"scalar",T:9},{no:3,name:"distance",kind:"scalar",T:3}]}),u9=De.makeMessageType("livekit.SubscriptionResponse",function(){return[{no:1,name:"track_sid",kind:"scalar",T:9},{no:2,name:"err",kind:"enum",T:De.getEnumType(NM)}]}),d9=De.makeMessageType("livekit.RequestResponse",function(){return[{no:1,name:"request_id",kind:"scalar",T:13},{no:2,name:"reason",kind:"enum",T:De.getEnumType(Lk)},{no:3,name:"message",kind:"scalar",T:9}]}),Lk=De.makeEnum("livekit.RequestResponse.Reason",[{no:0,name:"OK"},{no:1,name:"NOT_FOUND"},{no:2,name:"NOT_ALLOWED"},{no:3,name:"LIMIT_EXCEEDED"}]),h9=De.makeMessageType("livekit.TrackSubscribed",function(){return[{no:1,name:"track_sid",kind:"scalar",T:9}]});function f9(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Bk,vm={exports:{}},Uk,Fk,ym,bm,Wi,dd=(Bk||(Bk=1,Fk=vm.exports,ym=function(){var i=function(){},e="undefined",t=(typeof window>"u"?"undefined":et(window))!==e&&et(window.navigator)!==e&&/Trident\/|MSIE /.test(window.navigator.userAgent),n=["trace","debug","info","warn","error"],r={},s=null;function a(v,y){var p=v[y];if(typeof p.bind=="function")return p.bind(v);try{return Function.prototype.bind.call(p,v)}catch{return function(){return Function.prototype.apply.apply(p,[v,arguments])}}}function o(){console.log&&(console.log.apply||Function.prototype.apply.apply(console.log,[console,arguments]))}function c(){for(var v=this.getLevel(),y=0;y<n.length;y++){var p=n[y];this[p]=v>y?i:this.methodFactory(p,v,this.name)}if(this.log=this.debug,(typeof console>"u"?"undefined":et(console))===e&&v<this.levels.SILENT)return"No console available for logging"}function u(v){return function(){(typeof console>"u"?"undefined":et(console))!==e&&(c.call(this),this[v].apply(this,arguments))}}function d(v,y,p){return function(f){return f==="debug"&&(f="log"),(typeof console>"u"?"undefined":et(console))!==e&&(f==="trace"&&t?o:console[f]!==void 0?a(console,f):console.log!==void 0?a(console,"log"):i)}(v)||u.apply(this,arguments)}function h(v,y){var p,f,m,_=this,k="loglevel";function D(){var w;if((typeof window>"u"?"undefined":et(window))!==e&&k){try{w=window.localStorage[k]}catch{}if(et(w)===e)try{var N=window.document.cookie,S=encodeURIComponent(k),P=N.indexOf(S+"=");P!==-1&&(w=/^([^;]+)/.exec(N.slice(P+S.length+1))[1])}catch{}return _.levels[w]===void 0&&(w=void 0),w}}function E(w){var N=w;if(typeof N=="string"&&_.levels[N.toUpperCase()]!==void 0&&(N=_.levels[N.toUpperCase()]),typeof N!="number"||0>N||N>_.levels.SILENT)throw new TypeError("log.setLevel() called with invalid level: "+w);return N}typeof v=="string"?k+=":"+v:et(v)==="symbol"&&(k=void 0),_.name=v,_.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},_.methodFactory=y||d,_.getLevel=function(){return m??f??p},_.setLevel=function(w,N){return m=E(w),N!==!1&&function(S){var P=(n[S]||"silent").toUpperCase();if((typeof window>"u"?"undefined":et(window))!==e&&k){try{return void(window.localStorage[k]=P)}catch{}try{window.document.cookie=encodeURIComponent(k)+"="+P+";"}catch{}}}(m),c.call(_)},_.setDefaultLevel=function(w){f=E(w),D()||_.setLevel(w,!1)},_.resetLevel=function(){m=null,function(){if((typeof window>"u"?"undefined":et(window))!==e&&k){try{window.localStorage.removeItem(k)}catch{}try{window.document.cookie=encodeURIComponent(k)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}(),c.call(_)},_.enableAll=function(w){_.setLevel(_.levels.TRACE,w)},_.disableAll=function(w){_.setLevel(_.levels.SILENT,w)},_.rebuild=function(){if(s!==_&&(p=E(s.getLevel())),c.call(_),s===_)for(var w in r)r[w].rebuild()},p=E(s?s.getLevel():"WARN");var A=D();A!=null&&(m=E(A)),c.call(_)}(s=new h).getLogger=function(v){if(et(v)!=="symbol"&&typeof v!="string"||v==="")throw new TypeError("You must supply a name when creating a logger.");var y=r[v];return y||(y=r[v]=new h(v,s.methodFactory)),y};var b=(typeof window>"u"?"undefined":et(window))!==e?window.log:void 0;return s.noConflict=function(){return(typeof window>"u"?"undefined":et(window))!==e&&window.log===s&&(window.log=b),s},s.getLoggers=function(){return r},s.default=s,s},(Uk=vm).exports?Uk.exports=ym():Fk.log=ym()),vm.exports);(function(i){i[i.trace=0]="trace",i[i.debug=1]="debug",i[i.info=2]="info",i[i.warn=3]="warn",i[i.error=4]="error",i[i.silent=5]="silent"})(bm||(bm={})),function(i){i.Default="livekit",i.Room="livekit-room",i.Participant="livekit-participant",i.Track="livekit-track",i.Publication="livekit-track-publication",i.Engine="livekit-engine",i.Signal="livekit-signal",i.PCManager="livekit-pc-manager",i.PCTransport="livekit-pc-transport",i.E2EE="lk-e2ee"}(Wi||(Wi={}));var Ct=dd.getLogger("livekit");function Lr(i){var e=dd.getLogger(i);return e.setDefaultLevel(Ct.getLevel()),e}Object.values(Wi).map(function(i){return dd.getLogger(i)}),Ct.setDefaultLevel(bm.info);var p9=dd.getLogger("lk-e2ee"),Ol=7e3,m9=[0,300,1200,2700,4800,Ol,Ol,Ol,Ol,Ol],g9=function(){function i(e){ht(this,i),this._retryDelays=e!==void 0?Ii(e):m9}return ft(i,[{key:"nextRetryDelayInMs",value:function(e){if(e.retryCount>=this._retryDelays.length)return null;var t=this._retryDelays[e.retryCount];return e.retryCount>1?t+1e3*Math.random():t}}]),i}();function he(i,e,t,n){return new(t||(t=Promise))(function(r,s){function a(u){try{c(n.next(u))}catch(d){s(d)}}function o(u){try{c(n.throw(u))}catch(d){s(d)}}function c(u){var d;u.done?r(u.value):(d=u.value,d instanceof t?d:new t(function(h){h(d)})).then(a,o)}c((n=n.apply(i,e||[])).next())})}function v9(i){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&i[e],n=0;if(t)return t.call(i);if(i&&typeof i.length=="number")return{next:function(){return i&&n>=i.length&&(i=void 0),{value:i&&i[n++],done:!i}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function so(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,t=i[Symbol.asyncIterator];return t?t.call(i):(i=v9(i),e={},n("next"),n("throw"),n("return"),e[Symbol.asyncIterator]=function(){return this},e);function n(r){e[r]=i[r]&&function(s){return new Promise(function(a,o){(function(c,u,d,h){Promise.resolve(h).then(function(b){c({value:b,done:d})},u)})(a,o,(s=i[r](s)).done,s.value)})}}}typeof SuppressedError=="function"&&SuppressedError;var Vk,hd={exports:{}},Ys=function(){if(Vk)return hd.exports;Vk=1;var i,e=(typeof Reflect>"u"?"undefined":et(Reflect))==="object"?Reflect:null,t=e&&typeof e.apply=="function"?e.apply:function(p,f,m){return Function.prototype.apply.call(p,f,m)};i=e&&typeof e.ownKeys=="function"?e.ownKeys:Object.getOwnPropertySymbols?function(p){return Object.getOwnPropertyNames(p).concat(Object.getOwnPropertySymbols(p))}:function(p){return Object.getOwnPropertyNames(p)};var n=Number.isNaN||function(p){return p!=p};function r(){r.init.call(this)}hd.exports=r,hd.exports.once=function(p,f){return new Promise(function(m,_){function k(E){p.removeListener(f,D),_(E)}function D(){typeof p.removeListener=="function"&&p.removeListener("error",k),m([].slice.call(arguments))}y(p,f,D,{once:!0}),f!=="error"&&function(E,A,w){typeof E.on=="function"&&y(E,"error",A,w)}(p,k,{once:!0})})},r.EventEmitter=r,r.prototype._events=void 0,r.prototype._eventsCount=0,r.prototype._maxListeners=void 0;var s=10;function a(p){if(typeof p!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+et(p))}function o(p){return p._maxListeners===void 0?r.defaultMaxListeners:p._maxListeners}function c(p,f,m,_){var k,D,E;if(a(m),(D=p._events)===void 0?(D=p._events=Object.create(null),p._eventsCount=0):(D.newListener!==void 0&&(p.emit("newListener",f,m.listener?m.listener:m),D=p._events),E=D[f]),E===void 0)E=D[f]=m,++p._eventsCount;else if(typeof E=="function"?E=D[f]=_?[m,E]:[E,m]:_?E.unshift(m):E.push(m),(k=o(p))>0&&E.length>k&&!E.warned){E.warned=!0;var A=new Error("Possible EventEmitter memory leak detected. "+E.length+" "+String(f)+" listeners added. Use emitter.setMaxListeners() to increase limit");A.name="MaxListenersExceededWarning",A.emitter=p,A.type=f,A.count=E.length}return p}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(p,f,m){var _={fired:!1,wrapFn:void 0,target:p,type:f,listener:m},k=u.bind(_);return k.listener=m,_.wrapFn=k,k}function h(p,f,m){var _=p._events;if(_===void 0)return[];var k=_[f];return k===void 0?[]:typeof k=="function"?m?[k.listener||k]:[k]:m?function(D){for(var E=new Array(D.length),A=0;A<E.length;++A)E[A]=D[A].listener||D[A];return E}(k):v(k,k.length)}function b(p){var f=this._events;if(f!==void 0){var m=f[p];if(typeof m=="function")return 1;if(m!==void 0)return m.length}return 0}function v(p,f){for(var m=new Array(f),_=0;f>_;++_)m[_]=p[_];return m}function y(p,f,m,_){if(typeof p.on=="function")_.once?p.once(f,m):p.on(f,m);else{if(typeof p.addEventListener!="function")throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+et(p));p.addEventListener(f,function k(D){_.once&&p.removeEventListener(f,k),m(D)})}}return Object.defineProperty(r,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(p){if(typeof p!="number"||0>p||n(p))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+p+".");s=p}}),r.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},r.prototype.setMaxListeners=function(p){if(typeof p!="number"||0>p||n(p))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+p+".");return this._maxListeners=p,this},r.prototype.getMaxListeners=function(){return o(this)},r.prototype.emit=function(p){for(var f=[],m=1;arguments.length>m;m++)f.push(arguments[m]);var _=p==="error",k=this._events;if(k!==void 0)_=_&&k.error===void 0;else if(!_)return!1;if(_){var D;if(f.length>0&&(D=f[0]),D instanceof Error)throw D;var E=new Error("Unhandled error."+(D?" ("+D.message+")":""));throw E.context=D,E}var A=k[p];if(A===void 0)return!1;if(typeof A=="function")t(A,this,f);else{var w=A.length,N=v(A,w);for(m=0;w>m;++m)t(N[m],this,f)}return!0},r.prototype.addListener=function(p,f){return c(this,p,f,!1)},r.prototype.on=r.prototype.addListener,r.prototype.prependListener=function(p,f){return c(this,p,f,!0)},r.prototype.once=function(p,f){return a(f),this.on(p,d(this,p,f)),this},r.prototype.prependOnceListener=function(p,f){return a(f),this.prependListener(p,d(this,p,f)),this},r.prototype.removeListener=function(p,f){var m,_,k,D,E;if(a(f),(_=this._events)===void 0)return this;if((m=_[p])===void 0)return this;if(m===f||m.listener===f)--this._eventsCount==0?this._events=Object.create(null):(delete _[p],_.removeListener&&this.emit("removeListener",p,m.listener||f));else if(typeof m!="function"){for(k=-1,D=m.length-1;D>=0;D--)if(m[D]===f||m[D].listener===f){E=m[D].listener,k=D;break}if(0>k)return this;k===0?m.shift():function(A,w){for(;w+1<A.length;w++)A[w]=A[w+1];A.pop()}(m,k),m.length===1&&(_[p]=m[0]),_.removeListener!==void 0&&this.emit("removeListener",p,E||f)}return this},r.prototype.off=r.prototype.removeListener,r.prototype.removeAllListeners=function(p){var f,m,_;if((m=this._events)===void 0)return this;if(m.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):m[p]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete m[p]),this;if(arguments.length===0){var k,D=Object.keys(m);for(_=0;_<D.length;++_)(k=D[_])!=="removeListener"&&this.removeAllListeners(k);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(f=m[p])=="function")this.removeListener(p,f);else if(f!==void 0)for(_=f.length-1;_>=0;_--)this.removeListener(p,f[_]);return this},r.prototype.listeners=function(p){return h(this,p,!0)},r.prototype.rawListeners=function(p){return h(this,p,!1)},r.listenerCount=function(p,f){return typeof p.listenerCount=="function"?p.listenerCount(f):b.call(p,f)},r.prototype.listenerCount=b,r.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]},hd.exports}(),jk=!0;function fd(i,e,t){var n=i.match(e);return n&&n.length>=t&&parseInt(n[t],10)}function Js(i,e,t){if(i.RTCPeerConnection){var n=i.RTCPeerConnection.prototype,r=n.addEventListener;n.addEventListener=function(a,o){if(a!==e)return r.apply(this,arguments);var c=function(u){var d=t(u);d&&(o.handleEvent?o.handleEvent(d):o(d))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(o,c),r.apply(this,[a,c])};var s=n.removeEventListener;n.removeEventListener=function(a,o){if(a!==e||!this._eventMap||!this._eventMap[e])return s.apply(this,arguments);if(!this._eventMap[e].has(o))return s.apply(this,arguments);var c=this._eventMap[e].get(o);return this._eventMap[e].delete(o),this._eventMap[e].size===0&&delete this._eventMap[e],Object.keys(this._eventMap).length===0&&delete this._eventMap,s.apply(this,[a,c])},Object.defineProperty(n,"on"+e,{get:function(){return this["_on"+e]},set:function(a){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),a&&this.addEventListener(e,this["_on"+e]=a)},enumerable:!0,configurable:!0})}}function y9(i){return typeof i!="boolean"?new Error("Argument type: "+et(i)+". Please use a boolean."):(jk=i,i?"adapter.js logging disabled":"adapter.js logging enabled")}function b9(i){return typeof i!="boolean"?new Error("Argument type: "+et(i)+". Please use a boolean."):"adapter.js deprecation warnings "+(i?"disabled":"enabled")}function $k(){typeof window>"u"||et(window)}function Hk(i){return Object.prototype.toString.call(i)==="[object Object]"}function qk(i){return Hk(i)?Object.keys(i).reduce(function(e,t){var n=Hk(i[t]),r=n?qk(i[t]):i[t],s=n&&!Object.keys(r).length;return r===void 0||s?e:Object.assign(e,Qa({},t,r))},{}):i}function _m(i,e,t){e&&!t.has(e.id)&&(t.set(e.id,e),Object.keys(e).forEach(function(n){n.endsWith("Id")?_m(i,i.get(e[n]),t):n.endsWith("Ids")&&e[n].forEach(function(r){_m(i,i.get(r),t)})}))}function zk(i,e,t){var n=t?"outbound-rtp":"inbound-rtp",r=new Map;if(e===null)return r;var s=[];return i.forEach(function(a){a.type==="track"&&a.trackIdentifier===e.id&&s.push(a)}),s.forEach(function(a){i.forEach(function(o){o.type===n&&o.trackId===a.id&&_m(i,o,r)})}),r}var Gk=$k;function Wk(i,e){var t=i&&i.navigator;if(t.mediaDevices){var n=function(o){if(et(o)!=="object"||o.mandatory||o.optional)return o;var c={};return Object.keys(o).forEach(function(u){if(u!=="require"&&u!=="advanced"&&u!=="mediaSource"){var d=et(o[u])==="object"?o[u]:{ideal:o[u]};d.exact!==void 0&&typeof d.exact=="number"&&(d.min=d.max=d.exact);var h=function(v,y){return v?v+y.charAt(0).toUpperCase()+y.slice(1):y==="deviceId"?"sourceId":y};if(d.ideal!==void 0){c.optional=c.optional||[];var b={};typeof d.ideal=="number"?(b[h("min",u)]=d.ideal,c.optional.push(b),(b={})[h("max",u)]=d.ideal,c.optional.push(b)):(b[h("",u)]=d.ideal,c.optional.push(b))}d.exact!==void 0&&typeof d.exact!="number"?(c.mandatory=c.mandatory||{},c.mandatory[h("",u)]=d.exact):["min","max"].forEach(function(v){d[v]!==void 0&&(c.mandatory=c.mandatory||{},c.mandatory[h(v,u)]=d[v])})}}),o.advanced&&(c.optional=(c.optional||[]).concat(o.advanced)),c},r=function(o,c){if(e.version>=61)return c(o);if((o=JSON.parse(JSON.stringify(o)))&&et(o.audio)==="object"){var u=function(v,y,p){y in v&&!(p in v)&&(v[p]=v[y],delete v[y])};u((o=JSON.parse(JSON.stringify(o))).audio,"autoGainControl","googAutoGainControl"),u(o.audio,"noiseSuppression","googNoiseSuppression"),o.audio=n(o.audio)}if(o&&et(o.video)==="object"){var d=o.video.facingMode;d=d&&(et(d)==="object"?d:{ideal:d});var h,b=66>e.version;if(d&&(d.exact==="user"||d.exact==="environment"||d.ideal==="user"||d.ideal==="environment")&&(!t.mediaDevices.getSupportedConstraints||!t.mediaDevices.getSupportedConstraints().facingMode||b)&&(delete o.video.facingMode,d.exact==="environment"||d.ideal==="environment"?h=["back","rear"]:d.exact!=="user"&&d.ideal!=="user"||(h=["front"]),h))return t.mediaDevices.enumerateDevices().then(function(v){var y=(v=v.filter(function(p){return p.kind==="videoinput"})).find(function(p){return h.some(function(f){return p.label.toLowerCase().includes(f)})});return!y&&v.length&&h.includes("back")&&(y=v[v.length-1]),y&&(o.video.deviceId=d.exact?{exact:y.deviceId}:{ideal:y.deviceId}),o.video=n(o.video),Gk("chrome: "+JSON.stringify(o)),c(o)});o.video=n(o.video)}return Gk("chrome: "+JSON.stringify(o)),c(o)},s=function(o){return 64>e.version?{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[o.name]||o.name,message:o.message,constraint:o.constraint||o.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}:o};if(t.getUserMedia=(function(o,c,u){r(o,function(d){t.webkitGetUserMedia(d,c,function(h){u&&u(s(h))})})}).bind(t),t.mediaDevices.getUserMedia){var a=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(o){return r(o,function(c){return a(c).then(function(u){if(c.audio&&!u.getAudioTracks().length||c.video&&!u.getVideoTracks().length)throw u.getTracks().forEach(function(d){d.stop()}),new DOMException("","NotFoundError");return u},function(u){return Promise.reject(s(u))})})}}}}function Kk(i){i.MediaStream=i.MediaStream||i.webkitMediaStream}function Xk(i){if(et(i)==="object"&&i.RTCPeerConnection&&!("ontrack"in i.RTCPeerConnection.prototype)){Object.defineProperty(i.RTCPeerConnection.prototype,"ontrack",{get:function(){return this._ontrack},set:function(t){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=t)},enumerable:!0,configurable:!0});var e=i.RTCPeerConnection.prototype.setRemoteDescription;i.RTCPeerConnection.prototype.setRemoteDescription=function(){var t=this;return this._ontrackpoly||(this._ontrackpoly=function(n){n.stream.addEventListener("addtrack",function(r){var s;s=i.RTCPeerConnection.prototype.getReceivers?t.getReceivers().find(function(o){return o.track&&o.track.id===r.track.id}):{track:r.track};var a=new Event("track");a.track=r.track,a.receiver=s,a.transceiver={receiver:s},a.streams=[n.stream],t.dispatchEvent(a)}),n.stream.getTracks().forEach(function(r){var s;s=i.RTCPeerConnection.prototype.getReceivers?t.getReceivers().find(function(o){return o.track&&o.track.id===r.id}):{track:r};var a=new Event("track");a.track=r,a.receiver=s,a.transceiver={receiver:s},a.streams=[n.stream],t.dispatchEvent(a)})},this.addEventListener("addstream",this._ontrackpoly)),e.apply(this,arguments)}}else Js(i,"track",function(t){return t.transceiver||Object.defineProperty(t,"transceiver",{value:{receiver:t.receiver}}),t})}function Yk(i){if(et(i)==="object"&&i.RTCPeerConnection&&!("getSenders"in i.RTCPeerConnection.prototype)&&"createDTMFSender"in i.RTCPeerConnection.prototype){var e=function(o,c){return{track:c,get dtmf(){return this._dtmf===void 0&&(c.kind==="audio"?this._dtmf=o.createDTMFSender(c):this._dtmf=null),this._dtmf},_pc:o}};if(!i.RTCPeerConnection.prototype.getSenders){i.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};var t=i.RTCPeerConnection.prototype.addTrack;i.RTCPeerConnection.prototype.addTrack=function(o,c){var u=t.apply(this,arguments);return u||(u=e(this,o),this._senders.push(u)),u};var n=i.RTCPeerConnection.prototype.removeTrack;i.RTCPeerConnection.prototype.removeTrack=function(o){n.apply(this,arguments);var c=this._senders.indexOf(o);c!==-1&&this._senders.splice(c,1)}}var r=i.RTCPeerConnection.prototype.addStream;i.RTCPeerConnection.prototype.addStream=function(o){var c=this;this._senders=this._senders||[],r.apply(this,[o]),o.getTracks().forEach(function(u){c._senders.push(e(c,u))})};var s=i.RTCPeerConnection.prototype.removeStream;i.RTCPeerConnection.prototype.removeStream=function(o){var c=this;this._senders=this._senders||[],s.apply(this,[o]),o.getTracks().forEach(function(u){var d=c._senders.find(function(h){return h.track===u});d&&c._senders.splice(c._senders.indexOf(d),1)})}}else if(et(i)==="object"&&i.RTCPeerConnection&&"getSenders"in i.RTCPeerConnection.prototype&&"createDTMFSender"in i.RTCPeerConnection.prototype&&i.RTCRtpSender&&!("dtmf"in i.RTCRtpSender.prototype)){var a=i.RTCPeerConnection.prototype.getSenders;i.RTCPeerConnection.prototype.getSenders=function(){var o=this,c=a.apply(this,[]);return c.forEach(function(u){return u._pc=o}),c},Object.defineProperty(i.RTCRtpSender.prototype,"dtmf",{get:function(){return this._dtmf===void 0&&(this.track.kind==="audio"?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function Jk(i){if(et(i)==="object"&&i.RTCPeerConnection&&i.RTCRtpSender&&i.RTCRtpReceiver){if(!("getStats"in i.RTCRtpSender.prototype)){var e=i.RTCPeerConnection.prototype.getSenders;e&&(i.RTCPeerConnection.prototype.getSenders=function(){var s=this,a=e.apply(this,[]);return a.forEach(function(o){return o._pc=s}),a});var t=i.RTCPeerConnection.prototype.addTrack;t&&(i.RTCPeerConnection.prototype.addTrack=function(){var s=t.apply(this,arguments);return s._pc=this,s}),i.RTCRtpSender.prototype.getStats=function(){var s=this;return this._pc.getStats().then(function(a){return zk(a,s.track,!0)})}}if(!("getStats"in i.RTCRtpReceiver.prototype)){var n=i.RTCPeerConnection.prototype.getReceivers;n&&(i.RTCPeerConnection.prototype.getReceivers=function(){var s=this,a=n.apply(this,[]);return a.forEach(function(o){return o._pc=s}),a}),Js(i,"track",function(s){return s.receiver._pc=s.srcElement,s}),i.RTCRtpReceiver.prototype.getStats=function(){var s=this;return this._pc.getStats().then(function(a){return zk(a,s.track,!1)})}}if("getStats"in i.RTCRtpSender.prototype&&"getStats"in i.RTCRtpReceiver.prototype){var r=i.RTCPeerConnection.prototype.getStats;i.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof i.MediaStreamTrack){var s,a,o,c=arguments[0];return this.getSenders().forEach(function(u){u.track===c&&(s?o=!0:s=u)}),this.getReceivers().forEach(function(u){return u.track===c&&(a?o=!0:a=u),u.track===c}),o||s&&a?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):s?s.getStats():a?a.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return r.apply(this,arguments)}}}}function Qk(i){i.RTCPeerConnection.prototype.getLocalStreams=function(){var s=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(function(a){return s._shimmedLocalStreams[a][0]})};var e=i.RTCPeerConnection.prototype.addTrack;i.RTCPeerConnection.prototype.addTrack=function(s,a){if(!a)return e.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};var o=e.apply(this,arguments);return this._shimmedLocalStreams[a.id]?this._shimmedLocalStreams[a.id].indexOf(o)===-1&&this._shimmedLocalStreams[a.id].push(o):this._shimmedLocalStreams[a.id]=[a,o],o};var t=i.RTCPeerConnection.prototype.addStream;i.RTCPeerConnection.prototype.addStream=function(s){var a=this;this._shimmedLocalStreams=this._shimmedLocalStreams||{},s.getTracks().forEach(function(u){if(a.getSenders().find(function(d){return d.track===u}))throw new DOMException("Track already exists.","InvalidAccessError")});var o=this.getSenders();t.apply(this,arguments);var c=this.getSenders().filter(function(u){return o.indexOf(u)===-1});this._shimmedLocalStreams[s.id]=[s].concat(c)};var n=i.RTCPeerConnection.prototype.removeStream;i.RTCPeerConnection.prototype.removeStream=function(s){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[s.id],n.apply(this,arguments)};var r=i.RTCPeerConnection.prototype.removeTrack;i.RTCPeerConnection.prototype.removeTrack=function(s){var a=this;return this._shimmedLocalStreams=this._shimmedLocalStreams||{},s&&Object.keys(this._shimmedLocalStreams).forEach(function(o){var c=a._shimmedLocalStreams[o].indexOf(s);c!==-1&&a._shimmedLocalStreams[o].splice(c,1),a._shimmedLocalStreams[o].length===1&&delete a._shimmedLocalStreams[o]}),r.apply(this,arguments)}}function Zk(i,e){if(i.RTCPeerConnection){if(i.RTCPeerConnection.prototype.addTrack&&e.version>=65)return Qk(i);var t=i.RTCPeerConnection.prototype.getLocalStreams;i.RTCPeerConnection.prototype.getLocalStreams=function(){var c=this,u=t.apply(this);return this._reverseStreams=this._reverseStreams||{},u.map(function(d){return c._reverseStreams[d.id]})};var n=i.RTCPeerConnection.prototype.addStream;i.RTCPeerConnection.prototype.addStream=function(c){var u=this;if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},c.getTracks().forEach(function(h){if(u.getSenders().find(function(b){return b.track===h}))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[c.id]){var d=new i.MediaStream(c.getTracks());this._streams[c.id]=d,this._reverseStreams[d.id]=c,c=d}n.apply(this,[c])};var r=i.RTCPeerConnection.prototype.removeStream;i.RTCPeerConnection.prototype.removeStream=function(c){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},r.apply(this,[this._streams[c.id]||c]),delete this._reverseStreams[this._streams[c.id]?this._streams[c.id].id:c.id],delete this._streams[c.id]},i.RTCPeerConnection.prototype.addTrack=function(c,u){var d=this;if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");var h=[].slice.call(arguments,1);if(h.length!==1||!h[0].getTracks().find(function(y){return y===c}))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");if(this.getSenders().find(function(y){return y.track===c}))throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};var b=this._streams[u.id];if(b)b.addTrack(c),Promise.resolve().then(function(){d.dispatchEvent(new Event("negotiationneeded"))});else{var v=new i.MediaStream([c]);this._streams[u.id]=v,this._reverseStreams[v.id]=u,this.addStream(v)}return this.getSenders().find(function(y){return y.track===c})},["createOffer","createAnswer"].forEach(function(c){var u=i.RTCPeerConnection.prototype[c],d=Qa({},c,function(){var h=this,b=arguments;return arguments.length&&typeof arguments[0]=="function"?u.apply(this,[function(v){var y=o(h,v);b[0].apply(null,[y])},function(v){b[1]&&b[1].apply(null,v)},arguments[2]]):u.apply(this,arguments).then(function(v){return o(h,v)})});i.RTCPeerConnection.prototype[c]=d[c]});var s=i.RTCPeerConnection.prototype.setLocalDescription;i.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=function(c,u){var d=u.sdp;return Object.keys(c._reverseStreams||[]).forEach(function(h){var b=c._reverseStreams[h],v=c._streams[b.id];d=d.replace(new RegExp(b.id,"g"),v.id)}),new RTCSessionDescription({type:u.type,sdp:d})}(this,arguments[0]),s.apply(this,arguments)):s.apply(this,arguments)};var a=Object.getOwnPropertyDescriptor(i.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(i.RTCPeerConnection.prototype,"localDescription",{get:function(){var c=a.get.apply(this);return c.type===""?c:o(this,c)}}),i.RTCPeerConnection.prototype.removeTrack=function(c){var u,d=this;if(this.signalingState==="closed")throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!c._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(c._pc!==this)throw new DOMException("Sender was not created by this connection.","InvalidAccessError");this._streams=this._streams||{},Object.keys(this._streams).forEach(function(h){d._streams[h].getTracks().find(function(b){return c.track===b})&&(u=d._streams[h])}),u&&(u.getTracks().length===1?this.removeStream(this._reverseStreams[u.id]):u.removeTrack(c.track),this.dispatchEvent(new Event("negotiationneeded")))}}function o(c,u){var d=u.sdp;return Object.keys(c._reverseStreams||[]).forEach(function(h){var b=c._reverseStreams[h],v=c._streams[b.id];d=d.replace(new RegExp(v.id,"g"),b.id)}),new RTCSessionDescription({type:u.type,sdp:d})}}function km(i,e){!i.RTCPeerConnection&&i.webkitRTCPeerConnection&&(i.RTCPeerConnection=i.webkitRTCPeerConnection),i.RTCPeerConnection&&53>e.version&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(t){var n=i.RTCPeerConnection.prototype[t],r=Qa({},t,function(){return arguments[0]=new(t==="addIceCandidate"?i.RTCIceCandidate:i.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)});i.RTCPeerConnection.prototype[t]=r[t]})}function eT(i,e){Js(i,"negotiationneeded",function(t){var n=t.target;if(!(72>e.version||n.getConfiguration&&n.getConfiguration().sdpSemantics==="plan-b")||n.signalingState==="stable")return t})}var tT=Object.freeze({__proto__:null,fixNegotiationNeeded:eT,shimAddTrackRemoveTrack:Zk,shimAddTrackRemoveTrackWithNative:Qk,shimGetSendersWithDtmf:Yk,shimGetUserMedia:Wk,shimMediaStream:Kk,shimOnTrack:Xk,shimPeerConnection:km,shimSenderReceiverGetStats:Jk});function nT(i,e){var t=i&&i.navigator,n=i&&i.MediaStreamTrack;if(t.getUserMedia=function(c,u,d){t.mediaDevices.getUserMedia(c).then(u,d)},55>=e.version||!("autoGainControl"in t.mediaDevices.getSupportedConstraints())){var r=function(c,u,d){u in c&&!(d in c)&&(c[d]=c[u],delete c[u])},s=t.mediaDevices.getUserMedia.bind(t.mediaDevices);if(t.mediaDevices.getUserMedia=function(c){return et(c)==="object"&&et(c.audio)==="object"&&(c=JSON.parse(JSON.stringify(c)),r(c.audio,"autoGainControl","mozAutoGainControl"),r(c.audio,"noiseSuppression","mozNoiseSuppression")),s(c)},n&&n.prototype.getSettings){var a=n.prototype.getSettings;n.prototype.getSettings=function(){var c=a.apply(this,arguments);return r(c,"mozAutoGainControl","autoGainControl"),r(c,"mozNoiseSuppression","noiseSuppression"),c}}if(n&&n.prototype.applyConstraints){var o=n.prototype.applyConstraints;n.prototype.applyConstraints=function(c){return this.kind==="audio"&&et(c)==="object"&&(c=JSON.parse(JSON.stringify(c)),r(c,"autoGainControl","mozAutoGainControl"),r(c,"noiseSuppression","mozNoiseSuppression")),o.apply(this,[c])}}}}function iT(i){et(i)==="object"&&i.RTCTrackEvent&&"receiver"in i.RTCTrackEvent.prototype&&!("transceiver"in i.RTCTrackEvent.prototype)&&Object.defineProperty(i.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})}function Tm(i,e){if(et(i)==="object"&&(i.RTCPeerConnection||i.mozRTCPeerConnection)){!i.RTCPeerConnection&&i.mozRTCPeerConnection&&(i.RTCPeerConnection=i.mozRTCPeerConnection),53>e.version&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(r){var s=i.RTCPeerConnection.prototype[r],a=Qa({},r,function(){return arguments[0]=new(r==="addIceCandidate"?i.RTCIceCandidate:i.RTCSessionDescription)(arguments[0]),s.apply(this,arguments)});i.RTCPeerConnection.prototype[r]=a[r]});var t={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},n=i.RTCPeerConnection.prototype.getStats;i.RTCPeerConnection.prototype.getStats=function(){var r=Array.prototype.slice.call(arguments),s=r[0],a=r[1],o=r[2];return n.apply(this,[s||null]).then(function(c){if(53>e.version&&!a)try{c.forEach(function(u){u.type=t[u.type]||u.type})}catch(u){if(u.name!=="TypeError")throw u;c.forEach(function(d,h){c.set(h,Object.assign({},d,{type:t[d.type]||d.type}))})}return c}).then(a,o)}}}function rT(i){if(et(i)==="object"&&i.RTCPeerConnection&&i.RTCRtpSender&&(!i.RTCRtpSender||!("getStats"in i.RTCRtpSender.prototype))){var e=i.RTCPeerConnection.prototype.getSenders;e&&(i.RTCPeerConnection.prototype.getSenders=function(){var n=this,r=e.apply(this,[]);return r.forEach(function(s){return s._pc=n}),r});var t=i.RTCPeerConnection.prototype.addTrack;t&&(i.RTCPeerConnection.prototype.addTrack=function(){var n=t.apply(this,arguments);return n._pc=this,n}),i.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}}function sT(i){if(et(i)==="object"&&i.RTCPeerConnection&&i.RTCRtpSender&&(!i.RTCRtpSender||!("getStats"in i.RTCRtpReceiver.prototype))){var e=i.RTCPeerConnection.prototype.getReceivers;e&&(i.RTCPeerConnection.prototype.getReceivers=function(){var t=this,n=e.apply(this,[]);return n.forEach(function(r){return r._pc=t}),n}),Js(i,"track",function(t){return t.receiver._pc=t.srcElement,t}),i.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}}function aT(i){i.RTCPeerConnection&&!("removeStream"in i.RTCPeerConnection.prototype)&&(i.RTCPeerConnection.prototype.removeStream=function(e){var t=this;this.getSenders().forEach(function(n){n.track&&e.getTracks().includes(n.track)&&t.removeTrack(n)})})}function oT(i){i.DataChannel&&!i.RTCDataChannel&&(i.RTCDataChannel=i.DataChannel)}function lT(i){if(et(i)==="object"&&i.RTCPeerConnection){var e=i.RTCPeerConnection.prototype.addTransceiver;e&&(i.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];var t=arguments[1]&&arguments[1].sendEncodings;t===void 0&&(t=[]);var n=(t=Ii(t)).length>0;n&&t.forEach(function(o){if("rid"in o&&!/^[a-z0-9]{0,16}$/i.test(o.rid))throw new TypeError("Invalid RID value provided.");if("scaleResolutionDownBy"in o&&parseFloat(o.scaleResolutionDownBy)<1)throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in o&&parseFloat(o.maxFramerate)<0)throw new RangeError("max_framerate must be >= 0.0")});var r=e.apply(this,arguments);if(n){var s=r.sender,a=s.getParameters();(!("encodings"in a)||a.encodings.length===1&&Object.keys(a.encodings[0]).length===0)&&(a.encodings=t,s.sendEncodings=t,this.setParametersPromises.push(s.setParameters(a).then(function(){delete s.sendEncodings}).catch(function(){delete s.sendEncodings})))}return r})}}function cT(i){if(et(i)==="object"&&i.RTCRtpSender){var e=i.RTCRtpSender.prototype.getParameters;e&&(i.RTCRtpSender.prototype.getParameters=function(){var t=e.apply(this,arguments);return"encodings"in t||(t.encodings=[].concat(this.sendEncodings||[{}])),t})}}function uT(i){if(et(i)==="object"&&i.RTCPeerConnection){var e=i.RTCPeerConnection.prototype.createOffer;i.RTCPeerConnection.prototype.createOffer=function(){var t=arguments,n=this;return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(function(){return e.apply(n,t)}).finally(function(){n.setParametersPromises=[]}):e.apply(this,arguments)}}}function dT(i){if(et(i)==="object"&&i.RTCPeerConnection){var e=i.RTCPeerConnection.prototype.createAnswer;i.RTCPeerConnection.prototype.createAnswer=function(){var t=arguments,n=this;return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(function(){return e.apply(n,t)}).finally(function(){n.setParametersPromises=[]}):e.apply(this,arguments)}}}var hT=Object.freeze({__proto__:null,shimAddTransceiver:lT,shimCreateAnswer:dT,shimCreateOffer:uT,shimGetDisplayMedia:function(i,e){i.navigator.mediaDevices&&"getDisplayMedia"in i.navigator.mediaDevices||i.navigator.mediaDevices&&(i.navigator.mediaDevices.getDisplayMedia=function(t){if(!t||!t.video){var n=new DOMException("getDisplayMedia without video constraints is undefined");return n.name="NotFoundError",n.code=8,Promise.reject(n)}return t.video===!0?t.video={mediaSource:e}:t.video.mediaSource=e,i.navigator.mediaDevices.getUserMedia(t)})},shimGetParameters:cT,shimGetUserMedia:nT,shimOnTrack:iT,shimPeerConnection:Tm,shimRTCDataChannel:oT,shimReceiverGetStats:sT,shimRemoveStream:aT,shimSenderGetStats:rT});function fT(i){if(et(i)==="object"&&i.RTCPeerConnection){if("getLocalStreams"in i.RTCPeerConnection.prototype||(i.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in i.RTCPeerConnection.prototype)){var e=i.RTCPeerConnection.prototype.addTrack;i.RTCPeerConnection.prototype.addStream=function(t){var n=this;this._localStreams||(this._localStreams=[]),this._localStreams.includes(t)||this._localStreams.push(t),t.getAudioTracks().forEach(function(r){return e.call(n,r,t)}),t.getVideoTracks().forEach(function(r){return e.call(n,r,t)})},i.RTCPeerConnection.prototype.addTrack=function(t){for(var n=this,r=arguments.length,s=new Array(r>1?r-1:0),a=1;r>a;a++)s[a-1]=arguments[a];return s&&s.forEach(function(o){n._localStreams?n._localStreams.includes(o)||n._localStreams.push(o):n._localStreams=[o]}),e.apply(this,arguments)}}"removeStream"in i.RTCPeerConnection.prototype||(i.RTCPeerConnection.prototype.removeStream=function(t){var n=this;this._localStreams||(this._localStreams=[]);var r=this._localStreams.indexOf(t);if(r!==-1){this._localStreams.splice(r,1);var s=t.getTracks();this.getSenders().forEach(function(a){s.includes(a.track)&&n.removeTrack(a)})}})}}function pT(i){if(et(i)==="object"&&i.RTCPeerConnection&&("getRemoteStreams"in i.RTCPeerConnection.prototype||(i.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in i.RTCPeerConnection.prototype))){Object.defineProperty(i.RTCPeerConnection.prototype,"onaddstream",{get:function(){return this._onaddstream},set:function(t){var n=this;this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=t),this.addEventListener("track",this._onaddstreampoly=function(r){r.streams.forEach(function(s){if(n._remoteStreams||(n._remoteStreams=[]),!n._remoteStreams.includes(s)){n._remoteStreams.push(s);var a=new Event("addstream");a.stream=s,n.dispatchEvent(a)}})})}});var e=i.RTCPeerConnection.prototype.setRemoteDescription;i.RTCPeerConnection.prototype.setRemoteDescription=function(){var t=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(n){n.streams.forEach(function(r){if(t._remoteStreams||(t._remoteStreams=[]),0>t._remoteStreams.indexOf(r)){t._remoteStreams.push(r);var s=new Event("addstream");s.stream=r,t.dispatchEvent(s)}})}),e.apply(t,arguments)}}}function mT(i){if(et(i)==="object"&&i.RTCPeerConnection){var e=i.RTCPeerConnection.prototype,t=e.createOffer,n=e.createAnswer,r=e.setLocalDescription,s=e.setRemoteDescription,a=e.addIceCandidate;e.createOffer=function(c,u){var d=2>arguments.length?arguments[0]:arguments[2],h=t.apply(this,[d]);return u?(h.then(c,u),Promise.resolve()):h},e.createAnswer=function(c,u){var d=2>arguments.length?arguments[0]:arguments[2],h=n.apply(this,[d]);return u?(h.then(c,u),Promise.resolve()):h};var o=function(c,u,d){var h=r.apply(this,[c]);return d?(h.then(u,d),Promise.resolve()):h};e.setLocalDescription=o,o=function(c,u,d){var h=s.apply(this,[c]);return d?(h.then(u,d),Promise.resolve()):h},e.setRemoteDescription=o,o=function(c,u,d){var h=a.apply(this,[c]);return d?(h.then(u,d),Promise.resolve()):h},e.addIceCandidate=o}}function gT(i){var e=i&&i.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){var t=e.mediaDevices,n=t.getUserMedia.bind(t);e.mediaDevices.getUserMedia=function(r){return n(vT(r))}}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=(function(r,s,a){e.mediaDevices.getUserMedia(r).then(s,a)}).bind(e))}function vT(i){return i&&i.video!==void 0?Object.assign({},i,{video:qk(i.video)}):i}function yT(i){if(i.RTCPeerConnection){var e=i.RTCPeerConnection;i.RTCPeerConnection=function(t,n){if(t&&t.iceServers){for(var r=[],s=0;s<t.iceServers.length;s++){var a=t.iceServers[s];a.urls===void 0&&a.url?((a=JSON.parse(JSON.stringify(a))).urls=a.url,delete a.url,r.push(a)):r.push(t.iceServers[s])}t.iceServers=r}return new e(t,n)},i.RTCPeerConnection.prototype=e.prototype,"generateCertificate"in e&&Object.defineProperty(i.RTCPeerConnection,"generateCertificate",{get:function(){return e.generateCertificate}})}}function bT(i){et(i)==="object"&&i.RTCTrackEvent&&"receiver"in i.RTCTrackEvent.prototype&&!("transceiver"in i.RTCTrackEvent.prototype)&&Object.defineProperty(i.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})}function _T(i){var e=i.RTCPeerConnection.prototype.createOffer;i.RTCPeerConnection.prototype.createOffer=function(t){if(t){t.offerToReceiveAudio!==void 0&&(t.offerToReceiveAudio=!!t.offerToReceiveAudio);var n=this.getTransceivers().find(function(s){return s.receiver.track.kind==="audio"});t.offerToReceiveAudio===!1&&n?n.direction==="sendrecv"?n.setDirection?n.setDirection("sendonly"):n.direction="sendonly":n.direction==="recvonly"&&(n.setDirection?n.setDirection("inactive"):n.direction="inactive"):t.offerToReceiveAudio!==!0||n||this.addTransceiver("audio",{direction:"recvonly"}),t.offerToReceiveVideo!==void 0&&(t.offerToReceiveVideo=!!t.offerToReceiveVideo);var r=this.getTransceivers().find(function(s){return s.receiver.track.kind==="video"});t.offerToReceiveVideo===!1&&r?r.direction==="sendrecv"?r.setDirection?r.setDirection("sendonly"):r.direction="sendonly":r.direction==="recvonly"&&(r.setDirection?r.setDirection("inactive"):r.direction="inactive"):t.offerToReceiveVideo!==!0||r||this.addTransceiver("video",{direction:"recvonly"})}return e.apply(this,arguments)}}function kT(i){et(i)!=="object"||i.AudioContext||(i.AudioContext=i.webkitAudioContext)}var TT,ST=Object.freeze({__proto__:null,shimAudioContext:kT,shimCallbacksAPI:mT,shimConstraints:vT,shimCreateOfferLegacy:_T,shimGetUserMedia:gT,shimLocalStreamsAPI:fT,shimRTCIceServerUrls:yT,shimRemoteStreamsAPI:pT,shimTrackEventTransceiver:bT}),CT={exports:{}},xT=(TT||(TT=1,function(i){var e={generateIdentifier:function(){return Math.random().toString(36).substring(2,12)}};e.localCName=e.generateIdentifier(),e.splitLines=function(t){return t.trim().split(`
|
289
|
+
`).map(function(n){return n.trim()})},e.splitSections=function(t){return t.split(`
|
290
|
+
m=`).map(function(n,r){return(r>0?"m="+n:n).trim()+`\r
|
291
|
+
`})},e.getDescription=function(t){var n=e.splitSections(t);return n&&n[0]},e.getMediaSections=function(t){var n=e.splitSections(t);return n.shift(),n},e.matchPrefix=function(t,n){return e.splitLines(t).filter(function(r){return r.indexOf(n)===0})},e.parseCandidate=function(t){for(var n,r={foundation:(n=t.indexOf("a=candidate:")===0?t.substring(12).split(" "):t.substring(10).split(" "))[0],component:{1:"rtp",2:"rtcp"}[n[1]]||n[1],protocol:n[2].toLowerCase(),priority:parseInt(n[3],10),ip:n[4],address:n[4],port:parseInt(n[5],10),type:n[7]},s=8;s<n.length;s+=2)switch(n[s]){case"raddr":r.relatedAddress=n[s+1];break;case"rport":r.relatedPort=parseInt(n[s+1],10);break;case"tcptype":r.tcpType=n[s+1];break;case"ufrag":r.ufrag=n[s+1],r.usernameFragment=n[s+1];break;default:r[n[s]]===void 0&&(r[n[s]]=n[s+1]);break}return r},e.writeCandidate=function(t){var n=[];n.push(t.foundation);var r=t.component;r==="rtp"?n.push(1):r==="rtcp"?n.push(2):n.push(r),n.push(t.protocol.toUpperCase()),n.push(t.priority),n.push(t.address||t.ip),n.push(t.port);var s=t.type;return n.push("typ"),n.push(s),s!=="host"&&t.relatedAddress&&t.relatedPort&&(n.push("raddr"),n.push(t.relatedAddress),n.push("rport"),n.push(t.relatedPort)),t.tcpType&&t.protocol.toLowerCase()==="tcp"&&(n.push("tcptype"),n.push(t.tcpType)),(t.usernameFragment||t.ufrag)&&(n.push("ufrag"),n.push(t.usernameFragment||t.ufrag)),"candidate:"+n.join(" ")},e.parseIceOptions=function(t){return t.substring(14).split(" ")},e.parseRtpMap=function(t){var n=t.substring(9).split(" "),r={payloadType:parseInt(n.shift(),10)};return n=n[0].split("/"),r.name=n[0],r.clockRate=parseInt(n[1],10),r.channels=n.length===3?parseInt(n[2],10):1,r.numChannels=r.channels,r},e.writeRtpMap=function(t){var n=t.payloadType;t.preferredPayloadType!==void 0&&(n=t.preferredPayloadType);var r=t.channels||t.numChannels||1;return"a=rtpmap:"+n+" "+t.name+"/"+t.clockRate+(r!==1?"/"+r:"")+`\r
|
292
|
+
`},e.parseExtmap=function(t){var n=t.substring(9).split(" ");return{id:parseInt(n[0],10),direction:n[0].indexOf("/")>0?n[0].split("/")[1]:"sendrecv",uri:n[1],attributes:n.slice(2).join(" ")}},e.writeExtmap=function(t){return"a=extmap:"+(t.id||t.preferredId)+(t.direction&&t.direction!=="sendrecv"?"/"+t.direction:"")+" "+t.uri+(t.attributes?" "+t.attributes:"")+`\r
|
293
|
+
`},e.parseFmtp=function(t){for(var n,r={},s=t.substring(t.indexOf(" ")+1).split(";"),a=0;a<s.length;a++)r[(n=s[a].trim().split("="))[0].trim()]=n[1];return r},e.writeFmtp=function(t){var n="",r=t.payloadType;if(t.preferredPayloadType!==void 0&&(r=t.preferredPayloadType),t.parameters&&Object.keys(t.parameters).length){var s=[];Object.keys(t.parameters).forEach(function(a){t.parameters[a]!==void 0?s.push(a+"="+t.parameters[a]):s.push(a)}),n+="a=fmtp:"+r+" "+s.join(";")+`\r
|
294
|
+
`}return n},e.parseRtcpFb=function(t){var n=t.substring(t.indexOf(" ")+1).split(" ");return{type:n.shift(),parameter:n.join(" ")}},e.writeRtcpFb=function(t){var n="",r=t.payloadType;return t.preferredPayloadType!==void 0&&(r=t.preferredPayloadType),t.rtcpFeedback&&t.rtcpFeedback.length&&t.rtcpFeedback.forEach(function(s){n+="a=rtcp-fb:"+r+" "+s.type+(s.parameter&&s.parameter.length?" "+s.parameter:"")+`\r
|
295
|
+
`}),n},e.parseSsrcMedia=function(t){var n=t.indexOf(" "),r={ssrc:parseInt(t.substring(7,n),10)},s=t.indexOf(":",n);return s>-1?(r.attribute=t.substring(n+1,s),r.value=t.substring(s+1)):r.attribute=t.substring(n+1),r},e.parseSsrcGroup=function(t){var n=t.substring(13).split(" ");return{semantics:n.shift(),ssrcs:n.map(function(r){return parseInt(r,10)})}},e.getMid=function(t){var n=e.matchPrefix(t,"a=mid:")[0];if(n)return n.substring(6)},e.parseFingerprint=function(t){var n=t.substring(14).split(" ");return{algorithm:n[0].toLowerCase(),value:n[1].toUpperCase()}},e.getDtlsParameters=function(t,n){return{role:"auto",fingerprints:e.matchPrefix(t+n,"a=fingerprint:").map(e.parseFingerprint)}},e.writeDtlsParameters=function(t,n){var r="a=setup:"+n+`\r
|
296
|
+
`;return t.fingerprints.forEach(function(s){r+="a=fingerprint:"+s.algorithm+" "+s.value+`\r
|
297
|
+
`}),r},e.parseCryptoLine=function(t){var n=t.substring(9).split(" ");return{tag:parseInt(n[0],10),cryptoSuite:n[1],keyParams:n[2],sessionParams:n.slice(3)}},e.writeCryptoLine=function(t){return"a=crypto:"+t.tag+" "+t.cryptoSuite+" "+(et(t.keyParams)==="object"?e.writeCryptoKeyParams(t.keyParams):t.keyParams)+(t.sessionParams?" "+t.sessionParams.join(" "):"")+`\r
|
298
|
+
`},e.parseCryptoKeyParams=function(t){if(t.indexOf("inline:")!==0)return null;var n=t.substring(7).split("|");return{keyMethod:"inline",keySalt:n[0],lifeTime:n[1],mkiValue:n[2]?n[2].split(":")[0]:void 0,mkiLength:n[2]?n[2].split(":")[1]:void 0}},e.writeCryptoKeyParams=function(t){return t.keyMethod+":"+t.keySalt+(t.lifeTime?"|"+t.lifeTime:"")+(t.mkiValue&&t.mkiLength?"|"+t.mkiValue+":"+t.mkiLength:"")},e.getCryptoParameters=function(t,n){return e.matchPrefix(t+n,"a=crypto:").map(e.parseCryptoLine)},e.getIceParameters=function(t,n){var r=e.matchPrefix(t+n,"a=ice-ufrag:")[0],s=e.matchPrefix(t+n,"a=ice-pwd:")[0];return r&&s?{usernameFragment:r.substring(12),password:s.substring(10)}:null},e.writeIceParameters=function(t){var n="a=ice-ufrag:"+t.usernameFragment+`\r
|
299
|
+
a=ice-pwd:`+t.password+`\r
|
300
|
+
`;return t.iceLite&&(n+=`a=ice-lite\r
|
301
|
+
`),n},e.parseRtpParameters=function(t){var n={codecs:[],headerExtensions:[],fecMechanisms:[],rtcp:[]},r=e.splitLines(t)[0].split(" ");n.profile=r[2];for(var s=3;s<r.length;s++){var a=r[s],o=e.matchPrefix(t,"a=rtpmap:"+a+" ")[0];if(o){var c=e.parseRtpMap(o),u=e.matchPrefix(t,"a=fmtp:"+a+" ");switch(c.parameters=u.length?e.parseFmtp(u[0]):{},c.rtcpFeedback=e.matchPrefix(t,"a=rtcp-fb:"+a+" ").map(e.parseRtcpFb),n.codecs.push(c),c.name.toUpperCase()){case"RED":case"ULPFEC":n.fecMechanisms.push(c.name.toUpperCase());break}}}e.matchPrefix(t,"a=extmap:").forEach(function(h){n.headerExtensions.push(e.parseExtmap(h))});var d=e.matchPrefix(t,"a=rtcp-fb:* ").map(e.parseRtcpFb);return n.codecs.forEach(function(h){d.forEach(function(b){h.rtcpFeedback.find(function(v){return v.type===b.type&&v.parameter===b.parameter})||h.rtcpFeedback.push(b)})}),n},e.writeRtpDescription=function(t,n){var r="";r+="m="+t+" ",r+=n.codecs.length>0?"9":"0",r+=" "+(n.profile||"UDP/TLS/RTP/SAVPF")+" ",r+=n.codecs.map(function(a){return a.preferredPayloadType!==void 0?a.preferredPayloadType:a.payloadType}).join(" ")+`\r
|
302
|
+
`,r+=`c=IN IP4 0.0.0.0\r
|
303
|
+
`,r+=`a=rtcp:9 IN IP4 0.0.0.0\r
|
304
|
+
`,n.codecs.forEach(function(a){r+=e.writeRtpMap(a),r+=e.writeFmtp(a),r+=e.writeRtcpFb(a)});var s=0;return n.codecs.forEach(function(a){a.maxptime>s&&(s=a.maxptime)}),s>0&&(r+="a=maxptime:"+s+`\r
|
305
|
+
`),n.headerExtensions&&n.headerExtensions.forEach(function(a){r+=e.writeExtmap(a)}),r},e.parseRtpEncodingParameters=function(t){var n,r=[],s=e.parseRtpParameters(t),a=s.fecMechanisms.indexOf("RED")!==-1,o=s.fecMechanisms.indexOf("ULPFEC")!==-1,c=e.matchPrefix(t,"a=ssrc:").map(function(b){return e.parseSsrcMedia(b)}).filter(function(b){return b.attribute==="cname"}),u=c.length>0&&c[0].ssrc,d=e.matchPrefix(t,"a=ssrc-group:FID").map(function(b){return b.substring(17).split(" ").map(function(v){return parseInt(v,10)})});d.length>0&&d[0].length>1&&d[0][0]===u&&(n=d[0][1]),s.codecs.forEach(function(b){if(b.name.toUpperCase()==="RTX"&&b.parameters.apt){var v={ssrc:u,codecPayloadType:parseInt(b.parameters.apt,10)};u&&n&&(v.rtx={ssrc:n}),r.push(v),a&&((v=JSON.parse(JSON.stringify(v))).fec={ssrc:u,mechanism:o?"red+ulpfec":"red"},r.push(v))}}),r.length===0&&u&&r.push({ssrc:u});var h=e.matchPrefix(t,"b=");return h.length&&(h=h[0].indexOf("b=TIAS:")===0?parseInt(h[0].substring(7),10):h[0].indexOf("b=AS:")===0?1e3*parseInt(h[0].substring(5),10)*.95-16e3:void 0,r.forEach(function(b){b.maxBitrate=h})),r},e.parseRtcpParameters=function(t){var n={},r=e.matchPrefix(t,"a=ssrc:").map(function(o){return e.parseSsrcMedia(o)}).filter(function(o){return o.attribute==="cname"})[0];r&&(n.cname=r.value,n.ssrc=r.ssrc);var s=e.matchPrefix(t,"a=rtcp-rsize");n.reducedSize=s.length>0,n.compound=s.length===0;var a=e.matchPrefix(t,"a=rtcp-mux");return n.mux=a.length>0,n},e.writeRtcpParameters=function(t){var n="";return t.reducedSize&&(n+=`a=rtcp-rsize\r
|
306
|
+
`),t.mux&&(n+=`a=rtcp-mux\r
|
307
|
+
`),t.ssrc!==void 0&&t.cname&&(n+="a=ssrc:"+t.ssrc+" cname:"+t.cname+`\r
|
308
|
+
`),n},e.parseMsid=function(t){var n,r=e.matchPrefix(t,"a=msid:");if(r.length===1)return{stream:(n=r[0].substring(7).split(" "))[0],track:n[1]};var s=e.matchPrefix(t,"a=ssrc:").map(function(a){return e.parseSsrcMedia(a)}).filter(function(a){return a.attribute==="msid"});return s.length>0?{stream:(n=s[0].value.split(" "))[0],track:n[1]}:void 0},e.parseSctpDescription=function(t){var n,r=e.parseMLine(t),s=e.matchPrefix(t,"a=max-message-size:");s.length>0&&(n=parseInt(s[0].substring(19),10)),isNaN(n)&&(n=65536);var a=e.matchPrefix(t,"a=sctp-port:");if(a.length>0)return{port:parseInt(a[0].substring(12),10),protocol:r.fmt,maxMessageSize:n};var o=e.matchPrefix(t,"a=sctpmap:");if(o.length>0){var c=o[0].substring(10).split(" ");return{port:parseInt(c[0],10),protocol:c[1],maxMessageSize:n}}},e.writeSctpDescription=function(t,n){var r=[];return r=t.protocol!=="DTLS/SCTP"?["m="+t.kind+" 9 "+t.protocol+" "+n.protocol+`\r
|
309
|
+
`,`c=IN IP4 0.0.0.0\r
|
310
|
+
`,"a=sctp-port:"+n.port+`\r
|
311
|
+
`]:["m="+t.kind+" 9 "+t.protocol+" "+n.port+`\r
|
312
|
+
`,`c=IN IP4 0.0.0.0\r
|
313
|
+
`,"a=sctpmap:"+n.port+" "+n.protocol+` 65535\r
|
314
|
+
`],n.maxMessageSize!==void 0&&r.push("a=max-message-size:"+n.maxMessageSize+`\r
|
315
|
+
`),r.join("")},e.generateSessionId=function(){return Math.random().toString().substr(2,22)},e.writeSessionBoilerplate=function(t,n,r){var s=n!==void 0?n:2;return`v=0\r
|
316
|
+
o=`+(r||"thisisadapterortc")+" "+(t||e.generateSessionId())+" "+s+` IN IP4 127.0.0.1\r
|
317
|
+
s=-\r
|
318
|
+
t=0 0\r
|
319
|
+
`},e.getDirection=function(t,n){for(var r=e.splitLines(t),s=0;s<r.length;s++)switch(r[s]){case"a=sendrecv":case"a=sendonly":case"a=recvonly":case"a=inactive":return r[s].substring(2)}return n?e.getDirection(n):"sendrecv"},e.getKind=function(t){return e.splitLines(t)[0].split(" ")[0].substring(2)},e.isRejected=function(t){return t.split(" ",2)[1]==="0"},e.parseMLine=function(t){var n=e.splitLines(t)[0].substring(2).split(" ");return{kind:n[0],port:parseInt(n[1],10),protocol:n[2],fmt:n.slice(3).join(" ")}},e.parseOLine=function(t){var n=e.matchPrefix(t,"o=")[0].substring(2).split(" ");return{username:n[0],sessionId:n[1],sessionVersion:parseInt(n[2],10),netType:n[3],addressType:n[4],address:n[5]}},e.isValidSDP=function(t){if(typeof t!="string"||t.length===0)return!1;for(var n=e.splitLines(t),r=0;r<n.length;r++)if(2>n[r].length||n[r].charAt(1)!=="=")return!1;return!0},i.exports=e}(CT)),CT.exports),ao=f9(xT),_9=QO({__proto__:null,default:ao},[xT]);function pd(i){if(!(!i.RTCIceCandidate||i.RTCIceCandidate&&"foundation"in i.RTCIceCandidate.prototype)){var e=i.RTCIceCandidate;i.RTCIceCandidate=function(t){if(et(t)==="object"&&t.candidate&&t.candidate.indexOf("a=")===0&&((t=JSON.parse(JSON.stringify(t))).candidate=t.candidate.substring(2)),t.candidate&&t.candidate.length){var n=new e(t),r=ao.parseCandidate(t.candidate);for(var s in r)s in n||Object.defineProperty(n,s,{value:r[s]});return n.toJSON=function(){return{candidate:n.candidate,sdpMid:n.sdpMid,sdpMLineIndex:n.sdpMLineIndex,usernameFragment:n.usernameFragment}},n}return new e(t)},i.RTCIceCandidate.prototype=e.prototype,Js(i,"icecandidate",function(t){return t.candidate&&Object.defineProperty(t,"candidate",{value:new i.RTCIceCandidate(t.candidate),writable:"false"}),t})}}function Sm(i){!i.RTCIceCandidate||i.RTCIceCandidate&&"relayProtocol"in i.RTCIceCandidate.prototype||Js(i,"icecandidate",function(e){if(e.candidate){var t=ao.parseCandidate(e.candidate.candidate);t.type==="relay"&&(e.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[t.priority>>24])}return e})}function md(i,e){if(i.RTCPeerConnection){"sctp"in i.RTCPeerConnection.prototype||Object.defineProperty(i.RTCPeerConnection.prototype,"sctp",{get:function(){return this._sctp===void 0?null:this._sctp}});var t=i.RTCPeerConnection.prototype.setRemoteDescription;i.RTCPeerConnection.prototype.setRemoteDescription=function(){var n,r;if(this._sctp=null,e.browser!=="chrome"||e.version<76||this.getConfiguration().sdpSemantics==="plan-b"&&Object.defineProperty(this,"sctp",{get:function(){return this._sctp===void 0?null:this._sctp},enumerable:!0,configurable:!0}),function(d){if(!d||!d.sdp)return!1;var h=ao.splitSections(d.sdp);return h.shift(),h.some(function(b){var v=ao.parseMLine(b);return v&&v.kind==="application"&&v.protocol.indexOf("SCTP")!==-1})}(arguments[0])){var s,a=function(d){var h=d.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(h===null||2>h.length)return-1;var b=parseInt(h[1],10);return b!=b?-1:b}(arguments[0]),o=(n=a,r=65536,e.browser==="firefox"&&(r=57>e.version?n===-1?16384:2147483637:60>e.version?e.version===57?65535:65536:2147483637),r),c=function(d,h){var b=65536;e.browser==="firefox"&&e.version===57&&(b=65535);var v=ao.matchPrefix(d.sdp,"a=max-message-size:");return v.length>0?b=parseInt(v[0].substring(19),10):e.browser==="firefox"&&h!==-1&&(b=2147483637),b}(arguments[0],a);s=o===0&&c===0?Number.POSITIVE_INFINITY:o===0||c===0?Math.max(o,c):Math.min(o,c);var u={};Object.defineProperty(u,"maxMessageSize",{get:function(){return s}}),this._sctp=u}return t.apply(this,arguments)}}}function gd(i){if(i.RTCPeerConnection&&"createDataChannel"in i.RTCPeerConnection.prototype){var e=i.RTCPeerConnection.prototype.createDataChannel;i.RTCPeerConnection.prototype.createDataChannel=function(){var n=e.apply(this,arguments);return t(n,this),n},Js(i,"datachannel",function(n){return t(n.channel,n.target),n})}function t(n,r){var s=n.send;n.send=function(){var a=arguments[0],o=a.length||a.size||a.byteLength;if(n.readyState==="open"&&r.sctp&&o>r.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+r.sctp.maxMessageSize+" bytes)");return s.apply(n,arguments)}}}function Cm(i){if(i.RTCPeerConnection&&!("connectionState"in i.RTCPeerConnection.prototype)){var e=i.RTCPeerConnection.prototype;Object.defineProperty(e,"connectionState",{get:function(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(e,"onconnectionstatechange",{get:function(){return this._onconnectionstatechange||null},set:function(t){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),t&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=t)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(function(t){var n=e[t];e[t]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=function(r){var s=r.target;if(s._lastConnectionState!==s.connectionState){s._lastConnectionState=s.connectionState;var a=new Event("connectionstatechange",r);s.dispatchEvent(a)}return r},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}})}}function xm(i,e){if(i.RTCPeerConnection&&(e.browser!=="chrome"||71>e.version)&&(e.browser!=="safari"||605>e.version)){var t=i.RTCPeerConnection.prototype.setRemoteDescription;i.RTCPeerConnection.prototype.setRemoteDescription=function(n){if(n&&n.sdp&&n.sdp.indexOf(`
|
320
|
+
a=extmap-allow-mixed`)!==-1){var r=n.sdp.split(`
|
321
|
+
`).filter(function(s){return s.trim()!=="a=extmap-allow-mixed"}).join(`
|
322
|
+
`);i.RTCSessionDescription&&n instanceof i.RTCSessionDescription?arguments[0]=new i.RTCSessionDescription({type:n.type,sdp:r}):n.sdp=r}return t.apply(this,arguments)}}}function vd(i,e){if(i.RTCPeerConnection&&i.RTCPeerConnection.prototype){var t=i.RTCPeerConnection.prototype.addIceCandidate;t&&t.length!==0&&(i.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?(e.browser==="chrome"&&78>e.version||e.browser==="firefox"&&68>e.version||e.browser==="safari")&&arguments[0]&&arguments[0].candidate===""?Promise.resolve():t.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}}function yd(i,e){if(i.RTCPeerConnection&&i.RTCPeerConnection.prototype){var t=i.RTCPeerConnection.prototype.setLocalDescription;t&&t.length!==0&&(i.RTCPeerConnection.prototype.setLocalDescription=function(){var n=this,r=arguments[0]||{};if(et(r)!=="object"||r.type&&r.sdp)return t.apply(this,arguments);if(!(r={type:r.type,sdp:r.sdp}).type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":r.type="offer";break;default:r.type="answer";break}return r.sdp||r.type!=="offer"&&r.type!=="answer"?t.apply(this,[r]):(r.type==="offer"?this.createOffer:this.createAnswer).apply(this).then(function(s){return t.apply(n,[s])})})}}var k9=Object.freeze({__proto__:null,removeExtmapAllowMixed:xm,shimAddIceCandidateNullOrEmpty:vd,shimConnectionState:Cm,shimMaxMessageSize:md,shimParameterlessSetLocalDescription:yd,shimRTCIceCandidate:pd,shimRTCIceCandidateRelayProtocol:Sm,shimSendThrowTypeError:gd});(function(){var i=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).window,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shimChrome:!0,shimFirefox:!0,shimSafari:!0},t=$k,n=function(s){var a={browser:null,version:null};if(s===void 0||!s.navigator||!s.navigator.userAgent)return a.browser="Not a browser.",a;var o=s.navigator;if(o.userAgentData&&o.userAgentData.brands){var c=o.userAgentData.brands.find(function(u){return u.brand==="Chromium"});if(c)return{browser:"chrome",version:parseInt(c.version,10)}}if(o.mozGetUserMedia)a.browser="firefox",a.version=fd(o.userAgent,/Firefox\/(\d+)\./,1);else if(o.webkitGetUserMedia||s.isSecureContext===!1&&s.webkitRTCPeerConnection)a.browser="chrome",a.version=fd(o.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!s.RTCPeerConnection||!o.userAgent.match(/AppleWebKit\/(\d+)\./))return a.browser="Not a supported browser.",a;a.browser="safari",a.version=fd(o.userAgent,/AppleWebKit\/(\d+)\./,1),a.supportsUnifiedPlan=s.RTCRtpTransceiver&&"currentDirection"in s.RTCRtpTransceiver.prototype}return a}(i),r={browserDetails:n,commonShim:k9,extractVersion:fd,disableLog:y9,disableWarnings:b9,sdp:_9};switch(n.browser){case"chrome":if(!tT||!km||!e.shimChrome||n.version===null)return t(),r;t(),r.browserShim=tT,vd(i,n),yd(i),Wk(i,n),Kk(i),km(i,n),Xk(i),Zk(i,n),Yk(i),Jk(i),eT(i,n),pd(i),Sm(i),Cm(i),md(i,n),gd(i),xm(i,n);break;case"firefox":if(!hT||!Tm||!e.shimFirefox)return t(),r;t(),r.browserShim=hT,vd(i,n),yd(i),nT(i,n),Tm(i,n),iT(i),aT(i),rT(i),sT(i),oT(i),lT(i),cT(i),uT(i),dT(i),pd(i),Cm(i),md(i,n),gd(i);break;case"safari":if(!ST||!e.shimSafari)return t(),r;t(),r.browserShim=ST,vd(i,n),yd(i),yT(i),_T(i),mT(i),fT(i),pT(i),bT(i),gT(i),kT(i),pd(i),Sm(i),md(i,n),gd(i),xm(i,n);break;default:t();break}})({window:typeof window>"u"?void 0:window});var Ml,ET,fs,wT,bd="lk_e2ee";function T9(){return window.RTCRtpSender!==void 0&&window.RTCRtpSender.prototype.createEncodedStreams!==void 0||Em()}function Em(){return window.RTCRtpScriptTransform!==void 0}(function(i){i.SetKey="setKey",i.RatchetRequest="ratchetRequest",i.KeyRatcheted="keyRatcheted"})(Ml||(Ml={})),function(i){i.KeyRatcheted="keyRatcheted"}(ET||(ET={})),function(i){i.ParticipantEncryptionStatusChanged="participantEncryptionStatusChanged",i.EncryptionError="encryptionError"}(fs||(fs={})),function(i){i.Error="cryptorError"}(wT||(wT={}));var $n,Qs=function(i){function e(t,n){var r;return ht(this,e),(r=Rt(this,e,[n||"an error has occured"])).code=t,r}return Lt(e,Yu(Error)),ft(e)}();(function(i){i[i.NotAllowed=0]="NotAllowed",i[i.ServerUnreachable=1]="ServerUnreachable",i[i.InternalError=2]="InternalError",i[i.Cancelled=3]="Cancelled",i[i.LeaveRequest=4]="LeaveRequest"})($n||($n={}));var _d,DT,je,qe,Qe,$e,zt=function(i){function e(t,n,r){var s;return ht(this,e),(s=Rt(this,e,[1,t])).status=r,s.reason=n,s}return Lt(e,Qs),ft(e)}(),wm=function(i){function e(t){return ht(this,e),Rt(this,e,[21,t??"device is unsupported"])}return Lt(e,Qs),ft(e)}(),gr=function(i){function e(t){return ht(this,e),Rt(this,e,[20,t??"track is invalid"])}return Lt(e,Qs),ft(e)}(),S9=function(i){function e(t){return ht(this,e),Rt(this,e,[10,t??"unsupported server"])}return Lt(e,Qs),ft(e)}(),vn=function(i){function e(t){return ht(this,e),Rt(this,e,[12,t??"unexpected connection state"])}return Lt(e,Qs),ft(e)}(),Dm=function(i){function e(t){return ht(this,e),Rt(this,e,[13,t??"unable to negotiate"])}return Lt(e,Qs),ft(e)}(),AT=function(i){function e(t,n){var r;return ht(this,e),(r=Rt(this,e,[15,t])).reason=n,r}return Lt(e,Qs),ft(e)}();function Am(i,e,t){var n,r,s;e===void 0&&(e=50),t===void 0&&(t={});var a=(n=t.isImmediate)!=null&&n,o=(r=t.callback)!=null&&r,c=t.maxWait,u=Date.now(),d=[];function h(){if(c!==void 0){var v=Date.now()-u;if(v+e>=c)return c-v}return e}var b=function(){var v=[].slice.call(arguments),y=this;return new Promise(function(p,f){var m=a&&s===void 0;if(s!==void 0&&clearTimeout(s),s=setTimeout(function(){if(s=void 0,u=Date.now(),!a){var k=i.apply(y,v);o&&o(k),d.forEach(function(D){return(0,D.resolve)(k)}),d=[]}},h()),m){var _=i.apply(y,v);return o&&o(_),p(_)}d.push({resolve:p,reject:f})})};return b.cancel=function(v){s!==void 0&&clearTimeout(s),d.forEach(function(y){return(0,y.reject)(v)}),d=[]},b}(function(i){i.PermissionDenied="PermissionDenied",i.NotFound="NotFound",i.DeviceInUse="DeviceInUse",i.Other="Other"})(_d||(_d={})),function(i){i.getFailure=function(e){if(e&&"name"in e)return e.name==="NotFoundError"||e.name==="DevicesNotFoundError"?i.NotFound:e.name==="NotAllowedError"||e.name==="PermissionDeniedError"?i.PermissionDenied:e.name==="NotReadableError"||e.name==="TrackStartError"?i.DeviceInUse:i.Other}}(_d||(_d={})),function(i){i[i.InvalidKey=0]="InvalidKey",i[i.MissingKey=1]="MissingKey",i[i.InternalError=2]="InternalError"}(DT||(DT={})),function(i){i.Connected="connected",i.Reconnecting="reconnecting",i.SignalReconnecting="signalReconnecting",i.Reconnected="reconnected",i.Disconnected="disconnected",i.ConnectionStateChanged="connectionStateChanged",i.MediaDevicesChanged="mediaDevicesChanged",i.ParticipantConnected="participantConnected",i.ParticipantDisconnected="participantDisconnected",i.TrackPublished="trackPublished",i.TrackSubscribed="trackSubscribed",i.TrackSubscriptionFailed="trackSubscriptionFailed",i.TrackUnpublished="trackUnpublished",i.TrackUnsubscribed="trackUnsubscribed",i.TrackMuted="trackMuted",i.TrackUnmuted="trackUnmuted",i.LocalTrackPublished="localTrackPublished",i.LocalTrackUnpublished="localTrackUnpublished",i.LocalAudioSilenceDetected="localAudioSilenceDetected",i.ActiveSpeakersChanged="activeSpeakersChanged",i.ParticipantMetadataChanged="participantMetadataChanged",i.ParticipantNameChanged="participantNameChanged",i.ParticipantAttributesChanged="participantAttributesChanged",i.RoomMetadataChanged="roomMetadataChanged",i.DataReceived="dataReceived",i.SipDTMFReceived="sipDTMFReceived",i.TranscriptionReceived="transcriptionReceived",i.ConnectionQualityChanged="connectionQualityChanged",i.TrackStreamStateChanged="trackStreamStateChanged",i.TrackSubscriptionPermissionChanged="trackSubscriptionPermissionChanged",i.TrackSubscriptionStatusChanged="trackSubscriptionStatusChanged",i.AudioPlaybackStatusChanged="audioPlaybackChanged",i.VideoPlaybackStatusChanged="videoPlaybackChanged",i.MediaDevicesError="mediaDevicesError",i.ParticipantPermissionsChanged="participantPermissionsChanged",i.SignalConnected="signalConnected",i.RecordingStatusChanged="recordingStatusChanged",i.ParticipantEncryptionStatusChanged="participantEncryptionStatusChanged",i.EncryptionError="encryptionError",i.DCBufferStatusChanged="dcBufferStatusChanged",i.ActiveDeviceChanged="activeDeviceChanged",i.ChatMessage="chatMessage",i.LocalTrackSubscribed="localTrackSubscribed",i.MetricsReceived="metricsReceived"}(je||(je={})),function(i){i.TrackPublished="trackPublished",i.TrackSubscribed="trackSubscribed",i.TrackSubscriptionFailed="trackSubscriptionFailed",i.TrackUnpublished="trackUnpublished",i.TrackUnsubscribed="trackUnsubscribed",i.TrackMuted="trackMuted",i.TrackUnmuted="trackUnmuted",i.LocalTrackPublished="localTrackPublished",i.LocalTrackUnpublished="localTrackUnpublished",i.ParticipantMetadataChanged="participantMetadataChanged",i.ParticipantNameChanged="participantNameChanged",i.DataReceived="dataReceived",i.SipDTMFReceived="sipDTMFReceived",i.TranscriptionReceived="transcriptionReceived",i.IsSpeakingChanged="isSpeakingChanged",i.ConnectionQualityChanged="connectionQualityChanged",i.TrackStreamStateChanged="trackStreamStateChanged",i.TrackSubscriptionPermissionChanged="trackSubscriptionPermissionChanged",i.TrackSubscriptionStatusChanged="trackSubscriptionStatusChanged",i.MediaDevicesError="mediaDevicesError",i.AudioStreamAcquired="audioStreamAcquired",i.ParticipantPermissionsChanged="participantPermissionsChanged",i.PCTrackAdded="pcTrackAdded",i.AttributesChanged="attributesChanged",i.LocalTrackSubscribed="localTrackSubscribed",i.ChatMessage="chatMessage"}(qe||(qe={})),function(i){i.TransportsCreated="transportsCreated",i.Connected="connected",i.Disconnected="disconnected",i.Resuming="resuming",i.Resumed="resumed",i.Restarting="restarting",i.Restarted="restarted",i.SignalResumed="signalResumed",i.SignalRestarted="signalRestarted",i.Closing="closing",i.MediaTrackAdded="mediaTrackAdded",i.ActiveSpeakersUpdate="activeSpeakersUpdate",i.DataPacketReceived="dataPacketReceived",i.RTPVideoMapUpdate="rtpVideoMapUpdate",i.DCBufferStatusChanged="dcBufferStatusChanged",i.ParticipantUpdate="participantUpdate",i.RoomUpdate="roomUpdate",i.SpeakersChanged="speakersChanged",i.StreamStateChanged="streamStateChanged",i.ConnectionQualityUpdate="connectionQualityUpdate",i.SubscriptionError="subscriptionError",i.SubscriptionPermissionUpdate="subscriptionPermissionUpdate",i.RemoteMute="remoteMute",i.SubscribedQualityUpdate="subscribedQualityUpdate",i.LocalTrackUnpublished="localTrackUnpublished",i.LocalTrackSubscribed="localTrackSubscribed",i.Offline="offline",i.SignalRequestResponse="signalRequestResponse"}(Qe||(Qe={})),function(i){i.Message="message",i.Muted="muted",i.Unmuted="unmuted",i.Restarted="restarted",i.Ended="ended",i.Subscribed="subscribed",i.Unsubscribed="unsubscribed",i.UpdateSettings="updateSettings",i.UpdateSubscription="updateSubscription",i.AudioPlaybackStarted="audioPlaybackStarted",i.AudioPlaybackFailed="audioPlaybackFailed",i.AudioSilenceDetected="audioSilenceDetected",i.VisibilityChanged="visibilityChanged",i.VideoDimensionsChanged="videoDimensionsChanged",i.VideoPlaybackStarted="videoPlaybackStarted",i.VideoPlaybackFailed="videoPlaybackFailed",i.ElementAttached="elementAttached",i.ElementDetached="elementDetached",i.UpstreamPaused="upstreamPaused",i.UpstreamResumed="upstreamResumed",i.SubscriptionPermissionChanged="subscriptionPermissionChanged",i.SubscriptionStatusChanged="subscriptionStatusChanged",i.SubscriptionFailed="subscriptionFailed",i.TrackProcessorUpdate="trackProcessorUpdate",i.AudioTrackFeatureUpdate="audioTrackFeatureUpdate",i.TranscriptionReceived="transcriptionReceived",i.TimeSyncUpdate="timeSyncUpdate"}($e||($e={}));var Im,C9=/version\/(\d+(\.?_?\d+)+)/i;function Br(i){var e=1>=arguments.length||arguments[1]===void 0||arguments[1];if(typeof navigator<"u"){var t=navigator.userAgent.toLowerCase();if(Im===void 0||e){var n=x9.find(function(r){return r.test.test(t)});Im=n==null?void 0:n.describe(t)}return Im}}var x9=[{test:/firefox|iceweasel|fxios/i,describe:function(i){return{name:"Firefox",version:kd(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,i),os:i.toLowerCase().includes("fxios")?"iOS":void 0,osVersion:Nm(i)}}},{test:/chrom|crios|crmo/i,describe:function(i){return{name:"Chrome",version:kd(/(?:chrome|chromium|crios|crmo)\/(\d+(\.?_?\d+)+)/i,i),os:i.toLowerCase().includes("crios")?"iOS":void 0,osVersion:Nm(i)}}},{test:/safari|applewebkit/i,describe:function(i){return{name:"Safari",version:kd(C9,i),os:i.includes("mobile/")?"iOS":"macOS",osVersion:Nm(i)}}}];function kd(i,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,n=e.match(i);return n&&n.length>=t&&n[t]||""}function Nm(i){return i.includes("mac os")?kd(/\(.+?(\d+_\d+(:?_\d+)?)/,i,1).replace(/_/g,"."):void 0}var Nn=ft(function i(){ht(this,i)});Nn.setTimeout=function(){return setTimeout.apply(void 0,arguments)},Nn.setInterval=function(){return setInterval.apply(void 0,arguments)},Nn.clearTimeout=function(){return clearTimeout.apply(void 0,arguments)},Nn.clearInterval=function(){return clearInterval.apply(void 0,arguments)};var Pm,Bt=function(){function i(e,t,n,r,s){if(ht(this,i),et(e)==="object")this.width=e.width,this.height=e.height,this.aspectRatio=e.aspectRatio,this.encoding={maxBitrate:e.maxBitrate,maxFramerate:e.maxFramerate,priority:e.priority};else{if(t===void 0||n===void 0)throw new TypeError("Unsupported options: provide at least width, height and maxBitrate");this.width=e,this.height=t,this.aspectRatio=e/t,this.encoding={maxBitrate:n,maxFramerate:r,priority:s}}}return ft(i,[{key:"resolution",get:function(){return{width:this.width,height:this.height,frameRate:this.encoding.maxFramerate,aspectRatio:this.aspectRatio}}}]),i}(),E9=["vp8","h264"],IT=["vp8","h264","vp9","av1"];function w9(i){return!!E9.find(function(e){return e===i})}(function(i){i.telephone={maxBitrate:12e3},i.speech={maxBitrate:2e4},i.music={maxBitrate:32e3},i.musicStereo={maxBitrate:48e3},i.musicHighQuality={maxBitrate:64e3},i.musicHighQualityStereo={maxBitrate:96e3}})(Pm||(Pm={}));var Rl={h90:new Bt(160,90,9e4,20),h180:new Bt(320,180,16e4,20),h216:new Bt(384,216,18e4,20),h360:new Bt(640,360,45e4,20),h540:new Bt(960,540,8e5,25),h720:new Bt(1280,720,17e5,30),h1080:new Bt(1920,1080,3e6,30),h1440:new Bt(2560,1440,5e6,30),h2160:new Bt(3840,2160,8e6,30)},Om={h120:new Bt(160,120,7e4,20),h180:new Bt(240,180,125e3,20),h240:new Bt(320,240,14e4,20),h360:new Bt(480,360,33e4,20),h480:new Bt(640,480,5e5,20),h540:new Bt(720,540,6e5,25),h720:new Bt(960,720,13e5,30),h1080:new Bt(1440,1080,23e5,30),h1440:new Bt(1920,1440,38e5,30)},Mm={h360fps3:new Bt(640,360,2e5,3,"medium"),h360fps15:new Bt(640,360,4e5,15,"medium"),h720fps5:new Bt(1280,720,8e5,5,"medium"),h720fps15:new Bt(1280,720,15e5,15,"medium"),h720fps30:new Bt(1280,720,2e6,30,"medium"),h1080fps15:new Bt(1920,1080,25e5,15,"medium"),h1080fps30:new Bt(1920,1080,5e6,30,"medium"),original:new Bt(0,0,7e6,30,"medium")},Pi,Ll=[];(function(i){i[i.LOW=0]="LOW",i[i.MEDIUM=1]="MEDIUM",i[i.HIGH=2]="HIGH"})(Pi||(Pi={}));var Le=function(i){function e(t,n){var r;ht(this,e);var s,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return(r=Rt(this,e)).attachedElements=[],r.isMuted=!1,r.streamState=e.StreamState.Active,r.isInBackground=!1,r._currentBitrate=0,r.log=Ct,r.appVisibilityChangedListener=function(){r.backgroundTimeout&&clearTimeout(r.backgroundTimeout),document.visibilityState==="hidden"?r.backgroundTimeout=setTimeout(function(){return r.handleAppVisibilityChanged()},5e3):r.handleAppVisibilityChanged()},r.log=Lr((s=a.loggerName)!==null&&s!==void 0?s:Wi.Track),r.loggerContextCb=a.loggerContextCb,r.setMaxListeners(100),r.kind=n,r._mediaStreamTrack=t,r._mediaStreamID=t.id,r.source=e.Source.Unknown,r}return Lt(e,Ys.EventEmitter),ft(e,[{key:"logContext",get:function(){var t;return Object.assign(Object.assign({},(t=this.loggerContextCb)===null||t===void 0?void 0:t.call(this)),Vt(this))}},{key:"currentBitrate",get:function(){return this._currentBitrate}},{key:"mediaStreamTrack",get:function(){return this._mediaStreamTrack}},{key:"mediaStreamID",get:function(){return this._mediaStreamID}},{key:"attach",value:function(t){var n=this,r="audio";this.kind===e.Kind.Video&&(r="video"),this.attachedElements.length===0&&this.kind===e.Kind.Video&&this.addAppVisibilityListener(),t||(r==="audio"&&(Ll.forEach(function(o){o.parentElement!==null||t||(t=o)}),t&&Ll.splice(Ll.indexOf(t),1)),t||(t=document.createElement(r))),this.attachedElements.includes(t)||this.attachedElements.push(t),oo(this.mediaStreamTrack,t);var s=t.srcObject.getTracks(),a=s.some(function(o){return o.kind==="audio"});return t.play().then(function(){n.emit(a?$e.AudioPlaybackStarted:$e.VideoPlaybackStarted)}).catch(function(o){o.name==="NotAllowedError"?n.emit(a?$e.AudioPlaybackFailed:$e.VideoPlaybackFailed,o):o.name==="AbortError"?Ct.debug("".concat(a?"audio":"video"," playback aborted, likely due to new play request")):Ct.warn("could not playback ".concat(a?"audio":"video"),o),a&&t&&s.some(function(c){return c.kind==="video"})&&o.name==="NotAllowedError"&&(t.muted=!0,t.play().catch(function(){}))}),this.emit($e.ElementAttached,t),t}},{key:"detach",value:function(t){var n=this;try{if(t){lo(this.mediaStreamTrack,t);var r=this.attachedElements.indexOf(t);return 0>r||(this.attachedElements.splice(r,1),this.recycleElement(t),this.emit($e.ElementDetached,t)),t}var s=[];return this.attachedElements.forEach(function(a){lo(n.mediaStreamTrack,a),s.push(a),n.recycleElement(a),n.emit($e.ElementDetached,a)}),this.attachedElements=[],s}finally{this.attachedElements.length===0&&this.removeAppVisibilityListener()}}},{key:"stop",value:function(){this.stopMonitor(),this._mediaStreamTrack.stop()}},{key:"enable",value:function(){this._mediaStreamTrack.enabled=!0}},{key:"disable",value:function(){this._mediaStreamTrack.enabled=!1}},{key:"stopMonitor",value:function(){this.monitorInterval&&clearInterval(this.monitorInterval),this.timeSyncHandle&&cancelAnimationFrame(this.timeSyncHandle)}},{key:"updateLoggerOptions",value:function(t){t.loggerName&&(this.log=Lr(t.loggerName)),t.loggerContextCb&&(this.loggerContextCb=t.loggerContextCb)}},{key:"recycleElement",value:function(t){if(t instanceof HTMLAudioElement){var n=!0;t.pause(),Ll.forEach(function(r){r.parentElement||(n=!1)}),n&&Ll.push(t)}}},{key:"handleAppVisibilityChanged",value:function(){return he(this,void 0,void 0,L().mark(function t(){var n=this;return L().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:this.isInBackground=document.visibilityState==="hidden",this.isInBackground||this.kind!==e.Kind.Video||setTimeout(function(){return n.attachedElements.forEach(function(s){return s.play().catch(function(){})})},0);case 2:case"end":return r.stop()}},t,this)}))}},{key:"addAppVisibilityListener",value:function(){yi()?(this.isInBackground=document.visibilityState==="hidden",document.addEventListener("visibilitychange",this.appVisibilityChangedListener)):this.isInBackground=!1}},{key:"removeAppVisibilityListener",value:function(){yi()&&document.removeEventListener("visibilitychange",this.appVisibilityChangedListener)}}]),e}();function oo(i,e){var t,n;t=e.srcObject instanceof MediaStream?e.srcObject:new MediaStream,(n=i.kind==="audio"?t.getAudioTracks():t.getVideoTracks()).includes(i)||(n.forEach(function(r){t.removeTrack(r)}),t.addTrack(i)),Zs()&&e instanceof HTMLVideoElement||(e.autoplay=!0),e.muted=t.getAudioTracks().length===0,e instanceof HTMLVideoElement&&(e.playsInline=!0),e.srcObject!==t&&(e.srcObject=t,(Zs()||co())&&e instanceof HTMLVideoElement&&setTimeout(function(){e.srcObject=t,e.play().catch(function(){})},0))}function lo(i,e){if(e.srcObject instanceof MediaStream){var t=e.srcObject;t.removeTrack(i),t.getTracks().length>0?e.srcObject=t:e.srcObject=null}}function NT(i,e,t){var n,r=(n=function(s){if(s!==void 0)return typeof structuredClone=="function"?structuredClone(s):JSON.parse(JSON.stringify(s))}(i))!==null&&n!==void 0?n:{};return r.audio===!0&&(r.audio={}),r.video===!0&&(r.video={}),r.audio&&Rm(r.audio,e),r.video&&Rm(r.video,t),r}function Rm(i,e){return Object.keys(e).forEach(function(t){i[t]===void 0&&(i[t]=e[t])}),i}function Td(i){var e={};if(i.video)if(et(i.video)==="object"){var t={},n=t,r=i.video;Object.keys(r).forEach(function(s){switch(s){case"resolution":Rm(n,r.resolution);break;default:n[s]=r[s]}}),e.video=t}else e.video=i.video;else e.video=!1;return i.audio?et(i.audio)==="object"?e.audio=i.audio:e.audio=!0:e.audio=!1,e}function D9(i){return he(this,arguments,void 0,function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:200;return L().mark(function n(){var r,s,a,o,c;return L().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(!(r=PT())){u.next=14;break}return(s=r.createAnalyser()).fftSize=2048,a=s.frequencyBinCount,o=new Uint8Array(a),r.createMediaStreamSource(new MediaStream([e.mediaStreamTrack])).connect(s),u.next=10,vr(t);case 10:return s.getByteTimeDomainData(o),c=o.some(function(d){return d!==128&&d!==0}),r.close(),u.abrupt("return",!c);case 14:return u.abrupt("return",!1);case 15:case"end":return u.stop()}},n)})()})}function PT(){var i=typeof window<"u"&&(window.AudioContext||window.webkitAudioContext);if(i)return new i({latencyHint:"interactive"})}function OT(i){return i===Le.Source.Microphone?"audioinput":i===Le.Source.Camera?"videoinput":void 0}function A9(i){var e,t,n=(e=i.video)===null||e===void 0||e;return i.resolution&&i.resolution.width>0&&i.resolution.height>0&&(n=typeof n=="boolean"?{}:n,n=Zs()?Object.assign(Object.assign({},n),{width:{max:i.resolution.width},height:{max:i.resolution.height},frameRate:i.resolution.frameRate}):Object.assign(Object.assign({},n),{width:{ideal:i.resolution.width},height:{ideal:i.resolution.height},frameRate:i.resolution.frameRate})),{audio:(t=i.audio)!==null&&t!==void 0&&t,video:n,controller:i.controller,selfBrowserSurface:i.selfBrowserSurface,surfaceSwitching:i.surfaceSwitching,systemAudio:i.systemAudio,preferCurrentTab:i.preferCurrentTab}}function Sd(i){var e=i.split("/")[1].toLowerCase();if(!IT.includes(e))throw Error("Video codec not supported: ".concat(e));return e}function Vt(i){return i instanceof Le?{trackID:i.sid,source:i.source,muted:i.isMuted,enabled:i.mediaStreamTrack.enabled,kind:i.kind,streamID:i.mediaStreamID,streamTrackID:i.mediaStreamTrack.id}:{trackID:i.trackSid,enabled:i.isEnabled,muted:i.isMuted,trackInfo:Object.assign({mimeType:i.mimeType,name:i.trackName,encrypted:i.isEncrypted,kind:i.kind,source:i.source},i.track?Vt(i.track):{})}}(function(i){var e,t,n;(function(r){r.Audio="audio",r.Video="video",r.Unknown="unknown"})(e=i.Kind||(i.Kind={})),function(r){r.Camera="camera",r.Microphone="microphone",r.ScreenShare="screen_share",r.ScreenShareAudio="screen_share_audio",r.Unknown="unknown"}(t=i.Source||(i.Source={})),function(r){r.Active="active",r.Paused="paused",r.Unknown="unknown"}(n=i.StreamState||(i.StreamState={})),i.kindToProto=function(r){switch(r){case e.Audio:return zi.AUDIO;case e.Video:return zi.VIDEO;default:return zi.DATA}},i.kindFromProto=function(r){switch(r){case zi.AUDIO:return e.Audio;case zi.VIDEO:return e.Video;default:return e.Unknown}},i.sourceToProto=function(r){switch(r){case t.Camera:return jn.CAMERA;case t.Microphone:return jn.MICROPHONE;case t.ScreenShare:return jn.SCREEN_SHARE;case t.ScreenShareAudio:return jn.SCREEN_SHARE_AUDIO;default:return jn.UNKNOWN}},i.sourceFromProto=function(r){switch(r){case jn.CAMERA:return t.Camera;case jn.MICROPHONE:return t.Microphone;case jn.SCREEN_SHARE:return t.ScreenShare;case jn.SCREEN_SHARE_AUDIO:return t.ScreenShareAudio;default:return t.Unknown}},i.streamStateFromProto=function(r){switch(r){case um.ACTIVE:return n.Active;case um.PAUSED:return n.Paused;default:return n.Unknown}}})(Le||(Le={}));var MT="https://aomediacodec.github.io/av1-rtp-spec/#dependency-descriptor-rtp-header-extension";function vr(i){return he(this,void 0,void 0,L().mark(function e(){return L().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(n){return Nn.setTimeout(n,i)}));case 1:case"end":return t.stop()}},e)}))}function Lm(){return"addTransceiver"in RTCPeerConnection.prototype}function Bm(){return"addTrack"in RTCPeerConnection.prototype}function I9(){if(!("getCapabilities"in RTCRtpSender)||Zs())return!1;var i=RTCRtpSender.getCapabilities("video"),e=!1;if(i){var t,n=dt(i.codecs);try{for(n.s();!(t=n.n()).done;)if(t.value.mimeType==="video/AV1"){e=!0;break}}catch(r){n.e(r)}finally{n.f()}}return e}function N9(){if(!("getCapabilities"in RTCRtpSender)||co())return!1;if(Zs()){var i=Br();if(i!=null&&i.version&&0>Ul(i.version,"16"))return!1}var e=RTCRtpSender.getCapabilities("video"),t=!1;if(e){var n,r=dt(e.codecs);try{for(r.s();!(n=r.n()).done;)if(n.value.mimeType==="video/VP9"){t=!0;break}}catch(s){r.e(s)}finally{r.f()}}return t}function Bl(i){return i==="av1"||i==="vp9"}function Um(i){return!!document&&(i||(i=document.createElement("audio")),"setSinkId"in i)}function co(){var i;return((i=Br())===null||i===void 0?void 0:i.name)==="Firefox"}function Zs(){var i;return((i=Br())===null||i===void 0?void 0:i.name)==="Safari"}function RT(){var i,e;return!!yi()&&((e=(i=navigator.userAgentData)===null||i===void 0?void 0:i.mobile)!==null&&e!==void 0?e:/Tablet|iPad|Mobile|Android|BlackBerry/.test(navigator.userAgent))}function P9(){var i=Br(),e="17.2";if(i)return i.name!=="Safari"&&i.os!=="iOS"||!(i.os!=="iOS"||!i.osVersion||0>Ul(e,i.osVersion))||i.name==="Safari"&&Ul(e,i.version)>=0}function yi(){return typeof document<"u"}function Ur(){return navigator.product=="ReactNative"}function Fm(i){return i.hostname.endsWith(".livekit.cloud")||i.hostname.endsWith(".livekit.run")}function LT(){if(global&&global.LiveKitReactNativeGlobal)return global.LiveKitReactNativeGlobal}function BT(){if(Ur()){var i=LT();return i?i.platform:void 0}}function UT(){if(yi())return window.devicePixelRatio;if(Ur()){var i=LT();if(i)return i.devicePixelRatio}return 1}function Ul(i,e){for(var t=i.split("."),n=e.split("."),r=Math.min(t.length,n.length),s=0;r>s;++s){var a=parseInt(t[s],10),o=parseInt(n[s],10);if(a>o)return 1;if(o>a)return-1;if(s===r-1&&a===o)return 0}return i===""&&e!==""?-1:e===""?1:t.length==n.length?0:t.length<n.length?-1:1}function O9(i){var e,t=dt(i);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.target.handleResize(n)}}catch(r){t.e(r)}finally{t.f()}}function M9(i){var e,t=dt(i);try{for(t.s();!(e=t.n()).done;){var n=e.value;n.target.handleVisibilityChanged(n)}}catch(r){t.e(r)}finally{t.f()}}var Cd,Vm=null,FT=function(){return Vm||(Vm=new ResizeObserver(O9)),Vm},jm=null,VT=function(){return jm||(jm=new IntersectionObserver(M9,{root:null,rootMargin:"0px"})),jm};function jT(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:16,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:16,t=arguments.length>2&&arguments[2]!==void 0&&arguments[2],n=arguments.length>3&&arguments[3]!==void 0&&arguments[3],r=document.createElement("canvas");r.width=i,r.height=e;var s=r.getContext("2d");s==null||s.fillRect(0,0,r.width,r.height),n&&s&&(s.beginPath(),s.arc(i/2,e/2,50,0,2*Math.PI,!0),s.closePath(),s.fillStyle="grey",s.fill());var a=At(r.captureStream().getTracks(),1)[0];if(!a)throw Error("Could not get empty media stream video track");return a.enabled=t,a}function $m(){if(!Cd){var i=new AudioContext,e=i.createOscillator(),t=i.createGain();t.gain.setValueAtTime(0,0);var n=i.createMediaStreamDestination();e.connect(t),t.connect(n),e.start();var r=At(n.stream.getAudioTracks(),1);if(!(Cd=r[0]))throw Error("Could not get empty media stream audio track");Cd.enabled=!1}return Cd.clone()}var $T=ft(function i(e,t){var n=this;ht(this,i),this.onFinally=t,this.promise=new Promise(function(r,s){return he(n,void 0,void 0,L().mark(function a(){return L().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(this.resolve=r,this.reject=s,!e){o.next=5;break}return o.next=5,e(r,s);case 5:case"end":return o.stop()}},a,this)}))}).finally(function(){var r;return(r=n.onFinally)===null||r===void 0?void 0:r.call(n)})}),bi=function(){function i(){ht(this,i),this._locking=Promise.resolve(),this._locks=0}return ft(i,[{key:"isLocked",value:function(){return this._locks>0}},{key:"lock",value:function(){var e,t=this;this._locks+=1;var n=new Promise(function(s){return e=function(){t._locks-=1,s()}}),r=this._locking.then(function(){return e});return this._locking=this._locking.then(function(){return n}),r}}]),i}();function Fr(i){if(typeof i=="string"||typeof i=="number")return i;if(Array.isArray(i))return i[0];if(i.exact)return Array.isArray(i.exact)?i.exact[0]:i.exact;if(i.ideal)return Array.isArray(i.ideal)?i.ideal[0]:i.ideal;throw Error("could not unwrap constraint")}function HT(i){return i.startsWith("ws")?i.replace(/^(ws)/,"http"):i}var Hm="default",yr=function(){function i(){ht(this,i)}return ft(i,[{key:"getDevices",value:function(e){return he(this,arguments,void 0,function(t){var n=this,r=1>=arguments.length||arguments[1]===void 0||arguments[1];return L().mark(function s(){var a,o,c,u;return L().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(((a=i.userMediaPromiseMap)===null||a===void 0?void 0:a.size)<=0){d.next=15;break}if(Ct.debug("awaiting getUserMedia promise"),d.prev=2,!t){d.next=8;break}return d.next=6,i.userMediaPromiseMap.get(t);case 6:d.next=10;break;case 8:return d.next=10,Promise.all(i.userMediaPromiseMap.values());case 10:d.next=15;break;case 12:d.prev=12,d.t0=d.catch(2),Ct.warn("error waiting for media permissons");case 15:return d.next=17,navigator.mediaDevices.enumerateDevices();case 17:if(o=d.sent,!r||Zs()&&n.hasDeviceInUse(t)){d.next=29;break}if(!(o.filter(function(h){return h.kind===t}).length===0||o.some(function(h){var b=h.label==="",v=!t||h.kind===t;return b&&v}))){d.next=29;break}return c={video:t!=="audioinput"&&t!=="audiooutput",audio:t!=="videoinput"},d.next=24,navigator.mediaDevices.getUserMedia(c);case 24:return u=d.sent,d.next=27,navigator.mediaDevices.enumerateDevices();case 27:o=d.sent,u.getTracks().forEach(function(h){h.stop()});case 29:return t&&(o=o.filter(function(h){return h.kind===t})),d.abrupt("return",o);case 31:case"end":return d.stop()}},s,null,[[2,12]])})()})}},{key:"normalizeDeviceId",value:function(e,t,n){return he(this,void 0,void 0,L().mark(function r(){var s,a,o;return L().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(t===Hm){c.next=2;break}return c.abrupt("return",t);case 2:return c.next=4,this.getDevices(e);case 4:if(s=c.sent,a=s.find(function(u){return u.deviceId===Hm})){c.next=9;break}return Ct.warn("could not reliably determine default device"),c.abrupt("return",void 0);case 9:if(o=s.find(function(u){return u.deviceId!==Hm&&u.groupId===(n??a.groupId)})){c.next=13;break}return Ct.warn("could not reliably determine default device"),c.abrupt("return",void 0);case 13:return c.abrupt("return",o==null?void 0:o.deviceId);case 14:case"end":return c.stop()}},r,this)}))}},{key:"hasDeviceInUse",value:function(e){return e?i.userMediaPromiseMap.has(e):i.userMediaPromiseMap.size>0}}],[{key:"getInstance",value:function(){return this.instance===void 0&&(this.instance=new i),this.instance}}]),i}();yr.mediaDeviceKinds=["audioinput","audiooutput","videoinput"],yr.userMediaPromiseMap=new Map;var Fl,uo=function(i){function e(t,n,r){var s;ht(this,e);var a=arguments.length>3&&arguments[3]!==void 0&&arguments[3];return(s=Rt(this,e,[t,n,arguments.length>4?arguments[4]:void 0])).manuallyStopped=!1,s._isUpstreamPaused=!1,s.handleTrackMuteEvent=function(){return s.debouncedTrackMuteHandler().catch(function(){return s.log.debug("track mute bounce got cancelled by an unmute event",s.logContext)})},s.debouncedTrackMuteHandler=Am(function(){return he(ct(s),void 0,void 0,L().mark(function o(){return L().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,this.pauseUpstream();case 2:case"end":return c.stop()}},o,this)}))},5e3),s.handleTrackUnmuteEvent=function(){return he(ct(s),void 0,void 0,L().mark(function o(){return L().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return this.debouncedTrackMuteHandler.cancel("unmute"),c.next=3,this.resumeUpstream();case 3:case"end":return c.stop()}},o,this)}))},s.handleEnded=function(){s.isInBackground&&(s.reacquireTrack=!0),s._mediaStreamTrack.removeEventListener("mute",s.handleTrackMuteEvent),s._mediaStreamTrack.removeEventListener("unmute",s.handleTrackUnmuteEvent),s.emit($e.Ended,ct(s))},s.reacquireTrack=!1,s.providedByUser=a,s.muteLock=new bi,s.pauseUpstreamLock=new bi,s.processorLock=new bi,s.restartLock=new bi,s.setMediaStreamTrack(t,!0),s._constraints=t.getConstraints(),r&&(s._constraints=r),s}return Lt(e,Le),ft(e,[{key:"sender",get:function(){return this._sender},set:function(t){this._sender=t}},{key:"constraints",get:function(){return this._constraints}},{key:"id",get:function(){return this._mediaStreamTrack.id}},{key:"dimensions",get:function(){if(this.kind===Le.Kind.Video){var t=this._mediaStreamTrack.getSettings(),n=t.width,r=t.height;return n&&r?{width:n,height:r}:void 0}}},{key:"isUpstreamPaused",get:function(){return this._isUpstreamPaused}},{key:"isUserProvided",get:function(){return this.providedByUser}},{key:"mediaStreamTrack",get:function(){var t,n;return(n=(t=this.processor)===null||t===void 0?void 0:t.processedTrack)!==null&&n!==void 0?n:this._mediaStreamTrack}},{key:"setMediaStreamTrack",value:function(t,n){return he(this,void 0,void 0,L().mark(function r(){var s,a,o=this;return L().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(t!==this._mediaStreamTrack||n){c.next=2;break}return c.abrupt("return");case 2:if(this._mediaStreamTrack&&(this.attachedElements.forEach(function(u){lo(o._mediaStreamTrack,u)}),this.debouncedTrackMuteHandler.cancel("new-track"),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent)),this.mediaStream=new MediaStream([t]),t&&(t.addEventListener("ended",this.handleEnded),t.addEventListener("mute",this.handleTrackMuteEvent),t.addEventListener("unmute",this.handleTrackUnmuteEvent),this._constraints=t.getConstraints()),!this.processor||!t){c.next=20;break}return c.next=8,this.processorLock.lock();case 8:if(a=c.sent,c.prev=9,this.log.debug("restarting processor",this.logContext),this.kind!=="unknown"){c.next=13;break}throw TypeError("cannot set processor on track of unknown kind");case 13:return this.processorElement&&(oo(t,this.processorElement),this.processorElement.muted=!0),c.next=16,this.processor.restart({track:t,kind:this.kind,element:this.processorElement});case 16:s=this.processor.processedTrack;case 17:return c.prev=17,a(),c.finish(17);case 20:if(!this.sender){c.next=23;break}return c.next=23,this.sender.replaceTrack(s??t);case 23:if(this.providedByUser||this._mediaStreamTrack===t||this._mediaStreamTrack.stop(),this._mediaStreamTrack=t,!t){c.next=30;break}return this._mediaStreamTrack.enabled=!this.isMuted,c.next=29,this.resumeUpstream();case 29:this.attachedElements.forEach(function(u){oo(s??t,u)});case 30:case"end":return c.stop()}},r,this,[[9,,17,20]])}))}},{key:"waitForDimensions",value:function(){return he(this,arguments,void 0,function(){var t=this,n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1e3;return L().mark(function r(){var s,a,o;return L().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(t.kind!==Le.Kind.Audio){c.next=2;break}throw new Error("cannot get dimensions for audio tracks");case 2:if(((s=Br())===null||s===void 0?void 0:s.os)!=="iOS"){c.next=5;break}return c.next=5,vr(10);case 5:a=Date.now();case 6:if(Date.now()-a>=n){c.next=14;break}if(!(o=t.dimensions)){c.next=10;break}return c.abrupt("return",o);case 10:return c.next=12,vr(50);case 12:c.next=6;break;case 14:throw new gr("unable to get track dimensions after timeout");case 15:case"end":return c.stop()}},r)})()})}},{key:"getDeviceId",value:function(){return he(this,arguments,void 0,function(){var t=this,n=0>=arguments.length||arguments[0]===void 0||arguments[0];return L().mark(function r(){var s,a,o,c;return L().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(t.source!==Le.Source.ScreenShare){u.next=2;break}return u.abrupt("return");case 2:return s=t._mediaStreamTrack.getSettings(),a=s.deviceId,o=s.groupId,c=t.kind===Le.Kind.Audio?"audioinput":"videoinput",u.abrupt("return",n?yr.getInstance().normalizeDeviceId(c,a,o):a);case 5:case"end":return u.stop()}},r)})()})}},{key:"mute",value:function(){return he(this,void 0,void 0,L().mark(function t(){return L().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return this.setTrackMuted(!0),n.abrupt("return",this);case 2:case"end":return n.stop()}},t,this)}))}},{key:"unmute",value:function(){return he(this,void 0,void 0,L().mark(function t(){return L().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return this.setTrackMuted(!1),n.abrupt("return",this);case 2:case"end":return n.stop()}},t,this)}))}},{key:"replaceTrack",value:function(t,n){return he(this,void 0,void 0,L().mark(function r(){var s,a;return L().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(this.sender){o.next=2;break}throw new gr("unable to replace an unpublished track");case 2:return typeof n=="boolean"?s=n:n!==void 0&&(s=n.userProvidedTrack,a=n.stopProcessor),this.providedByUser=s==null||s,this.log.debug("replace MediaStreamTrack",this.logContext),o.next=7,this.setMediaStreamTrack(t);case 7:if(!a||!this.processor){o.next=10;break}return o.next=10,this.stopProcessor();case 10:return o.abrupt("return",this);case 11:case"end":return o.stop()}},r,this)}))}},{key:"restart",value:function(t){return he(this,void 0,void 0,L().mark(function n(){var r,s,a,o,c=this;return L().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return this.manuallyStopped=!1,u.next=3,this.restartLock.lock();case 3:return r=u.sent,u.prev=4,t||(t=this._constraints),this.log.debug("restarting track with constraints",Object.assign(Object.assign({},this.logContext),{constraints:t})),s={audio:!1,video:!1},this.kind===Le.Kind.Video?s.video=t:s.audio=t,this.attachedElements.forEach(function(d){lo(c.mediaStreamTrack,d)}),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.stop(),u.next=14,navigator.mediaDevices.getUserMedia(s);case 14:return a=u.sent,(o=a.getTracks()[0]).addEventListener("ended",this.handleEnded),this.log.debug("re-acquired MediaStreamTrack",this.logContext),u.next=20,this.setMediaStreamTrack(o);case 20:return this._constraints=t,this.emit($e.Restarted,this),this.manuallyStopped&&(this.log.warn("track was stopped during a restart, stopping restarted track",this.logContext),this.stop()),u.abrupt("return",this);case 24:return u.prev=24,r(),u.finish(24);case 27:case"end":return u.stop()}},n,this,[[4,,24,27]])}))}},{key:"setTrackMuted",value:function(t){this.log.debug("setting ".concat(this.kind," track ").concat(t?"muted":"unmuted"),this.logContext),this.isMuted===t&&this._mediaStreamTrack.enabled!==t||(this.isMuted=t,this._mediaStreamTrack.enabled=!t,this.emit(t?$e.Muted:$e.Unmuted,this))}},{key:"needsReAcquisition",get:function(){return this._mediaStreamTrack.readyState!=="live"||this._mediaStreamTrack.muted||!this._mediaStreamTrack.enabled||this.reacquireTrack}},{key:"handleAppVisibilityChanged",value:function(){var t=this,n=Object.create(null,{handleAppVisibilityChanged:{get:function(){return pt(lt(e.prototype),"handleAppVisibilityChanged",t)}}});return he(this,void 0,void 0,L().mark(function r(){return L().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,n.handleAppVisibilityChanged.call(this);case 2:if(RT()){s.next=4;break}return s.abrupt("return");case 4:if(this.log.debug("visibility changed, is in Background: ".concat(this.isInBackground),this.logContext),this.isInBackground||!this.needsReAcquisition||this.isUserProvided||this.isMuted){s.next=10;break}return this.log.debug("track needs to be reacquired, restarting ".concat(this.source),this.logContext),s.next=9,this.restart();case 9:this.reacquireTrack=!1;case 10:case"end":return s.stop()}},r,this)}))}},{key:"stop",value:function(){var t;this.manuallyStopped=!0,pt(lt(e.prototype),"stop",this).call(this),this._mediaStreamTrack.removeEventListener("ended",this.handleEnded),this._mediaStreamTrack.removeEventListener("mute",this.handleTrackMuteEvent),this._mediaStreamTrack.removeEventListener("unmute",this.handleTrackUnmuteEvent),(t=this.processor)===null||t===void 0||t.destroy(),this.processor=void 0}},{key:"pauseUpstream",value:function(){return he(this,void 0,void 0,L().mark(function t(){var n,r;return L().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,this.pauseUpstreamLock.lock();case 2:if(n=s.sent,s.prev=3,this._isUpstreamPaused!==!0){s.next=6;break}return s.abrupt("return");case 6:if(this.sender){s.next=9;break}return this.log.warn("unable to pause upstream for an unpublished track",this.logContext),s.abrupt("return");case 9:if(this._isUpstreamPaused=!0,this.emit($e.UpstreamPaused,this),((r=Br())==null?void 0:r.name)!=="Safari"||Ul(r.version,"12.0")>=0){s.next=14;break}throw new wm("pauseUpstream is not supported on Safari < 12.");case 14:return s.next=16,this.sender.replaceTrack(null);case 16:return s.prev=16,n(),s.finish(16);case 19:case"end":return s.stop()}},t,this,[[3,,16,19]])}))}},{key:"resumeUpstream",value:function(){return he(this,void 0,void 0,L().mark(function t(){var n;return L().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.pauseUpstreamLock.lock();case 2:if(n=r.sent,r.prev=3,this._isUpstreamPaused!==!1){r.next=6;break}return r.abrupt("return");case 6:if(this.sender){r.next=9;break}return this.log.warn("unable to resume upstream for an unpublished track",this.logContext),r.abrupt("return");case 9:return this._isUpstreamPaused=!1,this.emit($e.UpstreamResumed,this),r.next=13,this.sender.replaceTrack(this.mediaStreamTrack);case 13:return r.prev=13,n(),r.finish(13);case 16:case"end":return r.stop()}},t,this,[[3,,13,16]])}))}},{key:"getRTCStatsReport",value:function(){return he(this,void 0,void 0,L().mark(function t(){var n,r;return L().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(!((n=this.sender)===null||n===void 0)&&n.getStats){s.next=2;break}return s.abrupt("return");case 2:return s.next=4,this.sender.getStats();case 4:return r=s.sent,s.abrupt("return",r);case 6:case"end":return s.stop()}},t,this)}))}},{key:"setProcessor",value:function(t){return he(this,arguments,void 0,function(n){var r=this,s=1>=arguments.length||arguments[1]===void 0||arguments[1];return L().mark(function a(){var o,c,u,d,h,b,v;return L().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,r.processorLock.lock();case 2:return c=y.sent,y.prev=3,r.log.debug("setting up processor",r.logContext),u=document.createElement(r.kind),d={kind:r.kind,track:r._mediaStreamTrack,element:u,audioContext:r.audioContext},y.next=9,n.init(d);case 9:if(r.log.debug("processor initialized",r.logContext),!r.processor){y.next=13;break}return y.next=13,r.stopProcessor();case 13:if(r.kind!=="unknown"){y.next=15;break}throw TypeError("cannot set processor on track of unknown kind");case 15:if(oo(r._mediaStreamTrack,u),u.muted=!0,u.play().catch(function(p){return r.log.error("failed to play processor element",Object.assign(Object.assign({},r.logContext),{error:p}))}),r.processor=n,r.processorElement=u,!r.processor.processedTrack){y.next=25;break}h=dt(r.attachedElements);try{for(h.s();!(b=h.n()).done;)(v=b.value)!==r.processorElement&&s&&(lo(r._mediaStreamTrack,v),oo(r.processor.processedTrack,v))}catch(p){h.e(p)}finally{h.f()}return y.next=25,(o=r.sender)===null||o===void 0?void 0:o.replaceTrack(r.processor.processedTrack);case 25:r.emit($e.TrackProcessorUpdate,r.processor);case 26:return y.prev=26,c(),y.finish(26);case 29:case"end":return y.stop()}},a,null,[[3,,26,29]])})()})}},{key:"getProcessor",value:function(){return this.processor}},{key:"stopProcessor",value:function(){return he(this,arguments,void 0,function(){var t=this,n=0>=arguments.length||arguments[0]===void 0||arguments[0];return L().mark(function r(){var s,a;return L().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(t.processor){o.next=2;break}return o.abrupt("return");case 2:return t.log.debug("stopping processor",t.logContext),(s=t.processor.processedTrack)===null||s===void 0||s.stop(),o.next=6,t.processor.destroy();case 6:return t.processor=void 0,n||((a=t.processorElement)===null||a===void 0||a.remove(),t.processorElement=void 0),o.next=10,t._mediaStreamTrack.applyConstraints(t._constraints);case 10:return o.next=12,t.setMediaStreamTrack(t._mediaStreamTrack,!0);case 12:t.emit($e.TrackProcessorUpdate);case 13:case"end":return o.stop()}},r)})()})}}]),e}(),R9=function(i){function e(t){var n;return ht(this,e),(n=Rt(this,e)).onWorkerMessage=function(r){var s,a,o=r.data,c=o.kind,u=o.data;switch(c){case"error":Ct.error(u.error.message),n.emit(fs.EncryptionError,u.error);break;case"initAck":u.enabled&&n.keyProvider.getKeys().forEach(function(h){n.postKey(h)});break;case"enable":if(u.enabled&&n.keyProvider.getKeys().forEach(function(h){n.postKey(h)}),n.encryptionEnabled!==u.enabled&&u.participantIdentity===((s=n.room)===null||s===void 0?void 0:s.localParticipant.identity))n.emit(fs.ParticipantEncryptionStatusChanged,u.enabled,n.room.localParticipant),n.encryptionEnabled=u.enabled;else if(u.participantIdentity){var d=(a=n.room)===null||a===void 0?void 0:a.getParticipantByIdentity(u.participantIdentity);if(!d)throw TypeError("couldn't set encryption status, participant not found".concat(u.participantIdentity));n.emit(fs.ParticipantEncryptionStatusChanged,u.enabled,d)}break;case"ratchetKey":n.keyProvider.emit(Ml.KeyRatcheted,u.material,u.keyIndex);break}},n.onWorkerError=function(r){Ct.error("e2ee worker encountered an error:",{error:r.error}),n.emit(fs.EncryptionError,r.error)},n.keyProvider=t.keyProvider,n.worker=t.worker,n.encryptionEnabled=!1,n}return Lt(e,Ys.EventEmitter),ft(e,[{key:"setup",value:function(t){if(!T9())throw new wm("tried to setup end-to-end encryption on an unsupported browser");if(Ct.info("setting up e2ee"),t!==this.room){this.room=t,this.setupEventListeners(t,this.keyProvider);var n={kind:"init",data:{keyProviderOptions:this.keyProvider.getOptions(),loglevel:p9.getLevel()}};this.worker&&(Ct.info("initializing worker",{worker:this.worker}),this.worker.onmessage=this.onWorkerMessage,this.worker.onerror=this.onWorkerError,this.worker.postMessage(n))}}},{key:"setParticipantCryptorEnabled",value:function(t,n){Ct.debug("set e2ee to ".concat(t," for participant ").concat(n)),this.postEnable(t,n)}},{key:"setSifTrailer",value:function(t){t&&t.length!==0?this.postSifTrailer(t):Ct.warn("ignoring server sent trailer as it's empty")}},{key:"setupEngine",value:function(t){var n=this;t.on(Qe.RTPVideoMapUpdate,function(r){n.postRTPMap(r)})}},{key:"setupEventListeners",value:function(t,n){var r=this;t.on(je.TrackPublished,function(s,a){return r.setParticipantCryptorEnabled(s.trackInfo.encryption!==Ni.NONE,a.identity)}),t.on(je.ConnectionStateChanged,function(s){s===Ut.Connected&&t.remoteParticipants.forEach(function(a){a.trackPublications.forEach(function(o){r.setParticipantCryptorEnabled(o.trackInfo.encryption!==Ni.NONE,a.identity)})})}).on(je.TrackUnsubscribed,function(s,a,o){var c,u={kind:"removeTransform",data:{participantIdentity:o.identity,trackId:s.mediaStreamID}};(c=r.worker)===null||c===void 0||c.postMessage(u)}).on(je.TrackSubscribed,function(s,a,o){r.setupE2EEReceiver(s,o.identity,a.trackInfo)}).on(je.SignalConnected,function(){if(!r.room)throw new TypeError("expected room to be present on signal connect");n.getKeys().forEach(function(s){r.postKey(s)}),r.setParticipantCryptorEnabled(r.room.localParticipant.isE2EEEnabled,r.room.localParticipant.identity)}),t.localParticipant.on(qe.LocalTrackPublished,function(s){return he(r,void 0,void 0,L().mark(function a(){return L().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:this.setupE2EESender(s.track,s.track.sender);case 1:case"end":return o.stop()}},a,this)}))}),n.on(Ml.SetKey,function(s){return r.postKey(s)}).on(Ml.RatchetRequest,function(s,a){return r.postRatchetRequest(s,a)})}},{key:"postRatchetRequest",value:function(t,n){if(!this.worker)throw Error("could not ratchet key, worker is missing");var r={kind:"ratchetRequest",data:{participantIdentity:t,keyIndex:n}};this.worker.postMessage(r)}},{key:"postKey",value:function(t){var n,r=t.key,s=t.participantIdentity,a=t.keyIndex;if(!this.worker)throw Error("could not set key, worker is missing");var o={kind:"setKey",data:{participantIdentity:s,isPublisher:s===((n=this.room)===null||n===void 0?void 0:n.localParticipant.identity),key:r,keyIndex:a}};this.worker.postMessage(o)}},{key:"postEnable",value:function(t,n){if(!this.worker)throw new ReferenceError("failed to enable e2ee, worker is not ready");var r={kind:"enable",data:{enabled:t,participantIdentity:n}};this.worker.postMessage(r)}},{key:"postRTPMap",value:function(t){var n;if(!this.worker)throw TypeError("could not post rtp map, worker is missing");if(!(!((n=this.room)===null||n===void 0)&&n.localParticipant.identity))throw TypeError("could not post rtp map, local participant identity is missing");var r={kind:"setRTPMap",data:{map:t,participantIdentity:this.room.localParticipant.identity}};this.worker.postMessage(r)}},{key:"postSifTrailer",value:function(t){if(!this.worker)throw Error("could not post SIF trailer, worker is missing");var n={kind:"setSifTrailer",data:{trailer:t}};this.worker.postMessage(n)}},{key:"setupE2EEReceiver",value:function(t,n,r){if(t.receiver){if(!(r!=null&&r.mimeType)||r.mimeType==="")throw new TypeError("MimeType missing from trackInfo, cannot set up E2EE cryptor");this.handleReceiver(t.receiver,t.mediaStreamID,n,t.kind==="video"?Sd(r.mimeType):void 0)}}},{key:"setupE2EESender",value:function(t,n){t instanceof uo&&n?this.handleSender(n,t.mediaStreamID,void 0):n||Ct.warn("early return because sender is not ready")}},{key:"handleReceiver",value:function(t,n,r,s){return he(this,void 0,void 0,L().mark(function a(){var o,c,u,d,h,b;return L().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(this.worker){v.next=2;break}return v.abrupt("return");case 2:if(!Em()){v.next=7;break}o={kind:"decode",participantIdentity:r,trackId:n,codec:s},t.transform=new RTCRtpScriptTransform(this.worker,o),v.next=16;break;case 7:if(!(bd in t)||!s){v.next=11;break}return c={kind:"updateCodec",data:{trackId:n,codec:s,participantIdentity:r}},this.worker.postMessage(c),v.abrupt("return");case 11:u=t.writableStream,d=t.readableStream,u&&d||(h=t.createEncodedStreams(),t.writableStream=h.writable,u=h.writable,t.readableStream=h.readable,d=h.readable),b={kind:"decode",data:{readableStream:d,writableStream:u,trackId:n,codec:s,participantIdentity:r}},this.worker.postMessage(b,[d,u]);case 16:t[bd]=!0;case 17:case"end":return v.stop()}},a,this)}))}},{key:"handleSender",value:function(t,n,r){var s;if(!(bd in t)&&this.worker){if(!(!((s=this.room)===null||s===void 0)&&s.localParticipant.identity)||this.room.localParticipant.identity==="")throw TypeError("local identity needs to be known in order to set up encrypted sender");if(Em()){Ct.info("initialize script transform");var a={kind:"encode",participantIdentity:this.room.localParticipant.identity,trackId:n,codec:r};t.transform=new RTCRtpScriptTransform(this.worker,a)}else{Ct.info("initialize encoded streams");var o=t.createEncodedStreams(),c={kind:"encode",data:{readableStream:o.readable,writableStream:o.writable,codec:r,trackId:n,participantIdentity:this.room.localParticipant.identity}};this.worker.postMessage(c,[o.readable,o.writable])}t[bd]=!0}}}]),e}();(function(i){i[i.WAITING=0]="WAITING",i[i.RUNNING=1]="RUNNING",i[i.COMPLETED=2]="COMPLETED"})(Fl||(Fl={}));var Jt,L9=function(){function i(){ht(this,i),this.pendingTasks=new Map,this.taskMutex=new bi,this.nextTaskIndex=0}return ft(i,[{key:"run",value:function(e){return he(this,void 0,void 0,L().mark(function t(){var n,r;return L().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return n={id:this.nextTaskIndex++,enqueuedAt:Date.now(),status:Fl.WAITING},this.pendingTasks.set(n.id,n),s.next=4,this.taskMutex.lock();case 4:return r=s.sent,s.prev=5,n.executedAt=Date.now(),n.status=Fl.RUNNING,s.next=10,e();case 10:return s.abrupt("return",s.sent);case 11:return s.prev=11,n.status=Fl.COMPLETED,this.pendingTasks.delete(n.id),r(),s.finish(11);case 16:case"end":return s.stop()}},t,this,[[5,,11,16]])}))}},{key:"flush",value:function(){return he(this,void 0,void 0,L().mark(function e(){var t=this;return L().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this.run(function(){return he(t,void 0,void 0,L().mark(function r(){return L().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:case"end":return s.stop()}},r)}))}));case 1:case"end":return n.stop()}},e,this)}))}},{key:"snapshot",value:function(){return Array.from(this.pendingTasks.values())}}]),i}(),B9=["syncState","trickle","offer","answer","simulate","leave"];function U9(i){var e=B9.indexOf(i.case)>=0;return Ct.trace("request allowed to bypass queue:",{canPass:e,req:i}),e}(function(i){i[i.CONNECTING=0]="CONNECTING",i[i.CONNECTED=1]="CONNECTED",i[i.RECONNECTING=2]="RECONNECTING",i[i.DISCONNECTING=3]="DISCONNECTING",i[i.DISCONNECTED=4]="DISCONNECTED"})(Jt||(Jt={}));var F9=function(){function i(){var e=this;ht(this,i);var t,n=arguments.length>0&&arguments[0]!==void 0&&arguments[0],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.rtt=0,this.state=Jt.DISCONNECTED,this.log=Ct,this._requestId=0,this.resetCallbacks=function(){e.onAnswer=void 0,e.onLeave=void 0,e.onLocalTrackPublished=void 0,e.onLocalTrackUnpublished=void 0,e.onNegotiateRequested=void 0,e.onOffer=void 0,e.onRemoteMuteChanged=void 0,e.onSubscribedQualityUpdate=void 0,e.onTokenRefresh=void 0,e.onTrickle=void 0,e.onClose=void 0},this.log=Lr((t=r.loggerName)!==null&&t!==void 0?t:Wi.Signal),this.loggerContextCb=r.loggerContextCb,this.useJSON=n,this.requestQueue=new L9,this.queuedRequests=[],this.closingLock=new bi,this.connectionLock=new bi,this.state=Jt.DISCONNECTED}return ft(i,[{key:"currentState",get:function(){return this.state}},{key:"isDisconnected",get:function(){return this.state===Jt.DISCONNECTING||this.state===Jt.DISCONNECTED}},{key:"isEstablishingConnection",get:function(){return this.state===Jt.CONNECTING||this.state===Jt.RECONNECTING}},{key:"getNextRequestId",value:function(){return this._requestId+=1,this._requestId}},{key:"logContext",get:function(){var e,t;return(t=(e=this.loggerContextCb)===null||e===void 0?void 0:e.call(this))!==null&&t!==void 0?t:{}}},{key:"join",value:function(e,t,n,r){return he(this,void 0,void 0,L().mark(function s(){var a;return L().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return this.state=Jt.CONNECTING,this.options=n,o.next=4,this.connect(e,t,n,r);case 4:return a=o.sent,o.abrupt("return",a);case 6:case"end":return o.stop()}},s,this)}))}},{key:"reconnect",value:function(e,t,n,r){return he(this,void 0,void 0,L().mark(function s(){var a;return L().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(this.options){o.next=3;break}return this.log.warn("attempted to reconnect without signal options being set, ignoring",this.logContext),o.abrupt("return");case 3:return this.state=Jt.RECONNECTING,this.clearPingInterval(),o.next=7,this.connect(e,t,Object.assign(Object.assign({},this.options),{reconnect:!0,sid:n,reconnectReason:r}));case 7:return a=o.sent,o.abrupt("return",a);case 9:case"end":return o.stop()}},s,this)}))}},{key:"connect",value:function(e,t,n,r){var s=this;this.connectOptions=n,e=(e=function(u){return u.startsWith("http")?u.replace(/^(http)/,"ws"):u}(e)).replace(/\/$/,""),e+="/rtc";var a,o,c=function(u,d,h){var b,v=new URLSearchParams;return v.set("access_token",u),h.reconnect&&(v.set("reconnect","1"),h.sid&&v.set("sid",h.sid)),v.set("auto_subscribe",h.autoSubscribe?"1":"0"),v.set("sdk",Ur()?"reactnative":"js"),v.set("version",d.version),v.set("protocol",d.protocol.toString()),d.deviceModel&&v.set("device_model",d.deviceModel),d.os&&v.set("os",d.os),d.osVersion&&v.set("os_version",d.osVersion),d.browser&&v.set("browser",d.browser),d.browserVersion&&v.set("browser_version",d.browserVersion),h.adaptiveStream&&v.set("adaptive_stream","1"),h.reconnectReason&&v.set("reconnect_reason",h.reconnectReason.toString()),!((b=navigator.connection)===null||b===void 0)&&b.type&&v.set("network",navigator.connection.type),"?".concat(v.toString())}(t,(o=new HM({sdk:kk.JS,protocol:15,version:"2.5.9"}),Ur()&&(o.os=(a=BT())!==null&&a!==void 0?a:""),o),n);return new Promise(function(u,d){return he(s,void 0,void 0,L().mark(function h(){var b,v,y,p=this;return L().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:return f.next=2,this.connectionLock.lock();case 2:if(b=f.sent,f.prev=3,v=function(){return he(p,void 0,void 0,L().mark(function m(){return L().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:this.close(),clearTimeout(y),d(new zt("room connection has been cancelled (signal)"));case 3:case"end":return _.stop()}},m,this)}))},y=setTimeout(function(){p.close(),d(new zt("room connection has timed out (signal)"))},n.websocketTimeout),r!=null&&r.aborted&&v(),r==null||r.addEventListener("abort",v),this.log.debug("connecting to ".concat(e+c),this.logContext),!this.ws){f.next=12;break}return f.next=12,this.close(!1);case 12:this.ws=new WebSocket(e+c),this.ws.binaryType="arraybuffer",this.ws.onopen=function(){clearTimeout(y)},this.ws.onerror=function(m){return he(p,void 0,void 0,L().mark(function _(){var k,D;return L().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:if(this.state===Jt.CONNECTED){E.next=21;break}return this.state=Jt.DISCONNECTED,clearTimeout(y),E.prev=3,E.next=6,fetch("http".concat(e.substring(2),"/validate").concat(c));case 6:if(!(k=E.sent).status.toFixed(0).startsWith("4")){E.next=14;break}return E.next=10,k.text();case 10:D=E.sent,d(new zt(D,$n.NotAllowed,k.status)),E.next=15;break;case 14:d(new zt("Internal error",$n.InternalError,k.status));case 15:E.next=20;break;case 17:E.prev=17,E.t0=E.catch(3),d(new zt("server was not reachable",$n.ServerUnreachable));case 20:return E.abrupt("return");case 21:this.handleWSError(m);case 22:case"end":return E.stop()}},_,this,[[3,17]])}))},this.ws.onmessage=function(m){return he(p,void 0,void 0,L().mark(function _(){var k,D,E,A,w,N;return L().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:if(typeof m.data!="string"){S.next=5;break}w=JSON.parse(m.data),A=xk.fromJson(w,{ignoreUnknownFields:!0}),S.next=11;break;case 5:if(!(m.data instanceof ArrayBuffer)){S.next=9;break}A=xk.fromBinary(new Uint8Array(m.data)),S.next=11;break;case 9:return this.log.error("could not decode websocket message: ".concat(et(m.data)),this.logContext),S.abrupt("return");case 11:if(this.state===Jt.CONNECTED){S.next=16;break}if(N=!1,((k=A.message)===null||k===void 0?void 0:k.case)==="join"?(this.state=Jt.CONNECTED,r==null||r.removeEventListener("abort",v),this.pingTimeoutDuration=A.message.value.pingTimeout,this.pingIntervalDuration=A.message.value.pingInterval,this.pingTimeoutDuration&&this.pingTimeoutDuration>0&&(this.log.debug("ping config",Object.assign(Object.assign({},this.logContext),{timeout:this.pingTimeoutDuration,interval:this.pingIntervalDuration})),this.startPingInterval()),u(A.message.value)):this.state===Jt.RECONNECTING&&A.message.case!=="leave"?(this.state=Jt.CONNECTED,r==null||r.removeEventListener("abort",v),this.startPingInterval(),((D=A.message)===null||D===void 0?void 0:D.case)==="reconnect"?u(A.message.value):(this.log.debug("declaring signal reconnected without reconnect response received",this.logContext),u(void 0),N=!0)):this.isEstablishingConnection&&A.message.case==="leave"?d(new zt("Received leave request while trying to (re)connect",$n.LeaveRequest)):n.reconnect||d(new zt("did not receive join response, got ".concat((E=A.message)===null||E===void 0?void 0:E.case," instead"))),N){S.next=16;break}return S.abrupt("return");case 16:if(!this.signalLatency){S.next=19;break}return S.next=19,vr(this.signalLatency);case 19:this.handleSignalResponse(A);case 20:case"end":return S.stop()}},_,this)}))},this.ws.onclose=function(m){p.isEstablishingConnection&&d(new zt("Websocket got closed during a (re)connection attempt")),p.log.warn("websocket closed",Object.assign(Object.assign({},p.logContext),{reason:m.reason,code:m.code,wasClean:m.wasClean,state:p.state})),p.handleOnClose(m.reason)};case 18:return f.prev=18,b(),f.finish(18);case 21:case"end":return f.stop()}},h,this,[[3,,18,21]])}))})}},{key:"close",value:function(){return he(this,arguments,void 0,function(){var e=this,t=0>=arguments.length||arguments[0]===void 0||arguments[0];return L().mark(function n(){var r,s;return L().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,e.closingLock.lock();case 2:if(r=a.sent,a.prev=3,e.clearPingInterval(),t&&(e.state=Jt.DISCONNECTING),!e.ws){a.next=16;break}if(e.ws.onmessage=null,e.ws.onopen=null,e.ws.onclose=null,s=new Promise(function(o){e.ws?e.ws.onclose=function(){o()}:o()}),e.ws.readyState>=e.ws.CLOSING){a.next=15;break}return e.ws.close(),a.next=15,Promise.race([s,vr(250)]);case 15:e.ws=void 0;case 16:return a.prev=16,t&&(e.state=Jt.DISCONNECTED),r(),a.finish(16);case 20:case"end":return a.stop()}},n,null,[[3,,16,20]])})()})}},{key:"sendOffer",value:function(e){this.log.debug("sending offer",Object.assign(Object.assign({},this.logContext),{offerSdp:e.sdp})),this.sendRequest({case:"offer",value:xd(e)})}},{key:"sendAnswer",value:function(e){return this.log.debug("sending answer",Object.assign(Object.assign({},this.logContext),{answerSdp:e.sdp})),this.sendRequest({case:"answer",value:xd(e)})}},{key:"sendIceCandidate",value:function(e,t){return this.log.trace("sending ice candidate",Object.assign(Object.assign({},this.logContext),{candidate:e})),this.sendRequest({case:"trickle",value:new fm({candidateInit:JSON.stringify(e),target:t})})}},{key:"sendMuteTrack",value:function(e,t){return this.sendRequest({case:"mute",value:new pm({sid:e,muted:t})})}},{key:"sendAddTrack",value:function(e){return this.sendRequest({case:"addTrack",value:e})}},{key:"sendUpdateLocalMetadata",value:function(e,t){return he(this,arguments,void 0,function(n,r){var s=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return L().mark(function o(){var c;return L().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return c=s.getNextRequestId(),u.next=3,s.sendRequest({case:"updateMetadata",value:new Ak({requestId:c,metadata:n,name:r,attributes:a})});case 3:return u.abrupt("return",c);case 4:case"end":return u.stop()}},o)})()})}},{key:"sendUpdateTrackSettings",value:function(e){this.sendRequest({case:"trackSetting",value:e})}},{key:"sendUpdateSubscription",value:function(e){return this.sendRequest({case:"subscription",value:e})}},{key:"sendSyncState",value:function(e){return this.sendRequest({case:"syncState",value:e})}},{key:"sendUpdateVideoLayers",value:function(e,t){return this.sendRequest({case:"updateLayers",value:new Dk({trackSid:e,layers:t})})}},{key:"sendUpdateSubscriptionPermissions",value:function(e,t){return this.sendRequest({case:"subscriptionPermission",value:new Pk({allParticipants:e,trackPermissions:t})})}},{key:"sendSimulateScenario",value:function(e){return this.sendRequest({case:"simulate",value:e})}},{key:"sendPing",value:function(){return Promise.all([this.sendRequest({case:"ping",value:qt.parse(Date.now())}),this.sendRequest({case:"pingReq",value:new Rk({timestamp:qt.parse(Date.now()),rtt:qt.parse(this.rtt)})})])}},{key:"sendUpdateLocalAudioTrack",value:function(e,t){return this.sendRequest({case:"updateAudioTrack",value:new wk({trackSid:e,features:t})})}},{key:"sendLeave",value:function(){return this.sendRequest({case:"leave",value:new ud({reason:to.CLIENT_INITIATED,action:ro.DISCONNECT})})}},{key:"sendRequest",value:function(e){return he(this,arguments,void 0,function(t){var n=this,r=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return L().mark(function s(){var a;return L().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(!(!r&&!U9(t))||n.state!==Jt.RECONNECTING){o.next=4;break}return n.queuedRequests.push(function(){return he(n,void 0,void 0,L().mark(function c(){return L().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.next=2,this.sendRequest(t,!0);case 2:case"end":return u.stop()}},c,this)}))}),o.abrupt("return");case 4:if(r){o.next=7;break}return o.next=7,n.requestQueue.flush();case 7:if(!n.signalLatency){o.next=10;break}return o.next=10,vr(n.signalLatency);case 10:if(n.ws&&n.ws.readyState===n.ws.OPEN){o.next=13;break}return n.log.error("cannot send signal request before connected, type: ".concat(t==null?void 0:t.case),n.logContext),o.abrupt("return");case 13:a=new GM({message:t});try{n.useJSON?n.ws.send(a.toJsonString()):n.ws.send(a.toBinary())}catch(c){n.log.error("error sending signal message",Object.assign(Object.assign({},n.logContext),{error:c}))}case 15:case"end":return o.stop()}},s)})()})}},{key:"handleSignalResponse",value:function(e){var t,n,r=e.message;if(r!=null){var s=!1;if(r.case==="answer"){var a=qT(r.value);this.onAnswer&&this.onAnswer(a)}else if(r.case==="offer"){var o=qT(r.value);this.onOffer&&this.onOffer(o)}else if(r.case==="trickle"){var c=JSON.parse(r.value.candidateInit);this.onTrickle&&this.onTrickle(c,r.value.target)}else r.case==="update"?this.onParticipantUpdate&&this.onParticipantUpdate((t=r.value.participants)!==null&&t!==void 0?t:[]):r.case==="trackPublished"?this.onLocalTrackPublished&&this.onLocalTrackPublished(r.value):r.case==="speakersChanged"?this.onSpeakersChanged&&this.onSpeakersChanged((n=r.value.speakers)!==null&&n!==void 0?n:[]):r.case==="leave"?this.onLeave&&this.onLeave(r.value):r.case==="mute"?this.onRemoteMuteChanged&&this.onRemoteMuteChanged(r.value.sid,r.value.muted):r.case==="roomUpdate"?this.onRoomUpdate&&r.value.room&&this.onRoomUpdate(r.value.room):r.case==="connectionQuality"?this.onConnectionQuality&&this.onConnectionQuality(r.value):r.case==="streamStateUpdate"?this.onStreamStateUpdate&&this.onStreamStateUpdate(r.value):r.case==="subscribedQualityUpdate"?this.onSubscribedQualityUpdate&&this.onSubscribedQualityUpdate(r.value):r.case==="subscriptionPermissionUpdate"?this.onSubscriptionPermissionUpdate&&this.onSubscriptionPermissionUpdate(r.value):r.case==="refreshToken"?this.onTokenRefresh&&this.onTokenRefresh(r.value):r.case==="trackUnpublished"?this.onLocalTrackUnpublished&&this.onLocalTrackUnpublished(r.value):r.case==="subscriptionResponse"?this.onSubscriptionError&&this.onSubscriptionError(r.value):r.case==="pong"||(r.case==="pongResp"?(this.rtt=Date.now()-Number.parseInt(r.value.lastPingTimestamp.toString()),this.resetPingTimeout(),s=!0):r.case==="requestResponse"?this.onRequestResponse&&this.onRequestResponse(r.value):r.case==="trackSubscribed"?this.onLocalTrackSubscribed&&this.onLocalTrackSubscribed(r.value.trackSid):this.log.debug("unsupported message",Object.assign(Object.assign({},this.logContext),{msgCase:r.case})));s||this.resetPingTimeout()}else this.log.debug("received unsupported message",this.logContext)}},{key:"setReconnected",value:function(){for(;this.queuedRequests.length>0;){var e=this.queuedRequests.shift();e&&this.requestQueue.run(e)}}},{key:"handleOnClose",value:function(e){return he(this,void 0,void 0,L().mark(function t(){var n;return L().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(this.state!==Jt.DISCONNECTED){r.next=2;break}return r.abrupt("return");case 2:return n=this.onClose,r.next=5,this.close();case 5:this.log.debug("websocket connection closed: ".concat(e),Object.assign(Object.assign({},this.logContext),{reason:e})),n&&n(e);case 7:case"end":return r.stop()}},t,this)}))}},{key:"handleWSError",value:function(e){this.log.error("websocket error",Object.assign(Object.assign({},this.logContext),{error:e}))}},{key:"resetPingTimeout",value:function(){var e=this;this.clearPingTimeout(),this.pingTimeoutDuration?this.pingTimeout=Nn.setTimeout(function(){e.log.warn("ping timeout triggered. last pong received at: ".concat(new Date(Date.now()-1e3*e.pingTimeoutDuration).toUTCString()),e.logContext),e.handleOnClose("ping timeout")},1e3*this.pingTimeoutDuration):this.log.warn("ping timeout duration not set",this.logContext)}},{key:"clearPingTimeout",value:function(){this.pingTimeout&&Nn.clearTimeout(this.pingTimeout)}},{key:"startPingInterval",value:function(){var e=this;this.clearPingInterval(),this.resetPingTimeout(),this.pingIntervalDuration?(this.log.debug("start ping interval",this.logContext),this.pingInterval=Nn.setInterval(function(){e.sendPing()},1e3*this.pingIntervalDuration)):this.log.warn("ping interval duration not set",this.logContext)}},{key:"clearPingInterval",value:function(){this.log.debug("clearing ping interval",this.logContext),this.clearPingTimeout(),this.pingInterval&&Nn.clearInterval(this.pingInterval)}}]),i}();function qT(i){var e={type:"offer",sdp:i.sdp};switch(i.type){case"answer":case"offer":case"pranswer":case"rollback":e.type=i.type;break}return e}function xd(i){return new Xs({sdp:i.sdp,type:i.type})}var zT,GT,qm,WT,KT,br={},XT={},zm={exports:{}};function YT(){if(zT)return zm.exports;zT=1;var i=zm.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(e){return e.encoding?"rtpmap:%d %s/%s/%s":e.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(e){return e.address!=null?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(e){return e.subtype!=null?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(e){return"extmap:%d"+(e.direction?"/%s":"%v")+(e["encrypt-uri"]?" %s":"%v")+" %s"+(e.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(e){return e.sessionConfig!=null?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(e){var t="candidate:%s %d %s %d %s %d typ %s";return t+=e.raddr!=null?" raddr %s rport %d":"%v%v",t+=e.tcptype!=null?" tcptype %s":"%v",e.generation!=null&&(t+=" generation %d"),t+=e["network-id"]!=null?" network-id %d":"%v",t+=e["network-cost"]!=null?" network-cost %d":"%v"}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(e){var t="ssrc:%d";return e.attribute!=null&&(t+=" %s",e.value!=null&&(t+=":%s")),t}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(e){return e.maxMessageSize!=null?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(e){return e.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(e){return"imageattr:%s %s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(e){return"simulcast:%s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(e){return"ts-refclk:%s"+(e.clksrcExt!=null?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(e){var t="mediaclk:";return t+=e.id!=null?"id=%s %s":"%v%s",t+=e.mediaClockValue!=null?"=%s":"",t+=e.rateNumerator!=null?" rate=%s":"",t+=e.rateDenominator!=null?"/%s":""}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};return Object.keys(i).forEach(function(e){i[e].forEach(function(t){t.reg||(t.reg=/(.*)/),t.format||(t.format="%s")})}),zm.exports}function V9(){return GT||(GT=1,function(i){var e=function(a){return String(Number(a))===a?Number(a):a},t=function(a,o,c){var u=a.name&&a.names;a.push&&!o[a.push]?o[a.push]=[]:u&&!o[a.name]&&(o[a.name]={});var d=a.push?{}:u?o[a.name]:o;(function(h,b,v,y){if(y&&!v)b[y]=e(h[1]);else for(var p=0;p<v.length;p+=1)h[p+1]!=null&&(b[v[p]]=e(h[p+1]))})(c.match(a.reg),d,a.names,a.name),a.push&&o[a.push].push(d)},n=YT(),r=RegExp.prototype.test.bind(/^([a-z])=(.*)/);i.parse=function(a){var o={},c=[],u=o;return a.split(/(\r\n|\r|\n)/).filter(r).forEach(function(d){var h=d[0],b=d.slice(2);h==="m"&&(c.push({rtp:[],fmtp:[]}),u=c[c.length-1]);for(var v=0;v<(n[h]||[]).length;v+=1){var y=n[h][v];if(y.reg.test(b))return t(y,u,b)}}),o.media=c,o};var s=function(a,o){var c=o.split(/=(.+)/,2);return c.length===2?a[c[0]]=e(c[1]):c.length===1&&o.length>1&&(a[c[0]]=void 0),a};i.parseParams=function(a){return a.split(/;\s?/).reduce(s,{})},i.parseFmtpConfig=i.parseParams,i.parsePayloads=function(a){return a.toString().split(" ").map(Number)},i.parseRemoteCandidates=function(a){for(var o=[],c=a.split(" ").map(e),u=0;u<c.length;u+=3)o.push({component:c[u],ip:c[u+1],port:c[u+2]});return o},i.parseImageAttributes=function(a){return a.split(" ").map(function(o){return o.substring(1,o.length-1).split(",").reduce(s,{})})},i.parseSimulcastStreamList=function(a){return a.split(";").map(function(o){return o.split(",").map(function(c){var u,d=!1;return c[0]!=="~"?u=e(c):(u=e(c.substring(1,c.length)),d=!0),{scid:u,paused:d}})})}}(XT)),XT}function j9(){if(WT)return qm;WT=1;var i=YT(),e=/%[sdv%]/g,t=function(a){var o=1,c=arguments,u=c.length;return a.replace(e,function(d){if(o>=u)return d;var h=c[o];switch(o+=1,d){case"%%":return"%";case"%s":return String(h);case"%d":return Number(h);case"%v":return""}})},n=function(a,o,c){var u=[a+"="+(o.format instanceof Function?o.format(o.push?c:c[o.name]):o.format)];if(o.names)for(var d=0;d<o.names.length;d+=1){var h=o.names[d];o.name?u.push(c[o.name][h]):u.push(c[o.names[d]])}else u.push(c[o.name]);return t.apply(null,u)},r=["v","o","s","i","u","e","p","c","b","t","r","z","a"],s=["i","c","b","a"];return qm=function(a,o){o=o||{},a.version==null&&(a.version=0),a.name==null&&(a.name=" "),a.media.forEach(function(h){h.payloads==null&&(h.payloads="")});var c=o.outerOrder||r,u=o.innerOrder||s,d=[];return c.forEach(function(h){i[h].forEach(function(b){b.name in a&&a[b.name]!=null?d.push(n(h,b,a)):b.push in a&&a[b.push]!=null&&a[b.push].forEach(function(v){d.push(n(h,b,v))})})}),a.media.forEach(function(h){d.push(n("m",i.m[0],h)),u.forEach(function(b){i[b].forEach(function(v){v.name in h&&h[v.name]!=null?d.push(n(b,v,h)):v.push in h&&h[v.push]!=null&&h[v.push].forEach(function(y){d.push(n(b,v,y))})})})}),d.join(`\r
|
323
|
+
`)+`\r
|
324
|
+
`},qm}var ps=function(){if(KT)return br;KT=1;var i=V9(),e=j9();return br.write=e,br.parse=i.parse,br.parseParams=i.parseParams,br.parseFmtpConfig=i.parseFmtpConfig,br.parsePayloads=i.parsePayloads,br.parseRemoteCandidates=i.parseRemoteCandidates,br.parseImageAttributes=i.parseImageAttributes,br.parseSimulcastStreamList=i.parseSimulcastStreamList,br}(),JT="negotiationStarted",QT="negotiationComplete",ZT="rtpVideoPayloadTypes",eS=function(i){function e(t){var n;ht(this,e);var r,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return(n=Rt(this,e)).log=Ct,n.pendingCandidates=[],n.restartingIce=!1,n.renegotiate=!1,n.trackBitrates=[],n.remoteStereoMids=[],n.remoteNackMids=[],n.negotiate=Am(function(a){return he(ct(n),void 0,void 0,L().mark(function o(){return L().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return this.emit(JT),c.prev=1,c.next=4,this.createAndSendOffer();case 4:c.next=13;break;case 6:if(c.prev=6,c.t0=c.catch(1),!a){c.next=12;break}a(c.t0),c.next=13;break;case 12:throw c.t0;case 13:case"end":return c.stop()}},o,this,[[1,6]])}))},20),n.close=function(){n._pc&&(n._pc.close(),n._pc.onconnectionstatechange=null,n._pc.oniceconnectionstatechange=null,n._pc.onicegatheringstatechange=null,n._pc.ondatachannel=null,n._pc.onnegotiationneeded=null,n._pc.onsignalingstatechange=null,n._pc.onicecandidate=null,n._pc.ondatachannel=null,n._pc.ontrack=null,n._pc.onconnectionstatechange=null,n._pc.oniceconnectionstatechange=null,n._pc=null)},n.log=Lr((r=s.loggerName)!==null&&r!==void 0?r:Wi.PCTransport),n.loggerOptions=s,n.config=t,n._pc=n.createPC(),n}return Lt(e,Ys.EventEmitter),ft(e,[{key:"pc",get:function(){return this._pc||(this._pc=this.createPC()),this._pc}},{key:"createPC",value:function(){var t=this,n=new RTCPeerConnection(this.config);return n.onicecandidate=function(r){var s;r.candidate&&((s=t.onIceCandidate)===null||s===void 0||s.call(t,r.candidate))},n.onicecandidateerror=function(r){var s;(s=t.onIceCandidateError)===null||s===void 0||s.call(t,r)},n.oniceconnectionstatechange=function(){var r;(r=t.onIceConnectionStateChange)===null||r===void 0||r.call(t,n.iceConnectionState)},n.onsignalingstatechange=function(){var r;(r=t.onSignalingStatechange)===null||r===void 0||r.call(t,n.signalingState)},n.onconnectionstatechange=function(){var r;(r=t.onConnectionStateChange)===null||r===void 0||r.call(t,n.connectionState)},n.ondatachannel=function(r){var s;(s=t.onDataChannel)===null||s===void 0||s.call(t,r)},n.ontrack=function(r){var s;(s=t.onTrack)===null||s===void 0||s.call(t,r)},n}},{key:"logContext",get:function(){var t,n;return Object.assign({},(n=(t=this.loggerOptions).loggerContextCb)===null||n===void 0?void 0:n.call(t))}},{key:"isICEConnected",get:function(){return this._pc!==null&&(this.pc.iceConnectionState==="connected"||this.pc.iceConnectionState==="completed")}},{key:"addIceCandidate",value:function(t){return he(this,void 0,void 0,L().mark(function n(){return L().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!this.pc.remoteDescription||this.restartingIce){r.next=2;break}return r.abrupt("return",this.pc.addIceCandidate(t));case 2:this.pendingCandidates.push(t);case 3:case"end":return r.stop()}},n,this)}))}},{key:"setRemoteDescription",value:function(t){return he(this,void 0,void 0,L().mark(function n(){var r,s,a,o,c,u,d=this;return L().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return s=void 0,t.type==="offer"?(a=H9(t),o=a.stereoMids,c=a.nackMids,this.remoteStereoMids=o,this.remoteNackMids=c):t.type==="answer"&&((u=ps.parse((r=t.sdp)!==null&&r!==void 0?r:"")).media.forEach(function(b){b.type==="audio"&&d.trackBitrates.some(function(v){if(!v.transceiver||b.mid!=v.transceiver.mid)return!1;var y=0;if(b.rtp.some(function(k){return k.codec.toUpperCase()===v.codec.toUpperCase()&&(y=k.payload,!0)}),y===0)return!0;var p,f=!1,m=dt(b.fmtp);try{for(m.s();!(p=m.n()).done;){var _=p.value;if(_.payload===y){_.config=_.config.split(";").filter(function(k){return!k.includes("maxaveragebitrate")}).join(";"),v.maxbr>0&&(_.config+=";maxaveragebitrate=".concat(1e3*v.maxbr)),f=!0;break}}}catch(k){m.e(k)}finally{m.f()}return f||v.maxbr>0&&b.fmtp.push({payload:y,config:"maxaveragebitrate=".concat(1e3*v.maxbr)}),!0})}),s=ps.write(u)),h.next=4,this.setMungedSDP(t,s,!0);case 4:if(this.pendingCandidates.forEach(function(b){d.pc.addIceCandidate(b)}),this.pendingCandidates=[],this.restartingIce=!1,!this.renegotiate){h.next=13;break}return this.renegotiate=!1,h.next=11,this.createAndSendOffer();case 11:h.next=14;break;case 13:t.type==="answer"&&(this.emit(QT),t.sdp&&ps.parse(t.sdp).media.forEach(function(b){b.type==="video"&&d.emit(ZT,b.rtp)}));case 14:case"end":return h.stop()}},n,this)}))}},{key:"createAndSendOffer",value:function(t){return he(this,void 0,void 0,L().mark(function n(){var r,s,a,o,c=this;return L().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(this.onOffer!==void 0){u.next=2;break}return u.abrupt("return");case 2:if(t!=null&&t.iceRestart&&(this.log.debug("restarting ICE",this.logContext),this.restartingIce=!0),!this._pc||this._pc.signalingState!=="have-local-offer"){u.next=14;break}if(s=this._pc.remoteDescription,!(t!=null&&t.iceRestart)||!s){u.next=10;break}return u.next=8,this._pc.setRemoteDescription(s);case 8:u.next=12;break;case 10:return this.renegotiate=!0,u.abrupt("return");case 12:u.next=17;break;case 14:if(this._pc&&this._pc.signalingState!=="closed"){u.next=17;break}return this.log.warn("could not createOffer with closed peer connection",this.logContext),u.abrupt("return");case 17:return this.log.debug("starting to negotiate",this.logContext),u.next=20,this.pc.createOffer(t);case 20:return a=u.sent,this.log.debug("original offer",Object.assign({sdp:a.sdp},this.logContext)),(o=ps.parse((r=a.sdp)!==null&&r!==void 0?r:"")).media.forEach(function(d){d.type==="audio"?tS(d,[],[]):d.type==="video"&&c.trackBitrates.some(function(h){if(!d.msid||!h.cid||!d.msid.includes(h.cid))return!1;var b=0;if(d.rtp.some(function(m){return m.codec.toUpperCase()===h.codec.toUpperCase()&&(b=m.payload,!0)}),b===0||(Bl(h.codec)&&$9(d),h.codec!=="av1"))return!0;var v,y=Math.round(.7*h.maxbr),p=dt(d.fmtp);try{for(p.s();!(v=p.n()).done;){var f=v.value;if(f.payload===b){f.config.includes("x-google-start-bitrate")||(f.config+=";x-google-start-bitrate=".concat(y));break}}}catch(m){p.e(m)}finally{p.f()}return!0})}),u.next=26,this.setMungedSDP(a,ps.write(o));case 26:this.onOffer(a);case 27:case"end":return u.stop()}},n,this)}))}},{key:"createAndSetAnswer",value:function(){return he(this,void 0,void 0,L().mark(function t(){var n,r,s,a=this;return L().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.pc.createAnswer();case 2:return r=o.sent,(s=ps.parse((n=r.sdp)!==null&&n!==void 0?n:"")).media.forEach(function(c){c.type==="audio"&&tS(c,a.remoteStereoMids,a.remoteNackMids)}),o.next=7,this.setMungedSDP(r,ps.write(s));case 7:return o.abrupt("return",r);case 8:case"end":return o.stop()}},t,this)}))}},{key:"createDataChannel",value:function(t,n){return this.pc.createDataChannel(t,n)}},{key:"addTransceiver",value:function(t,n){return this.pc.addTransceiver(t,n)}},{key:"addTrack",value:function(t){if(!this._pc)throw new vn("PC closed, cannot add track");return this._pc.addTrack(t)}},{key:"setTrackCodecBitrate",value:function(t){this.trackBitrates.push(t)}},{key:"setConfiguration",value:function(t){var n;if(!this._pc)throw new vn("PC closed, cannot configure");return(n=this._pc)===null||n===void 0?void 0:n.setConfiguration(t)}},{key:"canRemoveTrack",value:function(){var t;return!!(!((t=this._pc)===null||t===void 0)&&t.removeTrack)}},{key:"removeTrack",value:function(t){var n;return(n=this._pc)===null||n===void 0?void 0:n.removeTrack(t)}},{key:"getConnectionState",value:function(){var t,n;return(n=(t=this._pc)===null||t===void 0?void 0:t.connectionState)!==null&&n!==void 0?n:"closed"}},{key:"getICEConnectionState",value:function(){var t,n;return(n=(t=this._pc)===null||t===void 0?void 0:t.iceConnectionState)!==null&&n!==void 0?n:"closed"}},{key:"getSignallingState",value:function(){var t,n;return(n=(t=this._pc)===null||t===void 0?void 0:t.signalingState)!==null&&n!==void 0?n:"closed"}},{key:"getTransceivers",value:function(){var t,n;return(n=(t=this._pc)===null||t===void 0?void 0:t.getTransceivers())!==null&&n!==void 0?n:[]}},{key:"getSenders",value:function(){var t,n;return(n=(t=this._pc)===null||t===void 0?void 0:t.getSenders())!==null&&n!==void 0?n:[]}},{key:"getLocalDescription",value:function(){var t;return(t=this._pc)===null||t===void 0?void 0:t.localDescription}},{key:"getRemoteDescription",value:function(){var t;return(t=this.pc)===null||t===void 0?void 0:t.remoteDescription}},{key:"getStats",value:function(){return this.pc.getStats()}},{key:"getConnectedAddress",value:function(){return he(this,void 0,void 0,L().mark(function t(){var n,r,s,a,o;return L().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(this._pc){c.next=2;break}return c.abrupt("return");case 2:return r="",s=new Map,a=new Map,c.next=7,this._pc.getStats();case 7:if(c.sent.forEach(function(u){switch(u.type){case"transport":r=u.selectedCandidatePairId;break;case"candidate-pair":r===""&&u.selected&&(r=u.id),s.set(u.id,u);break;case"remote-candidate":a.set(u.id,"".concat(u.address,":").concat(u.port));break}}),r!==""){c.next=11;break}return c.abrupt("return",void 0);case 11:if((o=(n=s.get(r))===null||n===void 0?void 0:n.remoteCandidateId)!==void 0){c.next=14;break}return c.abrupt("return",void 0);case 14:return c.abrupt("return",a.get(o));case 15:case"end":return c.stop()}},t,this)}))}},{key:"setMungedSDP",value:function(t,n,r){return he(this,void 0,void 0,L().mark(function s(){var a,o,c;return L().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(!n){u.next=19;break}if(a=t.sdp,t.sdp=n,u.prev=3,this.log.debug("setting munged ".concat(r?"remote":"local"," description"),this.logContext),!r){u.next=10;break}return u.next=8,this.pc.setRemoteDescription(t);case 8:u.next=12;break;case 10:return u.next=12,this.pc.setLocalDescription(t);case 12:return u.abrupt("return");case 15:u.prev=15,u.t0=u.catch(3),this.log.warn("not able to set ".concat(t.type,", falling back to unmodified sdp"),Object.assign(Object.assign({},this.logContext),{error:u.t0,sdp:n})),t.sdp=a;case 19:if(u.prev=19,!r){u.next=25;break}return u.next=23,this.pc.setRemoteDescription(t);case 23:u.next=27;break;case 25:return u.next=27,this.pc.setLocalDescription(t);case 27:u.next=37;break;case 29:throw u.prev=29,u.t1=u.catch(19),o="unknown error",u.t1 instanceof Error?o=u.t1.message:typeof u.t1=="string"&&(o=u.t1),c={error:o,sdp:t.sdp},!r&&this.pc.remoteDescription&&(c.remoteSdp=this.pc.remoteDescription),this.log.error("unable to set ".concat(t.type),Object.assign(Object.assign({},this.logContext),{fields:c})),new Dm(o);case 37:case"end":return u.stop()}},s,this,[[3,15],[19,29]])}))}}]),e}();function tS(i,e,t){var n=0;i.rtp.some(function(r){return r.codec==="opus"&&(n=r.payload,!0)}),n>0&&(i.rtcpFb||(i.rtcpFb=[]),t.includes(i.mid)&&!i.rtcpFb.some(function(r){return r.payload===n&&r.type==="nack"})&&i.rtcpFb.push({payload:n,type:"nack"}),e.includes(i.mid)&&i.fmtp.some(function(r){return r.payload===n&&(r.config.includes("stereo=1")||(r.config+=";stereo=1"),!0)}))}function $9(i){var e,t,n=0;!((e=i.ext)===null||e===void 0)&&e.some(function(r){return r.uri===MT||(r.value>n&&(n=r.value),!1)})||(t=i.ext)===null||t===void 0||t.push({value:n+1,uri:MT})}function H9(i){var e,t=[],n=[],r=ps.parse((e=i.sdp)!==null&&e!==void 0?e:""),s=0;return r.media.forEach(function(a){var o;a.type==="audio"&&(a.rtp.some(function(c){return c.codec==="opus"&&(s=c.payload,!0)}),!((o=a.rtcpFb)===null||o===void 0)&&o.some(function(c){return c.payload===s&&c.type==="nack"})&&n.push(a.mid),a.fmtp.some(function(c){return c.payload===s&&(c.config.includes("sprop-stereo=1")&&t.push(a.mid),!0)}))}),{stereoMids:t,nackMids:n}}var ln,Gm="vp8",q9={audioPreset:Pm.music,dtx:!0,red:!0,forceStereo:!1,simulcast:!0,screenShareEncoding:Mm.h1080fps15.encoding,stopMicTrackOnMute:!1,videoCodec:Gm,backupCodec:!0},nS={autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0},iS={resolution:Rl.h720.resolution},z9={adaptiveStream:!1,dynacast:!1,stopLocalTrackOnUnpublish:!0,reconnectPolicy:new g9,disconnectOnPageLeave:!0,webAudioMix:!1},Wm={autoSubscribe:!0,maxRetries:1,peerConnectionTimeout:15e3,websocketTimeout:15e3};(function(i){i[i.NEW=0]="NEW",i[i.CONNECTING=1]="CONNECTING",i[i.CONNECTED=2]="CONNECTED",i[i.FAILED=3]="FAILED",i[i.CLOSING=4]="CLOSING",i[i.CLOSED=5]="CLOSED"})(ln||(ln={}));var G9=function(){function i(e,t,n){var r,s=this;ht(this,i),this.peerConnectionTimeout=Wm.peerConnectionTimeout,this.log=Ct,this.updateState=function(){var a,o=s.state,c=s.requiredTransports.map(function(u){return u.getConnectionState()});c.every(function(u){return u==="connected"})?s.state=ln.CONNECTED:c.some(function(u){return u==="failed"})?s.state=ln.FAILED:c.some(function(u){return u==="connecting"})?s.state=ln.CONNECTING:c.every(function(u){return u==="closed"})?s.state=ln.CLOSED:c.some(function(u){return u==="closed"})?s.state=ln.CLOSING:c.every(function(u){return u==="new"})&&(s.state=ln.NEW),o!==s.state&&(s.log.debug("pc state change: from ".concat(ln[o]," to ").concat(ln[s.state]),s.logContext),(a=s.onStateChange)===null||a===void 0||a.call(s,s.state,s.publisher.getConnectionState(),s.subscriber.getConnectionState()))},this.log=Lr((r=n.loggerName)!==null&&r!==void 0?r:Wi.PCManager),this.loggerOptions=n,this.isPublisherConnectionRequired=!t,this.isSubscriberConnectionRequired=t,this.publisher=new eS(e,n),this.subscriber=new eS(e,n),this.publisher.onConnectionStateChange=this.updateState,this.subscriber.onConnectionStateChange=this.updateState,this.publisher.onIceConnectionStateChange=this.updateState,this.subscriber.onIceConnectionStateChange=this.updateState,this.publisher.onSignalingStatechange=this.updateState,this.subscriber.onSignalingStatechange=this.updateState,this.publisher.onIceCandidate=function(a){var o;(o=s.onIceCandidate)===null||o===void 0||o.call(s,a,Gi.PUBLISHER)},this.subscriber.onIceCandidate=function(a){var o;(o=s.onIceCandidate)===null||o===void 0||o.call(s,a,Gi.SUBSCRIBER)},this.subscriber.onDataChannel=function(a){var o;(o=s.onDataChannel)===null||o===void 0||o.call(s,a)},this.subscriber.onTrack=function(a){var o;(o=s.onTrack)===null||o===void 0||o.call(s,a)},this.publisher.onOffer=function(a){var o;(o=s.onPublisherOffer)===null||o===void 0||o.call(s,a)},this.state=ln.NEW,this.connectionLock=new bi,this.remoteOfferLock=new bi}return ft(i,[{key:"needsPublisher",get:function(){return this.isPublisherConnectionRequired}},{key:"needsSubscriber",get:function(){return this.isSubscriberConnectionRequired}},{key:"currentState",get:function(){return this.state}},{key:"logContext",get:function(){var e,t;return Object.assign({},(t=(e=this.loggerOptions).loggerContextCb)===null||t===void 0?void 0:t.call(e))}},{key:"requirePublisher",value:function(){var e=0>=arguments.length||arguments[0]===void 0||arguments[0];this.isPublisherConnectionRequired=e,this.updateState()}},{key:"requireSubscriber",value:function(){var e=0>=arguments.length||arguments[0]===void 0||arguments[0];this.isSubscriberConnectionRequired=e,this.updateState()}},{key:"createAndSendPublisherOffer",value:function(e){return this.publisher.createAndSendOffer(e)}},{key:"setPublisherAnswer",value:function(e){return this.publisher.setRemoteDescription(e)}},{key:"removeTrack",value:function(e){return this.publisher.removeTrack(e)}},{key:"close",value:function(){return he(this,void 0,void 0,L().mark(function e(){var t,n,r,s;return L().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(this.publisher&&this.publisher.getSignallingState()!=="closed"){t=this.publisher,n=dt(t.getSenders());try{for(n.s();!(r=n.n()).done;){s=r.value;try{t.canRemoveTrack()&&t.removeTrack(s)}catch(o){this.log.warn("could not removeTrack",Object.assign(Object.assign({},this.logContext),{error:o}))}}}catch(o){n.e(o)}finally{n.f()}}return a.next=3,Promise.all([this.publisher.close(),this.subscriber.close()]);case 3:this.updateState();case 4:case"end":return a.stop()}},e,this)}))}},{key:"triggerIceRestart",value:function(){return he(this,void 0,void 0,L().mark(function e(){return L().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(this.subscriber.restartingIce=!0,!this.needsPublisher){t.next=4;break}return t.next=4,this.createAndSendPublisherOffer({iceRestart:!0});case 4:case"end":return t.stop()}},e,this)}))}},{key:"addIceCandidate",value:function(e,t){return he(this,void 0,void 0,L().mark(function n(){return L().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(t!==Gi.PUBLISHER){r.next=5;break}return r.next=3,this.publisher.addIceCandidate(e);case 3:r.next=7;break;case 5:return r.next=7,this.subscriber.addIceCandidate(e);case 7:case"end":return r.stop()}},n,this)}))}},{key:"createSubscriberAnswerFromOffer",value:function(e){return he(this,void 0,void 0,L().mark(function t(){var n,r;return L().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return this.log.debug("received server offer",Object.assign(Object.assign({},this.logContext),{RTCSdpType:e.type,sdp:e.sdp,signalingState:this.subscriber.getSignallingState().toString()})),s.next=3,this.remoteOfferLock.lock();case 3:return n=s.sent,s.prev=4,s.next=7,this.subscriber.setRemoteDescription(e);case 7:return s.next=9,this.subscriber.createAndSetAnswer();case 9:return r=s.sent,s.abrupt("return",r);case 11:return s.prev=11,n(),s.finish(11);case 14:case"end":return s.stop()}},t,this,[[4,,11,14]])}))}},{key:"updateConfiguration",value:function(e,t){this.publisher.setConfiguration(e),this.subscriber.setConfiguration(e),t&&this.triggerIceRestart()}},{key:"ensurePCTransportConnection",value:function(e,t){return he(this,void 0,void 0,L().mark(function n(){var r,s,a=this;return L().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.connectionLock.lock();case 2:return s=o.sent,o.prev=3,this.isPublisherConnectionRequired&&this.publisher.getConnectionState()!=="connected"&&this.publisher.getConnectionState()!=="connecting"&&(this.log.debug("negotiation required, start negotiating",this.logContext),this.publisher.negotiate()),o.next=7,Promise.all((r=this.requiredTransports)===null||r===void 0?void 0:r.map(function(c){return a.ensureTransportConnected(c,e,t)}));case 7:return o.prev=7,s(),o.finish(7);case 10:case"end":return o.stop()}},n,this,[[3,,7,10]])}))}},{key:"negotiate",value:function(e){return he(this,void 0,void 0,L().mark(function t(){var n=this;return L().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new Promise(function(s,a){return he(n,void 0,void 0,L().mark(function o(){var c,u,d=this;return L().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return c=setTimeout(function(){a("negotiation timed out")},this.peerConnectionTimeout),u=function(){clearTimeout(c),a("negotiation aborted")},e.signal.addEventListener("abort",u),this.publisher.once(JT,function(){e.signal.aborted||d.publisher.once(QT,function(){clearTimeout(c),s()})}),h.next=6,this.publisher.negotiate(function(b){clearTimeout(c),a(b)});case 6:case"end":return h.stop()}},o,this)}))}));case 1:case"end":return r.stop()}},t)}))}},{key:"addPublisherTransceiver",value:function(e,t){return this.publisher.addTransceiver(e,t)}},{key:"addPublisherTrack",value:function(e){return this.publisher.addTrack(e)}},{key:"createPublisherDataChannel",value:function(e,t){return this.publisher.createDataChannel(e,t)}},{key:"getConnectedAddress",value:function(e){return e===Gi.PUBLISHER||e===Gi.SUBSCRIBER?this.publisher.getConnectedAddress():this.requiredTransports[0].getConnectedAddress()}},{key:"requiredTransports",get:function(){var e=[];return this.isPublisherConnectionRequired&&e.push(this.publisher),this.isSubscriberConnectionRequired&&e.push(this.subscriber),e}},{key:"ensureTransportConnected",value:function(e,t){return he(this,arguments,void 0,function(n,r){var s=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.peerConnectionTimeout;return L().mark(function o(){return L().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(n.getConnectionState()!=="connected"){c.next=3;break}return c.abrupt("return");case 3:return c.abrupt("return",new Promise(function(u,d){return he(s,void 0,void 0,L().mark(function h(){var b,v,y=this;return L().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:b=function(){y.log.warn("abort transport connection",y.logContext),Nn.clearTimeout(v),d(new zt("room connection has been cancelled",$n.Cancelled))},r!=null&&r.signal.aborted&&b(),r==null||r.signal.addEventListener("abort",b),v=Nn.setTimeout(function(){r==null||r.signal.removeEventListener("abort",b),d(new zt("could not establish pc connection"))},a);case 4:if(this.state===ln.CONNECTED){p.next=12;break}return p.next=7,vr(50);case 7:if(!(r!=null&&r.signal.aborted)){p.next=10;break}return d(new zt("room connection has been cancelled",$n.Cancelled)),p.abrupt("return");case 10:p.next=4;break;case 12:Nn.clearTimeout(v),r==null||r.signal.removeEventListener("abort",b),u();case 15:case"end":return p.stop()}},h,this)}))}));case 4:case"end":return c.stop()}},o)})()})}}]),i}(),Km=2e3;function Ed(i,e){return e?("bytesReceived"in i?(t=i.bytesReceived,n=e.bytesReceived):"bytesSent"in i&&(t=i.bytesSent,n=e.bytesSent),t===void 0||n===void 0||i.timestamp===void 0||e.timestamp===void 0?0:8*(t-n)*1e3/(i.timestamp-e.timestamp)):0;var t,n}var Pn=function(i){function e(t,n){var r;ht(this,e);var s=2>=arguments.length||arguments[2]===void 0||arguments[2],a=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;return(r=Rt(this,e,[t,Le.Kind.Audio,n,s,o])).stopOnMute=!1,r.isKrispNoiseFilterEnabled=!1,r.monitorSender=function(){return he(ct(r),void 0,void 0,L().mark(function c(){var u;return L().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(this.sender){d.next=3;break}return this._currentBitrate=0,d.abrupt("return");case 3:return d.prev=3,d.next=6,this.getSenderStats();case 6:u=d.sent,d.next=13;break;case 9:return d.prev=9,d.t0=d.catch(3),this.log.error("could not get audio sender stats",Object.assign(Object.assign({},this.logContext),{error:d.t0})),d.abrupt("return");case 13:u&&this.prevStats&&(this._currentBitrate=Ed(u,this.prevStats)),this.prevStats=u;case 15:case"end":return d.stop()}},c,this,[[3,9]])}))},r.handleKrispNoiseFilterEnable=function(){r.isKrispNoiseFilterEnabled=!0,r.log.debug("Krisp noise filter enabled",r.logContext),r.emit($e.AudioTrackFeatureUpdate,ct(r),pr.TF_ENHANCED_NOISE_CANCELLATION,!0)},r.handleKrispNoiseFilterDisable=function(){r.isKrispNoiseFilterEnabled=!1,r.log.debug("Krisp noise filter disabled",r.logContext),r.emit($e.AudioTrackFeatureUpdate,ct(r),pr.TF_ENHANCED_NOISE_CANCELLATION,!1)},r.audioContext=a,r.checkForSilence(),r}return Lt(e,uo),ft(e,[{key:"enhancedNoiseCancellation",get:function(){return this.isKrispNoiseFilterEnabled}},{key:"setDeviceId",value:function(t){return he(this,void 0,void 0,L().mark(function n(){return L().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(this._constraints.deviceId!==t||this._mediaStreamTrack.getSettings().deviceId!==Fr(t)){r.next=2;break}return r.abrupt("return",!0);case 2:if(this._constraints.deviceId=t,this.isMuted){r.next=6;break}return r.next=6,this.restartTrack();case 6:return r.abrupt("return",this.isMuted||Fr(t)===this._mediaStreamTrack.getSettings().deviceId);case 7:case"end":return r.stop()}},n,this)}))}},{key:"mute",value:function(){var t=this,n=Object.create(null,{mute:{get:function(){return pt(lt(e.prototype),"mute",t)}}});return he(this,void 0,void 0,L().mark(function r(){var s;return L().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.muteLock.lock();case 2:if(s=a.sent,a.prev=3,!this.isMuted){a.next=7;break}return this.log.debug("Track already muted",this.logContext),a.abrupt("return",this);case 7:return this.source===Le.Source.Microphone&&this.stopOnMute&&!this.isUserProvided&&(this.log.debug("stopping mic track",this.logContext),this._mediaStreamTrack.stop()),a.next=10,n.mute.call(this);case 10:return a.abrupt("return",this);case 11:return a.prev=11,s(),a.finish(11);case 14:case"end":return a.stop()}},r,this,[[3,,11,14]])}))}},{key:"unmute",value:function(){var t=this,n=Object.create(null,{unmute:{get:function(){return pt(lt(e.prototype),"unmute",t)}}});return he(this,void 0,void 0,L().mark(function r(){var s,a;return L().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.muteLock.lock();case 2:if(s=o.sent,o.prev=3,this.isMuted){o.next=7;break}return this.log.debug("Track already unmuted",this.logContext),o.abrupt("return",this);case 7:if(a=this._constraints.deviceId&&this._mediaStreamTrack.getSettings().deviceId!==Fr(this._constraints.deviceId),this.source!==Le.Source.Microphone||!this.stopOnMute&&this._mediaStreamTrack.readyState!=="ended"&&!a||this.isUserProvided){o.next=12;break}return this.log.debug("reacquiring mic track",this.logContext),o.next=12,this.restartTrack();case 12:return o.next=14,n.unmute.call(this);case 14:return o.abrupt("return",this);case 15:return o.prev=15,s(),o.finish(15);case 18:case"end":return o.stop()}},r,this,[[3,,15,18]])}))}},{key:"restartTrack",value:function(t){return he(this,void 0,void 0,L().mark(function n(){var r,s;return L().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return t&&typeof(s=Td({audio:t})).audio!="boolean"&&(r=s.audio),a.next=3,this.restart(r);case 3:case"end":return a.stop()}},n,this)}))}},{key:"restart",value:function(t){var n=this,r=Object.create(null,{restart:{get:function(){return pt(lt(e.prototype),"restart",n)}}});return he(this,void 0,void 0,L().mark(function s(){var a;return L().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,r.restart.call(this,t);case 2:return a=o.sent,this.checkForSilence(),o.abrupt("return",a);case 5:case"end":return o.stop()}},s,this)}))}},{key:"startMonitor",value:function(){var t=this;yi()&&(this.monitorInterval||(this.monitorInterval=setInterval(function(){t.monitorSender()},Km)))}},{key:"setProcessor",value:function(t){return he(this,void 0,void 0,L().mark(function n(){var r,s,a;return L().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return o.next=2,this.processorLock.lock();case 2:if(s=o.sent,o.prev=3,this.audioContext){o.next=6;break}throw Error("Audio context needs to be set on LocalAudioTrack in order to enable processors");case 6:if(!this.processor){o.next=9;break}return o.next=9,this.stopProcessor();case 9:return a={kind:this.kind,track:this._mediaStreamTrack,audioContext:this.audioContext},this.log.debug("setting up audio processor ".concat(t.name),this.logContext),o.next=13,t.init(a);case 13:if(this.processor=t,!this.processor.processedTrack){o.next=19;break}return o.next=17,(r=this.sender)===null||r===void 0?void 0:r.replaceTrack(this.processor.processedTrack);case 17:this.processor.processedTrack.addEventListener("enable-lk-krisp-noise-filter",this.handleKrispNoiseFilterEnable),this.processor.processedTrack.addEventListener("disable-lk-krisp-noise-filter",this.handleKrispNoiseFilterDisable);case 19:this.emit($e.TrackProcessorUpdate,this.processor);case 20:return o.prev=20,s(),o.finish(20);case 23:case"end":return o.stop()}},n,this,[[3,,20,23]])}))}},{key:"setAudioContext",value:function(t){this.audioContext=t}},{key:"getSenderStats",value:function(){return he(this,void 0,void 0,L().mark(function t(){var n,r;return L().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(!((n=this.sender)===null||n===void 0)&&n.getStats){s.next=2;break}return s.abrupt("return",void 0);case 2:return s.next=4,this.sender.getStats();case 4:return s.sent.forEach(function(a){a.type==="outbound-rtp"&&(r={type:"audio",streamId:a.id,packetsSent:a.packetsSent,packetsLost:a.packetsLost,bytesSent:a.bytesSent,timestamp:a.timestamp,roundTripTime:a.roundTripTime,jitter:a.jitter})}),s.abrupt("return",r);case 7:case"end":return s.stop()}},t,this)}))}},{key:"checkForSilence",value:function(){return he(this,void 0,void 0,L().mark(function t(){var n;return L().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,D9(this);case 2:return(n=r.sent)&&(this.isMuted||this.log.warn("silence detected on local audio track",this.logContext),this.emit($e.AudioSilenceDetected)),r.abrupt("return",n);case 5:case"end":return r.stop()}},t,this)}))}}]),e}();function rS(i,e,t){switch(i.kind){case"audio":return new Pn(i,e,!1,void 0,t);case"video":return new Hn(i,e,!1,t);default:throw new gr("unsupported track type: ".concat(i.kind))}}var W9=Object.values(Rl),K9=Object.values(Om),X9=Object.values(Mm),Y9=[Rl.h180,Rl.h360],J9=[Om.h180,Om.h360],Q9=function(i){return[{scaleResolutionDownBy:2,fps:i.encoding.maxFramerate}].map(function(e){var t,n;return new Bt(Math.floor(i.width/e.scaleResolutionDownBy),Math.floor(i.height/e.scaleResolutionDownBy),Math.max(15e4,Math.floor(i.encoding.maxBitrate/(Math.pow(e.scaleResolutionDownBy,2)*(((t=i.encoding.maxFramerate)!==null&&t!==void 0?t:30)/((n=e.fps)!==null&&n!==void 0?n:30))))),e.fps,i.encoding.priority)})},Xm=["q","h","f"];function Ym(i,e,t,n){var r,s,a=n==null?void 0:n.videoEncoding;i&&(a=n==null?void 0:n.screenShareEncoding);var o=n==null?void 0:n.simulcast,c=n==null?void 0:n.scalabilityMode,u=n==null?void 0:n.videoCodec;if(!a&&!o&&!c||!e||!t)return[{}];a||(a=function(D,E,A,w){for(var N=function(J,ie,X){if(J)return X9;var H=ie>X?ie/X:X/ie;return Math.abs(H-16/9)<Math.abs(H-4/3)?W9:K9}(D,E,A),S=N[0].encoding,P=Math.max(E,A),F=0;F<N.length;F+=1){var V=N[F];if(S=V.encoding,V.width>=P)break}if(w)switch(w){case"av1":(S=Object.assign({},S)).maxBitrate=.7*S.maxBitrate;break;case"vp9":(S=Object.assign({},S)).maxBitrate=.85*S.maxBitrate;break}return S}(i,e,t,u),Ct.debug("using video encoding",a));var d=new Bt(e,t,a.maxBitrate,a.maxFramerate,a.priority);if(c&&Bl(u)){var h=new oS(c),b=[];if(h.spatial>3)throw new Error("unsupported scalabilityMode: ".concat(c));var v=Br();if(Zs()||Ur()||(v==null?void 0:v.name)==="Chrome"&&0>Ul(v==null?void 0:v.version,"113")){for(var y=h.suffix=="h"?2:3,p=0;p<h.spatial;p+=1)b.push({rid:Xm[2-p],maxBitrate:a.maxBitrate/Math.pow(y,p),maxFramerate:d.encoding.maxFramerate});b[0].scalabilityMode=c}else b.push({maxBitrate:a.maxBitrate,maxFramerate:d.encoding.maxFramerate,scalabilityMode:c});return d.encoding.priority&&(b[0].priority=d.encoding.priority,b[0].networkPriority=d.encoding.priority),Ct.debug("using svc encoding",{encodings:b}),b}if(!o)return[a];var f,m=[];if((m=i?(r=aS(n==null?void 0:n.screenShareSimulcastLayers))!==null&&r!==void 0?r:sS(i,d):(s=aS(n==null?void 0:n.videoSimulcastLayers))!==null&&s!==void 0?s:sS(i,d)).length>0){var _=m[0];m.length>1&&(f=At(m,2)[1]);var k=Math.max(e,t);if(k>=960&&f)return Jm(e,t,[_,f,d]);if(k>=480)return Jm(e,t,[_,d])}return Jm(e,t,[d])}function Z9(i,e,t){var n,r,s,a;if(t.backupCodec&&t.backupCodec!==!0&&t.backupCodec.codec!==t.videoCodec){e!==t.backupCodec.codec&&Ct.warn("requested a different codec than specified as backup",{serverRequested:e,backup:t.backupCodec.codec}),t.videoCodec=e,t.videoEncoding=t.backupCodec.encoding;var o=i.mediaStreamTrack.getSettings(),c=(n=o.width)!==null&&n!==void 0?n:(r=i.dimensions)===null||r===void 0?void 0:r.width,u=(s=o.height)!==null&&s!==void 0?s:(a=i.dimensions)===null||a===void 0?void 0:a.height;return Ym(i.source===Le.Source.ScreenShare,c,u,t)}}function sS(i,e){if(i)return Q9(e);var t=e.width,n=e.height,r=t>n?t/n:n/t;return Math.abs(r-16/9)<Math.abs(r-4/3)?Y9:J9}function Jm(i,e,t){var n=[];if(t.forEach(function(a,o){if(o<Xm.length){var c=Math.min(i,e),u={rid:Xm[o],scaleResolutionDownBy:Math.max(1,c/Math.min(a.width,a.height)),maxBitrate:a.encoding.maxBitrate};a.encoding.maxFramerate&&(u.maxFramerate=a.encoding.maxFramerate);var d=co()||o===0;a.encoding.priority&&d&&(u.priority=a.encoding.priority,u.networkPriority=a.encoding.priority),n.push(u)}}),Ur()&&BT()==="ios"){var r=void 0;n.forEach(function(a){r?a.maxFramerate&&a.maxFramerate>r&&(r=a.maxFramerate):r=a.maxFramerate});var s=!0;n.forEach(function(a){var o;a.maxFramerate!=r&&(s&&(s=!1,Ct.info("Simulcast on iOS React-Native requires all encodings to share the same framerate.")),Ct.info('Setting framerate of encoding "'.concat((o=a.rid)!==null&&o!==void 0?o:"",'" to ').concat(r)),a.maxFramerate=r)})}return n}function aS(i){if(i)return i.sort(function(e,t){var n=e.encoding,r=t.encoding;return n.maxBitrate>r.maxBitrate?1:n.maxBitrate<r.maxBitrate?-1:n.maxBitrate===r.maxBitrate&&n.maxFramerate&&r.maxFramerate?n.maxFramerate>r.maxFramerate?1:-1:0})}var oS=function(){function i(e){ht(this,i);var t=e.match(/^L(\d)T(\d)(h|_KEY|_KEY_SHIFT){0,1}$/);if(!t)throw new Error("invalid scalability mode");if(this.spatial=parseInt(t[1]),this.temporal=parseInt(t[2]),t.length>3)switch(t[3]){case"h":case"_KEY":case"_KEY_SHIFT":this.suffix=t[3]}}return ft(i,[{key:"toString",value:function(){var e;return"L".concat(this.spatial,"T").concat(this.temporal).concat((e=this.suffix)!==null&&e!==void 0?e:"")}}]),i}();function eR(i){return i.source===Le.Source.ScreenShare||i.constraints.height&&Fr(i.constraints.height)>=1080?"maintain-resolution":"balanced"}var Hn=function(i){function e(t,n){var r;ht(this,e);var s=2>=arguments.length||arguments[2]===void 0||arguments[2],a=arguments.length>3?arguments[3]:void 0;return(r=Rt(this,e,[t,Le.Kind.Video,n,s,a])).simulcastCodecs=new Map,r.degradationPreference="balanced",r.monitorSender=function(){return he(ct(r),void 0,void 0,L().mark(function o(){var c,u,d,h=this;return L().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:if(this.sender){b.next=3;break}return this._currentBitrate=0,b.abrupt("return");case 3:return b.prev=3,b.next=6,this.getSenderStats();case 6:c=b.sent,b.next=13;break;case 9:return b.prev=9,b.t0=b.catch(3),this.log.error("could not get audio sender stats",Object.assign(Object.assign({},this.logContext),{error:b.t0})),b.abrupt("return");case 13:u=new Map(c.map(function(v){return[v.rid,v]})),this.prevStats&&(d=0,u.forEach(function(v,y){var p,f=(p=h.prevStats)===null||p===void 0?void 0:p.get(y);d+=Ed(v,f)}),this._currentBitrate=d),this.prevStats=u;case 16:case"end":return b.stop()}},o,this,[[3,9]])}))},r.senderLock=new bi,r}return Lt(e,uo),ft(e,[{key:"sender",get:function(){return this._sender},set:function(t){this._sender=t,this.degradationPreference&&this.setDegradationPreference(this.degradationPreference)}},{key:"isSimulcast",get:function(){return!(!this.sender||1>=this.sender.getParameters().encodings.length)}},{key:"startMonitor",value:function(t){var n,r=this;if(this.signalClient=t,yi()){var s=(n=this.sender)===null||n===void 0?void 0:n.getParameters();s&&(this.encodings=s.encodings),this.monitorInterval||(this.monitorInterval=setInterval(function(){r.monitorSender()},Km))}}},{key:"stop",value:function(){this._mediaStreamTrack.getConstraints(),this.simulcastCodecs.forEach(function(t){t.mediaStreamTrack.stop()}),pt(lt(e.prototype),"stop",this).call(this)}},{key:"pauseUpstream",value:function(){var t=this,n=Object.create(null,{pauseUpstream:{get:function(){return pt(lt(e.prototype),"pauseUpstream",t)}}});return he(this,void 0,void 0,L().mark(function r(){var s,a,o,c,u,d,h,b,v;return L().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,n.pauseUpstream.call(this);case 2:y.prev=2,d=!0,h=so(this.simulcastCodecs.values());case 4:return y.next=6,h.next();case 6:if(b=y.sent,s=b.done){y.next=17;break}return c=b.value,d=!1,v=c,y.next=14,(u=v.sender)===null||u===void 0?void 0:u.replaceTrack(null);case 14:d=!0,y.next=4;break;case 17:y.next=22;break;case 19:y.prev=19,y.t0=y.catch(2),a={error:y.t0};case 22:if(y.prev=22,y.prev=23,d||s||!(o=h.return)){y.next=27;break}return y.next=27,o.call(h);case 27:if(y.prev=27,!a){y.next=30;break}throw a.error;case 30:return y.finish(27);case 31:return y.finish(22);case 32:case"end":return y.stop()}},r,this,[[2,19,22,32],[23,,27,31]])}))}},{key:"resumeUpstream",value:function(){var t=this,n=Object.create(null,{resumeUpstream:{get:function(){return pt(lt(e.prototype),"resumeUpstream",t)}}});return he(this,void 0,void 0,L().mark(function r(){var s,a,o,c,u,d,h,b,v;return L().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,n.resumeUpstream.call(this);case 2:y.prev=2,d=!0,h=so(this.simulcastCodecs.values());case 4:return y.next=6,h.next();case 6:if(b=y.sent,s=b.done){y.next=17;break}return c=b.value,d=!1,v=c,y.next=14,(u=v.sender)===null||u===void 0?void 0:u.replaceTrack(v.mediaStreamTrack);case 14:d=!0,y.next=4;break;case 17:y.next=22;break;case 19:y.prev=19,y.t0=y.catch(2),a={error:y.t0};case 22:if(y.prev=22,y.prev=23,d||s||!(o=h.return)){y.next=27;break}return y.next=27,o.call(h);case 27:if(y.prev=27,!a){y.next=30;break}throw a.error;case 30:return y.finish(27);case 31:return y.finish(22);case 32:case"end":return y.stop()}},r,this,[[2,19,22,32],[23,,27,31]])}))}},{key:"mute",value:function(){var t=this,n=Object.create(null,{mute:{get:function(){return pt(lt(e.prototype),"mute",t)}}});return he(this,void 0,void 0,L().mark(function r(){var s;return L().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.muteLock.lock();case 2:if(s=a.sent,a.prev=3,!this.isMuted){a.next=7;break}return this.log.debug("Track already muted",this.logContext),a.abrupt("return",this);case 7:return this.source!==Le.Source.Camera||this.isUserProvided||(this.log.debug("stopping camera track",this.logContext),this._mediaStreamTrack.stop()),a.next=10,n.mute.call(this);case 10:return a.abrupt("return",this);case 11:return a.prev=11,s(),a.finish(11);case 14:case"end":return a.stop()}},r,this,[[3,,11,14]])}))}},{key:"unmute",value:function(){var t=this,n=Object.create(null,{unmute:{get:function(){return pt(lt(e.prototype),"unmute",t)}}});return he(this,void 0,void 0,L().mark(function r(){var s;return L().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,this.muteLock.lock();case 2:if(s=a.sent,a.prev=3,this.isMuted){a.next=7;break}return this.log.debug("Track already unmuted",this.logContext),a.abrupt("return",this);case 7:if(this.source!==Le.Source.Camera||this.isUserProvided){a.next=11;break}return this.log.debug("reacquiring camera track",this.logContext),a.next=11,this.restartTrack();case 11:return a.next=13,n.unmute.call(this);case 13:return a.abrupt("return",this);case 14:return a.prev=14,s(),a.finish(14);case 17:case"end":return a.stop()}},r,this,[[3,,14,17]])}))}},{key:"setTrackMuted",value:function(t){pt(lt(e.prototype),"setTrackMuted",this).call(this,t);var n,r=dt(this.simulcastCodecs.values());try{for(r.s();!(n=r.n()).done;)n.value.mediaStreamTrack.enabled=!t}catch(s){r.e(s)}finally{r.f()}}},{key:"getSenderStats",value:function(){return he(this,void 0,void 0,L().mark(function t(){var n,r,s;return L().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(!((n=this.sender)===null||n===void 0)&&n.getStats){a.next=2;break}return a.abrupt("return",[]);case 2:return r=[],a.next=5,this.sender.getStats();case 5:return(s=a.sent).forEach(function(o){var c;if(o.type==="outbound-rtp"){var u={type:"video",streamId:o.id,frameHeight:o.frameHeight,frameWidth:o.frameWidth,framesPerSecond:o.framesPerSecond,framesSent:o.framesSent,firCount:o.firCount,pliCount:o.pliCount,nackCount:o.nackCount,packetsSent:o.packetsSent,bytesSent:o.bytesSent,qualityLimitationReason:o.qualityLimitationReason,qualityLimitationDurations:o.qualityLimitationDurations,qualityLimitationResolutionChanges:o.qualityLimitationResolutionChanges,rid:(c=o.rid)!==null&&c!==void 0?c:o.id,retransmittedPacketsSent:o.retransmittedPacketsSent,targetBitrate:o.targetBitrate,timestamp:o.timestamp},d=s.get(o.remoteId);d&&(u.jitter=d.jitter,u.packetsLost=d.packetsLost,u.roundTripTime=d.roundTripTime),r.push(u)}}),r.sort(function(o,c){var u,d;return((u=c.frameWidth)!==null&&u!==void 0?u:0)-((d=o.frameWidth)!==null&&d!==void 0?d:0)}),a.abrupt("return",r);case 9:case"end":return a.stop()}},t,this)}))}},{key:"setPublishingQuality",value:function(t){for(var n=[],r=Pi.LOW;r<=Pi.HIGH;r+=1)n.push(new gm({quality:r,enabled:t>=r}));this.log.debug("setting publishing quality. max quality ".concat(t),this.logContext),this.setPublishingLayers(n)}},{key:"setDeviceId",value:function(t){return he(this,void 0,void 0,L().mark(function n(){return L().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(this._constraints.deviceId!==t||this._mediaStreamTrack.getSettings().deviceId!==Fr(t)){r.next=2;break}return r.abrupt("return",!0);case 2:if(this._constraints.deviceId=t,this.isMuted){r.next=6;break}return r.next=6,this.restartTrack();case 6:return r.abrupt("return",this.isMuted||Fr(t)===this._mediaStreamTrack.getSettings().deviceId);case 7:case"end":return r.stop()}},n,this)}))}},{key:"restartTrack",value:function(t){return he(this,void 0,void 0,L().mark(function n(){var r,s,a,o,c,u,d,h,b,v;return L().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return t&&typeof(u=Td({video:t})).video!="boolean"&&(c=u.video),y.next=3,this.restart(c);case 3:y.prev=3,d=!0,h=so(this.simulcastCodecs.values());case 5:return y.next=7,h.next();case 7:if(b=y.sent,r=b.done){y.next=20;break}if(o=b.value,d=!1,!(v=o).sender){y.next=17;break}return v.mediaStreamTrack=this.mediaStreamTrack.clone(),y.next=17,v.sender.replaceTrack(v.mediaStreamTrack);case 17:d=!0,y.next=5;break;case 20:y.next=25;break;case 22:y.prev=22,y.t0=y.catch(3),s={error:y.t0};case 25:if(y.prev=25,y.prev=26,d||r||!(a=h.return)){y.next=30;break}return y.next=30,a.call(h);case 30:if(y.prev=30,!s){y.next=33;break}throw s.error;case 33:return y.finish(30);case 34:return y.finish(25);case 35:case"end":return y.stop()}},n,this,[[3,22,25,35],[26,,30,34]])}))}},{key:"setProcessor",value:function(t){var n=this,r=Object.create(null,{setProcessor:{get:function(){return pt(lt(e.prototype),"setProcessor",n)}}});return he(this,arguments,void 0,function(s){var a=this,o=1>=arguments.length||arguments[1]===void 0||arguments[1];return L().mark(function c(){var u,d,h,b,v,y,p,f,m,_;return L().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return k.next=2,r.setProcessor.call(a,s,o);case 2:if(!(!((v=a.processor)===null||v===void 0)&&v.processedTrack)){k.next=33;break}k.prev=3,p=!0,f=so(a.simulcastCodecs.values());case 5:return k.next=7,f.next();case 7:if(m=k.sent,u=m.done){k.next=18;break}return b=m.value,p=!1,_=b,k.next=15,(y=_.sender)===null||y===void 0?void 0:y.replaceTrack(a.processor.processedTrack);case 15:p=!0,k.next=5;break;case 18:k.next=23;break;case 20:k.prev=20,k.t0=k.catch(3),d={error:k.t0};case 23:if(k.prev=23,k.prev=24,p||u||!(h=f.return)){k.next=28;break}return k.next=28,h.call(f);case 28:if(k.prev=28,!d){k.next=31;break}throw d.error;case 31:return k.finish(28);case 32:return k.finish(23);case 33:case"end":return k.stop()}},c,null,[[3,20,23,33],[24,,28,32]])})()})}},{key:"setDegradationPreference",value:function(t){return he(this,void 0,void 0,L().mark(function n(){var r;return L().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(this.degradationPreference=t,this.sender)try{this.log.debug("setting degradationPreference to ".concat(t),this.logContext),(r=this.sender.getParameters()).degradationPreference=t,this.sender.setParameters(r)}catch(a){this.log.warn("failed to set degradationPreference",Object.assign({error:a},this.logContext))}case 2:case"end":return s.stop()}},n,this)}))}},{key:"addSimulcastTrack",value:function(t,n){if(!this.simulcastCodecs.has(t)){var r={codec:t,mediaStreamTrack:this.mediaStreamTrack.clone(),sender:void 0,encodings:n};return this.simulcastCodecs.set(t,r),r}this.log.error("".concat(t," already added, skipping adding simulcast codec"),this.logContext)}},{key:"setSimulcastTrackSender",value:function(t,n){var r=this,s=this.simulcastCodecs.get(t);s&&(s.sender=n,setTimeout(function(){r.subscribedCodecs&&r.setPublishingCodecs(r.subscribedCodecs)},5e3))}},{key:"setPublishingCodecs",value:function(t){return he(this,void 0,void 0,L().mark(function n(){var r,s,a,o,c,u,d,h,b,v,y,p;return L().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(this.log.debug("setting publishing codecs",Object.assign(Object.assign({},this.logContext),{codecs:t,currentCodec:this.codec})),this.codec||0>=t.length){f.next=5;break}return f.next=4,this.setPublishingLayers(t[0].qualities);case 4:return f.abrupt("return",[]);case 5:this.subscribedCodecs=t,h=[],f.prev=7,r=!0,s=so(t);case 9:return f.next=11,s.next();case 11:if(a=f.sent,o=a.done){f.next=52;break}if(d=a.value,r=!1,b=d,this.codec&&this.codec!==b.codec){f.next=22;break}return f.next=20,this.setPublishingLayers(b.qualities);case 20:f.next=49;break;case 22:if(v=this.simulcastCodecs.get(b.codec),this.log.debug("try setPublishingCodec for ".concat(b.codec),Object.assign(Object.assign({},this.logContext),{simulcastCodecInfo:v})),v&&v.sender){f.next=45;break}y=dt(b.qualities),f.prev=26,y.s();case 28:if((p=y.n()).done){f.next=35;break}if(!p.value.enabled){f.next=33;break}return h.push(b.codec),f.abrupt("break",35);case 33:f.next=28;break;case 35:f.next=40;break;case 37:f.prev=37,f.t0=f.catch(26),y.e(f.t0);case 40:return f.prev=40,y.f(),f.finish(40);case 43:f.next=49;break;case 45:if(!v.encodings){f.next=49;break}return this.log.debug("try setPublishingLayersForSender ".concat(b.codec),this.logContext),f.next=49,lS(v.sender,v.encodings,b.qualities,this.senderLock,this.log,this.logContext);case 49:r=!0,f.next=9;break;case 52:f.next=57;break;case 54:f.prev=54,f.t1=f.catch(7),c={error:f.t1};case 57:if(f.prev=57,f.prev=58,r||o||!(u=s.return)){f.next=62;break}return f.next=62,u.call(s);case 62:if(f.prev=62,!c){f.next=65;break}throw c.error;case 65:return f.finish(62);case 66:return f.finish(57);case 67:return f.abrupt("return",h);case 68:case"end":return f.stop()}},n,this,[[7,54,57,67],[26,37,40,43],[58,,62,66]])}))}},{key:"setPublishingLayers",value:function(t){return he(this,void 0,void 0,L().mark(function n(){return L().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(this.log.debug("setting publishing layers",Object.assign(Object.assign({},this.logContext),{qualities:t})),this.sender&&this.encodings){r.next=3;break}return r.abrupt("return");case 3:return r.next=5,lS(this.sender,this.encodings,t,this.senderLock,this.log,this.logContext);case 5:case"end":return r.stop()}},n,this)}))}},{key:"handleAppVisibilityChanged",value:function(){var t=this,n=Object.create(null,{handleAppVisibilityChanged:{get:function(){return pt(lt(e.prototype),"handleAppVisibilityChanged",t)}}});return he(this,void 0,void 0,L().mark(function r(){return L().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,n.handleAppVisibilityChanged.call(this);case 2:if(RT()){s.next=4;break}return s.abrupt("return");case 4:this.isInBackground&&this.source===Le.Source.Camera&&(this._mediaStreamTrack.enabled=!1);case 5:case"end":return s.stop()}},r,this)}))}}]),e}();function lS(i,e,t,n,r,s){return he(this,void 0,void 0,L().mark(function a(){var o,c,u,d;return L().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.next=2,n.lock();case 2:if(o=h.sent,r.debug("setPublishingLayersForSender",Object.assign(Object.assign({},s),{sender:i,qualities:t,senderEncodings:e})),h.prev=4,c=i.getParameters(),u=c.encodings){h.next=9;break}return h.abrupt("return");case 9:if(u.length===e.length){h.next=12;break}return r.warn("cannot set publishing layers, encodings mismatch",Object.assign(Object.assign({},s),{encodings:u,senderEncodings:e})),h.abrupt("return");case 12:if(d=!1,u.forEach(function(b,v){var y,p=(y=b.rid)!==null&&y!==void 0?y:"";p===""&&(p="q");var f=cS(p),m=t.find(function(_){return _.quality===f});m&&b.active!==m.enabled&&(d=!0,b.active=m.enabled,r.debug("setting layer ".concat(m.quality," to ").concat(b.active?"enabled":"disabled"),s),co()&&(m.enabled?(b.scaleResolutionDownBy=e[v].scaleResolutionDownBy,b.maxBitrate=e[v].maxBitrate,b.maxFrameRate=e[v].maxFrameRate):(b.scaleResolutionDownBy=4,b.maxBitrate=10,b.maxFrameRate=2)))}),!d){h.next=20;break}return c.encodings=u,r.debug("setting encodings",Object.assign(Object.assign({},s),{encodings:c.encodings})),h.next=20,i.setParameters(c);case 20:return h.prev=20,o(),h.finish(20);case 23:case"end":return h.stop()}},a,null,[[4,,20,23]])}))}function cS(i){switch(i){case"f":return Pi.HIGH;case"h":return Pi.MEDIUM;case"q":return Pi.LOW;default:return Pi.HIGH}}function uS(i,e,t,n){if(!t)return[new Ks({quality:Pi.HIGH,width:i,height:e,bitrate:0,ssrc:0})];if(n){for(var r=t[0].scalabilityMode,s=new oS(r),a=[],o=s.suffix=="h"?1.5:2,c=s.suffix=="h"?2:3,u=0;u<s.spatial;u+=1)a.push(new Ks({quality:Math.min(Pi.HIGH,s.spatial-1)-u,width:Math.ceil(i/Math.pow(o,u)),height:Math.ceil(e/Math.pow(o,u)),bitrate:t[0].maxBitrate?Math.ceil(t[0].maxBitrate/Math.pow(c,u)):0,ssrc:0}));return a}return t.map(function(d){var h,b,v,y=(h=d.scaleResolutionDownBy)!==null&&h!==void 0?h:1,p=cS((b=d.rid)!==null&&b!==void 0?b:"");return new Ks({quality:p,width:Math.ceil(i/y),height:Math.ceil(e/y),bitrate:(v=d.maxBitrate)!==null&&v!==void 0?v:0,ssrc:0})})}var Ki,dS="_lossy",hS="_reliable",Qm="leave-reconnect";(function(i){i[i.New=0]="New",i[i.Connected=1]="Connected",i[i.Disconnected=2]="Disconnected",i[i.Reconnecting=3]="Reconnecting",i[i.Closed=4]="Closed"})(Ki||(Ki={}));var tR=function(i){function e(t){var n,r;return ht(this,e),(n=Rt(this,e)).options=t,n.rtcConfig={},n.peerConnectionTimeout=Wm.peerConnectionTimeout,n.fullReconnectOnNext=!1,n.subscriberPrimary=!1,n.pcState=Ki.New,n._isClosed=!0,n.pendingTrackResolvers={},n.reconnectAttempts=0,n.reconnectStart=0,n.attemptingReconnect=!1,n.joinAttempts=0,n.maxJoinAttempts=1,n.shouldFailNext=!1,n.log=Ct,n.handleDataChannel=function(s){return he(ct(n),[s],void 0,function(a){var o=this,c=a.channel;return L().mark(function u(){return L().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(c){d.next=2;break}return d.abrupt("return");case 2:if(c.label!==hS){d.next=6;break}o.reliableDCSub=c,d.next=11;break;case 6:if(c.label!==dS){d.next=10;break}o.lossyDCSub=c,d.next=11;break;case 10:return d.abrupt("return");case 11:o.log.debug("on data channel ".concat(c.id,", ").concat(c.label),o.logContext),c.onmessage=o.handleDataMessage;case 13:case"end":return d.stop()}},u)})()})},n.handleDataMessage=function(s){return he(ct(n),void 0,void 0,L().mark(function a(){var o,c,u,d,h;return L().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return b.next=2,this.dataProcessLock.lock();case 2:if(u=b.sent,b.prev=3,!(s.data instanceof ArrayBuffer)){b.next=8;break}d=s.data,b.next=16;break;case 8:if(!(s.data instanceof Blob)){b.next=14;break}return b.next=11,s.data.arrayBuffer();case 11:d=b.sent,b.next=16;break;case 14:return this.log.error("unsupported data type",Object.assign(Object.assign({},this.logContext),{data:s.data})),b.abrupt("return");case 16:h=Pl.fromBinary(new Uint8Array(d)),((o=h.value)===null||o===void 0?void 0:o.case)==="speaker"?this.emit(Qe.ActiveSpeakersUpdate,h.value.value.speakers):(((c=h.value)===null||c===void 0?void 0:c.case)==="user"&&nR(h,h.value.value),this.emit(Qe.DataPacketReceived,h));case 18:return b.prev=18,u(),b.finish(18);case 21:case"end":return b.stop()}},a,this,[[3,,18,21]])}))},n.handleDataError=function(s){var a=s.currentTarget.maxRetransmits===0?"lossy":"reliable";if(s instanceof ErrorEvent&&s.error){var o=s.error.error;n.log.error("DataChannel error on ".concat(a,": ").concat(s.message),Object.assign(Object.assign({},n.logContext),{error:o}))}else n.log.error("Unknown DataChannel error on ".concat(a),Object.assign(Object.assign({},n.logContext),{event:s}))},n.handleBufferedAmountLow=function(s){var a=s.currentTarget.maxRetransmits===0?gn.LOSSY:gn.RELIABLE;n.updateAndEmitDCBufferStatus(a)},n.handleDisconnect=function(s,a){if(!n._isClosed){n.log.warn("".concat(s," disconnected"),n.logContext),n.reconnectAttempts===0&&(n.reconnectStart=Date.now());var o=Date.now()-n.reconnectStart,c=n.getNextRetryDelay({elapsedMs:o,retryCount:n.reconnectAttempts});c!==null?(s===Qm&&(c=0),n.log.debug("reconnecting in ".concat(c,"ms"),n.logContext),n.clearReconnectTimeout(),n.token&&n.regionUrlProvider&&n.regionUrlProvider.updateToken(n.token),n.reconnectTimeout=Nn.setTimeout(function(){return n.attemptReconnect(a).finally(function(){return n.reconnectTimeout=void 0})},c)):function(u){n.log.warn("could not recover connection after ".concat(n.reconnectAttempts," attempts, ").concat(u,"ms. giving up"),n.logContext),n.emit(Qe.Disconnected),n.close()}(o)}},n.waitForRestarted=function(){return new Promise(function(s,a){n.pcState===Ki.Connected&&s();var o=function(){n.off(Qe.Disconnected,c),s()},c=function(){n.off(Qe.Restarted,o),a()};n.once(Qe.Restarted,o),n.once(Qe.Disconnected,c)})},n.updateAndEmitDCBufferStatus=function(s){var a=n.isBufferStatusLow(s);a!==void 0&&a!==n.dcBufferStatus.get(s)&&(n.dcBufferStatus.set(s,a),n.emit(Qe.DCBufferStatusChanged,a,s))},n.isBufferStatusLow=function(s){var a=n.dataChannelForKind(s);if(a)return a.bufferedAmount<=a.bufferedAmountLowThreshold},n.handleBrowserOnLine=function(){n.client.currentState===Jt.RECONNECTING&&(n.clearReconnectTimeout(),n.attemptReconnect(no.RR_SIGNAL_DISCONNECTED))},n.log=Lr((r=t.loggerName)!==null&&r!==void 0?r:Wi.Engine),n.loggerOptions={loggerName:t.loggerName,loggerContextCb:function(){return n.logContext}},n.client=new F9(void 0,n.loggerOptions),n.client.signalLatency=n.options.expSignalLatency,n.reconnectPolicy=n.options.reconnectPolicy,n.registerOnLineListener(),n.closingLock=new bi,n.dataProcessLock=new bi,n.dcBufferStatus=new Map([[gn.LOSSY,!0],[gn.RELIABLE,!0]]),n.client.onParticipantUpdate=function(s){return n.emit(Qe.ParticipantUpdate,s)},n.client.onConnectionQuality=function(s){return n.emit(Qe.ConnectionQualityUpdate,s)},n.client.onRoomUpdate=function(s){return n.emit(Qe.RoomUpdate,s)},n.client.onSubscriptionError=function(s){return n.emit(Qe.SubscriptionError,s)},n.client.onSubscriptionPermissionUpdate=function(s){return n.emit(Qe.SubscriptionPermissionUpdate,s)},n.client.onSpeakersChanged=function(s){return n.emit(Qe.SpeakersChanged,s)},n.client.onStreamStateUpdate=function(s){return n.emit(Qe.StreamStateChanged,s)},n.client.onRequestResponse=function(s){return n.emit(Qe.SignalRequestResponse,s)},n}return Lt(e,Ys.EventEmitter),ft(e,[{key:"isClosed",get:function(){return this._isClosed}},{key:"pendingReconnect",get:function(){return!!this.reconnectTimeout}},{key:"logContext",get:function(){var t,n,r,s,a,o,c,u;return{room:(n=(t=this.latestJoinResponse)===null||t===void 0?void 0:t.room)===null||n===void 0?void 0:n.name,roomID:(s=(r=this.latestJoinResponse)===null||r===void 0?void 0:r.room)===null||s===void 0?void 0:s.sid,participant:(o=(a=this.latestJoinResponse)===null||a===void 0?void 0:a.participant)===null||o===void 0?void 0:o.identity,pID:(u=(c=this.latestJoinResponse)===null||c===void 0?void 0:c.participant)===null||u===void 0?void 0:u.sid}}},{key:"join",value:function(t,n,r,s){return he(this,void 0,void 0,L().mark(function a(){var o;return L().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return this.url=t,this.token=n,this.signalOpts=r,this.maxJoinAttempts=r.maxRetries,c.prev=4,this.joinAttempts+=1,this.setupSignalClientCallbacks(),c.next=9,this.client.join(t,n,r,s);case 9:if(o=c.sent,this._isClosed=!1,this.latestJoinResponse=o,this.subscriberPrimary=o.subscriberPrimary,this.pcManager){c.next=16;break}return c.next=16,this.configure(o);case 16:return this.subscriberPrimary&&!o.fastPublish||this.negotiate(),this.clientConfiguration=o.clientConfiguration,c.abrupt("return",o);case 21:if(c.prev=21,c.t0=c.catch(4),!(c.t0 instanceof zt)){c.next=28;break}if(c.t0.reason!==$n.ServerUnreachable){c.next=28;break}if(this.log.warn("Couldn't connect to server, attempt ".concat(this.joinAttempts," of ").concat(this.maxJoinAttempts),this.logContext),this.joinAttempts>=this.maxJoinAttempts){c.next=28;break}return c.abrupt("return",this.join(t,n,r,s));case 28:throw c.t0;case 29:case"end":return c.stop()}},a,this,[[4,21]])}))}},{key:"close",value:function(){return he(this,void 0,void 0,L().mark(function t(){var n;return L().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.closingLock.lock();case 2:if(n=r.sent,!this.isClosed){r.next=6;break}return n(),r.abrupt("return");case 6:return r.prev=6,this._isClosed=!0,this.emit(Qe.Closing),this.removeAllListeners(),this.deregisterOnLineListener(),this.clearPendingReconnect(),r.next=14,this.cleanupPeerConnections();case 14:return r.next=16,this.cleanupClient();case 16:return r.prev=16,n(),r.finish(16);case 19:case"end":return r.stop()}},t,this,[[6,,16,19]])}))}},{key:"cleanupPeerConnections",value:function(){return he(this,void 0,void 0,L().mark(function t(){var n,r;return L().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,(n=this.pcManager)===null||n===void 0?void 0:n.close();case 2:this.pcManager=void 0,(r=function(a){a&&(a.close(),a.onbufferedamountlow=null,a.onclose=null,a.onclosing=null,a.onerror=null,a.onmessage=null,a.onopen=null)})(this.lossyDC),r(this.lossyDCSub),r(this.reliableDC),r(this.reliableDCSub),this.lossyDC=void 0,this.lossyDCSub=void 0,this.reliableDC=void 0,this.reliableDCSub=void 0;case 12:case"end":return s.stop()}},t,this)}))}},{key:"cleanupClient",value:function(){return he(this,void 0,void 0,L().mark(function t(){return L().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.client.close();case 2:this.client.resetCallbacks();case 3:case"end":return n.stop()}},t,this)}))}},{key:"addTrack",value:function(t){var n=this;if(this.pendingTrackResolvers[t.cid])throw new gr("a track with the same ID has already been published");return new Promise(function(r,s){var a=setTimeout(function(){delete n.pendingTrackResolvers[t.cid],s(new zt("publication of local track timed out, no response from server"))},1e4);n.pendingTrackResolvers[t.cid]={resolve:function(o){clearTimeout(a),r(o)},reject:function(){clearTimeout(a),s(new Error("Cancelled publication by calling unpublish"))}},n.client.sendAddTrack(t)})}},{key:"removeTrack",value:function(t){if(t.track&&this.pendingTrackResolvers[t.track.id]){var n=this.pendingTrackResolvers[t.track.id].reject;n&&n(),delete this.pendingTrackResolvers[t.track.id]}try{return this.pcManager.removeTrack(t),!0}catch(r){this.log.warn("failed to remove track",Object.assign(Object.assign({},this.logContext),{error:r}))}return!1}},{key:"updateMuteStatus",value:function(t,n){this.client.sendMuteTrack(t,n)}},{key:"dataSubscriberReadyState",get:function(){var t;return(t=this.reliableDCSub)===null||t===void 0?void 0:t.readyState}},{key:"getConnectedServerAddress",value:function(){return he(this,void 0,void 0,L().mark(function t(){var n;return L().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(n=this.pcManager)===null||n===void 0?void 0:n.getConnectedAddress());case 1:case"end":return r.stop()}},t,this)}))}},{key:"setRegionUrlProvider",value:function(t){this.regionUrlProvider=t}},{key:"configure",value:function(t){return he(this,void 0,void 0,L().mark(function n(){var r,s,a,o=this;return L().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(!this.pcManager||this.pcManager.currentState===ln.NEW){c.next=2;break}return c.abrupt("return");case 2:this.participantSid=(r=t.participant)===null||r===void 0?void 0:r.sid,a=this.makeRTCConfiguration(t),this.pcManager=new G9(a,t.subscriberPrimary,this.loggerOptions),this.emit(Qe.TransportsCreated,this.pcManager.publisher,this.pcManager.subscriber),this.pcManager.onIceCandidate=function(d,h){o.client.sendIceCandidate(d,h)},this.pcManager.onPublisherOffer=function(d){o.client.sendOffer(d)},this.pcManager.onDataChannel=this.handleDataChannel,this.pcManager.onStateChange=function(d,h,b){return he(o,void 0,void 0,L().mark(function v(){var y,p,f;return L().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:this.log.debug("primary PC state changed ".concat(d),this.logContext),["closed","disconnected","failed"].includes(h)&&(this.publisherConnectionPromise=void 0),d===ln.CONNECTED?(y=this.pcState===Ki.New,this.pcState=Ki.Connected,y&&this.emit(Qe.Connected,t)):d===ln.FAILED&&this.pcState===Ki.Connected&&(this.pcState=Ki.Disconnected,this.handleDisconnect("peerconnection failed",b==="failed"?no.RR_SUBSCRIBER_FAILED:no.RR_PUBLISHER_FAILED)),p=this.client.isDisconnected||this.client.currentState===Jt.RECONNECTING,f=[ln.FAILED,ln.CLOSING,ln.CLOSED].includes(d),p&&f&&!this._isClosed&&this.emit(Qe.Offline);case 6:case"end":return m.stop()}},v,this)}))},this.pcManager.onTrack=function(d){o.emit(Qe.MediaTrackAdded,d.track,d.streams[0],d.receiver)},(u=(s=t.serverInfo)===null||s===void 0?void 0:s.protocol)!==void 0&&u>13||this.createDataChannels();case 12:case"end":return c.stop()}var u},n,this)}))}},{key:"setupSignalClientCallbacks",value:function(){var t=this;this.client.onAnswer=function(n){return he(t,void 0,void 0,L().mark(function r(){return L().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(this.pcManager){s.next=2;break}return s.abrupt("return");case 2:return this.log.debug("received server answer",Object.assign(Object.assign({},this.logContext),{RTCSdpType:n.type})),s.next=5,this.pcManager.setPublisherAnswer(n);case 5:case"end":return s.stop()}},r,this)}))},this.client.onTrickle=function(n,r){t.pcManager&&(t.log.trace("got ICE candidate from peer",Object.assign(Object.assign({},t.logContext),{candidate:n,target:r})),t.pcManager.addIceCandidate(n,r))},this.client.onOffer=function(n){return he(t,void 0,void 0,L().mark(function r(){var s;return L().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(this.pcManager){a.next=2;break}return a.abrupt("return");case 2:return a.next=4,this.pcManager.createSubscriberAnswerFromOffer(n);case 4:s=a.sent,this.client.sendAnswer(s);case 6:case"end":return a.stop()}},r,this)}))},this.client.onLocalTrackPublished=function(n){var r;if(t.log.debug("received trackPublishedResponse",Object.assign(Object.assign({},t.logContext),{cid:n.cid,track:(r=n.track)===null||r===void 0?void 0:r.sid})),t.pendingTrackResolvers[n.cid]){var s=t.pendingTrackResolvers[n.cid].resolve;delete t.pendingTrackResolvers[n.cid],s(n.track)}else t.log.error("missing track resolver for ".concat(n.cid),Object.assign(Object.assign({},t.logContext),{cid:n.cid}))},this.client.onLocalTrackUnpublished=function(n){t.emit(Qe.LocalTrackUnpublished,n)},this.client.onLocalTrackSubscribed=function(n){t.emit(Qe.LocalTrackSubscribed,n)},this.client.onTokenRefresh=function(n){t.token=n},this.client.onRemoteMuteChanged=function(n,r){t.emit(Qe.RemoteMute,n,r)},this.client.onSubscribedQualityUpdate=function(n){t.emit(Qe.SubscribedQualityUpdate,n)},this.client.onClose=function(){t.handleDisconnect("signal",no.RR_SIGNAL_DISCONNECTED)},this.client.onLeave=function(n){switch(t.log.debug("client leave request",Object.assign(Object.assign({},t.logContext),{reason:n==null?void 0:n.reason})),n.regions&&t.regionUrlProvider&&(t.log.debug("updating regions",t.logContext),t.regionUrlProvider.setServerReportedRegions(n.regions)),n.action){case ro.DISCONNECT:t.emit(Qe.Disconnected,n==null?void 0:n.reason),t.close();break;case ro.RECONNECT:t.fullReconnectOnNext=!0,t.handleDisconnect(Qm);break;case ro.RESUME:t.handleDisconnect(Qm)}}}},{key:"makeRTCConfiguration",value:function(t){var n,r=Object.assign({},this.rtcConfig);if(!((n=this.signalOpts)===null||n===void 0)&&n.e2eeEnabled&&(this.log.debug("E2EE - setting up transports with insertable streams",this.logContext),r.encodedInsertableStreams=!0),t.iceServers&&!r.iceServers){var s=[];t.iceServers.forEach(function(a){var o={urls:a.urls};a.username&&(o.username=a.username),a.credential&&(o.credential=a.credential),s.push(o)}),r.iceServers=s}return t.clientConfiguration&&t.clientConfiguration.forceRelay===Il.ENABLED&&(r.iceTransportPolicy="relay"),r.sdpSemantics="unified-plan",r.continualGatheringPolicy="gather_continually",r}},{key:"createDataChannels",value:function(){this.pcManager&&(this.lossyDC&&(this.lossyDC.onmessage=null,this.lossyDC.onerror=null),this.reliableDC&&(this.reliableDC.onmessage=null,this.reliableDC.onerror=null),this.lossyDC=this.pcManager.createPublisherDataChannel(dS,{ordered:!0,maxRetransmits:0}),this.reliableDC=this.pcManager.createPublisherDataChannel(hS,{ordered:!0}),this.lossyDC.onmessage=this.handleDataMessage,this.reliableDC.onmessage=this.handleDataMessage,this.lossyDC.onerror=this.handleDataError,this.reliableDC.onerror=this.handleDataError,this.lossyDC.bufferedAmountLowThreshold=65535,this.reliableDC.bufferedAmountLowThreshold=65535,this.lossyDC.onbufferedamountlow=this.handleBufferedAmountLow,this.reliableDC.onbufferedamountlow=this.handleBufferedAmountLow)}},{key:"createSender",value:function(t,n,r){return he(this,void 0,void 0,L().mark(function s(){var a,o;return L().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(!Lm()){c.next=5;break}return c.next=3,this.createTransceiverRTCRtpSender(t,n,r);case 3:return a=c.sent,c.abrupt("return",a);case 5:if(!Bm()){c.next=11;break}return this.log.warn("using add-track fallback",this.logContext),c.next=9,this.createRTCRtpSender(t.mediaStreamTrack);case 9:return o=c.sent,c.abrupt("return",o);case 11:throw new vn("Required webRTC APIs not supported on this device");case 12:case"end":return c.stop()}},s,this)}))}},{key:"createSimulcastSender",value:function(t,n,r,s){return he(this,void 0,void 0,L().mark(function a(){return L().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(!Lm()){o.next=2;break}return o.abrupt("return",this.createSimulcastTransceiverSender(t,n,r,s));case 2:if(!Bm()){o.next=5;break}return this.log.debug("using add-track fallback",this.logContext),o.abrupt("return",this.createRTCRtpSender(t.mediaStreamTrack));case 5:throw new vn("Cannot stream on this device");case 6:case"end":return o.stop()}},a,this)}))}},{key:"createTransceiverRTCRtpSender",value:function(t,n,r){return he(this,void 0,void 0,L().mark(function s(){var a,o,c;return L().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(this.pcManager){u.next=2;break}throw new vn("publisher is closed");case 2:return a=[],t.mediaStream&&a.push(t.mediaStream),t instanceof Hn&&(t.codec=n.videoCodec),o={direction:"sendonly",streams:a},r&&(o.sendEncodings=r),u.next=9,this.pcManager.addPublisherTransceiver(t.mediaStreamTrack,o);case 9:return c=u.sent,u.abrupt("return",c.sender);case 11:case"end":return u.stop()}},s,this)}))}},{key:"createSimulcastTransceiverSender",value:function(t,n,r,s){return he(this,void 0,void 0,L().mark(function a(){var o,c;return L().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(this.pcManager){u.next=2;break}throw new vn("publisher is closed");case 2:return o={direction:"sendonly"},s&&(o.sendEncodings=s),u.next=6,this.pcManager.addPublisherTransceiver(n.mediaStreamTrack,o);case 6:if(c=u.sent,r.videoCodec){u.next=9;break}return u.abrupt("return");case 9:return t.setSimulcastTrackSender(r.videoCodec,c.sender),u.abrupt("return",c.sender);case 11:case"end":return u.stop()}},a,this)}))}},{key:"createRTCRtpSender",value:function(t){return he(this,void 0,void 0,L().mark(function n(){return L().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(this.pcManager){r.next=2;break}throw new vn("publisher is closed");case 2:return r.abrupt("return",this.pcManager.addPublisherTrack(t));case 3:case"end":return r.stop()}},n,this)}))}},{key:"attemptReconnect",value:function(t){return he(this,void 0,void 0,L().mark(function n(){var r,s,a,o;return L().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(!this._isClosed){c.next=2;break}return c.abrupt("return");case 2:if(!this.attemptingReconnect){c.next=5;break}return Ct.warn("already attempting reconnect, returning early",this.logContext),c.abrupt("return");case 5:if(((r=this.clientConfiguration)===null||r===void 0?void 0:r.resumeConnection)!==Il.DISABLED&&((a=(s=this.pcManager)===null||s===void 0?void 0:s.currentState)!==null&&a!==void 0?a:ln.NEW)!==ln.NEW||(this.fullReconnectOnNext=!0),c.prev=6,this.attemptingReconnect=!0,!this.fullReconnectOnNext){c.next=13;break}return c.next=11,this.restartConnection();case 11:c.next=15;break;case 13:return c.next=15,this.resumeConnection(t);case 15:this.clearPendingReconnect(),this.fullReconnectOnNext=!1,c.next=32;break;case 19:if(c.prev=19,c.t0=c.catch(6),this.reconnectAttempts+=1,o=!0,c.t0 instanceof vn?(this.log.debug("received unrecoverable error",Object.assign(Object.assign({},this.logContext),{error:c.t0})),o=!1):c.t0 instanceof ho||(this.fullReconnectOnNext=!0),!o){c.next=28;break}this.handleDisconnect("reconnect",no.RR_UNKNOWN),c.next=32;break;case 28:return this.log.info("could not recover connection after ".concat(this.reconnectAttempts," attempts, ").concat(Date.now()-this.reconnectStart,"ms. giving up"),this.logContext),this.emit(Qe.Disconnected),c.next=32,this.close();case 32:return c.prev=32,this.attemptingReconnect=!1,c.finish(32);case 35:case"end":return c.stop()}},n,this,[[6,19,32,35]])}))}},{key:"getNextRetryDelay",value:function(t){try{return this.reconnectPolicy.nextRetryDelayInMs(t)}catch(n){this.log.warn("encountered error in reconnect policy",Object.assign(Object.assign({},this.logContext),{error:n}))}return null}},{key:"restartConnection",value:function(t){return he(this,void 0,void 0,L().mark(function n(){var r,s,a,o,c;return L().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:if(u.prev=0,this.url&&this.token){u.next=3;break}throw new vn("could not reconnect, url or token not saved");case 3:if(this.log.info("reconnecting, attempt: ".concat(this.reconnectAttempts),this.logContext),this.emit(Qe.Restarting),this.client.isDisconnected){u.next=8;break}return u.next=8,this.client.sendLeave();case 8:return u.next=10,this.cleanupPeerConnections();case 10:return u.next=12,this.cleanupClient();case 12:if(u.prev=12,this.signalOpts){u.next=16;break}throw this.log.warn("attempted connection restart, without signal options present",this.logContext),new ho;case 16:return u.next=18,this.join(t??this.url,this.token,this.signalOpts);case 18:o=u.sent,u.next=26;break;case 21:if(u.prev=21,u.t0=u.catch(12),!(u.t0 instanceof zt&&u.t0.reason===$n.NotAllowed)){u.next=25;break}throw new vn("could not reconnect, token might be expired");case 25:throw new ho;case 26:if(!this.shouldFailNext){u.next=29;break}throw this.shouldFailNext=!1,new Error("simulated failure");case 29:return this.client.setReconnected(),this.emit(Qe.SignalRestarted,o),u.next=33,this.waitForPCReconnected();case 33:if(this.client.currentState===Jt.CONNECTED){u.next=35;break}throw new ho("Signal connection got severed during reconnect");case 35:(r=this.regionUrlProvider)===null||r===void 0||r.resetAttempts(),this.emit(Qe.Restarted),u.next=52;break;case 39:return u.prev=39,u.t1=u.catch(0),u.next=43,(s=this.regionUrlProvider)===null||s===void 0?void 0:s.getNextBestRegionUrl();case 43:if(!(c=u.sent)){u.next=50;break}return u.next=47,this.restartConnection(c);case 47:return u.abrupt("return");case 50:throw(a=this.regionUrlProvider)===null||a===void 0||a.resetAttempts(),u.t1;case 52:case"end":return u.stop()}},n,this,[[0,39],[12,21]])}))}},{key:"resumeConnection",value:function(t){return he(this,void 0,void 0,L().mark(function n(){var r,s,a,o;return L().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(this.url&&this.token){c.next=2;break}throw new vn("could not reconnect, url or token not saved");case 2:if(this.pcManager){c.next=4;break}throw new vn("publisher and subscriber connections unset");case 4:return this.log.info("resuming signal connection, attempt ".concat(this.reconnectAttempts),this.logContext),this.emit(Qe.Resuming),c.prev=6,this.setupSignalClientCallbacks(),c.next=10,this.client.reconnect(this.url,this.token,this.participantSid,t);case 10:s=c.sent,c.next=22;break;case 13:if(c.prev=13,c.t0=c.catch(6),a="",c.t0 instanceof Error&&(a=c.t0.message,this.log.error(c.t0.message,Object.assign(Object.assign({},this.logContext),{error:c.t0}))),!(c.t0 instanceof zt&&c.t0.reason===$n.NotAllowed)){c.next=19;break}throw new vn("could not reconnect, token might be expired");case 19:if(!(c.t0 instanceof zt&&c.t0.reason===$n.LeaveRequest)){c.next=21;break}throw c.t0;case 21:throw new ho(a);case 22:if(this.emit(Qe.SignalResumed),s?(o=this.makeRTCConfiguration(s),this.pcManager.updateConfiguration(o)):this.log.warn("Did not receive reconnect response",this.logContext),!this.shouldFailNext){c.next=27;break}throw this.shouldFailNext=!1,new Error("simulated failure");case 27:return c.next=29,this.pcManager.triggerIceRestart();case 29:return c.next=31,this.waitForPCReconnected();case 31:if(this.client.currentState===Jt.CONNECTED){c.next=33;break}throw new ho("Signal connection got severed during reconnect");case 33:this.client.setReconnected(),((r=this.reliableDC)===null||r===void 0?void 0:r.readyState)==="open"&&this.reliableDC.id===null&&this.createDataChannels(),this.emit(Qe.Resumed);case 36:case"end":return c.stop()}},n,this,[[6,13]])}))}},{key:"waitForPCInitialConnection",value:function(t,n){return he(this,void 0,void 0,L().mark(function r(){return L().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(this.pcManager){s.next=2;break}throw new vn("PC manager is closed");case 2:return s.next=4,this.pcManager.ensurePCTransportConnection(n,t);case 4:case"end":return s.stop()}},r,this)}))}},{key:"waitForPCReconnected",value:function(){return he(this,void 0,void 0,L().mark(function t(){return L().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return this.pcState=Ki.Reconnecting,this.log.debug("waiting for peer connection to reconnect",this.logContext),n.prev=2,n.next=5,vr(2e3);case 5:if(this.pcManager){n.next=7;break}throw new vn("PC manager is closed");case 7:return n.next=9,this.pcManager.ensurePCTransportConnection(void 0,this.peerConnectionTimeout);case 9:this.pcState=Ki.Connected,n.next=16;break;case 12:throw n.prev=12,n.t0=n.catch(2),this.pcState=Ki.Disconnected,new zt("could not establish PC connection, ".concat(n.t0.message));case 16:case"end":return n.stop()}},t,this,[[2,12]])}))}},{key:"sendDataPacket",value:function(t,n){return he(this,void 0,void 0,L().mark(function r(){var s,a;return L().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return s=t.toBinary(),o.next=3,this.ensurePublisherConnected(n);case 3:(a=this.dataChannelForKind(n))&&a.send(s),this.updateAndEmitDCBufferStatus(n);case 6:case"end":return o.stop()}},r,this)}))}},{key:"ensureDataTransportConnected",value:function(t){return he(this,arguments,void 0,function(n){var r=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.subscriberPrimary;return L().mark(function a(){var o,c,u,d,h,b;return L().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:if(r.pcManager){v.next=2;break}throw new vn("PC manager is closed");case 2:if(c=s?r.pcManager.subscriber:r.pcManager.publisher,u=s?"Subscriber":"Publisher",c){v.next=6;break}throw new zt("".concat(u," connection not set"));case 6:if(d=!1,s||r.dataChannelForKind(n,s)||(r.createDataChannels(),d=!0),d||s||r.pcManager.publisher.isICEConnected||r.pcManager.publisher.getICEConnectionState()==="checking"||(d=!0),d&&r.negotiate(),((h=r.dataChannelForKind(n,s))==null?void 0:h.readyState)!=="open"){v.next=13;break}return v.abrupt("return");case 13:b=new Date().getTime()+r.peerConnectionTimeout;case 14:if(new Date().getTime()>=b){v.next=21;break}if(!c.isICEConnected||((o=r.dataChannelForKind(n,s))===null||o===void 0?void 0:o.readyState)!=="open"){v.next=17;break}return v.abrupt("return");case 17:return v.next=19,vr(50);case 19:v.next=14;break;case 21:throw new zt("could not establish ".concat(u," connection, state: ").concat(c.getICEConnectionState()));case 22:case"end":return v.stop()}},a)})()})}},{key:"ensurePublisherConnected",value:function(t){return he(this,void 0,void 0,L().mark(function n(){return L().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return this.publisherConnectionPromise||(this.publisherConnectionPromise=this.ensureDataTransportConnected(t,!1)),r.next=3,this.publisherConnectionPromise;case 3:case"end":return r.stop()}},n,this)}))}},{key:"verifyTransport",value:function(){return!!this.pcManager&&this.pcManager.currentState===ln.CONNECTED&&!(!this.client.ws||this.client.ws.readyState===WebSocket.CLOSED)}},{key:"negotiate",value:function(){return he(this,void 0,void 0,L().mark(function t(){var n=this;return L().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new Promise(function(s,a){return he(n,void 0,void 0,L().mark(function o(){var c,u,d=this;return L().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(this.pcManager){h.next=3;break}return a(new Dm("PC manager is closed")),h.abrupt("return");case 3:return this.pcManager.requirePublisher(),this.pcManager.publisher.getTransceivers().length!=0||this.lossyDC||this.reliableDC||this.createDataChannels(),c=new AbortController,u=function(){c.abort(),d.log.debug("engine disconnected while negotiation was ongoing",d.logContext),s()},this.isClosed&&a("cannot negotiate on closed engine"),this.on(Qe.Closing,u),this.pcManager.publisher.once(ZT,function(b){var v=new Map;b.forEach(function(y){var p,f=y.codec.toLowerCase();p=f,IT.includes(p)&&v.set(y.payload,f)}),d.emit(Qe.RTPVideoMapUpdate,v)}),h.prev=10,h.next=13,this.pcManager.negotiate(c);case 13:s(),h.next=21;break;case 16:h.prev=16,h.t0=h.catch(10),h.t0 instanceof Dm&&(this.fullReconnectOnNext=!0),this.handleDisconnect("negotiation",no.RR_UNKNOWN),a(h.t0);case 21:return h.prev=21,this.off(Qe.Closing,u),h.finish(21);case 24:case"end":return h.stop()}},o,this,[[10,16,21,24]])}))}));case 1:case"end":return r.stop()}},t)}))}},{key:"dataChannelForKind",value:function(t,n){if(n){if(t===gn.LOSSY)return this.lossyDCSub;if(t===gn.RELIABLE)return this.reliableDCSub}else{if(t===gn.LOSSY)return this.lossyDC;if(t===gn.RELIABLE)return this.reliableDC}}},{key:"sendSyncState",value:function(t,n){var r,s;if(this.pcManager){var a,o,c=this.pcManager.subscriber.getLocalDescription(),u=this.pcManager.subscriber.getRemoteDescription(),d=(s=(r=this.signalOpts)===null||r===void 0?void 0:r.autoSubscribe)===null||s===void 0||s,h=new Array,b=new Array;t.forEach(function(v){v.isDesired!==d&&h.push(v.trackSid),v.isEnabled||b.push(v.trackSid)}),this.client.sendSyncState(new Ok({answer:c?xd({sdp:c.sdp,type:c.type}):void 0,offer:u?xd({sdp:u.sdp,type:u.type}):void 0,subscription:new cd({trackSids:h,subscribe:!d,participantTracks:[]}),publishTracks:(a=n,o=[],a.forEach(function(v){v.track!==void 0&&o.push(new mm({cid:v.track.mediaStreamID,track:v.trackInfo}))}),o),dataChannels:this.dataChannelsInfo(),trackSidsDisabled:b}))}else this.log.warn("sync state cannot be sent without peer connection setup",this.logContext)}},{key:"failNext",value:function(){this.shouldFailNext=!0}},{key:"dataChannelsInfo",value:function(){var t=[],n=function(r,s){(r==null?void 0:r.id)!==void 0&&r.id!==null&&t.push(new Mk({label:r.label,id:r.id,target:s}))};return n(this.dataChannelForKind(gn.LOSSY),Gi.PUBLISHER),n(this.dataChannelForKind(gn.RELIABLE),Gi.PUBLISHER),n(this.dataChannelForKind(gn.LOSSY,!0),Gi.SUBSCRIBER),n(this.dataChannelForKind(gn.RELIABLE,!0),Gi.SUBSCRIBER),t}},{key:"clearReconnectTimeout",value:function(){this.reconnectTimeout&&Nn.clearTimeout(this.reconnectTimeout)}},{key:"clearPendingReconnect",value:function(){this.clearReconnectTimeout(),this.reconnectAttempts=0}},{key:"registerOnLineListener",value:function(){yi()&&window.addEventListener("online",this.handleBrowserOnLine)}},{key:"deregisterOnLineListener",value:function(){yi()&&window.removeEventListener("online",this.handleBrowserOnLine)}}]),e}(),ho=function(i){function e(){return ht(this,e),Rt(this,e,arguments)}return Lt(e,Yu(Error)),ft(e)}();function nR(i,e){var t=i.participantIdentity?i.participantIdentity:e.participantIdentity;i.participantIdentity=t,e.participantIdentity=t;var n=i.destinationIdentities.length!==0?i.destinationIdentities:e.destinationIdentities;i.destinationIdentities=n,e.destinationIdentities=n}var fS=function(){function i(e,t){ht(this,i),this.lastUpdateAt=0,this.settingsCacheTime=3e3,this.attemptedRegions=[],this.serverUrl=new URL(e),this.token=t}return ft(i,[{key:"updateToken",value:function(e){this.token=e}},{key:"isCloud",value:function(){return Fm(this.serverUrl)}},{key:"getServerUrl",value:function(){return this.serverUrl}},{key:"getNextBestRegionUrl",value:function(e){return he(this,void 0,void 0,L().mark(function t(){var n,r,s=this;return L().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(this.isCloud()){a.next=2;break}throw Error("region availability is only supported for LiveKit Cloud domains");case 2:if(this.regionSettings&&Date.now()-this.lastUpdateAt<=this.settingsCacheTime){a.next=6;break}return a.next=5,this.fetchRegionSettings(e);case 5:this.regionSettings=a.sent;case 6:if((n=this.regionSettings.regions.filter(function(o){return!s.attemptedRegions.find(function(c){return c.url===o.url})})).length<=0){a.next=14;break}return r=n[0],this.attemptedRegions.push(r),Ct.debug("next region: ".concat(r.region)),a.abrupt("return",r.url);case 14:return a.abrupt("return",null);case 15:case"end":return a.stop()}},t,this)}))}},{key:"resetAttempts",value:function(){this.attemptedRegions=[]}},{key:"fetchRegionSettings",value:function(e){return he(this,void 0,void 0,L().mark(function t(){var n,r;return L().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,fetch("".concat((a=this.serverUrl,"".concat(a.protocol.replace("ws","http"),"//").concat(a.host,"/settings")),"/regions"),{headers:{authorization:"Bearer ".concat(this.token)},signal:e});case 2:if(!(n=s.sent).ok){s.next=11;break}return s.next=6,n.json();case 6:return r=s.sent,this.lastUpdateAt=Date.now(),s.abrupt("return",r);case 11:throw new zt("Could not fetch region settings: ".concat(n.statusText),n.status===401?$n.NotAllowed:void 0,n.status);case 12:case"end":return s.stop()}var a},t,this)}))}},{key:"setServerReportedRegions",value:function(e){this.regionSettings=e,this.lastUpdateAt=Date.now()}}]),i}(),pS=function(i){function e(t,n,r,s,a){var o;return ht(this,e),(o=Rt(this,e,[t,r,a])).sid=n,o.receiver=s,o}return Lt(e,Le),ft(e,[{key:"setMuted",value:function(t){this.isMuted!==t&&(this.isMuted=t,this._mediaStreamTrack.enabled=!t,this.emit(t?$e.Muted:$e.Unmuted,this))}},{key:"setMediaStream",value:function(t){var n=this;this.mediaStream=t,t.addEventListener("removetrack",function r(s){s.track===n._mediaStreamTrack&&(t.removeEventListener("removetrack",r),n.receiver&&"playoutDelayHint"in n.receiver&&(n.receiver.playoutDelayHint=void 0),n.receiver=void 0,n._currentBitrate=0,n.emit($e.Ended,n))})}},{key:"start",value:function(){this.startMonitor(),pt(lt(e.prototype),"enable",this).call(this)}},{key:"stop",value:function(){this.stopMonitor(),pt(lt(e.prototype),"disable",this).call(this)}},{key:"getRTCStatsReport",value:function(){return he(this,void 0,void 0,L().mark(function t(){var n,r;return L().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(!((n=this.receiver)===null||n===void 0)&&n.getStats){s.next=2;break}return s.abrupt("return");case 2:return s.next=4,this.receiver.getStats();case 4:return r=s.sent,s.abrupt("return",r);case 6:case"end":return s.stop()}},t,this)}))}},{key:"setPlayoutDelay",value:function(t){this.receiver?"playoutDelayHint"in this.receiver?this.receiver.playoutDelayHint=t:this.log.warn("Playout delay not supported in this browser"):this.log.warn("Cannot set playout delay, track already ended")}},{key:"getPlayoutDelay",value:function(){if(this.receiver){if("playoutDelayHint"in this.receiver)return this.receiver.playoutDelayHint;this.log.warn("Playout delay not supported in this browser")}else this.log.warn("Cannot get playout delay, track already ended");return 0}},{key:"startMonitor",value:function(){var t=this;this.monitorInterval||(this.monitorInterval=setInterval(function(){return t.monitorReceiver()},Km)),typeof RTCRtpReceiver<"u"&&"getSynchronizationSources"in RTCRtpReceiver&&this.registerTimeSyncUpdate()}},{key:"registerTimeSyncUpdate",value:function(){var t=this;(function n(){var r;t.timeSyncHandle=requestAnimationFrame(function(){return n()});var s=(r=t.receiver)===null||r===void 0?void 0:r.getSynchronizationSources()[0];if(s){var a=s.timestamp,o=s.rtpTimestamp;o&&t.rtpTimestamp!==o&&(t.emit($e.TimeSyncUpdate,{timestamp:a,rtpTimestamp:o}),t.rtpTimestamp=o)}})()}}]),e}(),Vl=function(i){function e(t,n,r,s,a,o){var c;return ht(this,e),(c=Rt(this,e,[t,n,Le.Kind.Audio,r,o])).monitorReceiver=function(){return he(ct(c),void 0,void 0,L().mark(function u(){var d;return L().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(this.receiver){h.next=3;break}return this._currentBitrate=0,h.abrupt("return");case 3:return h.next=5,this.getReceiverStats();case 5:(d=h.sent)&&this.prevStats&&this.receiver&&(this._currentBitrate=Ed(d,this.prevStats)),this.prevStats=d;case 8:case"end":return h.stop()}},u,this)}))},c.audioContext=s,c.webAudioPluginNodes=[],a&&(c.sinkId=a.deviceId),c}return Lt(e,pS),ft(e,[{key:"setVolume",value:function(t){var n,r,s=dt(this.attachedElements);try{for(s.s();!(r=s.n()).done;){var a=r.value;this.audioContext?(n=this.gainNode)===null||n===void 0||n.gain.setTargetAtTime(t,0,.1):a.volume=t}}catch(o){s.e(o)}finally{s.f()}Ur()&&this._mediaStreamTrack._setVolume(t),this.elementVolume=t}},{key:"getVolume",value:function(){if(this.elementVolume)return this.elementVolume;if(Ur())return 1;var t=0;return this.attachedElements.forEach(function(n){n.volume>t&&(t=n.volume)}),t}},{key:"setSinkId",value:function(t){return he(this,void 0,void 0,L().mark(function n(){return L().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return this.sinkId=t,r.next=3,Promise.all(this.attachedElements.map(function(s){if(Um(s))return s.setSinkId(t)}));case 3:case"end":return r.stop()}},n,this)}))}},{key:"attach",value:function(t){var n=this.attachedElements.length===0;return t?pt(lt(e.prototype),"attach",this).call(this,t):t=pt(lt(e.prototype),"attach",this).call(this),this.sinkId&&Um(t)&&t.setSinkId(this.sinkId),this.audioContext&&n&&(this.log.debug("using audio context mapping",this.logContext),this.connectWebAudio(this.audioContext,t),t.volume=0,t.muted=!0),this.elementVolume&&this.setVolume(this.elementVolume),t}},{key:"detach",value:function(t){var n;return t?(n=pt(lt(e.prototype),"detach",this).call(this,t),this.audioContext&&(this.attachedElements.length>0?this.connectWebAudio(this.audioContext,this.attachedElements[0]):this.disconnectWebAudio())):(n=pt(lt(e.prototype),"detach",this).call(this),this.disconnectWebAudio()),n}},{key:"setAudioContext",value:function(t){this.audioContext=t,t&&this.attachedElements.length>0?this.connectWebAudio(t,this.attachedElements[0]):t||this.disconnectWebAudio()}},{key:"setWebAudioPlugins",value:function(t){this.webAudioPluginNodes=t,this.attachedElements.length>0&&this.audioContext&&this.connectWebAudio(this.audioContext,this.attachedElements[0])}},{key:"connectWebAudio",value:function(t,n){var r=this;this.disconnectWebAudio(),this.sourceNode=t.createMediaStreamSource(n.srcObject);var s=this.sourceNode;this.webAudioPluginNodes.forEach(function(a){s.connect(a),s=a}),this.gainNode=t.createGain(),s.connect(this.gainNode),this.gainNode.connect(t.destination),this.elementVolume&&this.gainNode.gain.setTargetAtTime(this.elementVolume,0,.1),t.state!=="running"&&t.resume().then(function(){t.state!=="running"&&r.emit($e.AudioPlaybackFailed,new Error("Audio Context couldn't be started automatically"))}).catch(function(a){r.emit($e.AudioPlaybackFailed,a)})}},{key:"disconnectWebAudio",value:function(){var t,n;(t=this.gainNode)===null||t===void 0||t.disconnect(),(n=this.sourceNode)===null||n===void 0||n.disconnect(),this.gainNode=void 0,this.sourceNode=void 0}},{key:"getReceiverStats",value:function(){return he(this,void 0,void 0,L().mark(function t(){var n;return L().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(this.receiver&&this.receiver.getStats){r.next=2;break}return r.abrupt("return");case 2:return r.next=4,this.receiver.getStats();case 4:return r.sent.forEach(function(s){s.type==="inbound-rtp"&&(n={type:"audio",timestamp:s.timestamp,jitter:s.jitter,bytesReceived:s.bytesReceived,concealedSamples:s.concealedSamples,concealmentEvents:s.concealmentEvents,silentConcealedSamples:s.silentConcealedSamples,silentConcealmentEvents:s.silentConcealmentEvents,totalAudioEnergy:s.totalAudioEnergy,totalSamplesDuration:s.totalSamplesDuration})}),r.abrupt("return",n);case 7:case"end":return r.stop()}},t,this)}))}}]),e}(),jl=function(i){function e(t,n,r,s,a){var o;return ht(this,e),(o=Rt(this,e,[t,n,Le.Kind.Video,r,a])).elementInfos=[],o.monitorReceiver=function(){return he(ct(o),void 0,void 0,L().mark(function c(){var u;return L().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(this.receiver){d.next=3;break}return this._currentBitrate=0,d.abrupt("return");case 3:return d.next=5,this.getReceiverStats();case 5:(u=d.sent)&&this.prevStats&&this.receiver&&(this._currentBitrate=Ed(u,this.prevStats)),this.prevStats=u;case 8:case"end":return d.stop()}},c,this)}))},o.debouncedHandleResize=Am(function(){o.updateDimensions()},100),o.adaptiveStreamSettings=s,o}return Lt(e,pS),ft(e,[{key:"isAdaptiveStream",get:function(){return this.adaptiveStreamSettings!==void 0}},{key:"mediaStreamTrack",get:function(){return this._mediaStreamTrack}},{key:"setMuted",value:function(t){var n=this;pt(lt(e.prototype),"setMuted",this).call(this,t),this.attachedElements.forEach(function(r){t?lo(n._mediaStreamTrack,r):oo(n._mediaStreamTrack,r)})}},{key:"attach",value:function(t){if(t?pt(lt(e.prototype),"attach",this).call(this,t):t=pt(lt(e.prototype),"attach",this).call(this),this.adaptiveStreamSettings&&this.elementInfos.find(function(r){return r.element===t})===void 0){var n=new iR(t);this.observeElementInfo(n)}return t}},{key:"observeElementInfo",value:function(t){var n=this;this.adaptiveStreamSettings&&this.elementInfos.find(function(r){return r===t})===void 0?(t.handleResize=function(){n.debouncedHandleResize()},t.handleVisibilityChanged=function(){n.updateVisibility()},this.elementInfos.push(t),t.observe(),this.debouncedHandleResize(),this.updateVisibility()):this.log.warn("visibility resize observer not triggered",this.logContext)}},{key:"stopObservingElementInfo",value:function(t){if(this.isAdaptiveStream){var n,r=this.elementInfos.filter(function(a){return a===t}),s=dt(r);try{for(s.s();!(n=s.n()).done;)n.value.stopObserving()}catch(a){s.e(a)}finally{s.f()}this.elementInfos=this.elementInfos.filter(function(a){return a!==t}),this.updateVisibility(),this.debouncedHandleResize()}else this.log.warn("stopObservingElementInfo ignored",this.logContext)}},{key:"detach",value:function(t){var n;if(t)return this.stopObservingElement(t),pt(lt(e.prototype),"detach",this).call(this,t);var r,s=dt(n=pt(lt(e.prototype),"detach",this).call(this));try{for(s.s();!(r=s.n()).done;){var a=r.value;this.stopObservingElement(a)}}catch(o){s.e(o)}finally{s.f()}return n}},{key:"getDecoderImplementation",value:function(){var t;return(t=this.prevStats)===null||t===void 0?void 0:t.decoderImplementation}},{key:"getReceiverStats",value:function(){return he(this,void 0,void 0,L().mark(function t(){var n,r,s,a;return L().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(this.receiver&&this.receiver.getStats){o.next=2;break}return o.abrupt("return");case 2:return o.next=4,this.receiver.getStats();case 4:return n=o.sent,s="",a=new Map,n.forEach(function(c){c.type==="inbound-rtp"?(s=c.codecId,r={type:"video",framesDecoded:c.framesDecoded,framesDropped:c.framesDropped,framesReceived:c.framesReceived,packetsReceived:c.packetsReceived,packetsLost:c.packetsLost,frameWidth:c.frameWidth,frameHeight:c.frameHeight,pliCount:c.pliCount,firCount:c.firCount,nackCount:c.nackCount,jitter:c.jitter,timestamp:c.timestamp,bytesReceived:c.bytesReceived,decoderImplementation:c.decoderImplementation}):c.type==="codec"&&a.set(c.id,c)}),r&&s!==""&&a.get(s)&&(r.mimeType=a.get(s).mimeType),o.abrupt("return",r);case 10:case"end":return o.stop()}},t,this)}))}},{key:"stopObservingElement",value:function(t){var n,r=this.elementInfos.filter(function(o){return o.element===t}),s=dt(r);try{for(s.s();!(n=s.n()).done;){var a=n.value;this.stopObservingElementInfo(a)}}catch(o){s.e(o)}finally{s.f()}}},{key:"handleAppVisibilityChanged",value:function(){var t=this,n=Object.create(null,{handleAppVisibilityChanged:{get:function(){return pt(lt(e.prototype),"handleAppVisibilityChanged",t)}}});return he(this,void 0,void 0,L().mark(function r(){return L().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,n.handleAppVisibilityChanged.call(this);case 2:if(this.isAdaptiveStream){s.next=4;break}return s.abrupt("return");case 4:this.updateVisibility();case 5:case"end":return s.stop()}},r,this)}))}},{key:"updateVisibility",value:function(){var t,n,r=this,s=this.elementInfos.reduce(function(u,d){return Math.max(u,d.visibilityChangedAt||0)},0),a=!((n=(t=this.adaptiveStreamSettings)===null||t===void 0?void 0:t.pauseVideoInBackground)!==null&&n!==void 0&&!n)&&this.isInBackground,o=this.elementInfos.some(function(u){return u.pictureInPicture}),c=this.elementInfos.some(function(u){return u.visible})&&!a||o;this.lastVisible!==c&&(c||Date.now()-s>=100?(this.lastVisible=c,this.emit($e.VisibilityChanged,c,this)):Nn.setTimeout(function(){r.updateVisibility()},100))}},{key:"updateDimensions",value:function(){var t,n,r,s=0,a=0,o=this.getPixelDensity(),c=dt(this.elementInfos);try{for(c.s();!(r=c.n()).done;){var u=r.value,d=u.width()*o,h=u.height()*o;d+h>s+a&&(s=d,a=h)}}catch(b){c.e(b)}finally{c.f()}((t=this.lastDimensions)===null||t===void 0?void 0:t.width)===s&&((n=this.lastDimensions)===null||n===void 0?void 0:n.height)===a||(this.lastDimensions={width:s,height:a},this.emit($e.VideoDimensionsChanged,this.lastDimensions,this))}},{key:"getPixelDensity",value:function(){var t,n=(t=this.adaptiveStreamSettings)===null||t===void 0?void 0:t.pixelDensity;return n==="screen"?UT():n||(UT()>2?2:1)}}]),e}(),iR=function(){function i(e,t){var n=this;ht(this,i),this.onVisibilityChanged=function(r){var s,a=r.target,o=r.isIntersecting;a===n.element&&(n.isIntersecting=o,n.visibilityChangedAt=Date.now(),(s=n.handleVisibilityChanged)===null||s===void 0||s.call(n))},this.onEnterPiP=function(){var r;n.isPiP=!0,(r=n.handleVisibilityChanged)===null||r===void 0||r.call(n)},this.onLeavePiP=function(){var r;n.isPiP=!1,(r=n.handleVisibilityChanged)===null||r===void 0||r.call(n)},this.element=e,this.isIntersecting=t??mS(e),this.isPiP=yi()&&document.pictureInPictureElement===e,this.visibilityChangedAt=0}return ft(i,[{key:"visible",get:function(){return this.isPiP||this.isIntersecting}},{key:"pictureInPicture",get:function(){return this.isPiP}},{key:"width",value:function(){return this.element.clientWidth}},{key:"height",value:function(){return this.element.clientHeight}},{key:"observe",value:function(){var e=this;this.isIntersecting=mS(this.element),this.isPiP=document.pictureInPictureElement===this.element,this.element.handleResize=function(){var t;(t=e.handleResize)===null||t===void 0||t.call(e)},this.element.handleVisibilityChanged=this.onVisibilityChanged,VT().observe(this.element),FT().observe(this.element),this.element.addEventListener("enterpictureinpicture",this.onEnterPiP),this.element.addEventListener("leavepictureinpicture",this.onLeavePiP)}},{key:"stopObserving",value:function(){var e,t;(e=VT())===null||e===void 0||e.unobserve(this.element),(t=FT())===null||t===void 0||t.unobserve(this.element),this.element.removeEventListener("enterpictureinpicture",this.onEnterPiP),this.element.removeEventListener("leavepictureinpicture",this.onLeavePiP)}}]),i}();function mS(i){for(var e=i.offsetTop,t=i.offsetLeft,n=i.offsetWidth,r=i.offsetHeight,s=i.hidden,a=getComputedStyle(i),o=a.opacity,c=a.display;i.offsetParent;)e+=(i=i.offsetParent).offsetTop,t+=i.offsetLeft;return e<window.pageYOffset+window.innerHeight&&t<window.pageXOffset+window.innerWidth&&e+r>window.pageYOffset&&t+n>window.pageXOffset&&!s&&(o===""||parseFloat(o)>0)&&c!=="none"}var Vr=function(i){function e(t,n,r,s){var a,o;return ht(this,e),(a=Rt(this,e)).metadataMuted=!1,a.encryption=Ni.NONE,a.log=Ct,a.handleMuted=function(){a.emit($e.Muted)},a.handleUnmuted=function(){a.emit($e.Unmuted)},a.log=Lr((o=s==null?void 0:s.loggerName)!==null&&o!==void 0?o:Wi.Publication),a.loggerContextCb=a.loggerContextCb,a.setMaxListeners(100),a.kind=t,a.trackSid=n,a.trackName=r,a.source=Le.Source.Unknown,a}return Lt(e,Ys.EventEmitter),ft(e,[{key:"setTrack",value:function(t){this.track&&(this.track.off($e.Muted,this.handleMuted),this.track.off($e.Unmuted,this.handleUnmuted)),this.track=t,t&&(t.on($e.Muted,this.handleMuted),t.on($e.Unmuted,this.handleUnmuted))}},{key:"logContext",get:function(){var t;return Object.assign(Object.assign({},(t=this.loggerContextCb)===null||t===void 0?void 0:t.call(this)),Vt(this))}},{key:"isMuted",get:function(){return this.metadataMuted}},{key:"isEnabled",get:function(){return!0}},{key:"isSubscribed",get:function(){return this.track!==void 0}},{key:"isEncrypted",get:function(){return this.encryption!==Ni.NONE}},{key:"audioTrack",get:function(){if(this.track instanceof Pn||this.track instanceof Vl)return this.track}},{key:"videoTrack",get:function(){if(this.track instanceof Hn||this.track instanceof jl)return this.track}},{key:"updateInfo",value:function(t){this.trackSid=t.sid,this.trackName=t.name,this.source=Le.sourceFromProto(t.source),this.mimeType=t.mimeType,this.kind===Le.Kind.Video&&t.width>0&&(this.dimensions={width:t.width,height:t.height},this.simulcasted=t.simulcast),this.encryption=t.encryption,this.trackInfo=t,this.log.debug("update publication info",Object.assign(Object.assign({},this.logContext),{info:t}))}}]),e}();(function(i){var e,t;(e=i.SubscriptionStatus||(i.SubscriptionStatus={})).Desired="desired",e.Subscribed="subscribed",e.Unsubscribed="unsubscribed",(t=i.PermissionStatus||(i.PermissionStatus={})).Allowed="allowed",t.NotAllowed="not_allowed"})(Vr||(Vr={}));var ms,wd=function(i){function e(t,n,r,s){var a;return ht(this,e),(a=Rt(this,e,[t,n.sid,n.name,s])).track=void 0,a.handleTrackEnded=function(){a.emit($e.Ended)},a.updateInfo(n),a.setTrack(r),a}return Lt(e,Vr),ft(e,[{key:"isUpstreamPaused",get:function(){var t;return(t=this.track)===null||t===void 0?void 0:t.isUpstreamPaused}},{key:"setTrack",value:function(t){this.track&&this.track.off($e.Ended,this.handleTrackEnded),pt(lt(e.prototype),"setTrack",this).call(this,t),t&&t.on($e.Ended,this.handleTrackEnded)}},{key:"isMuted",get:function(){return this.track?this.track.isMuted:pt(lt(e.prototype),"isMuted",this)}},{key:"audioTrack",get:function(){return pt(lt(e.prototype),"audioTrack",this)}},{key:"videoTrack",get:function(){return pt(lt(e.prototype),"videoTrack",this)}},{key:"mute",value:function(){return he(this,void 0,void 0,L().mark(function t(){var n;return L().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(n=this.track)===null||n===void 0?void 0:n.mute());case 1:case"end":return r.stop()}},t,this)}))}},{key:"unmute",value:function(){return he(this,void 0,void 0,L().mark(function t(){var n;return L().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(n=this.track)===null||n===void 0?void 0:n.unmute());case 1:case"end":return r.stop()}},t,this)}))}},{key:"pauseUpstream",value:function(){return he(this,void 0,void 0,L().mark(function t(){var n;return L().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,(n=this.track)===null||n===void 0?void 0:n.pauseUpstream();case 2:case"end":return r.stop()}},t,this)}))}},{key:"resumeUpstream",value:function(){return he(this,void 0,void 0,L().mark(function t(){var n;return L().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,(n=this.track)===null||n===void 0?void 0:n.resumeUpstream();case 2:case"end":return r.stop()}},t,this)}))}},{key:"getTrackFeatures",value:function(){var t;if(this.track instanceof Pn){var n=this.track.mediaStreamTrack.getSettings(),r=new Set;return n.autoGainControl&&r.add(pr.TF_AUTO_GAIN_CONTROL),n.echoCancellation&&r.add(pr.TF_ECHO_CANCELLATION),n.noiseSuppression&&r.add(pr.TF_NOISE_SUPPRESSION),n.channelCount&&n.channelCount>1&&r.add(pr.TF_STEREO),!((t=this.options)===null||t===void 0)&&t.dtx||r.add(pr.TF_NO_DTX),this.track.enhancedNoiseCancellation&&r.add(pr.TF_ENHANCED_NOISE_CANCELLATION),Array.from(r.values())}return[]}}]),e}();function gS(i){var e,t;return et(i.audio)==="object"&&i.audio.processor&&(e=i.audio.processor),et(i.video)==="object"&&i.video.processor&&(t=i.video.processor),{audioProcessor:e,videoProcessor:t}}function rR(i){return he(this,void 0,void 0,L().mark(function e(){var t,n,r,s,a,o,c,u,d,h=this;return L().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:return i!=null||(i={}),(t=i.audio)!==null&&t!==void 0||(i.audio=!0),(n=i.video)!==null&&n!==void 0||(i.video=!0),r=gS(i),s=r.audioProcessor,a=r.videoProcessor,o=NT(i,nS,iS),c=Td(o),u=navigator.mediaDevices.getUserMedia(c),i.audio&&(yr.userMediaPromiseMap.set("audioinput",u),u.catch(function(){return yr.userMediaPromiseMap.delete("audioinput")})),i.video&&(yr.userMediaPromiseMap.set("videoinput",u),u.catch(function(){return yr.userMediaPromiseMap.delete("videoinput")})),b.next=11,u;case 11:return d=b.sent,b.abrupt("return",Promise.all(d.getTracks().map(function(v){return he(h,void 0,void 0,L().mark(function y(){var p,f,m,_;return L().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if((p=v.kind==="audio")?o.audio:o.video,typeof(m=p?c.audio:c.video)!="boolean"&&(f=m),f?f.deviceId=v.getSettings().deviceId:f={deviceId:v.getSettings().deviceId},(_=rS(v,f)).kind===Le.Kind.Video?_.source=Le.Source.Camera:_.kind===Le.Kind.Audio&&(_.source=Le.Source.Microphone),_.mediaStream=d,!(_ instanceof Pn&&s)){k.next=13;break}return k.next=11,_.setProcessor(s);case 11:k.next=16;break;case 13:if(!(_ instanceof Hn&&a)){k.next=16;break}return k.next=16,_.setProcessor(a);case 16:return k.abrupt("return",_);case 17:case"end":return k.stop()}},y)}))})));case 13:case"end":return b.stop()}},e)}))}(function(i){i.Excellent="excellent",i.Good="good",i.Poor="poor",i.Lost="lost",i.Unknown="unknown"})(ms||(ms={}));var vS=function(i){function e(t,n,r,s,a){var o;ht(this,e);var c,u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:ld.STANDARD;return(o=Rt(this,e)).audioLevel=0,o.isSpeaking=!1,o._connectionQuality=ms.Unknown,o.log=Ct,o.log=Lr((c=a==null?void 0:a.loggerName)!==null&&c!==void 0?c:Wi.Participant),o.loggerOptions=a,o.setMaxListeners(100),o.sid=t,o.identity=n,o.name=r,o.metadata=s,o.audioTrackPublications=new Map,o.videoTrackPublications=new Map,o.trackPublications=new Map,o._kind=u,o._attributes={},o}return Lt(e,Ys.EventEmitter),ft(e,[{key:"logContext",get:function(){var t,n;return Object.assign({},(n=(t=this.loggerOptions)===null||t===void 0?void 0:t.loggerContextCb)===null||n===void 0?void 0:n.call(t))}},{key:"isEncrypted",get:function(){return this.trackPublications.size>0&&Array.from(this.trackPublications.values()).every(function(t){return t.isEncrypted})}},{key:"isAgent",get:function(){var t;return((t=this.permissions)===null||t===void 0?void 0:t.agent)||this.kind===ld.AGENT}},{key:"kind",get:function(){return this._kind}},{key:"attributes",get:function(){return Object.freeze(Object.assign({},this._attributes))}},{key:"getTrackPublications",value:function(){return Array.from(this.trackPublications.values())}},{key:"getTrackPublication",value:function(t){var n,r=dt(this.trackPublications);try{for(r.s();!(n=r.n()).done;){var s=At(n.value,2)[1];if(s.source===t)return s}}catch(a){r.e(a)}finally{r.f()}}},{key:"getTrackPublicationByName",value:function(t){var n,r=dt(this.trackPublications);try{for(r.s();!(n=r.n()).done;){var s=At(n.value,2)[1];if(s.trackName===t)return s}}catch(a){r.e(a)}finally{r.f()}}},{key:"connectionQuality",get:function(){return this._connectionQuality}},{key:"isCameraEnabled",get:function(){var t,n=this.getTrackPublication(Le.Source.Camera);return!((t=n==null?void 0:n.isMuted)===null||t===void 0||t)}},{key:"isMicrophoneEnabled",get:function(){var t,n=this.getTrackPublication(Le.Source.Microphone);return!((t=n==null?void 0:n.isMuted)===null||t===void 0||t)}},{key:"isScreenShareEnabled",get:function(){return!!this.getTrackPublication(Le.Source.ScreenShare)}},{key:"isLocal",get:function(){return!1}},{key:"joinedAt",get:function(){return this.participantInfo?new Date(1e3*Number.parseInt(this.participantInfo.joinedAt.toString())):new Date}},{key:"updateInfo",value:function(t){return(!this.participantInfo||this.participantInfo.sid!==t.sid||this.participantInfo.version<=t.version)&&(this.identity=t.identity,this.sid=t.sid,this._setName(t.name),this._setMetadata(t.metadata),this._setAttributes(t.attributes),t.permission&&this.setPermissions(t.permission),this.participantInfo=t,this.log.trace("update participant info",Object.assign(Object.assign({},this.logContext),{info:t})),!0)}},{key:"_setMetadata",value:function(t){var n=this.metadata!==t,r=this.metadata;this.metadata=t,n&&this.emit(qe.ParticipantMetadataChanged,r)}},{key:"_setName",value:function(t){var n=this.name!==t;this.name=t,n&&this.emit(qe.ParticipantNameChanged,t)}},{key:"_setAttributes",value:function(t){var n=function(r,s){var a;r===void 0&&(r={}),s===void 0&&(s={});var o,c={},u=dt([].concat(Ii(Object.keys(s)),Ii(Object.keys(r))));try{for(u.s();!(o=u.n()).done;){var d=o.value;r[d]!==s[d]&&(c[d]=(a=s[d])!==null&&a!==void 0?a:"")}}catch(h){u.e(h)}finally{u.f()}return c}(this.attributes,t);this._attributes=t,Object.keys(n).length>0&&this.emit(qe.AttributesChanged,n)}},{key:"setPermissions",value:function(t){var n,r,s,a,o,c,u=this,d=this.permissions,h=t.canPublish!==((n=this.permissions)===null||n===void 0?void 0:n.canPublish)||t.canSubscribe!==((r=this.permissions)===null||r===void 0?void 0:r.canSubscribe)||t.canPublishData!==((s=this.permissions)===null||s===void 0?void 0:s.canPublishData)||t.hidden!==((a=this.permissions)===null||a===void 0?void 0:a.hidden)||t.recorder!==((o=this.permissions)===null||o===void 0?void 0:o.recorder)||t.canPublishSources.length!==this.permissions.canPublishSources.length||t.canPublishSources.some(function(b,v){var y;return b!==((y=u.permissions)===null||y===void 0?void 0:y.canPublishSources[v])})||t.canSubscribeMetrics!==((c=this.permissions)===null||c===void 0?void 0:c.canSubscribeMetrics);return this.permissions=t,h&&this.emit(qe.ParticipantPermissionsChanged,d),h}},{key:"setIsSpeaking",value:function(t){t!==this.isSpeaking&&(this.isSpeaking=t,t&&(this.lastSpokeAt=new Date),this.emit(qe.IsSpeakingChanged,t))}},{key:"setConnectionQuality",value:function(t){var n=this._connectionQuality;this._connectionQuality=function(r){switch(r){case Al.EXCELLENT:return ms.Excellent;case Al.GOOD:return ms.Good;case Al.POOR:return ms.Poor;case Al.LOST:return ms.Lost;default:return ms.Unknown}}(t),n!==this._connectionQuality&&this.emit(qe.ConnectionQualityChanged,this._connectionQuality)}},{key:"setAudioContext",value:function(t){this.audioContext=t,this.audioTrackPublications.forEach(function(n){return(n.track instanceof Vl||n.track instanceof Pn)&&n.track.setAudioContext(t)})}},{key:"addTrackPublication",value:function(t){var n=this;t.on($e.Muted,function(){n.emit(qe.TrackMuted,t)}),t.on($e.Unmuted,function(){n.emit(qe.TrackUnmuted,t)});var r=t;switch(r.track&&(r.track.sid=t.trackSid),this.trackPublications.set(t.trackSid,t),t.kind){case Le.Kind.Audio:this.audioTrackPublications.set(t.trackSid,t);break;case Le.Kind.Video:this.videoTrackPublications.set(t.trackSid,t);break}}}]),e}(),Ut,yS=function(i){function e(t,n,r,s){var a;return ht(this,e),(a=Rt(this,e,[t,n,void 0,void 0,{loggerName:s.loggerName,loggerContextCb:function(){return a.engine.logContext}}])).pendingPublishing=new Set,a.pendingPublishPromises=new Map,a.participantTrackPermissions=[],a.allParticipantsAllowedToSubscribe=!0,a.encryptionType=Ni.NONE,a.enabledPublishVideoCodecs=[],a.handleReconnecting=function(){a.reconnectFuture||(a.reconnectFuture=new $T)},a.handleReconnected=function(){var o,c;(c=(o=a.reconnectFuture)===null||o===void 0?void 0:o.resolve)===null||c===void 0||c.call(o),a.reconnectFuture=void 0,a.updateTrackSubscriptionPermissions()},a.handleDisconnected=function(){var o,c;a.reconnectFuture&&(a.reconnectFuture.promise.catch(function(u){return a.log.warn(u.message,a.logContext)}),(c=(o=a.reconnectFuture)===null||o===void 0?void 0:o.reject)===null||c===void 0||c.call(o,"Got disconnected during reconnection attempt"),a.reconnectFuture=void 0)},a.handleSignalRequestResponse=function(o){var c=o.requestId,u=o.reason,d=o.message,h=a.pendingSignalRequests.get(c);h&&(u!==Lk.OK&&h.reject(new AT(d,u)),a.pendingSignalRequests.delete(c))},a.updateTrackSubscriptionPermissions=function(){a.log.debug("updating track subscription permissions",Object.assign(Object.assign({},a.logContext),{allParticipantsAllowed:a.allParticipantsAllowedToSubscribe,participantTrackPermissions:a.participantTrackPermissions})),a.engine.client.sendUpdateSubscriptionPermissions(a.allParticipantsAllowedToSubscribe,a.participantTrackPermissions.map(function(o){return function(c){var u,d,h;if(!c.participantSid&&!c.participantIdentity)throw new Error("Invalid track permission, must provide at least one of participantIdentity and participantSid");return new Nk({participantIdentity:(u=c.participantIdentity)!==null&&u!==void 0?u:"",participantSid:(d=c.participantSid)!==null&&d!==void 0?d:"",allTracks:(h=c.allowAll)!==null&&h!==void 0&&h,trackSids:c.allowedTrackSids||[]})}(o)}))},a.onTrackUnmuted=function(o){a.onTrackMuted(o,o.isUpstreamPaused)},a.onTrackMuted=function(o,c){c===void 0&&(c=!0),o.sid?a.engine.updateMuteStatus(o.sid,c):a.log.error("could not update mute status for unpublished track",Object.assign(Object.assign({},a.logContext),Vt(o)))},a.onTrackUpstreamPaused=function(o){a.log.debug("upstream paused",Object.assign(Object.assign({},a.logContext),Vt(o))),a.onTrackMuted(o,!0)},a.onTrackUpstreamResumed=function(o){a.log.debug("upstream resumed",Object.assign(Object.assign({},a.logContext),Vt(o))),a.onTrackMuted(o,o.isMuted)},a.onTrackFeatureUpdate=function(o){var c=a.audioTrackPublications.get(o.sid);c?a.engine.client.sendUpdateLocalAudioTrack(c.trackSid,c.getTrackFeatures()):a.log.warn("Could not update local audio track settings, missing publication for track ".concat(o.sid),a.logContext)},a.handleSubscribedQualityUpdate=function(o){return he(ct(a),void 0,void 0,L().mark(function c(){var u,d,h,b,v,y,p,f,m,_,k,D;return L().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:if(!((v=this.roomOptions)===null||v===void 0)&&v.dynacast){E.next=2;break}return E.abrupt("return");case 2:if(p=this.videoTrackPublications.get(o.trackSid)){E.next=6;break}return this.log.warn("received subscribed quality update for unknown track",Object.assign(Object.assign({},this.logContext),{trackSid:o.trackSid})),E.abrupt("return");case 6:if(o.subscribedCodecs.length<=0){E.next=46;break}if(p.videoTrack){E.next=9;break}return E.abrupt("return");case 9:return E.next=11,p.videoTrack.setPublishingCodecs(o.subscribedCodecs);case 11:f=E.sent,E.prev=12,m=!0,_=so(f);case 14:return E.next=16,_.next();case 16:if(k=E.sent,u=k.done){E.next=29;break}if(b=k.value,m=!1,!w9(D=b)){E.next=26;break}return this.log.debug("publish ".concat(D," for ").concat(p.videoTrack.sid),Object.assign(Object.assign({},this.logContext),Vt(p))),E.next=26,this.publishAdditionalCodecForTrack(p.videoTrack,D,p.options);case 26:m=!0,E.next=14;break;case 29:E.next=34;break;case 31:E.prev=31,E.t0=E.catch(12),d={error:E.t0};case 34:if(E.prev=34,E.prev=35,m||u||!(h=_.return)){E.next=39;break}return E.next=39,h.call(_);case 39:if(E.prev=39,!d){E.next=42;break}throw d.error;case 42:return E.finish(39);case 43:return E.finish(34);case 44:E.next=49;break;case 46:if(o.subscribedQualities.length<=0){E.next=49;break}return E.next=49,(y=p.videoTrack)===null||y===void 0?void 0:y.setPublishingLayers(o.subscribedQualities);case 49:case"end":return E.stop()}},c,this,[[12,31,34,44],[35,,39,43]])}))},a.handleLocalTrackUnpublished=function(o){var c=a.trackPublications.get(o.trackSid);c?a.unpublishTrack(c.track):a.log.warn("received unpublished event for unknown track",Object.assign(Object.assign({},a.logContext),{trackSid:o.trackSid}))},a.handleTrackEnded=function(o){return he(ct(a),void 0,void 0,L().mark(function c(){var u;return L().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(o.source!==Le.Source.ScreenShare&&o.source!==Le.Source.ScreenShareAudio){d.next=5;break}this.log.debug("unpublishing local track due to TrackEnded",Object.assign(Object.assign({},this.logContext),Vt(o))),this.unpublishTrack(o),d.next=41;break;case 5:if(!o.isUserProvided){d.next=10;break}return d.next=8,o.mute();case 8:d.next=41;break;case 10:if(!(o instanceof Pn||o instanceof Hn)){d.next=41;break}if(d.prev=11,!yi()){d.next=25;break}return d.prev=13,d.next=16,navigator==null?void 0:navigator.permissions.query({name:o.source===Le.Source.Camera?"camera":"microphone"});case 16:if(!(u=d.sent)||u.state!=="denied"){d.next=21;break}throw this.log.warn("user has revoked access to ".concat(o.source),Object.assign(Object.assign({},this.logContext),Vt(o))),u.onchange=function(){u.state!=="denied"&&(o.isMuted||o.restartTrack(),u.onchange=null)},new Error("GetUserMedia Permission denied");case 21:d.next=25;break;case 23:d.prev=23,d.t0=d.catch(13);case 25:if(o.isMuted){d.next=34;break}if(this.log.debug("track ended, attempting to use a different device",Object.assign(Object.assign({},this.logContext),Vt(o))),!(o instanceof Pn)){d.next=32;break}return d.next=30,o.restartTrack({deviceId:"default"});case 30:d.next=34;break;case 32:return d.next=34,o.restartTrack();case 34:d.next=41;break;case 36:return d.prev=36,d.t1=d.catch(11),this.log.warn("could not restart track, muting instead",Object.assign(Object.assign({},this.logContext),Vt(o))),d.next=41,o.mute();case 41:case"end":return d.stop()}},c,this,[[11,36],[13,23]])}))},a.audioTrackPublications=new Map,a.videoTrackPublications=new Map,a.trackPublications=new Map,a.engine=r,a.roomOptions=s,a.setupEngine(r),a.activeDeviceMap=new Map,a.pendingSignalRequests=new Map,a}return Lt(e,vS),ft(e,[{key:"lastCameraError",get:function(){return this.cameraError}},{key:"lastMicrophoneError",get:function(){return this.microphoneError}},{key:"isE2EEEnabled",get:function(){return this.encryptionType!==Ni.NONE}},{key:"getTrackPublication",value:function(t){var n=pt(lt(e.prototype),"getTrackPublication",this).call(this,t);if(n)return n}},{key:"getTrackPublicationByName",value:function(t){var n=pt(lt(e.prototype),"getTrackPublicationByName",this).call(this,t);if(n)return n}},{key:"setupEngine",value:function(t){var n=this;this.engine=t,this.engine.on(Qe.RemoteMute,function(r,s){var a=n.trackPublications.get(r);a&&a.track&&(s?a.mute():a.unmute())}),this.engine.on(Qe.Connected,this.handleReconnected).on(Qe.SignalRestarted,this.handleReconnected).on(Qe.SignalResumed,this.handleReconnected).on(Qe.Restarting,this.handleReconnecting).on(Qe.Resuming,this.handleReconnecting).on(Qe.LocalTrackUnpublished,this.handleLocalTrackUnpublished).on(Qe.SubscribedQualityUpdate,this.handleSubscribedQualityUpdate).on(Qe.Disconnected,this.handleDisconnected).on(Qe.SignalRequestResponse,this.handleSignalRequestResponse)}},{key:"setMetadata",value:function(t){return he(this,void 0,void 0,L().mark(function n(){return L().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.requestMetadataUpdate({metadata:t});case 2:case"end":return r.stop()}},n,this)}))}},{key:"setName",value:function(t){return he(this,void 0,void 0,L().mark(function n(){return L().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.requestMetadataUpdate({name:t});case 2:case"end":return r.stop()}},n,this)}))}},{key:"setAttributes",value:function(t){return he(this,void 0,void 0,L().mark(function n(){return L().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.requestMetadataUpdate({attributes:t});case 2:case"end":return r.stop()}},n,this)}))}},{key:"requestMetadataUpdate",value:function(t){return he(this,arguments,void 0,function(n){var r=this,s=n.metadata,a=n.name,o=n.attributes;return L().mark(function c(){return L().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return u.abrupt("return",new Promise(function(d,h){return he(r,void 0,void 0,L().mark(function b(){var v,y,p,f,m,_=this;return L().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return k.prev=0,p=!1,k.next=4,this.engine.client.sendUpdateLocalMetadata((v=s??this.metadata)!==null&&v!==void 0?v:"",(y=a??this.name)!==null&&y!==void 0?y:"",o);case 4:f=k.sent,m=performance.now(),this.pendingSignalRequests.set(f,{resolve:d,reject:function(D){h(D),p=!0},values:{name:a,metadata:s,attributes:o}});case 7:if(performance.now()-m>=5e3||p){k.next=16;break}if(a&&this.name!==a||s&&this.metadata!==s||o&&!Object.entries(o).every(function(D){var E=At(D,2),A=E[0],w=E[1];return _.attributes[A]===w||w===""&&!_.attributes[A]})){k.next=12;break}return this.pendingSignalRequests.delete(f),d(),k.abrupt("return");case 12:return k.next=14,vr(50);case 14:k.next=7;break;case 16:h(new AT("Request to update local metadata timed out","TimeoutError")),k.next=22;break;case 19:k.prev=19,k.t0=k.catch(0),k.t0 instanceof Error&&h(k.t0);case 22:case"end":return k.stop()}},b,this,[[0,19]])}))}));case 1:case"end":return u.stop()}},c)})()})}},{key:"setCameraEnabled",value:function(t,n,r){return this.setTrackEnabled(Le.Source.Camera,t,n,r)}},{key:"setMicrophoneEnabled",value:function(t,n,r){return this.setTrackEnabled(Le.Source.Microphone,t,n,r)}},{key:"setScreenShareEnabled",value:function(t,n,r){return this.setTrackEnabled(Le.Source.ScreenShare,t,n,r)}},{key:"setPermissions",value:function(t){var n=this.permissions,r=pt(lt(e.prototype),"setPermissions",this).call(this,t);return r&&n&&this.emit(qe.ParticipantPermissionsChanged,n),r}},{key:"setE2EEEnabled",value:function(t){return he(this,void 0,void 0,L().mark(function n(){return L().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return this.encryptionType=t?Ni.GCM:Ni.NONE,r.next=3,this.republishAllTracks(void 0,!1);case 3:case"end":return r.stop()}},n,this)}))}},{key:"setTrackEnabled",value:function(t,n,r,s){return he(this,void 0,void 0,L().mark(function a(){var o,c,u,d,h,b,v,y,p,f,m,_;return L().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if(this.log.debug("setTrackEnabled",Object.assign(Object.assign({},this.logContext),{source:t,enabled:n})),!this.republishPromise){k.next=4;break}return k.next=4,this.republishPromise;case 4:if(u=this.getTrackPublication(t),!n){k.next=57;break}if(!u){k.next=11;break}return k.next=9,u.unmute();case 9:k.next=55;break;case 11:if(!this.pendingPublishing.has(t)){k.next=19;break}return k.next=14,this.waitForPendingPublicationOfSource(t);case 14:return(h=k.sent)||this.log.info("skipping duplicate published source",Object.assign(Object.assign({},this.logContext),{source:t})),k.next=18,h==null?void 0:h.unmute();case 18:return k.abrupt("return",h);case 19:this.pendingPublishing.add(t),k.prev=20,k.t0=t,k.next=k.t0===Le.Source.Camera?24:k.t0===Le.Source.Microphone?28:k.t0===Le.Source.ScreenShare?32:36;break;case 24:return k.next=26,this.createTracks({video:(o=r)===null||o===void 0||o});case 26:return d=k.sent,k.abrupt("break",37);case 28:return k.next=30,this.createTracks({audio:(c=r)===null||c===void 0||c});case 30:return d=k.sent,k.abrupt("break",37);case 32:return k.next=34,this.createScreenTracks(Object.assign({},r));case 34:return d=k.sent,k.abrupt("break",37);case 36:throw new gr(t);case 37:b=[],v=dt(d);try{for(v.s();!(y=v.n()).done;)p=y.value,this.log.info("publishing track",Object.assign(Object.assign({},this.logContext),Vt(p))),b.push(this.publishTrack(p,s))}catch(D){v.e(D)}finally{v.f()}return k.next=42,Promise.all(b);case 42:f=k.sent,m=At(f,1),u=m[0],k.next=52;break;case 47:throw k.prev=47,k.t1=k.catch(20),d==null||d.forEach(function(D){D.stop()}),k.t1 instanceof Error&&!(k.t1 instanceof gr)&&this.emit(qe.MediaDevicesError,k.t1),k.t1;case 52:return k.prev=52,this.pendingPublishing.delete(t),k.finish(52);case 55:k.next=72;break;case 57:if(u!=null&&u.track){k.next=61;break}return k.next=60,this.waitForPendingPublicationOfSource(t);case 60:u=k.sent;case 61:if(!u||!u.track){k.next=72;break}if(t!==Le.Source.ScreenShare){k.next=70;break}return k.next=65,this.unpublishTrack(u.track);case 65:u=k.sent,(_=this.getTrackPublication(Le.Source.ScreenShareAudio))&&_.track&&this.unpublishTrack(_.track),k.next=72;break;case 70:return k.next=72,u.mute();case 72:return k.abrupt("return",u);case 73:case"end":return k.stop()}},a,this,[[20,47,52,55]])}))}},{key:"enableCameraAndMicrophone",value:function(){return he(this,void 0,void 0,L().mark(function t(){var n,r=this;return L().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(!this.pendingPublishing.has(Le.Source.Camera)&&!this.pendingPublishing.has(Le.Source.Microphone)){s.next=2;break}return s.abrupt("return");case 2:return this.pendingPublishing.add(Le.Source.Camera),this.pendingPublishing.add(Le.Source.Microphone),s.prev=4,s.next=7,this.createTracks({audio:!0,video:!0});case 7:return n=s.sent,s.next=10,Promise.all(n.map(function(a){return r.publishTrack(a)}));case 10:return s.prev=10,this.pendingPublishing.delete(Le.Source.Camera),this.pendingPublishing.delete(Le.Source.Microphone),s.finish(10);case 14:case"end":return s.stop()}},t,this,[[4,,10,14]])}))}},{key:"createTracks",value:function(t){return he(this,void 0,void 0,L().mark(function n(){var r,s,a,o,c,u,d,h,b=this;return L().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return t!=null||(t={}),a=gS(t),o=a.audioProcessor,c=a.videoProcessor,u=NT(t,(r=this.roomOptions)===null||r===void 0?void 0:r.audioCaptureDefaults,(s=this.roomOptions)===null||s===void 0?void 0:s.videoCaptureDefaults),d=Td(u),v.prev=4,v.next=7,navigator.mediaDevices.getUserMedia(d);case 7:h=v.sent,v.next=14;break;case 10:throw v.prev=10,v.t0=v.catch(4),v.t0 instanceof Error&&(d.audio&&(this.microphoneError=v.t0),d.video&&(this.cameraError=v.t0)),v.t0;case 14:return d.audio&&(this.microphoneError=void 0,this.emit(qe.AudioStreamAcquired)),d.video&&(this.cameraError=void 0),v.abrupt("return",Promise.all(h.getTracks().map(function(y){return he(b,void 0,void 0,L().mark(function p(){var f,m,_,k,D=this;return L().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:if((f=y.kind==="audio")?u.audio:u.video,typeof(_=f?d.audio:d.video)!="boolean"&&(m=_),(k=rS(y,m,{loggerName:this.roomOptions.loggerName,loggerContextCb:function(){return D.logContext}})).kind===Le.Kind.Video?k.source=Le.Source.Camera:k.kind===Le.Kind.Audio&&(k.source=Le.Source.Microphone,k.setAudioContext(this.audioContext)),k.mediaStream=h,!(k instanceof Pn&&o)){E.next=12;break}return E.next=10,k.setProcessor(o);case 10:E.next=15;break;case 12:if(!(k instanceof Hn&&c)){E.next=15;break}return E.next=15,k.setProcessor(c);case 15:return E.abrupt("return",k);case 16:case"end":return E.stop()}},p,this)}))})));case 17:case"end":return v.stop()}},n,this,[[4,10]])}))}},{key:"createScreenTracks",value:function(t){return he(this,void 0,void 0,L().mark(function n(){var r,s,a,o,c,u,d=this;return L().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:if(t===void 0&&(t={}),navigator.mediaDevices.getDisplayMedia!==void 0){h.next=3;break}throw new wm("getDisplayMedia not supported");case 3:return t.resolution!==void 0||(b=void 0,((b=Br())==null?void 0:b.name)==="Safari"&&b.version.startsWith("17."))||(t.resolution=Mm.h1080fps30.resolution),r=A9(t),h.next=7,navigator.mediaDevices.getDisplayMedia(r);case 7:if(s=h.sent,(a=s.getVideoTracks()).length!==0){h.next=11;break}throw new gr("no video track found");case 11:return(o=new Hn(a[0],void 0,!1,{loggerName:this.roomOptions.loggerName,loggerContextCb:function(){return d.logContext}})).source=Le.Source.ScreenShare,t.contentHint&&(o.mediaStreamTrack.contentHint=t.contentHint),c=[o],s.getAudioTracks().length>0&&(this.emit(qe.AudioStreamAcquired),(u=new Pn(s.getAudioTracks()[0],void 0,!1,this.audioContext,{loggerName:this.roomOptions.loggerName,loggerContextCb:function(){return d.logContext}})).source=Le.Source.ScreenShareAudio,c.push(u)),h.abrupt("return",c);case 17:case"end":return h.stop()}var b},n,this)}))}},{key:"publishTrack",value:function(t,n){return he(this,void 0,void 0,L().mark(function r(){return L().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.abrupt("return",this.publishOrRepublishTrack(t,n));case 1:case"end":return s.stop()}},r,this)}))}},{key:"publishOrRepublishTrack",value:function(t,n){return he(this,arguments,void 0,function(r,s){var a=this,o=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return L().mark(function c(){var u,d,h,b,v,y,p,f,m,_,k,D;return L().wrap(function(E){for(;;)switch(E.prev=E.next){case 0:return r instanceof Pn&&r.setAudioContext(a.audioContext),E.next=3,(u=a.reconnectFuture)===null||u===void 0?void 0:u.promise;case 3:if(!a.republishPromise||o){E.next=6;break}return E.next=6,a.republishPromise;case 6:if(!(r instanceof uo&&a.pendingPublishPromises.has(r))){E.next=9;break}return E.next=9,a.pendingPublishPromises.get(r);case 9:if(!(r instanceof MediaStreamTrack)){E.next=13;break}v=r.getConstraints(),E.next=22;break;case 13:v=r.constraints,y=void 0,E.t0=r.source,E.next=E.t0===Le.Source.Microphone?18:E.t0===Le.Source.Camera?20:21;break;case 18:return y="audioinput",E.abrupt("break",21);case 20:y="videoinput";case 21:y&&a.activeDeviceMap.has(y)&&(v=Object.assign(Object.assign({},v),{deviceId:a.activeDeviceMap.get(y)}));case 22:if(!(r instanceof MediaStreamTrack)){E.next=33;break}E.t1=r.kind,E.next=E.t1==="audio"?26:E.t1==="video"?28:30;break;case 26:return r=new Pn(r,v,!0,a.audioContext,{loggerName:a.roomOptions.loggerName,loggerContextCb:function(){return a.logContext}}),E.abrupt("break",31);case 28:return r=new Hn(r,v,!0,{loggerName:a.roomOptions.loggerName,loggerContextCb:function(){return a.logContext}}),E.abrupt("break",31);case 30:throw new gr("unsupported MediaStreamTrack kind ".concat(r.kind));case 31:E.next=34;break;case 33:r.updateLoggerOptions({loggerName:a.roomOptions.loggerName,loggerContextCb:function(){return a.logContext}});case 34:if(a.trackPublications.forEach(function(A){A.track&&A.track===r&&(p=A)}),!p){E.next=38;break}return a.log.warn("track has already been published, skipping",Object.assign(Object.assign({},a.logContext),Vt(p))),E.abrupt("return",p);case 38:return f="channelCount"in r.mediaStreamTrack.getSettings()&&r.mediaStreamTrack.getSettings().channelCount===2||r.mediaStreamTrack.getConstraints().channelCount===2,(m=(d=s==null?void 0:s.forceStereo)!==null&&d!==void 0?d:f)&&(s||(s={}),s.dtx===void 0&&a.log.info("Opus DTX will be disabled for stereo tracks by default. Enable them explicitly to make it work.",Object.assign(Object.assign({},a.logContext),Vt(r))),s.red===void 0&&a.log.info("Opus RED will be disabled for stereo tracks by default. Enable them explicitly to make it work."),(h=s.dtx)!==null&&h!==void 0||(s.dtx=!1),(b=s.red)!==null&&b!==void 0||(s.red=!1)),_=Object.assign(Object.assign({},a.roomOptions.publishDefaults),s),!P9()&&a.roomOptions.e2ee&&(a.log.info("End-to-end encryption is set up, simulcast publishing will be disabled on Safari versions and iOS browsers running iOS < v17.2",Object.assign({},a.logContext)),_.simulcast=!1),_.source&&(r.source=_.source),k=a.publish(r,_,m),a.pendingPublishPromises.set(r,k),E.prev=46,E.next=49,k;case 49:return D=E.sent,E.abrupt("return",D);case 53:throw E.prev=53,E.t2=E.catch(46),E.t2;case 56:return E.prev=56,a.pendingPublishPromises.delete(r),E.finish(56);case 59:case"end":return E.stop()}},c,null,[[46,53,56,59]])})()})}},{key:"publish",value:function(t,n,r){return he(this,void 0,void 0,L().mark(function s(){var a,o,c,u,d,h,b,v,y,p,f,m,_,k,D,E,A,w,N,S,P,F=this;return L().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:if(Array.from(this.trackPublications.values()).find(function(J){return t instanceof uo&&J.source===t.source})&&t.source!==Le.Source.Unknown&&this.log.info("publishing a second track with the same source: ".concat(t.source),Object.assign(Object.assign({},this.logContext),Vt(t))),n.stopMicTrackOnMute&&t instanceof Pn&&(t.stopOnMute=!0),t.source===Le.Source.ScreenShare&&co()&&(n.simulcast=!1),n.videoCodec!=="av1"||I9()||(n.videoCodec=void 0),n.videoCodec!=="vp9"||N9()||(n.videoCodec=void 0),n.videoCodec===void 0&&(n.videoCodec=Gm),this.enabledPublishVideoCodecs.length>0&&(this.enabledPublishVideoCodecs.some(function(J){return n.videoCodec===Sd(J.mime)})||(n.videoCodec=Sd(this.enabledPublishVideoCodecs[0].mime))),f=n.videoCodec,t.on($e.Muted,this.onTrackMuted),t.on($e.Unmuted,this.onTrackUnmuted),t.on($e.Ended,this.handleTrackEnded),t.on($e.UpstreamPaused,this.onTrackUpstreamPaused),t.on($e.UpstreamResumed,this.onTrackUpstreamResumed),t.on($e.AudioTrackFeatureUpdate,this.onTrackFeatureUpdate),m=new hm({cid:t.mediaStreamTrack.id,name:n.name,type:Le.kindToProto(t.kind),muted:t.isMuted,source:Le.sourceToProto(t.source),disableDtx:!((a=n.dtx)===null||a===void 0||a),encryption:this.encryptionType,stereo:r,disableRed:this.isE2EEEnabled||!((o=n.red)===null||o===void 0||o),stream:n==null?void 0:n.stream}),t.kind!==Le.Kind.Video){V.next=36;break}return k={width:0,height:0},V.prev=18,V.next=21,t.waitForDimensions();case 21:k=V.sent,V.next=29;break;case 24:V.prev=24,V.t0=V.catch(18),D=(u=(c=this.roomOptions.videoCaptureDefaults)===null||c===void 0?void 0:c.resolution)!==null&&u!==void 0?u:Rl.h720.resolution,k={width:D.width,height:D.height},this.log.error("could not determine track dimensions, using defaults",Object.assign(Object.assign(Object.assign({},this.logContext),Vt(t)),{dims:k}));case 29:m.width=k.width,m.height=k.height,t instanceof Hn&&(Bl(f)&&(t.source===Le.Source.ScreenShare&&(n.scalabilityMode="L1T3","contentHint"in t.mediaStreamTrack&&(t.mediaStreamTrack.contentHint="motion",this.log.info("forcing contentHint to motion for screenshare with SVC codecs",Object.assign(Object.assign({},this.logContext),Vt(t))))),n.scalabilityMode=(d=n.scalabilityMode)!==null&&d!==void 0?d:"L3T3_KEY"),m.simulcastCodecs=[new dm({codec:f,cid:t.mediaStreamTrack.id})],n.backupCodec===!0&&(n.backupCodec={codec:Gm}),n.backupCodec&&f!==n.backupCodec.codec&&m.encryption===Ni.NONE&&(this.roomOptions.dynacast||(this.roomOptions.dynacast=!0),m.simulcastCodecs.push(new dm({codec:n.backupCodec.codec,cid:""})))),_=Ym(t.source===Le.Source.ScreenShare,m.width,m.height,n),m.layers=uS(m.width,m.height,_,Bl(n.videoCodec)),V.next=37;break;case 36:t.kind===Le.Kind.Audio&&(_=[{maxBitrate:(h=n.audioPreset)===null||h===void 0?void 0:h.maxBitrate,priority:(v=(b=n.audioPreset)===null||b===void 0?void 0:b.priority)!==null&&v!==void 0?v:"high",networkPriority:(p=(y=n.audioPreset)===null||y===void 0?void 0:y.priority)!==null&&p!==void 0?p:"high"}]);case 37:if(this.engine&&!this.engine.isClosed){V.next=39;break}throw new vn("cannot publish track when not connected");case 39:if(E=function(){return he(F,void 0,void 0,L().mark(function J(){var ie,X,H,$,j,B,q;return L().wrap(function(z){for(;;)switch(z.prev=z.next){case 0:if(this.engine.pcManager){z.next=2;break}throw new vn("pcManager is not ready");case 2:return z.next=4,this.engine.createSender(t,n,_);case 4:if(t.sender=z.sent,t instanceof Hn&&((ie=n.degradationPreference)!==null&&ie!==void 0||(n.degradationPreference=eR(t)),t.setDegradationPreference(n.degradationPreference)),!_){z.next=31;break}if(!co()||t.kind!==Le.Kind.Audio){z.next=30;break}$=void 0,j=dt(this.engine.pcManager.publisher.getTransceivers()),z.prev=10,j.s();case 12:if((B=j.n()).done){z.next=19;break}if((q=B.value).sender!==t.sender){z.next=17;break}return $=q,z.abrupt("break",19);case 17:z.next=12;break;case 19:z.next=24;break;case 21:z.prev=21,z.t0=z.catch(10),j.e(z.t0);case 24:return z.prev=24,j.f(),z.finish(24);case 27:$&&this.engine.pcManager.publisher.setTrackCodecBitrate({transceiver:$,codec:"opus",maxbr:!((X=_[0])===null||X===void 0)&&X.maxBitrate?_[0].maxBitrate/1e3:0}),z.next=31;break;case 30:t.codec&&Bl(t.codec)&&(!((H=_[0])===null||H===void 0)&&H.maxBitrate)&&this.engine.pcManager.publisher.setTrackCodecBitrate({cid:m.cid,codec:t.codec,maxbr:_[0].maxBitrate/1e3});case 31:return z.next=33,this.engine.negotiate();case 33:case"end":return z.stop()}},J,this,[[10,21,24,27]])}))},this.enabledPublishVideoCodecs.length<=0){V.next=47;break}return V.next=43,Promise.all([this.engine.addTrack(m),E()]);case 43:w=V.sent,A=w[0],V.next=54;break;case 47:return V.next=49,this.engine.addTrack(m);case 49:return(A=V.sent).codecs.forEach(function(J){N===void 0&&(N=J.mimeType)}),N&&t.kind===Le.Kind.Video&&(S=Sd(N))!==f&&(this.log.debug("falling back to server selected codec",Object.assign(Object.assign(Object.assign({},this.logContext),Vt(t)),{codec:S})),n.videoCodec=S,_=Ym(t.source===Le.Source.ScreenShare,m.width,m.height,n)),V.next=54,E();case 54:return(P=new wd(t.kind,A,t,{loggerName:this.roomOptions.loggerName,loggerContextCb:function(){return F.logContext}})).options=n,t.sid=A.sid,this.log.debug("publishing ".concat(t.kind," with encodings"),Object.assign(Object.assign({},this.logContext),{encodings:_,trackInfo:A})),t instanceof Hn?t.startMonitor(this.engine.client):t instanceof Pn&&t.startMonitor(),this.addTrackPublication(P),this.emit(qe.LocalTrackPublished,P),V.abrupt("return",P);case 62:case"end":return V.stop()}},s,this,[[18,24]])}))}},{key:"isLocal",get:function(){return!0}},{key:"publishAdditionalCodecForTrack",value:function(t,n,r){return he(this,void 0,void 0,L().mark(function s(){var a,o,c,u,d,h,b,v,y,p=this;return L().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(this.encryptionType===Ni.NONE){f.next=2;break}return f.abrupt("return");case 2:if(this.trackPublications.forEach(function(m){m.track&&m.track===t&&(o=m)}),o){f.next=5;break}throw new gr("track is not published");case 5:if(t instanceof Hn){f.next=7;break}throw new gr("track is not a video track");case 7:if(c=Object.assign(Object.assign({},(a=this.roomOptions)===null||a===void 0?void 0:a.publishDefaults),r),u=Z9(t,n,c)){f.next=12;break}return this.log.info("backup codec has been disabled, ignoring request to add additional codec for track",Object.assign(Object.assign({},this.logContext),Vt(t))),f.abrupt("return");case 12:if(d=t.addSimulcastTrack(n,u)){f.next=15;break}return f.abrupt("return");case 15:if((h=new hm({cid:d.mediaStreamTrack.id,type:Le.kindToProto(t.kind),muted:t.isMuted,source:Le.sourceToProto(t.source),sid:t.sid,simulcastCodecs:[{codec:c.videoCodec,cid:d.mediaStreamTrack.id}]})).layers=uS(h.width,h.height,u),this.engine&&!this.engine.isClosed){f.next=19;break}throw new vn("cannot publish track when not connected");case 19:return b=function(){return he(p,void 0,void 0,L().mark(function m(){return L().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return _.next=2,this.engine.createSimulcastSender(t,d,c,u);case 2:return _.next=4,this.engine.negotiate();case 4:case"end":return _.stop()}},m,this)}))},f.next=22,Promise.all([this.engine.addTrack(h),b()]);case 22:v=f.sent,y=v[0],this.log.debug("published ".concat(n," for track ").concat(t.sid),Object.assign(Object.assign({},this.logContext),{encodings:u,trackInfo:y}));case 25:case"end":return f.stop()}},s,this)}))}},{key:"unpublishTrack",value:function(t,n){return he(this,void 0,void 0,L().mark(function r(){var s,a,o,c,u,d,h,b,v,y,p,f,m,_;return L().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if(!(t instanceof uo)){k.next=6;break}if(!(o=this.pendingPublishPromises.get(t))){k.next=6;break}return this.log.info("awaiting publish promise before attempting to unpublish",Object.assign(Object.assign({},this.logContext),Vt(t))),k.next=6,o;case 6:if(c=this.getPublicationForTrack(t),u=c?Vt(c):void 0,this.log.debug("unpublishing track",Object.assign(Object.assign({},this.logContext),u)),c&&c.track){k.next=12;break}return this.log.warn("track was not unpublished because no publication was found",Object.assign(Object.assign({},this.logContext),u)),k.abrupt("return",void 0);case 12:if((t=c.track).off($e.Muted,this.onTrackMuted),t.off($e.Unmuted,this.onTrackUnmuted),t.off($e.Ended,this.handleTrackEnded),t.off($e.UpstreamPaused,this.onTrackUpstreamPaused),t.off($e.UpstreamResumed,this.onTrackUpstreamResumed),t.off($e.AudioTrackFeatureUpdate,this.onTrackFeatureUpdate),n===void 0&&(n=(a=(s=this.roomOptions)===null||s===void 0?void 0:s.stopLocalTrackOnUnpublish)===null||a===void 0||a),n&&t.stop(),d=!1,h=t.sender,t.sender=void 0,this.engine.pcManager&&this.engine.pcManager.currentState<ln.FAILED&&h)try{b=dt(this.engine.pcManager.publisher.getTransceivers());try{for(b.s();!(v=b.n()).done;)(y=v.value).sender===h&&(y.direction="inactive",d=!0)}catch(D){b.e(D)}finally{b.f()}if(this.engine.removeTrack(h)&&(d=!0),t instanceof Hn){p=dt(t.simulcastCodecs);try{for(p.s();!(f=p.n()).done;)m=At(f.value,2),(_=m[1]).sender&&(this.engine.removeTrack(_.sender)&&(d=!0),_.sender=void 0)}catch(D){p.e(D)}finally{p.f()}t.simulcastCodecs.clear()}}catch(D){this.log.warn("failed to unpublish track",Object.assign(Object.assign(Object.assign({},this.logContext),u),{error:D}))}this.trackPublications.delete(c.trackSid),k.t0=c.kind,k.next=k.t0===Le.Kind.Audio?29:k.t0===Le.Kind.Video?31:33;break;case 29:return this.audioTrackPublications.delete(c.trackSid),k.abrupt("break",33);case 31:return this.videoTrackPublications.delete(c.trackSid),k.abrupt("break",33);case 33:if(this.emit(qe.LocalTrackUnpublished,c),c.setTrack(void 0),!d){k.next=38;break}return k.next=38,this.engine.negotiate();case 38:return k.abrupt("return",c);case 39:case"end":return k.stop()}},r,this)}))}},{key:"unpublishTracks",value:function(t){return he(this,void 0,void 0,L().mark(function n(){var r,s=this;return L().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,Promise.all(t.map(function(o){return s.unpublishTrack(o)}));case 2:return r=a.sent,a.abrupt("return",r.filter(function(o){return o instanceof wd}));case 4:case"end":return a.stop()}},n)}))}},{key:"republishAllTracks",value:function(t){return he(this,arguments,void 0,function(n){var r=this,s=1>=arguments.length||arguments[1]===void 0||arguments[1];return L().mark(function a(){return L().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(!r.republishPromise){o.next=3;break}return o.next=3,r.republishPromise;case 3:return r.republishPromise=new Promise(function(c,u){return he(r,void 0,void 0,L().mark(function d(){var h,b=this;return L().wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.prev=0,h=[],this.trackPublications.forEach(function(y){y.track&&(n&&(y.options=Object.assign(Object.assign({},y.options),n)),h.push(y))}),v.next=5,Promise.all(h.map(function(y){return he(b,void 0,void 0,L().mark(function p(){var f;return L().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return f=y.track,m.next=3,this.unpublishTrack(f,!1);case 3:if(!s||f.isMuted||f.source===Le.Source.ScreenShare||f.source===Le.Source.ScreenShareAudio||!(f instanceof Pn||f instanceof Hn)||f.isUserProvided){m.next=7;break}return this.log.debug("restarting existing track",Object.assign(Object.assign({},this.logContext),{track:y.trackSid})),m.next=7,f.restartTrack();case 7:return m.next=9,this.publishOrRepublishTrack(f,y.options,!0);case 9:case"end":return m.stop()}},p,this)}))}));case 5:c(),v.next=11;break;case 8:v.prev=8,v.t0=v.catch(0),u(v.t0);case 11:return v.prev=11,this.republishPromise=void 0,v.finish(11);case 14:case"end":return v.stop()}},d,this,[[0,8,11,14]])}))}),o.next=6,r.republishPromise;case 6:case"end":return o.stop()}},a)})()})}},{key:"publishData",value:function(t){return he(this,arguments,void 0,function(n){var r=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return L().mark(function a(){var o,c,u,d;return L().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return o=s.reliable?gn.RELIABLE:gn.LOSSY,c=s.destinationIdentities,u=s.topic,d=new Pl({kind:o,value:{case:"user",value:new yk({participantIdentity:r.identity,payload:n,destinationIdentities:c,topic:u})}}),h.next=6,r.engine.sendDataPacket(d,o);case 6:case"end":return h.stop()}},a)})()})}},{key:"publishDtmf",value:function(t,n){return he(this,void 0,void 0,L().mark(function r(){var s;return L().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return s=new Pl({kind:gn.RELIABLE,value:{case:"sipDtmf",value:new bk({code:t,digit:n})}}),a.next=3,this.engine.sendDataPacket(s,gn.RELIABLE);case 3:case"end":return a.stop()}},r,this)}))}},{key:"sendChatMessage",value:function(t){return he(this,void 0,void 0,L().mark(function n(){var r,s;return L().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return r={id:crypto.randomUUID(),message:t,timestamp:Date.now()},s=new Pl({value:{case:"chatMessage",value:new cm(Object.assign(Object.assign({},r),{timestamp:qt.parse(r.timestamp)}))}}),a.next=4,this.engine.sendDataPacket(s,gn.RELIABLE);case 4:return this.emit(qe.ChatMessage,r),a.abrupt("return",r);case 6:case"end":return a.stop()}},n,this)}))}},{key:"editChatMessage",value:function(t,n){return he(this,void 0,void 0,L().mark(function r(){var s,a;return L().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:return s=Object.assign(Object.assign({},n),{message:t,editTimestamp:Date.now()}),a=new Pl({value:{case:"chatMessage",value:new cm(Object.assign(Object.assign({},s),{timestamp:qt.parse(s.timestamp),editTimestamp:qt.parse(s.editTimestamp)}))}}),o.next=4,this.engine.sendDataPacket(a,gn.RELIABLE);case 4:return this.emit(qe.ChatMessage,s),o.abrupt("return",s);case 6:case"end":return o.stop()}},r,this)}))}},{key:"setTrackSubscriptionPermissions",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];this.participantTrackPermissions=n,this.allParticipantsAllowedToSubscribe=t,this.engine.client.isDisconnected||this.updateTrackSubscriptionPermissions()}},{key:"setEnabledPublishCodecs",value:function(t){this.enabledPublishVideoCodecs=t.filter(function(n){return n.mime.split("/")[0].toLowerCase()==="video"})}},{key:"updateInfo",value:function(t){var n=this;return t.sid===this.sid&&!!pt(lt(e.prototype),"updateInfo",this).call(this,t)&&(t.tracks.forEach(function(r){var s,a,o=n.trackPublications.get(r.sid);if(o){var c=o.isMuted||(a=(s=o.track)===null||s===void 0?void 0:s.isUpstreamPaused)!==null&&a!==void 0&&a;c!==r.muted&&(n.log.debug("updating server mute state after reconcile",Object.assign(Object.assign(Object.assign({},n.logContext),Vt(o)),{mutedOnServer:c})),n.engine.client.sendMuteTrack(r.sid,c))}}),!0)}},{key:"getPublicationForTrack",value:function(t){var n;return this.trackPublications.forEach(function(r){var s=r.track;s&&(t instanceof MediaStreamTrack?(s instanceof Pn||s instanceof Hn)&&s.mediaStreamTrack===t&&(n=r):t===s&&(n=r))}),n}},{key:"waitForPendingPublicationOfSource",value:function(t){return he(this,void 0,void 0,L().mark(function n(){var r;return L().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(!(r=Array.from(this.pendingPublishPromises.entries()).find(function(a){return At(a,1)[0].source===t}))){s.next=3;break}return s.abrupt("return",r[1]);case 3:case"end":return s.stop()}},n,this)}))}}]),e}(),bS=function(i){function e(t,n,r,s){var a;return ht(this,e),(a=Rt(this,e,[t,n.sid,n.name,s])).track=void 0,a.allowed=!0,a.disabled=!1,a.currentVideoQuality=Pi.HIGH,a.handleEnded=function(o){a.setTrack(void 0),a.emit($e.Ended,o)},a.handleVisibilityChange=function(o){a.log.debug("adaptivestream video visibility ".concat(a.trackSid,", visible=").concat(o),a.logContext),a.disabled=!o,a.emitTrackUpdate()},a.handleVideoDimensionsChange=function(o){a.log.debug("adaptivestream video dimensions ".concat(o.width,"x").concat(o.height),a.logContext),a.videoDimensions=o,a.emitTrackUpdate()},a.subscribed=r,a.updateInfo(n),a}return Lt(e,Vr),ft(e,[{key:"setSubscribed",value:function(t){var n=this.subscriptionStatus,r=this.permissionStatus;this.subscribed=t,t&&(this.allowed=!0);var s=new cd({trackSids:[this.trackSid],subscribe:this.subscribed,participantTracks:[new _k({participantSid:"",trackSids:[this.trackSid]})]});this.emit($e.UpdateSubscription,s),this.emitSubscriptionUpdateIfChanged(n),this.emitPermissionUpdateIfChanged(r)}},{key:"subscriptionStatus",get:function(){return this.subscribed===!1?Vr.SubscriptionStatus.Unsubscribed:pt(lt(e.prototype),"isSubscribed",this)?Vr.SubscriptionStatus.Subscribed:Vr.SubscriptionStatus.Desired}},{key:"permissionStatus",get:function(){return this.allowed?Vr.PermissionStatus.Allowed:Vr.PermissionStatus.NotAllowed}},{key:"isSubscribed",get:function(){return this.subscribed!==!1&&pt(lt(e.prototype),"isSubscribed",this)}},{key:"isDesired",get:function(){return this.subscribed!==!1}},{key:"isEnabled",get:function(){return!this.disabled}},{key:"setEnabled",value:function(t){this.isManualOperationAllowed()&&this.disabled!==!t&&(this.disabled=!t,this.emitTrackUpdate())}},{key:"setVideoQuality",value:function(t){this.isManualOperationAllowed()&&this.currentVideoQuality!==t&&(this.currentVideoQuality=t,this.videoDimensions=void 0,this.emitTrackUpdate())}},{key:"setVideoDimensions",value:function(t){var n,r;this.isManualOperationAllowed()&&(((n=this.videoDimensions)===null||n===void 0?void 0:n.width)===t.width&&((r=this.videoDimensions)===null||r===void 0?void 0:r.height)===t.height||(this.track instanceof jl&&(this.videoDimensions=t),this.currentVideoQuality=void 0,this.emitTrackUpdate()))}},{key:"setVideoFPS",value:function(t){this.isManualOperationAllowed()&&this.track instanceof jl&&this.fps!==t&&(this.fps=t,this.emitTrackUpdate())}},{key:"videoQuality",get:function(){return this.currentVideoQuality}},{key:"setTrack",value:function(t){var n=this.subscriptionStatus,r=this.permissionStatus,s=this.track;s!==t&&(s&&(s.off($e.VideoDimensionsChanged,this.handleVideoDimensionsChange),s.off($e.VisibilityChanged,this.handleVisibilityChange),s.off($e.Ended,this.handleEnded),s.detach(),s.stopMonitor(),this.emit($e.Unsubscribed,s)),pt(lt(e.prototype),"setTrack",this).call(this,t),t&&(t.sid=this.trackSid,t.on($e.VideoDimensionsChanged,this.handleVideoDimensionsChange),t.on($e.VisibilityChanged,this.handleVisibilityChange),t.on($e.Ended,this.handleEnded),this.emit($e.Subscribed,t)),this.emitPermissionUpdateIfChanged(r),this.emitSubscriptionUpdateIfChanged(n))}},{key:"setAllowed",value:function(t){var n=this.subscriptionStatus,r=this.permissionStatus;this.allowed=t,this.emitPermissionUpdateIfChanged(r),this.emitSubscriptionUpdateIfChanged(n)}},{key:"setSubscriptionError",value:function(t){this.emit($e.SubscriptionFailed,t)}},{key:"updateInfo",value:function(t){pt(lt(e.prototype),"updateInfo",this).call(this,t);var n=this.metadataMuted;this.metadataMuted=t.muted,this.track?this.track.setMuted(t.muted):n!==t.muted&&this.emit(t.muted?$e.Muted:$e.Unmuted)}},{key:"emitSubscriptionUpdateIfChanged",value:function(t){var n=this.subscriptionStatus;t!==n&&this.emit($e.SubscriptionStatusChanged,n,t)}},{key:"emitPermissionUpdateIfChanged",value:function(t){this.permissionStatus!==t&&this.emit($e.SubscriptionPermissionChanged,this.permissionStatus,t)}},{key:"isManualOperationAllowed",value:function(){return this.kind===Le.Kind.Video&&this.isAdaptiveStream?(this.log.warn("adaptive stream is enabled, cannot change video track settings",this.logContext),!1):!!this.isDesired||(this.log.warn("cannot update track settings when not subscribed",this.logContext),!1)}},{key:"isAdaptiveStream",get:function(){return this.track instanceof jl&&this.track.isAdaptiveStream}},{key:"emitTrackUpdate",value:function(){var t=new Ek({trackSids:[this.trackSid],disabled:this.disabled,fps:this.fps});this.videoDimensions?(t.width=Math.ceil(this.videoDimensions.width),t.height=Math.ceil(this.videoDimensions.height)):this.currentVideoQuality!==void 0?t.quality=this.currentVideoQuality:t.quality=Pi.HIGH,this.emit($e.UpdateSettings,t)}}]),e}(),_S=function(i){function e(t,n,r,s,a,o){var c;return ht(this,e),(c=Rt(this,e,[n,r||"",s,a,o,arguments.length>6&&arguments[6]!==void 0?arguments[6]:ld.STANDARD])).signalClient=t,c.trackPublications=new Map,c.audioTrackPublications=new Map,c.videoTrackPublications=new Map,c.volumeMap=new Map,c}return Lt(e,vS),ft(e,[{key:"logContext",get:function(){return Object.assign(Object.assign({},pt(lt(e.prototype),"logContext",this)),{rpID:this.sid,remoteParticipant:this.identity})}},{key:"addTrackPublication",value:function(t){var n=this;pt(lt(e.prototype),"addTrackPublication",this).call(this,t),t.on($e.UpdateSettings,function(r){n.log.debug("send update settings",Object.assign(Object.assign({},n.logContext),Vt(t))),n.signalClient.sendUpdateTrackSettings(r)}),t.on($e.UpdateSubscription,function(r){r.participantTracks.forEach(function(s){s.participantSid=n.sid}),n.signalClient.sendUpdateSubscription(r)}),t.on($e.SubscriptionPermissionChanged,function(r){n.emit(qe.TrackSubscriptionPermissionChanged,t,r)}),t.on($e.SubscriptionStatusChanged,function(r){n.emit(qe.TrackSubscriptionStatusChanged,t,r)}),t.on($e.Subscribed,function(r){n.emit(qe.TrackSubscribed,r,t)}),t.on($e.Unsubscribed,function(r){n.emit(qe.TrackUnsubscribed,r,t)}),t.on($e.SubscriptionFailed,function(r){n.emit(qe.TrackSubscriptionFailed,t.trackSid,r)})}},{key:"getTrackPublication",value:function(t){var n=pt(lt(e.prototype),"getTrackPublication",this).call(this,t);if(n)return n}},{key:"getTrackPublicationByName",value:function(t){var n=pt(lt(e.prototype),"getTrackPublicationByName",this).call(this,t);if(n)return n}},{key:"setVolume",value:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Le.Source.Microphone;this.volumeMap.set(n,t);var r=this.getTrackPublication(n);r&&r.track&&r.track.setVolume(t)}},{key:"getVolume",value:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Le.Source.Microphone,n=this.getTrackPublication(t);return n&&n.track?n.track.getVolume():this.volumeMap.get(t)}},{key:"addSubscribedMediaTrack",value:function(t,n,r,s,a,o){var c,u=this,d=this.getTrackPublicationBySid(n);return d||n.startsWith("TR")||this.trackPublications.forEach(function(h){d||t.kind!==h.kind.toString()||(d=h)}),d?t.readyState==="ended"?(this.log.error("unable to subscribe because MediaStreamTrack is ended. Do not call MediaStreamTrack.stop()",Object.assign(Object.assign({},this.logContext),Vt(d))),void this.emit(qe.TrackSubscriptionFailed,n)):((c=t.kind==="video"?new jl(t,n,s,a):new Vl(t,n,s,this.audioContext,this.audioOutput)).source=d.source,c.isMuted=d.isMuted,c.setMediaStream(r),c.start(),d.setTrack(c),this.volumeMap.has(d.source)&&c instanceof Vl&&c.setVolume(this.volumeMap.get(d.source)),d):o===0?(this.log.error("could not find published track",Object.assign(Object.assign({},this.logContext),{trackSid:n})),void this.emit(qe.TrackSubscriptionFailed,n)):(o===void 0&&(o=20),void setTimeout(function(){u.addSubscribedMediaTrack(t,n,r,s,a,o-1)},150))}},{key:"hasMetadata",get:function(){return!!this.participantInfo}},{key:"getTrackPublicationBySid",value:function(t){return this.trackPublications.get(t)}},{key:"updateInfo",value:function(t){var n=this;if(!pt(lt(e.prototype),"updateInfo",this).call(this,t))return!1;var r=new Map,s=new Map;return t.tracks.forEach(function(a){var o,c,u=n.getTrackPublicationBySid(a.sid);if(u)u.updateInfo(a);else{var d=Le.kindFromProto(a.type);if(!d)return;(u=new bS(d,a,(o=n.signalClient.connectOptions)===null||o===void 0?void 0:o.autoSubscribe,{loggerContextCb:function(){return n.logContext},loggerName:(c=n.loggerOptions)===null||c===void 0?void 0:c.loggerName})).updateInfo(a),s.set(a.sid,u);var h=Array.from(n.trackPublications.values()).find(function(b){return b.source===(u==null?void 0:u.source)});h&&u.source!==Le.Source.Unknown&&n.log.debug("received a second track publication for ".concat(n.identity," with the same source: ").concat(u.source),Object.assign(Object.assign({},n.logContext),{oldTrack:Vt(h),newTrack:Vt(u)})),n.addTrackPublication(u)}r.set(a.sid,u)}),this.trackPublications.forEach(function(a){r.has(a.trackSid)||(n.log.trace("detected removed track on remote participant, unpublishing",Object.assign(Object.assign({},n.logContext),Vt(a))),n.unpublishTrack(a.trackSid,!0))}),s.forEach(function(a){n.emit(qe.TrackPublished,a)}),!0}},{key:"unpublishTrack",value:function(t,n){var r=this.trackPublications.get(t);if(r){var s=r.track;switch(s&&(s.stop(),r.setTrack(void 0)),this.trackPublications.delete(t),r.kind){case Le.Kind.Audio:this.audioTrackPublications.delete(t);break;case Le.Kind.Video:this.videoTrackPublications.delete(t);break}n&&this.emit(qe.TrackUnpublished,r)}}},{key:"setAudioOutput",value:function(t){return he(this,void 0,void 0,L().mark(function n(){var r;return L().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return this.audioOutput=t,r=[],this.audioTrackPublications.forEach(function(a){var o;a.track instanceof Vl&&r.push(a.track.setSinkId((o=t.deviceId)!==null&&o!==void 0?o:"default"))}),s.next=5,Promise.all(r);case 5:case"end":return s.stop()}},n,this)}))}},{key:"emit",value:function(t){for(var n,r=arguments.length,s=new Array(r>1?r-1:0),a=1;r>a;a++)s[a-1]=arguments[a];return this.log.trace("participant event",Object.assign(Object.assign({},this.logContext),{event:t,args:s})),(n=pt(lt(e.prototype),"emit",this)).call.apply(n,[this,t].concat(s))}}],[{key:"fromParticipantInfo",value:function(t,n,r){return new e(t,n.sid,n.identity,n.name,n.metadata,r,n.kind)}}]),e}();(function(i){i.Disconnected="disconnected",i.Connecting="connecting",i.Connected="connected",i.Reconnecting="reconnecting",i.SignalReconnecting="signalReconnecting"})(Ut||(Ut={}));var kS,Dd=function(i){function e(t){var n,r,s,a;return ht(this,e),n=Rt(this,e),r=ct(n),n.state=Ut.Disconnected,n.activeSpeakers=[],n.isE2EEEnabled=!1,n.audioEnabled=!0,n.isVideoPlaybackBlocked=!1,n.log=Ct,n.bufferedEvents=[],n.isResuming=!1,n.connect=function(o,c,u){return he(ct(n),void 0,void 0,L().mark(function d(){var h,b,v,y,p=this;return L().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(typeof RTCPeerConnection<"u"&&(Lm()||Bm())){f.next=6;break}if(!Ur()){f.next=5;break}throw Error("WebRTC isn't detected, have you called registerGlobals?");case 5:throw Error("LiveKit doesn't seem to be supported on this browser. Try to update your browser and make sure no browser extensions are disabling webRTC.");case 6:return f.next=8,this.disconnectLock.lock();case 8:if(b=f.sent,this.state!==Ut.Connected){f.next=13;break}return this.log.info("already connected to room ".concat(this.name),this.logContext),b(),f.abrupt("return",Promise.resolve());case 13:if(!this.connectFuture){f.next=16;break}return b(),f.abrupt("return",this.connectFuture.promise);case 16:return this.setAndEmitConnectionState(Ut.Connecting),((h=this.regionUrlProvider)===null||h===void 0?void 0:h.getServerUrl().toString())!==o&&(this.regionUrl=void 0,this.regionUrlProvider=void 0),Fm(new URL(o))&&(this.regionUrlProvider===void 0?this.regionUrlProvider=new fS(o,c):this.regionUrlProvider.updateToken(c),this.regionUrlProvider.fetchRegionSettings().then(function(m){var _;(_=p.regionUrlProvider)===null||_===void 0||_.setServerReportedRegions(m)}).catch(function(m){p.log.warn("could not fetch region settings",Object.assign(Object.assign({},p.logContext),{error:m}))})),v=function m(_,k,D){return he(p,void 0,void 0,L().mark(function E(){var A,w,N,S;return L().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return this.abortController&&this.abortController.abort(),N=new AbortController,this.abortController=N,b==null||b(),P.prev=4,P.next=7,this.attemptConnection(D??o,c,u,N);case 7:this.abortController=void 0,_(),P.next=40;break;case 11:if(P.prev=11,P.t0=P.catch(4),!(this.regionUrlProvider&&P.t0 instanceof zt&&P.t0.reason!==$n.Cancelled&&P.t0.reason!==$n.NotAllowed)){P.next=38;break}return S=null,P.prev=15,P.next=18,this.regionUrlProvider.getNextBestRegionUrl((A=this.abortController)===null||A===void 0?void 0:A.signal);case 18:S=P.sent,P.next=27;break;case 21:if(P.prev=21,P.t1=P.catch(15),!(P.t1 instanceof zt)||P.t1.status!==401&&P.t1.reason!==$n.Cancelled){P.next=27;break}return this.handleDisconnect(this.options.stopLocalTrackOnUnpublish),k(P.t1),P.abrupt("return");case 27:if(!S||!((w=this.abortController)===null||w===void 0)&&w.signal.aborted){P.next=34;break}return this.log.info("Initial connection failed with ConnectionError: ".concat(P.t0.message,". Retrying with another region: ").concat(S),this.logContext),this.recreateEngine(),P.next=32,m(_,k,S);case 32:P.next=36;break;case 34:this.handleDisconnect(this.options.stopLocalTrackOnUnpublish),k(P.t0);case 36:P.next=40;break;case 38:this.handleDisconnect(this.options.stopLocalTrackOnUnpublish),k(P.t0);case 40:case"end":return P.stop()}},E,this,[[4,11],[15,21]])}))},y=this.regionUrl,this.regionUrl=void 0,this.connectFuture=new $T(function(m,_){v(m,_,y)},function(){p.clearConnectionFutures()}),f.abrupt("return",this.connectFuture.promise);case 24:case"end":return f.stop()}},d,this)}))},n.connectSignal=function(o,c,u,d,h,b){return he(ct(n),void 0,void 0,L().mark(function v(){var y,p,f,m,_;return L().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return k.next=2,u.join(o,c,{autoSubscribe:d.autoSubscribe,adaptiveStream:et(h.adaptiveStream)==="object"||h.adaptiveStream,maxRetries:d.maxRetries,e2eeEnabled:!!this.e2eeManager,websocketTimeout:d.websocketTimeout},b.signal);case 2:if(m=k.sent,(_=m.serverInfo)||(_={version:m.serverVersion,region:m.serverRegion}),this.serverInfo=_,this.log.debug("connected to Livekit Server ".concat(Object.entries(_).map(function(D){var E=At(D,2),A=E[0],w=E[1];return"".concat(A,": ").concat(w)}).join(", ")),{room:(y=m.room)===null||y===void 0?void 0:y.name,roomSid:(p=m.room)===null||p===void 0?void 0:p.sid,identity:(f=m.participant)===null||f===void 0?void 0:f.identity}),_.version){k.next=9;break}throw new S9("unknown server version");case 9:return _.version==="0.15.1"&&this.options.dynacast&&(this.log.debug("disabling dynacast due to server version",this.logContext),h.dynacast=!1),k.abrupt("return",m);case 11:case"end":return k.stop()}},v,this)}))},n.applyJoinResponse=function(o){var c=o.participant;if(n.localParticipant.sid=c.sid,n.localParticipant.identity=c.identity,n.localParticipant.setEnabledPublishCodecs(o.enabledPublishCodecs),n.options.e2ee&&n.e2eeManager)try{n.e2eeManager.setSifTrailer(o.sifTrailer)}catch(u){n.log.error(u instanceof Error?u.message:"Could not set SifTrailer",Object.assign(Object.assign({},n.logContext),{error:u}))}n.handleParticipantUpdates([c].concat(Ii(o.otherParticipants))),o.room&&n.handleRoomUpdate(o.room)},n.attemptConnection=function(o,c,u,d){return he(ct(n),void 0,void 0,L().mark(function h(){var b,v,y,p,f;return L().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:return this.state===Ut.Reconnecting||this.isResuming||!((b=this.engine)===null||b===void 0)&&b.pendingReconnect?(this.log.info("Reconnection attempt replaced by new connection attempt",this.logContext),this.recreateEngine()):this.maybeCreateEngine(),!((v=this.regionUrlProvider)===null||v===void 0)&&v.isCloud()&&this.engine.setRegionUrlProvider(this.regionUrlProvider),this.acquireAudioContext(),this.connOptions=Object.assign(Object.assign({},Wm),u),this.connOptions.rtcConfig&&(this.engine.rtcConfig=this.connOptions.rtcConfig),this.connOptions.peerConnectionTimeout&&(this.engine.peerConnectionTimeout=this.connOptions.peerConnectionTimeout),m.prev=6,m.next=9,this.connectSignal(o,c,this.engine,this.connOptions,this.options,d);case 9:p=m.sent,this.applyJoinResponse(p),this.setupLocalParticipantEvents(),this.emit(je.SignalConnected),m.next=25;break;case 15:return m.prev=15,m.t0=m.catch(6),m.next=19,this.engine.close();case 19:throw this.recreateEngine(),f=new zt("could not establish signal connection"),m.t0 instanceof Error&&(f.message="".concat(f.message,": ").concat(m.t0.message)),m.t0 instanceof zt&&(f.reason=m.t0.reason,f.status=m.t0.status),this.log.debug("error trying to establish signal connection",Object.assign(Object.assign({},this.logContext),{error:m.t0})),f;case 25:if(!d.signal.aborted){m.next=30;break}return m.next=28,this.engine.close();case 28:throw this.recreateEngine(),new zt("Connection attempt aborted");case 30:return m.prev=30,m.next=33,this.engine.waitForPCInitialConnection(this.connOptions.peerConnectionTimeout,d);case 33:m.next=41;break;case 35:return m.prev=35,m.t1=m.catch(30),m.next=39,this.engine.close();case 39:throw this.recreateEngine(),m.t1;case 41:yi()&&this.options.disconnectOnPageLeave&&(window.addEventListener("pagehide",this.onPageLeave),window.addEventListener("beforeunload",this.onPageLeave)),yi()&&(document.addEventListener("freeze",this.onPageLeave),(y=navigator.mediaDevices)===null||y===void 0||y.addEventListener("devicechange",this.handleDeviceChange)),this.setAndEmitConnectionState(Ut.Connected),this.emit(je.Connected),this.registerConnectionReconcile();case 46:case"end":return m.stop()}},h,this,[[6,15],[30,35]])}))},n.disconnect=function(){for(var o=arguments.length,c=new Array(o),u=0;o>u;u++)c[u]=arguments[u];return he(r,[].concat(c),void 0,function(){var d=this,h=0>=arguments.length||arguments[0]===void 0||arguments[0];return L().mark(function b(){var v,y,p,f,m;return L().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:return _.next=2,d.disconnectLock.lock();case 2:if(m=_.sent,_.prev=3,d.state!==Ut.Disconnected){_.next=7;break}return d.log.debug("already disconnected",d.logContext),_.abrupt("return");case 7:if(d.log.info("disconnect from room",Object.assign({},d.logContext)),(d.state===Ut.Connecting||d.state===Ut.Reconnecting||d.isResuming)&&(d.log.warn("abort connection attempt",d.logContext),(v=d.abortController)===null||v===void 0||v.abort(),(p=(y=d.connectFuture)===null||y===void 0?void 0:y.reject)===null||p===void 0||p.call(y,new zt("Client initiated disconnect")),d.connectFuture=void 0),(f=d.engine)===null||f===void 0?void 0:f.client.isDisconnected){_.next=12;break}return _.next=12,d.engine.client.sendLeave();case 12:if(!d.engine){_.next=15;break}return _.next=15,d.engine.close();case 15:d.handleDisconnect(h,to.CLIENT_INITIATED),d.engine=void 0;case 17:return _.prev=17,m(),_.finish(17);case 20:case"end":return _.stop()}},b,null,[[3,,17,20]])})()})},n.onPageLeave=function(){return he(ct(n),void 0,void 0,L().mark(function o(){return L().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return this.log.info("Page leave detected, disconnecting",this.logContext),c.next=3,this.disconnect();case 3:case"end":return c.stop()}},o,this)}))},n.startAudio=function(){return he(ct(n),void 0,void 0,L().mark(function o(){var c,u,d,h,b,v,y=this;return L().wrap(function(p){for(;;)switch(p.prev=p.next){case 0:return c=[],(u=Br())&&u.os==="iOS"&&(d="livekit-dummy-audio-el",(h=document.getElementById(d))||((h=document.createElement("audio")).id=d,h.autoplay=!0,h.hidden=!0,(b=$m()).enabled=!0,v=new MediaStream([b]),h.srcObject=v,document.addEventListener("visibilitychange",function(){h&&(h.srcObject=document.hidden?null:v,document.hidden||(y.log.debug("page visible again, triggering startAudio to resume playback and update playback status",y.logContext),y.startAudio()))}),document.body.append(h),this.once(je.Disconnected,function(){h==null||h.remove(),h=null})),c.push(h)),this.remoteParticipants.forEach(function(f){f.audioTrackPublications.forEach(function(m){m.track&&m.track.attachedElements.forEach(function(_){c.push(_)})})}),p.prev=4,p.next=7,Promise.all([this.acquireAudioContext()].concat(Ii(c.map(function(f){return f.muted=!1,f.play()}))));case 7:this.handleAudioPlaybackStarted(),p.next=14;break;case 10:throw p.prev=10,p.t0=p.catch(4),this.handleAudioPlaybackFailed(p.t0),p.t0;case 14:case"end":return p.stop()}},o,this,[[4,10]])}))},n.startVideo=function(){return he(ct(n),void 0,void 0,L().mark(function o(){var c,u,d,h=this;return L().wrap(function(b){for(;;)switch(b.prev=b.next){case 0:c=[],u=dt(this.remoteParticipants.values());try{for(u.s();!(d=u.n()).done;)d.value.videoTrackPublications.forEach(function(v){var y;(y=v.track)===null||y===void 0||y.attachedElements.forEach(function(p){c.includes(p)||c.push(p)})})}catch(v){u.e(v)}finally{u.f()}return b.next=5,Promise.all(c.map(function(v){return v.play()})).then(function(){h.handleVideoPlaybackStarted()}).catch(function(v){v.name==="NotAllowedError"?h.handleVideoPlaybackFailed():h.log.warn("Resuming video playback failed, make sure you call `startVideo` directly in a user gesture handler",h.logContext)});case 5:case"end":return b.stop()}},o,this)}))},n.handleRestarting=function(){n.clearConnectionReconcile(),n.isResuming=!1;var o,c=dt(n.remoteParticipants.values());try{for(c.s();!(o=c.n()).done;){var u=o.value;n.handleParticipantDisconnected(u.identity,u)}}catch(d){c.e(d)}finally{c.f()}n.setAndEmitConnectionState(Ut.Reconnecting)&&n.emit(je.Reconnecting)},n.handleSignalRestarted=function(o){return he(ct(n),void 0,void 0,L().mark(function c(){return L().wrap(function(u){for(;;)switch(u.prev=u.next){case 0:return this.log.debug("signal reconnected to server, region ".concat(o.serverRegion),Object.assign(Object.assign({},this.logContext),{region:o.serverRegion})),this.bufferedEvents=[],this.applyJoinResponse(o),u.prev=3,u.next=6,this.localParticipant.republishAllTracks(void 0,!0);case 6:u.next=11;break;case 8:u.prev=8,u.t0=u.catch(3),this.log.error("error trying to re-publish tracks after reconnection",Object.assign(Object.assign({},this.logContext),{error:u.t0}));case 11:return u.prev=11,u.next=14,this.engine.waitForRestarted();case 14:this.log.debug("fully reconnected to server",Object.assign(Object.assign({},this.logContext),{region:o.serverRegion})),u.next=20;break;case 17:return u.prev=17,u.t1=u.catch(11),u.abrupt("return");case 20:this.setAndEmitConnectionState(Ut.Connected),this.emit(je.Reconnected),this.registerConnectionReconcile(),this.emitBufferedEvents();case 24:case"end":return u.stop()}},c,this,[[3,8],[11,17]])}))},n.handleParticipantUpdates=function(o){o.forEach(function(c){var u;if(c.identity!==n.localParticipant.identity){c.identity===""&&(c.identity=(u=n.sidToIdentity.get(c.sid))!==null&&u!==void 0?u:"");var d=n.remoteParticipants.get(c.identity);c.state===lm.DISCONNECTED?n.handleParticipantDisconnected(c.identity,d):d=n.getOrCreateParticipant(c.identity,c)}else n.localParticipant.updateInfo(c)})},n.handleActiveSpeakersUpdate=function(o){var c=[],u={};o.forEach(function(d){if(u[d.sid]=!0,d.sid===n.localParticipant.sid)n.localParticipant.audioLevel=d.level,n.localParticipant.setIsSpeaking(!0),c.push(n.localParticipant);else{var h=n.getRemoteParticipantBySid(d.sid);h&&(h.audioLevel=d.level,h.setIsSpeaking(!0),c.push(h))}}),u[n.localParticipant.sid]||(n.localParticipant.audioLevel=0,n.localParticipant.setIsSpeaking(!1)),n.remoteParticipants.forEach(function(d){u[d.sid]||(d.audioLevel=0,d.setIsSpeaking(!1))}),n.activeSpeakers=c,n.emitWhenConnected(je.ActiveSpeakersChanged,c)},n.handleSpeakersChanged=function(o){var c=new Map;n.activeSpeakers.forEach(function(d){var h=n.remoteParticipants.get(d.identity);h&&h.sid!==d.sid||c.set(d.sid,d)}),o.forEach(function(d){var h=n.getRemoteParticipantBySid(d.sid);d.sid===n.localParticipant.sid&&(h=n.localParticipant),h&&(h.audioLevel=d.level,h.setIsSpeaking(d.active),d.active?c.set(d.sid,h):c.delete(d.sid))});var u=Array.from(c.values());u.sort(function(d,h){return h.audioLevel-d.audioLevel}),n.activeSpeakers=u,n.emitWhenConnected(je.ActiveSpeakersChanged,u)},n.handleStreamStateUpdate=function(o){o.streamStates.forEach(function(c){var u=n.getRemoteParticipantBySid(c.participantSid);if(u){var d=u.getTrackPublicationBySid(c.trackSid);if(d&&d.track){var h=Le.streamStateFromProto(c.state);h!==d.track.streamState&&(d.track.streamState=h,u.emit(qe.TrackStreamStateChanged,d,d.track.streamState),n.emitWhenConnected(je.TrackStreamStateChanged,d,d.track.streamState,u))}}})},n.handleSubscriptionPermissionUpdate=function(o){var c=n.getRemoteParticipantBySid(o.participantSid);if(c){var u=c.getTrackPublicationBySid(o.trackSid);u&&u.setAllowed(o.allowed)}},n.handleSubscriptionError=function(o){var c=Array.from(n.remoteParticipants.values()).find(function(d){return d.trackPublications.has(o.trackSid)});if(c){var u=c.getTrackPublicationBySid(o.trackSid);u&&u.setSubscriptionError(o.err)}},n.handleDataPacket=function(o){var c=n.remoteParticipants.get(o.participantIdentity);o.value.case==="user"?n.handleUserPacket(c,o.value.value,o.kind):o.value.case==="transcription"?n.handleTranscription(c,o.value.value):o.value.case==="sipDtmf"?n.handleSipDtmf(c,o.value.value):o.value.case==="chatMessage"?n.handleChatMessage(c,o.value.value):o.value.case==="metrics"&&n.handleMetrics(o.value.value,c)},n.handleUserPacket=function(o,c,u){n.emit(je.DataReceived,c.payload,o,u,c.topic),o==null||o.emit(qe.DataReceived,c.payload,u)},n.handleSipDtmf=function(o,c){n.emit(je.SipDTMFReceived,c,o),o==null||o.emit(qe.SipDTMFReceived,c)},n.bufferedSegments=new Map,n.handleTranscription=function(o,c){var u=c.transcribedParticipantIdentity===n.localParticipant.identity?n.localParticipant:n.getParticipantByIdentity(c.transcribedParticipantIdentity),d=u==null?void 0:u.trackPublications.get(c.trackId),h=function(b,v){return b.segments.map(function(y){var p,f=y.id,m=y.text,_=y.language,k=y.startTime,D=y.endTime,E=y.final,A=(p=v.get(f))!==null&&p!==void 0?p:Date.now(),w=Date.now();return E?v.delete(f):v.set(f,A),{id:f,text:m,startTime:Number.parseInt(k.toString()),endTime:Number.parseInt(D.toString()),final:E,language:_,firstReceivedTime:A,lastReceivedTime:w}})}(c,n.transcriptionReceivedTimes);d==null||d.emit($e.TranscriptionReceived,h),u==null||u.emit(qe.TranscriptionReceived,h,d),n.emit(je.TranscriptionReceived,h,u,d)},n.handleChatMessage=function(o,c){var u=function(d){var h=d.id,b=d.timestamp,v=d.message,y=d.editTimestamp;return{id:h,timestamp:Number.parseInt(b.toString()),editTimestamp:y?Number.parseInt(y.toString()):void 0,message:v}}(c);n.emit(je.ChatMessage,u,o)},n.handleMetrics=function(o,c){n.emit(je.MetricsReceived,o,c)},n.handleAudioPlaybackStarted=function(){n.canPlaybackAudio||(n.audioEnabled=!0,n.emit(je.AudioPlaybackStatusChanged,!0))},n.handleAudioPlaybackFailed=function(o){n.log.warn("could not playback audio",Object.assign(Object.assign({},n.logContext),{error:o})),n.canPlaybackAudio&&(n.audioEnabled=!1,n.emit(je.AudioPlaybackStatusChanged,!1))},n.handleVideoPlaybackStarted=function(){n.isVideoPlaybackBlocked&&(n.isVideoPlaybackBlocked=!1,n.emit(je.VideoPlaybackStatusChanged,!0))},n.handleVideoPlaybackFailed=function(){n.isVideoPlaybackBlocked||(n.isVideoPlaybackBlocked=!0,n.emit(je.VideoPlaybackStatusChanged,!1))},n.handleDeviceChange=function(){return he(ct(n),void 0,void 0,L().mark(function o(){var c,u,d,h,b,v=this;return L().wrap(function(y){for(;;)switch(y.prev=y.next){case 0:return y.next=2,yr.getInstance().getDevices(void 0,!1);case 2:c=y.sent,u=["audiooutput"],d=L().mark(function p(){var f,m;return L().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(f=b[h],0>=(m=c.filter(function(k){return k.kind===f})).length||m.find(function(k){return k.deviceId===v.getActiveDevice(f)})){_.next=5;break}return _.next=5,v.switchActiveDevice(f,m[0].deviceId);case 5:case"end":return _.stop()}},p)}),h=0,b=u;case 6:if(h>=b.length){y.next=11;break}return y.delegateYield(d(),"t0",8);case 8:h++,y.next=6;break;case 11:this.emit(je.MediaDevicesChanged);case 12:case"end":return y.stop()}},o,this)}))},n.handleRoomUpdate=function(o){var c=n.roomInfo;n.roomInfo=o,c&&c.metadata!==o.metadata&&n.emitWhenConnected(je.RoomMetadataChanged,o.metadata),(c==null?void 0:c.activeRecording)!==o.activeRecording&&n.emitWhenConnected(je.RecordingStatusChanged,o.activeRecording)},n.handleConnectionQualityUpdate=function(o){o.updates.forEach(function(c){if(c.participantSid!==n.localParticipant.sid){var u=n.getRemoteParticipantBySid(c.participantSid);u&&u.setConnectionQuality(c.quality)}else n.localParticipant.setConnectionQuality(c.quality)})},n.onLocalParticipantMetadataChanged=function(o){n.emit(je.ParticipantMetadataChanged,o,n.localParticipant)},n.onLocalParticipantNameChanged=function(o){n.emit(je.ParticipantNameChanged,o,n.localParticipant)},n.onLocalAttributesChanged=function(o){n.emit(je.ParticipantAttributesChanged,o,n.localParticipant)},n.onLocalTrackMuted=function(o){n.emit(je.TrackMuted,o,n.localParticipant)},n.onLocalTrackUnmuted=function(o){n.emit(je.TrackUnmuted,o,n.localParticipant)},n.onTrackProcessorUpdate=function(o){var c;(c=o==null?void 0:o.onPublish)===null||c===void 0||c.call(o,ct(n))},n.onLocalTrackPublished=function(o){return he(ct(n),void 0,void 0,L().mark(function c(){var u,d,h,b,v,y,p,f;return L().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if((u=o.track)===null||u===void 0||u.on($e.TrackProcessorUpdate,this.onTrackProcessorUpdate),(d=o.track)===null||d===void 0||d.on($e.Restarted,this.onLocalTrackRestarted),(v=(b=(h=o.track)===null||h===void 0?void 0:h.getProcessor())===null||b===void 0?void 0:b.onPublish)===null||v===void 0||v.call(b,this),this.emit(je.LocalTrackPublished,o,this.localParticipant),!(o.track instanceof Pn)){m.next=9;break}return m.next=7,o.track.checkForSilence();case 7:m.sent&&this.emit(je.LocalAudioSilenceDetected,o);case 9:return m.next=11,(y=o.track)===null||y===void 0?void 0:y.getDeviceId();case 11:p=m.sent,(f=OT(o.source))&&p&&p!==this.localParticipant.activeDeviceMap.get(f)&&(this.localParticipant.activeDeviceMap.set(f,p),this.emit(je.ActiveDeviceChanged,f,p));case 14:case"end":return m.stop()}},c,this)}))},n.onLocalTrackUnpublished=function(o){var c,u;(c=o.track)===null||c===void 0||c.off($e.TrackProcessorUpdate,n.onTrackProcessorUpdate),(u=o.track)===null||u===void 0||u.off($e.Restarted,n.onLocalTrackRestarted),n.emit(je.LocalTrackUnpublished,o,n.localParticipant)},n.onLocalTrackRestarted=function(o){return he(ct(n),void 0,void 0,L().mark(function c(){var u,d;return L().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.next=2,o.getDeviceId(!1);case 2:u=h.sent,(d=OT(o.source))&&u&&u!==this.localParticipant.activeDeviceMap.get(d)&&(this.log.debug("local track restarted, setting ".concat(d," ").concat(u," active"),this.logContext),this.localParticipant.activeDeviceMap.set(d,u),this.emit(je.ActiveDeviceChanged,d,u));case 5:case"end":return h.stop()}},c,this)}))},n.onLocalConnectionQualityChanged=function(o){n.emit(je.ConnectionQualityChanged,o,n.localParticipant)},n.onMediaDevicesError=function(o){n.emit(je.MediaDevicesError,o)},n.onLocalParticipantPermissionsChanged=function(o){n.emit(je.ParticipantPermissionsChanged,o,n.localParticipant)},n.onLocalChatMessageSent=function(o){n.emit(je.ChatMessage,o,n.localParticipant)},n.setMaxListeners(100),n.remoteParticipants=new Map,n.sidToIdentity=new Map,n.options=Object.assign(Object.assign({},z9),t),n.log=Lr((s=n.options.loggerName)!==null&&s!==void 0?s:Wi.Room),n.transcriptionReceivedTimes=new Map,n.options.audioCaptureDefaults=Object.assign(Object.assign({},nS),t==null?void 0:t.audioCaptureDefaults),n.options.videoCaptureDefaults=Object.assign(Object.assign({},iS),t==null?void 0:t.videoCaptureDefaults),n.options.publishDefaults=Object.assign(Object.assign({},q9),t==null?void 0:t.publishDefaults),n.maybeCreateEngine(),n.disconnectLock=new bi,n.localParticipant=new yS("","",n.engine,n.options),n.options.videoCaptureDefaults.deviceId&&n.localParticipant.activeDeviceMap.set("videoinput",Fr(n.options.videoCaptureDefaults.deviceId)),n.options.audioCaptureDefaults.deviceId&&n.localParticipant.activeDeviceMap.set("audioinput",Fr(n.options.audioCaptureDefaults.deviceId)),!((a=n.options.audioOutput)===null||a===void 0)&&a.deviceId&&n.switchActiveDevice("audiooutput",Fr(n.options.audioOutput.deviceId)).catch(function(o){return n.log.warn("Could not set audio output: ".concat(o.message),n.logContext)}),n.options.e2ee&&n.setupE2EE(),n}return Lt(e,Ys.EventEmitter),ft(e,[{key:"setE2EEEnabled",value:function(t){return he(this,void 0,void 0,L().mark(function n(){return L().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!this.e2eeManager){r.next=6;break}return r.next=3,Promise.all([this.localParticipant.setE2EEEnabled(t)]);case 3:this.localParticipant.identity!==""&&this.e2eeManager.setParticipantCryptorEnabled(t,this.localParticipant.identity),r.next=7;break;case 6:throw Error("e2ee not configured, please set e2ee settings within the room options");case 7:case"end":return r.stop()}},n,this)}))}},{key:"setupE2EE",value:function(){var t,n=this;this.options.e2ee&&(this.e2eeManager=new R9(this.options.e2ee),this.e2eeManager.on(fs.ParticipantEncryptionStatusChanged,function(r,s){s instanceof yS&&(n.isE2EEEnabled=r),n.emit(je.ParticipantEncryptionStatusChanged,r,s)}),this.e2eeManager.on(fs.EncryptionError,function(r){return n.emit(je.EncryptionError,r)}),(t=this.e2eeManager)===null||t===void 0||t.setup(this))}},{key:"logContext",get:function(){var t;return{room:this.name,roomID:(t=this.roomInfo)===null||t===void 0?void 0:t.sid,participant:this.localParticipant.identity,pID:this.localParticipant.sid}}},{key:"isRecording",get:function(){var t,n;return(n=(t=this.roomInfo)===null||t===void 0?void 0:t.activeRecording)!==null&&n!==void 0&&n}},{key:"getSid",value:function(){return he(this,void 0,void 0,L().mark(function t(){var n=this;return L().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(this.state!==Ut.Disconnected){r.next=2;break}return r.abrupt("return","");case 2:if(!this.roomInfo||this.roomInfo.sid===""){r.next=4;break}return r.abrupt("return",this.roomInfo.sid);case 4:return r.abrupt("return",new Promise(function(s,a){var o=function c(u){u.sid!==""&&(n.engine.off(Qe.RoomUpdate,c),s(u.sid))};n.engine.on(Qe.RoomUpdate,o),n.once(je.Disconnected,function(){n.engine.off(Qe.RoomUpdate,o),a("Room disconnected before room server id was available")})}));case 5:case"end":return r.stop()}},t,this)}))}},{key:"name",get:function(){var t,n;return(n=(t=this.roomInfo)===null||t===void 0?void 0:t.name)!==null&&n!==void 0?n:""}},{key:"metadata",get:function(){var t;return(t=this.roomInfo)===null||t===void 0?void 0:t.metadata}},{key:"numParticipants",get:function(){var t,n;return(n=(t=this.roomInfo)===null||t===void 0?void 0:t.numParticipants)!==null&&n!==void 0?n:0}},{key:"numPublishers",get:function(){var t,n;return(n=(t=this.roomInfo)===null||t===void 0?void 0:t.numPublishers)!==null&&n!==void 0?n:0}},{key:"maybeCreateEngine",value:function(){var t=this;this.engine&&!this.engine.isClosed||(this.engine=new tR(this.options),this.engine.on(Qe.ParticipantUpdate,this.handleParticipantUpdates).on(Qe.RoomUpdate,this.handleRoomUpdate).on(Qe.SpeakersChanged,this.handleSpeakersChanged).on(Qe.StreamStateChanged,this.handleStreamStateUpdate).on(Qe.ConnectionQualityUpdate,this.handleConnectionQualityUpdate).on(Qe.SubscriptionError,this.handleSubscriptionError).on(Qe.SubscriptionPermissionUpdate,this.handleSubscriptionPermissionUpdate).on(Qe.MediaTrackAdded,function(n,r,s){t.onTrackAdded(n,r,s)}).on(Qe.Disconnected,function(n){t.handleDisconnect(t.options.stopLocalTrackOnUnpublish,n)}).on(Qe.ActiveSpeakersUpdate,this.handleActiveSpeakersUpdate).on(Qe.DataPacketReceived,this.handleDataPacket).on(Qe.Resuming,function(){t.clearConnectionReconcile(),t.isResuming=!0,t.log.info("Resuming signal connection",t.logContext),t.setAndEmitConnectionState(Ut.SignalReconnecting)&&t.emit(je.SignalReconnecting)}).on(Qe.Resumed,function(){t.registerConnectionReconcile(),t.isResuming=!1,t.log.info("Resumed signal connection",t.logContext),t.updateSubscriptions(),t.emitBufferedEvents(),t.setAndEmitConnectionState(Ut.Connected)&&t.emit(je.Reconnected)}).on(Qe.SignalResumed,function(){t.bufferedEvents=[],(t.state===Ut.Reconnecting||t.isResuming)&&t.sendSyncState()}).on(Qe.Restarting,this.handleRestarting).on(Qe.SignalRestarted,this.handleSignalRestarted).on(Qe.Offline,function(){t.setAndEmitConnectionState(Ut.Reconnecting)&&t.emit(je.Reconnecting)}).on(Qe.DCBufferStatusChanged,function(n,r){t.emit(je.DCBufferStatusChanged,n,r)}).on(Qe.LocalTrackSubscribed,function(n){var r=t.localParticipant.getTrackPublications().find(function(s){return s.trackSid===n});r?(t.localParticipant.emit(qe.LocalTrackSubscribed,r),t.emitWhenConnected(je.LocalTrackSubscribed,r,t.localParticipant)):t.log.warn("could not find local track subscription for subscribed event",t.logContext)}),this.localParticipant&&this.localParticipant.setupEngine(this.engine),this.e2eeManager&&this.e2eeManager.setupEngine(this.engine))}},{key:"prepareConnection",value:function(t,n){return he(this,void 0,void 0,L().mark(function r(){var s;return L().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:if(this.state===Ut.Disconnected){a.next=2;break}return a.abrupt("return");case 2:if(this.log.debug("prepareConnection to ".concat(t),this.logContext),a.prev=3,!Fm(new URL(t))||!n){a.next=16;break}return this.regionUrlProvider=new fS(t,n),a.next=8,this.regionUrlProvider.getNextBestRegionUrl();case 8:if(!(s=a.sent)||this.state!==Ut.Disconnected){a.next=14;break}return this.regionUrl=s,a.next=13,fetch(HT(s),{method:"HEAD"});case 13:this.log.debug("prepared connection to ".concat(s),this.logContext);case 14:a.next=18;break;case 16:return a.next=18,fetch(HT(t),{method:"HEAD"});case 18:a.next=23;break;case 20:a.prev=20,a.t0=a.catch(3),this.log.warn("could not prepare connection",Object.assign(Object.assign({},this.logContext),{error:a.t0}));case 23:case"end":return a.stop()}},r,this,[[3,20]])}))}},{key:"getParticipantByIdentity",value:function(t){return this.localParticipant.identity===t?this.localParticipant:this.remoteParticipants.get(t)}},{key:"clearConnectionFutures",value:function(){this.connectFuture=void 0}},{key:"simulateScenario",value:function(t,n){return he(this,void 0,void 0,L().mark(function r(){var s,a,o=this;return L().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:s=function(){},c.t0=t,c.next=c.t0==="signal-reconnect"?4:c.t0==="speaker"?7:c.t0==="node-failure"?9:c.t0==="server-leave"?11:c.t0==="migration"?13:c.t0==="resume-reconnect"?15:c.t0==="disconnect-signal-on-resume"?19:c.t0==="disconnect-signal-on-resume-no-messages"?22:c.t0==="full-reconnect"?25:c.t0==="force-tcp"||c.t0==="force-tls"?29:c.t0==="subscriber-bandwidth"?32:c.t0==="leave-full-reconnect"?36:37;break;case 4:return c.next=6,this.engine.client.handleOnClose("simulate disconnect");case 6:return c.abrupt("break",37);case 7:return a=new mr({scenario:{case:"speakerUpdate",value:3}}),c.abrupt("break",37);case 9:return a=new mr({scenario:{case:"nodeFailure",value:!0}}),c.abrupt("break",37);case 11:return a=new mr({scenario:{case:"serverLeave",value:!0}}),c.abrupt("break",37);case 13:return a=new mr({scenario:{case:"migration",value:!0}}),c.abrupt("break",37);case 15:return this.engine.failNext(),c.next=18,this.engine.client.handleOnClose("simulate resume-disconnect");case 18:return c.abrupt("break",37);case 19:return s=function(){return he(o,void 0,void 0,L().mark(function u(){return L().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,this.engine.client.handleOnClose("simulate resume-disconnect");case 2:case"end":return d.stop()}},u,this)}))},a=new mr({scenario:{case:"disconnectSignalOnResume",value:!0}}),c.abrupt("break",37);case 22:return s=function(){return he(o,void 0,void 0,L().mark(function u(){return L().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return d.next=2,this.engine.client.handleOnClose("simulate resume-disconnect");case 2:case"end":return d.stop()}},u,this)}))},a=new mr({scenario:{case:"disconnectSignalOnResumeNoMessages",value:!0}}),c.abrupt("break",37);case 25:return this.engine.fullReconnectOnNext=!0,c.next=28,this.engine.client.handleOnClose("simulate full-reconnect");case 28:return c.abrupt("break",37);case 29:return a=new mr({scenario:{case:"switchCandidateProtocol",value:t==="force-tls"?2:1}}),s=function(){return he(o,void 0,void 0,L().mark(function u(){var d;return L().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:(d=this.engine.client.onLeave)&&d(new ud({reason:to.CLIENT_INITIATED,action:ro.RECONNECT}));case 2:case"end":return h.stop()}},u,this)}))},c.abrupt("break",37);case 32:if(n!==void 0&&typeof n=="number"){c.next=34;break}throw new Error("subscriber-bandwidth requires a number as argument");case 34:return a=new mr({scenario:{case:"subscriberBandwidth",value:BigInt(n)}}),c.abrupt("break",37);case 36:a=new mr({scenario:{case:"leaveRequestFullReconnect",value:!0}});case 37:if(!a){c.next=42;break}return c.next=40,this.engine.client.sendSimulateScenario(a);case 40:return c.next=42,s();case 42:case"end":return c.stop()}},r,this)}))}},{key:"canPlaybackAudio",get:function(){return this.audioEnabled}},{key:"canPlaybackVideo",get:function(){return!this.isVideoPlaybackBlocked}},{key:"getActiveDevice",value:function(t){return this.localParticipant.activeDeviceMap.get(t)}},{key:"switchActiveDevice",value:function(t,n){return he(this,arguments,void 0,function(r,s){var a=this,o=arguments.length>2&&arguments[2]!==void 0&&arguments[2];return L().mark(function c(){var u,d,h,b,v,y,p,f,m,_,k,D,E,A,w;return L().wrap(function(N){for(;;)switch(N.prev=N.next){case 0:if(f=!1,m=!0,_=o?{exact:s}:s,r!=="audioinput"){N.next=20;break}return k=(u=a.getActiveDevice(r))!==null&&u!==void 0?u:a.options.audioCaptureDefaults.deviceId,a.options.audioCaptureDefaults.deviceId=_,f=k!==_,D=Array.from(a.localParticipant.audioTrackPublications.values()).filter(function(S){return S.source===Le.Source.Microphone}),N.prev=8,N.next=11,Promise.all(D.map(function(S){var P;return(P=S.audioTrack)===null||P===void 0?void 0:P.setDeviceId(_)}));case 11:m=N.sent.every(function(S){return S===!0}),N.next=18;break;case 14:throw N.prev=14,N.t0=N.catch(8),a.options.audioCaptureDefaults.deviceId=k,N.t0;case 18:N.next=67;break;case 20:if(r!=="videoinput"){N.next=37;break}return E=(d=a.getActiveDevice(r))!==null&&d!==void 0?d:a.options.videoCaptureDefaults.deviceId,a.options.videoCaptureDefaults.deviceId=_,f=E!==_,A=Array.from(a.localParticipant.videoTrackPublications.values()).filter(function(S){return S.source===Le.Source.Camera}),N.prev=25,N.next=28,Promise.all(A.map(function(S){var P;return(P=S.videoTrack)===null||P===void 0?void 0:P.setDeviceId(_)}));case 28:m=N.sent.every(function(S){return S===!0}),N.next=35;break;case 31:throw N.prev=31,N.t1=N.catch(25),a.options.videoCaptureDefaults.deviceId=E,N.t1;case 35:N.next=67;break;case 37:if(r!=="audiooutput"){N.next=67;break}if(!(!Um()&&!a.options.webAudioMix||a.options.webAudioMix&&a.audioContext&&!("setSinkId"in a.audioContext))){N.next=40;break}throw new Error("cannot switch audio output, setSinkId not supported");case 40:if(!a.options.webAudioMix){N.next=53;break}return N.next=43,yr.getInstance().normalizeDeviceId("audiooutput",s);case 43:if(N.t3=h=N.sent,N.t2=N.t3!==null,!N.t2){N.next=47;break}N.t2=h!==void 0;case 47:if(!N.t2){N.next=51;break}N.t4=h,N.next=52;break;case 51:N.t4="";case 52:s=N.t4;case 53:return(b=(p=a.options).audioOutput)!==null&&b!==void 0||(p.audioOutput={}),w=(v=a.getActiveDevice(r))!==null&&v!==void 0?v:a.options.audioOutput.deviceId,a.options.audioOutput.deviceId=s,f=w!==_,N.prev=57,a.options.webAudioMix&&((y=a.audioContext)===null||y===void 0||y.setSinkId(s)),N.next=61,Promise.all(Array.from(a.remoteParticipants.values()).map(function(S){return S.setAudioOutput({deviceId:s})}));case 61:N.next=67;break;case 63:throw N.prev=63,N.t5=N.catch(57),a.options.audioOutput.deviceId=w,N.t5;case 67:return f&&m&&(a.localParticipant.activeDeviceMap.set(r,s),a.emit(je.ActiveDeviceChanged,r,s)),N.abrupt("return",m);case 69:case"end":return N.stop()}},c,null,[[8,14],[25,31],[57,63]])})()})}},{key:"setupLocalParticipantEvents",value:function(){this.localParticipant.on(qe.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).on(qe.ParticipantNameChanged,this.onLocalParticipantNameChanged).on(qe.AttributesChanged,this.onLocalAttributesChanged).on(qe.TrackMuted,this.onLocalTrackMuted).on(qe.TrackUnmuted,this.onLocalTrackUnmuted).on(qe.LocalTrackPublished,this.onLocalTrackPublished).on(qe.LocalTrackUnpublished,this.onLocalTrackUnpublished).on(qe.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).on(qe.MediaDevicesError,this.onMediaDevicesError).on(qe.AudioStreamAcquired,this.startAudio).on(qe.ChatMessage,this.onLocalChatMessageSent).on(qe.ParticipantPermissionsChanged,this.onLocalParticipantPermissionsChanged)}},{key:"recreateEngine",value:function(){var t;(t=this.engine)===null||t===void 0||t.close(),this.engine=void 0,this.isResuming=!1,this.remoteParticipants.clear(),this.sidToIdentity.clear(),this.bufferedEvents=[],this.maybeCreateEngine()}},{key:"onTrackAdded",value:function(t,n,r){var s=this;if(this.state===Ut.Connecting||this.state===Ut.Reconnecting){var a=function(){s.onTrackAdded(t,n,r),o()},o=function y(){s.off(je.Reconnected,a),s.off(je.Connected,a),s.off(je.Disconnected,y)};return this.once(je.Reconnected,a),this.once(je.Connected,a),void this.once(je.Disconnected,o)}if(this.state!==Ut.Disconnected){var c=function(y){var p=y.split("|");return p.length>1?[p[0],y.substr(p[0].length+1)]:[y,""]}(n.id),u=c[0],d=c[1],h=t.id;if(d&&d.startsWith("TR")&&(h=d),u!==this.localParticipant.sid){var b,v=Array.from(this.remoteParticipants.values()).find(function(y){return y.sid===u});v?(this.options.adaptiveStream&&(b=et(this.options.adaptiveStream)==="object"?this.options.adaptiveStream:{}),v.addSubscribedMediaTrack(t,h,n,r,b)):this.log.error("Tried to add a track for a participant, that's not present. Sid: ".concat(u),this.logContext)}else this.log.warn("tried to create RemoteParticipant for local participant",this.logContext)}else this.log.warn("skipping incoming track after Room disconnected",this.logContext)}},{key:"handleDisconnect",value:function(){var t,n=this,r=0>=arguments.length||arguments[0]===void 0||arguments[0],s=arguments.length>1?arguments[1]:void 0;if(this.clearConnectionReconcile(),this.isResuming=!1,this.bufferedEvents=[],this.transcriptionReceivedTimes.clear(),this.state!==Ut.Disconnected){this.regionUrl=void 0;try{this.remoteParticipants.forEach(function(a){a.trackPublications.forEach(function(o){a.unpublishTrack(o.trackSid)})}),this.localParticipant.trackPublications.forEach(function(a){var o,c;a.track&&n.localParticipant.unpublishTrack(a.track,r),r&&((o=a.track)===null||o===void 0||o.detach(),(c=a.track)===null||c===void 0||c.stop())}),this.localParticipant.off(qe.ParticipantMetadataChanged,this.onLocalParticipantMetadataChanged).off(qe.ParticipantNameChanged,this.onLocalParticipantNameChanged).off(qe.AttributesChanged,this.onLocalAttributesChanged).off(qe.TrackMuted,this.onLocalTrackMuted).off(qe.TrackUnmuted,this.onLocalTrackUnmuted).off(qe.LocalTrackPublished,this.onLocalTrackPublished).off(qe.LocalTrackUnpublished,this.onLocalTrackUnpublished).off(qe.ConnectionQualityChanged,this.onLocalConnectionQualityChanged).off(qe.MediaDevicesError,this.onMediaDevicesError).off(qe.AudioStreamAcquired,this.startAudio).off(qe.ChatMessage,this.onLocalChatMessageSent).off(qe.ParticipantPermissionsChanged,this.onLocalParticipantPermissionsChanged),this.localParticipant.trackPublications.clear(),this.localParticipant.videoTrackPublications.clear(),this.localParticipant.audioTrackPublications.clear(),this.remoteParticipants.clear(),this.sidToIdentity.clear(),this.activeSpeakers=[],this.audioContext&&typeof this.options.webAudioMix=="boolean"&&(this.audioContext.close(),this.audioContext=void 0),yi()&&(window.removeEventListener("beforeunload",this.onPageLeave),window.removeEventListener("pagehide",this.onPageLeave),window.removeEventListener("freeze",this.onPageLeave),(t=navigator.mediaDevices)===null||t===void 0||t.removeEventListener("devicechange",this.handleDeviceChange))}finally{this.setAndEmitConnectionState(Ut.Disconnected),this.emit(je.Disconnected,s)}}}},{key:"handleParticipantDisconnected",value:function(t,n){this.remoteParticipants.delete(t),n&&(n.trackPublications.forEach(function(r){n.unpublishTrack(r.trackSid,!0)}),this.emit(je.ParticipantDisconnected,n))}},{key:"acquireAudioContext",value:function(){return he(this,void 0,void 0,L().mark(function t(){var n,r,s,a=this;return L().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(typeof this.options.webAudioMix!="boolean"&&this.options.webAudioMix.audioContext?this.audioContext=this.options.webAudioMix.audioContext:this.audioContext&&this.audioContext.state!=="closed"||(this.audioContext=(n=PT())!==null&&n!==void 0?n:void 0),!this.audioContext||this.audioContext.state!=="suspended"){o.next=10;break}return o.prev=2,o.next=5,this.audioContext.resume();case 5:o.next=10;break;case 7:o.prev=7,o.t0=o.catch(2),this.log.warn("Could not resume audio context",Object.assign(Object.assign({},this.logContext),{error:o.t0}));case 10:this.options.webAudioMix&&this.remoteParticipants.forEach(function(c){return c.setAudioContext(a.audioContext)}),this.localParticipant.setAudioContext(this.audioContext),(s=((r=this.audioContext)===null||r===void 0?void 0:r.state)==="running")!==this.canPlaybackAudio&&(this.audioEnabled=s,this.emit(je.AudioPlaybackStatusChanged,s));case 14:case"end":return o.stop()}},t,this,[[2,7]])}))}},{key:"createParticipant",value:function(t,n){var r,s,a=this;return s=n?_S.fromParticipantInfo(this.engine.client,n,{loggerContextCb:function(){return a.logContext},loggerName:this.options.loggerName}):new _S(this.engine.client,"",t,void 0,void 0,{loggerContextCb:function(){return a.logContext},loggerName:this.options.loggerName}),this.options.webAudioMix&&s.setAudioContext(this.audioContext),!((r=this.options.audioOutput)===null||r===void 0)&&r.deviceId&&s.setAudioOutput(this.options.audioOutput).catch(function(o){return a.log.warn("Could not set audio output: ".concat(o.message),a.logContext)}),s}},{key:"getOrCreateParticipant",value:function(t,n){var r=this;if(this.remoteParticipants.has(t)){var s=this.remoteParticipants.get(t);return n&&s.updateInfo(n)&&this.sidToIdentity.set(n.sid,n.identity),s}var a=this.createParticipant(t,n);return this.remoteParticipants.set(t,a),this.sidToIdentity.set(n.sid,n.identity),this.emitWhenConnected(je.ParticipantConnected,a),a.on(qe.TrackPublished,function(o){r.emitWhenConnected(je.TrackPublished,o,a)}).on(qe.TrackSubscribed,function(o,c){o.kind===Le.Kind.Audio?(o.on($e.AudioPlaybackStarted,r.handleAudioPlaybackStarted),o.on($e.AudioPlaybackFailed,r.handleAudioPlaybackFailed)):o.kind===Le.Kind.Video&&(o.on($e.VideoPlaybackFailed,r.handleVideoPlaybackFailed),o.on($e.VideoPlaybackStarted,r.handleVideoPlaybackStarted)),r.emit(je.TrackSubscribed,o,c,a)}).on(qe.TrackUnpublished,function(o){r.emit(je.TrackUnpublished,o,a)}).on(qe.TrackUnsubscribed,function(o,c){r.emit(je.TrackUnsubscribed,o,c,a)}).on(qe.TrackSubscriptionFailed,function(o){r.emit(je.TrackSubscriptionFailed,o,a)}).on(qe.TrackMuted,function(o){r.emitWhenConnected(je.TrackMuted,o,a)}).on(qe.TrackUnmuted,function(o){r.emitWhenConnected(je.TrackUnmuted,o,a)}).on(qe.ParticipantMetadataChanged,function(o){r.emitWhenConnected(je.ParticipantMetadataChanged,o,a)}).on(qe.ParticipantNameChanged,function(o){r.emitWhenConnected(je.ParticipantNameChanged,o,a)}).on(qe.AttributesChanged,function(o){r.emitWhenConnected(je.ParticipantAttributesChanged,o,a)}).on(qe.ConnectionQualityChanged,function(o){r.emitWhenConnected(je.ConnectionQualityChanged,o,a)}).on(qe.ParticipantPermissionsChanged,function(o){r.emitWhenConnected(je.ParticipantPermissionsChanged,o,a)}).on(qe.TrackSubscriptionStatusChanged,function(o,c){r.emitWhenConnected(je.TrackSubscriptionStatusChanged,o,c,a)}).on(qe.TrackSubscriptionFailed,function(o,c){r.emit(je.TrackSubscriptionFailed,o,a,c)}).on(qe.TrackSubscriptionPermissionChanged,function(o,c){r.emitWhenConnected(je.TrackSubscriptionPermissionChanged,o,c,a)}),n&&a.updateInfo(n),a}},{key:"sendSyncState",value:function(){var t=Array.from(this.remoteParticipants.values()).reduce(function(r,s){return r.push.apply(r,Ii(s.getTrackPublications())),r},[]),n=this.localParticipant.getTrackPublications();this.engine.sendSyncState(t,n)}},{key:"updateSubscriptions",value:function(){var t,n=dt(this.remoteParticipants.values());try{for(n.s();!(t=n.n()).done;){var r,s=dt(t.value.videoTrackPublications.values());try{for(s.s();!(r=s.n()).done;){var a=r.value;a.isSubscribed&&a instanceof bS&&a.emitTrackUpdate()}}catch(o){s.e(o)}finally{s.f()}}}catch(o){n.e(o)}finally{n.f()}}},{key:"getRemoteParticipantBySid",value:function(t){var n=this.sidToIdentity.get(t);if(n)return this.remoteParticipants.get(n)}},{key:"registerConnectionReconcile",value:function(){var t=this;this.clearConnectionReconcile();var n=0;this.connectionReconcileInterval=Nn.setInterval(function(){t.engine&&!t.engine.isClosed&&t.engine.verifyTransport()?n=0:(n++,t.log.warn("detected connection state mismatch",Object.assign(Object.assign({},t.logContext),{numFailures:n,engine:{closed:t.engine.isClosed,transportsConnected:t.engine.verifyTransport()}})),3>n||(t.recreateEngine(),t.handleDisconnect(t.options.stopLocalTrackOnUnpublish,to.STATE_MISMATCH)))},4e3)}},{key:"clearConnectionReconcile",value:function(){this.connectionReconcileInterval&&Nn.clearInterval(this.connectionReconcileInterval)}},{key:"setAndEmitConnectionState",value:function(t){return t!==this.state&&(this.state=t,this.emit(je.ConnectionStateChanged,this.state),!0)}},{key:"emitBufferedEvents",value:function(){var t=this;this.bufferedEvents.forEach(function(n){var r=At(n,2),s=r[0],a=r[1];t.emit.apply(t,[s].concat(Ii(a)))}),this.bufferedEvents=[]}},{key:"emitWhenConnected",value:function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;n>s;s++)r[s-1]=arguments[s];if(this.state===Ut.Reconnecting||this.isResuming||!this.engine||this.engine.pendingReconnect)this.bufferedEvents.push([t,r]);else if(this.state===Ut.Connected)return this.emit.apply(this,[t].concat(r));return!1}},{key:"simulateParticipants",value:function(t){return he(this,void 0,void 0,L().mark(function n(){var r,s,a,o,c,u,d,h,b,v,y,p,f,m=this;return L().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(a=Object.assign({audio:!0,video:!0,useRealTracks:!1},t.publish),o=Object.assign({count:9,audio:!1,video:!0,aspectRatios:[1.66,1.7,1.3]},t.participants),this.handleDisconnect(),this.roomInfo=new om({sid:"RM_SIMULATED",name:"simulated-room",emptyTimeout:0,maxParticipants:0,creationTime:qt.parse(new Date().getTime()),metadata:"",numParticipants:1,numPublishers:1,turnPassword:"",enabledCodecs:[],activeRecording:!1}),this.localParticipant.updateInfo(new Nl({identity:"simulated-local",name:"local-name"})),this.setupLocalParticipantEvents(),this.emit(je.SignalConnected),this.emit(je.Connected),this.setAndEmitConnectionState(Ut.Connected),!a.video){_.next=29;break}if(_.t0=wd,_.t1=Le.Kind.Video,_.t2=new io({source:jn.CAMERA,sid:Math.floor(1e4*Math.random()).toString(),type:zi.AUDIO,name:"video-dummy"}),_.t3=Hn,!a.useRealTracks){_.next=20;break}return _.next=17,window.navigator.mediaDevices.getUserMedia({video:!0});case 17:_.t4=_.sent.getVideoTracks()[0],_.next=21;break;case 20:_.t4=jT(160*((r=o.aspectRatios[0])!==null&&r!==void 0?r:1),160,!0,!0);case 21:_.t5=_.t4,_.t6=void 0,_.t7={loggerName:this.options.loggerName,loggerContextCb:function(){return m.logContext}},_.t8=new _.t3(_.t5,_.t6,!1,_.t7),_.t9={loggerName:this.options.loggerName,loggerContextCb:function(){return m.logContext}},c=new _.t0(_.t1,_.t2,_.t8,_.t9),this.localParticipant.addTrackPublication(c),this.localParticipant.emit(qe.LocalTrackPublished,c);case 29:if(!a.audio){_.next=50;break}if(_.t10=wd,_.t11=Le.Kind.Audio,_.t12=new io({source:jn.MICROPHONE,sid:Math.floor(1e4*Math.random()).toString(),type:zi.AUDIO}),_.t13=Pn,!a.useRealTracks){_.next=40;break}return _.next=37,navigator.mediaDevices.getUserMedia({audio:!0});case 37:_.t14=_.sent.getAudioTracks()[0],_.next=41;break;case 40:_.t14=$m();case 41:_.t15=_.t14,_.t16=void 0,_.t17=this.audioContext,_.t18={loggerName:this.options.loggerName,loggerContextCb:function(){return m.logContext}},_.t19=new _.t13(_.t15,_.t16,!1,_.t17,_.t18),_.t20={loggerName:this.options.loggerName,loggerContextCb:function(){return m.logContext}},u=new _.t10(_.t11,_.t12,_.t19,_.t20),this.localParticipant.addTrackPublication(u),this.localParticipant.emit(qe.LocalTrackPublished,u);case 50:for(d=0;d<o.count-1;d+=1)h=new Nl({sid:Math.floor(1e4*Math.random()).toString(),identity:"simulated-".concat(d),state:lm.ACTIVE,tracks:[],joinedAt:qt.parse(Date.now())}),b=this.getOrCreateParticipant(h.identity,h),o.video&&(v=jT(160*((s=o.aspectRatios[d%o.aspectRatios.length])!==null&&s!==void 0?s:1),160,!1,!0),y=new io({source:jn.CAMERA,sid:Math.floor(1e4*Math.random()).toString(),type:zi.AUDIO}),b.addSubscribedMediaTrack(v,y.sid,new MediaStream([v]),new RTCRtpReceiver),h.tracks=[].concat(Ii(h.tracks),[y])),o.audio&&(p=$m(),f=new io({source:jn.MICROPHONE,sid:Math.floor(1e4*Math.random()).toString(),type:zi.AUDIO}),b.addSubscribedMediaTrack(p,f.sid,new MediaStream([p]),new RTCRtpReceiver),h.tracks=[].concat(Ii(h.tracks),[f])),b.updateInfo(h);case 51:case"end":return _.stop()}},n,this)}))}},{key:"emit",value:function(t){for(var n,r=arguments.length,s=new Array(r>1?r-1:0),a=1;r>a;a++)s[a-1]=arguments[a];if(t!==je.ActiveSpeakersChanged){var o=TS(s).filter(function(c){return c!==void 0});this.log.debug("room event ".concat(t),Object.assign(Object.assign({},this.logContext),{event:t,args:o}))}return(n=pt(lt(e.prototype),"emit",this)).call.apply(n,[this,t].concat(s))}}],[{key:"getLocalDevices",value:function(t){var n=1>=arguments.length||arguments[1]===void 0||arguments[1];return yr.getInstance().getDevices(t,n)}}]),e}();function TS(i){return i.map(function(e){if(e)return Array.isArray(e)?TS(e):et(e)==="object"?"logContext"in e&&e.logContext:e})}(function(i){i[i.IDLE=0]="IDLE",i[i.RUNNING=1]="RUNNING",i[i.SKIPPED=2]="SKIPPED",i[i.SUCCESS=3]="SUCCESS",i[i.FAILED=4]="FAILED"})(kS||(kS={}));var Zm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function sR(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var SS={exports:{}},CS,xS={exports:{}};function Tt(){return CS||(CS=1,xS.exports=function(){var i=i||function(e,t){var n;if(typeof window<"u"&&window.crypto&&(n=window.crypto),typeof self<"u"&&self.crypto&&(n=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(n=globalThis.crypto),!n&&typeof window<"u"&&window.msCrypto&&(n=window.msCrypto),!n&&Zm!==void 0&&Zm.crypto&&(n=Zm.crypto),!n)try{n=require("crypto")}catch{}var r=function(){if(n){if(typeof n.getRandomValues=="function")try{return n.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof n.randomBytes=="function")try{return n.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},s=Object.create||function(){function f(){}return function(m){var _;return f.prototype=m,_=new f,f.prototype=null,_}}(),a={},o=a.lib={},c=o.Base={extend:function(f){var m=s(this);return f&&m.mixIn(f),m.hasOwnProperty("init")&&this.init!==m.init||(m.init=function(){m.$super.init.apply(this,arguments)}),m.init.prototype=m,m.$super=this,m},create:function(){var f=this.extend();return f.init.apply(f,arguments),f},init:function(){},mixIn:function(f){for(var m in f)f.hasOwnProperty(m)&&(this[m]=f[m]);f.hasOwnProperty("toString")&&(this.toString=f.toString)},clone:function(){return this.init.prototype.extend(this)}},u=o.WordArray=c.extend({init:function(f,m){f=this.words=f||[],this.sigBytes=m!=t?m:4*f.length},toString:function(f){return(f||h).stringify(this)},concat:function(f){var m=this.words,_=f.words,k=this.sigBytes,D=f.sigBytes;if(this.clamp(),k%4)for(var E=0;D>E;E++){var A=_[E>>>2]>>>24-E%4*8&255;m[k+E>>>2]|=A<<24-(k+E)%4*8}else for(var w=0;D>w;w+=4)m[k+w>>>2]=_[w>>>2];return this.sigBytes+=D,this},clamp:function(){var f=this.words,m=this.sigBytes;f[m>>>2]&=4294967295<<32-m%4*8,f.length=e.ceil(m/4)},clone:function(){var f=c.clone.call(this);return f.words=this.words.slice(0),f},random:function(f){for(var m=[],_=0;f>_;_+=4)m.push(r());return new u.init(m,f)}}),d=a.enc={},h=d.Hex={stringify:function(f){for(var m=f.words,_=f.sigBytes,k=[],D=0;_>D;D++){var E=m[D>>>2]>>>24-D%4*8&255;k.push((E>>>4).toString(16)),k.push((15&E).toString(16))}return k.join("")},parse:function(f){for(var m=f.length,_=[],k=0;m>k;k+=2)_[k>>>3]|=parseInt(f.substr(k,2),16)<<24-k%8*4;return new u.init(_,m/2)}},b=d.Latin1={stringify:function(f){for(var m=f.words,_=f.sigBytes,k=[],D=0;_>D;D++){var E=m[D>>>2]>>>24-D%4*8&255;k.push(String.fromCharCode(E))}return k.join("")},parse:function(f){for(var m=f.length,_=[],k=0;m>k;k++)_[k>>>2]|=(255&f.charCodeAt(k))<<24-k%4*8;return new u.init(_,m)}},v=d.Utf8={stringify:function(f){try{return decodeURIComponent(escape(b.stringify(f)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(f){return b.parse(unescape(encodeURIComponent(f)))}},y=o.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(f){typeof f=="string"&&(f=v.parse(f)),this._data.concat(f),this._nDataBytes+=f.sigBytes},_process:function(f){var m,_=this._data,k=_.words,D=_.sigBytes,E=this.blockSize,A=D/(4*E),w=(A=f?e.ceil(A):e.max((0|A)-this._minBufferSize,0))*E,N=e.min(4*w,D);if(w){for(var S=0;w>S;S+=E)this._doProcessBlock(k,S);m=k.splice(0,w),_.sigBytes-=N}return new u.init(m,N)},clone:function(){var f=c.clone.call(this);return f._data=this._data.clone(),f},_minBufferSize:0});o.Hasher=y.extend({cfg:c.extend(),init:function(f){this.cfg=this.cfg.extend(f),this.reset()},reset:function(){y.reset.call(this),this._doReset()},update:function(f){return this._append(f),this._process(),this},finalize:function(f){return f&&this._append(f),this._doFinalize()},blockSize:16,_createHelper:function(f){return function(m,_){return new f.init(_).finalize(m)}},_createHmacHelper:function(f){return function(m,_){return new p.HMAC.init(f,_).finalize(m)}}});var p=a.algo={};return a}(Math);return i}()),xS.exports}var ES,wS={exports:{}};function Ad(){return ES||(ES=1,wS.exports=function(i){return n=(t=i).lib,r=n.Base,s=n.WordArray,(a=t.x64={}).Word=r.extend({init:function(o,c){this.high=o,this.low=c}}),a.WordArray=r.extend({init:function(o,c){o=this.words=o||[],this.sigBytes=c!=e?c:8*o.length},toX32:function(){for(var o=this.words,c=o.length,u=[],d=0;c>d;d++){var h=o[d];u.push(h.high),u.push(h.low)}return s.create(u,this.sigBytes)},clone:function(){for(var o=r.clone.call(this),c=o.words=this.words.slice(0),u=c.length,d=0;u>d;d++)c[d]=c[d].clone();return o}}),i;var e,t,n,r,s,a}(Tt())),wS.exports}var DS,AS={exports:{}};function aR(){return DS||(DS=1,AS.exports=function(i){return function(){if(typeof ArrayBuffer=="function"){var e=i.lib.WordArray,t=e.init,n=e.init=function(r){if(r instanceof ArrayBuffer&&(r=new Uint8Array(r)),(r instanceof Int8Array||typeof Uint8ClampedArray<"u"&&r instanceof Uint8ClampedArray||r instanceof Int16Array||r instanceof Uint16Array||r instanceof Int32Array||r instanceof Uint32Array||r instanceof Float32Array||r instanceof Float64Array)&&(r=new Uint8Array(r.buffer,r.byteOffset,r.byteLength)),r instanceof Uint8Array){for(var s=r.byteLength,a=[],o=0;s>o;o++)a[o>>>2]|=r[o]<<24-o%4*8;t.call(this,a,s)}else t.apply(this,arguments)};n.prototype=e}}(),i.lib.WordArray}(Tt())),AS.exports}var IS,NS={exports:{}};function oR(){return IS||(IS=1,NS.exports=function(i){return function(){var e=i,t=e.lib.WordArray,n=e.enc;function r(s){return s<<8&4278255360|s>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(s){for(var a=s.words,o=s.sigBytes,c=[],u=0;o>u;u+=2){var d=a[u>>>2]>>>16-u%4*8&65535;c.push(String.fromCharCode(d))}return c.join("")},parse:function(s){for(var a=s.length,o=[],c=0;a>c;c++)o[c>>>1]|=s.charCodeAt(c)<<16-c%2*16;return t.create(o,2*a)}},n.Utf16LE={stringify:function(s){for(var a=s.words,o=s.sigBytes,c=[],u=0;o>u;u+=2){var d=r(a[u>>>2]>>>16-u%4*8&65535);c.push(String.fromCharCode(d))}return c.join("")},parse:function(s){for(var a=s.length,o=[],c=0;a>c;c++)o[c>>>1]|=r(s.charCodeAt(c)<<16-c%2*16);return t.create(o,2*a)}}}(),i.enc.Utf16}(Tt())),NS.exports}var PS,OS={exports:{}};function ea(){return PS||(PS=1,OS.exports=function(i){return function(){var e=i,t=e.lib.WordArray;function n(r,s,a){for(var o=[],c=0,u=0;s>u;u++)if(u%4){var d=a[r.charCodeAt(u-1)]<<u%4*2|a[r.charCodeAt(u)]>>>6-u%4*2;o[c>>>2]|=d<<24-c%4*8,c++}return t.create(o,c)}e.enc.Base64={stringify:function(r){var s=r.words,a=r.sigBytes,o=this._map;r.clamp();for(var c=[],u=0;a>u;u+=3)for(var d=(s[u>>>2]>>>24-u%4*8&255)<<16|(s[u+1>>>2]>>>24-(u+1)%4*8&255)<<8|s[u+2>>>2]>>>24-(u+2)%4*8&255,h=0;4>h&&a>u+.75*h;h++)c.push(o.charAt(d>>>6*(3-h)&63));var b=o.charAt(64);if(b)for(;c.length%4;)c.push(b);return c.join("")},parse:function(r){var s=r.length,a=this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var c=0;c<a.length;c++)o[a.charCodeAt(c)]=c}var u=a.charAt(64);if(u){var d=r.indexOf(u);d!==-1&&(s=d)}return n(r,s,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),i.enc.Base64}(Tt())),OS.exports}var MS,RS={exports:{}};function lR(){return MS||(MS=1,RS.exports=function(i){return function(){var e=i,t=e.lib.WordArray;function n(r,s,a){for(var o=[],c=0,u=0;s>u;u++)if(u%4){var d=a[r.charCodeAt(u-1)]<<u%4*2|a[r.charCodeAt(u)]>>>6-u%4*2;o[c>>>2]|=d<<24-c%4*8,c++}return t.create(o,c)}e.enc.Base64url={stringify:function(r,s){s===void 0&&(s=!0);var a=r.words,o=r.sigBytes,c=s?this._safe_map:this._map;r.clamp();for(var u=[],d=0;o>d;d+=3)for(var h=(a[d>>>2]>>>24-d%4*8&255)<<16|(a[d+1>>>2]>>>24-(d+1)%4*8&255)<<8|a[d+2>>>2]>>>24-(d+2)%4*8&255,b=0;4>b&&o>d+.75*b;b++)u.push(c.charAt(h>>>6*(3-b)&63));var v=c.charAt(64);if(v)for(;u.length%4;)u.push(v);return u.join("")},parse:function(r,s){s===void 0&&(s=!0);var a=r.length,o=s?this._safe_map:this._map,c=this._reverseMap;if(!c){c=this._reverseMap=[];for(var u=0;u<o.length;u++)c[o.charCodeAt(u)]=u}var d=o.charAt(64);if(d){var h=r.indexOf(d);h!==-1&&(a=h)}return n(r,a,c)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"}}(),i.enc.Base64url}(Tt())),RS.exports}var LS,BS={exports:{}};function ta(){return LS||(LS=1,BS.exports=function(i){return function(e){var t=i,n=t.lib,r=n.WordArray,s=n.Hasher,a=t.algo,o=[];(function(){for(var v=0;64>v;v++)o[v]=4294967296*e.abs(e.sin(v+1))|0})();var c=a.MD5=s.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(v,y){for(var p=0;16>p;p++){var f=y+p,m=v[f];v[f]=16711935&(m<<8|m>>>24)|4278255360&(m<<24|m>>>8)}var _=this._hash.words,k=v[y+0],D=v[y+1],E=v[y+2],A=v[y+3],w=v[y+4],N=v[y+5],S=v[y+6],P=v[y+7],F=v[y+8],V=v[y+9],J=v[y+10],ie=v[y+11],X=v[y+12],H=v[y+13],$=v[y+14],j=v[y+15],B=_[0],q=_[1],z=_[2],oe=_[3];B=u(B,q,z,oe,k,7,o[0]),oe=u(oe,B,q,z,D,12,o[1]),z=u(z,oe,B,q,E,17,o[2]),q=u(q,z,oe,B,A,22,o[3]),B=u(B,q,z,oe,w,7,o[4]),oe=u(oe,B,q,z,N,12,o[5]),z=u(z,oe,B,q,S,17,o[6]),q=u(q,z,oe,B,P,22,o[7]),B=u(B,q,z,oe,F,7,o[8]),oe=u(oe,B,q,z,V,12,o[9]),z=u(z,oe,B,q,J,17,o[10]),q=u(q,z,oe,B,ie,22,o[11]),B=u(B,q,z,oe,X,7,o[12]),oe=u(oe,B,q,z,H,12,o[13]),z=u(z,oe,B,q,$,17,o[14]),B=d(B,q=u(q,z,oe,B,j,22,o[15]),z,oe,D,5,o[16]),oe=d(oe,B,q,z,S,9,o[17]),z=d(z,oe,B,q,ie,14,o[18]),q=d(q,z,oe,B,k,20,o[19]),B=d(B,q,z,oe,N,5,o[20]),oe=d(oe,B,q,z,J,9,o[21]),z=d(z,oe,B,q,j,14,o[22]),q=d(q,z,oe,B,w,20,o[23]),B=d(B,q,z,oe,V,5,o[24]),oe=d(oe,B,q,z,$,9,o[25]),z=d(z,oe,B,q,A,14,o[26]),q=d(q,z,oe,B,F,20,o[27]),B=d(B,q,z,oe,H,5,o[28]),oe=d(oe,B,q,z,E,9,o[29]),z=d(z,oe,B,q,P,14,o[30]),B=h(B,q=d(q,z,oe,B,X,20,o[31]),z,oe,N,4,o[32]),oe=h(oe,B,q,z,F,11,o[33]),z=h(z,oe,B,q,ie,16,o[34]),q=h(q,z,oe,B,$,23,o[35]),B=h(B,q,z,oe,D,4,o[36]),oe=h(oe,B,q,z,w,11,o[37]),z=h(z,oe,B,q,P,16,o[38]),q=h(q,z,oe,B,J,23,o[39]),B=h(B,q,z,oe,H,4,o[40]),oe=h(oe,B,q,z,k,11,o[41]),z=h(z,oe,B,q,A,16,o[42]),q=h(q,z,oe,B,S,23,o[43]),B=h(B,q,z,oe,V,4,o[44]),oe=h(oe,B,q,z,X,11,o[45]),z=h(z,oe,B,q,j,16,o[46]),B=b(B,q=h(q,z,oe,B,E,23,o[47]),z,oe,k,6,o[48]),oe=b(oe,B,q,z,P,10,o[49]),z=b(z,oe,B,q,$,15,o[50]),q=b(q,z,oe,B,N,21,o[51]),B=b(B,q,z,oe,X,6,o[52]),oe=b(oe,B,q,z,A,10,o[53]),z=b(z,oe,B,q,J,15,o[54]),q=b(q,z,oe,B,D,21,o[55]),B=b(B,q,z,oe,F,6,o[56]),oe=b(oe,B,q,z,j,10,o[57]),z=b(z,oe,B,q,S,15,o[58]),q=b(q,z,oe,B,H,21,o[59]),B=b(B,q,z,oe,w,6,o[60]),oe=b(oe,B,q,z,ie,10,o[61]),z=b(z,oe,B,q,E,15,o[62]),q=b(q,z,oe,B,V,21,o[63]),_[0]=_[0]+B|0,_[1]=_[1]+q|0,_[2]=_[2]+z|0,_[3]=_[3]+oe|0},_doFinalize:function(){var v=this._data,y=v.words,p=8*this._nDataBytes,f=8*v.sigBytes;y[f>>>5]|=128<<24-f%32;var m=e.floor(p/4294967296),_=p;y[15+(f+64>>>9<<4)]=16711935&(m<<8|m>>>24)|4278255360&(m<<24|m>>>8),y[14+(f+64>>>9<<4)]=16711935&(_<<8|_>>>24)|4278255360&(_<<24|_>>>8),v.sigBytes=4*(y.length+1),this._process();for(var k=this._hash,D=k.words,E=0;4>E;E++){var A=D[E];D[E]=16711935&(A<<8|A>>>24)|4278255360&(A<<24|A>>>8)}return k},clone:function(){var v=s.clone.call(this);return v._hash=this._hash.clone(),v}});function u(v,y,p,f,m,_,k){var D=v+(y&p|~y&f)+m+k;return(D<<_|D>>>32-_)+y}function d(v,y,p,f,m,_,k){var D=v+(y&f|p&~f)+m+k;return(D<<_|D>>>32-_)+y}function h(v,y,p,f,m,_,k){var D=v+(y^p^f)+m+k;return(D<<_|D>>>32-_)+y}function b(v,y,p,f,m,_,k){var D=v+(p^(y|~f))+m+k;return(D<<_|D>>>32-_)+y}t.MD5=s._createHelper(c),t.HmacMD5=s._createHmacHelper(c)}(Math),i.MD5}(Tt())),BS.exports}var US,FS={exports:{}};function VS(){return US||(US=1,FS.exports=function(i){return t=(e=i).lib,n=t.WordArray,r=t.Hasher,s=e.algo,a=[],o=s.SHA1=r.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(c,u){for(var d=this._hash.words,h=d[0],b=d[1],v=d[2],y=d[3],p=d[4],f=0;80>f;f++){if(16>f)a[f]=0|c[u+f];else{var m=a[f-3]^a[f-8]^a[f-14]^a[f-16];a[f]=m<<1|m>>>31}var _=(h<<5|h>>>27)+p+a[f];_+=20>f?1518500249+(b&v|~b&y):40>f?1859775393+(b^v^y):60>f?(b&v|b&y|v&y)-1894007588:(b^v^y)-899497514,p=y,y=v,v=b<<30|b>>>2,b=h,h=_}d[0]=d[0]+h|0,d[1]=d[1]+b|0,d[2]=d[2]+v|0,d[3]=d[3]+y|0,d[4]=d[4]+p|0},_doFinalize:function(){var c=this._data,u=c.words,d=8*this._nDataBytes,h=8*c.sigBytes;return u[h>>>5]|=128<<24-h%32,u[14+(h+64>>>9<<4)]=Math.floor(d/4294967296),u[15+(h+64>>>9<<4)]=d,c.sigBytes=4*u.length,this._process(),this._hash},clone:function(){var c=r.clone.call(this);return c._hash=this._hash.clone(),c}}),e.SHA1=r._createHelper(o),e.HmacSHA1=r._createHmacHelper(o),i.SHA1;var e,t,n,r,s,a,o}(Tt())),FS.exports}var jS,$S={exports:{}};function eg(){return jS||(jS=1,$S.exports=function(i){return function(e){var t=i,n=t.lib,r=n.WordArray,s=n.Hasher,a=t.algo,o=[],c=[];(function(){function h(p){for(var f=e.sqrt(p),m=2;f>=m;m++)if(!(p%m))return!1;return!0}function b(p){return 4294967296*(p-(0|p))|0}for(var v=2,y=0;64>y;)h(v)&&(8>y&&(o[y]=b(e.pow(v,.5))),c[y]=b(e.pow(v,1/3)),y++),v++})();var u=[],d=a.SHA256=s.extend({_doReset:function(){this._hash=new r.init(o.slice(0))},_doProcessBlock:function(h,b){for(var v=this._hash.words,y=v[0],p=v[1],f=v[2],m=v[3],_=v[4],k=v[5],D=v[6],E=v[7],A=0;64>A;A++){if(16>A)u[A]=0|h[b+A];else{var w=u[A-15],N=(w<<25|w>>>7)^(w<<14|w>>>18)^w>>>3,S=u[A-2],P=(S<<15|S>>>17)^(S<<13|S>>>19)^S>>>10;u[A]=N+u[A-7]+P+u[A-16]}var F=y&p^y&f^p&f,V=(y<<30|y>>>2)^(y<<19|y>>>13)^(y<<10|y>>>22),J=E+((_<<26|_>>>6)^(_<<21|_>>>11)^(_<<7|_>>>25))+(_&k^~_&D)+c[A]+u[A];E=D,D=k,k=_,_=m+J|0,m=f,f=p,p=y,y=J+(V+F)|0}v[0]=v[0]+y|0,v[1]=v[1]+p|0,v[2]=v[2]+f|0,v[3]=v[3]+m|0,v[4]=v[4]+_|0,v[5]=v[5]+k|0,v[6]=v[6]+D|0,v[7]=v[7]+E|0},_doFinalize:function(){var h=this._data,b=h.words,v=8*this._nDataBytes,y=8*h.sigBytes;return b[y>>>5]|=128<<24-y%32,b[14+(y+64>>>9<<4)]=e.floor(v/4294967296),b[15+(y+64>>>9<<4)]=v,h.sigBytes=4*b.length,this._process(),this._hash},clone:function(){var h=s.clone.call(this);return h._hash=this._hash.clone(),h}});t.SHA256=s._createHelper(d),t.HmacSHA256=s._createHmacHelper(d)}(Math),i.SHA256}(Tt())),$S.exports}var HS,qS,zS={exports:{}};function GS(){return qS||(qS=1,zS.exports=function(i){return function(){var e=i,t=e.lib.Hasher,n=e.x64,r=n.Word,s=n.WordArray,a=e.algo;function o(){return r.create.apply(r,arguments)}var c=[o(1116352408,3609767458),o(1899447441,602891725),o(3049323471,3964484399),o(3921009573,2173295548),o(961987163,4081628472),o(1508970993,3053834265),o(2453635748,2937671579),o(2870763221,3664609560),o(3624381080,2734883394),o(310598401,1164996542),o(607225278,1323610764),o(1426881987,3590304994),o(1925078388,4068182383),o(2162078206,991336113),o(2614888103,633803317),o(3248222580,3479774868),o(3835390401,2666613458),o(4022224774,944711139),o(264347078,2341262773),o(604807628,2007800933),o(770255983,1495990901),o(1249150122,1856431235),o(1555081692,3175218132),o(1996064986,2198950837),o(2554220882,3999719339),o(2821834349,766784016),o(2952996808,2566594879),o(3210313671,3203337956),o(3336571891,1034457026),o(3584528711,2466948901),o(113926993,3758326383),o(338241895,168717936),o(666307205,1188179964),o(773529912,1546045734),o(1294757372,1522805485),o(1396182291,2643833823),o(1695183700,2343527390),o(1986661051,1014477480),o(2177026350,1206759142),o(2456956037,344077627),o(2730485921,1290863460),o(2820302411,3158454273),o(3259730800,3505952657),o(3345764771,106217008),o(3516065817,3606008344),o(3600352804,1432725776),o(4094571909,1467031594),o(275423344,851169720),o(430227734,3100823752),o(506948616,1363258195),o(659060556,3750685593),o(883997877,3785050280),o(958139571,3318307427),o(1322822218,3812723403),o(1537002063,2003034995),o(1747873779,3602036899),o(1955562222,1575990012),o(2024104815,1125592928),o(2227730452,2716904306),o(2361852424,442776044),o(2428436474,593698344),o(2756734187,3733110249),o(3204031479,2999351573),o(3329325298,3815920427),o(3391569614,3928383900),o(3515267271,566280711),o(3940187606,3454069534),o(4118630271,4000239992),o(116418474,1914138554),o(174292421,2731055270),o(289380356,3203993006),o(460393269,320620315),o(685471733,587496836),o(852142971,1086792851),o(1017036298,365543100),o(1126000580,2618297676),o(1288033470,3409855158),o(1501505948,4234509866),o(1607167915,987167468),o(1816402316,1246189591)],u=[];(function(){for(var h=0;80>h;h++)u[h]=o()})();var d=a.SHA512=t.extend({_doReset:function(){this._hash=new s.init([new r.init(1779033703,4089235720),new r.init(3144134277,2227873595),new r.init(1013904242,4271175723),new r.init(2773480762,1595750129),new r.init(1359893119,2917565137),new r.init(2600822924,725511199),new r.init(528734635,4215389547),new r.init(1541459225,327033209)])},_doProcessBlock:function(h,b){for(var v=this._hash.words,y=v[0],p=v[1],f=v[2],m=v[3],_=v[4],k=v[5],D=v[6],E=v[7],A=y.high,w=y.low,N=p.high,S=p.low,P=f.high,F=f.low,V=m.high,J=m.low,ie=_.high,X=_.low,H=k.high,$=k.low,j=D.high,B=D.low,q=E.high,z=E.low,oe=A,we=w,be=N,Z=S,_e=P,Te=F,Ue=V,We=J,pe=ie,Ne=X,nt=H,le=$,Ke=j,ae=B,ue=q,Be=z,Ie=0;80>Ie;Ie++){var tt,ze,Se=u[Ie];if(16>Ie)ze=Se.high=0|h[b+2*Ie],tt=Se.low=0|h[b+2*Ie+1];else{var Ve=u[Ie-15],ke=Ve.high,Me=Ve.low,Pe=(ke>>>1|Me<<31)^(ke>>>8|Me<<24)^ke>>>7,it=(Me>>>1|ke<<31)^(Me>>>8|ke<<24)^(Me>>>7|ke<<25),bt=u[Ie-2],Wt=bt.high,On=bt.low,_i=(Wt>>>19|On<<13)^(Wt<<3|On>>>29)^Wt>>>6,ai=(On>>>19|Wt<<13)^(On<<3|Wt>>>29)^(On>>>6|Wt<<26),St=u[Ie-7],kr=St.high,Cn=St.low,$r=u[Ie-16],Xi=$r.high,ki=$r.low;ze=(ze=(ze=Pe+kr+(it>>>0>(tt=it+Cn)>>>0?1:0))+_i+(ai>>>0>(tt+=ai)>>>0?1:0))+Xi+(ki>>>0>(tt+=ki)>>>0?1:0),Se.high=ze,Se.low=tt}var Yn,Hr=pe&nt^~pe&Ke,qr=Ne&le^~Ne&ae,U=oe&be^oe&_e^be&_e,G=we&Z^we&Te^Z&Te,re=(oe>>>28|we<<4)^(oe<<30|we>>>2)^(oe<<25|we>>>7),ve=(we>>>28|oe<<4)^(we<<30|oe>>>2)^(we<<25|oe>>>7),He=(pe>>>14|Ne<<18)^(pe>>>18|Ne<<14)^(pe<<23|Ne>>>9),at=(Ne>>>14|pe<<18)^(Ne>>>18|pe<<14)^(Ne<<23|pe>>>9),Xe=c[Ie],Re=Xe.high,yn=Xe.low,Qt=ue+He+(Be>>>0>(Yn=Be+at)>>>0?1:0),Gt=ve+G;ue=Ke,Be=ae,Ke=nt,ae=le,nt=pe,le=Ne,pe=Ue+(Qt=(Qt=(Qt=Qt+Hr+(qr>>>0>(Yn+=qr)>>>0?1:0))+Re+(yn>>>0>(Yn+=yn)>>>0?1:0))+ze+(tt>>>0>(Yn+=tt)>>>0?1:0))+(We>>>0>(Ne=We+Yn|0)>>>0?1:0)|0,Ue=_e,We=Te,_e=be,Te=Z,be=oe,Z=we,oe=Qt+(re+U+(ve>>>0>Gt>>>0?1:0))+(Yn>>>0>(we=Yn+Gt|0)>>>0?1:0)|0}w=y.low=w+we,y.high=A+oe+(we>>>0>w>>>0?1:0),S=p.low=S+Z,p.high=N+be+(Z>>>0>S>>>0?1:0),F=f.low=F+Te,f.high=P+_e+(Te>>>0>F>>>0?1:0),J=m.low=J+We,m.high=V+Ue+(We>>>0>J>>>0?1:0),X=_.low=X+Ne,_.high=ie+pe+(Ne>>>0>X>>>0?1:0),$=k.low=$+le,k.high=H+nt+(le>>>0>$>>>0?1:0),B=D.low=B+ae,D.high=j+Ke+(ae>>>0>B>>>0?1:0),z=E.low=z+Be,E.high=q+ue+(Be>>>0>z>>>0?1:0)},_doFinalize:function(){var h=this._data,b=h.words,v=8*this._nDataBytes,y=8*h.sigBytes;return b[y>>>5]|=128<<24-y%32,b[30+(y+128>>>10<<5)]=Math.floor(v/4294967296),b[31+(y+128>>>10<<5)]=v,h.sigBytes=4*b.length,this._process(),this._hash.toX32()},clone:function(){var h=t.clone.call(this);return h._hash=this._hash.clone(),h},blockSize:32});e.SHA512=t._createHelper(d),e.HmacSHA512=t._createHmacHelper(d)}(),i.SHA512}(Tt(),Ad())),zS.exports}var WS,KS,XS={exports:{}};function cR(){return KS||(KS=1,XS.exports=function(i){return function(e){var t=i,n=t.lib,r=n.WordArray,s=n.Hasher,a=t.x64.Word,o=t.algo,c=[],u=[],d=[];(function(){for(var v=1,y=0,p=0;24>p;p++){c[v+5*y]=(p+1)*(p+2)/2%64;var f=(2*v+3*y)%5;v=y%5,y=f}for(v=0;5>v;v++)for(y=0;5>y;y++)u[v+5*y]=y+(2*v+3*y)%5*5;for(var m=1,_=0;24>_;_++){for(var k=0,D=0,E=0;7>E;E++){if(1&m){var A=(1<<E)-1;32>A?D^=1<<A:k^=1<<A-32}128&m?m=m<<1^113:m<<=1}d[_]=a.create(k,D)}})();var h=[];(function(){for(var v=0;25>v;v++)h[v]=a.create()})();var b=o.SHA3=s.extend({cfg:s.cfg.extend({outputLength:512}),_doReset:function(){for(var v=this._state=[],y=0;25>y;y++)v[y]=new a.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(v,y){for(var p=this._state,f=this.blockSize/2,m=0;f>m;m++){var _=v[y+2*m],k=v[y+2*m+1];_=16711935&(_<<8|_>>>24)|4278255360&(_<<24|_>>>8),k=16711935&(k<<8|k>>>24)|4278255360&(k<<24|k>>>8),(z=p[m]).high^=k,z.low^=_}for(var D=0;24>D;D++){for(var E=0;5>E;E++){for(var A=0,w=0,N=0;5>N;N++)A^=(z=p[E+5*N]).high,w^=z.low;var S=h[E];S.high=A,S.low=w}for(E=0;5>E;E++){var P=h[(E+4)%5],F=h[(E+1)%5],V=F.high,J=F.low;for(A=P.high^(V<<1|J>>>31),w=P.low^(J<<1|V>>>31),N=0;5>N;N++)(z=p[E+5*N]).high^=A,z.low^=w}for(var ie=1;25>ie;ie++){var X=(z=p[ie]).high,H=z.low,$=c[ie];32>$?(A=X<<$|H>>>32-$,w=H<<$|X>>>32-$):(A=H<<$-32|X>>>64-$,w=X<<$-32|H>>>64-$);var j=h[u[ie]];j.high=A,j.low=w}var B=h[0],q=p[0];for(B.high=q.high,B.low=q.low,E=0;5>E;E++)for(N=0;5>N;N++){var z=p[ie=E+5*N],oe=h[ie],we=h[(E+1)%5+5*N],be=h[(E+2)%5+5*N];z.high=oe.high^~we.high&be.high,z.low=oe.low^~we.low&be.low}z=p[0];var Z=d[D];z.high^=Z.high,z.low^=Z.low}},_doFinalize:function(){var v=this._data,y=v.words;this._nDataBytes;var p=8*v.sigBytes,f=32*this.blockSize;y[p>>>5]|=1<<24-p%32,y[(e.ceil((p+1)/f)*f>>>5)-1]|=128,v.sigBytes=4*y.length,this._process();for(var m=this._state,_=this.cfg.outputLength/8,k=_/8,D=[],E=0;k>E;E++){var A=m[E],w=A.high,N=A.low;w=16711935&(w<<8|w>>>24)|4278255360&(w<<24|w>>>8),N=16711935&(N<<8|N>>>24)|4278255360&(N<<24|N>>>8),D.push(N),D.push(w)}return new r.init(D,_)},clone:function(){for(var v=s.clone.call(this),y=v._state=this._state.slice(0),p=0;25>p;p++)y[p]=y[p].clone();return v}});t.SHA3=s._createHelper(b),t.HmacSHA3=s._createHmacHelper(b)}(Math),i.SHA3}(Tt(),Ad())),XS.exports}var YS,JS,QS={exports:{}};function tg(){return JS||(JS=1,QS.exports=function(i){var e,t,n;t=(e=i).lib.Base,n=e.enc.Utf8,e.algo.HMAC=t.extend({init:function(r,s){r=this._hasher=new r.init,typeof s=="string"&&(s=n.parse(s));var a=r.blockSize,o=4*a;s.sigBytes>o&&(s=r.finalize(s)),s.clamp();for(var c=this._oKey=s.clone(),u=this._iKey=s.clone(),d=c.words,h=u.words,b=0;a>b;b++)d[b]^=1549556828,h[b]^=909522486;c.sigBytes=u.sigBytes=o,this.reset()},reset:function(){var r=this._hasher;r.reset(),r.update(this._iKey)},update:function(r){return this._hasher.update(r),this},finalize:function(r){var s=this._hasher,a=s.finalize(r);return s.reset(),s.finalize(this._oKey.clone().concat(a))}})}(Tt())),QS.exports}var ZS,eC,tC={exports:{}};function gs(){return eC||(eC=1,tC.exports=function(i){return t=(e=i).lib,n=t.Base,r=t.WordArray,s=e.algo,a=s.MD5,o=s.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:a,iterations:1}),init:function(c){this.cfg=this.cfg.extend(c)},compute:function(c,u){for(var d,h=this.cfg,b=h.hasher.create(),v=r.create(),y=v.words,p=h.keySize,f=h.iterations;y.length<p;){d&&b.update(d),d=b.update(c).finalize(u),b.reset();for(var m=1;f>m;m++)d=b.finalize(d),b.reset();v.concat(d)}return v.sigBytes=4*p,v}}),e.EvpKDF=function(c,u,d){return o.create(d).compute(c,u)},i.EvpKDF;var e,t,n,r,s,a,o}(Tt(),VS(),tg())),tC.exports}var nC,iC={exports:{}};function Sn(){return nC||(nC=1,iC.exports=function(i){i.lib.Cipher||function(e){var t=i,n=t.lib,r=n.Base,s=n.WordArray,a=n.BufferedBlockAlgorithm,o=t.enc;o.Utf8;var c=o.Base64,u=t.algo.EvpKDF,d=n.Cipher=a.extend({cfg:r.extend(),createEncryptor:function(D,E){return this.create(this._ENC_XFORM_MODE,D,E)},createDecryptor:function(D,E){return this.create(this._DEC_XFORM_MODE,D,E)},init:function(D,E,A){this.cfg=this.cfg.extend(A),this._xformMode=D,this._key=E,this.reset()},reset:function(){a.reset.call(this),this._doReset()},process:function(D){return this._append(D),this._process()},finalize:function(D){return D&&this._append(D),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function D(E){return typeof E=="string"?k:m}return function(E){return{encrypt:function(A,w,N){return D(w).encrypt(E,A,w,N)},decrypt:function(A,w,N){return D(w).decrypt(E,A,w,N)}}}}()});n.StreamCipher=d.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var h=t.mode={},b=n.BlockCipherMode=r.extend({createEncryptor:function(D,E){return this.Encryptor.create(D,E)},createDecryptor:function(D,E){return this.Decryptor.create(D,E)},init:function(D,E){this._cipher=D,this._iv=E}}),v=h.CBC=function(){var D=b.extend();function E(A,w,N){var S,P=this._iv;P?(S=P,this._iv=e):S=this._prevBlock;for(var F=0;N>F;F++)A[w+F]^=S[F]}return D.Encryptor=D.extend({processBlock:function(A,w){var N=this._cipher,S=N.blockSize;E.call(this,A,w,S),N.encryptBlock(A,w),this._prevBlock=A.slice(w,w+S)}}),D.Decryptor=D.extend({processBlock:function(A,w){var N=this._cipher,S=N.blockSize,P=A.slice(w,w+S);N.decryptBlock(A,w),E.call(this,A,w,S),this._prevBlock=P}}),D}(),y=(t.pad={}).Pkcs7={pad:function(D,E){for(var A=4*E,w=A-D.sigBytes%A,N=w<<24|w<<16|w<<8|w,S=[],P=0;w>P;P+=4)S.push(N);var F=s.create(S,w);D.concat(F)},unpad:function(D){var E=255&D.words[D.sigBytes-1>>>2];D.sigBytes-=E}};n.BlockCipher=d.extend({cfg:d.cfg.extend({mode:v,padding:y}),reset:function(){var D;d.reset.call(this);var E=this.cfg,A=E.iv,w=E.mode;this._xformMode==this._ENC_XFORM_MODE?D=w.createEncryptor:(D=w.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==D?this._mode.init(this,A&&A.words):(this._mode=D.call(w,this,A&&A.words),this._mode.__creator=D)},_doProcessBlock:function(D,E){this._mode.processBlock(D,E)},_doFinalize:function(){var D,E=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(E.pad(this._data,this.blockSize),D=this._process(!0)):(D=this._process(!0),E.unpad(D)),D},blockSize:4});var p=n.CipherParams=r.extend({init:function(D){this.mixIn(D)},toString:function(D){return(D||this.formatter).stringify(this)}}),f=(t.format={}).OpenSSL={stringify:function(D){var E=D.ciphertext,A=D.salt;return(A?s.create([1398893684,1701076831]).concat(A).concat(E):E).toString(c)},parse:function(D){var E,A=c.parse(D),w=A.words;return w[0]==1398893684&&w[1]==1701076831&&(E=s.create(w.slice(2,4)),w.splice(0,4),A.sigBytes-=16),p.create({ciphertext:A,salt:E})}},m=n.SerializableCipher=r.extend({cfg:r.extend({format:f}),encrypt:function(D,E,A,w){w=this.cfg.extend(w);var N=D.createEncryptor(A,w),S=N.finalize(E),P=N.cfg;return p.create({ciphertext:S,key:A,iv:P.iv,algorithm:D,mode:P.mode,padding:P.padding,blockSize:D.blockSize,formatter:w.format})},decrypt:function(D,E,A,w){return w=this.cfg.extend(w),E=this._parse(E,w.format),D.createDecryptor(A,w).finalize(E.ciphertext)},_parse:function(D,E){return typeof D=="string"?E.parse(D,this):D}}),_=(t.kdf={}).OpenSSL={execute:function(D,E,A,w,N){if(w||(w=s.random(8)),N)S=u.create({keySize:E+A,hasher:N}).compute(D,w);else var S=u.create({keySize:E+A}).compute(D,w);var P=s.create(S.words.slice(E),4*A);return S.sigBytes=4*E,p.create({key:S,iv:P,salt:w})}},k=n.PasswordBasedCipher=m.extend({cfg:m.cfg.extend({kdf:_}),encrypt:function(D,E,A,w){var N=(w=this.cfg.extend(w)).kdf.execute(A,D.keySize,D.ivSize,w.salt,w.hasher);w.iv=N.iv;var S=m.encrypt.call(this,D,E,N.key,w);return S.mixIn(N),S},decrypt:function(D,E,A,w){w=this.cfg.extend(w),E=this._parse(E,w.format);var N=w.kdf.execute(A,D.keySize,D.ivSize,E.salt,w.hasher);return w.iv=N.iv,m.decrypt.call(this,D,E,N.key,w)}})}()}(Tt(),gs())),iC.exports}var rC,sC={exports:{}};function uR(){return rC||(rC=1,sC.exports=function(i){return i.mode.CFB=function(){var e=i.lib.BlockCipherMode.extend();function t(n,r,s,a){var o,c=this._iv;c?(o=c.slice(0),this._iv=void 0):o=this._prevBlock,a.encryptBlock(o,0);for(var u=0;s>u;u++)n[r+u]^=o[u]}return e.Encryptor=e.extend({processBlock:function(n,r){var s=this._cipher,a=s.blockSize;t.call(this,n,r,a,s),this._prevBlock=n.slice(r,r+a)}}),e.Decryptor=e.extend({processBlock:function(n,r){var s=this._cipher,a=s.blockSize,o=n.slice(r,r+a);t.call(this,n,r,a,s),this._prevBlock=o}}),e}(),i.mode.CFB}(Tt(),Sn())),sC.exports}var aC,oC={exports:{}};function dR(){return aC||(aC=1,oC.exports=function(i){return i.mode.CTR=(e=i.lib.BlockCipherMode.extend(),t=e.Encryptor=e.extend({processBlock:function(n,r){var s=this._cipher,a=s.blockSize,o=this._iv,c=this._counter;o&&(c=this._counter=o.slice(0),this._iv=void 0);var u=c.slice(0);s.encryptBlock(u,0),c[a-1]=c[a-1]+1|0;for(var d=0;a>d;d++)n[r+d]^=u[d]}}),e.Decryptor=t,e),i.mode.CTR;var e,t}(Tt(),Sn())),oC.exports}var lC,cC={exports:{}};function hR(){return lC||(lC=1,cC.exports=function(i){return i.mode.CTRGladman=function(){var e=i.lib.BlockCipherMode.extend();function t(s){if((s>>24&255)==255){var a=s>>16&255,o=s>>8&255,c=255&s;a===255?(a=0,o===255?(o=0,c===255?c=0:++c):++o):++a,s=0,s+=a<<16,s+=o<<8,s+=c}else s+=1<<24;return s}function n(s){return(s[0]=t(s[0]))===0&&(s[1]=t(s[1])),s}var r=e.Encryptor=e.extend({processBlock:function(s,a){var o=this._cipher,c=o.blockSize,u=this._iv,d=this._counter;u&&(d=this._counter=u.slice(0),this._iv=void 0),n(d);var h=d.slice(0);o.encryptBlock(h,0);for(var b=0;c>b;b++)s[a+b]^=h[b]}});return e.Decryptor=r,e}(),i.mode.CTRGladman}(Tt(),Sn())),cC.exports}var uC,dC={exports:{}};function fR(){return uC||(uC=1,dC.exports=function(i){return i.mode.OFB=(e=i.lib.BlockCipherMode.extend(),t=e.Encryptor=e.extend({processBlock:function(n,r){var s=this._cipher,a=s.blockSize,o=this._iv,c=this._keystream;o&&(c=this._keystream=o.slice(0),this._iv=void 0),s.encryptBlock(c,0);for(var u=0;a>u;u++)n[r+u]^=c[u]}}),e.Decryptor=t,e),i.mode.OFB;var e,t}(Tt(),Sn())),dC.exports}var hC,fC,pC,mC,gC,vC,yC,bC,_C,kC={exports:{}};function pR(){return _C||(_C=1,kC.exports=function(i){return function(){var e=i,t=e.lib,n=t.WordArray,r=t.BlockCipher,s=e.algo,a=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],o=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],u=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],d=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=s.DES=r.extend({_doReset:function(){for(var p=this._key.words,f=[],m=0;56>m;m++){var _=a[m]-1;f[m]=p[_>>>5]>>>31-_%32&1}for(var k=this._subKeys=[],D=0;16>D;D++){var E=k[D]=[],A=c[D];for(m=0;24>m;m++)E[m/6|0]|=f[(o[m]-1+A)%28]<<31-m%6,E[4+(m/6|0)]|=f[28+(o[m+24]-1+A)%28]<<31-m%6;for(E[0]=E[0]<<1|E[0]>>>31,m=1;7>m;m++)E[m]=E[m]>>>4*(m-1)+3;E[7]=E[7]<<5|E[7]>>>27}var w=this._invSubKeys=[];for(m=0;16>m;m++)w[m]=k[15-m]},encryptBlock:function(p,f){this._doCryptBlock(p,f,this._subKeys)},decryptBlock:function(p,f){this._doCryptBlock(p,f,this._invSubKeys)},_doCryptBlock:function(p,f,m){this._lBlock=p[f],this._rBlock=p[f+1],b.call(this,4,252645135),b.call(this,16,65535),v.call(this,2,858993459),v.call(this,8,16711935),b.call(this,1,1431655765);for(var _=0;16>_;_++){for(var k=m[_],D=this._lBlock,E=this._rBlock,A=0,w=0;8>w;w++)A|=u[w][((E^k[w])&d[w])>>>0];this._lBlock=E,this._rBlock=D^A}var N=this._lBlock;this._lBlock=this._rBlock,this._rBlock=N,b.call(this,1,1431655765),v.call(this,8,16711935),v.call(this,2,858993459),b.call(this,16,65535),b.call(this,4,252645135),p[f]=this._lBlock,p[f+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function b(p,f){var m=(this._lBlock>>>p^this._rBlock)&f;this._rBlock^=m,this._lBlock^=m<<p}function v(p,f){var m=(this._rBlock>>>p^this._lBlock)&f;this._lBlock^=m,this._rBlock^=m<<p}e.DES=r._createHelper(h);var y=s.TripleDES=r.extend({_doReset:function(){var p=this._key.words;if(p.length!==2&&p.length!==4&&6>p.length)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var f=p.slice(0,2),m=4>p.length?p.slice(0,2):p.slice(2,4),_=6>p.length?p.slice(0,2):p.slice(4,6);this._des1=h.createEncryptor(n.create(f)),this._des2=h.createEncryptor(n.create(m)),this._des3=h.createEncryptor(n.create(_))},encryptBlock:function(p,f){this._des1.encryptBlock(p,f),this._des2.decryptBlock(p,f),this._des3.encryptBlock(p,f)},decryptBlock:function(p,f){this._des3.decryptBlock(p,f),this._des2.encryptBlock(p,f),this._des1.decryptBlock(p,f)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=r._createHelper(y)}(),i.TripleDES}(Tt(),ea(),ta(),gs(),Sn())),kC.exports}var TC,SC,CC,xC,EC={exports:{}};function mR(){return xC||(xC=1,EC.exports=function(i){return function(){var e=i,t=e.lib.BlockCipher,n=e.algo;const r=16,s=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],a=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var o={pbox:[],sbox:[]};function c(v,y){let p=y>>24&255,f=y>>16&255,m=y>>8&255,_=255&y,k=v.sbox[0][p]+v.sbox[1][f];return k^=v.sbox[2][m],k+=v.sbox[3][_],k}function u(v,y,p){let f,m=y,_=p;for(let k=0;r>k;++k)m^=v.pbox[k],_=c(v,m)^_,f=m,m=_,_=f;return f=m,m=_,_=f,_^=v.pbox[r],m^=v.pbox[r+1],{left:m,right:_}}function d(v,y,p){let f,m=y,_=p;for(let k=r+1;k>1;--k)m^=v.pbox[k],_=c(v,m)^_,f=m,m=_,_=f;return f=m,m=_,_=f,_^=v.pbox[1],m^=v.pbox[0],{left:m,right:_}}function h(v,y,p){for(let D=0;4>D;D++){v.sbox[D]=[];for(let E=0;256>E;E++)v.sbox[D][E]=a[D][E]}let f=0;for(let D=0;r+2>D;D++)v.pbox[D]=s[D]^y[f],f++,p>f||(f=0);let m=0,_=0,k=0;for(let D=0;r+2>D;D+=2)k=u(v,m,_),m=k.left,_=k.right,v.pbox[D]=m,v.pbox[D+1]=_;for(let D=0;4>D;D++)for(let E=0;256>E;E+=2)k=u(v,m,_),m=k.left,_=k.right,v.sbox[D][E]=m,v.sbox[D][E+1]=_;return!0}var b=n.Blowfish=t.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var v=this._keyPriorReset=this._key,y=v.words,p=v.sigBytes/4;h(o,y,p)}},encryptBlock:function(v,y){var p=u(o,v[y],v[y+1]);v[y]=p.left,v[y+1]=p.right},decryptBlock:function(v,y){var p=d(o,v[y],v[y+1]);v[y]=p.left,v[y+1]=p.right},blockSize:2,keySize:4,ivSize:2});e.Blowfish=t._createHelper(b)}(),i.Blowfish}(Tt(),ea(),ta(),gs(),Sn())),EC.exports}SS.exports=function(i){return i}(Tt(),Ad(),aR(),oR(),ea(),lR(),ta(),VS(),eg(),HS||(HS=1,function(i){return t=(e=i).lib.WordArray,n=e.algo,r=n.SHA256,s=n.SHA224=r.extend({_doReset:function(){this._hash=new t.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var a=r._doFinalize.call(this);return a.sigBytes-=4,a}}),e.SHA224=r._createHelper(s),e.HmacSHA224=r._createHmacHelper(s),i.SHA224;var e,t,n,r,s}(Tt(),eg())),GS(),WS||(WS=1,function(i){return t=(e=i).x64,n=t.Word,r=t.WordArray,s=e.algo,a=s.SHA512,o=s.SHA384=a.extend({_doReset:function(){this._hash=new r.init([new n.init(3418070365,3238371032),new n.init(1654270250,914150663),new n.init(2438529370,812702999),new n.init(355462360,4144912697),new n.init(1731405415,4290775857),new n.init(2394180231,1750603025),new n.init(3675008525,1694076839),new n.init(1203062813,3204075428)])},_doFinalize:function(){var c=a._doFinalize.call(this);return c.sigBytes-=16,c}}),e.SHA384=a._createHelper(o),e.HmacSHA384=a._createHmacHelper(o),i.SHA384;var e,t,n,r,s,a,o}(Tt(),Ad(),GS())),cR(),YS||(YS=1,function(i){return function(e){var t=i,n=t.lib,r=n.WordArray,s=n.Hasher,a=t.algo,o=r.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),c=r.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),u=r.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),d=r.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),h=r.create([0,1518500249,1859775393,2400959708,2840853838]),b=r.create([1352829926,1548603684,1836072691,2053994217,0]),v=a.RIPEMD160=s.extend({_doReset:function(){this._hash=r.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(D,E){for(var A=0;16>A;A++){var w=E+A,N=D[w];D[w]=16711935&(N<<8|N>>>24)|4278255360&(N<<24|N>>>8)}var S,P,F,V,J,ie,X,H,$,j,B,q=this._hash.words,z=h.words,oe=b.words,we=o.words,be=c.words,Z=u.words,_e=d.words;for(ie=S=q[0],X=P=q[1],H=F=q[2],$=V=q[3],j=J=q[4],A=0;80>A;A+=1)B=S+D[E+we[A]]|0,B+=16>A?y(P,F,V)+z[0]:32>A?p(P,F,V)+z[1]:48>A?f(P,F,V)+z[2]:64>A?m(P,F,V)+z[3]:_(P,F,V)+z[4],B=(B=k(B|=0,Z[A]))+J|0,S=J,J=V,V=k(F,10),F=P,P=B,B=ie+D[E+be[A]]|0,B+=16>A?_(X,H,$)+oe[0]:32>A?m(X,H,$)+oe[1]:48>A?f(X,H,$)+oe[2]:64>A?p(X,H,$)+oe[3]:y(X,H,$)+oe[4],B=(B=k(B|=0,_e[A]))+j|0,ie=j,j=$,$=k(H,10),H=X,X=B;B=q[1]+F+$|0,q[1]=q[2]+V+j|0,q[2]=q[3]+J+ie|0,q[3]=q[4]+S+X|0,q[4]=q[0]+P+H|0,q[0]=B},_doFinalize:function(){var D=this._data,E=D.words,A=8*this._nDataBytes,w=8*D.sigBytes;E[w>>>5]|=128<<24-w%32,E[14+(w+64>>>9<<4)]=16711935&(A<<8|A>>>24)|4278255360&(A<<24|A>>>8),D.sigBytes=4*(E.length+1),this._process();for(var N=this._hash,S=N.words,P=0;5>P;P++){var F=S[P];S[P]=16711935&(F<<8|F>>>24)|4278255360&(F<<24|F>>>8)}return N},clone:function(){var D=s.clone.call(this);return D._hash=this._hash.clone(),D}});function y(D,E,A){return D^E^A}function p(D,E,A){return D&E|~D&A}function f(D,E,A){return(D|~E)^A}function m(D,E,A){return D&A|E&~A}function _(D,E,A){return D^(E|~A)}function k(D,E){return D<<E|D>>>32-E}t.RIPEMD160=s._createHelper(v),t.HmacRIPEMD160=s._createHmacHelper(v)}(),i.RIPEMD160}(Tt())),tg(),ZS||(ZS=1,function(i){return n=(t=(e=i).lib).Base,r=t.WordArray,a=(s=e.algo).SHA256,o=s.HMAC,c=s.PBKDF2=n.extend({cfg:n.extend({keySize:4,hasher:a,iterations:25e4}),init:function(u){this.cfg=this.cfg.extend(u)},compute:function(u,d){for(var h=this.cfg,b=o.create(h.hasher,u),v=r.create(),y=r.create([1]),p=v.words,f=y.words,m=h.keySize,_=h.iterations;p.length<m;){var k=b.update(d).finalize(y);b.reset();for(var D=k.words,E=D.length,A=k,w=1;_>w;w++){A=b.finalize(A),b.reset();for(var N=A.words,S=0;E>S;S++)D[S]^=N[S]}v.concat(k),f[0]++}return v.sigBytes=4*m,v}}),e.PBKDF2=function(u,d,h){return c.create(h).compute(u,d)},i.PBKDF2;var e,t,n,r,s,a,o,c}(Tt(),eg(),tg())),gs(),Sn(),uR(),dR(),hR(),fR(),hC||(hC=1,function(i){return i.mode.ECB=((e=i.lib.BlockCipherMode.extend()).Encryptor=e.extend({processBlock:function(t,n){this._cipher.encryptBlock(t,n)}}),e.Decryptor=e.extend({processBlock:function(t,n){this._cipher.decryptBlock(t,n)}}),e),i.mode.ECB;var e}(Tt(),Sn())),fC||(fC=1,function(i){return i.pad.AnsiX923={pad:function(e,t){var n=e.sigBytes,r=4*t,s=r-n%r,a=n+s-1;e.clamp(),e.words[a>>>2]|=s<<24-a%4*8,e.sigBytes+=s},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},i.pad.Ansix923}(Tt(),Sn())),pC||(pC=1,function(i){return i.pad.Iso10126={pad:function(e,t){var n=4*t,r=n-e.sigBytes%n;e.concat(i.lib.WordArray.random(r-1)).concat(i.lib.WordArray.create([r<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},i.pad.Iso10126}(Tt(),Sn())),mC||(mC=1,function(i){return i.pad.Iso97971={pad:function(e,t){e.concat(i.lib.WordArray.create([2147483648],1)),i.pad.ZeroPadding.pad(e,t)},unpad:function(e){i.pad.ZeroPadding.unpad(e),e.sigBytes--}},i.pad.Iso97971}(Tt(),Sn())),gC||(gC=1,function(i){return i.pad.ZeroPadding={pad:function(e,t){var n=4*t;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},unpad:function(e){var t=e.words,n=e.sigBytes-1;for(n=e.sigBytes-1;n>=0;n--)if(t[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}}},i.pad.ZeroPadding}(Tt(),Sn())),vC||(vC=1,function(i){return i.pad.NoPadding={pad:function(){},unpad:function(){}},i.pad.NoPadding}(Tt(),Sn())),yC||(yC=1,function(i){return t=(e=i).lib.CipherParams,n=e.enc.Hex,e.format.Hex={stringify:function(r){return r.ciphertext.toString(n)},parse:function(r){var s=n.parse(r);return t.create({ciphertext:s})}},i.format.Hex;var e,t,n}(Tt(),Sn())),bC||(bC=1,function(i){return function(){var e=i,t=e.lib.BlockCipher,n=e.algo,r=[],s=[],a=[],o=[],c=[],u=[],d=[],h=[],b=[],v=[];(function(){for(var f=[],m=0;256>m;m++)f[m]=128>m?m<<1:m<<1^283;var _=0,k=0;for(m=0;256>m;m++){var D=k^k<<1^k<<2^k<<3^k<<4;D=D>>>8^255&D^99,r[_]=D,s[D]=_;var E=f[_],A=f[E],w=f[A],N=257*f[D]^16843008*D;a[_]=N<<24|N>>>8,o[_]=N<<16|N>>>16,c[_]=N<<8|N>>>24,u[_]=N,N=16843009*w^65537*A^257*E^16843008*_,d[D]=N<<24|N>>>8,h[D]=N<<16|N>>>16,b[D]=N<<8|N>>>24,v[D]=N,_?(_=E^f[f[f[w^E]]],k^=f[f[k]]):_=k=1}})();var y=[0,1,2,4,8,16,32,64,128,27,54],p=n.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var f=this._keyPriorReset=this._key,m=f.words,_=f.sigBytes/4,k=4*((this._nRounds=_+6)+1),D=this._keySchedule=[],E=0;k>E;E++)_>E?D[E]=m[E]:(N=D[E-1],E%_?_>6&&E%_==4&&(N=r[N>>>24]<<24|r[N>>>16&255]<<16|r[N>>>8&255]<<8|r[255&N]):(N=r[(N=N<<8|N>>>24)>>>24]<<24|r[N>>>16&255]<<16|r[N>>>8&255]<<8|r[255&N],N^=y[E/_|0]<<24),D[E]=D[E-_]^N);for(var A=this._invKeySchedule=[],w=0;k>w;w++){if(E=k-w,w%4)var N=D[E];else N=D[E-4];A[w]=4>w||4>=E?N:d[r[N>>>24]]^h[r[N>>>16&255]]^b[r[N>>>8&255]]^v[r[255&N]]}}},encryptBlock:function(f,m){this._doCryptBlock(f,m,this._keySchedule,a,o,c,u,r)},decryptBlock:function(f,m){var _=f[m+1];f[m+1]=f[m+3],f[m+3]=_,this._doCryptBlock(f,m,this._invKeySchedule,d,h,b,v,s),_=f[m+1],f[m+1]=f[m+3],f[m+3]=_},_doCryptBlock:function(f,m,_,k,D,E,A,w){for(var N=this._nRounds,S=f[m]^_[0],P=f[m+1]^_[1],F=f[m+2]^_[2],V=f[m+3]^_[3],J=4,ie=1;N>ie;ie++){var X=k[S>>>24]^D[P>>>16&255]^E[F>>>8&255]^A[255&V]^_[J++],H=k[P>>>24]^D[F>>>16&255]^E[V>>>8&255]^A[255&S]^_[J++],$=k[F>>>24]^D[V>>>16&255]^E[S>>>8&255]^A[255&P]^_[J++],j=k[V>>>24]^D[S>>>16&255]^E[P>>>8&255]^A[255&F]^_[J++];S=X,P=H,F=$,V=j}X=(w[S>>>24]<<24|w[P>>>16&255]<<16|w[F>>>8&255]<<8|w[255&V])^_[J++],H=(w[P>>>24]<<24|w[F>>>16&255]<<16|w[V>>>8&255]<<8|w[255&S])^_[J++],$=(w[F>>>24]<<24|w[V>>>16&255]<<16|w[S>>>8&255]<<8|w[255&P])^_[J++],j=(w[V>>>24]<<24|w[S>>>16&255]<<16|w[P>>>8&255]<<8|w[255&F])^_[J++],f[m]=X,f[m+1]=H,f[m+2]=$,f[m+3]=j},keySize:8});e.AES=t._createHelper(p)}(),i.AES}(Tt(),ea(),ta(),gs(),Sn())),pR(),TC||(TC=1,function(i){return function(){var e=i,t=e.lib.StreamCipher,n=e.algo,r=n.RC4=t.extend({_doReset:function(){for(var o=this._key,c=o.words,u=o.sigBytes,d=this._S=[],h=0;256>h;h++)d[h]=h;h=0;for(var b=0;256>h;h++){var v=h%u,y=c[v>>>2]>>>24-v%4*8&255;b=(b+d[h]+y)%256;var p=d[h];d[h]=d[b],d[b]=p}this._i=this._j=0},_doProcessBlock:function(o,c){o[c]^=s.call(this)},keySize:8,ivSize:0});function s(){for(var o=this._S,c=this._i,u=this._j,d=0,h=0;4>h;h++){u=(u+o[c=(c+1)%256])%256;var b=o[c];o[c]=o[u],o[u]=b,d|=o[(o[c]+o[u])%256]<<24-8*h}return this._i=c,this._j=u,d}e.RC4=t._createHelper(r);var a=n.RC4Drop=r.extend({cfg:r.cfg.extend({drop:192}),_doReset:function(){r._doReset.call(this);for(var o=this.cfg.drop;o>0;o--)s.call(this)}});e.RC4Drop=t._createHelper(a)}(),i.RC4}(Tt(),ea(),ta(),gs(),Sn())),SC||(SC=1,function(i){return function(){var e=i,t=e.lib.StreamCipher,n=e.algo,r=[],s=[],a=[],o=n.Rabbit=t.extend({_doReset:function(){for(var u=this._key.words,d=this.cfg.iv,h=0;4>h;h++)u[h]=16711935&(u[h]<<8|u[h]>>>24)|4278255360&(u[h]<<24|u[h]>>>8);var b=this._X=[u[0],u[3]<<16|u[2]>>>16,u[1],u[0]<<16|u[3]>>>16,u[2],u[1]<<16|u[0]>>>16,u[3],u[2]<<16|u[1]>>>16],v=this._C=[u[2]<<16|u[2]>>>16,4294901760&u[0]|65535&u[1],u[3]<<16|u[3]>>>16,4294901760&u[1]|65535&u[2],u[0]<<16|u[0]>>>16,4294901760&u[2]|65535&u[3],u[1]<<16|u[1]>>>16,4294901760&u[3]|65535&u[0]];for(this._b=0,h=0;4>h;h++)c.call(this);for(h=0;8>h;h++)v[h]^=b[h+4&7];if(d){var y=d.words,p=y[0],f=y[1],m=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),_=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),k=m>>>16|4294901760&_,D=_<<16|65535&m;for(v[0]^=m,v[1]^=k,v[2]^=_,v[3]^=D,v[4]^=m,v[5]^=k,v[6]^=_,v[7]^=D,h=0;4>h;h++)c.call(this)}},_doProcessBlock:function(u,d){var h=this._X;c.call(this),r[0]=h[0]^h[5]>>>16^h[3]<<16,r[1]=h[2]^h[7]>>>16^h[5]<<16,r[2]=h[4]^h[1]>>>16^h[7]<<16,r[3]=h[6]^h[3]>>>16^h[1]<<16;for(var b=0;4>b;b++)r[b]=16711935&(r[b]<<8|r[b]>>>24)|4278255360&(r[b]<<24|r[b]>>>8),u[d+b]^=r[b]},blockSize:4,ivSize:2});function c(){for(var u=this._X,d=this._C,h=0;8>h;h++)s[h]=d[h];for(d[0]=d[0]+1295307597+this._b|0,d[1]=d[1]+3545052371+(d[0]>>>0<s[0]>>>0?1:0)|0,d[2]=d[2]+886263092+(d[1]>>>0<s[1]>>>0?1:0)|0,d[3]=d[3]+1295307597+(d[2]>>>0<s[2]>>>0?1:0)|0,d[4]=d[4]+3545052371+(d[3]>>>0<s[3]>>>0?1:0)|0,d[5]=d[5]+886263092+(d[4]>>>0<s[4]>>>0?1:0)|0,d[6]=d[6]+1295307597+(d[5]>>>0<s[5]>>>0?1:0)|0,d[7]=d[7]+3545052371+(d[6]>>>0<s[6]>>>0?1:0)|0,this._b=d[7]>>>0<s[7]>>>0?1:0,h=0;8>h;h++){var b=u[h]+d[h],v=65535&b,y=b>>>16,p=((v*v>>>17)+v*y>>>15)+y*y,f=((4294901760&b)*b|0)+((65535&b)*b|0);a[h]=p^f}u[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,u[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,u[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,u[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,u[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,u[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,u[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,u[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.Rabbit=t._createHelper(o)}(),i.Rabbit}(Tt(),ea(),ta(),gs(),Sn())),CC||(CC=1,function(i){return function(){var e=i,t=e.lib.StreamCipher,n=e.algo,r=[],s=[],a=[],o=n.RabbitLegacy=t.extend({_doReset:function(){var u=this._key.words,d=this.cfg.iv,h=this._X=[u[0],u[3]<<16|u[2]>>>16,u[1],u[0]<<16|u[3]>>>16,u[2],u[1]<<16|u[0]>>>16,u[3],u[2]<<16|u[1]>>>16],b=this._C=[u[2]<<16|u[2]>>>16,4294901760&u[0]|65535&u[1],u[3]<<16|u[3]>>>16,4294901760&u[1]|65535&u[2],u[0]<<16|u[0]>>>16,4294901760&u[2]|65535&u[3],u[1]<<16|u[1]>>>16,4294901760&u[3]|65535&u[0]];this._b=0;for(var v=0;4>v;v++)c.call(this);for(v=0;8>v;v++)b[v]^=h[v+4&7];if(d){var y=d.words,p=y[0],f=y[1],m=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),_=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),k=m>>>16|4294901760&_,D=_<<16|65535&m;for(b[0]^=m,b[1]^=k,b[2]^=_,b[3]^=D,b[4]^=m,b[5]^=k,b[6]^=_,b[7]^=D,v=0;4>v;v++)c.call(this)}},_doProcessBlock:function(u,d){var h=this._X;c.call(this),r[0]=h[0]^h[5]>>>16^h[3]<<16,r[1]=h[2]^h[7]>>>16^h[5]<<16,r[2]=h[4]^h[1]>>>16^h[7]<<16,r[3]=h[6]^h[3]>>>16^h[1]<<16;for(var b=0;4>b;b++)r[b]=16711935&(r[b]<<8|r[b]>>>24)|4278255360&(r[b]<<24|r[b]>>>8),u[d+b]^=r[b]},blockSize:4,ivSize:2});function c(){for(var u=this._X,d=this._C,h=0;8>h;h++)s[h]=d[h];for(d[0]=d[0]+1295307597+this._b|0,d[1]=d[1]+3545052371+(d[0]>>>0<s[0]>>>0?1:0)|0,d[2]=d[2]+886263092+(d[1]>>>0<s[1]>>>0?1:0)|0,d[3]=d[3]+1295307597+(d[2]>>>0<s[2]>>>0?1:0)|0,d[4]=d[4]+3545052371+(d[3]>>>0<s[3]>>>0?1:0)|0,d[5]=d[5]+886263092+(d[4]>>>0<s[4]>>>0?1:0)|0,d[6]=d[6]+1295307597+(d[5]>>>0<s[5]>>>0?1:0)|0,d[7]=d[7]+3545052371+(d[6]>>>0<s[6]>>>0?1:0)|0,this._b=d[7]>>>0<s[7]>>>0?1:0,h=0;8>h;h++){var b=u[h]+d[h],v=65535&b,y=b>>>16,p=((v*v>>>17)+v*y>>>15)+y*y,f=((4294901760&b)*b|0)+((65535&b)*b|0);a[h]=p^f}u[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,u[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,u[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,u[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,u[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,u[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,u[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,u[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.RabbitLegacy=t._createHelper(o)}(),i.RabbitLegacy}(Tt(),ea(),ta(),gs(),Sn())),mR());var Id=sR(SS.exports),vs=new WeakMap,ng=new WeakMap,ig=new WeakMap,wC=new WeakSet,gR=function(){function i(e,t,n){ht(this,i),qi(this,wC),Mr(this,vs,{writable:!0,value:null}),Mr(this,ng,{writable:!0,value:null}),Mr(this,ig,{writable:!0,value:null}),this.url=e,this.socket=null,this.isOpen=!1,this.messageHandlers=new Map,this.openHandlers=new Map,this.closeHandlers=[],this.errorHandlers=[],Or(this,ng,t),Or(this,ig,n)}return ft(i,[{key:"connect",value:function(){var e=this,t=tn(this,wC,vR).call(this),n=t.timestamp,r=t.signature,s=this.url.indexOf("×tamp");this.url=s>-1?this.url.replace(this.url.substring(s),"×tamp=".concat(n,"&signature=").concat(r)):"".concat(this.url,"×tamp=").concat(n,"&signature=").concat(r),this.socket=new WebSocket(this.url),this.socket.onopen=function(a){e.isOpen=!0,e.openHandlers.size>0&&e.openHandlers.forEach(function(o){return o()}),It(e,vs)&&(clearInterval(It(e,vs)),Or(e,vs,null)),Or(e,vs,setInterval(function(){e.send({cmd:"HeartBreak"})},1e4))},this.socket.onmessage=function(a){e.messageHandlers.size>0&&e.messageHandlers.forEach(function(o){return o(a.data)})},this.socket.onclose=function(a){e.closeHandlers.forEach(function(o){return o(a)})},this.socket.onerror=function(a){e.errorHandlers.forEach(function(o){return o(a)})}}},{key:"send",value:function(e){var t=this;this.socket.readyState===WebSocket.OPEN?this.socket.send(JSON.stringify(e)):this.socket.readyState===WebSocket.CLOSED?this.isOpen&&(this.connect(),this.clearOpenHandler(),this.addOpenHandler("MsgSend",function(){t.socket.send(JSON.stringify(e))})):(this.clearOpenHandler(),this.addOpenHandler("MsgSend",function(){t.socket.send(JSON.stringify(e))}))}},{key:"addMessageHandler",value:function(e,t){this.messageHandlers.has(e)?(this.messageHandlers.delete(e),this.messageHandlers.set(e,t)):this.messageHandlers.set(e,t)}},{key:"addOpenHandler",value:function(e,t){this.openHandlers.has(e)?(this.openHandlers.delete(e),this.openHandlers.set(e,t)):this.openHandlers.set(e,t)}},{key:"addCloseHandler",value:function(e){this.closeHandlers.push(e)}},{key:"addErrorHandler",value:function(e){this.errorHandlers.push(e)}},{key:"clearMessageHandler",value:function(){this.messageHandlers.clear()}},{key:"clearOpenHandler",value:function(){this.openHandlers.clear()}},{key:"clearCloseHandler",value:function(){this.closeHandlers=[]}},{key:"clearErrorHandler",value:function(){this.errorHandlers=[]}},{key:"close",value:function(){this.socket.close(),this.isOpen=!1,It(this,vs)&&(clearInterval(It(this,vs)),Or(this,vs,null))}}]),i}();function vR(){var i=Math.floor(Date.now()/1e3),e="".concat(It(this,ng)).concat(i),t=Id.HmacSHA256(e,It(this,ig));return{timestamp:i,signature:Id.enc.Base64.stringify(t).replace(/\+/g,"-").replace(/\//g,"_")}}var na=new WeakMap,yR=function(){function i(){var e;ht(this,i),Mr(this,na,{writable:!0,value:void 0}),Or(this,na,{all:e=e||new Map,on:function(t,n){var r=e.get(t);r?r.push(n):e.set(t,[n])},off:function(t,n){var r=e.get(t);r&&(n?r.splice(r.indexOf(n)>>>0,1):e.set(t,[]))},emit:function(t,n){var r=e.get(t);r&&r.slice().map(function(s){s(n)}),(r=e.get("*"))&&r.slice().map(function(s){s(t,n)})}})}return ft(i,[{key:"on",value:function(e,t){It(this,na).on(e,t)}},{key:"off",value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;t&&typeof t=="function"?It(this,na).off(e,t):It(this,na).off(e)}},{key:"emit",value:function(e,t){It(this,na).emit(e,t)}},{key:"removeAllListeners",value:function(){It(this,na).all.clear()}}]),i}(),Nd=new WeakMap,Pd=new WeakMap,Od=new WeakMap,Oi=new WeakMap,rg=new WeakMap,DC=new WeakSet,Md=new WeakSet,AC=new WeakSet,_r=new WeakSet,IC=new WeakSet,NC=new WeakSet,PC=new WeakSet,Rd=new WeakSet,OC=new WeakSet,MC=new WeakSet,sg=function(i){function e(){var f,m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},_=m.userId,k=m.org,D=m.roomName,E=D===void 0?"":D,A=m.roomMode,w=A===void 0?"auto":A,N=m.baseUrl;ht(this,e),qi(ct(f=Rt(this,e)),MC),qi(ct(f),OC),qi(ct(f),Rd),qi(ct(f),PC),qi(ct(f),NC),qi(ct(f),IC),qi(ct(f),_r),qi(ct(f),AC),qi(ct(f),Md),qi(ct(f),DC),Mr(ct(f),Nd,{writable:!0,value:""}),Mr(ct(f),Pd,{writable:!0,value:""}),Mr(ct(f),Od,{writable:!0,value:null}),Mr(ct(f),Oi,{writable:!0,value:"devkey"}),Mr(ct(f),rg,{writable:!0,value:"hongxinlkclient&BBX5Y8PtsACxFEEApUPs"}),f.userId=_,f.org=k,f.roomName=E,f.roomNum,f.room=null,f.roomMode=w,f.baseUrl=N,f.encoder=new TextEncoder,f.decoder=new TextDecoder,f.wshead=f.baseUrl.split("//")[0]=="http:"?"ws://":"wss://";var S=tn(ct(f),_r,jr).call(ct(f)),P=S.timestamp,F=S.signature;return f.websocketUrl="".concat(f.wshead).concat(f.baseUrl.split("//")[1],"/socket?org=").concat(f.org,"&identity=").concat(f.userId,"&apikey=").concat(It(ct(f),Oi),"×tamp=").concat(P,"&signature=").concat(F),f.socket=new gR(f.websocketUrl,It(ct(f),Oi),It(ct(f),rg)),f.socket.addOpenHandler("SocketOpen",function(){f.emit("socketOpen")}),f.socket.connect(),tn(ct(f),DC,bR).call(ct(f)),f}var t,n,r,s,a,o,c,u,d,h,b,v,y,p;return Lt(e,yR),ft(e,[{key:"isShareEnable",get:function(){return!(!this.room||!this.room.localParticipant)&&this.room.localParticipant.isScreenShareEnabled}},{key:"isCameraEnable",get:function(){return!(!this.room||!this.room.localParticipant)&&this.room.localParticipant.isCameraEnabled}},{key:"isMicrophoneEnable",get:function(){return!(!this.room||!this.room.localParticipant)&&this.room.localParticipant.isMicrophoneEnabled}},{key:"sendMessage",value:function(f,m){var _={cmd:"SendText",data:{room:this.roomNum,identity:this.userId,name:m,text:f}};this.socket.send(_)}},{key:"screenShot",value:function(f){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},_=tn(this,AC,_R).call(this,f);if(_){var k=document.createElement("canvas");return k.width=m.width,k.height=m.height,k.getContext("2d").drawImage(_,0,0,m.width,m.height),k.toDataURL("image/png",m.quality)}this.emit("errorPush",{type:"screenShot",message:"DOM元素不存在"})}},{key:"uploadScreenShot",value:(p=In(L().mark(function f(m){var _,k,D,E,A,w,N,S,P,F=arguments;return L().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return _=F.length>1&&F[1]!==void 0?F[1]:{},D=this.screenShot(m,_),(E=D.indexOf(","))>-1&&(k=D.substring(E+1)),A=tn(this,_r,jr).call(this),w=A.timestamp,N=A.signature,V.next=7,fetch(this.baseUrl+"/api/FileFind/upload/image/sample",Qa({method:"POST",headers:{"Content-Type":"application/json;charset=utf-8"},body:JSON.stringify({base64:k,org:this.org,owner:this.userId})},"headers",{apikey:It(this,Oi),timestamp:w,signature:N}));case 7:return S=V.sent,V.prev=8,V.next=11,S.json();case 11:((P=V.sent)==null?void 0:P.code)===200?this.emit("imageUploadSuccess",D):this.emit("imageUploadFail",P),V.next=18;break;case 15:V.prev=15,V.t0=V.catch(8),this.emit("imageUploadFail",V.t0);case 18:case"end":return V.stop()}},f,this,[[8,15]])})),function(f){return p.apply(this,arguments)})},{key:"judgeUserInMeeting",value:function(){var f=this,m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return new Promise(function(_,k){var D=tn(f,_r,jr).call(f),E=D.timestamp,A=D.signature;fetch(f.baseUrl+"/api/v1/IsParticipantExist",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8",apikey:It(f,Oi),timestamp:E,signature:A},body:JSON.stringify({room:m,identity:f.userId})}).then(function(w){return w.json()}).then(function(w){(w==null?void 0:w.code)===200?_(w==null?void 0:w.data):k()}).catch(function(w){k(w)})})}},{key:"judgeRoomExist",value:function(){var f=this,m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return new Promise(function(_,k){var D=tn(f,_r,jr).call(f),E=D.timestamp,A=D.signature;fetch(f.baseUrl+"/api/v1/isRoomExist",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8",apikey:It(f,Oi),timestamp:E,signature:A},body:JSON.stringify({room:m})}).then(function(w){return w.json()}).then(function(w){_(w)}).catch(function(w){k(w)})})}},{key:"setParticipantDeafness",value:function(f){var m=this;return new Promise(function(_,k){f||(m.emit("errorPush",{type:"setParticipantDeafness",message:"identity不能为空"}),k());var D={cmd:"DoDeafness",data:{room:m.roomNum,identity:f}};m.socket.send(D),m.socket.addMessageHandler("SetParticipantDeafness",function(E){var A,w=JSON.parse(E);w.cmd==="DoDeafness"&&((w==null?void 0:w.data.code)=="200"?_():(m.emit("errorPush",{type:"setParticipantDeafness",message:(A=w.data.msg)!==null&&A!==void 0?A:"与会者置聋失败"}),k()))})})}},{key:"cancelParticipantDeafness",value:function(f){var m=this;return new Promise(function(_,k){f||(m.emit("errorPush",{type:"cancelParticipantDeafness",message:"identity不能为空"}),k());var D={cmd:"UnDoDeafness",data:{room:m.roomNum,identity:f}};m.socket.send(D),m.socket.addMessageHandler("CancelParticipantDeafness",function(E){var A,w=JSON.parse(E);w.cmd==="UnDoDeafness"&&((w==null?void 0:w.data.code)=="200"?_():(m.emit("errorPush",{type:"cancelParticipantDeafness",message:(A=w.data.msg)!==null&&A!==void 0?A:"与会者取消置聋失败"}),k()))})})}},{key:"addCoHost",value:function(f,m){var _=this;return new Promise(function(k,D){f&&m||(_.emit("errorPush",{type:"addCoHost",message:"关键参数缺失"}),D(new Error("关键参数缺失")));var E={cmd:"AddCoHost",data:{room:_.roomNum,identity:_.userId,coHostId:f,coHostName:m}};_.socket.send(E),_.socket.addMessageHandler("AddCoHost",function(A){var w,N,S=JSON.parse(A);S.cmd==="AddCoHost"&&((S==null?void 0:S.data.code)=="200"?k():(_.emit("errorPush",{type:"addCoHost",message:(w=S.data.msg)!==null&&w!==void 0?w:"联席主持人设置失败"}),D(new Error((N=S.data.msg)!==null&&N!==void 0?N:"联席主持人设置失败"))))})})}},{key:"removeCoHost",value:function(f,m){var _=this;return new Promise(function(k,D){f&&m||(_.emit("errorPush",{type:"removeCoHost",message:"关键参数缺失"}),D(new Error("关键参数缺失")));var E={cmd:"RemoveCoHost",data:{room:_.roomNum,identity:_.userId,coHostId:f,coHostName:m}};_.socket.send(E),_.socket.addMessageHandler("RemoveCoHost",function(A){var w,N,S=JSON.parse(A);S.cmd==="RemoveCoHost"&&((S==null?void 0:S.data.code)=="200"?k():(_.emit("errorPush",{type:"removeCoHost",message:(w=S.data.msg)!==null&&w!==void 0?w:"移除联席主持人失败"}),D(new Error((N=S.data.msg)!==null&&N!==void 0?N:"联席主持人设置失败"))))})})}},{key:"modifyPermission",value:function(f,m){var _=this;return new Promise(function(k,D){f&&m||(_.emit("errorPush",{type:"modifyPermission",message:"关键参数缺失"}),D(new Error("关键参数缺失")));var E={cmd:"ModifyPermission",data:{room:_.roomNum,identity:_.userId,permission:f,input:m}};_.socket.send(E),_.socket.addMessageHandler("ModifyPermission",function(A){var w,N,S=JSON.parse(A);S.cmd==="ModifyPermission"&&((S==null?void 0:S.data.code)=="200"?k():(_.emit("errorPush",{type:"modifyPermission",message:(w=S.data.msg)!==null&&w!==void 0?w:"修改与会者权限失败"}),D(new Error((N=S.data.msg)!==null&&N!==void 0?N:"修改与会者权限失败"))))})})}},{key:"createRoom",value:(y=In(L().mark(function f(){var m,_,k,D,E,A,w,N,S,P,F;return L().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:if(this.baseUrl){V.next=3;break}return this.emit("errorPush",{type:"createRoom",message:"请输入baseUrl"}),V.abrupt("return");case 3:if(this.roomName){V.next=6;break}return this.emit("errorPush",{type:"createRoom",message:"房间名不能为空"}),V.abrupt("return");case 6:if(this.org&&this.userId){V.next=9;break}return this.emit("errorPush",{type:"createRoom",message:"创建房间前请先登录"}),V.abrupt("return");case 9:return k="",V.prev=10,D=tn(this,_r,jr).call(this),E=D.timestamp,A=D.signature,V.next=14,fetch(this.baseUrl+"/api/v1/creatRoom",{method:"POST",body:JSON.stringify({roomAlias:this.roomName,org:this.org,owner:this.userId}),headers:{apikey:It(this,Oi),timestamp:E,signature:A}});case 14:return w=V.sent,V.next=17,w.json();case 17:if((m=V.sent).code!=200){V.next=36;break}return k=m.data,N=tn(this,_r,jr).call(this),S=N.timestamp,P=N.signature,V.next=23,fetch(this.baseUrl+"/api/v1/createDispatcher",{method:"POST",body:JSON.stringify({org:this.org,room:k,called:k}),headers:{apikey:It(this,Oi),timestamp:S,signature:P}});case 23:return F=V.sent,V.next=26,F.json();case 26:if((_=V.sent).code!=200){V.next=32;break}this.emit("roomCreatedSuccess",k),Or(this,Od,_.data),V.next=34;break;case 32:return this.emit("roomCreatedFail",_.msg),V.abrupt("return","");case 34:V.next=38;break;case 36:return this.emit("roomCreatedFail",m.msg),V.abrupt("return","");case 38:V.next=43;break;case 40:V.prev=40,V.t0=V.catch(10),this.emit("roomCreatedFail",V.t0);case 43:return V.abrupt("return",k);case 44:case"end":return V.stop()}},f,this,[[10,40]])})),function(){return y.apply(this,arguments)})},{key:"joinRoom",value:(v=In(L().mark(function f(){var m,_,k,D,E,A,w,N,S,P,F,V,J,ie,X,H,$,j,B,q,z,oe,we,be,Z,_e,Te,Ue,We,pe,Ne,nt,le=this,Ke=arguments;return L().wrap(function(ae){for(;;)switch(ae.prev=ae.next){case 0:if(E=(D=Ke.length>0&&Ke[0]!==void 0?Ke[0]:{}).audioDeviceId,A=E===void 0?"":E,w=D.videoDeviceId,N=w===void 0?"":w,S=D.outputDeviceId,P=S===void 0?"":S,F=D.facingMode,V=F===void 0?"user":F,J=D.autoGainControl,ie=D.echoCancellation,X=D.noiseSuppression,H=D.roomNum,$=D.cameraStatus,j=$===void 0||$,B=D.microphoneStatus,q=B===void 0||B,z=D.origin,oe=z===void 0?"0":z,we=D.videoCodec,H){ae.next=4;break}return this.emit("errorPush",{type:"joinRoom",message:"请输入房间号"}),ae.abrupt("return");case 4:return be={audioCaptureDefaults:{deviceId:A||"default",autoGainControl:J!=null&&J,echoCancellation:ie!=null&&ie,noiseSuppression:X!=null&&X},videoCaptureDefaults:{},stopLocalTrackOnUnpublish:!0,adaptiveStream:!0},P&&(be.audioOutput={deviceId:P}),Z={autoSubscribe:!0},N?be.videoCaptureDefaults.deviceId=N:be.videoCaptureDefaults.facingMode=V,we&&typeof we=="string"&&(_e={videoCodec:we},be.publishDefaults=_e),this.roomNum=H,ae.prev=10,ae.next=13,tn(this,NC,TR).call(this,this.roomNum,oe);case 13:return Te=ae.sent,Ue=this.baseUrl.split("//")[1],We=Ue.split("/ylapi")[0],Or(this,Nd,"".concat(this.wshead).concat(We)),Or(this,Pd,Te.token),this.room=new Dd(be),ae.next=21,this.room.prepareConnection(It(this,Nd),It(this,Pd));case 21:return tn(this,PC,SR).call(this),ae.next=24,this.room.connect(It(this,Nd),It(this,Pd),Z);case 24:ae.next=30;break;case 26:return ae.prev=26,ae.t0=ae.catch(10),this.emit("joinRoomError",ae.t0),ae.abrupt("return");case 30:if(ae.prev=30,this.roomMode!=="auto"){ae.next=39;break}return ae.next=34,this.room.localParticipant.setCameraEnabled(j);case 34:return ae.next=36,this.room.localParticipant.setMicrophoneEnabled(q);case 36:tn(this,Md,ag).call(this,"video"),ae.next=44;break;case 39:return ae.next=41,this.room.localParticipant.setMicrophoneEnabled(q);case 41:return ae.next=43,this.room.localParticipant.setCameraEnabled(!1);case 43:tn(this,Md,ag).call(this,"audio");case 44:ae.next=49;break;case 46:ae.prev=46,ae.t1=ae.catch(30);case 49:return pe=(m=this.room.getActiveDevice("audioinput"))!==null&&m!==void 0?m:"default",Ne=(_=this.room.getActiveDevice("videoinput"))!==null&&_!==void 0?_:"default",nt=(k=this.room.getActiveDevice("audiooutput"))!==null&&k!==void 0?k:"default",this.room.remoteParticipants.forEach(function(ue){tn(le,Rd,og).call(le,ue)}),tn(this,Rd,og).call(this,this.room.localParticipant),ae.abrupt("return",{audioInputDevice:pe,videoInputDevice:Ne,audioOutputDevice:nt});case 55:case"end":return ae.stop()}},f,this,[[10,26],[30,46]])})),function(){return v.apply(this,arguments)})},{key:"makeCall",value:function(f,m,_){var k=this;return new Promise(function(D,E){var A=null;k.roomNum||(k.emit("errorPush",{type:"makeCall",message:"请先加入房间"}),E()),k.baseUrl||(k.emit("errorPush",{type:"makeCall",message:"baseUrl为空"}),E()),A=_?{name:f,org:k.org,room:k.roomNum,dnis:m,type:_}:{name:f,org:k.org,room:k.roomNum,dnis:m};var w=tn(k,_r,jr).call(k),N=w.timestamp,S=w.signature;fetch(k.baseUrl+"/api/v1/makeCall",{method:"POST",body:JSON.stringify(A),headers:{apikey:It(k,Oi),timestamp:N,signature:S}}).then(function(P){return P.json()}).then(function(P){var F;P.code==200?(k.emit("makeCallSuccess"),D()):(k.emit("errorPush",{type:"makeCall",message:(F=P.msg)!==null&&F!==void 0?F:"呼出失败"}),E())}).catch(function(P){k.emit("errorPush",{type:"makeCall",message:P}),E()})})}},{key:"pushVideoStream",value:function(){var f,m=this;if(this.roomNum)return new Promise(function(_,k){var D={cmd:"StartOutputStream",data:{room:m.roomNum,url:"rtmp://10.2.14.199/live/"}};m.socket.send(D),m.socket.addMessageHandler("StartOutputStream",function(E){var A,w,N=JSON.parse(E);N.cmd==="StartOutputStream"&&((N==null?void 0:N.data.code)=="200"?(m.emit("startPushing",N.data),_(N.data.result)):(m.emit("errorPush",{type:"pushVideoStream",message:(A=(w=N.data)===null||w===void 0?void 0:w.msg)!==null&&A!==void 0?A:"推流失败"}),k()))})});this.emit("errorPush",{type:"pushVideoStream",message:(f=result.msg)!==null&&f!==void 0?f:"请先加入房间"})}},{key:"stopPushVideoStream",value:function(){var f=this;if(this.roomNum)return new Promise(function(m,_){var k={cmd:"StopOutputStream",data:{room:f.roomNum}};f.socket.send(k),f.socket.addMessageHandler("StopOutputStream",function(D){var E,A,w=JSON.parse(D);w.cmd==="StopOutputStream"&&((w==null?void 0:w.data.code)=="200"?(f.emit("stopPushing",w.data),m()):(f.emit("errorPush",{type:"stopPushVideoStream",message:(E=(A=w.data)===null||A===void 0?void 0:A.msg)!==null&&E!==void 0?E:"停止推流失败"}),_()))})});this.emit("errorPush",{type:"stopPushVideoStream",message:"请先加入房间"})}},{key:"moveoutParticipant",value:function(f){var m=this;if(this.roomNum)return new Promise(function(_,k){var D={cmd:"RemoveParticipant",data:{room:m.roomNum,identity:f}};m.socket.send(D),m.socket.addMessageHandler("RemoveParticipant",function(E){var A,w=JSON.parse(E);w.cmd==="RemoveParticipant"&&((w==null?void 0:w.data.code)=="200"?_():(m.emit("errorPush",{type:"moveoutParticipant",message:(A=w.data.msg)!==null&&A!==void 0?A:"移出房间失败"}),k()))})});this.emit("errorPush",{type:"moveoutParticipant",message:"请先加入房间"})}},{key:"updateParticipantName",value:function(f,m){var _=this,k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"0";if(this.roomNum)return new Promise(function(D,E){var A={cmd:"UpdateParticipant",data:{room:_.roomNum,identity:f,name:m,isPermission:k}};_.socket.send(A),_.socket.addMessageHandler("UpdateParticipant",function(w){var N,S=JSON.parse(w);S.cmd==="UpdateParticipant"&&((S==null?void 0:S.data.code)=="200"?D():(_.emit("errorPush",{type:"updateParticipantName",message:(N=S.data.msg)!==null&&N!==void 0?N:"修改与会者名称失败"}),E()))})});this.emit("errorPush",{type:"updateParticipantName",message:"请先加入房间"})}},{key:"setParticipantToHost",value:function(f,m){var _=this;return new Promise(function(k,D){_.roomNum&&f&&m&&_.userId||(_.emit("errorPush",{type:"setParticipantToHost",message:"关键参数缺失"}),D("关键参数缺失"));var E={cmd:"AddHost",data:{room:_.roomNum,identity:_.userId,hostId:f,hostName:m}};_.socket.addMessageHandler("SetParticipantToHost",function(A){var w,N,S=JSON.parse(A);S.cmd==="AddHost"&&((S==null?void 0:S.data.code)=="200"?k():(_.emit("errorPush",{type:"setParticipantToHost",message:(w=S.data.msg)!==null&&w!==void 0?w:"添加为主持人失败"}),D((N=S.data.msg)!==null&&N!==void 0?N:"添加为主持人失败")))}),_.socket.send(E)})}},{key:"startRecord",value:function(){var f=this;if(this.roomNum)return new Promise(function(m,_){var k={cmd:"StartRecording",data:{room:f.roomNum}};f.socket.send(k),f.socket.addMessageHandler("StartRecording",function(D){var E,A=JSON.parse(D);A.cmd==="StartRecording"&&((A==null?void 0:A.data.code)=="200"?(f.emit("startRecording",A.data.result),m(A.data.result)):(f.emit("errorPush",{type:"startRecord",message:(E=A.data.msg)!==null&&E!==void 0?E:"录制失败"}),_()))})});this.emit("errorPush",{type:"startRecord",message:"请先加入房间"})}},{key:"stopRecord",value:function(){var f=this;if(this.roomNum)return new Promise(function(m,_){var k={cmd:"StopRecording",data:{room:f.roomNum}};f.socket.send(k),f.socket.addMessageHandler("StopRecording",function(D){var E,A,w=JSON.parse(D);w.cmd==="StopRecording"&&((w==null?void 0:w.data.code)=="200"?(f.emit("stopRecording",w.data),m()):(f.emit("errorPush",{type:"stopRecord",message:(E=(A=w.data)===null||A===void 0?void 0:A.msg)!==null&&E!==void 0?E:"停止录制失败"}),_()))})});this.emit("errorPush",{type:"stopRecord",message:"请先加入房间"})}},{key:"pullStream",value:function(f,m){var _=this;return new Promise(function(k,D){m||D("streamIdentity不能为空");var E={cmd:"StartInputStream",data:{room:_.roomNum,identity:m,url:f}};_.socket.send(E),_.socket.addMessageHandler("StartInputStream",function(A){var w,N,S=JSON.parse(A);S.cmd==="StartInputStream"&&((S==null?void 0:S.data.code)=="200"?(_.emit("startPulling",S.data.result),k(S.data.result)):(_.emit("errorPush",{type:"pullStream",message:(w=(N=S.data)===null||N===void 0?void 0:N.msg)!==null&&w!==void 0?w:"拉流失败"}),D()))})})}},{key:"stopPullStream",value:function(){var f=this;return new Promise(function(m,_){var k={cmd:"StopInputStream",data:{room:f.roomNum,identity:"liuang3a5gdf"}};f.socket.send(k),f.socket.addMessageHandler("StopInputStream",function(D){var E,A,w=JSON.parse(D);w.cmd==="StopInputStream"&&((w==null?void 0:w.data.code)=="200"?(f.emit("stopPulling",w.data),m()):(f.emit("errorPush",{type:"stopPullStream",message:(E=(A=w.data)===null||A===void 0?void 0:A.msg)!==null&&E!==void 0?E:"停止拉流失败"}),_()))})})}},{key:"inviteThirdParty",value:function(f){var m=this,_=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"1478649882954985474",k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"";return new Promise(function(D,E){f||(m.emit("errorPush",{type:"inviteThirdParty",message:"被邀请人姓名不能为空"}),E());var A={cmd:"Invite",data:{room:m.roomNum,identity:m.userId,inviteOrg:_,inviteIdentity:f,metadata:k}};m.socket.addMessageHandler("inviteThirdParty",function(w){var N,S=JSON.parse(w);S.cmd==="Invite"&&(((N=S.data)===null||N===void 0?void 0:N.code)==="200"?(m.emit("inviteThirdSuccess"),D()):(m.emit("inviteThirdFail"),E()))}),m.socket.send(A)})}},{key:"acceptInvite",value:function(f,m,_){var k=this;return new Promise(function(D,E){f&&m&&_||(k.emit("errorPush",{type:"acceptInvite",message:"关键参数缺失"}),E());var A={cmd:"Accept",data:{room:f,identity:k.userId,toOrg:_,toIdentity:m}};k.socket.addMessageHandler("inviteAccept",function(w){var N,S=JSON.parse(w);S.cmd==="Accept"&&(((N=S.data)===null||N===void 0?void 0:N.code)==="200"?(k.emit("acceptInviteSuccess"),D()):(k.emit("acceptInviteFail"),E()))}),k.socket.send(A)})}},{key:"refuseInvite",value:function(f,m,_){var k=this;return new Promise(function(D,E){f&&m&&_||(k.emit("errorPush",{type:"refuseInvite",message:"关键参数缺失"}),E());var A={cmd:"Refuse",data:{room:f,identity:k.userId,toOrg:_,toIdentity:m}};k.socket.addMessageHandler("inviteRefuse",function(w){var N,S=JSON.parse(w);S.cmd==="Refuse"&&(((N=S.data)===null||N===void 0?void 0:N.code)==="200"?(k.emit("refuseInviteSuccess"),D()):(k.emit("refuseInviteFail"),E()))}),k.socket.send(A)})}},{key:"enterText",value:function(f){if(this.room&&this.room.localParticipant){var m=this.room.localParticipant,_=this.encoder.encode(f);m.publishData(_,gn.RELIABLE)}else this.emit("errorPush",{type:"enterText",message:"请先加入房间"})}},{key:"leaveRoom",value:(b=In(L().mark(function f(){return L().wrap(function(m){for(;;)switch(m.prev=m.next){case 0:if(!this.room){m.next=4;break}return m.next=3,this.room.disconnect();case 3:this.room=null;case 4:case"end":return m.stop()}},f,this)})),function(){return b.apply(this,arguments)})},{key:"deleteRoom",value:function(f){var m=this;return new Promise(function(_,k){var D={cmd:"DeleteRoom",data:{room:m.roomNum,identity:f}};m.socket.send(D),m.socket.addMessageHandler("DeleteRoom",function(E){var A=JSON.parse(E);A.cmd==="DeleteRoom"&&((A==null?void 0:A.data.code)=="200"?_():k(A==null?void 0:A.data.msg))})})}},{key:"closeSocket",value:function(){this.socket.close()}},{key:"publishLocalParticipant",value:(h=In(L().mark(function f(){var m,_=this;return L().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return k.next=2,rR({audio:!0,video:!0});case 2:m=k.sent,this.room.localParticipant&&m.forEach(function(D){_.room.localParticipant.publishTrack(m)});case 5:case"end":return k.stop()}},f,this)})),function(){return h.apply(this,arguments)})},{key:"changeAudioDevice",value:(d=In(L().mark(function f(m){return L().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(!this.room){_.next=3;break}return _.next=3,this.room.switchActiveDevice("audioinput",m);case 3:case"end":return _.stop()}},f,this)})),function(f){return d.apply(this,arguments)})},{key:"changeVideoDevice",value:(u=In(L().mark(function f(m){return L().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(!this.room){_.next=11;break}return _.prev=1,_.next=4,this.room.switchActiveDevice("videoinput",m);case 4:_.sent,_.next=11;break;case 8:throw _.prev=8,_.t0=_.catch(1),new Error("sdkError",_.t0);case 11:case"end":return _.stop()}},f,this,[[1,8]])})),function(f){return u.apply(this,arguments)})},{key:"changeOutputDevice",value:(c=In(L().mark(function f(m){return L().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(!this.room){_.next=3;break}return _.next=3,this.room.switchActiveDevice("audiooutput",m);case 3:case"end":return _.stop()}},f,this)})),function(f){return c.apply(this,arguments)})},{key:"flipCamera",value:function(){var f,m,_,k=(f=this.room)===null||f===void 0?void 0:f.localParticipant.getTrackPublication(Le.Source.Camera);if(k){var D={facingMode:((m=k.videoTrack)===null||m===void 0?void 0:m.constraints).facingMode==="user"?"environment":"user"};return(_=k.videoTrack)===null||_===void 0||_.restartTrack(D),D.facingMode}this.emit("errorPush",{type:"flipCamera",message:"请先加入房间"})}},{key:"changeCameraStatus",value:(o=In(L().mark(function f(){var m;return L().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(!this.room||!this.room.localParticipant){_.next=12;break}if(!(m=this.room.localParticipant).isCameraEnabled){_.next=7;break}return _.next=5,m.setCameraEnabled(!1);case 5:_.next=9;break;case 7:return _.next=9,m.setCameraEnabled(!0);case 9:this.emit("localCameraChange",m.isCameraEnabled),_.next=13;break;case 12:this.emit("errorPush",{type:"changeCameraStatus",message:"请先加入房间"});case 13:case"end":return _.stop()}},f,this)})),function(){return o.apply(this,arguments)})},{key:"changeMicrophoneStatus",value:(a=In(L().mark(function f(){var m;return L().wrap(function(_){for(;;)switch(_.prev=_.next){case 0:if(!this.room||!this.room.localParticipant){_.next=12;break}if(!(m=this.room.localParticipant).isMicrophoneEnabled){_.next=7;break}return _.next=5,m.setMicrophoneEnabled(!1);case 5:_.next=9;break;case 7:return _.next=9,m.setMicrophoneEnabled(!0);case 9:this.emit("localMicrophoneChange",m.isMicrophoneEnabled),_.next=13;break;case 12:this.emit("errorPush",{type:"changeMicrophoneStatus",message:"请先加入房间"});case 13:case"end":return _.stop()}},f,this)})),function(){return a.apply(this,arguments)})},{key:"changeScreenShareStatus",value:(s=In(L().mark(function f(){var m,_;return L().wrap(function(k){for(;;)switch(k.prev=k.next){case 0:if(!this.room||!this.room.localParticipant){k.next=9;break}return m=this.room.localParticipant,_=m.isScreenShareEnabled,k.next=5,m.setScreenShareEnabled(!_,{audio:!0});case 5:_||tn(this,Md,ag).call(this,"share"),this.emit("localScreenShareChange",m.isScreenShareEnabled),k.next=10;break;case 9:this.emit("errorPush",{type:"changeScreenShareStatus",message:"请先加入房间"});case 10:case"end":return k.stop()}},f,this)})),function(){return s.apply(this,arguments)})},{key:"changeParticipantMicrophoneStatus",value:(r=In(L().mark(function f(m,_){var k,D,E,A,w,N=this;return L().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:if(m){S.next=3;break}return this.emit("errorPush",{type:"changeParticipantMicrophoneStatus",message:"请输入要查询的identity"}),S.abrupt("return");case 3:if(k=this.room.getParticipantByIdentity(m)){S.next=7;break}return this.emit("errorPush",{type:"changeParticipantMicrophoneStatus",message:"该参与者不存在"}),S.abrupt("return");case 7:if(!k.isLocal){S.next=13;break}return S.next=10,k.setMicrophoneEnabled(!_);case 10:this.emit("localMicrophoneChange",this.room.localParticipant.isMicrophoneEnabled),S.next=19;break;case 13:if(D=k.getTrackPublication(Le.Source.Microphone),E=D?D.trackSid:void 0){S.next=18;break}return this.emit("errorPush",{type:"changeParticipantMicrophoneStatus",message:"trackId不存在"}),S.abrupt("return");case 18:_?(A={cmd:"Mute",data:{org:this.org,room:this.roomNum,input:"1",identity:m,trackId:E}},this.socket.addMessageHandler("Mute",function(P){var F,V,J=JSON.parse(P);J.cmd==="Mute"&&((J==null?void 0:J.data.code)=="200"||N.emit("errorPush",{type:"changeParticipantMicrophoneStatus",message:(F=(V=J.data)===null||V===void 0?void 0:V.msg)!==null&&F!==void 0?F:"关闭指定参与者麦克风失败"}))}),this.socket.send(A)):(w={cmd:"UnMute",data:{org:this.org,room:this.roomNum,input:"1",identity:m,trackId:E}},this.socket.addMessageHandler("UnMute",function(P){var F,V,J,ie=JSON.parse(P);ie.cmd==="UnMute"&&((ie==null?void 0:ie.data.code)=="200"||(F=ie.data)!==null&&F!==void 0&&F.msg&&N.emit("errorPush",{type:"changeParticipantMicrophoneStatus",message:(V=(J=ie.data)===null||J===void 0?void 0:J.msg)!==null&&V!==void 0?V:"请求开启指定参与者麦克风失败"}))}),this.socket.send(w));case 19:case"end":return S.stop()}},f,this)})),function(f,m){return r.apply(this,arguments)})},{key:"changeParticipantCameraStatus",value:(n=In(L().mark(function f(m,_){var k,D,E,A,w,N=this;return L().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:if(m){S.next=3;break}return this.emit("errorPush",{type:"changeParticipantCameraStatus",message:"请输入要查询的identity"}),S.abrupt("return");case 3:if(k=this.room.getParticipantByIdentity(m)){S.next=7;break}return this.emit("errorPush",{type:"changeParticipantCameraStatus",message:"该参与者不存在"}),S.abrupt("return");case 7:if(!k.isLocal){S.next=13;break}return S.next=10,k.setCameraEnabled(!_);case 10:this.emit("localCameraChange",this.room.localParticipant.isCameraEnabled),S.next=19;break;case 13:if(D=k.getTrackPublication(Le.Source.Camera),E=D?D.trackSid:void 0){S.next=18;break}return this.emit("errorPush",{type:"changeParticipantCameraStatus",message:"trackId不存在"}),S.abrupt("return");case 18:_?(A={cmd:"Mute",data:{org:this.org,room:this.roomNum,identity:m,trackId:E,input:"2"}},this.socket.addMessageHandler("Mute",function(P){var F,V,J=JSON.parse(P);J.cmd==="Mute"&&((J==null?void 0:J.data.code)=="200"||N.emit("errorPush",{type:"changeParticipantCameraStatus",message:(F=(V=J.data)===null||V===void 0?void 0:V.msg)!==null&&F!==void 0?F:"关闭指定参与者摄像头失败"}))}),this.socket.send(A)):(w={cmd:"UnMute",data:{org:this.org,room:this.roomNum,identity:m,trackId:E,input:"2"}},this.socket.addMessageHandler("UnMute",function(P){var F,V,J,ie=JSON.parse(P);ie.cmd==="UnMute"&&((ie==null?void 0:ie.data.code)=="200"||(F=ie.data)!==null&&F!==void 0&&F.msg&&N.emit("errorPush",{type:"changeParticipantCameraStatus",message:(V=(J=ie.data)===null||J===void 0?void 0:J.msg)!==null&&V!==void 0?V:"请求打开指定参与者摄像头失败"}))}),this.socket.send(w));case 19:case"end":return S.stop()}},f,this)})),function(f,m){return n.apply(this,arguments)})},{key:"startTrackAttach",value:function(f){var m={};if(m.name=f.name?f.name:f.identity,m.roomMode=this.roomMode,m.identity=f.identity,m.audioLevel=f.audioLevel,m.isSpeaking=f.isSpeaking,m.metadata=f.metadata,m.sid=f.sid,m.isLocal=f.isLocal,m.isMicrophoneEnabled=f.isMicrophoneEnabled,this.roomMode==="auto"){m.isCameraEnabled=f.isCameraEnabled,m.isScreenShareEnabled=f.isScreenShareEnabled;var _=f.getTrackPublication(Le.Source.Camera),k=f.getTrackPublication(Le.Source.Microphone);f.isScreenShareEnabled&&(_=f.getTrackPublication(Le.Source.ScreenShare),k=f.getTrackPublication(Le.Source.ScreenShareAudio)),m.videoTrack=_?_.videoTrack:void 0,m.audioTrack=k?k.audioTrack:void 0,this.emit("trackAttach",m)}else{var D=f.getTrackPublication(Le.Source.Microphone);m.audioTrack=D?D.audioTrack:void 0,this.emit("trackAttach",m)}}},{key:"renderParticipant",value:function(f){var m=arguments.length>1&&arguments[1]!==void 0&&arguments[1];this.roomMode==="auto"?this.renderToVideo(f,m):this.roomMode==="audio"&&this.renderToAudio(f,m)}},{key:"renderToVideo",value:function(f,m){var _={},k=f.name,D=f.identity,E=f.audioLevel,A=f.isSpeaking,w=f.metadata,N=f.sid,S=f.isCameraEnabled,P=f.isLocal,F=f.isMicrophoneEnabled,V=f.isScreenShareEnabled,J=f.connectionQuality;_.remove=m,_.name=k||D,_.roomMode=this.roomMode,_.identity=D,_.audioLevel=E,_.isSpeaking=A,_.metadata=w,_.sid=N,_.isCameraEnabled=S,_.isLocal=P,_.isMicrophoneEnabled=F,_.isScreenShareEnabled=V,_.connectionQuality=J;var ie=f.getTrackPublication(Le.Source.Camera),X=f.getTrackPublication(Le.Source.Microphone);V&&(ie=f.getTrackPublication(Le.Source.ScreenShare),X=f.getTrackPublication(Le.Source.ScreenShareAudio)),_.videoTrack=ie?ie.videoTrack:void 0,_.audioTrack=X?X.audioTrack:void 0,this.emit("videoCallRender",_)}},{key:"renderToAudio",value:function(f,m){var _={},k=f.name,D=f.identity,E=f.audioLevel,A=f.isSpeaking,w=f.metadata,N=f.sid,S=f.isLocal,P=f.isMicrophoneEnabled,F=f.connectionQuality;_.remove=m,_.name=k||D,_.roomMode=this.roomMode,_.identity=D,_.audioLevel=E,_.isSpeaking=A,_.metadata=w,_.sid=N,_.isLocal=S,_.isMicrophoneEnabled=P,_.connectionQuality=F;var V=f.getTrackPublication(Le.Source.Microphone);_.audioTrack=V?V.audioTrack:void 0,this.emit("audioCallRender",_)}},{key:"updateVideoSize",value:function(f,m){m.innerHTML="(".concat(f.videoWidth,"x").concat(f.videoHeight,")")}},{key:"sendInviteNotice",value:function(f,m,_){var k=this;return new Promise(function(D,E){_||E("缺少roomNum参数");var A=tn(k,_r,jr).call(k),w=A.timestamp,N=A.signature;fetch(k.baseUrl+"/api/v1/noticeMakeCall",{method:"POST",headers:{"Content-Type":"application/json;charset=utf-8",apikey:It(k,Oi),timestamp:w,signature:N},body:JSON.stringify({name:f,dnis:m,room:_})}).then(function(S){return S.json()}).then(function(S){var P;(S==null?void 0:S.code)==200?D():E((P=S==null?void 0:S.msg)!==null&&P!==void 0?P:"语音播报接口出错")}).catch(function(S){E(S)})})}}],[{key:"getDeviceList",value:(t=In(L().mark(function f(){var m,_,k;return L().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:return D.next=2,Dd.getLocalDevices("audioinput");case 2:return m=D.sent,D.next=5,Dd.getLocalDevices("videoinput");case 5:return _=D.sent,D.next=8,Dd.getLocalDevices("audiooutput");case 8:return k=D.sent,D.abrupt("return",{audioDevices:m,videoDevices:_,outputDevices:k});case 10:case"end":return D.stop()}},f)})),function(){return t.apply(this,arguments)})}]),e}();function bR(){var i=this;this.socket.addMessageHandler("ResUnMute",function(e){var t,n=JSON.parse(e);n.cmd==="ResUnMute"&&((n==null?void 0:n.data.code)=="200"?i.emit("requestDeviceOpen",n.data):i.emit("errorPush",{type:"requestDeviceOpen",message:(t=n==null?void 0:n.data.msg)!==null&&t!==void 0?t:"更改用户设备失败"}))}),this.socket.addMessageHandler("ResThirdInvite",function(e){var t,n=JSON.parse(e);n.cmd==="ResInvite"&&((t=n.data)===null||t===void 0?void 0:t.code)=="200"&&i.emit("receiveInviteSuccess",{roomNum:n.data.room,fromIdentity:n.data.fromIdentity,fromOrg:n.data.fromOrg,metadata:n.data.metadata})}),this.socket.addMessageHandler("ResAccept",function(e){var t,n=JSON.parse(e);n.cmd==="ResAccept"&&((t=n.data)===null||t===void 0?void 0:t.code)=="200"&&i.emit("receiveInviteAccept",{roomNum:n.data.room,fromIdentity:n.data.fromIdentity,fromOrg:n.data.fromOrg})}),this.socket.addMessageHandler("ResRefuse",function(e){var t,n=JSON.parse(e);n.cmd==="ResRefuse"&&((t=n.data)===null||t===void 0?void 0:t.code)=="200"&&i.emit("receiveInviteRefuse",{roomNum:n.data.room,fromIdentity:n.data.fromIdentity,fromOrg:n.data.fromOrg})}),this.socket.addMessageHandler("SendText",function(e){var t,n=JSON.parse(e);n.cmd==="SendText"&&(((t=n.data)===null||t===void 0?void 0:t.code)=="200"?i.emit("sendTextSuccess",n.data.msg):i.emit("sendTextFailed",n.data.msg))}),this.socket.addMessageHandler("ResReceiveMsg",function(e){var t,n=JSON.parse(e);n.cmd==="ResReceiveMsg"&&((t=n.data)===null||t===void 0?void 0:t.code)=="200"&&i.emit("messageReceived",{origin:n==null?void 0:n.data.fromIdentity,content:n==null?void 0:n.data.text,fromName:n==null?void 0:n.data.fromName,fromOrg:n==null?void 0:n.data.fromOrg,room:n==null?void 0:n.data.room})}),this.socket.addMessageHandler("ResAddHost",function(e){var t,n=JSON.parse(e);n.cmd==="ResAddHost"&&((t=n.data)===null||t===void 0?void 0:t.code)=="200"&&i.emit("setHostSuccess",{hostId:n==null?void 0:n.data.hostId,hostName:n==null?void 0:n.data.hostName})}),this.socket.addMessageHandler("ResAddCoHost",function(e){var t,n=JSON.parse(e);n.cmd==="ResAddCoHost"&&((t=n.data)===null||t===void 0?void 0:t.code)=="200"&&i.emit("addCoHostSuccess",{coHostId:n==null?void 0:n.data.coHostId,coHostName:n==null?void 0:n.data.coHostName})}),this.socket.addMessageHandler("ResRemoveCoHost",function(e){var t,n=JSON.parse(e);n.cmd==="ResRemoveCoHost"&&((t=n.data)===null||t===void 0?void 0:t.code)=="200"&&i.emit("removeCoHostSuccess",{coHostId:n==null?void 0:n.data.coHostId,coHostName:n==null?void 0:n.data.coHostName})}),this.socket.addMessageHandler("ResModifyPermission",function(e){var t,n,r,s=JSON.parse(e);s.cmd==="ResModifyPermission"&&((t=s.data)===null||t===void 0?void 0:t.code)=="200"&&i.emit("roomPermissionChange",{permission:(n=s.data)===null||n===void 0?void 0:n.permission,input:(r=s.data)===null||r===void 0?void 0:r.input})})}function ag(i){if(this.roomNum){var e={cmd:"SdkCall",data:{room:this.roomNum,sdkType:i}};this.socket.send(e)}else this.emit("errorPush",{type:"getSdkCallNum",message:"请先加入房间"})}function _R(i){return document.getElementById(i)}function jr(){var i=Math.floor(Date.now()/1e3),e="".concat(It(this,Oi)).concat(i),t=Id.HmacSHA256(e,It(this,rg));return{timestamp:i,signature:Id.enc.Base64.stringify(t).replace(/\+/g,"-").replace(/\//g,"_")}}function kR(){return RC.apply(this,arguments)}function RC(){return(RC=In(L().mark(function i(){var e,t,n,r;return L().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(It(this,Od)){s.next=2;break}return s.abrupt("return");case 2:if(this.baseUrl){s.next=4;break}return s.abrupt("return");case 4:return s.prev=4,e=tn(this,_r,jr).call(this),t=e.timestamp,n=e.signature,s.next=8,fetch(this.baseUrl+"/api/v1/deleteDispatcher",{method:"POST",body:JSON.stringify({ruleId:It(this,Od)}),headers:{"Content-Type":"application/json;chartset=UTF-8",apikey:It(this,Oi),timestamp:t,signature:n}});case 8:return r=s.sent,s.next=11,r.json();case 11:s.sent.code!==200&&this.emit("errorPush",{type:"dispatchInCall",message:"解除呼入绑定失败"}),s.next=18;break;case 15:s.prev=15,s.t0=s.catch(4),this.emit("errorPush",{type:"dispatchInCall",message:"解除呼入绑定失败"});case 18:case"end":return s.stop()}},i,this,[[4,15]])}))).apply(this,arguments)}function TR(i){var e=this,t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"0";if(i)return new Promise(function(n,r){var s={cmd:"GetToken",data:{org:e.org,room:i,identity:e.userId,origin:t}};e.socket.send(s),e.socket.addMessageHandler("GetToken",function(a){var o,c,u=JSON.parse(a);u.cmd==="GetToken"&&((u==null?void 0:u.data.code)=="200"?n({roomUrl:u.data.url,token:u.data.token}):(e.emit("errorPush",{type:"getToken",message:(o=(c=u.data)===null||c===void 0?void 0:c.msg)!==null&&o!==void 0?o:"获取会议token失败"}),r()))})});this.emit("errorPush",{type:"getToken",message:"未获取到房间号"})}function SR(){var i=this;this.room.on(je.Connected,function(){i.emit("roomConnected")}),this.room.on(je.Disconnected,function(){var e=In(L().mark(function t(n){return L().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,tn(i,MC,xR).call(i);case 2:i.emit("roomDisconnected",n);case 3:case"end":return r.stop()}},t)}));return function(t){return e.apply(this,arguments)}}()),this.room.on(je.ParticipantConnected,function(e){i.emit("participantConnected",e),tn(i,Rd,og).call(i,e)}),this.room.on(je.ParticipantDisconnected,function(e){tn(i,OC,CR).call(i,e)}),this.room.on(je.ActiveDeviceChanged,function(e,t){i.emit("mediaDeviceChange",{kind:e,deviceId:t})}),this.room.on(je.ActiveSpeakersChanged,function(e){var t;t=e.map(function(n){var r;return{identity:n.identity,isLocal:n.isLocal,audioLevel:n.audioLevel,name:(r=n.name)!==null&&r!==void 0?r:n.identity}}),i.emit("activeSpeakerChange",t)}),this.room.on(je.LocalTrackPublished,function(e){i.renderParticipant(i.room.localParticipant),i.startTrackAttach(i.room.localParticipant)}),this.room.on(je.LocalTrackUnpublished,function(){i.renderParticipant(i.room.localParticipant),i.startTrackAttach(i.room.localParticipant)}),this.room.on(je.TrackPublished,function(e,t){i.startTrackAttach(t)}),this.room.on(je.TrackUnpublished,function(e,t){i.startTrackAttach(t)}),this.room.on(je.TrackSubscribed,function(e,t,n){i.renderParticipant(n),i.startTrackAttach(n)}),this.room.on(je.TrackUnsubscribed,function(e,t,n){i.renderParticipant(n),i.startTrackAttach(n)}),this.room.on(je.RoomMetadataChanged,function(e){i.emit("roomMetadataChanged",e)})}function og(i){var e=this;i.on(qe.ParticipantMetadataChanged,function(){e.renderParticipant(i)}),i.on(qe.TrackMuted,function(t){e.renderParticipant(i),e.startTrackAttach(i)}),i.on(qe.TrackUnmuted,function(t){e.renderParticipant(i),e.startTrackAttach(i)}),i.on(qe.IsSpeakingChanged,function(){e.renderParticipant(i)}),i.on(qe.ConnectionQualityChanged,function(){e.renderParticipant(i)}),i.on(qe.ParticipantNameChanged,function(t){e.renderParticipant(i)})}function CR(i){this.renderParticipant(i,!0)}function xR(i){return LC.apply(this,arguments)}function LC(){return(LC=In(L().mark(function i(e){var t=this;return L().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(this.room){n.next=2;break}return n.abrupt("return");case 2:return this.renderParticipant(this.room.localParticipant,!0),this.room.remoteParticipants.forEach(function(r){t.renderParticipant(r,!0)}),n.next=7,tn(this,IC,kR).call(this);case 7:case"end":return n.stop()}},i,this)}))).apply(this,arguments)}const lg=i=>(l.pushScopeId("data-v-c12bddcb"),i=i(),l.popScopeId(),i),ER={class:"check-dialog-inner"},wR={class:"control-list",style:{border:"none"}},DR=lg(()=>l.createElementVNode("div",{class:"control-list-title"},"麦克风",-1)),AR=["onClick"],IR={class:"control-list-item-value"},NR={class:"control-list"},PR=lg(()=>l.createElementVNode("div",{class:"control-list-title"},"扬声器",-1)),OR=["onClick"],MR={class:"control-list-item-value"},RR={key:1,class:"control-list"},LR=lg(()=>l.createElementVNode("div",{class:"control-list-title"},"摄像头",-1)),BR=["onClick"],UR={class:"control-list-item-value"},FR={key:2,class:"control-list"},VR=["onClick"],jR={class:"control-list-item-value"},$l=Mt({__name:"SelectDialog",props:{position:{type:Object,default:()=>({left:"0px",bottom:"40px"})},dialogType:{type:String,default:"audio"},otherOptionList:{type:Array,default:()=>[{label:"会议模式",value:"normal"},{label:"点调模式",value:"pointTurn"}]},audioDevices:{type:Array,default:()=>[]},outputDevices:{type:Array,default:()=>[]},videoDevices:{type:Array,default:()=>[]},activeDevice:{type:Object,default:()=>({})},currentRoomMode:{type:String,default:"normal"}},emits:["chooseAudioInputDevice","chooseAudioOutputDevice","chooseVideoDevice","chooseOtherItem","close"],setup(i,{emit:e}){const t=e;function n(o){t("chooseAudioInputDevice",o.value),t("close")}function r(o){t("chooseAudioOutputDevice",o.value),t("close")}function s(o){t("chooseVideoDevice",o.value),t("close")}function a(o){t("chooseOtherItem",o.value),t("close")}return(o,c)=>(l.openBlock(),l.createElementBlock("div",{class:"check-dialog",style:l.normalizeStyle(i.position)},[l.createElementVNode("div",ER,[i.dialogType==="audio"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createElementVNode("div",wR,[DR,(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.audioDevices,u=>{var d,h,b,v;return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["control-list-item",{"control-list-item-checked":((d=i.activeDevice)==null?void 0:d.audioInputDevice)&&u.value==((h=i.activeDevice)==null?void 0:h.audioInputDevice)}]),key:u.value,onClick:y=>n(u)},[l.createElementVNode("div",IR,l.toDisplayString(u.label),1),l.createElementVNode("div",{class:l.normalizeClass(["check",{"is-checked":((b=i.activeDevice)==null?void 0:b.audioInputDevice)&&u.value==((v=i.activeDevice)==null?void 0:v.audioInputDevice)}])},null,2)],10,AR)}),128))]),l.createElementVNode("div",NR,[PR,(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.outputDevices,u=>{var d,h,b,v;return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["control-list-item",{"control-list-item-checked":((d=i.activeDevice)==null?void 0:d.audioOutputDevice)&&u.value==((h=i.activeDevice)==null?void 0:h.audioOutputDevice)}]),key:u.value,onClick:y=>r(u)},[l.createElementVNode("div",MR,l.toDisplayString(u.label),1),l.createElementVNode("div",{class:l.normalizeClass(["check",{"is-checked":((b=i.activeDevice)==null?void 0:b.audioOutputDevice)&&u.value==((v=i.activeDevice)==null?void 0:v.audioOutputDevice)}])},null,2)],10,OR)}),128))])],64)):i.dialogType==="video"?(l.openBlock(),l.createElementBlock("div",RR,[LR,(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.videoDevices,u=>{var d,h,b,v;return l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["control-list-item",{"control-list-item-checked":((d=i.activeDevice)==null?void 0:d.videoDevice)&&u.value==((h=i.activeDevice)==null?void 0:h.videoDevice)}]),key:u.value,onClick:y=>s(u)},[l.createElementVNode("div",UR,l.toDisplayString(u.label),1),l.createElementVNode("div",{class:l.normalizeClass(["check",{"is-checked":((b=i.activeDevice)==null?void 0:b.videoDevice)&&u.value==((v=i.activeDevice)==null?void 0:v.videoDevice)}])},null,2)],10,BR)}),128))])):i.dialogType==="other"?(l.openBlock(),l.createElementBlock("div",FR,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.otherOptionList,u=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["control-list-item",{"control-list-item-checked":i.currentRoomMode===u.value}]),key:u.value,onClick:d=>a(u)},[l.createElementVNode("div",jR,l.toDisplayString(u.label),1),l.createElementVNode("div",{class:l.normalizeClass(["check",{"is-checked":i.currentRoomMode===u.value}])},null,2)],10,VR))),128))])):l.createCommentVNode("",!0)])],4))}},[["__scopeId","data-v-c12bddcb"]]),fo="/assets/img/index/tx.png",cg=new wn;function $R(){const i=l.ref(null),e=l.ref(null),t=l.ref(null),n=l.ref(!1),r=l.ref(0),s=u=>new Promise((d,h)=>{var b;(b=i.value)!=null&&b.setSinkId?i.value.setSinkId(u).then(d).catch(h):(cg.message("error","当前浏览器不支持指定扬声器设备"),h())});return{startmicroVolumnCheck:async(u,d,h,b,v)=>{let y=u;if(i.value||(i.value=d||new AudioContext),!b){cg.message("error","请先选择音频输出扬声器");return}s(b).then(async()=>{n.value=!0;const p={audio:h&&h!=="default"?{deviceId:h}:"default"};if(!y){const k=await navigator.mediaDevices.getUserMedia(p);y=i.value.createMediaStreamSource(k)}e.value=i.value.createAnalyser(),t.value=i.value.createGain(),t.value.gain.value=v,e.value.fftSize=32,y.connect(e.value),e.value.connect(t.value),t.value.connect(i.value.destination);const f=e.value.frequencyBinCount,m=new Uint8Array(f);function _(){e.value.getByteFrequencyData(m);let k=0;for(let D=0;D<f;D++)k+=m[D];r.value=Math.floor(k/f/255*100),n.value?requestAnimationFrame(_):r.value=0}_()}).catch(p=>{console.error(p),cg.message("error",`设置${b}扬声器失败`)})},stopmicroVolumnCheck:()=>{var u,d;n.value=!1,(u=t.value)==null||u.disconnect(),(d=e.value)==null||d.disconnect()},setMicroOutputVolumn:u=>{n.value&&(t.value.gain.value=u)},isMicroDetectStart:n,microVolumn:r}}const HR="/assets/audio/moon_light.ogg",ug=new wn;function qR(){const i=l.ref(null),e=l.ref(!1),t=l.ref(null),n=l.ref(null),r=l.ref(0),s=u=>new Promise((d,h)=>{var b;(b=i.value)!=null&&b.setSinkId?i.value.setSinkId(u).then(d).catch(h):(ug.message("error","当前浏览器不支持指定扬声器设备"),h())});return{startOutputVolumeCheck:async(u,d,h="audio-detect-player",b,v)=>{let y=u;if(i.value||(i.value=d||new AudioContext),!b){ug.message("error","请先选择要检测的扬声器");return}s(b).then(()=>{if(e.value=!0,!y){let _=document.getElementById(h);_||(_=document.createElement("audio"),_.id=h,_.src=HR,_.autoplay=!0,document.body.appendChild(_),_.onloadeddata=function(){_.play()}),y=i.value.createMediaElementSource(_)}t.value=i.value.createAnalyser(),n.value=i.value.createGain(),n.value.gain.value=v,t.value.fftSize=32,y.connect(t.value),t.value.connect(n.value),n.value.connect(i.value.destination);const p=t.value.frequencyBinCount,f=new Uint8Array(p);function m(){t.value.getByteFrequencyData(f);let _=0;for(let k=0;k<p;k++)_+=f[k];r.value=Math.floor(_/p/255*100),e.value?requestAnimationFrame(m):r.value=0}m()}).catch(p=>{console.error(p),ug.message("error",`设置${b}扬声器失败`)})},stopOutputVolumeCheck:(u="audio-detect-player")=>{var h,b;const d=document.getElementById(u);d&&d.remove(),e.value=!1,(h=n.value)==null||h.disconnect(),(b=t.value)==null||b.disconnect()},setOutputVolumn:u=>{e.value&&(n.value.gain.value=u)},isOutputDetectStart:e,outputVolumn:r}}const ri=i=>(l.pushScopeId("data-v-c01a99c7"),i=i(),l.popScopeId(),i),zR={class:"addressbox"},GR={class:"CustomHeader"},WR={class:"tabs"},KR=["onClick"],XR=ri(()=>l.createElementVNode("div",{class:"fgx"},null,-1)),YR={key:0,class:"setter-content"},JR={class:"setter-item",style:{"margin-bottom":"19px"}},QR=ri(()=>l.createElementVNode("div",{class:"setter-item-title"},"扬声器",-1)),ZR={class:"setter-item-content"},eL={class:"setter-item-tool"},tL={class:"setter-item-show"},nL=ri(()=>l.createElementVNode("div",{class:"setter-item-show-title"},[l.createElementVNode("span",null,"输出等级"),l.createElementVNode("img",{class:"icon",src:fo,alt:""})],-1)),iL={class:"setter-item-show-outter"},rL={class:"setter-item-show-split-layer"},sL={class:"setter-item-control"},aL=ri(()=>l.createElementVNode("div",{class:"setter-item-show-title"},[l.createElementVNode("span",null,"输出等级"),l.createElementVNode("img",{class:"icon",src:fo,alt:""})],-1)),oL={class:"setter-item"},lL=ri(()=>l.createElementVNode("div",{class:"setter-item-title"},"麦克风",-1)),cL={class:"setter-item-content"},uL={class:"setter-item-tool"},dL={class:"setter-item-show"},hL=ri(()=>l.createElementVNode("div",{class:"setter-item-show-title"},[l.createElementVNode("span",null,"输出等级"),l.createElementVNode("img",{class:"icon",src:fo,alt:""})],-1)),fL={class:"setter-item-show-outter"},pL={class:"setter-item-show-split-layer"},mL={class:"setter-item-control"},gL=ri(()=>l.createElementVNode("div",{class:"setter-item-show-title"},[l.createElementVNode("span",null,"输出等级"),l.createElementVNode("img",{class:"icon",src:fo,alt:""})],-1)),vL={key:1,class:"setter-content"},yL={class:"meeting-ordinary-setter"},bL=[ri(()=>l.createElementVNode("div",{class:"meeting-ordinary-setter-item-check"},null,-1)),ri(()=>l.createElementVNode("span",{class:"meeting-ordinary-setter-item-name"},"语音激励",-1))],_L=[ri(()=>l.createElementVNode("div",{class:"meeting-ordinary-setter-item-check"},null,-1)),ri(()=>l.createElementVNode("span",{class:"meeting-ordinary-setter-item-name"},"自动接听",-1))],kL={style:{display:"flex","align-items":"center",height:"32px",width:"100%"}},TL=ri(()=>l.createElementVNode("span",{class:"meeting-ordinary-setter-item-name"},"画面轮询",-1)),SL={key:0,style:{display:"flex","align-items":"center","margin-top":"10px"}},CL=ri(()=>l.createElementVNode("span",{style:{"white-space":"nowrap","margin-right":"15px"}},"轮询间隔:",-1)),xL={key:1,style:{"margin-left":"5px"}},EL={key:2,class:"setter-content",style:{padding:"6px 12px 24px"}},wL=ri(()=>l.createElementVNode("div",{class:"camera-setter"},[l.createElementVNode("video",{id:"camera-setter-video-ele",class:"camera-setter-video",muted:"",autoplay:""})],-1)),DL={class:"camera-setter-foot"},BC="hx_device_setter_settings",dg=Mt({__name:"DeviceSetter",setup(i){const e=new wn,t=()=>{console.log("关闭按钮被点击"),o.value=!1},n=l.ref(!1),r=()=>{n.value=!!(document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)},s=()=>{["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"].forEach(ue=>{document.addEventListener(ue,r)})},a=()=>{["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"].forEach(ue=>{document.removeEventListener(ue,r)})},o=l.ref(!1),c=l.ref(0),u=l.ref(""),d=l.ref("0%"),h=l.ref(100),b=l.ref(""),v=l.ref("0%"),y=l.ref(100),p=l.ref([]),f=l.ref(""),m=[{id:0,name:"音频设置"},{id:1,name:"视频设置"},{id:2,name:"通用设置"}],_=l.ref([]),k=l.ref([]),D=l.ref([]),E=l.ref(!1),A=l.ref(!1),w=l.ref(!1),N=l.ref(5),S=l.ref(5),P=[{value:5,label:"5秒"},{value:10,label:"10秒"},{value:15,label:"15秒"},{value:"custom",label:"自定义"}],F=async()=>{var ae,ue,Be;try{const{audioDevices:Ie,videoDevices:tt,outputDevices:ze}=await sg.getDeviceList(),Se=ze&&((ae=ze[0])!=null&&ae.label)?ze[0].label:"扬声器",Ve=Ie&&((ue=Ie[0])!=null&&ue.label)?Ie[0].label:"麦克风",ke=tt&&((Be=tt[0])!=null&&Be.label)?tt[0].label:"摄像头";k.value=[{label:`默认 - ${Se}`,value:"default"}].concat(ze.map(Me=>({label:Me.label,value:Me.deviceId}))),_.value=[{label:`默认 - ${Ve}`,value:"default"}].concat(Ie.map(Me=>({label:Me.label,value:Me.deviceId}))),D.value=[{label:`默认 - ${ke}`,value:"default"}].concat(tt.map(Me=>({label:Me.label,value:Me.deviceId})))}catch(Ie){console.error(Ie)}};function V(){try{const ae=localStorage.getItem(BC);if(!ae)return;const ue=JSON.parse(ae);if(typeof ue.isVoiceMotivationOpen=="boolean"&&(E.value=ue.isVoiceMotivationOpen),typeof ue.isAutoPolling=="boolean"&&(A.value=ue.isAutoPolling),typeof ue.isAutoAnswer=="boolean"&&(w.value=ue.isAutoAnswer),typeof ue.pollingIntervalMs=="number"){const Be=ue.pollingIntervalMs/1e3;N.value=Be,S.value=[5,10,15].includes(Be)?Be:"custom"}}catch(ae){console.warn("loadPersistedSettings err",ae)}}function J(){try{const ae={isVoiceMotivationOpen:E.value,isAutoPolling:A.value,isAutoAnswer:w.value,pollingIntervalMs:(S.value==="custom"?N.value:S.value)*1e3};localStorage.setItem(BC,JSON.stringify(ae))}catch(ae){console.warn("persistSettings err",ae)}}const ie=()=>{E.value=!E.value,ut.emit("voiceMotivationChange",E.value)},X=()=>{w.value=!w.value,ut.emit("autoAnswerChange",w.value)},H=()=>{A.value=!A.value,ut.emit("autoPollingToggle",A.value)},$=ae=>{ae!=="custom"&&(N.value=ae,ut.emit("pollingIntervalChange",ae*1e3))},j=ae=>{ut.emit("pollingIntervalChange",Number(ae)*1e3)},B=()=>{let ae=parseInt(N.value);(isNaN(ae)||ae<5)&&(ae=5),ae>300&&(ae=300),N.value=ae,ut.emit("pollingIntervalChange",ae*1e3)},{microVolumn:q,isMicroDetectStart:z,startmicroVolumnCheck:oe,stopmicroVolumnCheck:we,setMicroOutputVolumn:be}=$R(),{outputVolumn:Z,isOutputDetectStart:_e,startOutputVolumeCheck:Te,stopOutputVolumeCheck:Ue,setOutputVolumn:We}=qR(),pe=()=>{_e.value&&Ue(),z.value?we():b.value?oe(void 0,void 0,b.value,u.value,y.value/100):e.message("error","请先选择要检测的麦克风")},Ne=()=>{z.value&&we(),_e.value?Ue():Te(void 0,void 0,"audio-detect-player",u.value,h.value/100)};l.watch([E,A,w,S,N],()=>{J()});const nt=async()=>{try{let ae=null;if(!f.value||f.value==="default"){ae=await navigator.mediaDevices.getUserMedia({video:!0});const ue=document.getElementById("camera-setter-video-ele");p.value=ae.getTracks(),ue&&(ue.srcObject=ae);return}try{ae=await navigator.mediaDevices.getUserMedia({video:{deviceId:f.value}});const ue=document.getElementById("camera-setter-video-ele");p.value=ae.getTracks(),ue&&(ue.srcObject=ae);return}catch(ue){console.warn("指定视频设备启动失败,回退默认摄像头",ue),ae=await navigator.mediaDevices.getUserMedia({video:!0});const Be=document.getElementById("camera-setter-video-ele");p.value=ae.getTracks(),Be&&(Be.srcObject=ae);return}}catch(ae){console.error("初始化视频流失败:",ae);try{console.log("尝试使用默认视频设备");const ue=await navigator.mediaDevices.getUserMedia({video:!0}),Be=document.getElementById("camera-setter-video-ele");p.value=ue.getTracks(),Be&&(Be.srcObject=ue)}catch(ue){console.error("使用默认设备也失败:",ue),console.log("无法启动任何视频设备,但设置界面仍可正常使用")}}},le=()=>{console.log("allTracks",p.value),p.value.length>0&&p.value.forEach(ae=>{ae.stop()})},Ke=()=>{let ae=document.querySelector("#camera-setter-video-ele");ae&&(ae.pause(),ae.srcObject=null,ae.src=""),le()};return ut.on("getDeviceSetter",async ae=>{var Ie,tt,ze;o.value=!0,c.value=ae.type,await F(),V();const ue=window.liveClient||{},Be=(ae==null?void 0:ae.tempActive)||(ue==null?void 0:ue.activeDevice)||{};if(u.value=(Be==null?void 0:Be.audioOutputDevice)||((Ie=ue==null?void 0:ue.activeDevice)==null?void 0:Ie.audioOutputDevice)||u.value||"default",b.value=(Be==null?void 0:Be.audioInputDevice)||((tt=ue==null?void 0:ue.activeDevice)==null?void 0:tt.audioInputDevice)||b.value||"default",f.value=(Be==null?void 0:Be.videoDevice)||((ze=ue==null?void 0:ue.activeDevice)==null?void 0:ze.videoInputDevice)||f.value||"default",f.value)try{if((await navigator.mediaDevices.enumerateDevices()).filter(Me=>Me.kind==="videoinput").some(Me=>Me.deviceId===f.value))console.log("找到可用视频设备,初始化视频流"),nt();else{console.log("存储的视频设备ID无效,尝试回退并初始化默认视频流"),f.value="";try{await nt()}catch(Me){console.warn("回退默认视频流失败",Me)}}}catch{console.log("无法枚举设备,跳过视频流初始化"),f.value=""}else console.log("没有视频设备或设备ID无效,但设置界面已打开")}),l.watch(()=>b.value,ae=>{ae&&b.value&&we()}),l.watch(()=>y.value,ae=>{be(ae/100)}),l.watch(()=>q.value,ae=>{v.value=ae>50?"100%":(ae/50).toFixed(2)*100+"%"}),l.watch(()=>h.value,ae=>{We(ae/100)}),l.watch(()=>Z.value,ae=>{d.value=ae>24?"100%":(ae/24).toFixed(2)*100+"%"}),l.watch(()=>u.value,ae=>{_e.value&&Ue()}),l.watch(()=>c.value,async()=>{if(z.value&&we(),_e.value&&Ue(),Ke(),f.value)try{(await navigator.mediaDevices.enumerateDevices()).filter(Ie=>Ie.kind==="videoinput").some(Ie=>Ie.deviceId===f.value)?(console.log("切换标签页:找到可用视频设备,初始化视频流"),nt()):(console.log("切换标签页:存储的视频设备ID无效,跳过视频流初始化"),f.value="")}catch{console.log("切换标签页:无法枚举设备,跳过视频流初始化"),f.value=""}else console.log("切换标签页:没有视频设备,跳过视频流初始化")}),l.watch(()=>f.value,ae=>{ut.emit("setterVideoDeviceChange",ae)}),l.watch(()=>o.value,async ae=>{ae||(await l.nextTick(),Ke())}),l.onMounted(()=>{r(),s()}),l.onUnmounted(()=>{a()}),(ae,ue)=>{const Be=l.resolveComponent("el-icon"),Ie=l.resolveComponent("el-option"),tt=l.resolveComponent("el-select"),ze=l.resolveComponent("el-slider"),Se=l.resolveComponent("el-radio"),Ve=l.resolveComponent("el-radio-group"),ke=l.resolveComponent("el-input"),Me=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",zR,[l.createVNode(Me,{modelValue:o.value,"onUpdate:modelValue":ue[8]||(ue[8]=Pe=>o.value=Pe),"show-close":!1,class:"addresslogClass2",width:"588px","append-to-body":!n.value,style:{background:"#252e3d",height:"560px"}},{header:l.withCtx(()=>[l.createElementVNode("div",GR,[l.createElementVNode("div",WR,[(l.openBlock(),l.createElementBlock(l.Fragment,null,l.renderList(m,Pe=>l.createElementVNode("div",{key:Pe.id,class:l.normalizeClass(["tabItem",c.value==Pe.id?"activeBorder":""]),onClick:it=>c.value=Pe.id},l.toDisplayString(Pe.name),11,KR)),64))]),l.createElementVNode("div",{onClick:l.withModifiers(t,["stop"]),style:{cursor:"pointer",padding:"4px"}},[l.createVNode(Be,{size:24,style:{color:"#fff"}},{default:l.withCtx(()=>[l.createVNode(l.unref(Sh))]),_:1})])])]),default:l.withCtx(()=>[XR,c.value===0?(l.openBlock(),l.createElementBlock("div",YR,[l.createElementVNode("div",JR,[QR,l.createElementVNode("div",ZR,[l.createElementVNode("div",eL,[l.createVNode(tt,{modelValue:u.value,"onUpdate:modelValue":ue[0]||(ue[0]=Pe=>u.value=Pe)},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(k.value,Pe=>(l.openBlock(),l.createBlock(Ie,{key:Pe.value,label:Pe.label,value:Pe.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),l.createElementVNode("div",{class:"detect-btn",onClick:Ne},l.toDisplayString(l.unref(_e)?"停止监测":"扬声器监测"),1)]),l.createElementVNode("div",tL,[nL,l.createElementVNode("div",iL,[l.createElementVNode("div",rL,[(l.openBlock(),l.createElementBlock(l.Fragment,null,l.renderList(9,Pe=>l.createElementVNode("div",{class:"setter-item-show-split",key:Pe})),64))]),l.createElementVNode("div",{class:"setter-item-show-inner",style:l.normalizeStyle({width:d.value})},null,4)])]),l.createElementVNode("div",sL,[aL,l.createVNode(ze,{modelValue:h.value,"onUpdate:modelValue":ue[1]||(ue[1]=Pe=>h.value=Pe)},null,8,["modelValue"])])])]),l.createElementVNode("div",oL,[lL,l.createElementVNode("div",cL,[l.createElementVNode("div",uL,[l.createVNode(tt,{modelValue:b.value,"onUpdate:modelValue":ue[2]||(ue[2]=Pe=>b.value=Pe)},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(_.value,Pe=>(l.openBlock(),l.createBlock(Ie,{key:Pe.value,label:Pe.label,value:Pe.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"]),l.createElementVNode("div",{class:"detect-btn",onClick:pe},l.toDisplayString(l.unref(z)?"停止监测":"开始监测"),1)]),l.createElementVNode("div",dL,[hL,l.createElementVNode("div",fL,[l.createElementVNode("div",pL,[(l.openBlock(),l.createElementBlock(l.Fragment,null,l.renderList(9,Pe=>l.createElementVNode("div",{class:"setter-item-show-split",key:Pe})),64))]),l.createElementVNode("div",{class:"setter-item-show-inner",style:l.normalizeStyle({width:v.value})},null,4)])]),l.createElementVNode("div",mL,[gL,l.createVNode(ze,{modelValue:y.value,"onUpdate:modelValue":ue[3]||(ue[3]=Pe=>y.value=Pe)},null,8,["modelValue"])])])])])):c.value===2?(l.openBlock(),l.createElementBlock("div",vL,[l.createElementVNode("div",yL,[l.createElementVNode("div",{class:l.normalizeClass(["meeting-ordinary-setter-item",{"meeting-ordinary-setter-item-checked":E.value}]),onClick:ie},bL,2),l.createElementVNode("div",{class:l.normalizeClass(["meeting-ordinary-setter-item",{"meeting-ordinary-setter-item-checked":w.value}]),onClick:X},_L,2),l.createElementVNode("div",{class:l.normalizeClass(["meeting-ordinary-setter-item",{"meeting-ordinary-setter-item-checked":A.value}]),style:{"flex-direction":"column","align-items":"start",height:"auto"},onClick:ue[6]||(ue[6]=l.withModifiers(()=>{},["stop"]))},[l.createElementVNode("div",kL,[l.createElementVNode("div",{class:"meeting-ordinary-setter-item-check",onClick:l.withModifiers(H,["stop"])}),TL]),A.value?(l.openBlock(),l.createElementBlock("div",SL,[CL,l.createVNode(Ve,{modelValue:S.value,"onUpdate:modelValue":ue[4]||(ue[4]=Pe=>S.value=Pe),onChange:$},{default:l.withCtx(()=>[(l.openBlock(),l.createElementBlock(l.Fragment,null,l.renderList(P,Pe=>l.createVNode(Se,{key:Pe.value,value:Pe.value},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(Pe.label),1)]),_:2},1032,["value"])),64))]),_:1},8,["modelValue"]),S.value==="custom"?(l.openBlock(),l.createBlock(ke,{key:0,modelValue:N.value,"onUpdate:modelValue":ue[5]||(ue[5]=Pe=>N.value=Pe),type:"number",min:5,max:300,style:{width:"80px","margin-left":"10px"},onChange:j,onBlur:B},null,8,["modelValue"])):l.createCommentVNode("",!0),S.value==="custom"?(l.openBlock(),l.createElementBlock("span",xL,"秒")):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0)],2)])])):c.value===1?(l.openBlock(),l.createElementBlock("div",EL,[wL,l.createElementVNode("div",DL,[l.createVNode(tt,{style:{width:"100%"},modelValue:f.value,"onUpdate:modelValue":ue[7]||(ue[7]=Pe=>f.value=Pe)},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(D.value,Pe=>(l.openBlock(),l.createBlock(Ie,{key:Pe.value,label:Pe.label,value:Pe.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])])])):l.createCommentVNode("",!0)]),_:1},8,["modelValue","append-to-body"])])}}},[["__scopeId","data-v-c01a99c7"]]),Hl=i=>(l.pushScopeId("data-v-f9043ed7"),i=i(),l.popScopeId(),i),AL={class:"dialog"},IL={class:"dialog-head"},NL={class:"dialog-contain"},PL={class:"video-contain"},OL=Hl(()=>l.createElementVNode("div",{class:"avatar"},null,-1)),ML={id:"video-ele",class:"video-ele",muted:"",autoplay:""},RL=[Hl(()=>l.createElementVNode("img",{class:"mirror-switch-icon",src:JO},null,-1)),Hl(()=>l.createElementVNode("span",null,"镜像",-1))],LL={class:"tool-bar"},BL={class:"tool-bar-group"},UL={class:"imgsf"},FL=Hl(()=>l.createElementVNode("div",{class:"xian"},null,-1)),VL={class:"imgsf"},jL=Hl(()=>l.createElementVNode("div",{class:"xian"},null,-1)),$L={class:"imgsf"},UC=Mt({__name:"MeetingReadyDialog",props:{dialogType:{type:String,default:"launch"},tempRoomNum:{type:String,default:""},meetingTitle:{type:String,default:"调度会议"}},emits:["close","launchMeeting","joinMeeting"],setup(i,{emit:e}){const t=new wn,n=e,r=i,s=l.ref(""),a=l.ref(""),o=l.ref(!0),c=l.ref(!0),u=l.ref(null),d=l.ref(!1),h=l.ref(!1),b=l.ref([]),v=l.ref(!1),y=l.ref([]),p=l.ref([]),f=l.ref([]),m=l.reactive({audioInputDevice:"",audioOutputDevice:"",videoDevice:""}),_=l.ref(!1);l.watch(()=>o.value,async j=>{let B=null;j?B={audio:m!=null&&m.audioInputDevice?{deviceId:m.audioInputDevice}:!0,video:m!=null&&m.videoDevice?{deviceId:m.videoDevice}:{facingMode:u}}:B={audio:m!=null&&m.audioInputDevice?{deviceId:m.audioInputDevice}:!0,video:!1},await P(B)});function k(){if(s.value==""){t.message("error","会议名称不能为空");return}else if(s.value.length>10){t.message("error","会议名称不能超过10个字符");return}n("launchMeeting",{roomName:s.value,cameraStatus:o.value,microphoneStatus:c.value,audioInputDevice:m.audioInputDevice,audioOutputDevice:m.audioOutputDevice,videoDevice:m.videoDevice}),n("close")}function D(){if(a.value==""){t.message("error","会议名称不能为空");return}n("joinMeeting",{roomNum:a.value,cameraStatus:o.value,microphoneStatus:c.value,audioInputDevice:m.audioInputDevice,audioOutputDevice:m.audioOutputDevice,videoDevice:m.videoDevice}),n("close")}async function E(){try{if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices){console.warn("浏览器不支持 enumerateDevices 或 mediaDevices 为 undefined"),t.message("warning","浏览器不支持设备枚举或未授权访问,请检查浏览器或使用兼容的浏览器"),y.value=[],f.value=[],p.value=[];return}const{audioDevices:j,videoDevices:B,outputDevices:q}=await sg.getDeviceList();y.value=j.map(z=>({label:z.label,value:z.deviceId})),f.value=B.map(z=>({label:z.label,value:z.deviceId})),p.value=q.map(z=>({label:z.label,value:z.deviceId}))}catch(j){console.error(j),t.message("error","获取设备列表失败")}}function A(){c.value=!c.value}function w(){o.value=!o.value}function N(){b.value.length>0&&b.value.forEach(j=>{j.stop()})}function S(j){let B=j==null?void 0:j.getVideoTracks(),q=j==null?void 0:j.getAudioTracks();if(B&&B.length>0){let z=B[0].getCapabilities();m.videoDevice=z.deviceId,u.value=z.facingMode[0]}if(q&&q.length>0){let z=q[0].getCapabilities();m.audioInputDevice=z.deviceId}}async function P(j){try{if(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia)throw new Error("当前环境不支持媒体设备访问 (getUserMedia 不可用)");const B=await navigator.mediaDevices.getUserMedia(j);let q=document.querySelector("#video-ele");N(),q&&(b.value=B.getTracks(),S(B),q.srcObject=B,q.onloadedmetadata=function(z){q.play()})}catch(B){throw new Error(B)}}function F(){let j=document.querySelector("#video-ele");j&&(j.pause(),j.srcObject=null,j.src=""),N()}async function V(){u.value="user";const j={audio:c.value,video:o.value?{facingMode:u.value}:o.value};if(!navigator.mediaDevices||!navigator.mediaDevices.getUserMedia){console.warn("跳过视频流初始化:getUserMedia 不可用");return}await P(j)}async function J(j){if(j&&j!==(m==null?void 0:m.audioInputDevice)){let B={audio:c.value?{deviceId:j}:!0,video:o.value?m!=null&&m.videoDevice?{deviceId:m.videoDevice}:{facingMode:u.value}:o.value};await P(B)}}function ie(j){j&&j!==m.audioOutputDevice&&(m.audioOutputDevice=j)}async function X(j){if(j&&j!==m.videoDevice){let B={audio:m!=null&&m.audioInputDevice?{deviceId:m.audioInputDevice}:!0,video:o.value?{deviceId:j}:o.value};await P(B)}}async function H(){v.value=!v.value,await l.nextTick();let j=document.getElementById("video-ele");j&&(v.value?j.style.transform="rotateY(180deg)":j.style.transform="rotateY(0deg)")}l.onMounted(async()=>{await E(),await V(),r.dialogType==="join"&&(a.value=r.tempRoomNum),s.value=r.meetingTitle}),l.onBeforeUnmount(()=>{F()});async function $(){_.value||(_.value=!0,await l.nextTick()),ut.emit("getDeviceSetter",{type:0,tempActive:m})}return(j,B)=>{const q=l.resolveComponent("el-input");return l.openBlock(),l.createElementBlock("div",{class:"mask",onClick:B[7]||(B[7]=l.withModifiers(z=>n("close"),["self"]))},[l.createElementVNode("div",AL,[l.createElementVNode("div",IL,[i.dialogType==="launch"?(l.openBlock(),l.createBlock(q,{key:0,class:"search-input",modelValue:s.value,"onUpdate:modelValue":B[0]||(B[0]=z=>s.value=z),placeholder:"请输入会议名称"},null,8,["modelValue"])):(l.openBlock(),l.createBlock(q,{key:1,class:"search-input",modelValue:a.value,"onUpdate:modelValue":B[1]||(B[1]=z=>a.value=z),placeholder:"请输入会议ID"},null,8,["modelValue"])),l.createElementVNode("div",{class:"close-icon",onClick:B[2]||(B[2]=z=>n("close"))})]),l.createElementVNode("div",NL,[l.createElementVNode("div",PL,[OL,l.withDirectives(l.createElementVNode("video",ML,null,512),[[l.vShow,o.value]]),l.createElementVNode("div",{class:"mirror-switch",onClick:H},RL)]),l.createElementVNode("div",LL,[l.createElementVNode("div",BL,[l.createElementVNode("div",UL,[l.createElementVNode("div",{class:l.normalizeClass(["img-icon",c.value?"img-icon-mic-on":"img-icon-mic-off"]),onClick:A},null,2),FL,l.createElementVNode("img",{src:N_,alt:"",onClick:B[3]||(B[3]=z=>d.value=!d.value)}),d.value?(l.openBlock(),l.createBlock($l,{key:0,dialogType:"audio",audioDevices:y.value,outputDevices:p.value,activeDevice:m,onClose:B[4]||(B[4]=z=>d.value=!1),onChooseAudioInputDevice:J,onChooseAudioOutputDevice:ie},null,8,["audioDevices","outputDevices","activeDevice"])):l.createCommentVNode("",!0)]),l.createElementVNode("div",VL,[l.createElementVNode("div",{class:l.normalizeClass(["img-icon",o.value?"img-icon-cam-on":"img-icon-cam-off"]),onClick:w},null,2),jL,l.createElementVNode("img",{src:N_,alt:"",onClick:B[5]||(B[5]=z=>h.value=!h.value)}),h.value?(l.openBlock(),l.createBlock($l,{key:0,dialogType:"video",videoDevices:f.value,activeDevice:m,onClose:B[6]||(B[6]=z=>h.value=!1),onChooseVideoDevice:X},null,8,["videoDevices","activeDevice"])):l.createCommentVNode("",!0)]),l.createElementVNode("div",$L,[l.createElementVNode("img",{src:P_,alt:"",onClick:$,class:"set"}),_.value?(l.openBlock(),l.createBlock(dg,{key:0,tempActiveDevice:m},null,8,["tempActiveDevice"])):l.createCommentVNode("",!0)])]),i.dialogType==="launch"?(l.openBlock(),l.createElementBlock("div",{key:0,class:"tool-bar-btn",onClick:k}," 发起会议 ")):(l.openBlock(),l.createElementBlock("div",{key:1,class:"tool-bar-btn",onClick:D},"加入会议"))])])])])}}},[["__scopeId","data-v-f9043ed7"]]),HL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABMAAAASCAYAAAC5DOVpAAAAAXNSR0IArs4c6QAAASZJREFUOE/Vky1PA0EQht/ZEhJCA8E0KBSWf0AQFagqCPwExCU9cjkOe1Mk10K4DRBMEdRgcXiw/IJ6FArZ3g65a67ZUkJWFALrdj6eyXy8hBk+miELYxgzz7+9S4+IakUBEYOKuk1P4zu74OERawE2SpsQ3eskvs7/Y5gX8eqc4JVAB4ZkkDuzIZ6uzrlvw5oh70BhqUgWaQhUTbfjrS9haZudW/ejVlMEez8LC4JgYaiWe7rDu65L8cN4U0B13eGTiTZdAd/FOc/Hpdg/gHkeVyuL0tVJa9+lpTymWICiuk4+LaA82r93Z5acjg1kQERZBnm+TPhlQpsRN4xgfWSjbQDVKQWMhI4bIqyUyWTQvTjjBxvmh5yCsGYJ/XFK6K5D/7Wj/QBDX4YTWE81agAAAABJRU5ErkJggg==",FC="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAUCAYAAABiS3YzAAAAAXNSR0IArs4c6QAAAqBJREFUOE+lU0FoE0EUfX+TaFrjwZKDBxXMqZBDxVu9tEgVsYqCGujBg6dCS5VikaCklCCKYlEsVkF62ChSNiii5lKkQQXFU/FUsFLSi1KMklJEaZr5dnZ3NrPNBg/OZXZmZ968/977BG2MFTm88AUjYJwAIaL/AwMgd4eRMQilGuN8lZHO99OKflYds/f6HnIfCVxU9+UsB9XBJDYbhFGjilItgkcQWIbA0JMBWlTAftAHbAlGwscwYBEOIUNVLFQNTNuPAqv4g3PTw1Ry1/VbqUm2gH+DgvHKGqSxM5M8bgAxiSCAQn6AXjSAnr5XB9UqdiQAbFntiUFCIB3aiWI+RbXNxfjKPzXBFuvlGwAxmMmzyH9fADA888xnQzTRwPTkXbaIkbCNUtQIYHbWcg4cZLPPPb8QBHqHLZCjaU8S8R0tiCiOzM4XSQB3fFxEZamM3+6+GQh6/Laj6e42RPu7Ofl9tc5L10lFblcb8eWnmFtbtx8yXw4HMO0dZ2ujjEQsitBgD9q3hjnqwWpOqeyWyvQj9x4ldrQ1C0GgR29tipS/i2RslC9SjDp5BhMhVxgJYHrkJlus5dQXDc04O1fSPG+y42bOXAoAPXzDKV/S2b8H8W1RRGQmocxR3+78+RsqyyuOUVLTmXQA6KHrbDFhbzyGlt4OJH+tuYnX9JTuqyRsb4V4/A6f1gUEC5ivrwSAHrzmMI1GEDq2D+1bIogqEIMAoeVUvvO1gnJxHktun5mzQaDdV9naEDwhHfE8Uh2jd4/b7E7PAiQ7T8CczQQw7cryFIAOFaNmXaT2fSkjTL3J0P2GNu3Kcqdg2P3bMCSC0EzbdIAMnH2bofkGULlxIMudIYEUA61NOt3TRmpsEH7WDFgfRmnOq7Dpxf/48RdZkAok9Jke3QAAAABJRU5ErkJggg==",qL="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAI0AAACMCAYAAABBAioAAAAAAXNSR0IArs4c6QAAIABJREFUeF7kfQecVNX59vOee6fubC/AwrK7dEFFBAUBBUSjYk/UxGhiD3bRGP92sEWNvRAssSSaBvbewSiKCCooCNKWtuzC9tmdeu95vz13ZpbZZXfnzoIl+U4yvx28p99n3vP2Q/j/uDAz1QC99Sh6Owi9iOBmIAeEnHbbwmhQ/yagwZCoYhPVfjeqSoiC/z9uH/3/sOgW5mLDNPfTSNsXQG9muCwQkAwBogqMKtLQIA00ko6GaBRwO2JACUWR43AAbCCHdLhgonccVL2llEIIYfXFkE3E/K2haYuzgfVExP+re/s/BxpFPRqj0dFCcxzCLPcRJIIMWaEJ8a0AlnmINn0fL9PPXMTAUJLYD1IOgIAbwA5Tyv9k6/oCIjK+j3F/jD7/J0CzgznTDRwppTwUgASwEkK8nU209sfY1MSYfuZCmOYhkmiyAEwA66JCvJz3PQH3h1rrfy1omNnRCPwc0jyeGTXE/FKOw/HBD7VxPRnHzzzCkPJkMJcJjb4MIvDP3pS5vSd9/Zht/utAUxcO7026OBMQLgjxQi7R/B9zA3s6dm04PELTxekE6m0w3szTtOeJSFGjn3z5rwANM2t1ZuQEQdoxgPyiRjgeG0wU/snvrs0J1rNxHKQ8iUHfhIT+cDFRwGbTH6XaTxo0a5hd+YieC2Asm/xyvu56/kfZpR9o0CbmoYaMXipBWyGify0g79YfaOi0hvlJgoaZ9VoZvZAEhsso/lLodC5Ja1X/5ZUbOTQ4KjEDQtuWD/0+Imr5KS3pJweaGg4fz8ApgPhLITn+K/mVPfWCt4dCg+HAZZoQa/LgmP1TEdt/MqDZzqFBAnQNgPkF5Hp2T238/0I/tRwYb0ptuhD8TAG53/ux1/Sjg4aZnTUIX8ySCyHctxURNX/fm7KZOc9pYChLs0wIrVRpiSXL3kQim5k9BMpOzEFtkAQ3gtFAxA0gUSUYVSabVWFoyx1OVPxQjOs2s+UiEmJkFJGrSyi77vvep676/1FBU83N+4LFDUy4uzd5P/s+NmELc77DxCTDNMZpgkYCYiyDFSjqmVEB5o2CqIIIDcyigWE2akJj9Vep42TcDkWgHGZll+JSQaKXZC4jQhkDHmZsgqDPBPNXJuSHxbq+6PsSn7fzdp9E5gMC/HYReed+H3uWqs8fBTRLeImjL4ZfxtLMqhe+W0cQRVJN1O5zZhZbDWMKmI8iop8B2JuZNxCwiIDPTJOWZbj1r/KIGu322V29Sub+HDb3Ew4ayVKOk8A4MDIAfEyaeIuFeKUf0Xd7YqzkPqo4+GsGT4ggcn0p5dTv6f676+8HB80WbsrXoN0FiGf6kGePMLrK3rTJMKYyyzOJ6Fi1KGZ+VQjtLRGJfNjX6938Q27qunB4HyfRZEk4noDJBKyCoGeiwnxpALlX76m5VHNogAl5q0T4T/0o96s91W+qfn5Q0GzhxnECjoujiFyyJ34dG5lzpRG6hIh+B8AHYC4x/7vU4Xk/1cJ/qOdrmLN0M3K0YPxKQh4DovcI/NdSzT2PiKJ7Yh5bufkOgraumDyP74n+UvXxg4FmGzefyaABxZRxY6pJpXq+hv0jhKnNBHASgd4liKcMzfniT11LXMlcEJahc5n5EgnKBMs7ocvHB+0B+9NW9v8SwMHF8F2+p8D4ozHCyrC4FYGbAP62H/meSQWI7p6vZf/ezGImmI4D8xMs+bEhTt8PRpZ3Z+4d266NNh/JRNcz8b4EPOYQdE8ZZWzbnTG2cXiECWOmBu9FfYh27E5fPxpPs4HZ7UDL7YCc24+yPu3pIr7lYBmxcTeYjmXmx0kTfxxGGZU97e+n1O67aPNhTDwThJEM3JUlfPfsjgi/getzHHA96IS8qoh8Vd/HWr+346meOacFLQ+a4DtLKXNFTya/rKoqQy/03EygGQT8jULadcMy/jfA0nE/VkQbppImbgNjuGS+eIf2xT+m0JQeOW5VcVWGiawnTZi39KfMb3qy9z84pdnIDbk6nE8K0OV9yFPRk0kv5/oTBOPPAFUy4fx9KOf/C/vTCqP+bBZ0HwNLo8Rn7U+5G3uyf4ot2MKBf4N4Zgn5vu5JHz8YT5MAjKIOxeRJe8GrmDNDsn6OIMW30JX7ajmP7ckF/zf0tYLZZ8j6e0E4zWR5ZaPIf3xKD9xF48D5F4hn7Ung7NHjaTNv9hDn/1UQ/aEngPk8umOy0OifBPpCBuW5YzIKd4sx/G8ASHdz/Irrp0g2/07Aaic5fjGiB6aDmCAS/Ccgru1H7j2iZNxjoFnB7MySgXs1oc8uJte36byw+cy6D7VXETBTgK/ZnwrvTaf9nqq7gTkHIeREzfYhLA4NDXCjoZzIilD4IcsK3u4LAU8z6AgJHHMgFX6Y7vhLmB29ZfCZqJAzyvcAc7zHQLPJbJkthXy4jDLTAswSrsuWMJ5SjlYEceIBVLA43U1Jp77SHi8PREe5NO1AQO4FpqEAlQlCKbMVQWAFOO1S4gEpDGxklspetcGUtJiFXBV064vGfM/edou5+gKAHgTo6gNQoHxslAO97VLJ7GUZfFwKzyUlRLtl7NwjoNnMoYs10LZiSs+zbhHX9hOQrwHc3AIcOYWK9riFW4Hki3B4oJPoFGJMYmASIRb31H1JbE1y+JJloOi8GdHnDF5AQry8UtcXnfI9+Psu5poDmPltInpJoGL6GBqTlka5koP9TRPX99PcF9Nu2Pt2GzSbjZZpzDS8v8N7d6rXkPx8MW/fj5k+IKaXD9QKzkqnrZ26ixobBzvc+hkE+g0B/TshHfUArWKmZYK4AtAqWEaqYVIDNK39MWSaOdC0HM0hsqXk3iR5pATKQBgGcHnHvhncxMBzmpMeHQnPknSpQnfrW8y1JQC/zsw1TtJ/Popy0zoyt3JklCnNk/trnmvt7GNndXYLNJUcHmZIOaO/5jk/nQks5vr9mM0PiTH7QK2gx5PvOKbijTwR/9Eg+gMBE2J0ga3ThoFaAr2tPg6Hvmi/PcQULgnW9YdwjJUkJhHLI5h4kJqXGpWs0bEShL/W6tUPTKPBe8QZfj6v8Hm5SP3g3CycU8ZSVm06+7/FCP6WAVmie3rk7NZj0FRWVnplr9ynhHCflY4G8xOuOVBjvGsY8oYJzqIH01lsV3WVq0UgOuBcTdC1zOiXVK+JmP7FJJ+d6Mj7aE+MlaqPRaHGwaZGxzGbZ4Kwd6I+AU0GeI5Ld943jnzVqfpJ9XwFr3C2cK+3AeQz9QA4ZuBeFtpTJeRKW4fTY9BsMgN3a1HxeF+3fVP/p7xjf2KaTxKXjtUL/ppqY1I9n8tztTzz0FM14A4Afa36DGbgXZ3EU4foef9K1cf3+Xx+uG5vockrJeM0ALoieQo8TLgLwn/3FCoP7e74i4yauUzYyyEiU8ZQcY3d/mISVehvLuH+XSGR3247Va9HoNnE4RNIclGJ5rateFsU2TEamvhAgq8brxU8nM4kO6v7amTLSKfQHyVgbAwrkAKYR0wPHObo1WM71+7Oq7P2b3Btli7Nq5nlFQkmnAG/CXlBs9bnX7vDNM/lFc4Ss/f7IM5wCDFlDOXZdi6r4mB5ROKc/prn+nTWnTZoNjEXkwzdUaJ5fmt3ICUlQdJySH5ynCP/SrvtOqunNskjM2cJaMoJPUFb3oLkm452lnwvLqO7M9/ktm/wmiyWnqsBugqAZk2e8J4gPmsa9dvS03HUnvTn3p9AYoOu5f16TBp+OpvN0CUQ2tcl5Fhgd/z0QWOG5gjhuq0fka1FfsKNeZo0P2TQ4nFa7jl2J9ZZvZd443CA/glmlTJEEcrNgsSFx1G/13an3x+67atcOczk6EMMHBZn0v1EOPsEKn2up3NZxlUZQen8Gow3xul5F6fTzyYz+GS4ITBjcH5+k512aYFmoxE6Rmiidwk5/2Knc3VuRs2Gfyt+4yA91zpGelJm8SwxDL89WwBxzzQyCTx7G8yrLt1DEklP5rW7bZ7jDWcw+GGOeR2qH8EcYNvvT6HxPUqW9FloxxCpa59C4rqDnHmP2J3fNuayqBE6r7/Dc52dNrZBo0JknWboiVLdc7qdjlWdz8yG/zOlvDRDjwwZSb17FCX4KC9xZCL3fgIujI9bDRgnn0pDfxBpyO5ae1rvH7y6gKA9B9CkWB/8RQja1LOoPC39S2L8z4y6oxn0b2g0aRzlLLU7r41mcJYmtJf6kTOlU5tt0Gwyw9eygZdKXa6VdiayMFp/iADeM6UcNdGV3yN/mmd5TZaA/hKYp8TGlG9lkHHK8TQsLW7fznwTdb6NNh1EGm6U4HEA5xBolWA8NkRk3f99Zrf6h7nuj6A4r0NUK0AH/4rK0jLJJNawKFp/M4PPEbq+r10djlJbFJn7PLJOc05PZVG3BZrNzH3ZDF/TX3fbOisXsr+IDFM5/9w13pFzVzovLVH3Wa7NIm6aD8b+sURFfO9p2oA/9KQvu22WB5qvMGHeE2aGwUoxxxBEcBDBBbG4zpM5IdWG2h2rs3r/5HVnm1I8RIBXmVZYaGNPp1JbP9KO/X0SrVfK080HOXNtnwwbjdCxALlLdde87tZhCzQbo6H7he662a6ha2G04TkB5B3kyFGZqdIuc3lddtTQ5kNgFBgmES79tVb257Q7SqPBF35/YSSK7S2GRFBKRNkKg7FA4xYErybU56PRORmTvk+K8wxX7E+S5xMoC8wRlnLi6c6Bn6exFKvqf9hfqEfNb4XQpo/TM21n29hohJ+JaM5zu3PSTwmajeHwcNLx8/6a61Y7E/841HQcafw0dOeoCT1wwprLddlR6Z/PjFEEGEzyktO1cttMnZ05dlbn022Bz5qi8sCmiESLKRFR0ZUM6ALwaIRMh0CWU4AjXs+UctptpVx383wmUrE/CXoXQB6AZmlGD/qta1DabpufRprOZMj7hUMfalcLvSkaPYSIh5bozi7DYVKDJhJ6QDhcV9tJf/oRN+SKiPhGEN9xkDP7oXRf4Fze7gsb4f8AHAOM4It/o5U+mm4/6dZXUZnzK8JmXVCiPiTRHGWEDLZA41BUxgHkuARy3AK5Th4/ocz7vSsP/x5aN1jqjs/AyCWgmXUa9RsqSTuH4MJIw3vMtHWiK/sMu/uyyYg8EdYcF3ZFbboFzcZweAQJnNDf4brNzoALw/5bQXz4BGdW2uK1MjZujm5+lEBnE1ksxUW/cZbY1jjbmV9XdebOZc23T9SoaZGoCzCaQnHQSEBXVMYJ5HgJ+RkCOV4+6rBB7rd2Zzy7bf8aqRglIOYjlpBgrQjIA0/LKU0rBPfjlh3F5HCuZqJpEx1ZtiTO9dHgITppg/rrzic7m2u3oNkUDd9Feuh2OxkKFoYaBkKIlRwNT5iYUZi2E/gz0S1XMOMeNclWH5ibznCVzLK7uXui3qvLjIodzVxa18xoDDKCUUBKwKEDmS5CrpdQkAlkuPS8Y/altF7c7szvmeCmg1mj98DkBGF+iaPvz9JlxheGmu4AYdpWZ+YouyaLikj4yQ0O5+86G6tL0Kz1+4scLtd1pU7nZXYW/UnY/28G0wRX1il26ifXeTKwdbymYWHsv/ELZ7j6/SLdPnanvnLUWrJBXrRyCz1U62c0Bqyk07HjSQNUvtlcH1CYRaEJB1BB7x84M9VfI1vPBluKTQGBm85w9E3rB6WUrKGwv4IlzTjYm9mtZJTYx01G6DiG7izV9V201F2CZmM0ehXp+vP9idaleiEfBZsmkhDvsFMbdjB50kru/HfemGtEHJvAllb0O4+rfp9TaMQeyyLR2dwrK9mbnYfJTJgEiclE2JcB9+drgTXbgKYgEE4CTYZbHU/A0fsDLpW9HFgNhrJzLTDdeDl7N90nU+2vev50cMtfiUTM3sc4+AxP8cd22iXq/CfQeIkQ4saoy1c+xUYOIJXCbpMZnV2qO6d3HKdT0Cj+YqAZfby/7rTlUfdxqOUjZrnyYE/mLgN0t7BZzKIsuO05EJ2o9BJS0NizXX16pJdItYGKmrSEMVUyziDgZCS5fCpfCkVV1N8124ENNUAwspPSFPqAvfsBPpdKjR//tB/wPQb+nenG099XijNllAyEVGYI2gtANYdCw87KTU9r/HHIv4Yg7p3gzpiTar/U84po+HpIPF/mah8o0CloKqLRQ4WUhf1dLmU36rZ82NIyStN4UdQl+06hLNv+HNavp7lqKmuw0oEJgevOcPX+Y6rx0n2u0skGQjhbMm5goKSjh6/6N0vAZMCUbInahgm88C3DHwYmlgKD88kSvR0C0DSCFgdO8lysjSQ0EuHZgIFbevlotx2tOq71b+HKvaQUS61ESuA5Z3v6JEwrtrblo4D/UhLi6lyXt8xOTiCVlQORyIxSl0slW2grnYMmFHlIczmusiVmB5ufAOA92OM71dbM45UerF2T5fNkbSXAR8DiM7290pa4uhtPidHNYZxrSlwPRklXdYWIUZioCQSjEoEIEDKApz9m1DYDx+4HDC8meBwEjxNwaoCmyE03RT1ufbF3bvXgRjsvJ519e6Kl8jZBmuUiy2yMPjuj7xd22yveJhhs2QBB5x/szrDlGbAxEnlqvcNxXjJDvMvq1zFna1Hz9jKnnhLF8wOBfjpxhaDo0AnunJS8T/LinmrZoewjN4DQIgSPPNPdK6323W1UdQMPdDrxNzDGW5ubqJz4El+1YnIVYBRlCRuMlgjQFGYEwoxXlgL1LYzJw4HBvQg+F8HnJnh0wKmTdUypdlbpJEghjqsmAZyanUFv2H2xduo91VK9nkHlRFgaWbnpoOlj7Ecl/CfYfA2Bfn2wJ2MfO2OtD4dPJhb+crejTc2wC2gqwuFfa0JUljhSO+X8J9B8FROOmeTxHWJnAok6j9fW9hMuGc9OxU+c4ytSCaZ3uyjqUh/ABQAeVkjp7u4cXYu/awUaGQONojLNYQUexvpaoDnEGFJEyHIrUZusj0cnS6JSFEoNoNqmojoEPNHgxcXltGc0yU81Vx8uQW8BJEA87ZyMojftbt78pqYCzaFtMCQmH5qRkdIK/snmzZ7iXr1uKXM625zndgHNhkjkkTKHQ8XFdJuxQEVU1gSDGwm4/BCvNy1f3L807biXBF0OcE0owOUXFe1+vJNKa5LdgscZOF1RDwWYxOKSvyc2V4HG4mcUEyzVy1cKPSVqx/4qKmIyWxphpw64dYJbV9JTnKcRsf7bqE2coiWITvJfVVEQvmLCcfle2iOp3J7w1ywEYTyYtxv+aPn04mLbqfH/09LyEjNvnOTz2VKnVIQij29wOS5IHFHtQLNhwwY3+pY8UO7UU0pBHwWDE5n5ea/H0y8d98LZtbUlLicSYvmt52bm32D3V9JVvaoqznD48L5kjFUgsFO0+EtPAEcxwobJFm+jqIclTVmKEUDVVSBzKCZYMcNJu6badUvSEidYDDhNLDG2IItW2Zljd3WeaNgxhjX6zKI2LI87N6vwVbt9/icYnMSSn9cCLeUTCwtTuplsiBhnaqSt6+8gS6PcHjTR6GRI6lPu0v+ZagIfNgceIKLMQzI8Z6eqm/z88ca6W0FQHmJ1kZBRurtUhpl9tc1YLBl7WXjpjKx0MkG18GR+NkGdEuJ3rEmsM0vMVgDqIDUl2qQ1pkBYODA630U98jFqt5dNdUpXMwHgb87NzBuZTlDehy2BSmJx1iE+twqD6bas8XOhw2lcVuZyWA7o7UBTETVvphZxX2lO92py62hqCe2QoF9M8dnPoP1oXV22ENgKogwwP3ZeTl5KitbdapjZW9OC+abEgR0pTCe86S5ddQROqs1Lft4GmHQaxTdcaAi7TOydnb17l5g93tAwGsSWyUaQNv6cLPvZxhY0B/6mQDYpw3OmnSVsjBhzSp264hc7UJqIOafcqVkPuisLgsGDSeK5SRmeXqnqtv9l1B/Pkl4CWXxnnwtzep7/Vmksd/gx32RMtHUk2UWR2hR1NMWpi9V38k/L5vHX3b4oyiUIfjejLDt794LxH2tsUClmh7DkZ6bn5tqOEPnAH5ykEb3Ssm1z0bTBqSM/N4TN2x1OcXc/otq27VixfbvPk5V72wC3IyVzNN8fvJUEjZyc4T42HdA8WtewCILGEuOT3+VmT0inbce62/18W6vby7WKiU0WedvecRwku5xWnQAgUafjX9VvAjRWsySJrCPDm5hfZ9i0jsFkcZ8tTgQ64fMdmZi4O7qcR+rrbyISNxIhwkR9p2fZU7AqnU1zS2gbafrPJ3kc/0n1LipCxjRVp8ytv9G2hRVBnsLC7FXu0lNKQguaw99A0gOTs7p21Ok4iUcbGgaCheUPInQ6+bzMzB6Ha1TX80gp8JWpnEBTrfYn+jzBIylNeO8s6rEmfO6KFc764n4qmYGXGcedn5dlmyH+sDn0OkAfTfK5VIRqCr7GX6g7vReXu7SZbaBZHzKvFC7xfBnRhu5av9fc3EuHo8qQzoLDssh24PmcusbTCOJZEGrPz80sSDXJrp6rPCuiCVWGRKaScP6bi6JAShIzCUNKsmlNT9cyp65pIYHGtyoz3zk/P/MIu/0saA5dAYgTJvuctvRs60LGnIFu/YIk0BizB7j1i1INOL85eiRYPjwl02VlR7Bb5tQ2vwXCEQT85/w8Xzxcw27rnfWqGvhag6GOpm6pjB0WprPR246dxNHUxRR70n8np5QFGl3g697ZGNXTSzgeqW2+jAn3gxF1ymD+OTbEaLWsD/zhEYLoS1+GI8dOUqb1oRhGkkHz8AC3njLaYL4/fD1B7D850/Fzu6/80TrOlhyw4niIcdH5BRk9chJvbOS8ZkatUqi1U8R2lneoU+YiPuOuKFRHbWAHPqRtvR377qxdZ3U6GVdRG2UMFYQjinPoHbt7mlxvjt9fxGGxjUh1Q+PPz7fvjjq/KVJvwph2WFbqNhvC5o2GKZ60lqtcIUrD8r4Bbu2SVJP+oDH8Ngnx6ZRMh21HoNk1kQMIxmLLntziLbiwND3Pt/lcX6aZ8rC+4awjHGH9JKV860wdswsj281iOuJMVe2ufUcNs/UD2JW/7VFGBYva6Kjc4Ku/PSro4yk9uBzjzzUBlYRxMBGuvCDfa3lA2inzm6KfkqA/T/bpKbPJV4SNE0loTRZo1oR4oA4cU+6mB1INNN9vbBPg0yZl2r8De/aO0HSAVUTB+osKPQNTjZF4vpCrigxDn8PEP1dvdFBzgaWxtbSwPSz+lgi21wYtjW9Brhu5WTYyqXUy1vrNjQgbMat3v94+uNQXm2UXIkQxt4tNGfWIaiYE0wdRky84zF1oOxvn7B2BFwE6gRgLLyzyTLQ5FcxvijwCptCUbMeMVG3WNYf3IV0/xALN+hCre5HcA9z0SncNFzVzr4A0qyik9ZlSRLZTqD+8I/QqAccw8MHFhe6pqSannn8Y9u9lyPBig6TPgESWdKF/KMcCjXrh7bSSnXSowFG5I4iaFkZ9gFEfBGoCQFgK+LIzrQ6C/hZkijAOKndg30HZ3fdJQCQq8d6yRizfasKXlxufBCHYHIALUeR5gQxdojBTQ36mQFG2E/k57tQKY0VpCAi4wtjgaIAOAQcENNZ+O9mTm5ICqOXP3hH6fetNNHczc9RR6M6YbjNzxPuNkYsFiZ9PydJTxqgp+x6H5S3W3m+I8FnhSGTpMJ9reXcv9P3GyIEE8fah2XqunRefqPPQ9nA9ATkC+OOFRa6UQebvtOwoZlOsjkD6IixhgDGK86EbumUXalPmdUAOS8bHy2qwuoZQE9LhyfB0mGbXNoZsox5nHt5755mTpIhRXzdWNuPfnwfhzMzqvk+rnUI1IRwMQ4sGsV9/Fw7eOwtOxbyo0oniUB1Rilgt0bZbIHOQgJMEHJo+dqo3O2XG0weqwntrAlZWKx085Pwity1p7P2G6KEkxNxDszRbEu26kDnH2vZ1QfMmaYiHB2d2f3PH+03GsQS69dAsbaRd0Ny7mfMczqglmkuioy4r2umX0VUfb9Q2vBFh86gQSyjQKMI/US+yvOqU1NRZUVTg6Xer0CQ6vtSuRtlV1ZtlNuF3R8cSaiWXNRsbMe9LA053h6MsDREq2tKME/d3Y1h5TqcTUnYt5XLxlayDnw0LNG4LOFTlbWosn1KeOmvWQ9UR5VvtYKJDLi1y2ApXmV/L/ViXm0NGQ/Y0G6lG1gXMhxPH0wMD3GRDE8zTWZonHJqtH2UXNPfvCA3VTM2y6rIRLbm0n7fbvDYvVislINYGpYmQlIhIiWzNgXGu3Laox2SGVfVrmoxHXtuKJi0DpiCwskSbDM3cVSzvSkCKrYcRaWzC5H2zkOUmkCCsqQxidY0G3eFoW3LH8ePEo91zRU0MnSxzhDAZQgKhphbMOLYIeVnOXfpSUpTia6o5iGUhP5wiBhq3JuAS2iHHFKWOWXpwW2QjiPoz5KmX9XalVNImJvFBkwxpTPtMsqErWhcyVQYPYF2A7x3opStSAeH9BvN2gAZOzRG2w1Tur4xOFEQftVq2o5f21nfuVheDPbe58fQIy2cCpkTICo9l7JuRgTKXt42f6dj0q9W1eO3rhBtdDChRB8FwEkxdQGpk5VbzBEy4A914TaVBOZLnoPoO+HRE3AJaVEKYgGZIOMPSAm7yKZojgrjoxNJ2FnYLdHFKownGSzU1lh+PAoxHfXTxj1/0zVZ5+7otD1RFvyTQfgBdd2lvzbaW+f1GswqG/PnUfMcnqcZYF+RHrPVUhPjBMjddmqrBew3mbKUKmJpDKV1BE33dt804SoDeYGD7jD5atwbOjbU8/JvmloeqI8ahAUOBhhE2JX5enAeNhQWajoKTlIyZf/kWIqPtVuROl6F+8YEsHUGfjvxtIaSX77vrndlR6oWUEjk1UbiCO4Hb3V5efmwhcpKpTYwFsvQ1ytHr+co6mGC4dSvpALKcWt3EPN/xxVnUbdjK/duM9wl0KDEev7RYU1c02irvN8hviej3h2andktdH+L48RTghwZ4KaWO5r16+RyBvp0sI2GKAAAgAElEQVSaS7Ydp+6v5F8A/BwI62b0EZ1qkZXFel0N7iDg9yv9IWwJRNASlQha8dSMMwflWRGPnYHG3xLF7f/aDLL8L9vzsck7lnykbN4vByVfxXIGJR9XXbXvSqej6tf39SB3666JqzrqcFTdRD/T9vNgwqjY7yeJ37YcvBRoXtjUgIDJcGuEDIdAplNgQq5PAetDzYETu3JduX+rfBWEYwC8MaNYHG0LMa384nv1cjEE3XtYNqU80taFWL0n63i6f6CXUsrp79bx60LDu1Oz6X67E7pvC19ApO5twqoZfa2YnV3K8s38hClxdjQKrA0FsT1sxEETy2Z45l7ZVsRjNFlyiveyvT6Ee+am50G54dDeKP9gV42BokZGjgZHvQn9ID+Mb71Ag4Zwbx3OKqNTkdx0xI6kdEp5PnD+SYN3aaK8A90a8MJ6P+ojpuWPrEDjcwrs486A0wE4HFjGOiaM7E27ZBa7f4v5DEicDsKCGcUUTwSVembv17OK23rmsFxKmaZ3XZBnWaBZG+D7B9kAzXv1/AEBr0zNTQ80gAWaLy7vR6M7LmHxGh4RkfimJQSEI8A2CqIxItEciVEalyCcvW+m5berpKeEe0LiF7p2UxPmvGwrZ2Tb0JuP6IeSt7fE+hKAvzwLWeub0Dg0Cy1HOlH8QA0yr6pGy3s5kF+4sPX3RSi+bwdIMppLfPBt3nmFQ09Ao5sh3Dlj//YgTDqeXl/Xgk3+OGichCyXQLH0wO0geN2Ay4nLxw3c9R3ct4UfAUE5tn11eV8alRousRoWaCTmHpZPKRMupA2ad2p5EQn86/A0QHPPpjilIXxxRSegeX8F3+UP4MqmABAIAZHsoJW1wR9my8lb/drOG5NhURoFmo48zcKlVZg7v7qdu0rbZiVJ1ckCduUx/VGwsBqOhrB1PlRP7Yfe725B4z65CB/jQeEfK5F3Yy2a3syCscSBHdf2RcEdlZAeHTsm9EbvdzdDujSLwRZRhhY2LSmps3ET/y35cSgQxKM3jos9ik9MPVfHkwqReXV1EBsaTAskPgUaN8Htd1v/zvQCOZmonjocxR3dO+/ZxI9QDDQrriihtmzpqcCjQCNNvHx4AaVMD5M2aN6tYyUFPZ8WaDbwBdAsSvP17/tTPJXrzmW89AUvrG3A+Ho/EAgDGb3DaAxKCzQqNDbDQbhwgsfiaRKJhpL5kMXLqvHX15OOp671d22Dbj9hALIXVcG5XfEijJqflaLwrY3wjyyA+fMM5Ny4EUW3NKLhdR8iizTU31SGnFs2Qno01B7SD4VvVMDMcoJ1Aa05ChHuICJ1fEvJhk+lIohE8OgsKySrrVig0WKgefGbMNbVmvA4VCgwIctDCNe4LKqbkwkU5AAeE9nTxlG7FK73bGyjNJ//vj8dmAosiefv1vN7YDx/eJ7KLtp92QmaFn5kUAalvBTjnVp+nQTeTQc091bwOUxQKWRX/b50V57mHwv5tep6HL2jKUZpevdXoIFFbYJhwOsErjjUjRYFGiNmQkguK9bW44Fn03Purz15MDI/roSjOmAdEQ1HlyPn1fUI7F8EnJyJjGvWofjOAGpf8iD0KSFw+2B4r18L06Oj8dD+yHtlHYxslyXuaP4IyDo37RU1XoYLuPeag9qDJq6nUUCZ92UYa7azFdGZ6SZkewg1lQ44BSE/G+idD7gFvKeMp3Yc+F0V/AIRTlQ8zZX97fM079bye8R45rCCNHiadQG+b6BXxSF1X96u4ecE4dvD8+1LT3dV8IkEvMCMTX8op9KOIzwxn8+sacJT2+oAfxAoHxBFQwtb31vCbOWHueFolwUaZSC03DsThYBt2wO47t6d6XDa+faqenHmJ+FyqZ43nToM3gVboFe3WMeD/4RByHphDYIH9oJ+ai70K1ah/L4Itj/vQuBjRvTevaD/YRXYo8N/RDmynl9jURplMBKK0sTPzcQRZVHCOLgT87H4p7j5YGDfDFx3UXv2ztII67Coy5z5EVQ3MbxOQqYnllBp6xbd0t30ygX6FOCT8ybTLu6yd1Xw68SYBsK8K8vIti7tnRpeLATuPSwvtfSk+N+YlbuZ7xvsSw2ad2r4SRD8P8tPrT1OvNe71vFhILzLQONVA2gXHfrD73F+KISKrTXwNQSA8v4G6lsAxeOoCEdlxvnTLx1oVjHW0Z0WbuudMFDXGMKMWxa2Z3Z2MSO3j01q/u3e8D27wiJbLAihqaXwvFeByL6FcP6mELhyJQbPlqia54B/gQn6877gS1UycCB8SH+45m+0nM+VDMwuDaS49K5KJzL91IOKceZJe7Xjzyzbk66OY+Cu16OoawFUihN1NOVkAFsrNbh0Qt8Ci6c59KLDaH7HIe9ax1YAHQF3XTnASi9rq7xdw98Q49qfFXZvsFadrQvs1NM8MMCbGghv7eCbiVB+RAH9xtZsWjMD/GkN7w8BlelABkPwzBpBu+SeeeId/pkZxtv1TUDIJ1GvslG1xCiPAsq9v9EQUWr4aCyQLfmECoYMnHd1Iq3/TrTEWJtkLUgMZaw8sH8xBK7nlNeBdR9TWz3ru2IqgiZyD2U0fUkw6xno5QKq1VVNu3K7Zl8ftK0d483aj7vzzqnYjK783UjsNzxmH0zUVIo9lx5LZ3L9vwxrrSp2PNurEioRPAFhMcFeHx44+2edq0f+tJ5XIhb/ddH/DSTbjm7v1PAWKXHqkUWxYLjuyppmvjshct+peTAzVazxWzV8MRhHH1lItm1Pd6/nUlPCupubGKOvGkydZjl4ez4PIxNzVgR48uYmoL5ZgYYRCBHOOxwYWkJWrLWl4EtCjfp++a2fotGSgnc1Qiarz1gnRIdkw7HOD1LMa6cyVzLX2pmVKelsBBA6pA8cK2qh1XYOqvauXTGY3HPt/shTPFESRVQ6GnU0ZbqAS/8iLaZYUZlslYHLB4zNpErWce2nk/HMrC7ur7xzDe8AoYAIR181MLV2N7GSt3dwSEQx6vBiSpnseq0/bkZY28x/gMC/BqWIM36rln8BE9cdWUQqIbSt8ugSdtRnw6IuLHHeNUOp23sV/vgSn9TQgnkN6ohqAZT+Zp9S4MzDYB1Riq+xLN1JG/7pl9vx9Ivx25jVkeEUkK5Y/KwCClQqV6feeq85Q9/c0rUXFwO5mRL7jciDV7UHUFUTwtJvGgGx02DZceFmkQdmjsM67igkQYYJisjYR/07yaHZoUXx4A2jIRQTEyc1aiR1NKksopU1wH2vxI4mi5/xAZkZuGPmibiuuwjK25dzLnlgXWjKBsZcsxelDO5XdV/fwL21DGxzuVE4JYtS5hda28IqOTawxs/qUtAtg7KoW4PVm9V8kCC8eEQR9baFmHil21fzN63M2QhmzL12KP2yu7az5rOOenzQFMTB6nhqDioyDVxzokoDAgTjwfnJfTQHovi/u9eCdEcMKMqWY3Tu3mfljulITKydNnHa0bk4SElQHUogaODJeRVYtSmZknWQozsGNllR/wBbGZBaTYhWNmvgN8fkYux++e1GaDuanMBznwLLN+4ETZYXzUKgZNaJ3V/vfMsqPlIXeFONkSFQdOng7t1cEhN4azsfDOC1I4usDKIpyxp/HDTfNfJYoWHYIF/3Itd71dzLAKqiJjKOLSbbWQr+uJrvIcYVDCy9dhiNSTWz21/j3LCJj1rCGNESjh1J1xwL63hSOWSSXT4TXMa/Xt+Iz751xBjUTnx3E2OSokQWquKRlNbFSyH87qR8DCnP3kV5mMxTv/L+NixYasbsXInMFCmiFnaOq4StMG65tBQuh2g7SBOGSnU0qZQmD70T492UWJ7hQrMmMO7G41LHfd++mu9lxuVE2H7NULId+fpmNU8nxnlH9k79Xlbu4D4uL86z9nx1JRdo2bhsUEZqUfrNKlbKjalH9SLbCZhvXcXHK4u/su9duxepLNwpyx1zOTvqw+yIgdMUdTmwFBhZAiulmRJWLIqfREzCEYk7ntiGYDQjZjJOJift+Ne4SVk5hZkR7D+Y8YsjCuBIeNV1NbN4H2s2NOH1j8PYVueIscWJsXbJjpUcjkkwjTDOPtaFvQa1/0ErLbA6mnzOWAzUEwsBlwZlZ/qUgN/cMC11okw1jdtW8UfEUL7BT127F9lOyvBmNc8mhufI3qnbrGnigyAwoG071/j5z4MzU7s8vFnFb4Pw9lG96N6Ubz5e4Y/f8hBmqJhjmAbG3LivvfNW1b/jbR5vEn6d4cL44/fGqKYQLJ2N5Suc4G3i46hUIavX+9HcImFIQkgBLMIIhiQM1hAKSetX7HUB/YoERg51IT/X3Z5/7kSjHPfebLfcr1c3YM0miR0NsS1UWT81jZHl06EJCY9LQNcYHhfB7QR65evoVeht60P1qdiaBAOs/Nu/2opVq6rxhabhn5GP8casWfYdOG77lneAUcCEX1+/F6XM+pGYyJvb+AMi/PPI3tRlWvtE3TVNfDZpWLYTNC380OCM1O4Rb1Sxyl4+cFpv+pVd0Jw8l7WRw1EJQhFLPHTDPql9dzr2PWsWi/Mux0dNIYxv7oK3SW7TOUfTvtfkoydZndJRtdJxLh3VQN3tQ2f9WvXj0ZVKzM5wAtluqEs8cgbmke07KBPj3rqMx0GHRflZw7AbhpH1A7VT3tjGVaThpKOKuvfVUX2tbeY/hQO4eSdomvhuPRPXpxK7X6/i44lxy7Q+u9qRupvkLV/zg0S4hBlf37BPem0T/W6r5eEhYEWjojaRnbYoW1kj7OzgD1RHbXrCU09JTIqXaT2eZvXJppt6MoVbvuGnW+MDzgBj+/JvUTzvFLJl13i7istNxnoZQd4xNmLRvvPz/UMyacZO0DTz6SSwfpC3ewnqlSou1yTW5LuQNy6/vcGsuwXf+hVPlALK4ClDQPEf90k/ZaqiNudeho+aoxjvD6lsnDEfm46ZIxI6uASYOlHKxqbagWS0O5k6MLi7qgl3deBKrL9T6pLUgTqWFP/iVnoZp9LHwO9j9M/N7V5C6mp/b17OKsml4jVuvGFfusUu8F7bwhcIgbOnFdMBdtqsbeYHBvnosmSeZriKtR7so/tSdfB6Ja9vjVu/YVox/T1V3cTzWUvYKxxQ+lXlJ3zXzJH21dzJY2yu4b5SwxbF26hjysqPF2eKuz2S4vxvW76ZrqTnZH1eMgOdNAnr/duwpneCSysdmxK+rGPJETuWPDpO6ZNDttLPd9zvG5bzPjpjuZqTpmPUdSMo5XWCiT7eqGQ15nfTiillWNGqOt5Xc2DC4EyKhbCookJz+zbhoSHZlDKp0Rvb+MFW3iT/6L6U0tk5eZGzvuQ/E+ECMNbNHEVpJRBI7mdrI18SMvCgxRQrhZ8yL8QzjncHYpvvudMuUrVN9TwBIAUYFd+UOJYyXViy+gscNGUKlH+FHVas3fxmfckvE+E45YPdx0C/6WMoaveH/MZW3mowfnNcP/ogVZvv/DydCYuG+mgnI6warW7k2UOzKWXmiFc38zRBePToftRlUufOJjFrKe8LgWXqmQR+dvMo6yKsNAvTmjVwenthcXMY+6pjygJO3G2iK/6mMwND4kW2JS/q4LPb3RuMidttcXHtDGKdAih+JKnYJgUYZS7IdMHfFMWQEYWojtk/0wPNXcs4o8W0BIwsAi6eOYpm293M17fwfiAsNJzofXwhpUzW+J2f/7zVh0tVhs92BHiNny+UBhYOzSXrxXZVXt7BmXrYyt4w5fhSit+eknq66i4E/gLqar39ifDJrP13Ne+n7oVJaca+qEJBkQfr/GFkKt2NUvxZKertJDpKRRZSPU9M0k69+LGoeBgFmIR9Sd3sAsLPSs/DB5gbcxNKFzQ3LuH/a70tMZaQiFF60xiyfZnJa1v5QQD9julLtrJ/fNfEjw7JIitHYjvQfNfAA1jgV0NtZGZ6dTM/S4zGY/qnpkztjqjP+ThJeNnSrQmMvW1/Su9uKOaYV8IpEN/NwZBWfkAFMMAfAQLKUSvuPpFOwiM77z41mDuvkUhclAwYK+cAY3rpQ1CXcEmVfmPmTGWAT4/S3LiElctiPxAeuHl06sCA5Bm+uoVXagLXTismpXTttnxXw2PZiX2GZsXshruwet818RNDsuicVB29spmPIuCxY0vSPKKWsFeJeQB6EWPRzQdSexe2VAMzE24CYUXrVuVCrL0dU10a3lTURjHGCjjqqErkAk6o+zvrNpW+xc7z2I88VjrqfRImAsXDWF54zpjrg0Pgz5P+hivWfgOJekiMaPXRmAlGGqC5YQlfgcSlasCwWw+wr5t5cT0f6HBivumydzStbuSbTIknh+fSxk5Boyq4GfenSgv78irOFBnWyz/j2BL7Zng16A2L+FcQ+KfysTGAcXccSPZvg02ABhCjK0FLiyu05dPLDs334vU24MQvxUhkmOhp+tZU+O3qeTx7p3UcKcAo5Z36KD7GZNx5/Gu4ZfnnMEaHIZe2gmZWK2hmpQGaWfPZZ3ixiggq8PwftxyYnkDy6iZ+EgznsaVk6/plZaQcnLlT8bsLpVlRz6MchAOH5FDKC0df3cy3t94HtM+xpaQCtGyXez9hT62GbwgYAMayW8epUFI7JcbPKEozGRALYgnFrc8rp2DYmL5YEIgiU7lQKOY4EcFgZc7q4q6EjhJ2Ow+anWaqRCKIdomP2n518UYJpV3imh+lh1E+zgowyrbUFMRFEx+te7YOeQbyYMIFiW1Wl5LTOJ6uX8zq7gdLYNFbb5iZNY5sx/C8WsleNqAuZTvhuNLUWmDFsgA4aUgO/SnxhjrVRKxu4MeG5lDKsM4XKngvlS+Oguh97NDUvhjJsLj6U56sEyyXRSZccttYejg1bFq9bGe1HakxwDRu0aA5BMIO7cGTff1O3Nf5N1NitAKNYo6VsVMdV+3S16e4bCP1PHbWSACljXeJGyAVYBIUxqvDv7zSPO2Iv2ofQ2VO8cJERYVEWZmcDMgFSpi0SWmuX8gDOWb/yWDCn24bS/+Xznxf2ciKmb081B8j7NxnubqRb9SdeHqgZyeT3RVoro4A8/bJSW1hfWUjv8TAtuNLU+t3khenJCm5GCot7Ilg1AuJQbPGp0rEHAeN4mdGWOBJUBodQWiINGkFHt214FL3VbkeMUNpjC3gRGNKwASvk3z3QbtU9TZ3P2HQTqS9tyQjdYlYXDqyKEycykSieH3W+/jDi0uaa5t90kCtYcAVNVHTy4QTJopjlEaBxo4ENeszXsSw7oBoEUDxrA5hLKmW8MpG/k6auPWEAfS3VHXV89VN/NjQrPYEpFPQrGrgciEwfUgWXZ2q41c38GRJeEk4UZyOj43qd9YXXCyiUClo1U2wH954oDp1uitMs1opTTzZnxgOiAAggs3Qqn3Q0AgdEg74oF8xNlpy0QTHnS4NhyjQJANHieYJn5yEi0VXx1dHkpzgVyxTQPy2OQUWpeFVHyVSK8CAuPrzjfL6s+dF32+MuMOQzQZMaSA7yygGjMpYrsnYZwXYjth982esLgezrruWwNRZY1Mr5ZJ388UNfIJGeDrTi35TimhnmGgXW766iSeCUT40m9pl4+pCUd4aeN3ATwzNxvRUV/jMZdZcm/AlJN48vjw9Uqnmeuti/qUAYoHnEpdfO667kF9FaW5qVanNRIKn6de4Rdui9RPQ6vUsT67W1AwdZtABFzkydXI9dqJ+yIH9xYVuB+2XoDbKPTj5yFKUR+Xxs6hOByeuBN9iHUOxLJxWqjMLMAmwJIEGhOpV2/HYb56JzGto5iAJjoY0d9SKqmOfkddSZ9bl5xmohYn8OJWJ8zTWWF1IUHd8wSNlFItAcLemH3z2ugPtO/cnMPFyBX+p4Hl8Od2eihhYVKaBH8vOxuUdbwfuEjRrG/lIg+EblkMpM4u/VMEqBfozmhMlaVMbZuH+HPOIoJRMIQcw6YoDqIt0YazcfC0dTex4WinKKoaLihHQsKlOQ4amgTQdps/hJuhMYSdLcijqc8sxzpFHDeFfF/noSEVpEtQmwesoiqNMEW0UJ0kdbFGXuM3IusYnTmGUZJSQkJrDWLa8Sr4wfZ75pj/CIRiICumMhJwhA2EZzdS8Ub8JA84aEw1RE64+5ui9IZfmQkLFEFg8jQWbXRTRs+ezr8WHbxgoZUZ1yMDw1Ed5e1i8uoFPMIG/u3WUHFmSig0AllVxkduDC4dmJwh7ez6uU9DNn896n/3w2LDc1B5dito4K7AQjOUnDEjNQHcc8PaPONfpxkoQlO/xDvJg2BUjOltYEiM8HDR85UotAK+IoExEAjVajXDoiGZrEC06TKFCEh0uculhGXE4NHLAgD4knzKvO1xMHlpI44p8dIAQyFWAUR8FGIviqAkmuXNazFPsEgzLOq2AIwQidS389cZ6/uz5r/nDZ5ZKpY1VqSWiirqQ4YySK2SEGjkK4YnCC5Vv0oAHSvEv4YKJMCQOSwZN58q9e5fyQlZXK6r5EUZfNabziI7uqMdLG3gtNMw+oX9qg7Tq59t6vokZ84bn0Tcd++2S0qiKq+r5LKFj3ZBMSnnhwvNreH9Nw4cmsPcvBsSUQOmU+z/noSDLWutkYKXDg7EXjejk3E1S7o3OhVharO6ohYZsaKis15CRq0Fr1r1C6AFTOFzCrUNRHRlRueis75akan039F/uLYoPH6wP75uD/tke6p3pol5ODRnqSmYFHkHEEZNbAhHUN4W5qrIRm7/cirUPfxJZY5gwIWGSpin5zIDuMCjCRkRw1B11RRWV8Ybd0YDHyjVpoMUSs80yH8yKJH7G0tN04aX3wFJLp2JddS1NnHf52O6jOTrb8xfX8sUk8IdIEINP6STurGObTzazJz8Ldw7N7txZrlvQrKnlLEl4dGge2boJ9+X1/Awz+pwwkA5LBzCJug99zseRsEwMilIvLXRjfMdFWuFuSuxeAZo8AqR0NWWAiACiMgAN/kYd3mwtw2jRWnwZFkBckbDOunVMaYw4cKShsXRooJ26Huu7MAiyg6Zc6AzDUGcUt8o5DA0SUjeJWDk7qf9iwIyY5HAYxGyEhSsKLWQiwAY0TxQOv5kTNE1HTo6xQ9WvhTk8H7wSkCevAM+dq3JY7no0zV7CdzNBpXpVGzKnZhQu7irmqav9VnoZM4iNYPzuhEH0op33srqBrxEaXhmc2blDe7egiVObGSTwydDsrviMndN4eRMXk4E1DJx6/IDUIZ6dLWD253yOplkJA9QR8dr5o6nD9UA7FXyWyF0JGuRaK9bqg0QvDaI6HOdtrGMKOpxWXiQLONChcYRif2VUXX0qQEpYjgGHyRAwHQoUBBnduTfCwVY+M0QVoVIgUSlHLahYSUvdrLgVkww2yQkjxC7DyzAo3GIKb4bhb2iUBZnZRo2sljCjEtn91BHF7Y+m9qB55Eu+Eow7rbkxnq1qwlmzpnR/r2hn+/nqBn5BMgqOH0C2Ls3YvJk9LT7cMSy364jblKCxqI3AA0NzySKRqcqrG/gsYtxc58ew347cNVtTqvbq+aNf8eWCcW/c/WBRlgOTdlKcJNDE7U9QR5Sl6ANZx1SwXsumXNHohoaWFh1Oobn9pIW8EK6wRWkE66TBtCJy44BRspEqUcXmWv9HsmeKAo0CigCTuhHVCWnxJE5IClt5a03S2AxF3Ca4VsKTb2SGYfodjSbc2SaaETvMyiFHuyCXKk2wErWV3WlWwnwV42me+IJvl4SrFBslgY8rnZjaWThzqr18ZQ1PIh0vGQbGnDg4tc7NIhJ1fJ3JeGlEftdhMylBozpaXc+W/+nQPEp5le/cuaxlHADl1LP16HL6daqFdfZcKf5Kv8ItIFwb19uvls044JyJyu8jLkEljJZKilIeJQo4FRUCBR4Nvl4xEIUatUzKFhxt1pqJBIwMDc6Q5raAQoLDFi2ygMMmkUVhFJA6Kwowqqj8RRqr8GyL2rS6WCpnDEma2wwGghLMEro04WATDVKiV3bsCGuEokYxoCmF3nDwrFapaRZuUibuNsnp6a/4SUaMhwHjw0ADjrloSmqdSscpv72MM4xMS7i4/ehyUlcMpCybmT0tdbhjWIoED7ZAw8zaqno8s1eePRC8vp5LCfhaABcdOaC9YijlzJMqPP0FX6AJKyGSOtOrBOGY0/ZFLBY8boNq4236tCYO2wYqQ4WoqFT5xnSBWk1AUwl5cyiTIGSgRW9RakTKUHnkCUZIc6M1fDMcioFHfbf+hlXAZdvekAZW4TDKBQYul0pFgJACTZRV9hEOBlhmeFi2cEbs6JJNEs4sRZuk9b8mMIotJZ5E7lLGYaPlyfOAeYrKqKXMBD+5Gj5X2ErJYvGDTPiHW8dZdhjXzvb0jQ1Wrpo8fwt+ZrePlbV8n5B4ZFhh9xZzW6BRk1pRw4dqGvYelkvKeSdleWs9n0ICf5aMMUeVk5UAoCflH8tYMeH/iLsdBAVw6a9G4ok2f4SbQCevAM1Lpjh5IGyA6KVVi+o6TaB/ASHYSrciTRrc1t23AlEfWXroQEB4naBAlAjeeFr8KEh925kxKP4tCobDw95AAAGPV2Y4WrgloqiOTyITMjvUyI2hbC5wwqzxgtEMhg8masGWIq9yKaN49M5jSVGZWTP5n1/jIDahMqD2ib+QOavrcGlPeBi1x+9s4DNZ4GEzgmHTBtszZq5t5EHSxC+H5JGlce6u2AaN6mR1PT8sNczcy+aNcm9X8GPEODCvDAekc3d3xwnPXc77KDdmALEgaImXIiGccfo4+NsMmDvtUVBKP9QOt5yQ14a3aQgKKszsRTt8IHhBaGiwqE9WuIma3FmEiJ8QIYLPB0SbrT3xtaYEaYbP+qu+WTr3sE/xMioNkiI2DCczXFmc425gUZsj6zw1DHUpIAolGrcw6vsxMsGWCwSWYnLxaC5cMY/njTg5pswDMG85rra0TzGHe5gmzjp1FKmQlB6VDzbyCJPxmQROPqIsNTuRGGRVHT+TlYvpxZQ63Do90NRw32orHHMAAA0pSURBVNZz/6ahuXSunRWpc1Vk42MCVh1WZk9s76rflz/mzGgWXhSExC0uW0nishNH4oVZs26imTNn8k2tfM4sFVOhTvJKWKlEl7og4AehTPW8TaBZEHxKTVcIqABjBSJFhQDkhEENKu1SdaNiqHeWRiDHlW295AYXOBf1qOdcqTLM1NTUAHsVyOI14Mph4LImcEUtOC5Sw5KSvlvAuHAy4xSlj7mplbjM5Be+xL7Q8VcQYvdMMCojjCN+NXJXZZqdvVZ13q7iDC2Mb8F4/LAy+6Esqxr4HJbYvlce2br/Mi3QqImtaeBzWaJqSB69ZmcxKmkABbGqlfQ+OrU0tQG0uz4Vk+0cjkuVZGWlKouxpq9zFFcdPwrfkmKOEyWZ8sQZ5eEAInmgtXWgfo2gLSVAcRPIbI61q0609YEKAjVU4y3gQqWi3q4e7EAvbyFX+5JyBDSC+2ELtmT3Y+SBsQZQYPFUgpcWgycvWIAFhZMtCUmREuVoNXcpslxO3MqE6co4Hk9E8KhL4vdH9FDaVLObu4KdBT6oTFhrskpwhl3KvkZdqEG4bEge/cHO+1R10gaNYorXNuBJj4Yr+tk8puav4zHkwPutjgGXHGrTJN/dAl5ZxuWajkfBODxeTynHnm7Vu86cNhJb25hk9VCBR5WYK4UydGJBH9Dw90ArRwCoTdqD/KTvjVsICgzqWmFUoMIiVRVAbRlbxx7WAvmD2KIkVlkKi1/BApw8fDLPa40oavPIU1H5FXAV+nEZCSj/F+vqI1Z0CDj7mL3pbbsvrKt6Czbz3NZcwMMhMXFKuf2gu+/q+BHdiZkDfPaDF9MGjZr019Xcy+3CbYNz7B1Tqs2HFXwoCbzFjNMnldLc3d0kRXWyRuCXRJgDRuy+HqVQE/i7jOCuI/ezzICx/L7KyBmnQievmEfzTj5ZpcOmkwvBFgMNYHTlUlo6ejSsI23bSkKf4Yzkv5XDY+CI+b/EyoIFgKIkMVBynCGP/TvuH/POchRKgXM0wlWtl5Mmcg4qQ/vdrYrHW6YNJpVCa7fKR5v4Ecn4mXTgwCnF9p3h1tXzZSZj7ZA8ej2dCfQINGqAtXV8lNAwcEC2HY+72JQ+2sSnMuMpEjj14BJ7Ku1Ui3ljDbucEVwBwtUEZMXfqCTG5ww8pHnx/JRyCsXhs9MLXPE/rZ2rjwUkxZwmqFJ3g8bF5ETbtqpxxjZBq95biakk8UsWONO6tytemPFYKIjrjh1j/+V2N52PNrOiuCdrhH3Gl9DWVPuVeL6uiYdIiTMG56SOruzYZ49BYwGnnm9g4LXBufSl3cl+tJF/16o/eJAETp/QL7Xbhd1+FXg8Bi4nWL6z/draMQxBeAmEl7Uw3pkwkiwOJVaS8oy3cw6O+SEnJJy2Qyth+U5k99upyeGn5rN7UC9MNIFfgnA8GIVJ7cKt6R7ntMbJ/emQ4RTP82Z3ZV3XW7iZHwPjpIiJ8VPKyXYy5cpK9ga9eCKUjTNG0K6JM1PNbLdAs4LZ6W7Ak4aGGUNt5GtLTObjCsu+NEcypk/oT0+lmmQ6z5lZ/GclTiINZwhgWgdPcGUGWEmMD6XEZ5qBxeFaVEyZoihReuXjZTwULgwFYxwIh6gbE1uTmXqTY6hUTB8THndq+Me4wfaTJdiZySebWemqJksD0yYOsB++ovpe38D/Eg5cXpbRMwDvFmjUBLb5uTBo4J66HJxjl2NX7T7dysdCWh57Nx1UstPT3c6G2a2zZDUXGMAvpcQJRDFNaxelgghVYFQpLQ4Y7XLEMKwM870lWzyJ8vlRXLGlIO6kqGiml0yBZycMxXfpBsClWtv8FezzZuE1CeSRE4eP62WfgVV9b2jgPwqB10uz7EfGdpzTboNGdagu95IaLi3PSZ0qP3kCn23hkQL4mCWez/DjdyNs+Hqk2tSuni9bxhkBJ44QhHECmASBfdU9XD3tL6ndcgY+k4xFmsCCA4aQigX7XsqSah4oI3iFCXUm4/jxNjzwkieyro5Pa7VFuQbmkors7HHZI6CxgFPHEyEwrTSHlPOz7fLVZu5rKF2LcorTcPSYYvvxyLYH6aLiZ6u4XBCGaQSVfr8MbFGRHCiKomzeOy+Nb2CydMBVAqiQhI2aQEVgB1aN73A/we7Oqav2S7bw0Qz8nQjztgdwcbpS16YmPk4Cg8qy7Ke962oueww0FnDq+besoagsi+5OZ/OWVLKy1DwoGL8QAufsV0wvpNP+f73uks18h8oiBsaM0SWpc+N13I+NDTxaXdBXmoMZRPayZHW3p3sUNGqgika+kBhGaU7qC6c6TuyLTVYiwHuUx7zTid+PsBFm8b8MmMUbeYTDgafAyGCBk/fvQyvTXW+Fn/cSEpf4szCjJ5JSZ+PtcdCoQTY18AXKxakkM33gfF3NA03Dik7Ig8TZI20k3El3I/8b6i/bxn9g0/Ip+rtBuGRMGnmbE+tbX88jHQJnNW3BVXuSX/xeQKMmvaWBz2eCoyQ79W1lHV+iioTIG4yriPAHAt5udOK8iTYS7/w3gCHVHL/eyuOVTocI2f+vu3OLjbKI4vhvZrctVHe3UKDtlkWMIhUIgohFQwATETVGwUSFByPBYGKiIiReQ6KEaDCEgGhIjL4QvCQmPBAIauILJl5qDAlBoE1FbaVdyq3t9pKW7jfHnQ/WFCzsftvtdpfnmW/mnNP/TmfO7T/g8OLdkfQj1YPXbu2Qe+KwpquFV7MJGLvHiIHGBU5MnhPDrEhZ+sGwwYofa5UpjvCJhkWJ7u1bi4rZVnODgudws4RLirBdx59IXMZ3lPTw7rQMQwzN7bJca5Z2nmJ9tgEz4qCxG7TGZKEjPBUJpaYGutav8ERUlhjBEjmMsxm1M6q9l3Gk+oWP1nh9s4QdH28peCGRsHZAadbPHMYLssWmOWhCPwX4MJ0C/0z0HtGTJilQS7vMFcXb/j5WVw5BDZyO4Da6fjzKKg0blSIA7MTPrkI9ef5sk7v646xVirUC+xO5yZvujKij6djiWnOiMdkqwpFwSH0+nHVSfZsT0Fw+cSZg2OUYNkfGZ24cW805O8pKS/yuwPJ871aKj6ZVpSadSGWMXIzXn5KnlY/VCA8L7DWaTTMqM0+8sjK3i5T1drqpIluqPcQBM9U3Z6CxAv4mUlTdxXti+COcwZP8aiVPtMn9PsPLiczAlaI4ooRPcdg3bXJ6ebGZGs3rd41tch+GZxFWiabHCF84cT6Y6dGjO9S+zZ0y3w/rtGZDZWBwMNarlOnPzylokmK1xWSFgccu9LEuG76YxkYJqgArleIZG8SzKTH21eX3sW/KRI+NINO33TVnNjZKiQ6wVHAvtUsQIqLYqzR7/jnG9w9kUPQ21GbRmLyeKKgb2xLkfS9xv+GqOCqgsUI390i4OM42gT1VIW89+66ndGNUJvoUy4HHgUW2Xt/mgNnGyTjUCdTfNoyL5lB7nzwldygfczTUOpdiWwtEaLFsNQ7sv72Cg6latnj5Q56LSU1c2KQUOyqC6VMoednjenNHDTRWKBHxn+nmeWOY4+vntUlZ9gDb7L7axSwQWADUItQCU5QiagxNWlPvRrbhNJoOE6ctkczVh4+OK4zmUOZThEQoM7anKJdiVcrGrIQaYKzYOi/FL7YSoEhzaPJETmY7wm1laovJBkn02SPIxqv7xmQLFKnWGVXQJIU73SG3onnDr/l5Qgp2u1QKpRo//rdUlY5lqlZMV8JUY5iqNBViUx5soFK5ke8xScNczo/pE6EjwdzW6aZQQBOaqBYanDhNPsOJSORKYvVUcngdP9crtc4ArwjsrAypOq/fZ3N+XoAmqVD0gjzq97Mi7vBl1bj/805nU/FCWetMt1Qq4R3H0FARZJfKINMu27rmFWiscpbYY1Y3axAWirB5Ukg1ZlvpQljv7FmpooT1to+RUWzP1csoHdvkHWj++5d1Wm7SpaxDUa3h4wmB1JzR6Sic73PO9kiVMrwphuIBw5bw5S7h+SR33oImaaRWkdLiLl4SxTyt+Kz85kyYW/LJ5EPLcqFbZjsOq5WPPlsDX16aX76mwVLnPWiSwtowwvkYq7TmXgP1F4Wvwx6S2fMRNtafE6pkuRaWKc3RXofdkVDqJoqjrUvBgGawoayfwpKNaZVoDy/UyUUOlnugRhxto7d3yQNiWGE0fm04sHM733phxh1t+QsSNEmjWT/M0kdYaOBJCyBj+B0/3+Xb0W5PlPIwDyrDMtFuu6PDTh9fZdsvlSswFTRoBhvJ1jvFepnnGB7SGluEHVeGQ2aAX8ePz12yupXpvEjQ1+O2ol+ktNuZpmvA8GNTgG9y6e4fKRDdMKC52kA2+2/ufBajqBVDhdZuNxlLvNrg9/FXvI+mccN8mYhIqKPHdQ5aR2GNGKrcKgYhZhQ/+B3qggV+7xoKeDcsaIZS1pajlpZSY/xM1zYUINwi0K+gJEHrN0bEdkWjX2tKEJJVl8o2pbZz3Ll2zLi82v22sM6IW85SLwM0hArgEpuN0+dfvgOtoDQyRzUAAAAASUVORK5CYII=",po=i=>(l.pushScopeId("data-v-355c611a"),i=i(),l.popScopeId(),i),zL={class:"custom-video-player"},GL=["id","controls","data-setup","width","height"],WL=["src","type"],KL=po(()=>l.createElementVNode("p",{class:"vjs-no-js"},[l.createTextVNode(" To view this video please enable JavaScript, and consider upgrading to a "),l.createElementVNode("a",{href:"https://videojs.com/html5-video-support/",target:"_blank"},[l.createTextVNode(" web browser that "),l.createElementVNode("span",null,"supports HTML5 video")])],-1)),XL={key:0,class:"error-overlay"},YL={class:"error-message"},JL=po(()=>l.createElementVNode("i",{class:"el-icon-warning"},null,-1)),QL=po(()=>l.createElementVNode("p",null,"视频加载失败",-1)),ZL={class:"error-detail"},eB={key:1,class:"loading-overlay"},tB=[po(()=>l.createElementVNode("div",{class:"loading-spinner"},[l.createElementVNode("i",{class:"el-icon-loading"}),l.createElementVNode("p",null,"视频加载中...")],-1))],nB={key:0,class:"custom-controls"},iB=po(()=>l.createElementVNode("i",{class:"el-icon-close"},null,-1)),rB=po(()=>l.createElementVNode("i",{class:"el-icon-camera"},null,-1)),sB=Mt({__name:"CustomVideoPlayer",props:{videoUrl:{type:String,default:""},controls:{type:Boolean,default:!0},showCustomButton:{type:Boolean,default:!1},hideSnapshotButton:{type:Boolean,default:!1},live:{type:Boolean,default:!1},hasvideo:{type:Boolean,default:!0},width:{type:[String,Number],default:"100%"},height:{type:[String,Number],default:"auto"},lang:{type:String,default:"zh-CN"}},emits:["closeVideo","play","pause","ended","error","loadeddata"],setup(i,{emit:e}){const t=i,n=e,r=l.ref(null),s=l.ref(null),a=l.ref(`video-player-${Date.now()}`),o=l.ref(!1),c=l.ref(""),u=l.ref(!1),d=JSON.stringify({fluid:!0,responsive:!0,playbackRates:[.5,1,1.25,1.5,2],language:t.lang,techOrder:["html5"],html5:{vhs:{overrideNative:!0}}}),h=A=>{if(!A)return"video/mp4";const w=A.split(".").pop().toLowerCase();return{mp4:"video/mp4",webm:"video/webm",ogg:"video/ogg",mov:"video/quicktime",avi:"video/x-msvideo",m3u8:"application/x-mpegURL",flv:"video/x-flv"}[w]||"video/mp4"},b=async()=>{if(!(!r.value||!t.videoUrl))try{u.value=!0,o.value=!1,s.value&&(s.value.dispose(),s.value=null),await l.nextTick(),s.value=fe(r.value,{controls:t.controls,fluid:!0,responsive:!0,playbackRates:[.5,1,1.25,1.5,2],language:t.lang,techOrder:["html5"],sources:[{src:t.videoUrl,type:h(t.videoUrl)}],html5:{vhs:{overrideNative:!0}}}),s.value.ready(()=>{console.log("Video.js player is ready"),u.value=!1}),s.value.on("error",A=>{console.error("Video.js error:",A),v(A)}),s.value.on("play",()=>{n("play")}),s.value.on("pause",()=>{n("pause")}),s.value.on("ended",()=>{n("ended")}),s.value.on("loadeddata",()=>{n("loadeddata"),u.value=!1})}catch(A){console.error("Failed to initialize player:",A),v(A)}},v=A=>{o.value=!0,u.value=!1,c.value=(A==null?void 0:A.message)||"视频加载失败,请检查视频地址是否正确",n("error",A),Ln.error("视频加载失败")},y=()=>{u.value=!0,o.value=!1},p=()=>{u.value=!1,n("loadeddata")},f=()=>{n("play")},m=()=>{n("pause")},_=()=>{n("ended")},k=()=>{s.value&&s.value.pause(),n("closeVideo")},D=()=>{if(s.value)try{const A=document.createElement("canvas"),w=s.value.el().querySelector("video");w.videoWidth&&w.videoHeight?(A.width=w.videoWidth,A.height=w.videoHeight,A.getContext("2d").drawImage(w,0,0,A.width,A.height),A.toBlob(S=>{const P=URL.createObjectURL(S),F=document.createElement("a");F.href=P,F.download=`screenshot-${Date.now()}.png`,document.body.appendChild(F),F.click(),document.body.removeChild(F),URL.revokeObjectURL(P),Ln.success("截图已保存")},"image/png")):Ln.warning("视频尚未加载完成")}catch(A){console.error("Screenshot failed:",A),Ln.error("截图失败")}},E=()=>{o.value=!1,c.value="",b()};return l.watch(()=>t.videoUrl,A=>{A&&b()},{immediate:!0}),l.onMounted(()=>{t.videoUrl&&b()}),l.onUnmounted(()=>{s.value&&(s.value.dispose(),s.value=null)}),(A,w)=>(l.openBlock(),l.createElementBlock("div",zL,[l.createElementVNode("div",{class:l.normalizeClass(["video-container",{"has-error":o.value}])},[l.createElementVNode("video",{ref_key:"videoElement",ref:r,id:a.value,class:"video-js vjs-default-skin",controls:i.controls,"data-setup":l.unref(d),width:i.width,height:i.height,preload:"metadata",onError:v,onLoadstart:y,onLoadeddata:p,onPlay:f,onPause:m,onEnded:_},[l.createElementVNode("source",{src:i.videoUrl,type:h(i.videoUrl)},null,8,WL),KL],40,GL),o.value?(l.openBlock(),l.createElementBlock("div",XL,[l.createElementVNode("div",YL,[JL,QL,l.createElementVNode("p",ZL,l.toDisplayString(c.value),1),l.createVNode(l.unref(Mc),{onClick:E,size:"small",type:"primary"},{default:l.withCtx(()=>[l.createTextVNode("重试")]),_:1})])])):l.createCommentVNode("",!0),u.value?(l.openBlock(),l.createElementBlock("div",eB,tB)):l.createCommentVNode("",!0)],2),i.showCustomButton?(l.openBlock(),l.createElementBlock("div",nB,[l.createVNode(l.unref(Mc),{onClick:k,size:"small"},{default:l.withCtx(()=>[iB,l.createTextVNode(" 关闭视频 ")]),_:1}),i.hideSnapshotButton?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(Mc),{key:0,onClick:D,size:"small"},{default:l.withCtx(()=>[rB,l.createTextVNode(" 截图 ")]),_:1}))])):l.createCommentVNode("",!0)]))}},[["__scopeId","data-v-355c611a"]]),aB=(i={},{baseUrl:e,token:t}={})=>Et.post("/api/conferenceRecord/getConferenceRecordByPage",i,{baseURL:e,headers:{satoken:t}}),oB=(i={},{baseUrl:e,token:t}={})=>Et.post("/api/conferenceRecord/deleteConferenceRecord",i,{baseURL:e,headers:{satoken:t}}),lB=(i={},{baseUrl:e,token:t}={})=>Et.post("/api/conferenceRecord/updateConferenceRecord",i,{baseURL:e,headers:{satoken:t}}),cB=(i="",{baseUrl:e,token:t}={})=>Et.post(`/api/asr/getMessageByBytes?fileUrl=${i}`,null,{baseURL:e,headers:{satoken:t}}),VC=(i={},{baseUrl:e,token:t}={})=>Et.post("/api/v1/displayUsers",i,{baseURL:e,headers:{satoken:t}}),mo=(i={},{baseUrl:e,token:t}={})=>Et.post("api/v1/muteParticipant",i,{baseURL:e,headers:{satoken:t}}),ql=i=>(l.pushScopeId("data-v-4978f656"),i=i(),l.popScopeId(),i),uB={class:"manage-container"},dB={class:"main-box"},hB={class:"main-top-box"},fB={class:"searchArea"},pB={class:"main-list-box"},mB={class:"table-box"},gB={class:"video-header"},vB={class:"video-title"},yB=ql(()=>l.createElementVNode("span",null,null,-1)),bB={class:"el-dialog__title"},_B={class:"video-close"},kB={class:"video-dialog-body"},TB={class:"video-player-box"},SB={key:0,class:"video-transcribe-box"},CB=[ql(()=>l.createElementVNode("div",{class:"transcribe-title"},[l.createElementVNode("img",{src:FC,alt:""}),l.createElementVNode("div",null,"文字记录")],-1)),ql(()=>l.createElementVNode("div",{class:"transcribe-loading"},[l.createElementVNode("img",{src:qL,alt:""}),l.createElementVNode("div",{class:"transcribe-loading-text"},"智能生成中...")],-1))],xB={key:1,class:"video-transcribe-box"},EB=ql(()=>l.createElementVNode("div",{class:"transcribe-title"},[l.createElementVNode("img",{src:FC,alt:""}),l.createElementVNode("div",null,"文字记录")],-1)),wB={class:"transcribe-content"},DB={class:"message-list"},AB=ql(()=>l.createElementVNode("div",{class:"message-footer"},"机器识别仅供参考",-1)),IB=Mt({__name:"HistoryVideoDialog",props:{baseUrl:{type:String,default:""},token:{type:String,default:""}},setup(i){const e=i;l.ref("0");const t=l.ref(0),n=l.ref(1),r=l.ref(10),s=l.ref([]),a=l.reactive({fileName:"",ownerName:"",createdAt:[],roomMode:"0"}),o=l.ref([]),c=l.ref(!1),u=l.ref(""),d=l.ref("http://10.227.1.34:18080/mp3"),h=l.ref("http://10.227.1.31:7101/recordings"),b=l.ref(""),v=l.ref(!1),y=l.reactive({}),p=l.reactive({fileName:[{required:!0,message:"请输入文件名称",trigger:"blur"}]});l.ref("");const f=l.ref(!0),m=l.ref(""),_=l.ref(""),k=l.ref(!1),D=l.ref(null),E=async()=>{let be="",Z="";if(a.createdAt[0]){let Te=new Date(a.createdAt[0]);Te.setUTCHours(Te.getUTCHours()+8),be=Te.toISOString().replace(/T/," ").replace(/\..+/,"")}if(a.createdAt[1]){let Te=new Date(a.createdAt[1]);Te.setUTCHours(Te.getUTCHours()+8),Z=Te.toISOString().replace(/T/," ").replace(/\..+/,"")}let _e={fileName:a.fileName,ownerName:a.ownerName,roomMode:a.roomMode,start:be,end:Z,page:{current:n.value,size:r.value}};try{const Te=await aB(_e,{baseUrl:e.baseUrl,token:e.token});console.log(Te,"res"),Te.status==200?(o.value=Te.data?Te.data.data:[],t.value=Te.data?Te.data.recordsTotal:0):(o.value=[],t.value=0)}catch(Te){o.value=[],t.value=0,console.log(Te)}},A=()=>{console.log(a.fileName,"1111")},w=()=>{a.fileName="",a.ownerName="",a.createdAt=[],t.value=0,n.value=1,r.value=10,s.value=[],E()},N=be=>{s.value=be},S=async be=>{try{await Sv.confirm("确定删除这条录像文件?","警告",{type:"warning"});const Z={id:be.id},_e=await oB(Z,{baseUrl:e.baseUrl,token:e.token});_e.data.code===0?(Ln.success("删除成功"),E()):Ln.error(_e.data.msg)}catch(Z){Z==="cancel"?Ln.info("已取消删除"):console.error("删除失败:",Z)}},P=async be=>{c.value=!0,u.value=h.value+be.filePath,b.value=be.fileName||"夏小明的直播间";try{let Z=d.value+be.filePath.replace(/4$/,"3");const _e=await cB(Z,{baseUrl:e.baseUrl,token:e.token});_e.data&&_e.data.code==0&&(m.value=_e.data.msg)}catch(Z){console.log(Z)}f.value=!0,setTimeout(()=>{f.value=!1},2e3)},F=()=>{c.value=!1},V=()=>{console.log("视频开始播放")},J=()=>{console.log("视频暂停")},ie=()=>{console.log("视频播放结束")},X=be=>{console.error("视频播放错误:",be),Ln.error("视频播放出现错误")},H=be=>{let Z=h.value+be.filePath;q(Z,be.fileName)},$=be=>{v.value=!0,Object.assign(y,be)},j=async()=>{var Z;if(await((Z=D.value)==null?void 0:Z.validate()))try{const _e={id:y.id,fileName:y.fileName},Te=await lB(_e,{baseUrl:e.baseUrl,token:e.token});Te.data.code===0?(Ln.success("重命名成功"),v.value=!1,E()):Ln.error(Te.data.msg)}catch(_e){console.error("重命名失败:",_e),Ln.error("重命名失败")}},B=()=>{var be;v.value=!1,(be=D.value)==null||be.resetFields(),Object.assign(y,{})},q=async(be,Z)=>{const Te=await(await fetch(be)).blob();let Ue=document.createElement("a");Ue.style.display="none",Ue.download=`${Z}.mp4`,Ue.href=URL.createObjectURL(Te),document.body.appendChild(Ue),Ue.click(),document.body.removeChild(Ue)},z=be=>{n.value=be,E()},oe=be=>{r.value=be,n.value=t.value/r.value<n.value?Math.ceil(t.value/r.value):n.value,E()},we=()=>{k.value=!k.value};return l.onMounted(()=>{E()}),(be,Z)=>{const _e=l.resolveComponent("el-input"),Te=l.resolveComponent("el-form-item"),Ue=l.resolveComponent("el-col"),We=l.resolveComponent("el-date-picker"),pe=l.resolveComponent("el-button"),Ne=l.resolveComponent("el-row"),nt=l.resolveComponent("el-form"),le=l.resolveComponent("el-table-column"),Ke=l.resolveComponent("el-table"),ae=l.resolveComponent("el-pagination"),ue=l.resolveComponent("el-icon"),Be=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",uB,[l.createElementVNode("div",dB,[l.createElementVNode("div",hB,[l.createElementVNode("div",fB,[l.createVNode(nt,{ref:"queryFormRef",model:a,"label-width":"90px","label-position":"right",size:"small"},{default:l.withCtx(()=>[l.createVNode(Ne,{gutter:24},{default:l.withCtx(()=>[l.createVNode(Ue,{span:5},{default:l.withCtx(()=>[l.createVNode(Te,{label:"文件名称"},{default:l.withCtx(()=>[l.createVNode(_e,{modelValue:a.fileName,"onUpdate:modelValue":Z[0]||(Z[0]=Ie=>a.fileName=Ie),maxlength:100,placeholder:"请输入文件名称",onInput:A},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(Ue,{span:5},{default:l.withCtx(()=>[l.createVNode(Te,{label:"创建者"},{default:l.withCtx(()=>[l.createVNode(_e,{modelValue:a.ownerName,"onUpdate:modelValue":Z[1]||(Z[1]=Ie=>a.ownerName=Ie),maxlength:100,placeholder:"请输入创建者"},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(Ue,{span:8},{default:l.withCtx(()=>[l.createVNode(Te,{label:"创建时间"},{default:l.withCtx(()=>[l.createVNode(We,{modelValue:a.createdAt,"onUpdate:modelValue":Z[2]||(Z[2]=Ie=>a.createdAt=Ie),type:"datetimerange","start-placeholder":"开始时间","end-placeholder":"结束时间"},null,8,["modelValue"])]),_:1})]),_:1}),l.createVNode(Ue,{span:6},{default:l.withCtx(()=>[l.createVNode(Te,{style:{"text-align":"right","margin-top":"0"}},{default:l.withCtx(()=>[l.createVNode(pe,{onClick:Z[3]||(Z[3]=Ie=>E()),class:"query-btn"},{default:l.withCtx(()=>[l.createTextVNode("查询")]),_:1}),l.createVNode(pe,{onClick:Z[4]||(Z[4]=Ie=>w()),class:"reset"},{default:l.withCtx(()=>[l.createTextVNode("重置")]),_:1})]),_:1})]),_:1})]),_:1})]),_:1},8,["model"])])]),l.createElementVNode("div",pB,[l.createElementVNode("div",mB,[l.createVNode(Ke,{data:o.value,height:"500px","row-key":"id",onSelectionChange:N,style:{background:"#252e3d"},"header-cell-style":{background:"#252e3d",color:"#fff"},border:""},{default:l.withCtx(()=>[l.createVNode(le,{type:"selection",align:"center",width:"55"}),l.createVNode(le,{type:"index",align:"center",label:"序号",width:"80"}),l.createVNode(le,{prop:"fileName",align:"center",label:"文件名称"}),l.createVNode(le,{prop:"createdAt",align:"center",label:"创建时间"}),l.createVNode(le,{prop:"size",align:"center",label:"文件大小"}),l.createVNode(le,{prop:"ownerName",align:"center",label:"文件创建者"}),l.createVNode(le,{prop:"action",align:"center",label:"操作",fixed:"right"},{default:l.withCtx(({row:Ie})=>[l.createVNode(pe,{type:"primary",text:"",size:"small",onClick:tt=>P(Ie)},{default:l.withCtx(()=>[l.createTextVNode("播放")]),_:2},1032,["onClick"]),l.createVNode(pe,{type:"primary",text:"",size:"small",onClick:tt=>H(Ie)},{default:l.withCtx(()=>[l.createTextVNode("下载")]),_:2},1032,["onClick"]),l.createVNode(pe,{type:"primary",text:"",size:"small",onClick:tt=>$(Ie)},{default:l.withCtx(()=>[l.createTextVNode("重命名")]),_:2},1032,["onClick"]),l.createVNode(pe,{type:"primary",text:"",size:"small",onClick:tt=>S(Ie)},{default:l.withCtx(()=>[l.createTextVNode("删除")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),l.createVNode(ae,{"current-page":n.value,"page-size":r.value,"page-sizes":[10,20,30,40],layout:"total, sizes, prev, pager, next, jumper",total:t.value,onSizeChange:oe,onCurrentChange:z,background:""},null,8,["current-page","page-size","total"])])]),l.createVNode(Be,{modelValue:c.value,"onUpdate:modelValue":Z[7]||(Z[7]=Ie=>c.value=Ie),width:"70%",height:"65%",center:"","show-close":!1,fullscreen:k.value,class:l.normalizeClass(["video-dialog",{"is-fullscreen":k.value}])},{title:l.withCtx(()=>[l.createElementVNode("div",gB,[l.createElementVNode("div",vB,[yB,l.createElementVNode("div",bB,l.toDisplayString(b.value),1)]),l.createElementVNode("div",_B,[l.createElementVNode("img",{src:HL,alt:"",class:"fullscreen-icon",onClick:we}),l.createVNode(ue,{class:"el-dialog__close",onClick:Z[5]||(Z[5]=Ie=>c.value=!1),style:{"font-size":"20px"}},{default:l.withCtx(()=>[l.createVNode(l.unref(Sh))]),_:1})])])]),default:l.withCtx(()=>[l.createElementVNode("div",kB,[l.createElementVNode("div",TB,[l.createVNode(sB,{lang:"zh-CN",videoUrl:u.value,controls:!0,"show-custom-button":!0,"hide-snapshot-button":!0,live:!1,hasvideo:!0,onCloseVideo:F,onPlay:V,onPause:J,onEnded:ie,onError:X},null,8,["videoUrl"])]),f.value?(l.openBlock(),l.createElementBlock("div",SB,CB)):(l.openBlock(),l.createElementBlock("div",xB,[EB,l.createElementVNode("div",wB,[l.createVNode(_e,{modelValue:_.value,"onUpdate:modelValue":Z[6]||(Z[6]=Ie=>_.value=Ie),style:{height:"36px"},placeholder:"请输入名称进行查询"},null,8,["modelValue"]),l.createElementVNode("div",DB,l.toDisplayString(m.value),1),AB])]))])]),_:1},8,["modelValue","fullscreen","class"]),l.createVNode(Be,{modelValue:v.value,"onUpdate:modelValue":Z[11]||(Z[11]=Ie=>v.value=Ie),title:"录像重命名",width:"30%",height:"30%",class:"reactName"},{footer:l.withCtx(()=>[l.createVNode(pe,{type:"primary",onClick:Z[9]||(Z[9]=Ie=>j()),style:{width:"80px"}},{default:l.withCtx(()=>[l.createTextVNode("确定")]),_:1}),l.createVNode(pe,{type:"default",onClick:Z[10]||(Z[10]=Ie=>B()),style:{width:"80px"}},{default:l.withCtx(()=>[l.createTextVNode("取消")]),_:1})]),default:l.withCtx(()=>[l.createVNode(nt,{ref_key:"detailFormRef",ref:D,model:y,"label-width":"100px",rules:p,style:{"margin-top":"20px"}},{default:l.withCtx(()=>[l.createVNode(Te,{label:"文件名称",prop:"fileName"},{default:l.withCtx(()=>[l.createVNode(_e,{type:"text",maxlength:50,modelValue:y.fileName,"onUpdate:modelValue":Z[8]||(Z[8]=Ie=>y.fileName=Ie),placeholder:"请输入文件名称"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-4978f656"]]),hn=i=>(l.pushScopeId("data-v-66270129"),i=i(),l.popScopeId(),i),NB={class:"live-address-book-head"},PB={class:"live-address-book-head-title"},OB={class:"live-address-book-content"},MB={class:"content-left-side"},RB=[hn(()=>l.createElementVNode("div",{class:"enter-item-icon enter-item-icon-quick"},null,-1)),hn(()=>l.createElementVNode("div",{class:"enter-item-title"},"快速会议",-1))],LB=[hn(()=>l.createElementVNode("div",{class:"enter-item-icon enter-item-icon-join"},null,-1)),hn(()=>l.createElementVNode("div",{class:"enter-item-title"},"加入会议",-1))],BB=[hn(()=>l.createElementVNode("div",{class:"enter-item-icon enter-item-icon-preview"},null,-1)),hn(()=>l.createElementVNode("div",{class:"enter-item-title"},"预约会议",-1))],UB={class:"left-item"},FB=hn(()=>l.createElementVNode("div",{class:"left-item-title"},[l.createElementVNode("div",{class:"label"},"通讯录")],-1)),VB={class:"left-item-content"},jB={class:"search-bar"},$B=hn(()=>l.createElementVNode("i",{class:"el-input__icon el-icon-search"},null,-1)),HB={class:"custom-tree-node"},qB={key:0,class:"custom-tree-node-user"},zB={key:0,class:"custom-tree-node-prefix-icon",src:b7,alt:""},GB={key:1,class:"custom-tree-node-prefix-icon",src:_7,alt:""},WB=["title"],KB={key:1,class:"custom-tree-node-user",style:{"margin-left":"-20px"}},XB=hn(()=>l.createElementVNode("span",{class:l.normalizeClass(["custom-tree-node-icon"])},null,-1)),YB=["title"],JB={class:"chosen"},QB={class:"chosen-title"},ZB=hn(()=>l.createElementVNode("div",{class:"chosen-title-label"},"已选",-1)),eU={class:"chosen-title-num"},tU=[hn(()=>l.createElementVNode("span",null,"重置",-1))],nU=[hn(()=>l.createElementVNode("img",{class:"option-icon",src:k7,alt:""},null,-1)),hn(()=>l.createElementVNode("span",null,"发起会议",-1))],iU={class:"content-right-side"},rU={class:"meeting-entry-right-head"},sU=hn(()=>l.createElementVNode("img",{class:"logo",src:T7,alt:""},null,-1)),aU={style:{display:"flex","align-items":"center","justify-content":"space-between",width:"100%"}},oU=hn(()=>l.createElementVNode("span",{style:{"margin-right":"30px"}},"今天",-1)),lU={class:"preview-meeting-list-left"},cU={class:"preview-meeting-list-left-primary"},uU=hn(()=>l.createElementVNode("div",{class:"preview-logo"},null,-1)),dU={class:"preview-meeting-name"},hU={class:"preview-meeting-list-left-sub"},fU={class:"meeting-message-item"},pU=hn(()=>l.createElementVNode("div",{class:"meeting-message-item-title"},"发起人:",-1)),mU={class:"meeting-message-item-value"},gU={class:"meeting-message-item"},vU=hn(()=>l.createElementVNode("div",{class:"meeting-message-item-title"},"时间:",-1)),yU={class:"meeting-message-item-value"},bU={class:"meeting-message-item"},_U=hn(()=>l.createElementVNode("div",{class:"meeting-message-item-title"},"会议ID:",-1)),kU={class:"meeting-message-item-value"},TU={class:"preview-meeting-list-right"},SU=["onClick"],CU=["onClick"],xU={key:1,class:"empty-box"},EU=[hn(()=>l.createElementVNode("div",{class:"empty-logo"},null,-1)),hn(()=>l.createElementVNode("div",{class:"empty-text"},"今日暂无会议",-1))],zl=Mt({__name:"LiveAddressBook",props:{title:{type:String,default:"视频会商"},baseUrl:{type:String,default:""},meetingVideo:{type:Boolean,default:!1},userData:{type:Object,default:()=>({})},org:{type:String,default:"default"},token:{type:String,default:""},meetingTitle:{type:String,default:"调度会议"}},emits:["enterDialogClose","quickLaunch","launchMeeting","joinMeeting"],setup(i,{expose:e,emit:t}){let n=null;const r=new wn,s=i,a=t,o=l.ref(!1),c=l.ref(),u=l.ref(),d=l.ref(""),h=l.ref([]),b=l.ref([]),v=l.ref([]),y=l.ref([]),p=l.ref(null),f=l.ref({}),m=l.ref("add"),_=l.ref(!1),k=l.ref(!1),D=l.reactive({left:"0px",top:"0px"}),E=l.ref(""),A=l.ref(!1),w=l.ref("launch"),N=l.computed(()=>v.value.length),S=l.computed(()=>v.value.length>0?v.value.map(Se=>Se.userId):[]),P=l.computed(()=>Qn().format("MM月DD日")),F=l.computed(()=>y.value.length);l.watch(()=>d.value,async Se=>{await l.nextTick(),c.value.filter(Se)}),l.watch(()=>b.value,(Se,Ve)=>{Se.length>0&&Se.forEach(ke=>{X(ke)}),Ve.forEach(ke=>{Se.length>0?Se.findIndex(Pe=>Pe.userId===ke.userId)<0&&H(ke.mobile):(c.value.setChecked(ke.userId,!1,!1),H(ke.mobile))})},{deep:!0});function V(){o.value=!0}function J(Se){return new Promise((Ve,ke)=>{uy({},{baseUrl:s.baseUrl,token:Se||s.token}).then(Me=>{var Pe,it;console.log("获取通讯录组织树",Me),((Pe=Me.data)==null?void 0:Pe.code)===0?(it=Me.data)!=null&&it.data&&(h.value=Me.data.data,Ve()):(r.message("error","获取通讯录组织数据失败"),ke())})})}function ie(Se){return N.value>0?v.value.findIndex(ke=>ke.mobile===Se):-1}function X(Se){if(N.value<=0)v.value.push(Se);else{if(ie(Se.mobile)!==-1)return;v.value.push(Se)}}function H(Se){if(N.value>0){const Ve=ie(Se);Ve!==-1&&v.value.splice(Ve,1)}}function $(){ut.emit("getaddressBookUserForAddressBook")}async function j(Se){b.value=Se,await l.nextTick(),c.value.setCheckedKeys(S.value,!1)}async function B(Se){var Ve;document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement?document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen():(await l.nextTick(),(Ve=u.value)!=null&&Ve.requestFullscreen&&u.value.requestFullscreen())}function q(){a("enterDialogClose")}function z(){A.value=!1}function oe(Se,Ve){return Se?Ve.label.includes(Se):!0}async function we(){await l.nextTick();const Se=c.value.getCheckedNodes(!0,!1);b.value=Se.filter(Ve=>!Ve.children).map(Ve=>be(Ve))}function be(Se){if(Se!=null&&Se.classify&&Se.classify==="设备"){const Ve={userId:Se.id,userName:Se.label,mobile:Se.equipmentCode,...Se};return Ve.mobile=Se.equipmentCode,Ve}else return{userId:Se.id,userName:Se.label,mobile:Se.phone,...Se}}function Z(Se){D8({},{baseUrl:s.baseUrl,token:Se||s.token}).then(Ve=>{var ke;((ke=Ve.data)==null?void 0:ke.code)==0?(y.value=[],Ve.data.data.length>0&&(y.value=Ve.data.data.map(Me=>{var Pe,it;return{roomName:Me.roomAlias,roomNum:Me.roomName,status:Me.status,beginTime:Qn(Me.reserveStart).format("HH:mm"),endTime:Qn(Me.reserveEnd).format("HH:mm"),beginFullTime:Me.reserveStart,endFullTime:Me.reserveEnd,creator:Me.ownerName,realNumParticipants:Me.realNumParticipants,owner:Me.owner,org:Me.org,preMeetingNotify:Me.preMeetingNotify,joinBefore:Me.joinBefore!==0,joinMute:Me.joinMute!==0,autoRecord:Me.autoRecord!==0,inviteOthers:Me.inviteOthers!==0,venueName:Me!=null&&Me.metadata&&Me.metadata!=="null"?(Pe=JSON.parse(Me.metadata))==null?void 0:Pe.venueName:"",meetingCompany:Me!=null&&Me.metadata&&Me.metadata!=="null"?(it=JSON.parse(Me.metadata))==null?void 0:it.meetingCompany:"",zone:Me.zone}}))):y.value=[]})}function _e(Se){console.log(Se,"e123"),f.value=Se,m.value="edit",_.value=!0}function Te(Se){f.value=Se,m.value="detail",_.value=!0}function Ue(Se){const Ve={identity:Se.owner,room:Se.roomNum,org:Se.org};ly(Ve,{baseUrl:window.liveClient.baseUrl,token:s.token}).then(ke=>{(ke==null?void 0:ke.data.code)===200?(rf(Se.roomNum,{baseUrl:s.baseUrl,token:s.token}),r.message("success","成功取消会议"),Z()):r.message("error","取消会议失败")})}function We(Se){const Ve={identity:Se.owner,room:Se.roomNum,org:Se.org};ly(Ve,{baseUrl:window.liveClient.baseUrl,token:s.token}).then(ke=>{(ke==null?void 0:ke.data.code)===200?(rf(Se.roomNum,{baseUrl:s.baseUrl,token:s.token}),Z()):r.message("error","结束会议失败")})}function pe(){a("quickLaunch",{roomName:s.userData.username+"的视频会议",cameraStatus:!0,microphoneStatus:!0,audioInputDevice:"",audioOutputDevice:"",videoDevice:"",inviteList:v.value}),q()}function Ne(Se){const Ve={...Se,inviteList:v.value};a("launchMeeting",Ve),q()}function nt(Se){const Ve={...Se,inviteList:[]};a("joinMeeting",Ve),q()}function le(){b.value=[]}function Ke(){le()}function ae(Se){v.value=Array.isArray(Se)?Se:[],b.value=Array.isArray(Se)?Se:[]}function ue(){w.value="launch",A.value=!0}function Be(){E.value="",w.value="join",A.value=!0}function Ie(){m.value="add",_.value=!0}function tt(Se){E.value=Se.roomNum,w.value="join",A.value=!0}function ze(Se,Ve){var ke;k.value?((ke=p.value)==null?void 0:ke.roomNum)===Se.roomNum?k.value=!1:(k.value=!1,p.value=Se,D.left=Ve.target.offsetLeft-60+"px",D.top=Ve.target.offsetTop+24+"px",k.value=!0):(p.value=Se,D.left=Ve.target.offsetLeft-60+"px",D.top=Ve.target.offsetTop+24+"px",k.value=!0)}return l.onMounted(()=>{n=setInterval(()=>{Z()},5e3)}),l.onBeforeUnmount(()=>{n&&(clearInterval(n),n=null)}),e({getUserAndOrgTreeData:J,getPreviewMeetingList:Z}),(Se,Ve)=>{const ke=l.resolveComponent("el-input"),Me=l.resolveComponent("el-tree"),Pe=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",{class:"live-address-book",ref_key:"rootElm",ref:u},[l.createElementVNode("div",NB,[l.createElementVNode("div",PB,l.toDisplayString(i.title),1),l.createElementVNode("div",{class:"head-btn-group"},[l.createElementVNode("div",{class:"head-btn head-btn-screen",onClick:B}),l.createElementVNode("div",{class:"head-btn head-btn-close",onClick:q})])]),l.createElementVNode("div",OB,[l.createElementVNode("div",MB,[l.createElementVNode("div",{class:"enter-list"},[l.createElementVNode("div",{class:"enter-list-item",onClick:pe},RB),l.createElementVNode("div",{class:"enter-list-item",onClick:Be},LB),l.createElementVNode("div",{class:"enter-list-item",onClick:Ie},BB)]),l.createElementVNode("div",UB,[FB,l.createElementVNode("div",VB,[l.createElementVNode("div",jB,[l.createVNode(ke,{class:"search-input",modelValue:d.value,"onUpdate:modelValue":Ve[0]||(Ve[0]=it=>d.value=it),placeholder:"请输入名称进行搜索"},{suffix:l.withCtx(()=>[$B]),_:1},8,["modelValue"])]),l.createVNode(Me,{class:"tree-content",data:h.value,"default-expand-all":!1,"node-key":"id","show-checkbox":"","filter-node-method":oe,ref_key:"tree",ref:c,onCheck:we},{default:l.withCtx(({node:it,data:bt})=>[l.createElementVNode("span",HB,[bt.children?(l.openBlock(),l.createElementBlock("span",qB,[bt.children.length<=0?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[it.expanded?(l.openBlock(),l.createElementBlock("img",zB)):(l.openBlock(),l.createElementBlock("img",GB))],64)):l.createCommentVNode("",!0),l.createElementVNode("span",{class:"custom-tree-node-label",title:it.label},l.toDisplayString(it.label),9,WB)])):(l.openBlock(),l.createElementBlock("span",KB,[XB,l.createElementVNode("span",{class:"custom-tree-node-label",title:it.label},l.toDisplayString(it.label),9,YB)]))])]),_:1},8,["data"]),l.createElementVNode("div",JB,[l.createElementVNode("div",QB,[ZB,l.createElementVNode("div",eU,l.toDisplayString(N.value),1),l.createElementVNode("div",{class:"chosen-title-icon",onClick:$})])]),l.createElementVNode("div",{class:"options"},[l.createElementVNode("div",{class:"option option-reset",onClick:le},tU),l.createElementVNode("div",{class:"option option-launch",onClick:ue},nU)])])])]),l.createElementVNode("div",iU,[l.createElementVNode("div",rU,[sU,l.createElementVNode("div",aU,[l.createElementVNode("div",null,[oU,l.createElementVNode("span",null,l.toDisplayString(P.value),1)]),i.meetingVideo?(l.openBlock(),l.createElementBlock("div",{key:0,style:{cursor:"pointer"},onClick:V}," 会议录像 ")):l.createCommentVNode("",!0)])]),l.createElementVNode("div",{class:l.normalizeClass(["meeting-entry-right-content",{"meeting-entry-right-content-empty":F.value<=0}])},[F.value>0?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:0},l.renderList(y.value,(it,bt)=>(l.openBlock(),l.createElementBlock("div",{class:"preview-meeting-list",key:"p"+bt},[l.createElementVNode("div",lU,[l.createElementVNode("div",cU,[uU,l.createElementVNode("div",dU,l.toDisplayString(it.roomName),1),l.createElementVNode("div",{class:l.normalizeClass(["preview-meeting-status",it.status==0?"preview-meeting-status-unstart":"preview-meeting-status-start"])},l.toDisplayString(it.status==0?"待开始":"已开始"),3)]),l.createElementVNode("div",hU,[l.createElementVNode("div",fU,[pU,l.createElementVNode("div",mU,l.toDisplayString(it.creator),1)]),l.createElementVNode("div",gU,[vU,l.createElementVNode("div",yU,l.toDisplayString(it.beginTime)+"~"+l.toDisplayString(it.endTime),1)]),l.createElementVNode("div",bU,[_U,l.createElementVNode("div",kU,l.toDisplayString(it.roomNum),1)])])]),l.createElementVNode("div",TU,[l.createElementVNode("div",{class:"enter-btn",onClick:Wt=>tt(it)}," 进入会议 ",8,SU),l.createElementVNode("div",{class:"more-btn",onClick:Wt=>ze(it,Wt)},null,8,CU)])]))),128)):(l.openBlock(),l.createElementBlock("div",xU,EU))],2)])]),l.createVNode(Yp,{inviteList:v.value,baseUrl:i.baseUrl,token:i.token,onInviteListUpdate:j},null,8,["inviteList","baseUrl","token"]),k.value?(l.openBlock(),l.createBlock(wO,{key:0,previewMeetingData:p.value,optionDialogOffset:D,mobile:i.userData.mobile,onUpdateMeetingDetail:_e,onCheckMeetingDetail:Te,onCancelMeeting:Ue,onEndMeeting:We,onClose:Ve[1]||(Ve[1]=it=>k.value=!1)},null,8,["previewMeetingData","optionDialogOffset","mobile"])):l.createCommentVNode("",!0),_.value?(l.openBlock(),l.createBlock(YO,{key:1,width:"540px",title:"预约会议",previewType:m.value,previewMeetingData:f.value,baseUrl:i.baseUrl,inviteList:v.value,userData:i.userData,org:i.org,token:i.token,onClose:Ve[2]||(Ve[2]=it=>_.value=!1),onPreviewSuccess:Z,onUpdateSuccess:Z,onPreviewResetInviteList:Ke,onPreviewUpdateInviteList:ae},null,8,["previewType","previewMeetingData","baseUrl","inviteList","userData","org","token"])):l.createCommentVNode("",!0),A.value?(l.openBlock(),l.createBlock(UC,{key:2,dialogType:w.value,tempRoomNum:E.value,onClose:z,onLaunchMeeting:Ne,onJoinMeeting:nt,meetingTitle:i.meetingTitle},null,8,["dialogType","tempRoomNum","meetingTitle"])):l.createCommentVNode("",!0),l.createVNode(Pe,{modelValue:o.value,"onUpdate:modelValue":Ve[3]||(Ve[3]=it=>o.value=it),width:"80%",onClose:Ve[4]||(Ve[4]=it=>o.value=!1),style:{background:"#252e3d"},class:"history-video-dialog"},{default:l.withCtx(()=>[l.createVNode(IB,{baseUrl:i.baseUrl,token:i.token},null,8,["baseUrl","token"])]),_:1},8,["modelValue"])],512)}}},[["__scopeId","data-v-66270129"]]);zl.install=function(i){i.component("LiveAddressBook",zl)};const jC="/assets/img/meeting/share.png",wU="/assets/img/meeting/chat.png",$C="/assets/img/meeting/record.png",DU="/assets/img/meeting/member.png",AU="/assets/img/meeting/invite.png",IU="/assets/img/meeting/copy-icon.png",hg=i=>(l.pushScopeId("data-v-737c89fc"),i=i(),l.popScopeId(),i),NU={class:"dialog-inner"},PU={class:"mark-list"},OU=hg(()=>l.createElementVNode("div",{class:"mark-list-title"},"会议主题",-1)),MU={class:"mark-list-value"},RU={class:"mark-list"},LU=hg(()=>l.createElementVNode("div",{class:"mark-list-title"},"会议ID",-1)),BU={class:"mark-list-value"},UU={id:"meeting-num"},FU={class:"mark-icon"},VU={class:"mark-list"},jU=hg(()=>l.createElementVNode("div",{class:"mark-list-title"},"会议发起人",-1)),$U={class:"mark-list-value"},HU=Mt({__name:"ThemeDialog",props:{position:{type:Object,default:()=>({left:"0px",top:"36px"})},meetingName:{type:String},meetingNum:{type:String},meetingH5Link:{type:String},meetingWXLink:{type:String},meetingCreator:{type:String}},setup(i){const e=i,t=new wn,n=async s=>{await l.nextTick();let a=document.getElementById(s);if(a){if(navigator.clipboard){const o=a.innerText;console.log("复制内容",o),navigator.clipboard.writeText(o).then(()=>{t.message("success","已复制到剪贴板")}).catch(c=>{t.message("error","复制失败,请重试")})}else t.message("warning","当前浏览器不支持复制内容");a=null}},r=async()=>{if(await l.nextTick(),navigator.clipboard){const s=`会议主题:${e.meetingName}
|
325
|
+
会议ID:${e.meetingNum}
|
326
|
+
会议链接:${e.meetingH5Link}
|
327
|
+
小程序链接:${e.meetingWXLink}
|
328
|
+
会议发起人:${e.meetingCreator}`;navigator.clipboard.writeText(s).then(()=>{t.message("success","已复制到剪贴板")}).catch(a=>{t.message("error","复制失败,请重试")})}else t.message("warning","当前浏览器不支持复制内容")};return(s,a)=>(l.openBlock(),l.createElementBlock("div",{class:"dialog",style:l.normalizeStyle(e.position)},[l.createElementVNode("div",NU,[l.createElementVNode("div",PU,[OU,l.createElementVNode("div",MU,[l.createElementVNode("span",null,l.toDisplayString(i.meetingName),1)])]),l.createElementVNode("div",RU,[LU,l.createElementVNode("div",BU,[l.createElementVNode("span",UU,l.toDisplayString(i.meetingNum),1),l.createElementVNode("div",FU,[l.createElementVNode("img",{src:IU,alt:"",onClick:a[0]||(a[0]=o=>n("meeting-num"))})])])]),l.createElementVNode("div",VU,[jU,l.createElementVNode("div",$U,l.toDisplayString(i.meetingCreator),1)]),l.createElementVNode("div",{class:"dialog-inner-foot"},[l.createElementVNode("div",{class:"dialog-inner-foot-btn",onClick:r},"一键复制")])])],4))}},[["__scopeId","data-v-737c89fc"]]),HC=i=>(l.pushScopeId("data-v-c7fcde8d"),i=i(),l.popScopeId(),i),qU={class:"dialog-inner"},zU={class:"mark-list"},GU=HC(()=>l.createElementVNode("div",{class:"mark-list-title"},"网络质量",-1)),WU={class:"mark-list-value"},KU={class:"mark-list"},XU=HC(()=>l.createElementVNode("div",{class:"mark-list-title"},"通话延迟",-1)),YU={class:"mark-list-value"},JU=Mt({__name:"NetworkDetect",props:{position:{type:Object,default:()=>({left:"0px",top:"25px"})},meetingQuality:{type:String},meetingTTL:{type:[String,Number]}},setup(i){const e=i;return(t,n)=>(l.openBlock(),l.createElementBlock("div",{class:"dialog",style:l.normalizeStyle(e.position)},[l.createElementVNode("div",qU,[l.createElementVNode("div",zU,[GU,l.createElementVNode("div",WU,[l.createElementVNode("span",null,l.toDisplayString(i.meetingQuality),1)])]),l.createElementVNode("div",KU,[XU,l.createElementVNode("div",YU,[l.createElementVNode("span",null,l.toDisplayString(i.meetingTTL)+"ms",1)])])])],4))}},[["__scopeId","data-v-c7fcde8d"]]),QU=i=>(l.pushScopeId("data-v-75b60137"),i=i(),l.popScopeId(),i),ZU={class:"dialog-inner"},eF=["onClick"],tF=QU(()=>l.createElementVNode("div",{class:"icon"},null,-1)),nF={class:"title"},iF=Mt({__name:"LayoutSwitch",props:{position:{type:Object,default:()=>({right:"0px",top:"25px"})},currentLayout:{type:String},layoutList:{type:Array},layoutLabels:{type:Array},currentRoomMode:{type:String}},emits:["setLayout"],setup(i,{emit:e}){const t=new wn,n=i,r=e,s=a=>{n.currentRoomMode==="normal"?r("setLayout",a):t.message("info","点调模式下无法切换布局,请切换到会议模式后重试")};return(a,o)=>(l.openBlock(),l.createElementBlock("div",{class:"dialog",style:l.normalizeStyle(n.position)},[l.createElementVNode("div",ZU,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.layoutList,(c,u)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["layout-list",i.currentLayout===c?"layout-list-"+c+"-active":"layout-list-"+c]),key:c,onClick:d=>s(c)},[tF,l.createElementVNode("div",nF,l.toDisplayString(i.layoutLabels[u]),1)],10,eF))),128))])],4))}},[["__scopeId","data-v-75b60137"]]),fg="/assets/img/index/avatar.png",qC="/assets/img/meeting/mic-off-small.png",zC="/assets/img/meeting/camera-off-small.png",si=i=>(l.pushScopeId("data-v-c24e55d4"),i=i(),l.popScopeId(),i),rF={class:"member-manage"},sF={class:"member-manage-head"},aF={class:"member-manage-head-left"},oF=si(()=>l.createElementVNode("div",{class:"logo"},null,-1)),lF=si(()=>l.createElementVNode("div",{class:"title"},"成员管理",-1)),cF={class:"tab-content"},uF=si(()=>l.createElementVNode("div",{class:"input-suffix-icon"},null,-1)),dF={class:"member-list"},hF={class:"member-list-item-group"},fF=si(()=>l.createElementVNode("img",{class:"avatar",src:fg,alt:""},null,-1)),pF={class:"name"},mF={key:0,class:"host"},gF={class:"member-list-item-group"},vF=["onClick"],yF=["onClick"],bF=["onClick"],_F={class:"tab-content-foot"},kF=[si(()=>l.createElementVNode("img",{class:"btn-icon",src:qC,alt:""},null,-1)),si(()=>l.createElementVNode("span",null,"全员静音",-1))],TF=[si(()=>l.createElementVNode("img",{class:"btn-icon",src:zC,alt:""},null,-1)),si(()=>l.createElementVNode("span",null,"全员关闭摄像头",-1))],SF={class:"tab-content"},CF=si(()=>l.createElementVNode("div",{class:"input-suffix-icon"},null,-1)),xF={class:"member-list"},EF={class:"member-list-item-group"},wF=si(()=>l.createElementVNode("img",{class:"avatar",src:fg,alt:""},null,-1)),DF={class:"name"},AF={key:0,class:"host"},IF={class:"member-list-item-group"},NF=["onClick"],PF=["onClick"],OF={class:"tab-content-foot"},MF=[si(()=>l.createElementVNode("img",{class:"btn-icon",src:qC,alt:""},null,-1)),si(()=>l.createElementVNode("span",null,"全员静音",-1))],RF=[si(()=>l.createElementVNode("img",{class:"btn-icon",src:zC,alt:""},null,-1)),si(()=>l.createElementVNode("span",null,"全员关闭摄像头",-1))],LF=Mt({__name:"MemberManage",props:{joinedList:{type:Array},participants:{type:Array},localIdentity:{type:String},tempInvitedList:{type:Array},inviteList:{type:Array},meetingNum:{type:String},meetingName:{type:String},meetingHost:{type:Object}},emits:["close","participantCameraSwitch","participantMicrophoneSwitch","allCameraClose","allMicrophoneClose","openMoreDialog","closeMoreDialog","appendMemberInvite","removeUnjoinItem","filterJoinedList"],setup(i,{emit:e}){const t=i,n=e,r=l.ref("joined"),s=l.ref(""),a=l.ref(""),o=l.ref([]),c=l.computed(()=>t.participants.length),u=l.computed(()=>t.tempInvitedList.length);function d(w){return t.meetingHost.ownerId===w}function h(w){if(c.value>0){let N=t.participants.findIndex(S=>S.name===w);return N>=0?N:-1}else return-1}const b=(w,N)=>{n("participantCameraSwitch",{identity:w,isMute:N})},v=(w,N)=>{n("participantMicrophoneSwitch",{identity:w,isMute:N})},y=(w,N)=>{n("openMoreDialog",{identity:w,clientX:N.clientX,clientY:N.clientY})},p=w=>{console.log("点击事件",w.target.className),w.target.className.includes("icon-btn-option")||w.target.className.includes("more-icon")||n("closeMoreDialog")},f=()=>{window.addEventListener("click",p)},m=()=>{window.removeEventListener("click",p)},_=(w,N)=>{console.log("tab点击",w,N)},k=w=>{console.log("participants",t.participants),console.log("tempInvitedList",t.tempInvitedList),u.value>0?c.value>0?(o.value=[],t.tempInvitedList.forEach(N=>{h(N.userName)<0&&N.userName.includes(w)&&o.value.push(N)})):o.value=t.tempInvitedList.filter(N=>N.userName.includes(w)):o.value=[],console.log("unjoinList",o.value)},D=w=>{n("removeUnjoinItem",w)},E=w=>{n("appendMemberInvite",w)},A=()=>{n("close")};return l.watch(()=>s.value,w=>{n("filterJoinedList",w)}),l.watch(()=>t.meetingHost.ownerId,w=>{n("filterJoinedList",s.value)}),l.watch(()=>c.value,w=>{k(a.value)}),l.watch(()=>u.value,w=>{k(a.value)}),l.watch(()=>a.value,w=>{k(w)}),l.onMounted(()=>{k(a.value),f()}),l.onBeforeUnmount(()=>{m()}),(w,N)=>{const S=l.resolveComponent("el-input"),P=l.resolveComponent("el-tab-pane"),F=l.resolveComponent("el-tabs");return l.openBlock(),l.createElementBlock("div",rF,[l.createElementVNode("div",sF,[l.createElementVNode("div",aF,[oF,lF,l.withDirectives(l.createElementVNode("div",{class:"num"},l.toDisplayString(c.value),513),[[l.vShow,c.value>0]])]),l.createElementVNode("div",{class:"close",onClick:A})]),l.createVNode(F,{modelValue:r.value,"onUpdate:modelValue":N[6]||(N[6]=V=>r.value=V),class:"member-manage-contain",onTabClick:_},{default:l.withCtx(()=>[l.createVNode(P,{label:"会议中",name:"joined"},{default:l.withCtx(()=>[l.createElementVNode("div",cF,[l.createVNode(S,{modelValue:s.value,"onUpdate:modelValue":N[0]||(N[0]=V=>s.value=V),placeholder:"请输入名称查询"},{suffix:l.withCtx(()=>[uF]),_:1},8,["modelValue"]),l.createElementVNode("div",dF,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.joinedList,V=>(l.openBlock(),l.createElementBlock("div",{class:"member-list-item",key:V.identity},[l.createElementVNode("div",hF,[fF,l.createElementVNode("span",pF,l.toDisplayString(V.name),1),d(V.identity)?(l.openBlock(),l.createElementBlock("span",mF,"主持人")):l.createCommentVNode("",!0)]),l.createElementVNode("div",gF,[l.createElementVNode("div",{class:l.normalizeClass(["icon-btn",V.isMicrophoneEnabled?"icon-btn-mic-on":"icon-btn-mic-off"]),onClick:J=>v(V.identity,V.isMicrophoneEnabled)},null,10,vF),l.createElementVNode("div",{class:l.normalizeClass(["icon-btn",V.isCameraEnabled?"icon-btn-cam-on":"icon-btn-cam-off"]),onClick:J=>b(V.identity,V.isCameraEnabled)},null,10,yF),l.createElementVNode("div",{class:"icon-btn icon-btn-option",onClick:J=>y(V.identity,J)},null,8,bF)])]))),128))]),l.createElementVNode("div",_F,[l.createElementVNode("div",{class:"tab-content-foot-btn",onClick:N[1]||(N[1]=V=>n("allMicrophoneClose"))},kF),l.createElementVNode("div",{class:"tab-content-foot-btn",onClick:N[2]||(N[2]=V=>n("allCameraClose"))},TF)])])]),_:1}),d(i.localIdentity)?(l.openBlock(),l.createBlock(P,{key:0,label:"未入会",name:"unJoin"},{default:l.withCtx(()=>[l.createElementVNode("div",SF,[l.createVNode(S,{modelValue:a.value,"onUpdate:modelValue":N[3]||(N[3]=V=>a.value=V),placeholder:"请输入名称查询"},{suffix:l.withCtx(()=>[CF]),_:1},8,["modelValue"]),l.createElementVNode("div",xF,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.value,V=>(l.openBlock(),l.createElementBlock("div",{class:"member-list-item",key:V.mobile},[l.createElementVNode("div",EF,[wF,l.createElementVNode("span",DF,l.toDisplayString(V.userName),1),d(V.mobile)?(l.openBlock(),l.createElementBlock("span",AF,"主持人")):l.createCommentVNode("",!0)]),l.createElementVNode("div",IF,[l.createElementVNode("div",{class:"text-btn text-btn-remove",onClick:J=>D(V)},"移除",8,NF),l.createElementVNode("div",{class:"text-btn text-btn-invite",onClick:J=>E(V)},"邀请",8,PF)])]))),128))]),l.createElementVNode("div",OF,[l.createElementVNode("div",{class:"tab-content-foot-btn",onClick:N[4]||(N[4]=V=>n("allMicrophoneClose"))},MF),l.createElementVNode("div",{class:"tab-content-foot-btn",onClick:N[5]||(N[5]=V=>n("allCameraClose"))},RF)])])]),_:1})):l.createCommentVNode("",!0)]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-c24e55d4"]]),BF=[{codes:"1F600",char:"😀",name:"grinning face"},{codes:"1F603",char:"😃",name:"grinning face with big eyes"},{codes:"1F604",char:"😄",name:"grinning face with smiling eyes"},{codes:"1F601",char:"😁",name:"beaming face with smiling eyes"},{codes:"1F606",char:"😆",name:"grinning squinting face"},{codes:"1F605",char:"😅",name:"grinning face with sweat"},{codes:"1F923",char:"🤣",name:"rolling on the floor laughing"},{codes:"1F602",char:"😂",name:"face with tears of joy"},{codes:"1F642",char:"🙂",name:"slightly smiling face"},{codes:"1F643",char:"🙃",name:"upside-down face"},{codes:"1F609",char:"😉",name:"winking face"},{codes:"1F60A",char:"😊",name:"smiling face with smiling eyes"},{codes:"1F607",char:"😇",name:"smiling face with halo"},{codes:"1F970",char:"🥰",name:"smiling face with hearts"},{codes:"1F60D",char:"😍",name:"smiling face with heart-eyes"},{codes:"1F929",char:"🤩",name:"star-struck"},{codes:"1F618",char:"😘",name:"face blowing a kiss"},{codes:"1F617",char:"😗",name:"kissing face"},{codes:"1F61A",char:"😚",name:"kissing face with closed eyes"},{codes:"1F619",char:"😙",name:"kissing face with smiling eyes"},{codes:"1F44B",char:"👋",name:"waving hand"},{codes:"1F91A",char:"🤚",name:"raised back of hand"},{codes:"1F590",char:"🖐",name:"hand with fingers splayed"},{codes:"270B",char:"✋",name:"raised hand"},{codes:"1F596",char:"🖖",name:"vulcan salute"},{codes:"1F44C",char:"👌",name:"OK hand"},{codes:"1F90F",char:"🤏",name:"pinching hand"},{codes:"270C",char:"✌",name:"victory hand"},{codes:"1F91E",char:"🤞",name:"crossed fingers"},{codes:"1F91F",char:"🤟",name:"love-you gesture"},{codes:"1F918",char:"🤘",name:"sign of the horns"},{codes:"1F919",char:"🤙",name:"call me hand"},{codes:"1F448",char:"👈",name:"backhand index pointing left"},{codes:"1F449",char:"👉",name:"backhand index pointing right"},{codes:"1F446",char:"👆",name:"backhand index pointing up"},{codes:"1F595",char:"🖕",name:"middle finger"},{codes:"1F447",char:"👇",name:"backhand index pointing down"},{codes:"261D FE0F",char:"☝️",name:"index pointing up"},{codes:"1F44D",char:"👍",name:"thumbs up"},{codes:"1F44E",char:"👎",name:"thumbs down"},{codes:"270A",char:"✊",name:"raised fist"},{codes:"1F44A",char:"👊",name:"oncoming fist"},{codes:"1F91B",char:"🤛",name:"left-facing fist"},{codes:"1F91C",char:"🤜",name:"right-facing fist"}],Gl=i=>(l.pushScopeId("data-v-5dd4cec6"),i=i(),l.popScopeId(),i),UF={class:"chat"},FF=Gl(()=>l.createElementVNode("div",{class:"chat-head-left"},[l.createElementVNode("div",{class:"logo"}),l.createElementVNode("div",{class:"title"},"聊天")],-1)),VF={class:"chat-content",id:"chat-content"},jF={class:"message-item-content"},$F={class:"message-item-content-top"},HF={class:"name"},qF=["src"],zF={key:1,class:"message-item-content-value"},GF=Gl(()=>l.createElementVNode("img",{class:"message-item-avatar",src:fo,alt:""},null,-1)),WF=Gl(()=>l.createElementVNode("img",{class:"message-item-avatar",src:fo,alt:""},null,-1)),KF={class:"message-item-content"},XF={class:"message-item-content-top"},YF={class:"name"},JF=["src"],QF={key:1,class:"message-item-content-value"},ZF={class:"chat-foot"},eV={class:"prefix-btns"},tV={class:"emotion-list"},nV=["onClick"],iV=Gl(()=>l.createElementVNode("div",{class:"btn btn-emoji"},null,-1)),rV=Gl(()=>l.createElementVNode("div",{class:"btn"},null,-1)),sV=Mt({__name:"ChatArea",props:{localIdentity:{type:String},messageList:{type:Array},fileUploadUrl:{type:String},imgUrl:{type:String}},emits:["close","messageSend"],setup(i,{expose:e,emit:t}){const n=i,r=t,s=new wn,a=l.ref(""),o=l.ref([]),c=l.ref(),u=l.ref(),d=l.computed(()=>n.messageList.length),h=()=>{a.value=""},b=async()=>{await l.nextTick();let k=document.getElementById("chat-content");if(!k){console.error("不存在消息队列容器");return}k.scrollTop=k.scrollHeight+180},v=()=>{r("close")},y=k=>{k.length<=0?s.message("error","不能发送空白消息"):r("messageSend",k)},p=k=>/\.(jpg|jpeg|png|gif|bmp)$/i.test(k),f=async k=>{var E,A;console.log("emoji",k);let D="";if(await l.nextTick(),(A=(E=window.getSelection().anchorNode)==null?void 0:E.className)!=null&&A.includes("el-input")){let N=document.getElementById("inputEle").selectionStart;D=a.value.substring(0,N)+k+a.value.substring(N)}else D=a.value+k;a.value=D,c.value.focus()},m=(k,D)=>{if(k.url){const E=n.imgUrl+k.url.substring(k.url.indexOf("/equipmentphoto"));y(E)}},_=k=>p(k.name)?k.size>20*1024*1024?(s.message("error","文件大小不得超过20M"),!1):!0:(s.message("error","请上传图片"),!1);return l.watch(()=>d.value,k=>{b()}),l.onMounted(()=>{BF.forEach(k=>{o.value.push(k.char)})}),e({clearInputContent:h}),(k,D)=>{const E=l.resolveComponent("el-popover"),A=l.resolveComponent("el-upload"),w=l.resolveComponent("el-input");return l.openBlock(),l.createElementBlock("div",UF,[l.createElementVNode("div",{class:"chat-head"},[FF,l.createElementVNode("div",{class:"close",onClick:v})]),l.createElementVNode("div",VF,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.messageList,(N,S)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["message-item",N.origin===i.localIdentity?"message-item-local":"message-item-other"]),key:"m"+S},[N.origin===i.localIdentity?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createElementVNode("div",jF,[l.createElementVNode("div",$F,[l.createElementVNode("span",HF,l.toDisplayString(N.fromName),1),l.createElementVNode("span",null,l.toDisplayString(N.timestamp),1)]),p(N.content)?(l.openBlock(),l.createElementBlock("img",{key:0,class:"message-image",src:N.content,alt:""},null,8,qF)):l.createCommentVNode("",!0),p(N.content)?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",zF,[l.createElementVNode("span",null,l.toDisplayString(N.content),1)]))]),GF],64)):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[WF,l.createElementVNode("div",KF,[l.createElementVNode("div",XF,[l.createElementVNode("span",YF,l.toDisplayString(N.fromName),1),l.createElementVNode("span",null,l.toDisplayString(N.timestamp),1)]),p(N.content)?(l.openBlock(),l.createElementBlock("img",{key:0,class:"message-image",src:N.content,alt:""},null,8,JF)):l.createCommentVNode("",!0),p(N.content)?l.createCommentVNode("",!0):(l.openBlock(),l.createElementBlock("div",QF,[l.createElementVNode("span",null,l.toDisplayString(N.content),1)]))])],64))],2))),128))]),l.createElementVNode("div",ZF,[l.createVNode(w,{ref_key:"inputRef",ref:c,id:"inputEle",modelValue:a.value,"onUpdate:modelValue":D[1]||(D[1]=N=>a.value=N),placeholder:"开始聊天",onKeyup:D[2]||(D[2]=l.withKeys(N=>y(a.value),["enter"]))},{prefix:l.withCtx(()=>[l.createElementVNode("div",eV,[l.createVNode(E,{placement:"top",width:"200",trigger:"hover","popper-class":"custom-popover"},{reference:l.withCtx(()=>[iV]),default:l.withCtx(()=>[l.createElementVNode("div",tV,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.value,(N,S)=>(l.openBlock(),l.createElementBlock("a",{href:"javascript:void(0);",onClick:P=>f(N),key:S,class:"emotion-item"},l.toDisplayString(N),9,nV))),128))])]),_:1}),l.createVNode(A,{ref_key:"uploadRef",ref:u,action:i.fileUploadUrl,multiple:!1,"on-success":m,"before-upload":_},{default:l.withCtx(()=>[rV]),_:1},8,["action"])])]),suffix:l.withCtx(()=>[l.createElementVNode("div",{class:"btn btn-send",onClick:D[0]||(D[0]=N=>y(a.value))})]),_:1},8,["modelValue"])])])}}},[["__scopeId","data-v-5dd4cec6"]]),aV={class:"check-dialog-inner"},oV={class:"control-list"},lV=["onClick"],cV=Mt({__name:"LeaveOptionDialog",props:{position:{type:Object,default:()=>({left:"0px",bottom:"40px"})},otherOptionList:{type:Array,default:()=>["结束会议","离开会议"]}},emits:["cancelMeeting","leaveMeeting","optionClose"],setup(i,{emit:e}){const t=i,n=e,r=s=>{switch(s){case"结束会议":n("cancelMeeting");break;case"离开会议":n("leaveMeeting");break}n("optionClose")};return(s,a)=>(l.openBlock(),l.createElementBlock("div",{class:"check-dialog",style:l.normalizeStyle(t.position)},[l.createElementVNode("div",aV,[l.createElementVNode("div",oV,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(t.otherOptionList,o=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["control-list-item"]),key:o.value,onClick:c=>r(o)},l.toDisplayString(o),9,lV))),128))])])],4))}},[["__scopeId","data-v-e06551cc"]]),GC=i=>(l.pushScopeId("data-v-468c6895"),i=i(),l.popScopeId(),i),uV={class:"appoint-dialog-title"},dV={class:"member-list"},hV=["onClick"],fV=GC(()=>l.createElementVNode("img",{class:"member-item-avatar",src:fg,alt:""},null,-1)),pV={class:"member-item-name"},mV=GC(()=>l.createElementVNode("div",{class:"member-item-check"},null,-1)),gV=Mt({__name:"AppointDialog",props:{position:{type:Object,default:()=>({right:"127px",bottom:"84px"})},title:{type:String,default:"指定主持人"},participants:{type:Array},meetingHost:{type:Object}},emits:["appointHost","closeDialog"],setup(i,{emit:e}){const t=new wn,n=i,r=l.ref([]),s=l.ref(null),a=e,o=l.computed(()=>n.participants.length);function c(h){return n.meetingHost.ownerId===h}const u=()=>{if(c(s.value.ownerId)){t.message("info","当前与会者为已存在的会议主持人,无法更改");return}a("appointHost",s.value),a("closeDialog")},d=h=>{s.value={ownerId:h.identity,ownerName:h.name}};return l.watchEffect(()=>{s.value=n.meetingHost,o.value>0?r.value.length>0?(r.value=r.value.filter(h=>n.participants.findIndex(b=>b.identity===h.identity)>-1),n.participants.forEach(h=>{r.value.findIndex(b=>b.identity===h.identity)<=-1&&r.value.push({identity:h.identity,name:h.name})})):r.value=n.participants.map(h=>({identity:h.identity,name:h.name})):r.value=[]}),l.onMounted(()=>{}),(h,b)=>(l.openBlock(),l.createElementBlock("div",{class:"appoint-dialog",style:l.normalizeStyle(n.position)},[l.createElementVNode("div",uV,l.toDisplayString(n.title),1),l.createElementVNode("div",dV,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(r.value,(v,y)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["member-item",{"member-item-checked":s.value.ownerId===v.identity}]),key:"p"+y,onClick:l.withModifiers(p=>d(v),["stop"])},[fV,l.createElementVNode("span",pV,l.toDisplayString(v.name),1),mV],10,hV))),128))]),l.createElementVNode("div",{class:"appoint-dialog-foot"},[l.createElementVNode("div",{class:"foot-btn",onClick:u},"指定并离开")])],4))}},[["__scopeId","data-v-468c6895"]]),vV=["onClick"],yV=Mt({__name:"MoreOptionDialog",props:{curBlur:{type:String,default:""},identity:{type:String,default:""},optionDialogOffset:{type:Object,default:{left:"0px",top:"0px"}},localIdentity:{type:String},meetingHost:{type:Object},participants:{type:Array},currentDisplayIdentity:{type:String,default:null}},emits:["close","setToBlur","removeFromBlur","closeMicro","closeCamera","setToHost","setToDeafness","cancelDeafness","updateName","remove","distributeScreen","cancelDistributeScreen"],setup(i,{emit:e}){const t=i,n=e,r=l.computed(()=>{if(a(t.localIdentity)){if(o(t.identity))return[t.curBlur===t.identity?"取消设为主屏":"设为主屏","关闭麦克风",t.currentDisplayIdentity===t.identity?"取消分发画面":"分发画面","修改名称","移出会议"]}else return t.curBlur===t.identity?t.identity===t.localIdentity?["取消设为主屏","修改名称"]:["取消设为主屏"]:t.identity===t.localIdentity?["设为主屏","修改名称"]:["设为主屏"]}),s=l.computed(()=>t.participants.length);function a(u){return t.meetingHost.ownerId===u}function o(u){if(s.value>0){const d=t.participants.findIndex(h=>h.identity===u);return d>-1?t.participants[d]:null}else return null}const c=u=>{switch(u){case"设为主屏":n("setToBlur",t.identity);break;case"取消设为主屏":n("removeFromBlur",t.identity);break;case"关闭麦克风":n("closeMicro",t.identity);break;case"分发画面":n("distributeScreen",t.identity);break;case"取消分发画面":n("cancelDistributeScreen",t.identity);break;case"关闭摄像头":n("closeCamera",t.identity);break;case"设为主持人":n("setToHost",t.identity);break;case"置聋":n("setToDeafness",t.identity);break;case"取消置聋":n("cancelDeafness",t.identity);break;case"修改名称":n("updateName",t.identity);break;case"移出会议":n("remove",t.identity);break}n("close")};return l.onMounted(()=>{}),(u,d)=>(l.openBlock(),l.createElementBlock("div",{class:"more-option",style:l.normalizeStyle(t.optionDialogOffset)},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(r.value,(h,b)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(["more-option-item",{"more-option-item-danger":h==="移出会议"}]),key:"o"+b,onClick:v=>c(h)},l.toDisplayString(h),11,vV))),128))],4))}},[["__scopeId","data-v-eb018a10"]]),bV="/assets/img/meeting/close.png",pg=i=>(l.pushScopeId("data-v-d78ab697"),i=i(),l.popScopeId(),i),_V={class:"call-board-title"},kV=pg(()=>l.createElementVNode("span",null,"拨号盘",-1)),TV={class:"call-board-list"},SV=["onClick"],CV={class:"call-board-foot"},xV=[pg(()=>l.createElementVNode("div",{class:"btn-icon"},null,-1))],EV=[pg(()=>l.createElementVNode("div",{class:"btn-icon"},null,-1))],wV=Mt({__name:"CallBoard",props:{position:{type:Object,default:()=>({right:"127px",bottom:"84px"})},defaultCallingMethod:{type:Array,default:()=>["voice","video","mini"]}},emits:["closeCallBoard","phoneCall","miniCall"],setup(i,{emit:e}){const t=new wn,n=i,r=e,s=l.ref(""),a=d=>/^[\d#*]+$/.test(d),o=d=>{s.value+=d},c=()=>{s.value?a(s.value)?r("phoneCall",s.value):t.message("error","手机号中包含不合法字符"):t.message("error","联系方式不能为空")},u=()=>{s.value?r("miniCall",s.value):t.message("error","联系方式不能为空")};return(d,h)=>{const b=l.resolveComponent("el-input");return l.openBlock(),l.createElementBlock("div",{class:"call-board",style:l.normalizeStyle(n.position)},[l.createElementVNode("div",_V,[kV,l.createElementVNode("img",{class:"title-close-icon",src:bV,alt:"",onClick:h[0]||(h[0]=v=>r("closeCallBoard"))})]),l.createVNode(b,{modelValue:s.value,"onUpdate:modelValue":h[1]||(h[1]=v=>s.value=v),type:"mobile",clearable:""},null,8,["modelValue"]),l.createElementVNode("div",TV,[(l.openBlock(),l.createElementBlock(l.Fragment,null,l.renderList("123456789*0#",(v,y)=>l.createElementVNode("div",{class:"call-board-list-item",key:y,onClick:p=>o(v)},l.toDisplayString(v),9,SV)),64))]),l.createElementVNode("div",CV,[i.defaultCallingMethod.includes("video")?(l.openBlock(),l.createElementBlock("div",{key:0,class:"call-board-foot-btn call-btn",onClick:c},xV)):l.createCommentVNode("",!0),i.defaultCallingMethod.includes("mini")?(l.openBlock(),l.createElementBlock("div",{key:1,class:"call-board-foot-btn mini-btn",onClick:u},EV)):l.createCommentVNode("",!0)])],4)}}},[["__scopeId","data-v-d78ab697"]]),DV=i=>(l.pushScopeId("data-v-a0281acb"),i=i(),l.popScopeId(),i),AV={class:"chat-wrap"},IV={class:"chat-content",id:"chat-content"},NV=DV(()=>l.createElementVNode("div",{class:"chat-message"},[l.createElementVNode("span",{class:"msg-content"},"您已进入会议,可以开始聊天了")],-1)),PV={class:"msg-origin"},OV={class:"msg-content"},MV=Mt({__name:"InstantMessage",props:{messageList:{type:Array}},emits:["messageSend"],setup(i,{expose:e,emit:t}){const n=l.ref(""),r=t,s=i,a=l.computed(()=>s.messageList.length);l.watch(()=>a.value,h=>{o()});const o=()=>{let h=document.getElementById("chat-content");if(!h){console.error("不存在对应元素");return}h.scrollTop=h.scrollHeight},c=()=>{n.value.length?r("messageSend",n.value):ElMessage({message:"不能发送空白消息",type:"warning"})},u=h=>/\.(jpg|jpeg|png|gif|bmp)$/i.test(h);return e({clearInput:()=>{n.value=""}}),(h,b)=>{const v=l.resolveComponent("el-input");return l.openBlock(),l.createElementBlock("div",AV,[l.createElementVNode("div",IV,[NV,(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(i.messageList,(y,p)=>(l.openBlock(),l.createElementBlock("div",{class:"chat-message",key:"a"+p},[l.createElementVNode("span",PV,l.toDisplayString(y.fromName)+":",1),l.createElementVNode("span",OV,l.toDisplayString(u(y.content)?"[图片消息]请点击下方聊天按钮查看":y.content),1)]))),128))]),l.createElementVNode("div",null,[l.createVNode(v,{modelValue:n.value,"onUpdate:modelValue":b[0]||(b[0]=y=>n.value=y),placeholder:"说点什么。。。。",clearable:"",onKeyup:l.withKeys(c,["enter"])},null,8,["modelValue"])])])}}},[["__scopeId","data-v-a0281acb"]]),RV=i=>(l.pushScopeId("data-v-68022380"),i=i(),l.popScopeId(),i),LV={class:"CustomHeader"},BV=RV(()=>l.createElementVNode("div",{class:"ivits"},"修改与会者名称",-1)),UV={class:"contentsinit"},FV=Mt({__name:"UpdateNameDialog",emits:["updateNameCancel","updateNameConfirm"],setup(i,{emit:e}){const t=e,n=l.ref(!1),r=l.ref(),s=l.reactive({name:"",sort:1}),a=l.ref(""),o=l.reactive({name:[{required:!0,message:"请输入名称",trigger:"blur"},{min:1,max:10,message:"与会者名称不应超过10个字符",trigger:"blur"}]});ut.on("updateName",d=>{n.value=!0,a.value=d.identity});const c=()=>{t("updateNameCancel"),n.value=!1},u=async()=>{await l.nextTick(),r.value.validate(d=>{console.log("valid",d),d?(t("updateNameConfirm",{name:s.name,identity:a.value}),n.value=!1):console.log("表单校验不通过")})};return l.watch(()=>n.value,d=>{d&&(s.name="")}),(d,h)=>{const b=l.resolveComponent("el-input"),v=l.resolveComponent("el-form-item"),y=l.resolveComponent("el-form"),p=l.resolveComponent("el-dialog");return l.openBlock(),l.createElementBlock("div",null,[l.createVNode(p,{modelValue:n.value,"onUpdate:modelValue":h[2]||(h[2]=f=>n.value=f),"show-close":!1,class:"telephoneInvit",width:"460"},{header:l.withCtx(()=>[l.createElementVNode("div",LV,[BV,l.createElementVNode("div",{class:"close",onClick:h[0]||(h[0]=f=>n.value=!1)})])]),default:l.withCtx(()=>[l.createElementVNode("div",UV,[l.createVNode(y,{model:s,"hide-required-asterisk":"",ref_key:"createForm",ref:r,rules:o,"label-width":"100",class:"customForm"},{default:l.withCtx(()=>[l.createVNode(v,{label:"与会者名称",prop:"name"},{default:l.withCtx(()=>[l.createVNode(b,{modelValue:s.name,"onUpdate:modelValue":h[1]||(h[1]=f=>s.name=f)},null,8,["modelValue"])]),_:1}),l.createVNode(v,{"label-width":"110"},{default:l.withCtx(()=>[l.createElementVNode("div",{class:"isokmul"},[l.createElementVNode("div",{onClick:c},"取消"),l.createElementVNode("div",{onClick:u},"确定")])]),_:1})]),_:1},8,["model","rules"])])]),_:1},8,["modelValue"])])}}},[["__scopeId","data-v-68022380"]]),VV=()=>{const i=l.ref(null),e=s=>{i.value=new IntersectionObserver(s,{root:null,rootMargin:"0px",threshold:.1})};function t(s){i.value&&i.value.observe(s)}function n(s){i.value&&i.value.unobserve(s)}function r(){i.value&&(i.value.disconnect(),i.value=null)}return{interceptionObserver:i,createInterceptionObserver:e,observeElement:t,unobserveElement:n,endInterceptionObserve:r}},jV=()=>{const i=l.ref(!0),e=l.ref(null);function t(s,a){if(s&&s===a.identity||a!=null&&a.isInViewport||e.value===a.identity)return;const o=document.getElementById(`participant-${a.identity}`),c=document.querySelector("#meeting-contain .layout-participant");if(o&&c){if(c.firstChild&&c.firstChild.id===o.id)return;c.insertBefore(o,c.firstChild??null),e.value=a.identity}}function n(s){if(s!=null&&s.isInViewport||e.value===s.identity)return;const a=document.getElementById(`participant-${s.identity}`),o=document.getElementById("meeting-contain");if(a&&o){if(o.firstChild&&o.firstChild.id===a.id)return;o.insertBefore(a,o.firstChild??null),e.value=s.identity}}function r(s,a,o,c){if(i.value&&c&&c.length>0){const u=c.findIndex(d=>d.identity===s.identity);u>=0&&(a==="blur"?t(o,c[u]):n(c[u]))}}return{onSpeakerVoiceMotivate:r}},nn=i=>(l.pushScopeId("data-v-5ba2b479"),i=i(),l.popScopeId(),i),$V={class:l.normalizeClass(["meeting-room-top-bar"])},HV={class:"bar-group"},qV=nn(()=>l.createElementVNode("div",{class:"meeting-theme"},[l.createElementVNode("div",{class:"meeting-theme-logo"}),l.createElementVNode("span",{style:{"white-space":"nowrap"}},"会议主题")],-1)),zV={class:"meeting-name-text"},GV=nn(()=>l.createElementVNode("div",{class:"meeting-name-icon"},null,-1)),WV={class:"meeting-duration"},KV=nn(()=>l.createElementVNode("div",{class:"meeting-duration-logo"},null,-1)),XV={class:"bar-group"},YV={class:"meeting-room-contain"},JV={class:"bar-group"},QV={class:"custom-select"},ZV=[nn(()=>l.createElementVNode("div",{class:"arrow-icon"},null,-1))],ej={class:"custom-select"},tj=[nn(()=>l.createElementVNode("div",{class:"arrow-icon"},null,-1))],nj={class:"bar-group"},ij={key:0,class:"custom-select"},rj=nn(()=>l.createElementVNode("div",{class:"theme-icon"},null,-1)),sj=nn(()=>l.createElementVNode("div",{class:"theme-text"},"会议模式",-1)),aj=[nn(()=>l.createElementVNode("div",{class:"arrow-icon"},null,-1))],oj=[nn(()=>l.createElementVNode("img",{class:"t-btn-icon",src:jC,alt:""},null,-1)),nn(()=>l.createElementVNode("span",null,"共享屏幕",-1))],lj=[nn(()=>l.createElementVNode("img",{class:"t-btn-icon",src:jC,alt:""},null,-1)),nn(()=>l.createElementVNode("span",null,"结束共享",-1))],cj=[nn(()=>l.createElementVNode("img",{class:"t-btn-icon",src:wU,alt:""},null,-1)),nn(()=>l.createElementVNode("span",null,"聊天",-1))],uj=[nn(()=>l.createElementVNode("img",{class:"t-btn-icon",src:$C,alt:""},null,-1)),nn(()=>l.createElementVNode("span",null,"录制",-1))],dj=[nn(()=>l.createElementVNode("img",{class:"t-btn-icon",src:$C,alt:""},null,-1)),nn(()=>l.createElementVNode("span",null,"结束录制",-1))],hj=[nn(()=>l.createElementVNode("img",{class:"t-btn-icon",src:DU,alt:""},null,-1)),nn(()=>l.createElementVNode("span",null,"成员管理",-1))],fj=[nn(()=>l.createElementVNode("span",null,"一键VOLTE",-1))],pj=[nn(()=>l.createElementVNode("img",{class:"t-btn-icon",src:AU,alt:""},null,-1))],mj=nn(()=>l.createElementVNode("img",{class:"t-btn-icon",src:P_,alt:""},null,-1)),gj={class:"meeting-room-contain-right"},ia=`
|
329
|
+
<div class="board">
|
330
|
+
<div class="board-icon"></div>
|
331
|
+
</div>
|
332
|
+
<div class="describe">
|
333
|
+
<div class="describe-left">
|
334
|
+
<div class="avatar"></div>
|
335
|
+
<div class="identity">空缺席位</div>
|
336
|
+
</div>
|
337
|
+
<div class="tools"></div>
|
338
|
+
</div>
|
339
|
+
`,Wl=Mt({__name:"LiveMultipleMeeting",props:{tempMeetingName:{type:String,default:""},tempMeetingNum:{type:String,default:""},tempCameraStatus:{type:Boolean},meetingVideo:{type:Boolean,default:!1},tempMicroStatus:{type:Boolean},tempActiveDevice:{type:Object,default:()=>({})},tempInviteList:{type:Array,default:()=>[]},baseUrl:{type:String,default:""},meetingUrl:{type:String,default:""},userData:{type:Object,default:()=>({})},org:{type:String,default:"default"},joinType:{type:String,default:"launch"},token:{type:String,default:""},fileUploadUrl:{type:String},imgUrl:{type:String},h5Url:{type:String,default:""},isCustomizeMiniInvitations:{type:Boolean,default:!1},miniPagePath:{type:String,default:""},defaultInviteWay:{type:String,default:"mini"},wxOfficial:{type:Boolean,default:!1},defaultCallingMethod:{type:Array,default:()=>["voice","video","mini"]}},emits:["multiMeetingClose","miniInviteSend","inviteMessageSend"],setup(i,{expose:e,emit:t}){const n=i,r=t,s=l.ref(),a=l.ref(""),o=l.ref(""),c=l.ref(""),u=l.ref([]),d=l.ref([]),h=l.ref([]),b=l.ref([]),v=l.ref(""),y=l.ref({ownerId:"",ownerName:""}),p=l.ref(""),f=l.ref(""),m=l.ref(""),_=l.ref(""),k=l.ref([]),D=l.ref([]),E=l.ref([]),A=l.reactive({audioInputDevice:"",audioOutputDevice:"",videoDevice:""}),w=l.ref([]),N=l.ref(""),S=l.ref(""),P=l.ref("grid"),F=l.ref("normal"),V=l.ref(["grid","rightSide"]),J=l.ref(["宫格","右侧边栏"]),ie=l.ref(0),X=l.ref(!1),H=l.ref(!1),$=l.ref(!1),j=l.ref(!1),B=l.ref(!1),q=l.ref(!1),z=l.ref(!1),oe=l.ref(!1),we=l.ref(!1),be=l.ref(!1),Z=l.ref(!1),_e=l.ref(!1),Te=l.ref(null),Ue=l.ref([]),We=l.ref([]),pe=l.ref(null),Ne=l.ref(null),nt=l.ref(!1),le=l.ref({}),Ke=l.ref(!1),ae=l.ref(!1),ue=l.ref(!1),Be=l.ref(!1),Ie=l.ref(""),tt=l.ref(!1),ze=l.ref(3);l.ref("测试短信");const Se=l.ref(!1),Ve=l.ref(!1),ke=l.ref(!1),Me=l.ref(!1),Pe=l.ref({}),it=l.ref(!1),bt=l.ref(!1),Wt=l.ref({}),On=l.ref(null),_i=l.ref(!1),ai=l.ref(""),St=l.ref(!0),kr=l.ref(!1),Cn=l.ref(null),$r=l.ref(),Xi=l.ref();l.ref(0);const{createInterceptionObserver:ki,observeElement:Yn,unobserveElement:Hr,endInterceptionObserve:qr}=VV();jV();const U=M=>{console.log(`交叉观察器触发,检测到 ${M.length} 个元素变化`),M.forEach(R=>{console.log("观察器目标元素:",{id:R.target.id,className:R.target.className,tagName:R.target.tagName});const W=R.target.getAttribute("data-identity");if(!W){console.log(`❌ 无法获取参与者identity,元素ID: ${R.target.id}`);return}const Q=document.getElementById(`video-${W}`);console.log(`参与者 ${W} 视口状态变化:`,{isIntersecting:R.isIntersecting,intersectionRatio:R.intersectionRatio,boundingClientRect:R.boundingClientRect});const se=h.value.findIndex(ye=>ye.identity===W);if(se===-1){if(console.log(`未找到参与者: ${W},尝试从DOM元素获取数据`),!document.getElementById(`participant-${W}`)){console.log(`❌ 无法找到参与者元素: ${W}`);return}setTimeout(()=>{const ge=h.value.findIndex(me=>me.identity===W);if(ge!==-1){const me=h.value[ge];console.log(`✅ 重试找到参与者: ${W}`),R.isIntersecting?(me.isInViewport=!0,me.videoTrack&&Q&&(!Q.src&&!Q.currentSrc?requestAnimationFrame(()=>{me.videoTrack.attach(Q),console.log(`✅ 重试渲染视频: ${W}`)}):console.log(`✅ 重试时视频已在渲染: ${W}`))):(me.isInViewport=!1,me.videoTrack&&requestAnimationFrame(()=>{me.videoTrack.detach(),console.log(`❌ 重试停止渲染视频: ${W}`)}))}else console.log(`❌ 重试后仍未找到参与者: ${W}`)},50);return}const de=h.value[se];R.isIntersecting?(de.isInViewport=!0,de.videoTrack&&Q?!Q.src&&!Q.currentSrc?requestAnimationFrame(()=>{de.videoTrack.attach(Q),console.log(`✅ 开始渲染视频: ${W}`)}):console.log(`✅ 视频已在渲染: ${W}`):console.log(`❌ 无法渲染视频: ${W}`,{hasVideoTrack:!!de.videoTrack,hasVideoElement:!!Q,videoTrackDetails:de.videoTrack?{id:de.videoTrack.id,kind:de.videoTrack.kind,enabled:de.videoTrack.enabled,muted:de.videoTrack.muted}:null})):(de.isInViewport=!1,de.videoTrack&&requestAnimationFrame(()=>{de.videoTrack.detach(),console.log(`❌ 停止渲染视频: ${W}`)}))})},G=()=>{ki(U),console.log("交叉观察器已初始化")},re=()=>{console.log("=== 视频渲染状态调试 ==="),console.log("当前布局:",P.value),console.log("麦克风状态:",we.value),console.log("参与者数量:",h.value.length),h.value.forEach(M=>{const R=document.getElementById(`video-${M.identity}`),W=document.getElementById(`participant-${M.identity}`);console.log(`参与者 ${M.identity}:`,{hasVideoTrack:!!M.videoTrack,hasVideoElement:!!R,hasParticipantElement:!!W,isInViewport:M.isInViewport,videoElementSrc:R?R.src:"N/A"})})},ve=()=>{console.log("=== 手动触发视口检测 ==="),document.querySelectorAll('[id^="participant-"]').forEach(R=>{const W=R.getAttribute("data-identity"),Q=R.getBoundingClientRect(),se=Q.top>=0&&Q.left>=0&&Q.bottom<=window.innerHeight&&Q.right<=window.innerWidth;if(console.log(`参与者 ${W} 手动检测:`,{rect:Q,isInViewport:se,windowSize:{width:window.innerWidth,height:window.innerHeight}}),se&&P.value==="grid"){const de=document.getElementById(`video-${W}`),ye=h.value.find(ge=>ge.identity===W);ye&&ye.videoTrack&&de?(ye.videoTrack.attach(de),console.log(`✅ 手动渲染视频: ${W}`)):console.log(`❌ 无法手动渲染视频: ${W}`,{hasParticipantData:!!ye,hasVideoTrack:ye?!!ye.videoTrack:!1,hasVideoElement:!!de})}})},He=()=>{console.log("=== 检查中间三个参与者状态 ===");const M=document.querySelectorAll('[id^="participant-"]'),R=Array.from(M).map(ye=>{const ge=ye.getAttribute("data-identity"),me=ye.getBoundingClientRect();return{identity:ge,rect:me,element:ye}});R.sort((ye,ge)=>ye.rect.top-ge.rect.top);const W=3,Q=W,se=W*2,de=R.slice(Q,se);console.log("中间行参与者:",de.map(ye=>ye.identity)),de.forEach(ye=>{const ge=ye.identity,me=document.getElementById(`video-${ge}`),Ze=h.value.find(Ye=>Ye.identity===ge);if(console.log(`中间参与者 ${ge} 详细状态:`,{hasParticipantData:!!Ze,hasVideoTrack:Ze?!!Ze.videoTrack:!1,hasVideoElement:!!me,videoTrackDetails:Ze&&Ze.videoTrack?{id:Ze.videoTrack.id,kind:Ze.videoTrack.kind,enabled:Ze.videoTrack.enabled,muted:Ze.videoTrack.muted,readyState:Ze.videoTrack.readyState}:null,videoElementDetails:me?{src:me.src,currentSrc:me.currentSrc,readyState:me.readyState,videoWidth:me.videoWidth,videoHeight:me.videoHeight,paused:me.paused,ended:me.ended,error:me.error}:null}),Ze&&Ze.videoTrack&&me){const Ye=ye.element.getBoundingClientRect(),kt=Ye.top>=0&&Ye.left>=0&&Ye.bottom<=window.innerHeight&&Ye.right<=window.innerWidth;console.log(`中间参与者 ${ge} 视口检查:`,{rect:Ye,isInViewport:kt,windowSize:{width:window.innerWidth,height:window.innerHeight}}),kt&&!me.src&&!me.currentSrc&&(console.log(`🔧 强制渲染中间参与者: ${ge}`),Ze.videoTrack.attach(me))}})},at=()=>{console.log("=== 强制检查所有参与者视口状态 ==="),h.value.forEach(M=>{const R=document.getElementById(`participant-${M.identity}`),W=document.getElementById(`video-${M.identity}`);if(R&&W){const Q=R.getBoundingClientRect(),se=Q.top>=0&&Q.left>=0&&Q.bottom<=window.innerHeight&&Q.right<=window.innerWidth;console.log(`参与者 ${M.identity} 强制检查:`,{isInViewport:se,hasVideoTrack:!!M.videoTrack,videoSrc:W.src,videoCurrentSrc:W.currentSrc,videoReadyState:W.readyState,videoWidth:W.videoWidth,videoHeight:W.videoHeight}),se&&M.videoTrack&&!W.src&&!W.currentSrc&&(console.log(`🔧 强制重新attach: ${M.identity}`),M.videoTrack.detach(),setTimeout(()=>{M.videoTrack.attach(W)},50))}})},Xe=new wn;let Re=null,yn=null,Qt=null,Gt=null;const Mi=l.computed(()=>Yg(ie.value)),Ft=l.computed(()=>h.value.length);ut.on("voiceMotivationChange",M=>{ae.value=!!M}),ut.on("autoAnswerChange",M=>{ue.value=!!M}),ut.on("autoPollingToggle",M=>{if(Be.value=!!M,M){try{const R=localStorage.getItem("hx_device_setter_settings");if(R){const W=JSON.parse(R);W&&typeof W.pollingIntervalMs=="number"&&W.pollingIntervalMs>0&&D_(W.pollingIntervalMs)}}catch(R){console.warn("读取轮询间隔设置失败",R)}Gu(!0)}else{try{Gu(!1)}catch(R){console.error("setPollingEnabled error:",R)}ut.emit("updateVisibleParticipants",{participants:(h.value||[]).slice(0,16),currentIndex:0,isPolling:!1,action:"replace"})}}),ut.on("pollingIntervalChange",M=>{try{D_(M),kl()}catch(R){console.warn("设置轮询间隔失败",R)}});const bn=l.computed(()=>u.value.length),Nt=l.computed(()=>d.value.length),Yi=l.computed(()=>Ft.value>0?h.value.findIndex(R=>R.isScreenShareEnabled):-1),zr=l.computed(()=>F.value==="pointTurn"?"point-turn":P.value==="grid"?Ft.value<=1?"grid1":Ft.value<=2?"grid2":Ft.value<=4?"grid3":Ft.value<=6?"grid4":"grid5":P.value);function rn(M){var de;if(P.value!=="rightSide")return;const R=document.querySelector("#room .layout-rightside");if(!R)return;const W=5,Q=[...M];let se=0;for(let ye=0;ye<Q.length&&se<W;ye++){const ge=(de=Q[ye])==null?void 0:de.identity;if(!ge)continue;const me=document.getElementById(`participant-${ge}`);me&&R.contains(me)&&(R.appendChild(me),se++)}}const oi=async M=>{var R,W;try{const Q={display:M,org:n.org||"default",room:o.value},se=await VC(Q,{baseUrl:n.meetingUrl,token:n.token});((R=se==null?void 0:se.data)==null?void 0:R.code)===0||(se==null?void 0:se.status)===200?(Cn.value=M,Xe.message("success","分发画面成功")):Xe.message("error",((W=se==null?void 0:se.data)==null?void 0:W.msg)||"分发画面失败")}catch(Q){console.error("分发画面失败",Q),Xe.message("error","分发画面失败,请稍后重试")}},Ti=async M=>{var R,W;try{const Q={display:" ",org:n.org||"default",room:o.value},se=await VC(Q,{baseUrl:n.meetingUrl,token:n.token});((R=se==null?void 0:se.data)==null?void 0:R.code)===0||(se==null?void 0:se.status)===200?(Cn.value=null,Xe.message("success","取消分发画面成功")):Xe.message("error",((W=se==null?void 0:se.data)==null?void 0:W.msg)||"取消分发画面失败")}catch(Q){console.error("取消分发画面失败",Q),Xe.message("error","取消分发画面失败,请稍后重试")}};function xt(M){if(P.value=M,M==="grid")l.nextTick(()=>{const R=document.querySelectorAll('[id^="participant-"]');console.log(`切换到宫格布局,设置观察器,参与者数量: ${R.length}`),R.forEach((W,Q)=>{const se=W.getAttribute("data-identity");W.hasAttribute("data-observer-set")?console.log(`参与者 ${se} 已设置过观察器,跳过`):(Yn(W),W.setAttribute("data-observer-set","true"),console.log(`设置观察器 ${Q+1}: ${se}`))}),setTimeout(()=>{re(),ve(),He(),at()},100)});else{const R=document.querySelectorAll('[id^="participant-"]');console.log(`切换到其他布局,停止观察,参与者数量: ${R.length}`),R.forEach(W=>{Hr(W),W.removeAttribute("data-observer-set");const Q=W.getAttribute("data-identity"),se=W.querySelector("video");if(se&&Q){const de=h.value.find(ye=>ye.identity===Q);de&&de.videoTrack&&(de.videoTrack.attach(se),console.log(`恢复视频渲染: ${Q}`))}})}}function Ud(M){const R=document.getElementById("room");if(!R)return;R.style.position="relative",R.querySelectorAll('[id^="participant-"]').forEach(se=>{se.style.display="none"});const Q=document.getElementById(`participant-${M}`);if(Q){Q.style.display="block",Q.style.position="absolute",Q.style.top="0",Q.style.left="0",Q.style.width="100%",Q.style.height="100%",Q.style.maxHeight="none",Q.style.zIndex="99",Q.style.margin="0",Q.style.borderRadius="0";const se=Q.querySelector("video");se&&(se.style.width="100%",se.style.height="100%",se.style.objectFit="cover",se.style.borderRadius="0");const de=Q.querySelector("canvas");de&&(de.style.width="100%",de.style.height="100%",de.style.objectFit="cover",de.style.borderRadius="0");const ye=Q.querySelector(".describe");ye&&(ye.style.position="absolute",ye.style.bottom="20px",ye.style.left="20px",ye.style.right="auto",ye.style.zIndex="1000")}}function go(){const M=document.getElementById("room");if(!M)return;M.style.position="",M.querySelectorAll('[id^="participant-"]').forEach(W=>{W.style.display="block",W.style.position="",W.style.top="",W.style.left="",W.style.width="",W.style.height="",W.style.maxHeight="",W.style.zIndex="",W.style.margin="",W.style.borderRadius="";const Q=W.querySelector("video");Q&&(Q.style.width="",Q.style.height="",Q.style.objectFit="",Q.style.borderRadius="");const se=W.querySelector("canvas");se&&(se.style.width="",se.style.height="",se.style.objectFit="",se.style.borderRadius="");const de=W.querySelector(".describe");de&&(de.style.position="",de.style.bottom="",de.style.left="",de.style.right="",de.style.zIndex="")})}function li(M){return y.value.ownerId===M}function Fd(M){if(Ft.value>0){let R=h.value.findIndex(W=>W.identity===M);return R>=0?R:-1}else return-1}function Ji(M){if(Nt.value<=0)d.value.push(M);else{if(d.value.findIndex(W=>W.mobile===M.mobile)>-1)return;d.value.push(M)}}function jt(M){if(M.audioTrack||M.videoTrack)if(Ft.value<=0)h.value.push(M);else{const R=Fd(M.identity);R!==-1?h.value.splice(R,1,M):h.value.push(M)}console.log(`参与者 ${M.identity} 已添加到数组,当前数组长度: ${h.value.length}`)}function Vd(M){y.value.ownerId=M.hostId,y.value.ownerName=M.hostName}function vo(M){if(Ft.value>0){let R=Fd(M);R!==-1&&h.value.splice(R,1)}}function yo(){b.value=[],h.value.forEach(M=>{M.name.includes(v.value)&&b.value.push({identity:M==null?void 0:M.identity,name:M.name,audioLevel:M.audioLevel,isCameraEnabled:M.isCameraEnabled,isLocal:M.isLocal,isMicrophoneEnabled:M.isMicrophoneEnabled,isScreenShareEnabled:M.isScreenShareEnabled,isSpeaking:M.isSpeaking,sid:M.sid,metadata:M.metadata})})}function yg(M){v.value=M,yo()}function bg(M){if(bn.value>0){let R=bo(M);R!==-1&&u.value.splice(R,1)}}function jd(M){(bn.value<=0||bo(M.mobile)<0)&&u.value.push(M)}function bo(M){return bn.value>0?u.value.findIndex(W=>W.mobile===M):-1}function Kl(M){if(Nt.value>0){const R=d.value.findIndex(W=>W.mobile===M);R!==-1&&d.value.splice(R,1)}}function Xl(M){return Ft.value>0?h.value.findIndex(W=>W.isScreenShareEnabled&&W.identity!==M):-1}function _g(M){w.value.push(M)}function Yl(M){if(Ft.value>0){const R=h.value.findIndex(W=>W.identity===M);return R>-1?h.value[R]:null}else return null}function ra(){if(Ft.value>0){const M=h.value.findIndex(R=>R.isLocal);return M>-1?h.value[M]:null}else return null}const _o=M=>{const W=window.innerHeight,Q=M.clientY,se=10;let de;const ye=W-Q,ge=Q;ye>=268+se?de=Q+se+"px":ge>=268+se?de=Q-268-se+"px":ye>ge?de=Math.max(10,W-268-10)+"px":de=Math.min(Q-se,10)+"px",le.value={left:X.value?M.clientX-120+"px":M.clientX-400+"px",top:de},Ie.value===M.identity&&nt.value?nt.value=!1:(nt.value=!1,Ie.value=M.identity,nt.value=!0)};function $d(M){var W;Kl(M.mobile),bg(M.mobile);const R=u.value.map(Q=>(Q==null?void 0:Q.classify)==="人员"?{roomName:o.value,roomAlias:a.value,userId:Q.userId,userName:Q.userName,officeName:Q==null?void 0:Q.officeName,metadata:JSON.stringify({classify:Q==null?void 0:Q.classify,phone:Q==null?void 0:Q.mobile})}:{roomName:o.value,roomAlias:a.value,userId:Q.userId,userName:Q.userName,officeName:Q==null?void 0:Q.officeName,metadata:JSON.stringify({phone:"",classify:Q==null?void 0:Q.classify,equipmentCode:Q==null?void 0:Q.mobile,equipmentPassword:Q==null?void 0:Q.equipmentPassword,equipmentType:Q==null?void 0:Q.equipmentType})});n.joinType==="launch"&&R.findIndex(se=>se.userId===n.userData.userId)<0&&R.push({roomName:o.value,roomAlias:a.value,userId:n.userData.userId,userName:n.userData.username,officeName:(W=n.userData)==null?void 0:W.officeName,metadata:JSON.stringify({classify:"人员",phone:n.userData.mobile})}),Ko(R,{baseUrl:n.baseUrl,token:n.token}).then(Q=>{console.log("储存已邀请用户",Q)})}const sa=()=>{nt.value=!1},aa=async()=>{try{const{audioDevices:M,videoDevices:R,outputDevices:W}=await sg.getDeviceList();k.value=M.map(Q=>({label:Q.label,value:Q.deviceId})),D.value=R.map(Q=>({label:Q.label,value:Q.deviceId})),E.value=W.map(Q=>({label:Q.label,value:Q.deviceId}))}catch{Xe.message("error","获取设备列表失败")}},$t=M=>{Ue.value.indexOf(M)<0&&Ue.value.push(M)},oa=()=>{yn&&(clearInterval(yn),yn=null),Qt&&(clearInterval(Qt),Qt=null),Gt&&(clearInterval(Gt),Gt=null)},kg=()=>{We.value.length>0&&We.value.forEach(M=>{M==null||M.detach(),M==null||M.stop()})},Hd=()=>{Re&&Ue.value.length>0&&Ue.value.forEach(M=>{console.log("解除绑定事件:",M),Re.off(M)})},la=()=>{ke.value=!0,r("multiMeetingClose")},ko=async()=>{if(Re){await Re.leaveRoom();try{Ve.value&&o.value&&await rf(o.value,{baseUrl:n.baseUrl,token:n.token})}catch(M){console.error("delScheduleConf error",M)}}},Tr=M=>{li(p.value)?Me.value?Me.value=!1:(Pe.value={left:M.target.offsetLeft-40+"px",bottom:M.target.offsetTop+60+"px"},Me.value=!0):(Ve.value=!1,ko())},To=M=>{li(p.value)?Me.value?Me.value=!1:(Pe.value={left:M.target.offsetLeft-140+"px",bottom:M.target.offsetTop+60+"px"},Me.value=!0):(Ve.value=!1,ko())},qd=async()=>{kr.value?(Ve.value=!0,ko()):Sv.confirm("点击结束会议后会议将被解散,您确定要这么做么?","警告",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{Ve.value=!0,ko()}).catch(()=>{})},Jl=()=>{Ft.value<=1&&li(p.value)?qd():it.value=!0},Ql=M=>{Re.setParticipantToHost(M.ownerId,M.ownerName).then(()=>{console.log(`成功指派 ${M.ownerName} 为主持人`)}).catch(R=>{console.error(`指派 ${M.ownerName} 失败`,R)})},Si=()=>{var R;if(!Re||!(Re!=null&&Re.room))return;let M=null;switch((R=Re.room)==null?void 0:R.localParticipant.connectionQuality){case"excellent":case"good":M="良好";break;case"poor":M="较差";break;case"lost":case"unknown":M="极差";break}m.value=M??"暂无"},zd=async()=>{let M={echoCancellation:!0,noiseSuppression:!0,roomNum:o.value,cameraStatus:be.value,microphoneStatus:we.value,audioDeviceId:A.audioInputDevice,videoDeviceId:A.videoDevice,outputDeviceId:A.audioOutputDevice},R=null;try{R=await Re.joinRoom(M),A&&(A.audioInputDevice=R==null?void 0:R.audioInputDevice,A.audioOutputDevice=R==null?void 0:R.audioOutputDevice,A.videoDevice=R==null?void 0:R.videoInputDevice,console.log("activeDevice:",A))}catch(W){console.error("加入会议失败",W)}},So=async M=>{var R;try{await dy(o.value,M,{baseUrl:n.baseUrl,token:n.token});const W=await fy(o.value,{baseUrl:n.baseUrl,token:n.token}),Q=(R=W==null?void 0:W.data)==null?void 0:R.msg;Q&&await nf({dnis:Q,mute:!0,name:"重庆市卫健委",org:"default",room:o.value,type:6},{baseUrl:n.meetingUrl,token:n.token})}catch(W){console.error("scheduleConfAndCall error",W)}},Gr=async M=>{if(!M||M.length===0)return;const R=M.filter(de=>de.proxy),W=M.filter(de=>!de.proxy),Q=W.map(de=>de&&de.uri?F8(o.value,[de],{baseUrl:n.baseUrl,token:n.token}):Re.makeCall(de.userName,de.mobile,Number(de.equipmentType))),se=async(de,ye=8)=>{let ge=0;const me=[],Ze=Array.from({length:ye},async()=>{for(;ge<de.length;){const Ye=ge++,kt=de[Ye];let Wr=!1;for(let sn=1;sn<=1&&!Wr;sn++){try{const{data:qn}=await nf({name:kt.userName,dnis:kt.mobile,type:Number(kt.equipmentType),proxy:kt.proxy,org:n.org,room:o.value},{baseUrl:n.meetingUrl});if(qn.code===200)Wr=!0,Ji(kt),me[Ye]={success:!0,item:kt};else if(qn.code===500)console.warn(`外呼邀请失败 (${kt.userName}),状态码: 500,尝试重试 ${sn}/6`);else{console.error(`外呼邀请失败 (${kt.userName}),状态码: ${qn.code}`),Xe.message("error",`外呼邀请失败 (${kt.userName}): ${qn.msg||"未知错误"}`),me[Ye]={success:!1,item:kt,error:new Error(`Status code ${qn.code}`)};break}}catch(qn){console.error(`外呼邀请异常 (${kt.userName})`,qn),sn===6&&(Xe.message("error",`外呼邀请异常 (${kt.userName}): ${qn.msg||"网络异常"}`),me[Ye]={success:!1,item:kt,error:qn})}!Wr&&sn<6&&await new Promise(qn=>setTimeout(qn,200*sn))}}});return await Promise.all(Ze),me};try{const[de,ye]=await Promise.all([Promise.allSettled(Q),se(R,8)]),ge=de.filter(Ye=>Ye.status==="rejected");ge.length>0&&(console.error(`无proxy设备邀请失败: ${ge.length}个`),ge.forEach((Ye,kt)=>{const Wr=W[kt];Xe.message("error",`设备邀请失败 (${Wr.userName}): ${Ye.reason.message||"未知错误"}`)}));const me=ge.length+ye.filter(Ye=>!Ye.success).length,Ze=M.length-me;me===0?Xe.message("success",`所有设备邀请成功 (${Ze}/${M.length})`):Xe.message("warning",`设备邀请完成: ${Ze}成功, ${me}失败`)}catch(de){console.error("发送设备邀请失败:",de),Xe.message("error","发送设备邀请失败")}},Co=()=>{cy({roomName:o.value},{baseUrl:n.baseUrl,token:n.token}).then(M=>{M.data.code===0?M.data.data.length>0?(u.value=M.data.data.filter(R=>JSON.parse(R.metadata).phone!==n.userData.mobile).map(R=>{const W=JSON.parse(R.metadata);return W.classify==="人员"?{classify:W.classify,userName:R.userName,userId:R.userId,mobile:W.phone,officeName:R.officeName,id:R.userId,label:R.userName,phone:W.phone}:{classify:W.classify,userName:R.userName,userId:R.userId,mobile:W.equipmentCode,officeName:R.officeName,phone:W.phone,equipmentCode:W.equipmentCode,equipmentPassword:W.equipmentPassword,equipmentType:W.equipmentType,id:R.userId,label:R.userName}}),d.value=u.value,console.log("已邀请人员",d.value,u.value)):(u.value=[],d.value=[]):(Xe.message("error","获取邀请人列表失败"),u.value=[],d.value=[])})},ys=M=>{if(M&&(M!=null&&M.identity)){const R=document.getElementById(`participant-${M.identity}`);if(R)if(F.value==="pointTurn"){if(!(M.identity===Ne.value||M.identity===pe.value)){const W=document.querySelector("#room .point-turn-top"),Q=document.querySelector("#room .point-turn-bottom"),se=document.querySelector("#room .point-turn-other");if(!W||!Q||!se)return;if(R.parentElement)if(R.parentElement.className==="point-turn-top"){if(R.id===W.firstElementChild.id)return;W.insertBefore(R,W.firstChild??null)}else R.parentElement.className==="point-turn-bottom"?document.querySelectorAll(".point-turn-top .participant").length>=5&&(se.insertBefore(W.lastElementChild,se.firstChild??null),W.insertBefore(R,W.firstChild??null),Q.insertBefore(se.firstChild,Q.firstChild??null)):document.querySelectorAll(".point-turn-top .participant").length>=5&&document.querySelectorAll(".point-turn-bottom .participant").length>=5&&(se.insertBefore(Q.lastElementChild,se.firstChild??null),Q.insertBefore(W.lastElementChild,Q.firstChild??null),W.insertBefore(R,W.firstChild??null))}}else{const W=document.getElementById("room");if(P.value==="grid"){if(R.id===W.firstElementChild.id)return;W.insertBefore(R,W.firstChild??null)}else if(P.value==="rightSide"){const Q=document.querySelector("#room .layout-rightside"),se=document.querySelector("#room .layout-leftside");if(!se||!Q)return;if(M.identity!==pe.value){if(R.id===se.firstElementChild.id||R.id===Q.firstElementChild.id)return;Q.insertBefore(R,Q.firstElementChild??null)}}}}else return},Zl=M=>{let R=document.createElement("div");return R.id=`participant-${M.identity}`,R.className=M.isLocal?"participant local":"participant",R.setAttribute("data-identity",M.identity),R.setAttribute("data-is-in-viewport","false"),M.isScreenShareEnabled?R.innerHTML=`
|
340
|
+
<video id="video-${M.identity}" class="p-video" autoplay webkit-playsinline playsinline x5-video-player-type="h5"></video>
|
341
|
+
<div id="screenshare-${M.identity}" class="screen-share-suspension">
|
342
|
+
${M.name} 正在共享屏幕
|
343
|
+
</div>
|
344
|
+
<div class="describe">
|
345
|
+
<div class="describe-left">
|
346
|
+
<div class="avatar"></div>
|
347
|
+
<div id="${M.identity}" class="identity">${M.isLocal?M.name+"(我)":M.name}</div>
|
348
|
+
</div>
|
349
|
+
<div class="tools">
|
350
|
+
<div id="microphone-${M.identity}" class="microphone"></div>
|
351
|
+
</div>
|
352
|
+
</div>
|
353
|
+
`:M.isCameraEnabled?R.innerHTML=`
|
354
|
+
<video id="video-${M.identity}" class="p-video" autoplay webkit-playsinline playsinline x5-video-player-type="h5"></video>
|
355
|
+
<div id="signal-${M.identity}" class="signal-icon signal-icon-good"></div>
|
356
|
+
<div id="more-${M.identity}" class="more-icon"></div>
|
357
|
+
<div class="describe">
|
358
|
+
<div class="describe-left">
|
359
|
+
<div class="avatar"></div>
|
360
|
+
<div id="${M.identity}" class="identity">${M.isLocal?M.name+"(我)":M.name}</div>
|
361
|
+
</div>
|
362
|
+
<div class="tools">
|
363
|
+
<div id="microphone-${M.identity}" class="microphone"></div>
|
364
|
+
</div>
|
365
|
+
</div>
|
366
|
+
`:R.innerHTML=`
|
367
|
+
<video id="video-${M.identity}" class="p-video" autoplay webkit-playsinline playsinline x5-video-player-type="h5"></video>
|
368
|
+
<div id="board-${M.identity}" class="board">
|
369
|
+
<div class="board-icon"></div>
|
370
|
+
</div>
|
371
|
+
<div id="signal-${M.identity}" class="signal-icon signal-icon-good"></div>
|
372
|
+
<div id="more-${M.identity}" class="more-icon"></div>
|
373
|
+
<div class="describe">
|
374
|
+
<div class="describe-left">
|
375
|
+
<div class="avatar"></div>
|
376
|
+
<div id="${M.identity}" class="identity">${M.isLocal?M.name+"(我)":M.name}</div>
|
377
|
+
</div>
|
378
|
+
<div class="tools">
|
379
|
+
<div id="microphone-${M.identity}" class="microphone"></div>
|
380
|
+
</div>
|
381
|
+
</div>
|
382
|
+
`,R},Gd=(M,R,W)=>{if(F.value==="pointTurn"){let Q=document.querySelector("#room .point-turn-top"),se=document.querySelector("#room .point-turn-center"),de=document.querySelector("#room .point-turn-bottom"),ye=document.querySelector("#room .point-turn-other");if(Q||(Q=document.createElement("div"),Q.className="point-turn-top",M.insertBefore(Q,M.firstChild??null)),se||(se=document.createElement("div"),se.className="point-turn-center",M.appendChild(se)),de||(de=document.createElement("div"),de.className="point-turn-bottom",M.appendChild(de)),ye||(ye=document.createElement("div"),ye.className="point-turn-other",M.appendChild(ye)),Ne.value===W.identity)if(se.hasChildNodes()){let ge=document.querySelectorAll(".point-turn-center .participant");ge.length>0?ge.length===1?se.insertBefore(R,se.firstChild??null):ge[0].id?(document.querySelectorAll(".point-turn-top .participant").length>=5?document.querySelectorAll(".point-turn-bottom .participant").length>=5?ye.appendChild(ge[0]):de.appendChild(ge[0]):Q.appendChild(ge[0]),se.insertBefore(R,se.firstChild??null)):(se.removeChild(ge[0]),se.insertBefore(R,se.firstChild??null)):se.insertBefore(R,se.firstChild??null)}else se.appendChild(R);else if(pe.value===W.identity)if(se.hasChildNodes()){let ge=document.querySelectorAll(".point-turn-center .participant");ge.length>0?ge.length===1?se.appendChild(R):ge[1].id?(document.querySelectorAll(".point-turn-top .participant").length>=5?document.querySelectorAll(".point-turn-bottom .participant").length>=5?ye.appendChild(ge[1]):de.appendChild(ge[1]):Q.appendChild(ge[1]),se.appendChild(R)):(se.removeChild(ge[1]),se.appendChild(R)):se.appendChild(R)}else se.appendChild(R);else document.querySelectorAll(".point-turn-top .participant").length>=5?document.querySelectorAll(".point-turn-bottom .participant").length>=5?ye.appendChild(R):de.appendChild(R):Q.appendChild(R)}else if(P.value==="grid")W.isLocal?M.insertBefore(R,M.firstChild??null):M.appendChild(R);else if(P.value==="rightSide"){let Q=document.querySelector("#room .layout-rightside"),se=document.querySelector("#room .layout-leftside");se||(se=document.createElement("div"),se.className="layout-leftside",M.insertBefore(se,M.firstChild??null)),Q||(Q=document.createElement("div"),Q.className="layout-rightside",M.appendChild(Q)),pe.value&&pe.value===W.identity?se.hasChildNodes()&&(Q.insertBefore(se.firstChild,Q.firstChild??null),se.appendChild(R)):W.isLocal?(se.hasChildNodes()&&Q.insertBefore(se.firstChild,Q.firstChild??null),se.appendChild(R)):Q.appendChild(R)}return M},bs=M=>{P.value=M},Tg=M=>{console.log(`与会者渲染 ${M.identity}`,M),M.isLocal&&(p.value=M.identity,f.value=M.name,be.value=M.isCameraEnabled,we.value=M.isMicrophoneEnabled,Z.value=M.isScreenShareEnabled),!Ne.value&&li(M.identity)&&!M.remove&&(Ne.value=M.identity);let R=document.getElementById("room");if(!R){Xe.message("error","会议容器不存在");return}let W=document.getElementById(`participant-${M.identity}`);if(!W&&!M.remove&&(M.audioTrack||M.videoTrack)){if(W=Zl(M),R=Gd(R,W,M),jt(M),d.value.length>0){const mt=d.value.findIndex(fn=>fn.classify!=="人员"&&"sip_"+fn.mobile===M.identity);mt!==-1&&Re.updateParticipantName(M.identity,d.value[mt].userName)}if(u.value.length>0){const mt=u.value.findIndex(fn=>fn.mobile==M.identity);mt!==-1&&Re.updateParticipantName(M.identity,u.value[mt].userName)}u.value.forEach(mt=>{console.log("静音监控"),mt.mobile==M.identity&&mt.type=="监控/监控1"&&Re.changeParticipantMicrophoneStatus(M.identity,!0)})}let Q=document.getElementById(`video-${M.identity}`),se=document.getElementById(`board-${M.identity}`),de=document.getElementById(`microphone-${M.identity}`),ye=document.getElementById(`signal-${M.identity}`),ge=document.getElementById(`more-${M.identity}`);const me=async()=>{Re.changeParticipantMicrophoneStatus(M.identity,!0);try{const mt={owner:"administrators",org:"default",room:o.value,identity:M.identity,input:1,cmd:!0};await mo(mt,{baseUrl:n.meetingUrl,token:n.token})}catch(mt){console.error("muteParticipant (unableMicrophone) error:",mt)}},Ze=async()=>{console.log("micro click -> unmute (false)",M.identity),Re.changeParticipantMicrophoneStatus(M.identity,!1);try{const mt={owner:"administrators",org:"default",room:o.value,identity:M.identity,input:1,cmd:!1};await mo(mt,{baseUrl:n.meetingUrl,token:n.token})}catch(mt){console.error("muteParticipant (enableMicrophone) error:",mt)}},Ye=()=>{ye&&(ye.style.visibility="visible"),ge&&(ge.style.visibility="visible")},kt=()=>{ye&&(ye.style.visibility="hidden"),ge&&(ge.style.visibility="hidden")},Wr=mt=>{le.value={left:mt.clientX-110+"px",top:mt.clientY+35+"px"},Ie.value===M.identity&&nt.value?nt.value=!1:(nt.value=!1,Ie.value=M.identity,nt.value=!0)};de&&M.isMicrophoneEnabled?(de.className="microphone microphone-active",de.onclick=me):de&&!M.isMicrophoneEnabled&&(de.className="microphone microphone-inactive",de.onclick=Ze),W&&(W.onmouseenter=Ye,W.onmouseleave=kt),ge&&(ge.onclick=Wr),ye&&(M.connectionQuality==="excellent"||M.connectionQuality==="good"?ye.className="signal-icon signal-icon-good":ye.className="signal-icon signal-icon-poor");let sn=document.getElementById(`screenshare-${M.identity}`);if(M.isScreenShareEnabled)sn||(sn=document.createElement("div"),sn.id=`screenshare-${M.identity}`,sn.className="screen-share-suspension",sn.innerHTML=`${M.name} 正在共享屏幕`,W&&W.appendChild(sn)),se&&(W&&W.removeChild(se),se=null),ye&&(W&&W.removeChild(ye),ye=null),ge&&(W&&W.removeChild(ge),ge=null);else if(M.isCameraEnabled)sn&&(W&&W.removeChild(sn),sn=null),se&&(W&&W.removeChild(se),se=null),ye||(ye=document.createElement("div"),ye.id=`signal-${M.identity}`,M.connectionQuality==="excellent"||M.connectionQuality==="good"?ye.className="signal-icon signal-icon-good":ye.className="signal-icon signal-icon-poor",W&&W.appendChild(ye)),ge||(ge=document.createElement("div"),ge.id=`more-${M.identity}`,ge.className="more-icon",W&&W.appendChild(ge));else{if(!se){se=document.createElement("div"),se.id=`board-${M.identity}`,se.className="board";let mt=document.createElement("div");mt.className="board-icon",se.appendChild(mt),W&&(W==null||W.appendChild(se))}sn&&(W&&W.removeChild(sn),sn=null)}if(M.remove){if(Q&&(Q.srcObject=null,Q.src="",Q.remove()),W&&W.remove(),vo(M.identity),yo(),F.value==="pointTurn")if(M.identity===Ne.value){const mt=document.querySelector("#room .point-turn-center"),fn=document.createElement("div");fn.className="participant",fn.innerHTML=ia,mt.insertBefore(fn,mt.firstChild??null),Ne.value===pe.value?Ne.value=pe.value=null:Ne.value=null}else if(M.identity===pe.value){let mt=document.createElement("div"),fn=document.querySelector("#room .point-turn-center");mt.className="participant",mt.innerHTML=ia,fn.appendChild(mt),pe.value=null}else{let mt=document.querySelector("#room .point-turn-top"),fn=document.querySelector("#room .point-turn-bottom"),Cr=document.querySelector("#room .point-turn-other"),Hg=mt.children.length,ic=fn.children.length,rc=Cr.children.length;Hg<5?ic>0?mt.appendChild(fn.firstElementChild):rc>0&&mt.appendChild(Cr.firstChild):ic<5&&rc>0&&fn.appendChild(Cr.firstChild)}else P.value==="rightSide"&&pe.value&&pe.value===M.identity&&bs("grid"),pe.value===M.identity&&(Ne.value===pe.value?Ne.value=pe.value=null:pe.value=null);M.videoTrack&&M.videoTrack.detach(),M.audioTrack&&M.audioTrack.detach();return}if(M.isScreenShareEnabled&&F.value!=="pointTurn"){if(P.value==="grid")Xl(M.identity)!==-1||(_i.value=!0,ai.value=P.value,pe.value=M.identity,bs("rightSide"));else if(P.value==="rightSide"&&Xl(M.identity)===-1){_i.value=!0,ai.value=P.value,pe.value=M.identity;const mt=document.querySelector("#room .layout-rightside"),fn=document.querySelector("#room .layout-leftside");if(W&&fn){let Cr=null;for(;Cr=fn.firstChild;)Cr&&mt&&mt.appendChild(Cr);fn.insertBefore(W,fn.firstChild??null)}}}Si(),M.videoTrack&&(P.value==="grid"?(console.log(`参与者 ${M.identity} 在宫格布局中,延迟设置交叉观察器`),setTimeout(()=>{const mt=document.getElementById(`participant-${M.identity}`);mt&&!mt.hasAttribute("data-observer-set")&&(Yn(mt),mt.setAttribute("data-observer-set","true"),console.log(`延迟为参与者 ${M.identity} 设置交叉观察器`))},200)):M.videoTrack.attach(Q)),M.isLocal||M.audioTrack&&M.audioTrack.attach(Q);let qn=document.getElementById(M.identity);qn&&(qn.innerHTML=M.isLocal?M.name+"(我)":M.name);const nc=h.value.findIndex(mt=>mt.identity===M.identity);nc===-1?(jt(M),yo()):(h.value.splice(nc,1,M),console.log(`更新参与者数据: ${M.identity}`),yo()),F.value==="normal"&&Yi===-1&&_i.value&&(bs(ai.value),_i.value=!1),Ft.value>=1&&(JSON.parse(Re.room.metadata),St.value&&(Qt&&(clearInterval(Qt),Qt=null),Qt=setInterval(()=>{ie.value++,St.value=!1},1e3)))},Sg=()=>{if(!Re){Xe.message("error","liveClient初始化失败");return}if(Re._eventsInitialized){console.log("liveClient事件已初始化,跳过重复注册");return}console.log("开始注册liveClient事件监听器"),Re.on("errorPush",M=>{$t("errorPush"),console.error("出错位置"+M.type+":",M.message),Xe.message("error",M.message)}),Re.on("socketOpen",()=>{$t("socketOpen"),Xe.message("success","链接建立成功")}),Re.on("roomCreatedSuccess",async M=>{$t("roomCreatedSuccess"),Xe.message("success","会议房间创建成功"),o.value=M,await zd()}),Re.on("roomCreatedFail",M=>{$t("roomCreatedFail"),Xe.message("error","会议房间创建失败")}),Re.on("joinRoomError",M=>{$t("joinRoomError"),console.error("加入房间失败",M),Se.value=!1,Xe.message("error","加入房间失败")}),Re.on("roomConnected",async M=>{var R,W,Q,se;if($t("roomConnected"),Re.room){const de=JSON.parse(Re.room.metadata);console.log("metadata222:",de,de.owner),a.value=de.roomAlias,c.value=de.creator??"暂无",y.value=de.owner,de.display&&de.display.trim()!==""&&!li(p.value)&&(Cn.value=de.display,console.log("检测到分发画面设置:",de.display),Ud(de.display))}(R=n.userData)!=null&&R.username&&Re.updateParticipantName(n.userData.mobile,n.userData.username),yn=setInterval(()=>{_.value=navigator.connection.rtt},1e3),N.value=`${n.h5Url}?roomNum=${o.value}&tenantId=${n.org}&userName=${n.userData.username}&mobile=${n.userData.mobile}`,console.log("joinType",n.joinType);try{const de=await hy(o.value,{baseUrl:n.baseUrl,token:n.token});((W=de==null?void 0:de.data)==null?void 0:W.code)===0&&Array.isArray((Q=de==null?void 0:de.data)==null?void 0:Q.data)&&u.value.push(...de.data.data)}catch(de){console.error("queryConfSitesStatus error",de)}if(Eg(),n.joinType==="launch"){if(u.value=n.tempInviteList,bn.value>0){const de=u.value.filter(me=>(me==null?void 0:me.classify)==="人员"),ye=u.value.filter(me=>(me==null?void 0:me.classify)!=="人员");if(de.length>0){if(n.wxOfficial)for(let me=0;me<de.length;me++)$g(de[me]);else if(n.isCustomizeMiniInvitations)r("inviteMessageSend",{inviteUserList:de,meetingName:a.value,meetingNum:o.value,fromUser:n.userData.username});else for(let me=0;me<de.length;me++){if(n.defaultInviteWay==="mini")try{const Ze=await _s(de[me].userName,de[me].mobile),Ye=await tf([{roomName:a.value,userName:de[me].userName,phone:de[me].mobile,message:Ze.messageTemplate}],{baseUrl:n.baseUrl,token:n.token});console.log("成功发送短信链接与语音播报",Ze,Ye)}catch(Ze){console.error("发送语音播报失败",Ze)}else da(de[me].mobile);me>0&&(me+1)%10===0&&await ks(500)}de.forEach(me=>{Ji(me)})}Gr(ye);const ge=u.value.map(me=>(me==null?void 0:me.classify)==="人员"?{roomName:o.value,roomAlias:a.value,userId:me.userId,userName:me.userName,officeName:me==null?void 0:me.officeName,metadata:JSON.stringify({classify:me==null?void 0:me.classify,phone:me==null?void 0:me.mobile})}:{roomName:o.value,roomAlias:a.value,userId:me.userId,userName:me.userName,officeName:me==null?void 0:me.officeName,metadata:JSON.stringify({phone:"",classify:me==null?void 0:me.classify,equipmentCode:me==null?void 0:me.mobile,equipmentPassword:me==null?void 0:me.equipmentPassword,equipmentType:me==null?void 0:me.equipmentType})});n.joinType==="launch"&&ge.findIndex(Ze=>Ze.userId===n.userData.userId)<0&&ge.push({roomName:o.value,roomAlias:a.value,userId:n.userData.userId,userName:n.userData.username,officeName:(se=n.userData)==null?void 0:se.officeName,metadata:JSON.stringify({classify:"人员",phone:n.userData.mobile})}),Ko(ge,{baseUrl:n.baseUrl,token:n.token}).then(me=>{console.log("储存已邀请用户",me)})}}else Co();Se.value=!0}),Re.on("setHostSuccess",async M=>{if($t("setHostSuccess"),console.log("主持人添加成功",M),Vd(M),Ne.value!==y.value.ownerId){await l.nextTick();let R=l.toValue(Ne);Ne.value=y.value.ownerId,console.log("修改前主持人",R),console.log("修改后主持人",Ne.value);let W=document.getElementById(`participant-${Ne.value}`);if(F.value==="pointTurn"){const Q=document.querySelector("#room .point-turn-top"),se=document.querySelector("#room .point-turn-center"),de=document.querySelector("#room .point-turn-bottom"),ye=document.querySelector("#room .point-turn-other");let ge=Q.children.length,me=de.children.length,Ze=ye.children.length;if(se.hasChildNodes()){let Ye=se.children;if(console.log("childNodes",Ye),Ne.value===pe.value)if(Ye[0].id){document.querySelectorAll(".point-turn-top .participant").length>=5?document.querySelectorAll(".point-turn-bottom .participant").length>=5?ye.appendChild(Ye[0]):de.appendChild(Ye[0]):Q.appendChild(Ye[0]),se.insertBefore(W,se.firstElementChild??null);let kt=document.createElement("div");kt.className="participant",kt.innerHTML=ia,se.appendChild(kt)}else se.insertBefore(W,se.firstElementChild??null);else Ye[0].id?(document.querySelectorAll(".point-turn-top .participant").length>=5?document.querySelectorAll(".point-turn-bottom .participant").length>=5?ye.appendChild(Ye[0]):de.appendChild(Ye[0]):Q.appendChild(Ye[0]),se.insertBefore(W,se.firstElementChild??null)):(se.removeChild(Ye[0]),se.insertBefore(W,se.firstElementChild??null))}else{se.insertBefore(W,se.firstElementChild??null);let Ye=document.createElement("div");Ye.className="participant",Ye.innerHTML=ia,se.appendChild(Ye)}ge<5?me>0?Q.appendChild(de.firstElementChild):Ze>0&&Q.appendChild(ye.firstChild):me<5&&Ze>0&&de.appendChild(ye.firstChild)}}}),Re.on("roomMetadataChanged",M=>{console.log("roomMetadataChanged",M,JSON.parse(M));const R=JSON.parse(M);li(p.value)||(R.display&&R.display.trim()!==""&&R.display!==Cn.value?(Cn.value=R.display,console.log("分发画面已更新:",R.display),Ud(R.display)):(!R.display||R.display.trim()==="")&&Cn.value&&(Cn.value=null,console.log("分发画面已取消"),go()))}),Re.on("roomDisconnected",()=>{if($t("roomDisconnected"),Xe.message("info","房间链接已断开"),Se.value=!1,oa(),kg(),Re){Re._eventsInitialized=!1;try{Re.removeAllListeners()}catch(M){console.warn("清理liveClient事件监听器失败:",M)}}Ve.value?Re.deleteRoom(n.userData.mobile).then(()=>{la()}).catch(M=>{la()}):la()}),Re.on("localCameraChange",M=>{$t("localCameraChange"),be.value=M,be.value?Xe.message("success","摄像头已开启"):Xe.message("success","摄像头已关闭")}),Re.on("localMicrophoneChange",M=>{$t("localMicrophoneChange"),we.value=M,we.value?Xe.message("success","麦克风已开启"):Xe.message("success","麦克风已关闭")}),Re.on("localScreenShareChange",M=>{$t("localScreenShareChange"),Z.value=M,Z.value?Xe.message("success","屏幕共享已开启"):Xe.message("success","屏幕共享已关闭")}),Re.on("startRecording",M=>{$t("startRecording"),_e.value=!0,Te.value=M,Xe.message("success","开始录制")}),Re.on("stopRecording",M=>{$t("stopRecording"),_e.value=!1,Xe.message("success","结束录制")}),Re.on("requestDeviceOpen",M=>{$t("requestDeviceOpen"),M.input=="1"?Xe.message("info","房主请求您开启麦克风"):M.input=="2"&&Xe.message("info","房主请求您开启摄像头")}),Re.on("mediaDeviceChange",M=>{$t("mediaDeviceChange"),Xe.message("success","设备切换成功"),console.log("设备类型"+M.kind,M.deviceId),M.kind=="audioinput"?A.audioInputDevice=M.deviceId:M.kind=="videoinput"?A.videoDevice=M.deviceId:A.audioOutputDevice=M.deviceId}),Re.on("sendTextFailed",M=>{$t("sendTextFailed"),Xe.message("error","e")}),Re.on("sendTextSuccess",async M=>{$t("sendTextSuccess"),await l.nextTick(),Xi.value&&Xi.value.clearInputContent(),On.value&&On.value.clearInput()}),Re.on("messageReceived",M=>{$t("sendTextSuccess"),M.timestamp=Qn().format("HH:mm"),_g(M)}),Re.on("videoCallRender",M=>{$t("videoCallRender"),Tg(M)}),Re.on("activeSpeakerChange",M=>{if($t("activeSpeakerChange"),M.length>0){let R=0,W=-1;if(M.forEach((Q,se)=>{Q.audioLevel>R&&(R=Q.audioLevel,W=se)}),W>=0){const Q=M[W];ys(Q);try{const{setVoiceActivatedIdentity:se}=require("../utils/autoPolling.js");typeof se=="function"&&se(Q.identity)}catch{}try{ut.emit("voiceActivated",Q)}catch(se){console.warn("emit voiceActivated failed",se)}}}}),Re.on("makeCallSuccess",()=>{$t("makeCallSuccess"),Xe.message("success","外呼邀请发送成功"),bt.value=!1}),Re._eventsInitialized=!0,console.log("liveClient事件监听器注册完成")},Wd=()=>{if(Re&&Re._eventsInitialized){console.log("liveClient已初始化,跳过重复初始化");return}if(Re&&!Re._eventsInitialized){console.log("检测到liveClient状态异常,重新初始化");try{Re.removeAllListeners()}catch(M){console.warn("清理异常liveClient失败:",M)}}Re=window.liveClient,Sg()},xo=async()=>{Re&&await Re.createRoom()},Kd=async()=>{await Re.startRecord()},Cg=async()=>{await Re.stopRecord()},Xd=()=>{ut.emit("getaddressBookUserForMeeting",{isInner:!0})},xg=()=>{ut.emit("getaddressBookUserForMeeting",{isInner:!0,isVolte:!0})},Eo=async(M=[])=>{if(n.isCustomizeMiniInvitations)r("inviteMessageSend",{inviteUserList:M,meetingName:a.value,meetingNum:o.value,fromUser:n.userData.username});else for(let R=0;R<M.length;R++){if(n.defaultInviteWay==="mini")try{const W=await _s(M[R].userName,M[R].mobile),Q=await tf([{roomName:a.value,userName:M[R].userName,phone:M[R].mobile,message:W.messageTemplate}],{baseUrl:n.baseUrl,token:n.token});console.log("成功发送短信链接与语音播报",W,Q)}catch(W){console.error("发送语音播报失败",W)}else da(M[R].mobile);R>0&&(R+1)%10===0&&await ks(500)}M.forEach(R=>{Ji(R)})},Eg=async()=>{var M;try{const R=await fy(o.value,{baseUrl:n.baseUrl,token:n.token}),W=(M=R==null?void 0:R.data)==null?void 0:M.msg;console.log(W,"dnis"),W&&nf({dnis:W,mute:!0,name:"重庆市卫健委",org:"default",room:o.value,type:6},{baseUrl:n.meetingUrl,token:n.token})}catch(R){console.error("getScheduleConfCode error",R)}},wo=async M=>{var ye;u.value=M;let R=[],W=-1;u.value.forEach(ge=>{Nt.value>0?(W=d.value.findIndex(me=>me.mobile===ge.mobile),W<0&&R.push(ge)):R.push(ge)}),console.log("本次追加邀请人员",R);const Q=R.filter(ge=>(ge==null?void 0:ge.classify)==="人员"),se=R.filter(ge=>ge&&ge.uri),de=R.filter(ge=>(ge==null?void 0:ge.classify)!=="人员"&&!(ge!=null&&ge.uri));if(Q.length>0&&Eo(Q),Gr(de),se.length>0&&await So(se),bn.value>0){const me=u.value.filter(Ze=>!(Ze!=null&&Ze.uri)).map(Ze=>(Ze==null?void 0:Ze.classify)==="人员"?{roomName:o.value,roomAlias:a.value,userId:Ze.userId,userName:Ze.userName,officeName:Ze.officeName,metadata:JSON.stringify({classify:Ze.classify,phone:Ze.mobile})}:{roomName:o.value,roomAlias:a.value,userId:Ze.userId,userName:Ze.userName,officeName:Ze.officeName,metadata:JSON.stringify({phone:"",classify:Ze==null?void 0:Ze.classify,equipmentCode:Ze==null?void 0:Ze.mobile,equipmentPassword:Ze==null?void 0:Ze.equipmentPassword,equipmentType:Ze==null?void 0:Ze.equipmentType})});n.joinType==="launch"&&me.findIndex(Ye=>Ye.userId===n.userData.userId)<0&&me.push({roomName:o.value,roomAlias:a.value,userId:n.userData.userId,userName:n.userData.username,officeName:(ye=n.userData)==null?void 0:ye.officeName,metadata:JSON.stringify({classify:"人员",phone:n.userData.mobile})}),Ko(me,{baseUrl:n.baseUrl,token:n.token}).then(Ze=>{console.log("储存已邀请用户",Ze)})}},Do=M=>{Eo([M])},Ao=async(M,R)=>{if(!R){Xe("error","设备id不存在");return}if(M=="audioinput")await Re.changeAudioDevice(R);else if(M=="audiooutput")await Re.changeOutputDevice(R);else if(M=="videoinput")await Re.changeVideoDevice(R);else return},wg=async M=>{await Ao("audioinput",M),q.value=!1},Dg=async M=>{await Ao("audiooutput",M),q.value=!1},Yd=async M=>{await Ao("videoinput",M),z.value=!1},Jd=async()=>{Ke.value||(Ke.value=!0,await l.nextTick(),await l.nextTick()),ut.emit("getDeviceSetter",{type:0,tempActive:A})},Ag=M=>{F.value=M,oe.value=!1},Qd=async()=>{await Re.changeCameraStatus();try{const M={owner:"administrators",org:"default",room:o.value,identity:p.value,input:2,cmd:!be.value};await mo(M,{baseUrl:n.meetingUrl,token:n.token})}catch(M){console.error("调用muteParticipant接口失败:",M)}},Ig=async()=>{await Re.changeMicrophoneStatus(),await new Promise(M=>setTimeout(M,100));try{const M={owner:"administrators",org:"default",room:o.value,identity:p.value,input:1,cmd:!we.value},R=await mo(M,{baseUrl:n.meetingUrl,token:n.token})}catch(M){console.error("调用muteParticipant接口失败:",M)}},Zd=async()=>{await Re.changeScreenShareStatus()},eh=M=>{Re.sendMessage(M,f.value)},Ng=()=>{h.value=[],be.value=n.tempCameraStatus,we.value=n.tempMicroStatus},th=async M=>{if(Re){Re.changeParticipantCameraStatus(M.identity,M.isMute);try{const R={owner:"administrators",org:"default",room:o.value,identity:M.identity,input:2,cmd:M.isMute};await mo(R,{baseUrl:n.meetingUrl,token:n.token})}catch(R){console.error("调用muteParticipant接口失败:",R)}}},nh=async M=>{if(Re){Re.changeParticipantMicrophoneStatus(M.identity,M.isMute);try{const R={owner:"administrators",org:"default",room:o.value,identity:M.identity,input:1,cmd:M.isMute};await mo(R,{baseUrl:n.meetingUrl,token:n.token})}catch(R){console.error("调用muteParticipant接口失败:",R)}}},ec=()=>{Ft.value>0&&h.value.forEach(M=>{li(M.identity)||M.isCameraEnabled&&th({identity:M.identity,isMute:!0})})},Pg=async()=>{Ft.value>0&&h.value.forEach(M=>{li(M.identity)||M.isMicrophoneEnabled&&nh({identity:M.identity,isMute:!0})})},ih=async(M,R=!1)=>{if(F.value==="pointTurn"){if(Ne.value&&Ne.value===M&&!R){Xe.message("info","当前与会者已被设置为主持人,暂无法设为焦点");return}if(pe.value&&pe.value===M){Xe.message("info","当前与会者已被设置为焦点");return}pe.value=M,await l.nextTick();const W=document.querySelector("#room .point-turn-center"),Q=document.getElementById(`participant-${pe.value}`);let se=null;if(Q&&(se=Q.parentElement,console.log("焦点元素的父元素",se,se.className),W)){if(W.children.length<2){if(W.appendChild(Q),se&&se.className!=="point-turn-other"){const de=document.querySelector("#room .point-turn-other");de&&de.children.length>0&&se.appendChild(de.firstChild)}}else if(W.lastChild.id)se&&(se.appendChild(W.lastChild),W.appendChild(Q));else if(W.removeChild(W.lastChild),W.appendChild(Q),se&&se.className!=="point-turn-other"){const de=document.querySelector("#room .point-turn-other");de&&de.children.length>0&&se.appendChild(Q)}}}else if(P.value==="rightSide"){if(pe.value&&pe.value===M){Xe.message("info","当前与会者已被设置为焦点");return}pe.value=M;const W=document.querySelector("#room .layout-rightside"),Q=document.querySelector("#room .layout-leftside"),se=document.getElementById(`participant-${pe.value}`);if(se&&Q){let de=null;for(;de=Q.firstChild;)de&&W&&W.appendChild(de);Q.insertBefore(se,Q.firstChild??null)}}else P.value==="grid"&&(pe.value&&pe.value===M?Xe.message("info","当前与会者已被设置为焦点"):pe.value=M,bs("rightSide"))},Io=()=>{const M=document.getElementById(`participant-${pe.value}`);if(F.value==="pointTurn"){if(M){const R=document.querySelector("#room .point-turn-top"),W=document.querySelector("#room .point-turn-center"),Q=document.querySelector("#room .point-turn-bottom"),se=document.querySelector("#room .point-turn-other");R.children.length>=5?Q.children.length>=5?se.appendChild(M):Q.appendChild(M):R.appendChild(M);const de=document.createElement("div");de.className="participant",de.innerHTML=ia,W.appendChild(de)}}else if(P.value==="rightSide"){const R=document.querySelector("#room .layout-rightside"),W=document.querySelector("#room .layout-leftside");if(M){let Q=null;for(;Q=W.firstChild;)Q&&R&&R.appendChild(Q)}if(Ne.value){const Q=document.getElementById(`participant-${Ne.value}`);Q&&W&&W.insertBefore(Q,W.firstChild??null)}}pe.value=null},Og=M=>{Re&&Re.changeParticipantMicrophoneStatus(M,!0)},Mg=M=>{Re&&Re.changeParticipantCameraStatus(M,!0)},Rg=M=>{var R;li(M)||Re.setParticipantToHost(M,(R=Yl(M))==null?void 0:R.name)},Lg=async M=>{Re&&await Re.setParticipantDeafness(M)},Bg=async M=>{Re&&await Re.cancelParticipantDeafness(M)},No=M=>{ut.emit("updateName",{identity:M})},ca=async M=>{Re&&await Re.updateParticipantName(M.identity,M.name)},ua=async M=>{if(Re){await Re.moveoutParticipant(M);try{const R=Yl(M);if(R&&(R.uri||R.metadata&&/"equipmentCode"|"equipmentType"/i.test(R.metadata))&&o.value){const Q=R.uri?{uri:R.uri}:{};await U8(o.value,Q,{baseUrl:n.baseUrl,token:n.token})}}catch(R){console.error("disconnectSites error",R)}}},Po=async()=>{document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement?document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen?document.webkitCancelFullScreen():document.msExitFullscreen&&document.msExitFullscreen():(await l.nextTick(),s.value.requestFullscreen&&s.value.requestFullscreen())},ci=(M=3,R)=>{ze.value=M,tt.value=!0,Gt&&clearInterval(Gt),Gt=setInterval(()=>{ze.value>0&&ze.value--},1e3)},Qi=()=>{console.log("点击",Gt),Gt&&clearInterval(Gt),tt.value=!0},ui=(M,R)=>{if(!M)return!1;const W=M.className;return W?typeof W=="string"?W.split(/\s+/).includes(R):typeof W.contains=="function"?W.contains(R):typeof W.baseVal=="string"?W.baseVal.split(/\s+/).includes(R):!1:!1},tc=M=>{const R=M&&M.target;ui(R,"meeting-name")||($.value=!1),ui(R,"exit-btn")||ui(R,"close-meeting-icon")||(Me.value=!1),ui(R,"member-item")||ui(R,"appoint-dialog")||ui(R,"member-list")||ui(R,"control-list-item")||(it.value=!1),ui(R,"icon-btn-option")||ui(R,"more-icon")||(nt.value=!1)},Ug=M=>{ke.value||M.preventDefault()},Fg=()=>{window.addEventListener("click",tc),window.addEventListener("beforeunload",Ug),document.addEventListener("fullscreenchange",Sr)},Vg=()=>{window.removeEventListener("click",tc),document.removeEventListener("fullscreenchange",Sr)},jg=M=>{bt.value?bt.value=!1:(bt.value=!0,Wt.value={bottom:M.target.offsetTop+50+"px",left:M.target.clientLeft-122+"px"})};function da(M){const R=Re||window.liveClient;if(!R||typeof R.makeCall!="function"){console.error("liveClient 未就绪,无法发起外呼"),Xe.message("error","外呼服务未就绪,请稍后再试");return}R.makeCall(M,"0"+M);let W=[{roomName:o.value,roomAlias:a.value,userId:M,userName:M,officeName:"",metadata:JSON.stringify({classify:"人员",phone:M})}];Ko(W,{baseUrl:n.baseUrl,token:n.token}).then(Q=>{console.log("储存已邀请用户volte",Q)})}const rh=async M=>{if(n.isCustomizeMiniInvitations)r("miniInviteSend",{inviteMobile:M,fromUser:n.userData.username,meetingName:a.value,meetingNum:o.value});else try{const R=await _s(M,M),W=await tf([{roomName:a.value,userName:M,phone:M,message:R.messageTemplate}],{baseUrl:n.baseUrl,token:n.token});Xe.message("success","成功发送短信链接与语音播报"),bt.value=!1}catch(R){console.error("发送语音播报失败",R)}};function _s(M,R){return new Promise((W,Q)=>{R8({path:n.miniPagePath,query:`roomNum=${o.value}&tenantId=${n.org}&userName=${M}&mobile=${R}&joinType=join&cameraStatus=trueµphoneStatus=true}`},{baseUrl:n.baseUrl,token:n.token}).then(se=>{if(console.log("生成小程序链接地址",se),se.data.code==0){const de=se.data.msg,ye=`【鸿信翼联视频会议】 邀请您参加视频会议。
|
383
|
+
会议主题:${a.value}
|
384
|
+
微信小程序参会链接:${de}`;W({meetingWXLink:de,messageTemplate:ye})}else Q(se.data.msg)})})}function ks(M){return new Promise(R=>setTimeout(R,M))}function Oo(M){var Q;let R=[],W=-1;if(M&&M.length>0){M.forEach(ye=>{Nt.value>0?(W=d.value.findIndex(ge=>ge.mobile===ye.mobile),W<0&&R.push(ye)):R.push(ye),jd(ye)}),console.log("本次追加邀请人员",R);const se=R.filter(ye=>(ye==null?void 0:ye.classify)==="人员"),de=R.filter(ye=>(ye==null?void 0:ye.classify)!=="人员");if(se.length>0&&Eo(se),Gr(de),bn.value>0){const ye=u.value.map(ge=>(ge==null?void 0:ge.classify)==="人员"?{roomName:o.value,roomAlias:a.value,userId:ge.userId,userName:ge.userName,officeName:ge.officeName,metadata:JSON.stringify({classify:ge.classify,phone:ge.mobile})}:{roomName:o.value,roomAlias:a.value,userId:ge.userId,userName:ge.userName,officeName:ge.officeName,metadata:JSON.stringify({phone:"",classify:ge==null?void 0:ge.classify,equipmentCode:ge==null?void 0:ge.mobile,equipmentPassword:ge==null?void 0:ge.equipmentPassword,equipmentType:ge==null?void 0:ge.equipmentType})});n.joinType==="launch"&&ye.findIndex(me=>me.userId===n.userData.userId)<0&&ye.push({roomName:o.value,roomAlias:a.value,userId:n.userData.userId,userName:n.userData.username,officeName:(Q=n.userData)==null?void 0:Q.officeName,metadata:JSON.stringify({classify:"人员",phone:n.userData.mobile})}),Ko(ye,{baseUrl:n.baseUrl,token:n.token}).then(ge=>{console.log("储存已邀请用户",ge)})}}}function Sr(){document.fullscreenElement?kr.value=!0:kr.value=!1}const $g=async M=>{try{const R=await L8({orgcode:"500103014",username:"dianxintest",password:"abcd@1234",template_id:"qke0p5vGp_PAyEV-p620NbjwvjZ9xCNmkqKvv_jtmBE",url:`${n.h5Url}index?roomNum=${o.value}&userName=${M.label}&mobile=${M.mobile}&tenantId=${n.org}`,client_msg_id:"",firstvalue:"",keyword1value:`请参加会议!会议号:${o.value}`,keyword2value:sh(new Date),remark:""},{baseUrl:n.baseUrl,token:n.token});console.log("成功发送微信通知",R,result)}catch(R){console.error("发送语音播报失败",R)}},sh=M=>{const R=M.getFullYear(),W=String(M.getMonth()+1).padStart(2,"0"),Q=String(M.getDate()).padStart(2,"0"),se=String(M.getHours()).padStart(2,"0"),de=String(M.getMinutes()).padStart(2,"0"),ye=String(M.getSeconds()).padStart(2,"0");return`${R}-${W}-${Q} ${se}:${de}:${ye}`};l.watch(()=>ze.value,M=>{M<=0&&(tt.value=!1,Gt&&clearInterval(Gt))}),l.watch(()=>Ft.value,(M,R)=>{M!==R&&kl()}),l.watch(()=>P.value,async(M,R)=>{if(console.log("新布局",M),console.log("旧布局",R),await l.nextTick(),F.value=="normal"){let W=document.getElementById("room");if(W){if(R==="grid"&&M==="rightSide"){let Q=document.querySelector("#room .layout-rightside"),se=document.querySelector("#room .layout-leftside");if(se||(se=document.createElement("div"),se.className="layout-leftside"),Q||(Q=document.createElement("div"),Q.className="layout-rightside"),pe.value){let de=Yl(pe.value);if(de){const ye=document.getElementById(`participant-${de.identity}`);if(ye){if(se.hasChildNodes()){let ge;for(;ge=se.firstChild;)ge&&Q.appendChild(ge)}if(se.appendChild(ye),W.hasChildNodes()){let ge;for(;ge=W.firstElementChild;)ge&&Q.appendChild(ge)}}}else if(de=ra(),de){const ye=document.getElementById(`participant-${de.identity}`);if(ye){if(se.hasChildNodes()){let ge;for(;ge=se.firstChild;)ge&&Q.appendChild(ge)}if(se.appendChild(ye),W.hasChildNodes()){let ge;for(;ge=W.firstElementChild;)ge&&Q.appendChild(ge)}}}}else{let de=ra();if(de){const ye=document.getElementById(`participant-${de.identity}`);if(ye){if(se.hasChildNodes()){let ge;for(;ge=se.firstChild;)ge&&Q.appendChild(ge)}if(se.appendChild(ye),W.hasChildNodes()){let ge;for(;ge=W.firstChild;)ge&&Q.appendChild(ge)}}}}W.insertBefore(se,W.firstChild??null),W.appendChild(Q)}if(R==="rightSide"&&M==="grid"){let Q=document.querySelector("#room .layout-rightside"),se=document.querySelector("#room .layout-leftside");console.log("layoutSideEle",Q,se);const de=document.createDocumentFragment();if(Q){if(Q.hasChildNodes()){let ye;for(;ye=Q.firstChild;)de.appendChild(ye)}W.removeChild(Q)}if(se){if(se.hasChildNodes()){let ye;for(;ye=se.firstChild;)console.log("layoutLeftSideEleChild",se,ye),W.insertBefore(ye,W.firstChild??null)}W.removeChild(se)}W.appendChild(de)}}}kl()}),l.watch(()=>F.value,async M=>{console.log("当前会议模式",M),await l.nextTick();let R=document.getElementById("room");if(M==="pointTurn"){let W=document.createElement("div");W.className="point-turn-top";let Q=document.createElement("div");Q.className="point-turn-center";let se=document.createElement("div");se.className="point-turn-bottom";let de=document.createElement("div");de.className="point-turn-other";let ye=document.createElement("div"),ge=document.createElement("div");if(ye.className="participant",ye.innerHTML=ia,ge.className="participant",ge.innerHTML=ia,Q.appendChild(ye),Q.appendChild(ge),P.value==="grid"){let me=null;for(;me=R.firstChild;)me&&(Ne.value&&me.id===`participant-${Ne.value}`&&(Q.removeChild(ye),Q.insertBefore(me,Q.firstChild??null)),pe.value&&me.id===`participant-${pe.value}`&&(pe.value===Ne.value||(Q.removeChild(ge),Q.appendChild(me))),(!Ne.value&&!pe.value||!(me.id===`participant-${Ne.value}`||me.id===`participant-${pe.value}`))&&(W.children.length>=5?se.children.length>=5?de.appendChild(me):se.appendChild(me):W.appendChild(me)))}if(P.value==="rightSide"){let me=document.querySelector("#room .layout-rightside"),Ze=document.querySelector("#room .layout-leftside");if(Ze){let Ye=null;for(;Ye=Ze.firstChild;)Ye&&(Ne.value&&Ye.id===`participant-${Ne.value}`&&(Q.removeChild(ye),Q.insertBefore(Ye,Q.firstChild??null)),pe.value&&Ye.id===`participant-${pe.value}`&&(pe.value===Ne.value||(Q.removeChild(ge),Q.appendChild(Ye))),(!Ne.value&&!pe.value||!(Ye.id===`participant-${Ne.value}`||Ye.id===`participant-${pe.value}`))&&(W.children.length>=5?se.children.length>=5?de.appendChild(Ye):se.appendChild(Ye):W.appendChild(Ye)));R.removeChild(Ze)}if(me){let Ye=null;for(;Ye=me.firstChild;)Ye&&(Ne.value&&Ye.id===`participant-${Ne.value}`&&(Q.removeChild(ye),Q.insertBefore(Ye,Q.firstChild??null)),pe.value&&Ye.id===`participant-${pe.value}`&&(pe.value===Ne.value||(Q.removeChild(ge),Q.appendChild(Ye))),(!Ne.value&&!pe.value||!(Ye.id===`participant-${Ne.value}`||Ye.id===`participant-${pe.value}`))&&(W.children.length>=5?se.children.length>=5?de.appendChild(Ye):se.appendChild(Ye):W.appendChild(Ye)));R.removeChild(me)}}R.insertBefore(W,R.firstChild??null),R.appendChild(Q),R.appendChild(se),R.appendChild(de)}else{let W=document.querySelector("#room .point-turn-top"),Q=document.querySelector("#room .point-turn-center"),se=document.querySelector("#room .point-turn-bottom"),de=document.querySelector("#room .point-turn-other");if(console.log("currentLayout",P.value),P.value==="grid"){if(W){if(W.children.length>0){let ye=null;for(;ye=W.firstChild;)ye&&R.appendChild(ye)}R.removeChild(W)}if(Q){if(Q.children.length>0){let ye=null;for(;ye=Q.firstChild;)ye&&(ye.id?R.appendChild(ye):ye.remove())}R.removeChild(Q)}if(se){if(se.children.length>0){let ye=null;for(;ye=se.firstChild;)ye&&R.appendChild(ye)}R.removeChild(se)}if(de){if(de.children.length>0){let ye=null;for(;ye=de.firstChild;)ye&&R.appendChild(ye)}R.removeChild(de)}}if(P.value==="rightSide"){let ye=document.createElement("div");ye.className="layout-leftside";let ge=document.createElement("div");if(ge.className="layout-rightside",!pe.value&&Ne.value&&(pe.value=Ne.value),W){if(W.children.length>0){let me=null;for(;me=W.firstChild;)me&&(pe.value&&me.id===`participant-${pe.value}`?ye.appendChild(me):ge.appendChild(me))}R.removeChild(W)}if(Q){if(Q.children.length>0){let me=null;for(;me=Q.firstChild;)me&&(me.id?pe.value&&me.id===`participant-${pe.value}`?ye.appendChild(me):ge.appendChild(me):me.remove())}R.removeChild(Q)}if(se){if(se.children.length>0){let me=null;for(;me=se.firstChild;)me&&(pe.value&&me.id===`participant-${pe.value}`?ye.appendChild(me):ge.appendChild(me))}R.removeChild(se)}if(de){if(de.children.length>0){let me=null;for(;me=de.firstChild;)me&&(pe.value&&me.id===`participant-${pe.value}`?ye.appendChild(me):ge.appendChild(me))}R.removeChild(de)}R.appendChild(ye),R.appendChild(ge)}}try{const W=localStorage.getItem("hx_device_setter_settings");if(W){const Q=JSON.parse(W);Q&&typeof Q.isAutoPolling=="boolean"&&Gu(Q.isAutoPolling)}}catch(W){console.warn("读取本地轮询开关失败",W)}kl()}),l.onMounted(async()=>{await aa(),Ng(),setTimeout(()=>{G()},300);let M=null;try{const R=localStorage.getItem("hx_device_setter_settings");if(R){const W=JSON.parse(R);W&&typeof W.pollingIntervalMs=="number"&&W.pollingIntervalMs>0&&(M=W.pollingIntervalMs)}}catch(R){console.warn("读取本地轮询设置失败",R)}BP({getParticipants:()=>h.value,getCurrentLayout:()=>P.value,getCurrentRoomMode:()=>F.value,pollingIntervalMs:M,getHostIdentity:()=>Ne.value});try{const R=localStorage.getItem("hx_device_setter_settings");if(R){const W=JSON.parse(R);if(W&&typeof W.isAutoPolling=="boolean")try{Gu(W.isAutoPolling)}catch(Q){console.warn("同步本地轮询开关到 manager 失败",Q)}}}catch(R){console.warn("读取本地轮询设置失败",R)}window.liveClient||await new Promise(R=>{const W=()=>{window.removeEventListener("liveClientReady",W),R()};window.addEventListener("liveClientReady",W,{once:!0}),setTimeout(()=>{window.removeEventListener("liveClientReady",W),R()},3e3)}),n.joinType==="launch"?(Wd(),Re.roomName=n.tempMeetingName,await xo()):(Wd(),o.value=n.tempMeetingNum,await zd()),ci(5),Fg(),ut.on("getmeetingMembers",oh),ut.on("startVideoCall",ah),ut.on("updateVisibleParticipants",R=>{R&&Array.isArray(R.participants)&&P.value==="rightSide"&&rn(R.participants)}),ut.on("pointTurnPolling",R=>{if(!R||!Array.isArray(R.participants)||F.value!=="pointTurn")return;const W=document.querySelector("#room .point-turn-top"),Q=document.querySelector("#room .point-turn-bottom"),se=document.querySelector("#room .point-turn-center");if(!W||!Q||!se)return;const de=R.participants.filter(Ye=>!!(Ye&&Ye.identity)),ye=5,ge=5,me=de.slice(0,ye),Ze=de.slice(ye,ye+ge);me.forEach(Ye=>{const kt=document.getElementById(`participant-${Ye.identity}`);kt&&kt!==se.firstChild&&kt!==se.lastChild&&W.appendChild(kt)}),Ze.forEach(Ye=>{const kt=document.getElementById(`participant-${Ye.identity}`);kt&&kt!==se.firstChild&&kt!==se.lastChild&&Q.appendChild(kt)})}),kl()}),l.onBeforeUnmount(()=>{Hd(),Vg(),Re=null,UP(),qr()}),e({appendInvite:Oo});const ah=M=>{console.log("Received start video call for mobile:",M),da(M)},oh=()=>{console.log("Getting meeting members...")};return(M,R)=>(l.openBlock(),l.createElementBlock("div",{class:"meeting-room",ref_key:"rootElm",ref:s},[l.createElementVNode("div",$V,[l.createElementVNode("div",HV,[qV,l.createElementVNode("div",{class:"meeting-name",onClick:R[0]||(R[0]=l.withModifiers(W=>$.value=!$.value,["stop"]))},[l.createElementVNode("span",zV,l.toDisplayString(a.value),1),GV,$.value?(l.openBlock(),l.createBlock(HU,{key:0,meetingName:a.value,meetingNum:o.value,meetingH5Link:N.value,meetingWXLink:S.value,meetingCreator:c.value},null,8,["meetingName","meetingNum","meetingH5Link","meetingWXLink","meetingCreator"])):l.createCommentVNode("",!0)]),l.createElementVNode("div",{class:"meeting-signal",onMouseenterCapture:R[3]||(R[3]=W=>j.value=!0),onMouseleave:R[4]||(R[4]=W=>j.value=!1)},[j.value?(l.openBlock(),l.createBlock(JU,{key:0,meetingQuality:m.value,meetingTTL:_.value,onMouseenter:R[1]||(R[1]=W=>j.value=!0),onMouseleave:R[2]||(R[2]=W=>j.value=!1)},null,8,["meetingQuality","meetingTTL"])):l.createCommentVNode("",!0)],32)]),l.createElementVNode("div",WV,[KV,l.createElementVNode("span",null,l.toDisplayString(Mi.value),1)]),l.createElementVNode("div",XV,[l.createElementVNode("div",{class:l.normalizeClass(["btn",B.value?"layout-active":"layout"]),onMouseenterCapture:R[7]||(R[7]=W=>B.value=!0),onMouseleave:R[8]||(R[8]=W=>B.value=!1)},[B.value?(l.openBlock(),l.createBlock(iF,{key:0,currentLayout:P.value,layoutList:V.value,layoutLabels:J.value,currentRoomMode:F.value,onSetLayout:xt,onMouseenter:R[5]||(R[5]=W=>B.value=!0),onMouseleave:R[6]||(R[6]=W=>B.value=!1)},null,8,["currentLayout","layoutList","layoutLabels","currentRoomMode"])):l.createCommentVNode("",!0)],34),l.createElementVNode("div",{class:"btn full-screen",onClick:R[9]||(R[9]=W=>Po())}),l.createElementVNode("div",{class:"btn close-meeting-icon",onClick:R[10]||(R[10]=W=>Se.value?To(W):la())})])]),l.createElementVNode("div",YV,[l.createElementVNode("div",{class:l.normalizeClass(["meeting-room-contain-left",{"meeting-room-contain-left-slide":X.value||H.value}])},[l.createElementVNode("div",{class:l.normalizeClass(["meeting",zr.value]),id:"room",onMousemove:R[11]||(R[11]=W=>ci(5))},null,34),l.createVNode(MV,{"message-list":w.value,ref_key:"instantRef",ref:On,onMessageSend:eh},null,8,["message-list"]),l.createElementVNode("div",{class:l.normalizeClass(["meeting-control-bar",{"meeting-control-bar-show":tt.value}]),onMousemove:Qi},[l.createElementVNode("div",JV,[l.createElementVNode("div",QV,[l.createElementVNode("div",{class:l.normalizeClass(["custom-select-btn",we.value?"mic-on":"mic-off"]),onClick:Ig},null,2),l.createElementVNode("div",{class:"custom-select-right",onClick:R[12]||(R[12]=W=>q.value=!q.value)},ZV),q.value?(l.openBlock(),l.createBlock($l,{key:0,dialogType:"audio",audioDevices:k.value,outputDevices:E.value,activeDevice:A,onChooseAudioInputDevice:wg,onChooseAudioOutputDevice:Dg},null,8,["audioDevices","outputDevices","activeDevice"])):l.createCommentVNode("",!0)]),l.createElementVNode("div",ej,[l.createElementVNode("div",{class:l.normalizeClass(["custom-select-btn",be.value?"cam-on":"cam-off"]),onClick:Qd},null,2),l.createElementVNode("div",{class:"custom-select-right",onClick:R[13]||(R[13]=W=>z.value=!z.value)},tj),z.value?(l.openBlock(),l.createBlock($l,{key:0,videoDevices:D.value,activeDevice:A,dialogType:"video",onChooseVideoDevice:Yd},null,8,["videoDevices","activeDevice"])):l.createCommentVNode("",!0)])]),l.createElementVNode("div",nj,[c.value===p.value?(l.openBlock(),l.createElementBlock("div",ij,[rj,sj,l.createElementVNode("div",{class:"custom-select-right",onClick:R[14]||(R[14]=W=>oe.value=!oe.value)},aj),oe.value?(l.openBlock(),l.createBlock($l,{key:0,currentRoomMode:F.value,dialogType:"other",onChooseOtherItem:Ag},null,8,["currentRoomMode"])):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),Z.value?(l.openBlock(),l.createElementBlock("div",{key:2,class:"t-btn",onClick:Zd},lj)):(l.openBlock(),l.createElementBlock("div",{key:1,class:"t-btn",onClick:Zd},oj)),l.createElementVNode("div",{class:"t-btn",onClick:R[15]||(R[15]=W=>H.value=!H.value)},cj),_e.value?(l.openBlock(),l.createElementBlock("div",{key:4,class:"t-btn",onClick:Cg},dj)):(l.openBlock(),l.createElementBlock("div",{key:3,class:"t-btn",onClick:Kd},uj)),l.createElementVNode("div",{class:"t-btn",onClick:R[16]||(R[16]=W=>X.value=!X.value)},hj),i.meetingVideo?(l.openBlock(),l.createElementBlock("div",{key:5,class:"t-btn",onClick:xg},fj)):l.createCommentVNode("",!0),l.createElementVNode("div",{class:"t-btn",onClick:Xd},pj),c.value===p.value?(l.openBlock(),l.createElementBlock("div",{key:6,class:"t-btn t-btn-qtm",onClick:R[18]||(R[18]=l.withModifiers(W=>jg(W),["self"]))},[bt.value?(l.openBlock(),l.createBlock(wV,{key:0,position:Wt.value,defaultCallingMethod:i.defaultCallingMethod,onCloseCallBoard:R[17]||(R[17]=W=>bt.value=!1),onPhoneCall:da,onMiniCall:rh},null,8,["position","defaultCallingMethod"])):l.createCommentVNode("",!0)])):l.createCommentVNode("",!0),l.createElementVNode("div",{class:"t-btn",onClick:Jd},[mj,Ke.value?(l.openBlock(),l.createBlock(dg,{key:0,tempActiveDevice:{audioInputDevice:A.audioInputDevice,audioOutputDevice:A.audioOutputDevice,videoDevice:A.videoDevice}},null,8,["tempActiveDevice"])):l.createCommentVNode("",!0)])]),l.createElementVNode("div",{class:"exit-btn",onClick:R[19]||(R[19]=W=>Se.value?Tr(W):la())}," 结束会议 ")],34),it.value?(l.openBlock(),l.createBlock(gV,{key:0,participants:h.value,meetingHost:y.value,onAppointHost:Ql,onCloseDialog:R[20]||(R[20]=W=>it.value=!1)},null,8,["participants","meetingHost"])):l.createCommentVNode("",!0)],2),l.createElementVNode("div",gj,[X.value?(l.openBlock(),l.createBlock(LF,{key:0,ref_key:"memeberManageRef",ref:$r,joinedList:b.value,participants:h.value,localIdentity:p.value,tempInvitedList:d.value,inviteList:u.value,meetingNum:o.value,meetingName:a.value,meetingHost:y.value,onClose:R[21]||(R[21]=W=>{X.value=!1,nt.value=!1}),onCloseMoreDialog:sa,onParticipantCameraSwitch:th,onParticipantMicrophoneSwitch:nh,onAllCameraClose:ec,onAllMicrophoneClose:Pg,onOpenMoreDialog:_o,onAppendMemberInvite:Do,onRemoveUnjoinItem:$d,onFilterJoinedList:yg},null,8,["joinedList","participants","localIdentity","tempInvitedList","inviteList","meetingNum","meetingName","meetingHost"])):l.createCommentVNode("",!0),H.value?(l.openBlock(),l.createBlock(sV,{key:1,ref_key:"chatAreaRef",ref:Xi,localIdentity:p.value,messageList:w.value,fileUploadUrl:i.fileUploadUrl,imgUrl:i.imgUrl,onClose:R[22]||(R[22]=W=>H.value=!1),onMessageSend:eh},null,8,["localIdentity","messageList","fileUploadUrl","imgUrl"])):l.createCommentVNode("",!0)])]),Me.value?(l.openBlock(),l.createBlock(cV,{key:0,position:Pe.value,onCancelMeeting:qd,onLeaveMeeting:Jl,onOptionClose:R[23]||(R[23]=W=>Me.value=!1)},null,8,["position"])):l.createCommentVNode("",!0),nt.value?(l.openBlock(),l.createBlock(yV,{key:1,curBlur:pe.value,identity:Ie.value,optionDialogOffset:le.value,localIdentity:p.value,meetingHost:y.value,participants:h.value,currentDisplayIdentity:Cn.value,onClose:R[24]||(R[24]=W=>nt.value=!1),onSetToBlur:ih,onRemoveFromBlur:Io,onCloseMicro:Og,onCloseCamera:Mg,onSetToHost:Rg,onSetToDeafness:Lg,onCancelDeafness:Bg,onUpdateName:No,onRemove:ua,onDistributeScreen:oi,onCancelDistributeScreen:Ti},null,8,["curBlur","identity","optionDialogOffset","localIdentity","meetingHost","participants","currentDisplayIdentity"])):l.createCommentVNode("",!0),l.createVNode(Yp,{baseUrl:i.baseUrl,token:i.token,inviteList:u.value,componentType:"meeting",onAppendInvitePeople:wo},null,8,["baseUrl","token","inviteList"]),l.createVNode(FV,{onUpdateNameConfirm:ca})],512))}},[["__scopeId","data-v-5ba2b479"]]),mg={__name:"LiveMulti",props:{isEnterDialogShow:{type:Boolean,default:!1},baseUrl:{type:String,default:""},meetingUrl:{type:String,default:""},userData:{type:Object,default:()=>({})},meetingVideo:{type:Boolean,default:!1},org:{type:String,default:"default"},token:{type:String,default:""},fileUploadUrl:{type:String,default:""},imgUrl:{type:String,default:""},h5Url:{type:String,default:""},isCustomizeMiniInvitations:{type:Boolean,default:!1},miniPagePath:{type:String,default:""},defaultInviteWay:{type:String,default:"mini"},wxOfficial:{type:Boolean,default:!1},defaultCallingMethod:{type:Array,default:()=>["voice","video","mini"]},meetingTitle:{type:String,default:"调度会议"}},emits:["enterDialogClose","miniInviteSend","inviteMessageSend"],setup(i,{emit:e}){const t=i,n=e,r=l.ref(null),s=l.computed(()=>r.value||t.token),a=l.ref(null),o=l.ref(!1),c=l.ref({roomName:"",roomNum:"",cameraStatus:!0,microphoneStatus:!0,audioInputDevice:"",audioOutputDevice:"",videoDevice:"",inviteList:[],joinType:"launch"});function u(f){c.value={roomName:f.roomName,roomNum:"",cameraStatus:f.cameraStatus,microphoneStatus:f.microphoneStatus,audioInputDevice:f.audioInputDevice,audioOutputDevice:f.audioOutputDevice,videoDevice:f.videoDevice,inviteList:f.inviteList,joinType:"launch"},o.value=!0}function d(f){c.value={roomName:f.roomName,roomNum:"",cameraStatus:f.cameraStatus,microphoneStatus:f.microphoneStatus,audioInputDevice:f.audioInputDevice,audioOutputDevice:f.audioOutputDevice,videoDevice:f.videoDevice,inviteList:f.inviteList,joinType:"launch"},o.value=!0}function h(f){c.value={roomName:"",roomNum:f.roomNum,cameraStatus:f.cameraStatus,microphoneStatus:f.microphoneStatus,audioInputDevice:f.audioInputDevice,audioOutputDevice:f.audioOutputDevice,videoDevice:f.videoDevice,inviteList:f.inviteList,joinType:"join"},o.value=!0}function b(){o.value=!1}function v(f){n("miniInviteSend",f)}function y(f){n("inviteMessageSend",f)}async function p(){const f=localStorage.getItem("xtoken");if(f&&t.baseUrl)try{const _=await(await fetch(`${t.baseUrl}/api/systemUserJwt/sso-login?xtoken=${f}`,{method:"POST",headers:{"Content-Type":"application/json"}})).json();_.code===0?(r.value=_.data.tokenValue,a.value.getUserAndOrgTreeData(r.value),a.value.getPreviewMeetingList(r.value)):console.error("Component LiveMulti: Failed to fetch token:",_.message)}catch(m){console.error("Component LiveMulti: Error fetching token:",m)}else a.value.getUserAndOrgTreeData(),a.value.getPreviewMeetingList()}return l.onMounted(()=>{localStorage.getItem("xtoken")?p():(a.value.getUserAndOrgTreeData(),a.value.getPreviewMeetingList())}),(f,m)=>(l.openBlock(),l.createElementBlock("div",null,[(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[l.withDirectives(l.createVNode(zl,{onEnterDialogClose:m[0]||(m[0]=_=>f.$emit("enterDialogClose")),baseUrl:i.baseUrl,userData:i.userData,org:i.org,token:s.value,meetingTitle:i.meetingTitle,onQuickLaunch:u,onLaunchMeeting:d,onJoinMeeting:h,meetingVideo:i.meetingVideo,ref_key:"addressBookRef",ref:a},null,8,["baseUrl","userData","org","token","meetingTitle","meetingVideo"]),[[l.vShow,i.isEnterDialogShow]])])),(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[o.value?(l.openBlock(),l.createBlock(Wl,{key:0,baseUrl:i.baseUrl,token:s.value,meetingUrl:i.meetingUrl,org:i.org,userData:i.userData,tempMeetingName:c.value.roomName,tempMeetingNum:c.value.roomNum,tempCameraStatus:c.value.cameraStatus,tempMicroStatus:c.value.microphoneStatus,tempActiveDevice:{audioInputDevice:c.value.audioInputDevice,audioOutputDevice:c.value.audioOutputDevice,videoDevice:c.value.videoDevice},joinType:c.value.joinType,tempInviteList:c.value.inviteList,fileUploadUrl:i.fileUploadUrl,imgUrl:i.imgUrl,h5Url:i.h5Url,isCustomizeMiniInvitations:i.isCustomizeMiniInvitations,wxOfficial:i.wxOfficial,miniPagePath:i.miniPagePath,defaultCallingMethod:i.defaultCallingMethod,defaultInviteWay:i.defaultInviteWay,onMultiMeetingClose:b,onMiniInviteSend:v,onInviteMessageSend:y,meetingVideo:i.meetingVideo},null,8,["baseUrl","token","meetingUrl","org","userData","tempMeetingName","tempMeetingNum","tempCameraStatus","tempMicroStatus","tempActiveDevice","joinType","tempInviteList","fileUploadUrl","imgUrl","h5Url","isCustomizeMiniInvitations","wxOfficial","miniPagePath","defaultCallingMethod","defaultInviteWay","meetingVideo"])):l.createCommentVNode("",!0)]))]))}};mg.install=function(i){i.component("LiveMulti",mg)},Wl.install=function(i){i.component("LiveMultipleMeeting",Wl)};const gg={__name:"LiveMultipersonMeeting",props:{isEnterDialogShow:{type:Boolean,default:!1},dialogType:{type:String,default:"launch"},tempRoomNum:{type:String,default:""},inviteList:{type:Array,default:()=>[]},baseUrl:{type:String,default:""},meetingUrl:{type:String,default:""},userData:{type:Object,default:()=>({})},org:{type:String,default:"default"},token:{type:String,default:""},fileUploadUrl:{type:String,default:""},imgUrl:{type:String,default:""},h5Url:{type:String,default:""},isCustomizeMiniInvitations:{type:Boolean,default:!1},miniPagePath:{type:String,default:""},defaultInviteWay:{type:String,default:"mini"}},emits:["enterDialogClose","miniInviteSend","inviteMessageSend"],setup(i,{expose:e,emit:t}){const n=i,r=t,s=l.ref(),a=l.ref(null),o=l.computed(()=>a.value||n.token),c=l.ref(!1),u=l.ref({roomName:"",roomNum:"",cameraStatus:!0,microphoneStatus:!0,audioInputDevice:"",audioOutputDevice:"",videoDevice:"",joinType:"launch"});function d(k){u.value={...k,roomNum:"",joinType:"launch"},c.value=!0}function h(k){u.value={...k,roomName:"",joinType:"join"},c.value=!0}function b(){u.value={roomName:n.userData.username+"的视频会议",roomNum:"",cameraStatus:!0,microphoneStatus:!0,audioInputDevice:"",audioOutputDevice:"",videoDevice:"",joinType:"launch"},c.value=!0}function v(){r("enterDialogClose")}function y(){c.value=!1}function p(k){r("miniInviteSend",k)}function f(k){r("inviteMessageSend",k)}async function m(k){await l.nextTick(),s.value&&s.value.appendInvite(k)}async function _(){const k=localStorage.getItem("xtoken");if(k&&n.baseUrl)try{const E=await(await fetch(`${n.baseUrl}/api/systemUserJwt/sso-login?xtoken=${k}`,{method:"POST",headers:{"Content-Type":"application/json"}})).json();E.code===0?a.value=E.data.tokenValue:console.error("Component LiveMultipersonMeeting: Failed to fetch token:",E.message)}catch(D){console.error("Component LiveMultipersonMeeting: Error fetching token:",D)}else console.warn("Component LiveMultipersonMeeting: Cannot fetch token. xtoken not found in localStorage or baseUrl prop is missing.")}return l.onMounted(()=>{localStorage.getItem("xtoken")&&_()}),e({quickLaunch:b,launchMeeting:d,joinMeeting:h,appendInvite:m}),(k,D)=>(l.openBlock(),l.createElementBlock("div",null,[(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[i.isEnterDialogShow?(l.openBlock(),l.createBlock(UC,{key:0,dialogType:i.dialogType,tempRoomNum:i.tempRoomNum,onLaunchMeeting:d,onJoinMeeting:h,onClose:v},null,8,["dialogType","tempRoomNum"])):l.createCommentVNode("",!0)])),(l.openBlock(),l.createBlock(l.Teleport,{to:"body"},[c.value?(l.openBlock(),l.createBlock(Wl,{key:0,ref_key:"liveMultipleMeetingRef",ref:s,baseUrl:i.baseUrl,token:o.value,meetingUrl:i.meetingUrl,org:i.org,userData:i.userData,tempMeetingName:u.value.roomName,tempMeetingNum:u.value.roomNum,tempCameraStatus:u.value.cameraStatus,tempMicroStatus:u.value.microphoneStatus,tempActiveDevice:{audioInputDevice:u.value.audioInputDevice,audioOutputDevice:u.value.audioOutputDevice,videoDevice:u.value.videoDevice},joinType:u.value.joinType,tempInviteList:i.inviteList,fileUploadUrl:i.fileUploadUrl,imgUrl:i.imgUrl,h5Url:i.h5Url,isCustomizeMiniInvitations:i.isCustomizeMiniInvitations,miniPagePath:i.miniPagePath,defaultInviteWay:i.defaultInviteWay,onMultiMeetingClose:y,onMiniInviteSend:p,onInviteMessageSend:f},null,8,["baseUrl","token","meetingUrl","org","userData","tempMeetingName","tempMeetingNum","tempCameraStatus","tempMicroStatus","tempActiveDevice","joinType","tempInviteList","fileUploadUrl","imgUrl","h5Url","isCustomizeMiniInvitations","miniPagePath","defaultInviteWay"])):l.createCommentVNode("",!0)]))]))}};gg.install=function(i){i.component("LiveMultipersonMeeting",gg)};const vj="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAzCAYAAADVY1sUAAAAAXNSR0IArs4c6QAAAaZJREFUaEPt2ettwzAMBGByso7SxyJNJkm7STdjIcAqDMMWSenOcAP5b6zHp5MtS1F5kkufxCETcrUkZyIzEdIIzKlFGtjuakOJmNmbiLyIyI+qfne3liiYbdOFLBU+Vn24qeo90af0rWZ2E5HPpaCJyLs3gBHIl4i8bnpDw2wQtdmHqn60RiQCKdNqnUitD445QGASKb0+aKD8BMM02riraplqzctNpJZmYkYRpY9hCCsZBCINQWNQiC4ICoNEdENGMWjEEKQXw0AMQ7IYFgICiWLMrHxy7K0HoXUCto54FbXWmaUsDQFLJLBo7o0DJIlacWpB9FJxptm6OBQBTySYDBzBhBw92OVLtkDg+xnG1DpC/AXGwEAhjVfs9vGCJwODtNaJRVG3rpRkIJDIYtfY/UGemWFIBOG8zSDTbAiSQbAx3ZAeBBPTBRlBsDBpCALBwKQgSAQaE4YwEEhMCMJEoDAuZOcQu7YN/4qlHpma2d4hNhzhJEM5xKYhDjDQQ+z//0dPZHt7hXvch/0KnYz0YUIio3TmPTORM0c70tZMJDJKZ97zCzEUP0NhkckVAAAAAElFTkSuQmCC",WC="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkCAYAAADhAJiYAAAAAXNSR0IArs4c6QAAArFJREFUWEfFmI1RFUEQhGcy0AwkA81AMoAIxAiUCIQIhAiECMQIJAMwAs1AMmjvu9q92jvuZ+ZelUzV1nsF+9PbOz29+9x2hqQvZnZmZq9KqzM9mtm9mV26+1N2es8OoL+kr2b2eWPsvbsfZ+dPA5L0xsx+Bxc6dnfYCsceQDcdoA/BFdIspQCVvLkIgqndLtz9MjpmFpCkt2ZG+1Ma3z91yfo+OvGkH4l+ZWa/yt/7ueeO8xkgSd/N7GTnwtlh5Ndpq8YRoKB6sotu9b9y9/PaaQAkCVZg5yViUGMLCCkj6ZeIQY09IElU3G8vgaRZs2epAvp5oIJQEeyiHqxkT/xw95MKKHtceNQ1Up76VWEbn8seP2XgqALKSJ3aBL18LkZnMZmKzjwjhtjNQ5DuoxaMJIol45/c/a5FKCmaCjD+jnlbleHeuPha3Lj7xyIEcgVm2+oNaxQ6cgqx8D9AbcW5u1PJbVoY/26wxC7qYktHwm5hsb8LBViC2dcV8RTQGsXDQEmwA/ilGHbc9WXn+OBSjG4EGUC9CsqukTc5txTt0XI7QHW7AK0dWYahsw78bQG/xdD8kUmC1j6xVmLwnJWjGJUFSTAJo2sxTurEtXRw5pJHbKC9PU5VtnW0FeRY9sk70KC0Jp/qZe6xrdySMg6w2zo2K3Vhj5qGaUdjt3XUBVDP7dRCSjHk5pD1sl7+1cuiFXVutxRKcoDaBIi9bt8rs7WOqO9EjyDTb6hxLaBDWMosPtcX/+uNeVqpt4rYoQvPjb/ulDk8y+eeQf8T1J27n7Yolx6KJCetXsL4joSjT+gpE7y/sBI+69zUrP7msAlo6VwkRe5M0+H8LBN+fqfe9qUyZ66mg+tHk28PoIwaRzYTAZUGlGBppJ4ImGeyjw4qoGqSt28xKjYNSwnnTbvuP+syQDSUk68hAAAAAElFTkSuQmCC",yj="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAAAXNSR0IArs4c6QAAAsFJREFUWEfdmOtVFEEQhasycDMQI5AIlAw0AiEC0QBQIxAiECJQIxAjkAwgA8mg8JvT1adn7Jczs+5q/4Fzpqb79q3HvbMqe750z/HJ/wXQzB6JyAsReSYijwP79yJyLSJfVfVu7Yx0MRiAvRaRUxEBZGkB9GRNoE2AZgZT3xLGekh6o6rnHpgwD8P3qnrTswkxVYAzwfnZEWQA+CO5JEAvReRCVSmR4moBhLnnvbfNxB06W2ZGeXycxAD0qFYSRYBmdiwinxaA49VrVT3in8DibaaGYZCLZBusBnApe343GKJ5AElaX2UufaOqhzkysgDDbX8uZM9f/6Cq7wPAXJo97lhVr6ZnlgBSdzC4xmI+MjthkL+fC5vGckiflwCuUX9+TlqHtYszfja9DO4CINgOps1SYvCpiDC31li9KeaszXQu1rqYJqnJWi/4WPxmRrO8K7zYn+JQ0EgV+rt0xbSZWW10XarqSVcNBoBoMIN1yULKGC10cGu/OC+bXewBBXnqBYwyoBCD1laGNI+z7PGgx83MSfVIYxvs4WxgL2samgDD7WvFPWV05AkzTiaNRzlOa46mC2BSQwDNaSkhACNVI7kK6oHp8IkAu8ReuUbXaqYbYLqJmaEIqeVH7Fe3+1012NsR24prGVZYcqbmYIDZUfGHmsQwpPsSQ7NQHt9V1fyw3wCaGTLHtCeNaygJB5+ntdloHDzjW1Ud7N4IoJmhHPFjZw5llXcA+tJrNRBR0vvogCJAM4O1wVhucY1m3i8mazN20PABYIcMrYk5ddg11zSw6ABL3wprAvO9aAgMhEsgaQZobm0cIKZgSbf+6UX49QFSyF4tzQf6l9PrF0nTXJPRnQGM7qVhYvcG4FmhRp7sKsUpgzRIqUm+7Bxgq7sc4NLfYGrnRF1NgvjSu2iB+/fdTM8Ntx0zy7BuG1S6/wPgWUXGlCU/owAAAABJRU5ErkJggg==",Ld=i=>(l.pushScopeId("data-v-f64ae524"),i=i(),l.popScopeId(),i),bj={class:"dialog"},_j=Ld(()=>l.createElementVNode("div",{style:{display:"flex",height:"100%","align-items":"center","margin-top":"-14px"}},[l.createElementVNode("div",{class:"title-text"},"语音播报"),l.createElementVNode("div",{class:"text"},"指令查询")],-1)),kj={class:"dialog-content","element-loading-text":"视频合成中","element-loading-background":"rgba(0, 0, 0, 0.6)"},Tj={class:"main-content"},Sj={class:"form-top"},Cj={class:"num-picker"},xj={class:"picker-num"},Ej={class:"textarea-wrapper"},wj={class:"voice-detect-btn-outter"},Dj={class:"synthesis-settings"},Aj=Ld(()=>l.createElementVNode("div",{class:"settings-title"},[l.createElementVNode("img",{src:WC,alt:"",style:{width:"18px",height:"18px","margin-right":"10px"}}),l.createElementVNode("span",null,"合成设置")],-1)),Ij={class:"form-top"},Nj={class:"num-picker"},Pj={class:"picker-num"},Oj={class:"success-area"},Mj={class:"success-content"},Rj={key:0,class:"success-title"},Lj={key:1,class:"success-title"},Bj={class:"audio-list"},Uj={class:"custom-video-player"},Fj=["src"],Vj={class:"controls"},jj={key:0},$j={key:1},Hj={class:"time"},qj=["max"],zj={class:"receiver-area"},Gj={class:"receiver-title"},Wj=Ld(()=>l.createElementVNode("img",{src:WC,style:{width:"18px",height:"18px","margin-right":"10px"}},null,-1)),Kj=Ld(()=>l.createElementVNode("span",null,"接收人:",-1)),Xj={class:"receiver-count"},Yj={class:"receiver-list"},Jj=["onClick"],Qj={class:"success-btns"},Bd=Mt({__name:"VoiceBroadcast",props:{baseUrl:{type:String,default:""},token:{type:String,default:""},org:{type:String,default:"default"}},emits:["dialogClose","taskCreated"],setup(i,{expose:e,emit:t}){const n=i,r=t,s=l.ref(null),a=l.computed(()=>s.value||n.token),o=new wn,c=l.ref(),u=l.reactive({title:[{required:!0,message:"请输入指令标题",trigger:"blur"}],deadlineTime:[{type:"date",required:!0,message:"请选择呼叫截止时间",trigger:"change"}]}),d=l.reactive({title:"",speechRate:"1",callNum:1,deadlineTime:""}),h=l.ref([{label:"1.0x(默认)",value:"1"},{label:"0.5x",value:"0.5"},{label:"1.5x",value:"1.5"},{label:"2.0x",value:"2.0"}]),b=l.ref(!1);l.ref([]);const v=l.ref(""),y=l.ref(!1),p=l.ref(""),f=l.ref(!1),m=l.ref([]);l.computed(()=>m.value.length);async function _(ae){if(Array.isArray(ae)){const ue=new Map;ae.forEach(Ie=>{ue.has(Ie.userId)||ue.set(Ie.userId,{userName:Ie.userName||Ie.label||Ie.userId,userId:Ie.userId,phone:Ie.phone})});const Be=Array.from(ue.values());J.value=Be,m.value=Be}console.log(J.value,"2222")}const k=()=>{P(),V.value="",J.value=[],m.value=[],E.value="",F.value="edit",f.value=!1,r("dialogClose")},D=async()=>{if(y.value)try{(await fetch("https://10.227.1.31:8442/ylapi/api/v1/stopAudioToWS",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({room:B.value||(j==null?void 0:j.roomNumber)||"",identity:localStorage.getItem("userId")||"admin"})})).ok?(console.log("语音识别停止成功"),y.value=!1):console.warn("停止语音识别API调用失败")}catch(ae){console.error("停止语音识别失败:",ae)}else try{const ae=await fetch("https://10.227.1.31:8442/ylapi/api/v1/startAudioToWS",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({room:B.value||(j==null?void 0:j.roomNumber)||"",identity:localStorage.getItem("userId")||"admin"})});if(ae.ok){const ue=await ae.json();console.log("语音识别启动成功:",ue),y.value=!0}else o.message("error","启动语音识别失败")}catch(ae){console.error("语音识别启动失败:",ae),o.message("error","启动语音识别服务失败")}},E=l.ref(""),A=async()=>{b.value=!0;try{const ae=await fetch("https://10.227.1.31:8442/ytapi/ai/api/v1/video/notice/querySynthesizeTask",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({org:n.org,taskId:E.value})});if(ae.ok){const ue=await ae.json();ue.data&&(typeof ue.data=="string"&&ue.data||typeof ue.data=="object"&&Object.keys(ue.data).length>0)?(V.value=ue.data,o.message("success",ue.msg)):o.message("warning",ue.msg),F.value="success"}else o.message("error","查询合成任务状态失败")}catch{o.message("error","查询合成任务状态失败")}finally{b.value=!1}},w=()=>{c.value&&c.value.validate(async ae=>{if(ae){if(!p.value){o.message("warning","请输入通知内容");return}b.value=!0;try{const ue=await fetch("https://10.227.1.31:8442/ytapi/ai/api/v1/video/notice/synthesizeVideo",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({org:n.org,videoBackground:"https://10.227.1.31:8442/assets/loginbg-DG29K9gD.png",text:p.value})});if(ue.ok){const Be=await ue.json();console.log("视频合成成功:",Be),Be.code==200?(E.value=Be.data,v.value=p.value,o.message("success",Be.msg||"合成任务已提交"),await A()):o.message("error",Be.msg||"音频合成失败")}else o.message("error","音频合成失败");F.value="success"}catch(ue){console.error("视频合成失败:",ue),o.message("error","音频合成接口异常")}finally{b.value=!1}}})};function N(){d.callNum>1&&d.callNum--}function S(){d.callNum++}function P(){d.title="",p.value="",d.callNum=1,d.speechRate="1",d.deadlineTime=""}const F=l.ref("edit"),V=l.ref(""),J=l.ref([]);function ie(){ut.emit("getaddressBookUserForVoiceBroadcast")}function X(ae){J.value.splice(ae,1),m.value.splice(ae,1)}function H(ae){return ae.getTime()<Date.now()-60*1e3}async function $(){if(!d.title){o.message("warning","请输入指令标题");return}if(!p.value){o.message("warning","请输入通知内容");return}if(!d.deadlineTime||new Date(d.deadlineTime).getTime()<Date.now()-60*1e3){o.message("warning","呼叫截止时间不能早于当前时间");return}if(V.value===""||typeof V.value=="object"&&!Array.isArray(V.value)&&Object.keys(V.value).length===0){if(E.value)try{const ae=await fetch("https://10.227.1.31:8442/ytapi/ai/api/v1/video/notice/querySynthesizeTask",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({org:n.org,taskId:E.value})});if(ae.ok){const ue=await ae.json();V.value=ue.data,console.log(ue.data,"2323"),typeof ue.data=="object"&&o.message("warning","语音合成中")}else{o.message("error","查询合成任务失败");return}}catch{o.message("error","查询合成任务失败");return}if(V.value===""||typeof V.value=="object"&&!Array.isArray(V.value)&&Object.keys(V.value).length===0)return}if(!J.value.length){o.message("warning","请选择接收人");return}try{const ae=await fetch("https://10.227.1.31:8442/ytapi/ai/api/v1/video/notice/createVideoCallTask",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({org:n.org,taskId:E.value,cyclesNumber:d.callNum,deadlineTime:d.deadlineTime,title:d.title,sendIdentityId:localStorage.getItem("userId")||"",sendIdentityName:localStorage.getItem("userName")||localStorage.getItem("userId"),videoUrl:V.value||"",callObjects:J.value.map(ue=>({callName:ue.userName,callIdentity:ue.userId,phoneNumber:ue.phone||"",callDepartment:ue.department||""}))})});if(ae.ok){const ue=await ae.json(),{code:Be,msg:Ie}=ue;Be==200?(o.message("success",Ie),r("taskCreated",{code:Be,msg:Ie}),P(),V.value="",J.value=[],m.value=[],E.value="",F.value="edit",k()):o.message("error",Ie||"下发失败")}else o.message("error","下发失败")}catch{o.message("error","下发接口异常")}}let j=null;const B=l.ref(""),q=()=>{j=window.liveClient};async function z(){if(j||q(),!j){console.error("liveClient初始化失败");return}try{const ae=await j.createRoom();ae&&(j.roomNumber=ae,B.value=ae)}catch(ae){console.error("创建房间失败",ae)}}const oe=l.ref(null),we=l.ref(!1),be=l.ref(0),Z=l.ref(0);function _e(){oe.value&&(we.value?oe.value.pause():oe.value.play())}function Te(){we.value=!0}function Ue(){we.value=!1}function We(ae){be.value=ae.target.currentTime}function pe(ae){Z.value=ae.target.duration}function Ne(){oe.value&&(oe.value.currentTime=Number(be.value))}function nt(ae){ae=Math.floor(ae);const ue=String(Math.floor(ae/60)).padStart(1,"0"),Be=String(ae%60).padStart(2,"0");return`${ue}:${Be}`}function le(ae){if(f.value=!0,z(),ae&&ae.length>0){const ue=ae.filter(Be=>Be.classify==="人员").map(Be=>({userName:Be.userName||Be.label||Be.userId,userId:Be.userId,phone:Be.phone}));J.value=ue,m.value=ue}else J.value=[],m.value=[]}async function Ke(){const ae=localStorage.getItem("xtoken");if(ae&&n.baseUrl)try{const Be=await(await fetch(`${n.baseUrl}/api/systemUserJwt/sso-login?xtoken=${ae}`,{method:"POST",headers:{"Content-Type":"application/json"}})).json();Be.code==0?s.value=Be.data.tokenValue:console.error("Component VoiceBroadcast: Failed to fetch token:",Be.message)}catch(ue){console.error("Component VoiceBroadcast: Error fetching token:",ue)}else console.warn("Component VoiceBroadcast: Cannot fetch token. xtoken not found in localStorage or baseUrl prop is missing.")}return l.onMounted(()=>{localStorage.getItem("xtoken")&&Ke(),q(),ut.on("inviteListUpdate",ae=>{if(Array.isArray(ae)){const ue=new Map;J.value.forEach(Ie=>ue.set(Ie.userId,Ie)),ae.forEach(Ie=>ue.set(Ie.userId,{userName:Ie.userName||Ie.label||Ie.userId,userId:Ie.userId,phone:Ie.phone}));const Be=Array.from(ue.values());J.value=Be,m.value=Be}})}),e({openDialog:le}),(ae,ue)=>{const Be=l.resolveComponent("el-input"),Ie=l.resolveComponent("el-form-item"),tt=l.resolveComponent("el-date-picker"),ze=l.resolveComponent("el-form"),Se=l.resolveComponent("el-option"),Ve=l.resolveComponent("el-select"),ke=l.resolveComponent("el-dialog"),Me=l.resolveDirective("loading");return l.openBlock(),l.createElementBlock("div",null,[l.createElementVNode("div",bj,[l.createVNode(ke,{modelValue:f.value,"onUpdate:modelValue":ue[8]||(ue[8]=Pe=>f.value=Pe),overflow:"","close-on-press-escape":!1,draggable:"","close-on-click-modal":!0,"show-close":!1,modal:!0,"align-center":""},{header:l.withCtx(()=>[l.createElementVNode("div",{class:"title"},[_j,l.createElementVNode("img",{src:vj,alt:"",onClick:k})])]),default:l.withCtx(()=>[l.withDirectives((l.openBlock(),l.createElementBlock("div",kj,[l.createElementVNode("div",Tj,[F.value==="edit"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:0},[l.createVNode(ze,{ref_key:"mainFormRef",ref:c,model:d,class:"main-form",rules:u},{default:l.withCtx(()=>[l.createElementVNode("div",Sj,[l.createVNode(Ie,{label:"指令标题:",prop:"title"},{default:l.withCtx(()=>[l.createVNode(Be,{modelValue:d.title,"onUpdate:modelValue":ue[0]||(ue[0]=Pe=>d.title=Pe),placeholder:"请输入"},null,8,["modelValue"])]),_:1}),l.createVNode(Ie,{label:"循环呼叫次数:"},{default:l.withCtx(()=>[l.createElementVNode("div",Cj,[l.createElementVNode("div",{class:"picker-btn picker-btn-sub",onClick:N}),l.createElementVNode("div",xj,l.toDisplayString(d.callNum),1),l.createElementVNode("div",{class:"picker-btn picker-btn-plus",onClick:S})])]),_:1}),l.createVNode(Ie,{label:"呼叫截止时间:",prop:"deadlineTime"},{default:l.withCtx(()=>[l.createVNode(tt,{modelValue:d.deadlineTime,"onUpdate:modelValue":ue[1]||(ue[1]=Pe=>d.deadlineTime=Pe),type:"datetime",placeholder:"请选择呼叫截止时间",format:"YYYY-MM-DD HH:mm:ss","date-format":"MMM DD, YYYY","time-format":"HH:mm:ss","disabled-date":H},null,8,["modelValue"])]),_:1})]),l.createElementVNode("div",Ej,[l.createVNode(Be,{class:"voice-detect-content",type:"textarea",modelValue:p.value,"onUpdate:modelValue":ue[2]||(ue[2]=Pe=>p.value=Pe),placeholder:"请输入通知内容(200字以内)",rows:8,resize:"none",maxlength:"200"},null,8,["modelValue"]),l.createElementVNode("div",wj,[l.createElementVNode("div",{class:"btn",onClick:D},l.toDisplayString(y.value?"停止识别":"语音识别"),1)])])]),_:1},8,["model","rules"]),l.createElementVNode("div",Dj,[Aj,l.createVNode(ze,{model:d},{default:l.withCtx(()=>[l.createVNode(Ie,{label:"调节语速:"},{default:l.withCtx(()=>[l.createVNode(Ve,{modelValue:d.speechRate,"onUpdate:modelValue":ue[3]||(ue[3]=Pe=>d.speechRate=Pe),placeholder:"1.0x(默认)"},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(h.value,Pe=>(l.openBlock(),l.createBlock(Se,{key:Pe.value,label:Pe.label,value:Pe.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])]),l.createElementVNode("div",{class:"generate-button-wrapper"},[l.createElementVNode("div",{class:"btn",onClick:w},"开始合成")])],64)):F.value==="success"?(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createVNode(ze,{ref_key:"mainFormRef",ref:c,model:d,class:"main-form",rules:u},{default:l.withCtx(()=>[l.createElementVNode("div",Ij,[l.createVNode(Ie,{label:"指令标题:",prop:"title"},{default:l.withCtx(()=>[l.createVNode(Be,{modelValue:d.title,"onUpdate:modelValue":ue[4]||(ue[4]=Pe=>d.title=Pe),placeholder:"请输入"},null,8,["modelValue"])]),_:1}),l.createVNode(Ie,{label:"循环呼叫次数:"},{default:l.withCtx(()=>[l.createElementVNode("div",Nj,[l.createElementVNode("div",{class:"picker-btn picker-btn-sub",onClick:N}),l.createElementVNode("div",Pj,l.toDisplayString(d.callNum),1),l.createElementVNode("div",{class:"picker-btn picker-btn-plus",onClick:S})])]),_:1}),l.createVNode(Ie,{label:"呼叫截止时间:",prop:"deadlineTime"},{default:l.withCtx(()=>[l.createVNode(tt,{modelValue:d.deadlineTime,"onUpdate:modelValue":ue[5]||(ue[5]=Pe=>d.deadlineTime=Pe),type:"datetime",placeholder:"请选择呼叫截止时间",format:"YYYY-MM-DD HH:mm:ss","date-format":"MMM DD, YYYY","time-format":"HH:mm:ss","disabled-date":H},null,8,["modelValue"])]),_:1})])]),_:1},8,["model","rules"]),l.createElementVNode("div",Oj,[l.createElementVNode("div",Mj,[V.value&&V.value.length>0?(l.openBlock(),l.createElementBlock("div",Rj," 语音文件生成成功 ")):(l.openBlock(),l.createElementBlock("div",Lj,"语音文件生成中...")),l.createElementVNode("div",Bj,[l.createElementVNode("div",Uj,[l.createElementVNode("video",{ref_key:"videoRef",ref:oe,src:V.value,onTimeupdate:We,onLoadedmetadata:pe,onPlay:Te,onPause:Ue,style:{display:"none"}},null,40,Fj),l.createElementVNode("div",Vj,[l.createElementVNode("button",{onClick:_e,class:"play-btn"},[we.value?(l.openBlock(),l.createElementBlock("span",$j,"⏸️")):(l.openBlock(),l.createElementBlock("span",jj,"▶️"))]),l.createElementVNode("span",Hj,l.toDisplayString(nt(be.value))+" / "+l.toDisplayString(nt(Z.value)),1),l.withDirectives(l.createElementVNode("input",{type:"range",min:"0",max:Z.value,step:"0.1","onUpdate:modelValue":ue[6]||(ue[6]=Pe=>be.value=Pe),onInput:Ne,class:"progress-bar"},null,40,qj),[[l.vModelText,be.value]])])])])]),l.createElementVNode("div",zj,[l.createElementVNode("div",Gj,[Wj,Kj,l.createElementVNode("span",Xj,l.toDisplayString(J.value.length),1),l.createElementVNode("img",{src:yj,style:{width:"18px",height:"18px","margin-left":"11px",cursor:"pointer"},onClick:ie})]),l.createElementVNode("div",Yj,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(J.value,(Pe,it)=>(l.openBlock(),l.createElementBlock("span",{class:"receiver-tag",key:Pe.userId},[l.createTextVNode(l.toDisplayString(Pe.userName)+" ",1),l.createElementVNode("span",{class:"receiver-remove",onClick:bt=>X(it)},"×",8,Jj)]))),128))])]),l.createElementVNode("div",Qj,[l.createElementVNode("div",{class:"btn btn-back",onClick:ue[7]||(ue[7]=Pe=>F.value="edit")}," 返回上一步 "),l.createElementVNode("div",{class:"btn btn-cancel",onClick:k},"取消"),l.createElementVNode("div",{class:"btn btn-send",onClick:$}," 下发 ")])])],64)):l.createCommentVNode("",!0)])])),[[Me,b.value]])]),_:1},8,["modelValue"])]),l.createVNode(Yp,{inviteList:m.value,baseUrl:i.baseUrl,token:a.value,componentType:"voiceBroadcast",onInviteListUpdate:_},null,8,["inviteList","baseUrl","token"])])}}},[["__scopeId","data-v-f64ae524"]]);Bd.install=function(i){i.component("VoiceBroadcast",Bd)};const Zj=[Xu,Tl,Sl,zl,mg,Wl,gg,Bd,dg],vg=i=>{vg.installed||Zj.forEach(e=>{i.use(e)})},e$={install:vg};di.LiveAddressBook=zl,di.LiveCallBoard=Tl,di.LivePoint=Xu,di.LivePointMeeting=Sl,di.VoiceBroadcast=Bd,di.default=e$,di.install=vg,Object.defineProperties(di,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|