123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- "use strict";/**
- * @vue/shared v3.4.21
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
- * @license MIT
- **/function wi(i,e){const t=new Set(i.split(","));return e?n=>t.has(n.toLowerCase()):n=>t.has(n)}const Re=Object.freeze({}),ku=Object.freeze([]),He=()=>{},yx=()=>!1,yh=i=>i.charCodeAt(0)===111&&i.charCodeAt(1)===110&&(i.charCodeAt(2)>122||i.charCodeAt(2)<97),Bu=i=>i.startsWith("onUpdate:"),xe=Object.assign,Xr=(i,e)=>{const t=i.indexOf(e);t>-1&&i.splice(t,1)},vx=Object.prototype.hasOwnProperty,ne=(i,e)=>vx.call(i,e),te=Array.isArray,Fn=i=>Ft(i)==="[object Map]",vh=i=>Ft(i)==="[object Set]",W=i=>typeof i=="function",Te=i=>typeof i=="string",Di=i=>typeof i=="symbol",Ee=i=>i!==null&&typeof i=="object",_s=i=>(Ee(i)||W(i))&&W(i.then)&&W(i.catch),Eh=Object.prototype.toString,Ft=i=>Eh.call(i),Jr=i=>Ft(i).slice(8,-1),Ge=i=>Ft(i)==="[object Object]",ac=i=>Te(i)&&i!=="NaN"&&i[0]!=="-"&&""+parseInt(i,10)===i,Ah=wi(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ex=wi("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),Zr=i=>{const e=Object.create(null);return t=>e[t]||(e[t]=i(t))},Ax=/-(\w)/g,Ht=Zr(i=>i.replace(Ax,(e,t)=>t?t.toUpperCase():"")),Sx=/\B([A-Z])/g,Hn=Zr(i=>i.replace(Sx,"-$1").toLowerCase()),Gn=Zr(i=>i.charAt(0).toUpperCase()+i.slice(1)),Ln=Zr(i=>i?`on${Gn(i)}`:""),En=(i,e)=>!Object.is(i,e),rr=(i,e)=>{for(let t=0;t<i.length;t++)i[t](e)},Tx=(i,e,t)=>{Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value:t})},bx=i=>{const e=parseFloat(i);return isNaN(e)?i:e};function Sh(i){if(te(i)){const e={};for(let t=0;t<i.length;t++){const n=i[t],s=Te(n)?Lx(n):Sh(n);if(s)for(const r in s)e[r]=s[r]}return e}else if(Te(i)||Ee(i))return i}const _x=/;(?![^(]*\))/g,Ix=/:([^]+)/,Cx=/\/\*[^]*?\*\//g;function Lx(i){const e={};return i.replace(Cx,"").split(_x).forEach(t=>{if(t){const n=t.split(Ix);n.length>1&&(e[n[0].trim()]=n[1].trim())}}),e}function Th(i){let e="";if(Te(i))e=i;else if(te(i))for(let t=0;t<i.length;t++){const n=Th(i[t]);n&&(e+=n+" ")}else if(Ee(i))for(const t in i)i[t]&&(e+=t+" ");return e.trim()}const Rx=i=>Te(i)?i:i==null?"":te(i)||Ee(i)&&(i.toString===Eh||!W(i.toString))?JSON.stringify(i,bh,2):String(i),bh=(i,e)=>e&&e.__v_isRef?bh(i,e.value):Fn(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[n,s],r)=>(t[Eo(n,r)+" =>"]=s,t),{})}:vh(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>Eo(t))}:Di(e)?Eo(e):Ee(e)&&!te(e)&&!Ge(e)?String(e):e,Eo=(i,e="")=>{var t;return Di(i)?`Symbol(${(t=i.description)!=null?t:e})`:i},Ao="zh-Hans",Fu="zh-Hant",ns="en",Dx="fr",Px="es";function kx(i,e){return!!e.find(t=>i.indexOf(t)!==-1)}function Bx(i,e){return e.find(t=>i.indexOf(t)===0)}function _h(i,e){if(!i)return;if(i=i.trim().replace(/_/g,"-"),e&&e[i])return i;if(i=i.toLowerCase(),i==="chinese")return Ao;if(i.indexOf("zh")===0)return i.indexOf("-hans")>-1?Ao:i.indexOf("-hant")>-1||kx(i,["-tw","-hk","-mo","-cht"])?Fu:Ao;let t=[ns,Dx,Px];e&&Object.keys(e).length>0&&(t=Object.keys(e));const n=Bx(i,t);if(n)return n}const Fx="d",eo="onShow",to="onHide",Ih="onLaunch",Kn="onError",Ch="onThemeChange",Lh="onPageNotFound",Rh="onUnhandledRejection",Ox="onExit",Is="onLoad",lc="onReady",cc="onUnload",wh="onInit",Dh="onSaveExitState",Ph="onResize",kh="onBackPress",Bh="onPageScroll",uc="onTabItemTap",fc="onReachBottom",dc="onPullDownRefresh",Fh="onShareTimeline",Oh="onShareChat",hc="onAddToFavorites",Mh="onShareAppMessage",Nh="onNavigationBarButtonTap",Uh="onNavigationBarSearchInputClicked",$h="onNavigationBarSearchInputChanged",Hh="onNavigationBarSearchInputConfirmed",Gh="onNavigationBarSearchInputFocusChanged",Mx="virtualHostStyle",Nx="virtualHostClass",Ux="virtualHostHidden",ja="virtualHostId";function $x(i){return i.indexOf("/")===0}function Hx(i){return $x(i)?i:"/"+i}const Gx=(i,e)=>{let t;for(let n=0;n<i.length;n++)t=i[n](e);return t};function Kh(i,e=null){let t;return(...n)=>(i&&(t=i.apply(e,n),i=null),t)}function Vh(i,e){if(!Te(e))return;e=e.replace(/\[(\d+)\]/g,".$1");const t=e.split(".");let n=t[0];return i||(i={}),t.length===1?i[n]:Vh(i[n],t.slice(1).join("."))}function jh(i){let e={};return Ge(i)&&Object.keys(i).sort().forEach(t=>{const n=t;e[n]=i[n]}),Object.keys(e)?e:i}const Kx=/:/g;function Vx(i){return Ht(i.replace(Kx,"-"))}const jx=encodeURIComponent;function qx(i,e=jx){const t=i?Object.keys(i).map(n=>{let s=i[n];return typeof s===void 0||s===null?s="":Ge(s)&&(s=JSON.stringify(s)),e(n)+"="+e(s)}).filter(n=>n.length>0).join("&"):null;return t?`?${t}`:""}const Wx=[wh,Is,eo,to,cc,kh,Bh,uc,fc,dc,Fh,Mh,Oh,hc,Dh,Nh,Uh,$h,Hh,Gh];function zx(i){return Wx.indexOf(i)>-1}const qh=[eo,to,Ih,Kn,Ch,Lh,Rh,Ox,wh,Is,lc,cc,Ph,kh,Bh,uc,fc,dc,Fh,hc,Mh,Oh,Dh,Nh,Uh,$h,Hh,Gh],Wa={onPageScroll:1,onShareAppMessage:2,onShareTimeline:4};function Wh(i,e,t=!0){return t&&!W(e)?!1:qh.indexOf(i)>-1?!0:i.indexOf("on")===0}let za;const zh=[];function Qx(i){if(za)return i(za);zh.push(i)}function Yx(i){za=i,zh.forEach(e=>e(i))}const Xx=Kh((i,e)=>e(i)),Qh=function(){};Qh.prototype={_id:1,on:function(i,e,t){var n=this.e||(this.e={});return(n[i]||(n[i]=[])).push({fn:e,ctx:t,_id:this._id}),this._id++},once:function(i,e,t){var n=this;function s(){n.off(i,s),e.apply(t,arguments)}return s._=e,this.on(i,s,t)},emit:function(i){var e=[].slice.call(arguments,1),t=((this.e||(this.e={}))[i]||[]).slice(),n=0,s=t.length;for(n;n<s;n++)t[n].fn.apply(t[n].ctx,e);return this},off:function(i,e){var t=this.e||(this.e={}),n=t[i],s=[];if(n&&e){for(var r=n.length-1;r>=0;r--)if(n[r].fn===e||n[r].fn._===e||n[r]._id===e){n.splice(r,1);break}s=n}return s.length?t[i]=s:delete t[i],this}};var Jx=Qh;/**
- * @dcloudio/uni-mp-vue v3.4.21
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
- * @license MIT
- **/function An(i,...e){console.warn(`[Vue warn] ${i}`,...e)}let Tt;class Yh{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=Tt,!e&&Tt&&(this.index=(Tt.scopes||(Tt.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const t=Tt;try{return Tt=this,e()}finally{Tt=t}}else An("cannot run an inactive effect scope.")}on(){Tt=this}off(){Tt=this.parent}stop(e){if(this._active){let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].stop(!0);if(!this.detached&&this.parent&&!e){const s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0,this._active=!1}}}function Zx(i){return new Yh(i)}function e2(i,e=Tt){e&&e.active&&e.effects.push(i)}function t2(){return Tt}let On;class pc{constructor(e,t,n,s){this.fn=e,this.trigger=t,this.scheduler=n,this.active=!0,this.deps=[],this._dirtyLevel=4,this._trackId=0,this._runnings=0,this._shouldSchedule=!1,this._depsLength=0,e2(this,s)}get dirty(){if(this._dirtyLevel===2||this._dirtyLevel===3){this._dirtyLevel=1,Wn();for(let e=0;e<this._depsLength;e++){const t=this.deps[e];if(t.computed&&(n2(t.computed),this._dirtyLevel>=4))break}this._dirtyLevel===1&&(this._dirtyLevel=0),zn()}return this._dirtyLevel>=4}set dirty(e){this._dirtyLevel=e?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let e=mn,t=On;try{return mn=!0,On=this,this._runnings++,Ou(this),this.fn()}finally{Mu(this),this._runnings--,On=t,mn=e}}stop(){var e;this.active&&(Ou(this),Mu(this),(e=this.onStop)==null||e.call(this),this.active=!1)}}function n2(i){return i.value}function Ou(i){i._trackId++,i._depsLength=0}function Mu(i){if(i.deps.length>i._depsLength){for(let e=i._depsLength;e<i.deps.length;e++)Xh(i.deps[e],i);i.deps.length=i._depsLength}}function Xh(i,e){const t=i.get(e);t!==void 0&&e._trackId!==t&&(i.delete(e),i.size===0&&i.cleanup())}let mn=!0,Qa=0;const Jh=[];function Wn(){Jh.push(mn),mn=!1}function zn(){const i=Jh.pop();mn=i===void 0?!0:i}function gc(){Qa++}function mc(){for(Qa--;!Qa&&Ya.length;)Ya.shift()()}function Zh(i,e,t){var n;if(e.get(i)!==i._trackId){e.set(i,i._trackId);const s=i.deps[i._depsLength];s!==e?(s&&Xh(s,i),i.deps[i._depsLength++]=e):i._depsLength++,(n=i.onTrack)==null||n.call(i,xe({effect:i},t))}}const Ya=[];function ep(i,e,t){var n;gc();for(const s of i.keys()){let r;s._dirtyLevel<e&&(r??(r=i.get(s)===s._trackId))&&(s._shouldSchedule||(s._shouldSchedule=s._dirtyLevel===0),s._dirtyLevel=e),s._shouldSchedule&&(r??(r=i.get(s)===s._trackId))&&((n=s.onTrigger)==null||n.call(s,xe({effect:s},t)),s.trigger(),(!s._runnings||s.allowRecurse)&&s._dirtyLevel!==2&&(s._shouldSchedule=!1,s.scheduler&&Ya.push(s.scheduler)))}mc()}const tp=(i,e)=>{const t=new Map;return t.cleanup=i,t.computed=e,t},Xa=new WeakMap,Mn=Symbol("iterate"),Ja=Symbol("Map key iterate");function Ye(i,e,t){if(mn&&On){let n=Xa.get(i);n||Xa.set(i,n=new Map);let s=n.get(t);s||n.set(t,s=tp(()=>n.delete(t))),Zh(On,s,{target:i,type:e,key:t})}}function Qt(i,e,t,n,s,r){const o=Xa.get(i);if(!o)return;let a=[];if(e==="clear")a=[...o.values()];else if(t==="length"&&te(i)){const c=Number(n);o.forEach((l,u)=>{(u==="length"||!Di(u)&&u>=c)&&a.push(l)})}else switch(t!==void 0&&a.push(o.get(t)),e){case"add":te(i)?ac(t)&&a.push(o.get("length")):(a.push(o.get(Mn)),Fn(i)&&a.push(o.get(Ja)));break;case"delete":te(i)||(a.push(o.get(Mn)),Fn(i)&&a.push(o.get(Ja)));break;case"set":Fn(i)&&a.push(o.get(Mn));break}gc();for(const c of a)c&&ep(c,4,{target:i,type:e,key:t,newValue:n,oldValue:s,oldTarget:r});mc()}const i2=wi("__proto__,__v_isRef,__isVue"),np=new Set(Object.getOwnPropertyNames(Symbol).filter(i=>i!=="arguments"&&i!=="caller").map(i=>Symbol[i]).filter(Di)),Nu=s2();function s2(){const i={};return["includes","indexOf","lastIndexOf"].forEach(e=>{i[e]=function(...t){const n=fe(this);for(let r=0,o=this.length;r<o;r++)Ye(n,"get",r+"");const s=n[e](...t);return s===-1||s===!1?n[e](...t.map(fe)):s}}),["push","pop","shift","unshift","splice"].forEach(e=>{i[e]=function(...t){Wn(),gc();const n=fe(this)[e].apply(this,t);return mc(),zn(),n}}),i}function r2(i){const e=fe(this);return Ye(e,"has",i),e.hasOwnProperty(i)}class ip{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){const s=this._isReadonly,r=this._isShallow;if(t==="__v_isReactive")return!s;if(t==="__v_isReadonly")return s;if(t==="__v_isShallow")return r;if(t==="__v_raw")return n===(s?r?up:cp:r?lp:ap).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const o=te(e);if(!s){if(o&&ne(Nu,t))return Reflect.get(Nu,t,n);if(t==="hasOwnProperty")return r2}const a=Reflect.get(e,t,n);return(Di(t)?np.has(t):i2(t))||(s||Ye(e,"get",t),r)?a:et(a)?o&&ac(t)?a:a.value:Ee(a)?s?fp(a):so(a):a}}class sp extends ip{constructor(e=!1){super(!1,e)}set(e,t,n,s){let r=e[t];if(!this._isShallow){const c=Ei(r);if(!Er(n)&&!Ei(n)&&(r=fe(r),n=fe(n)),!te(e)&&et(r)&&!et(n))return c?!1:(r.value=n,!0)}const o=te(e)&&ac(t)?Number(t)<e.length:ne(e,t),a=Reflect.set(e,t,n,s);return e===fe(s)&&(o?En(n,r)&&Qt(e,"set",t,n,r):Qt(e,"add",t,n)),a}deleteProperty(e,t){const n=ne(e,t),s=e[t],r=Reflect.deleteProperty(e,t);return r&&n&&Qt(e,"delete",t,void 0,s),r}has(e,t){const n=Reflect.has(e,t);return(!Di(t)||!np.has(t))&&Ye(e,"has",t),n}ownKeys(e){return Ye(e,"iterate",te(e)?"length":Mn),Reflect.ownKeys(e)}}class rp extends ip{constructor(e=!1){super(!0,e)}set(e,t){return An(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0}deleteProperty(e,t){return An(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}}const o2=new sp,a2=new rp,l2=new sp(!0),c2=new rp(!0),xc=i=>i,no=i=>Reflect.getPrototypeOf(i);function Bs(i,e,t=!1,n=!1){i=i.__v_raw;const s=fe(i),r=fe(e);t||(En(e,r)&&Ye(s,"get",e),Ye(s,"get",r));const{has:o}=no(s),a=n?xc:t?vc:is;if(o.call(s,e))return a(i.get(e));if(o.call(s,r))return a(i.get(r));i!==s&&i.get(e)}function Fs(i,e=!1){const t=this.__v_raw,n=fe(t),s=fe(i);return e||(En(i,s)&&Ye(n,"has",i),Ye(n,"has",s)),i===s?t.has(i):t.has(i)||t.has(s)}function Os(i,e=!1){return i=i.__v_raw,!e&&Ye(fe(i),"iterate",Mn),Reflect.get(i,"size",i)}function Uu(i){i=fe(i);const e=fe(this);return no(e).has.call(e,i)||(e.add(i),Qt(e,"add",i,i)),this}function $u(i,e){e=fe(e);const t=fe(this),{has:n,get:s}=no(t);let r=n.call(t,i);r?op(t,n,i):(i=fe(i),r=n.call(t,i));const o=s.call(t,i);return t.set(i,e),r?En(e,o)&&Qt(t,"set",i,e,o):Qt(t,"add",i,e),this}function Hu(i){const e=fe(this),{has:t,get:n}=no(e);let s=t.call(e,i);s?op(e,t,i):(i=fe(i),s=t.call(e,i));const r=n?n.call(e,i):void 0,o=e.delete(i);return s&&Qt(e,"delete",i,void 0,r),o}function Gu(){const i=fe(this),e=i.size!==0,t=Fn(i)?new Map(i):new Set(i),n=i.clear();return e&&Qt(i,"clear",void 0,void 0,t),n}function Ms(i,e){return function(n,s){const r=this,o=r.__v_raw,a=fe(o),c=e?xc:i?vc:is;return!i&&Ye(a,"iterate",Mn),o.forEach((l,u)=>n.call(s,c(l),c(u),r))}}function Ns(i,e,t){return function(...n){const s=this.__v_raw,r=fe(s),o=Fn(r),a=i==="entries"||i===Symbol.iterator&&o,c=i==="keys"&&o,l=s[i](...n),u=t?xc:e?vc:is;return!e&&Ye(r,"iterate",c?Ja:Mn),{next(){const{value:f,done:d}=l.next();return d?{value:f,done:d}:{value:a?[u(f[0]),u(f[1])]:u(f),done:d}},[Symbol.iterator](){return this}}}}function tn(i){return function(...e){{const t=e[0]?`on key "${e[0]}" `:"";An(`${Gn(i)} operation ${t}failed: target is readonly.`,fe(this))}return i==="delete"?!1:i==="clear"?void 0:this}}function u2(){const i={get(r){return Bs(this,r)},get size(){return Os(this)},has:Fs,add:Uu,set:$u,delete:Hu,clear:Gu,forEach:Ms(!1,!1)},e={get(r){return Bs(this,r,!1,!0)},get size(){return Os(this)},has:Fs,add:Uu,set:$u,delete:Hu,clear:Gu,forEach:Ms(!1,!0)},t={get(r){return Bs(this,r,!0)},get size(){return Os(this,!0)},has(r){return Fs.call(this,r,!0)},add:tn("add"),set:tn("set"),delete:tn("delete"),clear:tn("clear"),forEach:Ms(!0,!1)},n={get(r){return Bs(this,r,!0,!0)},get size(){return Os(this,!0)},has(r){return Fs.call(this,r,!0)},add:tn("add"),set:tn("set"),delete:tn("delete"),clear:tn("clear"),forEach:Ms(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(r=>{i[r]=Ns(r,!1,!1),t[r]=Ns(r,!0,!1),e[r]=Ns(r,!1,!0),n[r]=Ns(r,!0,!0)}),[i,t,e,n]}const[f2,d2,h2,p2]=u2();function io(i,e){const t=e?i?p2:h2:i?d2:f2;return(n,s,r)=>s==="__v_isReactive"?!i:s==="__v_isReadonly"?i:s==="__v_raw"?n:Reflect.get(ne(t,s)&&s in n?t:n,s,r)}const g2={get:io(!1,!1)},m2={get:io(!1,!0)},x2={get:io(!0,!1)},y2={get:io(!0,!0)};function op(i,e,t){const n=fe(t);if(n!==t&&e.call(i,n)){const s=Jr(i);An(`Reactive ${s} contains both the raw and reactive versions of the same object${s==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const ap=new WeakMap,lp=new WeakMap,cp=new WeakMap,up=new WeakMap;function v2(i){switch(i){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function E2(i){return i.__v_skip||!Object.isExtensible(i)?0:v2(Jr(i))}function so(i){return Ei(i)?i:ro(i,!1,o2,g2,ap)}function A2(i){return ro(i,!1,l2,m2,lp)}function fp(i){return ro(i,!0,a2,x2,cp)}function ui(i){return ro(i,!0,c2,y2,up)}function ro(i,e,t,n,s){if(!Ee(i))return An(`value cannot be made reactive: ${String(i)}`),i;if(i.__v_raw&&!(e&&i.__v_isReactive))return i;const r=s.get(i);if(r)return r;const o=E2(i);if(o===0)return i;const a=new Proxy(i,o===2?n:t);return s.set(i,a),a}function gi(i){return Ei(i)?gi(i.__v_raw):!!(i&&i.__v_isReactive)}function Ei(i){return!!(i&&i.__v_isReadonly)}function Er(i){return!!(i&&i.__v_isShallow)}function S2(i){return gi(i)||Ei(i)}function fe(i){const e=i&&i.__v_raw;return e?fe(e):i}function yc(i){return Object.isExtensible(i)&&Tx(i,"__v_skip",!0),i}const is=i=>Ee(i)?so(i):i,vc=i=>Ee(i)?fp(i):i,T2="Computed is still dirty after getter evaluation, likely because a computed is mutating its own dependency in its getter. State mutations in computed getters should be avoided. Check the docs for more details: https://vuejs.org/guide/essentials/computed.html#getters-should-be-side-effect-free";class dp{constructor(e,t,n,s){this.getter=e,this._setter=t,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new pc(()=>e(this._value),()=>or(this,this.effect._dirtyLevel===2?2:3)),this.effect.computed=this,this.effect.active=this._cacheable=!s,this.__v_isReadonly=n}get value(){const e=fe(this);return(!e._cacheable||e.effect.dirty)&&En(e._value,e._value=e.effect.run())&&or(e,4),hp(e),e.effect._dirtyLevel>=2&&(this._warnRecursive&&An(T2,`
- getter: `,this.getter),or(e,2)),e._value}set value(e){this._setter(e)}get _dirty(){return this.effect.dirty}set _dirty(e){this.effect.dirty=e}}function b2(i,e,t=!1){let n,s;const r=W(i);r?(n=i,s=()=>{An("Write operation failed: computed value is readonly")}):(n=i.get,s=i.set);const o=new dp(n,s,r||!s,t);return e&&!t&&(o.effect.onTrack=e.onTrack,o.effect.onTrigger=e.onTrigger),o}function hp(i){var e;mn&&On&&(i=fe(i),Zh(On,(e=i.dep)!=null?e:i.dep=tp(()=>i.dep=void 0,i instanceof dp?i:void 0),{target:i,type:"get",key:"value"}))}function or(i,e=4,t){i=fe(i);const n=i.dep;n&&ep(n,e,{target:i,type:"set",key:"value",newValue:t})}function et(i){return!!(i&&i.__v_isRef===!0)}function _2(i){return I2(i,!1)}function I2(i,e){return et(i)?i:new C2(i,e)}class C2{constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:fe(e),this._value=t?e:is(e)}get value(){return hp(this),this._value}set value(e){const t=this.__v_isShallow||Er(e)||Ei(e);e=t?e:fe(e),En(e,this._rawValue)&&(this._rawValue=e,this._value=t?e:is(e),or(this,4,e))}}function pp(i){return et(i)?i.value:i}const L2={get:(i,e,t)=>pp(Reflect.get(i,e,t)),set:(i,e,t,n)=>{const s=i[e];return et(s)&&!et(t)?(s.value=t,!0):Reflect.set(i,e,t,n)}};function gp(i){return gi(i)?i:new Proxy(i,L2)}const Nn=[];function Ec(i){Nn.push(i)}function Ac(){Nn.pop()}function J(i,...e){Wn();const t=Nn.length?Nn[Nn.length-1].component:null,n=t&&t.appContext.config.warnHandler,s=R2();if(n)Yt(n,t,11,[i+e.map(r=>{var o,a;return(a=(o=r.toString)==null?void 0:o.call(r))!=null?a:JSON.stringify(r)}).join(""),t&&t.proxy,s.map(({vnode:r})=>`at <${co(t,r.type)}>`).join(`
- `),s]);else{const r=[`[Vue warn]: ${i}`,...e];s.length&&r.push(`
- `,...w2(s)),console.warn(...r)}zn()}function R2(){let i=Nn[Nn.length-1];if(!i)return[];const e=[];for(;i;){const t=e[0];t&&t.vnode===i?t.recurseCount++:e.push({vnode:i,recurseCount:0});const n=i.component&&i.component.parent;i=n&&n.vnode}return e}function w2(i){const e=[];return i.forEach((t,n)=>{e.push(...n===0?[]:[`
- `],...D2(t))}),e}function D2({vnode:i,recurseCount:e}){const t=e>0?`... (${e} recursive calls)`:"",n=i.component?i.component.parent==null:!1,s=` at <${co(i.component,i.type,n)}`,r=">"+t;return i.props?[s,...P2(i.props),r]:[s+r]}function P2(i){const e=[],t=Object.keys(i);return t.slice(0,3).forEach(n=>{e.push(...mp(n,i[n]))}),t.length>3&&e.push(" ..."),e}function mp(i,e,t){return Te(e)?(e=JSON.stringify(e),t?e:[`${i}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?t?e:[`${i}=${e}`]:et(e)?(e=mp(i,fe(e.value),!0),t?e:[`${i}=Ref<`,e,">"]):W(e)?[`${i}=fn${e.name?`<${e.name}>`:""}`]:(e=fe(e),t?e:[`${i}=`,e])}const Sc={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ."};function Yt(i,e,t,n){try{return n?i(...n):i()}catch(s){oo(s,e,t)}}function Sn(i,e,t,n){if(W(i)){const r=Yt(i,e,t,n);return r&&_s(r)&&r.catch(o=>{oo(o,e,t)}),r}const s=[];for(let r=0;r<i.length;r++)s.push(Sn(i[r],e,t,n));return s}function oo(i,e,t,n=!0){const s=e?e.vnode:null;if(e){let r=e.parent;const o=e.proxy,a=Sc[t]||t;for(;r;){const l=r.ec;if(l){for(let u=0;u<l.length;u++)if(l[u](i,o,a)===!1)return}r=r.parent}const c=e.appContext.config.errorHandler;if(c){Yt(c,null,10,[i,o,a]);return}}xp(i,t,s,n)}function xp(i,e,t,n=!0){{const s=Sc[e]||e;t&&Ec(t),J(`Unhandled error${s?` during execution of ${s}`:""}`),t&&Ac(),console.error(i)}}let ss=!1,Za=!1;const $e=[];let kt=0;const mi=[];let qt=null,an=0;const yp=Promise.resolve();let Tc=null;const k2=100;function bc(i){const e=Tc||yp;return i?e.then(this?i.bind(this):i):e}function B2(i){let e=kt+1,t=$e.length;for(;e<t;){const n=e+t>>>1,s=$e[n],r=rs(s);r<i||r===i&&s.pre?e=n+1:t=n}return e}function Ar(i){(!$e.length||!$e.includes(i,ss&&i.allowRecurse?kt+1:kt))&&(i.id==null?$e.push(i):$e.splice(B2(i.id),0,i),vp())}function vp(){!ss&&!Za&&(Za=!0,Tc=yp.then(Sp))}function F2(i){return $e.indexOf(i)>-1}function O2(i){const e=$e.indexOf(i);e>kt&&$e.splice(e,1)}function Ep(i){te(i)?mi.push(...i):(!qt||!qt.includes(i,i.allowRecurse?an+1:an))&&mi.push(i),vp()}function Ap(i,e,t=ss?kt+1:0){for(e=e||new Map;t<$e.length;t++){const n=$e[t];if(n&&n.pre){if(_c(e,n))continue;$e.splice(t,1),t--,n()}}}function M2(i){if(mi.length){const e=[...new Set(mi)].sort((t,n)=>rs(t)-rs(n));if(mi.length=0,qt){qt.push(...e);return}for(qt=e,i=i||new Map,an=0;an<qt.length;an++)_c(i,qt[an])||qt[an]();qt=null,an=0}}const rs=i=>i.id==null?1/0:i.id,N2=(i,e)=>{const t=rs(i)-rs(e);if(t===0){if(i.pre&&!e.pre)return-1;if(e.pre&&!i.pre)return 1}return t};function Sp(i){Za=!1,ss=!0,i=i||new Map,$e.sort(N2);const e=t=>_c(i,t);try{for(kt=0;kt<$e.length;kt++){const t=$e[kt];if(t&&t.active!==!1){if(e(t))continue;Yt(t,null,14)}}}finally{kt=0,$e.length=0,M2(i),ss=!1,Tc=null,($e.length||mi.length)&&Sp(i)}}function _c(i,e){if(!i.has(e))i.set(e,1);else{const t=i.get(e);if(t>k2){const n=e.ownerInstance,s=n&&wc(n.type);return oo(`Maximum recursive updates exceeded${s?` in component <${s}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}else i.set(e,t+1)}}let Bt,Ki=[],el=!1;function ao(i,...e){Bt?Bt.emit(i,...e):el||Ki.push({event:i,args:e})}function Tp(i,e){var t,n;Bt=i,Bt?(Bt.enabled=!0,Ki.forEach(({event:s,args:r})=>Bt.emit(s,...r)),Ki=[]):typeof window<"u"&&window.HTMLElement&&!((n=(t=window.navigator)==null?void 0:t.userAgent)!=null&&n.includes("jsdom"))?((e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(r=>{Tp(r,e)}),setTimeout(()=>{Bt||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,el=!0,Ki=[])},3e3)):(el=!0,Ki=[])}function U2(i,e){ao("app:init",i,e,{Fragment:wy,Text:Dy,Comment:Py,Static:ky})}const $2=Ic("component:added"),H2=Ic("component:updated"),G2=Ic("component:removed"),K2=i=>{Bt&&typeof Bt.cleanupBuffer=="function"&&!Bt.cleanupBuffer(i)&&G2(i)};/*! #__NO_SIDE_EFFECTS__ */function Ic(i){return e=>{ao(i,e.appContext.app,e.uid,e.uid===0?void 0:e.parent?e.parent.uid:0,e)}}const V2=bp("perf:start"),j2=bp("perf:end");function bp(i){return(e,t,n)=>{ao(i,e.appContext.app,e.uid,e,t,n)}}function q2(i,e,t){ao("component:emit",i.appContext.app,i,e,t)}function W2(i,e,...t){if(i.isUnmounted)return;const n=i.vnode.props||Re;{const{emitsOptions:u,propsOptions:[f]}=i;if(u)if(!(e in u))(!f||!(Ln(e)in f))&&J(`Component emitted event "${e}" but it is neither declared in the emits option nor as an "${Ln(e)}" prop.`);else{const d=u[e];W(d)&&(d(...t)||J(`Invalid event arguments: event validation failed for event "${e}".`))}}let s=t;const r=e.startsWith("update:"),o=r&&e.slice(7);if(o&&o in n){const u=`${o==="modelValue"?"model":o}Modifiers`,{number:f,trim:d}=n[u]||Re;d&&(s=t.map(h=>Te(h)?h.trim():h)),f&&(s=t.map(bx))}q2(i,e,s);{const u=e.toLowerCase();u!==e&&n[Ln(u)]&&J(`Event "${u}" is emitted in component ${co(i,i.type)} but the handler is registered for "${e}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${Hn(e)}" instead of "${e}".`)}let a,c=n[a=Ln(e)]||n[a=Ln(Ht(e))];!c&&r&&(c=n[a=Ln(Hn(e))]),c&&Sn(c,i,6,s);const l=n[a+"Once"];if(l){if(!i.emitted)i.emitted={};else if(i.emitted[a])return;i.emitted[a]=!0,Sn(l,i,6,s)}}function _p(i,e,t=!1){const n=e.emitsCache,s=n.get(i);if(s!==void 0)return s;const r=i.emits;let o={},a=!1;if(!W(i)){const c=l=>{const u=_p(l,e,!0);u&&(a=!0,xe(o,u))};!t&&e.mixins.length&&e.mixins.forEach(c),i.extends&&c(i.extends),i.mixins&&i.mixins.forEach(c)}return!r&&!a?(Ee(i)&&n.set(i,null),null):(te(r)?r.forEach(c=>o[c]=null):xe(o,r),Ee(i)&&n.set(i,o),o)}function Ip(i,e){return!i||!yh(e)?!1:(e=e.slice(2).replace(/Once$/,""),ne(i,e[0].toLowerCase()+e.slice(1))||ne(i,Hn(e))||ne(i,e))}let Vn=null;function Ku(i){const e=Vn;return Vn=i,i&&i.type.__scopeId,e}const tl="components";function z2(i,e){return Q2(tl,i,!0,e)||i}function Q2(i,e,t=!0,n=!1){const s=Vn||ke;if(s){const r=s.type;if(i===tl){const a=wc(r,!1);if(a&&(a===e||a===Ht(e)||a===Gn(Ht(e))))return r}const o=Vu(s[i]||r[i],e)||Vu(s.appContext[i],e);if(!o&&n)return r;if(t&&!o){const a=i===tl?`
- If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.`:"";J(`Failed to resolve ${i.slice(0,-1)}: ${e}${a}`)}return o}else J(`resolve${Gn(i.slice(0,-1))} can only be used in render() or setup().`)}function Vu(i,e){return i&&(i[e]||i[Ht(e)]||i[Gn(Ht(e))])}const Us={};function zi(i,e,t){return W(e)||J("`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."),Cp(i,e,t)}function Cp(i,e,{immediate:t,deep:n,flush:s,once:r,onTrack:o,onTrigger:a}=Re){if(e&&r){const T=e;e=(..._)=>{T(..._),S()}}n!==void 0&&typeof n=="number"&&J('watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.'),e||(t!==void 0&&J('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),n!==void 0&&J('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),r!==void 0&&J('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const c=T=>{J("Invalid watch source: ",T,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},l=ke,u=T=>n===!0?T:fi(T,n===!1?1:void 0);let f,d=!1,h=!1;if(et(i)?(f=()=>i.value,d=Er(i)):gi(i)?(f=()=>u(i),d=!0):te(i)?(h=!0,d=i.some(T=>gi(T)||Er(T)),f=()=>i.map(T=>{if(et(T))return T.value;if(gi(T))return u(T);if(W(T))return Yt(T,l,2);c(T)})):W(i)?e?f=()=>Yt(i,l,2):f=()=>(p&&p(),Sn(i,l,3,[m])):(f=He,c(i)),e&&n){const T=f;f=()=>fi(T())}let p,m=T=>{p=x.onStop=()=>{Yt(T,l,4),p=x.onStop=void 0}},g=h?new Array(i.length).fill(Us):Us;const y=()=>{if(!(!x.active||!x.dirty))if(e){const T=x.run();(n||d||(h?T.some((_,I)=>En(_,g[I])):En(T,g)))&&(p&&p(),Sn(e,l,3,[T,g===Us?void 0:h&&g[0]===Us?[]:g,m]),g=T)}else x.run()};y.allowRecurse=!!e;let v;s==="sync"?v=y:s==="post"?v=()=>ef(y,l&&l.suspense):(y.pre=!0,l&&(y.id=l.uid),v=()=>Ar(y));const x=new pc(f,He,v),E=t2(),S=()=>{x.stop(),E&&Xr(E.effects,x)};return x.onTrack=o,x.onTrigger=a,e?t?y():g=x.run():s==="post"?ef(x.run.bind(x),l&&l.suspense):x.run(),S}function Y2(i,e,t){const n=this.proxy,s=Te(i)?i.includes(".")?Lp(n,i):()=>n[i]:i.bind(n,n);let r;W(e)?r=e:(r=e.handler,t=e);const o=Cs(this),a=Cp(s,r.bind(n),t);return o(),a}function Lp(i,e){const t=e.split(".");return()=>{let n=i;for(let s=0;s<t.length&&n;s++)n=n[t[s]];return n}}function fi(i,e,t=0,n){if(!Ee(i)||i.__v_skip)return i;if(e&&e>0){if(t>=e)return i;t++}if(n=n||new Set,n.has(i))return i;if(n.add(i),et(i))fi(i.value,e,t,n);else if(te(i))for(let s=0;s<i.length;s++)fi(i[s],e,t,n);else if(vh(i)||Fn(i))i.forEach(s=>{fi(s,e,t,n)});else if(Ge(i))for(const s in i)fi(i[s],e,t,n);return i}function Rp(i){Ex(i)&&J("Do not use built-in directive ids as custom directive id: "+i)}function wp(){return{app:null,config:{isNativeTag:yx,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let X2=0;function J2(i,e){return function(n,s=null){W(n)||(n=xe({},n)),s!=null&&!Ee(s)&&(J("root props passed to app.mount() must be an object."),s=null);const r=wp(),o=new WeakSet,a=r.app={_uid:X2++,_component:n,_props:s,_container:null,_context:r,_instance:null,version:Gp,get config(){return r.config},set config(c){J("app.config cannot be replaced. Modify individual options instead.")},use(c,...l){return o.has(c)?J("Plugin has already been applied to target app."):c&&W(c.install)?(o.add(c),c.install(a,...l)):W(c)?(o.add(c),c(a,...l)):J('A plugin must either be a function or an object with an "install" function.'),a},mixin(c){return r.mixins.includes(c)?J("Mixin has already been applied to target app"+(c.name?`: ${c.name}`:"")):r.mixins.push(c),a},component(c,l){return ll(c,r.config),l?(r.components[c]&&J(`Component "${c}" has already been registered in target app.`),r.components[c]=l,a):r.components[c]},directive(c,l){return Rp(c),l?(r.directives[c]&&J(`Directive "${c}" has already been registered in target app.`),r.directives[c]=l,a):r.directives[c]},mount(){},unmount(){},provide(c,l){return c in r.provides&&J(`App already provides property with key "${String(c)}". It will be overwritten with the new value.`),r.provides[c]=l,a},runWithContext(c){const l=Qi;Qi=a;try{return c()}finally{Qi=l}}};return a}}let Qi=null;function Z2(i,e){if(!ke)J("provide() can only be used inside setup().");else{let t=ke.provides;const n=ke.parent&&ke.parent.provides;n===t&&(t=ke.provides=Object.create(n)),t[i]=e,ke.type.mpType==="app"&&ke.appContext.app.provide(i,e)}}function ar(i,e,t=!1){const n=ke||Vn;if(n||Qi){const s=n?n.parent==null?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:Qi._context.provides;if(s&&i in s)return s[i];if(arguments.length>1)return t&&W(e)?e.call(n&&n.proxy):e;J(`injection "${String(i)}" not found.`)}else J("inject() can only be used inside setup() or functional components.")}const ey=i=>i.type.__isKeepAlive;function ty(i,e){Dp(i,"a",e)}function ny(i,e){Dp(i,"da",e)}function Dp(i,e,t=ke){const n=i.__wdc||(i.__wdc=()=>{let s=t;for(;s;){if(s.isDeactivated)return;s=s.parent}return i()});if(Qn(e,n,t),t){let s=t.parent;for(;s&&s.parent;)ey(s.parent.vnode)&&iy(n,e,t,s),s=s.parent}}function iy(i,e,t,n){const s=Qn(e,i,n,!0);Pp(()=>{Xr(n[e],s)},t)}function Qn(i,e,t=ke,n=!1){if(t){zx(i)&&(t=t.root);const s=t[i]||(t[i]=[]),r=e.__weh||(e.__weh=(...o)=>{if(t.isUnmounted)return;Wn();const a=Cs(t),c=Sn(e,t,i,o);return a(),zn(),c});return n?s.unshift(r):s.push(r),r}else{const s=Ln((Sc[i]||i.replace(/^on/,"")).replace(/ hook$/,""));J(`${s} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().`)}}const Xt=i=>(e,t=ke)=>(!Rc||i==="sp")&&Qn(i,(...n)=>e(...n),t),sy=Xt("bm"),ry=Xt("m"),oy=Xt("bu"),ay=Xt("u"),Cc=Xt("bum"),Pp=Xt("um"),ly=Xt("sp"),cy=Xt("rtg"),uy=Xt("rtc");function fy(i,e=ke){Qn("ec",i,e)}const nl=i=>i?Up(i)?Ls(i)||i.proxy:nl(i.parent):null;function dy(i){return i}const os=xe(Object.create(null),{$:dy,$el:i=>i.__$el||(i.__$el={}),$data:i=>i.data,$props:i=>ui(i.props),$attrs:i=>ui(i.attrs),$slots:i=>ui(i.slots),$refs:i=>ui(i.refs),$parent:i=>nl(i.parent),$root:i=>nl(i.root),$emit:i=>i.emit,$options:i=>Fp(i),$forceUpdate:i=>i.f||(i.f=()=>{i.effect.dirty=!0,Ar(i.update)}),$watch:i=>Y2.bind(i)}),Lc=i=>i==="_"||i==="$",So=(i,e)=>i!==Re&&!i.__isScriptSetup&&ne(i,e),kp={get({_:i},e){const{ctx:t,setupState:n,data:s,props:r,accessCache:o,type:a,appContext:c}=i;if(e==="__isVue")return!0;let l;if(e[0]!=="$"){const h=o[e];if(h!==void 0)switch(h){case 1:return n[e];case 2:return s[e];case 4:return t[e];case 3:return r[e]}else{if(So(n,e))return o[e]=1,n[e];if(s!==Re&&ne(s,e))return o[e]=2,s[e];if((l=i.propsOptions[0])&&ne(l,e))return o[e]=3,r[e];if(t!==Re&&ne(t,e))return o[e]=4,t[e];il&&(o[e]=0)}}const u=os[e];let f,d;if(u)return(e==="$attrs"||e==="$slots")&&Ye(i,"get",e),u(i);if((f=a.__cssModules)&&(f=f[e]))return f;if(t!==Re&&ne(t,e))return o[e]=4,t[e];if(d=c.config.globalProperties,ne(d,e))return d[e];Vn&&(!Te(e)||e.indexOf("__v")!==0)&&(s!==Re&&Lc(e[0])&&ne(s,e)?J(`Property ${JSON.stringify(e)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`):i===Vn&&J(`Property ${JSON.stringify(e)} was accessed during render but is not defined on instance.`))},set({_:i},e,t){const{data:n,setupState:s,ctx:r}=i;return So(s,e)?(s[e]=t,!0):s.__isScriptSetup&&ne(s,e)?(J(`Cannot mutate <script setup> binding "${e}" from Options API.`),!1):n!==Re&&ne(n,e)?(n[e]=t,!0):ne(i.props,e)?(J(`Attempting to mutate prop "${e}". Props are readonly.`),!1):e[0]==="$"&&e.slice(1)in i?(J(`Attempting to mutate public property "${e}". Properties starting with $ are reserved and readonly.`),!1):(e in i.appContext.config.globalProperties?Object.defineProperty(r,e,{enumerable:!0,configurable:!0,value:t}):r[e]=t,!0)},has({_:{data:i,setupState:e,accessCache:t,ctx:n,appContext:s,propsOptions:r}},o){let a;return!!t[o]||i!==Re&&ne(i,o)||So(e,o)||(a=r[0])&&ne(a,o)||ne(n,o)||ne(os,o)||ne(s.config.globalProperties,o)},defineProperty(i,e,t){return t.get!=null?i._.accessCache[e]=0:ne(t,"value")&&this.set(i,e,t.value,null),Reflect.defineProperty(i,e,t)}};kp.ownKeys=i=>(J("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(i));function hy(i){const e={};return Object.defineProperty(e,"_",{configurable:!0,enumerable:!1,get:()=>i}),Object.keys(os).forEach(t=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get:()=>os[t](i),set:He})}),e}function py(i){const{ctx:e,propsOptions:[t]}=i;t&&Object.keys(t).forEach(n=>{Object.defineProperty(e,n,{enumerable:!0,configurable:!0,get:()=>i.props[n],set:He})})}function gy(i){const{ctx:e,setupState:t}=i;Object.keys(fe(t)).forEach(n=>{if(!t.__isScriptSetup){if(Lc(n[0])){J(`setup() return property ${JSON.stringify(n)} should not start with "$" or "_" which are reserved prefixes for Vue internals.`);return}Object.defineProperty(e,n,{enumerable:!0,configurable:!0,get:()=>t[n],set:He})}})}function ju(i){return te(i)?i.reduce((e,t)=>(e[t]=null,e),{}):i}function xy(){const i=Object.create(null);return(e,t)=>{i[t]?J(`${e} property "${t}" is already defined in ${i[t]}.`):i[t]=e}}let il=!0;function yy(i){const e=Fp(i),t=i.proxy,n=i.ctx;il=!1,e.beforeCreate&&qu(e.beforeCreate,i,"bc");const{data:s,computed:r,methods:o,watch:a,provide:c,inject:l,created:u,beforeMount:f,mounted:d,beforeUpdate:h,updated:p,activated:m,deactivated:g,beforeDestroy:y,beforeUnmount:v,destroyed:x,unmounted:E,render:S,renderTracked:T,renderTriggered:_,errorCaptured:I,serverPrefetch:w,expose:b,inheritAttrs:L,components:k,directives:M,filters:N}=e,F=xy();{const[G]=i.propsOptions;if(G)for(const H in G)F("Props",H)}function O(){l&&vy(l,n,F)}if(O(),o)for(const G in o){const H=o[G];W(H)?(Object.defineProperty(n,G,{value:H.bind(t),configurable:!0,enumerable:!0,writable:!0}),F("Methods",G)):J(`Method "${G}" has type "${typeof H}" in the component definition. Did you reference the function correctly?`)}if(s){W(s)||J("The data option must be a function. Plain object usage is no longer supported.");const G=s.call(t,t);if(_s(G)&&J("data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>."),!Ee(G))J("data() should return an object.");else{i.data=so(G);for(const H in G)F("Data",H),Lc(H[0])||Object.defineProperty(n,H,{configurable:!0,enumerable:!0,get:()=>G[H],set:He})}}if(il=!0,r)for(const G in r){const H=r[G],C=W(H)?H.bind(t,t):W(H.get)?H.get.bind(t,t):He;C===He&&J(`Computed property "${G}" has no getter.`);const R=!W(H)&&W(H.set)?H.set.bind(t):()=>{J(`Write operation failed: computed property "${G}" is readonly.`)},P=Hp({get:C,set:R});Object.defineProperty(n,G,{enumerable:!0,configurable:!0,get:()=>P.value,set:D=>P.value=D}),F("Computed",G)}if(a)for(const G in a)Bp(a[G],n,t,G);function K(){if(c){const G=W(c)?c.call(t):c;Reflect.ownKeys(G).forEach(H=>{Z2(H,G[H])})}}K(),u&&qu(u,i,"c");function B(G,H){te(H)?H.forEach(C=>G(C.bind(t))):H&&G(H.bind(t))}if(B(sy,f),B(ry,d),B(oy,h),B(ay,p),B(ty,m),B(ny,g),B(fy,I),B(uy,T),B(cy,_),B(Cc,v),B(Pp,E),B(ly,w),te(b))if(b.length){const G=i.exposed||(i.exposed={});b.forEach(H=>{Object.defineProperty(G,H,{get:()=>t[H],set:C=>t[H]=C})})}else i.exposed||(i.exposed={});S&&i.render===He&&(i.render=S),L!=null&&(i.inheritAttrs=L),k&&(i.components=k),M&&(i.directives=M),i.ctx.$onApplyOptions&&i.ctx.$onApplyOptions(e,i,t)}function vy(i,e,t=He){te(i)&&(i=sl(i));for(const n in i){const s=i[n];let r;Ee(s)?"default"in s?r=ar(s.from||n,s.default,!0):r=ar(s.from||n):r=ar(s),et(r)?Object.defineProperty(e,n,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):e[n]=r,t("Inject",n)}}function qu(i,e,t){Sn(te(i)?i.map(n=>n.bind(e.proxy)):i.bind(e.proxy),e,t)}function Bp(i,e,t,n){const s=n.includes(".")?Lp(t,n):()=>t[n];if(Te(i)){const r=e[i];W(r)?zi(s,r):J(`Invalid watch handler specified by key "${i}"`,r)}else if(W(i))zi(s,i.bind(t));else if(Ee(i))if(te(i))i.forEach(r=>Bp(r,e,t,n));else{const r=W(i.handler)?i.handler.bind(t):e[i.handler];W(r)?zi(s,r,i):J(`Invalid watch handler specified by key "${i.handler}"`,r)}else J(`Invalid watch option: "${n}"`,i)}function Fp(i){const e=i.type,{mixins:t,extends:n}=e,{mixins:s,optionsCache:r,config:{optionMergeStrategies:o}}=i.appContext,a=r.get(e);let c;return a?c=a:!s.length&&!t&&!n?c=e:(c={},s.length&&s.forEach(l=>Sr(c,l,o,!0)),Sr(c,e,o)),Ee(e)&&r.set(e,c),c}function Sr(i,e,t,n=!1){const{mixins:s,extends:r}=e;r&&Sr(i,r,t,!0),s&&s.forEach(o=>Sr(i,o,t,!0));for(const o in e)if(n&&o==="expose")J('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const a=Ey[o]||t&&t[o];i[o]=a?a(i[o],e[o]):e[o]}return i}const Ey={data:Wu,props:zu,emits:zu,methods:Vi,computed:Vi,beforeCreate:Xe,created:Xe,beforeMount:Xe,mounted:Xe,beforeUpdate:Xe,updated:Xe,beforeDestroy:Xe,beforeUnmount:Xe,destroyed:Xe,unmounted:Xe,activated:Xe,deactivated:Xe,errorCaptured:Xe,serverPrefetch:Xe,components:Vi,directives:Vi,watch:Sy,provide:Wu,inject:Ay};function Wu(i,e){return e?i?function(){return xe(W(i)?i.call(this,this):i,W(e)?e.call(this,this):e)}:e:i}function Ay(i,e){return Vi(sl(i),sl(e))}function sl(i){if(te(i)){const e={};for(let t=0;t<i.length;t++)e[i[t]]=i[t];return e}return i}function Xe(i,e){return i?[...new Set([].concat(i,e))]:e}function Vi(i,e){return i?xe(Object.create(null),i,e):e}function zu(i,e){return i?te(i)&&te(e)?[...new Set([...i,...e])]:xe(Object.create(null),ju(i),ju(e??{})):e}function Sy(i,e){if(!i)return e;if(!e)return i;const t=xe(Object.create(null),i);for(const n in e)t[n]=Xe(i[n],e[n]);return t}function Ty(i,e,t,n=!1){const s={},r={};i.propsDefaults=Object.create(null),Op(i,e,s,r);for(const o in i.propsOptions[0])o in s||(s[o]=void 0);Np(e||{},s,i),t?i.props=n?s:A2(s):i.type.props?i.props=s:i.props=r,i.attrs=r}function by(i,e,t,n){const{props:s,attrs:r,vnode:{patchFlag:o}}=i,a=fe(s),[c]=i.propsOptions;let l=!1;if(!void 0&&(n||o>0)&&!(o&16)){if(o&8){const u=i.vnode.dynamicProps;for(let f=0;f<u.length;f++){let d=u[f];if(Ip(i.emitsOptions,d))continue;const h=e[d];if(c)if(ne(r,d))h!==r[d]&&(r[d]=h,l=!0);else{const p=Ht(d);s[p]=rl(c,a,p,h,i,!1)}else h!==r[d]&&(r[d]=h,l=!0)}}}else{Op(i,e,s,r)&&(l=!0);let u;for(const f in a)(!e||!ne(e,f)&&((u=Hn(f))===f||!ne(e,u)))&&(c?t&&(t[f]!==void 0||t[u]!==void 0)&&(s[f]=rl(c,a,f,void 0,i,!0)):delete s[f]);if(r!==a)for(const f in r)(!e||!ne(e,f))&&(delete r[f],l=!0)}l&&Qt(i,"set","$attrs"),Np(e||{},s,i)}function Op(i,e,t,n){const[s,r]=i.propsOptions;let o=!1,a;if(e)for(let c in e){if(Ah(c))continue;const l=e[c];let u;s&&ne(s,u=Ht(c))?!r||!r.includes(u)?t[u]=l:(a||(a={}))[u]=l:Ip(i.emitsOptions,c)||(!(c in n)||l!==n[c])&&(n[c]=l,o=!0)}if(r){const c=fe(t),l=a||Re;for(let u=0;u<r.length;u++){const f=r[u];t[f]=rl(s,c,f,l[f],i,!ne(l,f))}}return o}function rl(i,e,t,n,s,r){const o=i[t];if(o!=null){const a=ne(o,"default");if(a&&n===void 0){const c=o.default;if(o.type!==Function&&!o.skipFactory&&W(c)){const{propsDefaults:l}=s;if(t in l)n=l[t];else{const u=Cs(s);n=l[t]=c.call(null,e),u()}}else n=c}o[0]&&(r&&!a?n=!1:o[1]&&(n===""||n===Hn(t))&&(n=!0))}return n}function Mp(i,e,t=!1){const n=e.propsCache,s=n.get(i);if(s)return s;const r=i.props,o={},a=[];let c=!1;if(!W(i)){const u=f=>{c=!0;const[d,h]=Mp(f,e,!0);xe(o,d),h&&a.push(...h)};!t&&e.mixins.length&&e.mixins.forEach(u),i.extends&&u(i.extends),i.mixins&&i.mixins.forEach(u)}if(!r&&!c)return Ee(i)&&n.set(i,ku),ku;if(te(r))for(let u=0;u<r.length;u++){Te(r[u])||J("props must be strings when using array syntax.",r[u]);const f=Ht(r[u]);Qu(f)&&(o[f]=Re)}else if(r){Ee(r)||J("invalid props options",r);for(const u in r){const f=Ht(u);if(Qu(f)){const d=r[u],h=o[f]=te(d)||W(d)?{type:d}:xe({},d);if(h){const p=Xu(Boolean,h.type),m=Xu(String,h.type);h[0]=p>-1,h[1]=m<0||p<m,(p>-1||ne(h,"default"))&&a.push(f)}}}}const l=[o,a];return Ee(i)&&n.set(i,l),l}function Qu(i){return i[0]!=="$"&&!Ah(i)?!0:(J(`Invalid prop name: "${i}" is a reserved property.`),!1)}function ol(i){return i===null?"null":typeof i=="function"?i.name||"":typeof i=="object"&&i.constructor&&i.constructor.name||""}function Yu(i,e){return ol(i)===ol(e)}function Xu(i,e){return te(e)?e.findIndex(t=>Yu(t,i)):W(e)&&Yu(e,i)?0:-1}function Np(i,e,t){const n=fe(e),s=t.propsOptions[0];for(const r in s){let o=s[r];o!=null&&_y(r,n[r],o,ui(n),!ne(i,r)&&!ne(i,Hn(r)))}}function _y(i,e,t,n,s){const{type:r,required:o,validator:a,skipCheck:c}=t;if(o&&s){J('Missing required prop: "'+i+'"');return}if(!(e==null&&!o)){if(r!=null&&r!==!0&&!c){let l=!1;const u=te(r)?r:[r],f=[];for(let d=0;d<u.length&&!l;d++){const{valid:h,expectedType:p}=Cy(e,u[d]);f.push(p||""),l=h}if(!l){J(Ly(i,e,f));return}}a&&!a(e,n)&&J('Invalid prop: custom validator check failed for prop "'+i+'".')}}const Iy=wi("String,Number,Boolean,Function,Symbol,BigInt");function Cy(i,e){let t;const n=ol(e);if(Iy(n)){const s=typeof i;t=s===n.toLowerCase(),!t&&s==="object"&&(t=i instanceof e)}else n==="Object"?t=Ee(i):n==="Array"?t=te(i):n==="null"?t=i===null:t=i instanceof e;return{valid:t,expectedType:n}}function Ly(i,e,t){if(t.length===0)return`Prop type [] for prop "${i}" won't match anything. Did you mean to use type Array instead?`;let n=`Invalid prop: type check failed for prop "${i}". Expected ${t.map(Gn).join(" | ")}`;const s=t[0],r=Jr(e),o=Ju(e,s),a=Ju(e,r);return t.length===1&&Zu(s)&&!Ry(s,r)&&(n+=` with value ${o}`),n+=`, got ${r} `,Zu(r)&&(n+=`with value ${a}.`),n}function Ju(i,e){return e==="String"?`"${i}"`:e==="Number"?`${Number(i)}`:`${i}`}function Zu(i){return["string","number","boolean"].some(t=>i.toLowerCase()===t)}function Ry(...i){return i.some(e=>e.toLowerCase()==="boolean")}let Ni,un;function Tr(i,e){i.appContext.config.performance&&_r()&&un.mark(`vue-${e}-${i.uid}`),V2(i,e,_r()?un.now():Date.now())}function br(i,e){if(i.appContext.config.performance&&_r()){const t=`vue-${e}-${i.uid}`,n=t+":end";un.mark(n),un.measure(`<${co(i,i.type)}> ${e}`,t,n),un.clearMarks(t),un.clearMarks(n)}j2(i,e,_r()?un.now():Date.now())}function _r(){return Ni!==void 0||(typeof window<"u"&&window.performance?(Ni=!0,un=window.performance):Ni=!1),Ni}const ef=Ep,wy=Symbol.for("v-fgt"),Dy=Symbol.for("v-txt"),Py=Symbol.for("v-cmt"),ky=Symbol.for("v-stc");function By(i){return i?i.__v_isVNode===!0:!1}const Fy="__vInternal";function Oy(i){return i?S2(i)||Fy in i?xe({},i):i:null}const My=wp();let Ny=0;function Uy(i,e,t){const n=i.type,s=(e?e.appContext:i.appContext)||My,r={uid:Ny++,vnode:i,type:n,parent:e,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,scope:new Yh(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(s.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Mp(n,s),emitsOptions:_p(n,s),emit:null,emitted:null,propsDefaults:Re,inheritAttrs:n.inheritAttrs,ctx:Re,data:Re,props:Re,attrs:Re,slots:Re,refs:Re,setupState:Re,setupContext:null,attrsProxy:null,slotsProxy:null,suspense:t,suspenseId:t?t.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null,$uniElements:new Map,$templateUniElementRefs:[],$templateUniElementStyles:{},$eS:{},$eA:{}};return r.ctx=hy(r),r.root=e?e.root:r,r.emit=W2.bind(null,r),i.ce&&i.ce(r),r}let ke=null;const lo=()=>ke||Vn;let Ir,al;Ir=i=>{ke=i},al=i=>{Rc=i};const Cs=i=>{const e=ke;return Ir(i),i.scope.on(),()=>{i.scope.off(),Ir(e)}},tf=()=>{ke&&ke.scope.off(),Ir(null)},$y=wi("slot,component");function ll(i,{isNativeTag:e}){($y(i)||e(i))&&J("Do not use built-in or reserved HTML elements as component id: "+i)}function Up(i){return i.vnode.shapeFlag&4}let Rc=!1;function Hy(i,e=!1){e&&al(e);const{props:t}=i.vnode,n=Up(i);Ty(i,t,n,e);const s=n?Gy(i,e):void 0;return e&&al(!1),s}function Gy(i,e){const t=i.type;{if(t.name&&ll(t.name,i.appContext.config),t.components){const s=Object.keys(t.components);for(let r=0;r<s.length;r++)ll(s[r],i.appContext.config)}if(t.directives){const s=Object.keys(t.directives);for(let r=0;r<s.length;r++)Rp(s[r])}t.compilerOptions&&jy()&&J('"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.')}i.accessCache=Object.create(null),i.proxy=yc(new Proxy(i.ctx,kp)),py(i);const{setup:n}=t;if(n){const s=i.setupContext=n.length>1?zy(i):null,r=Cs(i);Wn();const o=Yt(n,i,0,[ui(i.props),s]);zn(),r(),_s(o)?(o.then(tf,tf),J("setup() returned a Promise, but the version of Vue you are using does not support it yet.")):Ky(i,o,e)}else $p(i,e)}function Ky(i,e,t){W(e)?i.render=e:Ee(e)?(By(e)&&J("setup() should not return VNodes directly - return a render function instead."),i.devtoolsRawSetupState=e,i.setupState=gp(e),gy(i)):e!==void 0&&J(`setup() should return an object. Received: ${e===null?"null":typeof e}`),$p(i,t)}let Vy;const jy=()=>!Vy;function $p(i,e,t){const n=i.type;i.render||(i.render=n.render||He);{const s=Cs(i);Wn();try{yy(i)}finally{zn(),s()}}!n.render&&i.render===He&&!e&&(n.template?J('Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".'):J("Component is missing template or render function."))}function qy(i){return i.attrsProxy||(i.attrsProxy=new Proxy(i.attrs,{get(e,t){return Ye(i,"get","$attrs"),e[t]},set(){return J("setupContext.attrs is readonly."),!1},deleteProperty(){return J("setupContext.attrs is readonly."),!1}}))}function Wy(i){return i.slotsProxy||(i.slotsProxy=new Proxy(i.slots,{get(e,t){return Ye(i,"get","$slots"),e[t]}}))}function zy(i){return Object.freeze({get attrs(){return qy(i)},get slots(){return Wy(i)},get emit(){return(t,...n)=>i.emit(t,...n)},expose:t=>{if(i.exposed&&J("expose() should be called only once per setup()."),t!=null){let n=typeof t;n==="object"&&(te(t)?n="array":et(t)&&(n="ref")),n!=="object"&&J(`expose() should be passed a plain object, received ${n}.`)}i.exposed=t||{}}})}function Ls(i){if(i.exposed)return i.exposeProxy||(i.exposeProxy=new Proxy(gp(yc(i.exposed)),{get(e,t){return t in e?e[t]:i.proxy[t]},has(e,t){return t in e||t in os}}))}const Qy=/(?:^|[-_])(\w)/g,Yy=i=>i.replace(Qy,e=>e.toUpperCase()).replace(/[-_]/g,"");function wc(i,e=!0){return W(i)?i.displayName||i.name:i.name||e&&i.__name}function co(i,e,t=!1){let n=wc(e);if(!n&&e.__file){const s=e.__file.match(/([^/\\]+)\.\w+$/);s&&(n=s[1])}if(!n&&i&&i.parent){const s=r=>{for(const o in r)if(r[o]===e)return o};n=s(i.components||i.parent.type.components)||s(i.appContext.components)}return n?Yy(n):t?"App":"Anonymous"}const Hp=(i,e)=>{const t=b2(i,e,Rc);{const n=lo();n&&n.appContext.config.warnRecursiveComputed&&(t._warnRecursive=!0)}return t},Gp="3.4.21",Dc=J;function Cr(i){return pp(i)}const wn="[object Array]",Dn="[object Object]";function Kp(i,e){const t={};return cl(i,e),lr(i,e,"",t),t}function cl(i,e){if(i=Cr(i),i===e)return;const t=Ft(i),n=Ft(e);if(t==Dn&&n==Dn)for(let s in e){const r=i[s];r===void 0?i[s]=null:cl(r,e[s])}else t==wn&&n==wn&&i.length>=e.length&&e.forEach((s,r)=>{cl(i[r],s)})}function lr(i,e,t,n){if(i=Cr(i),i===e)return;const s=Ft(i),r=Ft(e);if(s==Dn)if(r!=Dn||Object.keys(i).length<Object.keys(e).length)nn(n,t,i);else for(let o in i){const a=Cr(i[o]),c=e[o],l=Ft(a),u=Ft(c);if(l!=wn&&l!=Dn)a!=c&&nn(n,(t==""?"":t+".")+o,a);else if(l==wn)u!=wn||a.length<c.length?nn(n,(t==""?"":t+".")+o,a):a.forEach((f,d)=>{lr(f,c[d],(t==""?"":t+".")+o+"["+d+"]",n)});else if(l==Dn)if(u!=Dn||Object.keys(a).length<Object.keys(c).length)nn(n,(t==""?"":t+".")+o,a);else for(let f in a)lr(a[f],c[f],(t==""?"":t+".")+o+"."+f,n)}else s==wn?r!=wn||i.length<e.length?nn(n,t,i):i.forEach((o,a)=>{lr(o,e[a],t+"["+a+"]",n)}):nn(n,t,i)}function nn(i,e,t){i[e]=t}function Xy(i){return $e.includes(i.update)}function nf(i){const t=i.ctx.__next_tick_callbacks;if(t&&t.length){const n=t.slice(0);t.length=0;for(let s=0;s<n.length;s++)n[s]()}}function ul(i,e){const t=i.ctx;if(!t.__next_tick_pending&&!Xy(i))return bc(e&&e.bind(i.proxy));let n;return t.__next_tick_callbacks||(t.__next_tick_callbacks=[]),t.__next_tick_callbacks.push(()=>{e?Yt(e.bind(i.proxy),i,14):n&&n(i.proxy)}),new Promise(s=>{n=s})}function fl(i,e){i=Cr(i);const t=typeof i;if(t==="object"&&i!==null){let n=e.get(i);if(typeof n<"u")return n;if(te(i)){const s=i.length;n=new Array(s),e.set(i,n);for(let r=0;r<s;r++)n[r]=fl(i[r],e)}else{n={},e.set(i,n);for(const s in i)ne(i,s)&&(n[s]=fl(i[s],e))}return n}if(t!=="symbol")return i}function Jy(i){return fl(i,typeof WeakMap<"u"?new WeakMap:new Map)}function Zy(i,e){const t=i.data,n=Object.create(null);return e.forEach(s=>{n[s]=t[s]}),n}function sf(i,e,t){if(!e)return;e=Jy(e),e.$eS=i.$eS||{},e.$eA=i.$eA||{};const n=i.ctx,s=n.mpType;if(s==="page"||s==="component"){e.r0=1;const r=n.$scope,o=Object.keys(e),a=Kp(e,t||Zy(r,o));Object.keys(a).length?(n.__next_tick_pending=!0,r.setData(a,()=>{n.__next_tick_pending=!1,nf(i)}),Ap()):nf(i)}}function ev(i){i.globalProperties.$nextTick=function(t){return ul(this.$,t)}}function tv(i,e,t){e.appContext.config.globalProperties.$applyOptions(i,e,t);const n=i.computed;if(n){const s=Object.keys(n);if(s.length){const r=e.ctx;r.$computedKeys||(r.$computedKeys=[]),r.$computedKeys.push(...s)}}delete e.ctx.$onApplyOptions}function Vp(i,e=!1){const{setupState:t,$templateRefs:n,$templateUniElementRefs:s,ctx:{$scope:r,$mpPlatform:o}}=i;if(o==="mp-alipay"||!r||!n&&!s)return;if(e){n&&n.forEach(u=>Ui(u,null,t)),s&&s.forEach(u=>Ui(u,null,t));return}const a=o==="mp-baidu"||o==="mp-toutiao",c=u=>{if(u.length===0)return[];const f=(r.selectAllComponents(".r")||[]).concat(r.selectAllComponents(".r-i-f")||[]);return u.filter(d=>{const h=iv(f,d.i);return a&&h===null?!0:(Ui(d,h,t),!1)})},l=()=>{if(n){const u=c(n);u.length&&i.proxy&&i.proxy.$scope&&i.proxy.$scope.setData({r1:1},()=>{c(u)})}};s&&s.length&&ul(i,()=>{s.forEach(u=>{te(u.v)?u.v.forEach(f=>{Ui(u,f,t)}):Ui(u,u.v,t)})}),r._$setRef?r._$setRef(l):ul(i,l)}function nv(i){return Ee(i)&&yc(i),i}function iv(i,e){const t=i.find(n=>n&&(n.properties||n.props).uI===e);if(t){const n=t.$vm;return n?Ls(n.$)||n:nv(t)}return null}function Ui({r:i,f:e},t,n){if(W(i))i(t,{});else{const s=Te(i),r=et(i);if(s||r)if(e){if(!r)return;te(i.value)||(i.value=[]);const o=i.value;if(o.indexOf(t)===-1){if(o.push(t),!t)return;t.$&&Cc(()=>Xr(o,t),t.$)}}else s?ne(n,i)&&(n[i]=t):et(i)?i.value=t:rf(i);else rf(i)}}function rf(i){Dc("Invalid template ref type:",i,`(${typeof i})`)}const dl=Ep;function of(i,e){const t=i.component=Uy(i,e.parentComponent,null);return t.renderer=e.mpType?e.mpType:"component",t.ctx.$onApplyOptions=tv,t.ctx.$children=[],e.mpType==="app"&&(t.render=He),e.onBeforeSetup&&e.onBeforeSetup(t,e),Ec(i),Tr(t,"mount"),Tr(t,"init"),Hy(t),br(t,"init"),e.parentComponent&&t.proxy&&e.parentComponent.ctx.$children.push(Ls(t)||t.proxy),av(t),Ac(),br(t,"mount"),t.proxy}const sv=i=>{let e;for(const t in i)(t==="class"||t==="style"||yh(t))&&((e||(e={}))[t]=i[t]);return e};function af(i){const{type:e,vnode:t,proxy:n,withProxy:s,props:r,propsOptions:[o],slots:a,attrs:c,emit:l,render:u,renderCache:f,data:d,setupState:h,ctx:p,uid:m,appContext:{app:{config:{globalProperties:{pruneComponentPropsCache:g}}}},inheritAttrs:y}=i;i.$uniElementIds=new Map,i.$templateRefs=[],i.$templateUniElementRefs=[],i.$templateUniElementStyles={},i.$ei=0,g(m),i.__counter=i.__counter===0?1:0;let v;const x=Ku(i);try{if(t.shapeFlag&4){lf(y,r,o,c);const E=s||n;v=u.call(E,E,f,r,h,d,p)}else{lf(y,r,o,e.props?c:sv(c));const E=e;v=E.length>1?E(r,{attrs:c,slots:a,emit:l}):E(r,null)}}catch(E){oo(E,i,1),v=!1}return Vp(i),Ku(x),v}function lf(i,e,t,n){if(e&&n&&i!==!1){const s=Object.keys(n).filter(r=>r!=="class"&&r!=="style");if(!s.length)return;t&&s.some(Bu)?s.forEach(r=>{(!Bu(r)||!(r.slice(9)in t))&&(e[r]=n[r])}):s.forEach(r=>e[r]=n[r])}}const rv=i=>{Wn(),Ap(),zn()};function ov(){const i=this.$scopedSlotsData;if(!i||i.length===0)return;const e=this.ctx.$scope,t=e.data,n=Object.create(null);i.forEach(({path:s,index:r,data:o})=>{const a=Vh(t,s),c=Te(r)?`${s}.${r}`:`${s}[${r}]`;if(typeof a>"u"||typeof a[r]>"u")n[c]=o;else{const l=Kp(o,a[r]);Object.keys(l).forEach(u=>{n[c+"."+u]=l[u]})}}),i.length=0,Object.keys(n).length&&e.setData(n)}function To({effect:i,update:e},t){i.allowRecurse=e.allowRecurse=t}function av(i){const e=ov.bind(i);i.$updateScopedSlots=()=>bc(()=>Ar(e));const t=()=>{if(!i.isMounted)Cc(()=>{Vp(i,!0)},i),Tr(i,"patch"),sf(i,af(i)),br(i,"patch"),$2(i);else{const{next:r,bu:o,u:a}=i;Ec(r||i.vnode),To(i,!1),rv(),o&&rr(o),To(i,!0),Tr(i,"patch"),sf(i,af(i)),br(i,"patch"),a&&dl(a),H2(i),Ac()}},n=i.effect=new pc(t,He,()=>Ar(s),i.scope),s=i.update=()=>{n.dirty&&n.run()};s.id=i.uid,To(i,!0),n.onTrack=i.rtc?r=>rr(i.rtc,r):void 0,n.onTrigger=i.rtg?r=>rr(i.rtg,r):void 0,s.ownerInstance=i,s()}function lv(i){const{bum:e,scope:t,update:n,um:s}=i;e&&rr(e);{const r=i.parent;if(r){const o=r.ctx.$children,a=Ls(i)||i.proxy,c=o.indexOf(a);c>-1&&o.splice(c,1)}}t.stop(),n&&(n.active=!1),s&&dl(s),dl(()=>{i.isUnmounted=!0}),K2(i)}const cv=J2();function uv(){if(typeof window<"u")return window;if(typeof globalThis<"u")return globalThis;if(typeof global<"u")return global;if(typeof my<"u")return my}function fv(i,e=null){const t=uv();t.__VUE__=!0,Tp(t.__VUE_DEVTOOLS_GLOBAL_HOOK__,t);const n=cv(i,e),s=n._context;ev(s.config);const r=c=>(c.appContext=s,c.shapeFlag=6,c),o=function(l,u){return of(r(l),u)},a=function(l){return l&&lv(l.$)};return n.mount=function(){i.render=He;const l=of(r({type:i}),{mpType:"app",mpInstance:null,parentComponent:null,slots:[],props:null});return n._instance=l.$,U2(n,Gp),l.$app=n,l.$createComponent=o,l.$destroyComponent=a,s.$appInstance=l,l},n.unmount=function(){Dc("Cannot unmount an app.")},n}function cf(i,e,t,n){W(e)&&Qn(i,e.bind(t),n)}function dv(i,e,t){const n=i.mpType||t.$mpType;!n||n==="component"||n==="page"&&e.renderer==="component"||Object.keys(i).forEach(s=>{if(Wh(s,i[s],!1)){const r=i[s];te(r)?r.forEach(o=>cf(s,o,t,e)):cf(s,r,t,e)}})}function hv(i,e,t){dv(i,e,t)}function pv(i,e,t){return i[e]=t}function gv(i,...e){const t=this[i];return t?t(...e):(console.error(`method ${i} not found`),null)}function mv(i){const e=i.config.errorHandler;return function(n,s,r){e&&e(n,s,r);const o=i._instance;if(!o||!o.proxy)throw n;o[Kn]?o.proxy.$callHook(Kn,n):xp(n,r,s?s.$.vnode:null,!1)}}function xv(i,e){return i?[...new Set([].concat(i,e))]:e}function yv(i){qh.forEach(e=>{i[e]=xv})}let hl;const $s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",vv=/^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;typeof atob!="function"?hl=function(i){if(i=String(i).replace(/[\t\n\f\r ]+/g,""),!vv.test(i))throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");i+="==".slice(2-(i.length&3));for(var e,t="",n,s,r=0;r<i.length;)e=$s.indexOf(i.charAt(r++))<<18|$s.indexOf(i.charAt(r++))<<12|(n=$s.indexOf(i.charAt(r++)))<<6|(s=$s.indexOf(i.charAt(r++))),t+=n===64?String.fromCharCode(e>>16&255):s===64?String.fromCharCode(e>>16&255,e>>8&255):String.fromCharCode(e>>16&255,e>>8&255,e&255);return t}:hl=atob;function Ev(i){return decodeURIComponent(hl(i).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))}function bo(){const i=j.getStorageSync("uni_id_token")||"",e=i.split(".");if(!i||e.length!==3)return{uid:null,role:[],permission:[],tokenExpired:0};let t;try{t=JSON.parse(Ev(e[1]))}catch(n){throw new Error("获取当前用户信息出错,详细错误信息为:"+n.message)}return t.tokenExpired=t.exp*1e3,delete t.exp,delete t.iat,t}function Av(i){i.uniIDHasRole=function(e){const{role:t}=bo();return t.indexOf(e)>-1},i.uniIDHasPermission=function(e){const{permission:t}=bo();return this.uniIDHasRole("admin")||t.indexOf(e)>-1},i.uniIDTokenValid=function(){const{tokenExpired:e}=bo();return e>Date.now()}}function Sv(i){const e=i.config;e.errorHandler=Xx(i,mv),yv(e.optionMergeStrategies);const t=e.globalProperties;Av(t),t.$set=pv,t.$applyOptions=hv,t.$callMethod=gv,j.invokeCreateVueAppHook(i)}const as=Object.create(null);function Tv(i){const{uid:e,__counter:t}=lo(),n=(as[e]||(as[e]=[])).push(Oy(i))-1;return e+","+n+","+t}function jp(i){delete as[i]}function Pc(i){if(!i)return;const[e,t]=i.split(",");if(as[e])return as[e][parseInt(t)]}var bv={install(i){Sv(i),i.config.globalProperties.pruneComponentPropsCache=jp;const e=i.mount;i.mount=function(n){const s=e.call(i,n),r=_v();return r?r(s):typeof createMiniProgramApp<"u"&&createMiniProgramApp(s),s}}};function _v(){const i="createApp";if(typeof global<"u"&&typeof global[i]<"u")return global[i];if(typeof my<"u")return my[i]}function Iv(i){return Te(i)?i:Cv(Sh(i))}function Cv(i){let e="";if(!i||Te(i))return e;for(const t in i)e+=`${t.startsWith("--")?t:Hn(t)}:${i[t]};`;return e}function Lv(i,e){const t=lo(),n=t.ctx,s=typeof e<"u"&&(n.$mpPlatform==="mp-weixin"||n.$mpPlatform==="mp-qq"||n.$mpPlatform==="mp-xhs")&&(Te(e)||typeof e=="number")?"_"+e:"",r="e"+t.$ei+++s,o=n.$scope;if(!i)return delete o[r],r;const a=o[r];return a?a.value=i:o[r]=Rv(i,t),r}function Rv(i,e){const t=n=>{Dv(n);let s=[n];e&&e.ctx.$getTriggerEventDetail&&typeof n.detail=="number"&&(n.detail=e.ctx.$getTriggerEventDetail(n.detail)),n.detail&&n.detail.__args__&&(s=n.detail.__args__);const r=t.value,o=()=>Sn(Pv(n,r),e,5,s),a=n.target,c=a&&a.dataset?String(a.dataset.eventsync)==="true":!1;if(wv.includes(n.type)&&!c)setTimeout(o);else{const l=o();return n.type==="input"&&(te(l)||_s(l))?void 0:l}};return t.value=i,t}const wv=["tap","longpress","longtap","transitionend","animationstart","animationiteration","animationend","touchforcechange"];function Dv(i,e){i.type&&i.target&&(i.preventDefault=He,i.stopPropagation=He,i.stopImmediatePropagation=He,ne(i,"detail")||(i.detail={}),ne(i,"markerId")&&(i.detail=typeof i.detail=="object"?i.detail:{},i.detail.markerId=i.markerId),Ge(i.detail)&&ne(i.detail,"checked")&&!ne(i.detail,"value")&&(i.detail.value=i.detail.checked),Ge(i.detail)&&(i.target=xe({},i.target,i.detail)))}function Pv(i,e){if(te(e)){const t=i.stopImmediatePropagation;return i.stopImmediatePropagation=()=>{t&&t.call(i),i._stopped=!0},e.map(n=>s=>!s._stopped&&n(s))}else return e}function kv(i,e){let t;if(te(i)||Te(i)){t=new Array(i.length);for(let n=0,s=i.length;n<s;n++)t[n]=e(i[n],n,n)}else if(typeof i=="number"){if(!Number.isInteger(i))return Dc(`The v-for range expect an integer value but got ${i}.`),[];t=new Array(i);for(let n=0;n<i;n++)t[n]=e(n+1,n,n)}else if(Ee(i))if(i[Symbol.iterator])t=Array.from(i,(n,s)=>e(n,s,s));else{const n=Object.keys(i);t=new Array(n.length);for(let s=0,r=n.length;s<r;s++){const o=n[s];t[s]=e(i[o],o,s)}}else t=[];return t}function Bv(i,e,t={}){const{$templateRefs:n}=lo();n.push({i:e,r:i,k:t.k,f:t.f})}const Fv=(i,e)=>Lv(i,e),Ov=(i,e)=>kv(i,e),Mv=i=>Iv(i),Nv=(i,...e)=>xe(i,...e),Uv=i=>Th(i),$v=i=>Rx(i),Hv=i=>Tv(i),Gv=(i,e,t)=>Bv(i,e,t);function Kv(i,e=null){return i&&(i.mpType="app"),fv(i,e).use(bv)}const Vv=Kv;function jv(){var i;let e="";{const t=((i=wx.getAppBaseInfo)===null||i===void 0?void 0:i.call(wx))||wx.getSystemInfoSync(),n=t&&t.language?t.language:ns;e=_h(n)||ns}return e}function qv(i,e){console.warn(`${i}: ${e}`)}function uf(i,e,t,n){n||(n=qv);for(const s in t){const r=zv(s,e[s],t[s],!ne(e,s));Te(r)&&n(i,r)}}function Wv(i,e,t,n){if(!t)return;if(!te(t))return uf(i,e[0]||Object.create(null),t,n);const s=t.length,r=e.length;for(let o=0;o<s;o++){const a=t[o],c=Object.create(null);r>o&&(c[a.name]=e[o]),uf(i,c,{[a.name]:a},n)}}function zv(i,e,t,n){Ge(t)||(t={type:t});const{type:s,required:r,validator:o}=t;if(r&&n)return'Missing required args: "'+i+'"';if(!(e==null&&!r)){if(s!=null){let a=!1;const c=te(s)?s:[s],l=[];for(let u=0;u<c.length&&!a;u++){const{valid:f,expectedType:d}=Yv(e,c[u]);l.push(d||""),a=f}if(!a)return Xv(i,e,l)}if(o)return o(e)}}const Qv=wi("String,Number,Boolean,Function,Symbol");function Yv(i,e){let t;const n=Jv(e);if(Qv(n)){const s=typeof i;t=s===n.toLowerCase(),!t&&s==="object"&&(t=i instanceof e)}else n==="Object"?t=Ee(i):n==="Array"?t=te(i):t=i instanceof e;return{valid:t,expectedType:n}}function Xv(i,e,t){let n=`Invalid args: type check failed for args "${i}". Expected ${t.map(Gn).join(", ")}`;const s=t[0],r=Jr(e),o=ff(e,s),a=ff(e,r);return t.length===1&&df(s)&&!Zv(s,r)&&(n+=` with value ${o}`),n+=`, got ${r} `,df(r)&&(n+=`with value ${a}.`),n}function Jv(i){const e=i&&i.toString().match(/^\s*function (\w+)/);return e?e[1]:""}function ff(i,e){return e==="String"?`"${i}"`:e==="Number"?`${Number(i)}`:`${i}`}function df(i){return["string","number","boolean"].some(t=>i.toLowerCase()===t)}function Zv(...i){return i.some(e=>e.toLowerCase()==="boolean")}function eE(i){return function(){try{return i.apply(i,arguments)}catch(e){console.error(e)}}}let tE=1;const pl={};function nE(i,e,t,n=!1){return pl[i]={name:e,keepAlive:n,callback:t},i}function qp(i,e,t){if(typeof i=="number"){const n=pl[i];if(n)return n.keepAlive||delete pl[i],n.callback(e,t)}return e}const iE="success",sE="fail",rE="complete";function oE(i){const e={};for(const t in i){const n=i[t];W(n)&&(e[t]=eE(n),delete i[t])}return e}function aE(i,e){return!i||i.indexOf(":fail")===-1?e+":ok":e+i.substring(i.indexOf(":fail"))}function lE(i,e={},{beforeAll:t,beforeSuccess:n}={}){Ge(e)||(e={});const{success:s,fail:r,complete:o}=oE(e),a=W(s),c=W(r),l=W(o),u=tE++;return nE(u,i,f=>{f=f||{},f.errMsg=aE(f.errMsg,i),W(t)&&t(f),f.errMsg===i+":ok"?(W(n)&&n(f,e),a&&s(f)):c&&r(f),l&&o(f)}),u}const cE="success",uE="fail",fE="complete",Ai={},Si={};function dE(i,e){return function(t){return i(t,e)||t}}function Wp(i,e,t){let n=!1;for(let s=0;s<i.length;s++){const r=i[s];if(n)n=Promise.resolve(dE(r,t));else{const o=r(e,t);if(_s(o)&&(n=Promise.resolve(o)),o===!1)return{then(){},catch(){}}}}return n||{then(s){return s(e)},catch(){}}}function hf(i,e={}){return[cE,uE,fE].forEach(t=>{const n=i[t];if(!te(n))return;const s=e[t];e[t]=function(o){Wp(n,o,e).then(a=>W(s)&&s(a)||a)}}),e}function Lr(i,e){const t=[];te(Ai.returnValue)&&t.push(...Ai.returnValue);const n=Si[i];return n&&te(n.returnValue)&&t.push(...n.returnValue),t.forEach(s=>{e=s(e)||e}),e}function pf(i){const e=Object.create(null);Object.keys(Ai).forEach(n=>{n!=="returnValue"&&(e[n]=Ai[n].slice())});const t=Si[i];return t&&Object.keys(t).forEach(n=>{n!=="returnValue"&&(e[n]=(e[n]||[]).concat(t[n]))}),e}function Rr(i,e,t,n){const s=pf(i);return s&&Object.keys(s).length?te(s.invoke)?Wp(s.invoke,t).then(o=>e(hf(pf(i),o),...n)):e(hf(s,t),...n):e(t,...n)}function hE(i){return!!(Ge(i)&&[iE,sE,rE].find(e=>W(i[e])))}function pE(i,e){return(t={},...n)=>hE(t)?Lr(i,Rr(i,e,xe({},t),n)):Lr(i,new Promise((s,r)=>{Rr(i,e,xe({},t,{success:s,fail:r}),n)}))}function gE(i,e){i[0]}function mE(i,e,t){const n={errMsg:e+":ok"};return qp(i,xe(t||{},n))}function gf(i,e,t,n={}){const s=e+":fail";let r="";t?t.indexOf(s)===0?r=t:r=s+" "+t:r=s,delete n.errCode;let o=xe({errMsg:r},n);return qp(i,o)}function zp(i,e,t,n){Wv(i,e,t);const s=gE(e);if(s)return s}function xE(i){return!i||Te(i)?i:i.stack?((typeof globalThis>"u"||!globalThis.harmonyChannel)&&console.error(i.message+`
- `+i.stack),i.message):i}function yE(i,e,t,n){return s=>{const r=lE(i,s,n),o=zp(i,[s],t);return o?gf(r,i,o):e(s,{resolve:a=>mE(r,i,a),reject:(a,c)=>gf(r,i,xE(a),c)})}}function vE(i,e,t,n){return(...s)=>{const r=zp(i,s,t);if(r)throw new Error(r);return e.apply(null,s)}}function EE(i,e,t,n){return yE(i,e,t,n)}function Yn(i,e,t,n){return vE(i,e,t)}function AE(i,e,t,n){return pE(i,EE(i,e,t,n))}const SE="upx2px",TE=[{name:"upx",type:[Number,String],required:!0}],bE=1e-4,_E=750;let Qp=!1,gl=0,Yp=0;function IE(){var i,e;let t,n,s;{const r=((i=wx.getWindowInfo)===null||i===void 0?void 0:i.call(wx))||wx.getSystemInfoSync(),o=((e=wx.getDeviceInfo)===null||e===void 0?void 0:e.call(wx))||wx.getSystemInfoSync();t=r.windowWidth,n=r.pixelRatio,s=o.platform}gl=t,Yp=n,Qp=s==="ios"}const mf=Yn(SE,(i,e)=>{if(gl===0&&IE(),i=Number(i),i===0)return 0;let t=e||gl,n=i/_E*t;return n<0&&(n=-n),n=Math.floor(n+bE),n===0&&(Yp===1||!Qp?n=1:n=.5),i<0?-n:n},TE);function CE(i,e,...t){e&&t.push(e),console[i].apply(console,t)}const LE="addInterceptor",RE="removeInterceptor",Xp=[{name:"method",type:[String,Object],required:!0}],wE=Xp;function xf(i,e){Object.keys(e).forEach(t=>{W(e[t])&&(i[t]=DE(i[t],e[t]))})}function yf(i,e){!i||!e||Object.keys(e).forEach(t=>{const n=i[t],s=e[t];te(n)&&W(s)&&Xr(n,s)})}function DE(i,e){const t=e?i?i.concat(e):te(e)?e:[e]:i;return t&&PE(t)}function PE(i){const e=[];for(let t=0;t<i.length;t++)e.indexOf(i[t])===-1&&e.push(i[t]);return e}const kE=Yn(LE,(i,e)=>{Te(i)&&Ge(e)?xf(Si[i]||(Si[i]={}),e):Ge(i)&&xf(Ai,i)},Xp),BE=Yn(RE,(i,e)=>{Te(i)?Ge(e)?yf(Si[i],e):delete Si[i]:Ge(i)&&yf(Ai,i)},wE),FE={},OE="$on",Jp=[{name:"event",type:String,required:!0},{name:"callback",type:Function,required:!0}],ME="$once",NE=Jp,UE="$off",$E=[{name:"event",type:[String,Array]},{name:"callback",type:[Function,Number]}],HE="$emit",GE=[{name:"event",type:String,required:!0}];class KE{constructor(){this.$emitter=new Jx}on(e,t){return this.$emitter.on(e,t)}once(e,t){return this.$emitter.once(e,t)}off(e,t){if(!e){this.$emitter.e={};return}this.$emitter.off(e,t)}emit(e,...t){this.$emitter.emit(e,...t)}}const Ti=new KE,VE=Yn(OE,(i,e)=>(Ti.on(i,e),()=>Ti.off(i,e)),Jp),jE=Yn(ME,(i,e)=>(Ti.once(i,e),()=>Ti.off(i,e)),NE),qE=Yn(UE,(i,e)=>{te(i)||(i=i?[i]:[]),i.forEach(t=>{Ti.off(t,e)})},$E),WE=Yn(HE,(i,...e)=>{Ti.emit(i,...e)},GE);let Yi,ml,xl;function vf(i){try{return JSON.parse(i)}catch{}return i}function zE(i){if(i.type==="enabled")xl=!0;else if(i.type==="clientId")Yi=i.cid,ml=i.errMsg,Zp(Yi,i.errMsg);else if(i.type==="pushMsg"){const e={type:"receive",data:vf(i.message)};for(let t=0;t<xn.length;t++){const n=xn[t];if(n(e),e.stopped)break}}else i.type==="click"&&xn.forEach(e=>{e({type:"click",data:vf(i.message)})})}const yl=[];function Zp(i,e){yl.forEach(t=>{t(i,e)}),yl.length=0}const QE="getPushClientId",YE=AE(QE,(i,{resolve:e,reject:t})=>{Promise.resolve().then(()=>{typeof xl>"u"&&(xl=!1,Yi="",ml="uniPush is not enabled"),yl.push((n,s)=>{n?e({cid:n}):t(s)}),typeof Yi<"u"&&Zp(Yi,ml)})}),xn=[],XE=i=>{xn.indexOf(i)===-1&&xn.push(i)},JE=i=>{if(!i)xn.length=0;else{const e=xn.indexOf(i);e>-1&&xn.splice(e,1)}},ZE=/^\$|__f__|getLocale|setLocale|sendNativeEvent|restoreGlobal|requireGlobal|getCurrentSubNVue|getMenuButtonBoundingClientRect|^report|interceptors|Interceptor$|getSubNVueById|requireNativePlugin|upx2px|rpx2px|hideKeyboard|canIUse|^create|Sync$|Manager$|base64ToArrayBuffer|arrayBufferToBase64|getDeviceInfo|getAppBaseInfo|getWindowInfo|getSystemSetting|getAppAuthorizeSetting/,e3=/^create|Manager$/,t3=["createBLEConnection"],n3=["request","downloadFile","uploadFile","connectSocket"],i3=["createBLEConnection"],s3=/^on|^off/;function cr(i){return e3.test(i)&&t3.indexOf(i)===-1}function eg(i){return ZE.test(i)&&i3.indexOf(i)===-1}function r3(i){return s3.test(i)&&i!=="onPush"}function Ef(i){return n3.indexOf(i)!==-1}function o3(i){return!(cr(i)||eg(i)||r3(i))}Promise.prototype.finally||(Promise.prototype.finally=function(i){const e=this.constructor;return this.then(t=>e.resolve(i&&i()).then(()=>t),t=>e.resolve(i&&i()).then(()=>{throw t}))});function _o(i,e){return!o3(i)||!W(e)?e:function(n={},...s){return W(n.success)||W(n.fail)||W(n.complete)?Lr(i,Rr(i,e,xe({},n),s)):Lr(i,new Promise((r,o)=>{Rr(i,e,xe({},n,{success:r,fail:o}),s)}))}}const a3=["success","fail","cancel","complete"];function l3(i){function e(s,r,o){return function(a){return r(n(s,a,o))}}function t(s,r,o={},a={},c=!1){if(Ge(r)){const l=c===!0?r:{};W(o)&&(o=o(r,l)||{});for(const u in r)if(ne(o,u)){let f=o[u];W(f)&&(f=f(r[u],r,l)),f?Te(f)?l[f]=r[u]:Ge(f)&&(l[f.name?f.name:u]=f.value):console.warn(`微信小程序 ${s} 暂不支持 ${u}`)}else if(a3.indexOf(u)!==-1){const f=r[u];W(f)&&(l[u]=e(s,f,a))}else!c&&!ne(l,u)&&(l[u]=r[u]);return l}else W(r)&&(W(o)&&o(r,{}),r=e(s,r,a));return r}function n(s,r,o,a=!1){return W(i.returnValue)&&(r=i.returnValue(s,r)),t(s,r,o,{},a||!1)}return function(r,o){const a=ne(i,r);if(!a&&typeof wx[r]!="function")return o;const c=a||W(i.returnValue)||cr(r)||Ef(r),l=a||W(o);if(!a&&!o)return function(){console.error(`微信小程序 暂不支持${r}`)};if(!c||!l)return o;const u=i[r];return function(f,d){let h=u||{};W(u)&&(h=u(f)),f=t(r,f,h.args,h.returnValue);const p=[f];typeof d<"u"&&p.push(d);const m=wx[h.name||r].apply(wx,p);return(cr(r)||Ef(r))&&m&&!m.__v_skip&&(m.__v_skip=!0),eg(r)?n(r,m,h.returnValue,cr(r)):m}}}const wr=()=>{const i=W(getApp)&&getApp({allowDefault:!0});return i&&i.$vm?i.$vm.$locale:jv()},c3=i=>{const e=W(getApp)&&getApp();return e&&e.$vm.$locale!==i?(e.$vm.$locale=i,vl.forEach(n=>n({locale:i})),!0):!1},vl=[],u3=i=>{vl.indexOf(i)===-1&&vl.push(i)};typeof global<"u"&&(global.getLocale=wr);const Af="__DC_STAT_UUID";let ni;function tg(i=wx){return function(t,n){ni=ni||i.getStorageSync(Af),ni||(ni=Date.now()+""+Math.floor(Math.random()*1e7),wx.setStorage({key:Af,data:ni})),n.deviceId=ni}}function ng(i,e){if(i.safeArea){const t=i.safeArea;e.safeAreaInsets={top:t.top,left:t.left,right:i.windowWidth-t.right,bottom:i.screenHeight-t.bottom}}}function ig(i,e){let t="",n="";switch(t=i.split(" ")[0]||e,n=i.split(" ")[1]||"",t=t.toLowerCase(),t){case"harmony":case"ohos":case"openharmony":t="harmonyos";break;case"iphone os":t="ios";break;case"mac":case"darwin":t="macos";break;case"windows_nt":t="windows";break}return{osName:t,osVersion:n}}function f3(i,e){const{brand:t="",model:n="",system:s="",language:r="",theme:o,version:a,platform:c,fontSizeSetting:l,SDKVersion:u,pixelRatio:f,deviceOrientation:d}=i,{osName:h,osVersion:p}=ig(s,c);let m=a,g=sg(i,n),y=rg(t),v=ag(i),x=d,E=f,S=u;const T=(r||"").replace(/_/g,"-"),_={appId:"__UNI__90F7D71",appName:"签约",appVersion:"1.0.0",appVersionCode:100,appLanguage:og(T),uniCompileVersion:"4.75",uniCompilerVersion:"4.75",uniRuntimeVersion:"4.75",uniPlatform:"mp-weixin",deviceBrand:y,deviceModel:n,deviceType:g,devicePixelRatio:E,deviceOrientation:x,osName:h,osVersion:p,hostTheme:o,hostVersion:m,hostLanguage:T,hostName:v,hostSDKVersion:S,hostFontSizeSetting:l,windowTop:0,windowBottom:0,osLanguage:void 0,osTheme:void 0,ua:void 0,hostPackageName:void 0,browserName:void 0,browserVersion:void 0,isUniAppX:!1};xe(e,_)}function sg(i,e){let t=i.deviceType||"phone";{const n={ipad:"pad",windows:"pc",mac:"pc"},s=Object.keys(n),r=e.toLowerCase();for(let o=0;o<s.length;o++){const a=s[o];if(r.indexOf(a)!==-1){t=n[a];break}}}return t}function rg(i){let e=i;return e&&(e=e.toLowerCase()),e}function og(i){return wr?wr():i}function ag(i){let t=i.hostName||"WeChat";return i.environment?t=i.environment:i.host&&i.host.env&&(t=i.host.env),t}const lg={returnValue:(i,e)=>{ng(i,e),tg()(i,e),f3(i,e)}},d3=lg,h3={},p3={args(i,e){let t=parseInt(i.current);if(isNaN(t))return;const n=i.urls;if(!te(n))return;const s=n.length;if(s)return t<0?t=0:t>=s&&(t=s-1),t>0?(e.current=n[t],e.urls=n.filter((r,o)=>o<t?r!==n[t]:!0)):e.current=n[0],{indicator:!1,loop:!1}}},g3={args(i,e){e.alertText=i.title}},m3={returnValue:(i,e)=>{const{brand:t,model:n,system:s="",platform:r=""}=i;let o=sg(i,n),a=rg(t);tg()(i,e);const{osName:c,osVersion:l}=ig(s,r);e=jh(xe(e,{deviceType:o,deviceBrand:a,deviceModel:n,osName:c,osVersion:l}))}},x3={returnValue:(i,e)=>{const{version:t,language:n,SDKVersion:s,theme:r}=i;let o=ag(i),a=(n||"").replace(/_/g,"-");const c={hostVersion:t,hostLanguage:a,hostName:o,hostSDKVersion:s,hostTheme:r,appId:"__UNI__90F7D71",appName:"签约",appVersion:"1.0.0",appVersionCode:100,appLanguage:og(a),isUniAppX:!1,uniPlatform:"mp-weixin",uniCompileVersion:"4.75",uniCompilerVersion:"4.75",uniRuntimeVersion:"4.75"};xe(e,c)}},y3={returnValue:(i,e)=>{ng(i,e),e=jh(xe(e,{windowTop:0,windowBottom:0}))}},v3={returnValue:function(i,e){const{locationReducedAccuracy:t}=i;e.locationAccuracy="unsupported",t===!0?e.locationAccuracy="reduced":t===!1&&(e.locationAccuracy="full")}},E3={args(i){const e=getApp({allowDefault:!0})||{};e.$vm?Qn(Kn,i,e.$vm.$):(wx.$onErrorHandlers||(wx.$onErrorHandlers=[]),wx.$onErrorHandlers.push(i))}},A3={args(i){const e=getApp({allowDefault:!0})||{};if(e.$vm){if(i.__weh){const t=e.$vm.$[Kn];if(t){const n=t.indexOf(i.__weh);n>-1&&t.splice(n,1)}}}else{if(!wx.$onErrorHandlers)return;const t=wx.$onErrorHandlers.findIndex(n=>n===i);t!==-1&&wx.$onErrorHandlers.splice(t,1)}}},cg={args(){if(wx.__uni_console__){if(wx.__uni_console_warned__)return;wx.__uni_console_warned__=!0,console.warn("开发模式下小程序日志回显会使用 socket 连接,为了避免冲突,建议使用 SocketTask 的方式去管理 WebSocket 或手动关闭日志回显功能。[详情](https://uniapp.dcloud.net.cn/tutorial/run/mp-log.html)")}}},S3=cg,Sf={$on:VE,$off:qE,$once:jE,$emit:WE,upx2px:mf,rpx2px:mf,interceptors:FE,addInterceptor:kE,removeInterceptor:BE,onCreateVueApp:Qx,invokeCreateVueAppHook:Yx,getLocale:wr,setLocale:c3,onLocaleChange:u3,getPushClientId:YE,onPushMessage:XE,offPushMessage:JE,invokePushCallback:zE,__f__:CE};function T3(i,e,t=wx){const n=l3(e),s={get(r,o){return ne(r,o)?r[o]:ne(i,o)?_o(o,i[o]):ne(Sf,o)?_o(o,Sf[o]):_o(o,n(o,t[o]))}};return new Proxy({},s)}function b3(i){return function({service:t,success:n,fail:s,complete:r}){let o;i[t]?(o={errMsg:"getProvider:ok",service:t,provider:i[t]},W(n)&&n(o)):(o={errMsg:"getProvider:fail:服务["+t+"]不存在"},W(s)&&s(o)),W(r)&&r(o)}}const _3=["qy","env","error","version","lanDebug","cloud","serviceMarket","router","worklet","__webpack_require_UNI_MP_PLUGIN__"],I3=["lanDebug","router","worklet"],Tf=wx.getLaunchOptionsSync?wx.getLaunchOptionsSync():null;function C3(i){return Tf&&Tf.scene===1154&&I3.includes(i)?!1:_3.indexOf(i)>-1||typeof wx[i]=="function"}function ug(){const i={};for(const e in wx)C3(e)&&(i[e]=wx[e]);return typeof globalThis<"u"&&typeof requireMiniProgram>"u"&&(globalThis.wx=i),i}const L3=["__route__","__wxExparserNodeId__","__wxWebviewId__"],R3=b3({oauth:["weixin"],share:["weixin"],payment:["wxpay"],push:["weixin"]});function w3(i){const e=Object.create(null);return L3.forEach(t=>{e[t]=i[t]}),e}function D3(){const i=Ze.createSelectorQuery(),e=i.in;return i.in=function(n){return n.$scope?e.call(this,n.$scope):e.call(this,w3(n))},i}const Ze=ug();Ze.canIUse("getAppBaseInfo")||(Ze.getAppBaseInfo=Ze.getSystemInfoSync);Ze.canIUse("getWindowInfo")||(Ze.getWindowInfo=Ze.getSystemInfoSync);Ze.canIUse("getDeviceInfo")||(Ze.getDeviceInfo=Ze.getSystemInfoSync);let Dr=Ze.getAppBaseInfo&&Ze.getAppBaseInfo();Dr||(Dr=Ze.getSystemInfoSync());const bf=Dr?Dr.host:null,P3=bf&&bf.env==="SAAASDK"?Ze.miniapp.shareVideoMessage:Ze.shareVideoMessage;var k3=Object.freeze({__proto__:null,createSelectorQuery:D3,getProvider:R3,shareVideoMessage:P3});const B3={args(i,e){i.compressedHeight&&!e.compressHeight&&(e.compressHeight=i.compressedHeight),i.compressedWidth&&!e.compressWidth&&(e.compressWidth=i.compressedWidth)}};var F3=Object.freeze({__proto__:null,compressImage:B3,getAppAuthorizeSetting:v3,getAppBaseInfo:x3,getDeviceInfo:m3,getSystemInfo:lg,getSystemInfoSync:d3,getWindowInfo:y3,offError:A3,onError:E3,onSocketMessage:S3,onSocketOpen:cg,previewImage:p3,redirectTo:h3,showActionSheet:g3});const Ut=ug();var j=T3(k3,F3,Ut);function O3(i,e,t){return i==""||e==""||t==""?Promise.resolve(null):i.split(",").reduce((n,s)=>n.then(r=>r!=null?Promise.resolve(r):N3(s,e,t)),Promise.resolve(null))}const M3=500;function N3(i,e,t){return new Promise((n,s)=>{const r=j.connectSocket({url:`ws://${i}:${e}/${t}`,multiple:!0,fail(){n(null)}}),o=setTimeout(()=>{r.close({code:1006,reason:"connect timeout"}),n(null)},M3);r.onOpen(a=>{clearTimeout(o),n(r)}),r.onClose(a=>{clearTimeout(o),n(null)}),r.onError(a=>{clearTimeout(o),n(null)})})}const El=["log","warn","error","info","debug"],dn=El.reduce((i,e)=>(i[e]=console[e].bind(console),i),{});let Al=null;const ur=new Set,fg={};function Pr(i){if(Al==null){i.forEach(t=>{ur.add(t)});return}const e=i.map(t=>{if(typeof t=="string")return t;const n=t&&"promise"in t&&"reason"in t,s=n?"UnhandledPromiseRejection: ":"";if(n&&(t=t.reason),t instanceof Error&&t.stack)return t.message&&!t.stack.includes(t.message)?`${s}${t.message}
- ${t.stack}`:`${s}${t.stack}`;if(typeof t=="object"&&t!==null)try{return s+JSON.stringify(t)}catch(r){return s+String(r)}return s+String(t)}).filter(Boolean);e.length>0&&Al(JSON.stringify(Object.assign({type:"error",data:e},fg)))}function U3(i,e={}){if(Al=i,Object.assign(fg,e),i!=null&&ur.size>0){const t=Array.from(ur);ur.clear(),Pr(t)}}function _f(){function i(e){try{if(typeof PromiseRejectionEvent<"u"&&e instanceof PromiseRejectionEvent&&e.reason instanceof Error&&e.reason.message&&e.reason.message.includes("Cannot create property 'errMsg' on string 'taskId"))return;dn.error(e),Pr([e])}catch(t){dn.error(t)}}return typeof j.onError=="function"&&j.onError(i),typeof j.onUnhandledRejection=="function"&&j.onUnhandledRejection(i),function(){typeof j.offError=="function"&&j.offError(i),typeof j.offUnhandledRejection=="function"&&j.offUnhandledRejection(i)}}function If(i,e){try{return{type:i,args:$3(e)}}catch{}return{type:i,args:[]}}function $3(i){return i.map(e=>bi(e))}function bi(i,e=0){if(e>=7)return{type:"object",value:"[Maximum depth reached]"};switch(typeof i){case"string":return q3(i);case"number":return V3(i);case"boolean":return K3(i);case"object":try{return z3(i,e)}catch{return{type:"object",value:{properties:[]}}}case"undefined":return G3();case"function":return H3(i);case"symbol":return W3(i);case"bigint":return j3(i)}}function H3(i){return{type:"function",value:`function ${i.name}() {}`}}function G3(){return{type:"undefined"}}function K3(i){return{type:"boolean",value:String(i)}}function V3(i){return{type:"number",value:String(i)}}function j3(i){return{type:"bigint",value:String(i)}}function q3(i){return{type:"string",value:i}}function W3(i){return{type:"symbol",value:i.description}}function z3(i,e){if(i===null)return{type:"null"};{if(Y3(i))return X3(i,e);if(dg(i))return J3(i,e);if(Z3(i))return e4(i,e);if(t4(i))return n4(i,e)}if(Array.isArray(i))return{type:"object",subType:"array",value:{properties:i.map((s,r)=>i4(s,r,e+1))}};if(i instanceof Set)return{type:"object",subType:"set",className:"Set",description:`Set(${i.size})`,value:{entries:Array.from(i).map(s=>s4(s,e+1))}};if(i instanceof Map)return{type:"object",subType:"map",className:"Map",description:`Map(${i.size})`,value:{entries:Array.from(i.entries()).map(s=>r4(s,e+1))}};if(i instanceof Promise)return{type:"object",subType:"promise",value:{properties:[]}};if(i instanceof RegExp)return{type:"object",subType:"regexp",value:String(i),className:"Regexp"};if(i instanceof Date)return{type:"object",subType:"date",value:String(i),className:"Date"};if(i instanceof Error)return{type:"object",subType:"error",value:i.message||String(i),className:i.name||"Error"};let t;{const s=i.constructor;s&&s.get$UTSMetadata$&&(t=s.get$UTSMetadata$().name)}let n=Object.entries(i);return Q3(i)&&(n=n.filter(([s])=>s!=="modifier"&&s!=="nodeContent")),{type:"object",className:t,value:{properties:n.map(s=>Rs(s[0],s[1],e+1))}}}function Q3(i){return i.modifier&&i.modifier._attribute&&i.nodeContent}function Y3(i){return i.$&&dg(i.$)}function dg(i){return i.type&&i.uid!=null&&i.appContext}function X3(i,e){return{type:"object",className:"ComponentPublicInstance",value:{properties:Object.entries(i.$.type).map(([t,n])=>Rs(t,n,e+1))}}}function J3(i,e){return{type:"object",className:"ComponentInternalInstance",value:{properties:Object.entries(i.type).map(([t,n])=>Rs(t,n,e+1))}}}function Z3(i){return i.style&&i.tagName!=null&&i.nodeName!=null}function e4(i,e){return{type:"object",value:{properties:Object.entries(i).filter(([t])=>["id","tagName","nodeName","dataset","offsetTop","offsetLeft","style"].includes(t)).map(([t,n])=>Rs(t,n,e+1))}}}function t4(i){return typeof i.getPropertyValue=="function"&&typeof i.setProperty=="function"&&i.$styles}function n4(i,e){return{type:"object",value:{properties:Object.entries(i.$styles).map(([t,n])=>Rs(t,n,e+1))}}}function Rs(i,e,t){const n=bi(e,t);return n.name=i,n}function i4(i,e,t){const n=bi(i,t);return n.name=`${e}`,n}function s4(i,e){return{value:bi(i,e)}}function r4(i,e){return{key:bi(i[0],e),value:bi(i[1],e)}}let Sl=null;const fr=[],hg={},Cf="---BEGIN:EXCEPTION---",o4="---END:EXCEPTION---";function Tl(i){if(Sl==null){fr.push(...i);return}Sl(JSON.stringify(Object.assign({type:"console",data:i},hg)))}function a4(i,e={}){if(Sl=i,Object.assign(hg,e),i!=null&&fr.length>0){const t=fr.slice();fr.length=0,Tl(t)}}const l4=/^\s*at\s+[\w/./-]+:\d+$/;function Lf(){function i(e){return function(...t){{const n=[...t];if(n.length){const s=n[n.length-1];typeof s=="string"&&l4.test(s)&&n.pop()}dn[e](...n)}if(e==="error"&&t.length===1){const n=t[0];if(typeof n=="string"&&n.startsWith(Cf)){const s=Cf.length,r=n.length-o4.length;Pr([n.slice(s,r)]);return}else if(n instanceof Error){Pr([n]);return}}Tl([If(e,t)])}}if(c4())return El.forEach(e=>{console[e]=i(e)}),function(){El.forEach(t=>{console[t]=dn[t]})};if(typeof j<"u"&&j.__f__){const e=j.__f__;if(e)return j.__f__=function(...t){const[n,s,...r]=t;e(n,"",...r),Tl([If(n,[...r,s])])},function(){j.__f__=e}}return function(){}}function c4(){const i=console.log,e=Symbol();try{console.log=e}catch{return!1}const t=console.log===e;return console.log=i,t}function u4(){const i="192.168.10.168,127.0.0.1",e="8090",t="mp-weixin_FUWucn",n=typeof swan<"u";let s=n?()=>{}:_f(),r=n?()=>{}:Lf();return Promise.resolve().then(()=>(n&&(s=_f(),r=Lf()),O3(i,e,t).then(o=>o?(f4(),o.onClose(()=>{dn.error(Hs("开发模式下日志通道 socket 连接关闭,请在 HBuilderX 中重新运行。")),s(),r()}),a4(a=>{o.send({data:a})}),U3(a=>{o.send({data:a})}),!0):(s(),r(),dn.error(Hs("开发模式下日志通道建立 socket 连接失败。")),dn.error(Hs("小程序平台,请勾选不校验合法域名配置。")),dn.error(Hs("如果是运行到真机,请确认手机与电脑处于同一网络。")),!1))))}const Rf="";function Hs(i){return`${Rf}${i}${Rf}`}function f4(){typeof Ut<"u"?Ut.__uni_console__=!0:typeof my<"u"?my.__uni_console__=!0:typeof tt<"u"?tt.__uni_console__=!0:typeof swan<"u"?swan.__uni_console__=!0:typeof qq<"u"?qq.__uni_console__=!0:typeof ks<"u"?ks.__uni_console__=!0:typeof jd<"u"?jd.__uni_console__=!0:typeof xhs<"u"?xhs.__uni_console__=!0:typeof has<"u"?has.__uni_console__=!0:typeof qa<"u"&&(qa.__uni_console__=!0)}u4();const d4=(i,e)=>{const t=i.__vccOpts||i;for(const[n,s]of e)t[n]=s;return t};function h4(i,e){if(!i)return;const t=i.split(","),n=t.length;n===1?e._$vueId=t[0]:n===2&&(e._$vueId=t[0],e._$vuePid=t[1])}const p4=["externalClasses"];function g4(i,e){p4.forEach(t=>{ne(e,t)&&(i[t]=e[t])})}const m4=/_(.*)_worklet_factory_/;function x4(i,e){e&&Object.keys(e).forEach(t=>{const n=t.match(m4);if(n){const s=n[1];i[t]=e[t],i[s]=e[s]}})}function y4(i,e){te(e)&&e.forEach(t=>{i[t]=function(n){return this.$vm[t](n)}})}function v4(i,e,t){i.selectAllComponents(e).forEach(s=>{const r=s.properties.uR;t[r]=s.$vm||s})}function E4(i,e){Object.defineProperty(i,"refs",{get(){const t={};return v4(e,".r",t),e.selectAllComponents(".r-i-f").forEach(s=>{const r=s.properties.uR;r&&(t[r]||(t[r]=[]),t[r].push(s.$vm||s))}),t}})}function pg(i,e){const t=i.$children;for(let s=t.length-1;s>=0;s--){const r=t[s];if(r.$scope._$vueId===e)return r}let n;for(let s=t.length-1;s>=0;s--)if(n=pg(t[s],e),n)return n}function A4(){var i;let e="";{const t=((i=wx.getAppBaseInfo)===null||i===void 0?void 0:i.call(wx))||wx.getSystemInfoSync(),n=t&&t.language?t.language:ns;e=_h(n)||ns}return e}const S4=["createSelectorQuery","createIntersectionObserver","selectAllComponents","selectComponent"];function T4(i,e){return function(n,...s){const r=e.$scope;if(r&&n){const o={__args__:s};r.triggerEvent(n,o)}return i.apply(this,[n,...s])}}function gg(i,e){const t=i.ctx;t.mpType=e.mpType,t.$mpType=e.mpType,t.$mpPlatform="mp-weixin",t.$scope=e.mpInstance,Object.defineProperties(t,{[ja]:{get(){const n=this.$scope.data[ja];return n===void 0?"":n}}}),t.$mp={},t._self={},i.slots={},te(e.slots)&&e.slots.length&&(e.slots.forEach(n=>{i.slots[n]=!0}),i.slots[Fx]&&(i.slots.default=!0)),t.getOpenerEventChannel=function(){return e.mpInstance.getOpenerEventChannel()},t.$hasHook=I4,t.$callHook=mg,i.emit=T4(i.emit,t)}function b4(i,e){gg(i,e);const t=i.ctx;S4.forEach(n=>{t[n]=function(...s){const r=t.$scope;if(r&&r[n])return r[n].apply(r,s)}})}function _4(i,e,t){const n=i.ctx;t.forEach(s=>{ne(e,s)&&(i[s]=n[s]=e[s])})}function I4(i){const e=this.$[i];return!!(e&&e.length)}function mg(i,e){i==="mounted"&&(mg.call(this,"bm"),this.$.isMounted=!0,i="m");const t=this.$[i];return t&&Gx(t,e)}const C4=[Is,eo,to,cc,Ph,uc,fc,dc,hc];function bl(i,e=new Set){if(i){Object.keys(i).forEach(t=>{Wh(t,i[t])&&e.add(t)});{const{extends:t,mixins:n}=i;n&&n.forEach(s=>bl(s,e)),t&&bl(t,e)}}return e}function kc(i,e,t){t.indexOf(e)===-1&&!ne(i,e)&&(i[e]=function(n){return this.$vm&&this.$vm.$callHook(e,n)})}const xg=[lc];function Bc(i,e,t=xg){e.forEach(n=>kc(i,n,t))}function yg(i,e,t=xg){bl(e).forEach(n=>kc(i,n,t))}function L4(i,e){if(!e)return;Object.keys(Wa).forEach(n=>{e&Wa[n]&&kc(i,n,[])})}const R4=Kh(()=>{const i=[],e=W(getApp)&&getApp({allowDefault:!0});if(e&&e.$vm&&e.$vm.$){const t=e.$vm.$.appContext.mixins;if(te(t)){const n=Object.keys(Wa);t.forEach(s=>{n.forEach(r=>{ne(s,r)&&!i.includes(r)&&i.push(r)})})}}return i});function w4(i){Bc(i,R4())}const D4=[eo,to,Kn,Ch,Lh,Rh];function Fc(i,e){const t=i.$,n={globalData:i.$options&&i.$options.globalData||{},$vm:i,onLaunch(o){this.$vm=i;const a=t.ctx;this.$vm&&a.$scope&&a.$callHook||(gg(t,{mpType:"app",mpInstance:this,slots:[]}),a.globalData=this.globalData,i.$callHook(Ih,o))}},s=wx.$onErrorHandlers;s&&(s.forEach(o=>{Qn(Kn,o,t)}),s.length=0),B4(i);const r=i.$.type;Bc(n,D4),yg(n,r);{const o=r.methods;o&&xe(n,o)}return n}function P4(i){return function(t){return App(Fc(t))}}function k4(i){return function(t){const n=Fc(t),s=W(getApp)&&getApp({allowDefault:!0});if(!s)return;t.$.ctx.$scope=s;const r=s.globalData;r&&Object.keys(n.globalData).forEach(o=>{ne(r,o)||(r[o]=n.globalData[o])}),Object.keys(n).forEach(o=>{ne(s,o)||(s[o]=n[o])}),vg(n,t)}}function vg(i,e){if(W(i.onLaunch)){const t=wx.getLaunchOptionsSync&&wx.getLaunchOptionsSync();i.onLaunch(t)}W(i.onShow)&&wx.onAppShow&&wx.onAppShow(t=>{e.$callHook("onShow",t)}),W(i.onHide)&&wx.onAppHide&&wx.onAppHide(t=>{e.$callHook("onHide",t)})}function B4(i){const e=_2(A4());Object.defineProperty(i,"$locale",{get(){return e.value},set(t){e.value=t}})}const Eg=["eO","uR","uRIF","uI","uT","uP","uS"];function F4(i,e=!1){const t={};if(!e){let n=function(s){const r=Object.create(null);s&&s.forEach(o=>{r[o]=!0}),this.setData({$slots:r})};Eg.forEach(s=>{t[s]={type:null,value:""}}),t.uS={type:null,value:[]},t.uS.observer=n}return i.behaviors&&i.behaviors.includes("wx://form-field")&&((!i.properties||!i.properties.name)&&(t.name={type:null,value:""}),(!i.properties||!i.properties.value)&&(t.value={type:null,value:""})),t}function O4(i){const e={};return i&&i.virtualHost&&(e[Mx]={type:null,value:""},e[Nx]={type:null,value:""},e[Ux]={type:null,value:""},e[ja]={type:null,value:""}),e}function Ag(i){i.properties||(i.properties={}),xe(i.properties,F4(i),O4(i.options))}const M4=[String,Number,Boolean,Object,Array,null];function N4(i,e){return te(i)&&i.length===1?i[0]:i}function wf(i,e){const t=N4(i);return M4.indexOf(t)!==-1?t:null}function U4({properties:i},e){te(e)?e.forEach(t=>{i[t]={type:String,value:""}}):Ge(e)&&Object.keys(e).forEach(t=>{const n=e[t];if(Ge(n)){let s=n.default;W(s)&&(s=s());const r=n.type;n.type=wf(r),i[t]={type:n.type,value:s}}else i[t]={type:wf(n)}})}function $4(i,e){return(e?H4(i):Pc(i.uP))||{}}function H4(i){const e={};return Ge(i)&&Object.keys(i).forEach(t=>{Eg.indexOf(t)===-1&&(e[t]=i[t])}),e}function G4(i){const e=i.$options;te(e.behaviors)&&e.behaviors.includes("uni://form-field")&&i.$watch("modelValue",()=>{i.$scope&&i.$scope.setData({name:i.name,value:i.modelValue})},{immediate:!0})}function K4(i){return{}}function Sg(i){const e=function(){const n=this.properties.uP;n&&(this.$vm?j4(n,this.$vm.$):this.properties.uT==="m"&&V4(n,this))};i.observers||(i.observers={}),i.observers.uP=e}function V4(i,e){const t=e.properties,n=Pc(i)||{};Tg(t,n,!1)&&e.setData(n)}function j4(i,e){const t=fe(e.props),n=Pc(i)||{};Tg(t,n)&&(by(e,n,t,!1),F2(e.update)&&O2(e.update),e.update())}function Tg(i,e,t=!0){const n=Object.keys(e);if(t&&n.length!==Object.keys(i).length)return!0;for(let s=0;s<n.length;s++){const r=n[s];if(e[r]!==i[r])return!0}return!1}function q4(i){const e=i.behaviors;let t=i.props;t||(i.props=t=[]);const n=[];return te(e)&&e.forEach(s=>{n.push(s.replace("uni://","wx://")),s==="uni://form-field"&&(te(t)?(t.push("name"),t.push("modelValue")):(t.name={type:String,default:""},t.modelValue={type:[String,Number,Boolean,Array,Object,Date],default:""}))}),n}function W4(i,e){i.data=K4(),i.behaviors=q4(e)}function bg(i,{parse:e,mocks:t,isPage:n,isPageInProject:s,initRelation:r,handleLink:o,initLifetimes:a}){i=i.default||i;const c={multipleSlots:!0,addGlobalClass:!0,pureDataPattern:/^uP$/};te(i.mixins)&&i.mixins.forEach(u=>{Ee(u.options)&&xe(c,u.options)}),i.options&&xe(c,i.options);const l={options:c,lifetimes:a({mocks:t,isPage:n,initRelation:r,vueOptions:i}),pageLifetimes:{show(){this.$vm&&this.$vm.$callHook("onPageShow")},hide(){this.$vm&&this.$vm.$callHook("onPageHide")},resize(u){this.$vm&&this.$vm.$callHook("onPageResize",u)}},methods:{__l:o}};return W4(l,i),Ag(l),Sg(l),g4(l,i),y4(l.methods,i.wxsCallMethods),x4(l.methods,i.methods),e&&e(l,{handleLink:o}),l}function z4(i){return function(t){return Component(bg(t,i))}}let Io,Co;function _g(){return getApp().$vm}function Q4(i,e){Io||(Io=_g().$createComponent);const t=Io(i,e);return Ls(t.$)||t}function Y4(i){return Co||(Co=_g().$destroyComponent),Co(i)}function X4(i,e){const{parse:t,mocks:n,isPage:s,initRelation:r,handleLink:o,initLifetimes:a}=e,c=bg(i,{mocks:n,isPage:s,isPageInProject:!0,initRelation:r,handleLink:o,initLifetimes:a});U4(c,(i.default||i).props);const l=c.methods;return l.onLoad=function(u){return this.options=u,this.$page={fullPath:Hx(this.route+qx(u))},this.$vm&&this.$vm.$callHook(Is,u)},Bc(l,C4),yg(l,i),L4(l,i.__runtimeHooks),w4(l),t&&t(c,{handleLink:o}),c}function J4(i){return function(t){return Component(X4(t,i))}}function Z4(i){return function(t){vg(Fc(t),t)}}const eA=Page,tA=Component;function Df(i){const e=i.triggerEvent,t=function(n,...s){return e.apply(i,[Vx(n),...s])};try{i.triggerEvent=t}catch{i._triggerEvent=t}}function Ig(i,e,t){const n=e[i];n?e[i]=function(...s){return Df(this),n.apply(this,s)}:e[i]=function(){Df(this)}}Page=function(i){return Ig(Is,i),eA(i)};Component=function(i){return Ig("created",i),i.properties&&i.properties.uP||(Ag(i),Sg(i)),tA(i)};function nA({mocks:i,isPage:e,initRelation:t,vueOptions:n}){return{attached(){let s=this.properties;h4(s.uI,this);const r={vuePid:this._$vuePid};t(this,r);const o=this,a=e(o);let c=s;this.$vm=Q4({type:n,props:$4(c,a)},{mpType:a?"page":"component",mpInstance:o,slots:s.uS||{},parentComponent:r.parent&&r.parent.$,onBeforeSetup(l,u){E4(l,o),_4(l,o,i),b4(l,u)}}),a||G4(this.$vm)},ready(){this.$vm&&(this.$vm.$callHook("mounted"),this.$vm.$callHook(lc))},detached(){this.$vm&&(jp(this.$vm.$.uid),Y4(this.$vm))}}}const iA=["__route__","__wxExparserNodeId__","__wxWebviewId__"];function sA(i){return!!i.route}function rA(i,e){i.triggerEvent("__l",e)}function oA(i){const e=i.detail||i.value,t=e.vuePid;let n;t&&(n=pg(this.$vm,t)),n||(n=this.$vm),e.parent=n}var Cg=Object.freeze({__proto__:null,handleLink:oA,initLifetimes:nA,initRelation:rA,isPage:sA,mocks:iA});const aA=P4(),lA=J4(Cg),cA=z4(Cg),uA=Z4(),fA=k4();wx.createApp=global.createApp=aA,wx.createPage=lA,wx.createComponent=cA,wx.createPluginApp=global.createPluginApp=uA,wx.createSubpackageApp=global.createSubpackageApp=fA;/*!
- * vuex v4.1.0
- * (c) 2022 Evan You
- * @license MIT
- */var Lg="store";function dA(i){return i===void 0&&(i=null),ar(i!==null?i:Lg)}function Xn(i,e){Object.keys(i).forEach(function(t){return e(i[t],t)})}function hA(i){return i!==null&&typeof i=="object"}function pA(i){return i&&typeof i.then=="function"}function Ct(i,e){if(!i)throw new Error("[vuex] "+e)}function gA(i,e){return function(){return i(e)}}function Rg(i,e,t){return e.indexOf(i)<0&&(t&&t.prepend?e.unshift(i):e.push(i)),function(){var n=e.indexOf(i);n>-1&&e.splice(n,1)}}function wg(i,e){i._actions=Object.create(null),i._mutations=Object.create(null),i._wrappedGetters=Object.create(null),i._modulesNamespaceMap=Object.create(null);var t=i.state;uo(i,t,[],i._modules.root,!0),Oc(i,t,e)}function Oc(i,e,t){var n=i._state,s=i._scope;i.getters={},i._makeLocalGettersCache=Object.create(null);var r=i._wrappedGetters,o={},a={},c=Zx(!0);c.run(function(){Xn(r,function(l,u){o[u]=gA(l,i),a[u]=Hp(function(){return o[u]()}),Object.defineProperty(i.getters,u,{get:function(){return a[u].value},enumerable:!0})})}),i._state=so({data:e}),i._scope=c,i.strict&&AA(i),n&&t&&i._withCommit(function(){n.data=null}),s&&s.stop()}function uo(i,e,t,n,s){var r=!t.length,o=i._modules.getNamespace(t);if(n.namespaced&&(i._modulesNamespaceMap[o]&&console.error("[vuex] duplicate namespace "+o+" for the namespaced module "+t.join("/")),i._modulesNamespaceMap[o]=n),!r&&!s){var a=Mc(e,t.slice(0,-1)),c=t[t.length-1];i._withCommit(function(){c in a&&console.warn('[vuex] state field "'+c+'" was overridden by a module with the same name at "'+t.join(".")+'"'),a[c]=n.state})}var l=n.context=mA(i,o,t);n.forEachMutation(function(u,f){var d=o+f;yA(i,d,u,l)}),n.forEachAction(function(u,f){var d=u.root?f:o+f,h=u.handler||u;vA(i,d,h,l)}),n.forEachGetter(function(u,f){var d=o+f;EA(i,d,u,l)}),n.forEachChild(function(u,f){uo(i,e,t.concat(f),u,s)})}function mA(i,e,t){var n=e==="",s={dispatch:n?i.dispatch:function(r,o,a){var c=kr(r,o,a),l=c.payload,u=c.options,f=c.type;if((!u||!u.root)&&(f=e+f,!i._actions[f])){console.error("[vuex] unknown local action type: "+c.type+", global type: "+f);return}return i.dispatch(f,l)},commit:n?i.commit:function(r,o,a){var c=kr(r,o,a),l=c.payload,u=c.options,f=c.type;if((!u||!u.root)&&(f=e+f,!i._mutations[f])){console.error("[vuex] unknown local mutation type: "+c.type+", global type: "+f);return}i.commit(f,l,u)}};return Object.defineProperties(s,{getters:{get:n?function(){return i.getters}:function(){return xA(i,e)}},state:{get:function(){return Mc(i.state,t)}}}),s}function xA(i,e){if(!i._makeLocalGettersCache[e]){var t={},n=e.length;Object.keys(i.getters).forEach(function(s){if(s.slice(0,n)===e){var r=s.slice(n);Object.defineProperty(t,r,{get:function(){return i.getters[s]},enumerable:!0})}}),i._makeLocalGettersCache[e]=t}return i._makeLocalGettersCache[e]}function yA(i,e,t,n){var s=i._mutations[e]||(i._mutations[e]=[]);s.push(function(o){t.call(i,n.state,o)})}function vA(i,e,t,n){var s=i._actions[e]||(i._actions[e]=[]);s.push(function(o){var a=t.call(i,{dispatch:n.dispatch,commit:n.commit,getters:n.getters,state:n.state,rootGetters:i.getters,rootState:i.state},o);return pA(a)||(a=Promise.resolve(a)),i._devtoolHook?a.catch(function(c){throw i._devtoolHook.emit("vuex:error",c),c}):a})}function EA(i,e,t,n){if(i._wrappedGetters[e]){console.error("[vuex] duplicate getter key: "+e);return}i._wrappedGetters[e]=function(r){return t(n.state,n.getters,r.state,r.getters)}}function AA(i){zi(function(){return i._state.data},function(){Ct(i._committing,"do not mutate vuex store state outside mutation handlers.")},{deep:!0,flush:"sync"})}function Mc(i,e){return e.reduce(function(t,n){return t[n]},i)}function kr(i,e,t){return hA(i)&&i.type&&(t=e,e=i,i=i.type),Ct(typeof i=="string","expects string as the type, but found "+typeof i+"."),{type:i,payload:e,options:t}}var Lt=function(e,t){this.runtime=t,this._children=Object.create(null),this._rawModule=e;var n=e.state;this.state=(typeof n=="function"?n():n)||{}},Dg={namespaced:{configurable:!0}};Dg.namespaced.get=function(){return!!this._rawModule.namespaced};Lt.prototype.addChild=function(e,t){this._children[e]=t};Lt.prototype.removeChild=function(e){delete this._children[e]};Lt.prototype.getChild=function(e){return this._children[e]};Lt.prototype.hasChild=function(e){return e in this._children};Lt.prototype.update=function(e){this._rawModule.namespaced=e.namespaced,e.actions&&(this._rawModule.actions=e.actions),e.mutations&&(this._rawModule.mutations=e.mutations),e.getters&&(this._rawModule.getters=e.getters)};Lt.prototype.forEachChild=function(e){Xn(this._children,e)};Lt.prototype.forEachGetter=function(e){this._rawModule.getters&&Xn(this._rawModule.getters,e)};Lt.prototype.forEachAction=function(e){this._rawModule.actions&&Xn(this._rawModule.actions,e)};Lt.prototype.forEachMutation=function(e){this._rawModule.mutations&&Xn(this._rawModule.mutations,e)};Object.defineProperties(Lt.prototype,Dg);var Jn=function(e){this.register([],e,!1)};Jn.prototype.get=function(e){return e.reduce(function(t,n){return t.getChild(n)},this.root)};Jn.prototype.getNamespace=function(e){var t=this.root;return e.reduce(function(n,s){return t=t.getChild(s),n+(t.namespaced?s+"/":"")},"")};Jn.prototype.update=function(e){Pg([],this.root,e)};Jn.prototype.register=function(e,t,n){var s=this;n===void 0&&(n=!0),kg(e,t);var r=new Lt(t,n);if(e.length===0)this.root=r;else{var o=this.get(e.slice(0,-1));o.addChild(e[e.length-1],r)}t.modules&&Xn(t.modules,function(a,c){s.register(e.concat(c),a,n)})};Jn.prototype.unregister=function(e){var t=this.get(e.slice(0,-1)),n=e[e.length-1],s=t.getChild(n);if(!s){console.warn("[vuex] trying to unregister module '"+n+"', which is not registered");return}s.runtime&&t.removeChild(n)};Jn.prototype.isRegistered=function(e){var t=this.get(e.slice(0,-1)),n=e[e.length-1];return t?t.hasChild(n):!1};function Pg(i,e,t){if(kg(i,t),e.update(t),t.modules)for(var n in t.modules){if(!e.getChild(n)){console.warn("[vuex] trying to add a new module '"+n+"' on hot reloading, manual reload is needed");return}Pg(i.concat(n),e.getChild(n),t.modules[n])}}var Pf={assert:function(i){return typeof i=="function"},expected:"function"},SA={assert:function(i){return typeof i=="function"||typeof i=="object"&&typeof i.handler=="function"},expected:'function or object with "handler" function'},kf={getters:Pf,mutations:Pf,actions:SA};function kg(i,e){Object.keys(kf).forEach(function(t){if(e[t]){var n=kf[t];Xn(e[t],function(s,r){Ct(n.assert(s),TA(i,t,r,s,n.expected))})}})}function TA(i,e,t,n,s){var r=e+" should be "+s+' but "'+e+"."+t+'"';return i.length>0&&(r+=' in module "'+i.join(".")+'"'),r+=" is "+JSON.stringify(n)+".",r}function bA(i){return new at(i)}var at=function i(e){var t=this;e===void 0&&(e={}),Ct(typeof Promise<"u","vuex requires a Promise polyfill in this browser."),Ct(this instanceof i,"store must be called with the new operator.");var n=e.plugins;n===void 0&&(n=[]);var s=e.strict;s===void 0&&(s=!1);var r=e.devtools;this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new Jn(e),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._makeLocalGettersCache=Object.create(null),this._scope=null,this._devtools=r;var o=this,a=this,c=a.dispatch,l=a.commit;this.dispatch=function(d,h){return c.call(o,d,h)},this.commit=function(d,h,p){return l.call(o,d,h,p)},this.strict=s;var u=this._modules.root.state;uo(this,u,[],this._modules.root),Oc(this,u),n.forEach(function(f){return f(t)})},Nc={state:{configurable:!0}};at.prototype.install=function(e,t){e.provide(t||Lg,this),e.config.globalProperties.$store=this,this._devtools!==void 0&&this._devtools};Nc.state.get=function(){return this._state.data};Nc.state.set=function(i){Ct(!1,"use store.replaceState() to explicit replace store state.")};at.prototype.commit=function(e,t,n){var s=this,r=kr(e,t,n),o=r.type,a=r.payload,c=r.options,l={type:o,payload:a},u=this._mutations[o];if(!u){console.error("[vuex] unknown mutation type: "+o);return}this._withCommit(function(){u.forEach(function(d){d(a)})}),this._subscribers.slice().forEach(function(f){return f(l,s.state)}),c&&c.silent&&console.warn("[vuex] mutation type: "+o+". Silent option has been removed. Use the filter functionality in the vue-devtools")};at.prototype.dispatch=function(e,t){var n=this,s=kr(e,t),r=s.type,o=s.payload,a={type:r,payload:o},c=this._actions[r];if(!c){console.error("[vuex] unknown action type: "+r);return}try{this._actionSubscribers.slice().filter(function(u){return u.before}).forEach(function(u){return u.before(a,n.state)})}catch(u){console.warn("[vuex] error in before action subscribers: "),console.error(u)}var l=c.length>1?Promise.all(c.map(function(u){return u(o)})):c[0](o);return new Promise(function(u,f){l.then(function(d){try{n._actionSubscribers.filter(function(h){return h.after}).forEach(function(h){return h.after(a,n.state)})}catch(h){console.warn("[vuex] error in after action subscribers: "),console.error(h)}u(d)},function(d){try{n._actionSubscribers.filter(function(h){return h.error}).forEach(function(h){return h.error(a,n.state,d)})}catch(h){console.warn("[vuex] error in error action subscribers: "),console.error(h)}f(d)})})};at.prototype.subscribe=function(e,t){return Rg(e,this._subscribers,t)};at.prototype.subscribeAction=function(e,t){var n=typeof e=="function"?{before:e}:e;return Rg(n,this._actionSubscribers,t)};at.prototype.watch=function(e,t,n){var s=this;return Ct(typeof e=="function","store.watch only accepts a function."),zi(function(){return e(s.state,s.getters)},t,Object.assign({},n))};at.prototype.replaceState=function(e){var t=this;this._withCommit(function(){t._state.data=e})};at.prototype.registerModule=function(e,t,n){n===void 0&&(n={}),typeof e=="string"&&(e=[e]),Ct(Array.isArray(e),"module path must be a string or an Array."),Ct(e.length>0,"cannot register the root module by using registerModule."),this._modules.register(e,t),uo(this,this.state,e,this._modules.get(e),n.preserveState),Oc(this,this.state)};at.prototype.unregisterModule=function(e){var t=this;typeof e=="string"&&(e=[e]),Ct(Array.isArray(e),"module path must be a string or an Array."),this._modules.unregister(e),this._withCommit(function(){var n=Mc(t.state,e.slice(0,-1));delete n[e[e.length-1]]}),wg(this)};at.prototype.hasModule=function(e){return typeof e=="string"&&(e=[e]),Ct(Array.isArray(e),"module path must be a string or an Array."),this._modules.isRegistered(e)};at.prototype.hotUpdate=function(e){this._modules.update(e),wg(this,!0)};at.prototype._withCommit=function(e){var t=this._committing;this._committing=!0,e(),this._committing=t};Object.defineProperties(at.prototype,Nc);const Bg=i=>i;function _A(i){return/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(i)}function IA(i){return/^1[23456789]\d{9}$/.test(i)}function CA(i){return/^((https|http|ftp|rtsp|mms):\/\/)(([0-9a-zA-Z_!~*'().&=+$%-]+: )?[0-9a-zA-Z_!~*'().&=+$%-]+@)?(([0-9]{1,3}.){3}[0-9]{1,3}|([0-9a-zA-Z_!~*'()-]+.)*([0-9a-zA-Z][0-9a-zA-Z-]{0,61})?[0-9a-zA-Z].[a-zA-Z]{2,6})(:[0-9]{1,4})?((\/?)|(\/[0-9a-zA-Z_!~*'().;?:@&=+$,%#-]+)+\/?)$/.test(i)}function LA(i){if(!i)return!1;if(typeof i=="number")return i.toString().length!==10&&i.toString().length!==13?!1:!isNaN(new Date(i).getTime());if(typeof i=="string"){const e=Number(i);if(!isNaN(e)&&(e.toString().length===10||e.toString().length===13))return!isNaN(new Date(e).getTime());if(i.length<10||i.length>19||!/^\d{4}[-\/]\d{2}[-\/]\d{2}( \d{1,2}:\d{2}(:\d{2})?)?$/.test(i))return!1;const n=new Date(i);return!isNaN(n.getTime())}return!1}function RA(i){return/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(i)}function Br(i){return/^[\+-]?(\d+\.?\d*|\.\d+|\d\.\d+e\+\d+)$/.test(i)}function wA(i){return typeof i=="string"}function DA(i){return/^\d+$/.test(i)}function PA(i){return/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(i)}function kA(i){const e=/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}(([0-9]{5}[DF]$)|([DF][A-HJ-NP-Z0-9][0-9]{4}$))/,t=/^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳]{1}$/;return i.length===7?t.test(i):i.length===8?e.test(i):!1}function BA(i){return/^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(i)}function FA(i){return/^[\u4e00-\u9fa5]+$/gi.test(i)}function OA(i){return/^[a-zA-Z]*$/.test(i)}function MA(i){return/^[0-9a-zA-Z]*$/g.test(i)}function NA(i,e){return i.indexOf(e)>=0}function UA(i,e){return i>=e[0]&&i<=e[1]}function $A(i,e){return i.length>=e[0]&&i.length<=e[1]}function HA(i){return/^\d{3,4}-\d{7,8}(-\d{3,4})?$/.test(i)}function _l(i){switch(typeof i){case"undefined":return!0;case"string":if(i.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g,"").length==0)return!0;break;case"boolean":if(!i)return!0;break;case"number":if(i===0||isNaN(i))return!0;break;case"object":if(i===null||i.length===0)return!0;for(const e in i)return!1;return!0}return!1}function GA(i){if(typeof i=="string")try{const e=JSON.parse(i);return!!(typeof e=="object"&&e)}catch{return!1}return!1}function Fg(i){return typeof Array.isArray=="function"?Array.isArray(i):Object.prototype.toString.call(i)==="[object Array]"}function KA(i){return Object.prototype.toString.call(i)==="[object Object]"}function VA(i){return Object.prototype.toString.call(i)==="[object Promise]"}function jA(i,e=6){return new RegExp(`^\\d{${e}}$`).test(i)}function Il(i){return typeof i=="function"}function qA(i){return VA(i)&&Il(i.then)&&Il(i.catch)}function WA(i){const e=i.split("?")[0];return/\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i.test(e)}function zA(i){return/\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv|m3u8)/i.test(i)}function QA(i){return i&&Object.prototype.toString.call(i)==="[object RegExp]"}const Og={email:_A,mobile:IA,url:CA,date:LA,dateISO:RA,number:Br,digits:DA,idCard:PA,carNo:kA,amount:BA,chinese:FA,letter:OA,enOrNum:MA,contains:NA,range:UA,rangeLength:$A,empty:_l,isEmpty:_l,jsonString:GA,landline:HA,object:KA,array:Fg,code:jA,func:Il,promise:qA,video:zA,image:WA,regExp:QA,string:wA};function Mg(i,e=15){return+parseFloat(Number(i).toPrecision(e))}function ls(i){const e=i.toString().split(/[eE]/),t=(e[0].split(".")[1]||"").length-+(e[1]||0);return t>0?t:0}function Fr(i){if(i.toString().indexOf("e")===-1)return Number(i.toString().replace(".",""));const e=ls(i);return e>0?Mg(Number(i)*Math.pow(10,e)):Number(i)}function Cl(i){(i>Number.MAX_SAFE_INTEGER||i<Number.MIN_SAFE_INTEGER)&&j.__f__("warn","at node_modules/uview-plus/libs/function/digit.js:45",`${i} 超出了精度限制,结果可能不正确`)}function Ng(i,e){const[t,n,...s]=i;let r=e(t,n);return s.forEach(o=>{r=e(r,o)}),r}function Or(...i){if(i.length>2)return Ng(i,Or);const[e,t]=i,n=Fr(e),s=Fr(t),r=ls(e)+ls(t),o=n*s;return Cl(o),o/Math.pow(10,r)}function Ug(...i){if(i.length>2)return Ng(i,Ug);const[e,t]=i,n=Fr(e),s=Fr(t);return Cl(n),Cl(s),Or(n/s,Mg(Math.pow(10,ls(t)-ls(e))))}function YA(i,e){const t=Math.pow(10,e);let n=Ug(Math.round(Math.abs(Or(i,t))),t);return i<0&&n!==0&&(n=Or(n,-1)),n}const Ll="3";j.__f__("log","at node_modules/uview-plus/libs/config/config.js:5",`
- %c uview-plus V${Ll} %c https://ijry.github.io/uview-plus/
- `,"color: #ffffff; background: #3c9cff; padding:5px 0;","color: #3c9cff;background: #ffffff; padding:5px 0;");const Zn={v:Ll,version:Ll,type:["primary","success","info","error","warning"],color:{"u-primary":"#2979ff","u-warning":"#ff9900","u-success":"#19be6b","u-error":"#fa3534","u-info":"#909399","u-main-color":"#303133","u-content-color":"#606266","u-tips-color":"#909399","u-light-color":"#c0c4cc","up-primary":"#2979ff","up-warning":"#ff9900","up-success":"#19be6b","up-error":"#fa3534","up-info":"#909399","up-main-color":"#303133","up-content-color":"#606266","up-tips-color":"#909399","up-light-color":"#c0c4cc"},iconUrl:"https://at.alicdn.com/t/font_2225171_8kdcwk4po24.ttf",customIcon:{family:"",url:""},customIcons:{},unit:"px",interceptor:{navbarLeftClick:null},loadFontOnce:!1};function XA(i=0,e=0,t=0){return Math.max(i,Math.min(e,Number(t)))}function JA(i,e=!1){return Br(i)?e?`${i}px`:Number(i):/(rpx|upx)$/.test(i)?e?`${j.upx2px(parseInt(i))}px`:Number(j.upx2px(parseInt(i))):e?`${parseInt(i)}px`:parseInt(i)}function ZA(i=30){return new Promise(e=>{setTimeout(()=>{e()},i)})}function eS(){return j.getDeviceInfo().platform.toLowerCase()}function $g(){return j.getSystemInfoSync()}function tS(){let i={};return i=$g(),i}function nS(i,e){if(i>=0&&e>0&&e>=i){const t=e-i+1;return Math.floor(Math.random()*t+i)}return 0}function iS(i=32,e=!0,t=null){const n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),s=[];if(t=t||n.length,i)for(let r=0;r<i;r++)s[r]=n[0|Math.random()*t];else{let r;s[8]=s[13]=s[18]=s[23]="-",s[14]="4";for(let o=0;o<36;o++)s[o]||(r=0|Math.random()*16,s[o]=n[o==19?r&3|8:r])}return e?(s.shift(),`u${s.join("")}`):s.join("")}function Mr(i=void 0){let e=this.$parent;for(;e;)if(i=i.replace(/up-([a-zA-Z0-9-_]+)/g,"u-$1"),e.$options&&e.$options.name!==i)e=e.$parent;else return e;return!1}function sS(i,e="object"){if(_l(i)||typeof i=="object"&&e==="object"||e==="string"&&typeof i=="string")return i;if(e==="object"){i=ji(i);const n=i.split(";"),s={};for(let r=0;r<n.length;r++)if(n[r]){const o=n[r].split(":");s[ji(o[0])]=ji(o[1])}return s}let t="";return typeof i=="object"&&i.forEach((n,s)=>{const r=s.replace(/([A-Z])/g,"-$1").toLowerCase();t+=`${r}:${n};`}),ji(t)}function rS(i="auto",e=""){return e||(e=Zn.unit||"px"),e=="rpx"&&Br(String(i))&&(i=i*2),i=String(i),Br(i)?`${i}${e}`:i}function Uc(i){if([null,void 0,NaN,!1].includes(i)||typeof i!="object"&&typeof i!="function")return i;const e=Fg(i)?[]:{};for(const t in i)i.hasOwnProperty(t)&&(e[t]=typeof i[t]=="object"?Uc(i[t]):i[t]);return e}function cs(i={},e={}){let t=Uc(i);if(typeof t!="object"||typeof e!="object")return!1;for(const n in e)e.hasOwnProperty(n)&&(n in t?e[n]==null||typeof t[n]!="object"||typeof e[n]!="object"?t[n]=e[n]:t[n].concat&&e[n].concat?t[n]=t[n].concat(e[n]):t[n]=cs(t[n],e[n]):t[n]=e[n]);return t}function di(i,e={}){if(typeof i!="object"||typeof e!="object")return!1;for(const t in e)e.hasOwnProperty(t)&&(t in i?e[t]==null||typeof i[t]!="object"||typeof e[t]!="object"?i[t]=e[t]:i[t].concat&&e[t].concat?i[t]=i[t].concat(e[t]):i[t]=di(i[t],e[t]):i[t]=e[t]);return i}function oS(i){j.__f__("error","at node_modules/uview-plus/libs/function/index.js:304",`uView提示:${i}`)}function aS(i=[]){return i.sort(()=>Math.random()-.5)}String.prototype.padStart||(String.prototype.padStart=function(i,e=" "){if(Object.prototype.toString.call(e)!=="[object String]")throw new TypeError("fillString must be String");const t=this;if(t.length>=i)return String(t);const n=i-t.length;let s=Math.ceil(n/e.length);for(;s>>=1;)e+=e,s===1&&(e+=e);return e.slice(0,n)+t});function Hg(i=null,e="yyyy-mm-dd"){let t;i?/^\d{10}$/.test(i.toString().trim())?t=new Date(i*1e3):typeof i=="string"&&/^\d+$/.test(i.trim())?t=new Date(Number(i)):typeof i=="string"&&/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(i)?t=new Date(i):t=new Date(typeof i=="string"?i.replace(/-/g,"/"):i):t=new Date;const n={y:t.getFullYear().toString(),m:(t.getMonth()+1).toString().padStart(2,"0"),d:t.getDate().toString().padStart(2,"0"),h:t.getHours().toString().padStart(2,"0"),M:t.getMinutes().toString().padStart(2,"0"),s:t.getSeconds().toString().padStart(2,"0")};for(const s in n){const[r]=new RegExp(`${s}+`).exec(e)||[];if(r){const o=s==="y"&&r.length===2?2:0;e=e.replace(r,n[s].slice(o))}}return e}function lS(i=null,e="yyyy-mm-dd"){i==null&&(i=Number(new Date)),i=parseInt(i),i.toString().length==10&&(i*=1e3);let t=new Date().getTime()-i;t=parseInt(t/1e3);let n="";switch(!0){case t<300:n="刚刚";break;case(t>=300&&t<3600):n=`${parseInt(t/60)}分钟前`;break;case(t>=3600&&t<86400):n=`${parseInt(t/3600)}小时前`;break;case(t>=86400&&t<2592e3):n=`${parseInt(t/86400)}天前`;break;default:e===!1?t>=2592e3&&t<365*86400?n=`${parseInt(t/(86400*30))}个月前`:n=`${parseInt(t/(86400*365))}年前`:n=Hg(i,e)}return n}function ji(i,e="both"){return i=String(i),e=="both"?i.replace(/^\s+|\s+$/g,""):e=="left"?i.replace(/^\s*/,""):e=="right"?i.replace(/(\s*$)/g,""):e=="all"?i.replace(/\s+/g,""):i}function Rl(i={},e=!0,t="brackets"){const n=e?"?":"",s=[];["indices","brackets","repeat","comma"].indexOf(t)==-1&&(t="brackets");for(const r in i){const o=i[r];if(!(["",void 0,null].indexOf(o)>=0))if(o.constructor===Array)switch(t){case"indices":for(let c=0;c<o.length;c++)s.push(`${r}[${c}]=${o[c]}`);break;case"brackets":o.forEach(c=>{s.push(`${r}[]=${c}`)});break;case"repeat":o.forEach(c=>{s.push(`${r}=${c}`)});break;case"comma":let a="";o.forEach(c=>{a+=(a?",":"")+c}),s.push(`${r}=${a}`);break;default:o.forEach(c=>{s.push(`${r}[]=${c}`)})}else s.push(`${r}=${o}`)}return s.length?n+s.join("&"):""}function cS(i,e=2e3){j.showToast({title:String(i),icon:"none",duration:e})}function uS(i="success",e=!1){["primary","info","error","warning","success"].indexOf(i)==-1&&(i="success");let t="";switch(i){case"primary":t="info-circle";break;case"info":t="info-circle";break;case"error":t="close-circle";break;case"warning":t="error-circle";break;case"success":t="checkmark-circle";break;default:t="checkmark-circle"}return e&&(t+="-fill"),t}function fS(i,e=0,t=".",n=","){i=`${i}`.replace(/[^0-9+-Ee.]/g,"");const s=isFinite(+i)?+i:0,r=isFinite(+e)?Math.abs(e):0,o=typeof n>"u"?",":n,a=typeof t>"u"?".":t;let c="";c=(r?YA(s,r)+"":`${Math.round(s)}`).split(".");const l=/(-?\d+)(\d{3})/;for(;l.test(c[0]);)c[0]=c[0].replace(l,`$1${o}$2`);return(c[1]||"").length<r&&(c[1]=c[1]||"",c[1]+=new Array(r-c[1].length+1).join("0")),c.join(a)}function dS(i,e=!0){const t=parseInt(i);return e?/s$/.test(i)?i:i>30?`${i}ms`:`${i}s`:/ms$/.test(i)?t:/s$/.test(i)?t>30?t:t*1e3:t}function hS(i){return`00${i}`.slice(-2)}function pS(i,e){const t=Mr.call(i,"u-form-item"),n=Mr.call(i,"u-form");t&&n&&n.validateField(t.prop,()=>{},e)}function gS(i,e){if(typeof i!="object"||i==null||typeof e!="string"||e==="")return"";if(e.indexOf(".")!==-1){const t=e.split(".");let n=i[t[0]]||{};for(let s=1;s<t.length;s++)n&&(n=n[t[s]]);return n}return i[e]}function mS(i,e,t){if(typeof i!="object"||i==null)return;const n=function(s,r,o){if(r.length===1){s[r[0]]=o;return}for(;r.length>1;){const a=r[0];(!s[a]||typeof s[a]!="object")&&(s[a]={}),r.shift(),n(s[a],r,o)}};if(!(typeof e!="string"||e===""))if(e.indexOf(".")!==-1){const s=e.split(".");n(i,s,t)}else i[e]=t}function Gg(){const i=getCurrentPages();return`/${i[i.length-1].route||""}`}function xS(){return getCurrentPages()}function yS(i,e){return e.split(".").reduce((n,s)=>n&&n[s]!==void 0?n[s]:void 0,i)}function vS(i,e=95){const t=ES(i),n=AS(t.r,t.g,t.b),s={h:n.h,s:n.s,l:Math.min(e,95)};return SS(s.h,s.s,s.l)}function ES(i){const e=i.toLowerCase().trim();if(e.startsWith("#")){const n=e.replace("#",""),s=n.length===3?n.split("").map(r=>r+r).join(""):n;return{r:parseInt(s.substring(0,2),16),g:parseInt(s.substring(2,4),16),b:parseInt(s.substring(4,6),16)}}const t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(t)return{r:+t[1],g:+t[2],b:+t[3]};throw new Error("Invalid color format")}function AS(i,e,t){i/=255,e/=255,t/=255;const n=Math.max(i,e,t),s=Math.min(i,e,t);let r,o,a=(n+s)/2;if(n===s)r=o=0;else{const c=n-s;switch(o=a>.5?c/(2-n-s):c/(n+s),n){case i:r=(e-t)/c+(e<t?6:0);break;case e:r=(t-i)/c+2;break;case t:r=(i-e)/c+4;break}r=(r*60).toFixed(1)}return{h:+r,s:+(o*100).toFixed(1),l:+(a*100).toFixed(1)}}function SS(i,e,t){t/=100;const n=e*Math.min(t,1-t)/100,s=r=>{const o=(r+i/30)%12,a=t-n*Math.max(Math.min(o-3,9-o,1),-1);return Math.round(255*a).toString(16).padStart(2,"0")};return`#${s(0)}${s(8)}${s(4)}`}const kn={range:XA,getPx:JA,sleep:ZA,os:eS,sys:$g,getWindowInfo:tS,random:nS,guid:iS,$parent:Mr,addStyle:sS,addUnit:rS,deepClone:Uc,deepMerge:cs,shallowMerge:di,error:oS,randomArray:aS,timeFormat:Hg,timeFrom:lS,trim:ji,queryParams:Rl,toast:cS,type2icon:uS,priceFormat:fS,getDuration:dS,padZero:hS,formValidate:pS,getProperty:gS,setProperty:mS,page:Gg,pages:xS,getValueByPath:yS,genLightColor:vS};class TS{constructor(){this.config={type:"navigateTo",url:"",delta:1,params:{},animationType:"pop-in",animationDuration:300,intercept:!1},this.route=this.route.bind(this)}addRootPath(e){return e[0]==="/"?e:`/${e}`}mixinParam(e,t){e=e&&this.addRootPath(e);let n="";return/.*\/.*\?.*=.*/.test(e)?(n=Rl(t,!1),e+=`&${n}`):(n=Rl(t),e+=n)}async route(e={},t={}){let n={};typeof e=="string"?(n.url=this.mixinParam(e,t),n.type="navigateTo"):(n=cs(this.config,e),n.url=this.mixinParam(e.url,e.params)),n.url!==Gg()&&(t.intercept&&(this.config.intercept=t.intercept),n.params=t,n=cs(this.config,n),typeof j.$u.routeIntercept=="function"?await new Promise((r,o)=>{j.$u.routeIntercept(n,r)})&&this.openPage(n):this.openPage(n))}openPage(e){const{url:t,type:n,delta:s,animationType:r,animationDuration:o}=e;(e.type=="navigateTo"||e.type=="to")&&j.navigateTo({url:t,animationType:r,animationDuration:o}),(e.type=="redirectTo"||e.type=="redirect")&&j.redirectTo({url:t}),(e.type=="switchTab"||e.type=="tab")&&j.switchTab({url:t}),(e.type=="reLaunch"||e.type=="launch")&&j.reLaunch({url:t}),(e.type=="navigateBack"||e.type=="back")&&j.navigateBack({delta:s})}}const wl=new TS().route,Kg=Bg({props:{customStyle:{type:[Object,String],default:()=>({})},customClass:{type:String,default:""},url:{type:String,default:""},linkType:{type:String,default:"navigateTo"}},data(){return{}},onLoad(){this.$u.getRect=this.$uGetRect},created(){this.$u.getRect=this.$uGetRect},computed:{$u(){return cs(j.$u,{props:void 0,http:void 0,mixin:void 0})},bem(){return function(i,e,t){const n=`u-${i}--`,s={};return e&&e.map(r=>{s[n+this[r]]=!0}),t&&t.map(r=>{this[r]?s[n+r]=this[r]:delete s[n+r]}),Object.keys(s)}}},methods:{openPage(i="url"){const e=this[i];e&&wl({type:this.linkType,url:e})},navTo(i="",e="navigateTo"){wl({type:this.linkType,url:i})},$uGetRect(i,e){return new Promise(t=>{j.createSelectorQuery().in(this)[e?"selectAll":"select"](i).boundingClientRect(n=>{e&&Array.isArray(n)&&n.length&&t(n),!e&&n&&t(n)}).exec()})},getParentData(i=""){this.parent||(this.parent={}),this.parent=Mr.call(this,i),this.parent.children&&this.parent.children.indexOf(this)===-1&&this.parent.children.push(this),this.parent&&this.parentData&&Object.keys(this.parentData).map(e=>{this.parentData[e]=this.parent[e]})},preventEvent(i){i&&typeof i.stopPropagation=="function"&&i.stopPropagation()},noop(i){this.preventEvent(i)}},onReachBottom(){j.$emit("uOnReachBottom")},beforeUnmount(){if(this.parent&&Og.array(this.parent.children)){const i=this.parent.children;i.map((e,t)=>{e===this&&i.splice(t,1)})}}}),bS=Bg({options:{virtualHost:!0}});function _S(i="rgb(0, 0, 0)",e="rgb(255, 255, 255)",t=10){const n=Dl(i,!1),s=n[0],r=n[1],o=n[2],a=Dl(e,!1),c=a[0],l=a[1],u=a[2],f=(c-s)/t,d=(l-r)/t,h=(u-o)/t,p=[];for(let m=0;m<t;m++){let g=Xi(`rgb(${Math.round(f*m+s)},${Math.round(d*m+r)},${Math.round(h*m+o)})`);m===0&&(g=Xi(i)),m===t-1&&(g=Xi(e)),p.push(g)}return p}function Dl(i,e=!0){const t=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;if(i=String(i).toLowerCase(),i&&t.test(i)){if(i.length===4){let s="#";for(let r=1;r<4;r+=1)s+=i.slice(r,r+1).concat(i.slice(r,r+1));i=s}const n=[];for(let s=1;s<7;s+=2)n.push(parseInt(`0x${i.slice(s,s+2)}`));return e?`rgb(${n[0]},${n[1]},${n[2]})`:n}return/^(rgb|RGB)/.test(i)?i.replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",").map(s=>Number(s)):i}function Xi(i){const e=i,t=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;if(/^(rgb|RGB)/.test(e)){const n=e.replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",");let s="#";for(let r=0;r<n.length;r++){let o=Number(n[r]).toString(16);o=String(o).length==1?`0${o}`:o,o==="0"&&(o+=o),s+=o}return s.length!==7&&(s=e),s}if(t.test(e)){const n=e.replace(/#/,"").split("");if(n.length===6)return e;if(n.length===3){let s="#";for(let r=0;r<n.length;r+=1)s+=n[r]+n[r];return s}}else return e}function IS(i,e){i=Xi(i);const t=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;let n=String(i).toLowerCase();if(n&&t.test(n)){if(n.length===4){let r="#";for(let o=1;o<4;o+=1)r+=n.slice(o,o+1).concat(n.slice(o,o+1));n=r}const s=[];for(let r=1;r<7;r+=2)s.push(parseInt(`0x${n.slice(r,r+2)}`));return`rgba(${s.join(",")},${e})`}return n}const Gs={colorGradient:_S,hexToRgb:Dl,rgbToHex:Xi,colorToRgba:IS};let ii=null;function CS(i,e=500,t=!1){if(ii!==null&&clearTimeout(ii),t){const n=!ii;ii=setTimeout(()=>{ii=null},e),n&&typeof i=="function"&&i()}else ii=setTimeout(()=>{typeof i=="function"&&i()},e)}let si;function LS(i,e=500,t=!0){t?si||(si=!0,typeof i=="function"&&i(),setTimeout(()=>{si=!1},e)):si||(si=!0,setTimeout(()=>{si=!1,typeof i=="function"&&i()},e))}function RS(i,e){var t,n,s;try{t=i.toString().split(".")[1].length}catch{t=0}try{n=e.toString().split(".")[1].length}catch{n=0}return s=Math.pow(10,Math.max(t,n)),(i*s+e*s)/s}function wS(i,e){var t,n,s,r;try{t=i.toString().split(".")[1].length}catch{t=0}try{n=e.toString().split(".")[1].length}catch{n=0}return s=Math.pow(10,Math.max(t,n)),r=t>=n?t:n,Math.abs(((i*s-e*s)/s).toFixed(r))}function DS(i,e){var t=0,n=i.toString(),s=e.toString();try{t+=n.split(".")[1].length}catch{}try{t+=s.split(".")[1].length}catch{}return Number(n.replace(".",""))*Number(s.replace(".",""))/Math.pow(10,t)}function PS(i,e){var t,n,s=0,r=0;try{s=i.toString().split(".")[1].length}catch{}try{r=e.toString().split(".")[1].length}catch{}return t=Number(i.toString().replace(".","")),n=Number(e.toString().replace(".","")),xyutil.mul(t/n,Math.pow(10,r-s))}const kS={add:RS,sub:wS,mul:DS,div:PS},$c={toast:10090,noNetwork:10080,popup:10075,mask:10070,navbar:980,topTips:975,sticky:970,indexListSticky:965},fo={primary:"#3c9cff",info:"#909399",default:"#909399",warning:"#f9ae3d",error:"#f56c6c",success:"#5ac725",mainColor:"#303133",contentColor:"#606266",tipsColor:"#909399",lightColor:"#c0c4cc",borderColor:"#e4e7ed"},{toString:Vg}=Object.prototype;function jg(i){return Vg.call(i)==="[object Array]"}function BS(i){return i!==null&&typeof i=="object"}function FS(i){return Vg.call(i)==="[object Date]"}function OS(i){return typeof URLSearchParams<"u"&&i instanceof URLSearchParams}function Pl(i,e){if(!(i===null||typeof i>"u"))if(typeof i!="object"&&(i=[i]),jg(i))for(let t=0,n=i.length;t<n;t++)e.call(null,i[t],t,i);else for(const t in i)Object.prototype.hasOwnProperty.call(i,t)&&e.call(null,i[t],t,i)}function MS(i){return Object.prototype.toString.call(i)==="[object Object]"}function kl(){const i={};function e(t,n){typeof i[n]=="object"&&typeof t=="object"?i[n]=kl(i[n],t):typeof t=="object"?i[n]=kl({},t):i[n]=t}for(let t=0,n=arguments.length;t<n;t++)Pl(arguments[t],e);return i}function Nr(i){return typeof i>"u"}function Bf(i){return encodeURIComponent(i).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function NS(i,e){if(!e)return i;let t;if(OS(e))t=e.toString();else{const n=[];Pl(e,(s,r)=>{s===null||typeof s>"u"||(jg(s)?r=`${r}[]`:s=[s],Pl(s,o=>{FS(o)?o=o.toISOString():BS(o)&&(o=JSON.stringify(o)),n.push(`${Bf(r)}=${Bf(o)}`)}))}),t=n.join("&")}if(t){const n=i.indexOf("#");n!==-1&&(i=i.slice(0,n)),i+=(i.indexOf("?")===-1?"?":"&")+t}return i}function US(i){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(i)}function $S(i,e){return e?`${i.replace(/\/+$/,"")}/${e.replace(/^\/+/,"")}`:i}function HS(i,e){return i&&!US(e)?$S(i,e):e}function GS(i,e,t){const{validateStatus:n}=t.config,s=t.statusCode;s&&(!n||n(s))?i(t):e(t)}const Ff=(i,e)=>{const t={};return i.forEach(n=>{Nr(e[n])||(t[n]=e[n])}),t},KS=i=>new Promise((e,t)=>{const n=NS(HS(i.baseURL,i.url),i.params),s={url:n,header:i.header,complete:o=>{i.fullPath=n,o.config=i;try{typeof o.data=="string"&&(o.data=JSON.parse(o.data))}catch{}GS(e,t,o)}};let r;if(i.method==="UPLOAD"){delete s.header["content-type"],delete s.header["Content-Type"];const o={filePath:i.filePath,name:i.name},a=["formData"];r=j.uploadFile({...s,...o,...Ff(a,i)})}else if(i.method==="DOWNLOAD")r=j.downloadFile(s);else{const o=["data","method","timeout","dataType","responseType"];r=j.request({...s,...Ff(o,i)})}i.getTask&&i.getTask(r,i)}),VS=i=>KS(i);function us(){this.handlers=[]}us.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1};us.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)};us.prototype.forEach=function(e){this.handlers.forEach(t=>{t!==null&&e(t)})};const Of=(i,e,t)=>{const n={};return i.forEach(s=>{Nr(t[s])?Nr(e[s])||(n[s]=e[s]):n[s]=t[s]}),n},jS=(i,e={})=>{const t=e.method||i.method||"GET";let n={baseURL:i.baseURL||"",method:t,url:e.url||"",params:e.params||{},custom:{...i.custom||{},...e.custom||{}},header:kl(i.header||{},e.header||{})};return n={...n,...Of(["getTask","validateStatus"],i,e)},t==="DOWNLOAD"||(t==="UPLOAD"?(delete n.header["content-type"],delete n.header["Content-Type"],["filePath","name","formData"].forEach(o=>{Nr(e[o])||(n[o]=e[o])})):n={...n,...Of(["data","timeout","dataType","responseType"],i,e)}),n},qS={baseURL:"",header:{},method:"GET",dataType:"json",responseType:"text",custom:{},timeout:6e4,validateStatus:function(e){return e>=200&&e<300}};var WS=function(){function i(u,f){return f!=null&&u instanceof f}var e;try{e=Map}catch{e=function(){}}var t;try{t=Set}catch{t=function(){}}var n;try{n=Promise}catch{n=function(){}}function s(u,f,d,h,p){typeof f=="object"&&(d=f.depth,h=f.prototype,p=f.includeNonEnumerable,f=f.circular);var m=[],g=[],y=typeof Buffer<"u";typeof f>"u"&&(f=!0),typeof d>"u"&&(d=1/0);function v(x,E){if(x===null)return null;if(E===0)return x;var S,T;if(typeof x!="object")return x;if(i(x,e))S=new e;else if(i(x,t))S=new t;else if(i(x,n))S=new n(function(O,K){x.then(function(B){O(v(B,E-1))},function(B){K(v(B,E-1))})});else if(s.__isArray(x))S=[];else if(s.__isRegExp(x))S=new RegExp(x.source,l(x)),x.lastIndex&&(S.lastIndex=x.lastIndex);else if(s.__isDate(x))S=new Date(x.getTime());else{if(y&&Buffer.isBuffer(x))return Buffer.from?S=Buffer.from(x):(S=new Buffer(x.length),x.copy(S)),S;i(x,Error)?S=Object.create(x):typeof h>"u"?(T=Object.getPrototypeOf(x),S=Object.create(T)):(S=Object.create(h),T=h)}if(f){var _=m.indexOf(x);if(_!=-1)return g[_];m.push(x),g.push(S)}i(x,e)&&x.forEach(function(O,K){var B=v(K,E-1),G=v(O,E-1);S.set(B,G)}),i(x,t)&&x.forEach(function(O){var K=v(O,E-1);S.add(K)});for(var I in x){var w=Object.getOwnPropertyDescriptor(x,I);w&&(S[I]=v(x[I],E-1));try{var b=Object.getOwnPropertyDescriptor(x,I);if(b.set==="undefined")continue;S[I]=v(x[I],E-1)}catch(O){if(O instanceof TypeError)continue;if(O instanceof ReferenceError)continue}}if(Object.getOwnPropertySymbols)for(var L=Object.getOwnPropertySymbols(x),I=0;I<L.length;I++){var k=L[I],M=Object.getOwnPropertyDescriptor(x,k);M&&!M.enumerable&&!p||(S[k]=v(x[k],E-1),Object.defineProperty(S,k,M))}if(p)for(var N=Object.getOwnPropertyNames(x),I=0;I<N.length;I++){var F=N[I],M=Object.getOwnPropertyDescriptor(x,F);M&&M.enumerable||(S[F]=v(x[F],E-1),Object.defineProperty(S,F,M))}return S}return v(u,d)}s.clonePrototype=function(f){if(f===null)return null;var d=function(){};return d.prototype=f,new d};function r(u){return Object.prototype.toString.call(u)}s.__objToStr=r;function o(u){return typeof u=="object"&&r(u)==="[object Date]"}s.__isDate=o;function a(u){return typeof u=="object"&&r(u)==="[object Array]"}s.__isArray=a;function c(u){return typeof u=="object"&&r(u)==="[object RegExp]"}s.__isRegExp=c;function l(u){var f="";return u.global&&(f+="g"),u.ignoreCase&&(f+="i"),u.multiline&&(f+="m"),f}return s.__getRegExpFlags=l,s}();class zS{constructor(e={}){MS(e)||(e={},j.__f__("warn","at node_modules/uview-plus/libs/luch-request/core/Request.js:40","设置全局参数必须接收一个Object")),this.config=WS({...qS,...e}),this.interceptors={request:new us,response:new us}}setConfig(e){this.config=e(this.config)}middleware(e){e=jS(this.config,e);const t=[VS,void 0];let n=Promise.resolve(e);for(this.interceptors.request.forEach(s=>{t.unshift(s.fulfilled,s.rejected)}),this.interceptors.response.forEach(s=>{t.push(s.fulfilled,s.rejected)});t.length;)n=n.then(t.shift(),t.shift());return n}request(e={}){return this.middleware(e)}get(e,t={}){return this.middleware({url:e,method:"GET",...t})}post(e,t,n={}){return this.middleware({url:e,data:t,method:"POST",...n})}put(e,t,n={}){return this.middleware({url:e,data:t,method:"PUT",...n})}delete(e,t,n={}){return this.middleware({url:e,data:t,method:"DELETE",...n})}connect(e,t,n={}){return this.middleware({url:e,data:t,method:"CONNECT",...n})}head(e,t,n={}){return this.middleware({url:e,data:t,method:"HEAD",...n})}options(e,t,n={}){return this.middleware({url:e,data:t,method:"OPTIONS",...n})}trace(e,t,n={}){return this.middleware({url:e,data:t,method:"TRACE",...n})}upload(e,t={}){return t.url=e,t.method="UPLOAD",this.middleware(t)}download(e,t={}){return t.url=e,t.method="DOWNLOAD",this.middleware(t)}}const Hc=new zS,QS={actionSheet:{show:!1,title:"",description:"",actions:[],index:"",cancelText:"",closeOnClickAction:!0,safeAreaInsetBottom:!0,openType:"",closeOnClickOverlay:!0,round:0,wrapMaxHeight:"600px"}},YS={album:{urls:[],keyName:"",singleSize:180,multipleSize:70,space:6,singleMode:"scaleToFill",multipleMode:"aspectFill",maxCount:9,previewFullImage:!0,rowCount:3,showMore:!0,autoWrap:!1,unit:"px",stop:!0}},XS={alert:{title:"",type:"warning",description:"",closable:!1,showIcon:!1,effect:"light",center:!1,fontSize:14,transitionMode:"fade",duration:0,icon:"",value:!0}},JS={avatar:{src:"",shape:"circle",size:40,mode:"scaleToFill",text:"",bgColor:"#c0c4cc",color:"#ffffff",fontSize:18,icon:"",mpAvatar:!1,randomBgColor:!1,defaultUrl:"",colorIndex:"",name:""}},ZS={avatarGroup:{urls:[],maxCount:5,shape:"circle",mode:"scaleToFill",showMore:!0,size:40,keyName:"",gap:.5,extraValue:0}},e8={backtop:{mode:"circle",icon:"arrow-upward",text:"",duration:100,scrollTop:0,top:400,bottom:100,right:20,zIndex:9,iconStyle:{color:"#909399",fontSize:"19px"}}},t8={badge:{isDot:!1,value:"",show:!0,max:999,type:"error",showZero:!1,bgColor:null,color:null,shape:"circle",numberType:"overflow",offset:[],inverted:!1,absolute:!1}},n8={button:{hairline:!1,type:"info",size:"normal",shape:"square",plain:!1,disabled:!1,loading:!1,loadingText:"",loadingMode:"spinner",loadingSize:15,openType:"",formType:"",appParameter:"",hoverStopPropagation:!0,lang:"en",sessionFrom:"",sendMessageTitle:"",sendMessagePath:"",sendMessageImg:"",showMessageCard:!1,dataName:"",throttleTime:0,hoverStartTime:0,hoverStayTime:200,text:"",icon:"",iconColor:"",color:"",stop:!0}},i8={"up.common.cancel":"取消","up.common.confirm":"确定","up.common.start":"开始","up.common.end":"结束","up.common.stop":"停止","up.common.copy":"复制","up.common.none":"暂无","up.common.tip":"提示","up.common.success":"成功","up.common.fail":"失败","up.common.close":"关闭","up.common.preview":"预览","up.common.re-select":"重选","up.common.rotate":"旋转","up.common.pleaseChoose":"请选择","up.common.loading":"加载中","up.common.loading2":"正在加载","up.common.inOperation":"操作中","up.common.settings":"设置","up.common.retry":"重试","up.common.search":"搜索","up.common.more":"更多","up.common.video":"视频","up.common.file":"文件","up.week.one":"一","up.week.two":"二","up.week.three":"三","up.week.four":"四","up.week.five":"五","up.week.six":"六","up.week.seven":"日","up.barcode.error":"生成条码失败","up.calendar.chooseDates":"日期选择","up.calendar.disabled":"该日期已禁用","up.calendar.daysExceed":"选择天数不能超过{days}天","up.cityLocate.locateCity":"定位城市","up.cityLocate.fail":"定位失败,请点击重试。","up.cityLocate.locating":"定位中","up.code.send":"获取验证码","up.code.resendAfter":"X秒重新获取","up.code.resend":"重新获取","up.cropper.emptyWidhtOrHeight":"裁剪框的宽或高没有设置","up.empty.car":"购物车为空","up.empty.page":"页面不存在","up.empty.search":"没有搜索结果","up.empty.address":"没有收货地址","up.empty.wifi":"没有WiFi","up.empty.order":"订单为空","up.empty.coupon":"没有优惠券","up.empty.favor":"暂无收藏","up.empty.permission":"无权限","up.empty.history":"无历史记录","up.empty.news":"无新闻列表","up.empty.message":"消息列表为空","up.empty.list":"列表为空","up.empty.data":"数据为空","up.empty.comment":"暂无评论","up.link.copyed":"链接已复制,请在浏览器打开","up.loadmoe.loadmore":"加载更多","up.loadmoe.nomore":"没有更多了","up.noNetwork.text":"哎呀,网络信号丢失","up.noNetwork.pleaseCheck":"请检查网络,或前往","up.noNetwork.connect":"网络已连接","up.noNetwork.disconnect":"无网络连接","up.pagination.previous":"上一页","up.pagination.next":"下一页","up.pullRefresh.pull":"下拉刷新","up.pullRefresh.release":"释放刷新","up.pullRefresh.refreshing":"正在刷新","up.readMore.expand":"展开阅读全文","up.readMore.fold":"收起","up.search.placeholder":"请输入关键字","up.signature.penSize":"笔画大小","up.signature.penColor":"笔画颜色","up.upload.sizeExceed":"超过大小限制","up.upload.uploading":"上传中","up.upload.previewImageFail":"预览图片失败","up.upload.previewVideoFail":"预览视频失败"},s8={"up.common.cancel":"取消","up.common.confirm":"确定","up.common.start":"開始","up.common.end":"結束","up.common.stop":"停止","up.common.copy":"複製","up.common.none":"暫無","up.common.tip":"提示","up.common.success":"成功","up.common.fail":"失敗","up.common.close":"關閉","up.common.preview":"預覽","up.common.re-select":"重選","up.common.rotate":"旋轉","up.common.pleaseChoose":"請選擇","up.common.loading":"加載中","up.common.loading2":"正在加載","up.common.inOperation":"操作中","up.common.settings":"設置","up.common.retry":"重試","up.common.search":"搜索","up.common.more":"更多","up.common.video":"視頻","up.common.file":"文件","up.week.one":"一","up.week.two":"二","up.week.three":"三","up.week.four":"四","up.week.five":"五","up.week.six":"六","up.week.seven":"日","up.barcode.error":"生成條碼失敗","up.calendar.chooseDates":"日期選擇","up.calendar.disabled":"該日期已禁用","up.calendar.daysExceed":"選擇天數不能超過{days}天","up.cityLocate.locateCity":"定位城市","up.cityLocate.fail":"定位失敗,請點擊重試。","up.cityLocate.locating":"定位中","up.code.send":"獲取驗證碼","up.code.resendAfter":"X秒重新獲取","up.code.resend":"重新獲取","up.cropper.emptyWidhtOrHeight":"裁剪框的寬或高沒有設置","up.empty.car":"購物車為空","up.empty.page":"頁面不存在","up.empty.search":"沒有搜索結果","up.empty.address":"沒有收貨地址","up.empty.wifi":"沒有WiFi","up.empty.order":"訂單為空","up.empty.coupon":"沒有優惠券","up.empty.favor":"暫無收藏","up.empty.permission":"無權限","up.empty.history":"無歷史記錄","up.empty.news":"無新聞列表","up.empty.message":"消息列表為空","up.empty.list":"列表為空","up.empty.data":"數據為空","up.empty.comment":"暫無評論","up.link.copyed":"鏈接已複製,請在瀏覽器打開","up.loadmoe.loadmore":"加載更多","up.loadmoe.nomore":"沒有更多了","up.noNetwork.text":"哎呀,網絡信號丟失","up.noNetwork.pleaseCheck":"請檢查網絡,或前往","up.noNetwork.connect":"網絡已連接","up.noNetwork.disconnect":"無網絡連接","up.pagination.previous":"上一頁","up.pagination.next":"下一頁","up.pullRefresh.pull":"下拉刷新","up.pullRefresh.release":"釋放刷新","up.pullRefresh.refreshing":"正在刷新","up.readMore.expand":"展開閱讀全文","up.readMore.fold":"收起","up.search.placeholder":"請輸入關鍵字","up.signature.penSize":"筆畫大小","up.signature.penColor":"筆畫顏色","up.upload.sizeExceed":"超過大小限制","up.upload.uploading":"上傳中","up.upload.previewImageFail":"預覽圖片失敗","up.upload.previewVideoFail":"預覽視頻失敗"},r8={"up.common.cancel":"Cancel","up.common.confirm":"Confirm","up.common.start":"Start","up.common.end":"End","up.common.stop":"Stop","up.common.copy":"Copy","up.common.none":"None","up.common.tip":"Tip","up.common.success":"Success","up.common.fail":"Fail","up.common.close":"Close","up.common.preview":"Preview","up.common.re-select":"Re-select","up.common.rotate":"Rotate","up.common.pleaseChoose":"Please choose","up.common.loading":"Loading","up.common.loading2":"Loading","up.common.inOperation":"In operation","up.common.settings":"Settings","up.common.retry":"Retry","up.common.search":"Search","up.common.more":"More","up.common.video":"Video","up.common.file":"File","up.week.one":"Mon","up.week.two":"Tue","up.week.three":"Wed","up.week.four":"Thu","up.week.five":"Fri","up.week.six":"Sat","up.week.seven":"Sun","up.barcode.error":"Failed to generate barcode","up.calendar.chooseDates":"Date selection","up.calendar.disabled":"This date is disabled","up.calendar.daysExceed":"The number of selected days cannot exceed {days} days","up.cityLocate.locateCity":"Locate city","up.cityLocate.fail":"Location failed, please click to retry.","up.cityLocate.locating":"Locating","up.code.send":"Get verification code","up.code.resendAfter":"Resend after X seconds","up.code.resend":"Resend","up.cropper.emptyWidhtOrHeight":"The width or height of the cropping box is not set","up.empty.car":"Shopping cart is empty","up.empty.page":"Page not found","up.empty.search":"No search results","up.empty.address":"No shipping address","up.empty.wifi":"No WiFi","up.empty.order":"Order is empty","up.empty.coupon":"No coupons","up.empty.favor":"No favorites","up.empty.permission":"No permission","up.empty.history":"No history","up.empty.news":"No news list","up.empty.message":"Message list is empty","up.empty.list":"List is empty","up.empty.data":"Data is empty","up.empty.comment":"No comments","up.link.copyed":"Link copied, please open in browser","up.loadmoe.loadmore":"Load more","up.loadmoe.nomore":"No more","up.noNetwork.text":"Oops, network signal lost","up.noNetwork.pleaseCheck":"Please check the network, or go to","up.noNetwork.connect":"Network connected","up.noNetwork.disconnect":"No network connection","up.pagination.previous":"Previous","up.pagination.next":"Next","up.pullRefresh.pull":"Pull to refresh","up.pullRefresh.release":"Release to refresh","up.pullRefresh.refreshing":"Refreshing","up.readMore.expand":"Expand to read more","up.readMore.fold":"Collapse","up.search.placeholder":"Please enter keywords","up.signature.penSize":"Stroke size","up.signature.penColor":"Stroke color","up.upload.sizeExceed":"Size limit exceeded","up.upload.uploading":"Uploading","up.upload.previewImageFail":"Failed to preview image","up.upload.previewVideoFail":"Failed to preview video"},o8={"up.common.cancel":"Cancelar","up.common.confirm":"Confirmar","up.common.start":"Iniciar","up.common.end":"Finalizar","up.common.stop":"Detener","up.common.copy":"Copiar","up.common.none":"Ninguno","up.common.tip":"Consejo","up.common.success":"Éxito","up.common.fail":"Fallido","up.common.close":"Cerrar","up.common.preview":"Vista previa","up.common.re-select":"Re seleccionar","up.common.rotate":"Rotar","up.common.pleaseChoose":"Por favor seleccione","up.common.loading":"Cargando","up.common.loading2":"Cargando","up.common.inOperation":"En operación","up.common.settings":"Configuración","up.common.retry":"Reintentar","up.common.search":"Buscar","up.common.more":"Más","up.common.video":"Vídeo","up.common.file":"Archivo","up.week.one":"Lun","up.week.two":"Mar","up.week.three":"Mié","up.week.four":"Jue","up.week.five":"Vie","up.week.six":"Sáb","up.week.seven":"Dom","up.barcode.error":"Error al generar código de barras","up.calendar.chooseDates":"Selección de fecha","up.calendar.disabled":"Esta fecha está deshabilitada","up.calendar.daysExceed":"Los días seleccionados no pueden exceder {days} días","up.cityLocate.locateCity":"Localizar ciudad","up.cityLocate.fail":"Error de localización, haga clic para reintentar.","up.cityLocate.locating":"Localizando","up.code.send":"Obtener código de verificación","up.code.resendAfter":"Reenviar en X segundos","up.code.resend":"Reenviar","up.cropper.emptyWidhtOrHeight":"El ancho o alto del recorte no está configurado","up.empty.car":"Carrito de compras vacío","up.empty.page":"Página no encontrada","up.empty.search":"Sin resultados de búsqueda","up.empty.address":"Sin dirección de envío","up.empty.wifi":"Sin WiFi","up.empty.order":"Pedido vacío","up.empty.coupon":"Sin cupones","up.empty.favor":"Sin favoritos","up.empty.permission":"Sin permisos","up.empty.history":"Sin historial","up.empty.news":"Sin noticias","up.empty.message":"Lista de mensajes vacía","up.empty.list":"Lista vacía","up.empty.data":"Datos vacíos","up.empty.comment":"Sin comentarios","up.link.copyed":"Enlace copiado, por favor abra en el navegador","up.loadmoe.loadmore":"Cargar más","up.loadmoe.nomore":"No hay más","up.noNetwork.text":"¡Ups! Se perdió la señal de red","up.noNetwork.pleaseCheck":"Por favor verifique la red, o vaya a","up.noNetwork.connect":"Red conectada","up.noNetwork.disconnect":"Sin conexión a internet","up.pagination.previous":"Página anterior","up.pagination.next":"Página siguiente","up.pullRefresh.pull":"Deslizar hacia abajo para actualizar","up.pullRefresh.release":"Soltar para actualizar","up.pullRefresh.refreshing":"Actualizando","up.readMore.expand":"Expandir para leer más","up.readMore.fold":"Contraer","up.search.placeholder":"Ingrese palabra clave","up.signature.penSize":"Tamaño del trazo","up.signature.penColor":"Color del trazo","up.upload.sizeExceed":"Excede el límite de tamaño","up.upload.uploading":"Subiendo","up.upload.previewImageFail":"Error al previsualizar imagen","up.upload.previewVideoFail":"Error al previsualizar vídeo"},a8={"up.common.cancel":"Annuler","up.common.confirm":"Confirmer","up.common.start":"Démarrer","up.common.end":"Terminer","up.common.stop":"Arrêter","up.common.copy":"Copier","up.common.none":"Aucun","up.common.tip":"Conseil","up.common.success":"Succès","up.common.fail":"Échec","up.common.close":"Fermer","up.common.preview":"Aperçu","up.common.re-select":"Resélectionner","up.common.rotate":"Rotation","up.common.pleaseChoose":"Veuillez choisir","up.common.loading":"Chargement","up.common.loading2":"Chargement en cours","up.common.inOperation":"En cours d'opération","up.common.settings":"Paramètres","up.common.retry":"Réessayer","up.common.search":"Rechercher","up.common.more":"Plus","up.common.video":"Vidéo","up.common.file":"Fichier","up.week.one":"Lun","up.week.two":"Mar","up.week.three":"Mer","up.week.four":"Jeu","up.week.five":"Ven","up.week.six":"Sam","up.week.seven":"Dim","up.barcode.error":"Échec de génération du code-barres","up.calendar.chooseDates":"Sélection de dates","up.calendar.disabled":"Cette date est désactivée","up.calendar.daysExceed":"Le nombre de jours sélectionnés ne peut pas dépasser {days} jours","up.cityLocate.locateCity":"Localiser la ville","up.cityLocate.fail":"Échec de localisation, veuillez cliquer pour réessayer.","up.cityLocate.locating":"Localisation en cours","up.code.send":"Obtenir le code de vérification","up.code.resendAfter":"Renvoyer dans X secondes","up.code.resend":"Renvoyer","up.cropper.emptyWidhtOrHeight":"La largeur ou la hauteur de recadrage n'est pas définie","up.empty.car":"Panier vide","up.empty.page":"Page introuvable","up.empty.search":"Aucun résultat de recherche","up.empty.address":"Aucune adresse de livraison","up.empty.wifi":"Aucun Wi-Fi","up.empty.order":"Commande vide","up.empty.coupon":"Aucun coupon","up.empty.favor":"Aucun favori","up.empty.permission":"Aucune autorisation","up.empty.history":"Aucun historique","up.empty.news":"Aucune actualité","up.empty.message":"Liste de messages vide","up.empty.list":"Liste vide","up.empty.data":"Données vides","up.empty.comment":"Aucun commentaire","up.link.copyed":"Lien copié, veuillez ouvrir dans le navigateur","up.loadmoe.loadmore":"Charger plus","up.loadmoe.nomore":"Plus de contenu","up.noNetwork.text":"Oups, le signal réseau est perdu","up.noNetwork.pleaseCheck":"Veuillez vérifier le réseau, ou aller à","up.noNetwork.connect":"Réseau connecté","up.noNetwork.disconnect":"Aucune connexion réseau","up.pagination.previous":"Page précédente","up.pagination.next":"Page suivante","up.pullRefresh.pull":"Tirer pour actualiser","up.pullRefresh.release":"Relâcher pour actualiser","up.pullRefresh.refreshing":"Actualisation en cours","up.readMore.expand":"Développer pour lire la suite","up.readMore.fold":"Réduire","up.search.placeholder":"Veuillez saisir un mot-clé","up.signature.penSize":"Taille du trait","up.signature.penColor":"Couleur du trait","up.upload.sizeExceed":"Dépassement de la limite de taille","up.upload.uploading":"Téléchargement en cours","up.upload.previewImageFail":"Échec de l'aperçu de l'image","up.upload.previewVideoFail":"Échec de l'aperçu de la vidéo"},l8={"up.common.cancel":"Abbrechen","up.common.confirm":"Bestätigen","up.common.start":"Start","up.common.end":"Ende","up.common.stop":"Stopp","up.common.copy":"Kopieren","up.common.none":"Keine","up.common.tip":"Hinweis","up.common.success":"Erfolg","up.common.fail":"Fehlgeschlagen","up.common.close":"Schließen","up.common.preview":"Vorschau","up.common.re-select":"Erneut auswählen","up.common.rotate":"Drehen","up.common.pleaseChoose":"Bitte wählen","up.common.loading":"Laden","up.common.loading2":"Wird geladen","up.common.inOperation":"In Bearbeitung","up.common.settings":"Einstellungen","up.common.retry":"Wiederholen","up.common.search":"Suchen","up.common.more":"Mehr","up.common.video":"Video","up.common.file":"Datei","up.week.one":"Mo","up.week.two":"Di","up.week.three":"Mi","up.week.four":"Do","up.week.five":"Fr","up.week.six":"Sa","up.week.seven":"So","up.barcode.error":"Barcode-Generierung fehlgeschlagen","up.calendar.chooseDates":"Datumsauswahl","up.calendar.disabled":"Dieses Datum ist deaktiviert","up.calendar.daysExceed":"Die Anzahl der ausgewählten Tage darf {days} Tage nicht überschreiten","up.cityLocate.locateCity":"Stadt lokalisieren","up.cityLocate.fail":"Lokalisierung fehlgeschlagen, bitte klicken Sie zum Wiederholen.","up.cityLocate.locating":"Lokalisierung läuft","up.code.send":"Bestätigungscode erhalten","up.code.resendAfter":"Erneut senden in X Sekunden","up.code.resend":"Erneut senden","up.cropper.emptyWidhtOrHeight":"Breite oder Höhe des Zuschneidebereichs nicht festgelegt","up.empty.car":"Warenkorb ist leer","up.empty.page":"Seite existiert nicht","up.empty.search":"Keine Suchergebnisse","up.empty.address":"Keine Lieferadresse","up.empty.wifi":"Kein WLAN","up.empty.order":"Bestellungen sind leer","up.empty.coupon":"Keine Gutscheine","up.empty.favor":"Keine Favoriten","up.empty.permission":"Keine Berechtigung","up.empty.history":"Kein Verlauf","up.empty.news":"Keine Nachrichtenliste","up.empty.message":"Nachrichtenliste ist leer","up.empty.list":"Liste ist leer","up.empty.data":"Daten sind leer","up.empty.comment":"Keine Kommentare","up.link.copyed":"Link kopiert, bitte im Browser öffnen","up.loadmoe.loadmore":"Mehr laden","up.loadmoe.nomore":"Keine weiteren Daten","up.noNetwork.text":"Ups, Netzwerksignal verloren","up.noNetwork.pleaseCheck":"Bitte überprüfen Sie das Netzwerk oder gehen Sie zu","up.noNetwork.connect":"Netzwerk verbunden","up.noNetwork.disconnect":"Keine Netzwerkverbindung","up.pagination.previous":"Vorherige Seite","up.pagination.next":"Nächste Seite","up.pullRefresh.pull":"Zum Aktualisieren nach unten ziehen","up.pullRefresh.release":"Loslassen zum Aktualisieren","up.pullRefresh.refreshing":"Aktualisierung läuft","up.readMore.expand":"Erweitern zum vollständigen Lesen","up.readMore.fold":"Einklappen","up.search.placeholder":"Bitte Schlüsselwort eingeben","up.signature.penSize":"Strichstärke","up.signature.penColor":"Strichfarbe","up.upload.sizeExceed":"Größenbegrenzung überschritten","up.upload.uploading":"Upload läuft","up.upload.previewImageFail":"Bildvorschau fehlgeschlagen","up.upload.previewVideoFail":"Videovorschau fehlgeschlagen"},c8={"up.common.cancel":"취소","up.common.confirm":"확인","up.common.start":"시작","up.common.end":"종료","up.common.stop":"정지","up.common.copy":"복사","up.common.none":"없음","up.common.tip":"팁","up.common.success":"성공","up.common.fail":"실패","up.common.close":"닫기","up.common.preview":"미리보기","up.common.re-select":"재선택","up.common.rotate":"회전","up.common.pleaseChoose":"선택해주세요","up.common.loading":"로딩중","up.common.loading2":"로딩중","up.common.inOperation":"작업중","up.common.settings":"설정","up.common.retry":"재시도","up.common.search":"검색","up.common.more":"더보기","up.common.video":"비디오","up.common.file":"파일","up.week.one":"월","up.week.two":"화","up.week.three":"수","up.week.four":"목","up.week.five":"금","up.week.six":"토","up.week.seven":"일","up.barcode.error":"바코드 생성 실패","up.calendar.chooseDates":"날짜 선택","up.calendar.disabled":"해당 날짜는 사용할 수 없습니다","up.calendar.daysExceed":"선택한 날짜 수가 {days}일을 초과할 수 없습니다","up.cityLocate.locateCity":"도시 위치 찾기","up.cityLocate.fail":"위치 찾기 실패, 다시 시도하려면 클릭하세요.","up.cityLocate.locating":"위치 찾는 중","up.code.send":"인증코드 받기","up.code.resendAfter":"X초 후 재전송","up.code.resend":"재전송","up.cropper.emptyWidhtOrHeight":"자르기 영역의 너비 또는 높이가 설정되지 않았습니다","up.empty.car":"장바구니가 비어 있습니다","up.empty.page":"페이지가 존재하지 않습니다","up.empty.search":"검색 결과가 없습니다","up.empty.address":"배송 주소가 없습니다","up.empty.wifi":"Wi-Fi가 없습니다","up.empty.order":"주문이 없습니다","up.empty.coupon":"쿠폰이 없습니다","up.empty.favor":"즐겨찾기가 없습니다","up.empty.permission":"권한이 없습니다","up.empty.history":"기록이 없습니다","up.empty.news":"뉴스가 없습니다","up.empty.message":"메시지가 없습니다","up.empty.list":"목록이 비어 있습니다","up.empty.data":"데이터가 없습니다","up.empty.comment":"댓글이 없습니다","up.link.copyed":"링크가 복사되었습니다. 브라우저에서 열어주세요","up.loadmoe.loadmore":"더 불러오기","up.loadmoe.nomore":"더 이상 데이터가 없습니다","up.noNetwork.text":"네트워크 신호가 없습니다","up.noNetwork.pleaseCheck":"네트워크를 확인하거나 이동하세요","up.noNetwork.connect":"네트워크 연결됨","up.noNetwork.disconnect":"네트워크 연결 끊김","up.pagination.previous":"이전 페이지","up.pagination.next":"다음 페이지","up.pullRefresh.pull":"당겨서 새로고침","up.pullRefresh.release":"놓아서 새로고침","up.pullRefresh.refreshing":"새로고침 중","up.readMore.expand":"펼쳐서 전체 보기","up.readMore.fold":"접기","up.search.placeholder":"키워드를 입력하세요","up.signature.penSize":"선 굵기","up.signature.penColor":"선 색상","up.upload.sizeExceed":"용량 제한 초과","up.upload.uploading":"업로드 중","up.upload.previewImageFail":"이미지 미리보기 실패","up.upload.previewVideoFail":"비디오 미리보기 실패"},u8={"up.common.cancel":"キャンセル","up.common.confirm":"確認","up.common.start":"開始","up.common.end":"終了","up.common.stop":"停止","up.common.copy":"コピー","up.common.none":"なし","up.common.tip":"ヒント","up.common.success":"成功","up.common.fail":"失敗","up.common.close":"閉じる","up.common.preview":"プレビュー","up.common.re-select":"再選択","up.common.rotate":"回転","up.common.pleaseChoose":"選択してください","up.common.loading":"読み込み中","up.common.loading2":"読み込み中","up.common.inOperation":"操作中","up.common.settings":"設定","up.common.retry":"再試行","up.common.search":"検索","up.common.more":"もっと見る","up.common.video":"ビデオ","up.common.file":"ファイル","up.week.one":"月","up.week.two":"火","up.week.three":"水","up.week.four":"木","up.week.five":"金","up.week.six":"土","up.week.seven":"日","up.barcode.error":"バーコードの生成に失敗しました","up.calendar.chooseDates":"日付選択","up.calendar.disabled":"この日付は無効です","up.calendar.daysExceed":"選択日数は{days}日を超えることはできません","up.cityLocate.locateCity":"都市の位置を特定","up.cityLocate.fail":"位置特定に失敗しました。再試行するにはクリックしてください。","up.cityLocate.locating":"位置特定中","up.code.send":"認証コードを取得","up.code.resendAfter":"X秒後に再送信","up.code.resend":"再送信","up.cropper.emptyWidhtOrHeight":"切り抜き枠の幅または高さが設定されていません","up.empty.car":"ショッピングカートは空です","up.empty.page":"ページが存在しません","up.empty.search":"検索結果がありません","up.empty.address":"配送先住所がありません","up.empty.wifi":"Wi-Fiがありません","up.empty.order":"注文がありません","up.empty.coupon":"クーポンがありません","up.empty.favor":"お気に入りがありません","up.empty.permission":"権限がありません","up.empty.history":"履歴がありません","up.empty.news":"ニュースがありません","up.empty.message":"メッセージがありません","up.empty.list":"リストが空です","up.empty.data":"データがありません","up.empty.comment":"コメントがありません","up.link.copyed":"リンクがコピーされました。ブラウザで開いてください","up.loadmoe.loadmore":"さらに読み込む","up.loadmoe.nomore":"これ以上データがありません","up.noNetwork.text":"ネットワーク信号が失われました","up.noNetwork.pleaseCheck":"ネットワークを確認するか、移動してください","up.noNetwork.connect":"ネットワーク接続済み","up.noNetwork.disconnect":"ネットワーク未接続","up.pagination.previous":"前へ","up.pagination.next":"次へ","up.pullRefresh.pull":"引き下げて更新","up.pullRefresh.release":"指を離して更新","up.pullRefresh.refreshing":"更新中","up.readMore.expand":"全文表示","up.readMore.fold":"折りたたむ","up.search.placeholder":"キーワードを入力してください","up.signature.penSize":"線の太さ","up.signature.penColor":"線の色","up.upload.sizeExceed":"サイズ制限を超えています","up.upload.uploading":"アップロード中","up.upload.previewImageFail":"画像プレビュー失敗","up.upload.previewVideoFail":"ビデオプレビュー失敗"},f8={"up.common.cancel":"Отмена","up.common.confirm":"Подтвердить","up.common.start":"Начало","up.common.end":"Конец","up.common.stop":"Стоп","up.common.copy":"Копировать","up.common.none":"Нет","up.common.tip":"Подсказка","up.common.success":"Успех","up.common.fail":"Ошибка","up.common.close":"Закрыть","up.common.preview":"Предпросмотр","up.common.re-select":"Выбрать снова","up.common.rotate":"Повернуть","up.common.pleaseChoose":"Пожалуйста, выберите","up.common.loading":"Загрузка","up.common.loading2":"Загружается","up.common.inOperation":"В процессе","up.common.settings":"Настройки","up.common.retry":"Повторить","up.common.search":"Поиск","up.common.more":"Больше","up.common.video":"Видео","up.common.file":"Файл","up.week.one":"Пн","up.week.two":"Вт","up.week.three":"Ср","up.week.four":"Чт","up.week.five":"Пт","up.week.six":"Сб","up.week.seven":"Вс","up.barcode.error":"Ошибка генерации штрихкода","up.calendar.chooseDates":"Выбор даты","up.calendar.disabled":"Эта дата отключена","up.calendar.daysExceed":"Количество выбранных дней не может превышать {days} дней","up.cityLocate.locateCity":"Определение города","up.cityLocate.fail":"Ошибка определения местоположения, нажмите для повтора.","up.cityLocate.locating":"Определение местоположения","up.code.send":"Получить код подтверждения","up.code.resendAfter":"Повторная отправка через X секунд","up.code.resend":"Отправить снова","up.cropper.emptyWidhtOrHeight":"Ширина или высота области обрезки не задана","up.empty.car":"Корзина пуста","up.empty.page":"Страница не существует","up.empty.search":"Нет результатов поиска","up.empty.address":"Нет адреса доставки","up.empty.wifi":"Нет Wi-Fi","up.empty.order":"Заказы отсутствуют","up.empty.coupon":"Нет купонов","up.empty.favor":"Нет избранного","up.empty.permission":"Нет разрешения","up.empty.history":"Нет истории","up.empty.news":"Нет новостей","up.empty.message":"Список сообщений пуст","up.empty.list":"Список пуст","up.empty.data":"Нет данных","up.empty.comment":"Нет комментариев","up.link.copyed":"Ссылка скопирована, откройте в браузере","up.loadmoe.loadmore":"Загрузить еще","up.loadmoe.nomore":"Больше нет данных","up.noNetwork.text":"Ой, потеряно сетевое соединение","up.noNetwork.pleaseCheck":"Проверьте сеть или перейдите к","up.noNetwork.connect":"Сеть подключена","up.noNetwork.disconnect":"Нет сетевого подключения","up.pagination.previous":"Предыдущая страница","up.pagination.next":"Следующая страница","up.pullRefresh.pull":"Потяните вниз для обновления","up.pullRefresh.release":"Отпустите для обновления","up.pullRefresh.refreshing":"Обновление","up.readMore.expand":"Развернуть для полного чтения","up.readMore.fold":"Свернуть","up.search.placeholder":"Введите ключевое слово","up.signature.penSize":"Размер штриха","up.signature.penColor":"Цвет штриха","up.upload.sizeExceed":"Превышен лимит размера","up.upload.uploading":"Загрузка","up.upload.previewImageFail":"Ошибка предпросмотра изображения","up.upload.previewVideoFail":"Ошибка предпросмотра видео"};let qi={lang:j.getLocale(),locales:{en:r8,es:o8,fr:a8,de:l8,ko:c8,ja:u8,ru:f8,"zh-Hant":s8,"zh-Hans":i8}};j.onLocaleChange(i=>{qi.lang=i});function oe(i,e={}){if(i){let t=qi.lang;qi.locales[qi.lang]||(t="zh-Hans");let n=qi.locales[t][i]||i;return Object.keys(e).forEach(s=>{const r=new RegExp(`{${s}}`,"g");n=n.replace(r,e[s])}),n}else return i}const d8={calendar:{title:oe("up.calendar.chooseDates"),showTitle:!0,showSubtitle:!0,mode:"single",startText:oe("up.common.start"),endText:oe("up.common.end"),customList:[],color:"#3c9cff",minDate:0,maxDate:0,defaultDate:null,maxCount:Number.MAX_SAFE_INTEGER,rowHeight:56,formatter:null,showLunar:!1,showMark:!0,confirmText:oe("up.common.confirm"),confirmDisabledText:oe("up.common.confirm"),show:!1,closeOnClickOverlay:!1,readonly:!1,showConfirm:!0,maxRange:Number.MAX_SAFE_INTEGER,rangePrompt:"",showRangePrompt:!0,allowSameDay:!1,round:0,monthNum:3,weekText:[oe("up.week.one"),oe("up.week.two"),oe("up.week.three"),oe("up.week.four"),oe("up.week.five"),oe("up.week.six"),oe("up.week.seven")],forbidDays:[],forbidDaysToast:oe("up.calendar.disabled"),monthFormat:"",pageInline:!1}},h8={carKeyboard:{random:!1}},p8={card:{full:!1,title:"",titleColor:"#303133",titleSize:"15px",subTitle:"",subTitleColor:"#909399",subTitleSize:"13px",border:!0,index:"",margin:"15px",borderRadius:"8px",headStyle:{},bodyStyle:{},footStyle:{},headBorderBottom:!0,footBorderTop:!0,thumb:"",thumbWidth:"30px",thumbCircle:!1,padding:"15px",paddingHead:"",paddingBody:"",paddingFoot:"",showHead:!0,showFoot:!0,boxShadow:"none"}},g8={cell:{customClass:"",title:"",label:"",value:"",icon:"",disabled:!1,border:!0,center:!1,url:"",linkType:"navigateTo",clickable:!1,isLink:!1,required:!1,arrowDirection:"",iconStyle:{},rightIconStyle:{},rightIcon:"arrow-right",titleStyle:{},size:"",stop:!0,name:""}},m8={cellGroup:{title:"",border:!0,customStyle:{}}},x8={checkbox:{name:"",shape:"",size:"",checkbox:!1,disabled:"",activeColor:"",inactiveColor:"",iconSize:"",iconColor:"",label:"",labelSize:"",labelColor:"",labelDisabled:""}},y8={checkboxGroup:{name:"",value:[],shape:"square",disabled:!1,activeColor:"#2979ff",inactiveColor:"#c8c9cc",size:18,placement:"row",labelSize:14,labelColor:"#303133",labelDisabled:!1,iconColor:"#ffffff",iconSize:12,iconPlacement:"left",borderBottom:!1}},v8={circleProgress:{percentage:30}},E8={code:{seconds:60,startText:oe("up.code.send"),changeText:oe("up.code.resendAfter"),endText:oe("up.code.resend"),keepRunning:!1,uniqueKey:""}},A8={codeInput:{adjustPosition:!0,maxlength:6,dot:!1,mode:"box",hairline:!1,space:10,value:"",focus:!1,bold:!1,color:"#606266",fontSize:18,size:35,disabledKeyboard:!1,borderColor:"#c9cacc",disabledDot:!0}},S8={col:{span:12,offset:0,justify:"start",align:"stretch",textAlign:"left"}},T8={collapse:{value:null,accordion:!1,border:!0}},b8={collapseItem:{title:"",value:"",label:"",disabled:!1,isLink:!0,clickable:!0,border:!0,align:"left",name:"",icon:"",duration:300,showRight:!0,titleStyle:{},iconStyle:{},rightIconStyle:{},cellCustomStyle:{},cellCustomClass:""}},_8={columnNotice:{text:"",icon:"volume",mode:"",color:"#f9ae3d",bgColor:"#fdf6ec",fontSize:14,speed:80,step:!1,duration:1500,disableTouch:!0,justifyContent:"flex-start"}},I8={countDown:{time:0,format:"HH:mm:ss",autoStart:!0,millisecond:!1}},C8={countTo:{startVal:0,endVal:0,duration:2e3,autoplay:!0,decimals:0,useEasing:!0,decimal:".",color:"#606266",fontSize:22,bold:!1,separator:""}},L8={datetimePicker:{show:!1,popupMode:"bottom",showToolbar:!0,value:"",title:"",mode:"datetime",maxDate:new Date(new Date().getFullYear()+10,0,1).getTime(),minDate:new Date(new Date().getFullYear()-10,0,1).getTime(),minHour:0,maxHour:23,minMinute:0,maxMinute:59,filter:null,formatter:null,loading:!1,itemHeight:44,cancelText:oe("up.common.cancel"),confirmText:oe("up.common.confirm"),cancelColor:"#909193",confirmColor:"#3c9cff",visibleItemCount:5,closeOnClickOverlay:!1,defaultIndex:[],inputBorder:"surround",disabled:!1,disabledColor:"",placeholder:oe("up.common.pleaseChoose"),inputProps:{},pageInline:!1}},R8={divider:{dashed:!1,hairline:!0,dot:!1,textPosition:"center",text:"",textSize:14,textColor:"#909399",lineColor:"#dcdfe6"}},w8={empty:{icon:"",text:"",textColor:"#c0c4cc",textSize:14,iconColor:"#c0c4cc",iconSize:90,mode:"data",width:160,height:160,show:!0,marginTop:0}},D8={form:{model:{},rules:{},errorType:"message",borderBottom:!0,labelPosition:"left",labelWidth:45,labelAlign:"left",labelStyle:{}}},P8={formItem:{label:"",prop:"",rules:[],borderBottom:"",labelPosition:"",labelWidth:"",rightIcon:"",leftIcon:"",required:!1,leftIconStyle:""}},k8={gap:{bgColor:"transparent",height:20,marginTop:0,marginBottom:0,customStyle:{}}},B8={grid:{col:3,border:!1,align:"left"}},F8={gridItem:{name:null,bgColor:"transparent"}},{color:Mf}=Zn,O8={icon:{name:"",color:Mf["u-content-color"],size:"16px",bold:!1,index:"",hoverClass:"",customPrefix:"uicon",label:"",labelPos:"right",labelSize:"15px",labelColor:Mf["u-content-color"],space:"3px",imgMode:"",width:"",height:"",top:0,stop:!1}},M8={image:{src:"",mode:"aspectFill",width:"300",height:"225",shape:"square",radius:0,lazyLoad:!0,showMenuByLongpress:!0,loadingIcon:"photo",errorIcon:"error-circle",showLoading:!0,showError:!0,fade:!0,webp:!1,duration:500,bgColor:"#f3f4f6"}},N8={indexAnchor:{text:"",color:"#606266",size:14,bgColor:"#f1f1f1",height:32}},U8={indexList:{inactiveColor:"#606266",activeColor:"#5677fc",indexList:[],sticky:!0,customNavHeight:0,safeBottomFix:!1}},$8={input:{value:"",type:"text",fixed:!1,disabled:!1,disabledColor:"#f5f7fa",clearable:!1,password:!1,maxlength:140,placeholder:null,placeholderClass:"input-placeholder",placeholderStyle:"color: #c0c4cc",showWordLimit:!1,confirmType:"done",confirmHold:!1,holdKeyboard:!1,focus:!1,autoBlur:!1,disableDefaultPadding:!1,cursor:-1,cursorSpacing:30,selectionStart:-1,selectionEnd:-1,adjustPosition:!0,inputAlign:"left",fontSize:"15px",color:"#303133",prefixIcon:"",prefixIconStyle:"",suffixIcon:"",suffixIconStyle:"",border:"surround",readonly:!1,shape:"square",formatter:null,cursorColor:"",passwordVisibilityToggle:!0}},H8={keyboard:{mode:"number",dotDisabled:!1,tooltip:!0,showTips:!0,tips:"",showCancel:!0,showConfirm:!0,random:!1,safeAreaInsetBottom:!0,closeOnClickOverlay:!0,show:!1,overlay:!0,zIndex:10075,cancelText:oe("up.common.cancel"),confirmText:oe("up.common.confirm"),autoChange:!1}},G8={line:{color:"#d6d7d9",length:"100%",direction:"row",hairline:!0,margin:0,dashed:!1}},K8={lineProgress:{activeColor:"#19be6b",inactiveColor:"#ececec",percentage:0,showText:!0,height:12,fromRight:!1}},{color:V8}=Zn,j8={link:{color:V8["u-primary"],fontSize:15,underLine:!1,href:"",mpTips:oe("up.link.copyed"),lineColor:"",text:""}},q8={list:{showScrollbar:!1,lowerThreshold:50,upperThreshold:0,scrollTop:0,offsetAccuracy:10,enableFlex:!1,pagingEnabled:!1,scrollable:!0,scrollIntoView:"",scrollWithAnimation:!1,enableBackToTop:!1,height:0,width:0,preLoadScreen:1}},W8={listItem:{anchor:""}},{color:Nf}=Zn,z8={loadingIcon:{show:!0,color:Nf["u-tips-color"],textColor:Nf["u-tips-color"],vertical:!1,mode:"spinner",size:24,textSize:15,text:"",timingFunction:"ease-in-out",duration:1200,inactiveColor:""}},Q8={loadingPage:{loadingText:oe("up.common.loading2"),image:"",loadingMode:"circle",loading:!1,bgColor:"#ffffff",color:"#C8C8C8",fontSize:19,iconSize:28,loadingColor:"#C8C8C8",zIndex:10}},Y8={loadmore:{status:"loadmore",bgColor:"transparent",icon:!0,fontSize:14,iconSize:17,color:"#606266",loadingIcon:"spinner",loadmoreText:oe("up.loadmoe.loadmore"),loadingText:oe("up.common.loading2")+"...",nomoreText:oe("up.loadmoe.nomore"),isDot:!1,iconColor:"#b7b7b7",marginTop:10,marginBottom:10,height:"auto",line:!1,lineColor:"#E6E8EB",dashed:!1}},X8={modal:{show:!1,title:"",content:"",confirmText:oe("up.common.confirm"),cancelText:oe("up.common.cancel"),showConfirmButton:!0,showCancelButton:!1,confirmColor:"#2979ff",cancelColor:"#606266",buttonReverse:!1,zoom:!0,asyncClose:!1,closeOnClickOverlay:!1,negativeTop:0,width:"650rpx",confirmButtonShape:"",duration:400,contentTextAlign:"left",asyncCloseTip:oe("up.common.inOperatio")+"...",asyncCancelClose:!1,contentStyle:{}}},J8={navbar:{safeAreaInsetTop:!0,placeholder:!1,fixed:!0,border:!1,leftIcon:"arrow-left",leftText:"",rightText:"",rightIcon:"",title:"",titleColor:"",bgColor:"#ffffff",titleWidth:"400rpx",height:"44px",leftIconSize:20,leftIconColor:fo.mainColor,autoBack:!1,titleStyle:""}},Z8={noNetwork:{tips:oe("up.noNetwork.text"),zIndex:"",image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAABLKADAAQAAAABAAABLAAAAADYYILnAABAAElEQVR4Ae29CZhkV3kefNeq6m2W7tn3nl0aCbHIAgmQPGB+sLCNzSID9g9PYrAf57d/+4+DiW0cy8QBJ06c2In/PLFDHJ78+MGCGNsYgyxwIwktwEijAc1ohtmnZ+2Z7p5eq6vu9r/vuXWrq25VdVV1V3dXVX9Hmj73nv285963vvOd75yraeIEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQaD8E9PbrkvRopSMwMBBYRs+5O/yJS68cPnzYXel4tFP/jXbqjPRFEAiCQNe6Bw/6gdFn9Oy9Q90LLG2DgBBW2wyldIQIPPPCte2a5q3jtR+4ff/4wuBuXotrDwSEsNpjHKUXQODppy+udYJMEUEZgbd94DvnNwlA7YGAEFZ7jOOK78Xp06eTTkq7sxwQhmXuf/754VXl4iSstRAQwmqt8ZLWlkHg0UcD49qYfUjXfLtMtOZ7npExJu4iqZWLl7DWQUAIq3XGSlpaAYHD77q8xwuCOSUoXw8Sl0eMux977DGzQjES3AIICGG1wCBJEysj8PXnz230XXdr5RQFMYbRvWnv6w8UhMhliyGwYghr4Pjg3oEXL34ey9zyC9tiD2ml5h47dr1LN7S6CMjz/A3PvHh1Z6UyJby5EVgRhKUe7Kz/JU0LfvrJo5f+Y3MPibSuFgQGBgasYSd9l6GDsup0WS/T/9RTp9fXmU2SNwECdQ92E7S57iaMeJnPQLK6ixkDLfjlb7546RfrLkQyNBcC3dsP6oHWMd9G+V3JgwPHh7rnm1/yLQ8CbU9Y33zp0j+nZFUMb/DHmB7+SHGY3LUKAk8cObtD00xlHDrfNge+Z2ozU3c9dvx4Yr5lSL6lR6CtCWvg6OAPw9z538ZhhZRl6XrwhW8du1KX/iNejtwvPQIDR8+vSRqJ/obU7GupjdNdh2gW0ZDypJBFR6BtB2rg2OVtuub9JcmpHIpBoK1xfffLzx4f7C0XL2HNiYDp6bs9z23Ypn1fC1Y/9PCFDc3ZW2lVHIG2JKzTp4Ok7nv/G6Q054MIvda+bNb74pEgKGtwGAdL7pcfAa8vOKEZ2kyjWuLr7uDh+/qvN6o8KWdxEWhLwroyeek/g4zuqwU6kNrhyZcu/UktaSXN8iNwuL9/RuvVXtJ9PbPQ1vhmcP6t9+47u9ByJP/SIdB2hDVw9MJHQFYfrQdCph84evFX68kjaZcPAZJWwjMXRFpJ2zr91tfuvrh8vZCa54NA2xGWrunvmg8QWCJ/N4ir7fCYDxatkOeBB7an501agXbygVdvv9IK/ZQ2FiPQdi9osGbH+zRNf7y4m9Xu9Me7N9nv0HXdr5ZS4psHgXpJC9P/wDRTx0Vn1TxjWG9LGrbaUm/Fi5meSvcrkxf/Cg/ow9XqAUk91v3qHT97r6471dJKfHMi8Oyzgx1Z03t1YAQVT2MwgsC3u+yXHzi0faQ5eyGtqgWBtpOw2Ol9+/TM+sTOn8L08MtzgQCy+tOHXr3jA0JWc6HU/HF5Scssr4jXcYqfP6V/T8iq+ceyWgvbUsKKOn38eJAYyl56TAuCEr2WYei//9Crd/5GlFb81kdASVopSFrerKRlaoZj9HR+700H10+0fg+lB21NWBxe2lhNHsUpDZr27mi4dV379R9+za4/iO7Fbx8ECknLCPTsTDJ17O33bJpqnx6u7J60PWFxeAcCbMV56dJfQKf1bkMLfuGh1+76zMoe9vbuPUnLsb2DtmOe5HSxvXsrvWtLBEhaTx29+Ma27Jx0ShAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQaEsEVoQdVluO3BJ06ptHL34b1XRjp4Ch6Rq24+kmjG4Nwwg+9uA9u/73EjRBqhAEihAoe3xwUQq5WTYEzp0b3ZnV/Ncf6O/9AvY9wlh/6dy3X7ncN512Zw9BVLXjuAP4np44vnQtkZoEgVkEhLBmsWiKqwsXpjbPBOn3gRfenwnc+7GBe+zsjclvonFDS9nA9Iy/u3x9+vAP3735VPk4CRUEFhcBIazFxbfm0k9fHD7k+v4nQFaPQIrx8Gmyx/GJ0J/t7ez7mw0b9MmaC2pQQgh0/ZSm4g5TwueWWtqLt0HuVy4CQljLPPYnB0depTn+b3t+8B4t0AdBUv93h2H9xc6da0aXs2m+r1WQsLRnl7NdUvfKRkAIa5nG//r1oGtsZvjTgev/kqYHF/TA+AXoqv4npJemOEiQU1Eo2l+G0movBK1UBBPU7s9E1+ILAkuNgKwSLjXiqO/khVtvARH8dxDBRkMzPrF/V+9/BlG5y9CUqlXinHv9mRPXtvuus88L9H3JPv2zD2yXExCqAicJBIFWRwAvv3Xqwq0/Pnn+lv/K+ZvfPH3p9p5W75O0fxaBp793ce3AwIDMWmYhafiVgNtwSMsXeHp4eNXJC8Nf0PAdRCiuf/XgrnWUqsqotcvnl9DmRkCdweX4b9N7+m/ih+mbMraLM14yJVwcXItKpT1VRve+ArC3Qqn+3gM7132jKEGZm6tXg86J7OhDfuA/iHwPUpfUZSfu2L59tXxEoQxeyxkEgjKeOnLxHb4RqC+NY5H3+2953d4XlrNN7Vq3ENYij+yZwbG9jpt9GkBPQ5H9zgP9607OVeWp87cOQtn9zwJf+xDMNFfj+jryPqXpxj8c2Nn7P+SXey70lidu4IXzb0DNB4tr9751+HV7zxSHyd1CERDCWiiCc+QPjUCnsaqmZ62O5IN7N/VUNP48ee7mAZDTf4Tt049iUG4Guv4ZfNLos9UIbo7qJWoJEHjy+bP7fNsoOcnW0A0/aacef8PdG28sQTNWTBVCWIs01OfPj66BpfqTmq732UnjgT1bei+Vq4pTv7HM8Ceg2/o1qLQug7T+FaaM3IqTLZdewpoHgYEjV9fphvOj+OShWa5V+CxvZtpzv/LwG/aNl4uXsPoRwI+4uEYjAJ2GmdG8L0FK2mYa+tsrkdXZy+P7x2ZuHdW14P+BLdank9q6Qwd3rf+ckFWjR6Tx5Q2cP58K9Jm3VCIr1ogt48lO237r3//96YofeG18y9q7RFklXITxPXV+5DchKb3ZDMy37Nu5tuxG4R9cHH6b42QfAzlds+3EPXu2rfrBIjRFilwkBIIR7SHoJDurFU89ZOd680Gke6JaWomvjoBIWNUxqivFD87fej0e0n8Fwvr0/t1rnyqX+QfnRz7g+8FX8Rv8vL3auF/IqhxKzR2WCPxXqKeq3krDTdj2ierpJEUtCIgOqxaUakwzNBR0D09yiqePHOjveyOkpxLr9VMXb73V97S/h3nDXx7Y2fdPkAYbncW1IgIDxy5vM7LZt/hgrnLtxyaBrJNxv/72N+6tuNhSLp+EVUZACKsyNnXHvHL+1qcgNf2KbSXu2bt9dcmS9qlzo/fARgcmCtpzB3b1/Vg5QiuslLowENyDWDn8cSjl98PgdBviu03N+rl9/WufLEwr18uDwLdevLTF1YK3xnVZ2HI1bUxrT7z5zTuXdRP78qCyeLUKYTUI25OXbm4JPO00TBj+6I7+db8ZL3ZwMOiYdG4dA1lN9HWte2iuI2NAVPapC8O/CGPR34Ip/AZIbIMo7yX8G9QMbcS09P+2b1vf5XgdrXaPfiYns9oeLLEd8D1/B7Dp0E1jGP042pXQj7RKf546cmGzp+tv1TRf6YQD35/QO3seP3xow5IfC9QqmM23naJ0ny9ysXwgq98BWc0kVhv/Nhalbqe8kd/Fr8MOSEr3zEVWrwyO3I29hl+E9LUHGf+nAXI6sGPdd8uV2YphIKnE5IyL6bLxk7cn3bdkHHefrpvJAExMZ1uBZmqeNzXtfzUzk/m/ens7LjV7Px+8d9e1579/44l0duZtge+Np5zEEw8c2pBu9na3YvtEwmrAqNE8IZvNHsep5//yjl3r/0O8yFOXbv0QCO05gP0JGIL+fjw+uj91YeRh/Dp/PtCDM7Zpfmjvjt6Xo7hW9ycmJjaYduf7Hdf/8HTGfa3rG9rYxLSWnsloPg7fijZV8oFM2Ja2a9t6EJd7bCztvHP7us4rrdD/r3/7ct9I99jEI4cOiQ3dIg2YEFYDgOUJDFj1e8TqX7cT4kImXuQr5279A4DeBEX8ayvprU4N3rovcALot/TH13T0fXDTJn0qXk4r3k9OTm4y7a6PzjjORzOOvn1kbEqbnEprPhRzwAKzwFLHk05hv6Yd6N+o3R6beG50aPSdr3qV6IJKkVp5ITIlXOCYn4Yexr0w/DO6YXymHFlR0e5r7tsM3fxgJbI6fW1ivTeT+SsYmr54cFff+5Cu5X+hb94Merp6/J/PusGvTE6724eGJ7RpSFOkKPCUZvBPBccoHBet3Rwe13rX9tw/PjXzZ5hKvr8SfhWKkeA2REAIa4GD6p0feRdWBnvxjv2PckVhVfBf4A29uG/X2i+Ui2eYn8n8NryuDr3jPfWSFV5k44UT137eshIP2K7/64cObbheqZ6lCp+Ydt8TBO7vTM5od1+/NR4SFVhoLpKKt410lnE8LTMzo3V2dLznxLkhYgQ9obiVjEDln7mVjEodfYcpw+MAsftg/7qSDbAnb97sCSb0Yei2fqOcbovVqKNnNO8HmAE9Cv3Wp+uoWjt27HpXNqH9WTKR+kBHKqEFbvo5y3N/avfu4g23R45f3WGa1k9ZicTd0zPTf/f6O7f8dT311Jp2fHzmgJlI/N70jPPe4bEZ6Kg4qw0lqlrLiNKBiLWerpTW25PUbkPXZViW62ecHz+4d8PXojTirzwEyhq8rTwYFtRjvpX/rlwJ+iSXugPbMuyKBOHo3geRJtuT7PujcmVUCuPJlhnL/9NUqvMD2eyM5sxMaIlE4n7XML907tyNjcxHQjty4sZv66Z1xEok/xNW5n4uZSf+8sT5m++vVO58wkEu5sR09pd9w/rWyET2vReujiqygrSopn/zKZN5qMeirotKeTyolm7p/+X06Wvr51ue5Gt9BISwFjiGsLl6N6SrvylXDNTK70D4mX071pwtF88w6Jd/DG/1E1u26NOV0pQL71y3/8PJVOcHMzPTWkcCH2YGOaTTaS2RTN6f1fQvvvDK1bdnbO2JZCr1SeRfn05Pa1PTU0gXJBKW+ecnzlxvCGndhFQ1NRP8bcY1/vjS9bF1V26MwHwsVKiXa3etYVw1TNhYJ3TDjQCO42jJVMcez7J+t9YyJF37ISCEtahjGjxkGDr2DJZ31D8h5vUQJL5RPkXlUMM07u3qSGidICvkzzuSlmlZb0olrK9hD9v9JCrPC196JoPMAolFg6CV+PPj54YeyWecx8Vk2v1Q0rSfhFT18LnBmzBRyNalp5qrSuq7kiAsh4SFa7oZ9M0wzI+cPHOjZPo9V1kS1z4ICGEt4lhiCvZrSa2jol7qzPXJPk6nIGbVbWfUvcr7hO9MP97ZVXpggOu6ajplYStj7l1XvbRMXbPAbp6HzSSBlkraNknrvfVCcPt2sHYi7f3pTDb47KUbYxuvKqkKpYBXKBnV869c3WgbDEixAck0FGFFfEzJzbIsO9C1TyrcymWWsLZGIHoW2rqTzdo5dXyykz0NC8l779i5vu4zwM+eHVntGP5jqVTq/6AkVc5NZ3wNH2lVxNWZNIukMSjiNd9z0+CHp5DXAdX4SAg203w8GB5IATtODHzdK8C15kEjhXvNS9rWA11dnfcMDY9prscss48RySakrOLWqODCoIKAgkuVgsS0urtD60haeV1YYVbbtjUn6/74HXvW/11huFy3PwKzT1r797Upe3jq4sib9u9Y+wxe+vh7W1N7jx49v6ZzbffnQD4/Cj1Pfjx54XiBls6GVuTUc9mQsOIO9mPQFdkIRlz4fy5JLm2ZMOqTcJaXIqpcqnixVe+rdbZ3dbc2OT0D0wZIibHSksmklslknvx+//q3PiKnXcTQae/b+LPQ3r1t0969cOL6G7o6E09qgZegdMJBpVQ1DbKCpyUt6oPKz/4NEJalCAuZFIuEVBJd+jgLh4rvAiFqUVGkhJZMWFp3Z0obGSu/d5gSnWmavuO6h+/cvYHSobgVgoAYjrb4QPMUiGtj1/79jBMkLBwiTlMASlYzTkhWCJyTrGAyMOFkst/BoYMmuIIyGJYcMXMMdNwHPhYN1qWS1t6ZLGaKZL8yzFXTr15BooLLMugHMBRNKgW+It8y9TEcJGt4rvcRFCCEVQbFdg0Swmrxkb0+cf2XOzq73kgdFieEXF2jdEUJKQH6SVWQrNjtZDKlpTPp38U58iUbthk/Ph7sN6zg/xudSGvD4xkq6otcnnjyF0XRRTflkyC0IIJE1JG0QbqGNpMNp5xFhRTcZDNoj66988SFm5vv3LX+WkGUXLYxAuXnCW3c4XbqGs9hwjv+a9lsuN+ahOJSCoLjNDAFvVUll0p1aNPp6adTweSflEszPO48oFn+4yOTmR+6enOshKyYhzWpf/jDuuf6x2aV/qNRaPG/1d0gUXWCA0uu7GhMmkqmerEc8KOVU0lMuyFQ+Ylut562YX9Sncmf7Ojo3BDZWbGLtMkiUVXSWTFNuMqWuYG530f7+/tnGFboxsfdd9mm8XdDo9O7rg6NFq0CFqZr5DWlK9qV0fZqGvZchSuPlevB2VmG/hOV4yWm3RAQwmrhEcW64qu4ykfJho52Vp3J8quBYQooqWDKADftBd6HD+5efyoKj/zR8ew/hWXY56/cnFh7a3RCTTGjuMX0SVB9qzu1qfQM+jO3dBW1g6uVSHv/qVNX10Vh4rc3AkJYLTy+WA/8ou9kJjo7bOh+DLVFZ64TEbCyBktxI5PJZj56R//Gx+NdH5vM4vuI+p8NXh9LjU1iw3EZhXc8TyPuuV9wDaaCfBjTM06N0hVWQmHBDzvSDZ5tvqYR7ZAymh8BIazmH6OKLbzv0KZvJEz3ZzEFnEolaEtV2XEaCLKadrIz//TQnk1/EU85NuH8th8Yf4j9gMZUOrNkZEVZCnsbtTU9KW18GqcKFyjh420sd2+j33pg3F8uTsLaDwEhrBYf04O7N/2t7/o/C2FoGnsIy/YGlvAwSfCvZzLOe+8oR1ZT3u/5uvHJC9dGtJlMrfqjslXVHwjpat2aLi2rjFFLjUSrFUjlO0juddXSSXx7ICCE1QbjiHO0/hofbPgwpnDTOR2V6hWNQqGUx34890noet5yaO+Gko3Y45PO7/uB/lvnrwxrWdha1absbgxo1FWtwplXqYSJY5Nn5lU3bLHQmGA/yko0plVSSjMjIITVzKNTR9sO7dv8RSeb/T9BWmMkKv4D+YzBXuljV7yxd+zfte6VeHGKrHTz4+cv38JWmyUmKzSGG5z7VndoE7kz3uPtq+Welvhwm39weVjOyaoFsBZPI4TV4gNY2Pw79mz8KyebeRIH+VEZTaX0sf27+v794TKmCxNTzr/2NOPj5wZBVjjdYSklq6jN69dyKuhqmWztivYob+RTSkPbe/xMdlMUJn77IiCE1W5jq+s4dYEO6mzsYAmvi/+CrH7LDYxPcBq4HGTFVcG1ULLT5orS1ULIkoSFI2cMHKG8obiXcteOCAhhtdmo6gaOh4EWWlkyYU9gvHswXfgV19d/7+LVkSWfBrItJJhObL/p7elQR8fUZnEV70XxPc01sM+xrzhU7toRgZIHuh07uZL6xA3LBaYB+Ar8rBsfz34YX1j+D5eu317QNGy2xPquSE4mDuXb2IujY2AgytNE67RiKFshzuwCR5s9ZSMlsK0QEMJqq+GkBKOF5yFzRoidK5BoFCeMjM/8mG+a//Xy0Li55KYLBRiTrGjwOQ1br4VMBQuKVJeQKVPxMLlvPwSEsNpsTEECmBLSgbHUpwD1YGwse59l2p+9fmuig4fiNZIowrqq/6Xeqm9Vh9JbjcOKvqFtACX7gV8kTVZvkaRoRQSEsFpx1OZoM2iKxxuHLtDcsZlgLzYZfv7m7XSv+r7fIm234XSP/8o5ktWqzqSyZr89PoXPYDTYkZvziw0NLluKayoEyq4iNVULpTF1IaDjHHZmoAW4aep9geN8fiLt998cGYdtVp7K6iqzXGJFUCAi7jdkuapsBJKcPBwgyP8YRyV7B04Q3dDbpY3jg6gupoMNla5U41BbUN9n0sr1ScKaHwEhrOYfo7paCAW0WiWknihhW/0Tabf/6tDtxpIVSIhGnz1dSXUkDL8fSHKi4/lWPId9Kp3Vxqegp8J/m9f14D6DQ/nmb281FwgkZ1Dj7bnSSFx7ICCE1R7jmO8FJJr8jCvjeNrIxFjDJBpKVaSlXhwDw384MyucBoLAGEfHI5ptO6n1YAq4FjorH9IWjUOnFlF3pj62aui3whbI33ZGQAir/UY3XCVEvzgdw/8NcSyGUhSlpVWQrFg2p39xp0JYLyIohaXxdZ2FGofG6yi85/QS32F0Asu8URgu1+2JgCjd22xcsVElPC85169Gaa1YTkRWJKpSqooBiQQzONvq9sRULKKxtzzAEJw1api2EFZjoW3K0oSwmnJY5tcoSD09HanEDztubnfO/IopyUWC6sUmZUpW5aSqkgwgK04DxxaZrFivacCaIdAuH9zaM1rSDgloOwSEsNpoSMenvU93dXb+EE5taFivKElRqd67qrNmsqIF+yjMF/i56MV2JqadYKxXMDXM6+4Wu04pf/kQEMJaPuwbWvPticwj4Il/NnTrdl7JrqaDC5wTUle1GmdWWVCw1+JotjA6PgnThsIdQrXknF8arkJi/+R355dbcrUaArU9ha3WqxXW3tHR9C5dN//T9eEJ3aGdUwP7T0V7F86Mr0VW4mF6o2NTS/ilaB2HDmb8wA2+08AuS1FNjIAQVhMPTi1NgwRkGKbxRxMz3uaJSRzVUkumOtLwo6Zc7aOkVdEhynN9NQ1cyuNqeEqD67mX9TXGyxXbJhFthYAQVosP58S0909czfqJqzdGODVqaG/IUbCWr2p0yukfp4FUtDfeir1yl8IPUGjPHFy/fqJyKolpJwSEsFp4NEfT6Z3YBvOp8MvMc0hAi9hHNQ1cBrJil5TUZxhfXsTuSdFNhoAQVpMNSD3NMTzzU1PZYAM/ProYkg3UV5rHT8lXmA7SwnwEq4FLLVkRI04HM+n0LdvzvlEPZpK2tREQwmrR8ZucCd7hePr7rw2N5PfxLUZXON1zHKz4kb0KnIttP6Njk8tyaimbwXPrsW/yq3v3bhoqaJZctjkCQlgtOMCYCnU4GedTI+NpQ32XbxH7QOmKG5nzdIWZJz8HNkKygqI9TmSL2JSiovGVn0A39c8WBcpN2yMghNWCQ4zPc0HRbr6GEs6chJFnmfl3knZO4/hmII1B6fiFG9br0s6qAeXPp2WUrhzHeXH/jr6n5pNf8rQuAkJYLTZ2kK7Wul7w6zeGx9DyUsZovOodOizosTg1TM9k1Wogpa7lIisOF+w48E/7E5B1Y/cgtdizsBKbK6c1tNioT6X9n3MDcyePOo7OoJqrC6S0+ZIYV+GSOHxvc18PJCxXG4ed13I727axqTp9yk9rX1jutkj9S4+ASFhLj/m8axwdDdbgELxfGsLpoZyqVXPVU1QugVJUV0dC27p+FaaBWWxknq6ceAljTNMiAf/BoUMbJpewWqmqSRAQCatJBqKWZpgJ731Zx9pJM4aK0hXe5vlKVFEbKFlxs3PvqpSSqpbzKztRm+gnEkktnU6/2GFMfa4wXK5XDgJCWC0y1iAR6/Z49iOjY7C5qkG6mk+3SFQGlEP8FFdnygrNFqBsn1OxP5+K5pGHbcBhqhT8fqu/v39mHkVIljZAQAirRQYx7Wj3Zj3tddQjVVJ4l50CMjHe8mqOTJCCvmoTyIrENXx7Uinbm4Gs2PZUqkObnp76i0N7N36tWl8kvn0RaGnCGhgILKPn3B3+xKVXDh8+nPseX3sOlpt13+P4uonv71WeDqLr1ampFB8S1JrulNaHc9rTMxltcpofOeWns0rTLkeIZUHRnpm5YibMf7kc9UudzYNAyyrd8ZLpWvfgQT8w+oyevXeo++bBtaEtQd9s1/ffRsV3I6eDJCp+nourgH04UZQnhIYfWm1o8xdUGCU8/E/bil89sH3dlQUVJplbHoGWJaxnXri2HTvd1nEEcCBS3z++MLi75UejQgcmJjL92ax/gNJPo6QekhVXAbdvXI3D+XQ1Bcxiu02zTAEjKFIdHTQS/S8Hd2/4YhQm/spFoCUJ6+mnL651gkwRQRmBt33gO+c3teNQYin/oG6aKX5rcKEukqqoWN+Ij5vy81v8UATDG0WGC21jlJ96K6wKPpWd8H8jChN/ZSPQcoR1+vTppJPS7iw3bIZl7n/++eFV5eJaOczX9Z2YvM1LPxWpocBHKv8qHHdMqSphGUqqahaThfj40ITBcbLnsDj6oXvu2bS4n96JVy73TYtASxHWo48GxrUx+5Cu+XY5RH3PMzLGxF0ktXLxrRoGNVPPfNtOolIrgElLGYH2wbZqcipdIFVFlDbfGhqfj9bskCaHHS/7gTt3r73Y+BqkxFZFoKUI6/C7Lu/Bl1jmlKB8PUhcHjHufuyxx/g5lbZw+BL7bX4EoiZqyS0T0uM0j1+82QSl+ua+bhxj7GjD2LicwWkLzaarigbKsmDJ7gcTmezMBw/t3ixntUfAiK8QaBmzhq8/f26j77pbaxo3w+jetPf1B5D2RE3pmzyR4/nH+Mti4Wx1dUrCHO0lSVGqskFUnakkpn6mhu086jgYHkWTW3Wbo4Tli6L5gqYHE47vfeDufVv+YflaIjU3KwItIWEdO3a9Szc0ElDNDqcLbHjmxas7a87QxAnX9ljfxcr+Mzs29ykpi1O8iJjoR/cm5o7dnUl89LRLW93dyWmVIip+Kp7pmlWqIvQ8Mga9Gslm3Efu3LX+K008HNK0ZUSgplnGMrZPGxgYsIKeXa/TA61jPu0w0+7xBx/cd3M+eZspD0wbDgWm+RXP13cODY/jWGKuGAb48jG+agNpilbqlKZoWDqDY2AyjtNUlupzYZlKpXgaxIVMNv0zd+/d+uxcaSVuZSPQ/IT13TN34QRvZW81n6HSDdMLUqmjh9tgd//Fi8OHEl3JL3Z2dh3MzGA7XU664llVWRz/QhLjNYmsmaWp/DjCjqIDdlaZTOZZ1/A+fGj7hjP5OLkQBMog0NSE9cSRszuswNhdpt31BRnazM3U9IuPHDrUuG+419eChqU+cvzqjp7u5P9KJpMPpqc51Zv9QntLkFQBEqZluVCw/7nhaP9i376+8YIouRQEyiLQtIQ1cPT8GjOw7vE8tyFtxBrb2MBXdh579FF99g0vC0nzB548ebNHT2l/aFmJj1BPBYyav9EFLaQ+jdPAVNL8/pZ13a8qiJLLOhAAjvrTRy/d0enbF+69d0tzHFhWR/vnk7Rple6mp+9uFFkRGF8LVj/08IUN8wGp2fIcPLh+4sCu9R+F3ucj0MLf4vaVVnChqYWmdaQS2jpY2vd0djh86Vqh7c3Yxm8dudTPxaW0lrn7yJEjZW0Tm7HdC2lT0xKW1xecgHE3FDWNcb7uDh6+r/96Y0prjlIO7ur7TOD5b3ayzt9ylY0Gl83qKFXZsCXrXdOlrV3djf2LBr556JOshLDmMWhPPXV6vav5O5jVxYLUhNl3iIbV8yiqpbI0bQcP85C2Xu0l3dczC0XUN4Pzb71339mFltOM+Q/0rzu5f2fvu1zH+QDOt3uZ0pbVRMRFouJK5qqeTkhVqyBdtdUmhGV5JI4cudrpd5kHiyp3tTU/8s6r+4rC2vCmaQmLWJO0Ep65INJK2tbpt75298U2HLuiLh3oX/95L+0/kHUyvwTieiUJHVEimVzy1UKeWMqv2pCoKEVFRNXT1aHawnBx80eAZj7TwcxdAc5Gi5fiaNnNT37nCk4xaV/X1IRF2B94YHt63qQVaCcfePX2K+07fMU9U7qtHev+xE/7r3cc70O+6w1gxuV0dHZiusgvJS/O7IskRXLs6KCxqj+B26t9a3uUREWi4plbQlTFYzXvu+7tB3EIUGel/L6e3TNw5NS8zYAqldss4YvzBC9C7559drAja3qvDoyg6pwCP+KBZaVOPPjazS1vMLpQKE9fuPnawDB+EqehPwzWuAuSl8LPg90WVxhJJPWQCUmPBAWTBEz1TFUGpqO3wYYvIPgr2az35a2b1/50V6f1e1NTlVcvEzB0xRekj67usu5FmS2/crvQcaol/zeeObfTSOj91dIq28PxiaOHDx9quy8LtQxhcZBqIS0Dhkl2l/3yA4e2j1Qb2JUUD1Iyz1waOQib0vsxKXsAFvH3wMB0JySwtZC+DBPTN5BOCEnhrI1BuKe9l6tIzsVCiD6E0DOabrwI2elZ09aP7N3aNxjheXvK+a1OENa0EFYEyYL9rz072Ju03ZpNQKj7Xd899cKhNrA9LASvZTY/s9GcHoK0XsrakLS8UklLxyl+/rj+/Qfu2367sJNyTS7SuZfneO7ffweBGScu3NwAqWgrTvTc5jjBZmw87tMCfRXYKQWOgula4OiBOQUZ7DZuhrAGdQXxV0zPuCaGnkv3VPGHOpPw7+QPR62OM5HhdNddGOeX2kmCbSnC4mDlSStVTFr4eLljdHV+702vWz9R66Cu5HS5h5hmHvz3QiOxwJTRo2BGgY06dm7OVhewYGAY6s75oD+ZDs4JPY9JyqSCQ7ABqftd5VFM3/j2Ja4mtsWpJQSq6ZXu5UZTKeJnsHpohiYPRqBn04nkS2+CQWW59BK2dAjwS0Y4IHDz2ERWG8Gnwm7iK9W3sFmbvrqGPzw6gW8eTmvTM07XmTPX28KYd7EQ3rjnvv1QFHbPt3zT9DcMPHd+13zzN1s+/hC2rKOo7NjeQdsxT5LEWrYjbdLw05eHtwWe9jl0542u62HZHZIVpalY/yIlP5X3MHYddLLZfy4fmYiBhNuB509vw+rG3tKY+kOwGHLi7W/cS91jS7v4s9TSnZHGLx8CICH9lXNDX+zpWfXuycnaBV2e3e567nAm4973qv0bzy1fD5qr5oEB7KXt0u7B3Loh7yhWVfypbOalh9+wr6U3mbfklLC5Hi1pDRE4ef7Wj+EEiZ+amqpvJT2bzWjJRLIPR3n9riA5i4DZg720DSIrlsrvHXSZ9p7ZGlrzSgirNcetqVp9/vz5FJTqj6JRejTdq6eBMzNpHP9s//QrF4bvrydfO6f1JrCX1mvcXlo98Kembjotr3wXwmrnp36J+pYNeh5JdqRem83O77gxkpxtW3bgOZ/g1HKJmt3U1Rw+3D+zrc89aunagnWzpq6PdxujLz388L4F78tdbtCEsJZ7BFq8/sHBoMPX/I9hyrGgnuDUUZzrnnz7yQu3HlxQQW2Ued++fZmJ1e5LoPB5k5ZpWCPXz+08du+99zrtAI0QVjuM4jL2YcIZeh+2+9wF49MFtYJSlgmHE0g/JlLWLJQPg7RmhtyXsJ18eja0tivsXhj6xy9ve/mRR5TRcG2ZmjyViN9NPkDN3Dz1FW5z9XM4i+s1ME1YcFNpUIrVLHzJzHnwjl0bn1twgW1UwPHjxxPXpztejR0HFTc+F3YXRwxdfdM9W08D0zrs4wtLaM5rkbCac1xaolWOvurhZIPIih0OdVm2haNTfqUlAFjCRnJP4HBn+iUqz6tVa2nGpTe/etsP2o2s2G8hrGqjL/FlEQC5GHghfplSUSMdvwaEA/9+4vjpa3c2stx2KIsfUek2dr+EuXNF2xEjSJx98w/tbFt7NiGsdniSl6EPp84O3W/Z1oPzXRms1GRKWdCJdeCIlJ+vlGYlh997r+70+EPH8NHJEtLCauCph+7bmj81ox1xEsJqx1Fdij4Zxi9AT2KSYBrtslgxhOD2gWOyz7AstFzx6zFHj1mGobYUYAgC9cHge3ddK5uhjQKFsNpoMJeqK6+8cm0X6noXiWUxHA8WxAdWNyQM45HFKL8dyiRpueM7jllmMGpnjO+1w9fNaxmXxiogaqlR0jQdAkeOBPjczrnOiQ6jw88ESSOA6KT7iQzOHEvavu1pZsLQg4QPP/DdZG9Xx/vWrOr+mfR03SvtNffdxleAQIgvTzjBT0w409Mpu2faufZy+vDhw5WPMa25dEnYqggIYbXqyNXY7i/jCyvdfmaVb5hdVsLp9LJGp43j1/1A7/RdvdMwPRzEboRnLVHe9vEvL3eXBOB4ZMta22H+TiqV2LJQ26u5u6Bju44Z3J7O/Lvp6cwPmBanOwQ4uNHRTWMK21bSvh1Mm642nTWCtKkH07rnTE72aOO0XZq7bIltVQSEsFp15HLthg5J/+aJE12m3tVjOPYq1/dW4cTjHnwMYhXOce8xDd3y/PJW6OpMdsTRVy4iK/rKMR/jwvz825VIHFzT3fkx13UW/dnhRy3GJyeeHEs7n1XNibUPFvY6vtGDw5vV9w0Vofn81qGhZfDhi3HX8SfQ/3HPMse9CWcCX0gel2OIFJIt+2fRH7qWRaYJG85NxldGzV4tGayFSLQ24+q9ULyu9gJfMU5ELTn6wUISTl03NHz1KzyiJLqmX657OLLdSJgoXTO7cBxyN172blier4YCvBsFdSNXV2dC35tKJrbzfPfFdjwvC/qs9MSMxxNRsSqmT6LhUDQHE+jUBE7UnATXTuLsrRn01K2l/x6+qItiR3TNG8V59KNB0DGSfNXGUXwJY2Gm+osNhpSvEBDCasIHgVLTt75/aQ0MnXpBNb2QgNYEntfr4wu/nBYpKQLtxtdwAh0SBX3VDe7nM/Ha5vf1Fb/CURS2bCTAWWuxR229qRsbQQQbUed61LfW14JVKKsTJ5sk8WUcHbtlNANyTOhgcmAGKH7p3m1FWpqtuZCu+LByVdKHVMjpKEQrBwIW9tnpXOIH+QTDSH/D9f0bmCLewDn1I4HmwtAypPDZ/oe9oXKf/aMPsWxSs/RR13FHrURiZE1gDR86tKHEdCDMKX+XCwEhrOVCvqBeHNaW6ui11/mWDtLQ1kEiWodXE4rwYgepAPssTPCMOjIdAk94TZ8pMZjch8HjDorGFUTUAwlkh64be0A9/ZCatiDZWtOyE7ClQmIdJICJFYhA+TRV4Fo5/QIHiUvrTEbkVRCxiJfsSBbfYk87OTExXxdazY5yUgiRKfpHQ1YSkONmAZY+gV4NIeVFfCXoLNA5h/Plb5LzWAyzF+IVXdNnvO/6GcsyhjC1vmWZ7s2pO3fdOqzriy9asnJxZREoerDLppDAhiIAEtCfO3F5rW0a6z1PX4/nf53nG5RqqrpieSnULEVh8cx4E7ugH78H8tG9eP/24oVezY+pkpA8b/abhPF8le75BqdsXUtaFeaTlTI2IByEoU1l8oq1mkokcZHElIRoWmpejMMCMyCvQXyy7JjjuUcgOl4tLCzCMpTHgFpcgkViX/dH/ax2Szf8m2Yqc/MN+1r7BM/C/rfCtRDWEozSkbMjq7NTY5t13dqE6dhG3wsSqlp+C9DDi0ifLrqmT1f6BgUaPjiHN0lJAGAfvpWcI4XjiHIMF6ocO/EjmMa9HeelQ1LT1PRpoce/sJwOTCQtc+kfGQp6Uxl+9JWtmL+jNEaJ0gKBgbsygR58B4sHfwV5aliVWg3vCHv6ymHcdG868IzrVsK6pnd71+/dsmXxbD3m3/W2ybn0T1/bQFe5I8euX+9ybuqbXMPbDA7ZCKV4uMOecyz+9OfmWvj9x9zEw6JW+JuOX298WhE6qtwLEV3TL1tb/AWj7sqwfqaro/sdmcyM+vBp2XzzDEzaBiQsNH+e+eeTjQ+ohwqnG0BYhfVzNYKrkOmpyauYYH8KvD8G6RPBszrC6Jq+ystl0ghzXEZjR5+O4+iZwTh+eG7Yqa5rq/3hGzzTSkXKn4YgIITVABjBP+ZzP7i8ydasrZCetuCHvIvFRs92SEdlpnCYE2LOQi12OA7RNf1yjrphHIyE9yOXPnfNMDg70DpdTf8DWDKs5rRvMVwChAWrUgh21HzllD0NrigqlxKVC7bKQuOOWeGiuI7OTkhb6T8C/Xw3xkel9cXxj6eIxiY3Hhx3X9dHsWJwDaa3l1+zd9Mt/F4tUk/ijWnP+/DBb8++LWqvnh0c7NDGta0pO7kl6zpb8AJzEUr91kYEFdeBRCt69Nm4+AsSl6jwjVGckY6VwPwUpLhLURx9xliWvxFHi/w+zB0SWCnLsVpxnoXesSI2ngp4zmRJXPgf/0IleGH51R6uwjeX5MR76qtITh7+8N9Cp4GF7Sm8Zl1s35pVXVomm/5c1vG+Wm284njHJeJq44/FjixUAld8w7uijW6+xo3MhW2S6+oIVHumqpewglJ87+LFtcFUcqur+1vxwPcZJqYPMOyhXw6GKI4+4/GwQpjCBhe+6XDIpFb06PM+np5hhS5eXzw9bLJ2pBLGv4Fe36BU4kA6IQGw8MUY6MJywVeqDs54Z69zrWdY7jI3G1ZtUiSV6zzDI3IqLLew/wu9jspl+yywrA1pEed5QceXPT3jBb/DLrA5ua5UHZ/4eMTbFx+fwvE3DJO8fANrjlctL7giJhRx9MrfR89R+VgJ1Y6currONuwd0FNsxwtV02mPlWGLy1TxlPHf6Hh8PH9xesvw9yRM+5PIRT2ZIgVKKZxWUY/PT8aTFPji0i3m4Ed1hDWV/7uY9bNGtiGqAyorJRWSqCgdkrQiR5KddrwPlsq8xfhG6efvx8dvtiQczDdmmPaldDBxSVYeZ3GJXxUMWzxq5d4fPz7Ym7X1HTAL2A7NqtJHEQ3qtCPjw3LoxB/v+OMZ5VVzR5aHWRuErYA+y4uu6fM+Xl9J/lh7bFvbY+vmv0bWos9tsXAWSLIiaSnyApHxJz6SbFSFuXTw8i86r5vVRW1m+6IHmUREAuI0lcREP5q2ztWPrO9/YK54xsXHI56+cePvj3qBfimZNS+J5FWMcrjptThsRd4dPX9+DcwEd5iQphwozfkCwJKaLv9ewHYKeicfSudwShcnJDBBOD3MTwGRO0cqLIj73jQTaejDBYaPHTBgJ/i5+HyYijd95sFhRzkzB7yL2IrCtGwezj9nOQVTUlfPwiicifnu5J0qHHd8mXHIG6ZD7JQqIk9kJK6QwAokMWRUhMaSeJ0vcfaiXNhs7PyuwpYV51Vh+EM/Pu2M9GckpyiOuZm2Wvtom+Y4me8xPbvIIujzPu6Wbvyt1ejL3U7Sv/v754ZHsORwaX3KGdwiJhO5pzY+Mivk/urVq52jTnIXlEc78LKu8qAMx/G8kHhyOicosz0ovM3IrIDKb15HSvDoOoqv+hMLYCOWI8ash0vmufryZVcqLz4u8fym3ov1xT/EVp4UDUTn4/iS0xW+sZTMojASmLqGp64iH4FRXJQ2TKj+lv7JVRTVxwQkm9APyaboGnGMzSVR6VR87ipsVT645ovOzi5tamb6zzB1/nqzjz+s9YetwLioZW5C8jq08K9+1IxS8yQsfF6ap1WL2BK8VOaJc6NbPcPrx7wJ++hmHQUPvOaQgMJ3ETtVlERDP0wVsQ19uPgcLQyt/Dc+p4jlL6k/1xa2qVyh5ApEzEoErm/DsPOTXV3de6anq36roFyRdYWVbVSshHJEMt98saIXfIu9koplYZL6m/hUz7kS/Jt0/PE8+Jj6X/Y6k+fv2tA1BKIvB/OC8WnGAmp5dpqx3XW36fjgYK/upXbhFd+BrRlqn16MfkrspkoC4hnirYjbUVWzs4rHx8uL3cerjwt0TA4RcBcsuX8Rn97q54okVsCKJJ9YkSvy1gJR4aOtnAr6OJP+L13d+BKBKMEzHhAfgDh6yzD+vqHjTDDvYpAxLqwEfVdbE9bpIEi6V27tdLP+LnzPrWS/XrRTnz5d4e79+LNY7r4kP+Z7Jv7z1LyPL0B4Tb+ci9cXLy+eJ54e8Rw//rqqcUR+HOrgYVprJbBl5E2w63oI64J7k8mUDZLGhmAXs19ucVkxP8gKQu4ptCxbMy2TW3KAGI4u1P207ztH3CDx/7bL+Cdse8h1Zy5ev7Dp8uHD7blJuy0J69TV8XW6l92Dl3cbLG6g98idbhDgdANcY1ZY9o2N4mpNr96GRf1Da3Wui0RW69F1bWslvp81LD2xDTOGu9DhQzBc7AcYfYlkAqo6A6ozqHNBYJTESGitTGShsp0qQSxT4AcoPJQw0LBlEPhBFakHDjoLvY+XgVIyg7WK77tG8n9pvpHXBbXL+OMBd7FN6KLu+uf27esbX9RHdIkLbxvCGhgYsDb3v2a7obt7YHakpKmYiqgE2ioqJbzIOszXcSov/DAzRRNehyJKvPx4+igv/ZLKEaCkoZxUFMYXE1I8f7Xyq/UHp9CkAlfbCF3NdlhS7IQguA0N2wiJYy1ktC5IISb1Okr5jSYruy2SGlYkIkKLSC3yy/WrUWGzSnjaTUX/QEhYQuNewLCdwBFKRkpOuAfr4sBnwwfDg6B0MHagORhBHNqHw5WxTwYav6lAt/42MBLfrYZXHO9w3Ftr/B0Hp0pY+tkD29ddAz5ln8NGjddSlNPyhHV8aKjbzAS7Dd3egRcvgRHJWyrHASw9Pyp+vlSxEluH0jWAGQF9VVZMpxHVRZ/xSKQU4PR5Xy0+/sLQZCFS9DN/XKtSeh5WrL2x+sMyZv+W67+vwz5eC7oDx12rm9pakNg639B68XL3Qh+2Bm94DySxHhg0daBHSQhiCbyyyMS9SDi8RhEHyYP1qD9qak0S4VGn5VYrSTRKEkKHWYYiHuQmCYb/YKYLqS+3H5LYckxJmz6qhSYJ5yNgzgtuclESpncBfN8Fj3lgJdCSGpHcGECoxrouMoHjzO+4evLLMB1VKxJV8Wyj8Q80Ix043jnTu32hlTdkh08Yn7UWcnio9Qs3pzZm0lN7LCOxIdIZxbuQ1+lAVFFxJB7aMeUIiPkiPRPjo2v6dPF4FVjHnxi/oQK0Az/bymf5uI7ayGLj6eM63nrbF5VNXzV7nv3HViQL3JAEaSV1z0iBNJIgJBCYkSKJYbdjEiSHw7a0BI5s6QBBbINUswMUsQ6E11UojZGccA9dcZDBdQY+TgyFTgkiEKYyIBvstAQzIRk8cBJ+A2j4gZFDFWAqjAp3V5IhQYYwwUJ57ByS0QINzMYK8FyrRxt3KNbXb2qG/UVNT5wDyCt6/A0boGbdqzPA4tD21SPquWihPy1FWHjQzYs3xnZkM95ePIZd8RccBx1xez/UPowp46I4+uVcLD9/8Plq0Gfy6Jp+uez5uqPyY+UtNN5DuVQc06drpv4bIDXsjtsMpdkOSC79QK4Xog3PzwF4IBNCBiIhpBSpoE8jioqWaM2KCRuOqwLXgIQItKIe0lCYD/lZjoqgGIo0+J++SsmMKA8eqQ21qHuUh2PfzQHN6vgG6vVK8GfmQhcbr3Yff+AEi3rtdCtNF8u/eIWD2ATXx4Mg0XH1Vr/hm7sDQw8PvyvTrriKWocEE0C6oM/kJRJHrAykgj6WGlq+JUifu6YfS6pu4/UVa6AgQcXKi78ApekhcWFBwMstEkTX9MvVHw+Lt2ex+4+Pg62CxgsHEwZbAdgWIJfA+ICkfDRYtyAwWWB7Ay8F8VT/KB0bOJ4Gx/CQfUKSwZGrJJs8iZHYgB0zMB+zk8hopQ8hEcEog2ERASIBAOL5fIrVIKLxXKtzKPZLgZUckvGf+/nH5HsK0+Uz3316zeAjj3D23Lwu90w0ZwNpiZ72UnvwfO/AXIFnXfLBxLOsHn6yiLqmr3oQ04LHX9hq6TFHI6txrlYWkHj98UT1lh8vryR/rIKq6aO204drdP8hRWF3itmLUw42QnW1CSTSA2IAIXkWOBYKLWw8wjVqNkEaFqjFwLQNJhWI4ZiFoiq6QX0SbsEo6HMoWVFCYprwjw6FP65BXCSoXJwiOwpnFK9A6yiWkQhRDwA9XAfpwLS/AqnqSKP7jwapquiznXFXMn6x8Yg/X/HySvLHKqiaPlZfvf0H6BloAM/v3tpzHkJwUx59Uxb4GE5Lfnt2ZGS16SX3+F5mq4llfegtwnaSR6J5EC8hPUV6IDaS6aDnoZ5DpYe6AtdgOr4pyhXLNPH0KKCo/DDP7N+S+mI6qHzbQr7AbdgW+iylWn0l5cf6E29ftfSN6L9lGl04x30tOtMHklmLhxpClW9BL4S1T+i2uNPRp+0FflD0AN9A9LHnmHGBBfJCE3QL9ALiguoJqiu+64gDzWGIIAlhzhaSDsMV/yjJi3BxyY9khP9BXBSzEMY/AFORGMmM1yyKZfmm+ZKuJf4uMHV1THEj+o+S864E7zYd/8Dliqp2MamvPbt9uw4dY/M4DnXTuMuXx/scK9iHLcbryzfKwvOJBSGNPl10Tb8WV0xYyMFymDdXXv46Kq+ueChJQI4WlSUqf8StOf5CNdXqr9afxe8/Gm6AoLAqGKyCGLSG350ACFzKM2FvaeOseEhFOsjItdQ2S6wYYmkOdl2+CfLBvmpIV55vYY2Qn6uAxAWC40zbhxSmWArcQj0TSIiSU37mx0kgVesgLereOSz8E5EWJa6Qzyh1hZEcO7xY4Ct9WLfNvwa+5xA2h6uGP6vMPxMsZ8WNf0Gf+cOCw9usq51a5+kNG9Sn1IjJsjoO0LI7EpVra/vxhPdFs7JyjYriohlbTAKGxO1C6oJEljseOLqmTxfPX66OucJK66OUNzuDjK7p05UIbGwX25I/vrj4BYrnD0uZ/Rtvfzz9fPsPIkgkbL0DZNMFRVEHFEY2ZCBTcwMLdfCsCCVN4SwpE9YG+ARNgD24IDHYSYB1yNCYDkLRFoC8oOUG40AKQx5IYyAmlQ6SF7dDoSof0hbJiApzqLs43aPc5UG+AvVQ/4T7nGQFQiJ5kdbAkmgH2Sz0FaWB4gLrad22v4nmuvPt/yzCc1+V4t0e4z93r8PYwDCvNANxLSthkai0jmCf5+jq6y6Y4SkjTfoKprgWufj9Dg3AozBmiK7pl3H8WDH3u0YfLY6u6c/HVS2vSvsxoygyTF2q/qNenEyjJ5NJPYGPRidME1M1/JYqwyoNq32Ihu4J0z5M+WA2DoqwEI9wfmEaEhQJzPNsKNOh0jJwrfRVJqbnNOrC6IGwQFzgHiKrpCuq2kE+FizrMXWE7IWCEKemg7hSiimOQchNIC3EchqpHlBO95TshQThkwF5TL9k+Mm/MZLGzVo3AlQdLzagDle1vCYd/wU9/5Z5ZcyZPnNow/J8ZHZZCGtsbKw3rdn7nIzTx42o0WfP1cPKuYJ6XPFs5q7p8zmKx5v8cdcxDeMPOR1fj+gh4X10TV/dukiC+nJPeLy8eH1hrtm/UVvpKxcrP2oL/dlcs1eQ9PCeo73wGcp+R2Xyvlp74vH19B9EkoA2CYKUlcQqJCQj6vkoyBjh/IurcJiy4Zxy2FMptRBO7sK3kClR0UYUZAX+wMqfC1ICiYHMYBsKSQsSFKaAUEqZLoiK00ASFsgpN0UEUWE6yOkiiArE6NmUb91OWwAAEuNJREFUszCNxA0c/uBoF04W86YOarWQAYjGmHBBEIkUiXEqib025hNmInWknv6zKo77Sh3/RvcfSx5Xl4O4yr5Y7NxiuEEQFT4uvs8yrF5VvosX28LLS185vsiRHkc9YPiJtrCbJIzHyx3gJdfpl80flZWPR6qIxJghus7xjSqj4E9UNn2VvN76Csqq6XIR+48OYEeGlcAaXhLfQwxNQcgQEI9IErOOxBUuCuDLz9Arm5iyOTaYy7Jty8hAb2VCm43ZmwnwQTbgFpAWyA4SGEKhaMdgYNpngKAcpeMCAfFjYGE4yAqco3RZ0LorUqOkxVkf6AgzvFBPFbISSsOUD+WRrWijpcwbmI4Gomj4yxAIv4bPVU+q9sfxk/EP36UlfP49N3vNWr/m9CZdX/zzjDDofAoW3XHVr9NPHdB8p2+uORl/mjFLUktMbBTtkSJbpLCRxYyD5OpJps/4+DJuvq5IIgoLqfi3pLzcRuloM7QSzKImsBSWG80LVKkxkSvOkFHaCjL5QvrPN9rwvaSVtEg2ICmQCNRQkGjwnlOpNktMxdds+GxcRFrIyCmhTQMEUJjl4qwtzPbAOVC8o0DUZroGiMmBpEUfRBZ4DvRUJC4/1GOpij1ML9XU0PJdFxIZGsOpJkkOQ0YdFh5CPodKl0WfRqQkVUhTIEf1iN4GkdJU4Rx/xsJfHkpfMv4cd+IAUJb1+YdkfSU7NXp6+/bti7qquKiEdfVq0Gl2TO2DonYzAcUTCv0slCB8FuGia/q8j7iAPl30aNIPHVKq55w+00MvjFLo05WmV8H5P9XLzydVF/H0xbGl9UGfjm226B98po2u6fO+0f3H9M7SbT1h+FoS00ybSmm+5/RZHxzbwWvVHtSvNuLRR4BKl0vPtHRhWh1SESUsNBkH0qjvNiAx4MA1JDBc4yBmTPmwJArJCFM+dA1SE5XsmFIqRTzKUrZYkMio78IUkauFoW6Mcbin1GWrOR8nqOEUEUQFmuK3ZdEw6NFg92s9j3XLp0CIsAuS8VdPkcKhCZ9/KAc81x/c3NdzFjy6KHZc0YPNh7VhDg9jYnh4co9n2dvx1nLalys7Rimx2xLGigfEJBQ0Xr149FkBVb04BQiTlPAFbTiDxRGKM1pJf5AgarPKG0sQu413N07hkCANO5m0fSebtCwziW5DqMISHTRMJCDF23inYbmsauNCHq+Vn1ta5dErzKN8psP/RiIXVpAegKJQ30Y06AQSEXdAIpdL0wbTNsLpoSIeCwRJHZYBpTusIFAIlPC0iqL5AxoCcmLPQkkLdITRCc0dSFqQD1A51g4pLOXmhZCwDMO2BpH9q6ZtDoU4oKQIy5yEynFnv+mzw+0+/q3Sf5yT4aYs89zq1alLIK7wYeQANcCpgW5AOaqIARzxcudrXrMTz+cuFAxBI1Rw06eLKz3xsnDikt+Mmr9mWBlXrbySeJAlTt8MXJImXHRNv0zx2GpWZ3r0KKqzXHlRHH26+fQf+mkbg56ADjppUuihMJl7BEhGtmnj+4Phj1lEUAzjaQcgJkzcqPPmlI/yjdJV8Trf/+hbeYyP0uMS0zSVF8SEaSELxkhR6a7IC1IVHkNMBWEkCljxYQ7YXgWKrDCHw2ohJDDKSkr5Tst3TANBp7DdgkTFKSOpxYMtV2i3hXQoJjwbBo3L4oibAajdXmSbCl01PEvi6x3PetMvwfi3cv+xHpPRk8GZvo6Oq5y5FvZlvtfqQZ5v5igfH7iRdHqrn/H24McyEb6ejCUxkCwqEATi8JDNKtWRIxI6wrLj+aOyQgIqLT/KTZ+OLYnCFGHE60PdSgzIgVmcfrbt5evjYkB97VeNyv8plx/UYoChElhYgB7KtD3PAUWRpejIVNzNAjNzyDuYRqnrMF5dIx4CkTrlAJQRps2FhZIX5lqYwfFLOygTBeSmkUhDEgNvIC7MR5ML6JhozoCpn+858G1utbH4j7BRT0Z9VlZzbTyOKJCKeCjkqYbkFBJh+DXCPVcKuXKIFURlm8WBoZSFOBCYmk6i33ioT+Kw1CegEMspcFfe+M8+rRySNum/YUwm9I7TPT04NWOBDg/nwtz16xMbEp3mPswIOuI6G7wBSlynz1pQWZEIP0smIcEEWN3QsfJDn+nj9FFSPh73wilgdE2f+eOumo4pPqWI2kI/LKu4RVXLq7H/kJopRUFhnkj4joNT9KC/BlZgAIVD1I+cwASVUBgCIsF1KEQxJLpGPKHGP5LYrAs5ikREnmJ61KF4K5cG1+REVS6HC1JauGroYYcOrLWUEp6MSF0UpoZgK5hV2dgEzeNLYbMBnRQZEUPnOwGMT6GOp57Kg/0WTCMYjnsQHpDmlJFTR5IcNt/alvV1PdF5NsKcLSpGG03L6QcjnWDpeIXqgFYb//A9wGi1+fMPDeqY7nae6uvT530KKp+JebkhHJyX6Fqz33X83tCgRr1d6gXBH+XnFtEwDmEVMBfAtbK7UvHxVTb1gGLQokbFVBZMDtUJHmT+dsPxmqSRU2nkrxkWxhfbOfEVwLov4sIaonSRr1qZy6vy8xliPbn+qPjYHxSm6mJwdB357DfaVtJ/BMLeW0/ayVQSR6TA5AB7h8kwmFeRrFBUSFYkJk7GsM+F5SuiCQmFBEriCskHYcxfEM9ozBjBS/yaKD//rBzndjD3BHswAcmqwFdhOWGugCw5owwpEt9sxMlVGWQEK4GlcAOi1XAcL6eLICfdcMFmNDnH7xdO/YTCHTkxM2B6EiSPbuXmHrZO5eJy4Iu6lfo2Gu8orFfA+PM9UMjnHpBIx9v+/Q9Wm8nMfcMTE1d7u7vP4Ec6fzy1wqOGP3xI63JHjgT2/rsy/boTbMP0pe78dVUWS5wjK0VUjIqNN3kA62ZYeIcfxofXDFNFUZBTT4W6m71mWBlXrb4yWSoEYWh0jVIUdJEmzA6o18mRDN7dCplCEkK8IiP4WRAU9OO8j5wimZB3SAhKYlJEphLkJCaSEP7PEdxsfVG5UWFxP6qPPngTlvBED6IWLN8dTPmg8ocFPPRXWBdlFWqqCEmLlhAgLRtKdLaAkpQNfRUM6DUQGOUiTimNEaT7FvRVw/F6K91XG4/mHf9KPaovvJ36jzfSS1mpc6mUdhnvhZL4a0GjZsKBKK+n0+kt0AHvztCAsIzjeeAeUKVPF1l101cBWCICxcGmcPalUeHRnyguIsJYej79fFnpKxdjrKhu+spVK69Ke+OW6SXlh7Xk/8b7D5umJKY6nUiQAEmp5ZKoD5Ay8kTFzcAsJIrL+ZREYCWAaU4ubXRNP8wfpuSuGubHMwCJhSuGPCiYJIMw5GV6xkfY0Wd+WoPiBAlEhvnzNluw3SKZYTkQHIQ5J1RQDg7Lw/QQGUIdFp4wcC9KgQ/7KkxjucEHROVmc3ZaCFfEjMxUvlPvBZ0WhT1Q1zG06hQKyGPA9qEh4bPRJuO/0p//WvoPyXpa77BPr9L1mn64QiJRT0vlP3jg1oyn0/th1dnN6VOkQyh8wVRuPpLUH9GHi+sckD4vLaj43NSHLwfv8cKjbGxdgc97JUpFpIRbpovKYHTUltkpHYkyEqNYf1gWfZU+Vn+JiMZERS4qKyTAMv1hmwoItLT/aL6OL9cn8A4mknhDkR5CUuh43ExhAXjnIQVxRQ9UwnU1JM73meHISINzlY/1Ir3jwNQBtui5IpU3K2mFZbEUEhgJiHlZhkqI8rws7hPFxBHlZ5romu1CGRSv2HyQEQiLPkwefJcSk2o0mU+F8Z46KswbKd8qvRUWiq7BsuoYlF/q+Jd839p4/KNnFHhw+Fbc819r/y3dHO7qsk9D2lLPBvEq59SLXC6CYSCq1OTk5F48g+FxLyQSvvyzhFK8taaYL1ACiYdkkSOg/HVO4irmAySLlR8+yHy5wnaWysTF7YmnRxdyecMXFDcxx3KjNCUEGUtb2r4Iixwh5qebxEG58v2Hkh0ERqlLp5kClNLkngLSyF8XExrZi089SYbFm9DRg1FCbEKyoxQE8sqFkTOgTwrDVIPCP/k8qpRcGrxMEXmxnpwjUeXbhjpgA2bBNsp0HPQWOiwNOnddw5YcNIdSFyzTlUKehEbrLDxDNn7osjCXPw5FO22qgPfKHn/pf8XxxxetvSvYlX8BxBVKCdGDmPPDhz0W+Oijjxof//jHt+Hh2oko/qKqFx4l0BJQmQIwS3RNn/fxZXqGFbq4nQzimI9tKFs+S1S1KJ9XoQkEfUQwtKg98fSzefMMwmx5F28/IqK2RLjM2b54/gX0H0v6+IiDZSVgHJogfYWNzDMUpCtsUkKg4pKIUJAsnNTlkjNWzfBCPMOhi8JAiCSqPBmyMFVQ1OdctQwLywNZ5cPCpDl80D6IhjzBASQF0sUeREpSJCyE4ceSpJXbEO2612AHepaTSRn/YrtEAD3n8xV/ntv4+S96nyGRO9gccQZmEPiBK3bRi5kPHcG+v2T32n2+53bxNY8oQyWIB0SR9OmqxMeTh5lm/8azx8srEbCQNSqTpUTX+eagwCiPqiWeQAXO/olHV2tPaYUFjWCxsQJjt7MV564K6iOB2Xj1adNGa3PqDMFl4XwSSnAQCUIibqFPlwtTwbiOkoSR+JvLx3KYv9BXaSrlLyifSegQBNMFTAWhiIeFArRZnoX+8Y2EzKhbnuNlYO9wFpZXkwoH5Kmj/6qOFTz+0n8+Y4Y/2pVIcJqY35+YJ6wjEN33ZzL9kPY3hWjx6Sv+RcByLIQAZZYQJSn2C944FRF/QkvjQ31XZDcV04GVPOGl+WdJEhVGbaNPV3d7Va7ZP83U/1ACgzTjkg4gjUFvHhGWkrPAPnnBLNeFSEKKfAbzOu9yBAUdVj6cZURpZuU3XOUILioD93x2IEnxxFGc9c6M+M93cHSNZVzHquBQDeMn4x898wQ2us7pgGvAbyU8/z5e5EupVEqtJirCgp4KHxVI7sbrQIYKHyKF3+yvIvEEX8FsQNk9qXwgBpgQwNo7p9OKrukzfdzF08+WTmYrV35YF+tU8bEpYImInGtLVH+8PkzZ8iQcVpjrawXCLOHH5uo/9JmWjbXHJMQcNhVW8bOklbsumnJw7Q+cgtVK2mJxAUNNKKncp54KHuzAwnjCE01B1UIHA1A80ik/IkdIfTj6mE8MXh2sSKZhdHUd+IcDykwFLj4eMv7Fv+il75c8/xEmeHaojD+jZ4LgbsPVVvO5iutg4oSAFCCiAqVp/jrUKRU8mzVexsube05ff3tiD0Q1wkP/ojrYgeiaftiheHsjLKL4GrudTxYvb0H9h94bpzeAwCD4cAqJf5SmlBjFH5D8ChVC1Q8KyIkrjtgbE64y4lqtINJHel5Hq4q4ZdsYzsWBWaU+rkFWtFzQbiNNnWciNbT/qD4+Hitq/FdE/3mWzmvQU+W4hZZPenQuRHRNfylcvfVjpUqz0Tj6dNE1/fm4euufTx1z5am3/hr6z6lj9A9ElneKwPJ3IYEVEpqKys0YFeUhoDBP4TV/+bjVIkfqKuu8/ixC/+tqR73111V4DYnrrb+G8a+h1tkk9dY/m7MxV7XUzwdP3ApBgCYG6Co+L6/+kcB4X0g0ERFFzwXjojBc5q8ZhqOKtWEoROmLEwSWBIHowVySyqSS5kIABEYhisRFEov8SgRWGD6K9OMgq8IwBIkTBBYXASGsxcW3pUoHgfF5iIiLPv9x+03kuLxMqaqsUj1KJL4gsFgICGEtFrJtUG6OwDhtJHHhqLOl+dBAG0AnXRAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBAFBQBAQBAQBQUAQEAQEAUFAEBAEBIGVhMD/D0fV/fpMMM+gAAAAAElFTkSuQmCC"}},eT={noticeBar:{text:[],direction:"row",step:!1,icon:"volume",mode:"",color:"#f9ae3d",bgColor:"#fdf6ec",speed:80,fontSize:14,duration:2e3,disableTouch:!0,url:"",linkType:"navigateTo",justifyContent:"flex-start"}},tT={notify:{top:0,type:"primary",color:"#ffffff",bgColor:"",message:"",duration:3e3,fontSize:15,safeAreaInsetTop:!1}},nT={numberBox:{name:"",value:0,min:1,max:Number.MAX_SAFE_INTEGER,step:1,integer:!1,disabled:!1,disabledInput:!1,asyncChange:!1,inputWidth:35,showMinus:!0,showPlus:!0,decimalLength:null,longPress:!0,color:"#323233",buttonWidth:30,buttonSize:30,buttonRadius:"0px",bgColor:"#EBECEE",disabledBgColor:"#f7f8fa",inputBgColor:"#EBECEE",cursorSpacing:100,disableMinus:!1,disablePlus:!1,iconStyle:"",miniMode:!1}},iT={numberKeyboard:{mode:"number",dotDisabled:!1,random:!1}},sT={overlay:{show:!1,zIndex:10070,duration:300,opacity:.5}},rT={parse:{copyLink:!0,errorImg:"",lazyLoad:!1,loadingImg:"",pauseVideo:!0,previewImg:!0,setTitle:!0,showImgMenu:!0}},oT={picker:{show:!1,popupMode:"bottom",showToolbar:!0,title:"",columns:[],loading:!1,itemHeight:44,cancelText:oe("up.common.cancel"),confirmText:oe("up.common.confirm"),cancelColor:"#909193",confirmColor:"",visibleItemCount:5,keyName:"text",valueName:"value",closeOnClickOverlay:!1,defaultIndex:[],immediateChange:!0,zIndex:10076,disabled:!1,disabledColor:"",placeholder:oe("up.common.pleaseChoose"),inputProps:{},bgColor:"",round:0,duration:300,overlayOpacity:.5,pageInline:!1}},aT={popup:{show:!1,overlay:!0,mode:"bottom",duration:300,closeable:!1,overlayStyle:{},closeOnClickOverlay:!0,zIndex:10075,safeAreaInsetBottom:!0,safeAreaInsetTop:!1,closeIconPos:"top-right",round:"20px",zoom:!0,bgColor:"",overlayOpacity:.5,pageInline:!1,touchable:!1,minHeight:"200px",maxHeight:"600px"}},lT={radio:{name:"",shape:"",disabled:"",labelDisabled:"",activeColor:"",inactiveColor:"",iconSize:"",labelSize:"",label:"",labelColor:"",size:"",iconColor:"",placement:""}},cT={radioGroup:{value:"",disabled:!1,shape:"circle",activeColor:"#2979ff",inactiveColor:"#c8c9cc",name:"",size:18,placement:"row",label:"",labelColor:"#303133",labelSize:14,labelDisabled:!1,iconColor:"#ffffff",iconSize:12,borderBottom:!1,iconPlacement:"left",gap:"10px"}},uT={rate:{value:1,count:5,disabled:!1,size:18,inactiveColor:"#b2b2b2",activeColor:"#FA3534",gutter:4,minCount:1,allowHalf:!1,activeIcon:"star-fill",inactiveIcon:"star",touchable:!0}},fT={readMore:{showHeight:400,toggle:!1,closeText:oe("up.readMore.expand"),openText:oe("up.readMore.fold"),color:"#2979ff",fontSize:14,textIndent:"2em",name:""}},dT={row:{gutter:0,justify:"start",align:"center"}},hT={rowNotice:{text:"",icon:"volume",mode:"",color:"#f9ae3d",bgColor:"#fdf6ec",fontSize:14,speed:80}},pT={scrollList:{indicatorWidth:50,indicatorBarWidth:20,indicator:!0,indicatorColor:"#f2f2f2",indicatorActiveColor:"#3c9cff",indicatorStyle:""}},gT={search:{shape:"round",bgColor:"#f2f2f2",placeholder:oe("up.search.placeholder"),clearabled:!0,focus:!1,showAction:!0,actionStyle:{},actionText:oe("up.common.search"),inputAlign:"left",inputStyle:{},disabled:!1,borderColor:"transparent",searchIconColor:"#909399",searchIconSize:22,color:"#606266",placeholderColor:"#909399",searchIcon:"search",iconPosition:"left",margin:"0",animation:!1,value:"",maxlength:"-1",height:32,label:null}},mT={section:{title:"",subTitle:oe("up.common.more"),right:!0,fontSize:15,bold:!0,color:"#303133",subColor:"#909399",showLine:!0,lineColor:"",arrow:!0}},xT={skeleton:{loading:!0,animate:!0,rows:0,rowsWidth:"100%",rowsHeight:18,title:!0,titleWidth:"50%",titleHeight:18,avatar:!1,avatarSize:32,avatarShape:"circle"}},yT={slider:{value:0,blockSize:18,min:0,max:100,step:1,activeColor:"#2979ff",inactiveColor:"#c0c4cc",blockColor:"#ffffff",showValue:!1,disabled:!1,blockStyle:{},useNative:!1,height:"2px",innerStyle:{}}},vT={statusBar:{bgColor:"transparent",height:0}},ET={steps:{direction:"row",current:0,activeColor:"#3c9cff",inactiveColor:"#969799",activeIcon:"",inactiveIcon:"",dot:!1}},AT={stepsItem:{title:"",desc:"",iconSize:17,error:!1}},ST={sticky:{offsetTop:0,customNavHeight:0,disabled:!1,bgColor:"transparent",zIndex:"",index:""}},TT={subsection:{list:[],current:0,activeColor:"#3c9cff",inactiveColor:"#303133",mode:"button",fontSize:12,bold:!0,bgColor:"#eeeeef",keyName:"name",activeColorKeyName:"activeColorKey",inactiveColorKeyName:"inactiveColorKey",disabled:!1}},bT={swipeAction:{autoClose:!0}},_T={swipeActionItem:{show:!1,closeOnClick:!0,name:"",disabled:!1,threshold:20,autoClose:!0,options:[],duration:300}},IT={swiper:{list:[],indicator:!1,indicatorActiveColor:"#FFFFFF",indicatorInactiveColor:"rgba(255, 255, 255, 0.35)",indicatorStyle:"",indicatorMode:"line",autoplay:!0,current:0,currentItemId:"",interval:3e3,duration:300,circular:!1,previousMargin:0,nextMargin:0,acceleration:!1,displayMultipleItems:1,easingFunction:"default",keyName:"url",imgMode:"aspectFill",height:130,bgColor:"#f3f4f6",radius:4,loading:!1,showTitle:!1}},CT={swiperIndicator:{length:0,current:0,indicatorActiveColor:"",indicatorInactiveColor:"",indicatorMode:"line"}},LT={switch:{loading:!1,disabled:!1,size:25,activeColor:"#2979ff",inactiveColor:"#ffffff",value:!1,activeValue:!0,inactiveValue:!1,asyncChange:!1,space:0}},RT={tabbar:{value:null,safeAreaInsetBottom:!0,border:!0,zIndex:1,activeColor:"#1989fa",inactiveColor:"#7d7e80",fixed:!0,placeholder:!0,borderColor:"",backgroundColor:""}},wT={tabbarItem:{name:null,icon:"",badge:null,dot:!1,text:"",badgeStyle:"top: 6px;right:2px;",mode:""}},DT={tabs:{duration:300,list:[],lineColor:"",activeStyle:{color:"#303133"},inactiveStyle:{color:"#606266"},lineWidth:20,lineHeight:3,lineBgSize:"cover",itemStyle:{height:"44px"},scrollable:!0,current:0,keyName:"name",iconStyle:{}}},PT={tag:{type:"primary",disabled:!1,size:"medium",shape:"square",text:"",bgColor:"",color:"",borderColor:"",closeColor:"#C6C7CB",name:"",plainFill:!1,plain:!1,closable:!1,show:!0,icon:"",iconColor:"",textSize:"",height:"",padding:"",borderRadius:"",autoBgColor:0}},kT={text:{type:"",show:!0,text:"",prefixIcon:"",suffixIcon:"",mode:"",href:"",format:"",call:!1,openType:"",bold:!1,block:!1,lines:"",color:"#303133",size:15,iconStyle:{fontSize:"15px"},decoration:"none",margin:0,lineHeight:"",align:"left",wordWrap:"normal",flex1:!0}},BT={textarea:{value:"",placeholder:"",placeholderClass:"textarea-placeholder",placeholderStyle:"color: #c0c4cc",height:70,confirmType:"done",disabled:!1,count:!1,focus:!1,autoHeight:!1,fixed:!1,cursorSpacing:0,cursor:"",showConfirmBar:!0,selectionStart:-1,selectionEnd:-1,adjustPosition:!0,disableDefaultPadding:!1,holdKeyboard:!1,maxlength:140,border:"surround",formatter:null}},FT={toast:{zIndex:10090,loading:!1,message:"",icon:"",type:"",loadingMode:"",show:"",overlay:!1,position:"center",params:{},duration:2e3,isTab:!1,url:"",callback:null,back:!1}},OT={toolbar:{show:!0,cancelText:oe("up.common.cancel"),confirmText:oe("up.common.confirm"),cancelColor:"#909193",confirmColor:"",title:""}},MT={tooltip:{text:"",copyText:"",size:14,color:"#606266",bgColor:"transparent",direction:"top",zIndex:10071,showCopy:!0,buttons:[],overlay:!0,showToast:!0,popupBgColor:"",triggerMode:"longpress",forcePosition:{}}},NT={transition:{show:!1,mode:"fade",duration:"300",timingFunction:"ease-out"}},UT={upload:{accept:"image",extension:[],capture:["album","camera"],compressed:!0,camera:"back",maxDuration:60,uploadIcon:"camera-fill",uploadIconColor:"#D3D4D6",useBeforeRead:!1,previewFullImage:!0,maxCount:52,disabled:!1,imageMode:"aspectFill",name:"",sizeType:["original","compressed"],multiple:!1,deletable:!0,maxSize:Number.MAX_VALUE,fileList:[],uploadText:"",width:80,height:80,previewImage:!0,autoDelete:!1,autoUpload:!1,autoUploadApi:"",autoUploadAuthUrl:"",autoUploadDriver:"",autoUploadHeader:{},getVideoThumb:!1,customAfterAutoUpload:!1,videoPreviewObjectFit:"cover"}},qg={...QS,...YS,...XS,...JS,...ZS,...e8,...t8,...n8,...d8,...h8,...p8,...g8,...m8,...x8,...y8,...v8,...E8,...A8,...S8,...T8,...b8,..._8,...I8,...C8,...L8,...R8,...w8,...D8,...P8,...k8,...B8,...F8,...O8,...M8,...N8,...U8,...$8,...H8,...G8,...K8,...j8,...q8,...W8,...z8,...Q8,...Y8,...X8,...J8,...Z8,...eT,...tT,...nT,...iT,...sT,...rT,...oT,...aT,...lT,...cT,...uT,...fT,...dT,...hT,...pT,...gT,...mT,...xT,...yT,...vT,...ET,...AT,...ST,...TT,...bT,..._T,...IT,...CT,...LT,...RT,...wT,...DT,...PT,...kT,...BT,...FT,...OT,...MT,...NT,...UT};function $T(i){di(Zn,i.config||{}),di(qg,i.props||{}),di(fo,i.color||{}),di($c,i.zIndex||{})}if(j&&j.upuiParams){j.__f__("log","at node_modules/uview-plus/libs/config/props.js:206","setting uview-plus");let i=j.upuiParams();i.httpIns&&i.httpIns(Hc),i.options&&$T(i.options)}let ho="none";ho="vue3";ho="mp";ho="weixin";const HT=ho;let GT=["primary","success","error","warning","info"];function Wg(i){kn.shallowMerge(Zn,i.config||{}),kn.shallowMerge(qg,i.props||{}),kn.shallowMerge(fo,i.color||{}),kn.shallowMerge($c,i.zIndex||{})}kn.setConfig=Wg;const Uf={route:wl,date:kn.timeFormat,colorGradient:Gs.colorGradient,hexToRgb:Gs.hexToRgb,rgbToHex:Gs.rgbToHex,colorToRgba:Gs.colorToRgba,test:Og,type:GT,http:Hc,config:Zn,zIndex:$c,debounce:CS,throttle:LS,calc:kS,mixin:Kg,mpMixin:bS,...kn,color:fo,platform:HT},KT=(i,e="")=>{if(e){j.upuiParams=e;let t=e();t.httpIns&&t.httpIns(Hc),t.options&&Wg(t.options)}j.$u=Uf,i.config.globalProperties.$u=Uf,i.mixin(Kg)},VT={install:KT},jT={"^u--(.*)":"@/uni_modules/uview-plus/components/u-$1/u-$1.vue","^up-(.*)":"@/uni_modules/uview-plus/components/u-$1/u-$1.vue","^u-([^-].*)":"@/uni_modules/uview-plus/components/u-$1/u-$1.vue"},qT=[{path:"pages/auth/login",style:{navigationBarTitleText:"",navigationBarTextStyle:"black",enablePullDownRefresh:!1,navigationStyle:"custom","app-plus":{bounce:"none"}}},{path:"pages/home/living",style:{navigationBarTitleText:"",navigationBarTextStyle:"black",enablePullDownRefresh:!1,navigationStyle:"custom","app-plus":{bounce:"none"}}},{path:"pages/user/index",style:{navigationBarTitleText:"",navigationBarTextStyle:"black",enablePullDownRefresh:!1,navigationStyle:"custom","app-plus":{bounce:"none"}}},{path:"pages/list/index",style:{navigationBarTitleText:"直播列表",navigationBarTextStyle:"black","app-plus":{bounce:"none"}}},{path:"pages/games/index",style:{navigationBarTitleText:"",navigationBarTextStyle:"black",enablePullDownRefresh:!1,navigationStyle:"custom","app-plus":{bounce:"none"}}},{path:"pages/auth/findpass",style:{navigationBarTitleText:"",navigationBarTextStyle:"black",enablePullDownRefresh:!1,navigationStyle:"custom","app-plus":{bounce:"none"}}},{path:"pages/auth/h5WxLogin",style:{navigationBarTitleText:"",navigationBarTextStyle:"black",enablePullDownRefresh:!1,navigationStyle:"custom","app-plus":{bounce:"none"}}},{path:"pages/auth/loginIndex",style:{navigationBarTitleText:"",navigationBarTextStyle:"black",enablePullDownRefresh:!1,navigationStyle:"custom","app-plus":{bounce:"none"}}},{path:"pages/auth/register",style:{navigationBarTitleText:"",navigationBarTextStyle:"black",enablePullDownRefresh:!1,navigationStyle:"custom","app-plus":{bounce:"none"}}}],WT=[{root:"pages_shop",pages:[{path:"cart",style:{navigationBarTitleText:"购物车","app-plus":{titleNView:!1}}},{path:"goods",style:{navigationBarTitleText:"商品详情",enablePullDownRefresh:!1}},{path:"store",style:{navigationBarTitleText:"",enablePullDownRefresh:!1,navigationStyle:"custom",navigationBarTextStyle:"black","app-plus":{bounce:"none"}}},{path:"order",style:{navigationBarTitleText:"我的订单",navigationBarTextStyle:"black","app-plus":{bounce:"none"}}},{path:"confirmCreateOrder",style:{navigationBarTitleText:"确认订单",navigationBarTextStyle:"black","app-plus":{bounce:"none"}}},{path:"paymentOrder",style:{navigationBarTitleText:"支付订单",navigationBarTextStyle:"black","app-plus":{bounce:"none"}}},{path:"confirmPackageOrder",style:{navigationBarTitleText:"确认支付",navigationBarTextStyle:"black","app-plus":{bounce:"none"}}},{path:"storeOrder",style:{navigationBarTitleText:"订单",navigationBarTextStyle:"black","app-plus":{bounce:"none"}}},{path:"refundOrder",style:{navigationBarTitleText:"申请售后",enablePullDownRefresh:!1}},{path:"refundOrderProduct",style:{navigationBarTitleText:"订单售后",enablePullDownRefresh:!1}},{path:"storeOrderRefundList",style:{navigationBarTitleText:"我的售后",enablePullDownRefresh:!1,navigationBarBackgroundColor:"#ffffff",navigationBarTextStyle:"black"}},{path:"storeOrderRefundDetails",style:{navigationBarTitleText:"售后详情",enablePullDownRefresh:!1,navigationBarBackgroundColor:"#FF5C03",navigationBarTextStyle:"white"}},{path:"storeOrderRefundSubmit",style:{navigationBarTitleText:"提交售后",navigationBarTextStyle:"black",navigationBarBackgroundColor:"#ffffff"}},{path:"success",style:{navigationBarTitleText:"支付成功",navigationBarTextStyle:"black","app-plus":{bounce:"none"}}},{path:"storeOrderDelivery",style:{navigationBarTitleText:"物流信息",enablePullDownRefresh:!1}}]},{root:"pages_user",pages:[{path:"address",style:{navigationBarTitleText:"收货地址","app-plus":{titleNView:!1}}},{path:"integral",style:{navigationBarTitleText:"我的芳华币",enablePullDownRefresh:!1,navigationBarBackgroundColor:"#ffffff",navigationBarTextStyle:"black"}},{path:"integralGoodsList",style:{navigationBarTitleText:"芳华币商城",enablePullDownRefresh:!1,navigationBarBackgroundColor:"#ffffff",navigationBarTextStyle:"black"}},{path:"addAddress",style:{navigationBarTitleText:"新建收货地址",navigationBarTextStyle:"black","app-plus":{bounce:"none"}}}]}],zT={navigationBarTextStyle:"black",navigationBarTitleText:"【S直播】",navigationBarBackgroundColor:"#f5f5f5",backgroundColor:"#f7f8fa"},QT={},zg={custom:jT,pages:qT,subPackages:WT,globalStyle:zT,uniIdRouter:QT};var YT=[];function XT(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function $t(i,e,t){return i(t={path:e,exports:{},require:function(n,s){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(s==null&&t.path)}},t.exports),t.exports}var JT=$t(function(i,e){var t;i.exports=(t=t||function(n,s){var r=Object.create||function(){function g(){}return function(y){var v;return g.prototype=y,v=new g,g.prototype=null,v}}(),o={},a=o.lib={},c=a.Base={extend:function(g){var y=r(this);return g&&y.mixIn(g),y.hasOwnProperty("init")&&this.init!==y.init||(y.init=function(){y.$super.init.apply(this,arguments)}),y.init.prototype=y,y.$super=this,y},create:function(){var g=this.extend();return g.init.apply(g,arguments),g},init:function(){},mixIn:function(g){for(var y in g)g.hasOwnProperty(y)&&(this[y]=g[y]);g.hasOwnProperty("toString")&&(this.toString=g.toString)},clone:function(){return this.init.prototype.extend(this)}},l=a.WordArray=c.extend({init:function(g,y){g=this.words=g||[],this.sigBytes=y!=s?y:4*g.length},toString:function(g){return(g||f).stringify(this)},concat:function(g){var y=this.words,v=g.words,x=this.sigBytes,E=g.sigBytes;if(this.clamp(),x%4)for(var S=0;S<E;S++){var T=v[S>>>2]>>>24-S%4*8&255;y[x+S>>>2]|=T<<24-(x+S)%4*8}else for(S=0;S<E;S+=4)y[x+S>>>2]=v[S>>>2];return this.sigBytes+=E,this},clamp:function(){var g=this.words,y=this.sigBytes;g[y>>>2]&=4294967295<<32-y%4*8,g.length=n.ceil(y/4)},clone:function(){var g=c.clone.call(this);return g.words=this.words.slice(0),g},random:function(g){for(var y,v=[],x=function(T){var _=987654321,I=4294967295;return function(){var w=((_=36969*(65535&_)+(_>>16)&I)<<16)+(T=18e3*(65535&T)+(T>>16)&I)&I;return w/=4294967296,(w+=.5)*(n.random()>.5?1:-1)}},E=0;E<g;E+=4){var S=x(4294967296*(y||n.random()));y=987654071*S(),v.push(4294967296*S()|0)}return new l.init(v,g)}}),u=o.enc={},f=u.Hex={stringify:function(g){for(var y=g.words,v=g.sigBytes,x=[],E=0;E<v;E++){var S=y[E>>>2]>>>24-E%4*8&255;x.push((S>>>4).toString(16)),x.push((15&S).toString(16))}return x.join("")},parse:function(g){for(var y=g.length,v=[],x=0;x<y;x+=2)v[x>>>3]|=parseInt(g.substr(x,2),16)<<24-x%8*4;return new l.init(v,y/2)}},d=u.Latin1={stringify:function(g){for(var y=g.words,v=g.sigBytes,x=[],E=0;E<v;E++){var S=y[E>>>2]>>>24-E%4*8&255;x.push(String.fromCharCode(S))}return x.join("")},parse:function(g){for(var y=g.length,v=[],x=0;x<y;x++)v[x>>>2]|=(255&g.charCodeAt(x))<<24-x%4*8;return new l.init(v,y)}},h=u.Utf8={stringify:function(g){try{return decodeURIComponent(escape(d.stringify(g)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(g){return d.parse(unescape(encodeURIComponent(g)))}},p=a.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(g){typeof g=="string"&&(g=h.parse(g)),this._data.concat(g),this._nDataBytes+=g.sigBytes},_process:function(g){var y=this._data,v=y.words,x=y.sigBytes,E=this.blockSize,S=x/(4*E),T=(S=g?n.ceil(S):n.max((0|S)-this._minBufferSize,0))*E,_=n.min(4*T,x);if(T){for(var I=0;I<T;I+=E)this._doProcessBlock(v,I);var w=v.splice(0,T);y.sigBytes-=_}return new l.init(w,_)},clone:function(){var g=c.clone.call(this);return g._data=this._data.clone(),g},_minBufferSize:0});a.Hasher=p.extend({cfg:c.extend(),init:function(g){this.cfg=this.cfg.extend(g),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(g){return this._append(g),this._process(),this},finalize:function(g){return g&&this._append(g),this._doFinalize()},blockSize:16,_createHelper:function(g){return function(y,v){return new g.init(v).finalize(y)}},_createHmacHelper:function(g){return function(y,v){return new m.HMAC.init(g,v).finalize(y)}}});var m=o.algo={};return o}(Math),t)}),yn=JT,ZT=($t(function(i,e){var t;i.exports=(t=yn,function(n){var s=t,r=s.lib,o=r.WordArray,a=r.Hasher,c=s.algo,l=[];(function(){for(var m=0;m<64;m++)l[m]=4294967296*n.abs(n.sin(m+1))|0})();var u=c.MD5=a.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(m,g){for(var y=0;y<16;y++){var v=g+y,x=m[v];m[v]=16711935&(x<<8|x>>>24)|4278255360&(x<<24|x>>>8)}var E=this._hash.words,S=m[g+0],T=m[g+1],_=m[g+2],I=m[g+3],w=m[g+4],b=m[g+5],L=m[g+6],k=m[g+7],M=m[g+8],N=m[g+9],F=m[g+10],O=m[g+11],K=m[g+12],B=m[g+13],G=m[g+14],H=m[g+15],C=E[0],R=E[1],P=E[2],D=E[3];C=f(C,R,P,D,S,7,l[0]),D=f(D,C,R,P,T,12,l[1]),P=f(P,D,C,R,_,17,l[2]),R=f(R,P,D,C,I,22,l[3]),C=f(C,R,P,D,w,7,l[4]),D=f(D,C,R,P,b,12,l[5]),P=f(P,D,C,R,L,17,l[6]),R=f(R,P,D,C,k,22,l[7]),C=f(C,R,P,D,M,7,l[8]),D=f(D,C,R,P,N,12,l[9]),P=f(P,D,C,R,F,17,l[10]),R=f(R,P,D,C,O,22,l[11]),C=f(C,R,P,D,K,7,l[12]),D=f(D,C,R,P,B,12,l[13]),P=f(P,D,C,R,G,17,l[14]),C=d(C,R=f(R,P,D,C,H,22,l[15]),P,D,T,5,l[16]),D=d(D,C,R,P,L,9,l[17]),P=d(P,D,C,R,O,14,l[18]),R=d(R,P,D,C,S,20,l[19]),C=d(C,R,P,D,b,5,l[20]),D=d(D,C,R,P,F,9,l[21]),P=d(P,D,C,R,H,14,l[22]),R=d(R,P,D,C,w,20,l[23]),C=d(C,R,P,D,N,5,l[24]),D=d(D,C,R,P,G,9,l[25]),P=d(P,D,C,R,I,14,l[26]),R=d(R,P,D,C,M,20,l[27]),C=d(C,R,P,D,B,5,l[28]),D=d(D,C,R,P,_,9,l[29]),P=d(P,D,C,R,k,14,l[30]),C=h(C,R=d(R,P,D,C,K,20,l[31]),P,D,b,4,l[32]),D=h(D,C,R,P,M,11,l[33]),P=h(P,D,C,R,O,16,l[34]),R=h(R,P,D,C,G,23,l[35]),C=h(C,R,P,D,T,4,l[36]),D=h(D,C,R,P,w,11,l[37]),P=h(P,D,C,R,k,16,l[38]),R=h(R,P,D,C,F,23,l[39]),C=h(C,R,P,D,B,4,l[40]),D=h(D,C,R,P,S,11,l[41]),P=h(P,D,C,R,I,16,l[42]),R=h(R,P,D,C,L,23,l[43]),C=h(C,R,P,D,N,4,l[44]),D=h(D,C,R,P,K,11,l[45]),P=h(P,D,C,R,H,16,l[46]),C=p(C,R=h(R,P,D,C,_,23,l[47]),P,D,S,6,l[48]),D=p(D,C,R,P,k,10,l[49]),P=p(P,D,C,R,G,15,l[50]),R=p(R,P,D,C,b,21,l[51]),C=p(C,R,P,D,K,6,l[52]),D=p(D,C,R,P,I,10,l[53]),P=p(P,D,C,R,F,15,l[54]),R=p(R,P,D,C,T,21,l[55]),C=p(C,R,P,D,M,6,l[56]),D=p(D,C,R,P,H,10,l[57]),P=p(P,D,C,R,L,15,l[58]),R=p(R,P,D,C,B,21,l[59]),C=p(C,R,P,D,w,6,l[60]),D=p(D,C,R,P,O,10,l[61]),P=p(P,D,C,R,_,15,l[62]),R=p(R,P,D,C,N,21,l[63]),E[0]=E[0]+C|0,E[1]=E[1]+R|0,E[2]=E[2]+P|0,E[3]=E[3]+D|0},_doFinalize:function(){var m=this._data,g=m.words,y=8*this._nDataBytes,v=8*m.sigBytes;g[v>>>5]|=128<<24-v%32;var x=n.floor(y/4294967296),E=y;g[15+(v+64>>>9<<4)]=16711935&(x<<8|x>>>24)|4278255360&(x<<24|x>>>8),g[14+(v+64>>>9<<4)]=16711935&(E<<8|E>>>24)|4278255360&(E<<24|E>>>8),m.sigBytes=4*(g.length+1),this._process();for(var S=this._hash,T=S.words,_=0;_<4;_++){var I=T[_];T[_]=16711935&(I<<8|I>>>24)|4278255360&(I<<24|I>>>8)}return S},clone:function(){var m=a.clone.call(this);return m._hash=this._hash.clone(),m}});function f(m,g,y,v,x,E,S){var T=m+(g&y|~g&v)+x+S;return(T<<E|T>>>32-E)+g}function d(m,g,y,v,x,E,S){var T=m+(g&v|y&~v)+x+S;return(T<<E|T>>>32-E)+g}function h(m,g,y,v,x,E,S){var T=m+(g^y^v)+x+S;return(T<<E|T>>>32-E)+g}function p(m,g,y,v,x,E,S){var T=m+(y^(g|~v))+x+S;return(T<<E|T>>>32-E)+g}s.MD5=a._createHelper(u),s.HmacMD5=a._createHmacHelper(u)}(Math),t.MD5)}),$t(function(i,e){var t;i.exports=(t=yn,void function(){var n=t,s=n.lib.Base,r=n.enc.Utf8;n.algo.HMAC=s.extend({init:function(o,a){o=this._hasher=new o.init,typeof a=="string"&&(a=r.parse(a));var c=o.blockSize,l=4*c;a.sigBytes>l&&(a=o.finalize(a)),a.clamp();for(var u=this._oKey=a.clone(),f=this._iKey=a.clone(),d=u.words,h=f.words,p=0;p<c;p++)d[p]^=1549556828,h[p]^=909522486;u.sigBytes=f.sigBytes=l,this.reset()},reset:function(){var o=this._hasher;o.reset(),o.update(this._iKey)},update:function(o){return this._hasher.update(o),this},finalize:function(o){var a=this._hasher,c=a.finalize(o);return a.reset(),a.finalize(this._oKey.clone().concat(c))}})}())}),$t(function(i,e){i.exports=yn.HmacMD5})),e6=$t(function(i,e){i.exports=yn.enc.Utf8}),t6=$t(function(i,e){var t;i.exports=(t=yn,function(){var n=t,s=n.lib.WordArray;function r(o,a,c){for(var l=[],u=0,f=0;f<a;f++)if(f%4){var d=c[o.charCodeAt(f-1)]<<f%4*2,h=c[o.charCodeAt(f)]>>>6-f%4*2;l[u>>>2]|=(d|h)<<24-u%4*8,u++}return s.create(l,u)}n.enc.Base64={stringify:function(o){var a=o.words,c=o.sigBytes,l=this._map;o.clamp();for(var u=[],f=0;f<c;f+=3)for(var d=(a[f>>>2]>>>24-f%4*8&255)<<16|(a[f+1>>>2]>>>24-(f+1)%4*8&255)<<8|a[f+2>>>2]>>>24-(f+2)%4*8&255,h=0;h<4&&f+.75*h<c;h++)u.push(l.charAt(d>>>6*(3-h)&63));var p=l.charAt(64);if(p)for(;u.length%4;)u.push(p);return u.join("")},parse:function(o){var a=o.length,c=this._map,l=this._reverseMap;if(!l){l=this._reverseMap=[];for(var u=0;u<c.length;u++)l[c.charCodeAt(u)]=u}var f=c.charAt(64);if(f){var d=o.indexOf(f);d!==-1&&(a=d)}return r(o,a,l)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),t.enc.Base64)});const Qg="uni_id_token",Yg="uni_id_token_expired",n6="uniIdToken",Ur={DEFAULT:"FUNCTION",FUNCTION:"FUNCTION",OBJECT:"OBJECT",CLIENT_DB:"CLIENT_DB"},$f="pending",i6="fulfilled",Hf="rejected";function fs(i){return Object.prototype.toString.call(i).slice(8,-1).toLowerCase()}function Xg(i){return fs(i)==="object"}function Jg(i){return typeof i=="function"}function s6(i){return function(){try{return i.apply(i,arguments)}catch(e){console.error(e)}}}const Gf="REJECTED",Zg="NOT_PENDING";class Gc{constructor({createPromise:e,retryRule:t=Gf}={}){this.createPromise=e,this.status=null,this.promise=null,this.retryRule=t}get needRetry(){if(!this.status)return!0;switch(this.retryRule){case Gf:return this.status===Hf;case Zg:return this.status!==$f}}exec(){return this.needRetry?(this.status=$f,this.promise=this.createPromise().then(e=>(this.status=i6,Promise.resolve(e)),e=>(this.status=Hf,Promise.reject(e))),this.promise):this.promise}}class r6{constructor(){this._callback={}}addListener(e,t){this._callback[e]||(this._callback[e]=[]),this._callback[e].push(t)}on(e,t){return this.addListener(e,t)}removeListener(e,t){if(!t)throw new Error('The "listener" argument must be of type function. Received undefined');const n=this._callback[e];if(!n)return;const s=function(r,o){for(let a=r.length-1;a>=0;a--)if(r[a]===o)return a;return-1}(n,t);n.splice(s,1)}off(e,t){return this.removeListener(e,t)}removeAllListener(e){delete this._callback[e]}emit(e,...t){const n=this._callback[e];if(n)for(let s=0;s<n.length;s++)n[s](...t)}}function Kc(i){return i&&typeof i=="string"?JSON.parse(i):i}const o6=!0,a6="mp-weixin",l6=Kc(YT),_i=a6,c6=Kc(""),em=Kc("[]")||[];let u6="";try{u6="__UNI__90F7D71"}catch{}let Lo={};function jn(i,e={}){var t,n;return t=Lo,n=i,Object.prototype.hasOwnProperty.call(t,n)||(Lo[i]=e),Lo[i]}const tm=["invoke","success","fail","complete"],Ot=jn("_globalUniCloudInterceptor");function nm(i,e){Ot[i]||(Ot[i]={}),Xg(e)&&Object.keys(e).forEach(t=>{tm.indexOf(t)>-1&&function(n,s,r){let o=Ot[n][s];o||(o=Ot[n][s]=[]),o.indexOf(r)===-1&&Jg(r)&&o.push(r)}(i,t,e[t])})}function f6(i,e){Ot[i]||(Ot[i]={}),Xg(e)?Object.keys(e).forEach(t=>{tm.indexOf(t)>-1&&function(n,s,r){const o=Ot[n][s];if(!o)return;const a=o.indexOf(r);a>-1&&o.splice(a,1)}(i,t,e[t])}):delete Ot[i]}function st(i,e){return i&&i.length!==0?i.reduce((t,n)=>t.then(()=>n(e)),Promise.resolve()):Promise.resolve()}function rt(i,e){return Ot[i]&&Ot[i][e]||[]}function d6(i){nm("callObject",i)}const Ro=jn("_globalUniCloudListener"),we={RESPONSE:"response",NEED_LOGIN:"needLogin",REFRESH_TOKEN:"refreshToken"},hn={CLIENT_DB:"clientdb",CLOUD_FUNCTION:"cloudfunction",CLOUD_OBJECT:"cloudobject"};function ws(i){return Ro[i]||(Ro[i]=[]),Ro[i]}function wo(i,e){const t=ws(i);t.includes(e)||t.push(e)}function Do(i,e){const t=ws(i),n=t.indexOf(e);n!==-1&&t.splice(n,1)}function xt(i,e){const t=ws(i);for(let n=0;n<t.length;n++)(0,t[n])(e)}let Po,ko=!1;function im(){return Po||(Po=new Promise(i=>{ko&&i(),function e(){if(typeof getCurrentPages=="function"){const t=getCurrentPages();t&&t[0]&&(ko=!0,i())}ko||setTimeout(()=>{e()},30)}()}),Po)}function sm(i){const e={};for(const t in i){const n=i[t];Jg(n)&&(e[t]=s6(n))}return e}class Y extends Error{constructor(e){const t=e.message||e.errMsg||"unknown system error";super(t),this.errMsg=t,this.code=this.errCode=e.code||e.errCode||"SYSTEM_ERROR",this.errSubject=this.subject=e.subject||e.errSubject,this.cause=e.cause,this.requestId=e.requestId}toJson(e=0){if(!(e>=10))return e++,{errCode:this.errCode,errMsg:this.errMsg,errSubject:this.errSubject,cause:this.cause&&this.cause.toJson?this.cause.toJson(e):this.cause}}}var Pe={request:i=>j.request(i),uploadFile:i=>j.uploadFile(i),setStorageSync:(i,e)=>j.setStorageSync(i,e),getStorageSync:i=>j.getStorageSync(i),removeStorageSync:i=>j.removeStorageSync(i),clearStorageSync:()=>j.clearStorageSync(),connectSocket:i=>j.connectSocket(i)};function rm(i){return i&&rm(i.__v_raw)||i}function ds(){return{token:Pe.getStorageSync(Qg)||Pe.getStorageSync(n6),tokenExpired:Pe.getStorageSync(Yg)}}function om({token:i,tokenExpired:e}={}){i&&Pe.setStorageSync(Qg,i),e&&Pe.setStorageSync(Yg,e)}let Bo,Ks;function hs(){return Bo||(Bo=Ut.canIUse("getAppBaseInfo")&&Ut.canIUse("getDeviceInfo")?{...j.getAppBaseInfo(),...j.getDeviceInfo()}:j.getSystemInfoSync()),Bo}function h6(){let i,e;try{if(j.getLaunchOptionsSync){if(j.getLaunchOptionsSync.toString().indexOf("not yet implemented")>-1)return;const{scene:t,channel:n}=j.getLaunchOptionsSync();i=n,e=t}}catch{}return{channel:i,scene:e}}let Bl={};function Fl(){const i=j.getLocale&&j.getLocale()||"en";if(Ks)return{...Bl,...Ks,locale:i,LOCALE:i};const e=hs(),{deviceId:t,osName:n,uniPlatform:s,appId:r}=e,o=["appId","appLanguage","appName","appVersion","appVersionCode","appWgtVersion","browserName","browserVersion","deviceBrand","deviceId","deviceModel","deviceType","osName","osVersion","romName","romVersion","ua","hostName","hostVersion","uniPlatform","uniRuntimeVersion","uniRuntimeVersionCode","uniCompilerVersion","uniCompilerVersionCode"];for(const a in e)Object.hasOwnProperty.call(e,a)&&o.indexOf(a)===-1&&delete e[a];return Ks={PLATFORM:s,OS:n,APPID:r,DEVICEID:t,...h6(),...e},{...Bl,...Ks,locale:i,LOCALE:i}}var hi={sign:function(i,e){let t="";return Object.keys(i).sort().forEach(function(n){i[n]&&(t=t+"&"+n+"="+i[n])}),t=t.slice(1),ZT(t,e).toString()},wrappedRequest:function(i,e){return new Promise((t,n)=>{e(Object.assign(i,{complete(s){s||(s={});const r=s.data&&s.data.header&&s.data.header["x-serverless-request-id"]||s.header&&s.header["request-id"];if(!s.statusCode||s.statusCode>=400){const a=s.data&&s.data.error&&s.data.error.code||"SYS_ERR",c=s.data&&s.data.error&&s.data.error.message||s.errMsg||"request:fail";return n(new Y({code:a,message:c,requestId:r}))}const o=s.data;if(o.error)return n(new Y({code:o.error.code,message:o.error.message,requestId:r}));o.result=o.data,o.requestId=r,delete o.data,t(o)}}))})},toBase64:function(i){return t6.stringify(e6.parse(i))}},p6=class{constructor(i){["spaceId","clientSecret"].forEach(e=>{if(!Object.prototype.hasOwnProperty.call(i,e))throw new Error(`${e} required`)}),this.config=Object.assign({},{endpoint:i.spaceId.indexOf("mp-")===0?"https://api.next.bspapp.com":"https://api.bspapp.com"},i),this.config.provider="aliyun",this.config.requestUrl=this.config.endpoint+"/client",this.config.envType=this.config.envType||"public",this.config.accessTokenKey="access_token_"+this.config.spaceId,this.adapter=Pe,this._getAccessTokenPromiseHub=new Gc({createPromise:()=>this.requestAuth(this.setupRequest({method:"serverless.auth.user.anonymousAuthorize",params:"{}"},"auth")).then(e=>{if(!e.result||!e.result.accessToken)throw new Y({code:"AUTH_FAILED",message:"获取accessToken失败"});this.setAccessToken(e.result.accessToken)}),retryRule:Zg})}get hasAccessToken(){return!!this.accessToken}setAccessToken(i){this.accessToken=i}requestWrapped(i){return hi.wrappedRequest(i,this.adapter.request)}requestAuth(i){return this.requestWrapped(i)}request(i,e){return Promise.resolve().then(()=>this.hasAccessToken?e?this.requestWrapped(i):this.requestWrapped(i).catch(t=>new Promise((n,s)=>{!t||t.code!=="GATEWAY_INVALID_TOKEN"&&t.code!=="InvalidParameter.InvalidToken"?s(t):n()}).then(()=>this.getAccessToken()).then(()=>{const n=this.rebuildRequest(i);return this.request(n,!0)})):this.getAccessToken().then(()=>{const t=this.rebuildRequest(i);return this.request(t,!0)}))}rebuildRequest(i){const e=Object.assign({},i);return e.data.token=this.accessToken,e.header["x-basement-token"]=this.accessToken,e.header["x-serverless-sign"]=hi.sign(e.data,this.config.clientSecret),e}setupRequest(i,e){const t=Object.assign({},i,{spaceId:this.config.spaceId,timestamp:Date.now()}),n={"Content-Type":"application/json"};return e!=="auth"&&(t.token=this.accessToken,n["x-basement-token"]=this.accessToken),n["x-serverless-sign"]=hi.sign(t,this.config.clientSecret),{url:this.config.requestUrl,method:"POST",data:t,dataType:"json",header:n}}getAccessToken(){return this._getAccessTokenPromiseHub.exec()}async authorize(){await this.getAccessToken()}callFunction(i){const e={method:"serverless.function.runtime.invoke",params:JSON.stringify({functionTarget:i.name,functionArgs:i.data||{}})};return this.request({...this.setupRequest(e),timeout:i.timeout})}getOSSUploadOptionsFromPath(i){const e={method:"serverless.file.resource.generateProximalSign",params:JSON.stringify(i)};return this.request(this.setupRequest(e))}uploadFileToOSS({url:i,formData:e,name:t,filePath:n,fileType:s,onUploadProgress:r}){return new Promise((o,a)=>{const c=this.adapter.uploadFile({url:i,formData:e,name:t,filePath:n,fileType:s,header:{"X-OSS-server-side-encrpytion":"AES256"},success(l){l&&l.statusCode<400?o(l):a(new Y({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(l){a(new Y({code:l.code||"UPLOAD_FAILED",message:l.message||l.errMsg||"文件上传失败"}))}});typeof r=="function"&&c&&typeof c.onProgressUpdate=="function"&&c.onProgressUpdate(l=>{r({loaded:l.totalBytesSent,total:l.totalBytesExpectedToSend})})})}reportOSSUpload(i){const e={method:"serverless.file.resource.report",params:JSON.stringify(i)};return this.request(this.setupRequest(e))}async uploadFile({filePath:i,cloudPath:e,fileType:t="image",cloudPathAsRealPath:n=!1,onUploadProgress:s,config:r}){if(fs(e)!=="string")throw new Y({code:"INVALID_PARAM",message:"cloudPath必须为字符串类型"});if(!(e=e.trim()))throw new Y({code:"INVALID_PARAM",message:"cloudPath不可为空"});if(/:\/\//.test(e))throw new Y({code:"INVALID_PARAM",message:"cloudPath不合法"});const o=r&&r.envType||this.config.envType;if(n&&(e[0]!=="/"&&(e="/"+e),e.indexOf("\\")>-1))throw new Y({code:"INVALID_PARAM",message:"使用cloudPath作为路径时,cloudPath不可包含“\\”"});const a=(await this.getOSSUploadOptionsFromPath({env:o,filename:n?e.split("/").pop():e,fileId:n?e:void 0})).result,c="https://"+a.cdnDomain+"/"+a.ossPath,{securityToken:l,accessKeyId:u,signature:f,host:d,ossPath:h,id:p,policy:m,ossCallbackUrl:g}=a,y={"Cache-Control":"max-age=2592000","Content-Disposition":"attachment",OSSAccessKeyId:u,Signature:f,host:d,id:p,key:h,policy:m,success_action_status:200};if(l&&(y["x-oss-security-token"]=l),g){const x=JSON.stringify({callbackUrl:g,callbackBody:JSON.stringify({fileId:p,spaceId:this.config.spaceId}),callbackBodyType:"application/json"});y.callback=hi.toBase64(x)}const v={url:"https://"+a.host,formData:y,fileName:"file",name:"file",filePath:i,fileType:t};if(await this.uploadFileToOSS(Object.assign({},v,{onUploadProgress:s})),g)return{success:!0,filePath:i,fileID:c};if((await this.reportOSSUpload({id:p})).success)return{success:!0,filePath:i,fileID:c};throw new Y({code:"UPLOAD_FAILED",message:"文件上传失败"})}getTempFileURL({fileList:i}={}){return new Promise((e,t)=>{Array.isArray(i)&&i.length!==0||t(new Y({code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"})),this.getFileInfo({fileList:i}).then(n=>{e({fileList:i.map((s,r)=>{const o=n.fileList[r];return{fileID:s,tempFileURL:o&&o.url||s}})})})})}async getFileInfo({fileList:i}={}){if(!Array.isArray(i)||i.length===0)throw new Y({code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"});const e={method:"serverless.file.resource.info",params:JSON.stringify({id:i.map(t=>t.split("?")[0]).join(",")})};return{fileList:(await this.request(this.setupRequest(e))).result}}},g6={init(i){const e=new p6(i),t={signInAnonymously:function(){return e.authorize()},getLoginState:function(){return Promise.resolve(!1)}};return e.auth=function(){return t},e.customAuth=e.auth,e}};const m6=typeof location<"u"&&location.protocol==="http:"?"http:":"https:";var Kf;(function(i){i.local="local",i.none="none",i.session="session"})(Kf||(Kf={}));var x6=function(){},y6=$t(function(i,e){var t;i.exports=(t=yn,function(n){var s=t,r=s.lib,o=r.WordArray,a=r.Hasher,c=s.algo,l=[],u=[];(function(){function h(y){for(var v=n.sqrt(y),x=2;x<=v;x++)if(!(y%x))return!1;return!0}function p(y){return 4294967296*(y-(0|y))|0}for(var m=2,g=0;g<64;)h(m)&&(g<8&&(l[g]=p(n.pow(m,.5))),u[g]=p(n.pow(m,1/3)),g++),m++})();var f=[],d=c.SHA256=a.extend({_doReset:function(){this._hash=new o.init(l.slice(0))},_doProcessBlock:function(h,p){for(var m=this._hash.words,g=m[0],y=m[1],v=m[2],x=m[3],E=m[4],S=m[5],T=m[6],_=m[7],I=0;I<64;I++){if(I<16)f[I]=0|h[p+I];else{var w=f[I-15],b=(w<<25|w>>>7)^(w<<14|w>>>18)^w>>>3,L=f[I-2],k=(L<<15|L>>>17)^(L<<13|L>>>19)^L>>>10;f[I]=b+f[I-7]+k+f[I-16]}var M=g&y^g&v^y&v,N=(g<<30|g>>>2)^(g<<19|g>>>13)^(g<<10|g>>>22),F=_+((E<<26|E>>>6)^(E<<21|E>>>11)^(E<<7|E>>>25))+(E&S^~E&T)+u[I]+f[I];_=T,T=S,S=E,E=x+F|0,x=v,v=y,y=g,g=F+(N+M)|0}m[0]=m[0]+g|0,m[1]=m[1]+y|0,m[2]=m[2]+v|0,m[3]=m[3]+x|0,m[4]=m[4]+E|0,m[5]=m[5]+S|0,m[6]=m[6]+T|0,m[7]=m[7]+_|0},_doFinalize:function(){var h=this._data,p=h.words,m=8*this._nDataBytes,g=8*h.sigBytes;return p[g>>>5]|=128<<24-g%32,p[14+(g+64>>>9<<4)]=n.floor(m/4294967296),p[15+(g+64>>>9<<4)]=m,h.sigBytes=4*p.length,this._process(),this._hash},clone:function(){var h=a.clone.call(this);return h._hash=this._hash.clone(),h}});s.SHA256=a._createHelper(d),s.HmacSHA256=a._createHmacHelper(d)}(Math),t.SHA256)}),Ol=y6,am=$t(function(i,e){i.exports=yn.HmacSHA256});const Ds=()=>{let i;if(!Promise){i=()=>{},i.promise={};const t=()=>{throw new Y({message:'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.'})};return Object.defineProperty(i.promise,"then",{get:t}),Object.defineProperty(i.promise,"catch",{get:t}),i}const e=new Promise((t,n)=>{i=(s,r)=>s?n(s):t(r)});return i.promise=e,i};function v6(i){return i===void 0}function E6(i){return Object.prototype.toString.call(i)==="[object Null]"}function Vf(i=""){return i.replace(/([\s\S]+)\s+(请前往云开发AI小助手查看问题:.*)/,"$1")}function jf(i=32){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let t="";for(let n=0;n<i;n++)t+=e.charAt(Math.floor(62*Math.random()));return t}var qf;function A6(i){const e=(t=i,Object.prototype.toString.call(t)==="[object Array]"?i:[i]);var t;for(const n of e){const{isMatch:s,genAdapter:r,runtime:o}=n;if(s())return{adapter:r(),runtime:o}}}(function(i){i.WEB="web",i.WX_MP="wx_mp"})(qf||(qf={}));const Qe={adapter:null,runtime:void 0},S6=["anonymousUuidKey"];class Fo extends x6{constructor(){super(),Qe.adapter.root.tcbObject||(Qe.adapter.root.tcbObject={})}setItem(e,t){Qe.adapter.root.tcbObject[e]=t}getItem(e){return Qe.adapter.root.tcbObject[e]}removeItem(e){delete Qe.adapter.root.tcbObject[e]}clear(){delete Qe.adapter.root.tcbObject}}function Wf(i,e){switch(i){case"local":return e.localStorage||new Fo;case"none":return new Fo;default:return e.sessionStorage||new Fo}}class zf{constructor(e){if(!this._storage){this._persistence=Qe.adapter.primaryStorage||e.persistence,this._storage=Wf(this._persistence,Qe.adapter);const t=`access_token_${e.env}`,n=`access_token_expire_${e.env}`,s=`refresh_token_${e.env}`,r=`anonymous_uuid_${e.env}`,o=`login_type_${e.env}`,a="device_id",c=`token_type_${e.env}`,l=`user_info_${e.env}`;this.keys={accessTokenKey:t,accessTokenExpireKey:n,refreshTokenKey:s,anonymousUuidKey:r,loginTypeKey:o,userInfoKey:l,deviceIdKey:a,tokenTypeKey:c}}}updatePersistence(e){if(e===this._persistence)return;const t=this._persistence==="local";this._persistence=e;const n=Wf(e,Qe.adapter);for(const s in this.keys){const r=this.keys[s];if(t&&S6.includes(s))continue;const o=this._storage.getItem(r);v6(o)||E6(o)||(n.setItem(r,o),this._storage.removeItem(r))}this._storage=n}setStore(e,t,n){if(!this._storage)return;const s={version:n||"localCachev1",content:t},r=JSON.stringify(s);try{this._storage.setItem(e,r)}catch(o){throw o}}getStore(e,t){try{if(!this._storage)return}catch{return""}t=t||"localCachev1";const n=this._storage.getItem(e);return n&&n.indexOf(t)>=0?JSON.parse(n).content:""}removeStore(e){this._storage.removeItem(e)}}const lm={},cm={};function Pi(i){return lm[i]}class um{constructor(e,t){this.data=t||null,this.name=e}}class T6 extends um{constructor(e,t){super("error",{error:e,data:t}),this.error=e}}const Vc=new class{constructor(){this._listeners={}}on(i,e){return function(t,n,s){s[t]=s[t]||[],s[t].push(n)}(i,e,this._listeners),this}off(i,e){return function(t,n,s){if(s&&s[t]){const r=s[t].indexOf(n);r!==-1&&s[t].splice(r,1)}}(i,e,this._listeners),this}fire(i,e){if(i instanceof T6)return console.error(i.error),this;const t=typeof i=="string"?new um(i,e||{}):i,n=t.name;if(this._listens(n)){t.target=this;const s=this._listeners[n]?[...this._listeners[n]]:[];for(const r of s)r.call(this,t)}return this}_listens(i){return this._listeners[i]&&this._listeners[i].length>0}};function on(i,e){Vc.on(i,e)}function ot(i,e={}){Vc.fire(i,e)}function b6(i,e){Vc.off(i,e)}const Ii="loginStateChanged",fm="loginStateExpire",vn="loginTypeChanged",Ml="anonymousConverted",dm="refreshAccessToken";var Fe;(function(i){i.ANONYMOUS="ANONYMOUS",i.WECHAT="WECHAT",i.WECHAT_PUBLIC="WECHAT-PUBLIC",i.WECHAT_OPEN="WECHAT-OPEN",i.CUSTOM="CUSTOM",i.EMAIL="EMAIL",i.USERNAME="USERNAME",i.NULL="NULL"})(Fe||(Fe={}));class _6{constructor(){this._fnPromiseMap=new Map}async run(e,t){let n=this._fnPromiseMap.get(e);return n||(n=new Promise(async(s,r)=>{try{await this._runIdlePromise();const o=t();s(await o)}catch(o){r(o)}finally{this._fnPromiseMap.delete(e)}}),this._fnPromiseMap.set(e,n)),n}_runIdlePromise(){return Promise.resolve()}}class I6{constructor(e){this._singlePromise=new _6,this._cache=Pi(e.env),this._baseURL=`https://${e.env}.ap-shanghai.tcb-api.tencentcloudapi.com`,this._reqClass=new Qe.adapter.reqClass({timeout:e.timeout,timeoutMsg:`请求在${e.timeout/1e3}s内未完成,已中断`,restrictedMethods:["post"]})}_getDeviceId(){if(this._deviceID)return this._deviceID;const{deviceIdKey:e}=this._cache.keys;let t=this._cache.getStore(e);return typeof t=="string"&&t.length>=16&&t.length<=48||(t=jf(),this._cache.setStore(e,t)),this._deviceID=t,t}async _request(e,t,n={}){const s={"x-request-id":jf(),"x-device-id":this._getDeviceId()};if(n.withAccessToken){const{tokenTypeKey:r}=this._cache.keys,o=await this.getAccessToken(),a=this._cache.getStore(r);s.authorization=`${a} ${o}`}return this._reqClass[n.method==="get"?"get":"post"]({url:`${this._baseURL}${e}`,data:t,headers:s})}async _fetchAccessToken(){const{loginTypeKey:e,accessTokenKey:t,accessTokenExpireKey:n,tokenTypeKey:s}=this._cache.keys,r=this._cache.getStore(e);if(r&&r!==Fe.ANONYMOUS)throw new Y({code:"INVALID_OPERATION",message:"非匿名登录不支持刷新 access token"});const o=await this._singlePromise.run("fetchAccessToken",async()=>(await this._request("/auth/v1/signin/anonymously",{},{method:"post"})).data),{access_token:a,expires_in:c,token_type:l}=o;return this._cache.setStore(s,l),this._cache.setStore(t,a),this._cache.setStore(n,Date.now()+1e3*c),a}isAccessTokenExpired(e,t){let n=!0;return e&&t&&(n=t<Date.now()),n}async getAccessToken(){const{accessTokenKey:e,accessTokenExpireKey:t}=this._cache.keys,n=this._cache.getStore(e),s=this._cache.getStore(t);return this.isAccessTokenExpired(n,s)?this._fetchAccessToken():n}async refreshAccessToken(){const{accessTokenKey:e,accessTokenExpireKey:t,loginTypeKey:n}=this._cache.keys;return this._cache.removeStore(e),this._cache.removeStore(t),this._cache.setStore(n,Fe.ANONYMOUS),this.getAccessToken()}async getUserInfo(){return this._singlePromise.run("getUserInfo",async()=>(await this._request("/auth/v1/user/me",{},{withAccessToken:!0,method:"get"})).data)}}const Qf=["auth.getJwt","auth.logout","auth.signInWithTicket","auth.signInAnonymously","auth.signIn","auth.fetchAccessTokenWithRefreshToken","auth.signUpWithEmailAndPassword","auth.activateEndUserMail","auth.sendPasswordResetEmail","auth.resetPasswordWithToken","auth.isUsernameRegistered"],C6={"X-SDK-Version":"1.3.5"};function Oo(i,e,t){const n=i[e];i[e]=function(s){const r={},o={};t.forEach(c=>{const{data:l,headers:u}=c.call(i,s);Object.assign(r,l),Object.assign(o,u)});const a=s.data;return a&&(()=>{var c;if(c=a,Object.prototype.toString.call(c)!=="[object FormData]")s.data={...a,...r};else for(const l in r)a.append(l,r[l])})(),s.headers={...s.headers||{},...o},n.call(i,s)}}function Mo(){const i=Math.random().toString(16).slice(2);return{data:{seqId:i},headers:{...C6,"x-seqid":i}}}class L6{constructor(e={}){var t;this.config=e,this._reqClass=new Qe.adapter.reqClass({timeout:this.config.timeout,timeoutMsg:`请求在${this.config.timeout/1e3}s内未完成,已中断`,restrictedMethods:["post"]}),this._cache=Pi(this.config.env),this._localCache=(t=this.config.env,cm[t]),this.oauth=new I6(this.config),Oo(this._reqClass,"post",[Mo]),Oo(this._reqClass,"upload",[Mo]),Oo(this._reqClass,"download",[Mo])}async post(e){return await this._reqClass.post(e)}async upload(e){return await this._reqClass.upload(e)}async download(e){return await this._reqClass.download(e)}async refreshAccessToken(){let e,t;this._refreshAccessTokenPromise||(this._refreshAccessTokenPromise=this._refreshAccessToken());try{e=await this._refreshAccessTokenPromise}catch(n){t=n}if(this._refreshAccessTokenPromise=null,this._shouldRefreshAccessTokenHook=null,t)throw t;return e}async _refreshAccessToken(){const{accessTokenKey:e,accessTokenExpireKey:t,refreshTokenKey:n,loginTypeKey:s,anonymousUuidKey:r}=this._cache.keys;this._cache.removeStore(e),this._cache.removeStore(t);let o=this._cache.getStore(n);if(!o)throw new Y({message:"未登录CloudBase"});const a={refresh_token:o},c=await this.request("auth.fetchAccessTokenWithRefreshToken",a);if(c.data.code){const{code:l}=c.data;if(l==="SIGN_PARAM_INVALID"||l==="REFRESH_TOKEN_EXPIRED"||l==="INVALID_REFRESH_TOKEN"){if(this._cache.getStore(s)===Fe.ANONYMOUS&&l==="INVALID_REFRESH_TOKEN"){const u=this._cache.getStore(r),f=this._cache.getStore(n),d=await this.send("auth.signInAnonymously",{anonymous_uuid:u,refresh_token:f});return this.setRefreshToken(d.refresh_token),this._refreshAccessToken()}ot(fm),this._cache.removeStore(n)}throw new Y({code:c.data.code,message:`刷新access token失败:${c.data.code}`})}if(c.data.access_token)return ot(dm),this._cache.setStore(e,c.data.access_token),this._cache.setStore(t,c.data.access_token_expire+Date.now()),{accessToken:c.data.access_token,accessTokenExpire:c.data.access_token_expire};c.data.refresh_token&&(this._cache.removeStore(n),this._cache.setStore(n,c.data.refresh_token),this._refreshAccessToken())}async getAccessToken(){const{accessTokenKey:e,accessTokenExpireKey:t,refreshTokenKey:n}=this._cache.keys;if(!this._cache.getStore(n))throw new Y({message:"refresh token不存在,登录状态异常"});let s=this._cache.getStore(e),r=this._cache.getStore(t),o=!0;return this._shouldRefreshAccessTokenHook&&!await this._shouldRefreshAccessTokenHook(s,r)&&(o=!1),(!s||!r||r<Date.now())&&o?this.refreshAccessToken():{accessToken:s,accessTokenExpire:r}}async request(e,t,n){const s=`x-tcb-trace_${this.config.env}`;let r="application/x-www-form-urlencoded";const o={action:e,env:this.config.env,dataVersion:"2019-08-16",...t};let a;if(Qf.indexOf(e)===-1&&(this._cache.keys,o.access_token=await this.oauth.getAccessToken()),e==="storage.uploadFile"){a=new FormData;for(let y in a)a.hasOwnProperty(y)&&a[y]!==void 0&&a.append(y,o[y]);r="multipart/form-data"}else{r="application/json",a={};for(let y in o)o[y]!==void 0&&(a[y]=o[y])}let c={headers:{"content-type":r}};n&&n.timeout&&(c.timeout=n.timeout),n&&n.onUploadProgress&&(c.onUploadProgress=n.onUploadProgress);const l=this._localCache.getStore(s);l&&(c.headers["X-TCB-Trace"]=l);const{parse:u,inQuery:f,search:d}=t;let h={env:this.config.env};u&&(h.parse=!0),f&&(h={...f,...h});let p=function(y,v,x={}){const E=/\?/.test(v);let S="";for(let T in x)S===""?!E&&(v+="?"):S+="&",S+=`${T}=${encodeURIComponent(x[T])}`;return/^http(s)?\:\/\//.test(v+=S)?v:`${y}${v}`}(m6,"//tcb-api.tencentcloudapi.com/web",h);d&&(p+=d);const m=await this.post({url:p,data:a,...c}),g=m.header&&m.header["x-tcb-trace"];if(g&&this._localCache.setStore(s,g),Number(m.status)!==200&&Number(m.statusCode)!==200||!m.data)throw new Y({code:"NETWORK_ERROR",message:"network request error"});return m}async send(e,t={},n={}){const s=await this.request(e,t,{...n,onUploadProgress:t.onUploadProgress});if((s.data.code==="ACCESS_TOKEN_DISABLED"||s.data.code==="ACCESS_TOKEN_EXPIRED")&&Qf.indexOf(e)===-1){await this.oauth.refreshAccessToken();const r=await this.request(e,t,{...n,onUploadProgress:t.onUploadProgress});if(r.data.code)throw new Y({code:r.data.code,message:Vf(r.data.message)});return r.data}if(s.data.code)throw new Y({code:s.data.code,message:Vf(s.data.message)});return s.data}setRefreshToken(e){const{accessTokenKey:t,accessTokenExpireKey:n,refreshTokenKey:s}=this._cache.keys;this._cache.removeStore(t),this._cache.removeStore(n),this._cache.setStore(s,e)}}const hm={};function Jt(i){return hm[i]}class po{constructor(e){this.config=e,this._cache=Pi(e.env),this._request=Jt(e.env)}setRefreshToken(e){const{accessTokenKey:t,accessTokenExpireKey:n,refreshTokenKey:s}=this._cache.keys;this._cache.removeStore(t),this._cache.removeStore(n),this._cache.setStore(s,e)}setAccessToken(e,t){const{accessTokenKey:n,accessTokenExpireKey:s}=this._cache.keys;this._cache.setStore(n,e),this._cache.setStore(s,t)}async refreshUserInfo(){const{data:e}=await this._request.send("auth.getUserInfo",{});return this.setLocalUserInfo(e),e}setLocalUserInfo(e){const{userInfoKey:t}=this._cache.keys;this._cache.setStore(t,e)}}class R6{constructor(e){if(!e)throw new Y({code:"PARAM_ERROR",message:"envId is not defined"});this._envId=e,this._cache=Pi(this._envId),this._request=Jt(this._envId),this.setUserInfo()}linkWithTicket(e){if(typeof e!="string")throw new Y({code:"PARAM_ERROR",message:"ticket must be string"});return this._request.send("auth.linkWithTicket",{ticket:e})}linkWithRedirect(e){e.signInWithRedirect()}updatePassword(e,t){return this._request.send("auth.updatePassword",{oldPassword:t,newPassword:e})}updateEmail(e){return this._request.send("auth.updateEmail",{newEmail:e})}updateUsername(e){if(typeof e!="string")throw new Y({code:"PARAM_ERROR",message:"username must be a string"});return this._request.send("auth.updateUsername",{username:e})}async getLinkedUidList(){const{data:e}=await this._request.send("auth.getLinkedUidList",{});let t=!1;const{users:n}=e;return n.forEach(s=>{s.wxOpenId&&s.wxPublicId&&(t=!0)}),{users:n,hasPrimaryUid:t}}setPrimaryUid(e){return this._request.send("auth.setPrimaryUid",{uid:e})}unlink(e){return this._request.send("auth.unlink",{platform:e})}async update(e){const{nickName:t,gender:n,avatarUrl:s,province:r,country:o,city:a}=e,{data:c}=await this._request.send("auth.updateUserInfo",{nickName:t,gender:n,avatarUrl:s,province:r,country:o,city:a});this.setLocalUserInfo(c)}async refresh(){const e=await this._request.oauth.getUserInfo();return this.setLocalUserInfo(e),e}setUserInfo(){const{userInfoKey:e}=this._cache.keys,t=this._cache.getStore(e);["uid","loginType","openid","wxOpenId","wxPublicId","unionId","qqMiniOpenId","email","hasPassword","customUserId","nickName","gender","avatarUrl"].forEach(n=>{this[n]=t[n]}),this.location={country:t.country,province:t.province,city:t.city}}setLocalUserInfo(e){const{userInfoKey:t}=this._cache.keys;this._cache.setStore(t,e),this.setUserInfo()}}class Ps{constructor(e){if(!e)throw new Y({code:"PARAM_ERROR",message:"envId is not defined"});this._cache=Pi(e);const{refreshTokenKey:t,accessTokenKey:n,accessTokenExpireKey:s}=this._cache.keys,r=this._cache.getStore(t),o=this._cache.getStore(n),a=this._cache.getStore(s);this.credential={refreshToken:r,accessToken:o,accessTokenExpire:a},this.user=new R6(e)}get isAnonymousAuth(){return this.loginType===Fe.ANONYMOUS}get isCustomAuth(){return this.loginType===Fe.CUSTOM}get isWeixinAuth(){return this.loginType===Fe.WECHAT||this.loginType===Fe.WECHAT_OPEN||this.loginType===Fe.WECHAT_PUBLIC}get loginType(){return this._cache.getStore(this._cache.keys.loginTypeKey)}}class No extends po{async signIn(){this._cache.updatePersistence("local"),await this._request.oauth.getAccessToken(),ot(Ii),ot(vn,{env:this.config.env,loginType:Fe.ANONYMOUS,persistence:"local"});const e=new Ps(this.config.env);return await e.user.refresh(),e}async linkAndRetrieveDataWithTicket(e){const{anonymousUuidKey:t,refreshTokenKey:n}=this._cache.keys,s=this._cache.getStore(t),r=this._cache.getStore(n),o=await this._request.send("auth.linkAndRetrieveDataWithTicket",{anonymous_uuid:s,refresh_token:r,ticket:e});if(o.refresh_token)return this._clearAnonymousUUID(),this.setRefreshToken(o.refresh_token),await this._request.refreshAccessToken(),ot(Ml,{env:this.config.env}),ot(vn,{loginType:Fe.CUSTOM,persistence:"local"}),{credential:{refreshToken:o.refresh_token}};throw new Y({message:"匿名转化失败"})}_setAnonymousUUID(e){const{anonymousUuidKey:t,loginTypeKey:n}=this._cache.keys;this._cache.removeStore(t),this._cache.setStore(t,e),this._cache.setStore(n,Fe.ANONYMOUS)}_clearAnonymousUUID(){this._cache.removeStore(this._cache.keys.anonymousUuidKey)}}class Yf extends po{async signIn(e){if(typeof e!="string")throw new Y({code:"PARAM_ERROR",message:"ticket must be a string"});const{refreshTokenKey:t}=this._cache.keys,n=await this._request.send("auth.signInWithTicket",{ticket:e,refresh_token:this._cache.getStore(t)||""});if(n.refresh_token)return this.setRefreshToken(n.refresh_token),await this._request.refreshAccessToken(),ot(Ii),ot(vn,{env:this.config.env,loginType:Fe.CUSTOM,persistence:this.config.persistence}),await this.refreshUserInfo(),new Ps(this.config.env);throw new Y({message:"自定义登录失败"})}}class Xf extends po{async signIn(e,t){if(typeof e!="string")throw new Y({code:"PARAM_ERROR",message:"email must be a string"});const{refreshTokenKey:n}=this._cache.keys,s=await this._request.send("auth.signIn",{loginType:"EMAIL",email:e,password:t,refresh_token:this._cache.getStore(n)||""}),{refresh_token:r,access_token:o,access_token_expire:a}=s;if(r)return this.setRefreshToken(r),o&&a?this.setAccessToken(o,a):await this._request.refreshAccessToken(),await this.refreshUserInfo(),ot(Ii),ot(vn,{env:this.config.env,loginType:Fe.EMAIL,persistence:this.config.persistence}),new Ps(this.config.env);throw s.code?new Y({code:s.code,message:`邮箱登录失败: ${s.message}`}):new Y({message:"邮箱登录失败"})}async activate(e){return this._request.send("auth.activateEndUserMail",{token:e})}async resetPasswordWithToken(e,t){return this._request.send("auth.resetPasswordWithToken",{token:e,newPassword:t})}}class Jf extends po{async signIn(e,t){if(typeof e!="string")throw new Y({code:"PARAM_ERROR",message:"username must be a string"});typeof t!="string"&&(t="",console.warn("password is empty"));const{refreshTokenKey:n}=this._cache.keys,s=await this._request.send("auth.signIn",{loginType:Fe.USERNAME,username:e,password:t,refresh_token:this._cache.getStore(n)||""}),{refresh_token:r,access_token_expire:o,access_token:a}=s;if(r)return this.setRefreshToken(r),a&&o?this.setAccessToken(a,o):await this._request.refreshAccessToken(),await this.refreshUserInfo(),ot(Ii),ot(vn,{env:this.config.env,loginType:Fe.USERNAME,persistence:this.config.persistence}),new Ps(this.config.env);throw s.code?new Y({code:s.code,message:`用户名密码登录失败: ${s.message}`}):new Y({message:"用户名密码登录失败"})}}class w6{constructor(e){this.config=e,this._cache=Pi(e.env),this._request=Jt(e.env),this._onAnonymousConverted=this._onAnonymousConverted.bind(this),this._onLoginTypeChanged=this._onLoginTypeChanged.bind(this),on(vn,this._onLoginTypeChanged)}get currentUser(){const e=this.hasLoginState();return e&&e.user||null}get loginType(){return this._cache.getStore(this._cache.keys.loginTypeKey)}anonymousAuthProvider(){return new No(this.config)}customAuthProvider(){return new Yf(this.config)}emailAuthProvider(){return new Xf(this.config)}usernameAuthProvider(){return new Jf(this.config)}async signInAnonymously(){return new No(this.config).signIn()}async signInWithEmailAndPassword(e,t){return new Xf(this.config).signIn(e,t)}signInWithUsernameAndPassword(e,t){return new Jf(this.config).signIn(e,t)}async linkAndRetrieveDataWithTicket(e){return this._anonymousAuthProvider||(this._anonymousAuthProvider=new No(this.config)),on(Ml,this._onAnonymousConverted),await this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e)}async signOut(){if(this.loginType===Fe.ANONYMOUS)throw new Y({message:"匿名用户不支持登出操作"});const{refreshTokenKey:e,accessTokenKey:t,accessTokenExpireKey:n}=this._cache.keys,s=this._cache.getStore(e);if(!s)return;const r=await this._request.send("auth.logout",{refresh_token:s});return this._cache.removeStore(e),this._cache.removeStore(t),this._cache.removeStore(n),ot(Ii),ot(vn,{env:this.config.env,loginType:Fe.NULL,persistence:this.config.persistence}),r}async signUpWithEmailAndPassword(e,t){return this._request.send("auth.signUpWithEmailAndPassword",{email:e,password:t})}async sendPasswordResetEmail(e){return this._request.send("auth.sendPasswordResetEmail",{email:e})}onLoginStateChanged(e){on(Ii,()=>{const n=this.hasLoginState();e.call(this,n)});const t=this.hasLoginState();e.call(this,t)}onLoginStateExpired(e){on(fm,e.bind(this))}onAccessTokenRefreshed(e){on(dm,e.bind(this))}onAnonymousConverted(e){on(Ml,e.bind(this))}onLoginTypeChanged(e){on(vn,()=>{const t=this.hasLoginState();e.call(this,t)})}async getAccessToken(){return{accessToken:(await this._request.getAccessToken()).accessToken,env:this.config.env}}hasLoginState(){const{accessTokenKey:e,accessTokenExpireKey:t}=this._cache.keys,n=this._cache.getStore(e),s=this._cache.getStore(t);return this._request.oauth.isAccessTokenExpired(n,s)?null:new Ps(this.config.env)}async isUsernameRegistered(e){if(typeof e!="string")throw new Y({code:"PARAM_ERROR",message:"username must be a string"});const{data:t}=await this._request.send("auth.isUsernameRegistered",{username:e});return t&&t.isRegistered}getLoginState(){return Promise.resolve(this.hasLoginState())}async signInWithTicket(e){return new Yf(this.config).signIn(e)}shouldRefreshAccessToken(e){this._request._shouldRefreshAccessTokenHook=e.bind(this)}getUserInfo(){return this._request.send("auth.getUserInfo",{}).then(e=>e.code?e:{...e.data,requestId:e.seqId})}getAuthHeader(){const{refreshTokenKey:e,accessTokenKey:t}=this._cache.keys,n=this._cache.getStore(e);return{"x-cloudbase-credentials":this._cache.getStore(t)+"/@@/"+n}}_onAnonymousConverted(e){const{env:t}=e.data;t===this.config.env&&this._cache.updatePersistence(this.config.persistence)}_onLoginTypeChanged(e){const{loginType:t,persistence:n,env:s}=e.data;s===this.config.env&&(this._cache.updatePersistence(n),this._cache.setStore(this._cache.keys.loginTypeKey,t))}}const D6=function(i,e){e=e||Ds();const t=Jt(this.config.env),{cloudPath:n,filePath:s,onUploadProgress:r,fileType:o="image"}=i;return t.send("storage.getUploadMetadata",{path:n}).then(a=>{const{data:{url:c,authorization:l,token:u,fileId:f,cosFileId:d},requestId:h}=a,p={key:n,signature:l,"x-cos-meta-fileid":d,success_action_status:"201","x-cos-security-token":u};t.upload({url:c,data:p,file:s,name:n,fileType:o,onUploadProgress:r}).then(m=>{m.statusCode===201?e(null,{fileID:f,requestId:h}):e(new Y({code:"STORAGE_REQUEST_FAIL",message:`STORAGE_REQUEST_FAIL: ${m.data}`}))}).catch(m=>{e(m)})}).catch(a=>{e(a)}),e.promise},P6=function(i,e){e=e||Ds();const t=Jt(this.config.env),{cloudPath:n}=i;return t.send("storage.getUploadMetadata",{path:n}).then(s=>{e(null,s)}).catch(s=>{e(s)}),e.promise},k6=function({fileList:i},e){if(e=e||Ds(),!i||!Array.isArray(i))return{code:"INVALID_PARAM",message:"fileList必须是非空的数组"};for(let n of i)if(!n||typeof n!="string")return{code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"};const t={fileid_list:i};return Jt(this.config.env).send("storage.batchDeleteFile",t).then(n=>{n.code?e(null,n):e(null,{fileList:n.data.delete_list,requestId:n.requestId})}).catch(n=>{e(n)}),e.promise},pm=function({fileList:i},e){e=e||Ds(),i&&Array.isArray(i)||e(null,{code:"INVALID_PARAM",message:"fileList必须是非空的数组"});let t=[];for(let s of i)typeof s=="object"?(s.hasOwnProperty("fileID")&&s.hasOwnProperty("maxAge")||e(null,{code:"INVALID_PARAM",message:"fileList的元素必须是包含fileID和maxAge的对象"}),t.push({fileid:s.fileID,max_age:s.maxAge})):typeof s=="string"?t.push({fileid:s}):e(null,{code:"INVALID_PARAM",message:"fileList的元素必须是字符串"});const n={file_list:t};return Jt(this.config.env).send("storage.batchGetDownloadUrl",n).then(s=>{s.code?e(null,s):e(null,{fileList:s.data.download_list,requestId:s.requestId})}).catch(s=>{e(s)}),e.promise},B6=async function({fileID:i},e){const t=(await pm.call(this,{fileList:[{fileID:i,maxAge:600}]})).fileList[0];if(t.code!=="SUCCESS")return e?e(t):new Promise(r=>{r(t)});const n=Jt(this.config.env);let s=t.download_url;if(s=encodeURI(s),!e)return n.download({url:s});e(await n.download({url:s}))},F6=function({name:i,data:e,query:t,parse:n,search:s,timeout:r},o){const a=o||Ds();let c;try{c=e?JSON.stringify(e):""}catch(u){return Promise.reject(u)}if(!i)return Promise.reject(new Y({code:"PARAM_ERROR",message:"函数名不能为空"}));const l={inQuery:t,parse:n,search:s,function_name:i,request_data:c};return Jt(this.config.env).send("functions.invokeFunction",l,{timeout:r}).then(u=>{if(u.code)a(null,u);else{let f=u.data.response_data;if(n)a(null,{result:f,requestId:u.requestId});else try{f=JSON.parse(u.data.response_data),a(null,{result:f,requestId:u.requestId})}catch{a(new Y({message:"response data must be json"}))}}return a.promise}).catch(u=>{a(u)}),a.promise},Zf={timeout:15e3,persistence:"session"},e0=6e5,t0={};class jc{constructor(e){this.config=e||this.config,this.authObj=void 0}init(e){switch(Qe.adapter||(this.requestClient=new Qe.adapter.reqClass({timeout:e.timeout||5e3,timeoutMsg:`请求在${(e.timeout||5e3)/1e3}s内未完成,已中断`})),this.config={...Zf,...e},!0){case this.config.timeout>e0:console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"),this.config.timeout=e0;break;case this.config.timeout<100:console.warn("timeout小于可配置下限[100ms],已重置为下限数值"),this.config.timeout=100}return new jc(this.config)}auth({persistence:e}={}){if(this.authObj)return this.authObj;const t=e||Qe.adapter.primaryStorage||Zf.persistence;var n;return t!==this.config.persistence&&(this.config.persistence=t),function(s){const{env:r}=s;lm[r]=new zf(s),cm[r]=new zf({...s,persistence:"local"})}(this.config),n=this.config,hm[n.env]=new L6(n),this.authObj=new w6(this.config),this.authObj}on(e,t){return on.apply(this,[e,t])}off(e,t){return b6.apply(this,[e,t])}callFunction(e,t){return F6.apply(this,[e,t])}deleteFile(e,t){return k6.apply(this,[e,t])}getTempFileURL(e,t){return pm.apply(this,[e,t])}downloadFile(e,t){return B6.apply(this,[e,t])}uploadFile(e,t){return D6.apply(this,[e,t])}getUploadMetadata(e,t){return P6.apply(this,[e,t])}registerExtension(e){t0[e.name]=e}async invokeExtension(e,t){const n=t0[e];if(!n)throw new Y({message:`扩展${e} 必须先注册`});return await n.invoke(t,this)}useAdapters(e){const{adapter:t,runtime:n}=A6(e)||{};t&&(Qe.adapter=t),n&&(Qe.runtime=n)}}var gm=new jc;function Uo(i,e,t){t===void 0&&(t={});var n=/\?/.test(e),s="";for(var r in t)s===""?!n&&(e+="?"):s+="&",s+=r+"="+encodeURIComponent(t[r]);return/^http(s)?:\/\//.test(e+=s)?e:""+i+e}class O6{get(e){const{url:t,data:n,headers:s,timeout:r}=e;return new Promise((o,a)=>{Pe.request({url:Uo("https:",t),data:n,method:"GET",header:s,timeout:r,success(c){o(c)},fail(c){a(c)}})})}post(e){const{url:t,data:n,headers:s,timeout:r}=e;return new Promise((o,a)=>{Pe.request({url:Uo("https:",t),data:n,method:"POST",header:s,timeout:r,success(c){o(c)},fail(c){a(c)}})})}upload(e){return new Promise((t,n)=>{const{url:s,file:r,data:o,headers:a,fileType:c}=e,l=Pe.uploadFile({url:Uo("https:",s),name:"file",formData:Object.assign({},o),filePath:r,fileType:c,header:a,success(u){const f={statusCode:u.statusCode,data:u.data||{}};u.statusCode===200&&o.success_action_status&&(f.statusCode=parseInt(o.success_action_status,10)),t(f)},fail(u){n(new Error(u.errMsg||"uploadFile:fail"))}});typeof e.onUploadProgress=="function"&&l&&typeof l.onProgressUpdate=="function"&&l.onProgressUpdate(u=>{e.onUploadProgress({loaded:u.totalBytesSent,total:u.totalBytesExpectedToSend})})})}}const M6={setItem(i,e){Pe.setStorageSync(i,e)},getItem:i=>Pe.getStorageSync(i),removeItem(i){Pe.removeStorageSync(i)},clear(){Pe.clearStorageSync()}};var N6={genAdapter:function(){return{root:{},reqClass:O6,localStorage:M6,primaryStorage:"local"}},isMatch:function(){return!0},runtime:"uni_app"};gm.useAdapters(N6);const qc=gm,U6=qc.init;qc.init=function(i){i.env=i.spaceId;const e=U6.call(this,i);e.config.provider="tencent",e.config.spaceId=i.spaceId;const t=e.auth;return e.auth=function(n){const s=t.call(this,n);return["linkAndRetrieveDataWithTicket","signInAnonymously","signOut","getAccessToken","getLoginState","signInWithTicket","getUserInfo"].forEach(r=>{var o;s[r]=(o=s[r],function(a){a=a||{};const{success:c,fail:l,complete:u}=sm(a);if(!(c||l||u))return o.call(this,a);o.call(this,a).then(f=>{c&&c(f),u&&u(f)},f=>{l&&l(f),u&&u(f)})}).bind(s)}),s},e.customAuth=e.auth,e};var n0=qc;async function $6(i,e){const t=`http://${i}:${e}/system/ping`;try{const s=await(n={url:t,timeout:500},new Promise((r,o)=>{Pe.request({...n,success(a){r(a)},fail(a){o(a)}})}));return!(!s.data||s.data.code!==0)}catch{return!1}var n}async function mm(i,e){let t;for(let n=0;n<i.length;n++){const s=i[n];if(await $6(s,e)){t=s;break}}return{address:t,port:e}}const H6={"serverless.file.resource.generateProximalSign":"storage/generate-proximal-sign","serverless.file.resource.report":"storage/report","serverless.file.resource.delete":"storage/delete","serverless.file.resource.getTempFileURL":"storage/get-temp-file-url"};var G6=class{constructor(i){if(["spaceId","clientSecret"].forEach(e=>{if(!Object.prototype.hasOwnProperty.call(i,e))throw new Error(`${e} required`)}),!i.endpoint)throw new Error("集群空间未配置ApiEndpoint,配置后需要重新关联服务空间后生效");this.config=Object.assign({},i),this.config.provider="dcloud",this.config.requestUrl=this.config.endpoint+"/client",this.config.envType=this.config.envType||"public",this.adapter=Pe}async request(i,e=!0){const t=e;return i=t?await this.setupLocalRequest(i):this.setupRequest(i),Promise.resolve().then(()=>t?this.requestLocal(i):hi.wrappedRequest(i,this.adapter.request))}requestLocal(i){return new Promise((e,t)=>{this.adapter.request(Object.assign(i,{complete(n){if(n||(n={}),!n.statusCode||n.statusCode>=400){const s=n.data&&n.data.code||"SYS_ERR",r=n.data&&n.data.message||"request:fail";return t(new Y({code:s,message:r}))}e({success:!0,result:n.data})}}))})}setupRequest(i){const e=Object.assign({},i,{spaceId:this.config.spaceId,timestamp:Date.now()}),t={"Content-Type":"application/json"};t["x-serverless-sign"]=hi.sign(e,this.config.clientSecret);const n=Fl();t["x-client-info"]=encodeURIComponent(JSON.stringify(n));const{token:s}=ds();return t["x-client-token"]=s,{url:this.config.requestUrl,method:"POST",data:e,dataType:"json",header:JSON.parse(JSON.stringify(t))}}async setupLocalRequest(i){const e=Fl(),{token:t}=ds(),n=Object.assign({},i,{spaceId:this.config.spaceId,timestamp:Date.now(),clientInfo:e,token:t}),{address:s,servePort:r}=this.__dev__&&this.__dev__.debugInfo||{},{address:o}=await mm(s,r);return{url:`http://${o}:${r}/${H6[i.method]}`,method:"POST",data:n,dataType:"json",header:JSON.parse(JSON.stringify({"Content-Type":"application/json"}))}}callFunction(i){const e={method:"serverless.function.runtime.invoke",params:JSON.stringify({functionTarget:i.name,functionArgs:i.data||{}})};return this.request(e,!1)}getUploadFileOptions(i){const e={method:"serverless.file.resource.generateProximalSign",params:JSON.stringify(i)};return this.request(e)}reportUploadFile(i){const e={method:"serverless.file.resource.report",params:JSON.stringify(i)};return this.request(e)}uploadFile({filePath:i,cloudPath:e,fileType:t="image",onUploadProgress:n}){if(!e)throw new Y({code:"CLOUDPATH_REQUIRED",message:"cloudPath不可为空"});let s;return this.getUploadFileOptions({cloudPath:e}).then(r=>{const{url:o,formData:a,name:c}=r.result;return s=r.result.fileUrl,new Promise((l,u)=>{const f=this.adapter.uploadFile({url:o,formData:a,name:c,filePath:i,fileType:t,success(d){d&&d.statusCode<400?l(d):u(new Y({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(d){u(new Y({code:d.code||"UPLOAD_FAILED",message:d.message||d.errMsg||"文件上传失败"}))}});typeof n=="function"&&f&&typeof f.onProgressUpdate=="function"&&f.onProgressUpdate(d=>{n({loaded:d.totalBytesSent,total:d.totalBytesExpectedToSend})})})}).then(()=>this.reportUploadFile({cloudPath:e})).then(r=>new Promise((o,a)=>{r.success?o({success:!0,filePath:i,fileID:s}):a(new Y({code:"UPLOAD_FAILED",message:"文件上传失败"}))}))}deleteFile({fileList:i}){const e={method:"serverless.file.resource.delete",params:JSON.stringify({fileList:i})};return this.request(e).then(t=>{if(t.success)return t.result;throw new Y({code:"DELETE_FILE_FAILED",message:"删除文件失败"})})}getTempFileURL({fileList:i,maxAge:e}={}){if(!Array.isArray(i)||i.length===0)throw new Y({code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"});const t={method:"serverless.file.resource.getTempFileURL",params:JSON.stringify({fileList:i,maxAge:e})};return this.request(t).then(n=>{if(n.success)return{fileList:n.result.fileList.map(s=>({fileID:s.fileID,tempFileURL:s.tempFileURL}))};throw new Y({code:"GET_TEMP_FILE_URL_FAILED",message:"获取临时文件链接失败"})})}},i0={init(i){const e=new G6(i),t={signInAnonymously:function(){return Promise.resolve()},getLoginState:function(){return Promise.resolve(!1)}};return e.auth=function(){return t},e.customAuth=e.auth,e}},Ji=$t(function(i,e){i.exports=yn.enc.Hex});function xm(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){var e=16*Math.random()|0;return(i==="x"?e:3&e|8).toString(16)})}function ym(i="",e={}){const{data:t,functionName:n,method:s,headers:r,signHeaderKeys:o=[],config:a}=e,c=String(Date.now()),l=xm(),u=Object.assign({},r,{"x-from-app-id":a.spaceAppId,"x-from-env-id":a.spaceId,"x-to-env-id":a.spaceId,"x-from-instance-id":c,"x-from-function-name":n,"x-client-timestamp":c,"x-alipay-source":"client","x-request-id":l,"x-alipay-callid":l,"x-trace-id":l}),f=["x-from-app-id","x-from-env-id","x-to-env-id","x-from-instance-id","x-from-function-name","x-client-timestamp"].concat(o),[d="",h=""]=i.split("?")||[],p=function(m){const g="HMAC-SHA256",y=m.signedHeaders.join(";"),v=m.signedHeaders.map(I=>`${I.toLowerCase()}:${m.headers[I]}
- `).join(""),x=Ol(m.body).toString(Ji),E=`${m.method.toUpperCase()}
- ${m.path}
- ${m.query}
- ${v}
- ${y}
- ${x}
- `,S=Ol(E).toString(Ji),T=`${g}
- ${m.timestamp}
- ${S}
- `,_=am(T,m.secretKey).toString(Ji);return`${g} Credential=${m.secretId}, SignedHeaders=${y}, Signature=${_}`}({path:d,query:h,method:s,headers:u,timestamp:c,body:JSON.stringify(t),secretId:a.accessKey,secretKey:a.secretKey,signedHeaders:f.sort()});return{url:`${a.endpoint}${i}`,headers:Object.assign({},u,{Authorization:p})}}function vm({url:i,data:e,method:t="POST",headers:n={},timeout:s}){return new Promise((r,o)=>{Pe.request({url:i,method:t,data:typeof e=="object"?JSON.stringify(e):e,header:n,dataType:"json",timeout:s,complete:(a={})=>{const c=n["x-trace-id"]||"";if(!a.statusCode||a.statusCode>=400){const{message:l,errMsg:u,trace_id:f}=a.data||{};return o(new Y({code:"SYS_ERR",message:l||u||"request:fail",requestId:f||c}))}r({status:a.statusCode,data:a.data,headers:a.header,requestId:c})}})})}function s0(i,e){const{path:t,data:n,method:s="GET"}=i,{url:r,headers:o}=ym(t,{functionName:"",data:n,method:s,headers:{"x-alipay-cloud-mode":"oss","x-data-api-type":"oss","x-expire-timestamp":Date.now()+6e4},signHeaderKeys:["x-data-api-type","x-expire-timestamp"],config:e});return vm({url:r,data:n,method:s,headers:o}).then(a=>{const c=a.data||{};if(!c.success)throw new Y({code:a.errCode,message:a.errMsg,requestId:a.requestId});return c.data||{}}).catch(a=>{throw new Y({code:a.errCode,message:a.errMsg,requestId:a.requestId})})}function K6(i=""){const e=i.trim().replace(/^cloud:\/\//,""),t=e.indexOf("/");if(t<=0)throw new Y({code:"INVALID_PARAM",message:"fileID不合法"});const n=e.substring(0,t),s=e.substring(t+1);return n!==this.config.spaceId&&console.warn("file ".concat(i," does not belong to env ").concat(this.config.spaceId)),s}function V6(i=""){return"cloud://".concat(this.config.spaceId,"/").concat(i.replace(/^\/+/,""))}class j6{constructor(e){this.config=e}signedURL(e,t={}){const n=`/ws/function/${e}`,s=this.config.wsEndpoint.replace(/^ws(s)?:\/\//,""),r=Object.assign({},t,{accessKeyId:this.config.accessKey,signatureNonce:xm(),timestamp:""+Date.now()}),o=[n,["accessKeyId","authorization","signatureNonce","timestamp"].sort().map(function(u){return r[u]?"".concat(u,"=").concat(r[u]):null}).filter(Boolean).join("&"),`host:${s}`].join(`
- `),a=["HMAC-SHA256",Ol(o).toString(Ji)].join(`
- `),c=am(a,this.config.secretKey).toString(Ji),l=Object.keys(r).map(u=>`${u}=${encodeURIComponent(r[u])}`).join("&");return`${this.config.wsEndpoint}${n}?${l}&signature=${c}`}}var q6=class{constructor(i){if(["spaceId","spaceAppId","accessKey","secretKey"].forEach(e=>{if(!Object.prototype.hasOwnProperty.call(i,e))throw new Error(`${e} required`)}),i.endpoint){if(typeof i.endpoint!="string")throw new Error("endpoint must be string");if(!/^https:\/\//.test(i.endpoint))throw new Error("endpoint must start with https://");i.endpoint=i.endpoint.replace(/\/$/,"")}this.config=Object.assign({},i,{endpoint:i.endpoint||`https://${i.spaceId}.api-hz.cloudbasefunction.cn`,wsEndpoint:i.wsEndpoint||`wss://${i.spaceId}.api-hz.cloudbasefunction.cn`}),this._websocket=new j6(this.config)}callFunction(i){return function(e,t){const{name:n,data:s,async:r=!1,timeout:o}=e,a="POST",c={"x-to-function-name":n};r&&(c["x-function-invoke-type"]="async");const{url:l,headers:u}=ym("/functions/invokeFunction",{functionName:n,data:s,method:a,headers:c,signHeaderKeys:["x-to-function-name"],config:t});return vm({url:l,data:s,method:a,headers:u,timeout:o}).then(f=>{let d=0;if(r){const h=f.data||{};d=h.errCode==="200"?0:h.errCode,f.data=h.data||{},f.errMsg=h.errMsg}if(d!==0)throw new Y({code:d,message:f.errMsg,requestId:f.requestId});return{errCode:d,success:d===0,requestId:f.requestId,result:f.data}}).catch(f=>{throw new Y({code:f.errCode,message:f.errMsg,requestId:f.requestId})})}(i,this.config)}uploadFileToOSS({url:i,filePath:e,fileType:t,formData:n,onUploadProgress:s}){return new Promise((r,o)=>{const a=Pe.uploadFile({url:i,filePath:e,fileType:t,formData:n,name:"file",success(c){c&&c.statusCode<400?r(c):o(new Y({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(c){o(new Y({code:c.code||"UPLOAD_FAILED",message:c.message||c.errMsg||"文件上传失败"}))}});typeof s=="function"&&a&&typeof a.onProgressUpdate=="function"&&a.onProgressUpdate(c=>{s({loaded:c.totalBytesSent,total:c.totalBytesExpectedToSend})})})}async uploadFile({filePath:i,cloudPath:e="",fileType:t="image",onUploadProgress:n}){if(fs(e)!=="string")throw new Y({code:"INVALID_PARAM",message:"cloudPath必须为字符串类型"});if(!(e=e.trim()))throw new Y({code:"INVALID_PARAM",message:"cloudPath不可为空"});if(/:\/\//.test(e))throw new Y({code:"INVALID_PARAM",message:"cloudPath不合法"});const s=await s0({path:"/".concat(e.replace(/^\//,""),"?post_url")},this.config),{file_id:r,upload_url:o,form_data:a}=s,c=a&&a.reduce((l,u)=>(l[u.key]=u.value,l),{});return this.uploadFileToOSS({url:o,filePath:i,fileType:t,formData:c,onUploadProgress:n}).then(()=>({fileID:r}))}async getTempFileURL({fileList:i}){return new Promise((e,t)=>{(!i||i.length<0)&&e({code:"INVALID_PARAM",message:"fileList不能为空数组"}),i.length>50&&e({code:"INVALID_PARAM",message:"fileList数组长度不能超过50"});const n=[];for(const s of i){let r;fs(s)!=="string"&&e({code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"});try{r=K6.call(this,s)}catch(o){console.warn(o.errCode,o.errMsg),r=s}n.push({file_id:r,expire:600})}s0({path:"/?download_url",data:{file_list:n},method:"POST"},this.config).then(s=>{const{file_list:r=[]}=s;e({fileList:r.map(o=>({fileID:V6.call(this,o.file_id),tempFileURL:o.download_url}))})}).catch(s=>t(s))})}async connectWebSocket(i){const{name:e,query:t}=i;return Pe.connectSocket({url:this._websocket.signedURL(e,t),complete:()=>{}})}},W6={init:i=>{i.provider="alipay";const e=new q6(i);return e.auth=function(){return{signInAnonymously:function(){return Promise.resolve()},getLoginState:function(){return Promise.resolve(!0)}}},e}};function Em({data:i}){let e;e=Fl();const t=JSON.parse(JSON.stringify(i||{}));if(Object.assign(t,{clientInfo:e}),!t.uniIdToken){const{token:n}=ds();n&&(t.uniIdToken=n)}return t}async function r0(i={}){await this.__dev__.initLocalNetwork();const{localAddress:e,localPort:t}=this.__dev__,n={aliyun:"aliyun",tencent:"tcb",alipay:"alipay",dcloud:"dcloud"}[this.config.provider],s=this.config.spaceId,r=`http://${e}:${t}/system/check-function`,o=`http://${e}:${t}/cloudfunctions/${i.name}`;return new Promise((a,c)=>{Pe.request({method:"POST",url:r,data:{name:i.name,platform:_i,provider:n,spaceId:s},timeout:3e3,success(l){a(l)},fail(){a({data:{code:"NETWORK_ERROR",message:"连接本地调试服务失败,请检查客户端是否和主机在同一局域网下,自动切换为已部署的云函数。"}})}})}).then(({data:a}={})=>{const{code:c,message:l}=a||{};return{code:c===0?0:c||"SYS_ERR",message:l||"SYS_ERR"}}).then(({code:a,message:c})=>{if(a!==0){switch(a){case"MODULE_ENCRYPTED":console.error(`此云函数(${i.name})依赖加密公共模块不可本地调试,自动切换为云端已部署的云函数`);break;case"FUNCTION_ENCRYPTED":console.error(`此云函数(${i.name})已加密不可本地调试,自动切换为云端已部署的云函数`);break;case"ACTION_ENCRYPTED":console.error(c||"需要访问加密的uni-clientDB-action,自动切换为云端环境");break;case"NETWORK_ERROR":console.error(c||"连接本地调试服务失败,请检查客户端是否和主机在同一局域网下");break;case"SWITCH_TO_CLOUD":break;default:{const l=`检测本地调试服务出现错误:${c},请检查网络环境或重启客户端再试`;throw console.error(l),new Error(l)}}return this._callCloudFunction(i)}return new Promise((l,u)=>{const f=Em.call(this,{data:i.data});Pe.request({method:"POST",url:o,data:{provider:n,platform:_i,param:f},timeout:i.timeout,success:({statusCode:d,data:h}={})=>!d||d>=400?u(new Y({code:h.code||"SYS_ERR",message:h.message||"request:fail"})):l({result:h}),fail(d){u(new Y({code:d.code||d.errCode||"SYS_ERR",message:d.message||d.errMsg||"request:fail"}))}})})})}const z6=[{rule:/fc_function_not_found|FUNCTION_NOT_FOUND/,content:",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间",mode:"append"}];var Am=/[\\^$.*+?()[\]{}|]/g,Q6=RegExp(Am.source);function o0(i,e,t){return i.replace(new RegExp((n=e)&&Q6.test(n)?n.replace(Am,"\\$&"):n,"g"),t);var n}const pn={NONE:"none",REQUEST:"request",RESPONSE:"response",BOTH:"both"},a0="_globalUniCloudStatus",Sm="_globalUniCloudSecureNetworkCache__{spaceId}",Y6="uni-secure-network",Wc={SYSTEM_ERROR:{code:2e4,message:"System error"},APP_INFO_INVALID:{code:20101,message:"Invalid client"},GET_ENCRYPT_KEY_FAILED:{code:20102,message:"Get encrypt key failed"}};function Tm(i){const{errSubject:e,subject:t,errCode:n,errMsg:s,code:r,message:o,cause:a}=i||{};return new Y({subject:e||t||Y6,code:n||r||Wc.SYSTEM_ERROR.code,message:s||o,cause:a})}class X6{constructor({secretType:e,uniCloudIns:t}={}){this.clientType="",this.secretType=e||pn.NONE,this.uniCloudIns=t;const{provider:n,spaceId:s}=this.uniCloudIns.config;var r;this.provider=n,this.spaceId=s,this.scopedGlobalCache=(r=this.uniCloudIns,jn(Sm.replace("{spaceId}",r.config.spaceId)))}getSystemInfo(){return this._systemInfo||(this._systemInfo=hs()),this._systemInfo}get appId(){return this.getSystemInfo().appId}get deviceId(){return this.getSystemInfo().deviceId}async encryptData(e){return this.secretType===pn.NONE?e:this.platformEncryptData(e)}async decryptResult(e){if(this.secretType===pn.NONE)return e;const{errCode:t,errMsg:n,content:s}=e||{};return t||!s?e:this.secretType===pn.REQUEST?s:this.platformDecryptResult(e)}wrapVerifyClientCallFunction(e){const t=this;return async function({name:n,data:s={}}={}){await t.prepare(),(s=JSON.parse(JSON.stringify(s)))._uniCloudOptions=await t.platformGetSignOption();let r=await e({name:n,data:s});return t.isClientKeyNotFound(r)&&(await t.prepare({forceUpdate:!0}),s._uniCloudOptions=await t.platformGetSignOption(),r=await e({name:n,data:s})),r}}wrapEncryptDataCallFunction(e){const t=this;return async function({name:n,data:s={}}={}){await t.prepare();const r=await t.encryptData(s);let o=await e({name:n,data:r});if(t.isClientKeyNotFound(o)){await t.prepare({forceUpdate:!0});const a=await t.encryptData(s);o=await e({name:n,data:a})}return o.result=await t.decryptResult(o.result),o}}}/*! MIT License. Copyright 2015-2018 Richard Moore <me@ricmoo.com>. See LICENSE.txt. */function Nl(i){return parseInt(i)===i}function l0(i){if(!Nl(i.length))return!1;for(var e=0;e<i.length;e++)if(!Nl(i[e])||i[e]<0||i[e]>255)return!1;return!0}function We(i,e){if(i.buffer&&i.name==="Uint8Array")return e&&(i=i.slice?i.slice():Array.prototype.slice.call(i)),i;if(Array.isArray(i)){if(!l0(i))throw new Error("Array contains invalid value: "+i);return new Uint8Array(i)}if(Nl(i.length)&&l0(i))return new Uint8Array(i);throw new Error("unsupported array-like object")}function qe(i){return new Uint8Array(i)}function Je(i,e,t,n,s){n==null&&s==null||(i=i.slice?i.slice(n,s):Array.prototype.slice.call(i,n,s)),e.set(i,t)}var $o,J6={toBytes:function(i){var e=[],t=0;for(i=encodeURI(i);t<i.length;){var n=i.charCodeAt(t++);n===37?(e.push(parseInt(i.substr(t,2),16)),t+=2):e.push(n)}return We(e)},fromBytes:function(i){for(var e=[],t=0;t<i.length;){var n=i[t];n<128?(e.push(String.fromCharCode(n)),t++):n>191&&n<224?(e.push(String.fromCharCode((31&n)<<6|63&i[t+1])),t+=2):(e.push(String.fromCharCode((15&n)<<12|(63&i[t+1])<<6|63&i[t+2])),t+=3)}return e.join("")}},Z6=($o="0123456789abcdef",{toBytes:function(i){for(var e=[],t=0;t<i.length;t+=2)e.push(parseInt(i.substr(t,2),16));return e},fromBytes:function(i){for(var e=[],t=0;t<i.length;t++){var n=i[t];e.push($o[(240&n)>>4]+$o[15&n])}return e.join("")}}),e5={16:10,24:12,32:14},t5=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],pt=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],Vs=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],n5=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],i5=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],s5=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],r5=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],o5=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],a5=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],l5=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],c5=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],u5=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],f5=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],d5=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],h5=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function Ho(i){for(var e=[],t=0;t<i.length;t+=4)e.push(i[t]<<24|i[t+1]<<16|i[t+2]<<8|i[t+3]);return e}class _n{constructor(e){if(!(this instanceof _n))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:We(e,!0)}),this._prepare()}_prepare(){var e=e5[this.key.length];if(e==null)throw new Error("invalid key size (must be 16, 24 or 32 bytes)");this._Ke=[],this._Kd=[];for(var t=0;t<=e;t++)this._Ke.push([0,0,0,0]),this._Kd.push([0,0,0,0]);var n,s=4*(e+1),r=this.key.length/4,o=Ho(this.key);for(t=0;t<r;t++)n=t>>2,this._Ke[n][t%4]=o[t],this._Kd[e-n][t%4]=o[t];for(var a,c=0,l=r;l<s;){if(a=o[r-1],o[0]^=pt[a>>16&255]<<24^pt[a>>8&255]<<16^pt[255&a]<<8^pt[a>>24&255]^t5[c]<<24,c+=1,r!=8)for(t=1;t<r;t++)o[t]^=o[t-1];else{for(t=1;t<r/2;t++)o[t]^=o[t-1];for(a=o[r/2-1],o[r/2]^=pt[255&a]^pt[a>>8&255]<<8^pt[a>>16&255]<<16^pt[a>>24&255]<<24,t=r/2+1;t<r;t++)o[t]^=o[t-1]}for(t=0;t<r&&l<s;)u=l>>2,f=l%4,this._Ke[u][f]=o[t],this._Kd[e-u][f]=o[t++],l++}for(var u=1;u<e;u++)for(var f=0;f<4;f++)a=this._Kd[u][f],this._Kd[u][f]=u5[a>>24&255]^f5[a>>16&255]^d5[a>>8&255]^h5[255&a]}encrypt(e){if(e.length!=16)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,n=[0,0,0,0],s=Ho(e),r=0;r<4;r++)s[r]^=this._Ke[0][r];for(var o=1;o<t;o++){for(r=0;r<4;r++)n[r]=n5[s[r]>>24&255]^i5[s[(r+1)%4]>>16&255]^s5[s[(r+2)%4]>>8&255]^r5[255&s[(r+3)%4]]^this._Ke[o][r];s=n.slice()}var a,c=qe(16);for(r=0;r<4;r++)a=this._Ke[t][r],c[4*r]=255&(pt[s[r]>>24&255]^a>>24),c[4*r+1]=255&(pt[s[(r+1)%4]>>16&255]^a>>16),c[4*r+2]=255&(pt[s[(r+2)%4]>>8&255]^a>>8),c[4*r+3]=255&(pt[255&s[(r+3)%4]]^a);return c}decrypt(e){if(e.length!=16)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,n=[0,0,0,0],s=Ho(e),r=0;r<4;r++)s[r]^=this._Kd[0][r];for(var o=1;o<t;o++){for(r=0;r<4;r++)n[r]=o5[s[r]>>24&255]^a5[s[(r+3)%4]>>16&255]^l5[s[(r+2)%4]>>8&255]^c5[255&s[(r+1)%4]]^this._Kd[o][r];s=n.slice()}var a,c=qe(16);for(r=0;r<4;r++)a=this._Kd[t][r],c[4*r]=255&(Vs[s[r]>>24&255]^a>>24),c[4*r+1]=255&(Vs[s[(r+3)%4]>>16&255]^a>>16),c[4*r+2]=255&(Vs[s[(r+2)%4]>>8&255]^a>>8),c[4*r+3]=255&(Vs[255&s[(r+1)%4]]^a);return c}}class zc{constructor(e){if(!(this instanceof zc))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new _n(e)}encrypt(e){if((e=We(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=qe(e.length),n=qe(16),s=0;s<e.length;s+=16)Je(e,n,0,s,s+16),Je(n=this._aes.encrypt(n),t,s);return t}decrypt(e){if((e=We(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=qe(e.length),n=qe(16),s=0;s<e.length;s+=16)Je(e,n,0,s,s+16),Je(n=this._aes.decrypt(n),t,s);return t}}class Qc{constructor(e,t){if(!(this instanceof Qc))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Block Chaining",this.name="cbc",t){if(t.length!=16)throw new Error("invalid initialation vector size (must be 16 bytes)")}else t=qe(16);this._lastCipherblock=We(t,!0),this._aes=new _n(e)}encrypt(e){if((e=We(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=qe(e.length),n=qe(16),s=0;s<e.length;s+=16){Je(e,n,0,s,s+16);for(var r=0;r<16;r++)n[r]^=this._lastCipherblock[r];this._lastCipherblock=this._aes.encrypt(n),Je(this._lastCipherblock,t,s)}return t}decrypt(e){if((e=We(e)).length%16!=0)throw new Error("invalid ciphertext size (must be multiple of 16 bytes)");for(var t=qe(e.length),n=qe(16),s=0;s<e.length;s+=16){Je(e,n,0,s,s+16),n=this._aes.decrypt(n);for(var r=0;r<16;r++)t[s+r]=n[r]^this._lastCipherblock[r];Je(e,this._lastCipherblock,0,s,s+16)}return t}}class Yc{constructor(e,t,n){if(!(this instanceof Yc))throw Error("AES must be instanitated with `new`");if(this.description="Cipher Feedback",this.name="cfb",t){if(t.length!=16)throw new Error("invalid initialation vector size (must be 16 size)")}else t=qe(16);n||(n=1),this.segmentSize=n,this._shiftRegister=We(t,!0),this._aes=new _n(e)}encrypt(e){if(e.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var t,n=We(e,!0),s=0;s<n.length;s+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var r=0;r<this.segmentSize;r++)n[s+r]^=t[r];Je(this._shiftRegister,this._shiftRegister,0,this.segmentSize),Je(n,this._shiftRegister,16-this.segmentSize,s,s+this.segmentSize)}return n}decrypt(e){if(e.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var t,n=We(e,!0),s=0;s<n.length;s+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var r=0;r<this.segmentSize;r++)n[s+r]^=t[r];Je(this._shiftRegister,this._shiftRegister,0,this.segmentSize),Je(e,this._shiftRegister,16-this.segmentSize,s,s+this.segmentSize)}return n}}class Xc{constructor(e,t){if(!(this instanceof Xc))throw Error("AES must be instanitated with `new`");if(this.description="Output Feedback",this.name="ofb",t){if(t.length!=16)throw new Error("invalid initialation vector size (must be 16 bytes)")}else t=qe(16);this._lastPrecipher=We(t,!0),this._lastPrecipherIndex=16,this._aes=new _n(e)}encrypt(e){for(var t=We(e,!0),n=0;n<t.length;n++)this._lastPrecipherIndex===16&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),t[n]^=this._lastPrecipher[this._lastPrecipherIndex++];return t}decrypt(e){return this.encrypt(e)}}class ps{constructor(e){if(!(this instanceof ps))throw Error("Counter must be instanitated with `new`");e===0||e||(e=1),typeof e=="number"?(this._counter=qe(16),this.setValue(e)):this.setBytes(e)}setValue(e){if(typeof e!="number"||parseInt(e)!=e)throw new Error("invalid counter value (must be an integer)");if(e>Number.MAX_SAFE_INTEGER)throw new Error("integer value out of safe range");for(var t=15;t>=0;--t)this._counter[t]=e%256,e=parseInt(e/256)}setBytes(e){if((e=We(e,!0)).length!=16)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e}increment(){for(var e=15;e>=0;e--){if(this._counter[e]!==255){this._counter[e]++;break}this._counter[e]=0}}}class Jc{constructor(e,t){if(!(this instanceof Jc))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",t instanceof ps||(t=new ps(t)),this._counter=t,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new _n(e)}encrypt(e){for(var t=We(e,!0),n=0;n<t.length;n++)this._remainingCounterIndex===16&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),t[n]^=this._remainingCounter[this._remainingCounterIndex++];return t}decrypt(e){return this.encrypt(e)}}var gn={AES:_n,Counter:ps,ModeOfOperation:{ecb:zc,cbc:Qc,cfb:Yc,ofb:Xc,ctr:Jc},utils:{hex:Z6,utf8:J6},padding:{pkcs7:{pad:function(i){var e=16-(i=We(i,!0)).length%16,t=qe(i.length+e);Je(i,t);for(var n=i.length;n<t.length;n++)t[n]=e;return t},strip:function(i){if((i=We(i,!0)).length<16)throw new Error("PKCS#7 invalid length");var e=i[i.length-1];if(e>16)throw new Error("PKCS#7 padding byte out of range");for(var t=i.length-e,n=0;n<e;n++)if(i[t+n]!==e)throw new Error("PKCS#7 invalid padding byte");var s=qe(t);return Je(i,s,0,0,t),s}}},_arrayTest:{coerceArray:We,createArray:qe,copyArray:Je}};function c0(i,e,t){const n=new Uint8Array(j.base64ToArrayBuffer(e)),s=gn.utils.utf8.toBytes(t),r=gn.utils.utf8.toBytes(i),o=new gn.ModeOfOperation.cbc(n,s),a=gn.padding.pkcs7.pad(r),c=o.encrypt(a);return j.arrayBufferToBase64(c)}let Ul,$i=null;class p5 extends X6{constructor(e){super(e),this.clientType="mp-weixin",this.userEncryptKey=null}isLogin(){return!!this.scopedGlobalCache.mpWeixinCode||!!this.scopedGlobalCache.mpWeixinOpenid}async prepare(){if(!this.isLogin()){if(!this.scopedGlobalCache.initPromise)throw new Error("`uniCloud.initSecureNetworkByWeixin` has not yet been called");if(await this.scopedGlobalCache.initPromise,!this.isLogin())throw new Error("uniCloud.initSecureNetworkByWeixin` has not yet been called or successfully excuted")}}async getUserEncryptKey(){if(this.userEncryptKey)return this.userEncryptKey;if($i&&$i.expireTime){const e=Date.now();if($i.expireTime-e>0)return this.userEncryptKey=$i,this.userEncryptKey}return new Promise((e,t)=>{j.getUserCryptoManager().getLatestUserKey({success:n=>{$i=n,this.userEncryptKey=n,e(this.userEncryptKey)},fail:n=>{t(Tm({...Wc.GET_ENCRYPT_KEY_FAILED,cause:n}))}})})}getWxAppId(){return Ut.getAccountInfoSync().miniProgram.appId}async platformGetSignOption(){const{encryptKey:e,iv:t,version:n}=await this.getUserEncryptKey();return{verifyClientSign:c0(JSON.stringify({data:JSON.stringify({}),appId:this.appId,deviceId:this.deviceId,wxAppId:this.getWxAppId(),simulator:hs().platform==="devtools",timestamp:Date.now()}),e,t),encryptKeyId:n,mpWeixinCode:this.scopedGlobalCache.mpWeixinCode,mpWeixinOpenid:this.scopedGlobalCache.mpWeixinOpenid}}async platformEncryptData(e){const{encryptKey:t,iv:n,version:s}=await this.getUserEncryptKey(),r={secretType:this.secretType,encryptKeyId:s,mpWeixinCode:this.scopedGlobalCache.mpWeixinCode,mpWeixinOpenid:this.scopedGlobalCache.mpWeixinOpenid};return this.secretType===pn.RESPONSE?{content:e,_uniCloudOptions:r}:{content:c0(JSON.stringify({data:JSON.stringify(e),appId:this.appId,deviceId:this.deviceId,wxAppId:this.getWxAppId(),simulator:hs().platform==="devtools",timestamp:Date.now()}),t,n),_uniCloudOptions:r}}async platformDecryptResult(e){const{content:t}=e,{encryptKey:n,iv:s}=await this.getUserEncryptKey();return JSON.parse(function(r,o,a){const c=new Uint8Array(j.base64ToArrayBuffer(r)),l=new Uint8Array(j.base64ToArrayBuffer(o)),u=gn.utils.utf8.toBytes(a),f=new gn.ModeOfOperation.cbc(l,u),d=gn.padding.pkcs7.strip(f.decrypt(c));return gn.utils.utf8.fromBytes(d)}(t,n,s))}isClientKeyNotFound(){return!1}}function u0({secretType:i}={}){return i===pn.REQUEST||i===pn.RESPONSE||i===pn.BOTH}function f0({name:i,data:e={}}={}){return _i==="app"}function g5({provider:i,spaceId:e,functionName:t}={}){const{appId:n,uniPlatform:s,osName:r}=hs();let o=s;s==="app"&&(o=r);const a=function({provider:f,spaceId:d}={}){const h=l6;if(!h)return{};f=function(m){return m==="tencent"?"tcb":m}(f);const p=h.find(m=>m.provider===f&&m.spaceId===d);return p&&p.config}({provider:i,spaceId:e});if(!a||!a.accessControl||!a.accessControl.enable)return!1;const c=a.accessControl.function||{},l=Object.keys(c);if(l.length===0)return!0;const u=function(f,d){let h,p,m;for(let g=0;g<f.length;g++){const y=f[g];y!==d?y!=="*"?y.split(",").map(v=>v.trim()).indexOf(d)>-1&&(p=y):m=y:h=y}return h||p||m}(l,t);if(!u)return!1;if((c[u]||[]).find((f={})=>f.appId===n&&(f.platform||"").toLowerCase()===o.toLowerCase()))return!0;throw console.error(`此应用[appId: ${n}, platform: ${o}]不在云端配置的允许访问的应用列表内,参考:https://uniapp.dcloud.net.cn/uniCloud/secure-network.html#verify-client`),Tm(Wc.APP_INFO_INVALID)}function d0({functionName:i,result:e,logPvd:t}){if(this.__dev__.debugLog&&e&&e.requestId){const n=JSON.stringify({spaceId:this.config.spaceId,functionName:i,requestId:e.requestId});console.log(`[${t}-request]${n}[/${t}-request]`)}}function m5(i){const e=i.callFunction,t=function(n){const s=n.name;n.data=Em.call(i,{data:n.data});const r={aliyun:"aliyun",tencent:"tcb",tcb:"tcb",alipay:"alipay",dcloud:"dcloud"}[this.config.provider],o=u0(n),a=f0(n),c=o||a;return e.call(this,n).then(l=>(l.errCode=0,!c&&d0.call(this,{functionName:s,result:l,logPvd:r}),Promise.resolve(l)),l=>(!c&&d0.call(this,{functionName:s,result:l,logPvd:r}),l&&l.message&&(l.message=function({message:u="",extraInfo:f={},formatter:d=[]}={}){for(let h=0;h<d.length;h++){const{rule:p,content:m,mode:g}=d[h],y=u.match(p);if(!y)continue;let v=m;for(let x=1;x<y.length;x++)v=o0(v,`{$${x}}`,y[x]);for(const x in f)v=o0(v,`{${x}}`,f[x]);return g==="replace"?v:u+v}return u}({message:`[${n.name}]: ${l.message}`,formatter:z6,extraInfo:{functionName:s}})),Promise.reject(l)))};i.callFunction=function(n){const{provider:s,spaceId:r}=i.config,o=n.name;let a,c;return n.data=n.data||{},i.__dev__.debugInfo&&!i.__dev__.debugInfo.forceRemote&&em?(i._callCloudFunction||(i._callCloudFunction=t,i._callLocalFunction=r0),a=r0):a=t,a=a.bind(i),f0(n)||(function({name:l,data:u={}}){return l==="uni-id-co"&&u.method==="secureNetworkHandshakeByWeixin"}(n)?c=a.call(i,n):u0(n)?c=new Ul({secretType:n.secretType,uniCloudIns:i}).wrapEncryptDataCallFunction(t.bind(i))(n):g5({provider:s,spaceId:r,functionName:o})?c=new Ul({secretType:n.secretType,uniCloudIns:i}).wrapVerifyClientCallFunction(t.bind(i))(n):c=a(n)),Object.defineProperty(c,"result",{get:()=>(console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"),{})}),c.then(l=>l)}}Ul=p5;const bm=Symbol("CLIENT_DB_INTERNAL");function $r(i,e){return i.then="DoNotReturnProxyWithAFunctionNamedThen",i._internalType=bm,i.inspect=null,i.__v_raw=void 0,new Proxy(i,{get(t,n,s){if(n==="_uniClient")return null;if(typeof n=="symbol")return t[n];if(n in t||typeof n!="string"){const r=t[n];return typeof r=="function"?r.bind(t):r}return e.get(t,n,s)}})}function h0(i){return{on:(e,t)=>{i[e]=i[e]||[],i[e].indexOf(t)>-1||i[e].push(t)},off:(e,t)=>{i[e]=i[e]||[];const n=i[e].indexOf(t);n!==-1&&i[e].splice(n,1)}}}const x5=["db.Geo","db.command","command.aggregate"];function _m(i,e){return x5.indexOf(`${i}.${e}`)>-1}function Un(i){switch(fs(i=rm(i))){case"array":return i.map(e=>Un(e));case"object":return i._internalType===bm||Object.keys(i).forEach(e=>{i[e]=Un(i[e])}),i;case"regexp":return{$regexp:{source:i.source,flags:i.flags}};case"date":return{$date:i.toISOString()};default:return i}}function Hi(i){return i&&i.content&&i.content.$method}class y5{constructor(e,t,n){this.content=e,this.prevStage=t||null,this.udb=null,this._database=n}toJSON(){let e=this;const t=[e.content];for(;e.prevStage;)e=e.prevStage,t.push(e.content);return{$db:t.reverse().map(n=>({$method:n.$method,$param:Un(n.$param)}))}}toString(){return JSON.stringify(this.toJSON())}getAction(){const e=this.toJSON().$db.find(t=>t.$method==="action");return e&&e.$param&&e.$param[0]}getCommand(){return{$db:this.toJSON().$db.filter(e=>e.$method!=="action")}}get isAggregate(){let e=this;for(;e;){const t=Hi(e),n=Hi(e.prevStage);if(t==="aggregate"&&n==="collection"||t==="pipeline")return!0;e=e.prevStage}return!1}get isCommand(){let e=this;for(;e;){if(Hi(e)==="command")return!0;e=e.prevStage}return!1}get isAggregateCommand(){let e=this;for(;e;){const t=Hi(e),n=Hi(e.prevStage);if(t==="aggregate"&&n==="command")return!0;e=e.prevStage}return!1}getNextStageFn(e){const t=this;return function(){return gs({$method:e,$param:Un(Array.from(arguments))},t,t._database)}}get count(){return this.isAggregate?this.getNextStageFn("count"):function(){return this._send("count",Array.from(arguments))}}get remove(){return this.isCommand?this.getNextStageFn("remove"):function(){return this._send("remove",Array.from(arguments))}}get(){return this._send("get",Array.from(arguments))}get add(){return this.isCommand?this.getNextStageFn("add"):function(){return this._send("add",Array.from(arguments))}}update(){return this._send("update",Array.from(arguments))}end(){return this._send("end",Array.from(arguments))}get set(){return this.isCommand?this.getNextStageFn("set"):function(){throw new Error("JQL禁止使用set方法")}}_send(e,t){const n=this.getAction(),s=this.getCommand();if(s.$db.push({$method:e,$param:Un(t)}),o6){const r=s.$db.find(a=>a.$method==="collection"),o=r&&r.$param;o&&o.length===1&&typeof r.$param[0]=="string"&&r.$param[0].indexOf(",")>-1&&console.warn(`检测到使用JQL语法联表查询时,未使用getTemp先过滤主表数据,在主表数据量大的情况下可能会查询缓慢。
- - 如何优化请参考此文档:https://uniapp.dcloud.net.cn/uniCloud/jql?id=lookup-with-temp
- - 如果主表数据量很小请忽略此信息,项目发行时不会出现此提示。`)}return this._database._callCloudFunction({action:n,command:s})}}function gs(i,e,t){return $r(new y5(i,e,t),{get(n,s){let r="db";return n&&n.content&&(r=n.content.$method),_m(r,s)?gs({$method:s},n,t):function(){return gs({$method:s,$param:Un(Array.from(arguments))},n,t)}}})}function Go({path:i,method:e}){return class{constructor(){this.param=Array.from(arguments)}toJSON(){return{$newDb:[...i.map(t=>({$method:t})),{$method:e,$param:this.param}]}}toString(){return JSON.stringify(this.toJSON())}}}class v5{constructor({uniClient:e={},isJQL:t=!1}={}){this._uniClient=e,this._authCallBacks={},this._dbCallBacks={},e._isDefault&&(this._dbCallBacks=jn("_globalUniCloudDatabaseCallback")),t||(this.auth=h0(this._authCallBacks)),this._isJQL=t,Object.assign(this,h0(this._dbCallBacks)),this.env=$r({},{get:(n,s)=>({$env:s})}),this.Geo=$r({},{get:(n,s)=>Go({path:["Geo"],method:s})}),this.serverDate=Go({path:[],method:"serverDate"}),this.RegExp=Go({path:[],method:"RegExp"})}getCloudEnv(e){if(typeof e!="string"||!e.trim())throw new Error("getCloudEnv参数错误");return{$env:e.replace("$cloudEnv_","")}}_callback(e,t){const n=this._dbCallBacks;n[e]&&n[e].forEach(s=>{s(...t)})}_callbackAuth(e,t){const n=this._authCallBacks;n[e]&&n[e].forEach(s=>{s(...t)})}multiSend(){const e=Array.from(arguments),t=e.map(n=>{const s=n.getAction(),r=n.getCommand();if(r.$db[r.$db.length-1].$method!=="getTemp")throw new Error("multiSend只支持子命令内使用getTemp");return{action:s,command:r}});return this._callCloudFunction({multiCommand:t,queryList:e})}}function p0(i,e={}){return $r(new i(e),{get:(t,n)=>_m("db",n)?gs({$method:n},null,t):function(){return gs({$method:n,$param:Un(Array.from(arguments))},null,t)}})}class g0 extends v5{_parseResult(e){return this._isJQL?e.result:e}_callCloudFunction({action:e,command:t,multiCommand:n,queryList:s}){function r(f,d){if(n&&s)for(let h=0;h<s.length;h++){const p=s[h];p.udb&&typeof p.udb.setResult=="function"&&(d?p.udb.setResult(d):p.udb.setResult(f.result.dataList[h]))}}const o=this,a=this._isJQL?"databaseForJQL":"database";function c(f){return o._callback("error",[f]),st(rt(a,"fail"),f).then(()=>st(rt(a,"complete"),f)).then(()=>(r(null,f),xt(we.RESPONSE,{type:hn.CLIENT_DB,content:f}),Promise.reject(f)))}const l=st(rt(a,"invoke")),u=this._uniClient;return l.then(()=>u.callFunction({name:"DCloud-clientDB",type:Ur.CLIENT_DB,data:{action:e,command:t,multiCommand:n}})).then(f=>{const{code:d,message:h,token:p,tokenExpired:m,systemInfo:g=[]}=f.result;if(g)for(let v=0;v<g.length;v++){const{level:x,message:E,detail:S}=g[v];let T="[System Info]"+E;S&&(T=`${T}
- 详细信息:${S}`),(console[x]||console.log)(T)}if(d)return c(new Y({code:d,message:h,requestId:f.requestId}));f.result.errCode=f.result.errCode||f.result.code,f.result.errMsg=f.result.errMsg||f.result.message,p&&m&&(om({token:p,tokenExpired:m}),this._callbackAuth("refreshToken",[{token:p,tokenExpired:m}]),this._callback("refreshToken",[{token:p,tokenExpired:m}]),xt(we.REFRESH_TOKEN,{token:p,tokenExpired:m}));const y=[{prop:"affectedDocs",tips:"affectedDocs不再推荐使用,请使用inserted/deleted/updated/data.length替代"},{prop:"code",tips:"code不再推荐使用,请使用errCode替代"},{prop:"message",tips:"message不再推荐使用,请使用errMsg替代"}];for(let v=0;v<y.length;v++){const{prop:x,tips:E}=y[v];if(x in f.result){const S=f.result[x];Object.defineProperty(f.result,x,{get:()=>(console.warn(E),S)})}}return function(v){return st(rt(a,"success"),v).then(()=>st(rt(a,"complete"),v)).then(()=>{r(v,null);const x=o._parseResult(v);return xt(we.RESPONSE,{type:hn.CLIENT_DB,content:x}),Promise.resolve(x)})}(f)},f=>(/fc_function_not_found|FUNCTION_NOT_FOUND/g.test(f.message)&&console.warn("clientDB未初始化,请在web控制台保存一次schema以开启clientDB"),c(new Y({code:f.code||"SYSTEM_ERROR",message:f.message,requestId:f.requestId}))))}}const Bn="token无效,跳转登录页面",Im="token过期,跳转登录页面",Cm={TOKEN_INVALID_TOKEN_EXPIRED:Im,TOKEN_INVALID_INVALID_CLIENTID:Bn,TOKEN_INVALID:Bn,TOKEN_INVALID_WRONG_TOKEN:Bn,TOKEN_INVALID_ANONYMOUS_USER:Bn},E5={"uni-id-token-expired":Im,"uni-id-check-token-failed":Bn,"uni-id-token-not-exist":Bn,"uni-id-check-device-feature-failed":Bn},$l={...Cm,...E5,default:"用户未登录或登录状态过期,自动跳转登录页面"};function m0(i,e){let t="";return t=i?`${i}/${e}`:e,t.replace(/^\//,"")}function x0(i=[],e=""){const t=[],n=[];return i.forEach(s=>{s.needLogin===!0?t.push(m0(e,s.path)):s.needLogin===!1&&n.push(m0(e,s.path))}),{needLoginPage:t,notNeedLoginPage:n}}function ms(i){return i.split("?")[0].replace(/^\//,"")}function Zc(){return function(i){let e=i&&i.$page&&i.$page.fullPath;return e?(e.charAt(0)!=="/"&&(e="/"+e),e):""}(function(){const i=getCurrentPages();return i[i.length-1]}())}function Lm(){return ms(Zc())}function A5(i="",e={}){if(!i||!(e&&e.list&&e.list.length))return!1;const t=e.list,n=ms(i);return t.some(s=>s.pagePath===n)}const S5=!!zg.uniIdRouter,{loginPage:xs,routerNeedLogin:T5,resToLogin:b5,needLoginPage:Rm,notNeedLoginPage:_5,loginPageInTabBar:I5}=function({pages:i=[],subPackages:e=[],uniIdRouter:t={},tabBar:n={}}=zg){const{loginPage:s,needLogin:r=[],resToLogin:o=!0}=t,{needLoginPage:a,notNeedLoginPage:c}=x0(i),{needLoginPage:l,notNeedLoginPage:u}=function(f=[]){const d=[],h=[];return f.forEach(p=>{const{root:m,pages:g=[]}=p,{needLoginPage:y,notNeedLoginPage:v}=x0(g,m);d.push(...y),h.push(...v)}),{needLoginPage:d,notNeedLoginPage:h}}(e);return{loginPage:s,routerNeedLogin:r,resToLogin:o,needLoginPage:[...a,...l],notNeedLoginPage:[...c,...u],loginPageInTabBar:A5(s,n)}}();if(Rm.indexOf(xs)>-1)throw new Error(`Login page [${xs}] should not be "needLogin", please check your pages.json`);function wm(i){const e=Lm();if(i.charAt(0)==="/")return i;const[t,n]=i.split("?"),s=t.replace(/^\//,"").split("/"),r=e.split("/");r.pop();for(let o=0;o<s.length;o++){const a=s[o];a===".."?r.pop():a!=="."&&r.push(a)}return r[0]===""&&r.shift(),"/"+r.join("/")+(n?"?"+n:"")}function C5(i){const e=ms(wm(i));return!(_5.indexOf(e)>-1)&&(Rm.indexOf(e)>-1||T5.some(t=>function(n,s){return new RegExp(s).test(n)}(i,t)))}function Dm({redirect:i}){const e=ms(i),t=ms(xs);return Lm()!==t&&e!==t}function Hl({api:i,redirect:e}={}){if(!e||!Dm({redirect:e}))return;const t=function(s,r){return s.charAt(0)!=="/"&&(s="/"+s),r?s.indexOf("?")>-1?s+`&uniIdRedirectUrl=${encodeURIComponent(r)}`:s+`?uniIdRedirectUrl=${encodeURIComponent(r)}`:s}(xs,e);I5?i!=="navigateTo"&&i!=="redirectTo"||(i="switchTab"):i==="switchTab"&&(i="navigateTo");const n={navigateTo:j.navigateTo,redirectTo:j.redirectTo,switchTab:j.switchTab,reLaunch:j.reLaunch};setTimeout(()=>{n[i]({url:t})},0)}function y0({url:i}={}){const e={abortLoginPageJump:!1,autoToLoginPage:!1},t=function(){const{token:n,tokenExpired:s}=ds();let r;if(n){if(s<Date.now()){const o="uni-id-token-expired";r={errCode:o,errMsg:$l[o]}}}else{const o="uni-id-check-token-failed";r={errCode:o,errMsg:$l[o]}}return r}();if(C5(i)&&t){if(t.uniIdRedirectUrl=i,ws(we.NEED_LOGIN).length>0)return setTimeout(()=>{xt(we.NEED_LOGIN,t)},0),e.abortLoginPageJump=!0,e;e.autoToLoginPage=!0}return e}function L5(){(function(){const e=Zc(),{abortLoginPageJump:t,autoToLoginPage:n}=y0({url:e});t||n&&Hl({api:"redirectTo",redirect:e})})();const i=["navigateTo","redirectTo","reLaunch","switchTab"];for(let e=0;e<i.length;e++){const t=i[e];j.addInterceptor(t,{invoke(n){const{abortLoginPageJump:s,autoToLoginPage:r}=y0({url:n.url});return s?n:r?(Hl({api:t,redirect:wm(n.url)}),!1):n}})}}function R5(){this.onResponse(i=>{const{type:e,content:t}=i;let n=!1;switch(e){case"cloudobject":n=function(s){if(typeof s!="object")return!1;const{errCode:r}=s||{};return r in $l}(t);break;case"clientdb":n=function(s){if(typeof s!="object")return!1;const{errCode:r}=s||{};return r in Cm}(t)}n&&function(s={}){const r=ws(we.NEED_LOGIN);im().then(()=>{const o=Zc();if(o&&Dm({redirect:o}))return r.length>0?xt(we.NEED_LOGIN,Object.assign({uniIdRedirectUrl:o},s)):void(xs&&Hl({api:"navigateTo",redirect:o}))})}(t)})}function w5(i){(function(e){e.onResponse=function(t){wo(we.RESPONSE,t)},e.offResponse=function(t){Do(we.RESPONSE,t)}})(i),function(e){e.onNeedLogin=function(t){wo(we.NEED_LOGIN,t)},e.offNeedLogin=function(t){Do(we.NEED_LOGIN,t)},S5&&(jn(a0).needLoginInit||(jn(a0).needLoginInit=!0,im().then(()=>{L5.call(e)}),b5&&R5.call(e)))}(i),function(e){e.onRefreshToken=function(t){wo(we.REFRESH_TOKEN,t)},e.offRefreshToken=function(t){Do(we.REFRESH_TOKEN,t)}}(i)}let Pm;const js="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",D5=/^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;function P5(){const i=ds().token||"",e=i.split(".");if(!i||e.length!==3)return{uid:null,role:[],permission:[],tokenExpired:0};let t;try{t=JSON.parse((n=e[1],decodeURIComponent(Pm(n).split("").map(function(s){return"%"+("00"+s.charCodeAt(0).toString(16)).slice(-2)}).join(""))))}catch(s){throw new Error("获取当前用户信息出错,详细错误信息为:"+s.message)}var n;return t.tokenExpired=1e3*t.exp,delete t.exp,delete t.iat,t}Pm=typeof atob!="function"?function(i){if(i=String(i).replace(/[\t\n\f\r ]+/g,""),!D5.test(i))throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");var e;i+="==".slice(2-(3&i.length));for(var t,n,s="",r=0;r<i.length;)e=js.indexOf(i.charAt(r++))<<18|js.indexOf(i.charAt(r++))<<12|(t=js.indexOf(i.charAt(r++)))<<6|(n=js.indexOf(i.charAt(r++))),s+=t===64?String.fromCharCode(e>>16&255):n===64?String.fromCharCode(e>>16&255,e>>8&255):String.fromCharCode(e>>16&255,e>>8&255,255&e);return s}:atob;var k5=$t(function(i,e){Object.defineProperty(e,"__esModule",{value:!0});const t="chooseAndUploadFile:ok",n="chooseAndUploadFile:fail";function s(o,a){return o.tempFiles.forEach((c,l)=>{c.name||(c.name=c.path.substring(c.path.lastIndexOf("/")+1)),a&&(c.fileType=a),c.cloudPath=Date.now()+"_"+l+c.name.substring(c.name.lastIndexOf("."))}),o.tempFilePaths||(o.tempFilePaths=o.tempFiles.map(c=>c.path)),o}function r(o,a,{onChooseFile:c,onUploadProgress:l}){return a.then(u=>{if(c){const f=c(u);if(f!==void 0)return Promise.resolve(f).then(d=>d===void 0?u:d)}return u}).then(u=>u===!1?{errMsg:t,tempFilePaths:[],tempFiles:[]}:function(f,d,h=5,p){(d=Object.assign({},d)).errMsg=t;const m=d.tempFiles,g=m.length;let y=0;return new Promise(v=>{for(;y<h;)x();function x(){const E=y++;if(E>=g)return void(!m.find(T=>!T.url&&!T.errMsg)&&v(d));const S=m[E];f.uploadFile({provider:S.provider,filePath:S.path,cloudPath:S.cloudPath,fileType:S.fileType,cloudPathAsRealPath:S.cloudPathAsRealPath,onUploadProgress(T){T.index=E,T.tempFile=S,T.tempFilePath=S.path,p&&p(T)}}).then(T=>{S.url=T.fileID,E<g&&x()}).catch(T=>{S.errMsg=T.errMsg||T.message,E<g&&x()})}})}(o,u,5,l))}e.initChooseAndUploadFile=function(o){return function(a={type:"all"}){return a.type==="image"?r(o,function(c){const{count:l,sizeType:u,sourceType:f=["album","camera"],extension:d}=c;return new Promise((h,p)=>{j.chooseImage({count:l,sizeType:u,sourceType:f,extension:d,success(m){h(s(m,"image"))},fail(m){p({errMsg:m.errMsg.replace("chooseImage:fail",n)})}})})}(a),a):a.type==="video"?r(o,function(c){const{camera:l,compressed:u,maxDuration:f,sourceType:d=["album","camera"],extension:h}=c;return new Promise((p,m)=>{j.chooseVideo({camera:l,compressed:u,maxDuration:f,sourceType:d,extension:h,success(g){const{tempFilePath:y,duration:v,size:x,height:E,width:S}=g;p(s({errMsg:"chooseVideo:ok",tempFilePaths:[y],tempFiles:[{name:g.tempFile&&g.tempFile.name||"",path:y,size:x,type:g.tempFile&&g.tempFile.type||"",width:S,height:E,duration:v,fileType:"video",cloudPath:""}]},"video"))},fail(g){m({errMsg:g.errMsg.replace("chooseVideo:fail",n)})}})})}(a),a):r(o,function(c){const{count:l,extension:u}=c;return new Promise((f,d)=>{let h=j.chooseFile;if(typeof Ut<"u"&&typeof Ut.chooseMessageFile=="function"&&(h=Ut.chooseMessageFile),typeof h!="function")return d({errMsg:n+" 请指定 type 类型,该平台仅支持选择 image 或 video。"});h({type:"all",count:l,extension:u,success(p){f(s(p))},fail(p){d({errMsg:p.errMsg.replace("chooseFile:fail",n)})}})})}(a),a)}}}),B5=XT(k5);const F5={auto:"auto",onready:"onready",manual:"manual"};function km(i){return{props:{localdata:{type:Array,default:()=>[]},options:{type:[Object,Array],default:()=>({})},spaceInfo:{type:Object,default:()=>({})},collection:{type:[String,Array],default:""},action:{type:String,default:""},field:{type:String,default:""},orderby:{type:String,default:""},where:{type:[String,Object],default:""},pageData:{type:String,default:"add"},pageCurrent:{type:Number,default:1},pageSize:{type:Number,default:20},getcount:{type:[Boolean,String],default:!1},gettree:{type:[Boolean,String],default:!1},gettreepath:{type:[Boolean,String],default:!1},startwith:{type:String,default:""},limitlevel:{type:Number,default:10},groupby:{type:String,default:""},groupField:{type:String,default:""},distinct:{type:[Boolean,String],default:!1},foreignKey:{type:String,default:""},loadtime:{type:String,default:"auto"},manual:{type:Boolean,default:!1}},data:()=>({mixinDatacomLoading:!1,mixinDatacomHasMore:!1,mixinDatacomResData:[],mixinDatacomErrorMessage:"",mixinDatacomPage:{},mixinDatacomError:null}),created(){this.mixinDatacomPage={current:this.pageCurrent,size:this.pageSize,count:0},this.$watch(()=>{var e=[];return["pageCurrent","pageSize","localdata","collection","action","field","orderby","where","getont","getcount","gettree","groupby","groupField","distinct"].forEach(t=>{e.push(this[t])}),e},(e,t)=>{if(this.loadtime===F5.manual)return;let n=!1;const s=[];for(let r=2;r<e.length;r++)e[r]!==t[r]&&(s.push(e[r]),n=!0);e[0]!==t[0]&&(this.mixinDatacomPage.current=this.pageCurrent),this.mixinDatacomPage.size=this.pageSize,this.onMixinDatacomPropsChange(n,s)})},methods:{onMixinDatacomPropsChange(e,t){},mixinDatacomEasyGet({getone:e=!1,success:t,fail:n}={}){this.mixinDatacomLoading||(this.mixinDatacomLoading=!0,this.mixinDatacomErrorMessage="",this.mixinDatacomError=null,this.mixinDatacomGet().then(s=>{this.mixinDatacomLoading=!1;const{data:r,count:o}=s.result;this.getcount&&(this.mixinDatacomPage.count=o),this.mixinDatacomHasMore=r.length<this.pageSize;const a=e?r.length?r[0]:void 0:r;this.mixinDatacomResData=a,t&&t(a)}).catch(s=>{this.mixinDatacomLoading=!1,this.mixinDatacomErrorMessage=s,this.mixinDatacomError=s,n&&n(s)}))},mixinDatacomGet(e={}){let t;e=e||{},t=typeof __uniX<"u"&&__uniX?i.databaseForJQL(this.spaceInfo):i.database(this.spaceInfo);const n=e.action||this.action;n&&(t=t.action(n));const s=e.collection||this.collection;t=Array.isArray(s)?t.collection(...s):t.collection(s);const r=e.where||this.where;r&&Object.keys(r).length&&(t=t.where(r));const o=e.field||this.field;o&&(t=t.field(o));const a=e.foreignKey||this.foreignKey;a&&(t=t.foreignKey(a));const c=e.groupby||this.groupby;c&&(t=t.groupBy(c));const l=e.groupField||this.groupField;l&&(t=t.groupField(l)),(e.distinct!==void 0?e.distinct:this.distinct)===!0&&(t=t.distinct());const u=e.orderby||this.orderby;u&&(t=t.orderBy(u));const f=e.pageCurrent!==void 0?e.pageCurrent:this.mixinDatacomPage.current,d=e.pageSize!==void 0?e.pageSize:this.mixinDatacomPage.size,h=e.getcount!==void 0?e.getcount:this.getcount,p=e.gettree!==void 0?e.gettree:this.gettree,m=e.gettreepath!==void 0?e.gettreepath:this.gettreepath,g={getCount:h},y={limitLevel:e.limitlevel!==void 0?e.limitlevel:this.limitlevel,startWith:e.startwith!==void 0?e.startwith:this.startwith};return p&&(g.getTree=y),m&&(g.getTreePath=y),t=t.skip(d*(f-1)).limit(d).get(g),t}}}}function O5(i){return function(e,t={}){t=function(c,l={}){return c.customUI=l.customUI||c.customUI,c.parseSystemError=l.parseSystemError||c.parseSystemError,Object.assign(c.loadingOptions,l.loadingOptions),Object.assign(c.errorOptions,l.errorOptions),typeof l.secretMethods=="object"&&(c.secretMethods=l.secretMethods),c}({customUI:!1,loadingOptions:{title:"加载中...",mask:!0},errorOptions:{type:"modal",retry:!1}},t);const{customUI:n,loadingOptions:s,errorOptions:r,parseSystemError:o}=t,a=!n;return new Proxy({},{get(c,l){switch(l){case"toString":return"[object UniCloudObject]";case"toJSON":return{}}return function({fn:u,interceptorName:f,getCallbackArgs:d}={}){return async function(...h){const p=d?d({params:h}):{};let m,g;try{return await st(rt(f,"invoke"),{...p}),m=await u(...h),await st(rt(f,"success"),{...p,result:m}),m}catch(y){throw g=y,await st(rt(f,"fail"),{...p,error:g}),g}finally{await st(rt(f,"complete"),g?{...p,error:g}:{...p,result:m})}}}({fn:async function u(...f){let d;a&&j.showLoading({title:s.title,mask:s.mask});const h={name:e,type:Ur.OBJECT,data:{method:l,params:f}};typeof t.secretMethods=="object"&&function(x,E){const S=E.data.method,T=x.secretMethods||{},_=T[S]||T["*"];_&&(E.secretType=_)}(t,h);let p=!1;try{d=await i.callFunction(h)}catch(x){p=!0,d={result:new Y(x)}}const{errSubject:m,errCode:g,errMsg:y,newToken:v}=d.result||{};if(a&&j.hideLoading(),v&&v.token&&v.tokenExpired&&(om(v),xt(we.REFRESH_TOKEN,{...v})),g){let x=y;if(p&&o&&(x=(await o({objectName:e,methodName:l,params:f,errSubject:m,errCode:g,errMsg:y})).errMsg||y),a)if(r.type==="toast")j.showToast({title:x,icon:"none"});else{if(r.type!=="modal")throw new Error(`Invalid errorOptions.type: ${r.type}`);{const{confirm:S}=await async function({title:T,content:_,showCancel:I,cancelText:w,confirmText:b}={}){return new Promise((L,k)=>{j.showModal({title:T,content:_,showCancel:I,cancelText:w,confirmText:b,success(M){L(M)},fail(){L({confirm:!1,cancel:!0})}})})}({title:"提示",content:x,showCancel:r.retry,cancelText:"取消",confirmText:r.retry?"重试":"确定"});if(r.retry&&S)return u(...f)}}const E=new Y({subject:m,code:g,message:y,requestId:d.requestId});throw E.detail=d.result,xt(we.RESPONSE,{type:hn.CLOUD_OBJECT,content:E}),E}return xt(we.RESPONSE,{type:hn.CLOUD_OBJECT,content:d.result}),d.result},interceptorName:"callObject",getCallbackArgs:function({params:u}={}){return{objectName:e,methodName:l,params:u}}})}})}}function Bm(i){return jn(Sm.replace("{spaceId}",i.config.spaceId))}async function M5({openid:i,callLoginByWeixin:e=!1}={}){const t=Bm(this);if(i&&e)throw new Error("[SecureNetwork] openid and callLoginByWeixin cannot be passed at the same time");if(i)return t.mpWeixinOpenid=i,{};const n=await new Promise((r,o)=>{j.login({success(a){r(a.code)},fail(a){o(new Error(a.errMsg))}})});return await this.importObject("uni-id-co",{customUI:!0}).secureNetworkHandshakeByWeixin({code:n,callLoginByWeixin:e}),t.mpWeixinCode=n,{code:n}}async function N5(i){const e=Bm(this);return e.initPromise||(e.initPromise=M5.call(this,i).then(t=>t).catch(t=>{throw delete e.initPromise,t})),e.initPromise}function U5(i){return function({openid:e,callLoginByWeixin:t=!1}={}){return N5.call(i,{openid:e,callLoginByWeixin:t})}}function $5(i){(function(e){Bl=e})(i)}function v0(i){const e=Ut.canIUse("getAppBaseInfo"),t={getAppBaseInfo:e?j.getAppBaseInfo:j.getSystemInfo,getPushClientId:j.getPushClientId};return function(n){return new Promise((s,r)=>{e&&i==="getAppBaseInfo"?s(t[i]()):t[i]({...n,success(o){s(o)},fail(o){r(o)}})})}}class H5 extends r6{constructor(){super(),this._uniPushMessageCallback=this._receivePushMessage.bind(this),this._currentMessageId=-1,this._payloadQueue=[]}init(){return Promise.all([v0("getAppBaseInfo")(),v0("getPushClientId")()]).then(([{appId:e}={},{cid:t}={}]=[])=>{if(!e)throw new Error("Invalid appId, please check the manifest.json file");if(!t)throw new Error("Invalid push client id");this._appId=e,this._pushClientId=t,this._seqId=Date.now()+"-"+Math.floor(9e5*Math.random()+1e5),this.emit("open"),this._initMessageListener()},e=>{throw this.emit("error",e),this.close(),e})}async open(){return this.init()}_isUniCloudSSE(e){if(e.type!=="receive")return!1;const t=e&&e.data&&e.data.payload;return!(!t||t.channel!=="UNI_CLOUD_SSE"||t.seqId!==this._seqId)}_receivePushMessage(e){if(!this._isUniCloudSSE(e))return;const t=e&&e.data&&e.data.payload,{action:n,messageId:s,message:r}=t;this._payloadQueue.push({action:n,messageId:s,message:r}),this._consumMessage()}_consumMessage(){for(;;){const e=this._payloadQueue.find(t=>t.messageId===this._currentMessageId+1);if(!e)break;this._currentMessageId++,this._parseMessagePayload(e)}}_parseMessagePayload(e){const{action:t,messageId:n,message:s}=e;t==="end"?this._end({messageId:n,message:s}):t==="message"&&this._appendMessage({messageId:n,message:s})}_appendMessage({messageId:e,message:t}={}){this.emit("message",t)}_end({messageId:e,message:t}={}){this.emit("end",t),this.close()}_initMessageListener(){j.onPushMessage(this._uniPushMessageCallback)}_destroy(){j.offPushMessage(this._uniPushMessageCallback)}toJSON(){return{appId:this._appId,pushClientId:this._pushClientId,seqId:this._seqId}}close(){this._destroy(),this.emit("close")}}async function G5(i){const e=i.__dev__;if(!e.debugInfo)return;const{address:t,servePort:n}=e.debugInfo,{address:s}=await mm(t,n);if(s)return e.localAddress=s,void(e.localPort=n);const r=console.warn;let o="";if(e.debugInfo.initialLaunchType==="remote"?(e.debugInfo.forceRemote=!0,o=`当前客户端和HBuilderX不在同一局域网下(或其他网络原因无法连接HBuilderX),uniCloud本地调试服务不对当前客户端生效。
- - 如果不使用uniCloud本地调试服务,请直接忽略此信息。
- - 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。`):o=`无法连接uniCloud本地调试服务,请检查当前客户端是否与主机在同一局域网下。
- - 如需使用uniCloud本地调试服务,请将客户端与主机连接到同一局域网下并重新运行到客户端。`,o+=`
- - 如果在HBuilderX开启的状态下切换过网络环境,请重启HBuilderX后再试
- - 检查系统防火墙是否拦截了HBuilderX自带的nodejs
- - 检查是否错误的使用拦截器修改uni.request方法的参数`,_i.indexOf("mp-")===0&&(o+=`
- - 小程序中如何使用uniCloud,请参考:https://uniapp.dcloud.net.cn/uniCloud/publish.html#useinmp`),!e.debugInfo.forceRemote)throw new Error(o);r(o)}function K5(i){i._initPromiseHub||(i._initPromiseHub=new Gc({createPromise:function(){let e=Promise.resolve();var t;t=1,e=new Promise(s=>{setTimeout(()=>{s()},t)});const n=i.auth();return e.then(()=>n.getLoginState()).then(s=>s?Promise.resolve():n.signInAnonymously())}}))}const V5={tcb:n0,tencent:n0,aliyun:g6,private:i0,dcloud:i0,alipay:W6};let St=new class{init(i){let e={};const t=V5[i.provider];if(!t)throw new Error("未提供正确的provider参数");return e=t.init(i),function(n){const s={};n.__dev__=s,s.debugLog=_i==="mp-harmony";const r=c6;r&&!r.code&&(s.debugInfo=r);const o=new Gc({createPromise:function(){return G5(n)}});s.initLocalNetwork=function(){return o.exec()}}(e),K5(e),m5(e),function(n){const s=n.uploadFile;n.uploadFile=function(r){return s.call(this,r)}}(e),function(n){n.database=function(s){if(s&&Object.keys(s).length>0)return n.init(s).database();if(this._database)return this._database;const r=p0(g0,{uniClient:n});return this._database=r,r},n.databaseForJQL=function(s){if(s&&Object.keys(s).length>0)return n.init(s).databaseForJQL();if(this._databaseForJQL)return this._databaseForJQL;const r=p0(g0,{uniClient:n,isJQL:!0});return this._databaseForJQL=r,r}}(e),function(n){n.getCurrentUserInfo=P5,n.chooseAndUploadFile=B5.initChooseAndUploadFile(n),Object.assign(n,{get mixinDatacom(){return km(n)}}),n.SSEChannel=H5,n.initSecureNetworkByWeixin=U5(n),n.setCustomClientInfo=$5,n.importObject=O5(n)}(e),["callFunction","uploadFile","deleteFile","getTempFileURL","downloadFile","chooseAndUploadFile"].forEach(n=>{if(!e[n])return;const s=e[n];e[n]=function(){return s.apply(e,Array.from(arguments))},e[n]=function(r,o){return function(a){let c=!1;o==="callFunction"&&(c=(a&&a.type||Ur.DEFAULT)!==Ur.DEFAULT);const l=o==="callFunction"&&!c,u=this._initPromiseHub.exec();a=a||{};const{success:f,fail:d,complete:h}=sm(a),p=u.then(()=>c?Promise.resolve():st(rt(o,"invoke"),a)).then(()=>r.call(this,a)).then(m=>c?Promise.resolve(m):st(rt(o,"success"),m).then(()=>st(rt(o,"complete"),m)).then(()=>(l&&xt(we.RESPONSE,{type:hn.CLOUD_FUNCTION,content:m}),Promise.resolve(m))),m=>c?Promise.reject(m):st(rt(o,"fail"),m).then(()=>st(rt(o,"complete"),m)).then(()=>(xt(we.RESPONSE,{type:hn.CLOUD_FUNCTION,content:m}),Promise.reject(m))));if(!(f||d||h))return p;p.then(m=>{f&&f(m),h&&h(m),l&&xt(we.RESPONSE,{type:hn.CLOUD_FUNCTION,content:m})},m=>{d&&d(m),h&&h(m),l&&xt(we.RESPONSE,{type:hn.CLOUD_FUNCTION,content:m})})}}(e[n],n).bind(e)}),e.init=this.init,e}};(()=>{const i=em;let e={};if(i&&i.length===1)e=i[0],St=St.init(e),St._isDefault=!0;else{const t=["auth","callFunction","uploadFile","deleteFile","getTempFileURL","downloadFile"],n=["database","getCurrentUserInfo","importObject"];let s;s=i&&i.length>0?"应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间":"应用未关联服务空间,请在uniCloud目录右键关联服务空间",[...t,...n].forEach(r=>{St[r]=function(){if(console.error(s),n.indexOf(r)===-1)return Promise.reject(new Y({code:"SYS_ERR",message:s}));console.error(s)}})}Object.assign(St,{get mixinDatacom(){return km(St)}}),w5(St),St.addInterceptor=nm,St.removeInterceptor=f6,St.interceptObject=d6})();var j5=St;const q=Number.isFinite||function(i){return typeof i=="number"&&isFinite(i)},q5=Number.isSafeInteger||function(i){return typeof i=="number"&&Math.abs(i)<=W5},W5=Number.MAX_SAFE_INTEGER||9007199254740991;let Z=function(i){return i.NETWORK_ERROR="networkError",i.MEDIA_ERROR="mediaError",i.KEY_SYSTEM_ERROR="keySystemError",i.MUX_ERROR="muxError",i.OTHER_ERROR="otherError",i}({}),$=function(i){return i.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",i.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",i.KEY_SYSTEM_NO_SESSION="keySystemNoSession",i.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",i.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",i.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",i.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",i.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",i.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",i.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",i.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR="keySystemDestroyMediaKeysError",i.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR="keySystemDestroyCloseSessionError",i.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR="keySystemDestroyRemoveSessionError",i.MANIFEST_LOAD_ERROR="manifestLoadError",i.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",i.MANIFEST_PARSING_ERROR="manifestParsingError",i.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",i.LEVEL_EMPTY_ERROR="levelEmptyError",i.LEVEL_LOAD_ERROR="levelLoadError",i.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",i.LEVEL_PARSING_ERROR="levelParsingError",i.LEVEL_SWITCH_ERROR="levelSwitchError",i.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",i.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",i.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",i.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",i.FRAG_LOAD_ERROR="fragLoadError",i.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",i.FRAG_DECRYPT_ERROR="fragDecryptError",i.FRAG_PARSING_ERROR="fragParsingError",i.FRAG_GAP="fragGap",i.REMUX_ALLOC_ERROR="remuxAllocError",i.KEY_LOAD_ERROR="keyLoadError",i.KEY_LOAD_TIMEOUT="keyLoadTimeOut",i.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",i.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",i.BUFFER_APPEND_ERROR="bufferAppendError",i.BUFFER_APPENDING_ERROR="bufferAppendingError",i.BUFFER_STALLED_ERROR="bufferStalledError",i.BUFFER_FULL_ERROR="bufferFullError",i.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",i.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",i.ASSET_LIST_LOAD_ERROR="assetListLoadError",i.ASSET_LIST_LOAD_TIMEOUT="assetListLoadTimeout",i.ASSET_LIST_PARSING_ERROR="assetListParsingError",i.INTERSTITIAL_ASSET_ITEM_ERROR="interstitialAssetItemError",i.INTERNAL_EXCEPTION="internalException",i.INTERNAL_ABORTED="aborted",i.ATTACH_MEDIA_ERROR="attachMediaError",i.UNKNOWN="unknown",i}({}),A=function(i){return i.MEDIA_ATTACHING="hlsMediaAttaching",i.MEDIA_ATTACHED="hlsMediaAttached",i.MEDIA_DETACHING="hlsMediaDetaching",i.MEDIA_DETACHED="hlsMediaDetached",i.MEDIA_ENDED="hlsMediaEnded",i.STALL_RESOLVED="hlsStallResolved",i.BUFFER_RESET="hlsBufferReset",i.BUFFER_CODECS="hlsBufferCodecs",i.BUFFER_CREATED="hlsBufferCreated",i.BUFFER_APPENDING="hlsBufferAppending",i.BUFFER_APPENDED="hlsBufferAppended",i.BUFFER_EOS="hlsBufferEos",i.BUFFERED_TO_END="hlsBufferedToEnd",i.BUFFER_FLUSHING="hlsBufferFlushing",i.BUFFER_FLUSHED="hlsBufferFlushed",i.MANIFEST_LOADING="hlsManifestLoading",i.MANIFEST_LOADED="hlsManifestLoaded",i.MANIFEST_PARSED="hlsManifestParsed",i.LEVEL_SWITCHING="hlsLevelSwitching",i.LEVEL_SWITCHED="hlsLevelSwitched",i.LEVEL_LOADING="hlsLevelLoading",i.LEVEL_LOADED="hlsLevelLoaded",i.LEVEL_UPDATED="hlsLevelUpdated",i.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",i.LEVELS_UPDATED="hlsLevelsUpdated",i.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",i.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",i.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",i.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",i.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",i.AUDIO_TRACK_UPDATED="hlsAudioTrackUpdated",i.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",i.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",i.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",i.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",i.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",i.SUBTITLE_TRACK_UPDATED="hlsSubtitleTrackUpdated",i.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",i.CUES_PARSED="hlsCuesParsed",i.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",i.INIT_PTS_FOUND="hlsInitPtsFound",i.FRAG_LOADING="hlsFragLoading",i.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",i.FRAG_LOADED="hlsFragLoaded",i.FRAG_DECRYPTED="hlsFragDecrypted",i.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",i.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",i.FRAG_PARSING_METADATA="hlsFragParsingMetadata",i.FRAG_PARSED="hlsFragParsed",i.FRAG_BUFFERED="hlsFragBuffered",i.FRAG_CHANGED="hlsFragChanged",i.FPS_DROP="hlsFpsDrop",i.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",i.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",i.ERROR="hlsError",i.DESTROYING="hlsDestroying",i.KEY_LOADING="hlsKeyLoading",i.KEY_LOADED="hlsKeyLoaded",i.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",i.BACK_BUFFER_REACHED="hlsBackBufferReached",i.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",i.ASSET_LIST_LOADING="hlsAssetListLoading",i.ASSET_LIST_LOADED="hlsAssetListLoaded",i.INTERSTITIALS_UPDATED="hlsInterstitialsUpdated",i.INTERSTITIALS_BUFFERED_TO_BOUNDARY="hlsInterstitialsBufferedToBoundary",i.INTERSTITIAL_ASSET_PLAYER_CREATED="hlsInterstitialAssetPlayerCreated",i.INTERSTITIAL_STARTED="hlsInterstitialStarted",i.INTERSTITIAL_ASSET_STARTED="hlsInterstitialAssetStarted",i.INTERSTITIAL_ASSET_ENDED="hlsInterstitialAssetEnded",i.INTERSTITIAL_ASSET_ERROR="hlsInterstitialAssetError",i.INTERSTITIAL_ENDED="hlsInterstitialEnded",i.INTERSTITIALS_PRIMARY_RESUMED="hlsInterstitialsPrimaryResumed",i.PLAYOUT_LIMIT_REACHED="hlsPlayoutLimitReached",i.EVENT_CUE_ENTER="hlsEventCueEnter",i}({});var ue={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},X={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};class ri{constructor(e,t=0,n=0){this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=e,this.alpha_=e?Math.exp(Math.log(.5)/e):0,this.estimate_=t,this.totalWeight_=n}sample(e,t){const n=Math.pow(this.alpha_,e);this.estimate_=t*(1-n)+n*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class z5{constructor(e,t,n,s=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=n,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new ri(e),this.fast_=new ri(t),this.defaultTTFB_=s,this.ttfb_=new ri(e)}update(e,t){const{slow_:n,fast_:s,ttfb_:r}=this;n.halfLife!==e&&(this.slow_=new ri(e,n.getEstimate(),n.getTotalWeight())),s.halfLife!==t&&(this.fast_=new ri(t,s.getEstimate(),s.getTotalWeight())),r.halfLife!==e&&(this.ttfb_=new ri(e,r.getEstimate(),r.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const n=8*t,s=e/1e3,r=n/s;this.fast_.sample(s,r),this.slow_.sample(s,r)}sampleTTFB(e){const t=e/1e3,n=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(n,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}get defaultEstimate(){return this.defaultEstimate_}destroy(){}}function Q5(i,e,t){return(e=X5(e))in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function me(){return me=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},me.apply(null,arguments)}function E0(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(i);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(i,s).enumerable})),t.push.apply(t,n)}return t}function ye(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?E0(Object(t),!0).forEach(function(n){Q5(i,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):E0(Object(t)).forEach(function(n){Object.defineProperty(i,n,Object.getOwnPropertyDescriptor(t,n))})}return i}function Y5(i,e){if(typeof i!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var n=t.call(i,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}function X5(i){var e=Y5(i,"string");return typeof e=="symbol"?e:e+""}class Rt{constructor(e,t){this.trace=void 0,this.debug=void 0,this.log=void 0,this.warn=void 0,this.info=void 0,this.error=void 0;const n=`[${e}]:`;this.trace=ln,this.debug=t.debug.bind(null,n),this.log=t.log.bind(null,n),this.warn=t.warn.bind(null,n),this.info=t.info.bind(null,n),this.error=t.error.bind(null,n)}}const ln=function(){},J5={trace:ln,debug:ln,log:ln,warn:ln,info:ln,error:ln};function Gl(){return me({},J5)}function Z5(i,e){const t=self.console[i];return t?t.bind(self.console,`${e?"["+e+"] ":""}[${i}] >`):ln}function A0(i,e,t){return e[i]?e[i].bind(e):Z5(i,t)}const Kl=Gl();function eb(i,e,t){const n=Gl();if(typeof console=="object"&&i===!0||typeof i=="object"){const s=["debug","log","info","warn","error"];s.forEach(r=>{n[r]=A0(r,i,t)});try{n.log(`Debug logs enabled for "${e}" in hls.js version 1.6.7`)}catch{return Gl()}s.forEach(r=>{Kl[r]=A0(r,i)})}else me(Kl,n);return n}const pe=Kl;function Tn(i=!0){return typeof self>"u"?void 0:(i||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function tb(i){return typeof self<"u"&&i===self.ManagedMediaSource}function Fm(i,e){const t=Object.keys(i),n=Object.keys(e),s=t.length,r=n.length;return!s||!r||s===r&&!t.some(o=>n.indexOf(o)===-1)}function ft(i,e=!1){if(typeof TextDecoder<"u"){const l=new TextDecoder("utf-8").decode(i);if(e){const u=l.indexOf("\0");return u!==-1?l.substring(0,u):l}return l.replace(/\0/g,"")}const t=i.length;let n,s,r,o="",a=0;for(;a<t;){if(n=i[a++],n===0&&e)return o;if(n===0||n===3)continue;switch(n>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(n);break;case 12:case 13:s=i[a++],o+=String.fromCharCode((n&31)<<6|s&63);break;case 14:s=i[a++],r=i[a++],o+=String.fromCharCode((n&15)<<12|(s&63)<<6|(r&63)<<0);break}}return o}const Pn={hexDump:function(i){let e="";for(let t=0;t<i.length;t++){let n=i[t].toString(16);n.length<2&&(n="0"+n),e+=n}return e}};function Om(i){return Uint8Array.from(i.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}function nb(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Ko={exports:{}},S0;function ib(){return S0||(S0=1,function(i,e){(function(t){var n=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,s=/^(?=([^\/?#]*))\1([^]*)$/,r=/(?:\/|^)\.(?=\/)/g,o=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,a={buildAbsoluteURL:function(c,l,u){if(u=u||{},c=c.trim(),l=l.trim(),!l){if(!u.alwaysNormalize)return c;var f=a.parseURL(c);if(!f)throw new Error("Error trying to parse base URL.");return f.path=a.normalizePath(f.path),a.buildURLFromParts(f)}var d=a.parseURL(l);if(!d)throw new Error("Error trying to parse relative URL.");if(d.scheme)return u.alwaysNormalize?(d.path=a.normalizePath(d.path),a.buildURLFromParts(d)):l;var h=a.parseURL(c);if(!h)throw new Error("Error trying to parse base URL.");if(!h.netLoc&&h.path&&h.path[0]!=="/"){var p=s.exec(h.path);h.netLoc=p[1],h.path=p[2]}h.netLoc&&!h.path&&(h.path="/");var m={scheme:h.scheme,netLoc:d.netLoc,path:null,params:d.params,query:d.query,fragment:d.fragment};if(!d.netLoc&&(m.netLoc=h.netLoc,d.path[0]!=="/"))if(!d.path)m.path=h.path,d.params||(m.params=h.params,d.query||(m.query=h.query));else{var g=h.path,y=g.substring(0,g.lastIndexOf("/")+1)+d.path;m.path=a.normalizePath(y)}return m.path===null&&(m.path=u.alwaysNormalize?a.normalizePath(d.path):d.path),a.buildURLFromParts(m)},parseURL:function(c){var l=n.exec(c);return l?{scheme:l[1]||"",netLoc:l[2]||"",path:l[3]||"",params:l[4]||"",query:l[5]||"",fragment:l[6]||""}:null},normalizePath:function(c){for(c=c.split("").reverse().join("").replace(r,"");c.length!==(c=c.replace(o,"")).length;);return c.split("").reverse().join("")},buildURLFromParts:function(c){return c.scheme+c.netLoc+c.path+c.params+c.query+c.fragment}};i.exports=a})()}(Ko)),Ko.exports}var eu=ib();class tu{constructor(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}}var ve={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class Mm{constructor(e){this._byteRange=null,this._url=null,this._stats=null,this._streams=null,this.base=void 0,this.relurl=void 0,typeof e=="string"&&(e={url:e}),this.base=e,rb(this,"stats")}setByteRange(e,t){const n=e.split("@",2);let s;n.length===1?s=(t==null?void 0:t.byteRangeEndOffset)||0:s=parseInt(n[1]),this._byteRange=[s,parseInt(n[0])+s]}get baseurl(){return this.base.url}get byteRange(){return this._byteRange===null?[]:this._byteRange}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get elementaryStreams(){return this._streams===null&&(this._streams={[ve.AUDIO]:null,[ve.VIDEO]:null,[ve.AUDIOVIDEO]:null}),this._streams}set elementaryStreams(e){this._streams=e}get hasStats(){return this._stats!==null}get hasStreams(){return this._streams!==null}get stats(){return this._stats===null&&(this._stats=new tu),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=eu.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[ve.AUDIO]=null,e[ve.VIDEO]=null,e[ve.AUDIOVIDEO]=null}}function De(i){return i.sn!=="initSegment"}class Vo extends Mm{constructor(e,t){super(t),this._decryptdata=null,this._programDateTime=null,this._ref=null,this._bitrate=void 0,this.rawProgramDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.playlistOffset=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get byteLength(){if(this.hasStats){const e=this.stats.total;if(e)return e}if(this.byteRange){const e=this.byteRange[0],t=this.byteRange[1];if(q(e)&&q(t))return t-e}return null}get bitrate(){return this.byteLength?this.byteLength*8/this.duration:this._bitrate?this._bitrate:null}set bitrate(e){this._bitrate=e}get decryptdata(){const{levelkeys:e}=this;if(!e&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){const t=this.levelkeys.identity;if(t)this._decryptdata=t.getDecryptData(this.sn);else{const n=Object.keys(this.levelkeys);if(n.length===1)return this._decryptdata=this.levelkeys[n[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null)return null;const e=q(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){const t=Object.keys(this.levelkeys),n=t.length;if(n>1||n===1&&this.levelkeys[t[0]].encrypted)return!0}return!1}get programDateTime(){return this._programDateTime===null&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(e){if(!q(e)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=e}get ref(){return De(this)?(this._ref||(this._ref={base:this.base,start:this.start,duration:this.duration,sn:this.sn,programDateTime:this.programDateTime}),this._ref):null}addStart(e){this.setStart(this.start+e)}setStart(e){this.start=e,this._ref&&(this._ref.start=e)}setDuration(e){this.duration=e,this._ref&&(this._ref.duration=e)}setKeyFormat(e){if(this.levelkeys){const t=this.levelkeys[e];t&&!this._decryptdata&&(this._decryptdata=t.getDecryptData(this.sn))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,n,s,r,o=!1){const{elementaryStreams:a}=this,c=a[e];if(!c){a[e]={startPTS:t,endPTS:n,startDTS:s,endDTS:r,partial:o};return}c.startPTS=Math.min(c.startPTS,t),c.endPTS=Math.max(c.endPTS,n),c.startDTS=Math.min(c.startDTS,s),c.endDTS=Math.max(c.endDTS,r)}}class sb extends Mm{constructor(e,t,n,s,r){super(n),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=t,this.index=s;const o=e.enumeratedString("BYTERANGE");o&&this.setByteRange(o,r),r&&(this.fragOffset=r.fragOffset+r.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}function Nm(i,e){const t=Object.getPrototypeOf(i);if(t){const n=Object.getOwnPropertyDescriptor(t,e);return n||Nm(t,e)}}function rb(i,e){const t=Nm(i,e);t&&(t.enumerable=!0,Object.defineProperty(i,e,t))}const T0=Math.pow(2,32)-1,ob=[].push,Um={video:1,audio:2,id3:3,text:4};function Ue(i){return String.fromCharCode.apply(null,i)}function $m(i,e){const t=i[e]<<8|i[e+1];return t<0?65536+t:t}function ie(i,e){const t=Hm(i,e);return t<0?4294967296+t:t}function b0(i,e){let t=ie(i,e);return t*=Math.pow(2,32),t+=ie(i,e+4),t}function Hm(i,e){return i[e]<<24|i[e+1]<<16|i[e+2]<<8|i[e+3]}function ab(i){const e=i.byteLength;for(let t=0;t<e;){const n=ie(i,t);if(n>8&&i[t+4]===109&&i[t+5]===111&&i[t+6]===111&&i[t+7]===102)return!0;t=n>1?t+n:e}return!1}function le(i,e){const t=[];if(!e.length)return t;const n=i.byteLength;for(let s=0;s<n;){const r=ie(i,s),o=Ue(i.subarray(s+4,s+8)),a=r>1?s+r:n;if(o===e[0])if(e.length===1)t.push(i.subarray(s+8,a));else{const c=le(i.subarray(s+8,a),e.slice(1));c.length&&ob.apply(t,c)}s=a}return t}function lb(i){const e=[],t=i[0];let n=8;const s=ie(i,n);n+=4;let r=0,o=0;t===0?(r=ie(i,n),o=ie(i,n+4),n+=8):(r=b0(i,n),o=b0(i,n+8),n+=16),n+=2;let a=i.length+o;const c=$m(i,n);n+=2;for(let l=0;l<c;l++){let u=n;const f=ie(i,u);u+=4;const d=f&2147483647;if((f&2147483648)>>>31===1)return pe.warn("SIDX has hierarchical references (not supported)"),null;const p=ie(i,u);u+=4,e.push({referenceSize:d,subsegmentDuration:p,info:{duration:p/s,start:a,end:a+d-1}}),a+=d,u+=4,n=u}return{earliestPresentationTime:r,timescale:s,version:t,referencesCount:c,references:e}}function Gm(i){const e=[],t=le(i,["moov","trak"]);for(let s=0;s<t.length;s++){const r=t[s],o=le(r,["tkhd"])[0];if(o){let a=o[0];const c=ie(o,a===0?12:20),l=le(r,["mdia","mdhd"])[0];if(l){a=l[0];const u=ie(l,a===0?12:20),f=le(r,["mdia","hdlr"])[0];if(f){const d=Ue(f.subarray(8,12)),h={soun:ve.AUDIO,vide:ve.VIDEO}[d],p=le(r,["mdia","minf","stbl","stsd"])[0],m=cb(p);h?(e[c]={timescale:u,type:h,stsd:m},e[h]=ye({timescale:u,id:c},m)):e[c]={timescale:u,type:d,stsd:m}}}}}return le(i,["moov","mvex","trex"]).forEach(s=>{const r=ie(s,4),o=e[r];o&&(o.default={duration:ie(s,12),flags:ie(s,20)})}),e}function cb(i){const e=i.subarray(8),t=e.subarray(86),n=Ue(e.subarray(4,8));let s=n,r;const o=n==="enca"||n==="encv";if(o){const l=le(e,[n])[0].subarray(n==="enca"?28:78);le(l,["sinf"]).forEach(f=>{const d=le(f,["schm"])[0];if(d){const h=Ue(d.subarray(4,8));if(h==="cbcs"||h==="cenc"){const p=le(f,["frma"])[0];p&&(s=Ue(p))}}})}const a=s;switch(s){case"avc1":case"avc2":case"avc3":case"avc4":{const c=le(t,["avcC"])[0];c&&c.length>3&&(s+="."+Ws(c[1])+Ws(c[2])+Ws(c[3]),r=qs(a==="avc1"?"dva1":"dvav",t));break}case"mp4a":{const c=le(e,[n])[0],l=le(c.subarray(28),["esds"])[0];if(l&&l.length>7){let u=4;if(l[u++]!==3)break;u=jo(l,u),u+=2;const f=l[u++];if(f&128&&(u+=2),f&64&&(u+=l[u++]),l[u++]!==4)break;u=jo(l,u);const d=l[u++];if(d===64)s+="."+Ws(d);else break;if(u+=12,l[u++]!==5)break;u=jo(l,u);const h=l[u++];let p=(h&248)>>3;p===31&&(p+=1+((h&7)<<3)+((l[u]&224)>>5)),s+="."+p}break}case"hvc1":case"hev1":{const c=le(t,["hvcC"])[0];if(c&&c.length>12){const l=c[1],u=["","A","B","C"][l>>6],f=l&31,d=ie(c,2),h=(l&32)>>5?"H":"L",p=c[12],m=c.subarray(6,12);s+="."+u+f,s+="."+ub(d).toString(16).toUpperCase(),s+="."+h+p;let g="";for(let y=m.length;y--;){const v=m[y];(v||g)&&(g="."+v.toString(16).toUpperCase()+g)}s+=g}r=qs(a=="hev1"?"dvhe":"dvh1",t);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":{s=qs(s,t)||s;break}case"vp09":{const c=le(t,["vpcC"])[0];if(c&&c.length>6){const l=c[4],u=c[5],f=c[6]>>4&15;s+="."+Dt(l)+"."+Dt(u)+"."+Dt(f)}break}case"av01":{const c=le(t,["av1C"])[0];if(c&&c.length>2){const l=c[1]>>>5,u=c[1]&31,f=c[2]>>>7?"H":"M",d=(c[2]&64)>>6,h=(c[2]&32)>>5,p=l===2&&d?h?12:10:d?10:8,m=(c[2]&16)>>4,g=(c[2]&8)>>3,y=(c[2]&4)>>2,v=c[2]&3;s+="."+l+"."+Dt(u)+f+"."+Dt(p)+"."+m+"."+g+y+v+"."+Dt(1)+"."+Dt(1)+"."+Dt(1)+"."+0,r=qs("dav1",t)}break}}return{codec:s,encrypted:o,supplemental:r}}function qs(i,e){const t=le(e,["dvvC"]),n=t.length?t[0]:le(e,["dvcC"])[0];if(n){const s=n[2]>>1&127,r=n[2]<<5&32|n[3]>>3&31;return i+"."+Dt(s)+"."+Dt(r)}}function ub(i){let e=0;for(let t=0;t<32;t++)e|=(i>>t&1)<<31-t;return e>>>0}function jo(i,e){const t=e+5;for(;i[e++]&128&&e<t;);return e}function Ws(i){return("0"+i.toString(16).toUpperCase()).slice(-2)}function Dt(i){return(i<10?"0":"")+i}function fb(i,e){if(!i||!e)return i;const t=e.keyId;return t&&e.isCommonEncryption&&le(i,["moov","trak"]).forEach(s=>{const o=le(s,["mdia","minf","stbl","stsd"])[0].subarray(8);let a=le(o,["enca"]);const c=a.length>0;c||(a=le(o,["encv"])),a.forEach(l=>{const u=c?l.subarray(28):l.subarray(78);le(u,["sinf"]).forEach(d=>{const h=db(d);if(h){const p=h.subarray(8,24);p.some(m=>m!==0)||(pe.log(`[eme] Patching keyId in 'enc${c?"a":"v"}>sinf>>tenc' box: ${Pn.hexDump(p)} -> ${Pn.hexDump(t)}`),h.set(t,8))}})})}),i}function db(i){const e=le(i,["schm"])[0];if(e){const t=Ue(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return le(i,["schi","tenc"])[0]}return null}function hb(i,e,t){const n={},s=le(i,["moof","traf"]);for(let r=0;r<s.length;r++){const o=s[r],a=le(o,["tfhd"])[0],c=ie(a,4),l=e[c];if(!l)continue;const u=n[c]||(n[c]={start:NaN,duration:0,sampleCount:0,timescale:l.timescale,type:l.type}),f=le(o,["tfdt"])[0];if(f){const x=f[0];let E=ie(f,4);x===1&&(E===T0?t.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"):(E*=T0+1,E+=ie(f,8))),q(E)&&(!q(u.start)||E<u.start)&&(u.start=E)}const d=l.default,h=ie(a,0)|(d==null?void 0:d.flags);let p=(d==null?void 0:d.duration)||0;h&8&&(h&2?p=ie(a,12):p=ie(a,8));const m=le(o,["trun"]);let g=u.start||0,y=0,v=p;for(let x=0;x<m.length;x++){const E=m[x],S=ie(E,4),T=u.sampleCount;u.sampleCount+=S;const _=E[3]&1,I=E[3]&4,w=E[2]&1,b=E[2]&2,L=E[2]&4,k=E[2]&8;let M=8,N=S;for(_&&(M+=4),I&&S&&(!(E[M+1]&1)&&u.keyFrameIndex===void 0&&(u.keyFrameIndex=T),M+=4,w?(v=ie(E,M),M+=4):v=p,b&&(M+=4),k&&(M+=4),g+=v,y+=v,N--);N--;)w?(v=ie(E,M),M+=4):v=p,b&&(M+=4),L&&(E[M+1]&1||u.keyFrameIndex===void 0&&(u.keyFrameIndex=u.sampleCount-(N+1),u.keyFrameStart=g),M+=4),k&&(M+=4),g+=v,y+=v;!y&&p&&(y+=p*S)}u.duration+=y}if(!Object.keys(n).some(r=>n[r].duration)){let r=1/0,o=0;const a=le(i,["sidx"]);for(let c=0;c<a.length;c++){const l=lb(a[c]);if(l!=null&&l.references){r=Math.min(r,l.earliestPresentationTime/l.timescale);const u=l.references.reduce((f,d)=>f+d.info.duration||0,0);o=Math.max(o,u+l.earliestPresentationTime/l.timescale)}}o&&q(o)&&Object.keys(n).forEach(c=>{n[c].duration||(n[c].duration=o*n[c].timescale-n[c].start)})}return n}function pb(i){const e={valid:null,remainder:null},t=le(i,["moof"]);if(t.length<2)return e.remainder=i,e;const n=t[t.length-1];return e.valid=i.slice(0,n.byteOffset-8),e.remainder=i.slice(n.byteOffset-8),e}function vt(i,e){const t=new Uint8Array(i.length+e.length);return t.set(i),t.set(e,i.length),t}function _0(i,e){const t=[],n=e.samples,s=e.timescale,r=e.id;let o=!1;return le(n,["moof"]).map(c=>{const l=c.byteOffset-8;le(c,["traf"]).map(f=>{const d=le(f,["tfdt"]).map(h=>{const p=h[0];let m=ie(h,4);return p===1&&(m*=Math.pow(2,32),m+=ie(h,8)),m/s})[0];return d!==void 0&&(i=d),le(f,["tfhd"]).map(h=>{const p=ie(h,4),m=ie(h,0)&16777215,g=(m&1)!==0,y=(m&2)!==0,v=(m&8)!==0;let x=0;const E=(m&16)!==0;let S=0;const T=(m&32)!==0;let _=8;p===r&&(g&&(_+=8),y&&(_+=4),v&&(x=ie(h,_),_+=4),E&&(S=ie(h,_),_+=4),T&&(_+=4),e.type==="video"&&(o=go(e.codec)),le(f,["trun"]).map(I=>{const w=I[0],b=ie(I,0)&16777215,L=(b&1)!==0;let k=0;const M=(b&4)!==0,N=(b&256)!==0;let F=0;const O=(b&512)!==0;let K=0;const B=(b&1024)!==0,G=(b&2048)!==0;let H=0;const C=ie(I,4);let R=8;L&&(k=ie(I,R),R+=4),M&&(R+=4);let P=k+l;for(let D=0;D<C;D++){if(N?(F=ie(I,R),R+=4):F=x,O?(K=ie(I,R),R+=4):K=S,B&&(R+=4),G&&(w===0?H=ie(I,R):H=Hm(I,R),R+=4),e.type===ve.VIDEO){let z=0;for(;z<K;){const Q=ie(n,P);if(P+=4,gb(o,n[P])){const se=n.subarray(P,P+Q);nu(se,o?2:1,i+H/s,t)}P+=Q,z+=Q+4}}i+=F/s}}))})})}),t}function go(i){if(!i)return!1;const e=i.substring(0,4);return e==="hvc1"||e==="hev1"||e==="dvh1"||e==="dvhe"}function gb(i,e){if(i){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function nu(i,e,t,n){const s=Km(i);let r=0;r+=e;let o=0,a=0,c=0;for(;r<s.length;){o=0;do{if(r>=s.length)break;c=s[r++],o+=c}while(c===255);a=0;do{if(r>=s.length)break;c=s[r++],a+=c}while(c===255);const l=s.length-r;let u=r;if(a<l)r+=a;else if(a>l){pe.error(`Malformed SEI payload. ${a} is too small, only ${l} bytes left to parse.`);break}if(o===4){if(s[u++]===181){const d=$m(s,u);if(u+=2,d===49){const h=ie(s,u);if(u+=4,h===1195456820){const p=s[u++];if(p===3){const m=s[u++],g=31&m,y=64&m,v=y?2+g*3:0,x=new Uint8Array(v);if(y){x[0]=m;for(let E=1;E<v;E++)x[E]=s[u++]}n.push({type:p,payloadType:o,pts:t,bytes:x})}}}}}else if(o===5&&a>16){const f=[];for(let p=0;p<16;p++){const m=s[u++].toString(16);f.push(m.length==1?"0"+m:m),(p===3||p===5||p===7||p===9)&&f.push("-")}const d=a-16,h=new Uint8Array(d);for(let p=0;p<d;p++)h[p]=s[u++];n.push({payloadType:o,pts:t,uuid:f.join(""),userData:ft(h),userDataBytes:h})}}}function Km(i){const e=i.byteLength,t=[];let n=1;for(;n<e-2;)i[n]===0&&i[n+1]===0&&i[n+2]===3?(t.push(n+2),n+=2):n++;if(t.length===0)return i;const s=e-t.length,r=new Uint8Array(s);let o=0;for(n=0;n<s;o++,n++)o===t[0]&&(o++,t.shift()),r[n]=i[o];return r}function mb(i){const e=i[0];let t="",n="",s=0,r=0,o=0,a=0,c=0,l=0;if(e===0){for(;Ue(i.subarray(l,l+1))!=="\0";)t+=Ue(i.subarray(l,l+1)),l+=1;for(t+=Ue(i.subarray(l,l+1)),l+=1;Ue(i.subarray(l,l+1))!=="\0";)n+=Ue(i.subarray(l,l+1)),l+=1;n+=Ue(i.subarray(l,l+1)),l+=1,s=ie(i,12),r=ie(i,16),a=ie(i,20),c=ie(i,24),l=28}else if(e===1){l+=4,s=ie(i,l),l+=4;const f=ie(i,l);l+=4;const d=ie(i,l);for(l+=4,o=2**32*f+d,q5(o)||(o=Number.MAX_SAFE_INTEGER,pe.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),a=ie(i,l),l+=4,c=ie(i,l),l+=4;Ue(i.subarray(l,l+1))!=="\0";)t+=Ue(i.subarray(l,l+1)),l+=1;for(t+=Ue(i.subarray(l,l+1)),l+=1;Ue(i.subarray(l,l+1))!=="\0";)n+=Ue(i.subarray(l,l+1)),l+=1;n+=Ue(i.subarray(l,l+1)),l+=1}const u=i.subarray(l,i.byteLength);return{schemeIdUri:t,value:n,timeScale:s,presentationTime:o,presentationTimeDelta:r,eventDuration:a,id:c,payload:u}}function xb(i,...e){const t=e.length;let n=8,s=t;for(;s--;)n+=e[s].byteLength;const r=new Uint8Array(n);for(r[0]=n>>24&255,r[1]=n>>16&255,r[2]=n>>8&255,r[3]=n&255,r.set(i,4),s=0,n=8;s<t;s++)r.set(e[s],n),n+=e[s].byteLength;return r}function yb(i,e,t){if(i.byteLength!==16)throw new RangeError("Invalid system id");let n,s;n=0,s=new Uint8Array;let r;n>0?(r=new Uint8Array(4),e.length>0&&new DataView(r.buffer).setUint32(0,e.length,!1)):r=new Uint8Array;const o=new Uint8Array(4);return t&&t.byteLength>0&&new DataView(o.buffer).setUint32(0,t.byteLength,!1),xb([112,115,115,104],new Uint8Array([n,0,0,0]),i,r,s,o,t||new Uint8Array)}const Vm=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),Ci={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,dav1:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function iu(i,e){const t=Ci[e];return!!t&&!!t[i.slice(0,4)]}function Vl(i,e,t=!0){return!i.split(",").some(n=>!su(n,e,t))}function su(i,e,t=!0){var n;const s=Tn(t);return(n=s==null?void 0:s.isTypeSupported(ys(i,e)))!=null?n:!1}function ys(i,e){return`${e}/mp4;codecs=${i}`}function I0(i){if(i){const e=i.substring(0,4);return Ci.video[e]}return 2}function Hr(i){const e=Vm();return i.split(",").reduce((t,n)=>{const r=e&&go(n)?9:Ci.video[n];return r?(r*2+t)/(t?3:2):(Ci.audio[n]+t)/(t?2:1)},0)}const qo={};function vb(i,e=!0){if(qo[i])return qo[i];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[i];for(let s=0;s<t.length;s++){var n;if(su(t[s],"audio",e))return qo[i]=t[s],t[s];if(t[s]==="mp3"&&(n=Tn(e))!=null&&n.isTypeSupported("audio/mpeg"))return""}return i}const Eb=/flac|opus|mp4a\.40\.34/i;function Gr(i,e=!0){return i.replace(Eb,t=>vb(t.toLowerCase(),e))}function Ab(i,e){const t=[];if(i){const n=i.split(",");for(let s=0;s<n.length;s++)iu(n[s],"video")||t.push(n[s])}return e&&t.push(e),t.join(",")}function dr(i,e){if(i&&(i.length>4||["ac-3","ec-3","alac","fLaC","Opus"].indexOf(i)!==-1)&&(C0(i,"audio")||C0(i,"video")))return i;if(e){const t=e.split(",");if(t.length>1){if(i){for(let n=t.length;n--;)if(t[n].substring(0,4)===i.substring(0,4))return t[n]}return t[0]}}return e||i}function C0(i,e){return iu(i,e)&&su(i,e)}function Sb(i){const e=i.split(",");for(let t=0;t<e.length;t++){const n=e[t].split(".");n.length>2&&n[0]==="avc1"&&(e[t]=`avc1.${parseInt(n[1]).toString(16)}${("000"+parseInt(n[2]).toString(16)).slice(-4)}`)}return e.join(",")}function Tb(i){if(i.startsWith("av01.")){const e=i.split("."),t=["0","111","01","01","01","0"];for(let n=e.length;n>4&&n<10;n++)e[n]=t[n-4];return e.join(".")}return i}function L0(i){const e=Tn(i)||{isTypeSupported:()=>!1};return{mpeg:e.isTypeSupported("audio/mpeg"),mp3:e.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:e.isTypeSupported('audio/mp4; codecs="ac-3"')}}function jl(i){return i.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const jm={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]};function qm(i,e){return{supported:!1,configurations:e,decodingInfoResults:[{supported:!1,smooth:!1,powerEfficient:!1}],error:i}}function bb(i,e,t,n,s,r){const o=i.videoCodec,a=i.audioCodec?i.audioGroups:null,c=r==null?void 0:r.audioCodec,l=r==null?void 0:r.channels,u=l?parseInt(l):c?1/0:2;let f=null;if(a!=null&&a.length)try{a.length===1&&a[0]?f=e.groups[a[0]].channels:f=a.reduce((d,h)=>{if(h){const p=e.groups[h];if(!p)throw new Error(`Audio track group ${h} not found`);Object.keys(p.channels).forEach(m=>{d[m]=(d[m]||0)+p.channels[m]})}return d},{2:0})}catch{return!0}return o!==void 0&&(o.split(",").some(d=>go(d))||i.width>1920&&i.height>1088||i.height>1920&&i.width>1088||i.frameRate>Math.max(n,30)||i.videoRange!=="SDR"&&i.videoRange!==t||i.bitrate>Math.max(s,8e6))||!!f&&q(u)&&Object.keys(f).some(d=>parseInt(d)>u)}function Wm(i,e,t,n={}){const s=i.videoCodec;if(!s&&!i.audioCodec||!t)return Promise.resolve(jm);const r=[],o=_b(i),a=o.length,c=Ib(i,e,a>0),l=c.length;for(let u=a||1*l||1;u--;){const f={type:"media-source"};if(a&&(f.video=o[u%a]),l){f.audio=c[u%l];const d=f.audio.bitrate;f.video&&d&&(f.video.bitrate-=d)}r.push(f)}if(s){const u=navigator.userAgent;if(s.split(",").some(f=>go(f))&&Vm())return Promise.resolve(qm(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: (${u})`),r))}return Promise.all(r.map(u=>{const f=Lb(u);return n[f]||(n[f]=t.decodingInfo(u))})).then(u=>({supported:!u.some(f=>!f.supported),configurations:r,decodingInfoResults:u})).catch(u=>({supported:!1,configurations:r,decodingInfoResults:[],error:u}))}function _b(i){var e;const t=(e=i.videoCodec)==null?void 0:e.split(","),n=zm(i),s=i.width||640,r=i.height||480,o=i.frameRate||30,a=i.videoRange.toLowerCase();return t?t.map(c=>{const l={contentType:ys(Tb(c),"video"),width:s,height:r,bitrate:n,framerate:o};return a!=="sdr"&&(l.transferFunction=a),l}):[]}function Ib(i,e,t){var n;const s=(n=i.audioCodec)==null?void 0:n.split(","),r=zm(i);return s&&i.audioGroups?i.audioGroups.reduce((o,a)=>{var c;const l=a?(c=e.groups[a])==null?void 0:c.tracks:null;return l?l.reduce((u,f)=>{if(f.groupId===a){const d=parseFloat(f.channels||"");s.forEach(h=>{const p={contentType:ys(h,"audio"),bitrate:t?Cb(h,r):r};d&&(p.channels=""+d),u.push(p)})}return u},o):o},[]):[]}function Cb(i,e){if(e<=1)return 1;let t=128e3;return i==="ec-3"?t=768e3:i==="ac-3"&&(t=64e4),Math.min(e/2,t)}function zm(i){return Math.ceil(Math.max(i.bitrate*.9,i.averageBitrate)/1e3)*1e3||1}function Lb(i){let e="";const{audio:t,video:n}=i;if(n){const s=jl(n.contentType);e+=`${s}_r${n.height}x${n.width}f${Math.ceil(n.framerate)}${n.transferFunction||"sd"}_${Math.ceil(n.bitrate/1e5)}`}if(t){const s=jl(t.contentType);e+=`${n?"_":""}${s}_c${t.channels}`}return e}const ql=["NONE","TYPE-0","TYPE-1",null];function Rb(i){return ql.indexOf(i)>-1}const Kr=["SDR","PQ","HLG"];function wb(i){return!!i&&Kr.indexOf(i)>-1}var hr={No:"",Yes:"YES",v2:"v2"};function R0(i){const{canSkipUntil:e,canSkipDateRanges:t,age:n}=i,s=n<e/2;return e&&s?t?hr.v2:hr.Yes:hr.No}class w0{constructor(e,t,n){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=n}addDirectives(e){const t=new self.URL(e);return this.msn!==void 0&&t.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.href}}class vs{constructor(e){if(this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.supplemental=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.frameRate=e.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=e.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.codecSet=[e.videoCodec,e.audioCodec].filter(n=>!!n).map(n=>n.substring(0,4)).join(","),"supplemental"in e){var t;this.supplemental=e.supplemental;const n=(t=e.supplemental)==null?void 0:t.videoCodec;n&&n!==e.videoCodec&&(this.codecSet+=`,${n.substring(0,4)}`)}this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return D0(this._audioGroups,e)}hasSubtitleGroup(e){return D0(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t){if(e==="audio"){let n=this._audioGroups;n||(n=this._audioGroups=[]),n.indexOf(t)===-1&&n.push(t)}else if(e==="text"){let n=this._subtitleGroups;n||(n=this._subtitleGroups=[]),n.indexOf(t)===-1&&n.push(t)}}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var e;return(e=this.audioGroups)==null?void 0:e[0]}get textGroupId(){var e;return(e=this.subtitleGroups)==null?void 0:e[0]}addFallback(){}}function D0(i,e){return!e||!i?!1:i.indexOf(e)!==-1}function Db(){if(typeof matchMedia=="function"){const i=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(i.media!==e.media)return i.matches===!0}return!1}function Pb(i,e){let t=!1,n=[];if(i&&(t=i!=="SDR",n=[i]),e){n=e.allowedVideoRanges||Kr.slice(0);const s=n.join("")!=="SDR"&&!e.videoCodec;t=e.preferHDR!==void 0?e.preferHDR:s&&Db(),t||(n=["SDR"])}return{preferHDR:t,allowedVideoRanges:n}}const kb=i=>{const e=new WeakSet;return(t,n)=>{if(i&&(n=i(t,n)),typeof n=="object"&&n!==null){if(e.has(n))return;e.add(n)}return n}},Ae=(i,e)=>JSON.stringify(i,kb(e));function Bb(i,e,t,n,s){const r=Object.keys(i),o=n==null?void 0:n.channels,a=n==null?void 0:n.audioCodec,c=s==null?void 0:s.videoCodec,l=o&&parseInt(o)===2;let u=!1,f=!1,d=1/0,h=1/0,p=1/0,m=1/0,g=0,y=[];const{preferHDR:v,allowedVideoRanges:x}=Pb(e,s);for(let I=r.length;I--;){const w=i[r[I]];u||(u=w.channels[2]>0),d=Math.min(d,w.minHeight),h=Math.min(h,w.minFramerate),p=Math.min(p,w.minBitrate),x.filter(L=>w.videoRanges[L]>0).length>0&&(f=!0)}d=q(d)?d:0,h=q(h)?h:0;const E=Math.max(1080,d),S=Math.max(30,h);p=q(p)?p:t,t=Math.max(p,t),f||(e=void 0);const T=r.length>1;return{codecSet:r.reduce((I,w)=>{const b=i[w];if(w===I)return I;if(y=f?x.filter(L=>b.videoRanges[L]>0):[],T){if(b.minBitrate>t)return wt(w,`min bitrate of ${b.minBitrate} > current estimate of ${t}`),I;if(!b.hasDefaultAudio)return wt(w,"no renditions with default or auto-select sound found"),I;if(a&&w.indexOf(a.substring(0,4))%5!==0)return wt(w,`audio codec preference "${a}" not found`),I;if(o&&!l){if(!b.channels[o])return wt(w,`no renditions with ${o} channel sound found (channels options: ${Object.keys(b.channels)})`),I}else if((!a||l)&&u&&b.channels[2]===0)return wt(w,"no renditions with stereo sound found"),I;if(b.minHeight>E)return wt(w,`min resolution of ${b.minHeight} > maximum of ${E}`),I;if(b.minFramerate>S)return wt(w,`min framerate of ${b.minFramerate} > maximum of ${S}`),I;if(!y.some(L=>b.videoRanges[L]>0))return wt(w,`no variants with VIDEO-RANGE of ${Ae(y)} found`),I;if(c&&w.indexOf(c.substring(0,4))%5!==0)return wt(w,`video codec preference "${c}" not found`),I;if(b.maxScore<g)return wt(w,`max score of ${b.maxScore} < selected max of ${g}`),I}return I&&(Hr(w)>=Hr(I)||b.fragmentError>i[I].fragmentError)?I:(m=b.minIndex,g=b.maxScore,w)},void 0),videoRanges:y,preferHDR:v,minFramerate:h,minBitrate:p,minIndex:m}}function wt(i,e){pe.log(`[abr] start candidates with "${i}" ignored because ${e}`)}function Qm(i){return i.reduce((e,t)=>{let n=e.groups[t.groupId];n||(n=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),n.tracks.push(t);const s=t.channels||"2";return n.channels[s]=(n.channels[s]||0)+1,n.hasDefault=n.hasDefault||t.default,n.hasAutoSelect=n.hasAutoSelect||t.autoselect,n.hasDefault&&(e.hasDefaultAudio=!0),n.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function Fb(i,e,t,n){return i.slice(t,n+1).reduce((s,r,o)=>{if(!r.codecSet)return s;const a=r.audioGroups;let c=s[r.codecSet];c||(s[r.codecSet]=c={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:o,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!a,fragmentError:0}),c.minBitrate=Math.min(c.minBitrate,r.bitrate);const l=Math.min(r.height,r.width);return c.minHeight=Math.min(c.minHeight,l),c.minFramerate=Math.min(c.minFramerate,r.frameRate),c.minIndex=Math.min(c.minIndex,o),c.maxScore=Math.max(c.maxScore,r.score),c.fragmentError+=r.fragmentError,c.videoRanges[r.videoRange]=(c.videoRanges[r.videoRange]||0)+1,a&&a.forEach(u=>{if(!u)return;const f=e.groups[u];f&&(c.hasDefaultAudio=c.hasDefaultAudio||e.hasDefaultAudio?f.hasDefault:f.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(f.channels).forEach(d=>{c.channels[d]=(c.channels[d]||0)+f.channels[d]}))}),s},{})}function P0(i){if(!i)return i;const{lang:e,assocLang:t,characteristics:n,channels:s,audioCodec:r}=i;return{lang:e,assocLang:t,characteristics:n,channels:s,audioCodec:r}}function Mt(i,e,t){if("attrs"in i){const n=e.indexOf(i);if(n!==-1)return n}for(let n=0;n<e.length;n++){const s=e[n];if($n(i,s,t))return n}return-1}function $n(i,e,t){const{groupId:n,name:s,lang:r,assocLang:o,default:a}=i,c=i.forced;return(n===void 0||e.groupId===n)&&(s===void 0||e.name===s)&&(r===void 0||Ob(r,e.lang))&&(r===void 0||e.assocLang===o)&&(a===void 0||e.default===a)&&(c===void 0||e.forced===c)&&(!("characteristics"in i)||Mb(i.characteristics||"",e.characteristics))&&(t===void 0||t(i,e))}function Ob(i,e="--"){return i.length===e.length?i===e:i.startsWith(e)||e.startsWith(i)}function Mb(i,e=""){const t=i.split(","),n=e.split(",");return t.length===n.length&&!t.some(s=>n.indexOf(s)===-1)}function Rn(i,e){const{audioCodec:t,channels:n}=i;return(t===void 0||(e.audioCodec||"").substring(0,4)===t.substring(0,4))&&(n===void 0||n===(e.channels||"2"))}function Nb(i,e,t,n,s){const r=e[n],a=e.reduce((d,h,p)=>{const m=h.uri;return(d[m]||(d[m]=[])).push(p),d},{})[r.uri];a.length>1&&(n=Math.max.apply(Math,a));const c=r.videoRange,l=r.frameRate,u=r.codecSet.substring(0,4),f=k0(e,n,d=>{if(d.videoRange!==c||d.frameRate!==l||d.codecSet.substring(0,4)!==u)return!1;const h=d.audioGroups,p=t.filter(m=>!h||h.indexOf(m.groupId)!==-1);return Mt(i,p,s)>-1});return f>-1?f:k0(e,n,d=>{const h=d.audioGroups,p=t.filter(m=>!h||h.indexOf(m.groupId)!==-1);return Mt(i,p,s)>-1})}function k0(i,e,t){for(let n=e;n>-1;n--)if(t(i[n]))return n;for(let n=e+1;n<i.length;n++)if(t(i[n]))return n;return-1}function Vr(i,e){var t;return!!i&&i!==((t=e.loadLevelObj)==null?void 0:t.uri)}class Ub extends Rt{constructor(e){super("abr",e.logger),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.rebufferNotice=-1,this.supportedCache={},this.bwEstimator=void 0,this._abandonRulesCheck=t=>{var n;const{fragCurrent:s,partCurrent:r,hls:o}=this,{autoLevelEnabled:a,media:c}=o;if(!s||!c)return;const l=performance.now(),u=r?r.stats:s.stats,f=r?r.duration:s.duration,d=l-u.loading.start,h=o.minAutoLevel,p=s.level,m=this._nextAutoLevel;if(u.aborted||u.loaded&&u.loaded===u.total||p<=h){this.clearTimer(),this._nextAutoLevel=-1;return}if(!a)return;const g=m>-1&&m!==p,y=!!t||g;if(!y&&(c.paused||!c.playbackRate||!c.readyState))return;const v=o.mainForwardBufferInfo;if(!y&&v===null)return;const x=this.bwEstimator.getEstimateTTFB(),E=Math.abs(c.playbackRate);if(d<=Math.max(x,1e3*(f/(E*2))))return;const S=v?v.len/E:0,T=u.loading.first?u.loading.first-u.loading.start:-1,_=u.loaded&&T>-1,I=this.getBwEstimate(),w=o.levels,b=w[p],L=Math.max(u.loaded,Math.round(f*(s.bitrate||b.averageBitrate)/8));let k=_?d-T:d;k<1&&_&&(k=Math.min(d,u.loaded*8/I));const M=_?u.loaded*1e3/k:0,N=x/1e3,F=M?(L-u.loaded)/M:L*8/I+N;if(F<=S)return;const O=M?M*8:I,K=((n=(t==null?void 0:t.details)||this.hls.latestLevelDetails)==null?void 0:n.live)===!0,B=this.hls.config.abrBandWidthUpFactor;let G=Number.POSITIVE_INFINITY,H;for(H=p-1;H>h;H--){const D=w[H].maxBitrate,z=!w[H].details||K;if(G=this.getTimeToLoadFrag(N,O,f*D,z),G<Math.min(S,f+N))break}if(G>=F||G>f*10)return;_?this.bwEstimator.sample(d-Math.min(x,T),u.loaded):this.bwEstimator.sampleTTFB(d);const C=w[H].maxBitrate;this.getBwEstimate()*B>C&&this.resetEstimator(C);const R=this.findBestLevel(C,h,H,0,S,1,1);R>-1&&(H=R),this.warn(`Fragment ${s.sn}${r?" part "+r.index:""} of level ${p} is loading too slowly;
- Fragment duration: ${s.duration.toFixed(3)}
- Time to underbuffer: ${S.toFixed(3)} s
- Estimated load time for current fragment: ${F.toFixed(3)} s
- Estimated load time for down switch fragment: ${G.toFixed(3)} s
- TTFB estimate: ${T|0} ms
- Current BW estimate: ${q(I)?I|0:"Unknown"} bps
- New BW estimate: ${this.getBwEstimate()|0} bps
- Switching to level ${H} @ ${C|0} bps`),o.nextLoadLevel=o.nextAutoLevel=H,this.clearTimer();const P=()=>{if(this.clearTimer(),this.fragCurrent===s&&this.hls.loadLevel===H&&H>0){const D=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${H>0?"and switching down":""}
- Fragment duration: ${s.duration.toFixed(3)} s
- Time to underbuffer: ${D.toFixed(3)} s`),s.abortRequests(),this.fragCurrent=this.partCurrent=null,H>h){let z=this.findBestLevel(this.hls.levels[h].bitrate,h,H,0,D,1,1);z===-1&&(z=h),this.hls.nextLoadLevel=this.hls.nextAutoLevel=z,this.resetEstimator(this.hls.levels[z].bitrate)}}};g||F>G*2?P():this.timer=self.setInterval(P,G*1e3),o.trigger(A.FRAG_LOAD_EMERGENCY_ABORTED,{frag:s,part:r,stats:u})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(this.log(`setting initial bwe to ${e}`),this.hls.config.abrEwmaDefaultEstimate=e),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const e=this.hls.config;return new z5(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(A.MANIFEST_LOADING,this.onManifestLoading,this),e.on(A.FRAG_LOADING,this.onFragLoading,this),e.on(A.FRAG_LOADED,this.onFragLoaded,this),e.on(A.FRAG_BUFFERED,this.onFragBuffered,this),e.on(A.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(A.LEVEL_LOADED,this.onLevelLoaded,this),e.on(A.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(A.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(A.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(A.MANIFEST_LOADING,this.onManifestLoading,this),e.off(A.FRAG_LOADING,this.onFragLoading,this),e.off(A.FRAG_LOADED,this.onFragLoaded,this),e.off(A.FRAG_BUFFERED,this.onFragBuffered,this),e.off(A.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(A.LEVEL_LOADED,this.onLevelLoaded,this),e.off(A.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(A.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(A.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=this.supportedCache=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.supportedCache={},this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,t){const n=t.frag;if(!this.ignoreFragment(n)){if(!n.bitrateTest){var s;this.fragCurrent=n,this.partCurrent=(s=t.part)!=null?s:null}this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(e,t){this.clearTimer()}onError(e,t){if(!t.fatal)switch(t.details){case $.BUFFER_ADD_CODEC_ERROR:case $.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case $.FRAG_LOAD_TIMEOUT:{const n=t.frag,{fragCurrent:s,partCurrent:r}=this;if(n&&s&&n.sn===s.sn&&n.level===s.level){const o=performance.now(),a=r?r.stats:n.stats,c=o-a.loading.start,l=a.loading.first?a.loading.first-a.loading.start:-1;if(a.loaded&&l>-1){const f=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(c-Math.min(f,l),a.loaded)}else this.bwEstimator.sampleTTFB(c)}break}}}getTimeToLoadFrag(e,t,n,s){const r=e+n/t,o=s?e+this.lastLevelLoadSec:0;return r+o}onLevelLoaded(e,t){const n=this.hls.config,{loading:s}=t.stats,r=s.end-s.first;q(r)&&(this.lastLevelLoadSec=r/1e3),t.details.live?this.bwEstimator.update(n.abrEwmaSlowLive,n.abrEwmaFastLive):this.bwEstimator.update(n.abrEwmaSlowVoD,n.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(t.levelInfo)}onFragLoaded(e,{frag:t,part:n}){const s=n?n.stats:t.stats;if(t.type===X.MAIN&&this.bwEstimator.sampleTTFB(s.loading.first-s.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const r=n?n.duration:t.duration,o=this.hls.levels[t.level],a=(o.loaded?o.loaded.bytes:0)+s.loaded,c=(o.loaded?o.loaded.duration:0)+r;o.loaded={bytes:a,duration:c},o.realBitrate=Math.round(8*a/c)}if(t.bitrateTest){const r={stats:s,frag:t,part:n,id:t.type};this.onFragBuffered(A.FRAG_BUFFERED,r),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:n,part:s}=t,r=s!=null&&s.stats.loaded?s.stats:n.stats;if(r.aborted||this.ignoreFragment(n))return;const o=r.parsing.end-r.loading.start-Math.min(r.loading.first-r.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(o,r.loaded),r.bwEstimate=this.getBwEstimate(),n.bitrateTest?this.bitrateTestDelay=o/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==X.MAIN||e.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,n=this.getBwEstimate(),s=this.hls.config.maxStarvationDelay,r=this.findBestLevel(n,t,e,0,s,1,1);if(r>-1)return r;const o=this.hls.firstLevel,a=Math.min(Math.max(o,t),e);return this.warn(`Could not find best starting auto level. Defaulting to first in playlist ${o} clamped to ${a}`),a}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,n=this.bwEstimator.canEstimate(),s=this.lastLoadedFragLevel>-1;if(e!==-1&&(!n||!s||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const r=n&&s?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){const o=this.hls.levels;if(o.length>Math.max(e,r)&&o[e].loadError<=o[r].loadError)return e}return this._nextAutoLevel=r,this.nextAutoLevelKey=this.getAutoLevelKey(),r}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:n}=this;if(n.levels.length<=1)return n.loadLevel;const{maxAutoLevel:s,config:r,minAutoLevel:o}=n,a=t?t.duration:e?e.duration:0,c=this.getBwEstimate(),l=this.getStarvationDelay();let u=r.abrBandWidthFactor,f=r.abrBandWidthUpFactor;if(l){const g=this.findBestLevel(c,o,s,l,0,u,f);if(g>=0)return this.rebufferNotice=-1,g}let d=a?Math.min(a,r.maxStarvationDelay):r.maxStarvationDelay;if(!l){const g=this.bitrateTestDelay;g&&(d=(a?Math.min(a,r.maxLoadingDelay):r.maxLoadingDelay)-g,this.info(`bitrate test took ${Math.round(1e3*g)}ms, set first fragment max fetchDuration to ${Math.round(1e3*d)} ms`),u=f=1)}const h=this.findBestLevel(c,o,s,l,d,u,f);if(this.rebufferNotice!==h&&(this.rebufferNotice=h,this.info(`${l?"rebuffering expected":"buffer is empty"}, optimal quality level ${h}`)),h>-1)return h;const p=n.levels[o],m=n.loadLevelObj;return m&&(p==null?void 0:p.bitrate)<m.bitrate?o:n.loadLevel}getStarvationDelay(){const e=this.hls,t=e.media;if(!t)return 1/0;const n=t&&t.playbackRate!==0?Math.abs(t.playbackRate):1,s=e.mainForwardBufferInfo;return(s?s.len:0)/n}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,n,s,r,o,a){var c;const l=s+r,u=this.lastLoadedFragLevel,f=u===-1?this.hls.firstLevel:u,{fragCurrent:d,partCurrent:h}=this,{levels:p,allAudioTracks:m,loadLevel:g,config:y}=this.hls;if(p.length===1)return 0;const v=p[f],x=!!((c=this.hls.latestLevelDetails)!=null&&c.live),E=g===-1||u===-1;let S,T="SDR",_=(v==null?void 0:v.frameRate)||0;const{audioPreference:I,videoPreference:w}=y,b=this.audioTracksByGroup||(this.audioTracksByGroup=Qm(m));let L=-1;if(E){if(this.firstSelection!==-1)return this.firstSelection;const K=this.codecTiers||(this.codecTiers=Fb(p,b,t,n)),B=Bb(K,T,e,I,w),{codecSet:G,videoRanges:H,minFramerate:C,minBitrate:R,minIndex:P,preferHDR:D}=B;L=P,S=G,T=D?H[H.length-1]:H[0],_=C,e=Math.max(e,R),this.log(`picked start tier ${Ae(B)}`)}else S=v==null?void 0:v.codecSet,T=v==null?void 0:v.videoRange;const k=h?h.duration:d?d.duration:0,M=this.bwEstimator.getEstimateTTFB()/1e3,N=[];for(let K=n;K>=t;K--){var F,O;const B=p[K],G=K>f;if(!B)continue;if(y.useMediaCapabilities&&!B.supportedResult&&!B.supportedPromise){const Q=navigator.mediaCapabilities;typeof(Q==null?void 0:Q.decodingInfo)=="function"&&bb(B,b,T,_,e,I)?(B.supportedPromise=Wm(B,b,Q,this.supportedCache),B.supportedPromise.then(se=>{if(!this.hls)return;B.supportedResult=se;const ee=this.hls.levels,ge=ee.indexOf(B);se.error?this.warn(`MediaCapabilities decodingInfo error: "${se.error}" for level ${ge} ${Ae(se)}`):se.supported?se.decodingInfoResults.some(de=>de.smooth===!1||de.powerEfficient===!1)&&this.log(`MediaCapabilities decodingInfo for level ${ge} not smooth or powerEfficient: ${Ae(se)}`):(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${ge} ${Ae(se)}`),ge>-1&&ee.length>1&&(this.log(`Removing unsupported level ${ge}`),this.hls.removeLevel(ge),this.hls.loadLevel===-1&&(this.hls.nextLoadLevel=0)))})):B.supportedResult=jm}if((S&&B.codecSet!==S||T&&B.videoRange!==T||G&&_>B.frameRate||!G&&_>0&&_<B.frameRate||(F=B.supportedResult)!=null&&(O=F.decodingInfoResults)!=null&&O.some(Q=>Q.smooth===!1))&&(!E||K!==L)){N.push(K);continue}const H=B.details,C=(h?H==null?void 0:H.partTarget:H==null?void 0:H.averagetargetduration)||k;let R;G?R=a*e:R=o*e;const P=k&&s>=k*2&&r===0?B.averageBitrate:B.maxBitrate,D=this.getTimeToLoadFrag(M,R,P*C,H===void 0);if(R>=P&&(K===u||B.loadError===0&&B.fragmentError===0)&&(D<=M||!q(D)||x&&!this.bitrateTestDelay||D<l)){const Q=this.forcedAutoLevel;return K!==g&&(Q===-1||Q!==g)&&(N.length&&this.trace(`Skipped level(s) ${N.join(",")} of ${n} max with CODECS and VIDEO-RANGE:"${p[N[0]].codecs}" ${p[N[0]].videoRange}; not compatible with "${S}" ${T}`),this.info(`switch candidate:${f}->${K} adjustedbw(${Math.round(R)})-bitrate=${Math.round(R-P)} ttfb:${M.toFixed(1)} avgDuration:${C.toFixed(1)} maxFetchDuration:${l.toFixed(1)} fetchDuration:${D.toFixed(1)} firstSelection:${E} codecSet:${B.codecSet} videoRange:${B.videoRange} hls.loadLevel:${g}`)),E&&(this.firstSelection=K),K}}return-1}set nextAutoLevel(e){const t=this.deriveNextAutoLevel(e);this._nextAutoLevel!==t&&(this.nextAutoLevelKey="",this._nextAutoLevel=t)}deriveNextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:n}=this.hls;return Math.min(Math.max(e,n),t)}}const Ym={search:function(i,e){let t=0,n=i.length-1,s=null,r=null;for(;t<=n;){s=(t+n)/2|0,r=i[s];const o=e(r);if(o>0)t=s+1;else if(o<0)n=s-1;else return r}return null}};function $b(i,e,t){if(e===null||!Array.isArray(i)||!i.length||!q(e))return null;const n=i[0].programDateTime;if(e<(n||0))return null;const s=i[i.length-1].endProgramDateTime;if(e>=(s||0))return null;for(let r=0;r<i.length;++r){const o=i[r];if(Gb(e,t,o))return o}return null}function qn(i,e,t=0,n=0,s=.005){let r=null;if(i){r=e[1+i.sn-e[0].sn]||null;const a=i.endDTS-t;a>0&&a<15e-7&&(t+=15e-7),r&&i.level!==r.level&&r.end<=i.end&&(r=e[2+i.sn-e[0].sn]||null)}else t===0&&e[0].start===0&&(r=e[0]);if(r&&((!i||i.level===r.level)&&B0(t,n,r)===0||Hb(r,i,Math.min(s,n))))return r;const o=Ym.search(e,B0.bind(null,t,n));return o&&(o!==i||!r)?o:r}function Hb(i,e,t){if(e&&e.start===0&&e.level<i.level&&(e.endPTS||0)>0){const n=e.tagList.reduce((s,r)=>(r[0]==="INF"&&(s+=parseFloat(r[1])),s),t);return i.start<=n}return!1}function B0(i=0,e=0,t){if(t.start<=i&&t.start+t.duration>i)return 0;const n=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-n<=i?1:t.start-n>i&&t.start?-1:0}function Gb(i,e,t){const n=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-n>i}function Xm(i,e,t){if(i&&i.startCC<=e&&i.endCC>=e){let n=i.fragments;const{fragmentHint:s}=i;s&&(n=n.concat(s));let r;return Ym.search(n,o=>o.cc<e?1:o.cc>e?-1:(r=o,o.end<=t?1:o.start>t?-1:0)),r||null}return null}function jr(i){switch(i.details){case $.FRAG_LOAD_TIMEOUT:case $.KEY_LOAD_TIMEOUT:case $.LEVEL_LOAD_TIMEOUT:case $.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function F0(i,e){const t=jr(e);return i.default[`${t?"timeout":"error"}Retry`]}function ru(i,e){const t=i.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*i.retryDelayMs,i.maxRetryDelayMs)}function O0(i){return ye(ye({},i),{errorRetry:null,timeoutRetry:null})}function qr(i,e,t,n){if(!i)return!1;const s=n==null?void 0:n.code,r=e<i.maxNumRetry&&(Kb(s)||!!t);return i.shouldRetry?i.shouldRetry(i,e,t,n,r):r}function Kb(i){return i===0&&navigator.onLine===!1||!!i&&(i<400||i>499)}var ze={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},_t={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class Vb extends Rt{constructor(e){super("error-controller",e.logger),this.hls=void 0,this.playlistError=0,this.penalizedRenditions={},this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(A.ERROR,this.onError,this),e.on(A.MANIFEST_LOADING,this.onManifestLoading,this),e.on(A.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(A.ERROR,this.onError,this),e.off(A.ERROR,this.onErrorOut,this),e.off(A.MANIFEST_LOADING,this.onManifestLoading,this),e.off(A.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null,this.penalizedRenditions={}}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(e==null?void 0:e.type)===X.MAIN?e.level:this.hls.loadLevel}onManifestLoading(){this.playlistError=0,this.penalizedRenditions={}}onLevelUpdated(){this.playlistError=0}onError(e,t){var n;if(t.fatal)return;const s=this.hls,r=t.context;switch(t.details){case $.FRAG_LOAD_ERROR:case $.FRAG_LOAD_TIMEOUT:case $.KEY_LOAD_ERROR:case $.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case $.FRAG_PARSING_ERROR:if((n=t.frag)!=null&&n.gap){t.errorAction=Es();return}case $.FRAG_GAP:case $.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=ze.SendAlternateToPenaltyBox;return}case $.LEVEL_EMPTY_ERROR:case $.LEVEL_PARSING_ERROR:{var o,a;const l=t.parent===X.MAIN?t.level:s.loadLevel;t.details===$.LEVEL_EMPTY_ERROR&&((o=t.context)!=null&&(a=o.levelDetails)!=null&&a.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,l):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,l))}return;case $.LEVEL_LOAD_ERROR:case $.LEVEL_LOAD_TIMEOUT:typeof(r==null?void 0:r.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,r.level));return;case $.AUDIO_TRACK_LOAD_ERROR:case $.AUDIO_TRACK_LOAD_TIMEOUT:case $.SUBTITLE_LOAD_ERROR:case $.SUBTITLE_TRACK_LOAD_TIMEOUT:if(r){const l=s.loadLevelObj;if(l&&(r.type===ue.AUDIO_TRACK&&l.hasAudioGroup(r.groupId)||r.type===ue.SUBTITLE_TRACK&&l.hasSubtitleGroup(r.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,s.loadLevel),t.errorAction.action=ze.SendAlternateToPenaltyBox,t.errorAction.flags=_t.MoveAllAlternatesMatchingHost;return}}return;case $.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{const l=s.loadLevelObj,u=l==null?void 0:l.attrs["HDCP-LEVEL"];u?t.errorAction={action:ze.SendAlternateToPenaltyBox,flags:_t.MoveAllAlternatesMatchingHDCP,hdcpLevel:u}:this.keySystemError(t)}return;case $.BUFFER_ADD_CODEC_ERROR:case $.REMUX_ALLOC_ERROR:case $.BUFFER_APPEND_ERROR:if(!t.errorAction){var c;t.errorAction=this.getLevelSwitchAction(t,(c=t.level)!=null?c:s.loadLevel)}return;case $.INTERNAL_EXCEPTION:case $.BUFFER_APPENDING_ERROR:case $.BUFFER_FULL_ERROR:case $.LEVEL_SWITCH_ERROR:case $.BUFFER_STALLED_ERROR:case $.BUFFER_SEEK_OVER_HOLE:case $.BUFFER_NUDGE_ON_STALL:t.errorAction=Es();return}t.type===Z.KEY_SYSTEM_ERROR&&this.keySystemError(t)}keySystemError(e){const t=this.getVariantLevelIndex(e.frag);e.levelRetry=!1,e.errorAction=this.getLevelSwitchAction(e,t)}getPlaylistRetryOrSwitchAction(e,t){const n=this.hls,s=F0(n.config.playlistLoadPolicy,e),r=this.playlistError++;if(qr(s,r,jr(e),e.response))return{action:ze.RetryRequest,flags:_t.None,retryConfig:s,retryCount:r};const a=this.getLevelSwitchAction(e,t);return s&&(a.retryConfig=s,a.retryCount=r),a}getFragRetryOrSwitchAction(e){const t=this.hls,n=this.getVariantLevelIndex(e.frag),s=t.levels[n],{fragLoadPolicy:r,keyLoadPolicy:o}=t.config,a=F0(e.details.startsWith("key")?o:r,e),c=t.levels.reduce((u,f)=>u+f.fragmentError,0);if(s&&(e.details!==$.FRAG_GAP&&s.fragmentError++,qr(a,c,jr(e),e.response)))return{action:ze.RetryRequest,flags:_t.None,retryConfig:a,retryCount:c};const l=this.getLevelSwitchAction(e,n);return a&&(l.retryConfig=a,l.retryCount=c),l}getLevelSwitchAction(e,t){const n=this.hls;t==null&&(t=n.loadLevel);const s=this.hls.levels[t];if(s){var r,o;const l=e.details;s.loadError++,l===$.BUFFER_APPEND_ERROR&&s.fragmentError++;let u=-1;const{levels:f,loadLevel:d,minAutoLevel:h,maxAutoLevel:p}=n;!n.autoLevelEnabled&&!n.config.preserveManualLevelOnError&&(n.loadLevel=-1);const m=(r=e.frag)==null?void 0:r.type,y=(m===X.AUDIO&&l===$.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(l===$.BUFFER_ADD_CODEC_ERROR||l===$.BUFFER_APPEND_ERROR))&&f.some(({audioCodec:T})=>s.audioCodec!==T),x=e.sourceBufferName==="video"&&(l===$.BUFFER_ADD_CODEC_ERROR||l===$.BUFFER_APPEND_ERROR)&&f.some(({codecSet:T,audioCodec:_})=>s.codecSet!==T&&s.audioCodec===_),{type:E,groupId:S}=(o=e.context)!=null?o:{};for(let T=f.length;T--;){const _=(T+d)%f.length;if(_!==d&&_>=h&&_<=p&&f[_].loadError===0){var a,c;const I=f[_];if(l===$.FRAG_GAP&&m===X.MAIN&&e.frag){const w=f[_].details;if(w){const b=qn(e.frag,w.fragments,e.frag.start);if(b!=null&&b.gap)continue}}else{if(E===ue.AUDIO_TRACK&&I.hasAudioGroup(S)||E===ue.SUBTITLE_TRACK&&I.hasSubtitleGroup(S))continue;if(m===X.AUDIO&&(a=s.audioGroups)!=null&&a.some(w=>I.hasAudioGroup(w))||m===X.SUBTITLE&&(c=s.subtitleGroups)!=null&&c.some(w=>I.hasSubtitleGroup(w))||y&&s.audioCodec===I.audioCodec||!y&&s.audioCodec!==I.audioCodec||x&&s.codecSet===I.codecSet)continue}u=_;break}}if(u>-1&&n.loadLevel!==u)return e.levelRetry=!0,this.playlistError=0,{action:ze.SendAlternateToPenaltyBox,flags:_t.None,nextAutoLevel:u}}return{action:ze.SendAlternateToPenaltyBox,flags:_t.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var n;switch((n=t.errorAction)==null?void 0:n.action){case ze.DoNothing:break;case ze.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==$.FRAG_GAP?t.fatal=!0:/MediaSource readyState: ended/.test(t.error.message)&&(this.warn(`MediaSource ended after "${t.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError());break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,n=e.errorAction;if(!n)return;const{flags:s,hdcpLevel:r,nextAutoLevel:o}=n;switch(s){case _t.None:this.switchLevel(e,o);break;case _t.MoveAllAlternatesMatchingHDCP:r&&(t.maxHdcpLevel=ql[ql.indexOf(r)-1],n.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}n.resolved||this.switchLevel(e,o)}switchLevel(e,t){if(t!==void 0&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel,e.details===$.BUFFER_ADD_CODEC_ERROR&&e.mimeType&&e.sourceBufferName!=="audiovideo")){const n=jl(e.mimeType),s=this.hls.levels;for(let r=s.length;r--;)s[r][`${e.sourceBufferName}Codec`]===n&&this.hls.removeLevel(r)}}}function Es(i){const e={action:ze.DoNothing,flags:_t.None};return i&&(e.resolved=!0),e}var Be={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class jb{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(A.MANIFEST_LOADING,this.onManifestLoading,this),e.on(A.BUFFER_APPENDED,this.onBufferAppended,this),e.on(A.FRAG_BUFFERED,this.onFragBuffered,this),e.on(A.FRAG_LOADED,this.onFragLoaded,this)}_unregisterListeners(){const{hls:e}=this;e.off(A.MANIFEST_LOADING,this.onManifestLoading,this),e.off(A.BUFFER_APPENDED,this.onBufferAppended,this),e.off(A.FRAG_BUFFERED,this.onFragBuffered,this),e.off(A.FRAG_LOADED,this.onFragLoaded,this)}destroy(){this._unregisterListeners(),this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const n=this.activePartLists[t];if(n)for(let s=n.length;s--;){const r=n[s];if(!r)break;const o=r.end;if(r.start<=e&&o!==null&&e<=o)return r}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){return this.getFragAtPos(e,t,!0)}getFragAtPos(e,t,n){const{fragments:s}=this,r=Object.keys(s);for(let o=r.length;o--;){const a=s[r[o]];if((a==null?void 0:a.body.type)===t&&(!n||a.buffered)){const c=a.body;if(c.start<=e&&e<=c.end)return c}}return null}detectEvictedFragments(e,t,n,s,r){this.timeRanges&&(this.timeRanges[e]=t);const o=(s==null?void 0:s.fragment.sn)||-1;Object.keys(this.fragments).forEach(a=>{const c=this.fragments[a];if(!c||o>=c.body.sn)return;if(!c.buffered&&(!c.loaded||r)){c.body.type===n&&this.removeFragment(c.body);return}const l=c.range[e];if(l){if(l.time.length===0){this.removeFragment(c.body);return}l.time.some(u=>{const f=!this.isTimeBuffered(u.startPTS,u.endPTS,t);return f&&this.removeFragment(c.body),f})}})}detectPartialFragments(e){const t=this.timeRanges;if(!t||e.frag.sn==="initSegment")return;const n=e.frag,s=oi(n),r=this.fragments[s];if(!r||r.buffered&&n.gap)return;const o=!n.relurl;Object.keys(t).forEach(a=>{const c=n.elementaryStreams[a];if(!c)return;const l=t[a],u=o||c.partial===!0;r.range[a]=this.getBufferedTimes(n,e.part,u,l)}),r.loaded=null,Object.keys(r.range).length?(r.buffered=!0,(r.body.endList=n.endList||r.body.endList)&&(this.endListFragments[r.body.type]=r),zs(r)||this.removeParts(n.sn-1,n.type)):this.removeFragment(r.body)}removeParts(e,t){const n=this.activePartLists[t];n&&(this.activePartLists[t]=M0(n,s=>s.fragment.sn>=e))}fragBuffered(e,t){const n=oi(e);let s=this.fragments[n];!s&&t&&(s=this.fragments[n]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),s&&(s.loaded=null,s.buffered=!0)}getBufferedTimes(e,t,n,s){const r={time:[],partial:n},o=e.start,a=e.end,c=e.minEndPTS||a,l=e.maxStartPTS||o;for(let u=0;u<s.length;u++){const f=s.start(u)-this.bufferPadding,d=s.end(u)+this.bufferPadding;if(l>=f&&c<=d){r.time.push({startPTS:Math.max(o,s.start(u)),endPTS:Math.min(a,s.end(u))});break}else if(o<d&&a>f){const h=Math.max(o,s.start(u)),p=Math.min(a,s.end(u));p>h&&(r.partial=!0,r.time.push({startPTS:h,endPTS:p}))}else if(a<=f)break}return r}getPartialFragment(e){let t=null,n,s,r,o=0;const{bufferPadding:a,fragments:c}=this;return Object.keys(c).forEach(l=>{const u=c[l];u&&zs(u)&&(s=u.body.start-a,r=u.body.end+a,e>=s&&e<=r&&(n=Math.min(e-s,r-e),o<=n&&(t=u.body,o=n)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||zs(t))}getState(e){const t=oi(e),n=this.fragments[t];return n?n.buffered?zs(n)?Be.PARTIAL:Be.OK:Be.APPENDING:Be.NOT_LOADED}isTimeBuffered(e,t,n){let s,r;for(let o=0;o<n.length;o++){if(s=n.start(o)-this.bufferPadding,r=n.end(o)+this.bufferPadding,e>=s&&t<=r)return!0;if(t<=s)return!1}return!1}onManifestLoading(){this.removeAllFragments()}onFragLoaded(e,t){if(t.frag.sn==="initSegment"||t.frag.bitrateTest)return;const n=t.frag,s=t.part?null:t,r=oi(n);this.fragments[r]={body:n,appendedPTS:null,loaded:s,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:n,part:s,timeRanges:r,type:o}=t;if(n.sn==="initSegment")return;const a=n.type;if(s){let l=this.activePartLists[a];l||(this.activePartLists[a]=l=[]),l.push(s)}this.timeRanges=r;const c=r[o];this.detectEvictedFragments(o,c,a,s)}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=oi(e);return!!this.fragments[t]}hasFragments(e){const{fragments:t}=this,n=Object.keys(t);if(!e)return n.length>0;for(let s=n.length;s--;){const r=t[n[s]];if((r==null?void 0:r.body.type)===e)return!0}return!1}hasParts(e){var t;return!!((t=this.activePartLists[e])!=null&&t.length)}removeFragmentsInRange(e,t,n,s,r){s&&!this.hasGaps||Object.keys(this.fragments).forEach(o=>{const a=this.fragments[o];if(!a)return;const c=a.body;c.type!==n||s&&!c.gap||c.start<t&&c.end>e&&(a.buffered||r)&&this.removeFragment(c)})}removeFragment(e){const t=oi(e);e.clearElementaryStreamInfo();const n=this.activePartLists[e.type];if(n){const s=e.sn;this.activePartLists[e.type]=M0(n,r=>r.fragment.sn!==s)}delete this.fragments[t],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){var e,t;this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1;const n=(e=this.hls)==null||(t=e.latestLevelDetails)==null?void 0:t.partList;n&&n.forEach(s=>s.clearElementaryStreamInfo())}}function zs(i){var e,t,n;return i.buffered&&(i.body.gap||((e=i.range.video)==null?void 0:e.partial)||((t=i.range.audio)==null?void 0:t.partial)||((n=i.range.audiovideo)==null?void 0:n.partial))}function oi(i){return`${i.type}_${i.level}_${i.sn}`}function M0(i,e){return i.filter(t=>{const n=e(t);return n||t.clearElementaryStreamInfo(),n})}var bn={cbc:0,ctr:1};class qb{constructor(e,t,n){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=e,this.aesIV=t,this.aesMode=n}decrypt(e,t){switch(this.aesMode){case bn.cbc:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e);case bn.ctr:return this.subtle.decrypt({name:"AES-CTR",counter:this.aesIV,length:64},t,e);default:throw new Error(`[AESCrypto] invalid aes mode ${this.aesMode}`)}}}function Wb(i){const e=i.byteLength,t=e&&new DataView(i.buffer).getUint8(e-1);return t?i.slice(0,e-t):i}class zb{constructor(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}uint8ArrayToUint32Array_(e){const t=new DataView(e),n=new Uint32Array(4);for(let s=0;s<4;s++)n[s]=t.getUint32(s*4);return n}initTable(){const e=this.sBox,t=this.invSBox,n=this.subMix,s=n[0],r=n[1],o=n[2],a=n[3],c=this.invSubMix,l=c[0],u=c[1],f=c[2],d=c[3],h=new Uint32Array(256);let p=0,m=0,g=0;for(g=0;g<256;g++)g<128?h[g]=g<<1:h[g]=g<<1^283;for(g=0;g<256;g++){let y=m^m<<1^m<<2^m<<3^m<<4;y=y>>>8^y&255^99,e[p]=y,t[y]=p;const v=h[p],x=h[v],E=h[x];let S=h[y]*257^y*16843008;s[p]=S<<24|S>>>8,r[p]=S<<16|S>>>16,o[p]=S<<8|S>>>24,a[p]=S,S=E*16843009^x*65537^v*257^p*16843008,l[y]=S<<24|S>>>8,u[y]=S<<16|S>>>16,f[y]=S<<8|S>>>24,d[y]=S,p?(p=v^h[h[h[E^v]]],m^=h[h[m]]):p=m=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let n=!0,s=0;for(;s<t.length&&n;)n=t[s]===this.key[s],s++;if(n)return;this.key=t;const r=this.keySize=t.length;if(r!==4&&r!==6&&r!==8)throw new Error("Invalid aes key size="+r);const o=this.ksRows=(r+6+1)*4;let a,c;const l=this.keySchedule=new Uint32Array(o),u=this.invKeySchedule=new Uint32Array(o),f=this.sBox,d=this.rcon,h=this.invSubMix,p=h[0],m=h[1],g=h[2],y=h[3];let v,x;for(a=0;a<o;a++){if(a<r){v=l[a]=t[a];continue}x=v,a%r===0?(x=x<<8|x>>>24,x=f[x>>>24]<<24|f[x>>>16&255]<<16|f[x>>>8&255]<<8|f[x&255],x^=d[a/r|0]<<24):r>6&&a%r===4&&(x=f[x>>>24]<<24|f[x>>>16&255]<<16|f[x>>>8&255]<<8|f[x&255]),l[a]=v=(l[a-r]^x)>>>0}for(c=0;c<o;c++)a=o-c,c&3?x=l[a]:x=l[a-4],c<4||a<=4?u[c]=x:u[c]=p[f[x>>>24]]^m[f[x>>>16&255]]^g[f[x>>>8&255]]^y[f[x&255]],u[c]=u[c]>>>0}networkToHostOrderSwap(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24}decrypt(e,t,n){const s=this.keySize+6,r=this.invKeySchedule,o=this.invSBox,a=this.invSubMix,c=a[0],l=a[1],u=a[2],f=a[3],d=this.uint8ArrayToUint32Array_(n);let h=d[0],p=d[1],m=d[2],g=d[3];const y=new Int32Array(e),v=new Int32Array(y.length);let x,E,S,T,_,I,w,b,L,k,M,N,F,O;const K=this.networkToHostOrderSwap;for(;t<y.length;){for(L=K(y[t]),k=K(y[t+1]),M=K(y[t+2]),N=K(y[t+3]),_=L^r[0],I=N^r[1],w=M^r[2],b=k^r[3],F=4,O=1;O<s;O++)x=c[_>>>24]^l[I>>16&255]^u[w>>8&255]^f[b&255]^r[F],E=c[I>>>24]^l[w>>16&255]^u[b>>8&255]^f[_&255]^r[F+1],S=c[w>>>24]^l[b>>16&255]^u[_>>8&255]^f[I&255]^r[F+2],T=c[b>>>24]^l[_>>16&255]^u[I>>8&255]^f[w&255]^r[F+3],_=x,I=E,w=S,b=T,F=F+4;x=o[_>>>24]<<24^o[I>>16&255]<<16^o[w>>8&255]<<8^o[b&255]^r[F],E=o[I>>>24]<<24^o[w>>16&255]<<16^o[b>>8&255]<<8^o[_&255]^r[F+1],S=o[w>>>24]<<24^o[b>>16&255]<<16^o[_>>8&255]<<8^o[I&255]^r[F+2],T=o[b>>>24]<<24^o[_>>16&255]<<16^o[I>>8&255]<<8^o[w&255]^r[F+3],v[t]=K(x^h),v[t+1]=K(T^p),v[t+2]=K(S^m),v[t+3]=K(E^g),h=L,p=k,m=M,g=N,t=t+4}return v.buffer}}class Qb{constructor(e,t,n){this.subtle=void 0,this.key=void 0,this.aesMode=void 0,this.subtle=e,this.key=t,this.aesMode=n}expandKey(){const e=Yb(this.aesMode);return this.subtle.importKey("raw",this.key,{name:e},!1,["encrypt","decrypt"])}}function Yb(i){switch(i){case bn.cbc:return"AES-CBC";case bn.ctr:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${i}`)}}const Xb=16;class ou{constructor(e,{removePKCS7Padding:t=!0}={}){if(this.logEnabled=!0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.useSoftware=void 0,this.enableSoftwareAES=void 0,this.enableSoftwareAES=e.enableSoftwareAES,this.removePKCS7Padding=t,t)try{const n=self.crypto;n&&(this.subtle=n.subtle||n.webkitSubtle)}catch{}this.useSoftware=!this.subtle}destroy(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null}isSync(){return this.useSoftware}flush(){const{currentResult:e,remainderData:t}=this;if(!e||t)return this.reset(),null;const n=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?Wb(n):n}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,n,s){return this.useSoftware?new Promise((r,o)=>{const a=ArrayBuffer.isView(e)?e:new Uint8Array(e);this.softwareDecrypt(a,t,n,s);const c=this.flush();c?r(c.buffer):o(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(e),t,n,s)}softwareDecrypt(e,t,n,s){const{currentIV:r,currentResult:o,remainderData:a}=this;if(s!==bn.cbc||t.byteLength!==16)return pe.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),a&&(e=vt(a,e),this.remainderData=null);const c=this.getValidChunk(e);if(!c.length)return null;r&&(n=r);let l=this.softwareDecrypter;l||(l=this.softwareDecrypter=new zb),l.expandKey(t);const u=o;return this.currentResult=l.decrypt(c.buffer,0,n),this.currentIV=c.slice(-16).buffer,u||null}webCryptoDecrypt(e,t,n,s){if(this.key!==t||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(e,t,n,s));this.key=t,this.fastAesKey=new Qb(this.subtle,t,s)}return this.fastAesKey.expandKey().then(r=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new qb(this.subtle,new Uint8Array(n),s).decrypt(e.buffer,r)):Promise.reject(new Error("web crypto not initialized"))).catch(r=>(pe.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${r.name}: ${r.message}`),this.onWebCryptoError(e,t,n,s)))}onWebCryptoError(e,t,n,s){const r=this.enableSoftwareAES;if(r){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,n,s);const o=this.flush();if(o)return o.buffer}throw new Error("WebCrypto"+(r?" and softwareDecrypt":"")+": failed to decrypt data")}getValidChunk(e){let t=e;const n=e.length-e.length%Xb;return n!==e.length&&(t=e.slice(0,n),this.remainderData=e.slice(n)),t}logOnce(e){this.logEnabled&&(pe.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const N0=Math.pow(2,17);class Jb{constructor(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(e,t){const n=e.url;if(!n)return Promise.reject(new Wt({type:Z.NETWORK_ERROR,details:$.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error(`Fragment does not have a ${n?"part list":"url"}`),networkDetails:null}));this.abort();const s=this.config,r=s.fLoader,o=s.loader;return new Promise((a,c)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(p=>p[0]==="GAP")){c($0(e));return}else e.gap=!1;const l=this.loader=r?new r(s):new o(s),u=U0(e);e.loader=l;const f=O0(s.fragLoadPolicy.default),d={loadPolicy:f,timeout:f.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:N0};e.stats=l.stats;const h={onSuccess:(p,m,g,y)=>{this.resetLoader(e,l);let v=p.data;g.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(v.slice(0,16)),v=v.slice(16)),a({frag:e,part:null,payload:v,networkDetails:y})},onError:(p,m,g,y)=>{this.resetLoader(e,l),c(new Wt({type:Z.NETWORK_ERROR,details:$.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:ye({url:n,data:void 0},p),error:new Error(`HTTP Error ${p.code} ${p.text}`),networkDetails:g,stats:y}))},onAbort:(p,m,g)=>{this.resetLoader(e,l),c(new Wt({type:Z.NETWORK_ERROR,details:$.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:g,stats:p}))},onTimeout:(p,m,g)=>{this.resetLoader(e,l),c(new Wt({type:Z.NETWORK_ERROR,details:$.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${d.timeout}ms`),networkDetails:g,stats:p}))}};t&&(h.onProgress=(p,m,g,y)=>t({frag:e,part:null,payload:g,networkDetails:y})),l.load(u,d,h)})}loadPart(e,t,n){this.abort();const s=this.config,r=s.fLoader,o=s.loader;return new Promise((a,c)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){c($0(e,t));return}const l=this.loader=r?new r(s):new o(s),u=U0(e,t);e.loader=l;const f=O0(s.fragLoadPolicy.default),d={loadPolicy:f,timeout:f.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:N0};t.stats=l.stats,l.load(u,d,{onSuccess:(h,p,m,g)=>{this.resetLoader(e,l),this.updateStatsFromPart(e,t);const y={frag:e,part:t,payload:h.data,networkDetails:g};n(y),a(y)},onError:(h,p,m,g)=>{this.resetLoader(e,l),c(new Wt({type:Z.NETWORK_ERROR,details:$.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:ye({url:u.url,data:void 0},h),error:new Error(`HTTP Error ${h.code} ${h.text}`),networkDetails:m,stats:g}))},onAbort:(h,p,m)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,l),c(new Wt({type:Z.NETWORK_ERROR,details:$.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:m,stats:h}))},onTimeout:(h,p,m)=>{this.resetLoader(e,l),c(new Wt({type:Z.NETWORK_ERROR,details:$.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${d.timeout}ms`),networkDetails:m,stats:h}))}})})}updateStatsFromPart(e,t){const n=e.stats,s=t.stats,r=s.total;if(n.loaded+=s.loaded,r){const c=Math.round(e.duration/t.duration),l=Math.min(Math.round(n.loaded/r),c),f=(c-l)*Math.round(n.loaded/l);n.total=n.loaded+f}else n.total=Math.max(n.loaded,n.total);const o=n.loading,a=s.loading;o.start?o.first+=a.first-a.start:(o.start=a.start,o.first=a.first),o.end=a.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function U0(i,e=null){const t=e||i,n={frag:i,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},s=t.byteRangeStartOffset,r=t.byteRangeEndOffset;if(q(s)&&q(r)){var o;let a=s,c=r;if(i.sn==="initSegment"&&Zb((o=i.decryptdata)==null?void 0:o.method)){const l=r-s;l%16&&(c=r+(16-l%16)),s!==0&&(n.resetIV=!0,a=s-16)}n.rangeStart=a,n.rangeEnd=c}return n}function $0(i,e){const t=new Error(`GAP ${i.gap?"tag":"attribute"} found`),n={type:Z.MEDIA_ERROR,details:$.FRAG_GAP,fatal:!1,frag:i,error:t,networkDetails:null};return e&&(n.part=e),(e||i).stats.aborted=!0,new Wt(n)}function Zb(i){return i==="AES-128"||i==="AES-256"}class Wt extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class Jm extends Rt{constructor(e,t){super(e,t),this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(e){return this._tickInterval?!1:(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1}clearNextTick(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1}tick(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}class au{constructor(e,t,n,s=0,r=-1,o=!1){this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=Qs(),this.buffering={audio:Qs(),video:Qs(),audiovideo:Qs()},this.level=e,this.sn=t,this.id=n,this.size=s,this.part=r,this.partial=o}}function Qs(){return{start:0,executeStart:0,executeEnd:0,end:0}}const H0={length:0,start:()=>0,end:()=>0};class re{static isBuffered(e,t){if(e){const n=re.getBuffered(e);for(let s=n.length;s--;)if(t>=n.start(s)&&t<=n.end(s))return!0}return!1}static bufferedRanges(e){if(e){const t=re.getBuffered(e);return re.timeRangesToArray(t)}return[]}static timeRangesToArray(e){const t=[];for(let n=0;n<e.length;n++)t.push({start:e.start(n),end:e.end(n)});return t}static bufferInfo(e,t,n){if(e){const s=re.bufferedRanges(e);if(s.length)return re.bufferedInfo(s,t,n)}return{len:0,start:t,end:t,bufferedIndex:-1}}static bufferedInfo(e,t,n){t=Math.max(0,t),e.length>1&&e.sort((u,f)=>u.start-f.start||f.end-u.end);let s=-1,r=[];if(n)for(let u=0;u<e.length;u++){t>=e[u].start&&t<=e[u].end&&(s=u);const f=r.length;if(f){const d=r[f-1].end;e[u].start-d<n?e[u].end>d&&(r[f-1].end=e[u].end):r.push(e[u])}else r.push(e[u])}else r=e;let o=0,a,c=t,l=t;for(let u=0;u<r.length;u++){const f=r[u].start,d=r[u].end;if(s===-1&&t>=f&&t<=d&&(s=u),t+n>=f&&t<d)c=f,l=d,o=l-t;else if(t+n<f){a=f;break}}return{len:o,start:c||0,end:l||0,nextStart:a,buffered:e,bufferedIndex:s}}static getBuffered(e){try{return e.buffered||H0}catch(t){return pe.log("failed to get media.buffered",t),H0}}}const Zm=/\{\$([a-zA-Z0-9-_]+)\}/g;function G0(i){return Zm.test(i)}function Wl(i,e){if(i.variableList!==null||i.hasVariableRefs){const t=i.variableList;return e.replace(Zm,n=>{const s=n.substring(2,n.length-1),r=t==null?void 0:t[s];return r===void 0?(i.playlistParsingError||(i.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${s}"`)),n):r})}return e}function K0(i,e,t){let n=i.variableList;n||(i.variableList=n={});let s,r;if("QUERYPARAM"in e){s=e.QUERYPARAM;try{const o=new self.URL(t).searchParams;if(o.has(s))r=o.get(s);else throw new Error(`"${s}" does not match any query parameter in URI: "${t}"`)}catch(o){i.playlistParsingError||(i.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${o.message}`))}}else s=e.NAME,r=e.VALUE;s in n?i.playlistParsingError||(i.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${s}"`)):n[s]=r||""}function e9(i,e,t){const n=e.IMPORT;if(t&&n in t){let s=i.variableList;s||(i.variableList=s={}),s[n]=t[n]}else i.playlistParsingError||(i.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${n}"`))}const t9=/^(\d+)x(\d+)$/,V0=/(.+?)=(".*?"|.*?)(?:,|$)/g;class Se{constructor(e,t){typeof e=="string"&&(e=Se.parseAttrList(e,t)),me(this,e)}get clientAttrs(){return Object.keys(this).filter(e=>e.substring(0,2)==="X-")}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(t.length&1?"0":"")+t;const n=new Uint8Array(t.length/2);for(let s=0;s<t.length/2;s++)n[s]=parseInt(t.slice(s*2,s*2+2),16);return n}return null}hexadecimalIntegerAsNumber(e){const t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const n=this[e];return n?parseFloat(n):t}enumeratedString(e){return this[e]}enumeratedStringList(e,t){const n=this[e];return(n?n.split(/[ ,]+/):[]).reduce((s,r)=>(s[r.toLowerCase()]=!0,s),t)}bool(e){return this[e]==="YES"}decimalResolution(e){const t=t9.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e,t){let n;const s={},r='"';for(V0.lastIndex=0;(n=V0.exec(e))!==null;){const o=n[1].trim();let a=n[2];const c=a.indexOf(r)===0&&a.lastIndexOf(r)===a.length-1;let l=!1;if(c)a=a.slice(1,-1);else switch(o){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":l=!0}if(t&&(c||l))a=Wl(t,a);else if(!l&&!c)switch(o){case"CLOSED-CAPTIONS":if(a==="NONE")break;case"ALLOWED-CPC":case"CLASS":case"ASSOC-LANGUAGE":case"AUDIO":case"BYTERANGE":case"CHANNELS":case"CHARACTERISTICS":case"CODECS":case"DATA-ID":case"END-DATE":case"GROUP-ID":case"ID":case"IMPORT":case"INSTREAM-ID":case"KEYFORMAT":case"KEYFORMATVERSIONS":case"LANGUAGE":case"NAME":case"PATHWAY-ID":case"QUERYPARAM":case"RECENTLY-REMOVED-DATERANGES":case"SERVER-URI":case"STABLE-RENDITION-ID":case"STABLE-VARIANT-ID":case"START-DATE":case"SUBTITLES":case"SUPPLEMENTAL-CODECS":case"URI":case"VALUE":case"VIDEO":case"X-ASSET-LIST":case"X-ASSET-URI":pe.warn(`${e}: attribute ${o} is missing quotes`)}s[o]=a}return s}}const n9="com.apple.hls.interstitial";function i9(i){return i!=="ID"&&i!=="CLASS"&&i!=="CUE"&&i!=="START-DATE"&&i!=="DURATION"&&i!=="END-DATE"&&i!=="END-ON-NEXT"}function s9(i){return i==="SCTE35-OUT"||i==="SCTE35-IN"||i==="SCTE35-CMD"}class e1{constructor(e,t,n=0){var s;if(this.attr=void 0,this.tagAnchor=void 0,this.tagOrder=void 0,this._startDate=void 0,this._endDate=void 0,this._dateAtEnd=void 0,this._cue=void 0,this._badValueForSameId=void 0,this.tagAnchor=(t==null?void 0:t.tagAnchor)||null,this.tagOrder=(s=t==null?void 0:t.tagOrder)!=null?s:n,t){const r=t.attr;for(const o in r)if(Object.prototype.hasOwnProperty.call(e,o)&&e[o]!==r[o]){pe.warn(`DATERANGE tag attribute: "${o}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=o;break}e=me(new Se({}),r,e)}if(this.attr=e,t?(this._startDate=t._startDate,this._cue=t._cue,this._endDate=t._endDate,this._dateAtEnd=t._dateAtEnd):this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const r=(t==null?void 0:t.endDate)||new Date(this.attr["END-DATE"]);q(r.getTime())&&(this._endDate=r)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get cue(){const e=this._cue;return e===void 0?this._cue=this.attr.enumeratedStringList(this.attr.CUE?"CUE":"X-CUE",{pre:!1,post:!1,once:!1}):e}get startTime(){const{tagAnchor:e}=this;return e===null||e.programDateTime===null?(pe.warn(`Expected tagAnchor Fragment with PDT set for DateRange "${this.id}": ${e}`),NaN):e.start+(this.startDate.getTime()-e.programDateTime)/1e3}get startDate(){return this._startDate}get endDate(){const e=this._endDate||this._dateAtEnd;if(e)return e;const t=this.duration;return t!==null?this._dateAtEnd=new Date(this._startDate.getTime()+t*1e3):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(q(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isInterstitial(){return this.class===n9}get isValid(){return!!this.id&&!this._badValueForSameId&&q(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)&&(!this.attr.CUE||!this.cue.pre&&!this.cue.post||this.cue.pre!==this.cue.post)&&(!this.isInterstitial||"X-ASSET-URI"in this.attr||"X-ASSET-LIST"in this.attr)}}const r9=10;class o9{constructor(e){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.dateRanges=void 0,this.dateRangeTagCount=0,this.live=!0,this.requestScheduled=-1,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.misses=0,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.encryptedFragments=void 0,this.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.appliedTimelineOffset=void 0,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e){this.advanced=!0,this.updated=!0;return}const t=this.lastPartSn-e.lastPartSn,n=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!n||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||t===0&&n>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1}get hasProgramDateTime(){return this.fragments.length?q(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||r9}get drift(){const e=this.driftEndTime-this.driftStartTime;return e>0?(this.driftEnd-this.driftStart)*1e3/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){var e;return(e=this.fragments)!=null&&e.length?this.fragments[this.fragments.length-1].end:0}get fragmentStart(){var e;return(e=this.fragments)!=null&&e.length?this.fragments[0].start:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].index:-1}get maxPartIndex(){const e=this.partList;if(e){const t=this.lastPartIndex;if(t!==-1){for(let n=e.length;n--;)if(e[n].index>t)return e[n].index;return t}}return 0}get lastPartSn(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}get expired(){if(this.live&&this.age&&this.misses<3){const e=this.partEnd-this.fragmentStart;return this.age>Math.max(e,this.totalduration)+this.levelTargetDuration}return!1}}function xi(i){return i==="AES-128"||i==="AES-256"||i==="AES-256-CTR"}function lu(i){switch(i){case"AES-128":case"AES-256":return bn.cbc;case"AES-256-CTR":return bn.ctr;default:throw new Error(`invalid full segment method ${i}`)}}function t1(i){return Uint8Array.from(atob(i),e=>e.charCodeAt(0))}function zl(i){return Uint8Array.from(unescape(encodeURIComponent(i)),e=>e.charCodeAt(0))}function a9(i){const e=zl(i).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function l9(i){const e=function(n,s,r){const o=n[s];n[s]=n[r],n[r]=o};e(i,0,3),e(i,1,2),e(i,4,5),e(i,6,7)}function c9(i){const e=i.split(":");let t=null;if(e[0]==="data"&&e.length===2){const n=e[1].split(";"),s=n[n.length-1].split(",");if(s.length===2){const r=s[0]==="base64",o=s[1];r?(n.splice(-1,1),t=t1(o)):t=a9(o)}}return t}const Wr=typeof self<"u"?self:void 0;var _e={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},it={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function Ql(i){switch(i){case it.FAIRPLAY:return _e.FAIRPLAY;case it.PLAYREADY:return _e.PLAYREADY;case it.WIDEVINE:return _e.WIDEVINE;case it.CLEARKEY:return _e.CLEARKEY}}function j0(i){switch(i){case _e.FAIRPLAY:return it.FAIRPLAY;case _e.PLAYREADY:return it.PLAYREADY;case _e.WIDEVINE:return it.WIDEVINE;case _e.CLEARKEY:return it.CLEARKEY}}function pr(i){const{drmSystems:e,widevineLicenseUrl:t}=i,n=e?[_e.FAIRPLAY,_e.WIDEVINE,_e.PLAYREADY,_e.CLEARKEY].filter(s=>!!e[s]):[];return!n[_e.WIDEVINE]&&t&&n.push(_e.WIDEVINE),n}const n1=function(i){return Wr!=null&&(i=Wr.navigator)!=null&&i.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function u9(i,e,t,n){let s;switch(i){case _e.FAIRPLAY:s=["cenc","sinf"];break;case _e.WIDEVINE:case _e.PLAYREADY:s=["cenc"];break;case _e.CLEARKEY:s=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${i}`)}return f9(s,e,t,n)}function f9(i,e,t,n){return[{initDataTypes:i,persistentState:n.persistentState||"optional",distinctiveIdentifier:n.distinctiveIdentifier||"optional",sessionTypes:n.sessionTypes||[n.sessionType||"temporary"],audioCapabilities:e.map(r=>({contentType:`audio/mp4; codecs=${r}`,robustness:n.audioRobustness||"",encryptionScheme:n.audioEncryptionScheme||null})),videoCapabilities:t.map(r=>({contentType:`video/mp4; codecs=${r}`,robustness:n.videoRobustness||"",encryptionScheme:n.videoEncryptionScheme||null}))}]}function d9(i){var e;return i.sessionType==="persistent-license"||!!((e=i.sessionTypes)!=null&&e.some(t=>t==="persistent-license"))}function h9(i){const e=new Uint16Array(i.buffer,i.byteOffset,i.byteLength/2),t=String.fromCharCode.apply(null,Array.from(e)),n=t.substring(t.indexOf("<"),t.length),o=new DOMParser().parseFromString(n,"text/xml").getElementsByTagName("KID")[0];if(o){const a=o.childNodes[0]?o.childNodes[0].nodeValue:o.getAttribute("VALUE");if(a){const c=t1(a).subarray(0,16);return l9(c),c}}return null}let Ys={};class mo{static clearKeyUriToKeyIdMap(){Ys={}}constructor(e,t,n,s=[1],r=null,o){this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=e,this.uri=t,this.keyFormat=n,this.keyFormatVersions=s,this.iv=r,this.encrypted=e?e!=="NONE":!1,this.isCommonEncryption=this.encrypted&&!xi(e),o!=null&&o.startsWith("0x")&&(this.keyId=new Uint8Array(Om(o)))}matches(e){var t,n;return e.uri===this.uri&&e.method===this.method&&e.encrypted===this.encrypted&&e.keyFormat===this.keyFormat&&e.keyFormatVersions.join(",")===this.keyFormatVersions.join(",")&&((t=e.iv)==null?void 0:t.join(","))===((n=this.iv)==null?void 0:n.join(","))}isSupported(){if(this.method){if(xi(this.method)||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case it.FAIRPLAY:case it.WIDEVINE:case it.PLAYREADY:case it.CLEARKEY:return["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1}getDecryptData(e){if(!this.encrypted||!this.uri)return null;if(xi(this.method)&&this.uri&&!this.iv){typeof e!="number"&&(pe.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0);const n=p9(e);return new mo(this.method,this.uri,"identity",this.keyFormatVersions,n)}if(this.pssh&&this.keyId)return this;const t=c9(this.uri);if(t)switch(this.keyFormat){case it.WIDEVINE:if(this.pssh=t,!this.keyId&&t.length>=22){const n=t.length-22;this.keyId=t.subarray(n,n+16)}break;case it.PLAYREADY:{const n=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=yb(n,null,t),this.keyId=h9(t);break}default:{let n=t.subarray(0,16);if(n.length!==16){const s=new Uint8Array(16);s.set(n,16-n.length),n=s}this.keyId=n;break}}if(!this.keyId||this.keyId.byteLength!==16){let n=Ys[this.uri];if(!n){const s=Object.keys(Ys).length%Number.MAX_SAFE_INTEGER;n=new Uint8Array(16),new DataView(n.buffer,12,4).setUint32(0,s),Ys[this.uri]=n}this.keyId=n}return this}}function p9(i){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=i>>8*(15-t)&255;return e}const q0=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,W0=/#EXT-X-MEDIA:(.*)/g,g9=/^#EXT(?:INF|-X-TARGETDURATION):/m,Wo=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),m9=new RegExp([/#EXT-X-(PROGRAM-DATE-TIME|BYTERANGE|DATERANGE|DEFINE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class Nt{static findGroup(e,t){for(let n=0;n<e.length;n++){const s=e[n];if(s.id===t)return s}}static resolve(e,t){return eu.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return g9.test(e)}static parseMasterPlaylist(e,t){const n=G0(e),s={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:n},r=[];q0.lastIndex=0;let o;for(;(o=q0.exec(e))!=null;)if(o[1]){var a;const l=new Se(o[1],s),u=Wl(s,o[2]),f={attrs:l,bitrate:l.decimalInteger("BANDWIDTH")||l.decimalInteger("AVERAGE-BANDWIDTH"),name:l.NAME,url:Nt.resolve(u,t)},d=l.decimalResolution("RESOLUTION");d&&(f.width=d.width,f.height=d.height),Y0(l.CODECS,f);const h=l["SUPPLEMENTAL-CODECS"];h&&(f.supplemental={},Y0(h,f.supplemental)),(a=f.unknownCodecs)!=null&&a.length||r.push(f),s.levels.push(f)}else if(o[3]){const l=o[3],u=o[4];switch(l){case"SESSION-DATA":{const f=new Se(u,s),d=f["DATA-ID"];d&&(s.sessionData===null&&(s.sessionData={}),s.sessionData[d]=f);break}case"SESSION-KEY":{const f=z0(u,t,s);f.encrypted&&f.isSupported()?(s.sessionKeys===null&&(s.sessionKeys=[]),s.sessionKeys.push(f)):pe.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${u}"`);break}case"DEFINE":{{const f=new Se(u,s);K0(s,f,t)}break}case"CONTENT-STEERING":{const f=new Se(u,s);s.contentSteering={uri:Nt.resolve(f["SERVER-URI"],t),pathwayId:f["PATHWAY-ID"]||"."};break}case"START":{s.startTimeOffset=Q0(u);break}}}const c=r.length>0&&r.length<s.levels.length;return s.levels=c?r:s.levels,s.levels.length===0&&(s.playlistParsingError=new Error("no levels found in manifest")),s}static parseMasterPlaylistMedia(e,t,n){let s;const r={},o=n.levels,a={AUDIO:o.map(l=>({id:l.attrs.AUDIO,audioCodec:l.audioCodec})),SUBTITLES:o.map(l=>({id:l.attrs.SUBTITLES,textCodec:l.textCodec})),"CLOSED-CAPTIONS":[]};let c=0;for(W0.lastIndex=0;(s=W0.exec(e))!==null;){const l=new Se(s[1],n),u=l.TYPE;if(u){const f=a[u],d=r[u]||[];r[u]=d;const h=l.LANGUAGE,p=l["ASSOC-LANGUAGE"],m=l.CHANNELS,g=l.CHARACTERISTICS,y=l["INSTREAM-ID"],v={attrs:l,bitrate:0,id:c++,groupId:l["GROUP-ID"]||"",name:l.NAME||h||"",type:u,default:l.bool("DEFAULT"),autoselect:l.bool("AUTOSELECT"),forced:l.bool("FORCED"),lang:h,url:l.URI?Nt.resolve(l.URI,t):""};if(p&&(v.assocLang=p),m&&(v.channels=m),g&&(v.characteristics=g),y&&(v.instreamId=y),f!=null&&f.length){const x=Nt.findGroup(f,v.groupId)||f[0];X0(v,x,"audioCodec"),X0(v,x,"textCodec")}d.push(v)}}return r}static parseLevelPlaylist(e,t,n,s,r,o){var a;const c={url:t},l=new o9(t),u=l.fragments,f=[];let d=null,h=0,p=0,m=0,g=0,y=0,v=null,x=new Vo(s,c),E,S,T,_=-1,I=!1,w=null,b;if(Wo.lastIndex=0,l.m3u8=e,l.hasVariableRefs=G0(e),((a=Wo.exec(e))==null?void 0:a[0])!=="#EXTM3U")return l.playlistParsingError=new Error("Missing format identifier #EXTM3U"),l;for(;(E=Wo.exec(e))!==null;){I&&(I=!1,x=new Vo(s,c),x.playlistOffset=m,x.start=m,x.sn=h,x.cc=g,y&&(x.bitrate=y),x.level=n,d&&(x.initSegment=d,d.rawProgramDateTime&&(x.rawProgramDateTime=d.rawProgramDateTime,d.rawProgramDateTime=null),w&&(x.setByteRange(w),w=null)));const N=E[1];if(N){x.duration=parseFloat(N);const F=(" "+E[2]).slice(1);x.title=F||null,x.tagList.push(F?["INF",N,F]:["INF",N])}else if(E[3]){if(q(x.duration)){x.playlistOffset=m,x.start=m,T&&Z0(x,T,l),x.sn=h,x.level=n,x.cc=g,u.push(x);const F=(" "+E[3]).slice(1);x.relurl=Wl(l,F),Yl(x,v,f),v=x,m+=x.duration,h++,p=0,I=!0}}else{if(E=E[0].match(m9),!E){pe.warn("No matches on slow regex match for level playlist!");continue}for(S=1;S<E.length&&E[S]===void 0;S++);const F=(" "+E[S]).slice(1),O=(" "+E[S+1]).slice(1),K=E[S+2]?(" "+E[S+2]).slice(1):null;switch(F){case"BYTERANGE":v?x.setByteRange(O,v):x.setByteRange(O);break;case"PROGRAM-DATE-TIME":x.rawProgramDateTime=O,x.tagList.push(["PROGRAM-DATE-TIME",O]),_===-1&&(_=u.length);break;case"PLAYLIST-TYPE":l.type&&Vt(l,F,E),l.type=O.toUpperCase();break;case"MEDIA-SEQUENCE":l.startSN!==0?Vt(l,F,E):u.length>0&&ed(l,F,E),h=l.startSN=parseInt(O);break;case"SKIP":{l.skippedSegments&&Vt(l,F,E);const B=new Se(O,l),G=B.decimalInteger("SKIPPED-SEGMENTS");if(q(G)){l.skippedSegments+=G;for(let C=G;C--;)u.push(null);h+=G}const H=B.enumeratedString("RECENTLY-REMOVED-DATERANGES");H&&(l.recentlyRemovedDateranges=(l.recentlyRemovedDateranges||[]).concat(H.split(" ")));break}case"TARGETDURATION":l.targetduration!==0&&Vt(l,F,E),l.targetduration=Math.max(parseInt(O),1);break;case"VERSION":l.version!==null&&Vt(l,F,E),l.version=parseInt(O);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":l.live||Vt(l,F,E),l.live=!1;break;case"#":(O||K)&&x.tagList.push(K?[O,K]:[O]);break;case"DISCONTINUITY":g++,x.tagList.push(["DIS"]);break;case"GAP":x.gap=!0,x.tagList.push([F]);break;case"BITRATE":x.tagList.push([F,O]),y=parseInt(O)*1e3,q(y)?x.bitrate=y:y=0;break;case"DATERANGE":{const B=new Se(O,l),G=new e1(B,l.dateRanges[B.ID],l.dateRangeTagCount);l.dateRangeTagCount++,G.isValid||l.skippedSegments?l.dateRanges[G.id]=G:pe.warn(`Ignoring invalid DATERANGE tag: "${O}"`),x.tagList.push(["EXT-X-DATERANGE",O]);break}case"DEFINE":{{const B=new Se(O,l);"IMPORT"in B?e9(l,B,o):K0(l,B,t)}break}case"DISCONTINUITY-SEQUENCE":l.startCC!==0?Vt(l,F,E):u.length>0&&ed(l,F,E),l.startCC=g=parseInt(O);break;case"KEY":{const B=z0(O,t,l);if(B.isSupported()){if(B.method==="NONE"){T=void 0;break}T||(T={});const G=T[B.keyFormat];G!=null&&G.matches(B)||(G&&(T=me({},T)),T[B.keyFormat]=B)}else pe.warn(`[Keys] Ignoring invalid EXT-X-KEY tag: "${O}"`);break}case"START":l.startTimeOffset=Q0(O);break;case"MAP":{const B=new Se(O,l);if(x.duration){const G=new Vo(s,c);J0(G,B,n,T),d=G,x.initSegment=d,d.rawProgramDateTime&&!x.rawProgramDateTime&&(x.rawProgramDateTime=d.rawProgramDateTime)}else{const G=x.byteRangeEndOffset;if(G){const H=x.byteRangeStartOffset;w=`${G-H}@${H}`}else w=null;J0(x,B,n,T),d=x,I=!0}d.cc=g;break}case"SERVER-CONTROL":{b&&Vt(l,F,E),b=new Se(O),l.canBlockReload=b.bool("CAN-BLOCK-RELOAD"),l.canSkipUntil=b.optionalFloat("CAN-SKIP-UNTIL",0),l.canSkipDateRanges=l.canSkipUntil>0&&b.bool("CAN-SKIP-DATERANGES"),l.partHoldBack=b.optionalFloat("PART-HOLD-BACK",0),l.holdBack=b.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{l.partTarget&&Vt(l,F,E);const B=new Se(O);l.partTarget=B.decimalFloatingPoint("PART-TARGET");break}case"PART":{let B=l.partList;B||(B=l.partList=[]);const G=p>0?B[B.length-1]:void 0,H=p++,C=new Se(O,l),R=new sb(C,x,c,H,G);B.push(R),x.duration+=R.duration;break}case"PRELOAD-HINT":{const B=new Se(O,l);l.preloadHint=B;break}case"RENDITION-REPORT":{const B=new Se(O,l);l.renditionReports=l.renditionReports||[],l.renditionReports.push(B);break}default:pe.warn(`line parsed but not handled: ${E}`);break}}}v&&!v.relurl?(u.pop(),m-=v.duration,l.partList&&(l.fragmentHint=v)):l.partList&&(Yl(x,v,f),x.cc=g,l.fragmentHint=x,T&&Z0(x,T,l)),l.targetduration||(l.playlistParsingError=new Error("#EXT-X-TARGETDURATION is required"));const L=u.length,k=u[0],M=u[L-1];if(m+=l.skippedSegments*l.targetduration,m>0&&L&&M){l.averagetargetduration=m/L;const N=M.sn;l.endSN=N!=="initSegment"?N:0,l.live||(M.endList=!0),k&&l.startCC===void 0&&(l.startCC=k.cc),_>0&&(y9(u,_),k&&f.unshift(k))}else l.endSN=0,l.startCC=0;return l.fragmentHint&&(m+=l.fragmentHint.duration),l.totalduration=m,f.length&&l.dateRangeTagCount&&k&&i1(f,l),l.endCC=g,l}}function i1(i,e){const t=i.length;if(!t)return;const n=i[t-1],s=e.live?1/0:e.totalduration,r=Object.keys(e.dateRanges);for(let o=r.length;o--;){const a=e.dateRanges[r[o]],c=a.startDate.getTime();a.tagAnchor=n.ref;for(let l=t;l--;){const u=x9(e,c,i,l,s);if(u!==-1){a.tagAnchor=e.fragments[u].ref;break}}}}function x9(i,e,t,n,s){const r=t[n];if(r){const a=r.programDateTime;if(e>=a||n===0){var o;const c=(((o=t[n+1])==null?void 0:o.start)||s)-r.start;if(e<=a+c*1e3){const l=t[n].sn-i.startSN,u=i.fragments;if(u.length>t.length){const d=(t[n+1]||u[u.length-1]).sn-i.startSN;for(let h=d;h>l;h--){const p=u[h].programDateTime;if(e>=p&&e<p+u[h].duration*1e3)return h}}return l}}}return-1}function z0(i,e,t){var n,s;const r=new Se(i,t),o=(n=r.METHOD)!=null?n:"",a=r.URI,c=r.hexadecimalInteger("IV"),l=r.KEYFORMATVERSIONS,u=(s=r.KEYFORMAT)!=null?s:"identity";a&&r.IV&&!c&&pe.error(`Invalid IV: ${r.IV}`);const f=a?Nt.resolve(a,e):"",d=(l||"1").split("/").map(Number).filter(Number.isFinite);return new mo(o,f,u,d,c,r.KEYID)}function Q0(i){const t=new Se(i).decimalFloatingPoint("TIME-OFFSET");return q(t)?t:null}function Y0(i,e){let t=(i||"").split(/[ ,]+/).filter(n=>n);["video","audio","text"].forEach(n=>{const s=t.filter(r=>iu(r,n));s.length&&(e[`${n}Codec`]=s.map(r=>r.split("/")[0]).join(","),t=t.filter(r=>s.indexOf(r)===-1))}),e.unknownCodecs=t}function X0(i,e,t){const n=e[t];n&&(i[t]=n)}function y9(i,e){let t=i[e];for(let n=e;n--;){const s=i[n];if(!s)return;s.programDateTime=t.programDateTime-s.duration*1e3,t=s}}function Yl(i,e,t){i.rawProgramDateTime?t.push(i):e!=null&&e.programDateTime&&(i.programDateTime=e.endProgramDateTime)}function J0(i,e,t,n){i.relurl=e.URI,e.BYTERANGE&&i.setByteRange(e.BYTERANGE),i.level=t,i.sn="initSegment",n&&(i.levelkeys=n),i.initSegment=null}function Z0(i,e,t){i.levelkeys=e;const{encryptedFragments:n}=t;(!n.length||n[n.length-1].levelkeys!==e)&&Object.keys(e).some(s=>e[s].isCommonEncryption)&&n.push(i)}function Vt(i,e,t){i.playlistParsingError=new Error(`#EXT-X-${e} must not appear more than once (${t[0]})`)}function ed(i,e,t){i.playlistParsingError=new Error(`#EXT-X-${e} must appear before the first Media Segment (${t[0]})`)}function zo(i,e){const t=e.startPTS;if(q(t)){let n=0,s;e.sn>i.sn?(n=t-i.start,s=i):(n=i.start-t,s=e),s.duration!==n&&s.setDuration(n)}else e.sn>i.sn?i.cc===e.cc&&i.minEndPTS?e.setStart(i.start+(i.minEndPTS-i.start)):e.setStart(i.start+i.duration):e.setStart(Math.max(i.start-e.duration,0))}function s1(i,e,t,n,s,r){n-t<=0&&(pe.warn("Fragment should have a positive duration",e),n=t+e.duration,r=s+e.duration);let a=t,c=n;const l=e.startPTS,u=e.endPTS;if(q(l)){const g=Math.abs(l-t);q(e.deltaPTS)?e.deltaPTS=Math.max(g,e.deltaPTS):e.deltaPTS=g,a=Math.max(t,l),t=Math.min(t,l),s=Math.min(s,e.startDTS),c=Math.min(n,u),n=Math.max(n,u),r=Math.max(r,e.endDTS)}const f=t-e.start;e.start!==0&&e.setStart(t),e.setDuration(n-e.start),e.startPTS=t,e.maxStartPTS=a,e.startDTS=s,e.endPTS=n,e.minEndPTS=c,e.endDTS=r;const d=e.sn;if(!i||d<i.startSN||d>i.endSN)return 0;let h;const p=d-i.startSN,m=i.fragments;for(m[p]=e,h=p;h>0;h--)zo(m[h],m[h-1]);for(h=p;h<m.length-1;h++)zo(m[h],m[h+1]);return i.fragmentHint&&zo(m[m.length-1],i.fragmentHint),i.PTSKnown=i.alignedSliding=!0,f}function v9(i,e){if(i===e)return;let t=null;const n=i.fragments;for(let l=n.length-1;l>=0;l--){const u=n[l].initSegment;if(u){t=u;break}}i.fragmentHint&&delete i.fragmentHint.endPTS;let s;S9(i,e,(l,u,f,d)=>{if((!e.startCC||e.skippedSegments)&&u.cc!==l.cc){const h=l.cc-u.cc;for(let p=f;p<d.length;p++)d[p].cc+=h;e.endCC=d[d.length-1].cc}q(l.startPTS)&&q(l.endPTS)&&(u.setStart(u.startPTS=l.startPTS),u.startDTS=l.startDTS,u.maxStartPTS=l.maxStartPTS,u.endPTS=l.endPTS,u.endDTS=l.endDTS,u.minEndPTS=l.minEndPTS,u.setDuration(l.endPTS-l.startPTS),u.duration&&(s=u),e.PTSKnown=e.alignedSliding=!0),l.hasStreams&&(u.elementaryStreams=l.elementaryStreams),u.loader=l.loader,l.hasStats&&(u.stats=l.stats),l.initSegment&&(u.initSegment=l.initSegment,t=l.initSegment)});const r=e.fragments,o=e.fragmentHint?r.concat(e.fragmentHint):r;if(t&&o.forEach(l=>{var u;l&&(!l.initSegment||l.initSegment.relurl===((u=t)==null?void 0:u.relurl))&&(l.initSegment=t)}),e.skippedSegments){if(e.deltaUpdateFailed=r.some(l=>!l),e.deltaUpdateFailed){pe.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let l=e.skippedSegments;l--;)r.shift();e.startSN=r[0].sn}else{e.canSkipDateRanges&&(e.dateRanges=E9(i.dateRanges,e));const l=i.fragments.filter(u=>u.rawProgramDateTime);if(i.hasProgramDateTime&&!e.hasProgramDateTime)for(let u=1;u<o.length;u++)o[u].programDateTime===null&&Yl(o[u],o[u-1],l);i1(l,e)}e.endCC=r[r.length-1].cc}if(!e.startCC){var a;const l=a1(i,e.startSN-1);e.startCC=(a=l==null?void 0:l.cc)!=null?a:r[0].cc}A9(i.partList,e.partList,(l,u)=>{u.elementaryStreams=l.elementaryStreams,u.stats=l.stats}),s?s1(e,s,s.startPTS,s.endPTS,s.startDTS,s.endDTS):r1(i,e),r.length&&(e.totalduration=e.edge-r[0].start),e.driftStartTime=i.driftStartTime,e.driftStart=i.driftStart;const c=e.advancedDateTime;if(e.advanced&&c){const l=e.edge;e.driftStart||(e.driftStartTime=c,e.driftStart=l),e.driftEndTime=c,e.driftEnd=l}else e.driftEndTime=i.driftEndTime,e.driftEnd=i.driftEnd,e.advancedDateTime=i.advancedDateTime;e.requestScheduled===-1&&(e.requestScheduled=i.requestScheduled)}function E9(i,e){const{dateRanges:t,recentlyRemovedDateranges:n}=e,s=me({},i);n&&n.forEach(a=>{delete s[a]});const o=Object.keys(s).length;return o&&Object.keys(t).forEach(a=>{const c=s[a],l=new e1(t[a].attr,c);l.isValid?(s[a]=l,c||(l.tagOrder+=o)):pe.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${Ae(t[a].attr)}"`)}),s}function A9(i,e,t){if(i&&e){let n=0;for(let s=0,r=i.length;s<=r;s++){const o=i[s],a=e[s+n];o&&a&&o.index===a.index&&o.fragment.sn===a.fragment.sn?t(o,a):n--}}}function S9(i,e,t){const n=e.skippedSegments,s=Math.max(i.startSN,e.startSN)-e.startSN,r=(i.fragmentHint?1:0)+(n?e.endSN:Math.min(i.endSN,e.endSN))-e.startSN,o=e.startSN-i.startSN,a=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,c=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments;for(let l=s;l<=r;l++){const u=c[o+l];let f=a[l];if(n&&!f&&u&&(f=e.fragments[l]=u),u&&f){if(t(u,f,l,a),u.url&&u.url!==f.url){e.playlistParsingError=td(`media sequence mismatch ${f.sn}:`,i,e,u,f);return}else if(u.cc!==f.cc){e.playlistParsingError=td(`discontinuity sequence mismatch (${u.cc}!=${f.cc})`,i,e,u,f);return}}}}function td(i,e,t,n,s){return new Error(`${i} ${s.url}
- Playlist starting @${e.startSN}
- ${e.m3u8}
- Playlist starting @${t.startSN}
- ${t.m3u8}`)}function r1(i,e,t=!0){const n=e.startSN+e.skippedSegments-i.startSN,s=i.fragments,r=n>=0;let o=0;if(r&&n<s.length)o=s[n].start;else if(r&&e.startSN===i.endSN+1)o=i.fragmentEnd;else if(r&&t)o=i.fragmentStart+n*e.levelTargetDuration;else if(!e.skippedSegments&&e.fragmentStart===0)o=i.fragmentStart;else return;Xl(e,o)}function Xl(i,e){if(e){const t=i.fragments;for(let n=i.skippedSegments;n<t.length;n++)t[n].addStart(e);i.fragmentHint&&i.fragmentHint.addStart(e)}}function o1(i,e=1/0){let t=1e3*i.targetduration;if(i.updated){const n=i.fragments;if(n.length&&t*4>e){const r=n[n.length-1].duration*1e3;r<t&&(t=r)}}else t/=2;return Math.round(t)}function a1(i,e,t){if(!i)return null;let n=i.fragments[e-i.startSN];return n||(n=i.fragmentHint,n&&n.sn===e)?n:e<i.startSN&&t&&t.sn===e?t:null}function nd(i,e,t){return i?l1(i.partList,e,t):null}function l1(i,e,t){if(i)for(let n=i.length;n--;){const s=i[n];if(s.index===t&&s.fragment.sn===e)return s}return null}function c1(i){i.forEach((e,t)=>{var n;(n=e.details)==null||n.fragments.forEach(s=>{s.level=t,s.initSegment&&(s.initSegment.level=t)})})}function Zi(i,e){for(let n=0,s=i.length;n<s;n++){var t;if(((t=i[n])==null?void 0:t.cc)===e)return i[n]}return null}function T9(i,e){return!!(i&&e.startCC<i.endCC&&e.endCC>i.startCC)}function id(i,e){if(i){const t=i.start+e;i.start=i.startPTS=t,i.endPTS=t+i.duration}}function u1(i,e){const t=e.fragments;for(let n=0,s=t.length;n<s;n++)id(t[n],i);e.fragmentHint&&id(e.fragmentHint,i),e.alignedSliding=!0}function b9(i,e){i&&(f1(e,i),!e.alignedSliding&&i&&zr(e,i),!e.alignedSliding&&i&&!e.skippedSegments&&r1(i,e,!1))}function f1(i,e){if(!T9(e,i))return;const t=Math.min(e.endCC,i.endCC),n=Zi(e.fragments,t),s=Zi(i.fragments,t);if(!n||!s)return;pe.log(`Aligning playlist at start of dicontinuity sequence ${t}`);const r=n.start-s.start;u1(r,i)}function zr(i,e){if(!i.hasProgramDateTime||!e.hasProgramDateTime)return;const t=i.fragments,n=e.fragments;if(!t.length||!n.length)return;let s,r;const o=Math.min(e.endCC,i.endCC);e.startCC<o&&i.startCC<o&&(s=Zi(n,o),r=Zi(t,o)),(!s||!r)&&(s=n[Math.floor(n.length/2)],r=Zi(t,s.cc)||t[Math.floor(t.length/2)]);const a=s.programDateTime,c=r.programDateTime;if(!a||!c)return;const l=(c-a)/1e3-(r.start-s.start);u1(l,i)}const _9={toString:function(i){let e="";const t=i.length;for(let n=0;n<t;n++)e+=`[${i.start(n).toFixed(3)}-${i.end(n).toFixed(3)}]`;return e}},V={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"};class cu extends Jm{constructor(e,t,n,s,r){super(s,e.logger),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=V.STOPPED,this.playlistType=void 0,this.media=null,this.mediaBuffer=null,this.config=void 0,this.bitrateTest=!1,this.lastCurrentTime=0,this.nextLoadPosition=0,this.startPosition=0,this.startTimeOffset=null,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.keyLoader=void 0,this.levelLastLoaded=null,this.startFragRequested=!1,this.decrypter=void 0,this.initPTS=[],this.buffering=!0,this.loadingParts=!1,this.loopSn=void 0,this.onMediaSeeking=()=>{const{config:o,fragCurrent:a,media:c,mediaBuffer:l,state:u}=this,f=c?c.currentTime:0,d=re.bufferInfo(l||c,f,o.maxBufferHole),h=!d.len;if(this.log(`Media seeking to ${q(f)?f.toFixed(3):f}, state: ${u}, ${h?"out of":"in"} buffer`),this.state===V.ENDED)this.resetLoadingState();else if(a){const p=o.maxFragLookUpTolerance,m=a.start-p,g=a.start+a.duration+p;if(h||g<d.start||m>d.end){const y=f>g;(f<m||y)&&(y&&a.loader&&(this.log(`Cancelling fragment load for seek (sn: ${a.sn})`),a.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(c){this.fragmentTracker.removeFragmentsInRange(f,1/0,this.playlistType,!0);const p=this.lastCurrentTime;if(f>p&&(this.lastCurrentTime=f),!this.loadingParts){const m=Math.max(d.end,f),g=this.shouldLoadParts(this.getLevelDetails(),m);g&&(this.log(`LL-Part loading ON after seeking to ${f.toFixed(2)} with buffer @${m.toFixed(2)}`),this.loadingParts=g)}}this.hls.hasEnoughToStart||(this.log(`Setting ${h?"startPosition":"nextLoadPosition"} to ${f} for seek without enough to start`),this.nextLoadPosition=f,h&&(this.startPosition=f)),this.tickImmediate()},this.onMediaEnded=()=>{this.log("setting startPosition to 0 because media ended"),this.startPosition=this.lastCurrentTime=0},this.playlistType=r,this.hls=e,this.fragmentLoader=new Jb(e.config),this.keyLoader=n,this.fragmentTracker=t,this.config=e.config,this.decrypter=new ou(e.config)}registerListeners(){const{hls:e}=this;e.on(A.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(A.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(A.MANIFEST_LOADING,this.onManifestLoading,this),e.on(A.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(A.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(A.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(A.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(A.MANIFEST_LOADING,this.onManifestLoading,this),e.off(A.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(A.ERROR,this.onError,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){if(this.state===V.STOPPED)return;this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);const e=this.fragCurrent;e!=null&&e.loader&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=V.STOPPED}get startPositionValue(){const{nextLoadPosition:e,startPosition:t}=this;return t===-1&&e?e:t}get bufferingEnabled(){return this.buffering}pauseBuffering(){this.buffering=!1}resumeBuffering(){this.buffering=!0}get inFlightFrag(){return{frag:this.fragCurrent,state:this.state}}_streamEnded(e,t){if(t.live||!this.media)return!1;const n=e.end||0,s=this.config.timelineOffset||0;if(n<=s)return!1;const r=e.buffered;this.config.maxBufferHole&&r&&r.length>1&&(e=re.bufferedInfo(r,e.start,0));const o=e.nextStart;if(o&&o>s&&o<t.edge||this.media.currentTime<e.start)return!1;const c=t.partList;if(c!=null&&c.length){const u=c[c.length-1];return re.isBuffered(this.media,u.start+u.duration/2)}const l=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(l)}getLevelDetails(){if(this.levels&&this.levelLastLoaded!==null){var e;return(e=this.levelLastLoaded)==null?void 0:e.details}}get timelineOffset(){const e=this.config.timelineOffset;if(e){var t;return((t=this.getLevelDetails())==null?void 0:t.appliedTimelineOffset)||e}return 0}onMediaAttached(e,t){const n=this.media=this.mediaBuffer=t.media;n.removeEventListener("seeking",this.onMediaSeeking),n.removeEventListener("ended",this.onMediaEnded),n.addEventListener("seeking",this.onMediaSeeking),n.addEventListener("ended",this.onMediaEnded);const s=this.config;this.levels&&s.autoStartLoad&&this.state===V.STOPPED&&this.startLoad(s.startPosition)}onMediaDetaching(e,t){const n=!!t.transferMedia,s=this.media;if(s!==null){if(s.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),s.removeEventListener("seeking",this.onMediaSeeking),s.removeEventListener("ended",this.onMediaEnded),this.keyLoader&&!n&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loopSn=void 0,n){this.resetLoadingState(),this.resetTransmuxer();return}this.loadingParts=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}}onManifestLoading(){this.initPTS=[],this.levels=this.levelLastLoaded=this.fragCurrent=null,this.lastCurrentTime=this.startPosition=0,this.startFragRequested=!1}onError(e,t){}onManifestLoaded(e,t){this.startTimeOffset=t.startTimeOffset}onHandlerDestroying(){this.stopLoad(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),super.onHandlerDestroying(),this.hls=this.onMediaSeeking=this.onMediaEnded=null}onHandlerDestroyed(){this.state=V.STOPPED,this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,super.onHandlerDestroyed()}loadFragment(e,t,n){this.startFragRequested=!0,this._loadFragForPlayback(e,t,n)}_loadFragForPlayback(e,t,n){const s=r=>{const o=r.frag;if(this.fragContextChanged(o)){this.warn(`${o.type} sn: ${o.sn}${r.part?" part: "+r.part.index:""} of ${this.fragInfo(o,!1,r.part)}) was dropped during download.`),this.fragmentTracker.removeFragment(o);return}o.stats.chunkCount++,this._handleFragmentLoadProgress(r)};this._doFragLoad(e,t,n,s).then(r=>{if(!r)return;const o=this.state,a=r.frag;if(this.fragContextChanged(a)){(o===V.FRAG_LOADING||!this.fragCurrent&&o===V.PARSING)&&(this.fragmentTracker.removeFragment(a),this.state=V.IDLE);return}"payload"in r&&(this.log(`Loaded ${a.type} sn: ${a.sn} of ${this.playlistLabel()} ${a.level}`),this.hls.trigger(A.FRAG_LOADED,r)),this._handleFragmentLoadComplete(r)}).catch(r=>{this.state===V.STOPPED||this.state===V.ERROR||(this.warn(`Frag error: ${(r==null?void 0:r.message)||r}`),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:n}=this;if(n.getState(e)===Be.APPENDING){const r=e.type,o=this.getFwdBufferInfo(this.mediaBuffer,r),a=Math.max(e.duration,o?o.len:this.config.maxBufferLength),c=this.backtrackFragment;((c?e.sn-c.sn:0)===1||this.reduceMaxBufferLength(a,e.duration))&&n.removeFragment(e)}else((t=this.mediaBuffer)==null?void 0:t.buffered.length)===0?n.removeAllFragments():n.hasParts(e.type)&&(n.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),n.getState(e)===Be.PARTIAL&&n.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const t=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}waitForLive(e){const t=e.details;return(t==null?void 0:t.live)&&t.type!=="EVENT"&&(this.levelLastLoaded!==e||t.expired)}flushMainBuffer(e,t,n=null){if(!(e-t))return;const s={startOffset:e,endOffset:t,type:n};this.hls.trigger(A.BUFFER_FLUSHING,s)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(n=>{const s=n==null?void 0:n.frag;if(!s||this.fragContextChanged(s)||!this.levels)throw new Error("init load aborted");return n}).then(n=>{const{hls:s}=this,{frag:r,payload:o}=n,a=r.decryptdata;if(o&&o.byteLength>0&&a!=null&&a.key&&a.iv&&xi(a.method)){const c=self.performance.now();return this.decrypter.decrypt(new Uint8Array(o),a.key.buffer,a.iv.buffer,lu(a.method)).catch(l=>{throw s.trigger(A.ERROR,{type:Z.MEDIA_ERROR,details:$.FRAG_DECRYPT_ERROR,fatal:!1,error:l,reason:l.message,frag:r}),l}).then(l=>{const u=self.performance.now();return s.trigger(A.FRAG_DECRYPTED,{frag:r,payload:l,stats:{tstart:c,tdecrypt:u}}),n.payload=l,this.completeInitSegmentLoad(n)})}return this.completeInitSegmentLoad(n)}).catch(n=>{this.state===V.STOPPED||this.state===V.ERROR||(this.warn(n),this.resetFragmentLoading(e))})}completeInitSegmentLoad(e){const{levels:t}=this;if(!t)throw new Error("init load aborted, missing levels");const n=e.frag.stats;this.state!==V.STOPPED&&(this.state=V.IDLE),e.frag.data=new Uint8Array(e.payload),n.parsing.start=n.buffering.start=self.performance.now(),n.parsing.end=n.buffering.end=self.performance.now(),this.tick()}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.sn!==t.sn||e.level!==t.level}fragBufferedComplete(e,t){const n=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)} > buffer:${n?_9.toString(re.getBuffered(n)):"(detached)"})`),De(e)){var s;if(e.type!==X.SUBTITLE){const o=e.elementaryStreams;if(!Object.keys(o).some(a=>!!o[a])){this.state=V.IDLE;return}}const r=(s=this.levels)==null?void 0:s[e.level];r!=null&&r.fragmentError&&(this.log(`Resetting level fragment error count of ${r.fragmentError} on frag buffered`),r.fragmentError=0)}this.state=V.IDLE}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:n,part:s,partsLoaded:r}=e,o=!r||r.length===0||r.some(c=>!c),a=new au(n.level,n.sn,n.stats.chunkCount+1,0,s?s.index:-1,!o);t.flush(a)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,n=null,s){var r;this.fragCurrent=e;const o=t==null?void 0:t.details;if(!this.levels||!o)throw new Error(`frag load aborted, missing level${o?"":" detail"}s`);let a=null;e.encrypted&&!((r=e.decryptdata)!=null&&r.key)?(this.log(`Loading key for ${e.sn} of [${o.startSN}-${o.endSN}], ${this.playlistLabel()} ${e.level}`),this.state=V.KEY_LOADING,this.fragCurrent=e,a=this.keyLoader.load(e).then(f=>{if(!this.fragContextChanged(f.frag))return this.hls.trigger(A.KEY_LOADED,f),this.state===V.KEY_LOADING&&(this.state=V.IDLE),f}),this.hls.trigger(A.KEY_LOADING,{frag:e}),this.fragCurrent===null&&(a=Promise.reject(new Error("frag load aborted, context changed in KEY_LOADING")))):e.encrypted||(a=this.keyLoader.loadClear(e,o.encryptedFragments,this.startFragRequested),a&&this.log("[eme] blocking frag load until media-keys acquired"));const c=this.fragPrevious;if(De(e)&&(!c||e.sn!==c.sn)){const f=this.shouldLoadParts(t.details,e.end);f!==this.loadingParts&&(this.log(`LL-Part loading ${f?"ON":"OFF"} loading sn ${c==null?void 0:c.sn}->${e.sn}`),this.loadingParts=f)}if(n=Math.max(e.start,n||0),this.loadingParts&&De(e)){const f=o.partList;if(f&&s){n>e.end&&o.fragmentHint&&(e=o.fragmentHint);const d=this.getNextPart(f,e,n);if(d>-1){const h=f[d];e=this.fragCurrent=h.fragment,this.log(`Loading ${e.type} sn: ${e.sn} part: ${h.index} (${d}/${f.length-1}) of ${this.fragInfo(e,!1,h)}) cc: ${e.cc} [${o.startSN}-${o.endSN}], target: ${parseFloat(n.toFixed(3))}`),this.nextLoadPosition=h.start+h.duration,this.state=V.FRAG_LOADING;let p;return a?p=a.then(m=>!m||this.fragContextChanged(m.frag)?null:this.doFragPartsLoad(e,h,t,s)).catch(m=>this.handleFragLoadError(m)):p=this.doFragPartsLoad(e,h,t,s).catch(m=>this.handleFragLoadError(m)),this.hls.trigger(A.FRAG_LOADING,{frag:e,part:h,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):p}else if(!e.url||this.loadedEndOfParts(f,n))return Promise.resolve(null)}}if(De(e)&&this.loadingParts)this.log(`LL-Part loading OFF after next part miss @${n.toFixed(2)}`),this.loadingParts=!1;else if(!e.url)return Promise.resolve(null);this.log(`Loading ${e.type} sn: ${e.sn} of ${this.fragInfo(e,!1)}) cc: ${e.cc} ${o?"["+o.startSN+"-"+o.endSN+"]":""}, target: ${parseFloat(n.toFixed(3))}`),q(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=V.FRAG_LOADING;const l=this.config.progressive;let u;return l&&a?u=a.then(f=>!f||this.fragContextChanged(f==null?void 0:f.frag)?null:this.fragmentLoader.load(e,s)).catch(f=>this.handleFragLoadError(f)):u=Promise.all([this.fragmentLoader.load(e,l?s:void 0),a]).then(([f])=>(!l&&f&&s&&s(f),f)).catch(f=>this.handleFragLoadError(f)),this.hls.trigger(A.FRAG_LOADING,{frag:e,targetBufferTime:n}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):u}doFragPartsLoad(e,t,n,s){return new Promise((r,o)=>{var a;const c=[],l=(a=n.details)==null?void 0:a.partList,u=f=>{this.fragmentLoader.loadPart(e,f,s).then(d=>{c[f.index]=d;const h=d.part;this.hls.trigger(A.FRAG_LOADED,d);const p=nd(n.details,e.sn,f.index+1)||l1(l,e.sn,f.index+1);if(p)u(p);else return r({frag:e,part:h,partsLoaded:c})}).catch(o)};u(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;e.data&&t.details===$.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):this.hls.trigger(A.ERROR,t)}else this.hls.trigger(A.ERROR,{type:Z.OTHER_ERROR,details:$.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==V.PARSING){!this.fragCurrent&&this.state!==V.STOPPED&&this.state!==V.ERROR&&(this.state=V.IDLE);return}const{frag:n,part:s,level:r}=t,o=self.performance.now();n.stats.parsing.end=o,s&&(s.stats.parsing.end=o);const a=this.getLevelDetails(),l=a&&n.sn>a.endSN||this.shouldLoadParts(a,n.end);l!==this.loadingParts&&(this.log(`LL-Part loading ${l?"ON":"OFF"} after parsing segment ending @${n.end.toFixed(2)}`),this.loadingParts=l),this.updateLevelTiming(n,s,r,e.partial)}shouldLoadParts(e,t){if(this.config.lowLatencyMode){if(!e)return this.loadingParts;if(e!=null&&e.partList){var n;const r=e.partList[0],o=r.end+(((n=e.fragmentHint)==null?void 0:n.duration)||0);if(t>=o){var s;if((this.hls.hasEnoughToStart?((s=this.media)==null?void 0:s.currentTime)||this.lastCurrentTime:this.getLoadPosition())>r.start-r.fragment.duration)return!0}}}return!1}getCurrentContext(e){const{levels:t,fragCurrent:n}=this,{level:s,sn:r,part:o}=e;if(!(t!=null&&t[s]))return this.warn(`Levels object was unset while buffering fragment ${r} of ${this.playlistLabel()} ${s}. The current chunk will not be buffered.`),null;const a=t[s],c=a.details,l=o>-1?nd(c,r,o):null,u=l?l.fragment:a1(c,r,n);return u?(n&&n!==u&&(u.stats=n.stats),{frag:u,part:l,level:a}):null}bufferFragmentData(e,t,n,s,r){var o;if(!e||this.state!==V.PARSING)return;const{data1:a,data2:c}=e;let l=a;if(a&&c&&(l=vt(a,c)),!((o=l)!=null&&o.length))return;const u=this.initPTS[t.cc],f=u?-u.baseTime/u.timescale:void 0,d={type:e.type,frag:t,part:n,chunkMeta:s,offset:f,parent:t.type,data:l};if(this.hls.trigger(A.BUFFER_APPENDING,d),e.dropped&&e.independent&&!n){if(r)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!re.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const n=t.currentTime,s=re.bufferInfo(t,n,0),r=e.duration,o=Math.min(this.config.maxFragLookUpTolerance*2,r*.25),a=Math.max(Math.min(e.start-o,s.end-o),n+o);e.start-a>o&&this.flushMainBuffer(a,e.start)}getFwdBufferInfo(e,t){var n;const s=this.getLoadPosition();if(!q(s))return null;const o=this.lastCurrentTime>s||(n=this.media)!=null&&n.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(e,s,t,o)}getFwdBufferInfoAtPos(e,t,n,s){const r=re.bufferInfo(e,t,s);if(r.len===0&&r.nextStart!==void 0){const o=this.fragmentTracker.getBufferedFrag(t,n);if(o&&(r.nextStart<=o.end||o.gap)){const a=Math.max(Math.min(r.nextStart,o.end)-t,s);return re.bufferInfo(e,t,a)}}return r}getMaxBufferLength(e){const{config:t}=this;let n;return e?n=Math.max(8*t.maxBufferSize/e,t.maxBufferLength):n=t.maxBufferLength,Math.min(n,t.maxMaxBufferLength)}reduceMaxBufferLength(e,t){const n=this.config,s=Math.max(Math.min(e-t,n.maxBufferLength),t),r=Math.max(e-t*3,n.maxMaxBufferLength/2,s);return r>=s?(n.maxMaxBufferLength=r,this.warn(`Reduce max buffer length to ${r}s`),!0):!1}getAppendedFrag(e,t=X.MAIN){var n;const s=(n=this.fragmentTracker)==null?void 0:n.getAppendedFrag(e,t);return s&&"fragment"in s?s.fragment:s}getNextFragment(e,t){const n=t.fragments,s=n.length;if(!s)return null;const{config:r}=this,o=n[0].start,a=r.lowLatencyMode&&!!t.partList;let c=null;if(t.live){const f=r.initialLiveManifestSize;if(s<f)return this.warn(`Not enough fragments to start playback (have: ${s}, need: ${f})`),null;if(!t.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||e<o){var l;a&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),c=this.getInitialLiveFragment(t);const d=this.hls.startPosition,h=this.hls.liveSyncPosition,p=c?(d!==-1&&d>=o?d:h)||c.start:e;this.log(`Setting startPosition to ${p} to match start frag at live edge. mainStart: ${d} liveSyncPosition: ${h} frag.start: ${(l=c)==null?void 0:l.start}`),this.startPosition=this.nextLoadPosition=p}}else e<=o&&(c=n[0]);if(!c){const f=this.loadingParts?t.partEnd:t.fragmentEnd;c=this.getFragmentAtPosition(e,f,t)}let u=this.filterReplacedPrimary(c,t);if(!u&&c){const f=c.sn-t.startSN;u=this.filterReplacedPrimary(n[f+1]||null,t)}return this.mapToInitFragWhenRequired(u)}isLoopLoading(e,t){const n=this.fragmentTracker.getState(e);return(n===Be.OK||n===Be.PARTIAL&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,n,s,r){let o=null;if(e.gap&&(o=this.getNextFragment(this.nextLoadPosition,t),o&&!o.gap&&n.nextStart)){const a=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,n.nextStart,s,0);if(a!==null&&n.len+a.len>=r){const c=o.sn;return this.loopSn!==c&&(this.log(`buffer full after gaps in "${s}" playlist starting at sn: ${c}`),this.loopSn=c),null}}return this.loopSn=void 0,o}get primaryPrefetch(){if(sd(this.hls.config)){var e,t;if((e=this.hls.interstitialsManager)==null||(t=e.playingItem)==null?void 0:t.event)return!0}return!1}filterReplacedPrimary(e,t){if(!e)return e;if(sd(this.hls.config)&&e.type!==X.SUBTITLE){const n=this.hls.interstitialsManager,s=n==null?void 0:n.bufferingItem;if(s){const o=s.event;if(o){if(o.appendInPlace||Math.abs(e.start-s.start)>1||s.start===0)return null}else if(e.end<=s.start&&(t==null?void 0:t.live)===!1||e.start>s.end&&s.nextEvent&&(s.nextEvent.appendInPlace||e.start-s.end>1))return null}const r=n==null?void 0:n.playerQueue;if(r)for(let o=r.length;o--;){const a=r[o].interstitial;if(a.appendInPlace&&e.start>=a.startTime&&e.end<=a.resumeTime)return null}}return e}mapToInitFragWhenRequired(e){return e!=null&&e.initSegment&&!(e!=null&&e.initSegment.data)&&!this.bitrateTest?e.initSegment:e}getNextPart(e,t,n){let s=-1,r=!1,o=!0;for(let a=0,c=e.length;a<c;a++){const l=e[a];if(o=o&&!l.independent,s>-1&&n<l.start)break;const u=l.loaded;u?s=-1:(r||l.independent||o)&&l.fragment===t&&(s=a),r=u}return s}loadedEndOfParts(e,t){const n=e[e.length-1];return n&&t>n.start&&n.loaded}getInitialLiveFragment(e){const t=e.fragments,n=this.fragPrevious;let s=null;if(n){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${n.programDateTime}`),s=$b(t,n.endProgramDateTime,this.config.maxFragLookUpTolerance)),!s){const r=n.sn+1;if(r>=e.startSN&&r<=e.endSN){const o=t[r-e.startSN];n.cc===o.cc&&(s=o,this.log(`Live playlist, switching playlist, load frag with next SN: ${s.sn}`))}s||(s=Xm(e,n.cc,n.end),s&&this.log(`Live playlist, switching playlist, load frag with same CC: ${s.sn}`))}}else{const r=this.hls.liveSyncPosition;r!==null&&(s=this.getFragmentAtPosition(r,this.bitrateTest?e.fragmentEnd:e.edge,e))}return s}getFragmentAtPosition(e,t,n){const{config:s}=this;let{fragPrevious:r}=this,{fragments:o,endSN:a}=n;const{fragmentHint:c}=n,{maxFragLookUpTolerance:l}=s,u=n.partList,f=!!(this.loadingParts&&u!=null&&u.length&&c);f&&c&&!this.bitrateTest&&u[u.length-1].fragment.sn===c.sn&&(o=o.concat(c),a=c.sn);let d;if(e<t){var h;const m=e<this.lastCurrentTime||e>t-l||(h=this.media)!=null&&h.paused||!this.startFragRequested?0:l;d=qn(r,o,e,m)}else d=o[o.length-1];if(d){const p=d.sn-n.startSN,m=this.fragmentTracker.getState(d);if((m===Be.OK||m===Be.PARTIAL&&d.gap)&&(r=d),r&&d.sn===r.sn&&(!f||u[0].fragment.sn>d.sn||!n.live&&!f)&&r&&d.level===r.level){const y=o[p+1];d.sn<a&&this.fragmentTracker.getState(y)!==Be.OK?d=y:d=null}}return d}alignPlaylists(e,t,n){const s=e.fragments.length;if(!s)return this.warn("No fragments in live playlist"),0;const r=e.fragmentStart,o=!t,a=e.alignedSliding&&q(r);if(o||!a&&!r){b9(n,e);const c=e.fragmentStart;return this.log(`Live playlist sliding: ${c.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} fragments: ${s}`),c}return r}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,t){let n=this.startPosition;n<t&&(n=-1);const s=this.timelineOffset;if(n===-1){const r=this.startTimeOffset!==null,o=r?this.startTimeOffset:e.startTimeOffset;o!==null&&q(o)?(n=t+o,o<0&&(n+=e.edge),n=Math.min(Math.max(t,n),t+e.totalduration),this.log(`Setting startPosition to ${n} for start time offset ${o} found in ${r?"multivariant":"media"} playlist`),this.startPosition=n):e.live?(n=this.hls.liveSyncPosition||t,this.log(`Setting startPosition to -1 to start at live edge ${n}`),this.startPosition=-1):(this.log("setting startPosition to 0 by default"),this.startPosition=n=0),this.lastCurrentTime=n+s}this.nextLoadPosition=n+s}getLoadPosition(){var e;const{media:t}=this;let n=0;return(e=this.hls)!=null&&e.hasEnoughToStart&&t?n=t.currentTime:this.nextLoadPosition>=0&&(n=this.nextLoadPosition),n}handleFragLoadAborted(e,t){this.transmuxer&&e.type===this.playlistType&&De(e)&&e.stats.aborted&&(this.log(`Fragment ${e.sn}${t?" part "+t.index:""} of ${this.playlistLabel()} ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){(!this.fragCurrent||!this.fragContextChanged(e)&&this.state!==V.FRAG_LOADING_WAITING_RETRY)&&(this.state=V.IDLE)}onFragmentOrKeyLoadError(e,t){if(t.chunkMeta&&!t.frag){const p=this.getCurrentContext(t.chunkMeta);p&&(t.frag=p.frag)}const n=t.frag;if(!n||n.type!==e||!this.levels)return;if(this.fragContextChanged(n)){var s;this.warn(`Frag load error must match current frag to retry ${n.url} > ${(s=this.fragCurrent)==null?void 0:s.url}`);return}const r=t.details===$.FRAG_GAP;r&&this.fragmentTracker.fragBuffered(n,!0);const o=t.errorAction,{action:a,flags:c,retryCount:l=0,retryConfig:u}=o||{},f=!!o&&!!u,d=f&&a===ze.RetryRequest,h=f&&!o.resolved&&c===_t.MoveAllAlternatesMatchingHost;if(!d&&h&&De(n)&&!n.endList)this.resetFragmentErrors(e),this.treatAsGap(n),o.resolved=!0;else if((d||h)&&l<u.maxNumRetry){this.resetStartWhenNotLoaded(this.levelLastLoaded);const p=ru(u,l);this.warn(`Fragment ${n.sn} of ${e} ${n.level} errored with ${t.details}, retrying loading ${l+1}/${u.maxNumRetry} in ${p}ms`),o.resolved=!0,this.retryDate=self.performance.now()+p,this.state=V.FRAG_LOADING_WAITING_RETRY}else if(u&&o)if(this.resetFragmentErrors(e),l<u.maxNumRetry)!r&&a!==ze.RemoveAlternatePermanently&&(o.resolved=!0);else{this.warn(`${t.details} reached or exceeded max retry (${l})`);return}else a===ze.SendAlternateToPenaltyBox?this.state=V.WAITING_LEVEL:this.state=V.ERROR;this.tickImmediate()}reduceLengthAndFlushBuffer(e){if(this.state===V.PARSING||this.state===V.PARSED){const t=e.frag,n=e.parent,s=this.getFwdBufferInfo(this.mediaBuffer,n),r=s&&s.len>.5;r&&this.reduceMaxBufferLength(s.len,(t==null?void 0:t.duration)||10);const o=!r;return o&&this.warn(`Buffer full error while media.currentTime is not buffered, flush ${n} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),o}return!1}resetFragmentErrors(e){e===X.AUDIO&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==V.STOPPED&&(this.state=V.IDLE)}afterBufferFlushed(e,t,n){if(!e)return;const s=re.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,s,n),this.state===V.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==V.STOPPED&&(this.state=V.IDLE)}resetStartWhenNotLoaded(e){if(!this.hls.hasEnoughToStart){this.startFragRequested=!1;const t=e?e.details:null;t!=null&&t.live?(this.log("resetting startPosition for live start"),this.startPosition=-1,this.setStartPosition(t,t.fragmentStart),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.warn(`The loading context changed while buffering fragment ${e.sn} of ${this.playlistLabel()} ${e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,t,n,s){const r=n.details;if(!r){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((c,l)=>{const u=e.elementaryStreams[l];if(u){const f=u.endPTS-u.startPTS;if(f<=0)return this.warn(`Could not parse fragment ${e.sn} ${l} duration reliably (${f})`),c||!1;const d=s?0:s1(r,e,u.startPTS,u.endPTS,u.startDTS,u.endDTS);return this.hls.trigger(A.LEVEL_PTS_UPDATED,{details:r,level:n,drift:d,type:l,frag:e,start:u.startPTS,end:u.endPTS}),!0}return c},!1)){var a;if(n.fragmentError===0&&this.treatAsGap(e,n),((a=this.transmuxer)==null?void 0:a.error)===null){const c=new Error(`Found no media in fragment ${e.sn} of ${this.playlistLabel()} ${e.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(c.message),this.hls.trigger(A.ERROR,{type:Z.MEDIA_ERROR,details:$.FRAG_PARSING_ERROR,fatal:!1,error:c,frag:e,reason:`Found no media in msn ${e.sn} of ${this.playlistLabel()} "${n.url}"`}),!this.hls)return;this.resetTransmuxer()}}this.state=V.PARSED,this.log(`Parsed ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)})`),this.hls.trigger(A.FRAG_PARSED,{frag:e,part:t})}playlistLabel(){return this.playlistType===X.MAIN?"level":"track"}fragInfo(e,t=!0,n){var s,r;return`${this.playlistLabel()} ${e.level} (${n?"part":"frag"}:[${((s=t&&!n?e.startPTS:(n||e).start)!=null?s:NaN).toFixed(3)}-${((r=t&&!n?e.endPTS:(n||e).end)!=null?r:NaN).toFixed(3)}]${n&&e.type==="main"?"INDEPENDENT="+(n.independent?"YES":"NO"):""}`}treatAsGap(e,t){t&&t.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)}resetTransmuxer(){var e;(e=this.transmuxer)==null||e.reset()}recoverWorkerError(e){e.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),this.resetStartWhenNotLoaded(this.levelLastLoaded),this.resetLoadingState())}set state(e){const t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}function sd(i){return!!i.interstitialsController&&i.enableInterstitialPlayback!==!1}class d1{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let n;if(e.length)e.length===1?n=e[0]:n=I9(e,t);else return new Uint8Array(0);return this.reset(),n}reset(){this.chunks.length=0,this.dataLength=0}}function I9(i,e){const t=new Uint8Array(e);let n=0;for(let s=0;s<i.length;s++){const r=i[s];t.set(r,n),n+=r.length}return t}var Qo={exports:{}},rd;function C9(){return rd||(rd=1,function(i){var e=Object.prototype.hasOwnProperty,t="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(t=!1));function s(c,l,u){this.fn=c,this.context=l,this.once=u||!1}function r(c,l,u,f,d){if(typeof u!="function")throw new TypeError("The listener must be a function");var h=new s(u,f||c,d),p=t?t+l:l;return c._events[p]?c._events[p].fn?c._events[p]=[c._events[p],h]:c._events[p].push(h):(c._events[p]=h,c._eventsCount++),c}function o(c,l){--c._eventsCount===0?c._events=new n:delete c._events[l]}function a(){this._events=new n,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],u,f;if(this._eventsCount===0)return l;for(f in u=this._events)e.call(u,f)&&l.push(t?f.slice(1):f);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(u)):l},a.prototype.listeners=function(l){var u=t?t+l:l,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,h=f.length,p=new Array(h);d<h;d++)p[d]=f[d].fn;return p},a.prototype.listenerCount=function(l){var u=t?t+l:l,f=this._events[u];return f?f.fn?1:f.length:0},a.prototype.emit=function(l,u,f,d,h,p){var m=t?t+l:l;if(!this._events[m])return!1;var g=this._events[m],y=arguments.length,v,x;if(g.fn){switch(g.once&&this.removeListener(l,g.fn,void 0,!0),y){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,u),!0;case 3:return g.fn.call(g.context,u,f),!0;case 4:return g.fn.call(g.context,u,f,d),!0;case 5:return g.fn.call(g.context,u,f,d,h),!0;case 6:return g.fn.call(g.context,u,f,d,h,p),!0}for(x=1,v=new Array(y-1);x<y;x++)v[x-1]=arguments[x];g.fn.apply(g.context,v)}else{var E=g.length,S;for(x=0;x<E;x++)switch(g[x].once&&this.removeListener(l,g[x].fn,void 0,!0),y){case 1:g[x].fn.call(g[x].context);break;case 2:g[x].fn.call(g[x].context,u);break;case 3:g[x].fn.call(g[x].context,u,f);break;case 4:g[x].fn.call(g[x].context,u,f,d);break;default:if(!v)for(S=1,v=new Array(y-1);S<y;S++)v[S-1]=arguments[S];g[x].fn.apply(g[x].context,v)}}return!0},a.prototype.on=function(l,u,f){return r(this,l,u,f,!1)},a.prototype.once=function(l,u,f){return r(this,l,u,f,!0)},a.prototype.removeListener=function(l,u,f,d){var h=t?t+l:l;if(!this._events[h])return this;if(!u)return o(this,h),this;var p=this._events[h];if(p.fn)p.fn===u&&(!d||p.once)&&(!f||p.context===f)&&o(this,h);else{for(var m=0,g=[],y=p.length;m<y;m++)(p[m].fn!==u||d&&!p[m].once||f&&p[m].context!==f)&&g.push(p[m]);g.length?this._events[h]=g.length===1?g[0]:g:o(this,h)}return this},a.prototype.removeAllListeners=function(l){var u;return l?(u=t?t+l:l,this._events[u]&&o(this,u)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=t,a.EventEmitter=a,i.exports=a}(Qo)),Qo.exports}var L9=C9(),uu=nb(L9);const As="1.6.7",Li={};function R9(){return typeof __HLS_WORKER_BUNDLE__=="function"}function w9(){const i=Li[As];if(i)return i.clientCount++,i;const e=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),t=self.URL.createObjectURL(e),s={worker:new self.Worker(t),objectURL:t,clientCount:1};return Li[As]=s,s}function D9(i){const e=Li[i];if(e)return e.clientCount++,e;const t=new self.URL(i,self.location.href).href,s={worker:new self.Worker(t),scriptURL:t,clientCount:1};return Li[i]=s,s}function P9(i){const e=Li[i||As];if(e&&e.clientCount--===1){const{worker:n,objectURL:s}=e;delete Li[i||As],s&&self.URL.revokeObjectURL(s),n.terminate()}}function h1(i,e){return e+10<=i.length&&i[e]===51&&i[e+1]===68&&i[e+2]===73&&i[e+3]<255&&i[e+4]<255&&i[e+6]<128&&i[e+7]<128&&i[e+8]<128&&i[e+9]<128}function fu(i,e){return e+10<=i.length&&i[e]===73&&i[e+1]===68&&i[e+2]===51&&i[e+3]<255&&i[e+4]<255&&i[e+6]<128&&i[e+7]<128&&i[e+8]<128&&i[e+9]<128}function xo(i,e){let t=0;return t=(i[e]&127)<<21,t|=(i[e+1]&127)<<14,t|=(i[e+2]&127)<<7,t|=i[e+3]&127,t}function Ss(i,e){const t=e;let n=0;for(;fu(i,e);){n+=10;const s=xo(i,e+6);n+=s,h1(i,e+10)&&(n+=10),e+=n}if(n>0)return i.subarray(t,t+n)}function k9(i,e,t,n){const s=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],r=e[t+2],o=r>>2&15;if(o>12){const h=new Error(`invalid ADTS sampling index:${o}`);i.emit(A.ERROR,A.ERROR,{type:Z.MEDIA_ERROR,details:$.FRAG_PARSING_ERROR,fatal:!0,error:h,reason:h.message});return}const a=(r>>6&3)+1,c=e[t+3]>>6&3|(r&1)<<2,l="mp4a.40."+a,u=s[o];let f=o;(a===5||a===29)&&(f-=3);const d=[a<<3|(f&14)>>1,(f&1)<<7|c<<3];return pe.log(`manifest codec:${n}, parsed codec:${l}, channels:${c}, rate:${u} (ADTS object type:${a} sampling index:${o})`),{config:d,samplerate:u,channelCount:c,codec:l,parsedCodec:l,manifestCodec:n}}function p1(i,e){return i[e]===255&&(i[e+1]&246)===240}function g1(i,e){return i[e+1]&1?7:9}function du(i,e){return(i[e+3]&3)<<11|i[e+4]<<3|(i[e+5]&224)>>>5}function B9(i,e){return e+5<i.length}function Qr(i,e){return e+1<i.length&&p1(i,e)}function F9(i,e){return B9(i,e)&&p1(i,e)&&du(i,e)<=i.length-e}function O9(i,e){if(Qr(i,e)){const t=g1(i,e);if(e+t>=i.length)return!1;const n=du(i,e);if(n<=t)return!1;const s=e+n;return s===i.length||Qr(i,s)}return!1}function m1(i,e,t,n,s){if(!i.samplerate){const r=k9(e,t,n,s);if(!r)return;me(i,r)}}function x1(i){return 1024*9e4/i}function M9(i,e){const t=g1(i,e);if(e+t<=i.length){const n=du(i,e)-t;if(n>0)return{headerLength:t,frameLength:n}}}function y1(i,e,t,n,s){const r=x1(i.samplerate),o=n+s*r,a=M9(e,t);let c;if(a){const{frameLength:f,headerLength:d}=a,h=d+f,p=Math.max(0,t+h-e.length);p?(c=new Uint8Array(h-d),c.set(e.subarray(t+d,e.length),0)):c=e.subarray(t+d,t+h);const m={unit:c,pts:o};return p||i.samples.push(m),{sample:m,length:h,missing:p}}const l=e.length-t;return c=new Uint8Array(l),c.set(e.subarray(t,e.length),0),{sample:{unit:c,pts:o},length:l,missing:-1}}function N9(i,e){return fu(i,e)&&xo(i,e+6)+10<=i.length-e}function U9(i){return i instanceof ArrayBuffer?i:i.byteOffset==0&&i.byteLength==i.buffer.byteLength?i.buffer:new Uint8Array(i).buffer}function Yo(i,e=0,t=1/0){return $9(i,e,t,Uint8Array)}function $9(i,e,t,n){const s=H9(i);let r=1;"BYTES_PER_ELEMENT"in n&&(r=n.BYTES_PER_ELEMENT);const o=G9(i)?i.byteOffset:0,a=(o+i.byteLength)/r,c=(o+e)/r,l=Math.floor(Math.max(0,Math.min(c,a))),u=Math.floor(Math.min(l+Math.max(t,0),a));return new n(s,l,u-l)}function H9(i){return i instanceof ArrayBuffer?i:i.buffer}function G9(i){return i&&i.buffer instanceof ArrayBuffer&&i.byteLength!==void 0&&i.byteOffset!==void 0}function K9(i){const e={key:i.type,description:"",data:"",mimeType:null,pictureType:null},t=3;if(i.size<2)return;if(i.data[0]!==t){j.__f__("log","at node_modules/hls.js/dist/hls.mjs:10637","Ignore frame with unrecognized character encoding");return}const n=i.data.subarray(1).indexOf(0);if(n===-1)return;const s=ft(Yo(i.data,1,n)),r=i.data[2+n],o=i.data.subarray(3+n).indexOf(0);if(o===-1)return;const a=ft(Yo(i.data,3+n,o));let c;return s==="-->"?c=ft(Yo(i.data,4+n+o)):c=U9(i.data.subarray(4+n+o)),e.mimeType=s,e.pictureType=r,e.description=a,e.data=c,e}function V9(i){if(i.size<2)return;const e=ft(i.data,!0),t=new Uint8Array(i.data.subarray(e.length+1));return{key:i.type,info:e,data:t.buffer}}function j9(i){if(i.size<2)return;if(i.type==="TXXX"){let t=1;const n=ft(i.data.subarray(t),!0);t+=n.length+1;const s=ft(i.data.subarray(t));return{key:i.type,info:n,data:s}}const e=ft(i.data.subarray(1));return{key:i.type,info:"",data:e}}function q9(i){if(i.type==="WXXX"){if(i.size<2)return;let t=1;const n=ft(i.data.subarray(t),!0);t+=n.length+1;const s=ft(i.data.subarray(t));return{key:i.type,info:n,data:s}}const e=ft(i.data);return{key:i.type,info:"",data:e}}function W9(i){return i.type==="PRIV"?V9(i):i.type[0]==="W"?q9(i):i.type==="APIC"?K9(i):j9(i)}function z9(i){const e=String.fromCharCode(i[0],i[1],i[2],i[3]),t=xo(i,4),n=10;return{type:e,size:t,data:i.subarray(n,n+t)}}const Xs=10,Q9=10;function v1(i){let e=0;const t=[];for(;fu(i,e);){const n=xo(i,e+6);i[e+5]>>6&1&&(e+=Xs),e+=Xs;const s=e+n;for(;e+Q9<s;){const r=z9(i.subarray(e)),o=W9(r);o&&t.push(o),e+=r.size+Xs}h1(i,e)&&(e+=Xs)}return t}function E1(i){return i&&i.key==="PRIV"&&i.info==="com.apple.streaming.transportStreamTimestamp"}function Y9(i){if(i.data.byteLength===8){const e=new Uint8Array(i.data),t=e[3]&1;let n=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return n/=45,t&&(n+=4772185884e-2),Math.round(n)}}function hu(i){const e=v1(i);for(let t=0;t<e.length;t++){const n=e[t];if(E1(n))return Y9(n)}}let ut=function(i){return i.audioId3="org.id3",i.dateRange="com.apple.quicktime.HLS",i.emsg="https://aomedia.org/emsg/ID3",i.misbklv="urn:misb:KLV:bin:1910.1",i}({});function Pt(i="",e=9e4){return{type:i,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class pu{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(e,t,n,s){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(e){this.initPTS=e,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(e,t){return!1}appendFrame(e,t,n){}demux(e,t){this.cachedData&&(e=vt(this.cachedData,e),this.cachedData=null);let n=Ss(e,0),s=n?n.length:0,r;const o=this._audioTrack,a=this._id3Track,c=n?hu(n):void 0,l=e.length;for((this.basePTS===null||this.frameIndex===0&&q(c))&&(this.basePTS=X9(c,t,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),n&&n.length>0&&a.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:ut.audioId3,duration:Number.POSITIVE_INFINITY});s<l;){if(this.canParse(e,s)){const u=this.appendFrame(o,e,s);u?(this.frameIndex++,this.lastPTS=u.sample.pts,s+=u.length,r=s):s=l}else N9(e,s)?(n=Ss(e,s),a.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:n,type:ut.audioId3,duration:Number.POSITIVE_INFINITY}),s+=n.length,r=s):s++;if(s===l&&r!==l){const u=e.slice(r);this.cachedData?this.cachedData=vt(this.cachedData,u):this.cachedData=u}}return{audioTrack:o,videoTrack:Pt(),id3Track:a,textTrack:Pt()}}demuxSampleAes(e,t,n){return Promise.reject(new Error(`[${this}] This demuxer does not support Sample-AES decryption`))}flush(e){const t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),{audioTrack:this._audioTrack,videoTrack:Pt(),id3Track:this._id3Track,textTrack:Pt()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const X9=(i,e,t)=>{if(q(i))return i*90;const n=t?t.baseTime*9e4/t.timescale:0;return e*9e4+n};let Js=null;const J9=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],Z9=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],e_=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],t_=[0,1,1,4];function A1(i,e,t,n,s){if(t+24>e.length)return;const r=S1(e,t);if(r&&t+r.frameLength<=e.length){const o=r.samplesPerFrame*9e4/r.sampleRate,a=n+s*o,c={unit:e.subarray(t,t+r.frameLength),pts:a,dts:a};return i.config=[],i.channelCount=r.channelCount,i.samplerate=r.sampleRate,i.samples.push(c),{sample:c,length:r.frameLength,missing:0}}}function S1(i,e){const t=i[e+1]>>3&3,n=i[e+1]>>1&3,s=i[e+2]>>4&15,r=i[e+2]>>2&3;if(t!==1&&s!==0&&s!==15&&r!==3){const o=i[e+2]>>1&1,a=i[e+3]>>6,c=t===3?3-n:n===3?3:4,l=J9[c*14+s-1]*1e3,f=Z9[(t===3?0:t===2?1:2)*3+r],d=a===3?1:2,h=e_[t][n],p=t_[n],m=h*8*p,g=Math.floor(h*l/f+o)*p;if(Js===null){const x=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Js=x?parseInt(x[1]):0}return!!Js&&Js<=87&&n===2&&l>=224e3&&a===0&&(i[e+3]=i[e+3]|128),{sampleRate:f,channelCount:d,frameLength:g,samplesPerFrame:m}}}function gu(i,e){return i[e]===255&&(i[e+1]&224)===224&&(i[e+1]&6)!==0}function T1(i,e){return e+1<i.length&&gu(i,e)}function n_(i,e){return gu(i,e)&&4<=i.length-e}function b1(i,e){if(e+1<i.length&&gu(i,e)){const n=S1(i,e);let s=4;n!=null&&n.frameLength&&(s=n.frameLength);const r=e+s;return r===i.length||T1(i,r)}return!1}class i_ extends pu{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,n,s){super.resetInitSegment(e,t,n,s),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:s,inputTimeScale:9e4,dropped:0}}static probe(e,t){if(!e)return!1;const n=Ss(e,0);let s=(n==null?void 0:n.length)||0;if(b1(e,s))return!1;for(let r=e.length;s<r;s++)if(O9(e,s))return t.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return F9(e,t)}appendFrame(e,t,n){m1(e,this.observer,t,n,e.manifestCodec);const s=y1(e,t,n,this.basePTS,this.frameIndex);if(s&&s.missing===0)return s}}const _1=(i,e)=>{let t=0,n=5;e+=n;const s=new Uint32Array(1),r=new Uint32Array(1),o=new Uint8Array(1);for(;n>0;){o[0]=i[e];const a=Math.min(n,8),c=8-a;r[0]=4278190080>>>24+c<<c,s[0]=(o[0]&r[0])>>c,t=t?t<<a|s[0]:s[0],e+=1,n-=a}return t};class s_ extends pu{constructor(e){super(),this.observer=void 0,this.observer=e}resetInitSegment(e,t,n,s){super.resetInitSegment(e,t,n,s),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:t,duration:s,inputTimeScale:9e4,dropped:0}}canParse(e,t){return t+64<e.length}appendFrame(e,t,n){const s=I1(e,t,n,this.basePTS,this.frameIndex);if(s!==-1)return{sample:e.samples[e.samples.length-1],length:s,missing:0}}static probe(e){if(!e)return!1;const t=Ss(e,0);if(!t)return!1;const n=t.length;return e[n]===11&&e[n+1]===119&&hu(t)!==void 0&&_1(e,n)<16}}function I1(i,e,t,n,s){if(t+8>e.length||e[t]!==11||e[t+1]!==119)return-1;const r=e[t+4]>>6;if(r>=3)return-1;const a=[48e3,44100,32e3][r],c=e[t+4]&63,u=[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][c*3+r]*2;if(t+u>e.length)return-1;const f=e[t+6]>>5;let d=0;f===2?d+=2:(f&1&&f!==1&&(d+=2),f&4&&(d+=2));const h=(e[t+6]<<8|e[t+7])>>12-d&1,m=[2,1,2,3,3,4,4,5][f]+h,g=e[t+5]>>3,y=e[t+5]&7,v=new Uint8Array([r<<6|g<<1|y>>2,(y&3)<<6|f<<3|h<<2|c>>4,c<<4&224]),x=1536/a*9e4,E=n+s*x,S=e.subarray(t,t+u);return i.config=v,i.channelCount=m,i.samplerate=a,i.samples.push({unit:S,pts:E}),u}class r_ extends pu{resetInitSegment(e,t,n,s){super.resetInitSegment(e,t,n,s),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:s,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=Ss(e,0);let n=(t==null?void 0:t.length)||0;if(t&&e[n]===11&&e[n+1]===119&&hu(t)!==void 0&&_1(e,n)<=16)return!1;for(let s=e.length;n<s;n++)if(b1(e,n))return pe.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return n_(e,t)}appendFrame(e,t,n){if(this.basePTS!==null)return A1(e,t,n,this.basePTS,this.frameIndex)}}const o_=/\/emsg[-/]ID3/i;class a_{constructor(e,t){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=t}resetTimeStamp(){}resetInitSegment(e,t,n,s){const r=this.videoTrack=Pt("video",1),o=this.audioTrack=Pt("audio",1),a=this.txtTrack=Pt("text",1);if(this.id3Track=Pt("id3",1),this.timeOffset=0,!(e!=null&&e.byteLength))return;const c=Gm(e);if(c.video){const{id:l,timescale:u,codec:f,supplemental:d}=c.video;r.id=l,r.timescale=a.timescale=u,r.codec=f,r.supplemental=d}if(c.audio){const{id:l,timescale:u,codec:f}=c.audio;o.id=l,o.timescale=u,o.codec=f}a.id=Um.text,r.sampleDuration=0,r.duration=o.duration=s}resetContiguity(){this.remainderData=null}static probe(e){return ab(e)}demux(e,t){this.timeOffset=t;let n=e;const s=this.videoTrack,r=this.txtTrack;if(this.config.progressive){this.remainderData&&(n=vt(this.remainderData,e));const a=pb(n);this.remainderData=a.remainder,s.samples=a.valid||new Uint8Array}else s.samples=n;const o=this.extractID3Track(s,t);return r.samples=_0(t,s),{videoTrack:s,audioTrack:this.audioTrack,id3Track:o,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,n=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const s=this.extractID3Track(t,this.timeOffset);return n.samples=_0(e,t),{videoTrack:t,audioTrack:Pt(),id3Track:s,textTrack:Pt()}}extractID3Track(e,t){const n=this.id3Track;if(e.samples.length){const s=le(e.samples,["emsg"]);s&&s.forEach(r=>{const o=mb(r);if(o_.test(o.schemeIdUri)){const a=od(o,t);let c=o.eventDuration===4294967295?Number.POSITIVE_INFINITY:o.eventDuration/o.timeScale;c<=.001&&(c=Number.POSITIVE_INFINITY);const l=o.payload;n.samples.push({data:l,len:l.byteLength,dts:a,pts:a,type:ut.emsg,duration:c})}else if(this.config.enableEmsgKLVMetadata&&o.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const a=od(o,t);n.samples.push({data:o.payload,len:o.payload.byteLength,dts:a,pts:a,type:ut.misbklv,duration:Number.POSITIVE_INFINITY})}})}return n}demuxSampleAes(e,t,n){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){this.config=null,this.remainderData=null,this.videoTrack=this.audioTrack=this.id3Track=this.txtTrack=void 0}}function od(i,e){return q(i.presentationTime)?i.presentationTime/i.timeScale:e+i.presentationTimeDelta/i.timeScale}class l_{constructor(e,t,n){this.keyData=void 0,this.decrypter=void 0,this.keyData=n,this.decrypter=new ou(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,bn.cbc)}decryptAacSample(e,t,n){const s=e[t].unit;if(s.length<=16)return;const r=s.subarray(16,s.length-s.length%16),o=r.buffer.slice(r.byteOffset,r.byteOffset+r.length);this.decryptBuffer(o).then(a=>{const c=new Uint8Array(a);s.set(c,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,n)})}decryptAacSamples(e,t,n){for(;;t++){if(t>=e.length){n();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,n),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,n=new Int8Array(t);let s=0;for(let r=32;r<e.length-16;r+=160,s+=16)n.set(e.subarray(r,r+16),s);return n}getAvcDecryptedUnit(e,t){const n=new Uint8Array(t);let s=0;for(let r=32;r<e.length-16;r+=160,s+=16)e.set(n.subarray(s,s+16),r);return e}decryptAvcSample(e,t,n,s,r){const o=Km(r.data),a=this.getAvcEncryptedData(o);this.decryptBuffer(a.buffer).then(c=>{r.data=this.getAvcDecryptedUnit(o,c),this.decrypter.isSync()||this.decryptAvcSamples(e,t,n+1,s)})}decryptAvcSamples(e,t,n,s){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,n=0){if(t>=e.length){s();return}const r=e[t].units;for(;!(n>=r.length);n++){const o=r[n];if(!(o.data.length<=48||o.type!==1&&o.type!==5)&&(this.decryptAvcSample(e,t,n,s,o),!this.decrypter.isSync()))return}}}}class C1{constructor(){this.VideoSample=null}createVideoSample(e,t,n){return{key:e,frame:!1,pts:t,dts:n,units:[],length:0}}getLastNalUnit(e){var t;let n=this.VideoSample,s;if((!n||n.units.length===0)&&(n=e[e.length-1]),(t=n)!=null&&t.units){const r=n.units;s=r[r.length-1]}return s}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(e.pts===void 0){const n=t.samples,s=n.length;if(s){const r=n[s-1];e.pts=r.pts,e.dts=r.dts}else{t.dropped++;return}}t.samples.push(e)}}parseNALu(e,t,n){const s=t.byteLength;let r=e.naluState||0;const o=r,a=[];let c=0,l,u,f,d=-1,h=0;for(r===-1&&(d=0,h=this.getNALuType(t,0),r=0,c=1);c<s;){if(l=t[c++],!r){r=l?0:1;continue}if(r===1){r=l?0:2;continue}if(!l)r=3;else if(l===1){if(u=c-r-1,d>=0){const p={data:t.subarray(d,u),type:h};a.push(p)}else{const p=this.getLastNalUnit(e.samples);p&&(o&&c<=4-o&&p.state&&(p.data=p.data.subarray(0,p.data.byteLength-o)),u>0&&(p.data=vt(p.data,t.subarray(0,u)),p.state=0))}c<s?(f=this.getNALuType(t,c),d=c,h=f,r=0):r=-1}else r=0}if(d>=0&&r>=0){const p={data:t.subarray(d,s),type:h,state:r};a.push(p)}if(a.length===0){const p=this.getLastNalUnit(e.samples);p&&(p.data=vt(p.data,t))}return e.naluState=r,a}}class es{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const e=this.data,t=this.bytesAvailable,n=e.byteLength-t,s=new Uint8Array(4),r=Math.min(4,t);if(r===0)throw new Error("no bytes available");s.set(e.subarray(n,n+r)),this.word=new DataView(s.buffer).getUint32(0),this.bitsAvailable=r*8,this.bytesAvailable-=r}skipBits(e){let t;e=Math.min(e,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const n=this.word>>>32-t;if(e>32&&pe.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return t=e-t,t>0&&this.bitsAvailable?n<<t|this.readBits(t):n}skipLZ(){let e;for(e=0;e<this.bitsAvailable;++e)if(this.word&2147483648>>>e)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return this.readBits(1)===1}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}}class ad extends C1{parsePES(e,t,n,s){const r=this.parseNALu(e,n.data,s);let o=this.VideoSample,a,c=!1;n.data=null,o&&r.length&&!e.audFound&&(this.pushAccessUnit(o,e),o=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),r.forEach(l=>{var u,f;switch(l.type){case 1:{let m=!1;a=!0;const g=l.data;if(c&&g.length>4){const y=this.readSliceType(g);(y===2||y===4||y===7||y===9)&&(m=!0)}if(m){var d;(d=o)!=null&&d.frame&&!o.key&&(this.pushAccessUnit(o,e),o=this.VideoSample=null)}o||(o=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),o.frame=!0,o.key=m;break}case 5:a=!0,(u=o)!=null&&u.frame&&!o.key&&(this.pushAccessUnit(o,e),o=this.VideoSample=null),o||(o=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),o.key=!0,o.frame=!0;break;case 6:{a=!0,nu(l.data,1,n.pts,t.samples);break}case 7:{var h,p;a=!0,c=!0;const m=l.data,g=this.readSPS(m);if(!e.sps||e.width!==g.width||e.height!==g.height||((h=e.pixelRatio)==null?void 0:h[0])!==g.pixelRatio[0]||((p=e.pixelRatio)==null?void 0:p[1])!==g.pixelRatio[1]){e.width=g.width,e.height=g.height,e.pixelRatio=g.pixelRatio,e.sps=[m];const y=m.subarray(1,4);let v="avc1.";for(let x=0;x<3;x++){let E=y[x].toString(16);E.length<2&&(E="0"+E),v+=E}e.codec=v}break}case 8:a=!0,e.pps=[l.data];break;case 9:a=!0,e.audFound=!0,(f=o)!=null&&f.frame&&(this.pushAccessUnit(o,e),o=null),o||(o=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;case 12:a=!0;break;default:a=!1;break}o&&a&&o.units.push(l)}),s&&o&&(this.pushAccessUnit(o,e),this.VideoSample=null)}getNALuType(e,t){return e[t]&31}readSliceType(e){const t=new es(e);return t.readUByte(),t.readUEG(),t.readUEG()}skipScalingList(e,t){let n=8,s=8,r;for(let o=0;o<e;o++)s!==0&&(r=t.readEG(),s=(n+r+256)%256),n=s===0?n:s}readSPS(e){const t=new es(e);let n=0,s=0,r=0,o=0,a,c,l;const u=t.readUByte.bind(t),f=t.readBits.bind(t),d=t.readUEG.bind(t),h=t.readBoolean.bind(t),p=t.skipBits.bind(t),m=t.skipEG.bind(t),g=t.skipUEG.bind(t),y=this.skipScalingList.bind(this);u();const v=u();if(f(5),p(3),u(),g(),v===100||v===110||v===122||v===244||v===44||v===83||v===86||v===118||v===128){const I=d();if(I===3&&p(1),g(),g(),p(1),h())for(c=I!==3?8:12,l=0;l<c;l++)h()&&(l<6?y(16,t):y(64,t))}g();const x=d();if(x===0)d();else if(x===1)for(p(1),m(),m(),a=d(),l=0;l<a;l++)m();g(),p(1);const E=d(),S=d(),T=f(1);T===0&&p(1),p(1),h()&&(n=d(),s=d(),r=d(),o=d());let _=[1,1];if(h()&&h())switch(u()){case 1:_=[1,1];break;case 2:_=[12,11];break;case 3:_=[10,11];break;case 4:_=[16,11];break;case 5:_=[40,33];break;case 6:_=[24,11];break;case 7:_=[20,11];break;case 8:_=[32,11];break;case 9:_=[80,33];break;case 10:_=[18,11];break;case 11:_=[15,11];break;case 12:_=[64,33];break;case 13:_=[160,99];break;case 14:_=[4,3];break;case 15:_=[3,2];break;case 16:_=[2,1];break;case 255:{_=[u()<<8|u(),u()<<8|u()];break}}return{width:Math.ceil((E+1)*16-n*2-s*2),height:(2-T)*(S+1)*16-(T?2:4)*(r+o),pixelRatio:_}}}class ld extends C1{constructor(...e){super(...e),this.initVPS=null}parsePES(e,t,n,s){const r=this.parseNALu(e,n.data,s);let o=this.VideoSample,a,c=!1;n.data=null,o&&r.length&&!e.audFound&&(this.pushAccessUnit(o,e),o=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),r.forEach(l=>{var u,f;switch(l.type){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:o||(o=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts)),o.frame=!0,a=!0;break;case 16:case 17:case 18:case 21:if(a=!0,c){var d;(d=o)!=null&&d.frame&&!o.key&&(this.pushAccessUnit(o,e),o=this.VideoSample=null)}o||(o=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),o.key=!0,o.frame=!0;break;case 19:case 20:a=!0,(u=o)!=null&&u.frame&&!o.key&&(this.pushAccessUnit(o,e),o=this.VideoSample=null),o||(o=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),o.key=!0,o.frame=!0;break;case 39:a=!0,nu(l.data,2,n.pts,t.samples);break;case 32:a=!0,e.vps||(typeof e.params!="object"&&(e.params={}),e.params=me(e.params,this.readVPS(l.data)),this.initVPS=l.data),e.vps=[l.data];break;case 33:if(a=!0,c=!0,e.vps!==void 0&&e.vps[0]!==this.initVPS&&e.sps!==void 0&&!this.matchSPS(e.sps[0],l.data)&&(this.initVPS=e.vps[0],e.sps=e.pps=void 0),!e.sps){const h=this.readSPS(l.data);e.width=h.width,e.height=h.height,e.pixelRatio=h.pixelRatio,e.codec=h.codecString,e.sps=[],typeof e.params!="object"&&(e.params={});for(const p in h.params)e.params[p]=h.params[p]}this.pushParameterSet(e.sps,l.data,e.vps),o||(o=this.VideoSample=this.createVideoSample(!0,n.pts,n.dts)),o.key=!0;break;case 34:if(a=!0,typeof e.params=="object"){if(!e.pps){e.pps=[];const h=this.readPPS(l.data);for(const p in h)e.params[p]=h[p]}this.pushParameterSet(e.pps,l.data,e.vps)}break;case 35:a=!0,e.audFound=!0,(f=o)!=null&&f.frame&&(this.pushAccessUnit(o,e),o=null),o||(o=this.VideoSample=this.createVideoSample(!1,n.pts,n.dts));break;default:a=!1;break}o&&a&&o.units.push(l)}),s&&o&&(this.pushAccessUnit(o,e),this.VideoSample=null)}pushParameterSet(e,t,n){(n&&n[0]===this.initVPS||!n&&!e.length)&&e.push(t)}getNALuType(e,t){return(e[t]&126)>>>1}ebsp2rbsp(e){const t=new Uint8Array(e.byteLength);let n=0;for(let s=0;s<e.byteLength;s++)s>=2&&e[s]===3&&e[s-1]===0&&e[s-2]===0||(t[n]=e[s],n++);return new Uint8Array(t.buffer,0,n)}pushAccessUnit(e,t){super.pushAccessUnit(e,t),this.initVPS&&(this.initVPS=null)}readVPS(e){const t=new es(e);t.readUByte(),t.readUByte(),t.readBits(4),t.skipBits(2),t.readBits(6);const n=t.readBits(3),s=t.readBoolean();return{numTemporalLayers:n+1,temporalIdNested:s}}readSPS(e){const t=new es(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.readBits(4);const n=t.readBits(3);t.readBoolean();const s=t.readBits(2),r=t.readBoolean(),o=t.readBits(5),a=t.readUByte(),c=t.readUByte(),l=t.readUByte(),u=t.readUByte(),f=t.readUByte(),d=t.readUByte(),h=t.readUByte(),p=t.readUByte(),m=t.readUByte(),g=t.readUByte(),y=t.readUByte(),v=[],x=[];for(let ce=0;ce<n;ce++)v.push(t.readBoolean()),x.push(t.readBoolean());if(n>0)for(let ce=n;ce<8;ce++)t.readBits(2);for(let ce=0;ce<n;ce++)v[ce]&&(t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte()),x[ce]&&t.readUByte();t.readUEG();const E=t.readUEG();E==3&&t.skipBits(1);const S=t.readUEG(),T=t.readUEG(),_=t.readBoolean();let I=0,w=0,b=0,L=0;_&&(I+=t.readUEG(),w+=t.readUEG(),b+=t.readUEG(),L+=t.readUEG());const k=t.readUEG(),M=t.readUEG(),N=t.readUEG(),F=t.readBoolean();for(let ce=F?0:n;ce<=n;ce++)t.skipUEG(),t.skipUEG(),t.skipUEG();if(t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.readBoolean()&&t.readBoolean())for(let be=0;be<4;be++)for(let Oe=0;Oe<(be===3?2:6);Oe++)if(!t.readBoolean())t.readUEG();else{const je=Math.min(64,1<<4+(be<<1));be>1&&t.readEG();for(let Me=0;Me<je;Me++)t.readEG()}t.readBoolean(),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.skipUEG(),t.skipUEG(),t.readBoolean());const B=t.readUEG();let G=0;for(let ce=0;ce<B;ce++){let be=!1;if(ce!==0&&(be=t.readBoolean()),be){ce===B&&t.readUEG(),t.readBoolean(),t.readUEG();let Oe=0;for(let Et=0;Et<=G;Et++){const je=t.readBoolean();let Me=!1;je||(Me=t.readBoolean()),(je||Me)&&Oe++}G=Oe}else{const Oe=t.readUEG(),Et=t.readUEG();G=Oe+Et;for(let je=0;je<Oe;je++)t.readUEG(),t.readBoolean();for(let je=0;je<Et;je++)t.readUEG(),t.readBoolean()}}if(t.readBoolean()){const ce=t.readUEG();for(let be=0;be<ce;be++){for(let Oe=0;Oe<N+4;Oe++)t.readBits(1);t.readBits(1)}}let C=0,R=1,P=1,D=!0,z=1,Q=0;t.readBoolean(),t.readBoolean();let se=!1;if(t.readBoolean()){if(t.readBoolean()){const Le=t.readUByte(),At=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],Kt=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];Le>0&&Le<16?(R=At[Le-1],P=Kt[Le-1]):Le===255&&(R=t.readBits(16),P=t.readBits(16))}if(t.readBoolean()&&t.readBoolean(),t.readBoolean()&&(t.readBits(3),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.readUByte(),t.readUByte())),t.readBoolean()&&(t.readUEG(),t.readUEG()),t.readBoolean(),t.readBoolean(),t.readBoolean(),se=t.readBoolean(),se&&(I+=t.readUEG(),w+=t.readUEG(),b+=t.readUEG(),L+=t.readUEG()),t.readBoolean()&&(z=t.readBits(32),Q=t.readBits(32),t.readBoolean()&&t.readUEG(),t.readBoolean())){const Kt=t.readBoolean(),Bi=t.readBoolean();let dt=!1;(Kt||Bi)&&(dt=t.readBoolean(),dt&&(t.readUByte(),t.readBits(5),t.readBoolean(),t.readBits(5)),t.readBits(4),t.readBits(4),dt&&t.readBits(4),t.readBits(5),t.readBits(5),t.readBits(5));for(let Zt=0;Zt<=n;Zt++){D=t.readBoolean();const vo=D||t.readBoolean();let Fi=!1;vo?t.readEG():Fi=t.readBoolean();const Oi=Fi?1:t.readUEG()+1;if(Kt)for(let ht=0;ht<Oi;ht++)t.readUEG(),t.readUEG(),dt&&(t.readUEG(),t.readUEG()),t.skipBits(1);if(Bi)for(let ht=0;ht<Oi;ht++)t.readUEG(),t.readUEG(),dt&&(t.readUEG(),t.readUEG()),t.skipBits(1)}}t.readBoolean()&&(t.readBoolean(),t.readBoolean(),t.readBoolean(),C=t.readUEG())}let ge=S,de=T;if(_||se){let ce=1,be=1;E===1?ce=be=2:E==2&&(ce=2),ge=S-ce*w-ce*I,de=T-be*L-be*b}const Ie=s?["A","B","C"][s]:"",lt=a<<24|c<<16|l<<8|u;let Ce=0;for(let ce=0;ce<32;ce++)Ce=(Ce|(lt>>ce&1)<<31-ce)>>>0;let Ve=Ce.toString(16);return o===1&&Ve==="2"&&(Ve="6"),{codecString:`hvc1.${Ie}${o}.${Ve}.${r?"H":"L"}${y}.B0`,params:{general_tier_flag:r,general_profile_idc:o,general_profile_space:s,general_profile_compatibility_flags:[a,c,l,u],general_constraint_indicator_flags:[f,d,h,p,m,g],general_level_idc:y,bit_depth:k+8,bit_depth_luma_minus8:k,bit_depth_chroma_minus8:M,min_spatial_segmentation_idc:C,chroma_format_idc:E,frame_rate:{fixed:D,fps:Q/z}},width:ge,height:de,pixelRatio:[R,P]}}readPPS(e){const t=new es(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.skipUEG(),t.skipUEG(),t.skipBits(2),t.skipBits(3),t.skipBits(2),t.skipUEG(),t.skipUEG(),t.skipEG(),t.skipBits(2),t.readBoolean()&&t.skipUEG(),t.skipEG(),t.skipEG(),t.skipBits(4);const s=t.readBoolean(),r=t.readBoolean();let o=1;return r&&s?o=0:r?o=3:s&&(o=2),{parallelismType:o}}matchSPS(e,t){return String.fromCharCode.apply(null,e).substr(3)===String.fromCharCode.apply(null,t).substr(3)}}const Ne=188;class cn{constructor(e,t,n,s){this.logger=void 0,this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.logger=s,this.videoParser=null}static probe(e,t){const n=cn.syncOffset(e);return n>0&&t.warn(`MPEG2-TS detected but first sync word found @ offset ${n}`),n!==-1}static syncOffset(e){const t=e.length;let n=Math.min(Ne*5,t-Ne)+1,s=0;for(;s<n;){let r=!1,o=-1,a=0;for(let c=s;c<t;c+=Ne)if(e[c]===71&&(t-c===Ne||e[c+Ne]===71)){if(a++,o===-1&&(o=c,o!==0&&(n=Math.min(o+Ne*99,e.length-Ne)+1)),r||(r=Jl(e,c)===0),r&&a>1&&(o===0&&a>2||c+Ne>n))return o}else{if(a)return-1;break}s++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:Um[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?t:void 0}}resetInitSegment(e,t,n,s){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=cn.createTrack("video"),this._videoTrack.duration=s,this._audioTrack=cn.createTrack("audio",s),this._id3Track=cn.createTrack("id3"),this._txtTrack=cn.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=n}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:n}=this;e&&(e.pesData=null),t&&(t.pesData=null),n&&(n.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,n=!1,s=!1){n||(this.sampleAes=null);let r;const o=this._videoTrack,a=this._audioTrack,c=this._id3Track,l=this._txtTrack;let u=o.pid,f=o.pesData,d=a.pid,h=c.pid,p=a.pesData,m=c.pesData,g=null,y=this.pmtParsed,v=this._pmtId,x=e.length;if(this.remainderData&&(e=vt(this.remainderData,e),x=e.length,this.remainderData=null),x<Ne&&!s)return this.remainderData=e,{audioTrack:a,videoTrack:o,id3Track:c,textTrack:l};const E=Math.max(0,cn.syncOffset(e));x-=(x-E)%Ne,x<e.byteLength&&!s&&(this.remainderData=new Uint8Array(e.buffer,x,e.buffer.byteLength-x));let S=0;for(let _=E;_<x;_+=Ne)if(e[_]===71){const I=!!(e[_+1]&64),w=Jl(e,_),b=(e[_+3]&48)>>4;let L;if(b>1){if(L=_+5+e[_+4],L===_+Ne)continue}else L=_+4;switch(w){case u:if(I){if(f&&(r=ai(f,this.logger))){if(this.videoParser===null)switch(o.segmentCodec){case"avc":this.videoParser=new ad;break;case"hevc":this.videoParser=new ld;break}this.videoParser!==null&&this.videoParser.parsePES(o,l,r,!1)}f={data:[],size:0}}f&&(f.data.push(e.subarray(L,_+Ne)),f.size+=_+Ne-L);break;case d:if(I){if(p&&(r=ai(p,this.logger)))switch(a.segmentCodec){case"aac":this.parseAACPES(a,r);break;case"mp3":this.parseMPEGPES(a,r);break;case"ac3":this.parseAC3PES(a,r);break}p={data:[],size:0}}p&&(p.data.push(e.subarray(L,_+Ne)),p.size+=_+Ne-L);break;case h:I&&(m&&(r=ai(m,this.logger))&&this.parseID3PES(c,r),m={data:[],size:0}),m&&(m.data.push(e.subarray(L,_+Ne)),m.size+=_+Ne-L);break;case 0:I&&(L+=e[L]+1),v=this._pmtId=c_(e,L);break;case v:{I&&(L+=e[L]+1);const k=u_(e,L,this.typeSupported,n,this.observer,this.logger);u=k.videoPid,u>0&&(o.pid=u,o.segmentCodec=k.segmentVideoCodec),d=k.audioPid,d>0&&(a.pid=d,a.segmentCodec=k.segmentAudioCodec),h=k.id3Pid,h>0&&(c.pid=h),g!==null&&!y&&(this.logger.warn(`MPEG-TS PMT found at ${_} after unknown PID '${g}'. Backtracking to sync byte @${E} to parse all TS packets.`),g=null,_=E-188),y=this.pmtParsed=!0;break}case 17:case 8191:break;default:g=w;break}}else S++;S>0&&Zl(this.observer,new Error(`Found ${S} TS packet/s that do not start with 0x47`),void 0,this.logger),o.pesData=f,a.pesData=p,c.pesData=m;const T={audioTrack:a,videoTrack:o,id3Track:c,textTrack:l};return s&&this.extractRemainingSamples(T),T}flush(){const{remainderData:e}=this;this.remainderData=null;let t;return e?t=this.demux(e,-1,!1,!0):t={videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:n,id3Track:s,textTrack:r}=e,o=n.pesData,a=t.pesData,c=s.pesData;let l;if(o&&(l=ai(o,this.logger))){if(this.videoParser===null)switch(n.segmentCodec){case"avc":this.videoParser=new ad;break;case"hevc":this.videoParser=new ld;break}this.videoParser!==null&&(this.videoParser.parsePES(n,r,l,!0),n.pesData=null)}else n.pesData=o;if(a&&(l=ai(a,this.logger))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,l);break;case"mp3":this.parseMPEGPES(t,l);break;case"ac3":this.parseAC3PES(t,l);break}t.pesData=null}else a!=null&&a.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=a;c&&(l=ai(c,this.logger))?(this.parseID3PES(s,l),s.pesData=null):s.pesData=c}demuxSampleAes(e,t,n){const s=this.demux(e,n,!0,!this.config.progressive),r=this.sampleAes=new l_(this.observer,this.config,t);return this.decrypt(s,r)}decrypt(e,t){return new Promise(n=>{const{audioTrack:s,videoTrack:r}=e;s.samples&&s.segmentCodec==="aac"?t.decryptAacSamples(s.samples,0,()=>{r.samples?t.decryptAvcSamples(r.samples,0,0,()=>{n(e)}):n(e)}):r.samples&&t.decryptAvcSamples(r.samples,0,0,()=>{n(e)})})}destroy(){this.observer&&this.observer.removeAllListeners(),this.config=this.logger=this.observer=null,this.aacOverFlow=this.videoParser=this.remainderData=this.sampleAes=null,this._videoTrack=this._audioTrack=this._id3Track=this._txtTrack=void 0}parseAACPES(e,t){let n=0;const s=this.aacOverFlow;let r=t.data;if(s){this.aacOverFlow=null;const f=s.missing,d=s.sample.unit.byteLength;if(f===-1)r=vt(s.sample.unit,r);else{const h=d-f;s.sample.unit.set(r.subarray(0,f),h),e.samples.push(s.sample),n=s.missing}}let o,a;for(o=n,a=r.length;o<a-1&&!Qr(r,o);o++);if(o!==n){let f;const d=o<a-1;if(d?f=`AAC PES did not start with ADTS header,offset:${o}`:f="No ADTS header found in AAC PES",Zl(this.observer,new Error(f),d,this.logger),!d)return}m1(e,this.observer,r,o,this.audioCodec);let c;if(t.pts!==void 0)c=t.pts;else if(s){const f=x1(e.samplerate);c=s.sample.pts+f}else{this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}let l=0,u;for(;o<a;)if(u=y1(e,r,o,c,l),o+=u.length,u.missing){this.aacOverFlow=u;break}else for(l++;o<a-1&&!Qr(r,o);o++);}parseMPEGPES(e,t){const n=t.data,s=n.length;let r=0,o=0;const a=t.pts;if(a===void 0){this.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;o<s;)if(T1(n,o)){const c=A1(e,n,o,a,r);if(c)o+=c.length,r++;else break}else o++}parseAC3PES(e,t){{const n=t.data,s=t.pts;if(s===void 0){this.logger.warn("[tsdemuxer]: AC3 PES unknown PTS");return}const r=n.length;let o=0,a=0,c;for(;a<r&&(c=I1(e,n,a,s,o++))>0;)a+=c}}parseID3PES(e,t){if(t.pts===void 0){this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const n=me({},t,{type:this._videoTrack?ut.emsg:ut.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(n)}}function Jl(i,e){return((i[e+1]&31)<<8)+i[e+2]}function c_(i,e){return(i[e+10]&31)<<8|i[e+11]}function u_(i,e,t,n,s,r){const o={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},a=(i[e+1]&15)<<8|i[e+2],c=e+3+a-4,l=(i[e+10]&15)<<8|i[e+11];for(e+=12+l;e<c;){const u=Jl(i,e),f=(i[e+3]&15)<<8|i[e+4];switch(i[e]){case 207:if(!n){Xo("ADTS AAC",r);break}case 15:o.audioPid===-1&&(o.audioPid=u);break;case 21:o.id3Pid===-1&&(o.id3Pid=u);break;case 219:if(!n){Xo("H.264",r);break}case 27:o.videoPid===-1&&(o.videoPid=u);break;case 3:case 4:!t.mpeg&&!t.mp3?r.log("MPEG audio found, not supported in this browser"):o.audioPid===-1&&(o.audioPid=u,o.segmentAudioCodec="mp3");break;case 193:if(!n){Xo("AC-3",r);break}case 129:t.ac3?o.audioPid===-1&&(o.audioPid=u,o.segmentAudioCodec="ac3"):r.log("AC-3 audio found, not supported in this browser");break;case 6:if(o.audioPid===-1&&f>0){let d=e+5,h=f;for(;h>2;){switch(i[d]){case 106:t.ac3!==!0?r.log("AC-3 audio found, not supported in this browser for now"):(o.audioPid=u,o.segmentAudioCodec="ac3");break}const m=i[d+1]+2;d+=m,h-=m}}break;case 194:case 135:return Zl(s,new Error("Unsupported EC-3 in M2TS found"),void 0,r),o;case 36:o.videoPid===-1&&(o.videoPid=u,o.segmentVideoCodec="hevc",r.log("HEVC in M2TS found"));break}e+=f+5}return o}function Zl(i,e,t,n){n.warn(`parsing error: ${e.message}`),i.emit(A.ERROR,A.ERROR,{type:Z.MEDIA_ERROR,details:$.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function Xo(i,e){e.log(`${i} with AES-128-CBC encryption found in unencrypted stream`)}function ai(i,e){let t=0,n,s,r,o,a;const c=i.data;if(!i||i.size===0)return null;for(;c[0].length<19&&c.length>1;)c[0]=vt(c[0],c[1]),c.splice(1,1);if(n=c[0],(n[0]<<16)+(n[1]<<8)+n[2]===1){if(s=(n[4]<<8)+n[5],s&&s>i.size-6)return null;const u=n[7];u&192&&(o=(n[9]&14)*536870912+(n[10]&255)*4194304+(n[11]&254)*16384+(n[12]&255)*128+(n[13]&254)/2,u&64?(a=(n[14]&14)*536870912+(n[15]&255)*4194304+(n[16]&254)*16384+(n[17]&255)*128+(n[18]&254)/2,o-a>60*9e4&&(e.warn(`${Math.round((o-a)/9e4)}s delta between PTS and DTS, align them`),o=a)):a=o),r=n[8];let f=r+9;if(i.size<=f)return null;i.size-=f;const d=new Uint8Array(i.size);for(let h=0,p=c.length;h<p;h++){n=c[h];let m=n.byteLength;if(f)if(f>m){f-=m;continue}else n=n.subarray(f),m-=f,f=0;d.set(n,t),t+=m}return s&&(s-=r+3),{data:d,pts:o,dts:a,len:s}}return null}class f_{static getSilentFrame(e,t){switch(e){case"mp4a.40.2":if(t===1)return new Uint8Array([0,200,0,128,35,128]);if(t===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(t===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(t===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(t===5)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,56]);if(t===6)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,130,48,4,153,0,33,144,2,0,178,0,32,8,224]);break;default:if(t===1)return new Uint8Array([1,64,34,128,163,78,230,128,186,8,0,0,0,28,6,241,193,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(t===2)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);if(t===3)return new Uint8Array([1,64,34,128,163,94,230,128,186,8,0,0,0,0,149,0,6,241,161,10,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,90,94]);break}}}const sn=Math.pow(2,32)-1;class U{static init(){U.types={avc1:[],avcC:[],hvc1:[],hvcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],dac3:[],"ac-3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};let e;for(e in U.types)U.types.hasOwnProperty(e)&&(U.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);const t=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]),n=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]);U.HDLR_TYPES={video:t,audio:n};const s=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),r=new Uint8Array([0,0,0,0,0,0,0,0]);U.STTS=U.STSC=U.STCO=r,U.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),U.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),U.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),U.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const o=new Uint8Array([105,115,111,109]),a=new Uint8Array([97,118,99,49]),c=new Uint8Array([0,0,0,1]);U.FTYP=U.box(U.types.ftyp,o,c,o,a),U.DINF=U.box(U.types.dinf,U.box(U.types.dref,s))}static box(e,...t){let n=8,s=t.length;const r=s;for(;s--;)n+=t[s].byteLength;const o=new Uint8Array(n);for(o[0]=n>>24&255,o[1]=n>>16&255,o[2]=n>>8&255,o[3]=n&255,o.set(e,4),s=0,n=8;s<r;s++)o.set(t[s],n),n+=t[s].byteLength;return o}static hdlr(e){return U.box(U.types.hdlr,U.HDLR_TYPES[e])}static mdat(e){return U.box(U.types.mdat,e)}static mdhd(e,t){t*=e;const n=Math.floor(t/(sn+1)),s=Math.floor(t%(sn+1));return U.box(U.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,n>>24,n>>16&255,n>>8&255,n&255,s>>24,s>>16&255,s>>8&255,s&255,85,196,0,0]))}static mdia(e){return U.box(U.types.mdia,U.mdhd(e.timescale||0,e.duration||0),U.hdlr(e.type),U.minf(e))}static mfhd(e){return U.box(U.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,e&255]))}static minf(e){return e.type==="audio"?U.box(U.types.minf,U.box(U.types.smhd,U.SMHD),U.DINF,U.stbl(e)):U.box(U.types.minf,U.box(U.types.vmhd,U.VMHD),U.DINF,U.stbl(e))}static moof(e,t,n){return U.box(U.types.moof,U.mfhd(e),U.traf(n,t))}static moov(e){let t=e.length;const n=[];for(;t--;)n[t]=U.trak(e[t]);return U.box.apply(null,[U.types.moov,U.mvhd(e[0].timescale||0,e[0].duration||0)].concat(n).concat(U.mvex(e)))}static mvex(e){let t=e.length;const n=[];for(;t--;)n[t]=U.trex(e[t]);return U.box.apply(null,[U.types.mvex,...n])}static mvhd(e,t){t*=e;const n=Math.floor(t/(sn+1)),s=Math.floor(t%(sn+1)),r=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,n>>24,n>>16&255,n>>8&255,n&255,s>>24,s>>16&255,s>>8&255,s&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 U.box(U.types.mvhd,r)}static sdtp(e){const t=e.samples||[],n=new Uint8Array(4+t.length);let s,r;for(s=0;s<t.length;s++)r=t[s].flags,n[s+4]=r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy;return U.box(U.types.sdtp,n)}static stbl(e){return U.box(U.types.stbl,U.stsd(e),U.box(U.types.stts,U.STTS),U.box(U.types.stsc,U.STSC),U.box(U.types.stsz,U.STSZ),U.box(U.types.stco,U.STCO))}static avc1(e){let t=[],n=[],s,r,o;for(s=0;s<e.sps.length;s++)r=e.sps[s],o=r.byteLength,t.push(o>>>8&255),t.push(o&255),t=t.concat(Array.prototype.slice.call(r));for(s=0;s<e.pps.length;s++)r=e.pps[s],o=r.byteLength,n.push(o>>>8&255),n.push(o&255),n=n.concat(Array.prototype.slice.call(r));const a=U.box(U.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(n))),c=e.width,l=e.height,u=e.pixelRatio[0],f=e.pixelRatio[1];return U.box(U.types.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,c>>8&255,c&255,l>>8&255,l&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),a,U.box(U.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),U.box(U.types.pasp,new Uint8Array([u>>24,u>>16&255,u>>8&255,u&255,f>>24,f>>16&255,f>>8&255,f&255])))}static esds(e){const t=e.config;return new Uint8Array([0,0,0,0,3,25,0,1,0,4,17,64,21,0,0,0,0,0,0,0,0,0,0,0,5,2,...t,6,1,2])}static audioStsd(e){const t=e.samplerate||0;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount||0,0,16,0,0,0,0,t>>8&255,t&255,0,0])}static mp4a(e){return U.box(U.types.mp4a,U.audioStsd(e),U.box(U.types.esds,U.esds(e)))}static mp3(e){return U.box(U.types[".mp3"],U.audioStsd(e))}static ac3(e){return U.box(U.types["ac-3"],U.audioStsd(e),U.box(U.types.dac3,e.config))}static stsd(e){const{segmentCodec:t}=e;if(e.type==="audio"){if(t==="aac")return U.box(U.types.stsd,U.STSD,U.mp4a(e));if(t==="ac3"&&e.config)return U.box(U.types.stsd,U.STSD,U.ac3(e));if(t==="mp3"&&e.codec==="mp3")return U.box(U.types.stsd,U.STSD,U.mp3(e))}else if(e.pps&&e.sps){if(t==="avc")return U.box(U.types.stsd,U.STSD,U.avc1(e));if(t==="hevc"&&e.vps)return U.box(U.types.stsd,U.STSD,U.hvc1(e))}else throw new Error("video track missing pps or sps");throw new Error(`unsupported ${e.type} segment codec (${t}/${e.codec})`)}static tkhd(e){const t=e.id,n=(e.duration||0)*(e.timescale||0),s=e.width||0,r=e.height||0,o=Math.floor(n/(sn+1)),a=Math.floor(n%(sn+1));return U.box(U.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&255,0,0,0,0,o>>24,o>>16&255,o>>8&255,o&255,a>>24,a>>16&255,a>>8&255,a&255,0,0,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,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,s>>8&255,s&255,0,0,r>>8&255,r&255,0,0]))}static traf(e,t){const n=U.sdtp(e),s=e.id,r=Math.floor(t/(sn+1)),o=Math.floor(t%(sn+1));return U.box(U.types.traf,U.box(U.types.tfhd,new Uint8Array([0,0,0,0,s>>24,s>>16&255,s>>8&255,s&255])),U.box(U.types.tfdt,new Uint8Array([1,0,0,0,r>>24,r>>16&255,r>>8&255,r&255,o>>24,o>>16&255,o>>8&255,o&255])),U.trun(e,n.length+16+20+8+16+8+8),n)}static trak(e){return e.duration=e.duration||4294967295,U.box(U.types.trak,U.tkhd(e),U.mdia(e))}static trex(e){const t=e.id;return U.box(U.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const n=e.samples||[],s=n.length,r=12+16*s,o=new Uint8Array(r);let a,c,l,u,f,d;for(t+=8+r,o.set([e.type==="video"?1:0,0,15,1,s>>>24&255,s>>>16&255,s>>>8&255,s&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255],0),a=0;a<s;a++)c=n[a],l=c.duration,u=c.size,f=c.flags,d=c.cts,o.set([l>>>24&255,l>>>16&255,l>>>8&255,l&255,u>>>24&255,u>>>16&255,u>>>8&255,u&255,f.isLeading<<2|f.dependsOn,f.isDependedOn<<6|f.hasRedundancy<<4|f.paddingValue<<1|f.isNonSync,f.degradPrio&61440,f.degradPrio&15,d>>>24&255,d>>>16&255,d>>>8&255,d&255],12+16*a);return U.box(U.types.trun,o)}static initSegment(e){U.types||U.init();const t=U.moov(e);return vt(U.FTYP,t)}static hvc1(e){const t=e.params,n=[e.vps,e.sps,e.pps],s=4,r=new Uint8Array([1,t.general_profile_space<<6|(t.general_tier_flag?32:0)|t.general_profile_idc,t.general_profile_compatibility_flags[0],t.general_profile_compatibility_flags[1],t.general_profile_compatibility_flags[2],t.general_profile_compatibility_flags[3],t.general_constraint_indicator_flags[0],t.general_constraint_indicator_flags[1],t.general_constraint_indicator_flags[2],t.general_constraint_indicator_flags[3],t.general_constraint_indicator_flags[4],t.general_constraint_indicator_flags[5],t.general_level_idc,240|t.min_spatial_segmentation_idc>>8,255&t.min_spatial_segmentation_idc,252|t.parallelismType,252|t.chroma_format_idc,248|t.bit_depth_luma_minus8,248|t.bit_depth_chroma_minus8,0,parseInt(t.frame_rate.fps),s-1|t.temporal_id_nested<<2|t.num_temporal_layers<<3|(t.frame_rate.fixed?64:0),n.length]);let o=r.length;for(let p=0;p<n.length;p+=1){o+=3;for(let m=0;m<n[p].length;m+=1)o+=2+n[p][m].length}const a=new Uint8Array(o);a.set(r,0),o=r.length;const c=n.length-1;for(let p=0;p<n.length;p+=1){a.set(new Uint8Array([32+p|(p===c?128:0),0,n[p].length]),o),o+=3;for(let m=0;m<n[p].length;m+=1)a.set(new Uint8Array([n[p][m].length>>8,n[p][m].length&255]),o),o+=2,a.set(n[p][m],o),o+=n[p][m].length}const l=U.box(U.types.hvcC,a),u=e.width,f=e.height,d=e.pixelRatio[0],h=e.pixelRatio[1];return U.box(U.types.hvc1,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,u>>8&255,u&255,f>>8&255,f&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),l,U.box(U.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),U.box(U.types.pasp,new Uint8Array([d>>24,d>>16&255,d>>8&255,d&255,h>>24,h>>16&255,h>>8&255,h&255])))}}U.types=void 0;U.HDLR_TYPES=void 0;U.STTS=void 0;U.STSC=void 0;U.STCO=void 0;U.STSZ=void 0;U.VMHD=void 0;U.SMHD=void 0;U.STSD=void 0;U.FTYP=void 0;U.DINF=void 0;const L1=9e4;function mu(i,e,t=1,n=!1){const s=i*e*t;return n?Math.round(s):s}function d_(i,e,t=1,n=!1){return mu(i,e,1/t,n)}function Gi(i,e=!1){return mu(i,1e3,1/L1,e)}function h_(i,e=1){return mu(i,L1,1/e)}const p_=10*1e3,g_=1024,m_=1152,x_=1536;let li=null,Jo=null;function cd(i,e,t,n){return{duration:e,size:t,cts:n,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:i?2:1,isNonSync:i?0:1}}}class gr extends Rt{constructor(e,t,n,s){if(super("mp4-remuxer",s),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextVideoTs=null,this.nextAudioTs=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=t,this.typeSupported=n,this.ISGenerated=!1,li===null){const o=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);li=o?parseInt(o[1]):0}if(Jo===null){const r=navigator.userAgent.match(/Safari\/(\d+)/i);Jo=r?parseInt(r[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){this.log("initPTS & initDTS reset"),this._initPTS=this._initDTS=e}resetNextTimestamp(){this.log("reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){this.log("ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let t=!1;const n=e[0].pts,s=e.reduce((r,o)=>{let a=o.pts,c=a-r;return c<-4294967296&&(t=!0,a=mt(a,n),c=a-r),c>0?r:a},n);return t&&this.debug("PTS rollover detected"),s}remux(e,t,n,s,r,o,a,c){let l,u,f,d,h,p,m=r,g=r;const y=e.pid>-1,v=t.pid>-1,x=t.samples.length,E=e.samples.length>0,S=a&&x>0||x>1;if((!y||E)&&(!v||S)||this.ISGenerated||a){if(this.ISGenerated){var _,I,w,b;const N=this.videoTrackConfig;(N&&(t.width!==N.width||t.height!==N.height||((_=t.pixelRatio)==null?void 0:_[0])!==((I=N.pixelRatio)==null?void 0:I[0])||((w=t.pixelRatio)==null?void 0:w[1])!==((b=N.pixelRatio)==null?void 0:b[1]))||!N&&S||this.nextAudioTs===null&&E)&&this.resetInitSegment()}this.ISGenerated||(f=this.generateIS(e,t,r,o));const L=this.isVideoContiguous;let k=-1,M;if(S&&(k=y_(t.samples),!L&&this.config.forceKeyFrameOnDiscontinuity))if(p=!0,k>0){this.warn(`Dropped ${k} out of ${x} video samples due to a missing keyframe`);const N=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(k),t.dropped+=k,g+=(t.samples[0].pts-N)/t.inputTimeScale,M=g}else k===-1&&(this.warn(`No keyframe found out of ${x} video samples`),p=!1);if(this.ISGenerated){if(E&&S){const N=this.getVideoStartPts(t.samples),O=(mt(e.samples[0].pts,N)-N)/t.inputTimeScale;m+=Math.max(0,O),g+=Math.max(0,-O)}if(E){if(e.samplerate||(this.warn("regenerate InitSegment as audio detected"),f=this.generateIS(e,t,r,o)),u=this.remuxAudio(e,m,this.isAudioContiguous,o,v||S||c===X.AUDIO?g:void 0),S){const N=u?u.endPTS-u.startPTS:0;t.inputTimeScale||(this.warn("regenerate InitSegment as video detected"),f=this.generateIS(e,t,r,o)),l=this.remuxVideo(t,g,L,N)}}else S&&(l=this.remuxVideo(t,g,L,0));l&&(l.firstKeyFrame=k,l.independent=k!==-1,l.firstKeyFramePTS=M)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(n.samples.length&&(h=R1(n,r,this._initPTS,this._initDTS)),s.samples.length&&(d=w1(s,r,this._initPTS))),{audio:u,video:l,initSegment:f,independent:p,text:d,id3:h}}generateIS(e,t,n,s){const r=e.samples,o=t.samples,a=this.typeSupported,c={},l=this._initPTS;let u=!l||s,f="audio/mp4",d,h,p,m;if(u&&(d=h=1/0),e.config&&r.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":a.mpeg?(f="audio/mpeg",e.codec=""):a.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}c.audio={id:"audio",container:f,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&a.mpeg?new Uint8Array(0):U.initSegment([e]),metadata:{channelCount:e.channelCount}},u&&(m=e.id,p=e.inputTimeScale,!l||p!==l.timescale?d=h=r[0].pts-Math.round(p*n):u=!1)}if(t.sps&&t.pps&&o.length){if(t.timescale=t.inputTimeScale,c.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:U.initSegment([t]),metadata:{width:t.width,height:t.height}},u)if(m=t.id,p=t.inputTimeScale,!l||p!==l.timescale){const g=this.getVideoStartPts(o),y=Math.round(p*n);h=Math.min(h,mt(o[0].dts,g)-y),d=Math.min(d,g-y)}else u=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(c).length)return this.ISGenerated=!0,u?(this._initPTS={baseTime:d,timescale:p},this._initDTS={baseTime:h,timescale:p}):d=p=void 0,{tracks:c,initPTS:d,timescale:p,trackId:m}}remuxVideo(e,t,n,s){const r=e.inputTimeScale,o=e.samples,a=[],c=o.length,l=this._initPTS,u=l.baseTime*r/l.timescale;let f=this.nextVideoTs,d=8,h=this.videoSampleDuration,p,m,g=Number.POSITIVE_INFINITY,y=Number.NEGATIVE_INFINITY,v=!1;if(!n||f===null){const C=u+t*r,R=o[0].pts-mt(o[0].dts,o[0].pts);li&&f!==null&&Math.abs(C-R-(f+u))<15e3?n=!0:f=C-R-u}const x=f+u;for(let C=0;C<c;C++){const R=o[C];R.pts=mt(R.pts,x),R.dts=mt(R.dts,x),R.dts<o[C>0?C-1:C].dts&&(v=!0)}v&&o.sort(function(C,R){const P=C.dts-R.dts,D=C.pts-R.pts;return P||D}),p=o[0].dts,m=o[o.length-1].dts;const E=m-p,S=E?Math.round(E/(c-1)):h||e.inputTimeScale/30;if(n){const C=p-x,R=C>S,P=C<-1;if((R||P)&&(R?this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${Gi(C,!0)} ms (${C}dts) hole between fragments detected at ${t.toFixed(3)}`):this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${Gi(-C,!0)} ms (${C}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!P||x>=o[0].pts||li)){p=x;const D=o[0].pts-C;if(R)o[0].dts=p,o[0].pts=D;else{let z=!0;for(let Q=0;Q<o.length&&!(o[Q].dts>D&&z);Q++){const se=o[Q].pts;if(o[Q].dts-=C,o[Q].pts-=C,Q<o.length-1){const ee=o[Q+1].pts,ge=o[Q].pts,de=ee<=ge,Ie=ee<=se;z=de==Ie}}}this.log(`Video: Initial PTS/DTS adjusted: ${Gi(D,!0)}/${Gi(p,!0)}, delta: ${Gi(C,!0)} ms`)}}p=Math.max(0,p);let T=0,_=0,I=p;for(let C=0;C<c;C++){const R=o[C],P=R.units,D=P.length;let z=0;for(let Q=0;Q<D;Q++)z+=P[Q].data.length;_+=z,T+=D,R.length=z,R.dts<I?(R.dts=I,I+=S/4|0||1):I=R.dts,g=Math.min(R.pts,g),y=Math.max(R.pts,y)}m=o[c-1].dts;const w=_+4*T+8;let b;try{b=new Uint8Array(w)}catch(C){this.observer.emit(A.ERROR,A.ERROR,{type:Z.MUX_ERROR,details:$.REMUX_ALLOC_ERROR,fatal:!1,error:C,bytes:w,reason:`fail allocating video mdat ${w}`});return}const L=new DataView(b.buffer);L.setUint32(0,w),b.set(U.types.mdat,4);let k=!1,M=Number.POSITIVE_INFINITY,N=Number.POSITIVE_INFINITY,F=Number.NEGATIVE_INFINITY,O=Number.NEGATIVE_INFINITY;for(let C=0;C<c;C++){const R=o[C],P=R.units;let D=0;for(let se=0,ee=P.length;se<ee;se++){const ge=P[se],de=ge.data,Ie=ge.data.byteLength;L.setUint32(d,Ie),d+=4,b.set(de,d),d+=Ie,D+=4+Ie}let z;if(C<c-1)h=o[C+1].dts-R.dts,z=o[C+1].pts-R.pts;else{const se=this.config,ee=C>0?R.dts-o[C-1].dts:S;if(z=C>0?R.pts-o[C-1].pts:S,se.stretchShortVideoTrack&&this.nextAudioTs!==null){const ge=Math.floor(se.maxBufferHole*r),de=(s?g+s*r:this.nextAudioTs+u)-R.pts;de>ge?(h=de-ee,h<0?h=ee:k=!0,this.log(`It is approximately ${de/90} ms to the next segment; using duration ${h/90} ms for the last video frame.`)):h=ee}else h=ee}const Q=Math.round(R.pts-R.dts);M=Math.min(M,h),F=Math.max(F,h),N=Math.min(N,z),O=Math.max(O,z),a.push(cd(R.key,h,D,Q))}if(a.length){if(li){if(li<70){const C=a[0].flags;C.dependsOn=2,C.isNonSync=0}}else if(Jo&&O-N<F-M&&S/F<.025&&a[0].cts===0){this.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let C=p;for(let R=0,P=a.length;R<P;R++){const D=C+a[R].duration,z=C+a[R].cts;if(R<P-1){const Q=D+a[R+1].cts;a[R].duration=Q-z}else a[R].duration=R?a[R-1].duration:S;a[R].cts=0,C=D}}}h=k||!h?S:h;const K=m+h;this.nextVideoTs=f=K-u,this.videoSampleDuration=h,this.isVideoContiguous=!0;const H={data1:U.moof(e.sequenceNumber++,p,me(e,{samples:a})),data2:b,startPTS:(g-u)/r,endPTS:(y+h-u)/r,startDTS:(p-u)/r,endDTS:f/r,type:"video",hasAudio:!1,hasVideo:!0,nb:a.length,dropped:e.dropped};return e.samples=[],e.dropped=0,H}getSamplesPerFrame(e){switch(e.segmentCodec){case"mp3":return m_;case"ac3":return x_;default:return g_}}remuxAudio(e,t,n,s,r){const o=e.inputTimeScale,a=e.samplerate?e.samplerate:o,c=o/a,l=this.getSamplesPerFrame(e),u=l*c,f=this._initPTS,d=e.segmentCodec==="mp3"&&this.typeSupported.mpeg,h=[],p=r!==void 0;let m=e.samples,g=d?0:8,y=this.nextAudioTs||-1;const v=f.baseTime*o/f.timescale,x=v+t*o;if(this.isAudioContiguous=n=n||m.length&&y>0&&(s&&Math.abs(x-(y+v))<9e3||Math.abs(mt(m[0].pts,x)-(y+v))<20*u),m.forEach(function(O){O.pts=mt(O.pts,x)}),!n||y<0){if(m=m.filter(O=>O.pts>=0),!m.length)return;r===0?y=0:s&&!p?y=Math.max(0,x-v):y=m[0].pts-v}if(e.segmentCodec==="aac"){const O=this.config.maxAudioFramesDrift;for(let K=0,B=y+v;K<m.length;K++){const G=m[K],H=G.pts,C=H-B,R=Math.abs(1e3*C/o);if(C<=-O*u&&p)K===0&&(this.warn(`Audio frame @ ${(H/o).toFixed(3)}s overlaps marker by ${Math.round(1e3*C/o)} ms.`),this.nextAudioTs=y=H-v,B=H);else if(C>=O*u&&R<p_&&p){let P=Math.round(C/u);for(B=H-P*u;B<0&&P&&u;)P--,B+=u;K===0&&(this.nextAudioTs=y=B-v),this.warn(`Injecting ${P} audio frames @ ${((B-v)/o).toFixed(3)}s due to ${Math.round(1e3*C/o)} ms gap.`);for(let D=0;D<P;D++){let z=f_.getSilentFrame(e.parsedCodec||e.manifestCodec||e.codec,e.channelCount);z||(this.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),z=G.unit.subarray()),m.splice(K,0,{unit:z,pts:B}),B+=u,K++}}G.pts=B,B+=u}}let E=null,S=null,T,_=0,I=m.length;for(;I--;)_+=m[I].unit.byteLength;for(let O=0,K=m.length;O<K;O++){const B=m[O],G=B.unit;let H=B.pts;if(S!==null){const R=h[O-1];R.duration=Math.round((H-S)/c)}else if(n&&e.segmentCodec==="aac"&&(H=y+v),E=H,_>0){_+=g;try{T=new Uint8Array(_)}catch(R){this.observer.emit(A.ERROR,A.ERROR,{type:Z.MUX_ERROR,details:$.REMUX_ALLOC_ERROR,fatal:!1,error:R,bytes:_,reason:`fail allocating audio mdat ${_}`});return}d||(new DataView(T.buffer).setUint32(0,_),T.set(U.types.mdat,4))}else return;T.set(G,g);const C=G.byteLength;g+=C,h.push(cd(!0,l,C,0)),S=H}const w=h.length;if(!w)return;const b=h[h.length-1];y=S-v,this.nextAudioTs=y+c*b.duration;const L=d?new Uint8Array(0):U.moof(e.sequenceNumber++,E/c,me({},e,{samples:h}));e.samples=[];const k=(E-v)/o,M=y/o,F={data1:L,data2:T,startPTS:k,endPTS:M,startDTS:k,endDTS:M,type:"audio",hasAudio:!0,hasVideo:!1,nb:w};return this.isAudioContiguous=!0,F}}function mt(i,e){let t;if(e===null)return i;for(e<i?t=-8589934592:t=8589934592;Math.abs(i-e)>4294967296;)i+=t;return i}function y_(i){for(let e=0;e<i.length;e++)if(i[e].key)return e;return-1}function R1(i,e,t,n){const s=i.samples.length;if(!s)return;const r=i.inputTimeScale;for(let a=0;a<s;a++){const c=i.samples[a];c.pts=mt(c.pts-t.baseTime*r/t.timescale,e*r)/r,c.dts=mt(c.dts-n.baseTime*r/n.timescale,e*r)/r}const o=i.samples;return i.samples=[],{samples:o}}function w1(i,e,t){const n=i.samples.length;if(!n)return;const s=i.inputTimeScale;for(let o=0;o<n;o++){const a=i.samples[o];a.pts=mt(a.pts-t.baseTime*s/t.timescale,e*s)/s}i.samples.sort((o,a)=>o.pts-a.pts);const r=i.samples;return i.samples=[],{samples:r}}class v_ extends Rt{constructor(e,t,n,s){super("passthrough-remuxer",s),this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null,this.isVideoContiguous=!1}destroy(){}resetTimeStamp(e){this.lastEndTime=null;const t=this.initPTS;t&&e&&t.baseTime===e.baseTime&&t.timescale===e.timescale||(this.initPTS=e)}resetNextTimestamp(){this.isVideoContiguous=!1,this.lastEndTime=null}resetInitSegment(e,t,n,s){this.audioCodec=t,this.videoCodec=n,this.generateInitSegment(fb(e,s)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:n}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const s=this.initData=Gm(e);s.audio&&(t=ud(s.audio,ve.AUDIO,this)),s.video&&(n=ud(s.video,ve.VIDEO,this));const r={};s.audio&&s.video?r.audiovideo={container:"video/mp4",codec:t+","+n,supplemental:s.video.supplemental,initSegment:e,id:"main"}:s.audio?r.audio={container:"audio/mp4",codec:t,initSegment:e,id:"audio"}:s.video?r.video={container:"video/mp4",codec:n,supplemental:s.video.supplemental,initSegment:e,id:"main"}:this.warn("initSegment does not contain moov or trak boxes."),this.initTracks=r}remux(e,t,n,s,r,o){var a,c;let{initPTS:l,lastEndTime:u}=this;const f={audio:void 0,video:void 0,text:s,id3:n,initSegment:void 0};q(u)||(u=this.lastEndTime=r||0);const d=t.samples;if(!(d!=null&&d.length))return f;const h={initPTS:void 0,timescale:void 0,trackId:void 0};let p=this.initData;if((a=p)!=null&&a.length||(this.generateInitSegment(d),p=this.initData),!((c=p)!=null&&c.length))return this.warn("Failed to generate initSegment."),f;this.emitInitSegment&&(h.tracks=this.initTracks,this.emitInitSegment=!1);const m=hb(d,p,this),g=p.audio?m[p.audio.id]:null,y=p.video?m[p.video.id]:null,v=Zs(y,1/0),x=Zs(g,1/0),E=Zs(y,0,!0),S=Zs(g,0,!0);let T,_=r,I=0;if(g&&(!y||!l&&x<v||l&&l.trackId===p.audio.id)?(h.trackId=p.audio.id,T=g,I=S-x):y&&(h.trackId=p.video.id,T=y,I=E-v),T){const O=T.timescale;_=T.start/O,h.initPTS=T.start-r*O,h.timescale=O,l||(this.initPTS=l={baseTime:h.initPTS,timescale:O,trackId:h.trackId})}(o||!l)&&(E_(l,_,r,I)||h.timescale!==l.timescale)&&(h.initPTS=_-r,h.timescale=1,l&&l.timescale===1&&this.warn(`Adjusting initPTS @${r} from ${l.baseTime/l.timescale} to ${h.initPTS}`),this.initPTS=l={baseTime:h.initPTS,timescale:1});const w=e?_-l.baseTime/l.timescale:u,b=w+I;I>0?this.lastEndTime=b:(this.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const L=!!p.audio,k=!!p.video;let M="";L&&(M+="audio"),k&&(M+="video");const N={data1:d,startPTS:w,startDTS:w,endPTS:b,endDTS:b,type:M,hasAudio:L,hasVideo:k,nb:1,dropped:0};f.audio=L&&!k?N:void 0,f.video=k?N:void 0;const F=y==null?void 0:y.sampleCount;if(F){const O=y.keyFrameIndex,K=O!==-1;N.nb=F,N.dropped=O===0||this.isVideoContiguous?0:K?O:F,N.independent=K,N.firstKeyFrame=O,K&&y.keyFrameStart&&(N.firstKeyFramePTS=(y.keyFrameStart-l.baseTime)/l.timescale),this.isVideoContiguous||(f.independent=K),this.isVideoContiguous||(this.isVideoContiguous=K),N.dropped&&this.warn(`fmp4 does not start with IDR: firstIDR ${O}/${F} dropped: ${N.dropped} start: ${N.firstKeyFramePTS||"NA"}`)}return f.initSegment=h,f.id3=R1(n,r,l,l),s.samples.length&&(f.text=w1(s,r,l)),f}}function Zs(i,e,t=!1){return(i==null?void 0:i.start)!==void 0?(i.start+(t?i.duration:0))/i.timescale:e}function E_(i,e,t,n){if(i===null)return!0;const s=Math.max(n,1),r=e-i.baseTime/i.timescale;return Math.abs(r-t)>s}function ud(i,e,t){const n=i==null?void 0:i.codec;return n&&n.length>4?n:e===ve.AUDIO?n==="ec-3"||n==="ac-3"||n==="alac"?n:n==="fLaC"||n==="Opus"?Gr(n,!1):(t.warn(`Unhandled audio codec "${n}" in mp4 MAP`),n||"mp4a"):(t.warn(`Unhandled video codec "${n}" in mp4 MAP`),n||"avc1")}let zt;try{zt=self.performance.now.bind(self.performance)}catch{zt=Date.now}const mr=[{demux:a_,remux:v_},{demux:cn,remux:gr},{demux:i_,remux:gr},{demux:r_,remux:gr}];mr.splice(2,0,{demux:s_,remux:gr});class fd{constructor(e,t,n,s,r,o){this.asyncResult=!1,this.logger=void 0,this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.observer=e,this.typeSupported=t,this.config=n,this.id=r,this.logger=o}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,n,s){const r=n.transmuxing;r.executeStart=zt();let o=new Uint8Array(e);const{currentTransmuxState:a,transmuxConfig:c}=this;s&&(this.currentTransmuxState=s);const{contiguous:l,discontinuity:u,trackSwitch:f,accurateTimeOffset:d,timeOffset:h,initSegmentChange:p}=s||a,{audioCodec:m,videoCodec:g,defaultInitPts:y,duration:v,initSegmentData:x}=c,E=A_(o,t);if(E&&xi(E.method)){const I=this.getDecrypter(),w=lu(E.method);if(I.isSync()){let b=I.softwareDecrypt(o,E.key.buffer,E.iv.buffer,w);if(n.part>-1){const k=I.flush();b=k&&k.buffer}if(!b)return r.executeEnd=zt(),Zo(n);o=new Uint8Array(b)}else return this.asyncResult=!0,this.decryptionPromise=I.webCryptoDecrypt(o,E.key.buffer,E.iv.buffer,w).then(b=>{const L=this.push(b,null,n);return this.decryptionPromise=null,L}),this.decryptionPromise}const S=this.needsProbing(u,f);if(S){const I=this.configureTransmuxer(o);if(I)return this.logger.warn(`[transmuxer] ${I.message}`),this.observer.emit(A.ERROR,A.ERROR,{type:Z.MEDIA_ERROR,details:$.FRAG_PARSING_ERROR,fatal:!1,error:I,reason:I.message}),r.executeEnd=zt(),Zo(n)}(u||f||p||S)&&this.resetInitSegment(x,m,g,v,t),(u||p||S)&&this.resetInitialTimestamp(y),l||this.resetContiguity();const T=this.transmux(o,E,h,d,n);this.asyncResult=Ts(T);const _=this.currentTransmuxState;return _.contiguous=!0,_.discontinuity=!1,_.trackSwitch=!1,r.executeEnd=zt(),T}flush(e){const t=e.transmuxing;t.executeStart=zt();const{decrypter:n,currentTransmuxState:s,decryptionPromise:r}=this;if(r)return this.asyncResult=!0,r.then(()=>this.flush(e));const o=[],{timeOffset:a}=s;if(n){const f=n.flush();f&&o.push(this.push(f.buffer,null,e))}const{demuxer:c,remuxer:l}=this;if(!c||!l){t.executeEnd=zt();const f=[Zo(e)];return this.asyncResult?Promise.resolve(f):f}const u=c.flush(a);return Ts(u)?(this.asyncResult=!0,u.then(f=>(this.flushRemux(o,f,e),o))):(this.flushRemux(o,u,e),this.asyncResult?Promise.resolve(o):o)}flushRemux(e,t,n){const{audioTrack:s,videoTrack:r,id3Track:o,textTrack:a}=t,{accurateTimeOffset:c,timeOffset:l}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${n.sn}${n.part>-1?" part: "+n.part:""} of ${this.id===X.MAIN?"level":"track"} ${n.level}`);const u=this.remuxer.remux(s,r,o,a,l,c,!0,this.id);e.push({remuxResult:u,chunkMeta:n}),n.transmuxing.executeEnd=zt()}resetInitialTimestamp(e){const{demuxer:t,remuxer:n}=this;!t||!n||(t.resetTimeStamp(e),n.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;!e||!t||(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,n,s,r){const{demuxer:o,remuxer:a}=this;!o||!a||(o.resetInitSegment(e,t,n,s),a.resetInitSegment(e,t,n,r))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,n,s,r){let o;return t&&t.method==="SAMPLE-AES"?o=this.transmuxSampleAes(e,t,n,s,r):o=this.transmuxUnencrypted(e,n,s,r),o}transmuxUnencrypted(e,t,n,s){const{audioTrack:r,videoTrack:o,id3Track:a,textTrack:c}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(r,o,a,c,t,n,!1,this.id),chunkMeta:s}}transmuxSampleAes(e,t,n,s,r){return this.demuxer.demuxSampleAes(e,t,n).then(o=>({remuxResult:this.remuxer.remux(o.audioTrack,o.videoTrack,o.id3Track,o.textTrack,n,s,!1,this.id),chunkMeta:r}))}configureTransmuxer(e){const{config:t,observer:n,typeSupported:s}=this;let r;for(let f=0,d=mr.length;f<d;f++){var o;if((o=mr[f].demux)!=null&&o.probe(e,this.logger)){r=mr[f];break}}if(!r)return new Error("Failed to find demuxer by probing fragment data");const a=this.demuxer,c=this.remuxer,l=r.remux,u=r.demux;(!c||!(c instanceof l))&&(this.remuxer=new l(n,t,s,this.logger)),(!a||!(a instanceof u))&&(this.demuxer=new u(n,t,s,this.logger),this.probe=u.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new ou(this.config)),e}}function A_(i,e){let t=null;return i.byteLength>0&&(e==null?void 0:e.key)!=null&&e.iv!==null&&e.method!=null&&(t=e),t}const Zo=i=>({remuxResult:{},chunkMeta:i});function Ts(i){return"then"in i&&i.then instanceof Function}class S_{constructor(e,t,n,s,r){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=t,this.initSegmentData=n,this.duration=s,this.defaultInitPts=r||null}}class T_{constructor(e,t,n,s,r,o){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=e,this.contiguous=t,this.accurateTimeOffset=n,this.trackSwitch=s,this.timeOffset=r,this.initSegmentChange=o}}let dd=0;class D1{constructor(e,t,n,s){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=dd++,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.onWorkerMessage=c=>{const l=c.data,u=this.hls;if(!(!u||!(l!=null&&l.event)||l.instanceNo!==this.instanceNo))switch(l.event){case"init":{var f;const d=(f=this.workerContext)==null?void 0:f.objectURL;d&&self.URL.revokeObjectURL(d);break}case"transmuxComplete":{this.handleTransmuxComplete(l.data);break}case"flush":{this.onFlush(l.data);break}case"workerLog":{u.logger[l.data.logType]&&u.logger[l.data.logType](l.data.message);break}default:{l.data=l.data||{},l.data.frag=this.frag,l.data.part=this.part,l.data.id=this.id,u.trigger(l.event,l.data);break}}},this.onWorkerError=c=>{if(!this.hls)return;const l=new Error(`${c.message} (${c.filename}:${c.lineno})`);this.hls.config.enableWorker=!1,this.hls.logger.warn(`Error in "${this.id}" Web Worker, fallback to inline`),this.hls.trigger(A.ERROR,{type:Z.OTHER_ERROR,details:$.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:l})};const r=e.config;this.hls=e,this.id=t,this.useWorker=!!r.enableWorker,this.onTransmuxComplete=n,this.onFlush=s;const o=(c,l)=>{l=l||{},l.frag=this.frag||void 0,c===A.ERROR&&(l=l,l.parent=this.id,l.part=this.part,this.error=l.error),this.hls.trigger(c,l)};this.observer=new uu,this.observer.on(A.FRAG_DECRYPTED,o),this.observer.on(A.ERROR,o);const a=L0(r.preferManagedMediaSource);if(this.useWorker&&typeof Worker<"u"){const c=this.hls.logger;if(r.workerPath||R9()){try{r.workerPath?(c.log(`loading Web Worker ${r.workerPath} for "${t}"`),this.workerContext=D9(r.workerPath)):(c.log(`injecting Web Worker for "${t}"`),this.workerContext=w9());const{worker:u}=this.workerContext;u.addEventListener("message",this.onWorkerMessage),u.addEventListener("error",this.onWorkerError),u.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:a,id:t,config:Ae(r)})}catch(u){c.warn(`Error setting up "${t}" Web Worker, fallback to inline`,u),this.terminateWorker(),this.error=null,this.transmuxer=new fd(this.observer,a,r,"",t,e.logger)}return}}this.transmuxer=new fd(this.observer,a,r,"",t,e.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const e=this.instanceNo;this.instanceNo=dd++;const t=this.hls.config,n=L0(t.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:e,typeSupported:n,id:this.id,config:Ae(t)})}}terminateWorker(){if(this.workerContext){const{worker:e}=this.workerContext;this.workerContext=null,e.removeEventListener("message",this.onWorkerMessage),e.removeEventListener("error",this.onWorkerError),P9(this.hls.config.workerPath)}}destroy(){if(this.workerContext)this.terminateWorker(),this.onWorkerMessage=this.onWorkerError=null;else{const t=this.transmuxer;t&&(t.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.part=null,this.observer=null,this.hls=null}push(e,t,n,s,r,o,a,c,l,u){var f,d;l.transmuxing.start=self.performance.now();const{instanceNo:h,transmuxer:p}=this,m=o?o.start:r.start,g=r.decryptdata,y=this.frag,v=!(y&&r.cc===y.cc),x=!(y&&l.level===y.level),E=y?l.sn-y.sn:-1,S=this.part?l.part-this.part.index:-1,T=E===0&&l.id>1&&l.id===(y==null?void 0:y.stats.chunkCount),_=!x&&(E===1||E===0&&(S===1||T&&S<=0)),I=self.performance.now();(x||E||r.stats.parsing.start===0)&&(r.stats.parsing.start=I),o&&(S||!_)&&(o.stats.parsing.start=I);const w=!(y&&((f=r.initSegment)==null?void 0:f.url)===((d=y.initSegment)==null?void 0:d.url)),b=new T_(v,_,c,x,m,w);if(!_||v||w){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${r.type} sn: ${l.sn}${l.part>-1?" part: "+l.part:""} ${this.id===X.MAIN?"level":"track"}: ${l.level} id: ${l.id}
- discontinuity: ${v}
- trackSwitch: ${x}
- contiguous: ${_}
- accurateTimeOffset: ${c}
- timeOffset: ${m}
- initSegmentChange: ${w}`);const L=new S_(n,s,t,a,u);this.configureTransmuxer(L)}if(this.frag=r,this.part=o,this.workerContext)this.workerContext.worker.postMessage({instanceNo:h,cmd:"demux",data:e,decryptdata:g,chunkMeta:l,state:b},e instanceof ArrayBuffer?[e]:[]);else if(p){const L=p.push(e,g,l,b);Ts(L)?L.then(k=>{this.handleTransmuxComplete(k)}).catch(k=>{this.transmuxerError(k,l,"transmuxer-interface push error")}):this.handleTransmuxComplete(L)}}flush(e){e.transmuxing.start=self.performance.now();const{instanceNo:t,transmuxer:n}=this;if(this.workerContext)this.workerContext.worker.postMessage({instanceNo:t,cmd:"flush",chunkMeta:e});else if(n){const s=n.flush(e);Ts(s)?s.then(r=>{this.handleFlushResult(r,e)}).catch(r=>{this.transmuxerError(r,e,"transmuxer-interface flush error")}):this.handleFlushResult(s,e)}}transmuxerError(e,t,n){this.hls&&(this.error=e,this.hls.trigger(A.ERROR,{type:Z.MEDIA_ERROR,details:$.FRAG_PARSING_ERROR,chunkMeta:t,frag:this.frag||void 0,part:this.part||void 0,fatal:!1,error:e,err:e,reason:n}))}handleFlushResult(e,t){e.forEach(n=>{this.handleTransmuxComplete(n)}),this.onFlush(t)}configureTransmuxer(e){const{instanceNo:t,transmuxer:n}=this;this.workerContext?this.workerContext.worker.postMessage({instanceNo:t,cmd:"configure",config:e}):n&&n.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}const hd=100;class b_ extends cu{constructor(e,t,n){super(e,t,n,"audio-stream-controller",X.AUDIO),this.mainAnchor=null,this.mainFragLoading=null,this.audioOnly=!1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.flushing=!1,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.resetItem()}resetItem(){this.mainDetails=this.mainAnchor=this.mainFragLoading=this.bufferedTrack=this.switchingTrack=this.waitingData=this.cachedTrackLoadedData=null}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(A.LEVEL_LOADED,this.onLevelLoaded,this),e.on(A.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(A.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(A.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(A.BUFFER_RESET,this.onBufferReset,this),e.on(A.BUFFER_CREATED,this.onBufferCreated,this),e.on(A.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(A.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(A.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(A.FRAG_LOADING,this.onFragLoading,this),e.on(A.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){const{hls:e}=this;e&&(super.unregisterListeners(),e.off(A.LEVEL_LOADED,this.onLevelLoaded,this),e.off(A.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(A.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(A.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(A.BUFFER_RESET,this.onBufferReset,this),e.off(A.BUFFER_CREATED,this.onBufferCreated,this),e.off(A.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(A.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(A.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(A.FRAG_LOADING,this.onFragLoading,this),e.off(A.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(e,{frag:t,id:n,initPTS:s,timescale:r}){if(n===X.MAIN){const o=t.cc,a=this.fragCurrent;if(this.initPTS[o]={baseTime:s,timescale:r},this.log(`InitPTS for cc: ${o} found from main: ${s}/${r}`),this.mainAnchor=t,this.state===V.WAITING_INIT_PTS){const c=this.waitingData;(!c&&!this.loadingParts||c&&c.frag.cc!==o)&&this.syncWithAnchor(t,c==null?void 0:c.frag)}else!this.hls.hasEnoughToStart&&a&&a.cc!==o?(a.abortRequests(),this.syncWithAnchor(t,a)):this.state===V.IDLE&&this.tick()}}getLoadPosition(){return!this.startFragRequested&&this.nextLoadPosition>=0?this.nextLoadPosition:super.getLoadPosition()}syncWithAnchor(e,t){var n;const s=((n=this.mainFragLoading)==null?void 0:n.frag)||null;if(t&&(s==null?void 0:s.cc)===t.cc)return;const r=(s||e).cc,o=this.getLevelDetails(),a=this.getLoadPosition(),c=Xm(o,r,a);c&&(this.log(`Syncing with main frag at ${c.start} cc ${c.cc}`),this.startFragRequested=!1,this.nextLoadPosition=c.start,this.resetLoadingState(),this.state===V.IDLE&&this.doTickIdle())}startLoad(e,t){if(!this.levels){this.startPosition=e,this.state=V.STOPPED;return}const n=this.lastCurrentTime;this.stopLoad(),this.setInterval(hd),n>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n,this.state=V.IDLE):this.state=V.WAITING_TRACK,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}doTick(){switch(this.state){case V.IDLE:this.doTickIdle();break;case V.WAITING_TRACK:{const{levels:t,trackId:n}=this,s=t==null?void 0:t[n],r=s==null?void 0:s.details;if(r&&!this.waitForLive(s)){if(this.waitForCdnTuneIn(r))break;this.state=V.WAITING_INIT_PTS}break}case V.FRAG_LOADING_WAITING_RETRY:{var e;const t=performance.now(),n=this.retryDate;if(!n||t>=n||(e=this.media)!=null&&e.seeking){const{levels:s,trackId:r}=this;this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded((s==null?void 0:s[r])||null),this.state=V.IDLE}break}case V.WAITING_INIT_PTS:{const t=this.waitingData;if(t){const{frag:n,part:s,cache:r,complete:o}=t,a=this.mainAnchor;if(this.initPTS[n.cc]!==void 0){this.waitingData=null,this.state=V.FRAG_LOADING;const c=r.flush().buffer,l={frag:n,part:s,payload:c,networkDetails:null};this._handleFragmentLoadProgress(l),o&&super._handleFragmentLoadComplete(l)}else a&&a.cc!==t.frag.cc&&this.syncWithAnchor(a,t.frag)}else this.state=V.IDLE}}this.onTickEnd()}resetLoadingState(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){var e;const{hls:t,levels:n,media:s,trackId:r}=this,o=t.config;if(!this.buffering||!s&&!this.primaryPrefetch&&(this.startFragRequested||!o.startFragPrefetch)||!(n!=null&&n[r]))return;const a=n[r],c=a.details;if(!c||this.waitForLive(a)||this.waitForCdnTuneIn(c)){this.state=V.WAITING_TRACK,this.startFragRequested=!1;return}const l=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&l&&(this.bufferFlushed=!1,this.afterBufferFlushed(l,ve.AUDIO,X.AUDIO));const u=this.getFwdBufferInfo(l,X.AUDIO);if(u===null)return;if(!this.switchingTrack&&this._streamEnded(u,c)){t.trigger(A.BUFFER_EOS,{type:"audio"}),this.state=V.ENDED;return}const f=u.len,d=t.maxBufferLength,h=c.fragments,p=h[0].start,m=this.getLoadPosition(),g=this.flushing?m:u.end;if(this.switchingTrack&&s){const x=m;c.PTSKnown&&x<p&&(u.end>p||u.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),s.currentTime=p+.05)}if(f>=d&&!this.switchingTrack&&g<h[h.length-1].start)return;let y=this.getNextFragment(g,c);if(y&&this.isLoopLoading(y,g)&&(y=this.getNextFragmentLoopLoading(y,c,u,X.MAIN,d)),!y){this.bufferFlushed=!0;return}let v=((e=this.mainFragLoading)==null?void 0:e.frag)||null;if(!this.audioOnly&&this.startFragRequested&&v&&De(y)&&!y.endList&&(!c.live||!this.loadingParts&&g<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(v)===Be.OK&&(this.mainFragLoading=v=null),v&&De(v))){if(y.start>v.end){const E=this.fragmentTracker.getFragAtPos(g,X.MAIN);E&&E.end>v.end&&(v=E,this.mainFragLoading={frag:E,targetBufferTime:null})}if(y.start>v.end)return}this.loadFragment(y,a,g)}onMediaDetaching(e,t){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(e,t)}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map(n=>new vs(n))}onAudioTrackSwitching(e,t){const n=!!t.url;this.trackId=t.id;const{fragCurrent:s}=this;s&&(s.abortRequests(),this.removeUnbufferedFrags(s.start)),this.resetLoadingState(),n?(this.switchingTrack=t,this.flushAudioIfNeeded(t),this.state!==V.STOPPED&&(this.setInterval(hd),this.state=V.IDLE,this.tick())):(this.resetTransmuxer(),this.switchingTrack=null,this.bufferedTrack=t,this.clearInterval())}onManifestLoading(){super.onManifestLoading(),this.bufferFlushed=this.flushing=this.audioOnly=!1,this.resetItem(),this.trackId=-1}onLevelLoaded(e,t){this.mainDetails=t.details;const n=this.cachedTrackLoadedData;n&&(this.cachedTrackLoadedData=null,this.onAudioTrackLoaded(A.AUDIO_TRACK_LOADED,n))}onAudioTrackLoaded(e,t){var n;const{levels:s}=this,{details:r,id:o,groupId:a,track:c}=t;if(!s){this.warn(`Audio tracks reset while loading track ${o} "${c.name}" of "${a}"`);return}const l=this.mainDetails;if(!l||r.endCC>l.endCC||l.expired){this.cachedTrackLoadedData=t,this.state!==V.STOPPED&&(this.state=V.WAITING_TRACK);return}this.cachedTrackLoadedData=null,this.log(`Audio track ${o} "${c.name}" of "${a}" loaded [${r.startSN},${r.endSN}]${r.lastPartSn?`[part-${r.lastPartSn}-${r.lastPartIndex}]`:""},duration:${r.totalduration}`);const u=s[o];let f=0;if(r.live||(n=u.details)!=null&&n.live){if(this.checkLiveUpdate(r),r.deltaUpdateFailed)return;if(u.details){var d;f=this.alignPlaylists(r,u.details,(d=this.levelLastLoaded)==null?void 0:d.details)}r.alignedSliding||(f1(r,l),r.alignedSliding||zr(r,l),f=r.fragmentStart)}u.details=r,this.levelLastLoaded=u,this.startFragRequested||this.setStartPosition(l,f),this.hls.trigger(A.AUDIO_TRACK_UPDATED,{details:r,id:o,groupId:t.groupId}),this.state===V.WAITING_TRACK&&!this.waitForCdnTuneIn(r)&&(this.state=V.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const n=e.frag,{part:s,payload:r}=e,{config:o,trackId:a,levels:c}=this;if(!c){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);return}const l=c[a];if(!l){this.warn("Audio track is undefined on fragment load progress");return}const u=l.details;if(!u){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(n.start);return}const f=o.defaultAudioCodec||l.audioCodec||"mp4a.40.2";let d=this.transmuxer;d||(d=this.transmuxer=new D1(this.hls,X.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const h=this.initPTS[n.cc],p=(t=n.initSegment)==null?void 0:t.data;if(h!==void 0){const g=s?s.index:-1,y=g!==-1,v=new au(n.level,n.sn,n.stats.chunkCount,r.byteLength,g,y);d.push(r,p,f,"",n,s,u.totalduration,!1,v,h)}else{this.log(`Unknown video PTS for cc ${n.cc}, waiting for video PTS before demuxing audio frag ${n.sn} of [${u.startSN} ,${u.endSN}],track ${a}`);const{cache:m}=this.waitingData=this.waitingData||{frag:n,part:s,cache:new d1,complete:!1};m.push(new Uint8Array(r)),this.state!==V.STOPPED&&(this.state=V.WAITING_INIT_PTS)}}_handleFragmentLoadComplete(e){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=null}onBufferCreated(e,t){this.bufferFlushed=this.flushing=!1;const n=t.tracks.audio;n&&(this.mediaBuffer=n.buffer||null)}onFragLoading(e,t){!this.audioOnly&&t.frag.type===X.MAIN&&De(t.frag)&&(this.mainFragLoading=t,this.state===V.IDLE&&this.tick())}onFragBuffered(e,t){const{frag:n,part:s}=t;if(n.type!==X.AUDIO){!this.audioOnly&&n.type===X.MAIN&&!n.elementaryStreams.video&&!n.elementaryStreams.audiovideo&&(this.audioOnly=!0,this.mainFragLoading=null);return}if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${s?" p: "+s.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(De(n)){this.fragPrevious=n;const r=this.switchingTrack;r&&(this.bufferedTrack=r,this.switchingTrack=null,this.hls.trigger(A.AUDIO_TRACK_SWITCHED,ye({},r)))}this.fragBufferedComplete(n,s),this.media&&this.tick()}onError(e,t){var n;if(t.fatal){this.state=V.ERROR;return}switch(t.details){case $.FRAG_GAP:case $.FRAG_PARSING_ERROR:case $.FRAG_DECRYPT_ERROR:case $.FRAG_LOAD_ERROR:case $.FRAG_LOAD_TIMEOUT:case $.KEY_LOAD_ERROR:case $.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(X.AUDIO,t);break;case $.AUDIO_TRACK_LOAD_ERROR:case $.AUDIO_TRACK_LOAD_TIMEOUT:case $.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===V.WAITING_TRACK&&((n=t.context)==null?void 0:n.type)===ue.AUDIO_TRACK&&(this.state=V.IDLE);break;case $.BUFFER_ADD_CODEC_ERROR:case $.BUFFER_APPEND_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)||this.resetLoadingState();break;case $.BUFFER_FULL_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case $.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==ve.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==ve.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===V.ENDED&&(this.state=V.IDLE);const n=this.mediaBuffer||this.media;n&&(this.afterBufferFlushed(n,t,X.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const n="audio",{hls:s}=this,{remuxResult:r,chunkMeta:o}=e,a=this.getCurrentContext(o);if(!a){this.resetWhenMissingContext(o);return}const{frag:c,part:l,level:u}=a,{details:f}=u,{audio:d,text:h,id3:p,initSegment:m}=r;if(this.fragContextChanged(c)||!f){this.fragmentTracker.removeFragment(c);return}if(this.state=V.PARSING,this.switchingTrack&&d&&this.completeAudioSwitch(this.switchingTrack),m!=null&&m.tracks){const g=c.initSegment||c;this._bufferInitSegment(u,m.tracks,g,o),s.trigger(A.FRAG_PARSING_INIT_SEGMENT,{frag:g,id:n,tracks:m.tracks})}if(d){const{startPTS:g,endPTS:y,startDTS:v,endDTS:x}=d;l&&(l.elementaryStreams[ve.AUDIO]={startPTS:g,endPTS:y,startDTS:v,endDTS:x}),c.setElementaryStreamInfo(ve.AUDIO,g,y,v,x),this.bufferFragmentData(d,c,l,o)}if(p!=null&&(t=p.samples)!=null&&t.length){const g=me({id:n,frag:c,details:f},p);s.trigger(A.FRAG_PARSING_METADATA,g)}if(h){const g=me({id:n,frag:c,details:f},h);s.trigger(A.FRAG_PARSING_USERDATA,g)}}_bufferInitSegment(e,t,n,s){if(this.state!==V.PARSING||(t.video&&delete t.video,t.audiovideo&&delete t.audiovideo,!t.audio))return;const r=t.audio;r.id=X.AUDIO;const o=e.audioCodec;this.log(`Init audio buffer, container:${r.container}, codecs[level/parsed]=[${o}/${r.codec}]`),o&&o.split(",").length===1&&(r.levelCodec=o),this.hls.trigger(A.BUFFER_CODECS,t);const a=r.initSegment;if(a!=null&&a.byteLength){const c={type:"audio",frag:n,part:null,chunkMeta:s,parent:n.type,data:a};this.hls.trigger(A.BUFFER_APPENDING,c)}this.tickImmediate()}loadFragment(e,t,n){const s=this.fragmentTracker.getState(e);if(this.switchingTrack||s===Be.NOT_LOADED||s===Be.PARTIAL){var r;if(!De(e))this._loadInitSegment(e,t);else if((r=t.details)!=null&&r.live&&!this.initPTS[e.cc]){this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=V.WAITING_INIT_PTS;const o=this.mainDetails;o&&o.fragmentStart!==t.details.fragmentStart&&zr(t.details,o)}else super.loadFragment(e,t,n)}else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){if(this.media&&this.bufferedTrack){const{name:t,lang:n,assocLang:s,characteristics:r,audioCodec:o,channels:a}=this.bufferedTrack;$n({name:t,lang:n,assocLang:s,characteristics:r,audioCodec:o,channels:a},e,Rn)||(Vr(e.url,this.hls)?(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null):this.bufferedTrack=e)}}completeAudioSwitch(e){const{hls:t}=this;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(A.AUDIO_TRACK_SWITCHED,ye({},e))}}class xu extends Rt{constructor(e,t){super(t,e.logger),this.hls=void 0,this.canLoad=!1,this.timer=-1,this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){this.timer!==-1&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,t,n){const s=t==null?void 0:t.renditionReports;if(s){let r=-1;for(let o=0;o<s.length;o++){const a=s[o];let c;try{c=new self.URL(a.URI,t.url).href}catch(l){this.warn(`Could not construct new URL for Rendition Report: ${l}`),c=a.URI||""}if(c===e){r=o;break}else c===e.substring(0,c.length)&&(r=o)}if(r!==-1){const o=s[r],a=parseInt(o["LAST-MSN"])||(t==null?void 0:t.lastPartSn);let c=parseInt(o["LAST-PART"])||(t==null?void 0:t.lastPartIndex);if(this.hls.config.lowLatencyMode){const u=Math.min(t.age-t.partTarget,t.targetduration);c>=0&&u>t.partTarget&&(c+=1)}const l=n&&R0(n);return new w0(a,c>=0?c:void 0,l)}}}loadPlaylist(e){this.clearTimer()}loadingPlaylist(e,t){this.clearTimer()}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}getUrlWithDirectives(e,t){if(t)try{return t.addDirectives(e)}catch(n){this.warn(`Could not construct new URL with HLS Delivery Directives: ${n}`)}return e}playlistLoaded(e,t,n){const{details:s,stats:r}=t,o=self.performance.now(),a=r.loading.first?Math.max(0,o-r.loading.first):0;s.advancedDateTime=Date.now()-a;const c=this.hls.config.timelineOffset;if(c!==s.appliedTimelineOffset){const u=Math.max(c||0,0);s.appliedTimelineOffset=u,s.fragments.forEach(f=>{f.start=f.playlistOffset+u})}if(s.live||n!=null&&n.live){const u="levelInfo"in t?t.levelInfo:t.track;if(s.reloaded(n),n&&s.fragments.length>0){v9(n,s);const v=s.playlistParsingError;if(v){this.warn(v);const x=this.hls;if(!x.config.ignorePlaylistParsingErrors){var l;const{networkDetails:E}=t;x.trigger(A.ERROR,{type:Z.NETWORK_ERROR,details:$.LEVEL_PARSING_ERROR,fatal:!1,url:s.url,error:v,reason:v.message,level:t.level||void 0,parent:(l=s.fragments[0])==null?void 0:l.type,networkDetails:E,stats:r});return}s.playlistParsingError=null}}s.requestScheduled===-1&&(s.requestScheduled=r.loading.start);const f=this.hls.mainForwardBufferInfo,d=f?f.end-f.len:0,h=(s.edge-d)*1e3,p=o1(s,h);if(s.requestScheduled+p<o?s.requestScheduled=o:s.requestScheduled+=p,this.log(`live playlist ${e} ${s.advanced?"REFRESHED "+s.lastPartSn+"-"+s.lastPartIndex:s.updated?"UPDATED":"MISSED"}`),!this.canLoad||!s.live)return;let m,g,y;if(s.canBlockReload&&s.endSN&&s.advanced){const v=this.hls.config.lowLatencyMode,x=s.lastPartSn,E=s.endSN,S=s.lastPartIndex,T=S!==-1,_=x===E;T?_?(g=E+1,y=v?0:S):(g=x,y=v?S+1:s.maxPartIndex):g=E+1;const I=s.age,w=I+s.ageHeader;let b=Math.min(w-s.partTarget,s.targetduration*1.5);if(b>0){if(w>s.targetduration*3)this.log(`Playlist last advanced ${I.toFixed(2)}s ago. Omitting segment and part directives.`),g=void 0,y=void 0;else if(n!=null&&n.tuneInGoal&&w-s.partTarget>n.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${n.tuneInGoal} to: ${b} with playlist age: ${s.age}`),b=0;else{const L=Math.floor(b/s.targetduration);if(g+=L,y!==void 0){const k=Math.round(b%s.targetduration/s.partTarget);y+=k}this.log(`CDN Tune-in age: ${s.ageHeader}s last advanced ${I.toFixed(2)}s goal: ${b} skip sn ${L} to part ${y}`)}s.tuneInGoal=b}if(m=this.getDeliveryDirectives(s,t.deliveryDirectives,g,y),v||!_){s.requestScheduled=o,this.loadingPlaylist(u,m);return}}else(s.canBlockReload||s.canSkipUntil)&&(m=this.getDeliveryDirectives(s,t.deliveryDirectives,g,y));m&&g!==void 0&&s.canBlockReload&&(s.requestScheduled=r.loading.first+Math.max(p-a*2,p/2)),this.scheduleLoading(u,m,s)}else this.clearTimer()}scheduleLoading(e,t,n){const s=n||e.details;if(!s){this.loadingPlaylist(e,t);return}const r=self.performance.now(),o=s.requestScheduled;if(r>=o){this.loadingPlaylist(e,t);return}const a=o-r;this.log(`reload live playlist ${e.name||e.bitrate+"bps"} in ${Math.round(a)} ms`),this.clearTimer(),this.timer=self.setTimeout(()=>this.loadingPlaylist(e,t),a)}getDeliveryDirectives(e,t,n,s){let r=R0(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(n=t.msn,s=t.part,r=hr.No),new w0(n,s,r)}checkRetry(e){const t=e.details,n=jr(e),s=e.errorAction,{action:r,retryCount:o=0,retryConfig:a}=s||{},c=!!s&&!!a&&(r===ze.RetryRequest||!s.resolved&&r===ze.SendAlternateToPenaltyBox);if(c){var l;if(o>=a.maxNumRetry)return!1;if(n&&(l=e.context)!=null&&l.deliveryDirectives)this.warn(`Retrying playlist loading ${o+1}/${a.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const u=ru(a,o);this.clearTimer(),this.timer=self.setTimeout(()=>this.loadPlaylist(),u),this.warn(`Retrying playlist loading ${o+1}/${a.maxNumRetry} after "${t}" in ${u}ms`)}e.levelRetry=!0,s.resolved=!0}return c}}function P1(i,e){if(i.length!==e.length)return!1;for(let t=0;t<i.length;t++)if(!bs(i[t].attrs,e[t].attrs))return!1;return!0}function bs(i,e,t){const n=i["STABLE-RENDITION-ID"];return n&&!t?n===e["STABLE-RENDITION-ID"]:!(t||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some(s=>i[s]!==e[s])}function ec(i,e){return e.label.toLowerCase()===i.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(i.lang||"").toLowerCase())}class __ extends xu{constructor(e){super(e,"audio-track-controller"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(A.MANIFEST_LOADING,this.onManifestLoading,this),e.on(A.MANIFEST_PARSED,this.onManifestParsed,this),e.on(A.LEVEL_LOADING,this.onLevelLoading,this),e.on(A.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(A.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(A.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(A.MANIFEST_LOADING,this.onManifestLoading,this),e.off(A.MANIFEST_PARSED,this.onManifestParsed,this),e.off(A.LEVEL_LOADING,this.onLevelLoading,this),e.off(A.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(A.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(A.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:n,groupId:s,details:r}=t,o=this.tracksInGroup[n];if(!o||o.groupId!==s){this.warn(`Audio track with id:${n} and group:${s} not found in active group ${o==null?void 0:o.groupId}`);return}const a=o.details;o.details=t.details,this.log(`Audio track ${n} "${o.name}" lang:${o.lang} group:${s} loaded [${r.startSN}-${r.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,a)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.audioGroups||null,s=this.groupIds;let r=this.currentTrack;if(!n||(s==null?void 0:s.length)!==(n==null?void 0:n.length)||n!=null&&n.some(a=>(s==null?void 0:s.indexOf(a))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const a=this.tracks.filter(d=>!n||n.indexOf(d.groupId)!==-1);if(a.length)this.selectDefaultTrack&&!a.some(d=>d.default)&&(this.selectDefaultTrack=!1),a.forEach((d,h)=>{d.id=h});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=a;const c=this.hls.config.audioPreference;if(!r&&c){const d=Mt(c,a,Rn);if(d>-1)r=a[d];else{const h=Mt(c,this.tracks);r=this.tracks[h]}}let l=this.findTrackId(r);l===-1&&r&&(l=this.findTrackId(null));const u={audioTracks:a};this.log(`Updating audio tracks, ${a.length} track(s) found in group(s): ${n==null?void 0:n.join(",")}`),this.hls.trigger(A.AUDIO_TRACKS_UPDATED,u);const f=this.trackId;if(l!==-1&&f===-1)this.setAudioTrack(l);else if(a.length&&f===-1){var o;const d=new Error(`No audio track selected for current audio group-ID(s): ${(o=this.groupIds)==null?void 0:o.join(",")} track count: ${a.length}`);this.warn(d.message),this.hls.trigger(A.ERROR,{type:Z.MEDIA_ERROR,details:$.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:d})}}}onError(e,t){t.fatal||!t.context||t.context.type===ue.AUDIO_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&this.checkRetry(t)}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioOption(e){const t=this.hls;if(t.config.audioPreference=e,e){const n=this.allAudioTracks;if(this.selectDefaultTrack=!1,n.length){const s=this.currentTrack;if(s&&$n(e,s,Rn))return s;const r=Mt(e,this.tracksInGroup,Rn);if(r>-1){const o=this.tracksInGroup[r];return this.setAudioTrack(r),o}else if(s){let o=t.loadLevel;o===-1&&(o=t.firstAutoLevel);const a=Nb(e,t.levels,n,o,Rn);if(a===-1)return null;t.nextLoadLevel=a}if(e.channels||e.audioCodec){const o=Mt(e,n);if(o>-1)return n[o]}}}return null}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length){this.warn(`Invalid audio track id: ${e}`);return}this.selectDefaultTrack=!1;const n=this.currentTrack,s=t[e],r=s.details&&!s.details.live;if(e===this.trackId&&s===n&&r||(this.log(`Switching to audio-track ${e} "${s.name}" lang:${s.lang} group:${s.groupId} channels:${s.channels}`),this.trackId=e,this.currentTrack=s,this.hls.trigger(A.AUDIO_TRACK_SWITCHING,ye({},s)),r))return;const o=this.switchParams(s.url,n==null?void 0:n.details,s.details);this.loadPlaylist(o)}findTrackId(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){const s=t[n];if(!(this.selectDefaultTrack&&!s.default)&&(!e||$n(e,s,Rn)))return n}if(e){const{name:n,lang:s,assocLang:r,characteristics:o,audioCodec:a,channels:c}=e;for(let l=0;l<t.length;l++){const u=t[l];if($n({name:n,lang:s,assocLang:r,characteristics:o,audioCodec:a,channels:c},u,Rn))return l}for(let l=0;l<t.length;l++){const u=t[l];if(bs(e.attrs,u.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return l}for(let l=0;l<t.length;l++){const u=t[l];if(bs(e.attrs,u.attrs,["LANGUAGE"]))return l}}return-1}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;this.shouldLoadPlaylist(t)&&Vr(t.url,this.hls)&&this.scheduleLoading(t,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=e.id,s=e.groupId,r=this.getUrlWithDirectives(e.url,t),o=e.details,a=o==null?void 0:o.age;this.log(`Loading audio-track ${n} "${e.name}" lang:${e.lang} group:${s}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${a&&o.live?" age "+a.toFixed(1)+(o.type&&" "+o.type||""):""} ${r}`),this.hls.trigger(A.AUDIO_TRACK_LOADING,{url:r,id:n,groupId:s,deliveryDirectives:t||null,track:e})}}class I_{constructor(e){this.tracks=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.tracks=e}destroy(){this.tracks=this.queues=null}append(e,t,n){if(this.queues===null||this.tracks===null)return;const s=this.queues[t];s.push(e),s.length===1&&!n&&this.executeNext(t)}appendBlocker(e){return new Promise(t=>{const n={label:"async-blocker",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.append(n,e)})}prependBlocker(e){return new Promise(t=>{if(this.queues){const n={label:"async-blocker-prepend",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.queues[e].unshift(n)}})}removeBlockers(){this.queues!==null&&[this.queues.video,this.queues.audio,this.queues.audiovideo].forEach(e=>{var t;const n=(t=e[0])==null?void 0:t.label;(n==="async-blocker"||n==="async-blocker-prepend")&&(e[0].execute(),e.splice(0,1))})}unblockAudio(e){if(this.queues===null)return;this.queues.audio[0]===e&&this.shiftAndExecuteNext("audio")}executeNext(e){if(this.queues===null||this.tracks===null)return;const t=this.queues[e];if(t.length){const s=t[0];try{s.execute()}catch(r){var n;if(s.onError(r),this.queues===null||this.tracks===null)return;const o=(n=this.tracks[e])==null?void 0:n.buffer;o!=null&&o.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){this.queues!==null&&(this.queues[e].shift(),this.executeNext(e))}current(e){var t;return((t=this.queues)==null?void 0:t[e][0])||null}toString(){const{queues:e,tracks:t}=this;return e===null||t===null?"<destroyed>":`
- ${this.list("video")}
- ${this.list("audio")}
- ${this.list("audiovideo")}}`}list(e){var t,n;return(t=this.queues)!=null&&t[e]||(n=this.tracks)!=null&&n[e]?`${e}: (${this.listSbInfo(e)}) ${this.listOps(e)}`:""}listSbInfo(e){var t;const n=(t=this.tracks)==null?void 0:t[e],s=n==null?void 0:n.buffer;return s?`SourceBuffer${s.updating?" updating":""}${n.ended?" ended":""}${n.ending?" ending":""}`:"none"}listOps(e){var t;return((t=this.queues)==null?void 0:t[e].map(n=>n.label).join(", "))||""}}const pd=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,k1="HlsJsTrackRemovedError";class C_ extends Error{constructor(e){super(e),this.name=k1}}class L_ extends Rt{constructor(e,t){super("buffer-controller",e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.details=null,this._objectUrl=null,this.operationQueue=null,this.bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.blockedAudioAppend=null,this.lastVideoAppendEnd=0,this.appendSource=void 0,this.transferData=void 0,this.overrides=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.sourceBuffers=[[null,null],[null,null]],this._onEndStreaming=n=>{var s;this.hls&&((s=this.mediaSource)==null?void 0:s.readyState)==="open"&&this.hls.pauseBuffering()},this._onStartStreaming=n=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=n=>{const{media:s,mediaSource:r}=this;n&&this.log("Media source opened"),!(!s||!r)&&(r.removeEventListener("sourceopen",this._onMediaSourceOpen),s.removeEventListener("emptied",this._onMediaEmptied),this.updateDuration(),this.hls.trigger(A.MEDIA_ATTACHED,{media:s,mediaSource:r}),this.mediaSource!==null&&this.checkPendingTracks())},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:n,_objectUrl:s}=this;n!==s&&this.error(`Media element src was set while attaching MediaSource (${s} > ${n})`)},this.hls=e,this.fragmentTracker=t,this.appendSource=tb(Tn(e.config.preferManagedMediaSource)),this.initTracks(),this.registerListeners()}hasSourceTypes(){return Object.keys(this.tracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.transferData=this.overrides=void 0,this.operationQueue&&(this.operationQueue.destroy(),this.operationQueue=null),this.hls=this.fragmentTracker=null,this._onMediaSourceOpen=this._onMediaSourceClose=null,this._onMediaSourceEnded=null,this._onStartStreaming=this._onEndStreaming=null}registerListeners(){const{hls:e}=this;e.on(A.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(A.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(A.MANIFEST_LOADING,this.onManifestLoading,this),e.on(A.MANIFEST_PARSED,this.onManifestParsed,this),e.on(A.BUFFER_RESET,this.onBufferReset,this),e.on(A.BUFFER_APPENDING,this.onBufferAppending,this),e.on(A.BUFFER_CODECS,this.onBufferCodecs,this),e.on(A.BUFFER_EOS,this.onBufferEos,this),e.on(A.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(A.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(A.FRAG_PARSED,this.onFragParsed,this),e.on(A.FRAG_CHANGED,this.onFragChanged,this),e.on(A.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(A.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(A.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(A.MANIFEST_LOADING,this.onManifestLoading,this),e.off(A.MANIFEST_PARSED,this.onManifestParsed,this),e.off(A.BUFFER_RESET,this.onBufferReset,this),e.off(A.BUFFER_APPENDING,this.onBufferAppending,this),e.off(A.BUFFER_CODECS,this.onBufferCodecs,this),e.off(A.BUFFER_EOS,this.onBufferEos,this),e.off(A.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(A.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(A.FRAG_PARSED,this.onFragParsed,this),e.off(A.FRAG_CHANGED,this.onFragChanged,this),e.off(A.ERROR,this.onError,this)}transferMedia(){const{media:e,mediaSource:t}=this;if(!e)return null;const n={};if(this.operationQueue){const r=this.isUpdating();r||this.operationQueue.removeBlockers();const o=this.isQueued();(r||o)&&this.warn(`Transfering MediaSource with${o?" operations in queue":""}${r?" updating SourceBuffer(s)":""} ${this.operationQueue}`),this.operationQueue.destroy()}const s=this.transferData;return!this.sourceBufferCount&&s&&s.mediaSource===t?me(n,s.tracks):this.sourceBuffers.forEach(r=>{const[o]=r;o&&(n[o]=me({},this.tracks[o]),this.removeBuffer(o)),r[0]=r[1]=null}),{media:e,mediaSource:t,tracks:n}}initTracks(){const e={};this.sourceBuffers=[[null,null],[null,null]],this.tracks=e,this.resetQueue(),this.resetAppendErrors(),this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.lastVideoAppendEnd=0}onManifestLoading(){this.bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,t){var n;let s=2;(t.audio&&!t.video||!t.altAudio)&&(s=1),this.bufferCodecEventsTotal=s,this.log(`${s} bufferCodec event(s) expected.`),(n=this.transferData)!=null&&n.mediaSource&&this.sourceBufferCount&&s&&this.bufferCreated()}onMediaAttaching(e,t){const n=this.media=t.media,s=Tn(this.appendSource);if(this.transferData=this.overrides=void 0,n&&s){const r=!!t.mediaSource;(r||t.overrides)&&(this.transferData=t,this.overrides=t.overrides);const o=this.mediaSource=t.mediaSource||new s;if(this.assignMediaSource(o),r)this._objectUrl=n.src,this.attachTransferred();else{const a=this._objectUrl=self.URL.createObjectURL(o);if(this.appendSource)try{n.removeAttribute("src");const c=self.ManagedMediaSource;n.disableRemotePlayback=n.disableRemotePlayback||c&&o instanceof c,gd(n),R_(n,a),n.load()}catch{n.src=a}else n.src=a}n.addEventListener("emptied",this._onMediaEmptied)}}assignMediaSource(e){var t,n;this.log(`${((t=this.transferData)==null?void 0:t.mediaSource)===e?"transferred":"created"} media source: ${(n=e.constructor)==null?void 0:n.name}`),e.addEventListener("sourceopen",this._onMediaSourceOpen),e.addEventListener("sourceended",this._onMediaSourceEnded),e.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(e.addEventListener("startstreaming",this._onStartStreaming),e.addEventListener("endstreaming",this._onEndStreaming))}attachTransferred(){const e=this.media,t=this.transferData;if(!t||!e)return;const n=this.tracks,s=t.tracks,r=s?Object.keys(s):null,o=r?r.length:0,a=()=>{this.media&&this.mediaSourceOpenOrEnded&&this._onMediaSourceOpen()};if(s&&r&&o){if(!this.tracksReady){this.hls.config.startFragPrefetch=!0,this.log("attachTransferred: waiting for SourceBuffer track info");return}if(this.log(`attachTransferred: (bufferCodecEventsTotal ${this.bufferCodecEventsTotal})
- required tracks: ${Ae(n,(c,l)=>c==="initSegment"?void 0:l)};
- transfer tracks: ${Ae(s,(c,l)=>c==="initSegment"?void 0:l)}}`),!Fm(s,n)){t.mediaSource=null,t.tracks=void 0;const c=e.currentTime,l=this.details,u=Math.max(c,(l==null?void 0:l.fragments[0].start)||0);if(u-c>1){this.log(`attachTransferred: waiting for playback to reach new tracks start time ${c} -> ${u}`);return}this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(s)}"->"${Object.keys(n)}") start time: ${u} currentTime: ${c}`),this.onMediaDetaching(A.MEDIA_DETACHING,{}),this.onMediaAttaching(A.MEDIA_ATTACHING,t),e.currentTime=u;return}this.transferData=void 0,r.forEach(c=>{const l=c,u=s[l];if(u){const f=u.buffer;if(f){const d=this.fragmentTracker,h=u.id;if(d.hasFragments(h)||d.hasParts(h)){const g=re.getBuffered(f);d.detectEvictedFragments(l,g,h,null,!0)}const p=ea(l),m=[l,f];this.sourceBuffers[p]=m,f.updating&&this.operationQueue&&this.operationQueue.prependBlocker(l),this.trackSourceBuffer(l,u)}}}),a(),this.bufferCreated()}else this.log("attachTransferred: MediaSource w/o SourceBuffers"),a()}get mediaSourceOpenOrEnded(){var e;const t=(e=this.mediaSource)==null?void 0:e.readyState;return t==="open"||t==="ended"}onMediaDetaching(e,t){const n=!!t.transferMedia;this.transferData=this.overrides=void 0;const{media:s,mediaSource:r,_objectUrl:o}=this;if(r){if(this.log(`media source ${n?"transferring":"detaching"}`),n)this.sourceBuffers.forEach(([a])=>{a&&this.removeBuffer(a)}),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){const a=r.readyState==="open";try{const c=r.sourceBuffers;for(let l=c.length;l--;)a&&c[l].abort(),r.removeSourceBuffer(c[l]);a&&r.endOfStream()}catch(c){this.warn(`onMediaDetaching: ${c.message} while calling endOfStream`)}}this.sourceBufferCount&&this.onBufferReset()}r.removeEventListener("sourceopen",this._onMediaSourceOpen),r.removeEventListener("sourceended",this._onMediaSourceEnded),r.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(r.removeEventListener("startstreaming",this._onStartStreaming),r.removeEventListener("endstreaming",this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}s&&(s.removeEventListener("emptied",this._onMediaEmptied),n||(o&&self.URL.revokeObjectURL(o),this.mediaSrc===o?(s.removeAttribute("src"),this.appendSource&&gd(s),s.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null),this.hls.trigger(A.MEDIA_DETACHED,t)}onBufferReset(){this.sourceBuffers.forEach(([e])=>{e&&this.resetBuffer(e)}),this.initTracks()}resetBuffer(e){var t;const n=(t=this.tracks[e])==null?void 0:t.buffer;if(this.removeBuffer(e),n)try{var s;(s=this.mediaSource)!=null&&s.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(n)}catch(r){this.warn(`onBufferReset ${e}`,r)}delete this.tracks[e]}removeBuffer(e){this.removeBufferListeners(e),this.sourceBuffers[ea(e)]=[null,null];const t=this.tracks[e];t&&(t.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new I_(this.tracks)}onBufferCodecs(e,t){const n=this.tracks,s=Object.keys(t);this.log(`BUFFER_CODECS: "${s}" (current SB count ${this.sourceBufferCount})`);const r="audiovideo"in t&&(n.audio||n.video)||n.audiovideo&&("audio"in t||"video"in t),o=!r&&this.sourceBufferCount&&this.media&&s.some(a=>!n[a]);if(r||o){this.warn(`Unsupported transition between "${Object.keys(n)}" and "${s}" SourceBuffers`);return}s.forEach(a=>{var c,l,u;const f=t[a],{id:d,codec:h,levelCodec:p,container:m,metadata:g,supplemental:y}=f;let v=n[a];const x=(c=this.transferData)==null||(l=c.tracks)==null?void 0:l[a],E=x!=null&&x.buffer?x:v,S=(E==null?void 0:E.pendingCodec)||(E==null?void 0:E.codec),T=E==null?void 0:E.levelCodec;v||(v=n[a]={buffer:void 0,listeners:[],codec:h,supplemental:y,container:m,levelCodec:p,metadata:g,id:d});const _=dr(S,T),I=_==null?void 0:_.replace(pd,"$1");let w=dr(h,p);const b=(u=w)==null?void 0:u.replace(pd,"$1");w&&_&&I!==b&&(a.slice(0,5)==="audio"&&(w=Gr(w,this.appendSource)),this.log(`switching codec ${S} to ${w}`),w!==(v.pendingCodec||v.codec)&&(v.pendingCodec=w),v.container=m,this.appendChangeType(a,m,w))}),(this.tracksReady||this.sourceBufferCount)&&(t.tracks=this.sourceBufferTracks),!this.sourceBufferCount&&this.mediaSourceOpenOrEnded&&this.checkPendingTracks()}get sourceBufferTracks(){return Object.keys(this.tracks).reduce((e,t)=>{const n=this.tracks[t];return e[t]={id:n.id,container:n.container,codec:n.codec,levelCodec:n.levelCodec},e},{})}appendChangeType(e,t,n){const s=`${t};codecs=${n}`,r={label:`change-type=${s}`,execute:()=>{const o=this.tracks[e];if(o){const a=o.buffer;a!=null&&a.changeType&&(this.log(`changing ${e} sourceBuffer type to ${s}`),a.changeType(s),o.codec=n,o.container=t)}this.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:o=>{this.warn(`Failed to change ${e} SourceBuffer type`,o)}};this.append(r,e,this.isPending(this.tracks[e]))}blockAudio(e){var t;const n=e.start,s=n+e.duration*.05;if(((t=this.fragmentTracker.getAppendedFrag(n,X.MAIN))==null?void 0:t.gap)===!0)return;const o={label:"block-audio",execute:()=>{var a;const c=this.tracks.video;(this.lastVideoAppendEnd>s||c!=null&&c.buffer&&re.isBuffered(c.buffer,s)||((a=this.fragmentTracker.getAppendedFrag(s,X.MAIN))==null?void 0:a.gap)===!0)&&(this.blockedAudioAppend=null,this.shiftAndExecuteNext("audio"))},onStart:()=>{},onComplete:()=>{},onError:a=>{this.warn("Error executing block-audio operation",a)}};this.blockedAudioAppend={op:o,frag:e},this.append(o,"audio",!0)}unblockAudio(){const{blockedAudioAppend:e,operationQueue:t}=this;e&&t&&(this.blockedAudioAppend=null,t.unblockAudio(e.op))}onBufferAppending(e,t){const{tracks:n}=this,{data:s,type:r,parent:o,frag:a,part:c,chunkMeta:l,offset:u}=t,f=l.buffering[r],{sn:d,cc:h}=a,p=self.performance.now();f.start=p;const m=a.stats.buffering,g=c?c.stats.buffering:null;m.start===0&&(m.start=p),g&&g.start===0&&(g.start=p);const y=n.audio;let v=!1;r==="audio"&&(y==null?void 0:y.container)==="audio/mpeg"&&(v=!this.lastMpegAudioChunk||l.id===1||this.lastMpegAudioChunk.sn!==l.sn,this.lastMpegAudioChunk=l);const x=n.video,E=x==null?void 0:x.buffer;if(E&&d!=="initSegment"){const _=c||a,I=this.blockedAudioAppend;if(r==="audio"&&o!=="main"&&!this.blockedAudioAppend){const b=_.start+_.duration*.05,L=E.buffered,k=this.currentOp("video");!L.length&&!k?this.blockAudio(_):!k&&!re.isBuffered(E,b)&&this.lastVideoAppendEnd<b&&this.blockAudio(_)}else if(r==="video"){const w=_.end;if(I){const b=I.frag.start;(w>b||w<this.lastVideoAppendEnd||re.isBuffered(E,b))&&this.unblockAudio()}this.lastVideoAppendEnd=w}}const S=(c||a).start,T={label:`append-${r}`,execute:()=>{var _;f.executeStart=self.performance.now();const I=(_=this.tracks[r])==null?void 0:_.buffer;I&&(v?this.updateTimestampOffset(I,S,.1,r,d,h):u!==void 0&&q(u)&&this.updateTimestampOffset(I,u,1e-6,r,d,h)),this.appendExecutor(s,r)},onStart:()=>{},onComplete:()=>{const _=self.performance.now();f.executeEnd=f.end=_,m.first===0&&(m.first=_),g&&g.first===0&&(g.first=_);const I={};this.sourceBuffers.forEach(([w,b])=>{w&&(I[w]=re.getBuffered(b))}),this.appendErrors[r]=0,r==="audio"||r==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(A.BUFFER_APPENDED,{type:r,frag:a,part:c,chunkMeta:l,parent:a.type,timeRanges:I})},onError:_=>{var I;const w={type:Z.MEDIA_ERROR,parent:a.type,details:$.BUFFER_APPEND_ERROR,sourceBufferName:r,frag:a,part:c,chunkMeta:l,error:_,err:_,fatal:!1},b=(I=this.media)==null?void 0:I.error;if(_.code===DOMException.QUOTA_EXCEEDED_ERR||_.name=="QuotaExceededError"||"quota"in _)w.details=$.BUFFER_FULL_ERROR;else if(_.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!b)w.errorAction=Es(!0);else if(_.name===k1&&this.sourceBufferCount===0)w.errorAction=Es(!0);else{const L=++this.appendErrors[r];this.warn(`Failed ${L}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${r}" sourceBuffer (${b||"no media error"})`),(L>=this.hls.config.appendErrorMaxRetry||b)&&(w.fatal=!0)}this.hls.trigger(A.ERROR,w)}};this.append(T,r,this.isPending(this.tracks[r]))}getFlushOp(e,t,n){return this.log(`queuing "${e}" remove ${t}-${n}`),{label:"remove",execute:()=>{this.removeExecutor(e,t,n)},onStart:()=>{},onComplete:()=>{this.hls.trigger(A.BUFFER_FLUSHED,{type:e})},onError:s=>{this.warn(`Failed to remove ${t}-${n} from "${e}" SourceBuffer`,s)}}}onBufferFlushing(e,t){const{type:n,startOffset:s,endOffset:r}=t;n?this.append(this.getFlushOp(n,s,r),n):this.sourceBuffers.forEach(([o])=>{o&&this.append(this.getFlushOp(o,s,r),o)})}onFragParsed(e,t){const{frag:n,part:s}=t,r=[],o=s?s.elementaryStreams:n.elementaryStreams;o[ve.AUDIOVIDEO]?r.push("audiovideo"):(o[ve.AUDIO]&&r.push("audio"),o[ve.VIDEO]&&r.push("video"));const a=()=>{const c=self.performance.now();n.stats.buffering.end=c,s&&(s.stats.buffering.end=c);const l=s?s.stats:n.stats;this.hls.trigger(A.FRAG_BUFFERED,{frag:n,part:s,stats:l,id:n.type})};r.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${n.type} level: ${n.level} sn: ${n.sn}`),this.blockBuffers(a,r).catch(c=>{this.warn(`Fragment buffered callback ${c}`),this.stepOperationQueue(this.sourceBufferTypes)})}onFragChanged(e,t){this.trimBuffers()}get bufferedToEnd(){return this.sourceBufferCount>0&&!this.sourceBuffers.some(([e])=>{var t,n;return e&&(!((t=this.tracks[e])!=null&&t.ended)||((n=this.tracks[e])==null?void 0:n.ending))})}onBufferEos(e,t){var n;this.sourceBuffers.forEach(([o])=>{if(o){const a=this.tracks[o];(!t.type||t.type===o)&&(a.ending=!0,a.ended||(a.ended=!0,this.log(`${o} buffer reached EOS`)))}});const s=((n=this.overrides)==null?void 0:n.endOfStream)!==!1;this.sourceBufferCount>0&&!this.sourceBuffers.some(([o])=>{var a;return o&&!((a=this.tracks[o])!=null&&a.ended)})&&(s?(this.log("Queueing EOS"),this.blockUntilOpen(()=>{this.tracksEnded();const{mediaSource:o}=this;if(!o||o.readyState!=="open"){o&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${o.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),o.endOfStream(),this.hls.trigger(A.BUFFERED_TO_END,void 0)})):(this.tracksEnded(),this.hls.trigger(A.BUFFERED_TO_END,void 0)))}tracksEnded(){this.sourceBuffers.forEach(([e])=>{if(e!==null){const t=this.tracks[e];t&&(t.ending=!1)}})}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.updateDuration())}updateDuration(){this.blockUntilOpen(()=>{const e=this.getDurationAndRange();e&&this.updateMediaSource(e)})}onError(e,t){if(t.details===$.BUFFER_APPEND_ERROR&&t.frag){var n;const s=(n=t.errorAction)==null?void 0:n.nextAutoLevel;q(s)&&s!==t.frag.level&&this.resetAppendErrors()}}resetAppendErrors(){this.appendErrors={audio:0,video:0,audiovideo:0}}trimBuffers(){const{hls:e,details:t,media:n}=this;if(!n||t===null||!this.sourceBufferCount)return;const s=e.config,r=n.currentTime,o=t.levelTargetDuration,a=t.live&&s.liveBackBufferLength!==null?s.liveBackBufferLength:s.backBufferLength;if(q(a)&&a>=0){const c=Math.max(a,o),l=Math.floor(r/o)*o-c;this.flushBackBuffer(r,o,l)}if(q(s.frontBufferFlushThreshold)&&s.frontBufferFlushThreshold>0){const c=Math.max(s.maxBufferLength,s.frontBufferFlushThreshold),l=Math.max(c,o),u=Math.floor(r/o)*o+l;this.flushFrontBuffer(r,o,u)}}flushBackBuffer(e,t,n){this.sourceBuffers.forEach(([s,r])=>{if(r){const a=re.getBuffered(r);if(a.length>0&&n>a.start(0)){var o;this.hls.trigger(A.BACK_BUFFER_REACHED,{bufferEnd:n});const c=this.tracks[s];if((o=this.details)!=null&&o.live)this.hls.trigger(A.LIVE_BACK_BUFFER_REACHED,{bufferEnd:n});else if(c!=null&&c.ended){this.log(`Cannot flush ${s} back buffer while SourceBuffer is in ended state`);return}this.hls.trigger(A.BUFFER_FLUSHING,{startOffset:0,endOffset:n,type:s})}}})}flushFrontBuffer(e,t,n){this.sourceBuffers.forEach(([s,r])=>{if(r){const o=re.getBuffered(r),a=o.length;if(a<2)return;const c=o.start(a-1),l=o.end(a-1);if(n>c||e>=c&&e<=l)return;this.hls.trigger(A.BUFFER_FLUSHING,{startOffset:c,endOffset:1/0,type:s})}})}getDurationAndRange(){var e;const{details:t,mediaSource:n}=this;if(!t||!this.media||(n==null?void 0:n.readyState)!=="open")return null;const s=t.edge;if(t.live&&this.hls.config.liveDurationInfinity){if(t.fragments.length&&t.live&&n.setLiveSeekableRange){const l=Math.max(0,t.fragmentStart),u=Math.max(l,s);return{duration:1/0,start:l,end:u}}return{duration:1/0}}const r=(e=this.overrides)==null?void 0:e.duration;if(r)return q(r)?{duration:r}:null;const o=this.media.duration,a=q(n.duration)?n.duration:0;return s>a&&s>o||!q(o)?{duration:s}:null}updateMediaSource({duration:e,start:t,end:n}){const s=this.mediaSource;!this.media||!s||s.readyState!=="open"||(s.duration!==e&&(q(e)&&this.log(`Updating MediaSource duration to ${e.toFixed(3)}`),s.duration=e),t!==void 0&&n!==void 0&&(this.log(`MediaSource duration is set to ${s.duration}. Setting seekable range to ${t}-${n}.`),s.setLiveSeekableRange(t,n)))}get tracksReady(){const e=this.pendingTrackCount;return e>0&&(e>=this.bufferCodecEventsTotal||this.isPending(this.tracks.audiovideo))}checkPendingTracks(){const{bufferCodecEventsTotal:e,pendingTrackCount:t,tracks:n}=this;if(this.log(`checkPendingTracks (pending: ${t} codec events expected: ${e}) ${Ae(n)}`),this.tracksReady){var s;const r=(s=this.transferData)==null?void 0:s.tracks;r&&Object.keys(r).length?this.attachTransferred():this.createSourceBuffers()}}bufferCreated(){if(this.sourceBufferCount){const e={};this.sourceBuffers.forEach(([t,n])=>{if(t){const s=this.tracks[t];e[t]={buffer:n,container:s.container,codec:s.codec,supplemental:s.supplemental,levelCodec:s.levelCodec,id:s.id,metadata:s.metadata}}}),this.hls.trigger(A.BUFFER_CREATED,{tracks:e}),this.log(`SourceBuffers created. Running queue: ${this.operationQueue}`),this.sourceBuffers.forEach(([t])=>{this.executeNext(t)})}else{const e=new Error("could not create source buffer for media codec(s)");this.hls.trigger(A.ERROR,{type:Z.MEDIA_ERROR,details:$.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:e,reason:e.message})}}createSourceBuffers(){const{tracks:e,sourceBuffers:t,mediaSource:n}=this;if(!n)throw new Error("createSourceBuffers called when mediaSource was null");for(const r in e){const o=r,a=e[o];if(this.isPending(a)){const c=this.getTrackCodec(a,o),l=`${a.container};codecs=${c}`;a.codec=c,this.log(`creating sourceBuffer(${l})${this.currentOp(o)?" Queued":""} ${Ae(a)}`);try{const u=n.addSourceBuffer(l),f=ea(o),d=[o,u];t[f]=d,a.buffer=u}catch(u){var s;this.error(`error while trying to add sourceBuffer: ${u.message}`),this.shiftAndExecuteNext(o),(s=this.operationQueue)==null||s.removeBlockers(),delete this.tracks[o],this.hls.trigger(A.ERROR,{type:Z.MEDIA_ERROR,details:$.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:u,sourceBufferName:o,mimeType:l,parent:a.id});return}this.trackSourceBuffer(o,a)}}this.bufferCreated()}getTrackCodec(e,t){const n=e.supplemental;let s=e.codec;n&&(t==="video"||t==="audiovideo")&&Vl(n,"video")&&(s=Ab(s,n));const r=dr(s,e.levelCodec);return r?t.slice(0,5)==="audio"?Gr(r,this.appendSource):r:""}trackSourceBuffer(e,t){const n=t.buffer;if(!n)return;const s=this.getTrackCodec(t,e);this.tracks[e]={buffer:n,codec:s,container:t.container,levelCodec:t.levelCodec,supplemental:t.supplemental,metadata:t.metadata,id:t.id,listeners:[]},this.removeBufferListeners(e),this.addBufferListener(e,"updatestart",this.onSBUpdateStart),this.addBufferListener(e,"updateend",this.onSBUpdateEnd),this.addBufferListener(e,"error",this.onSBUpdateError),this.appendSource&&this.addBufferListener(e,"bufferedchange",(r,o)=>{const a=o.removedRanges;a!=null&&a.length&&this.hls.trigger(A.BUFFER_FLUSHED,{type:r})})}get mediaSrc(){var e,t;const n=((e=this.media)==null||(t=e.querySelector)==null?void 0:t.call(e,"source"))||this.media;return n==null?void 0:n.src}onSBUpdateStart(e){const t=this.currentOp(e);t&&t.onStart()}onSBUpdateEnd(e){var t;if(((t=this.mediaSource)==null?void 0:t.readyState)==="closed"){this.resetBuffer(e);return}const n=this.currentOp(e);n&&(n.onComplete(),this.shiftAndExecuteNext(e))}onSBUpdateError(e,t){var n;const s=new Error(`${e} SourceBuffer error. MediaSource readyState: ${(n=this.mediaSource)==null?void 0:n.readyState}`);this.error(`${s}`,t),this.hls.trigger(A.ERROR,{type:Z.MEDIA_ERROR,details:$.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:s,fatal:!1});const r=this.currentOp(e);r&&r.onError(s)}updateTimestampOffset(e,t,n,s,r,o){const a=t-e.timestampOffset;Math.abs(a)>=n&&(this.log(`Updating ${s} SourceBuffer timestampOffset to ${t} (sn: ${r} cc: ${o})`),e.timestampOffset=t)}removeExecutor(e,t,n){const{media:s,mediaSource:r}=this,o=this.tracks[e],a=o==null?void 0:o.buffer;if(!s||!r||!a){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),this.shiftAndExecuteNext(e);return}const c=q(s.duration)?s.duration:1/0,l=q(r.duration)?r.duration:1/0,u=Math.max(0,t),f=Math.min(n,c,l);f>u&&(!o.ending||o.ended)?(o.ended=!1,this.log(`Removing [${u},${f}] from the ${e} SourceBuffer`),a.remove(u,f)):this.shiftAndExecuteNext(e)}appendExecutor(e,t){const n=this.tracks[t],s=n==null?void 0:n.buffer;if(!s)throw new C_(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);n.ending=!1,n.ended=!1,s.appendBuffer(e)}blockUntilOpen(e){if(this.isUpdating()||this.isQueued())this.blockBuffers(e).catch(t=>{this.warn(`SourceBuffer blocked callback ${t}`),this.stepOperationQueue(this.sourceBufferTypes)});else try{e()}catch(t){this.warn(`Callback run without blocking ${this.operationQueue} ${t}`)}}isUpdating(){return this.sourceBuffers.some(([e,t])=>e&&t.updating)}isQueued(){return this.sourceBuffers.some(([e])=>e&&!!this.currentOp(e))}isPending(e){return!!e&&!e.buffer}blockBuffers(e,t=this.sourceBufferTypes){if(!t.length)return this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);const{operationQueue:n}=this,s=t.map(o=>this.appendBlocker(o));return t.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(s).then(o=>{n===this.operationQueue&&(e(),this.stepOperationQueue(this.sourceBufferTypes))})}stepOperationQueue(e){e.forEach(t=>{var n;const s=(n=this.tracks[t])==null?void 0:n.buffer;!s||s.updating||this.shiftAndExecuteNext(t)})}append(e,t,n){this.operationQueue&&this.operationQueue.append(e,t,n)}appendBlocker(e){if(this.operationQueue)return this.operationQueue.appendBlocker(e)}currentOp(e){return this.operationQueue?this.operationQueue.current(e):null}executeNext(e){e&&this.operationQueue&&this.operationQueue.executeNext(e)}shiftAndExecuteNext(e){this.operationQueue&&this.operationQueue.shiftAndExecuteNext(e)}get pendingTrackCount(){return Object.keys(this.tracks).reduce((e,t)=>e+(this.isPending(this.tracks[t])?1:0),0)}get sourceBufferCount(){return this.sourceBuffers.reduce((e,[t])=>e+(t?1:0),0)}get sourceBufferTypes(){return this.sourceBuffers.map(([e])=>e).filter(e=>!!e)}addBufferListener(e,t,n){const s=this.tracks[e];if(!s)return;const r=s.buffer;if(!r)return;const o=n.bind(this,e);s.listeners.push({event:t,listener:o}),r.addEventListener(t,o)}removeBufferListeners(e){const t=this.tracks[e];if(!t)return;const n=t.buffer;n&&(t.listeners.forEach(s=>{n.removeEventListener(s.event,s.listener)}),t.listeners.length=0)}}function gd(i){const e=i.querySelectorAll("source");[].slice.call(e).forEach(t=>{i.removeChild(t)})}function R_(i,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,i.appendChild(t)}function ea(i){return i==="audio"?1:0}class yu{constructor(e){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=e,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(e){this.streamController=e}destroy(){this.hls&&this.unregisterListener(),this.timer&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:e}=this;e.on(A.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(A.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(A.MANIFEST_PARSED,this.onManifestParsed,this),e.on(A.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(A.BUFFER_CODECS,this.onBufferCodecs,this),e.on(A.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(A.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(A.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(A.MANIFEST_PARSED,this.onManifestParsed,this),e.off(A.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(A.BUFFER_CODECS,this.onBufferCodecs,this),e.off(A.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){const n=this.hls.levels[t.droppedLevel];this.isLevelAllowed(n)&&this.restrictedLevels.push({bitrate:n.bitrate,height:n.height,width:n.width})}onMediaAttaching(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}onManifestParsed(e,t){const n=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,n.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onLevelsUpdated(e,t){this.timer&&q(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(e,t){this.hls.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onMediaDetaching(){this.stopCapping(),this.media=null}detectPlayerSize(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0){this.clientRect=null;return}const e=this.hls.levels;if(e.length){const t=this.hls,n=this.getMaxLevel(e.length-1);n!==this.autoLevelCapping&&t.logger.log(`Setting autoLevelCapping to ${n}: ${e[n].height}p@${e[n].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),t.autoLevelCapping=n,t.autoLevelEnabled&&t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const n=t.filter((s,r)=>this.isLevelAllowed(s)&&r<=e);return this.clientRect=null,yu.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,t={width:0,height:0};if(e){const n=e.getBoundingClientRect();t.width=n.width,t.height=n.height,!t.width&&!t.height&&(t.width=n.right-n.left||e.width||0,t.height=n.bottom-n.top||e.height||0)}return this.clientRect=t,t}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch{}return Math.min(e,this.hls.config.maxDevicePixelRatio)}isLevelAllowed(e){return!this.restrictedLevels.some(n=>e.bitrate===n.bitrate&&e.width===n.width&&e.height===n.height)}static getMaxLevelByMediaSize(e,t,n){if(!(e!=null&&e.length))return-1;const s=(a,c)=>c?a.width!==c.width||a.height!==c.height:!0;let r=e.length-1;const o=Math.max(t,n);for(let a=0;a<e.length;a+=1){const c=e[a];if((c.width>=o||c.height>=o)&&s(c,e[a+1])){r=a;break}}return r}}const w_={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},nt=w_,D_={HLS:"h"},P_=D_,k_="CMCD-Object",B_="CMCD-Request",F_="CMCD-Session",O_="CMCD-Status",Wi={OBJECT:k_,REQUEST:B_,SESSION:F_,STATUS:O_},M_={[Wi.OBJECT]:["br","ab","d","ot","tb","tpb","lb","tab","lab","url"],[Wi.REQUEST]:["pb","bl","tbl","dl","ltc","mtp","nor","nrr","rc","sn","sta","su","ttfb","ttfbb","ttlb","cmsdd","cmsds","smrt","df","cs"],[Wi.SESSION]:["cid","pr","sf","sid","st","v","msd"],[Wi.STATUS]:["bs","bsd","cdn","rtp","bg","pt","ec","e"]};class Ri{constructor(e,t){Array.isArray(e)&&(e=e.map(n=>n instanceof Ri?n:new Ri(n))),this.value=e,this.params=t}}const N_="Dict";function U_(i){return Array.isArray(i)?JSON.stringify(i):i instanceof Map?"Map{}":i instanceof Set?"Set{}":typeof i=="object"?JSON.stringify(i):String(i)}function $_(i,e,t,n){return new Error(`failed to ${i} "${U_(e)}" as ${t}`,{cause:n})}function Gt(i,e,t){return $_("serialize",i,e,t)}class B1{constructor(e){this.description=e}}const md="Bare Item",H_="Boolean";function G_(i){if(typeof i!="boolean")throw Gt(i,H_);return i?"?1":"?0"}function K_(i){return btoa(String.fromCharCode(...i))}const V_="Byte Sequence";function j_(i){if(ArrayBuffer.isView(i)===!1)throw Gt(i,V_);return`:${K_(i)}:`}const q_="Integer";function W_(i){return i<-999999999999999||999999999999999<i}function F1(i){if(W_(i))throw Gt(i,q_);return i.toString()}function z_(i){return`@${F1(i.getTime()/1e3)}`}function O1(i,e){if(i<0)return-O1(-i,e);const t=Math.pow(10,e);if(Math.abs(i*t%1-.5)<Number.EPSILON){const s=Math.floor(i*t);return(s%2===0?s:s+1)/t}else return Math.round(i*t)/t}const Q_="Decimal";function Y_(i){const e=O1(i,3);if(Math.floor(Math.abs(e)).toString().length>12)throw Gt(i,Q_);const t=e.toString();return t.includes(".")?t:`${t}.0`}const X_="String",J_=/[\x00-\x1f\x7f]+/;function Z_(i){if(J_.test(i))throw Gt(i,X_);return`"${i.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function e7(i){return i.description||i.toString().slice(7,-1)}const t7="Token";function xd(i){const e=e7(i);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw Gt(e,t7);return e}function tc(i){switch(typeof i){case"number":if(!q(i))throw Gt(i,md);return Number.isInteger(i)?F1(i):Y_(i);case"string":return Z_(i);case"symbol":return xd(i);case"boolean":return G_(i);case"object":if(i instanceof Date)return z_(i);if(i instanceof Uint8Array)return j_(i);if(i instanceof B1)return xd(i);default:throw Gt(i,md)}}const n7="Key";function nc(i){if(/^[a-z*][a-z0-9\-_.*]*$/.test(i)===!1)throw Gt(i,n7);return i}function vu(i){return i==null?"":Object.entries(i).map(([e,t])=>t===!0?`;${nc(e)}`:`;${nc(e)}=${tc(t)}`).join("")}function M1(i){return i instanceof Ri?`${tc(i.value)}${vu(i.params)}`:tc(i)}function i7(i){return`(${i.value.map(M1).join(" ")})${vu(i.params)}`}function s7(i,e={whitespace:!0}){if(typeof i!="object")throw Gt(i,N_);const t=i instanceof Map?i.entries():Object.entries(i),n=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([s,r])=>{r instanceof Ri||(r=new Ri(r));let o=nc(s);return r.value===!0?o+=vu(r.params):(o+="=",Array.isArray(r.value)?o+=i7(r):o+=M1(r)),o}).join(`,${n}`)}function r7(i,e){return s7(i,e)}function o7(i){return["ot","sf","st","e","sta"].includes(i)}function a7(i){return typeof i=="number"?q(i):i!=null&&i!==""&&i!==!1}function l7(i,e){const t=new URL(i),n=new URL(e);if(t.origin!==n.origin)return i;const s=t.pathname.split("/").slice(1),r=n.pathname.split("/").slice(1,-1);for(;s[0]===r[0];)s.shift(),r.shift();for(;r.length;)r.shift(),s.unshift("..");return s.join("/")}const xr=i=>Math.round(i),c7=(i,e)=>(e!=null&&e.baseUrl&&(i=l7(i,e.baseUrl)),encodeURIComponent(i)),er=i=>xr(i/100)*100,u7={br:xr,d:xr,bl:er,dl:er,mtp:er,nor:c7,rtp:er,tb:xr};function f7(i,e){const t={};if(i==null||typeof i!="object")return t;const n=Object.keys(i).sort(),s=me({},u7,e==null?void 0:e.formatters),r=e==null?void 0:e.filter;return n.forEach(o=>{if((r==null?void 0:r(o))===!1)return;let a=i[o];const c=s[o];c&&(a=c(a,e)),!(o==="v"&&a===1)&&(o=="pr"&&a===1||a7(a)&&(o7(o)&&typeof a=="string"&&(a=new B1(a)),t[o]=a))}),t}function N1(i,e={}){return i?r7(f7(i,e),me({whitespace:!1},e)):""}function d7(i,e={}){const t={};if(!i)return t;const n=Object.entries(i),s=Object.entries(M_).concat(Object.entries((e==null?void 0:e.customHeaderMap)||{})),r=n.reduce((o,a)=>{var c,l;const[u,f]=a,d=((c=s.find(h=>h[1].includes(u)))===null||c===void 0?void 0:c[0])||Wi.REQUEST;return(l=o[d])!==null&&l!==void 0||(o[d]={}),o[d][u]=f,o},{});return Object.entries(r).reduce((o,[a,c])=>(o[a]=N1(c,e),o),t)}function h7(i,e,t){return me(i,d7(e,t))}const p7="CMCD";function g7(i,e={}){if(!i)return"";const t=N1(i,e);return`${p7}=${encodeURIComponent(t)}`}const yd=/CMCD=[^&#]+/;function m7(i,e,t){const n=g7(e,t);if(!n)return i;if(yd.test(i))return i.replace(yd,n);const s=i.includes("?")?"&":"?";return`${i}${s}${n}`}class x7{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=s=>{try{this.apply(s,{ot:nt.MANIFEST,su:!this.initialized})}catch(r){this.hls.logger.warn("Could not generate manifest CMCD data.",r)}},this.applyFragmentData=s=>{try{const{frag:r,part:o}=s,a=this.hls.levels[r.level],c=this.getObjectType(r),l={d:(o||r).duration*1e3,ot:c};(c===nt.VIDEO||c===nt.AUDIO||c==nt.MUXED)&&(l.br=a.bitrate/1e3,l.tb=this.getTopBandwidth(c)/1e3,l.bl=this.getBufferLength(c));const u=o?this.getNextPart(o):this.getNextFrag(r);u!=null&&u.url&&u.url!==r.url&&(l.nor=u.url),this.apply(s,l)}catch(r){this.hls.logger.warn("Could not generate segment CMCD data.",r)}},this.hls=e;const t=this.config=e.config,{cmcd:n}=t;n!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=n.sessionId||e.sessionId,this.cid=n.contentId,this.useHeaders=n.useHeaders===!0,this.includeKeys=n.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(A.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(A.MEDIA_DETACHED,this.onMediaDetached,this),e.on(A.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(A.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(A.MEDIA_DETACHED,this.onMediaDetached,this),e.off(A.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=this.media=null}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,t){var n,s;this.audioBuffer=(n=t.tracks.audio)==null?void 0:n.buffer,this.videoBuffer=(s=t.tracks.video)==null?void 0:s.buffer}createData(){var e;return{v:1,sf:P_.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){me(t,this.createData());const n=t.ot===nt.INIT||t.ot===nt.VIDEO||t.ot===nt.MUXED;this.starved&&n&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering);const{includeKeys:s}=this;s&&(t=Object.keys(t).reduce((o,a)=>(s.includes(a)&&(o[a]=t[a]),o),{}));const r={baseUrl:e.url};this.useHeaders?(e.headers||(e.headers={}),h7(e.headers,t,r)):e.url=m7(e.url,t,r)}getNextFrag(e){var t;const n=(t=this.hls.levels[e.level])==null?void 0:t.details;if(n){const s=e.sn-n.startSN;return n.fragments[s+1]}}getNextPart(e){var t,n;const{index:s,fragment:r}=e,o=(t=this.hls.levels[r.level])==null||(n=t.details)==null?void 0:n.partList;if(o){const{sn:a}=r;for(let c=o.length-1;c>=0;c--){const l=o[c];if(l.index===s&&l.fragment.sn===a)return o[c+1]}}}getObjectType(e){const{type:t}=e;if(t==="subtitle")return nt.TIMED_TEXT;if(e.sn==="initSegment")return nt.INIT;if(t==="audio")return nt.AUDIO;if(t==="main")return this.hls.audioTracks.length?nt.VIDEO:nt.MUXED}getTopBandwidth(e){let t=0,n;const s=this.hls;if(e===nt.AUDIO)n=s.audioTracks;else{const r=s.maxAutoLevel,o=r>-1?r+1:s.levels.length;n=s.levels.slice(0,o)}return n.forEach(r=>{r.bitrate>t&&(t=r.bitrate)}),t>0?t:NaN}getBufferLength(e){const t=this.media,n=e===nt.AUDIO?this.audioBuffer:this.videoBuffer;return!n||!t?NaN:re.bufferInfo(n,t.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,n=e||this.config.loader;return class{constructor(r){this.loader=void 0,this.loader=new n(r)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(r,o,a){t(r),this.loader.load(r,o,a)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,n=e||this.config.loader;return class{constructor(r){this.loader=void 0,this.loader=new n(r)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(r,o,a){t(r),this.loader.load(r,o,a)}}}}const y7=3e5;class v7 extends Rt{constructor(e){super("content-steering",e.logger),this.hls=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this._pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(A.MANIFEST_LOADING,this.onManifestLoading,this),e.on(A.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(A.MANIFEST_PARSED,this.onManifestParsed,this),e.on(A.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(A.MANIFEST_LOADING,this.onManifestLoading,this),e.off(A.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(A.MANIFEST_PARSED,this.onManifestParsed,this),e.off(A.ERROR,this.onError,this))}pathways(){return(this.levels||[]).reduce((e,t)=>(e.indexOf(t.pathwayId)===-1&&e.push(t.pathwayId),e),[])}get pathwayPriority(){return this._pathwayPriority}set pathwayPriority(e){this.updatePathwayPriority(e)}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const e=this.timeToLoad*1e3-(performance.now()-this.updated);if(e>0){this.scheduleRefresh(this.uri,e);return}}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){this.reloadTimer!==-1&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const t=this.levels;t&&(this.levels=t.filter(n=>n!==e))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,t){const{contentSteering:n}=t;n!==null&&(this.pathwayId=n.pathwayId,this.uri=n.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:n}=t;if((n==null?void 0:n.action)===ze.SendAlternateToPenaltyBox&&n.flags===_t.MoveAllAlternatesMatchingHost){const s=this.levels;let r=this._pathwayPriority,o=this.pathwayId;if(t.context){const{groupId:a,pathwayId:c,type:l}=t.context;a&&s?o=this.getPathwayForGroupId(a,l,o):c&&(o=c)}o in this.penalizedPathways||(this.penalizedPathways[o]=performance.now()),!r&&s&&(r=this.pathways()),r&&r.length>1&&(this.updatePathwayPriority(r),n.resolved=this.pathwayId!==o),t.details===$.BUFFER_APPEND_ERROR&&!t.fatal?n.resolved=!0:n.resolved||this.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${o} levels: ${s&&s.length} priorities: ${Ae(r)} penalized: ${Ae(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(t.length===0){const n=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${n}"`),t=this.getLevelsForPathway(n),this.pathwayId=n}return t.length!==e.length&&this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t}getLevelsForPathway(e){return this.levels===null?[]:this.levels.filter(t=>e===t.pathwayId)}updatePathwayPriority(e){this._pathwayPriority=e;let t;const n=this.penalizedPathways,s=performance.now();Object.keys(n).forEach(r=>{s-n[r]>y7&&delete n[r]});for(let r=0;r<e.length;r++){const o=e[r];if(o in n)continue;if(o===this.pathwayId)return;const a=this.hls.nextLoadLevel,c=this.hls.levels[a];if(t=this.getLevelsForPathway(o),t.length>0){this.log(`Setting Pathway to "${o}"`),this.pathwayId=o,c1(t),this.hls.trigger(A.LEVELS_UPDATED,{levels:t});const l=this.hls.levels[a];c&&l&&this.levels&&(l.attrs["STABLE-VARIANT-ID"]!==c.attrs["STABLE-VARIANT-ID"]&&l.bitrate!==c.bitrate&&this.log(`Unstable Pathways change from bitrate ${c.bitrate} to ${l.bitrate}`),this.hls.nextLoadLevel=a);break}}}getPathwayForGroupId(e,t,n){const s=this.getLevelsForPathway(n).concat(this.levels||[]);for(let r=0;r<s.length;r++)if(t===ue.AUDIO_TRACK&&s[r].hasAudioGroup(e)||t===ue.SUBTITLE_TRACK&&s[r].hasSubtitleGroup(e))return s[r].pathwayId;return n}clonePathways(e){const t=this.levels;if(!t)return;const n={},s={};e.forEach(r=>{const{ID:o,"BASE-ID":a,"URI-REPLACEMENT":c}=r;if(t.some(u=>u.pathwayId===o))return;const l=this.getLevelsForPathway(a).map(u=>{const f=new Se(u.attrs);f["PATHWAY-ID"]=o;const d=f.AUDIO&&`${f.AUDIO}_clone_${o}`,h=f.SUBTITLES&&`${f.SUBTITLES}_clone_${o}`;d&&(n[f.AUDIO]=d,f.AUDIO=d),h&&(s[f.SUBTITLES]=h,f.SUBTITLES=h);const p=U1(u.uri,f["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",c),m=new vs({attrs:f,audioCodec:u.audioCodec,bitrate:u.bitrate,height:u.height,name:u.name,url:p,videoCodec:u.videoCodec,width:u.width});if(u.audioGroups)for(let g=1;g<u.audioGroups.length;g++)m.addGroupId("audio",`${u.audioGroups[g]}_clone_${o}`);if(u.subtitleGroups)for(let g=1;g<u.subtitleGroups.length;g++)m.addGroupId("text",`${u.subtitleGroups[g]}_clone_${o}`);return m});t.push(...l),vd(this.audioTracks,n,c,o),vd(this.subtitleTracks,s,c,o)})}loadSteeringManifest(e){const t=this.hls.config,n=t.loader;this.loader&&this.loader.destroy(),this.loader=new n(t);let s;try{s=new self.URL(e)}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(s.protocol!=="data:"){const u=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;s.searchParams.set("_HLS_pathway",this.pathwayId),s.searchParams.set("_HLS_throughput",""+u)}const r={responseType:"json",url:s.href},o=t.steeringManifestLoadPolicy.default,a=o.errorRetry||o.timeoutRetry||{},c={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:a.maxNumRetry||0,retryDelay:a.retryDelayMs||0,maxRetryDelay:a.maxRetryDelayMs||0},l={onSuccess:(u,f,d,h)=>{this.log(`Loaded steering manifest: "${s}"`);const p=u.data;if((p==null?void 0:p.VERSION)!==1){this.log(`Steering VERSION ${p.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=p.TTL;const{"RELOAD-URI":m,"PATHWAY-CLONES":g,"PATHWAY-PRIORITY":y}=p;if(m)try{this.uri=new self.URL(m,s).href}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${m}`);return}this.scheduleRefresh(this.uri||d.url),g&&this.clonePathways(g);const v={steeringManifest:p,url:s.toString()};this.hls.trigger(A.STEERING_MANIFEST_LOADED,v),y&&this.updatePathwayPriority(y)},onError:(u,f,d,h)=>{if(this.log(`Error loading steering manifest: ${u.code} ${u.text} (${f.url})`),this.stopLoad(),u.code===410){this.enabled=!1,this.log(`Steering manifest ${f.url} no longer available`);return}let p=this.timeToLoad*1e3;if(u.code===429){const m=this.loader;if(typeof(m==null?void 0:m.getResponseHeader)=="function"){const g=m.getResponseHeader("Retry-After");g&&(p=parseFloat(g)*1e3)}this.log(`Steering manifest ${f.url} rate limited`);return}this.scheduleRefresh(this.uri||f.url,p)},onTimeout:(u,f,d)=>{this.log(`Timeout loading steering manifest (${f.url})`),this.scheduleRefresh(this.uri||f.url)}};this.log(`Requesting steering manifest: ${s}`),this.loader.load(r,c,l)}scheduleRefresh(e,t=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var n;const s=(n=this.hls)==null?void 0:n.media;if(s&&!s.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},t)}}function vd(i,e,t,n){i&&Object.keys(e).forEach(s=>{const r=i.filter(o=>o.groupId===s).map(o=>{const a=me({},o);return a.details=void 0,a.attrs=new Se(a.attrs),a.url=a.attrs.URI=U1(o.url,o.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),a.groupId=a.attrs["GROUP-ID"]=e[s],a.attrs["PATHWAY-ID"]=n,a});i.push(...r)})}function U1(i,e,t,n){const{HOST:s,PARAMS:r,[t]:o}=n;let a;e&&(a=o==null?void 0:o[e],a&&(i=a));const c=new self.URL(i);return s&&!a&&(c.host=s),r&&Object.keys(r).sort().forEach(l=>{l&&c.searchParams.set(l,r[l])}),c.href}function yt(i,e,t){It(i,e,t),i.addEventListener(e,t)}function It(i,e,t){i.removeEventListener(e,t)}class yi extends Rt{constructor(e){super("eme",e.logger),this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.mediaKeys=null,this.setMediaKeysQueue=yi.CDMCleanupPromise?[yi.CDMCleanupPromise]:[],this.onWaitingForKey=t=>{this.log(`"${t.type}" event`)},this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.onDestroying(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onWaitingForKey=null}registerListeners(){this.hls.on(A.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(A.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(A.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(A.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.on(A.DESTROYING,this.onDestroying,this)}unregisterListeners(){this.hls.off(A.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(A.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(A.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(A.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.off(A.DESTROYING,this.onDestroying,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:n}=this.config,s=t[e];if(s)return s.licenseUrl;if(e===_e.WIDEVINE&&n)return n}getLicenseServerUrlOrThrow(e){const t=this.getLicenseServerUrl(e);if(t===void 0)throw new Error(`no license server URL configured for key-system "${e}"`);return t}getServerCertificateUrl(e){const{drmSystems:t}=this.config,n=t[e];if(n)return n.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,n=(o,a,c)=>!!o&&c.indexOf(o)===a,s=t.map(o=>o.audioCodec).filter(n),r=t.map(o=>o.videoCodec).filter(n);return s.length+r.length===0&&r.push("avc1.42e01e"),new Promise((o,a)=>{const c=l=>{const u=l.shift();this.getMediaKeysPromise(u,s,r).then(f=>o({keySystem:u,mediaKeys:f})).catch(f=>{l.length?c(l):f instanceof gt?a(f):a(new gt({type:Z.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_NO_ACCESS,error:f,fatal:!0},f.message))})};c(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:n}=this.config;if(typeof n!="function"){let s=`Configured requestMediaKeySystemAccess is not a function ${n}`;return n1===null&&self.location.protocol==="http:"&&(s=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(s))}return n(e,t)}getMediaKeysPromise(e,t,n){const s=u9(e,t,n,this.config.drmSystemOptions),r=this.keySystemAccessPromises[e];let o=r==null?void 0:r.keySystemAccess;if(!o){this.log(`Requesting encrypted media "${e}" key-system access with config: ${Ae(s)}`),o=this.requestMediaKeySystemAccess(e,s);const a=this.keySystemAccessPromises[e]={keySystemAccess:o};return o.catch(c=>{this.log(`Failed to obtain access to key-system "${e}": ${c}`)}),o.then(c=>{this.log(`Access for key-system "${c.keySystem}" obtained`);const l=this.fetchServerCertificate(e);return this.log(`Create media-keys for "${e}"`),a.mediaKeys=c.createMediaKeys().then(u=>(this.log(`Media-keys created for "${e}"`),a.hasMediaKeys=!0,l.then(f=>f?this.setMediaKeysServerCertificate(u,e,f):u))),a.mediaKeys.catch(u=>{this.error(`Failed to create media-keys for "${e}"}: ${u}`)}),a.mediaKeys})}return o.then(()=>r.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:n}){this.log(`Creating key-system session "${t}" keyId: ${Pn.hexDump(e.keyId||[])}`);const s=n.createSession(),r={decryptdata:e,keySystem:t,mediaKeys:n,mediaKeysSession:s,keyStatus:"status-pending"};return this.mediaKeySessions.push(r),r}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const n=this.createMediaKeySessionContext(e),s=this.getKeyIdString(t),r="cenc";this.keyIdToKeySessionPromise[s]=this.generateRequestWithPreferredKeySession(n,r,t.pssh.buffer,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}getKeyIdString(e){if(!e)throw new Error("Could not read keyId of undefined decryptdata");if(e.keyId===null)throw new Error("keyId is null");return Pn.hexDump(e.keyId)}updateKeySession(e,t){var n;const s=e.mediaKeysSession;return this.log(`Updating key-session "${s.sessionId}" for keyID ${Pn.hexDump(((n=e.decryptdata)==null?void 0:n.keyId)||[])}
- } (data length: ${t&&t.byteLength})`),s.update(t)}getSelectedKeySystemFormats(){return Object.keys(this.keySystemAccessPromises).map(e=>({keySystem:e,hasMediaKeys:this.keySystemAccessPromises[e].hasMediaKeys})).filter(({hasMediaKeys:e})=>!!e).map(({keySystem:e})=>j0(e)).filter(e=>!!e)}getKeySystemAccess(e){return this.getKeySystemSelectionPromise(e).then(({keySystem:t,mediaKeys:n})=>this.attemptSetMediaKeys(t,n))}selectKeySystem(e){return new Promise((t,n)=>this.getKeySystemSelectionPromise(e).then(({keySystem:s})=>{const r=j0(s);r?t(r):n(new Error(`Unable to find format for key-system "${s}"`))}).catch(n))}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){const t=pr(this.config),n=e.map(Ql).filter(s=>!!s&&t.indexOf(s)!==-1);return this.selectKeySystem(n)}loadKey(e){const t=e.keyInfo.decryptdata,n=this.getKeyIdString(t),s=`(keyId: ${n} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${s}`);let r=this.keyIdToKeySessionPromise[n];return r||(r=this.getKeySystemForKeyPromise(t).then(({keySystem:a,mediaKeys:c})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${s}`),this.attemptSetMediaKeys(a,c).then(()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:a,mediaKeys:c,decryptdata:t}))))),(this.keyIdToKeySessionPromise[n]=r.then(a=>{const c="cenc",l=t.pssh?t.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(a,c,l,"playlist-key")})).catch(a=>this.handleError(a))),r}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e){this.hls&&(this.error(e.message),e instanceof gt?this.hls.trigger(A.ERROR,e.data):this.hls.trigger(A.ERROR,{type:Z.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0}))}getKeySystemForKeyPromise(e){const t=this.getKeyIdString(e),n=this.keyIdToKeySessionPromise[t];if(!n){const s=Ql(e.keyFormat),r=s?[s]:pr(this.config);return this.attemptKeySystemAccess(r)}return n}getKeySystemSelectionPromise(e){if(e.length||(e=pr(this.config)),e.length===0)throw new gt({type:Z.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${Ae({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}attemptSetMediaKeys(e,t){if(this.mediaKeys===t)return Promise.resolve();const n=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const s=Promise.all(n).then(()=>{if(!this.media)throw this.mediaKeys=null,new Error("Attempted to set mediaKeys without media element attached");return this.media.setMediaKeys(t)});return this.mediaKeys=t,this.setMediaKeysQueue.push(s),s.then(()=>{this.log(`Media-keys set for "${e}"`),n.push(s),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(r=>n.indexOf(r)===-1)})}generateRequestWithPreferredKeySession(e,t,n,s){var r,o;const a=(r=this.config.drmSystems)==null||(o=r[e.keySystem])==null?void 0:o.generateRequest;if(a)try{const p=a.call(this.hls,t,n,e);if(!p)throw new Error("Invalid response from configured generateRequest filter");t=p.initDataType,n=p.initData?p.initData:null,e.decryptdata.pssh=n?new Uint8Array(n):null}catch(p){var c;if(this.warn(p.message),(c=this.hls)!=null&&c.config.debug)throw p}if(n===null)return this.log(`Skipping key-session request for "${s}" (no initData)`),Promise.resolve(e);const l=this.getKeyIdString(e.decryptdata);this.log(`Generating key-session request for "${s}": ${l} (init data type: ${t} length: ${n?n.byteLength:null})`);const u=new uu,f=e._onmessage=p=>{const m=e.mediaKeysSession;if(!m){u.emit("error",new Error("invalid state"));return}const{messageType:g,message:y}=p;this.log(`"${g}" message event for session "${m.sessionId}" message size: ${y.byteLength}`),g==="license-request"||g==="license-renewal"?this.renewLicense(e,y).catch(v=>{u.eventNames().length?u.emit("error",v):this.handleError(v)}):g==="license-release"?e.keySystem===_e.FAIRPLAY&&(this.updateKeySession(e,zl("acknowledged")),this.removeSession(e)):this.warn(`unhandled media key message type "${g}"`)},d=e._onkeystatuseschange=p=>{if(!e.mediaKeysSession){u.emit("error",new Error("invalid state"));return}this.onKeyStatusChange(e);const g=e.keyStatus;u.emit("keyStatus",g),g==="expired"&&(this.warn(`${e.keySystem} expired for key ${l}`),this.renewKeySession(e))};yt(e.mediaKeysSession,"message",f),yt(e.mediaKeysSession,"keystatuseschange",d);const h=new Promise((p,m)=>{u.on("error",m),u.on("keyStatus",g=>{g.startsWith("usable")?p():g==="output-restricted"?m(new gt({type:Z.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):g==="internal-error"?m(new gt({type:Z.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},`key status changed to "${g}"`)):g==="expired"?m(new Error("key expired while generating request")):this.warn(`unhandled key status change "${g}"`)})});return e.mediaKeysSession.generateRequest(t,n).then(()=>{var p;this.log(`Request generated for key-session "${(p=e.mediaKeysSession)==null?void 0:p.sessionId}" keyId: ${l}`)}).catch(p=>{throw new gt({type:Z.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_NO_SESSION,error:p,fatal:!1},`Error generating key-session request: ${p}`)}).then(()=>h).catch(p=>{throw u.removeAllListeners(),this.removeSession(e),p}).then(()=>(u.removeAllListeners(),e))}onKeyStatusChange(e){e.mediaKeysSession.keyStatuses.forEach((t,n)=>{if(typeof n=="string"&&typeof t=="object"){const s=n;n=t,t=s}this.log(`key status change "${t}" for keyStatuses keyId: ${Pn.hexDump("buffer"in n?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):new Uint8Array(n))} session keyId: ${Pn.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t})}fetchServerCertificate(e){const t=this.config,n=t.loader,s=new n(t),r=this.getServerCertificateUrl(e);return r?(this.log(`Fetching server certificate for "${e}"`),new Promise((o,a)=>{const c={responseType:"arraybuffer",url:r},l=t.certLoadPolicy.default,u={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},f={onSuccess:(d,h,p,m)=>{o(d.data)},onError:(d,h,p,m)=>{a(new gt({type:Z.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:p,response:ye({url:c.url,data:void 0},d)},`"${e}" certificate request failed (${r}). Status: ${d.code} (${d.text})`))},onTimeout:(d,h,p)=>{a(new gt({type:Z.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:p,response:{url:c.url,data:void 0}},`"${e}" certificate request timed out (${r})`))},onAbort:(d,h,p)=>{a(new Error("aborted"))}};s.load(c,u,f)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,n){return new Promise((s,r)=>{e.setServerCertificate(n).then(o=>{this.log(`setServerCertificate ${o?"success":"not supported by CDM"} (${n==null?void 0:n.byteLength}) on "${t}"`),s(e)}).catch(o=>{r(new gt({type:Z.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:o,fatal:!0},o.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(n=>this.updateKeySession(e,new Uint8Array(n)).catch(s=>{throw new gt({type:Z.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:s,fatal:!0},s.message)}))}unpackPlayReadyKeyMessage(e,t){const n=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!n.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const s=new DOMParser().parseFromString(n,"application/xml"),r=s.querySelectorAll("HttpHeader");if(r.length>0){let u;for(let f=0,d=r.length;f<d;f++){var o,a;u=r[f];const h=(o=u.querySelector("name"))==null?void 0:o.textContent,p=(a=u.querySelector("value"))==null?void 0:a.textContent;h&&p&&e.setRequestHeader(h,p)}}const c=s.querySelector("Challenge"),l=c==null?void 0:c.textContent;if(!l)throw new Error("Cannot find <Challenge> in key message");return zl(atob(l))}setupLicenseXHR(e,t,n,s){const r=this.config.licenseXhrSetup;return r?Promise.resolve().then(()=>{if(!n.decryptdata)throw new Error("Key removed");return r.call(this.hls,e,t,n,s)}).catch(o=>{if(!n.decryptdata)throw o;return e.open("POST",t,!0),r.call(this.hls,e,t,n,s)}).then(o=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:o||s})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:s}))}requestLicense(e,t){const n=this.config.keyLoadPolicy.default;return new Promise((s,r)=>{const o=this.getLicenseServerUrlOrThrow(e.keySystem);this.log(`Sending license request to URL: ${o}`);const a=new XMLHttpRequest;a.responseType="arraybuffer",a.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return r(new Error("invalid state"));if(a.readyState===4)if(a.status===200){this._requestLicenseFailureCount=0;let c=a.response;this.log(`License received ${c instanceof ArrayBuffer?c.byteLength:c}`);const l=this.config.licenseResponseCallback;if(l)try{c=l.call(this.hls,a,o,e)}catch(u){this.error(u)}s(c)}else{const c=n.errorRetry,l=c?c.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>l||a.status>=400&&a.status<500)r(new gt({type:Z.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:a,response:{url:o,data:void 0,code:a.status,text:a.statusText}},`License Request XHR failed (${o}). Status: ${a.status} (${a.statusText})`));else{const u=l-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${u} attempts left`),this.requestLicense(e,t).then(s,r)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=a,this.setupLicenseXHR(a,o,e,t).then(({xhr:c,licenseChallenge:l})=>{e.keySystem==_e.PLAYREADY&&(l=this.unpackPlayReadyKeyMessage(c,l)),c.send(l)})})}onDestroying(){this.unregisterListeners(),this._clear()}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const n=t.media;this.media=n,yt(n,"waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media;e&&(It(e,"waitingforkey",this.onWaitingForKey),this.media=null,this.mediaKeys=null)}_clear(){var e;if(this._requestLicenseFailureCount=0,this.keyIdToKeySessionPromise={},!this.mediaKeys&&!this.mediaKeySessions.length)return;const t=this.media,n=this.mediaKeySessions.slice();this.mediaKeySessions=[],this.mediaKeys=null,mo.clearKeyUriToKeyIdMap();const s=n.length;yi.CDMCleanupPromise=Promise.all(n.map(r=>this.removeSession(r)).concat(t==null||(e=t.setMediaKeys(null))==null?void 0:e.catch(r=>{var o;this.log(`Could not clear media keys: ${r}`),(o=this.hls)==null||o.trigger(A.ERROR,{type:Z.OTHER_ERROR,details:$.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${r}`)})}))).catch(r=>{var o;this.log(`Could not close sessions and clear media keys: ${r}`),(o=this.hls)==null||o.trigger(A.ERROR,{type:Z.OTHER_ERROR,details:$.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${r}`)})}).then(()=>{s&&this.log("finished closing key sessions and clearing media keys")})}onManifestLoading(){this.keyFormatPromise=null}onManifestLoaded(e,{sessionKeys:t}){if(!(!t||!this.config.emeEnabled)&&!this.keyFormatPromise){const n=t.reduce((s,r)=>(s.indexOf(r.keyFormat)===-1&&s.push(r.keyFormat),s),[]);this.log(`Selecting key-system from session-keys ${n.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(n)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:n}=e;if(t){this.log(`Remove licenses and keys and close session ${t.sessionId}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),n&&n.readyState!==XMLHttpRequest.DONE&&n.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const s=this.mediaKeySessions.indexOf(e);s>-1&&this.mediaKeySessions.splice(s,1);const{drmSystemOptions:r}=this.config;return(d9(r)?new Promise((a,c)=>{self.setTimeout(()=>c(new Error("MediaKeySession.remove() timeout")),8e3),t.remove().then(a)}):Promise.resolve()).catch(a=>{var c;this.log(`Could not remove session: ${a}`),(c=this.hls)==null||c.trigger(A.ERROR,{type:Z.OTHER_ERROR,details:$.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${a}`)})}).then(()=>t.close()).catch(a=>{var c;this.log(`Could not close session: ${a}`),(c=this.hls)==null||c.trigger(A.ERROR,{type:Z.OTHER_ERROR,details:$.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${a}`)})})}}}yi.CDMCleanupPromise=void 0;class gt extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}class E7{constructor(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}setStreamController(e){this.streamController=e}registerListeners(){this.hls.on(A.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(A.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(A.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(A.MEDIA_DETACHING,this.onMediaDetaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const n=this.hls.config;if(n.capLevelOnFPSDrop){const s=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=s,s&&typeof s.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),n.fpsDroppedMonitoringPeriod)}}onMediaDetaching(){this.media=null}checkFPS(e,t,n){const s=performance.now();if(t){if(this.lastTime){const r=s-this.lastTime,o=n-this.lastDroppedFrames,a=t-this.lastDecodedFrames,c=1e3*o/r,l=this.hls;if(l.trigger(A.FPS_DROP,{currentDropped:o,currentDecoded:a,totalDroppedFrames:n}),c>0&&o>l.config.fpsDroppedMonitoringThreshold*a){let u=l.currentLevel;l.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+u),u>0&&(l.autoLevelCapping===-1||l.autoLevelCapping>=u)&&(u=u-1,l.trigger(A.FPS_DROP_LEVEL_CAPPING,{level:u,droppedLevel:l.currentLevel}),l.autoLevelCapping=u,this.streamController.nextLevelSwitch())}}this.lastTime=s,this.lastDroppedFrames=n,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}function $1(i,e){let t;try{t=new Event("addtrack")}catch{t=document.createEvent("Event"),t.initEvent("addtrack",!1,!1)}t.track=i,e.dispatchEvent(t)}function H1(i,e){const t=i.mode;if(t==="disabled"&&(i.mode="hidden"),i.cues&&!i.cues.getCueById(e.id))try{if(i.addCue(e),!i.cues.getCueById(e.id))throw new Error(`addCue is failed for: ${e}`)}catch(n){pe.debug(`[texttrack-utils]: ${n}`);try{const s=new self.TextTrackCue(e.startTime,e.endTime,e.text);s.id=e.id,i.addCue(s)}catch(s){pe.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${s}`)}}t==="disabled"&&(i.mode=t)}function pi(i,e){const t=i.mode;if(t==="disabled"&&(i.mode="hidden"),i.cues)for(let n=i.cues.length;n--;)e&&i.cues[n].removeEventListener("enter",e),i.removeCue(i.cues[n]);t==="disabled"&&(i.mode=t)}function ic(i,e,t,n){const s=i.mode;if(s==="disabled"&&(i.mode="hidden"),i.cues&&i.cues.length>0){const r=S7(i.cues,e,t);for(let o=0;o<r.length;o++)(!n||n(r[o]))&&i.removeCue(r[o])}s==="disabled"&&(i.mode=s)}function A7(i,e){if(e<=i[0].startTime)return 0;const t=i.length-1;if(e>i[t].endTime)return-1;let n=0,s=t,r;for(;n<=s;)if(r=Math.floor((s+n)/2),e<i[r].startTime)s=r-1;else if(e>i[r].startTime&&n<t)n=r+1;else return r;return i[n].startTime-e<e-i[s].startTime?n:s}function S7(i,e,t){const n=[],s=A7(i,e);if(s>-1)for(let r=s,o=i.length;r<o;r++){const a=i[r];if(a.startTime>=e&&a.endTime<=t)n.push(a);else if(a.startTime>t)return n}return n}function yr(i){const e=[];for(let t=0;t<i.length;t++){const n=i[t];(n.kind==="subtitles"||n.kind==="captions")&&n.label&&e.push(i[t])}return e}class T7 extends xu{constructor(e){super(e,"subtitle-track-controller"),this.media=null,this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let t=null;const n=yr(this.media.textTracks);for(let r=0;r<n.length;r++)if(n[r].mode==="hidden")t=n[r];else if(n[r].mode==="showing"){t=n[r];break}const s=this.findTrackForTextTrack(t);this.subtitleTrack!==s&&this.setSubtitleTrack(s)},this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,this.onTextTracksChanged=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(e){this._subtitleDisplay=e,this.trackId>-1&&this.toggleTrackModes()}registerListeners(){const{hls:e}=this;e.on(A.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(A.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(A.MANIFEST_LOADING,this.onManifestLoading,this),e.on(A.MANIFEST_PARSED,this.onManifestParsed,this),e.on(A.LEVEL_LOADING,this.onLevelLoading,this),e.on(A.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(A.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(A.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(A.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(A.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(A.MANIFEST_LOADING,this.onManifestLoading,this),e.off(A.MANIFEST_PARSED,this.onManifestParsed,this),e.off(A.LEVEL_LOADING,this.onLevelLoading,this),e.off(A.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(A.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(A.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.media,this.media&&(this.queuedDefaultTrack>-1&&(this.subtitleTrack=this.queuedDefaultTrack,this.queuedDefaultTrack=-1),this.useTextTrackPolling=!(this.media.textTracks&&"onchange"in this.media.textTracks),this.useTextTrackPolling?this.pollTrackChange(500):this.media.textTracks.addEventListener("change",this.asyncPollTrackChange))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,e)}onMediaDetaching(e,t){const n=this.media;if(!n)return;const s=!!t.transferMedia;if(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||n.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),this.subtitleTrack=-1,this.media=null,s)return;yr(n.textTracks).forEach(o=>{pi(o)})}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:n,groupId:s,details:r}=t,o=this.tracksInGroup[n];if(!o||o.groupId!==s){this.warn(`Subtitle track with id:${n} and group:${s} not found in active group ${o==null?void 0:o.groupId}`);return}const a=o.details;o.details=t.details,this.log(`Subtitle track ${n} "${o.name}" lang:${o.lang} group:${s} loaded [${r.startSN}-${r.endSN}]`),n===this.trackId&&this.playlistLoaded(n,t,a)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const n=t.subtitleGroups||null,s=this.groupIds;let r=this.currentTrack;if(!n||(s==null?void 0:s.length)!==(n==null?void 0:n.length)||n!=null&&n.some(o=>(s==null?void 0:s.indexOf(o))===-1)){this.groupIds=n,this.trackId=-1,this.currentTrack=null;const o=this.tracks.filter(u=>!n||n.indexOf(u.groupId)!==-1);if(o.length)this.selectDefaultTrack&&!o.some(u=>u.default)&&(this.selectDefaultTrack=!1),o.forEach((u,f)=>{u.id=f});else if(!r&&!this.tracksInGroup.length)return;this.tracksInGroup=o;const a=this.hls.config.subtitlePreference;if(!r&&a){this.selectDefaultTrack=!1;const u=Mt(a,o);if(u>-1)r=o[u];else{const f=Mt(a,this.tracks);r=this.tracks[f]}}let c=this.findTrackId(r);c===-1&&r&&(c=this.findTrackId(null));const l={subtitleTracks:o};this.log(`Updating subtitle tracks, ${o.length} track(s) found in "${n==null?void 0:n.join(",")}" group-id`),this.hls.trigger(A.SUBTITLE_TRACKS_UPDATED,l),c!==-1&&this.trackId===-1&&this.setSubtitleTrack(c)}}findTrackId(e){const t=this.tracksInGroup,n=this.selectDefaultTrack;for(let s=0;s<t.length;s++){const r=t[s];if(!(n&&!r.default||!n&&!e)&&(!e||$n(r,e)))return s}if(e){for(let s=0;s<t.length;s++){const r=t[s];if(bs(e.attrs,r.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return s}for(let s=0;s<t.length;s++){const r=t[s];if(bs(e.attrs,r.attrs,["LANGUAGE"]))return s}}return-1}findTrackForTextTrack(e){if(e){const t=this.tracksInGroup;for(let n=0;n<t.length;n++){const s=t[n];if(ec(s,e))return n}}return-1}onError(e,t){t.fatal||!t.context||t.context.type===ue.SUBTITLE_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&this.checkRetry(t)}get allSubtitleTracks(){return this.tracks}get subtitleTracks(){return this.tracksInGroup}get subtitleTrack(){return this.trackId}set subtitleTrack(e){this.selectDefaultTrack=!1,this.setSubtitleTrack(e)}setSubtitleOption(e){if(this.hls.config.subtitlePreference=e,e){if(e.id===-1)return this.setSubtitleTrack(-1),null;const t=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,t.length){const n=this.currentTrack;if(n&&$n(e,n))return n;const s=Mt(e,this.tracksInGroup);if(s>-1){const r=this.tracksInGroup[s];return this.setSubtitleTrack(s),r}else{if(n)return null;{const r=Mt(e,t);if(r>-1)return t[r]}}}}return null}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentTrack)&&this.scheduleLoading(this.currentTrack,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=e.id,s=e.groupId,r=this.getUrlWithDirectives(e.url,t),o=e.details,a=o==null?void 0:o.age;this.log(`Loading subtitle ${n} "${e.name}" lang:${e.lang} group:${s}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${a&&o.live?" age "+a.toFixed(1)+(o.type&&" "+o.type||""):""} ${r}`),this.hls.trigger(A.SUBTITLE_TRACK_LOADING,{url:r,id:n,groupId:s,deliveryDirectives:t||null,track:e})}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=yr(e.textTracks),n=this.currentTrack;let s;if(n&&(s=t.filter(r=>ec(n,r))[0],s||this.warn(`Unable to find subtitle TextTrack with name "${n.name}" and language "${n.lang}"`)),[].slice.call(t).forEach(r=>{r.mode!=="disabled"&&r!==s&&(r.mode="disabled")}),s){const r=this.subtitleDisplay?"showing":"hidden";s.mode!==r&&(s.mode=r)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(e<-1||e>=t.length||!q(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.selectDefaultTrack=!1;const n=this.currentTrack,s=t[e]||null;if(this.trackId=e,this.currentTrack=s,this.toggleTrackModes(),!s){this.hls.trigger(A.SUBTITLE_TRACK_SWITCH,{id:e});return}const r=!!s.details&&!s.details.live;if(e===this.trackId&&s===n&&r)return;this.log(`Switching to subtitle-track ${e}`+(s?` "${s.name}" lang:${s.lang} group:${s.groupId}`:""));const{id:o,groupId:a="",name:c,type:l,url:u}=s;this.hls.trigger(A.SUBTITLE_TRACK_SWITCH,{id:o,groupId:a,name:c,type:l,url:u});const f=this.switchParams(s.url,n==null?void 0:n.details,s.details);this.loadPlaylist(f)}}function b7(){try{return crypto.randomUUID()}catch{try{const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}catch{let t=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,s=>{const r=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(s=="x"?r:r&3|8).toString(16)})}}}function ts(i){let e=5381,t=i.length;for(;t;)e=e*33^i.charCodeAt(--t);return(e>>>0).toString()}const vi=.025;let Yr=function(i){return i[i.Point=0]="Point",i[i.Range=1]="Range",i}({});function _7(i,e,t){return`${i.identifier}-${t+1}-${ts(e)}`}class I7{constructor(e,t){this.base=void 0,this._duration=null,this._timelineStart=null,this.appendInPlaceDisabled=void 0,this.appendInPlaceStarted=void 0,this.dateRange=void 0,this.hasPlayed=!1,this.cumulativeDuration=0,this.resumeOffset=NaN,this.playoutLimit=NaN,this.restrictions={skip:!1,jump:!1},this.snapOptions={out:!1,in:!1},this.assetList=[],this.assetListLoader=void 0,this.assetListResponse=null,this.resumeAnchor=void 0,this.error=void 0,this.resetOnResume=void 0,this.base=t,this.dateRange=e,this.setDateRange(e)}setDateRange(e){this.dateRange=e,this.resumeOffset=e.attr.optionalFloat("X-RESUME-OFFSET",this.resumeOffset),this.playoutLimit=e.attr.optionalFloat("X-PLAYOUT-LIMIT",this.playoutLimit),this.restrictions=e.attr.enumeratedStringList("X-RESTRICT",this.restrictions),this.snapOptions=e.attr.enumeratedStringList("X-SNAP",this.snapOptions)}reset(){var e;this.appendInPlaceStarted=!1,(e=this.assetListLoader)==null||e.destroy(),this.assetListLoader=void 0,this.supplementsPrimary||(this.assetListResponse=null,this.assetList=[],this._duration=null)}isAssetPastPlayoutLimit(e){var t;if(e>0&&e>=this.assetList.length)return!0;const n=this.playoutLimit;return e<=0||isNaN(n)?!1:n===0?!0:(((t=this.assetList[e])==null?void 0:t.startOffset)||0)>n}findAssetIndex(e){return this.assetList.indexOf(e)}get identifier(){return this.dateRange.id}get startDate(){return this.dateRange.startDate}get startTime(){const e=this.dateRange.startTime;if(this.snapOptions.out){const t=this.dateRange.tagAnchor;if(t)return ta(e,t)}return e}get startOffset(){return this.cue.pre?0:this.startTime}get startIsAligned(){if(this.startTime===0||this.snapOptions.out)return!0;const e=this.dateRange.tagAnchor;if(e){const t=this.dateRange.startTime,n=ta(t,e);return t-n<.1}return!1}get resumptionOffset(){const e=this.resumeOffset,t=q(e)?e:this.duration;return this.cumulativeDuration+t}get resumeTime(){const e=this.startOffset+this.resumptionOffset;if(this.snapOptions.in){const t=this.resumeAnchor;if(t)return ta(e,t)}return e}get appendInPlace(){return this.appendInPlaceStarted?!0:this.appendInPlaceDisabled?!1:!!(!this.cue.once&&!this.cue.pre&&this.startIsAligned&&(isNaN(this.playoutLimit)&&isNaN(this.resumeOffset)||this.resumeOffset&&this.duration&&Math.abs(this.resumeOffset-this.duration)<vi))}set appendInPlace(e){if(this.appendInPlaceStarted){this.resetOnResume=!e;return}this.appendInPlaceDisabled=!e}get timelineStart(){return this._timelineStart!==null?this._timelineStart:this.startTime}set timelineStart(e){this._timelineStart=e}get duration(){const e=this.playoutLimit;let t;return this._duration!==null?t=this._duration:this.dateRange.duration?t=this.dateRange.duration:t=this.dateRange.plannedDuration||0,!isNaN(e)&&e<t&&(t=e),t}set duration(e){this._duration=e}get cue(){return this.dateRange.cue}get timelineOccupancy(){return this.dateRange.attr["X-TIMELINE-OCCUPIES"]==="RANGE"?Yr.Range:Yr.Point}get supplementsPrimary(){return this.dateRange.attr["X-TIMELINE-STYLE"]==="PRIMARY"}get contentMayVary(){return this.dateRange.attr["X-CONTENT-MAY-VARY"]!=="NO"}get assetUrl(){return this.dateRange.attr["X-ASSET-URI"]}get assetListUrl(){return this.dateRange.attr["X-ASSET-LIST"]}get baseUrl(){return this.base.url}get assetListLoaded(){return this.assetList.length>0||this.assetListResponse!==null}toString(){return C7(this)}}function ta(i,e){return i-e.start<e.duration/2&&!(Math.abs(i-(e.start+e.duration))<vi)?e.start:e.start+e.duration}function G1(i,e,t){const n=new self.URL(i,t);return n.protocol!=="data:"&&n.searchParams.set("_HLS_primary_id",e),n}function na(i,e){for(;(t=i.assetList[++e])!=null&&t.error;)var t;return e}function C7(i){return`["${i.identifier}" ${i.cue.pre?"<pre>":i.cue.post?"<post>":""}${i.timelineStart.toFixed(2)}-${i.resumeTime.toFixed(2)}]`}function ci(i){const e=i.timelineStart,t=i.duration||0;return`["${i.identifier}" ${e.toFixed(2)}-${(e+t).toFixed(2)}]`}class L7{constructor(e,t,n,s){this.hls=void 0,this.interstitial=void 0,this.assetItem=void 0,this.tracks=null,this.hasDetails=!1,this.mediaAttached=null,this._currentTime=void 0,this._bufferedEosTime=void 0,this.checkPlayout=()=>{this.reachedPlayout(this.currentTime)&&this.hls.trigger(A.PLAYOUT_LIMIT_REACHED,{})};const r=this.hls=new e(t);this.interstitial=n,this.assetItem=s;let o=s.uri;try{o=G1(o,t.primarySessionId).href}catch{}r.loadSource(o);const a=()=>{this.hasDetails=!0};r.once(A.LEVEL_LOADED,a),r.once(A.AUDIO_TRACK_LOADED,a),r.once(A.SUBTITLE_TRACK_LOADED,a),r.on(A.MEDIA_ATTACHING,(c,{media:l})=>{this.removeMediaListeners(),this.mediaAttached=l,this.interstitial.playoutLimit&&(l.addEventListener("timeupdate",this.checkPlayout),this.appendInPlace&&r.on(A.BUFFER_APPENDED,()=>{const f=this.bufferedEnd;this.reachedPlayout(f)&&(this._bufferedEosTime=f,r.trigger(A.BUFFERED_TO_END,void 0))}))})}get appendInPlace(){var e;return((e=this.interstitial)==null?void 0:e.appendInPlace)||!1}bufferedInPlaceToEnd(e){var t;if(!this.appendInPlace)return!1;if((t=this.hls)!=null&&t.bufferedToEnd)return!0;if(!e||!this._bufferedEosTime)return!1;const n=this.timelineOffset,s=re.bufferInfo(e,n,0);return this.getAssetTime(s.end)>=this._bufferedEosTime-.02}reachedPlayout(e){const n=this.interstitial.playoutLimit;return this.startOffset+e>=n}get destroyed(){var e;return!((e=this.hls)!=null&&e.userConfig)}get assetId(){return this.assetItem.identifier}get interstitialId(){return this.assetItem.parentIdentifier}get media(){var e;return((e=this.hls)==null?void 0:e.media)||null}get bufferedEnd(){const e=this.media||this.mediaAttached;if(!e)return this._bufferedEosTime?this._bufferedEosTime:this.currentTime;const t=re.bufferInfo(e,e.currentTime,.001);return this.getAssetTime(t.end)}get currentTime(){const e=this.media||this.mediaAttached;return e?this.getAssetTime(e.currentTime):this._currentTime||0}get duration(){const e=this.assetItem.duration;return e||0}get remaining(){const e=this.duration;return e?Math.max(0,e-this.currentTime):0}get startOffset(){return this.assetItem.startOffset}get timelineOffset(){var e;return((e=this.hls)==null?void 0:e.config.timelineOffset)||0}set timelineOffset(e){const t=this.timelineOffset;if(e!==t){const n=e-t;if(Math.abs(n)>1/9e4){if(this.hasDetails)throw new Error("Cannot set timelineOffset after playlists are loaded");this.hls.config.timelineOffset=e}}}getAssetTime(e){const t=this.timelineOffset,n=this.duration;return Math.min(Math.max(0,e-t),n)}removeMediaListeners(){const e=this.mediaAttached;e&&(this._currentTime=e.currentTime,this.bufferSnapShot(),e.removeEventListener("timeupdate",this.checkPlayout))}bufferSnapShot(){if(this.mediaAttached){var e;(e=this.hls)!=null&&e.bufferedToEnd&&(this._bufferedEosTime=this.bufferedEnd)}}destroy(){this.removeMediaListeners(),this.hls.destroy(),this.hls=this.interstitial=null,this.tracks=this.mediaAttached=this.checkPlayout=null}attachMedia(e){this.hls.attachMedia(e)}detachMedia(){this.removeMediaListeners(),this.mediaAttached=null,this.hls.detachMedia()}resumeBuffering(){this.hls.resumeBuffering()}pauseBuffering(){this.hls.pauseBuffering()}transferMedia(){return this.bufferSnapShot(),this.hls.transferMedia()}resetDetails(){const e=this.hls;if(this.hasDetails){e.stopLoad();const t=n=>delete n.details;e.levels.forEach(t),e.allAudioTracks.forEach(t),e.allSubtitleTracks.forEach(t),this.hasDetails=!1}}on(e,t,n){this.hls.on(e,t)}once(e,t,n){this.hls.once(e,t)}off(e,t,n){this.hls.off(e,t)}toString(){var e;return`HlsAssetPlayer: ${ci(this.assetItem)} ${(e=this.hls)==null?void 0:e.sessionId} ${this.appendInPlace?"append-in-place":""}`}}const Ed=.033;class R7 extends Rt{constructor(e,t){super("interstitials-sched",t),this.onScheduleUpdate=void 0,this.eventMap={},this.events=null,this.items=null,this.durations={primary:0,playout:0,integrated:0},this.onScheduleUpdate=e}destroy(){this.reset(),this.onScheduleUpdate=null}reset(){this.eventMap={},this.setDurations(0,0,0),this.events&&this.events.forEach(e=>e.reset()),this.events=this.items=null}resetErrorsInRange(e,t){return this.events?this.events.reduce((n,s)=>e<=s.startOffset&&t>s.startOffset?(delete s.error,n+1):n,0):0}get duration(){const e=this.items;return e?e[e.length-1].end:0}get length(){return this.items?this.items.length:0}getEvent(e){return e&&this.eventMap[e]||null}hasEvent(e){return e in this.eventMap}findItemIndex(e,t){if(e.event)return this.findEventIndex(e.event.identifier);let n=-1;e.nextEvent?n=this.findEventIndex(e.nextEvent.identifier)-1:e.previousEvent&&(n=this.findEventIndex(e.previousEvent.identifier)+1);const s=this.items;if(s)for(s[n]||(t===void 0&&(t=e.start),n=this.findItemIndexAtTime(t));n>=0&&(r=s[n])!=null&&r.event;){var r;n--}return n}findItemIndexAtTime(e,t){const n=this.items;if(n)for(let s=0;s<n.length;s++){let r=n[s];if(t&&t!=="primary"&&(r=r[t]),e===r.start||e>r.start&&e<r.end)return s}return-1}findJumpRestrictedIndex(e,t){const n=this.items;if(n)for(let s=e;s<=t&&n[s];s++){const r=n[s].event;if(r!=null&&r.restrictions.jump&&!r.appendInPlace)return s}return-1}findEventIndex(e){const t=this.items;if(t)for(let s=t.length;s--;){var n;if(((n=t[s].event)==null?void 0:n.identifier)===e)return s}return-1}findAssetIndex(e,t){const n=e.assetList,s=n.length;if(s>1)for(let r=0;r<s;r++){const o=n[r];if(!o.error){const a=o.timelineStart;if(t===a||t>a&&t<a+(o.duration||0))return r}}return 0}get assetIdAtEnd(){var e,t;const n=(e=this.items)==null||(t=e[this.length-1])==null?void 0:t.event;if(n){const s=n.assetList,r=s[s.length-1];if(r)return r.identifier}return null}parseInterstitialDateRanges(e,t){const n=e.main.details,{dateRanges:s}=n,r=this.events,o=this.parseDateRanges(s,{url:n.url},t),a=Object.keys(s),c=r?r.filter(l=>!a.includes(l.identifier)):[];o.length&&o.sort((l,u)=>{const f=l.cue.pre,d=l.cue.post,h=u.cue.pre,p=u.cue.post;if(f&&!h)return-1;if(h&&!f||d&&!p)return 1;if(p&&!d)return-1;if(!f&&!h&&!d&&!p){const m=l.startTime,g=u.startTime;if(m!==g)return m-g}return l.dateRange.tagOrder-u.dateRange.tagOrder}),this.events=o,c.forEach(l=>{this.removeEvent(l)}),this.updateSchedule(e,c)}updateSchedule(e,t=[]){const n=this.events||[];if(n.length||t.length||this.length<2){const s=this.items,r=this.parseSchedule(n,e);(t.length||(s==null?void 0:s.length)!==r.length||r.some((a,c)=>Math.abs(a.playout.start-s[c].playout.start)>.005||Math.abs(a.playout.end-s[c].playout.end)>.005))&&(this.items=r,this.onScheduleUpdate(t,s))}}parseDateRanges(e,t,n){const s=[],r=Object.keys(e);for(let o=0;o<r.length;o++){const a=r[o],c=e[a];if(c.isInterstitial){let l=this.eventMap[a];l?l.setDateRange(c):(l=new I7(c,t),this.eventMap[a]=l,n===!1&&(l.appendInPlace=n)),s.push(l)}}return s}parseSchedule(e,t){const n=[],s=t.main.details,r=s.live?1/0:s.edge;let o=0;if(e=e.filter(c=>!c.error&&!(c.cue.once&&c.hasPlayed)),e.length){this.resolveOffsets(e,t);let c=0,l=0;if(e.forEach((u,f)=>{const d=u.cue.pre,h=u.cue.post,p=e[f-1]||null,m=u.appendInPlace,g=h?r:u.startOffset,y=u.duration,v=u.timelineOccupancy===Yr.Range?y:0,x=u.resumptionOffset,E=(p==null?void 0:p.startTime)===g,S=g+u.cumulativeDuration;let T=m?S+y:g+x;if(d||!h&&g<=0){const I=l;l+=v,u.timelineStart=S;const w=o;o+=y,n.push({event:u,start:S,end:T,playout:{start:w,end:o},integrated:{start:I,end:l}})}else if(g<=r){if(!E){const b=g-c;if(b>Ed){const L=c,k=l;l+=b;const M=o;o+=b;const N={previousEvent:e[f-1]||null,nextEvent:u,start:L,end:L+b,playout:{start:M,end:o},integrated:{start:k,end:l}};n.push(N)}else b>0&&p&&(p.cumulativeDuration+=b,n[n.length-1].end=g)}h&&(T=S),u.timelineStart=S;const I=l;l+=v;const w=o;o+=y,n.push({event:u,start:S,end:T,playout:{start:w,end:o},integrated:{start:I,end:l}})}else return;const _=u.resumeTime;h||_>r?c=r:c=_}),c<r){var a;const u=c,f=l,d=r-c;l+=d;const h=o;o+=d,n.push({previousEvent:((a=n[n.length-1])==null?void 0:a.event)||null,nextEvent:null,start:c,end:u+d,playout:{start:h,end:o},integrated:{start:f,end:l}})}this.setDurations(r,o,l)}else n.push({previousEvent:null,nextEvent:null,start:0,end:r,playout:{start:0,end:r},integrated:{start:0,end:r}}),this.setDurations(r,r,r);return n}setDurations(e,t,n){this.durations={primary:e,playout:t,integrated:n}}resolveOffsets(e,t){const n=t.main.details,s=n.live?1/0:n.edge;let r=0,o=-1;e.forEach((a,c)=>{const l=a.cue.pre,u=a.cue.post,f=l?0:u?s:a.startTime;this.updateAssetDurations(a),o===f?a.cumulativeDuration=r:(r=0,o=f),!u&&a.snapOptions.in&&(a.resumeAnchor=qn(null,n.fragments,a.startOffset+a.resumptionOffset,0,0)||void 0),a.appendInPlace&&!a.appendInPlaceStarted&&(this.primaryCanResumeInPlaceAt(a,t)||(a.appendInPlace=!1)),!a.appendInPlace&&c+1<e.length&&e[c+1].startTime-e[c].resumeTime<Ed&&(e[c+1].appendInPlace=!1,e[c+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${a}`));const h=q(a.resumeOffset)?a.resumeOffset:a.duration;r+=h})}primaryCanResumeInPlaceAt(e,t){const n=e.resumeTime,s=e.startTime+e.resumptionOffset;return Math.abs(n-s)>vi?(this.log(`"${e.identifier}" resumption ${n} not aligned with estimated timeline end ${s}`),!1):t?!Object.keys(t).some(o=>{const a=t[o].details,c=a.edge;if(n>=c)return this.log(`"${e.identifier}" resumption ${n} past ${o} playlist end ${c}`),!1;const l=qn(null,a.fragments,n);if(!l)return this.log(`"${e.identifier}" resumption ${n} does not align with any fragments in ${o} playlist (${a.fragStart}-${a.fragmentEnd})`),!0;const u=o==="audio"?.175:0;return Math.abs(l.start-n)<vi+u||Math.abs(l.end-n)<vi+u?!1:(this.log(`"${e.identifier}" resumption ${n} not aligned with ${o} fragment bounds (${l.start}-${l.end} sn: ${l.sn} cc: ${l.cc})`),!0)}):(this.log(`"${e.identifier}" resumption ${n} can not be aligned with media (none selected)`),!1)}updateAssetDurations(e){if(!e.assetListLoaded)return;const t=e.timelineStart;let n=0,s=!1,r=!1;e.assetList.forEach((o,a)=>{const c=t+n;o.startOffset=n,o.timelineStart=c,s||(s=o.duration===null),r||(r=!!o.error);const l=o.error?0:o.duration||0;n+=l}),s&&!r?e.duration=Math.max(n,e.duration):e.duration=n}removeEvent(e){e.reset(),delete this.eventMap[e.identifier]}}function rn(i){return`[${i.event?'"'+i.event.identifier+'"':"primary"}: ${i.start.toFixed(2)}-${i.end.toFixed(2)}]`}class w7{constructor(e){this.hls=void 0,this.hls=e}destroy(){this.hls=null}loadAssetList(e,t){const n=e.assetListUrl;let s;try{s=G1(n,this.hls.sessionId,e.baseUrl)}catch(d){const h=this.assignAssetListError(e,$.ASSET_LIST_LOAD_ERROR,d,n);this.hls.trigger(A.ERROR,h);return}t&&s.protocol!=="data:"&&s.searchParams.set("_HLS_start_offset",""+t);const r=this.hls.config,o=r.loader,a=new o(r),c={responseType:"json",url:s.href},l=r.interstitialAssetListLoadPolicy.default,u={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},f={onSuccess:(d,h,p,m)=>{const g=d.data,y=g==null?void 0:g.ASSETS;if(!Array.isArray(y)){const v=this.assignAssetListError(e,$.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),p.url,h,m);this.hls.trigger(A.ERROR,v);return}e.assetListResponse=g,this.hls.trigger(A.ASSET_LIST_LOADED,{event:e,assetListResponse:g,networkDetails:m})},onError:(d,h,p,m)=>{const g=this.assignAssetListError(e,$.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${d.code} ${d.text} (${h.url})`),h.url,m,p);this.hls.trigger(A.ERROR,g)},onTimeout:(d,h,p)=>{const m=this.assignAssetListError(e,$.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${h.url})`),h.url,d,p);this.hls.trigger(A.ERROR,m)}};return a.load(c,u,f),this.hls.trigger(A.ASSET_LIST_LOADING,{event:e}),a}assignAssetListError(e,t,n,s,r,o){return e.error=n,{type:Z.NETWORK_ERROR,details:t,fatal:!1,interstitial:e,url:s,error:n,networkDetails:o,stats:r}}}function Ad(i){i==null||i.play().catch(()=>{})}class D7 extends Rt{constructor(e,t){super("interstitials",e.logger),this.HlsPlayerClass=void 0,this.hls=void 0,this.assetListLoader=void 0,this.mediaSelection=null,this.altSelection=null,this.media=null,this.detachedData=null,this.requiredTracks=null,this.manager=null,this.playerQueue=[],this.bufferedPos=-1,this.timelinePos=-1,this.schedule=void 0,this.playingItem=null,this.bufferingItem=null,this.waitingItem=null,this.endedItem=null,this.playingAsset=null,this.endedAsset=null,this.bufferingAsset=null,this.shouldPlay=!1,this.onPlay=()=>{this.shouldPlay=!0},this.onPause=()=>{this.shouldPlay=!1},this.onSeeking=()=>{const n=this.currentTime;if(n===void 0||this.playbackDisabled)return;const s=n-this.timelinePos;if(Math.abs(s)<1/7056e5)return;const o=s<=-.01;this.timelinePos=n,this.bufferedPos=n;const a=this.playingItem;if(!a){this.checkBuffer();return}if(o&&this.schedule.resetErrorsInRange(n,n-s)&&this.updateSchedule(),this.checkBuffer(),o&&n<a.start||n>=a.end){var c;const d=this.schedule.findItemIndexAtTime(this.timelinePos);if(!this.isInterstitial(a)&&(c=this.media)!=null&&c.paused&&(this.shouldPlay=!1),!o){const h=this.findItemIndex(a);if(d>h){const p=this.schedule.findJumpRestrictedIndex(h+1,d);if(p>h){this.setSchedulePosition(p);return}}}this.setSchedulePosition(d);return}const l=this.playingAsset;if(!l){if(this.playingLastItem&&this.isInterstitial(a)){const d=a.event.assetList[0];d&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(n,d))}return}const u=l.timelineStart,f=l.duration||0;(o&&n<u||n>=u+f)&&this.setScheduleToAssetAtTime(n,l)},this.onTimeupdate=()=>{const n=this.currentTime;if(n===void 0||this.playbackDisabled)return;if(n>this.timelinePos)this.timelinePos=n,n>this.bufferedPos&&this.checkBuffer();else return;const s=this.playingItem;if(!s||this.playingLastItem)return;if(n>=s.end){this.timelinePos=s.end;const a=this.findItemIndex(s);this.setSchedulePosition(a+1)}const r=this.playingAsset;if(!r)return;const o=r.timelineStart+(r.duration||0);n>=o&&this.setScheduleToAssetAtTime(n,r)},this.onScheduleUpdate=(n,s)=>{const r=this.schedule,o=this.playingItem,a=r.events||[],c=r.items||[],l=r.durations,u=n.map(p=>p.identifier),f=!!(a.length||u.length);(f||s)&&this.log(`INTERSTITIALS_UPDATED (${a.length}): ${a}
- Schedule: ${c.map(p=>rn(p))} pos: ${this.timelinePos}`),u.length&&this.log(`Removed events ${u}`),this.playerQueue.forEach(p=>{if(p.interstitial.appendInPlace){const m=p.assetItem.timelineStart,g=p.timelineOffset-m;if(g)try{p.timelineOffset=m}catch(y){Math.abs(g)>vi&&this.warn(`${y} ("${p.assetId}" ${p.timelineOffset}->${m})`)}}});let d=null;if(o){const p=this.updateItem(o,this.timelinePos);this.itemsMatch(o,p)&&(this.playingItem=p,this.waitingItem=this.endedItem=null,d=()=>this.trimInPlace(p,o))}else this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const h=this.bufferingItem;if(h){const p=this.updateItem(h,this.bufferedPos);this.itemsMatch(h,p)?(this.bufferingItem=p,d||(d=()=>this.trimInPlace(p,h))):h.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(h.event,null))}if(n.forEach(p=>{p.assetList.forEach(m=>{this.clearAssetPlayer(m.identifier,null)})}),f||s){if(this.hls.trigger(A.INTERSTITIALS_UPDATED,{events:a.slice(0),schedule:c.slice(0),durations:l,removedIds:u}),this.isInterstitial(o)&&u.includes(o.event.identifier)){this.warn(`Interstitial "${o.event.identifier}" removed while playing`),this.primaryFallback(o.event);return}d&&d(),this.checkBuffer()}},this.hls=e,this.HlsPlayerClass=t,this.assetListLoader=new w7(e),this.schedule=new R7(this.onScheduleUpdate,e.logger),this.registerListeners()}registerListeners(){const e=this.hls;e.on(A.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(A.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(A.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(A.MANIFEST_LOADING,this.onManifestLoading,this),e.on(A.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(A.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(A.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.on(A.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(A.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.on(A.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.on(A.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.on(A.BUFFER_APPENDED,this.onBufferAppended,this),e.on(A.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(A.BUFFERED_TO_END,this.onBufferedToEnd,this),e.on(A.MEDIA_ENDED,this.onMediaEnded,this),e.on(A.ERROR,this.onError,this),e.on(A.DESTROYING,this.onDestroying,this)}unregisterListeners(){const e=this.hls;e&&(e.off(A.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(A.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(A.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(A.MANIFEST_LOADING,this.onManifestLoading,this),e.off(A.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(A.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(A.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.off(A.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(A.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.off(A.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.off(A.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.off(A.BUFFER_CODECS,this.onBufferCodecs,this),e.off(A.BUFFER_APPENDED,this.onBufferAppended,this),e.off(A.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(A.BUFFERED_TO_END,this.onBufferedToEnd,this),e.off(A.MEDIA_ENDED,this.onMediaEnded,this),e.off(A.ERROR,this.onError,this),e.off(A.DESTROYING,this.onDestroying,this))}startLoad(){this.resumeBuffering()}stopLoad(){this.pauseBuffering()}resumeBuffering(){var e;(e=this.getBufferingPlayer())==null||e.resumeBuffering()}pauseBuffering(){var e;(e=this.getBufferingPlayer())==null||e.pauseBuffering()}destroy(){this.unregisterListeners(),this.stopLoad(),this.assetListLoader&&this.assetListLoader.destroy(),this.emptyPlayerQueue(),this.clearScheduleState(),this.schedule&&this.schedule.destroy(),this.media=this.detachedData=this.mediaSelection=this.requiredTracks=this.altSelection=this.manager=null,this.hls=this.HlsPlayerClass=this.schedule=this.log=null,this.assetListLoader=null,this.onPlay=this.onPause=this.onSeeking=this.onTimeupdate=null,this.onScheduleUpdate=null}onDestroying(){const e=this.primaryMedia||this.media;e&&this.removeMediaListeners(e)}removeMediaListeners(e){It(e,"play",this.onPlay),It(e,"pause",this.onPause),It(e,"seeking",this.onSeeking),It(e,"timeupdate",this.onTimeupdate)}onMediaAttaching(e,t){const n=this.media=t.media;yt(n,"seeking",this.onSeeking),yt(n,"timeupdate",this.onTimeupdate),yt(n,"play",this.onPlay),yt(n,"pause",this.onPause)}onMediaAttached(e,t){const n=this.effectivePlayingItem,s=this.detachedData;if(this.detachedData=null,n===null)this.checkStart();else if(!s){this.clearScheduleState();const r=this.findItemIndex(n);this.setSchedulePosition(r)}}clearScheduleState(){this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null}onMediaDetaching(e,t){const n=!!t.transferMedia,s=this.media;if(this.media=null,!n&&(s&&this.removeMediaListeners(s),this.detachedData)){const r=this.getBufferingPlayer();r&&(this.playingAsset=this.endedAsset=this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,r.detachMedia()),this.shouldPlay=!1}}get interstitialsManager(){if(!this.manager){if(!this.hls)return null;const e=this,t=()=>e.bufferingItem||e.waitingItem,n=f=>f&&e.getAssetPlayer(f.identifier),s=(f,d,h,p,m)=>{if(f){let g=f[d].start;const y=f.event;if(y){if(d==="playout"||y.timelineOccupancy!==Yr.Point){const v=n(h);(v==null?void 0:v.interstitial)===y&&(g+=v.assetItem.startOffset+v[m])}}else{const v=p==="bufferedPos"?o():e[p];g+=v-f.start}return g}return 0},r=(f,d)=>{if(f!==0&&d!=="primary"&&e.schedule.length){var h;const p=e.schedule.findItemIndexAtTime(f),m=(h=e.schedule.items)==null?void 0:h[p];if(m){const g=m[d].start-m.start;return f+g}}return f},o=()=>{const f=e.bufferedPos;return f===Number.MAX_VALUE?a("primary"):Math.max(f,0)},a=f=>{var d;return(d=e.primaryDetails)!=null&&d.live?e.primaryDetails.edge:e.schedule.durations[f]},c=(f,d)=>{var h,p;const m=e.effectivePlayingItem;if(m!=null&&(h=m.event)!=null&&h.restrictions.skip)return;e.log(`seek to ${f} "${d}"`);const g=e.effectivePlayingItem,y=e.schedule.findItemIndexAtTime(f,d),v=(p=e.schedule.items)==null?void 0:p[y],x=e.getBufferingPlayer(),E=x==null?void 0:x.interstitial,S=E==null?void 0:E.appendInPlace,T=g&&e.itemsMatch(g,v);if(g&&(S||T)){const I=n(e.playingAsset),w=(I==null?void 0:I.media)||e.primaryMedia;if(w){const b=d==="primary"?w.currentTime:s(g,d,e.playingAsset,"timelinePos","currentTime"),L=f-b,k=(S?b:w.currentTime)+L;if(k>=0&&(!I||S||k<=I.duration)){w.currentTime=k;return}}}if(v){let I=f;if(d!=="primary"){const b=v[d].start,L=f-b;I=v.start+L}const w=!e.isInterstitial(v);if((!e.isInterstitial(g)||g.event.appendInPlace)&&(w||v.event.appendInPlace)){const b=e.media||(S?x==null?void 0:x.media:null);b&&(b.currentTime=I)}else if(g){const b=e.findItemIndex(g);if(y>b){const k=e.schedule.findJumpRestrictedIndex(b+1,y);if(k>b){e.setSchedulePosition(k);return}}let L=0;if(w)e.timelinePos=I,e.checkBuffer();else{var _;const k=v==null||(_=v.event)==null?void 0:_.assetList;if(k){const M=f-(v[d]||v).start;for(let N=k.length;N--;){const F=k[N];if(F.duration&&M>=F.startOffset&&M<F.startOffset+F.duration){L=N;break}}}}e.setSchedulePosition(y,L)}}},l=()=>{const f=e.effectivePlayingItem;if(e.isInterstitial(f))return f;const d=t();return e.isInterstitial(d)?d:null},u={get currentTime(){const f=l(),d=e.effectivePlayingItem;return d&&d===f?s(d,"playout",e.effectivePlayingAsset,"timelinePos","currentTime")-d.playout.start:0},set currentTime(f){const d=l(),h=e.effectivePlayingItem;h&&h===d&&c(f+h.playout.start,"playout")},get duration(){const f=l();return f?f.playout.end-f.playout.start:0},get assetPlayers(){var f;const d=(f=l())==null?void 0:f.event.assetList;return d?d.map(h=>e.getAssetPlayer(h.identifier)):[]},get playingIndex(){var f;const d=(f=l())==null?void 0:f.event;return d&&e.effectivePlayingAsset?d.findAssetIndex(e.effectivePlayingAsset):-1},get scheduleItem(){return l()}};this.manager={get events(){var f,d;return((f=e.schedule)==null||(d=f.events)==null?void 0:d.slice(0))||[]},get schedule(){var f,d;return((f=e.schedule)==null||(d=f.items)==null?void 0:d.slice(0))||[]},get interstitialPlayer(){return l()?u:null},get playerQueue(){return e.playerQueue.slice(0)},get bufferingAsset(){return e.bufferingAsset},get bufferingItem(){return t()},get bufferingIndex(){const f=t();return e.findItemIndex(f)},get playingAsset(){return e.effectivePlayingAsset},get playingItem(){return e.effectivePlayingItem},get playingIndex(){const f=e.effectivePlayingItem;return e.findItemIndex(f)},primary:{get bufferedEnd(){return o()},get currentTime(){const f=e.timelinePos;return f>0?f:0},set currentTime(f){c(f,"primary")},get duration(){return a("primary")},get seekableStart(){var f;return((f=e.primaryDetails)==null?void 0:f.fragmentStart)||0}},integrated:{get bufferedEnd(){return s(t(),"integrated",e.bufferingAsset,"bufferedPos","bufferedEnd")},get currentTime(){return s(e.effectivePlayingItem,"integrated",e.effectivePlayingAsset,"timelinePos","currentTime")},set currentTime(f){c(f,"integrated")},get duration(){return a("integrated")},get seekableStart(){var f;return r(((f=e.primaryDetails)==null?void 0:f.fragmentStart)||0,"integrated")}},skip:()=>{const f=e.effectivePlayingItem,d=f==null?void 0:f.event;if(d&&!d.restrictions.skip){const h=e.findItemIndex(f);if(d.appendInPlace){const p=f.playout.start+f.event.duration;c(p+.001,"playout")}else e.advanceAfterAssetEnded(d,h,1/0)}}}}return this.manager}get effectivePlayingItem(){return this.waitingItem||this.playingItem||this.endedItem}get effectivePlayingAsset(){return this.playingAsset||this.endedAsset}get playingLastItem(){var e;const t=this.playingItem,n=(e=this.schedule)==null?void 0:e.items;return!this.playbackStarted||!t||!n?!1:this.findItemIndex(t)===n.length-1}get playbackStarted(){return this.effectivePlayingItem!==null}get currentTime(){var e,t,n;if(this.mediaSelection===null)return;const s=this.waitingItem||this.playingItem;if(this.isInterstitial(s)&&!s.event.appendInPlace)return;let r=this.media;!r&&(e=this.bufferingItem)!=null&&(t=e.event)!=null&&t.appendInPlace&&(r=this.primaryMedia);const o=(n=r)==null?void 0:n.currentTime;if(!(o===void 0||!q(o)))return o}get primaryMedia(){var e;return this.media||((e=this.detachedData)==null?void 0:e.media)||null}isInterstitial(e){return!!(e!=null&&e.event)}retreiveMediaSource(e,t){const n=this.getAssetPlayer(e);n&&this.transferMediaFromPlayer(n,t)}transferMediaFromPlayer(e,t){const n=e.interstitial.appendInPlace,s=e.media;if(n&&s===this.primaryMedia){if(this.bufferingAsset=null,(!t||this.isInterstitial(t)&&!t.event.appendInPlace)&&t&&s){this.detachedData={media:s};return}const r=e.transferMedia();this.log(`transfer MediaSource from ${e} ${Ae(r)}`),this.detachedData=r}else t&&s&&(this.shouldPlay||(this.shouldPlay=!s.paused))}transferMediaTo(e,t){var n,s;if(e.media===t)return;let r=null;const o=this.hls,a=e!==o,c=a&&e.interstitial.appendInPlace,l=(n=this.detachedData)==null?void 0:n.mediaSource;let u;if(o.media)c&&(r=o.transferMedia(),this.detachedData=r),u="Primary";else if(l){const h=this.getBufferingPlayer();h?(r=h.transferMedia(),u=`${h}`):u="detached MediaSource"}else u="detached media";if(!r){if(l)r=this.detachedData,this.log(`using detachedData: MediaSource ${Ae(r)}`);else if(!this.detachedData||o.media===t){const h=this.playerQueue;h.length>1&&h.forEach(p=>{if(a&&p.interstitial.appendInPlace!==c){const m=p.interstitial;this.clearInterstitial(p.interstitial,null),m.appendInPlace=!1,m.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${m}`)}}),this.hls.detachMedia(),this.detachedData={media:t}}}const f=r&&"mediaSource"in r&&((s=r.mediaSource)==null?void 0:s.readyState)!=="closed",d=f&&r?r:t;if(this.log(`${f?"transfering MediaSource":"attaching media"} to ${a?e:"Primary"} from ${u}`),d===r){const h=a&&e.assetId===this.schedule.assetIdAtEnd;d.overrides={duration:this.schedule.duration,endOfStream:!a||h,cueRemoval:!a}}e.attachMedia(d)}onInterstitialCueEnter(){this.onTimeupdate()}checkStart(){const e=this.schedule,t=e.events;if(!t||this.playbackDisabled||!this.media)return;this.bufferedPos===-1&&(this.bufferedPos=0);const n=this.timelinePos,s=this.effectivePlayingItem;if(n===-1){const r=this.hls.startPosition;if(this.timelinePos=r,t.length&&t[0].cue.pre){const o=e.findEventIndex(t[0].identifier);this.setSchedulePosition(o)}else if(r>=0||!this.primaryLive){const o=this.timelinePos=r>0?r:0,a=e.findItemIndexAtTime(o);this.setSchedulePosition(a)}}else if(s&&!this.playingItem){const r=e.findItemIndex(s);this.setSchedulePosition(r)}}advanceAfterAssetEnded(e,t,n){const s=na(e,n);if(!e.isAssetPastPlayoutLimit(s))this.setSchedulePosition(t,s);else{const r=this.schedule.items;if(r){const o=t+1,a=r.length;if(o>=a){this.setSchedulePosition(-1);return}const c=e.resumeTime;this.timelinePos<c&&(this.timelinePos=c,this.checkBuffer()),this.setSchedulePosition(o)}}}setScheduleToAssetAtTime(e,t){const n=this.schedule,s=t.parentIdentifier,r=n.getEvent(s);if(r){const o=n.findEventIndex(s),a=n.findAssetIndex(r,e);this.advanceAfterAssetEnded(r,o,a-1)}}setSchedulePosition(e,t){const n=this.schedule.items;if(!n||this.playbackDisabled)return;this.log(`setSchedulePosition ${e}, ${t}`);const s=e>=0?n[e]:null,r=this.playingItem,o=this.playingLastItem;if(this.isInterstitial(r)){var a;const l=r.event,u=this.playingAsset,f=u==null?void 0:u.identifier,d=f?this.getAssetPlayer(f):null;if(d&&f&&(!this.eventItemsMatch(r,s)||t!==void 0&&f!==((a=l.assetList)==null?void 0:a[t].identifier))){var c;const h=l.findAssetIndex(u);if(this.log(`INTERSTITIAL_ASSET_ENDED ${h+1}/${l.assetList.length} ${ci(u)}`),this.endedAsset=u,this.playingAsset=null,this.hls.trigger(A.INTERSTITIAL_ASSET_ENDED,{asset:u,assetListIndex:h,event:l,schedule:n.slice(0),scheduleIndex:e,player:d}),r!==this.playingItem){this.itemsMatch(r,this.playingItem)&&!this.playingAsset&&this.advanceAfterAssetEnded(l,this.findItemIndex(this.playingItem),h);return}this.retreiveMediaSource(f,s),d.media&&!((c=this.detachedData)!=null&&c.mediaSource)&&d.detachMedia()}if(!this.eventItemsMatch(r,s)&&(this.endedItem=r,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${l} ${rn(r)}`),l.hasPlayed=!0,this.hls.trigger(A.INTERSTITIAL_ENDED,{event:l,schedule:n.slice(0),scheduleIndex:e}),l.cue.once)){this.updateSchedule();const h=this.schedule.items;if(s&&h){const p=this.findItemIndex(s);this.advanceSchedule(p,h,t,r,o)}return}}this.advanceSchedule(e,n,t,r,o)}advanceSchedule(e,t,n,s,r){const o=e>=0?t[e]:null,a=this.primaryMedia,c=this.playerQueue;if(c.length&&c.forEach(l=>{const u=l.interstitial,f=this.schedule.findEventIndex(u.identifier);(f<e||f>e+1)&&this.clearInterstitial(u,o)}),this.isInterstitial(o)){this.timelinePos=Math.min(Math.max(this.timelinePos,o.start),o.end);const l=o.event;if(n===void 0){n=this.schedule.findAssetIndex(l,this.timelinePos);const h=na(l,n-1);if(l.isAssetPastPlayoutLimit(h)){this.advanceAfterAssetEnded(l,e,n);return}n=h}const u=this.waitingItem;this.assetsBuffered(o,a)||this.setBufferingItem(o);let f=this.preloadAssets(l,n);if(this.eventItemsMatch(o,u||s)||(this.waitingItem=o,this.log(`INTERSTITIAL_STARTED ${rn(o)} ${l.appendInPlace?"append in place":""}`),this.hls.trigger(A.INTERSTITIAL_STARTED,{event:l,schedule:t.slice(0),scheduleIndex:e})),!l.assetListLoaded){this.log(`Waiting for ASSET-LIST to complete loading ${l}`);return}if(l.assetListLoader&&(l.assetListLoader.destroy(),l.assetListLoader=void 0),!a){this.log(`Waiting for attachMedia to start Interstitial ${l}`);return}this.waitingItem=this.endedItem=null,this.playingItem=o;const d=l.assetList[n];if(!d){const h=t[e+1],p=this.media;h&&p&&!this.isInterstitial(h)&&p.currentTime<h.start&&(p.currentTime=this.timelinePos=h.start),this.advanceAfterAssetEnded(l,e,n||0);return}if(f||(f=this.getAssetPlayer(d.identifier)),f===null||f.destroyed){const h=l.assetList.length;this.warn(`asset ${n+1}/${h} player destroyed ${l}`),f=this.createAssetPlayer(l,d,n)}if(!this.eventItemsMatch(o,this.bufferingItem)&&l.appendInPlace&&this.isAssetBuffered(d))return;this.startAssetPlayer(f,n,t,e,a),this.shouldPlay&&Ad(f.media)}else o!==null?(this.resumePrimary(o,e,s),this.shouldPlay&&Ad(this.hls.media)):r&&this.isInterstitial(s)&&(this.endedItem=null,this.playingItem=s,s.event.appendInPlace||this.attachPrimary(this.schedule.durations.primary,null))}get playbackDisabled(){return this.hls.config.enableInterstitialPlayback===!1}get primaryDetails(){var e,t;return(e=this.mediaSelection)==null||(t=e.main)==null?void 0:t.details}get primaryLive(){var e;return!!((e=this.primaryDetails)!=null&&e.live)}resumePrimary(e,t,n){var s;if(this.playingItem=e,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(e),this.log(`resuming ${rn(e)}`),!((s=this.detachedData)!=null&&s.mediaSource)){let o=this.timelinePos;(o<e.start||o>=e.end)&&(o=this.getPrimaryResumption(e,t),this.timelinePos=o),this.attachPrimary(o,e)}if(!n)return;const r=this.schedule.items;r&&(this.log(`INTERSTITIALS_PRIMARY_RESUMED ${rn(e)}`),this.hls.trigger(A.INTERSTITIALS_PRIMARY_RESUMED,{schedule:r.slice(0),scheduleIndex:t}),this.checkBuffer())}getPrimaryResumption(e,t){const n=e.start;if(this.primaryLive){const s=this.primaryDetails;if(t===0)return this.hls.startPosition;if(s&&(n<s.fragmentStart||n>s.edge))return this.hls.liveSyncPosition||-1}return n}isAssetBuffered(e){const t=this.getAssetPlayer(e.identifier);return t!=null&&t.hls?t.hls.bufferedToEnd:re.bufferInfo(this.primaryMedia,this.timelinePos,0).end+1>=e.timelineStart+(e.duration||0)}attachPrimary(e,t,n){t?this.setBufferingItem(t):this.bufferingItem=this.playingItem,this.bufferingAsset=null;const s=this.primaryMedia;if(!s)return;const r=this.hls;r.media?this.checkBuffer():(this.transferMediaTo(r,s),n&&this.startLoadingPrimaryAt(e,n)),n||(this.timelinePos=e,this.startLoadingPrimaryAt(e,n))}startLoadingPrimaryAt(e,t){var n;const s=this.hls;!s.loadingEnabled||!s.media||Math.abs((((n=s.mainForwardBufferInfo)==null?void 0:n.start)||s.media.currentTime)-e)>.5?s.startLoad(e,t):s.bufferingEnabled||s.resumeBuffering()}onManifestLoading(){this.stopLoad(),this.schedule.reset(),this.emptyPlayerQueue(),this.clearScheduleState(),this.shouldPlay=!1,this.bufferedPos=this.timelinePos=-1,this.mediaSelection=this.altSelection=this.manager=this.requiredTracks=null,this.hls.off(A.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(A.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(e,t){if(t.level===-1)return;const n=this.hls.levels[t.level],s=ye(ye({},this.mediaSelection||this.altSelection),{},{main:n});this.mediaSelection=s,this.schedule.parseInterstitialDateRanges(s,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&&this.schedule.items&&this.checkStart()}onAudioTrackUpdated(e,t){const n=this.hls.audioTracks[t.id],s=this.mediaSelection;if(!s){this.altSelection=ye(ye({},this.altSelection),{},{audio:n});return}const r=ye(ye({},s),{},{audio:n});this.mediaSelection=r}onSubtitleTrackUpdated(e,t){const n=this.hls.subtitleTracks[t.id],s=this.mediaSelection;if(!s){this.altSelection=ye(ye({},this.altSelection),{},{subtitles:n});return}const r=ye(ye({},s),{},{subtitles:n});this.mediaSelection=r}onAudioTrackSwitching(e,t){const n=P0(t);this.playerQueue.forEach(s=>s.hls.setAudioOption(t)||s.hls.setAudioOption(n))}onSubtitleTrackSwitch(e,t){const n=P0(t);this.playerQueue.forEach(s=>s.hls.setSubtitleOption(t)||t.id!==-1&&s.hls.setSubtitleOption(n))}onBufferCodecs(e,t){const n=t.tracks;n&&(this.requiredTracks=n)}onBufferAppended(e,t){this.checkBuffer()}onBufferFlushed(e,t){const n=this.playingItem;if(n&&!this.itemsMatch(n,this.bufferingItem)&&!this.isInterstitial(n)){const s=this.timelinePos;this.bufferedPos=s,this.checkBuffer()}}onBufferedToEnd(e){const t=this.schedule.events;if(this.bufferedPos<Number.MAX_VALUE&&t){for(let s=0;s<t.length;s++){const r=t[s];if(r.cue.post){var n;const o=this.schedule.findEventIndex(r.identifier),a=(n=this.schedule.items)==null?void 0:n[o];this.isInterstitial(a)&&this.eventItemsMatch(a,this.bufferingItem)&&this.bufferedToItem(a,0);break}}this.bufferedPos=Number.MAX_VALUE}}onMediaEnded(e){const t=this.playingItem;if(!this.playingLastItem&&t){const n=this.findItemIndex(t);this.setSchedulePosition(n+1)}else this.shouldPlay=!1}updateItem(e,t){const n=this.schedule.items;if(e&&n){const s=this.findItemIndex(e,t);return n[s]||null}return null}trimInPlace(e,t){if(this.isInterstitial(e)&&e.event.appendInPlace&&t.end-e.end>.25){e.event.assetList.forEach((r,o)=>{e.event.isAssetPastPlayoutLimit(o)&&this.clearAssetPlayer(r.identifier,null)});const n=e.end+.25,s=re.bufferInfo(this.primaryMedia,n,0);(s.end>n||(s.nextStart||0)>n)&&(this.attachPrimary(n,null),this.flushFrontBuffer(n))}}itemsMatch(e,t){return!!t&&(e===t||e.event&&t.event&&this.eventItemsMatch(e,t)||!e.event&&!t.event&&this.findItemIndex(e)===this.findItemIndex(t))}eventItemsMatch(e,t){var n;return!!t&&(e===t||e.event.identifier===((n=t.event)==null?void 0:n.identifier))}findItemIndex(e,t){return e?this.schedule.findItemIndex(e,t):-1}updateSchedule(){const e=this.mediaSelection;e&&this.schedule.updateSchedule(e,[])}checkBuffer(e){const t=this.schedule.items;if(!t)return;const n=re.bufferInfo(this.primaryMedia,this.timelinePos,0);e&&(this.bufferedPos=this.timelinePos),e||(e=n.len<1),this.updateBufferedPos(n.end,t,e)}updateBufferedPos(e,t,n){const s=this.schedule,r=this.bufferingItem;if(this.bufferedPos>e)return;if(t.length===1&&this.itemsMatch(t[0],r)){this.bufferedPos=e;return}const o=this.playingItem,a=this.findItemIndex(o);let c=s.findItemIndexAtTime(e);if(this.bufferedPos<e){var l,u;const f=this.findItemIndex(r),d=Math.min(f+1,t.length-1),h=t[d];if((c===-1&&r&&e>=r.end||(l=h.event)!=null&&l.appendInPlace&&e+.01>=h.start)&&(c=d),d-a>1&&(r==null||(u=r.event)==null?void 0:u.appendInPlace)===!1)return;if(this.bufferedPos=e,c>f&&c>a)this.bufferedToItem(h);else{const p=this.primaryDetails;this.primaryLive&&p&&e>p.edge-p.targetduration&&h.start<p.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(h)&&this.preloadAssets(h.event,0)}}else n&&o&&!this.itemsMatch(o,r)&&(c===a?this.bufferedToItem(o):c===a+1&&this.bufferedToItem(t[c]))}assetsBuffered(e,t){return e.event.assetList.length===0?!1:!e.event.assetList.some(s=>{const r=this.getAssetPlayer(s.identifier);return!(r!=null&&r.bufferedInPlaceToEnd(t))})}setBufferingItem(e){const t=this.bufferingItem,n=this.schedule;if(this.itemsMatch(e,t))this.bufferingItem!==e&&(this.bufferingItem=e);else{const{items:s,events:r}=n;if(!s||!r)return t;const o=this.isInterstitial(e),a=this.getBufferingPlayer();this.bufferingItem=e,this.bufferedPos=Math.max(e.start,Math.min(e.end,this.timelinePos));const c=a?a.remaining:t?t.end-this.timelinePos:0;this.log(`INTERSTITIALS_BUFFERED_TO_BOUNDARY ${rn(e)}`+(t?` (${c.toFixed(2)} remaining)`:"")),this.playbackDisabled||(o?e.event.assetList.forEach(l=>{const u=this.getAssetPlayer(l.identifier);u&&u.resumeBuffering()}):(this.hls.resumeBuffering(),this.playerQueue.forEach(l=>l.pauseBuffering()))),this.hls.trigger(A.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:r.slice(0),schedule:s.slice(0),bufferingIndex:this.findItemIndex(e),playingIndex:this.findItemIndex(this.playingItem)})}return t}bufferedToItem(e,t=0){const n=this.setBufferingItem(e);if(!this.playbackDisabled){if(this.isInterstitial(e))this.bufferedToEvent(e,t);else if(n!==null){this.bufferingAsset=null;const s=this.detachedData;s?s.mediaSource?this.attachPrimary(e.start,e,!0):this.preloadPrimary(e):this.preloadPrimary(e)}}}preloadPrimary(e){const t=this.findItemIndex(e),n=this.getPrimaryResumption(e,t);this.startLoadingPrimaryAt(n)}bufferedToEvent(e,t){const n=e.event,s=n.assetList.length===0&&!n.assetListLoader,r=n.cue.once;if(s||!r){const o=this.preloadAssets(n,t);if(o!=null&&o.interstitial.appendInPlace){const a=n.assetList[t],c=this.primaryMedia;a&&c&&this.bufferAssetPlayer(o,c)}}}preloadAssets(e,t){const n=e.assetUrl,s=e.assetList.length,r=s===0&&!e.assetListLoader,o=e.cue.once;if(r){const c=e.timelineStart;if(e.appendInPlace){var a;const d=this.playingItem;!this.isInterstitial(d)&&(d==null||(a=d.nextEvent)==null?void 0:a.identifier)===e.identifier&&this.flushFrontBuffer(c+.25)}let l,u=0;if(!this.playingItem&&this.primaryLive&&(u=this.hls.startPosition,u===-1&&(u=this.hls.liveSyncPosition||0)),u&&!(e.cue.pre||e.cue.post)){const d=u-c;d>0&&(l=Math.round(d*1e3)/1e3)}if(this.log(`Load interstitial asset ${t+1}/${n?1:s} ${e}${l?` live-start: ${u} start-offset: ${l}`:""}`),n)return this.createAsset(e,0,0,c,e.duration,n);const f=this.assetListLoader.loadAssetList(e,l);f&&(e.assetListLoader=f)}else if(!o&&s){for(let c=t;c<s;c++){const l=e.assetList[c],u=this.getAssetPlayerQueueIndex(l.identifier);(u===-1||this.playerQueue[u].destroyed)&&!l.error&&this.createAssetPlayer(e,l,c)}return this.getAssetPlayer(e.assetList[t].identifier)}return null}flushFrontBuffer(e){const t=this.requiredTracks;if(!t)return;this.log(`Removing front buffer starting at ${e}`),Object.keys(t).forEach(s=>{this.hls.trigger(A.BUFFER_FLUSHING,{startOffset:e,endOffset:1/0,type:s})})}getAssetPlayerQueueIndex(e){const t=this.playerQueue;for(let n=0;n<t.length;n++)if(e===t[n].assetId)return n;return-1}getAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);return this.playerQueue[t]||null}getBufferingPlayer(){const{playerQueue:e,primaryMedia:t}=this;if(t){for(let n=0;n<e.length;n++)if(e[n].media===t)return e[n]}return null}createAsset(e,t,n,s,r,o){const a={parentIdentifier:e.identifier,identifier:_7(e,o,t),duration:r,startOffset:n,timelineStart:s,uri:o};return this.createAssetPlayer(e,a,t)}createAssetPlayer(e,t,n){const s=this.hls,r=s.userConfig;let o=r.videoPreference;const a=s.loadLevelObj||s.levels[s.currentLevel];(o||a)&&(o=me({},o),a.videoCodec&&(o.videoCodec=a.videoCodec),a.videoRange&&(o.allowedVideoRanges=[a.videoRange]));const c=s.audioTracks[s.audioTrack],l=s.subtitleTracks[s.subtitleTrack];let u=0;if(this.primaryLive||e.appendInPlace){const x=this.timelinePos-t.timelineStart;if(x>1){const E=t.duration;E&&x<E&&(u=x)}}const f=t.identifier,d=ye(ye({},r),{},{autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:s.sessionId,assetPlayerId:f,abrEwmaDefaultEstimate:s.bandwidthEstimate,interstitialsController:void 0,startPosition:u,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:o,audioPreference:c||r.audioPreference,subtitlePreference:l||r.subtitlePreference});e.appendInPlace&&(e.appendInPlaceStarted=!0,t.timelineStart&&(d.timelineOffset=t.timelineStart));const h=d.cmcd;h!=null&&h.sessionId&&h.contentId&&(d.cmcd=me({},h,{contentId:ts(t.uri)})),this.getAssetPlayer(f)&&this.warn(`Duplicate date range identifier ${e} and asset ${f}`);const p=new L7(this.HlsPlayerClass,d,e,t);this.playerQueue.push(p),e.assetList[n]=t;const m=x=>{if(x.live){const T=new Error(`Interstitials MUST be VOD assets ${e}`),_={fatal:!0,type:Z.OTHER_ERROR,details:$.INTERSTITIAL_ASSET_ITEM_ERROR,error:T};this.handleAssetItemError(_,e,this.schedule.findEventIndex(e.identifier),n,T.message);return}const E=x.edge-x.fragmentStart,S=t.duration;(S===null||E>S)&&(this.log(`Interstitial asset "${f}" duration change ${S} > ${E}`),t.duration=E,this.updateSchedule())};p.on(A.LEVEL_UPDATED,(x,{details:E})=>m(E)),p.on(A.LEVEL_PTS_UPDATED,(x,{details:E})=>m(E));const g=(x,E)=>{const S=this.getAssetPlayer(f);if(S&&E.tracks){S.off(A.BUFFER_CODECS,g),S.tracks=E.tracks;const T=this.primaryMedia;this.bufferingAsset===S.assetItem&&T&&!S.media&&this.bufferAssetPlayer(S,T)}};p.on(A.BUFFER_CODECS,g);const y=()=>{var x;const E=this.getAssetPlayer(f);if(this.log(`buffered to end of asset ${E}`),!E)return;const S=this.schedule.findEventIndex(e.identifier),T=(x=this.schedule.items)==null?void 0:x[S];if(this.isInterstitial(T)){const I=e.findAssetIndex(t),w=na(e,I);if(!e.isAssetPastPlayoutLimit(w))this.bufferedToItem(T,w);else{var _;const b=(_=this.schedule.items)==null?void 0:_[S+1];b&&this.bufferedToItem(b)}}};p.on(A.BUFFERED_TO_END,y);const v=x=>()=>{if(!this.getAssetPlayer(f))return;this.shouldPlay=!0;const S=this.schedule.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,S,x)};return p.once(A.MEDIA_ENDED,v(n)),p.once(A.PLAYOUT_LIMIT_REACHED,v(1/0)),p.on(A.ERROR,(x,E)=>{const S=this.getAssetPlayer(f);if(E.details===$.BUFFER_STALLED_ERROR){if(S!=null&&S.media){const T=S.currentTime,_=S.duration-T;T&&e.appendInPlace&&_/S.media.playbackRate<.5?(this.log(`Advancing buffer past end of asset ${f} ${e} at ${S.media.currentTime}`),y()):(this.warn(`Stalled at ${T} of ${T+_} in asset ${f} ${e}`),this.onTimeupdate(),this.checkBuffer(!0))}return}this.handleAssetItemError(E,e,this.schedule.findEventIndex(e.identifier),n,`Asset player error ${E.error} ${e}`)}),p.on(A.DESTROYING,()=>{if(!this.getAssetPlayer(f))return;const E=new Error(`Asset player destroyed unexpectedly ${f}`),S={fatal:!0,type:Z.OTHER_ERROR,details:$.INTERSTITIAL_ASSET_ITEM_ERROR,error:E};this.handleAssetItemError(S,e,this.schedule.findEventIndex(e.identifier),n,E.message)}),this.log(`INTERSTITIAL_ASSET_PLAYER_CREATED ${ci(t)}`),this.hls.trigger(A.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:t,assetListIndex:n,event:e,player:p}),p}clearInterstitial(e,t){e.assetList.forEach(n=>{this.clearAssetPlayer(n.identifier,t)}),e.reset()}resetAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);if(t!==-1){this.log(`reset asset player "${e}" after error`);const n=this.playerQueue[t];this.transferMediaFromPlayer(n,null),n.resetDetails()}}clearAssetPlayer(e,t){const n=this.getAssetPlayerQueueIndex(e);if(n!==-1){this.log(`clear asset player "${e}" toSegment: ${t&&rn(t)}`);const s=this.playerQueue[n];this.transferMediaFromPlayer(s,t),this.playerQueue.splice(n,1),s.destroy()}}emptyPlayerQueue(){let e;for(;e=this.playerQueue.pop();)e.destroy();this.playerQueue=[]}startAssetPlayer(e,t,n,s,r){const{interstitial:o,assetItem:a,assetId:c}=e,l=o.assetList.length,u=this.playingAsset;this.endedAsset=null,this.playingAsset=a,(!u||u.identifier!==c)&&(u&&(this.clearAssetPlayer(u.identifier,n[s]),delete u.error),this.log(`INTERSTITIAL_ASSET_STARTED ${t+1}/${l} ${ci(a)}`),this.hls.trigger(A.INTERSTITIAL_ASSET_STARTED,{asset:a,assetListIndex:t,event:o,schedule:n.slice(0),scheduleIndex:s,player:e})),this.bufferAssetPlayer(e,r)}bufferAssetPlayer(e,t){var n,s;const{interstitial:r,assetItem:o}=e,a=this.schedule.findEventIndex(r.identifier),c=(n=this.schedule.items)==null?void 0:n[a];if(!c)return;this.setBufferingItem(c),this.bufferingAsset=o;const l=this.getBufferingPlayer();if(l===e)return;const u=r.appendInPlace;if(u&&(l==null?void 0:l.interstitial.appendInPlace)===!1)return;const f=(l==null?void 0:l.tracks)||((s=this.detachedData)==null?void 0:s.tracks)||this.requiredTracks;if(u&&o!==this.playingAsset){if(!e.tracks)return;if(f&&!Fm(f,e.tracks)){const d=new Error(`Asset ${ci(o)} SourceBuffer tracks ('${Object.keys(e.tracks)}') are not compatible with primary content tracks ('${Object.keys(f)}')`),h={fatal:!0,type:Z.OTHER_ERROR,details:$.INTERSTITIAL_ASSET_ITEM_ERROR,error:d},p=r.findAssetIndex(o);this.handleAssetItemError(h,r,a,p,d.message);return}}this.transferMediaTo(e,t)}handleAssetItemError(e,t,n,s,r){if(e.details===$.BUFFER_STALLED_ERROR)return;const o=t.assetList[s];this.warn(`INTERSTITIAL_ASSET_ERROR ${o&&ci(o)} ${e.error}`);const a=o==null?void 0:o.identifier,c=this.getAssetPlayerQueueIndex(a),l=this.playerQueue[c]||null,u=this.schedule.items,f=me({},e,{fatal:!1,errorAction:Es(!0),asset:o,assetListIndex:s,event:t,schedule:u,scheduleIndex:n,player:l});if(this.hls.trigger(A.INTERSTITIAL_ASSET_ERROR,f),!e.fatal)return;const d=this.playingAsset,h=new Error(r);if(o&&(this.clearAssetPlayer(a,null),o.error=h),!t.assetList.some(p=>!p.error))t.error=h;else{for(let p=s;p<t.assetList.length;p++)this.resetAssetPlayer(t.assetList[p].identifier);this.updateSchedule()}t.error?this.primaryFallback(t):d&&d.identifier===a&&this.advanceAfterAssetEnded(t,n,s)}primaryFallback(e){const t=e.timelineStart,n=this.effectivePlayingItem;if(this.updateSchedule(),n){this.log(`Fallback to primary from event "${e.identifier}" start: ${t} pos: ${this.timelinePos} playing: ${n?rn(n):"<none>"} error: ${e.error}`);let s=this.timelinePos;s===-1&&(s=this.hls.startPosition);const r=this.updateItem(n,s);this.itemsMatch(n,r)&&this.clearInterstitial(e,null),e.appendInPlace&&(this.attachPrimary(t,null),this.flushFrontBuffer(t));const o=this.schedule.findItemIndexAtTime(s);this.setSchedulePosition(o)}else this.checkStart()}onAssetListLoaded(e,t){var n;const s=t.event,r=s.identifier,o=t.assetListResponse.ASSETS;if(!this.schedule.hasEvent(r))return;const a=s.timelineStart,c=s.duration;let l=0;o.forEach((p,m)=>{const g=parseFloat(p.DURATION);this.createAsset(s,m,l,a+l,g,p.URI),l+=g}),s.duration=l,this.log(`Loaded asset-list with duration: ${l} (was: ${c}) ${s}`);const u=this.waitingItem,f=(u==null?void 0:u.event.identifier)===r;this.updateSchedule();const d=(n=this.bufferingItem)==null?void 0:n.event;if(f){var h;const p=this.schedule.findEventIndex(r),m=(h=this.schedule.items)==null?void 0:h[p];if(m){if(!this.playingItem&&this.timelinePos>m.end&&this.schedule.findItemIndexAtTime(this.timelinePos)!==p){s.error=new Error(`Interstitial no longer within playback range ${this.timelinePos} ${s}`),this.primaryFallback(s);return}this.setBufferingItem(m)}this.setSchedulePosition(p)}else if((d==null?void 0:d.identifier)===r&&d.appendInPlace){const p=s.assetList[0],m=this.getAssetPlayer(p.identifier),g=this.primaryMedia;p&&m&&g&&this.bufferAssetPlayer(m,g)}}onError(e,t){switch(t.details){case $.ASSET_LIST_PARSING_ERROR:case $.ASSET_LIST_LOAD_ERROR:case $.ASSET_LIST_LOAD_TIMEOUT:{const n=t.interstitial;n&&this.primaryFallback(n);break}case $.BUFFER_STALLED_ERROR:{this.onTimeupdate(),this.checkBuffer(!0);break}}}}const Sd=500;class P7 extends cu{constructor(e,t,n){super(e,t,n,"subtitle-stream-controller",X.SUBTITLE),this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(A.LEVEL_LOADED,this.onLevelLoaded,this),e.on(A.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(A.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(A.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(A.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(A.BUFFER_FLUSHING,this.onBufferFlushing,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(A.LEVEL_LOADED,this.onLevelLoaded,this),e.off(A.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(A.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(A.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(A.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(A.BUFFER_FLUSHING,this.onBufferFlushing,this)}startLoad(e,t){this.stopLoad(),this.state=V.IDLE,this.setInterval(Sd),this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}onManifestLoading(){super.onManifestLoading(),this.mainDetails=null}onMediaDetaching(e,t){this.tracksBuffered=[],super.onMediaDetaching(e,t)}onLevelLoaded(e,t){this.mainDetails=t.details}onSubtitleFragProcessed(e,t){const{frag:n,success:s}=t;if(this.fragContextChanged(n)||(De(n)&&(this.fragPrevious=n),this.state=V.IDLE),!s)return;const r=this.tracksBuffered[this.currentTrackId];if(!r)return;let o;const a=n.start;for(let l=0;l<r.length;l++)if(a>=r[l].start&&a<=r[l].end){o=r[l];break}const c=n.start+n.duration;o?o.end=c:(o={start:a,end:c},r.push(o)),this.fragmentTracker.fragBuffered(n),this.fragBufferedComplete(n,null),this.media&&this.tick()}onBufferFlushing(e,t){const{startOffset:n,endOffset:s}=t;if(n===0&&s!==Number.POSITIVE_INFINITY){const r=s-1;if(r<=0)return;t.endOffsetSubtitles=Math.max(0,r),this.tracksBuffered.forEach(o=>{for(let a=0;a<o.length;){if(o[a].end<=r){o.shift();continue}else if(o[a].start<r)o[a].start=r;else break;a++}}),this.fragmentTracker.removeFragmentsInRange(n,r,X.SUBTITLE)}}onError(e,t){const n=t.frag;(n==null?void 0:n.type)===X.SUBTITLE&&(t.details===$.FRAG_GAP&&this.fragmentTracker.fragBuffered(n,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==V.STOPPED&&(this.state=V.IDLE))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){if(this.levels&&P1(this.levels,t)){this.levels=t.map(n=>new vs(n));return}this.tracksBuffered=[],this.levels=t.map(n=>{const s=new vs(n);return this.tracksBuffered[s.id]=[],s}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,X.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,t){var n;if(this.currentTrackId=t.id,!((n=this.levels)!=null&&n.length)||this.currentTrackId===-1){this.clearInterval();return}const s=this.levels[this.currentTrackId];s!=null&&s.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,s&&this.state!==V.STOPPED&&this.setInterval(Sd)}onSubtitleTrackLoaded(e,t){var n;const{currentTrackId:s,levels:r}=this,{details:o,id:a}=t;if(!r){this.warn(`Subtitle tracks were reset while loading level ${a}`);return}const c=r[a];if(a>=r.length||!c)return;this.log(`Subtitle track ${a} loaded [${o.startSN},${o.endSN}]${o.lastPartSn?`[part-${o.lastPartSn}-${o.lastPartIndex}]`:""},duration:${o.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let l=0;if(o.live||(n=c.details)!=null&&n.live){if(o.deltaUpdateFailed)return;const f=this.mainDetails;if(!f){this.startFragRequested=!1;return}const d=f.fragments[0];if(!c.details)o.hasProgramDateTime&&f.hasProgramDateTime?(zr(o,f),l=o.fragmentStart):d&&(l=d.start,Xl(o,l));else{var u;l=this.alignPlaylists(o,c.details,(u=this.levelLastLoaded)==null?void 0:u.details),l===0&&d&&(l=d.start,Xl(o,l))}f&&!this.startFragRequested&&this.setStartPosition(f,l)}c.details=o,this.levelLastLoaded=c,a===s&&(this.hls.trigger(A.SUBTITLE_TRACK_UPDATED,{details:o,id:a,groupId:t.groupId}),this.tick(),o.live&&!this.fragCurrent&&this.media&&this.state===V.IDLE&&(qn(null,o.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),c.details=void 0)))}_handleFragmentLoadComplete(e){const{frag:t,payload:n}=e,s=t.decryptdata,r=this.hls;if(!this.fragContextChanged(t)&&n&&n.byteLength>0&&s!=null&&s.key&&s.iv&&xi(s.method)){const o=performance.now();this.decrypter.decrypt(new Uint8Array(n),s.key.buffer,s.iv.buffer,lu(s.method)).catch(a=>{throw r.trigger(A.ERROR,{type:Z.MEDIA_ERROR,details:$.FRAG_DECRYPT_ERROR,fatal:!1,error:a,reason:a.message,frag:t}),a}).then(a=>{const c=performance.now();r.trigger(A.FRAG_DECRYPTED,{frag:t,payload:a,stats:{tstart:o,tdecrypt:c}})}).catch(a=>{this.warn(`${a.name}: ${a.message}`),this.state=V.IDLE})}}doTick(){if(!this.media){this.state=V.IDLE;return}if(this.state===V.IDLE){const{currentTrackId:e,levels:t}=this,n=t==null?void 0:t[e];if(!n||!t.length||!n.details||this.waitForLive(n))return;const{config:s}=this,r=this.getLoadPosition(),o=re.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],r,s.maxBufferHole),{end:a,len:c}=o,l=n.details,u=this.hls.maxBufferLength+l.levelTargetDuration;if(c>u)return;const f=l.fragments,d=f.length,h=l.edge;let p=null;const m=this.fragPrevious;if(a<h){const v=s.maxFragLookUpTolerance,x=a>h-v?0:v;p=qn(m,f,Math.max(f[0].start,a),x),!p&&m&&m.start<f[0].start&&(p=f[0])}else p=f[d-1];if(p=this.filterReplacedPrimary(p,n.details),!p)return;const g=p.sn-l.startSN,y=f[g-1];if(y&&y.cc===p.cc&&this.fragmentTracker.getState(y)===Be.NOT_LOADED&&(p=y),this.fragmentTracker.getState(p)===Be.NOT_LOADED){const v=this.mapToInitFragWhenRequired(p);v&&this.loadFragment(v,n,a)}}}loadFragment(e,t,n){De(e)?super.loadFragment(e,t,n):this._loadInitSegment(e,t)}get mediaBufferTimeRanges(){return new k7(this.tracksBuffered[this.currentTrackId]||[])}}class k7{constructor(e){this.buffered=void 0;const t=(n,s,r)=>{if(s=s>>>0,s>r-1)throw new DOMException(`Failed to execute '${n}' on 'TimeRanges': The index provided (${s}) is greater than the maximum bound (${r})`);return e[s][n]};this.buffered={get length(){return e.length},end(n){return t("end",n,e.length)},start(n){return t("start",n,e.length)}}}}const B7={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},K1=i=>String.fromCharCode(B7[i]||i),bt=15,jt=100,F7={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},O7={17:2,18:4,21:6,22:8,23:10,19:13,20:15},M7={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},N7={25:2,26:4,29:6,30:8,31:10,27:13,28:15},U7=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class $7{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const n=typeof t=="function"?t():t;pe.log(`${this.time} [${e}] ${n}`)}}}const Cn=function(e){const t=[];for(let n=0;n<e.length;n++)t.push(e[n].toString(16));return t};class V1{constructor(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(e){const t=["foreground","underline","italics","background","flash"];for(let n=0;n<t.length;n++){const s=t[n];e.hasOwnProperty(s)&&(this[s]=e[s])}}isDefault(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash}equals(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash}copy(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class H7{constructor(){this.uchar=" ",this.penState=new V1}reset(){this.uchar=" ",this.penState.reset()}setChar(e,t){this.uchar=e,this.penState.copy(t)}setPenState(e){this.penState.copy(e)}equals(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)}copy(e){this.uchar=e.uchar,this.penState.copy(e.penState)}isEmpty(){return this.uchar===" "&&this.penState.isDefault()}}class G7{constructor(e){this.chars=[],this.pos=0,this.currPenState=new V1,this.cueStartTime=null,this.logger=void 0;for(let t=0;t<jt;t++)this.chars.push(new H7);this.logger=e}equals(e){for(let t=0;t<jt;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<jt;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<jt;t++)if(!this.chars[t].isEmpty()){e=!1;break}return e}setCursor(e){this.pos!==e&&(this.pos=e),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>jt&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=jt)}moveCursor(e){const t=this.pos+e;if(e>1)for(let n=this.pos+1;n<t+1;n++)this.chars[n].setPenState(this.currPenState);this.setCursor(t)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(e){e>=144&&this.backSpace();const t=K1(e);if(this.pos>=jt){this.logger.log(0,()=>"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1)}clearFromPos(e){let t;for(t=e;t<jt;t++)this.chars[t].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const e=[];let t=!0;for(let n=0;n<jt;n++){const s=this.chars[n].uchar;s!==" "&&(t=!1),e.push(s)}return t?"":e.join("")}setPenStyles(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}}class ia{constructor(e){this.rows=[],this.currRow=bt-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<bt;t++)this.rows.push(new G7(e));this.logger=e}reset(){for(let e=0;e<bt;e++)this.rows[e].clear();this.currRow=bt-1}equals(e){let t=!0;for(let n=0;n<bt;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t}copy(e){for(let t=0;t<bt;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<bt;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(e){this.rows[this.currRow].insertChar(e)}setPen(e){this.rows[this.currRow].setPenStyles(e)}moveCursor(e){this.rows[this.currRow].moveCursor(e)}setCursor(e){this.logger.log(2,"setCursor: "+e),this.rows[this.currRow].setCursor(e)}setPAC(e){this.logger.log(2,()=>"pacData = "+Ae(e));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let a=0;a<bt;a++)this.rows[a].clear();const r=this.currRow+1-this.nrRollUpRows,o=this.lastOutputScreen;if(o){const a=o.rows[r].cueStartTime,c=this.logger.time;if(a!==null&&c!==null&&a<c)for(let l=0;l<this.nrRollUpRows;l++)this.rows[t-this.nrRollUpRows+l+1].copy(o.rows[r+l])}}this.currRow=t;const n=this.rows[this.currRow];if(e.indent!==null){const r=e.indent,o=Math.max(r-1,0);n.setCursor(e.indent),e.color=n.chars[o].penState.foreground}const s={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(s)}setBkgData(e){this.logger.log(2,()=>"bkgData = "+Ae(e)),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(this.nrRollUpRows===null){this.logger.log(3,"roll_up but nrRollUpRows not set yet");return}this.logger.log(1,()=>this.getDisplayText());const e=this.currRow+1-this.nrRollUpRows,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let n="",s=-1;for(let r=0;r<bt;r++){const o=this.rows[r].getTextString();o&&(s=r+1,e?t.push("Row "+s+": '"+o+"'"):t.push(o.trim()))}return t.length>0&&(e?n="["+t.join(" | ")+"]":n=t.join(`
- `)),n}getTextAndFormat(){return this.rows}}class Td{constructor(e,t,n){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new ia(n),this.nonDisplayedMemory=new ia(n),this.lastOutputScreen=new ia(n),this.currRollUpRow=this.displayedMemory.rows[bt-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=n}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[bt-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,()=>"MODE="+e),this.mode==="MODE_POP-ON"?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),this.mode!=="MODE_ROLL-UP"&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)}insertChars(e){for(let n=0;n<e.length;n++)this.writeScreen.insertChar(e[n]);const t=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,()=>t+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const t={flash:!1};if(t.underline=e%2===1,t.italics=e>=46,t.italics)t.foreground="white";else{const n=Math.floor(e/2)-16,s=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=s[n]}this.logger.log(2,"MIDROW: "+Ae(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){const t=this.logger.time;t!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=t:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t),this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}class bd{constructor(e,t,n){this.channels=void 0,this.currentChannel=0,this.cmdHistory=V7(),this.logger=void 0;const s=this.logger=new $7;this.channels=[null,new Td(e,t,s),new Td(e+1,n,s)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){this.logger.time=e;for(let n=0;n<t.length;n+=2){const s=t[n]&127,r=t[n+1]&127;let o=!1,a=null;if(s===0&&r===0)continue;this.logger.log(3,()=>"["+Cn([t[n],t[n+1]])+"] -> ("+Cn([s,r])+")");const c=this.cmdHistory;if(s>=16&&s<=31){if(K7(s,r,c)){tr(null,null,c),this.logger.log(3,()=>"Repeated command ("+Cn([s,r])+") is dropped");continue}tr(s,r,this.cmdHistory),o=this.parseCmd(s,r),o||(o=this.parseMidrow(s,r)),o||(o=this.parsePAC(s,r)),o||(o=this.parseBackgroundAttributes(s,r))}else tr(null,null,c);if(!o&&(a=this.parseChars(s,r),a)){const u=this.currentChannel;u&&u>0?this.channels[u].insertChars(a):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!o&&!a&&this.logger.log(2,()=>"Couldn't parse cleaned data "+Cn([s,r])+" orig: "+Cn([t[n],t[n+1]]))}}parseCmd(e,t){const n=(e===20||e===28||e===21||e===29)&&t>=32&&t<=47,s=(e===23||e===31)&&t>=33&&t<=35;if(!(n||s))return!1;const r=e===20||e===21||e===23?1:2,o=this.channels[r];return e===20||e===21||e===28||e===29?t===32?o.ccRCL():t===33?o.ccBS():t===34?o.ccAOF():t===35?o.ccAON():t===36?o.ccDER():t===37?o.ccRU(2):t===38?o.ccRU(3):t===39?o.ccRU(4):t===40?o.ccFON():t===41?o.ccRDC():t===42?o.ccTR():t===43?o.ccRTD():t===44?o.ccEDM():t===45?o.ccCR():t===46?o.ccENM():t===47&&o.ccEOC():o.ccTO(t-32),this.currentChannel=r,!0}parseMidrow(e,t){let n=0;if((e===17||e===25)&&t>=32&&t<=47){if(e===17?n=1:n=2,n!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const s=this.channels[n];return s?(s.ccMIDROW(t),this.logger.log(3,()=>"MIDROW ("+Cn([e,t])+")"),!0):!1}return!1}parsePAC(e,t){let n;const s=(e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127,r=(e===16||e===24)&&t>=64&&t<=95;if(!(s||r))return!1;const o=e<=23?1:2;t>=64&&t<=95?n=o===1?F7[e]:M7[e]:n=o===1?O7[e]:N7[e];const a=this.channels[o];return a?(a.setPAC(this.interpretPAC(n,t)),this.currentChannel=o,!0):!1}interpretPAC(e,t){let n;const s={color:null,italics:!1,indent:null,underline:!1,row:e};return t>95?n=t-96:n=t-64,s.underline=(n&1)===1,n<=13?s.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(s.italics=!0,s.color="white"):s.indent=Math.floor((n-16)/2)*4,s}parseChars(e,t){let n,s=null,r=null;if(e>=25?(n=2,r=e-8):(n=1,r=e),r>=17&&r<=19){let o;r===17?o=t+80:r===18?o=t+112:o=t+144,this.logger.log(2,()=>"Special char '"+K1(o)+"' in channel "+n),s=[o]}else e>=32&&e<=127&&(s=t===0?[e]:[e,t]);return s&&this.logger.log(3,()=>"Char codes = "+Cn(s).join(",")),s}parseBackgroundAttributes(e,t){const n=(e===16||e===24)&&t>=32&&t<=47,s=(e===23||e===31)&&t>=45&&t<=47;if(!(n||s))return!1;let r;const o={};e===16||e===24?(r=Math.floor((t-32)/2),o.background=U7[r],t%2===1&&(o.background=o.background+"_semi")):t===45?o.background="transparent":(o.foreground="black",t===47&&(o.underline=!0));const a=e<=23?1:2;return this.channels[a].setBkgData(o),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}tr(null,null,this.cmdHistory)}cueSplitAtTime(e){for(let t=0;t<this.channels.length;t++){const n=this.channels[t];n&&n.cueSplitAtTime(e)}}}function tr(i,e,t){t.a=i,t.b=e}function K7(i,e,t){return t.a===i&&t.b===e}function V7(){return{a:null,b:null}}var Eu=function(){if(Wr!=null&&Wr.VTTCue)return self.VTTCue;const i=["","lr","rl"],e=["start","middle","end","left","right"];function t(a,c){if(typeof c!="string"||!Array.isArray(a))return!1;const l=c.toLowerCase();return~a.indexOf(l)?l:!1}function n(a){return t(i,a)}function s(a){return t(e,a)}function r(a,...c){let l=1;for(;l<arguments.length;l++){const u=arguments[l];for(const f in u)a[f]=u[f]}return a}function o(a,c,l){const u=this,f={enumerable:!0};u.hasBeenReset=!1;let d="",h=!1,p=a,m=c,g=l,y=null,v="",x=!0,E="auto",S="start",T=50,_="middle",I=50,w="middle";Object.defineProperty(u,"id",r({},f,{get:function(){return d},set:function(b){d=""+b}})),Object.defineProperty(u,"pauseOnExit",r({},f,{get:function(){return h},set:function(b){h=!!b}})),Object.defineProperty(u,"startTime",r({},f,{get:function(){return p},set:function(b){if(typeof b!="number")throw new TypeError("Start time must be set to a number.");p=b,this.hasBeenReset=!0}})),Object.defineProperty(u,"endTime",r({},f,{get:function(){return m},set:function(b){if(typeof b!="number")throw new TypeError("End time must be set to a number.");m=b,this.hasBeenReset=!0}})),Object.defineProperty(u,"text",r({},f,{get:function(){return g},set:function(b){g=""+b,this.hasBeenReset=!0}})),Object.defineProperty(u,"region",r({},f,{get:function(){return y},set:function(b){y=b,this.hasBeenReset=!0}})),Object.defineProperty(u,"vertical",r({},f,{get:function(){return v},set:function(b){const L=n(b);if(L===!1)throw new SyntaxError("An invalid or illegal string was specified.");v=L,this.hasBeenReset=!0}})),Object.defineProperty(u,"snapToLines",r({},f,{get:function(){return x},set:function(b){x=!!b,this.hasBeenReset=!0}})),Object.defineProperty(u,"line",r({},f,{get:function(){return E},set:function(b){if(typeof b!="number"&&b!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");E=b,this.hasBeenReset=!0}})),Object.defineProperty(u,"lineAlign",r({},f,{get:function(){return S},set:function(b){const L=s(b);if(!L)throw new SyntaxError("An invalid or illegal string was specified.");S=L,this.hasBeenReset=!0}})),Object.defineProperty(u,"position",r({},f,{get:function(){return T},set:function(b){if(b<0||b>100)throw new Error("Position must be between 0 and 100.");T=b,this.hasBeenReset=!0}})),Object.defineProperty(u,"positionAlign",r({},f,{get:function(){return _},set:function(b){const L=s(b);if(!L)throw new SyntaxError("An invalid or illegal string was specified.");_=L,this.hasBeenReset=!0}})),Object.defineProperty(u,"size",r({},f,{get:function(){return I},set:function(b){if(b<0||b>100)throw new Error("Size must be between 0 and 100.");I=b,this.hasBeenReset=!0}})),Object.defineProperty(u,"align",r({},f,{get:function(){return w},set:function(b){const L=s(b);if(!L)throw new SyntaxError("An invalid or illegal string was specified.");w=L,this.hasBeenReset=!0}})),u.displayState=void 0}return o.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},o}();class j7{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function j1(i){function e(n,s,r,o){return(n|0)*3600+(s|0)*60+(r|0)+parseFloat(o||0)}const t=i.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return t?parseFloat(t[2])>59?e(t[2],t[3],0,t[4]):e(t[1],t[2],t[3],t[4]):null}class q7{constructor(){this.values=Object.create(null)}set(e,t){!this.get(e)&&t!==""&&(this.values[e]=t)}get(e,t,n){return n?this.has(e)?this.values[e]:t[n]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,n){for(let s=0;s<n.length;++s)if(t===n[s]){this.set(e,t);break}}integer(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))}percent(e,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){const n=parseFloat(t);if(n>=0&&n<=100)return this.set(e,n),!0}return!1}}function q1(i,e,t,n){const s=n?i.split(n):[i];for(const r in s){if(typeof s[r]!="string")continue;const o=s[r].split(t);if(o.length!==2)continue;const a=o[0],c=o[1];e(a,c)}}const sc=new Eu(0,0,""),nr=sc.align==="middle"?"middle":"center";function W7(i,e,t){const n=i;function s(){const a=j1(i);if(a===null)throw new Error("Malformed timestamp: "+n);return i=i.replace(/^[^\sa-zA-Z-]+/,""),a}function r(a,c){const l=new q7;q1(a,function(d,h){let p;switch(d){case"region":for(let m=t.length-1;m>=0;m--)if(t[m].id===h){l.set(d,t[m].region);break}break;case"vertical":l.alt(d,h,["rl","lr"]);break;case"line":p=h.split(","),l.integer(d,p[0]),l.percent(d,p[0])&&l.set("snapToLines",!1),l.alt(d,p[0],["auto"]),p.length===2&&l.alt("lineAlign",p[1],["start",nr,"end"]);break;case"position":p=h.split(","),l.percent(d,p[0]),p.length===2&&l.alt("positionAlign",p[1],["start",nr,"end","line-left","line-right","auto"]);break;case"size":l.percent(d,h);break;case"align":l.alt(d,h,["start",nr,"end","left","right"]);break}},/:/,/\s/),c.region=l.get("region",null),c.vertical=l.get("vertical","");let u=l.get("line","auto");u==="auto"&&sc.line===-1&&(u=-1),c.line=u,c.lineAlign=l.get("lineAlign","start"),c.snapToLines=l.get("snapToLines",!0),c.size=l.get("size",100),c.align=l.get("align",nr);let f=l.get("position","auto");f==="auto"&&sc.position===50&&(f=c.align==="start"||c.align==="left"?0:c.align==="end"||c.align==="right"?100:50),c.position=f}function o(){i=i.replace(/^\s+/,"")}if(o(),e.startTime=s(),o(),i.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+n);i=i.slice(3),o(),e.endTime=s(),o(),r(i,e)}function W1(i){return i.replace(/<br(?: \/)?>/gi,`
- `)}class z7{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new j7,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const t=this;e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));function n(){let r=t.buffer,o=0;for(r=W1(r);o<r.length&&r[o]!=="\r"&&r[o]!==`
- `;)++o;const a=r.slice(0,o);return r[o]==="\r"&&++o,r[o]===`
- `&&++o,t.buffer=r.slice(o),a}function s(r){q1(r,function(o,a){},/:/)}try{let r="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;r=n();const a=r.match(/^()?WEBVTT([ \t].*)?$/);if(!(a!=null&&a[0]))throw new Error("Malformed WebVTT signature.");t.state="HEADER"}let o=!1;for(;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(o?o=!1:r=n(),t.state){case"HEADER":/:/.test(r)?s(r):r||(t.state="ID");continue;case"NOTE":r||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(r)){t.state="NOTE";break}if(!r)continue;if(t.cue=new Eu(0,0,""),t.state="CUE",r.indexOf("-->")===-1){t.cue.id=r;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{W7(r,t.cue,t.regionList)}catch{t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const a=r.indexOf("-->")!==-1;if(!r||a&&(o=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=`
- `),t.cue.text+=r}continue;case"BADCUE":r||(t.state="ID")}}}catch{t.state==="CUETEXT"&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this}flush(){const e=this;try{if((e.cue||e.state==="HEADER")&&(e.buffer+=`
- `,e.parse()),e.state==="INITIAL"||e.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this}}const Q7=/\r\n|\n\r|\n|\r/g,sa=function(e,t,n=0){return e.slice(n,n+t.length)===t},Y7=function(e){let t=parseInt(e.slice(-3));const n=parseInt(e.slice(-6,-4)),s=parseInt(e.slice(-9,-7)),r=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!q(t)||!q(n)||!q(s)||!q(r))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*n,t+=60*1e3*s,t+=60*60*1e3*r,t};function Au(i,e,t){return ts(i.toString())+ts(e.toString())+ts(t)}const X7=function(e,t,n){let s=e[t],r=e[s.prevCC];if(!r||!r.new&&s.new){e.ccOffset=e.presentationOffset=s.start,s.new=!1;return}for(;(o=r)!=null&&o.new;){var o;e.ccOffset+=s.start-r.start,s.new=!1,s=r,r=e[s.prevCC]}e.presentationOffset=n};function J7(i,e,t,n,s,r,o){const a=new z7,c=ft(new Uint8Array(i)).trim().replace(Q7,`
- `).split(`
- `),l=[],u=e?h_(e.baseTime,e.timescale):0;let f="00:00.000",d=0,h=0,p,m=!0;a.oncue=function(g){const y=t[n];let v=t.ccOffset;const x=(d-u)/9e4;if(y!=null&&y.new&&(h!==void 0?v=t.ccOffset=y.start:X7(t,n,x)),x){if(!e){p=new Error("Missing initPTS for VTT MPEGTS");return}v=x-t.presentationOffset}const E=g.endTime-g.startTime,S=mt((g.startTime+v-h)*9e4,s*9e4)/9e4;g.startTime=Math.max(S,0),g.endTime=Math.max(S+E,0);const T=g.text.trim();g.text=decodeURIComponent(encodeURIComponent(T)),g.id||(g.id=Au(g.startTime,g.endTime,T)),g.endTime>0&&l.push(g)},a.onparsingerror=function(g){p=g},a.onflush=function(){if(p){o(p);return}r(l)},c.forEach(g=>{if(m)if(sa(g,"X-TIMESTAMP-MAP=")){m=!1,g.slice(16).split(",").forEach(y=>{sa(y,"LOCAL:")?f=y.slice(6):sa(y,"MPEGTS:")&&(d=parseInt(y.slice(7)))});try{h=Y7(f)/1e3}catch(y){p=y}return}else g===""&&(m=!1);a.parse(g+`
- `)}),a.flush()}const ra="stpp.ttml.im1t",z1=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Q1=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,Z7={left:"start",center:"center",right:"end",start:"start",end:"end"};function _d(i,e,t,n){const s=le(new Uint8Array(i),["mdat"]);if(s.length===0){n(new Error("Could not parse IMSC1 mdat"));return}const r=s.map(a=>ft(a)),o=d_(e.baseTime,1,e.timescale);try{r.forEach(a=>t(eI(a,o)))}catch(a){n(a)}}function eI(i,e){const s=new DOMParser().parseFromString(i,"text/xml").getElementsByTagName("tt")[0];if(!s)throw new Error("Invalid ttml");const r={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},o=Object.keys(r).reduce((f,d)=>(f[d]=s.getAttribute(`ttp:${d}`)||r[d],f),{}),a=s.getAttribute("xml:space")!=="preserve",c=Id(oa(s,"styling","style")),l=Id(oa(s,"layout","region")),u=oa(s,"body","[begin]");return[].map.call(u,f=>{const d=Y1(f,a);if(!d||!f.hasAttribute("begin"))return null;const h=la(f.getAttribute("begin"),o),p=la(f.getAttribute("dur"),o);let m=la(f.getAttribute("end"),o);if(h===null)throw Cd(f);if(m===null){if(p===null)throw Cd(f);m=h+p}const g=new Eu(h-e,m-e,d);g.id=Au(g.startTime,g.endTime,g.text);const y=l[f.getAttribute("region")],v=c[f.getAttribute("style")],x=tI(y,v,c),{textAlign:E}=x;if(E){const S=Z7[E];S&&(g.lineAlign=S),g.align=E}return me(g,x),g}).filter(f=>f!==null)}function oa(i,e,t){const n=i.getElementsByTagName(e)[0];return n?[].slice.call(n.querySelectorAll(t)):[]}function Id(i){return i.reduce((e,t)=>{const n=t.getAttribute("xml:id");return n&&(e[n]=t),e},{})}function Y1(i,e){return[].slice.call(i.childNodes).reduce((t,n,s)=>{var r;return n.nodeName==="br"&&s?t+`
- `:(r=n.childNodes)!=null&&r.length?Y1(n,e):e?t+n.textContent.trim().replace(/\s+/g," "):t+n.textContent},"")}function tI(i,e,t){const n="http://www.w3.org/ns/ttml#styling";let s=null;const r=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],o=i!=null&&i.hasAttribute("style")?i.getAttribute("style"):null;return o&&t.hasOwnProperty(o)&&(s=t[o]),r.reduce((a,c)=>{const l=aa(e,n,c)||aa(i,n,c)||aa(s,n,c);return l&&(a[c]=l),a},{})}function aa(i,e,t){return i&&i.hasAttributeNS(e,t)?i.getAttributeNS(e,t):null}function Cd(i){return new Error(`Could not parse ttml timestamp ${i}`)}function la(i,e){if(!i)return null;let t=j1(i);return t===null&&(z1.test(i)?t=nI(i,e):Q1.test(i)&&(t=iI(i,e))),t}function nI(i,e){const t=z1.exec(i),n=(t[4]|0)+(t[5]|0)/e.subFrameRate;return(t[1]|0)*3600+(t[2]|0)*60+(t[3]|0)+n/e.frameRate}function iI(i,e){const t=Q1.exec(i),n=Number(t[1]);switch(t[2]){case"h":return n*3600;case"m":return n*60;case"ms":return n*1e3;case"f":return n/e.frameRate;case"t":return n/e.tickRate}return n}class ir{constructor(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}dispatchCue(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(e,t,n){(this.startTime===null||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}class sI{constructor(e){this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Rd(),this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},e.on(A.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(A.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(A.MANIFEST_LOADING,this.onManifestLoading,this),e.on(A.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(A.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(A.FRAG_LOADING,this.onFragLoading,this),e.on(A.FRAG_LOADED,this.onFragLoaded,this),e.on(A.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(A.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(A.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(A.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(A.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(A.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(A.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(A.MANIFEST_LOADING,this.onManifestLoading,this),e.off(A.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(A.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(A.FRAG_LOADING,this.onFragLoading,this),e.off(A.FRAG_LOADED,this.onFragLoaded,this),e.off(A.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(A.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(A.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(A.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(A.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const e=new ir(this,"textTrack1"),t=new ir(this,"textTrack2"),n=new ir(this,"textTrack3"),s=new ir(this,"textTrack4");this.cea608Parser1=new bd(1,e,t),this.cea608Parser2=new bd(3,n,s)}addCues(e,t,n,s,r){let o=!1;for(let a=r.length;a--;){const c=r[a],l=rI(c[0],c[1],t,n);if(l>=0&&(c[0]=Math.min(c[0],t),c[1]=Math.max(c[1],n),o=!0,l/(n-t)>.5))return}if(o||r.push([t,n]),this.config.renderTextTracksNatively){const a=this.captionsTracks[e];this.Cues.newCue(a,t,n,s)}else{const a=this.Cues.newCue(null,t,n,s);this.hls.trigger(A.CUES_PARSED,{type:"captions",cues:a,track:e})}}onInitPtsFound(e,{frag:t,id:n,initPTS:s,timescale:r}){const{unparsedVttFrags:o}=this;n===X.MAIN&&(this.initPTS[t.cc]={baseTime:s,timescale:r}),o.length&&(this.unparsedVttFrags=[],o.forEach(a=>{this.initPTS[a.frag.cc]?this.onFragLoaded(A.FRAG_LOADED,a):this.hls.trigger(A.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:a.frag,error:new Error("Subtitle discontinuity domain does not match main")})}))}getExistingTrack(e,t){const{media:n}=this;if(n)for(let s=0;s<n.textTracks.length;s++){const r=n.textTracks[s];if(Ld(r,{name:e,lang:t,characteristics:"transcribes-spoken-dialog,describes-music-and-sound"}))return r}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:n,media:s}=this,{label:r,languageCode:o}=t[e],a=this.getExistingTrack(r,o);if(a)n[e]=a,pi(n[e]),$1(n[e],s);else{const c=this.createTextTrack("captions",r,o);c&&(c[e]=!0,n[e]=c)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const n=t.label,s={_id:e,label:n,kind:"captions",default:t.media?!!t.media.default:!1,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=s,this.hls.trigger(A.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[s]})}createTextTrack(e,t,n){const s=this.media;if(s)return s.addTextTrack(e,t,n)}onMediaAttaching(e,t){this.media=t.media,t.mediaSource||this._cleanTracks()}onMediaDetaching(e,t){const n=!!t.transferMedia;if(this.media=null,n)return;const{captionsTracks:s}=this;Object.keys(s).forEach(r=>{pi(s[r]),delete s[r]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=Rd(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const t=e.textTracks;if(t)for(let n=0;n<t.length;n++)pi(t[n])}onSubtitleTracksUpdated(e,t){const n=t.subtitleTracks||[],s=n.some(r=>r.textCodec===ra);if(this.config.enableWebVTT||s&&this.config.enableIMSC1){if(P1(this.tracks,n)){this.tracks=n;return}if(this.textTracks=[],this.tracks=n,this.config.renderTextTracksNatively){const o=this.media,a=o?yr(o.textTracks):null;if(this.tracks.forEach((c,l)=>{let u;if(a){let f=null;for(let d=0;d<a.length;d++)if(a[d]&&Ld(a[d],c)){f=a[d],a[d]=null;break}f&&(u=f)}if(u)pi(u);else{const f=X1(c);u=this.createTextTrack(f,c.name,c.lang),u&&(u.mode="disabled")}u&&this.textTracks.push(u)}),a!=null&&a.length){const c=a.filter(l=>l!==null).map(l=>l.label);c.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${c.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const o=this.tracks.map(a=>({label:a.name,kind:a.type.toLowerCase(),default:a.default,subtitleTrack:a}));this.hls.trigger(A.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:o})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(n=>{const s=/(?:CC|SERVICE)([1-4])/.exec(n.instreamId);if(!s)return;const r=`textTrack${s[1]}`,o=this.captionsProperties[r];o&&(o.label=n.name,n.lang&&(o.languageCode=n.lang),o.media=n)})}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return t==null?void 0:t.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){if(this.enabled&&t.frag.type===X.MAIN){var n,s;const{cea608Parser1:r,cea608Parser2:o,lastSn:a}=this,{cc:c,sn:l}=t.frag,u=(n=(s=t.part)==null?void 0:s.index)!=null?n:-1;r&&o&&(l!==a+1||l===a&&u!==this.lastPartIndex+1||c!==this.lastCc)&&(r.reset(),o.reset()),this.lastCc=c,this.lastSn=l,this.lastPartIndex=u}}onFragLoaded(e,t){const{frag:n,payload:s}=t;if(n.type===X.SUBTITLE)if(s.byteLength){const r=n.decryptdata,o="stats"in t;if(r==null||!r.encrypted||o){const a=this.tracks[n.level],c=this.vttCCs;c[n.cc]||(c[n.cc]={start:n.start,prevCC:this.prevCC,new:!0},this.prevCC=n.cc),a&&a.textCodec===ra?this._parseIMSC1(n,s):this._parseVTTs(t)}}else this.hls.trigger(A.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const n=this.hls;_d(t,this.initPTS[e.cc],s=>{this._appendCues(s,e.level),n.trigger(A.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},s=>{n.logger.log(`Failed to parse IMSC1: ${s}`),n.trigger(A.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:s})})}_parseVTTs(e){var t;const{frag:n,payload:s}=e,{initPTS:r,unparsedVttFrags:o}=this,a=r.length-1;if(!r[n.cc]&&a===-1){o.push(e);return}const c=this.hls,l=(t=n.initSegment)!=null&&t.data?vt(n.initSegment.data,new Uint8Array(s)).buffer:s;J7(l,this.initPTS[n.cc],this.vttCCs,n.cc,n.start,u=>{this._appendCues(u,n.level),c.trigger(A.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:n})},u=>{const f=u.message==="Missing initPTS for VTT MPEGTS";f?o.push(e):this._fallbackToIMSC1(n,s),c.logger.log(`Failed to parse VTT cue: ${u}`),!(f&&a>n.cc)&&c.trigger(A.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:n,error:u})})}_fallbackToIMSC1(e,t){const n=this.tracks[e.level];n.textCodec||_d(t,this.initPTS[e.cc],()=>{n.textCodec=ra,this._parseIMSC1(e,t)},()=>{n.textCodec="wvtt"})}_appendCues(e,t){const n=this.hls;if(this.config.renderTextTracksNatively){const s=this.textTracks[t];if(!s||s.mode==="disabled")return;e.forEach(r=>H1(s,r))}else{const s=this.tracks[t];if(!s)return;const r=s.default?"default":"subtitles"+t;n.trigger(A.CUES_PARSED,{type:"subtitles",cues:e,track:r})}}onFragDecrypted(e,t){const{frag:n}=t;n.type===X.SUBTITLE&&this.onFragLoaded(A.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){if(!this.enabled||!this.config.enableCEA708Captions)return;const{frag:n,samples:s}=t;if(!(n.type===X.MAIN&&this.closedCaptionsForLevel(n)==="NONE"))for(let r=0;r<s.length;r++){const o=s[r].bytes;if(o){this.cea608Parser1||this.initCea608Parsers();const a=this.extractCea608Data(o);this.cea608Parser1.addData(s[r].pts,a[0]),this.cea608Parser2.addData(s[r].pts,a[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:n,endOffsetSubtitles:s,type:r}){const{media:o}=this;if(!(!o||o.currentTime<n)){if(!r||r==="video"){const{captionsTracks:a}=this;Object.keys(a).forEach(c=>ic(a[c],t,n))}if(this.config.renderTextTracksNatively&&t===0&&s!==void 0){const{textTracks:a}=this;Object.keys(a).forEach(c=>ic(a[c],t,s))}}}extractCea608Data(e){const t=[[],[]],n=e[0]&31;let s=2;for(let r=0;r<n;r++){const o=e[s++],a=127&e[s++],c=127&e[s++];if(a===0&&c===0)continue;if((4&o)!==0){const u=3&o;(u===0||u===1)&&(t[u].push(a),t[u].push(c))}}return t}}function X1(i){return i.characteristics&&/transcribes-spoken-dialog/gi.test(i.characteristics)&&/describes-music-and-sound/gi.test(i.characteristics)?"captions":"subtitles"}function Ld(i,e){return!!i&&i.kind===X1(e)&&ec(e,i)}function rI(i,e,t,n){return Math.min(e,n)-Math.max(i,t)}function Rd(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}const oI=/\s/,aI={newCue(i,e,t,n){const s=[];let r,o,a,c,l;const u=self.VTTCue||self.TextTrackCue;for(let d=0;d<n.rows.length;d++)if(r=n.rows[d],a=!0,c=0,l="",!r.isEmpty()){var f;for(let m=0;m<r.chars.length;m++)oI.test(r.chars[m].uchar)&&a?c++:(l+=r.chars[m].uchar,a=!1);r.cueStartTime=e,e===t&&(t+=1e-4),c>=16?c--:c++;const h=W1(l.trim()),p=Au(e,t,h);i!=null&&(f=i.cues)!=null&&f.getCueById(p)||(o=new u(e,t,h),o.id=p,o.line=d+1,o.align="left",o.position=10+Math.min(80,Math.floor(c*8/32)*10),s.push(o))}return i&&s.length&&(s.sort((d,h)=>d.line==="auto"||h.line==="auto"?0:d.line>8&&h.line>8?h.line-d.line:d.line-h.line),s.forEach(d=>H1(i,d))),s}};function lI(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch{}return!1}const cI=/(\d+)-(\d+)\/(\d+)/;class wd{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||hI,this.controller=new self.AbortController,this.stats=new tu}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,t,n){const s=this.stats;if(s.loading.start)throw new Error("Loader can only be used once.");s.loading.start=self.performance.now();const r=uI(e,this.controller.signal),o=e.responseType==="arraybuffer",a=o?"byteLength":"length",{maxTimeToFirstByteMs:c,maxLoadTimeMs:l}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=n,this.request=this.fetchSetup(e,r),self.clearTimeout(this.requestTimeout),t.timeout=c&&q(c)?c:l,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(s,e,this.response))},t.timeout),(Ts(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(f=>{var d;this.response=this.loader=f;const h=Math.max(self.performance.now(),s.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=l,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(s,e,this.response))},l-(h-s.loading.start)),!f.ok){const{status:m,statusText:g}=f;throw new pI(g||"fetch, bad network response",m,f)}s.loading.first=h,s.total=dI(f.headers)||s.total;const p=(d=this.callbacks)==null?void 0:d.onProgress;return p&&q(t.highWaterMark)?this.loadProgressively(f,s,e,t.highWaterMark,p):o?f.arrayBuffer():e.responseType==="json"?f.json():f.text()}).then(f=>{var d,h;const p=this.response;if(!p)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),s.loading.end=Math.max(self.performance.now(),s.loading.first);const m=f[a];m&&(s.loaded=s.total=m);const g={url:p.url,data:f,code:p.status},y=(d=this.callbacks)==null?void 0:d.onProgress;y&&!q(t.highWaterMark)&&y(s,e,f,p),(h=this.callbacks)==null||h.onSuccess(g,s,e,p)}).catch(f=>{var d;if(self.clearTimeout(this.requestTimeout),s.aborted)return;const h=f&&f.code||0,p=f?f.message:null;(d=this.callbacks)==null||d.onError({code:h,text:p},e,f?f.details:null,s)})}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,n,s=0,r){const o=new d1,a=e.body.getReader(),c=()=>a.read().then(l=>{if(l.done)return o.dataLength&&r(t,n,o.flush().buffer,e),Promise.resolve(new ArrayBuffer(0));const u=l.value,f=u.length;return t.loaded+=f,f<s||o.dataLength?(o.push(u),o.dataLength>=s&&r(t,n,o.flush().buffer,e)):r(t,n,u.buffer,e),c()}).catch(()=>Promise.reject());return c()}}function uI(i,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(me({},i.headers))};return i.rangeEnd&&t.headers.set("Range","bytes="+i.rangeStart+"-"+String(i.rangeEnd-1)),t}function fI(i){const e=cI.exec(i);if(e)return parseInt(e[2])-parseInt(e[1])+1}function dI(i){const e=i.get("Content-Range");if(e){const n=fI(e);if(q(n))return n}const t=i.get("Content-Length");if(t)return parseInt(t)}function hI(i,e){return new self.Request(i.url,e)}class pI extends Error{constructor(e,t,n){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=n}}const gI=/^age:\s*[\d.]+\s*$/im;class J1{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new tu,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,t,n){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=t,this.callbacks=n,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const n=this.loader=new self.XMLHttpRequest,s=this.stats;s.loading.first=0,s.loaded=0,s.aborted=!1;const r=this.xhrSetup;r?Promise.resolve().then(()=>{if(!(this.loader!==n||this.stats.aborted))return r(n,t.url)}).catch(o=>{if(!(this.loader!==n||this.stats.aborted))return n.open("GET",t.url,!0),r(n,t.url)}).then(()=>{this.loader!==n||this.stats.aborted||this.openAndSendXhr(n,t,e)}).catch(o=>{var a;(a=this.callbacks)==null||a.onError({code:n.status,text:o.message},t,n,s)}):this.openAndSendXhr(n,t,e)}openAndSendXhr(e,t,n){e.readyState||e.open("GET",t.url,!0);const s=t.headers,{maxTimeToFirstByteMs:r,maxLoadTimeMs:o}=n.loadPolicy;if(s)for(const a in s)e.setRequestHeader(a,s[a]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),n.timeout=r&&q(r)?r:o,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:n}=this;if(!e||!t)return;const s=t.readyState,r=this.config;if(!n.aborted&&s>=2&&(n.loading.first===0&&(n.loading.first=Math.max(self.performance.now(),n.loading.start),r.timeout!==r.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),r.timeout=r.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.loadPolicy.maxLoadTimeMs-(n.loading.first-n.loading.start)))),s===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const l=t.status,u=t.responseType==="text"?t.responseText:null;if(l>=200&&l<300){const p=u??t.response;if(p!=null){var o,a;n.loading.end=Math.max(self.performance.now(),n.loading.first);const m=t.responseType==="arraybuffer"?p.byteLength:p.length;n.loaded=n.total=m,n.bwEstimate=n.total*8e3/(n.loading.end-n.loading.first);const g=(o=this.callbacks)==null?void 0:o.onProgress;g&&g(n,e,p,t);const y={url:t.responseURL,data:p,code:l};(a=this.callbacks)==null||a.onSuccess(y,n,e,t);return}}const f=r.loadPolicy.errorRetry,d=n.retry,h={url:e.url,data:void 0,code:l};if(qr(f,d,!1,h))this.retry(f);else{var c;pe.error(`${l} while loading ${e.url}`),(c=this.callbacks)==null||c.onError({code:l,text:t.statusText},e,t,n)}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(qr(e,t,!0))this.retry(e);else{var n;pe.warn(`timeout while loading ${(n=this.context)==null?void 0:n.url}`);const s=this.callbacks;s&&(this.abortInternal(),s.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:n}=this;this.retryDelay=ru(e,n.retry),n.retry++,pe.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t==null?void 0:t.url}, retrying ${n.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&gI.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}const mI={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},xI=ye(ye({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,maxDevicePixelRatio:Number.POSITIVE_INFINITY,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,startOnSegmentBoundary:!1,maxBufferSize:60*1e3*1e3,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,liveSyncMode:"edge",liveSyncDurationCount:3,liveSyncOnStallIncrease:1,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,ignorePlaylistParsingErrors:!1,loader:J1,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:Ub,bufferController:L_,capLevelController:yu,errorController:Vb,fpsController:E7,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:n1,requireKeySystemAccessOnStart:!1,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableEmsgKLVMetadata:!1,enableID3MetadataCues:!0,enableInterstitialPlayback:!0,interstitialAppendInPlace:!0,interstitialLiveLookAhead:10,useMediaCapabilities:!0,preserveManualLevelOnError:!1,certLoadPolicy:{default:mI},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},interstitialAssetListLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:3e4,timeoutRetry:{maxNumRetry:0,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:0,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},yI()),{},{subtitleStreamController:P7,subtitleTrackController:T7,timelineController:sI,audioStreamController:b_,audioTrackController:__,emeController:yi,cmcdController:x7,contentSteeringController:v7,interstitialsController:D7});function yI(){return{cueHandler:aI,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function vI(i,e,t){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(e.liveMaxLatencyDurationCount!==void 0&&(e.liveSyncDurationCount===void 0||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(e.liveMaxLatencyDuration!==void 0&&(e.liveSyncDuration===void 0||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const n=rc(i),s=["manifest","level","frag"],r=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return s.forEach(o=>{const a=`${o==="level"?"playlist":o}LoadPolicy`,c=e[a]===void 0,l=[];r.forEach(u=>{const f=`${o}Loading${u}`,d=e[f];if(d!==void 0&&c){l.push(f);const h=n[a].default;switch(e[a]={default:h},u){case"TimeOut":h.maxLoadTimeMs=d,h.maxTimeToFirstByteMs=d;break;case"MaxRetry":h.errorRetry.maxNumRetry=d,h.timeoutRetry.maxNumRetry=d;break;case"RetryDelay":h.errorRetry.retryDelayMs=d,h.timeoutRetry.retryDelayMs=d;break;case"MaxRetryTimeout":h.errorRetry.maxRetryDelayMs=d,h.timeoutRetry.maxRetryDelayMs=d;break}}}),l.length&&t.warn(`hls.js config: "${l.join('", "')}" setting(s) are deprecated, use "${a}": ${Ae(e[a])}`)}),ye(ye({},n),e)}function rc(i){return i&&typeof i=="object"?Array.isArray(i)?i.map(rc):Object.keys(i).reduce((e,t)=>(e[t]=rc(i[t]),e),{}):i}function EI(i,e){const t=i.loader;t!==wd&&t!==J1?(e.log("[config]: Custom loader detected, cannot enable progressive streaming"),i.progressive=!1):lI()&&(i.loader=wd,i.progressive=!0,i.enableSoftwareAES=!0,e.log("[config]: Progressive streaming enabled, using FetchLoader"))}const vr=2,AI=.1,SI=.05,TI=100;class bI extends Jm{constructor(e,t){super("gap-controller",e.logger),this.hls=null,this.fragmentTracker=null,this.media=null,this.mediaSource=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.buffered={},this.lastCurrentTime=0,this.ended=0,this.waiting=0,this.onMediaPlaying=()=>{this.ended=0,this.waiting=0},this.onMediaWaiting=()=>{var n;(n=this.media)!=null&&n.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{if(this.hls){var n;this.ended=((n=this.media)==null?void 0:n.currentTime)||1,this.hls.trigger(A.MEDIA_ENDED,{stalled:!1})}},this.hls=e,this.fragmentTracker=t,this.registerListeners()}registerListeners(){const{hls:e}=this;e&&(e.on(A.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(A.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(A.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(A.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(A.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(A.BUFFER_APPENDED,this.onBufferAppended,this))}destroy(){super.destroy(),this.unregisterListeners(),this.media=this.hls=this.fragmentTracker=null,this.mediaSource=void 0}onMediaAttached(e,t){this.setInterval(TI),this.mediaSource=t.mediaSource;const n=this.media=t.media;yt(n,"playing",this.onMediaPlaying),yt(n,"waiting",this.onMediaWaiting),yt(n,"ended",this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();const{media:n}=this;n&&(It(n,"playing",this.onMediaPlaying),It(n,"waiting",this.onMediaWaiting),It(n,"ended",this.onMediaEnded),this.media=null),this.mediaSource=void 0}onBufferAppended(e,t){this.buffered=t.timeRanges}get hasBuffered(){return Object.keys(this.buffered).length>0}tick(){var e;if(!((e=this.media)!=null&&e.readyState)||!this.hasBuffered)return;const t=this.media.currentTime;this.poll(t,this.lastCurrentTime),this.lastCurrentTime=t}poll(e,t){var n,s;const r=(n=this.hls)==null?void 0:n.config;if(!r)return;const o=this.media;if(!o)return;const{seeking:a}=o,c=this.seeking&&!a,l=!this.seeking&&a,u=o.paused&&!a||o.ended||o.playbackRate===0;if(this.seeking=a,e!==t){t&&(this.ended=0),this.moved=!0,a||(this.nudgeRetry=0,r.nudgeOnVideoHole&&!u&&e>t&&this.nudgeOnVideoHole(e,t)),this.waiting===0&&this.stallResolved(e);return}if(l||c){c&&this.stallResolved(e);return}if(u){this.nudgeRetry=0,this.stallResolved(e),!this.ended&&o.ended&&this.hls&&(this.ended=e||1,this.hls.trigger(A.MEDIA_ENDED,{stalled:!1}));return}if(!re.getBuffered(o).length){this.nudgeRetry=0;return}const f=re.bufferInfo(o,e,0),d=f.nextStart||0,h=this.fragmentTracker;if(a&&h&&this.hls){const T=Dd(this.hls.inFlightFragments,e),_=f.len>vr,I=!d||T||d-e>vr&&!h.getPartialFragment(e);if(_||I)return;this.moved=!1}const p=(s=this.hls)==null?void 0:s.latestLevelDetails;if(!this.moved&&this.stalled!==null&&h){if(!(f.len>0)&&!d)return;const _=Math.max(d,f.start||0)-e,w=!!(p!=null&&p.live)?p.targetduration*2:vr,b=h.getPartialFragment(e);if(_>0&&(_<=w||b)){o.paused||this._trySkipBufferHole(b);return}}const m=r.detectStallWithCurrentTimeMs,g=self.performance.now(),y=this.waiting;let v=this.stalled;if(v===null)if(y>0&&g-y<m)v=this.stalled=y;else{this.stalled=g;return}const x=g-v;if(!a&&(x>=m||y)&&this.hls){var E;if(((E=this.mediaSource)==null?void 0:E.readyState)==="ended"&&!(p!=null&&p.live)&&Math.abs(e-((p==null?void 0:p.edge)||0))<1){if(this.ended)return;this.ended=e||1,this.hls.trigger(A.MEDIA_ENDED,{stalled:!0});return}if(this._reportStall(f),!this.media||!this.hls)return}const S=re.bufferInfo(o,e,r.maxBufferHole);this._tryFixBufferStall(S,x,e)}stallResolved(e){const t=this.stalled;if(t&&this.hls&&(this.stalled=null,this.stallReported)){const n=self.performance.now()-t;this.log(`playback not stuck anymore @${e}, after ${Math.round(n)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(A.STALL_RESOLVED,{})}}nudgeOnVideoHole(e,t){var n;const s=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&(n=this.buffered.audio)!=null&&n.length&&s&&s.length>1&&e>s.end(0)){const r=re.bufferedInfo(re.timeRangesToArray(this.buffered.audio),e,0);if(r.len>1&&t>=r.start){const o=re.timeRangesToArray(s),a=re.bufferedInfo(o,t,0).bufferedIndex;if(a>-1&&a<o.length-1){const c=re.bufferedInfo(o,e,0).bufferedIndex,l=o[a].end,u=o[a+1].start;if((c===-1||c>a)&&u-l<1&&e-l<2){const f=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${l} -> ${u} buffered index: ${c}`);this.warn(f.message),this.media.currentTime+=1e-6;const d=this.fragmentTracker.getPartialFragment(e)||void 0,h=re.bufferInfo(this.media,e,0);this.hls.trigger(A.ERROR,{type:Z.MEDIA_ERROR,details:$.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:f,reason:f.message,frag:d,buffer:h.len,bufferInfo:h})}}}}}_tryFixBufferStall(e,t,n){var s,r;const{fragmentTracker:o,media:a}=this,c=(s=this.hls)==null?void 0:s.config;if(!a||!o||!c)return;const l=(r=this.hls)==null?void 0:r.latestLevelDetails,u=o.getPartialFragment(n);if((u||l!=null&&l.live&&n<l.fragmentStart)&&(this._trySkipBufferHole(u)||!this.media))return;const f=e.buffered,d=this.adjacentTraversal(e,n);(f&&f.length>1&&e.len>c.maxBufferHole||e.nextStart&&(e.nextStart-n<c.maxBufferHole||d))&&(t>c.highBufferWatchdogPeriod*1e3||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(e))}adjacentTraversal(e,t){const n=this.fragmentTracker,s=e.nextStart;if(n&&s){const r=n.getFragAtPos(t,X.MAIN),o=n.getFragAtPos(s,X.MAIN);if(r&&o)return o.sn-r.sn<2}return!1}_reportStall(e){const{hls:t,media:n,stallReported:s,stalled:r}=this;if(!s&&r!==null&&n&&t){this.stallReported=!0;const o=new Error(`Playback stalling at @${n.currentTime} due to low buffer (${Ae(e)})`);this.warn(o.message),t.trigger(A.ERROR,{type:Z.MEDIA_ERROR,details:$.BUFFER_STALLED_ERROR,fatal:!1,error:o,buffer:e.len,bufferInfo:e,stalled:{start:r}})}}_trySkipBufferHole(e){var t;const{fragmentTracker:n,media:s}=this,r=(t=this.hls)==null?void 0:t.config;if(!s||!n||!r)return 0;const o=s.currentTime,a=re.bufferInfo(s,o,0),c=o<a.start?a.start:a.nextStart;if(c&&this.hls){const u=a.len<=r.maxBufferHole,f=a.len>0&&a.len<1&&s.readyState<3,d=c-o;if(d>0&&(u||f)){if(d>r.maxBufferHole){let p=!1;if(o===0){const m=n.getAppendedFrag(0,X.MAIN);m&&c<m.end&&(p=!0)}if(!p){const m=e||n.getAppendedFrag(o,X.MAIN);if(m){var l;if(!((l=this.hls.loadLevelObj)!=null&&l.details)||Dd(this.hls.inFlightFragments,c))return 0;let y=!1,v=m.end;for(;v<c;){const x=n.getAppendedFrag(v,X.MAIN)||n.getPartialFragment(v);if(x)v+=x.duration;else{y=!0;break}}if(y)return 0}}}const h=Math.max(c+SI,o+AI);if(this.warn(`skipping hole, adjusting currentTime from ${o} to ${h}`),this.moved=!0,s.currentTime=h,!(e!=null&&e.gap)){const p=new Error(`fragment loaded with buffer holes, seeking from ${o} to ${h}`);this.hls.trigger(A.ERROR,{type:Z.MEDIA_ERROR,details:$.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:p,reason:p.message,frag:e||void 0,buffer:a.len,bufferInfo:a})}return h}}return 0}_tryNudgeBuffer(e){const{hls:t,media:n,nudgeRetry:s}=this,r=t==null?void 0:t.config;if(!n||!r)return 0;const o=n.currentTime;if(this.nudgeRetry++,s<r.nudgeMaxRetry){const a=o+(s+1)*r.nudgeOffset,c=new Error(`Nudging 'currentTime' from ${o} to ${a}`);this.warn(c.message),n.currentTime=a,t.trigger(A.ERROR,{type:Z.MEDIA_ERROR,details:$.BUFFER_NUDGE_ON_STALL,error:c,fatal:!1,buffer:e.len,bufferInfo:e})}else{const a=new Error(`Playhead still not moving while enough data buffered @${o} after ${r.nudgeMaxRetry} nudges`);this.error(a.message),t.trigger(A.ERROR,{type:Z.MEDIA_ERROR,details:$.BUFFER_STALLED_ERROR,error:a,fatal:!0,buffer:e.len,bufferInfo:e})}}}function Dd(i,e){const t=Pd(i.main);if(t&&t.start<=e)return t;const n=Pd(i.audio);return n&&n.start<=e?n:null}function Pd(i){if(!i)return null;switch(i.state){case V.IDLE:case V.STOPPED:case V.ENDED:case V.ERROR:return null}return i.frag}const _I=.25;function oc(){if(!(typeof self>"u"))return self.VTTCue||self.TextTrackCue}function kd(i,e,t,n,s){let r=new i(e,t,"");try{r.value=n,s&&(r.type=s)}catch{r=new i(e,t,Ae(s?ye({type:s},n):n))}return r}const sr=(()=>{const i=oc();try{i&&new i(0,Number.POSITIVE_INFINITY,"")}catch{return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();class II{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(A.EVENT_CUE_ENTER,{})},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=this.onEventCueEnter=null}_registerListeners(){const{hls:e}=this;e.on(A.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(A.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(A.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(A.MANIFEST_LOADING,this.onManifestLoading,this),e.on(A.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(A.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(A.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(A.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this)}_unregisterListeners(){const{hls:e}=this;e.off(A.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(A.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(A.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(A.MANIFEST_LOADING,this.onManifestLoading,this),e.off(A.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(A.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(A.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(A.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this)}onMediaAttaching(e,t){var n;this.media=t.media,((n=t.overrides)==null?void 0:n.cueRemoval)===!1&&(this.removeCues=!1)}onMediaAttached(){const e=this.hls.latestLevelDetails;e&&this.updateDateRangeCues(e)}onMediaDetaching(e,t){this.media=null,!t.transferMedia&&(this.id3Track&&(this.removeCues&&pi(this.id3Track,this.onEventCueEnter),this.id3Track=null),this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;t<e.length;t++){const n=e[t];if(n.kind==="metadata"&&n.label==="id3")return $1(n,this.media),n}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media)return;const{hls:{config:{enableEmsgMetadataCues:n,enableID3MetadataCues:s}}}=this;if(!n&&!s)return;const{samples:r}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const o=oc();if(o)for(let a=0;a<r.length;a++){const c=r[a].type;if(c===ut.emsg&&!n||!s)continue;const l=v1(r[a].data);if(l){const u=r[a].pts;let f=u+r[a].duration;f>sr&&(f=sr),f-u<=0&&(f=u+_I);for(let h=0;h<l.length;h++){const p=l[h];if(!E1(p)){this.updateId3CueEnds(u,c);const m=kd(o,u,f,p,c);m&&this.id3Track.addCue(m)}}}}}updateId3CueEnds(e,t){var n;const s=(n=this.id3Track)==null?void 0:n.cues;if(s)for(let r=s.length;r--;){const o=s[r];o.type===t&&o.startTime<e&&o.endTime===sr&&(o.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:n,type:s}){const{id3Track:r,hls:o}=this;if(!o)return;const{config:{enableEmsgMetadataCues:a,enableID3MetadataCues:c}}=o;if(r&&(a||c)){let l;s==="audio"?l=u=>u.type===ut.audioId3&&c:s==="video"?l=u=>u.type===ut.emsg&&a:l=u=>u.type===ut.audioId3&&c||u.type===ut.emsg&&a,ic(r,t,n,l)}}onLevelUpdated(e,{details:t}){this.updateDateRangeCues(t,!0)}onLevelPtsUpdated(e,t){Math.abs(t.drift)>.01&&this.updateDateRangeCues(t.details)}updateDateRangeCues(e,t){if(!this.media||!e.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)return;const{id3Track:n}=this,{dateRanges:s}=e,r=Object.keys(s);let o=this.dateRangeCuesAppended;if(n&&t){var a;if((a=n.cues)!=null&&a.length){const u=Object.keys(o).filter(f=>!r.includes(f));for(let f=u.length;f--;){const d=u[f],h=o[d].cues;delete o[d],Object.keys(h).forEach(p=>{try{const m=h[p];m.removeEventListener("enter",this.onEventCueEnter),n.removeCue(m)}catch{}})}}else o=this.dateRangeCuesAppended={}}const c=e.fragments[e.fragments.length-1];if(r.length===0||!q(c==null?void 0:c.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const l=oc();for(let u=0;u<r.length;u++){const f=r[u],d=s[f],h=d.startTime,p=o[f],m=(p==null?void 0:p.cues)||{};let g=(p==null?void 0:p.durationKnown)||!1,y=sr;const{duration:v,endDate:x}=d;if(x&&v!==null)y=h+v,g=!0;else if(d.endOnNext&&!g){const S=r.reduce((T,_)=>{if(_!==d.id){const I=s[_];if(I.class===d.class&&I.startDate>d.startDate&&(!T||d.startDate<T.startDate))return I}return T},null);S&&(y=S.startTime,g=!0)}const E=Object.keys(d.attr);for(let S=0;S<E.length;S++){const T=E[S];if(!i9(T))continue;const _=m[T];if(_)g&&!p.durationKnown?_.endTime=y:Math.abs(_.startTime-h)>.01&&(_.startTime=h,_.endTime=y);else if(l){let I=d.attr[T];s9(T)&&(I=Om(I));const b=kd(l,h,y,{key:T,data:I},ut.dateRange);b&&(b.id=f,this.id3Track.addCue(b),m[T]=b,this.hls.config.interstitialsController&&(T==="X-ASSET-LIST"||T==="X-ASSET-URL")&&b.addEventListener("enter",this.onEventCueEnter))}}o[f]={cues:m,dateRange:d,durationKnown:g}}}}class CI{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.currentTime=0,this.stallCount=0,this._latency=null,this._targetLatencyUpdated=!1,this.onTimeupdate=()=>{const{media:t}=this,n=this.levelDetails;if(!t||!n)return;this.currentTime=t.currentTime;const s=this.computeLatency();if(s===null)return;this._latency=s;const{lowLatencyMode:r,maxLiveSyncPlaybackRate:o}=this.config;if(!r||o===1||!n.live)return;const a=this.targetLatency;if(a===null)return;const c=s-a,l=Math.min(this.maxLatency,a+n.targetduration);if(c<l&&c>.05&&this.forwardBufferLength>1){const f=Math.min(2,Math.max(1,o)),d=Math.round(2/(1+Math.exp(-.75*c-this.edgeStalled))*20)/20,h=Math.min(f,Math.max(1,d));this.changeMediaPlaybackRate(t,h)}else t.playbackRate!==1&&t.playbackRate!==0&&this.changeMediaPlaybackRate(t,1)},this.hls=e,this.config=e.config,this.registerListeners()}get levelDetails(){var e;return((e=this.hls)==null?void 0:e.latestLevelDetails)||null}get latency(){return this._latency||0}get maxLatency(){const{config:e}=this;if(e.liveMaxLatencyDuration!==void 0)return e.liveMaxLatencyDuration;const t=this.levelDetails;return t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const e=this.levelDetails;if(e===null||this.hls===null)return null;const{holdBack:t,partHoldBack:n,targetduration:s}=e,{liveSyncDuration:r,liveSyncDurationCount:o,lowLatencyMode:a}=this.config,c=this.hls.userConfig;let l=a&&n||t;(this._targetLatencyUpdated||c.liveSyncDuration||c.liveSyncDurationCount||l===0)&&(l=r!==void 0?r:o*s);const u=s;return l+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,u)}set targetLatency(e){this.stallCount=0,this.config.liveSyncDuration=e,this._targetLatencyUpdated=!0}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency;if(e===null||t===null)return null;const n=this.levelDetails;if(n===null)return null;const s=n.edge,r=e-t-this.edgeStalled,o=s-n.totalduration,a=s-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(o,r),a)}get drift(){const e=this.levelDetails;return e===null?1:e.drift}get edgeStalled(){const e=this.levelDetails;if(e===null)return 0;const t=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e}=this,t=this.levelDetails;if(!e||!t)return 0;const n=e.buffered.length;return(n?e.buffered.end(n-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){const{hls:e}=this;e&&(e.on(A.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(A.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(A.MANIFEST_LOADING,this.onManifestLoading,this),e.on(A.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(A.ERROR,this.onError,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(A.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(A.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(A.MANIFEST_LOADING,this.onManifestLoading,this),e.off(A.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(A.ERROR,this.onError,this))}onMediaAttached(e,t){this.media=t.media,this.media.addEventListener("timeupdate",this.onTimeupdate)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.onTimeupdate),this.media=null)}onManifestLoading(){this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:t}){t.advanced&&this.onTimeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.onTimeupdate)}onError(e,t){var n;t.details===$.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&(n=this.levelDetails)!=null&&n.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))}changeMediaPlaybackRate(e,t){var n,s;e.playbackRate!==t&&((n=this.hls)==null||n.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${(s=this.targetLatency)==null?void 0:s.toFixed(3)}, forwardBufferLength=${this.forwardBufferLength.toFixed(3)}: adjusting playback rate from ${e.playbackRate} to ${t}`),e.playbackRate=t)}estimateLiveEdge(){const e=this.levelDetails;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}class LI extends xu{constructor(e,t){super(e,"level-controller"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(A.MANIFEST_LOADING,this.onManifestLoading,this),e.on(A.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(A.LEVEL_LOADED,this.onLevelLoaded,this),e.on(A.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(A.FRAG_BUFFERED,this.onFragBuffered,this),e.on(A.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(A.MANIFEST_LOADING,this.onManifestLoading,this),e.off(A.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(A.LEVEL_LOADED,this.onLevelLoaded,this),e.off(A.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(A.FRAG_BUFFERED,this.onFragBuffered,this),e.off(A.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(t=>{t.loadError=0,t.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,t){this.resetLevels()}onManifestLoaded(e,t){const n=this.hls.config.preferManagedMediaSource,s=[],r={},o={};let a=!1,c=!1,l=!1;t.levels.forEach(u=>{const f=u.attrs;let{audioCodec:d,videoCodec:h}=u;d&&(u.audioCodec=d=Gr(d,n)||void 0),h&&(h=u.videoCodec=Sb(h));const{width:p,height:m,unknownCodecs:g}=u;let y=g?g.length:0;if(g)for(let b=y;b--;){const L=g[b];this.isAudioSupported(L)?(u.audioCodec=d=d?`${d},${L}`:L,y--,Ci.audio[d.substring(0,4)]=2):this.isVideoSupported(L)&&(u.videoCodec=h=h?`${h},${L}`:L,y--,Ci.video[h.substring(0,4)]=2)}if(a||(a=!!(p&&m)),c||(c=!!h),l||(l=!!d),y||d&&!this.isAudioSupported(d)||h&&!this.isVideoSupported(h)){this.log(`Some or all CODECS not supported "${f.CODECS}"`);return}const{CODECS:v,"FRAME-RATE":x,"HDCP-LEVEL":E,"PATHWAY-ID":S,RESOLUTION:T,"VIDEO-RANGE":_}=f,w=`${`${S||"."}-`}${u.bitrate}-${T}-${x}-${v}-${_}-${E}`;if(r[w])if(r[w].uri!==u.url&&!u.attrs["PATHWAY-ID"]){const b=o[w]+=1;u.attrs["PATHWAY-ID"]=new Array(b+1).join(".");const L=this.createLevel(u);r[w]=L,s.push(L)}else r[w].addGroupId("audio",f.AUDIO),r[w].addGroupId("text",f.SUBTITLES);else{const b=this.createLevel(u);r[w]=b,o[w]=1,s.push(b)}}),this.filterAndSortMediaOptions(s,t,a,c,l)}createLevel(e){const t=new vs(e),n=e.supplemental;if(n!=null&&n.videoCodec&&!this.isVideoSupported(n.videoCodec)){const s=new Error(`SUPPLEMENTAL-CODECS not supported "${n.videoCodec}"`);this.log(s.message),t.supportedResult=qm(s,[])}return t}isAudioSupported(e){return Vl(e,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(e){return Vl(e,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(e,t,n,s,r){let o=[],a=[],c=e;if((n||s)&&r&&(c=c.filter(({videoCodec:g,videoRange:y,width:v,height:x})=>(!!g||!!(v&&x))&&wb(y))),c.length===0){Promise.resolve().then(()=>{if(this.hls){let g="no level with compatible codecs found in manifest",y=g;t.levels.length&&(y=`one or more CODECS in variant not supported: ${Ae(t.levels.map(x=>x.attrs.CODECS).filter((x,E,S)=>S.indexOf(x)===E))}`,this.warn(y),g+=` (${y})`);const v=new Error(g);this.hls.trigger(A.ERROR,{type:Z.MEDIA_ERROR,details:$.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:v,reason:y})}});return}t.audioTracks&&(o=t.audioTracks.filter(g=>!g.audioCodec||this.isAudioSupported(g.audioCodec)),Bd(o)),t.subtitles&&(a=t.subtitles,Bd(a));const l=c.slice(0);c.sort((g,y)=>{if(g.attrs["HDCP-LEVEL"]!==y.attrs["HDCP-LEVEL"])return(g.attrs["HDCP-LEVEL"]||"")>(y.attrs["HDCP-LEVEL"]||"")?1:-1;if(n&&g.height!==y.height)return g.height-y.height;if(g.frameRate!==y.frameRate)return g.frameRate-y.frameRate;if(g.videoRange!==y.videoRange)return Kr.indexOf(g.videoRange)-Kr.indexOf(y.videoRange);if(g.videoCodec!==y.videoCodec){const v=I0(g.videoCodec),x=I0(y.videoCodec);if(v!==x)return x-v}if(g.uri===y.uri&&g.codecSet!==y.codecSet){const v=Hr(g.codecSet),x=Hr(y.codecSet);if(v!==x)return x-v}return g.averageBitrate!==y.averageBitrate?g.averageBitrate-y.averageBitrate:0});let u=l[0];if(this.steering&&(c=this.steering.filterParsedLevels(c),c.length!==l.length)){for(let g=0;g<l.length;g++)if(l[g].pathwayId===c[0].pathwayId){u=l[g];break}}this._levels=c;for(let g=0;g<c.length;g++)if(c[g]===u){var f;this._firstLevel=g;const y=u.bitrate,v=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${c.length} level(s) found, first bitrate: ${y}`),((f=this.hls.userConfig)==null?void 0:f.abrEwmaDefaultEstimate)===void 0){const x=Math.min(y,this.hls.config.abrEwmaDefaultEstimateMax);x>v&&v===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=x)}break}const d=r&&!s,h=this.hls.config,p=!!(h.audioStreamController&&h.audioTrackController),m={levels:c,audioTracks:o,subtitleTracks:a,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:r,video:s,altAudio:p&&!d&&o.some(g=>!!g.url)};this.hls.trigger(A.MANIFEST_PARSED,m)}get levels(){return this._levels.length===0?null:this._levels}get loadLevelObj(){return this.currentLevel}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(t.length===0)return;if(e<0||e>=t.length){const u=new Error("invalid level idx"),f=e<0;if(this.hls.trigger(A.ERROR,{type:Z.OTHER_ERROR,details:$.LEVEL_SWITCH_ERROR,level:e,fatal:f,error:u,reason:u.message}),f)return;e=Math.min(e,t.length-1)}const n=this.currentLevelIndex,s=this.currentLevel,r=s?s.attrs["PATHWAY-ID"]:void 0,o=t[e],a=o.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=o,n===e&&s&&r===a)return;this.log(`Switching to level ${e} (${o.height?o.height+"p ":""}${o.videoRange?o.videoRange+" ":""}${o.codecSet?o.codecSet+" ":""}@${o.bitrate})${a?" with Pathway "+a:""} from level ${n}${r?" with Pathway "+r:""}`);const c={level:e,attrs:o.attrs,details:o.details,bitrate:o.bitrate,averageBitrate:o.averageBitrate,maxBitrate:o.maxBitrate,realBitrate:o.realBitrate,width:o.width,height:o.height,codecSet:o.codecSet,audioCodec:o.audioCodec,videoCodec:o.videoCodec,audioGroups:o.audioGroups,subtitleGroups:o.subtitleGroups,loaded:o.loaded,loadError:o.loadError,fragmentError:o.fragmentError,name:o.name,id:o.id,uri:o.uri,url:o.url,urlId:0,audioGroupIds:o.audioGroupIds,textGroupIds:o.textGroupIds};this.hls.trigger(A.LEVEL_SWITCHING,c);const l=o.details;if(!l||l.live){const u=this.switchParams(o.uri,s==null?void 0:s.details,l);this.loadPlaylist(u)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(this._startLevel===void 0){const e=this.hls.config.startLevel;return e!==void 0?e:this.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}get pathways(){return this.steering?this.steering.pathways():[]}get pathwayPriority(){return this.steering?this.steering.pathwayPriority:null}set pathwayPriority(e){if(this.steering){const t=this.steering.pathways(),n=e.filter(s=>t.indexOf(s)!==-1);if(e.length<1){this.warn(`pathwayPriority ${e} should contain at least one pathway from list: ${t}`);return}this.steering.pathwayPriority=n}}onError(e,t){t.fatal||!t.context||t.context.type===ue.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===X.MAIN){const n=t.elementaryStreams;if(!Object.keys(n).some(r=>!!n[r]))return;const s=this._levels[t.level];s!=null&&s.loadError&&(this.log(`Resetting level error count of ${s.loadError} on frag buffered`),s.loadError=0)}}onLevelLoaded(e,t){var n;const{level:s,details:r}=t,o=t.levelInfo;if(!o){var a;this.warn(`Invalid level index ${s}`),(a=t.deliveryDirectives)!=null&&a.skip&&(r.deltaUpdateFailed=!0);return}if(o===this.currentLevel||t.withoutMultiVariant){o.fragmentError===0&&(o.loadError=0);let c=o.details;c===t.details&&c.advanced&&(c=void 0),this.playlistLoaded(s,t,c)}else(n=t.deliveryDirectives)!=null&&n.skip&&(r.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const n=this.getUrlWithDirectives(e.uri,t),s=this.currentLevelIndex,r=e.attrs["PATHWAY-ID"],o=e.details,a=o==null?void 0:o.age;this.log(`Loading level index ${s}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${r?" Pathway "+r:""}${a&&o.live?" age "+a.toFixed(1)+(o.type&&" "+o.type||""):""} ${n}`),this.hls.trigger(A.LEVEL_LOADING,{url:n,level:s,levelInfo:e,pathwayId:e.attrs["PATHWAY-ID"],id:0,deliveryDirectives:t||null})}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e){var t;if(this._levels.length===1)return;const n=this._levels.filter((r,o)=>o!==e?!0:(this.steering&&this.steering.removeLevel(r),r===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,r.details&&r.details.fragments.forEach(a=>a.level=-1)),!1));c1(n),this._levels=n,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.manualLevelIndex>-1&&(this.manualLevelIndex=this.currentLevelIndex);const s=n.length-1;this._firstLevel=Math.min(this._firstLevel,s),this._startLevel&&(this._startLevel=Math.min(this._startLevel,s)),this.hls.trigger(A.LEVELS_UPDATED,{levels:n})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:n}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(A.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:n}))}}function Bd(i){const e={};i.forEach(t=>{const n=t.groupId||"";t.id=e[n]=e[n]||0,e[n]++})}function Z1(){return self.SourceBuffer||self.WebKitSourceBuffer}function ex(){if(!Tn())return!1;const e=Z1();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function RI(){if(!ex())return!1;const i=Tn();return typeof(i==null?void 0:i.isTypeSupported)=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(e=>i.isTypeSupported(ys(e,"video")))||["mp4a.40.2","fLaC"].some(e=>i.isTypeSupported(ys(e,"audio"))))}function wI(){var i;const e=Z1();return typeof(e==null||(i=e.prototype)==null?void 0:i.changeType)=="function"}const DI=100;class PI extends cu{constructor(e,t,n){super(e,t,n,"stream-controller",X.MAIN),this.audioCodecSwap=!1,this.level=-1,this._forceStartLoad=!1,this._hasEnoughToStart=!1,this.altAudio=0,this.audioOnly=!1,this.fragPlaying=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this.onMediaPlaying=()=>{this.tick()},this.onMediaSeeked=()=>{const s=this.media,r=s?s.currentTime:null;if(r===null||!q(r)||(this.log(`Media seeked to ${r.toFixed(3)}`),!this.getBufferedFrag(r)))return;const o=this.getFwdBufferInfoAtPos(s,r,X.MAIN,0);if(o===null||o.len===0){this.warn(`Main forward buffer length at ${r} on "seeked" event ${o?o.len:"empty"})`);return}this.tick()},this.registerListeners()}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(A.MANIFEST_PARSED,this.onManifestParsed,this),e.on(A.LEVEL_LOADING,this.onLevelLoading,this),e.on(A.LEVEL_LOADED,this.onLevelLoaded,this),e.on(A.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(A.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(A.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(A.BUFFER_CREATED,this.onBufferCreated,this),e.on(A.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(A.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(A.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(A.MANIFEST_PARSED,this.onManifestParsed,this),e.off(A.LEVEL_LOADED,this.onLevelLoaded,this),e.off(A.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(A.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(A.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(A.BUFFER_CREATED,this.onBufferCreated,this),e.off(A.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(A.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(A.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(e,t){if(this.levels){const{lastCurrentTime:n,hls:s}=this;if(this.stopLoad(),this.setInterval(DI),this.level=-1,!this.startFragRequested){let r=s.startLevel;r===-1&&(s.config.testBandwidth&&this.levels.length>1?(r=0,this.bitrateTest=!0):r=s.firstAutoLevel),s.nextLoadLevel=r,this.level=s.loadLevel,this._hasEnoughToStart=!!t}n>0&&e===-1&&!t&&(this.log(`Override startPosition with lastCurrentTime @${n.toFixed(3)}`),e=n),this.state=V.IDLE,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=V.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case V.WAITING_LEVEL:{const{levels:t,level:n}=this,s=t==null?void 0:t[n],r=s==null?void 0:s.details;if(r&&(!r.live||this.levelLastLoaded===s&&!this.waitForLive(s))){if(this.waitForCdnTuneIn(r))break;this.state=V.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=V.IDLE;break}break}case V.FRAG_LOADING_WAITING_RETRY:{var e;const t=self.performance.now(),n=this.retryDate;if(!n||t>=n||(e=this.media)!=null&&e.seeking){const{levels:s,level:r}=this,o=s==null?void 0:s[r];this.resetStartWhenNotLoaded(o||null),this.state=V.IDLE}}break}this.state===V.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){var e;super.onTickEnd(),(e=this.media)!=null&&e.readyState&&this.media.seeking===!1&&(this.lastCurrentTime=this.media.currentTime),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:t,levels:n,media:s}=this;if(t===null||!s&&!this.primaryPrefetch&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const r=this.buffering?e.nextLoadLevel:e.loadLevel;if(!(n!=null&&n[r]))return;const o=n[r],a=this.getMainFwdBufferInfo();if(a===null)return;const c=this.getLevelDetails();if(c&&this._streamEnded(a,c)){const m={};this.altAudio===2&&(m.type="video"),this.hls.trigger(A.BUFFER_EOS,m),this.state=V.ENDED;return}if(!this.buffering)return;e.loadLevel!==r&&e.manualLevel===-1&&this.log(`Adapting to level ${r} from level ${this.level}`),this.level=e.nextLoadLevel=r;const l=o.details;if(!l||this.state===V.WAITING_LEVEL||this.waitForLive(o)){this.level=r,this.state=V.WAITING_LEVEL,this.startFragRequested=!1;return}const u=a.len,f=this.getMaxBufferLength(o.maxBitrate);if(u>=f)return;this.backtrackFragment&&this.backtrackFragment.start>a.end&&(this.backtrackFragment=null);const d=this.backtrackFragment?this.backtrackFragment.start:a.end;let h=this.getNextFragment(d,l);if(this.couldBacktrack&&!this.fragPrevious&&h&&De(h)&&this.fragmentTracker.getState(h)!==Be.OK){var p;const g=((p=this.backtrackFragment)!=null?p:h).sn-l.startSN,y=l.fragments[g-1];y&&h.cc===y.cc&&(h=y,this.fragmentTracker.removeFragment(y))}else this.backtrackFragment&&a.len&&(this.backtrackFragment=null);if(h&&this.isLoopLoading(h,d)){if(!h.gap){const g=this.audioOnly&&!this.altAudio?ve.AUDIO:ve.VIDEO,y=(g===ve.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;y&&this.afterBufferFlushed(y,g,X.MAIN)}h=this.getNextFragmentLoopLoading(h,l,a,X.MAIN,f)}h&&(h.initSegment&&!h.initSegment.data&&!this.bitrateTest&&(h=h.initSegment),this.loadFragment(h,o,d))}loadFragment(e,t,n){const s=this.fragmentTracker.getState(e);s===Be.NOT_LOADED||s===Be.PARTIAL?De(e)?this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,t)):super.loadFragment(e,t,n):this._loadInitSegment(e,t):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,X.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:t}=this;if(t!=null&&t.readyState){let n;const s=this.getAppendedFrag(t.currentTime);s&&s.start>1&&this.flushMainBuffer(0,s.start-1);const r=this.getLevelDetails();if(r!=null&&r.live){const a=this.getMainFwdBufferInfo();if(!a||a.len<r.targetduration*2)return}if(!t.paused&&e){const a=this.hls.nextLoadLevel,c=e[a],l=this.fragLastKbps;l&&this.fragCurrent?n=this.fragCurrent.duration*c.maxBitrate/(1e3*l)+1:n=0}else n=0;const o=this.getBufferedFrag(t.currentTime+n);if(o){const a=this.followingBufferedFrag(o);if(a){this.abortCurrentFrag();const c=a.maxStartPTS?a.maxStartPTS:a.start,l=a.duration,u=Math.max(o.end,c+Math.min(Math.max(l-this.config.maxFragLookUpTolerance,l*(this.couldBacktrack?.5:.125)),l*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(u,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case V.KEY_LOADING:case V.FRAG_LOADING:case V.FRAG_LOADING_WAITING_RETRY:case V.PARSING:case V.PARSED:this.state=V.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio===2?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const n=t.media;yt(n,"playing",this.onMediaPlaying),yt(n,"seeked",this.onMediaSeeked)}onMediaDetaching(e,t){const{media:n}=this;n&&(It(n,"playing",this.onMediaPlaying),It(n,"seeked",this.onMediaSeeked)),this.videoBuffer=null,this.fragPlaying=null,super.onMediaDetaching(e,t),!t.transferMedia&&(this._hasEnoughToStart=!1)}onManifestLoading(){super.onManifestLoading(),this.log("Trigger BUFFER_RESET"),this.hls.trigger(A.BUFFER_RESET,void 0),this.couldBacktrack=!1,this.fragLastKbps=0,this.fragPlaying=this.backtrackFragment=null,this.altAudio=0,this.audioOnly=!1}onManifestParsed(e,t){let n=!1,s=!1;t.levels.forEach(r=>{const o=r.audioCodec;o&&(n=n||o.indexOf("mp4a.40.2")!==-1,s=s||o.indexOf("mp4a.40.5")!==-1)}),this.audioCodecSwitch=n&&s&&!wI(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:n}=this;if(!n||this.state!==V.IDLE)return;const s=t.levelInfo;(!s.details||s.details.live&&(this.levelLastLoaded!==s||s.details.expired)||this.waitForCdnTuneIn(s.details))&&(this.state=V.WAITING_LEVEL)}onLevelLoaded(e,t){var n;const{levels:s,startFragRequested:r}=this,o=t.level,a=t.details,c=a.totalduration;if(!s){this.warn(`Levels were reset while loading level ${o}`);return}this.log(`Level ${o} loaded [${a.startSN},${a.endSN}]${a.lastPartSn?`[part-${a.lastPartSn}-${a.lastPartIndex}]`:""}, cc [${a.startCC}, ${a.endCC}] duration:${c}`);const l=t.levelInfo,u=this.fragCurrent;u&&(this.state===V.FRAG_LOADING||this.state===V.FRAG_LOADING_WAITING_RETRY)&&u.level!==t.level&&u.loader&&this.abortCurrentFrag();let f=0;if(a.live||(n=l.details)!=null&&n.live){var d;if(this.checkLiveUpdate(a),a.deltaUpdateFailed)return;f=this.alignPlaylists(a,l.details,(d=this.levelLastLoaded)==null?void 0:d.details)}if(l.details=a,this.levelLastLoaded=l,r||this.setStartPosition(a,f),this.hls.trigger(A.LEVEL_UPDATED,{details:a,level:o}),this.state===V.WAITING_LEVEL){if(this.waitForCdnTuneIn(a))return;this.state=V.IDLE}r&&a.live&&this.synchronizeToLiveEdge(a),this.tick()}synchronizeToLiveEdge(e){const{config:t,media:n}=this;if(!n)return;const s=this.hls.liveSyncPosition,r=this.getLoadPosition(),o=e.fragmentStart,a=e.edge,c=r>=o-t.maxFragLookUpTolerance&&r<=a;if(s!==null&&n.duration>s&&(r<s||!c)){const u=t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;if((!c&&n.readyState<4||r<a-u)&&(this._hasEnoughToStart||(this.nextLoadPosition=s),n.readyState))if(this.warn(`Playback: ${r.toFixed(3)} is located too far from the end of live sliding playlist: ${a}, reset currentTime to : ${s.toFixed(3)}`),this.config.liveSyncMode==="buffered"){var l;const f=re.bufferInfo(n,s,0);if(!(f!=null&&(l=f.buffered)!=null&&l.length)){n.currentTime=s;return}if(f.start<=r){n.currentTime=s;return}const{nextStart:h}=re.bufferedInfo(f.buffered,r,0);h&&(n.currentTime=h)}else n.currentTime=s}}_handleFragmentLoadProgress(e){var t;const n=e.frag,{part:s,payload:r}=e,{levels:o}=this;if(!o){this.warn(`Levels were reset while fragment load was in progress. Fragment ${n.sn} of level ${n.level} will not be buffered`);return}const a=o[n.level];if(!a){this.warn(`Level ${n.level} not found on progress`);return}const c=a.details;if(!c){this.warn(`Dropping fragment ${n.sn} of level ${n.level} after level details were reset`),this.fragmentTracker.removeFragment(n);return}const l=a.videoCodec,u=c.PTSKnown||!c.live,f=(t=n.initSegment)==null?void 0:t.data,d=this._getAudioCodec(a),h=this.transmuxer=this.transmuxer||new D1(this.hls,X.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),p=s?s.index:-1,m=p!==-1,g=new au(n.level,n.sn,n.stats.chunkCount,r.byteLength,p,m),y=this.initPTS[n.cc];h.push(r,f,d,l,n,s,c.totalduration,u,g,y)}onAudioTrackSwitching(e,t){const n=this.hls,s=this.altAudio===2;if(Vr(t.url,n))this.altAudio=1;else{if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const o=this.fragCurrent;o&&(this.log("Switching to main audio track, cancel main fragment load"),o.abortRequests(),this.fragmentTracker.removeFragment(o)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();if(s){this.fragmentTracker.removeAllFragments(),n.once(A.BUFFER_FLUSHED,()=>{var o;(o=this.hls)==null||o.trigger(A.AUDIO_TRACK_SWITCHED,t)}),n.trigger(A.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});return}n.trigger(A.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const n=Vr(t.url,this.hls);if(n){const s=this.videoBuffer;s&&this.mediaBuffer!==s&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=s)}this.altAudio=n?2:0,this.tick()}onBufferCreated(e,t){const n=t.tracks;let s,r,o=!1;for(const a in n){const c=n[a];if(c.id==="main"){if(r=a,s=c,a==="video"){const l=n[a];l&&(this.videoBuffer=l.buffer)}}else o=!0}o&&s?(this.log(`Alternate track found, use ${r}.buffered to schedule main fragment loading`),this.mediaBuffer=s.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:n,part:s}=t,r=n.type===X.MAIN;if(r){if(this.fragContextChanged(n)){this.warn(`Fragment ${n.sn}${s?" p: "+s.index:""} of level ${n.level} finished buffering, but was aborted. state: ${this.state}`),this.state===V.PARSED&&(this.state=V.IDLE);return}const a=s?s.stats:n.stats;this.fragLastKbps=Math.round(8*a.total/(a.buffering.end-a.loading.first)),De(n)&&(this.fragPrevious=n),this.fragBufferedComplete(n,s)}const o=this.media;o&&(!this._hasEnoughToStart&&re.getBuffered(o).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),r&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(e,t){var n;if(t.fatal){this.state=V.ERROR;return}switch(t.details){case $.FRAG_GAP:case $.FRAG_PARSING_ERROR:case $.FRAG_DECRYPT_ERROR:case $.FRAG_LOAD_ERROR:case $.FRAG_LOAD_TIMEOUT:case $.KEY_LOAD_ERROR:case $.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(X.MAIN,t);break;case $.LEVEL_LOAD_ERROR:case $.LEVEL_LOAD_TIMEOUT:case $.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===V.WAITING_LEVEL&&((n=t.context)==null?void 0:n.type)===ue.LEVEL&&(this.state=V.IDLE);break;case $.BUFFER_ADD_CODEC_ERROR:case $.BUFFER_APPEND_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&this.resetLoadingState();break;case $.BUFFER_FULL_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&this.flushMainBuffer(0,Number.POSITIVE_INFINITY);break;case $.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onFragLoadEmergencyAborted(){this.state=V.IDLE,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==ve.AUDIO||!this.altAudio){const n=(t===ve.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;n&&(this.afterBufferFlushed(n,t,X.MAIN),this.tick())}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level,this.level===-1&&this.resetWhenMissingContext(this.fragCurrent)),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let n=this.startPosition;if(n>=0&&t<n){if(e.seeking){this.log(`could not seek to ${n}, already seeking at ${t}`);return}const s=this.timelineOffset;s&&n&&(n+=s);const r=this.getLevelDetails(),o=re.getBuffered(e),a=o.length?o.start(0):0,c=a-n,l=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);(this.config.startOnSegmentBoundary||c>0&&(c<l||this.loadingParts&&c<2*((r==null?void 0:r.partTarget)||0)))&&(this.log(`adjusting start position by ${c} to match buffer start`),n+=c,this.startPosition=n),t<n&&(this.log(`seek to target start position ${n} from current time ${t} buffer start ${a}`),e.currentTime=n)}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t.indexOf("mp4a.40.5")!==-1?t="mp4a.40.2":t="mp4a.40.5"),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then(n=>{const{hls:s}=this,r=n==null?void 0:n.frag;if(!r||this.fragContextChanged(r))return;t.fragmentError=0,this.state=V.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const o=r.stats;o.parsing.start=o.parsing.end=o.buffering.start=o.buffering.end=self.performance.now(),s.trigger(A.FRAG_LOADED,n),r.bitrateTest=!1})}_handleTransmuxComplete(e){var t;const n=this.playlistType,{hls:s}=this,{remuxResult:r,chunkMeta:o}=e,a=this.getCurrentContext(o);if(!a){this.resetWhenMissingContext(o);return}const{frag:c,part:l,level:u}=a,{video:f,text:d,id3:h,initSegment:p}=r,{details:m}=u,g=this.altAudio?void 0:r.audio;if(this.fragContextChanged(c)){this.fragmentTracker.removeFragment(c);return}if(this.state=V.PARSING,p){if(p!=null&&p.tracks){const E=c.initSegment||c;this._bufferInitSegment(u,p.tracks,E,o),s.trigger(A.FRAG_PARSING_INIT_SEGMENT,{frag:E,id:n,tracks:p.tracks})}const y=p.initPTS,v=p.timescale,x=this.initPTS[c.cc];q(y)&&(!x||x.baseTime!==y||x.timescale!==v)&&(this.initPTS[c.cc]={baseTime:y,timescale:v},s.trigger(A.INIT_PTS_FOUND,{frag:c,id:n,initPTS:y,timescale:v}))}if(f&&m){g&&f.type==="audiovideo"&&this.logMuxedErr(c);const y=m.fragments[c.sn-1-m.startSN],v=c.sn===m.startSN,x=!y||c.cc>y.cc;if(r.independent!==!1){const{startPTS:E,endPTS:S,startDTS:T,endDTS:_}=f;if(l)l.elementaryStreams[f.type]={startPTS:E,endPTS:S,startDTS:T,endDTS:_};else if(f.firstKeyFrame&&f.independent&&o.id===1&&!x&&(this.couldBacktrack=!0),f.dropped&&f.independent){const I=this.getMainFwdBufferInfo(),w=(I?I.end:this.getLoadPosition())+this.config.maxBufferHole,b=f.firstKeyFramePTS?f.firstKeyFramePTS:E;if(!v&&w<b-this.config.maxBufferHole&&!x){this.backtrack(c);return}else x&&(c.gap=!0);c.setElementaryStreamInfo(f.type,c.start,S,c.start,_,!0)}else v&&E-(m.appliedTimelineOffset||0)>vr&&(c.gap=!0);c.setElementaryStreamInfo(f.type,E,S,T,_),this.backtrackFragment&&(this.backtrackFragment=c),this.bufferFragmentData(f,c,l,o,v||x)}else if(v||x)c.gap=!0;else{this.backtrack(c);return}}if(g){const{startPTS:y,endPTS:v,startDTS:x,endDTS:E}=g;l&&(l.elementaryStreams[ve.AUDIO]={startPTS:y,endPTS:v,startDTS:x,endDTS:E}),c.setElementaryStreamInfo(ve.AUDIO,y,v,x,E),this.bufferFragmentData(g,c,l,o)}if(m&&h!=null&&(t=h.samples)!=null&&t.length){const y={id:n,frag:c,details:m,samples:h.samples};s.trigger(A.FRAG_PARSING_METADATA,y)}if(m&&d){const y={id:n,frag:c,details:m,samples:d.samples};s.trigger(A.FRAG_PARSING_USERDATA,y)}}logMuxedErr(e){this.warn(`${De(e)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${e.url}`)}_bufferInitSegment(e,t,n,s){if(this.state!==V.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&(delete t.audio,t.audiovideo&&this.logMuxedErr(n));const{audio:r,video:o,audiovideo:a}=t;if(r){const l=e.audioCodec;let u=dr(r.codec,l);u==="mp4a"&&(u="mp4a.40.5");const f=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){u&&(u.indexOf("mp4a.40.5")!==-1?u="mp4a.40.2":u="mp4a.40.5");const d=r.metadata;d&&"channelCount"in d&&(d.channelCount||1)!==1&&f.indexOf("firefox")===-1&&(u="mp4a.40.5")}u&&u.indexOf("mp4a.40.5")!==-1&&f.indexOf("android")!==-1&&r.container!=="audio/mpeg"&&(u="mp4a.40.2",this.log(`Android: force audio codec to ${u}`)),l&&l!==u&&this.log(`Swapping manifest audio codec "${l}" for "${u}"`),r.levelCodec=u,r.id=X.MAIN,this.log(`Init audio buffer, container:${r.container}, codecs[selected/level/parsed]=[${u||""}/${l||""}/${r.codec}]`),delete t.audiovideo}if(o){o.levelCodec=e.videoCodec,o.id=X.MAIN;const l=o.codec;if((l==null?void 0:l.length)===4)switch(l){case"hvc1":case"hev1":o.codec="hvc1.1.6.L120.90";break;case"av01":o.codec="av01.0.04M.08";break;case"avc1":o.codec="avc1.42e01e";break}this.log(`Init video buffer, container:${o.container}, codecs[level/parsed]=[${e.videoCodec||""}/${l}]${o.codec!==l?" parsed-corrected="+o.codec:""}${o.supplemental?" supplemental="+o.supplemental:""}`),delete t.audiovideo}a&&(this.log(`Init audiovideo buffer, container:${a.container}, codecs[level/parsed]=[${e.codecs}/${a.codec}]`),delete t.video,delete t.audio);const c=Object.keys(t);if(c.length){if(this.hls.trigger(A.BUFFER_CODECS,t),!this.hls)return;c.forEach(l=>{const f=t[l].initSegment;f!=null&&f.byteLength&&this.hls.trigger(A.BUFFER_APPENDING,{type:l,data:f,frag:n,part:null,chunkMeta:s,parent:n.type})})}this.tickImmediate()}getMainFwdBufferInfo(){const e=this.mediaBuffer&&this.altAudio===2?this.mediaBuffer:this.media;return this.getFwdBufferInfo(e,X.MAIN)}get maxBufferLength(){const{levels:e,level:t}=this,n=e==null?void 0:e[t];return n?this.getMaxBufferLength(n.maxBitrate):this.config.maxBufferLength}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=V.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const n=e.currentTime;if(re.isBuffered(e,n)?t=this.getAppendedFrag(n):re.isBuffered(e,n+.1)&&(t=this.getAppendedFrag(n+.1)),t){this.backtrackFragment=null;const s=this.fragPlaying,r=t.level;(!s||t.sn!==s.sn||s.level!==r)&&(this.fragPlaying=t,this.hls.trigger(A.FRAG_CHANGED,{frag:t}),(!s||s.level!==r)&&this.hls.trigger(A.LEVEL_SWITCHED,{level:r}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){var e;if(this.fragPlaying)return this.fragPlaying;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;return q(t)?this.getAppendedFrag(t):null}get currentProgramDateTime(){var e;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;if(q(t)){const n=this.getLevelDetails(),s=this.currentFrag||(n?qn(null,n.fragments,t):null);if(s){const r=s.programDateTime;if(r!==null){const o=r+(t-s.start)*1e3;return new Date(o)}}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class kI{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const n in this.keyUriToKeyInfo){const s=this.keyUriToKeyInfo[n].loader;if(s){var t;if(e&&e!==((t=s.context)==null?void 0:t.frag.type))return;s.abort()}}}detach(){for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyUriToKeyInfo){const t=this.keyUriToKeyInfo[e].loader;t&&t.destroy()}this.keyUriToKeyInfo={}}createKeyLoadError(e,t=$.KEY_LOAD_ERROR,n,s,r){return new Wt({type:Z.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:r,error:n,networkDetails:s})}loadClear(e,t,n){if(this.emeController&&this.config.emeEnabled&&!this.emeController.getSelectedKeySystemFormats().length){if(t.length)for(let s=0,r=t.length;s<r;s++){const o=t[s];if(e.cc<=o.cc&&(!De(e)||!De(o)||e.sn<o.sn)||!n&&s==r-1)return this.emeController.selectKeySystemFormat(o).then(a=>{if(!this.emeController)return;o.setKeyFormat(a);const c=Ql(a);if(c)return this.emeController.getKeySystemAccess([c])})}if(this.config.requireKeySystemAccessOnStart){const s=pr(this.config);if(s.length)return this.emeController.getKeySystemAccess(s)}}return null}load(e){return!e.decryptdata&&e.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var n,s;t&&e.setKeyFormat(t);const r=e.decryptdata;if(!r){const l=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:"Missing decryption data on fragment in onKeyLoading");return Promise.reject(this.createKeyLoadError(e,$.KEY_LOAD_ERROR,l))}const o=r.uri;if(!o)return Promise.reject(this.createKeyLoadError(e,$.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${o}"`)));let a=this.keyUriToKeyInfo[o];if((n=a)!=null&&n.decryptdata.key)return r.key=a.decryptdata.key,Promise.resolve({frag:e,keyInfo:a});if((s=a)!=null&&s.keyLoadPromise){var c;switch((c=a.mediaKeySessionContext)==null?void 0:c.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return a.keyLoadPromise.then(l=>(r.key=l.keyInfo.decryptdata.key,{frag:e,keyInfo:a}))}}switch(a=this.keyUriToKeyInfo[o]={decryptdata:r,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},r.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return r.keyFormat==="identity"?this.loadKeyHTTP(a,e):this.loadKeyEME(a,e);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(a,e);default:return Promise.reject(this.createKeyLoadError(e,$.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${r.method}"`)))}}loadKeyEME(e,t){const n={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const s=this.emeController.loadKey(n);if(s)return(e.keyLoadPromise=s.then(r=>(e.mediaKeySessionContext=r,n))).catch(r=>{throw e.keyLoadPromise=null,r})}return Promise.resolve(n)}loadKeyHTTP(e,t){const n=this.config,s=n.loader,r=new s(n);return t.keyLoader=e.loader=r,e.keyLoadPromise=new Promise((o,a)=>{const c={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},l=n.keyLoadPolicy.default,u={loadPolicy:l,timeout:l.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},f={onSuccess:(d,h,p,m)=>{const{frag:g,keyInfo:y,url:v}=p;if(!g.decryptdata||y!==this.keyUriToKeyInfo[v])return a(this.createKeyLoadError(g,$.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),m));y.decryptdata.key=g.decryptdata.key=new Uint8Array(d.data),g.keyLoader=null,y.loader=null,o({frag:g,keyInfo:y})},onError:(d,h,p,m)=>{this.resetLoader(h),a(this.createKeyLoadError(t,$.KEY_LOAD_ERROR,new Error(`HTTP Error ${d.code} loading key ${d.text}`),p,ye({url:c.url,data:void 0},d)))},onTimeout:(d,h,p)=>{this.resetLoader(h),a(this.createKeyLoadError(t,$.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),p))},onAbort:(d,h,p)=>{this.resetLoader(h),a(this.createKeyLoadError(t,$.INTERNAL_ABORTED,new Error("key loading aborted"),p))}};r.load(c,u,f)})}resetLoader(e){const{frag:t,keyInfo:n,url:s}=e,r=n.loader;t.keyLoader===r&&(t.keyLoader=null,n.loader=null),delete this.keyUriToKeyInfo[s],r&&r.destroy()}}function Fd(i){const{type:e}=i;switch(e){case ue.AUDIO_TRACK:return X.AUDIO;case ue.SUBTITLE_TRACK:return X.SUBTITLE;default:return X.MAIN}}function ca(i,e){let t=i.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class BI{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.onManifestLoaded=this.checkAutostartLoad,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(A.MANIFEST_LOADING,this.onManifestLoading,this),e.on(A.LEVEL_LOADING,this.onLevelLoading,this),e.on(A.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(A.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.on(A.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:e}=this;e.off(A.MANIFEST_LOADING,this.onManifestLoading,this),e.off(A.LEVEL_LOADING,this.onLevelLoading,this),e.off(A.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(A.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.off(A.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(e){const t=this.hls.config,n=t.pLoader,s=t.loader,r=n||s,o=new r(t);return this.loaders[e.type]=o,o}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:n}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:ue.MANIFEST,url:n,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(e,t){const{id:n,level:s,pathwayId:r,url:o,deliveryDirectives:a,levelInfo:c}=t;this.load({id:n,level:s,pathwayId:r,responseType:"text",type:ue.LEVEL,url:o,deliveryDirectives:a,levelOrTrack:c})}onAudioTrackLoading(e,t){const{id:n,groupId:s,url:r,deliveryDirectives:o,track:a}=t;this.load({id:n,groupId:s,level:null,responseType:"text",type:ue.AUDIO_TRACK,url:r,deliveryDirectives:o,levelOrTrack:a})}onSubtitleTrackLoading(e,t){const{id:n,groupId:s,url:r,deliveryDirectives:o,track:a}=t;this.load({id:n,groupId:s,level:null,responseType:"text",type:ue.SUBTITLE_TRACK,url:r,deliveryDirectives:o,levelOrTrack:a})}onLevelsUpdated(e,t){const n=this.loaders[ue.LEVEL];if(n){const s=n.context;s&&!t.levels.some(r=>r===s.levelOrTrack)&&(n.abort(),delete this.loaders[ue.LEVEL])}}load(e){var t;const n=this.hls.config;let s=this.getInternalLoader(e);if(s){const l=this.hls.logger,u=s.context;if(u&&u.levelOrTrack===e.levelOrTrack&&(u.url===e.url||u.deliveryDirectives&&!e.deliveryDirectives)){u.url===e.url?l.log(`[playlist-loader]: ignore ${e.url} ongoing request`):l.log(`[playlist-loader]: ignore ${e.url} in favor of ${u.url}`);return}l.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),s.abort()}let r;if(e.type===ue.MANIFEST?r=n.manifestLoadPolicy.default:r=me({},n.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),s=this.createInternalLoader(e),q((t=e.deliveryDirectives)==null?void 0:t.part)){let l;if(e.type===ue.LEVEL&&e.level!==null?l=this.hls.levels[e.level].details:e.type===ue.AUDIO_TRACK&&e.id!==null?l=this.hls.audioTracks[e.id].details:e.type===ue.SUBTITLE_TRACK&&e.id!==null&&(l=this.hls.subtitleTracks[e.id].details),l){const u=l.partTarget,f=l.targetduration;if(u&&f){const d=Math.max(u*3,f*.8)*1e3;r=me({},r,{maxTimeToFirstByteMs:Math.min(d,r.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(d,r.maxTimeToFirstByteMs)})}}}const o=r.errorRetry||r.timeoutRetry||{},a={loadPolicy:r,timeout:r.maxLoadTimeMs,maxRetry:o.maxNumRetry||0,retryDelay:o.retryDelayMs||0,maxRetryDelay:o.maxRetryDelayMs||0},c={onSuccess:(l,u,f,d)=>{const h=this.getInternalLoader(f);this.resetInternalLoader(f.type);const p=l.data;if(p.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(l,f,new Error("no EXTM3U delimiter"),d||null,u);return}u.parsing.start=performance.now(),Nt.isMediaPlaylist(p)||f.type!==ue.MANIFEST?this.handleTrackOrLevelPlaylist(l,u,f,d||null,h):this.handleMasterPlaylist(l,u,f,d)},onError:(l,u,f,d)=>{this.handleNetworkError(u,f,!1,l,d)},onTimeout:(l,u,f)=>{this.handleNetworkError(u,f,!0,void 0,l)}};s.load(e,a,c)}checkAutostartLoad(){if(!this.hls)return;const{config:{autoStartLoad:e,startPosition:t},forceStartLoad:n}=this.hls;(e||n)&&(this.hls.logger.log(`${e?"auto":"force"} startLoad with configured startPosition ${t}`),this.hls.startLoad(t))}handleMasterPlaylist(e,t,n,s){const r=this.hls,o=e.data,a=ca(e,n),c=Nt.parseMasterPlaylist(o,a);if(c.playlistParsingError){this.handleManifestParsingError(e,n,c.playlistParsingError,s,t);return}const{contentSteering:l,levels:u,sessionData:f,sessionKeys:d,startTimeOffset:h,variableList:p}=c;this.variableList=p;const{AUDIO:m=[],SUBTITLES:g,"CLOSED-CAPTIONS":y}=Nt.parseMasterPlaylistMedia(o,a,c);m.length&&!m.some(x=>!x.url)&&u[0].audioCodec&&!u[0].attrs.AUDIO&&(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),m.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new Se({}),bitrate:0,url:""})),r.trigger(A.MANIFEST_LOADED,{levels:u,audioTracks:m,subtitles:g,captions:y,contentSteering:l,url:a,stats:t,networkDetails:s,sessionData:f,sessionKeys:d,startTimeOffset:h,variableList:p})}handleTrackOrLevelPlaylist(e,t,n,s,r){const o=this.hls,{id:a,level:c,type:l}=n,u=ca(e,n),f=q(c)?c:q(a)?a:0,d=Fd(n),h=Nt.parseLevelPlaylist(e.data,u,f,d,0,this.variableList);if(l===ue.MANIFEST){const p={attrs:new Se({}),bitrate:0,details:h,name:"",url:u};h.requestScheduled=t.loading.start+o1(h,0),o.trigger(A.MANIFEST_LOADED,{levels:[p],audioTracks:[],url:u,stats:t,networkDetails:s,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),n.levelDetails=h,this.handlePlaylistLoaded(h,e,t,n,s,r)}handleManifestParsingError(e,t,n,s,r){this.hls.trigger(A.ERROR,{type:Z.NETWORK_ERROR,details:$.MANIFEST_PARSING_ERROR,fatal:t.type===ue.MANIFEST,url:e.url,err:n,error:n,reason:n.message,response:e,context:t,networkDetails:s,stats:r})}handleNetworkError(e,t,n=!1,s,r){let o=`A network ${n?"timeout":"error"+(s?" (status "+s.code+")":"")} occurred while loading ${e.type}`;e.type===ue.LEVEL?o+=`: ${e.level} id: ${e.id}`:(e.type===ue.AUDIO_TRACK||e.type===ue.SUBTITLE_TRACK)&&(o+=` id: ${e.id} group-id: "${e.groupId}"`);const a=new Error(o);this.hls.logger.warn(`[playlist-loader]: ${o}`);let c=$.UNKNOWN,l=!1;const u=this.getInternalLoader(e);switch(e.type){case ue.MANIFEST:c=n?$.MANIFEST_LOAD_TIMEOUT:$.MANIFEST_LOAD_ERROR,l=!0;break;case ue.LEVEL:c=n?$.LEVEL_LOAD_TIMEOUT:$.LEVEL_LOAD_ERROR,l=!1;break;case ue.AUDIO_TRACK:c=n?$.AUDIO_TRACK_LOAD_TIMEOUT:$.AUDIO_TRACK_LOAD_ERROR,l=!1;break;case ue.SUBTITLE_TRACK:c=n?$.SUBTITLE_TRACK_LOAD_TIMEOUT:$.SUBTITLE_LOAD_ERROR,l=!1;break}u&&this.resetInternalLoader(e.type);const f={type:Z.NETWORK_ERROR,details:c,fatal:l,url:e.url,loader:u,context:e,error:a,networkDetails:t,stats:r};if(s){const d=(t==null?void 0:t.url)||e.url;f.response=ye({url:d,data:void 0},s)}this.hls.trigger(A.ERROR,f)}handlePlaylistLoaded(e,t,n,s,r,o){const a=this.hls,{type:c,level:l,id:u,groupId:f,deliveryDirectives:d}=s,h=ca(t,s),p=Fd(s),m=typeof s.level=="number"&&p===X.MAIN?l:void 0;if(!e.fragments.length){const y=e.playlistParsingError=new Error("No Segments found in Playlist");a.trigger(A.ERROR,{type:Z.NETWORK_ERROR,details:$.LEVEL_EMPTY_ERROR,fatal:!1,url:h,error:y,reason:y.message,response:t,context:s,level:m,parent:p,networkDetails:r,stats:n});return}e.targetduration||(e.playlistParsingError=new Error("Missing Target Duration"));const g=e.playlistParsingError;if(g){if(this.hls.logger.warn(g),!a.config.ignorePlaylistParsingErrors){a.trigger(A.ERROR,{type:Z.NETWORK_ERROR,details:$.LEVEL_PARSING_ERROR,fatal:!1,url:h,error:g,reason:g.message,response:t,context:s,level:m,parent:p,networkDetails:r,stats:n});return}e.playlistParsingError=null}switch(e.live&&o&&(o.getCacheAge&&(e.ageHeader=o.getCacheAge()||0),(!o.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),c){case ue.MANIFEST:case ue.LEVEL:a.trigger(A.LEVEL_LOADED,{details:e,levelInfo:s.levelOrTrack||a.levels[0],level:m||0,id:u||0,stats:n,networkDetails:r,deliveryDirectives:d,withoutMultiVariant:c===ue.MANIFEST});break;case ue.AUDIO_TRACK:a.trigger(A.AUDIO_TRACK_LOADED,{details:e,track:s.levelOrTrack,id:u||0,groupId:f||"",stats:n,networkDetails:r,deliveryDirectives:d});break;case ue.SUBTITLE_TRACK:a.trigger(A.SUBTITLE_TRACK_LOADED,{details:e,track:s.levelOrTrack,id:u||0,groupId:f||"",stats:n,networkDetails:r,deliveryDirectives:d});break}}}class fn{static get version(){return As}static isMSESupported(){return ex()}static isSupported(){return RI()}static getMediaSource(){return Tn()}static get Events(){return A}static get MetadataSchema(){return ut}static get ErrorTypes(){return Z}static get ErrorDetails(){return $}static get DefaultConfig(){return fn.defaultConfig?fn.defaultConfig:xI}static set DefaultConfig(e){fn.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.logger=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new uu,this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioStreamController=void 0,this.subtititleStreamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.interstitialsController=void 0,this.gapController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this._url=null,this._sessionId=void 0,this.triggeringException=void 0,this.started=!1;const t=this.logger=eb(e.debug||!1,"Hls instance",e.assetPlayerId),n=this.config=vI(fn.DefaultConfig,e,t);this.userConfig=e,n.progressive&&EI(n,t);const{abrController:s,bufferController:r,capLevelController:o,errorController:a,fpsController:c}=n,l=new a(this),u=this.abrController=new s(this),f=new jb(this),d=n.interstitialsController,h=d?this.interstitialsController=new d(this,fn):null,p=this.bufferController=new r(this,f),m=this.capLevelController=new o(this),g=new c(this),y=new BI(this),v=n.contentSteeringController,x=v?new v(this):null,E=this.levelController=new LI(this,x),S=new II(this),T=new kI(this.config),_=this.streamController=new PI(this,f,T),I=this.gapController=new bI(this,f);m.setStreamController(_),g.setStreamController(_);const w=[y,E,_];h&&w.splice(1,0,h),x&&w.splice(1,0,x),this.networkControllers=w;const b=[u,p,I,m,g,S,f];this.audioTrackController=this.createController(n.audioTrackController,w);const L=n.audioStreamController;L&&w.push(this.audioStreamController=new L(this,f,T)),this.subtitleTrackController=this.createController(n.subtitleTrackController,w);const k=n.subtitleStreamController;k&&w.push(this.subtititleStreamController=new k(this,f,T)),this.createController(n.timelineController,b),T.emeController=this.emeController=this.createController(n.emeController,b),this.cmcdController=this.createController(n.cmcdController,b),this.latencyController=this.createController(CI,b),this.coreComponents=b,w.push(l);const M=l.onErrorOut;typeof M=="function"&&this.on(A.ERROR,M,l),this.on(A.MANIFEST_LOADED,y.onManifestLoaded,y)}createController(e,t){if(e){const n=new e(this);return t&&t.push(n),n}return null}on(e,t,n=this){this._emitter.on(e,t,n)}once(e,t,n=this){this._emitter.once(e,t,n)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,n=this,s){this._emitter.off(e,t,n,s)}listeners(e){return this._emitter.listeners(e)}emit(e,t,n){return this._emitter.emit(e,t,n)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(n){if(this.logger.error("An internal error happened while handling event "+e+'. Error message: "'+n.message+'". Here is a stacktrace:',n),!this.triggeringException){this.triggeringException=!0;const s=e===A.ERROR;this.trigger(A.ERROR,{type:Z.OTHER_ERROR,details:$.INTERNAL_EXCEPTION,fatal:s,event:e,error:n}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){this.logger.log("destroy"),this.trigger(A.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this._url=null,this.networkControllers.forEach(t=>t.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(t=>t.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){if(!e||"media"in e&&!e.media){const r=new Error(`attachMedia failed: invalid argument (${e})`);this.trigger(A.ERROR,{type:Z.OTHER_ERROR,details:$.ATTACH_MEDIA_ERROR,fatal:!0,error:r});return}this.logger.log("attachMedia"),this._media&&(this.logger.warn("media must be detached before attaching"),this.detachMedia());const t="media"in e,n=t?e.media:e,s=t?e:{media:n};this._media=n,this.trigger(A.MEDIA_ATTACHING,s)}detachMedia(){this.logger.log("detachMedia"),this.trigger(A.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const e=this.bufferController.transferMedia();return this.trigger(A.MEDIA_DETACHING,{transferMedia:e}),e}loadSource(e){this.stopLoad();const t=this.media,n=this._url,s=this._url=eu.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${s}`),t&&n&&(n!==s||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(A.MANIFEST_LOADING,{url:e})}get url(){return this._url}get hasEnoughToStart(){return this.streamController.hasEnoughToStart}get startPosition(){return this.streamController.startPositionValue}startLoad(e=-1,t){this.logger.log(`startLoad(${e+(t?", <skip seek to start>":"")})`),this.started=!0,this.resumeBuffering();for(let n=0;n<this.networkControllers.length&&(this.networkControllers[n].startLoad(e,t),!(!this.started||!this.networkControllers));n++);}stopLoad(){this.logger.log("stopLoad"),this.started=!1;for(let e=0;e<this.networkControllers.length&&(this.networkControllers[e].stopLoad(),!(this.started||!this.networkControllers));e++);}get loadingEnabled(){return this.started}get bufferingEnabled(){return this.streamController.bufferingEnabled}resumeBuffering(){this.bufferingEnabled||(this.logger.log("resume buffering"),this.networkControllers.forEach(e=>{e.resumeBuffering&&e.resumeBuffering()}))}pauseBuffering(){this.bufferingEnabled&&(this.logger.log("pause buffering"),this.networkControllers.forEach(e=>{e.pauseBuffering&&e.pauseBuffering()}))}get inFlightFragments(){const e={[X.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[X.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[X.SUBTITLE]=this.subtititleStreamController.inFlightFrag),e}swapAudioCodec(){this.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){this.logger.log("recoverMediaError");const e=this._media,t=e==null?void 0:e.currentTime;this.detachMedia(),e&&(this.attachMedia(e),t&&this.startLoad(t))}removeLevel(e){this.levelController.removeLevel(e)}get sessionId(){let e=this._sessionId;return e||(e=this._sessionId=b7()),e}get levels(){const e=this.levelController.levels;return e||[]}get latestLevelDetails(){return this.streamController.getLevelDetails()||null}get loadLevelObj(){return this.levelController.loadLevelObj}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){this.logger.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){this.logger.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){this.logger.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){this.logger.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){const e=this.levelController.startLevel;return e===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){this.logger.log(`set startLevel:${e}`),e!==-1&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get abrEwmaDefaultEstimate(){const{bwEstimator:e}=this.abrController;return e?e.defaultEstimate:NaN}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(this.logger.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){Rb(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:t}}=this;if(!e)return 0;const n=e.length;for(let s=0;s<n;s++)if(e[s].maxBitrate>=t)return s;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:n}=this;let s;if(t===-1&&e!=null&&e.length?s=e.length-1:s=t,n)for(let r=s;r--;){const o=e[r].attrs["HDCP-LEVEL"];if(o&&o<=n)return r}return s}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get maxBufferLength(){return this.streamController.maxBufferLength}setAudioOption(e){var t;return((t=this.audioTrackController)==null?void 0:t.setAudioOption(e))||null}setSubtitleOption(e){var t;return((t=this.subtitleTrackController)==null?void 0:t.setSubtitleOption(e))||null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const t=this.audioTrackController;t&&(t.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}set targetLatency(e){this.latencyController.targetLatency=e}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}get pathways(){return this.levelController.pathways}get pathwayPriority(){return this.levelController.pathwayPriority}set pathwayPriority(e){this.levelController.pathwayPriority=e}get bufferedToEnd(){var e;return!!((e=this.bufferController)!=null&&e.bufferedToEnd)}get interstitialsManager(){var e;return((e=this.interstitialsController)==null?void 0:e.interstitialsManager)||null}getMediaDecodingInfo(e,t=this.allAudioTracks){const n=Qm(t);return Wm(e,n,navigator.mediaCapabilities)}}fn.defaultConfig=void 0;var ae=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function tx(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function FI(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 s=Object.getOwnPropertyDescriptor(i,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:function(){return i[n]}})}),t}var nx={exports:{}};function OI(i){throw new Error('Could not dynamically require "'+i+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ua={exports:{}};const MI=new Proxy({},{get(i,e){throw new Error(`Module "" has been externalized for browser compatibility. Cannot access ".${e}" in client code. See https://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.`)}}),NI=Object.freeze(Object.defineProperty({__proto__:null,default:MI},Symbol.toStringTag,{value:"Module"})),UI=FI(NI);var Od;function he(){return Od||(Od=1,function(i,e){(function(t,n){i.exports=n()})(ae,function(){var t=t||function(n,s){var r;if(typeof window<"u"&&window.crypto&&(r=window.crypto),typeof self<"u"&&self.crypto&&(r=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(r=globalThis.crypto),!r&&typeof window<"u"&&window.msCrypto&&(r=window.msCrypto),!r&&typeof ae<"u"&&ae.crypto&&(r=ae.crypto),!r&&typeof OI=="function")try{r=UI}catch{}var o=function(){if(r){if(typeof r.getRandomValues=="function")try{return r.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof r.randomBytes=="function")try{return r.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||function(){function v(){}return function(x){var E;return v.prototype=x,E=new v,v.prototype=null,E}}(),c={},l=c.lib={},u=l.Base=function(){return{extend:function(v){var x=a(this);return v&&x.mixIn(v),(!x.hasOwnProperty("init")||this.init===x.init)&&(x.init=function(){x.$super.init.apply(this,arguments)}),x.init.prototype=x,x.$super=this,x},create:function(){var v=this.extend();return v.init.apply(v,arguments),v},init:function(){},mixIn:function(v){for(var x in v)v.hasOwnProperty(x)&&(this[x]=v[x]);v.hasOwnProperty("toString")&&(this.toString=v.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),f=l.WordArray=u.extend({init:function(v,x){v=this.words=v||[],x!=s?this.sigBytes=x:this.sigBytes=v.length*4},toString:function(v){return(v||h).stringify(this)},concat:function(v){var x=this.words,E=v.words,S=this.sigBytes,T=v.sigBytes;if(this.clamp(),S%4)for(var _=0;_<T;_++){var I=E[_>>>2]>>>24-_%4*8&255;x[S+_>>>2]|=I<<24-(S+_)%4*8}else for(var w=0;w<T;w+=4)x[S+w>>>2]=E[w>>>2];return this.sigBytes+=T,this},clamp:function(){var v=this.words,x=this.sigBytes;v[x>>>2]&=4294967295<<32-x%4*8,v.length=n.ceil(x/4)},clone:function(){var v=u.clone.call(this);return v.words=this.words.slice(0),v},random:function(v){for(var x=[],E=0;E<v;E+=4)x.push(o());return new f.init(x,v)}}),d=c.enc={},h=d.Hex={stringify:function(v){for(var x=v.words,E=v.sigBytes,S=[],T=0;T<E;T++){var _=x[T>>>2]>>>24-T%4*8&255;S.push((_>>>4).toString(16)),S.push((_&15).toString(16))}return S.join("")},parse:function(v){for(var x=v.length,E=[],S=0;S<x;S+=2)E[S>>>3]|=parseInt(v.substr(S,2),16)<<24-S%8*4;return new f.init(E,x/2)}},p=d.Latin1={stringify:function(v){for(var x=v.words,E=v.sigBytes,S=[],T=0;T<E;T++){var _=x[T>>>2]>>>24-T%4*8&255;S.push(String.fromCharCode(_))}return S.join("")},parse:function(v){for(var x=v.length,E=[],S=0;S<x;S++)E[S>>>2]|=(v.charCodeAt(S)&255)<<24-S%4*8;return new f.init(E,x)}},m=d.Utf8={stringify:function(v){try{return decodeURIComponent(escape(p.stringify(v)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(v){return p.parse(unescape(encodeURIComponent(v)))}},g=l.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new f.init,this._nDataBytes=0},_append:function(v){typeof v=="string"&&(v=m.parse(v)),this._data.concat(v),this._nDataBytes+=v.sigBytes},_process:function(v){var x,E=this._data,S=E.words,T=E.sigBytes,_=this.blockSize,I=_*4,w=T/I;v?w=n.ceil(w):w=n.max((w|0)-this._minBufferSize,0);var b=w*_,L=n.min(b*4,T);if(b){for(var k=0;k<b;k+=_)this._doProcessBlock(S,k);x=S.splice(0,b),E.sigBytes-=L}return new f.init(x,L)},clone:function(){var v=u.clone.call(this);return v._data=this._data.clone(),v},_minBufferSize:0});l.Hasher=g.extend({cfg:u.extend(),init:function(v){this.cfg=this.cfg.extend(v),this.reset()},reset:function(){g.reset.call(this),this._doReset()},update:function(v){return this._append(v),this._process(),this},finalize:function(v){v&&this._append(v);var x=this._doFinalize();return x},blockSize:16,_createHelper:function(v){return function(x,E){return new v.init(E).finalize(x)}},_createHmacHelper:function(v){return function(x,E){return new y.HMAC.init(v,E).finalize(x)}}});var y=c.algo={};return c}(Math);return t})}(ua)),ua.exports}var fa={exports:{}},Md;function yo(){return Md||(Md=1,function(i,e){(function(t,n){i.exports=n(he())})(ae,function(t){return function(n){var s=t,r=s.lib,o=r.Base,a=r.WordArray,c=s.x64={};c.Word=o.extend({init:function(l,u){this.high=l,this.low=u}}),c.WordArray=o.extend({init:function(l,u){l=this.words=l||[],u!=n?this.sigBytes=u:this.sigBytes=l.length*8},toX32:function(){for(var l=this.words,u=l.length,f=[],d=0;d<u;d++){var h=l[d];f.push(h.high),f.push(h.low)}return a.create(f,this.sigBytes)},clone:function(){for(var l=o.clone.call(this),u=l.words=this.words.slice(0),f=u.length,d=0;d<f;d++)u[d]=u[d].clone();return l}})}(),t})}(fa)),fa.exports}var da={exports:{}},Nd;function $I(){return Nd||(Nd=1,function(i,e){(function(t,n){i.exports=n(he())})(ae,function(t){return function(){if(typeof ArrayBuffer=="function"){var n=t,s=n.lib,r=s.WordArray,o=r.init,a=r.init=function(c){if(c instanceof ArrayBuffer&&(c=new Uint8Array(c)),(c instanceof Int8Array||typeof Uint8ClampedArray<"u"&&c instanceof Uint8ClampedArray||c instanceof Int16Array||c instanceof Uint16Array||c instanceof Int32Array||c instanceof Uint32Array||c instanceof Float32Array||c instanceof Float64Array)&&(c=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)),c instanceof Uint8Array){for(var l=c.byteLength,u=[],f=0;f<l;f++)u[f>>>2]|=c[f]<<24-f%4*8;o.call(this,u,l)}else o.apply(this,arguments)};a.prototype=r}}(),t.lib.WordArray})}(da)),da.exports}var ha={exports:{}},Ud;function HI(){return Ud||(Ud=1,function(i,e){(function(t,n){i.exports=n(he())})(ae,function(t){return function(){var n=t,s=n.lib,r=s.WordArray,o=n.enc;o.Utf16=o.Utf16BE={stringify:function(c){for(var l=c.words,u=c.sigBytes,f=[],d=0;d<u;d+=2){var h=l[d>>>2]>>>16-d%4*8&65535;f.push(String.fromCharCode(h))}return f.join("")},parse:function(c){for(var l=c.length,u=[],f=0;f<l;f++)u[f>>>1]|=c.charCodeAt(f)<<16-f%2*16;return r.create(u,l*2)}},o.Utf16LE={stringify:function(c){for(var l=c.words,u=c.sigBytes,f=[],d=0;d<u;d+=2){var h=a(l[d>>>2]>>>16-d%4*8&65535);f.push(String.fromCharCode(h))}return f.join("")},parse:function(c){for(var l=c.length,u=[],f=0;f<l;f++)u[f>>>1]|=a(c.charCodeAt(f)<<16-f%2*16);return r.create(u,l*2)}};function a(c){return c<<8&4278255360|c>>>8&16711935}}(),t.enc.Utf16})}(ha)),ha.exports}var pa={exports:{}},$d;function ei(){return $d||($d=1,function(i,e){(function(t,n){i.exports=n(he())})(ae,function(t){return function(){var n=t,s=n.lib,r=s.WordArray,o=n.enc;o.Base64={stringify:function(c){var l=c.words,u=c.sigBytes,f=this._map;c.clamp();for(var d=[],h=0;h<u;h+=3)for(var p=l[h>>>2]>>>24-h%4*8&255,m=l[h+1>>>2]>>>24-(h+1)%4*8&255,g=l[h+2>>>2]>>>24-(h+2)%4*8&255,y=p<<16|m<<8|g,v=0;v<4&&h+v*.75<u;v++)d.push(f.charAt(y>>>6*(3-v)&63));var x=f.charAt(64);if(x)for(;d.length%4;)d.push(x);return d.join("")},parse:function(c){var l=c.length,u=this._map,f=this._reverseMap;if(!f){f=this._reverseMap=[];for(var d=0;d<u.length;d++)f[u.charCodeAt(d)]=d}var h=u.charAt(64);if(h){var p=c.indexOf(h);p!==-1&&(l=p)}return a(c,l,f)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function a(c,l,u){for(var f=[],d=0,h=0;h<l;h++)if(h%4){var p=u[c.charCodeAt(h-1)]<<h%4*2,m=u[c.charCodeAt(h)]>>>6-h%4*2,g=p|m;f[d>>>2]|=g<<24-d%4*8,d++}return r.create(f,d)}}(),t.enc.Base64})}(pa)),pa.exports}var ga={exports:{}},Hd;function GI(){return Hd||(Hd=1,function(i,e){(function(t,n){i.exports=n(he())})(ae,function(t){return function(){var n=t,s=n.lib,r=s.WordArray,o=n.enc;o.Base64url={stringify:function(c,l){l===void 0&&(l=!0);var u=c.words,f=c.sigBytes,d=l?this._safe_map:this._map;c.clamp();for(var h=[],p=0;p<f;p+=3)for(var m=u[p>>>2]>>>24-p%4*8&255,g=u[p+1>>>2]>>>24-(p+1)%4*8&255,y=u[p+2>>>2]>>>24-(p+2)%4*8&255,v=m<<16|g<<8|y,x=0;x<4&&p+x*.75<f;x++)h.push(d.charAt(v>>>6*(3-x)&63));var E=d.charAt(64);if(E)for(;h.length%4;)h.push(E);return h.join("")},parse:function(c,l){l===void 0&&(l=!0);var u=c.length,f=l?this._safe_map:this._map,d=this._reverseMap;if(!d){d=this._reverseMap=[];for(var h=0;h<f.length;h++)d[f.charCodeAt(h)]=h}var p=f.charAt(64);if(p){var m=c.indexOf(p);m!==-1&&(u=m)}return a(c,u,d)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"};function a(c,l,u){for(var f=[],d=0,h=0;h<l;h++)if(h%4){var p=u[c.charCodeAt(h-1)]<<h%4*2,m=u[c.charCodeAt(h)]>>>6-h%4*2,g=p|m;f[d>>>2]|=g<<24-d%4*8,d++}return r.create(f,d)}}(),t.enc.Base64url})}(ga)),ga.exports}var ma={exports:{}},Gd;function ti(){return Gd||(Gd=1,function(i,e){(function(t,n){i.exports=n(he())})(ae,function(t){return function(n){var s=t,r=s.lib,o=r.WordArray,a=r.Hasher,c=s.algo,l=[];(function(){for(var m=0;m<64;m++)l[m]=n.abs(n.sin(m+1))*4294967296|0})();var u=c.MD5=a.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(m,g){for(var y=0;y<16;y++){var v=g+y,x=m[v];m[v]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360}var E=this._hash.words,S=m[g+0],T=m[g+1],_=m[g+2],I=m[g+3],w=m[g+4],b=m[g+5],L=m[g+6],k=m[g+7],M=m[g+8],N=m[g+9],F=m[g+10],O=m[g+11],K=m[g+12],B=m[g+13],G=m[g+14],H=m[g+15],C=E[0],R=E[1],P=E[2],D=E[3];C=f(C,R,P,D,S,7,l[0]),D=f(D,C,R,P,T,12,l[1]),P=f(P,D,C,R,_,17,l[2]),R=f(R,P,D,C,I,22,l[3]),C=f(C,R,P,D,w,7,l[4]),D=f(D,C,R,P,b,12,l[5]),P=f(P,D,C,R,L,17,l[6]),R=f(R,P,D,C,k,22,l[7]),C=f(C,R,P,D,M,7,l[8]),D=f(D,C,R,P,N,12,l[9]),P=f(P,D,C,R,F,17,l[10]),R=f(R,P,D,C,O,22,l[11]),C=f(C,R,P,D,K,7,l[12]),D=f(D,C,R,P,B,12,l[13]),P=f(P,D,C,R,G,17,l[14]),R=f(R,P,D,C,H,22,l[15]),C=d(C,R,P,D,T,5,l[16]),D=d(D,C,R,P,L,9,l[17]),P=d(P,D,C,R,O,14,l[18]),R=d(R,P,D,C,S,20,l[19]),C=d(C,R,P,D,b,5,l[20]),D=d(D,C,R,P,F,9,l[21]),P=d(P,D,C,R,H,14,l[22]),R=d(R,P,D,C,w,20,l[23]),C=d(C,R,P,D,N,5,l[24]),D=d(D,C,R,P,G,9,l[25]),P=d(P,D,C,R,I,14,l[26]),R=d(R,P,D,C,M,20,l[27]),C=d(C,R,P,D,B,5,l[28]),D=d(D,C,R,P,_,9,l[29]),P=d(P,D,C,R,k,14,l[30]),R=d(R,P,D,C,K,20,l[31]),C=h(C,R,P,D,b,4,l[32]),D=h(D,C,R,P,M,11,l[33]),P=h(P,D,C,R,O,16,l[34]),R=h(R,P,D,C,G,23,l[35]),C=h(C,R,P,D,T,4,l[36]),D=h(D,C,R,P,w,11,l[37]),P=h(P,D,C,R,k,16,l[38]),R=h(R,P,D,C,F,23,l[39]),C=h(C,R,P,D,B,4,l[40]),D=h(D,C,R,P,S,11,l[41]),P=h(P,D,C,R,I,16,l[42]),R=h(R,P,D,C,L,23,l[43]),C=h(C,R,P,D,N,4,l[44]),D=h(D,C,R,P,K,11,l[45]),P=h(P,D,C,R,H,16,l[46]),R=h(R,P,D,C,_,23,l[47]),C=p(C,R,P,D,S,6,l[48]),D=p(D,C,R,P,k,10,l[49]),P=p(P,D,C,R,G,15,l[50]),R=p(R,P,D,C,b,21,l[51]),C=p(C,R,P,D,K,6,l[52]),D=p(D,C,R,P,I,10,l[53]),P=p(P,D,C,R,F,15,l[54]),R=p(R,P,D,C,T,21,l[55]),C=p(C,R,P,D,M,6,l[56]),D=p(D,C,R,P,H,10,l[57]),P=p(P,D,C,R,L,15,l[58]),R=p(R,P,D,C,B,21,l[59]),C=p(C,R,P,D,w,6,l[60]),D=p(D,C,R,P,O,10,l[61]),P=p(P,D,C,R,_,15,l[62]),R=p(R,P,D,C,N,21,l[63]),E[0]=E[0]+C|0,E[1]=E[1]+R|0,E[2]=E[2]+P|0,E[3]=E[3]+D|0},_doFinalize:function(){var m=this._data,g=m.words,y=this._nDataBytes*8,v=m.sigBytes*8;g[v>>>5]|=128<<24-v%32;var x=n.floor(y/4294967296),E=y;g[(v+64>>>9<<4)+15]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,g[(v+64>>>9<<4)+14]=(E<<8|E>>>24)&16711935|(E<<24|E>>>8)&4278255360,m.sigBytes=(g.length+1)*4,this._process();for(var S=this._hash,T=S.words,_=0;_<4;_++){var I=T[_];T[_]=(I<<8|I>>>24)&16711935|(I<<24|I>>>8)&4278255360}return S},clone:function(){var m=a.clone.call(this);return m._hash=this._hash.clone(),m}});function f(m,g,y,v,x,E,S){var T=m+(g&y|~g&v)+x+S;return(T<<E|T>>>32-E)+g}function d(m,g,y,v,x,E,S){var T=m+(g&v|y&~v)+x+S;return(T<<E|T>>>32-E)+g}function h(m,g,y,v,x,E,S){var T=m+(g^y^v)+x+S;return(T<<E|T>>>32-E)+g}function p(m,g,y,v,x,E,S){var T=m+(y^(g|~v))+x+S;return(T<<E|T>>>32-E)+g}s.MD5=a._createHelper(u),s.HmacMD5=a._createHmacHelper(u)}(Math),t.MD5})}(ma)),ma.exports}var xa={exports:{}},Kd;function ix(){return Kd||(Kd=1,function(i,e){(function(t,n){i.exports=n(he())})(ae,function(t){return function(){var n=t,s=n.lib,r=s.WordArray,o=s.Hasher,a=n.algo,c=[],l=a.SHA1=o.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(u,f){for(var d=this._hash.words,h=d[0],p=d[1],m=d[2],g=d[3],y=d[4],v=0;v<80;v++){if(v<16)c[v]=u[f+v]|0;else{var x=c[v-3]^c[v-8]^c[v-14]^c[v-16];c[v]=x<<1|x>>>31}var E=(h<<5|h>>>27)+y+c[v];v<20?E+=(p&m|~p&g)+1518500249:v<40?E+=(p^m^g)+1859775393:v<60?E+=(p&m|p&g|m&g)-1894007588:E+=(p^m^g)-899497514,y=g,g=m,m=p<<30|p>>>2,p=h,h=E}d[0]=d[0]+h|0,d[1]=d[1]+p|0,d[2]=d[2]+m|0,d[3]=d[3]+g|0,d[4]=d[4]+y|0},_doFinalize:function(){var u=this._data,f=u.words,d=this._nDataBytes*8,h=u.sigBytes*8;return f[h>>>5]|=128<<24-h%32,f[(h+64>>>9<<4)+14]=Math.floor(d/4294967296),f[(h+64>>>9<<4)+15]=d,u.sigBytes=f.length*4,this._process(),this._hash},clone:function(){var u=o.clone.call(this);return u._hash=this._hash.clone(),u}});n.SHA1=o._createHelper(l),n.HmacSHA1=o._createHmacHelper(l)}(),t.SHA1})}(xa)),xa.exports}var ya={exports:{}},Vd;function Su(){return Vd||(Vd=1,function(i,e){(function(t,n){i.exports=n(he())})(ae,function(t){return function(n){var s=t,r=s.lib,o=r.WordArray,a=r.Hasher,c=s.algo,l=[],u=[];(function(){function h(y){for(var v=n.sqrt(y),x=2;x<=v;x++)if(!(y%x))return!1;return!0}function p(y){return(y-(y|0))*4294967296|0}for(var m=2,g=0;g<64;)h(m)&&(g<8&&(l[g]=p(n.pow(m,1/2))),u[g]=p(n.pow(m,1/3)),g++),m++})();var f=[],d=c.SHA256=a.extend({_doReset:function(){this._hash=new o.init(l.slice(0))},_doProcessBlock:function(h,p){for(var m=this._hash.words,g=m[0],y=m[1],v=m[2],x=m[3],E=m[4],S=m[5],T=m[6],_=m[7],I=0;I<64;I++){if(I<16)f[I]=h[p+I]|0;else{var w=f[I-15],b=(w<<25|w>>>7)^(w<<14|w>>>18)^w>>>3,L=f[I-2],k=(L<<15|L>>>17)^(L<<13|L>>>19)^L>>>10;f[I]=b+f[I-7]+k+f[I-16]}var M=E&S^~E&T,N=g&y^g&v^y&v,F=(g<<30|g>>>2)^(g<<19|g>>>13)^(g<<10|g>>>22),O=(E<<26|E>>>6)^(E<<21|E>>>11)^(E<<7|E>>>25),K=_+O+M+u[I]+f[I],B=F+N;_=T,T=S,S=E,E=x+K|0,x=v,v=y,y=g,g=K+B|0}m[0]=m[0]+g|0,m[1]=m[1]+y|0,m[2]=m[2]+v|0,m[3]=m[3]+x|0,m[4]=m[4]+E|0,m[5]=m[5]+S|0,m[6]=m[6]+T|0,m[7]=m[7]+_|0},_doFinalize:function(){var h=this._data,p=h.words,m=this._nDataBytes*8,g=h.sigBytes*8;return p[g>>>5]|=128<<24-g%32,p[(g+64>>>9<<4)+14]=n.floor(m/4294967296),p[(g+64>>>9<<4)+15]=m,h.sigBytes=p.length*4,this._process(),this._hash},clone:function(){var h=a.clone.call(this);return h._hash=this._hash.clone(),h}});s.SHA256=a._createHelper(d),s.HmacSHA256=a._createHmacHelper(d)}(Math),t.SHA256})}(ya)),ya.exports}var va={exports:{}},qd;function KI(){return qd||(qd=1,function(i,e){(function(t,n,s){i.exports=n(he(),Su())})(ae,function(t){return function(){var n=t,s=n.lib,r=s.WordArray,o=n.algo,a=o.SHA256,c=o.SHA224=a.extend({_doReset:function(){this._hash=new r.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var l=a._doFinalize.call(this);return l.sigBytes-=4,l}});n.SHA224=a._createHelper(c),n.HmacSHA224=a._createHmacHelper(c)}(),t.SHA224})}(va)),va.exports}var Ea={exports:{}},Wd;function sx(){return Wd||(Wd=1,function(i,e){(function(t,n,s){i.exports=n(he(),yo())})(ae,function(t){return function(){var n=t,s=n.lib,r=s.Hasher,o=n.x64,a=o.Word,c=o.WordArray,l=n.algo;function u(){return a.create.apply(a,arguments)}var f=[u(1116352408,3609767458),u(1899447441,602891725),u(3049323471,3964484399),u(3921009573,2173295548),u(961987163,4081628472),u(1508970993,3053834265),u(2453635748,2937671579),u(2870763221,3664609560),u(3624381080,2734883394),u(310598401,1164996542),u(607225278,1323610764),u(1426881987,3590304994),u(1925078388,4068182383),u(2162078206,991336113),u(2614888103,633803317),u(3248222580,3479774868),u(3835390401,2666613458),u(4022224774,944711139),u(264347078,2341262773),u(604807628,2007800933),u(770255983,1495990901),u(1249150122,1856431235),u(1555081692,3175218132),u(1996064986,2198950837),u(2554220882,3999719339),u(2821834349,766784016),u(2952996808,2566594879),u(3210313671,3203337956),u(3336571891,1034457026),u(3584528711,2466948901),u(113926993,3758326383),u(338241895,168717936),u(666307205,1188179964),u(773529912,1546045734),u(1294757372,1522805485),u(1396182291,2643833823),u(1695183700,2343527390),u(1986661051,1014477480),u(2177026350,1206759142),u(2456956037,344077627),u(2730485921,1290863460),u(2820302411,3158454273),u(3259730800,3505952657),u(3345764771,106217008),u(3516065817,3606008344),u(3600352804,1432725776),u(4094571909,1467031594),u(275423344,851169720),u(430227734,3100823752),u(506948616,1363258195),u(659060556,3750685593),u(883997877,3785050280),u(958139571,3318307427),u(1322822218,3812723403),u(1537002063,2003034995),u(1747873779,3602036899),u(1955562222,1575990012),u(2024104815,1125592928),u(2227730452,2716904306),u(2361852424,442776044),u(2428436474,593698344),u(2756734187,3733110249),u(3204031479,2999351573),u(3329325298,3815920427),u(3391569614,3928383900),u(3515267271,566280711),u(3940187606,3454069534),u(4118630271,4000239992),u(116418474,1914138554),u(174292421,2731055270),u(289380356,3203993006),u(460393269,320620315),u(685471733,587496836),u(852142971,1086792851),u(1017036298,365543100),u(1126000580,2618297676),u(1288033470,3409855158),u(1501505948,4234509866),u(1607167915,987167468),u(1816402316,1246189591)],d=[];(function(){for(var p=0;p<80;p++)d[p]=u()})();var h=l.SHA512=r.extend({_doReset:function(){this._hash=new c.init([new a.init(1779033703,4089235720),new a.init(3144134277,2227873595),new a.init(1013904242,4271175723),new a.init(2773480762,1595750129),new a.init(1359893119,2917565137),new a.init(2600822924,725511199),new a.init(528734635,4215389547),new a.init(1541459225,327033209)])},_doProcessBlock:function(p,m){for(var g=this._hash.words,y=g[0],v=g[1],x=g[2],E=g[3],S=g[4],T=g[5],_=g[6],I=g[7],w=y.high,b=y.low,L=v.high,k=v.low,M=x.high,N=x.low,F=E.high,O=E.low,K=S.high,B=S.low,G=T.high,H=T.low,C=_.high,R=_.low,P=I.high,D=I.low,z=w,Q=b,se=L,ee=k,ge=M,de=N,Ie=F,lt=O,Ce=K,Ve=B,ki=G,ce=H,be=C,Oe=R,Et=P,je=D,Me=0;Me<80;Me++){var Le,At,Kt=d[Me];if(Me<16)At=Kt.high=p[m+Me*2]|0,Le=Kt.low=p[m+Me*2+1]|0;else{var Bi=d[Me-15],dt=Bi.high,Zt=Bi.low,vo=(dt>>>1|Zt<<31)^(dt>>>8|Zt<<24)^dt>>>7,Fi=(Zt>>>1|dt<<31)^(Zt>>>8|dt<<24)^(Zt>>>7|dt<<25),Oi=d[Me-2],ht=Oi.high,Mi=Oi.low,ox=(ht>>>19|Mi<<13)^(ht<<3|Mi>>>29)^ht>>>6,bu=(Mi>>>19|ht<<13)^(Mi<<3|ht>>>29)^(Mi>>>6|ht<<26),_u=d[Me-7],ax=_u.high,lx=_u.low,Iu=d[Me-16],cx=Iu.high,Cu=Iu.low;Le=Fi+lx,At=vo+ax+(Le>>>0<Fi>>>0?1:0),Le=Le+bu,At=At+ox+(Le>>>0<bu>>>0?1:0),Le=Le+Cu,At=At+cx+(Le>>>0<Cu>>>0?1:0),Kt.high=At,Kt.low=Le}var ux=Ce&ki^~Ce&be,Lu=Ve&ce^~Ve&Oe,fx=z&se^z&ge^se&ge,dx=Q&ee^Q&de^ee&de,hx=(z>>>28|Q<<4)^(z<<30|Q>>>2)^(z<<25|Q>>>7),Ru=(Q>>>28|z<<4)^(Q<<30|z>>>2)^(Q<<25|z>>>7),px=(Ce>>>14|Ve<<18)^(Ce>>>18|Ve<<14)^(Ce<<23|Ve>>>9),gx=(Ve>>>14|Ce<<18)^(Ve>>>18|Ce<<14)^(Ve<<23|Ce>>>9),wu=f[Me],mx=wu.high,Du=wu.low,ct=je+gx,en=Et+px+(ct>>>0<je>>>0?1:0),ct=ct+Lu,en=en+ux+(ct>>>0<Lu>>>0?1:0),ct=ct+Du,en=en+mx+(ct>>>0<Du>>>0?1:0),ct=ct+Le,en=en+At+(ct>>>0<Le>>>0?1:0),Pu=Ru+dx,xx=hx+fx+(Pu>>>0<Ru>>>0?1:0);Et=be,je=Oe,be=ki,Oe=ce,ki=Ce,ce=Ve,Ve=lt+ct|0,Ce=Ie+en+(Ve>>>0<lt>>>0?1:0)|0,Ie=ge,lt=de,ge=se,de=ee,se=z,ee=Q,Q=ct+Pu|0,z=en+xx+(Q>>>0<ct>>>0?1:0)|0}b=y.low=b+Q,y.high=w+z+(b>>>0<Q>>>0?1:0),k=v.low=k+ee,v.high=L+se+(k>>>0<ee>>>0?1:0),N=x.low=N+de,x.high=M+ge+(N>>>0<de>>>0?1:0),O=E.low=O+lt,E.high=F+Ie+(O>>>0<lt>>>0?1:0),B=S.low=B+Ve,S.high=K+Ce+(B>>>0<Ve>>>0?1:0),H=T.low=H+ce,T.high=G+ki+(H>>>0<ce>>>0?1:0),R=_.low=R+Oe,_.high=C+be+(R>>>0<Oe>>>0?1:0),D=I.low=D+je,I.high=P+Et+(D>>>0<je>>>0?1:0)},_doFinalize:function(){var p=this._data,m=p.words,g=this._nDataBytes*8,y=p.sigBytes*8;m[y>>>5]|=128<<24-y%32,m[(y+128>>>10<<5)+30]=Math.floor(g/4294967296),m[(y+128>>>10<<5)+31]=g,p.sigBytes=m.length*4,this._process();var v=this._hash.toX32();return v},clone:function(){var p=r.clone.call(this);return p._hash=this._hash.clone(),p},blockSize:1024/32});n.SHA512=r._createHelper(h),n.HmacSHA512=r._createHmacHelper(h)}(),t.SHA512})}(Ea)),Ea.exports}var Aa={exports:{}},zd;function VI(){return zd||(zd=1,function(i,e){(function(t,n,s){i.exports=n(he(),yo(),sx())})(ae,function(t){return function(){var n=t,s=n.x64,r=s.Word,o=s.WordArray,a=n.algo,c=a.SHA512,l=a.SHA384=c.extend({_doReset:function(){this._hash=new o.init([new r.init(3418070365,3238371032),new r.init(1654270250,914150663),new r.init(2438529370,812702999),new r.init(355462360,4144912697),new r.init(1731405415,4290775857),new r.init(2394180231,1750603025),new r.init(3675008525,1694076839),new r.init(1203062813,3204075428)])},_doFinalize:function(){var u=c._doFinalize.call(this);return u.sigBytes-=16,u}});n.SHA384=c._createHelper(l),n.HmacSHA384=c._createHmacHelper(l)}(),t.SHA384})}(Aa)),Aa.exports}var Sa={exports:{}},Qd;function jI(){return Qd||(Qd=1,function(i,e){(function(t,n,s){i.exports=n(he(),yo())})(ae,function(t){return function(n){var s=t,r=s.lib,o=r.WordArray,a=r.Hasher,c=s.x64,l=c.Word,u=s.algo,f=[],d=[],h=[];(function(){for(var g=1,y=0,v=0;v<24;v++){f[g+5*y]=(v+1)*(v+2)/2%64;var x=y%5,E=(2*g+3*y)%5;g=x,y=E}for(var g=0;g<5;g++)for(var y=0;y<5;y++)d[g+5*y]=y+(2*g+3*y)%5*5;for(var S=1,T=0;T<24;T++){for(var _=0,I=0,w=0;w<7;w++){if(S&1){var b=(1<<w)-1;b<32?I^=1<<b:_^=1<<b-32}S&128?S=S<<1^113:S<<=1}h[T]=l.create(_,I)}})();var p=[];(function(){for(var g=0;g<25;g++)p[g]=l.create()})();var m=u.SHA3=a.extend({cfg:a.cfg.extend({outputLength:512}),_doReset:function(){for(var g=this._state=[],y=0;y<25;y++)g[y]=new l.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(g,y){for(var v=this._state,x=this.blockSize/2,E=0;E<x;E++){var S=g[y+2*E],T=g[y+2*E+1];S=(S<<8|S>>>24)&16711935|(S<<24|S>>>8)&4278255360,T=(T<<8|T>>>24)&16711935|(T<<24|T>>>8)&4278255360;var _=v[E];_.high^=T,_.low^=S}for(var I=0;I<24;I++){for(var w=0;w<5;w++){for(var b=0,L=0,k=0;k<5;k++){var _=v[w+5*k];b^=_.high,L^=_.low}var M=p[w];M.high=b,M.low=L}for(var w=0;w<5;w++)for(var N=p[(w+4)%5],F=p[(w+1)%5],O=F.high,K=F.low,b=N.high^(O<<1|K>>>31),L=N.low^(K<<1|O>>>31),k=0;k<5;k++){var _=v[w+5*k];_.high^=b,_.low^=L}for(var B=1;B<25;B++){var b,L,_=v[B],G=_.high,H=_.low,C=f[B];C<32?(b=G<<C|H>>>32-C,L=H<<C|G>>>32-C):(b=H<<C-32|G>>>64-C,L=G<<C-32|H>>>64-C);var R=p[d[B]];R.high=b,R.low=L}var P=p[0],D=v[0];P.high=D.high,P.low=D.low;for(var w=0;w<5;w++)for(var k=0;k<5;k++){var B=w+5*k,_=v[B],z=p[B],Q=p[(w+1)%5+5*k],se=p[(w+2)%5+5*k];_.high=z.high^~Q.high&se.high,_.low=z.low^~Q.low&se.low}var _=v[0],ee=h[I];_.high^=ee.high,_.low^=ee.low}},_doFinalize:function(){var g=this._data,y=g.words;this._nDataBytes*8;var v=g.sigBytes*8,x=this.blockSize*32;y[v>>>5]|=1<<24-v%32,y[(n.ceil((v+1)/x)*x>>>5)-1]|=128,g.sigBytes=y.length*4,this._process();for(var E=this._state,S=this.cfg.outputLength/8,T=S/8,_=[],I=0;I<T;I++){var w=E[I],b=w.high,L=w.low;b=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360,L=(L<<8|L>>>24)&16711935|(L<<24|L>>>8)&4278255360,_.push(L),_.push(b)}return new o.init(_,S)},clone:function(){for(var g=a.clone.call(this),y=g._state=this._state.slice(0),v=0;v<25;v++)y[v]=y[v].clone();return g}});s.SHA3=a._createHelper(m),s.HmacSHA3=a._createHmacHelper(m)}(Math),t.SHA3})}(Sa)),Sa.exports}var Ta={exports:{}},Yd;function qI(){return Yd||(Yd=1,function(i,e){(function(t,n){i.exports=n(he())})(ae,function(t){/** @preserve
- (c) 2012 by Cédric Mesnil. All rights reserved.
- Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */return function(n){var s=t,r=s.lib,o=r.WordArray,a=r.Hasher,c=s.algo,l=o.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]),u=o.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]),f=o.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=o.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=o.create([0,1518500249,1859775393,2400959708,2840853838]),p=o.create([1352829926,1548603684,1836072691,2053994217,0]),m=c.RIPEMD160=a.extend({_doReset:function(){this._hash=o.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(T,_){for(var I=0;I<16;I++){var w=_+I,b=T[w];T[w]=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360}var L=this._hash.words,k=h.words,M=p.words,N=l.words,F=u.words,O=f.words,K=d.words,B,G,H,C,R,P,D,z,Q,se;P=B=L[0],D=G=L[1],z=H=L[2],Q=C=L[3],se=R=L[4];for(var ee,I=0;I<80;I+=1)ee=B+T[_+N[I]]|0,I<16?ee+=g(G,H,C)+k[0]:I<32?ee+=y(G,H,C)+k[1]:I<48?ee+=v(G,H,C)+k[2]:I<64?ee+=x(G,H,C)+k[3]:ee+=E(G,H,C)+k[4],ee=ee|0,ee=S(ee,O[I]),ee=ee+R|0,B=R,R=C,C=S(H,10),H=G,G=ee,ee=P+T[_+F[I]]|0,I<16?ee+=E(D,z,Q)+M[0]:I<32?ee+=x(D,z,Q)+M[1]:I<48?ee+=v(D,z,Q)+M[2]:I<64?ee+=y(D,z,Q)+M[3]:ee+=g(D,z,Q)+M[4],ee=ee|0,ee=S(ee,K[I]),ee=ee+se|0,P=se,se=Q,Q=S(z,10),z=D,D=ee;ee=L[1]+H+Q|0,L[1]=L[2]+C+se|0,L[2]=L[3]+R+P|0,L[3]=L[4]+B+D|0,L[4]=L[0]+G+z|0,L[0]=ee},_doFinalize:function(){var T=this._data,_=T.words,I=this._nDataBytes*8,w=T.sigBytes*8;_[w>>>5]|=128<<24-w%32,_[(w+64>>>9<<4)+14]=(I<<8|I>>>24)&16711935|(I<<24|I>>>8)&4278255360,T.sigBytes=(_.length+1)*4,this._process();for(var b=this._hash,L=b.words,k=0;k<5;k++){var M=L[k];L[k]=(M<<8|M>>>24)&16711935|(M<<24|M>>>8)&4278255360}return b},clone:function(){var T=a.clone.call(this);return T._hash=this._hash.clone(),T}});function g(T,_,I){return T^_^I}function y(T,_,I){return T&_|~T&I}function v(T,_,I){return(T|~_)^I}function x(T,_,I){return T&I|_&~I}function E(T,_,I){return T^(_|~I)}function S(T,_){return T<<_|T>>>32-_}s.RIPEMD160=a._createHelper(m),s.HmacRIPEMD160=a._createHmacHelper(m)}(),t.RIPEMD160})}(Ta)),Ta.exports}var ba={exports:{}},Xd;function Tu(){return Xd||(Xd=1,function(i,e){(function(t,n){i.exports=n(he())})(ae,function(t){(function(){var n=t,s=n.lib,r=s.Base,o=n.enc,a=o.Utf8,c=n.algo;c.HMAC=r.extend({init:function(l,u){l=this._hasher=new l.init,typeof u=="string"&&(u=a.parse(u));var f=l.blockSize,d=f*4;u.sigBytes>d&&(u=l.finalize(u)),u.clamp();for(var h=this._oKey=u.clone(),p=this._iKey=u.clone(),m=h.words,g=p.words,y=0;y<f;y++)m[y]^=1549556828,g[y]^=909522486;h.sigBytes=p.sigBytes=d,this.reset()},reset:function(){var l=this._hasher;l.reset(),l.update(this._iKey)},update:function(l){return this._hasher.update(l),this},finalize:function(l){var u=this._hasher,f=u.finalize(l);u.reset();var d=u.finalize(this._oKey.clone().concat(f));return d}})})()})}(ba)),ba.exports}var _a={exports:{}},Jd;function WI(){return Jd||(Jd=1,function(i,e){(function(t,n,s){i.exports=n(he(),Su(),Tu())})(ae,function(t){return function(){var n=t,s=n.lib,r=s.Base,o=s.WordArray,a=n.algo,c=a.SHA256,l=a.HMAC,u=a.PBKDF2=r.extend({cfg:r.extend({keySize:128/32,hasher:c,iterations:25e4}),init:function(f){this.cfg=this.cfg.extend(f)},compute:function(f,d){for(var h=this.cfg,p=l.create(h.hasher,f),m=o.create(),g=o.create([1]),y=m.words,v=g.words,x=h.keySize,E=h.iterations;y.length<x;){var S=p.update(d).finalize(g);p.reset();for(var T=S.words,_=T.length,I=S,w=1;w<E;w++){I=p.finalize(I),p.reset();for(var b=I.words,L=0;L<_;L++)T[L]^=b[L]}m.concat(S),v[0]++}return m.sigBytes=x*4,m}});n.PBKDF2=function(f,d,h){return u.create(h).compute(f,d)}}(),t.PBKDF2})}(_a)),_a.exports}var Ia={exports:{}},Zd;function In(){return Zd||(Zd=1,function(i,e){(function(t,n,s){i.exports=n(he(),ix(),Tu())})(ae,function(t){return function(){var n=t,s=n.lib,r=s.Base,o=s.WordArray,a=n.algo,c=a.MD5,l=a.EvpKDF=r.extend({cfg:r.extend({keySize:128/32,hasher:c,iterations:1}),init:function(u){this.cfg=this.cfg.extend(u)},compute:function(u,f){for(var d,h=this.cfg,p=h.hasher.create(),m=o.create(),g=m.words,y=h.keySize,v=h.iterations;g.length<y;){d&&p.update(d),d=p.update(u).finalize(f),p.reset();for(var x=1;x<v;x++)d=p.finalize(d),p.reset();m.concat(d)}return m.sigBytes=y*4,m}});n.EvpKDF=function(u,f,d){return l.create(d).compute(u,f)}}(),t.EvpKDF})}(Ia)),Ia.exports}var Ca={exports:{}},eh;function Ke(){return eh||(eh=1,function(i,e){(function(t,n,s){i.exports=n(he(),In())})(ae,function(t){t.lib.Cipher||function(n){var s=t,r=s.lib,o=r.Base,a=r.WordArray,c=r.BufferedBlockAlgorithm,l=s.enc;l.Utf8;var u=l.Base64,f=s.algo,d=f.EvpKDF,h=r.Cipher=c.extend({cfg:o.extend(),createEncryptor:function(b,L){return this.create(this._ENC_XFORM_MODE,b,L)},createDecryptor:function(b,L){return this.create(this._DEC_XFORM_MODE,b,L)},init:function(b,L,k){this.cfg=this.cfg.extend(k),this._xformMode=b,this._key=L,this.reset()},reset:function(){c.reset.call(this),this._doReset()},process:function(b){return this._append(b),this._process()},finalize:function(b){b&&this._append(b);var L=this._doFinalize();return L},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function b(L){return typeof L=="string"?w:T}return function(L){return{encrypt:function(k,M,N){return b(M).encrypt(L,k,M,N)},decrypt:function(k,M,N){return b(M).decrypt(L,k,M,N)}}}}()});r.StreamCipher=h.extend({_doFinalize:function(){var b=this._process(!0);return b},blockSize:1});var p=s.mode={},m=r.BlockCipherMode=o.extend({createEncryptor:function(b,L){return this.Encryptor.create(b,L)},createDecryptor:function(b,L){return this.Decryptor.create(b,L)},init:function(b,L){this._cipher=b,this._iv=L}}),g=p.CBC=function(){var b=m.extend();b.Encryptor=b.extend({processBlock:function(k,M){var N=this._cipher,F=N.blockSize;L.call(this,k,M,F),N.encryptBlock(k,M),this._prevBlock=k.slice(M,M+F)}}),b.Decryptor=b.extend({processBlock:function(k,M){var N=this._cipher,F=N.blockSize,O=k.slice(M,M+F);N.decryptBlock(k,M),L.call(this,k,M,F),this._prevBlock=O}});function L(k,M,N){var F,O=this._iv;O?(F=O,this._iv=n):F=this._prevBlock;for(var K=0;K<N;K++)k[M+K]^=F[K]}return b}(),y=s.pad={},v=y.Pkcs7={pad:function(b,L){for(var k=L*4,M=k-b.sigBytes%k,N=M<<24|M<<16|M<<8|M,F=[],O=0;O<M;O+=4)F.push(N);var K=a.create(F,M);b.concat(K)},unpad:function(b){var L=b.words[b.sigBytes-1>>>2]&255;b.sigBytes-=L}};r.BlockCipher=h.extend({cfg:h.cfg.extend({mode:g,padding:v}),reset:function(){var b;h.reset.call(this);var L=this.cfg,k=L.iv,M=L.mode;this._xformMode==this._ENC_XFORM_MODE?b=M.createEncryptor:(b=M.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==b?this._mode.init(this,k&&k.words):(this._mode=b.call(M,this,k&&k.words),this._mode.__creator=b)},_doProcessBlock:function(b,L){this._mode.processBlock(b,L)},_doFinalize:function(){var b,L=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(L.pad(this._data,this.blockSize),b=this._process(!0)):(b=this._process(!0),L.unpad(b)),b},blockSize:128/32});var x=r.CipherParams=o.extend({init:function(b){this.mixIn(b)},toString:function(b){return(b||this.formatter).stringify(this)}}),E=s.format={},S=E.OpenSSL={stringify:function(b){var L,k=b.ciphertext,M=b.salt;return M?L=a.create([1398893684,1701076831]).concat(M).concat(k):L=k,L.toString(u)},parse:function(b){var L,k=u.parse(b),M=k.words;return M[0]==1398893684&&M[1]==1701076831&&(L=a.create(M.slice(2,4)),M.splice(0,4),k.sigBytes-=16),x.create({ciphertext:k,salt:L})}},T=r.SerializableCipher=o.extend({cfg:o.extend({format:S}),encrypt:function(b,L,k,M){M=this.cfg.extend(M);var N=b.createEncryptor(k,M),F=N.finalize(L),O=N.cfg;return x.create({ciphertext:F,key:k,iv:O.iv,algorithm:b,mode:O.mode,padding:O.padding,blockSize:b.blockSize,formatter:M.format})},decrypt:function(b,L,k,M){M=this.cfg.extend(M),L=this._parse(L,M.format);var N=b.createDecryptor(k,M).finalize(L.ciphertext);return N},_parse:function(b,L){return typeof b=="string"?L.parse(b,this):b}}),_=s.kdf={},I=_.OpenSSL={execute:function(b,L,k,M,N){if(M||(M=a.random(64/8)),N)var F=d.create({keySize:L+k,hasher:N}).compute(b,M);else var F=d.create({keySize:L+k}).compute(b,M);var O=a.create(F.words.slice(L),k*4);return F.sigBytes=L*4,x.create({key:F,iv:O,salt:M})}},w=r.PasswordBasedCipher=T.extend({cfg:T.cfg.extend({kdf:I}),encrypt:function(b,L,k,M){M=this.cfg.extend(M);var N=M.kdf.execute(k,b.keySize,b.ivSize,M.salt,M.hasher);M.iv=N.iv;var F=T.encrypt.call(this,b,L,N.key,M);return F.mixIn(N),F},decrypt:function(b,L,k,M){M=this.cfg.extend(M),L=this._parse(L,M.format);var N=M.kdf.execute(k,b.keySize,b.ivSize,L.salt,M.hasher);M.iv=N.iv;var F=T.decrypt.call(this,b,L,N.key,M);return F}})}()})}(Ca)),Ca.exports}var La={exports:{}},th;function zI(){return th||(th=1,function(i,e){(function(t,n,s){i.exports=n(he(),Ke())})(ae,function(t){return t.mode.CFB=function(){var n=t.lib.BlockCipherMode.extend();n.Encryptor=n.extend({processBlock:function(r,o){var a=this._cipher,c=a.blockSize;s.call(this,r,o,c,a),this._prevBlock=r.slice(o,o+c)}}),n.Decryptor=n.extend({processBlock:function(r,o){var a=this._cipher,c=a.blockSize,l=r.slice(o,o+c);s.call(this,r,o,c,a),this._prevBlock=l}});function s(r,o,a,c){var l,u=this._iv;u?(l=u.slice(0),this._iv=void 0):l=this._prevBlock,c.encryptBlock(l,0);for(var f=0;f<a;f++)r[o+f]^=l[f]}return n}(),t.mode.CFB})}(La)),La.exports}var Ra={exports:{}},nh;function QI(){return nh||(nh=1,function(i,e){(function(t,n,s){i.exports=n(he(),Ke())})(ae,function(t){return t.mode.CTR=function(){var n=t.lib.BlockCipherMode.extend(),s=n.Encryptor=n.extend({processBlock:function(r,o){var a=this._cipher,c=a.blockSize,l=this._iv,u=this._counter;l&&(u=this._counter=l.slice(0),this._iv=void 0);var f=u.slice(0);a.encryptBlock(f,0),u[c-1]=u[c-1]+1|0;for(var d=0;d<c;d++)r[o+d]^=f[d]}});return n.Decryptor=s,n}(),t.mode.CTR})}(Ra)),Ra.exports}var wa={exports:{}},ih;function YI(){return ih||(ih=1,function(i,e){(function(t,n,s){i.exports=n(he(),Ke())})(ae,function(t){/** @preserve
- * Counter block mode compatible with Dr Brian Gladman fileenc.c
- * derived from CryptoJS.mode.CTR
- * Jan Hruby jhruby.web@gmail.com
- */return t.mode.CTRGladman=function(){var n=t.lib.BlockCipherMode.extend();function s(a){if((a>>24&255)===255){var c=a>>16&255,l=a>>8&255,u=a&255;c===255?(c=0,l===255?(l=0,u===255?u=0:++u):++l):++c,a=0,a+=c<<16,a+=l<<8,a+=u}else a+=1<<24;return a}function r(a){return(a[0]=s(a[0]))===0&&(a[1]=s(a[1])),a}var o=n.Encryptor=n.extend({processBlock:function(a,c){var l=this._cipher,u=l.blockSize,f=this._iv,d=this._counter;f&&(d=this._counter=f.slice(0),this._iv=void 0),r(d);var h=d.slice(0);l.encryptBlock(h,0);for(var p=0;p<u;p++)a[c+p]^=h[p]}});return n.Decryptor=o,n}(),t.mode.CTRGladman})}(wa)),wa.exports}var Da={exports:{}},sh;function XI(){return sh||(sh=1,function(i,e){(function(t,n,s){i.exports=n(he(),Ke())})(ae,function(t){return t.mode.OFB=function(){var n=t.lib.BlockCipherMode.extend(),s=n.Encryptor=n.extend({processBlock:function(r,o){var a=this._cipher,c=a.blockSize,l=this._iv,u=this._keystream;l&&(u=this._keystream=l.slice(0),this._iv=void 0),a.encryptBlock(u,0);for(var f=0;f<c;f++)r[o+f]^=u[f]}});return n.Decryptor=s,n}(),t.mode.OFB})}(Da)),Da.exports}var Pa={exports:{}},rh;function JI(){return rh||(rh=1,function(i,e){(function(t,n,s){i.exports=n(he(),Ke())})(ae,function(t){return t.mode.ECB=function(){var n=t.lib.BlockCipherMode.extend();return n.Encryptor=n.extend({processBlock:function(s,r){this._cipher.encryptBlock(s,r)}}),n.Decryptor=n.extend({processBlock:function(s,r){this._cipher.decryptBlock(s,r)}}),n}(),t.mode.ECB})}(Pa)),Pa.exports}var ka={exports:{}},oh;function ZI(){return oh||(oh=1,function(i,e){(function(t,n,s){i.exports=n(he(),Ke())})(ae,function(t){return t.pad.AnsiX923={pad:function(n,s){var r=n.sigBytes,o=s*4,a=o-r%o,c=r+a-1;n.clamp(),n.words[c>>>2]|=a<<24-c%4*8,n.sigBytes+=a},unpad:function(n){var s=n.words[n.sigBytes-1>>>2]&255;n.sigBytes-=s}},t.pad.Ansix923})}(ka)),ka.exports}var Ba={exports:{}},ah;function eC(){return ah||(ah=1,function(i,e){(function(t,n,s){i.exports=n(he(),Ke())})(ae,function(t){return t.pad.Iso10126={pad:function(n,s){var r=s*4,o=r-n.sigBytes%r;n.concat(t.lib.WordArray.random(o-1)).concat(t.lib.WordArray.create([o<<24],1))},unpad:function(n){var s=n.words[n.sigBytes-1>>>2]&255;n.sigBytes-=s}},t.pad.Iso10126})}(Ba)),Ba.exports}var Fa={exports:{}},lh;function tC(){return lh||(lh=1,function(i,e){(function(t,n,s){i.exports=n(he(),Ke())})(ae,function(t){return t.pad.Iso97971={pad:function(n,s){n.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(n,s)},unpad:function(n){t.pad.ZeroPadding.unpad(n),n.sigBytes--}},t.pad.Iso97971})}(Fa)),Fa.exports}var Oa={exports:{}},ch;function nC(){return ch||(ch=1,function(i,e){(function(t,n,s){i.exports=n(he(),Ke())})(ae,function(t){return t.pad.ZeroPadding={pad:function(n,s){var r=s*4;n.clamp(),n.sigBytes+=r-(n.sigBytes%r||r)},unpad:function(n){for(var s=n.words,r=n.sigBytes-1,r=n.sigBytes-1;r>=0;r--)if(s[r>>>2]>>>24-r%4*8&255){n.sigBytes=r+1;break}}},t.pad.ZeroPadding})}(Oa)),Oa.exports}var Ma={exports:{}},uh;function iC(){return uh||(uh=1,function(i,e){(function(t,n,s){i.exports=n(he(),Ke())})(ae,function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding})}(Ma)),Ma.exports}var Na={exports:{}},fh;function sC(){return fh||(fh=1,function(i,e){(function(t,n,s){i.exports=n(he(),Ke())})(ae,function(t){return function(n){var s=t,r=s.lib,o=r.CipherParams,a=s.enc,c=a.Hex,l=s.format;l.Hex={stringify:function(u){return u.ciphertext.toString(c)},parse:function(u){var f=c.parse(u);return o.create({ciphertext:f})}}}(),t.format.Hex})}(Na)),Na.exports}var Ua={exports:{}},dh;function rC(){return dh||(dh=1,function(i,e){(function(t,n,s){i.exports=n(he(),ei(),ti(),In(),Ke())})(ae,function(t){return function(){var n=t,s=n.lib,r=s.BlockCipher,o=n.algo,a=[],c=[],l=[],u=[],f=[],d=[],h=[],p=[],m=[],g=[];(function(){for(var x=[],E=0;E<256;E++)E<128?x[E]=E<<1:x[E]=E<<1^283;for(var S=0,T=0,E=0;E<256;E++){var _=T^T<<1^T<<2^T<<3^T<<4;_=_>>>8^_&255^99,a[S]=_,c[_]=S;var I=x[S],w=x[I],b=x[w],L=x[_]*257^_*16843008;l[S]=L<<24|L>>>8,u[S]=L<<16|L>>>16,f[S]=L<<8|L>>>24,d[S]=L;var L=b*16843009^w*65537^I*257^S*16843008;h[_]=L<<24|L>>>8,p[_]=L<<16|L>>>16,m[_]=L<<8|L>>>24,g[_]=L,S?(S=I^x[x[x[b^I]]],T^=x[x[T]]):S=T=1}})();var y=[0,1,2,4,8,16,32,64,128,27,54],v=o.AES=r.extend({_doReset:function(){var x;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var E=this._keyPriorReset=this._key,S=E.words,T=E.sigBytes/4,_=this._nRounds=T+6,I=(_+1)*4,w=this._keySchedule=[],b=0;b<I;b++)b<T?w[b]=S[b]:(x=w[b-1],b%T?T>6&&b%T==4&&(x=a[x>>>24]<<24|a[x>>>16&255]<<16|a[x>>>8&255]<<8|a[x&255]):(x=x<<8|x>>>24,x=a[x>>>24]<<24|a[x>>>16&255]<<16|a[x>>>8&255]<<8|a[x&255],x^=y[b/T|0]<<24),w[b]=w[b-T]^x);for(var L=this._invKeySchedule=[],k=0;k<I;k++){var b=I-k;if(k%4)var x=w[b];else var x=w[b-4];k<4||b<=4?L[k]=x:L[k]=h[a[x>>>24]]^p[a[x>>>16&255]]^m[a[x>>>8&255]]^g[a[x&255]]}}},encryptBlock:function(x,E){this._doCryptBlock(x,E,this._keySchedule,l,u,f,d,a)},decryptBlock:function(x,E){var S=x[E+1];x[E+1]=x[E+3],x[E+3]=S,this._doCryptBlock(x,E,this._invKeySchedule,h,p,m,g,c);var S=x[E+1];x[E+1]=x[E+3],x[E+3]=S},_doCryptBlock:function(x,E,S,T,_,I,w,b){for(var L=this._nRounds,k=x[E]^S[0],M=x[E+1]^S[1],N=x[E+2]^S[2],F=x[E+3]^S[3],O=4,K=1;K<L;K++){var B=T[k>>>24]^_[M>>>16&255]^I[N>>>8&255]^w[F&255]^S[O++],G=T[M>>>24]^_[N>>>16&255]^I[F>>>8&255]^w[k&255]^S[O++],H=T[N>>>24]^_[F>>>16&255]^I[k>>>8&255]^w[M&255]^S[O++],C=T[F>>>24]^_[k>>>16&255]^I[M>>>8&255]^w[N&255]^S[O++];k=B,M=G,N=H,F=C}var B=(b[k>>>24]<<24|b[M>>>16&255]<<16|b[N>>>8&255]<<8|b[F&255])^S[O++],G=(b[M>>>24]<<24|b[N>>>16&255]<<16|b[F>>>8&255]<<8|b[k&255])^S[O++],H=(b[N>>>24]<<24|b[F>>>16&255]<<16|b[k>>>8&255]<<8|b[M&255])^S[O++],C=(b[F>>>24]<<24|b[k>>>16&255]<<16|b[M>>>8&255]<<8|b[N&255])^S[O++];x[E]=B,x[E+1]=G,x[E+2]=H,x[E+3]=C},keySize:256/32});n.AES=r._createHelper(v)}(),t.AES})}(Ua)),Ua.exports}var $a={exports:{}},hh;function oC(){return hh||(hh=1,function(i,e){(function(t,n,s){i.exports=n(he(),ei(),ti(),In(),Ke())})(ae,function(t){return function(){var n=t,s=n.lib,r=s.WordArray,o=s.BlockCipher,a=n.algo,c=[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],l=[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],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],f=[{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=a.DES=o.extend({_doReset:function(){for(var y=this._key,v=y.words,x=[],E=0;E<56;E++){var S=c[E]-1;x[E]=v[S>>>5]>>>31-S%32&1}for(var T=this._subKeys=[],_=0;_<16;_++){for(var I=T[_]=[],w=u[_],E=0;E<24;E++)I[E/6|0]|=x[(l[E]-1+w)%28]<<31-E%6,I[4+(E/6|0)]|=x[28+(l[E+24]-1+w)%28]<<31-E%6;I[0]=I[0]<<1|I[0]>>>31;for(var E=1;E<7;E++)I[E]=I[E]>>>(E-1)*4+3;I[7]=I[7]<<5|I[7]>>>27}for(var b=this._invSubKeys=[],E=0;E<16;E++)b[E]=T[15-E]},encryptBlock:function(y,v){this._doCryptBlock(y,v,this._subKeys)},decryptBlock:function(y,v){this._doCryptBlock(y,v,this._invSubKeys)},_doCryptBlock:function(y,v,x){this._lBlock=y[v],this._rBlock=y[v+1],p.call(this,4,252645135),p.call(this,16,65535),m.call(this,2,858993459),m.call(this,8,16711935),p.call(this,1,1431655765);for(var E=0;E<16;E++){for(var S=x[E],T=this._lBlock,_=this._rBlock,I=0,w=0;w<8;w++)I|=f[w][((_^S[w])&d[w])>>>0];this._lBlock=_,this._rBlock=T^I}var b=this._lBlock;this._lBlock=this._rBlock,this._rBlock=b,p.call(this,1,1431655765),m.call(this,8,16711935),m.call(this,2,858993459),p.call(this,16,65535),p.call(this,4,252645135),y[v]=this._lBlock,y[v+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function p(y,v){var x=(this._lBlock>>>y^this._rBlock)&v;this._rBlock^=x,this._lBlock^=x<<y}function m(y,v){var x=(this._rBlock>>>y^this._lBlock)&v;this._lBlock^=x,this._rBlock^=x<<y}n.DES=o._createHelper(h);var g=a.TripleDES=o.extend({_doReset:function(){var y=this._key,v=y.words;if(v.length!==2&&v.length!==4&&v.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var x=v.slice(0,2),E=v.length<4?v.slice(0,2):v.slice(2,4),S=v.length<6?v.slice(0,2):v.slice(4,6);this._des1=h.createEncryptor(r.create(x)),this._des2=h.createEncryptor(r.create(E)),this._des3=h.createEncryptor(r.create(S))},encryptBlock:function(y,v){this._des1.encryptBlock(y,v),this._des2.decryptBlock(y,v),this._des3.encryptBlock(y,v)},decryptBlock:function(y,v){this._des3.decryptBlock(y,v),this._des2.encryptBlock(y,v),this._des1.decryptBlock(y,v)},keySize:192/32,ivSize:64/32,blockSize:64/32});n.TripleDES=o._createHelper(g)}(),t.TripleDES})}($a)),$a.exports}var Ha={exports:{}},ph;function aC(){return ph||(ph=1,function(i,e){(function(t,n,s){i.exports=n(he(),ei(),ti(),In(),Ke())})(ae,function(t){return function(){var n=t,s=n.lib,r=s.StreamCipher,o=n.algo,a=o.RC4=r.extend({_doReset:function(){for(var u=this._key,f=u.words,d=u.sigBytes,h=this._S=[],p=0;p<256;p++)h[p]=p;for(var p=0,m=0;p<256;p++){var g=p%d,y=f[g>>>2]>>>24-g%4*8&255;m=(m+h[p]+y)%256;var v=h[p];h[p]=h[m],h[m]=v}this._i=this._j=0},_doProcessBlock:function(u,f){u[f]^=c.call(this)},keySize:256/32,ivSize:0});function c(){for(var u=this._S,f=this._i,d=this._j,h=0,p=0;p<4;p++){f=(f+1)%256,d=(d+u[f])%256;var m=u[f];u[f]=u[d],u[d]=m,h|=u[(u[f]+u[d])%256]<<24-p*8}return this._i=f,this._j=d,h}n.RC4=r._createHelper(a);var l=o.RC4Drop=a.extend({cfg:a.cfg.extend({drop:192}),_doReset:function(){a._doReset.call(this);for(var u=this.cfg.drop;u>0;u--)c.call(this)}});n.RC4Drop=r._createHelper(l)}(),t.RC4})}(Ha)),Ha.exports}var Ga={exports:{}},gh;function lC(){return gh||(gh=1,function(i,e){(function(t,n,s){i.exports=n(he(),ei(),ti(),In(),Ke())})(ae,function(t){return function(){var n=t,s=n.lib,r=s.StreamCipher,o=n.algo,a=[],c=[],l=[],u=o.Rabbit=r.extend({_doReset:function(){for(var d=this._key.words,h=this.cfg.iv,p=0;p<4;p++)d[p]=(d[p]<<8|d[p]>>>24)&16711935|(d[p]<<24|d[p]>>>8)&4278255360;var m=this._X=[d[0],d[3]<<16|d[2]>>>16,d[1],d[0]<<16|d[3]>>>16,d[2],d[1]<<16|d[0]>>>16,d[3],d[2]<<16|d[1]>>>16],g=this._C=[d[2]<<16|d[2]>>>16,d[0]&4294901760|d[1]&65535,d[3]<<16|d[3]>>>16,d[1]&4294901760|d[2]&65535,d[0]<<16|d[0]>>>16,d[2]&4294901760|d[3]&65535,d[1]<<16|d[1]>>>16,d[3]&4294901760|d[0]&65535];this._b=0;for(var p=0;p<4;p++)f.call(this);for(var p=0;p<8;p++)g[p]^=m[p+4&7];if(h){var y=h.words,v=y[0],x=y[1],E=(v<<8|v>>>24)&16711935|(v<<24|v>>>8)&4278255360,S=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,T=E>>>16|S&4294901760,_=S<<16|E&65535;g[0]^=E,g[1]^=T,g[2]^=S,g[3]^=_,g[4]^=E,g[5]^=T,g[6]^=S,g[7]^=_;for(var p=0;p<4;p++)f.call(this)}},_doProcessBlock:function(d,h){var p=this._X;f.call(this),a[0]=p[0]^p[5]>>>16^p[3]<<16,a[1]=p[2]^p[7]>>>16^p[5]<<16,a[2]=p[4]^p[1]>>>16^p[7]<<16,a[3]=p[6]^p[3]>>>16^p[1]<<16;for(var m=0;m<4;m++)a[m]=(a[m]<<8|a[m]>>>24)&16711935|(a[m]<<24|a[m]>>>8)&4278255360,d[h+m]^=a[m]},blockSize:128/32,ivSize:64/32});function f(){for(var d=this._X,h=this._C,p=0;p<8;p++)c[p]=h[p];h[0]=h[0]+1295307597+this._b|0,h[1]=h[1]+3545052371+(h[0]>>>0<c[0]>>>0?1:0)|0,h[2]=h[2]+886263092+(h[1]>>>0<c[1]>>>0?1:0)|0,h[3]=h[3]+1295307597+(h[2]>>>0<c[2]>>>0?1:0)|0,h[4]=h[4]+3545052371+(h[3]>>>0<c[3]>>>0?1:0)|0,h[5]=h[5]+886263092+(h[4]>>>0<c[4]>>>0?1:0)|0,h[6]=h[6]+1295307597+(h[5]>>>0<c[5]>>>0?1:0)|0,h[7]=h[7]+3545052371+(h[6]>>>0<c[6]>>>0?1:0)|0,this._b=h[7]>>>0<c[7]>>>0?1:0;for(var p=0;p<8;p++){var m=d[p]+h[p],g=m&65535,y=m>>>16,v=((g*g>>>17)+g*y>>>15)+y*y,x=((m&4294901760)*m|0)+((m&65535)*m|0);l[p]=v^x}d[0]=l[0]+(l[7]<<16|l[7]>>>16)+(l[6]<<16|l[6]>>>16)|0,d[1]=l[1]+(l[0]<<8|l[0]>>>24)+l[7]|0,d[2]=l[2]+(l[1]<<16|l[1]>>>16)+(l[0]<<16|l[0]>>>16)|0,d[3]=l[3]+(l[2]<<8|l[2]>>>24)+l[1]|0,d[4]=l[4]+(l[3]<<16|l[3]>>>16)+(l[2]<<16|l[2]>>>16)|0,d[5]=l[5]+(l[4]<<8|l[4]>>>24)+l[3]|0,d[6]=l[6]+(l[5]<<16|l[5]>>>16)+(l[4]<<16|l[4]>>>16)|0,d[7]=l[7]+(l[6]<<8|l[6]>>>24)+l[5]|0}n.Rabbit=r._createHelper(u)}(),t.Rabbit})}(Ga)),Ga.exports}var Ka={exports:{}},mh;function cC(){return mh||(mh=1,function(i,e){(function(t,n,s){i.exports=n(he(),ei(),ti(),In(),Ke())})(ae,function(t){return function(){var n=t,s=n.lib,r=s.StreamCipher,o=n.algo,a=[],c=[],l=[],u=o.RabbitLegacy=r.extend({_doReset:function(){var d=this._key.words,h=this.cfg.iv,p=this._X=[d[0],d[3]<<16|d[2]>>>16,d[1],d[0]<<16|d[3]>>>16,d[2],d[1]<<16|d[0]>>>16,d[3],d[2]<<16|d[1]>>>16],m=this._C=[d[2]<<16|d[2]>>>16,d[0]&4294901760|d[1]&65535,d[3]<<16|d[3]>>>16,d[1]&4294901760|d[2]&65535,d[0]<<16|d[0]>>>16,d[2]&4294901760|d[3]&65535,d[1]<<16|d[1]>>>16,d[3]&4294901760|d[0]&65535];this._b=0;for(var g=0;g<4;g++)f.call(this);for(var g=0;g<8;g++)m[g]^=p[g+4&7];if(h){var y=h.words,v=y[0],x=y[1],E=(v<<8|v>>>24)&16711935|(v<<24|v>>>8)&4278255360,S=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,T=E>>>16|S&4294901760,_=S<<16|E&65535;m[0]^=E,m[1]^=T,m[2]^=S,m[3]^=_,m[4]^=E,m[5]^=T,m[6]^=S,m[7]^=_;for(var g=0;g<4;g++)f.call(this)}},_doProcessBlock:function(d,h){var p=this._X;f.call(this),a[0]=p[0]^p[5]>>>16^p[3]<<16,a[1]=p[2]^p[7]>>>16^p[5]<<16,a[2]=p[4]^p[1]>>>16^p[7]<<16,a[3]=p[6]^p[3]>>>16^p[1]<<16;for(var m=0;m<4;m++)a[m]=(a[m]<<8|a[m]>>>24)&16711935|(a[m]<<24|a[m]>>>8)&4278255360,d[h+m]^=a[m]},blockSize:128/32,ivSize:64/32});function f(){for(var d=this._X,h=this._C,p=0;p<8;p++)c[p]=h[p];h[0]=h[0]+1295307597+this._b|0,h[1]=h[1]+3545052371+(h[0]>>>0<c[0]>>>0?1:0)|0,h[2]=h[2]+886263092+(h[1]>>>0<c[1]>>>0?1:0)|0,h[3]=h[3]+1295307597+(h[2]>>>0<c[2]>>>0?1:0)|0,h[4]=h[4]+3545052371+(h[3]>>>0<c[3]>>>0?1:0)|0,h[5]=h[5]+886263092+(h[4]>>>0<c[4]>>>0?1:0)|0,h[6]=h[6]+1295307597+(h[5]>>>0<c[5]>>>0?1:0)|0,h[7]=h[7]+3545052371+(h[6]>>>0<c[6]>>>0?1:0)|0,this._b=h[7]>>>0<c[7]>>>0?1:0;for(var p=0;p<8;p++){var m=d[p]+h[p],g=m&65535,y=m>>>16,v=((g*g>>>17)+g*y>>>15)+y*y,x=((m&4294901760)*m|0)+((m&65535)*m|0);l[p]=v^x}d[0]=l[0]+(l[7]<<16|l[7]>>>16)+(l[6]<<16|l[6]>>>16)|0,d[1]=l[1]+(l[0]<<8|l[0]>>>24)+l[7]|0,d[2]=l[2]+(l[1]<<16|l[1]>>>16)+(l[0]<<16|l[0]>>>16)|0,d[3]=l[3]+(l[2]<<8|l[2]>>>24)+l[1]|0,d[4]=l[4]+(l[3]<<16|l[3]>>>16)+(l[2]<<16|l[2]>>>16)|0,d[5]=l[5]+(l[4]<<8|l[4]>>>24)+l[3]|0,d[6]=l[6]+(l[5]<<16|l[5]>>>16)+(l[4]<<16|l[4]>>>16)|0,d[7]=l[7]+(l[6]<<8|l[6]>>>24)+l[5]|0}n.RabbitLegacy=r._createHelper(u)}(),t.RabbitLegacy})}(Ka)),Ka.exports}var Va={exports:{}},xh;function uC(){return xh||(xh=1,function(i,e){(function(t,n,s){i.exports=n(he(),ei(),ti(),In(),Ke())})(ae,function(t){return function(){var n=t,s=n.lib,r=s.BlockCipher,o=n.algo;const a=16,c=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],l=[[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 u={pbox:[],sbox:[]};function f(g,y){let v=y>>24&255,x=y>>16&255,E=y>>8&255,S=y&255,T=g.sbox[0][v]+g.sbox[1][x];return T=T^g.sbox[2][E],T=T+g.sbox[3][S],T}function d(g,y,v){let x=y,E=v,S;for(let T=0;T<a;++T)x=x^g.pbox[T],E=f(g,x)^E,S=x,x=E,E=S;return S=x,x=E,E=S,E=E^g.pbox[a],x=x^g.pbox[a+1],{left:x,right:E}}function h(g,y,v){let x=y,E=v,S;for(let T=a+1;T>1;--T)x=x^g.pbox[T],E=f(g,x)^E,S=x,x=E,E=S;return S=x,x=E,E=S,E=E^g.pbox[1],x=x^g.pbox[0],{left:x,right:E}}function p(g,y,v){for(let _=0;_<4;_++){g.sbox[_]=[];for(let I=0;I<256;I++)g.sbox[_][I]=l[_][I]}let x=0;for(let _=0;_<a+2;_++)g.pbox[_]=c[_]^y[x],x++,x>=v&&(x=0);let E=0,S=0,T=0;for(let _=0;_<a+2;_+=2)T=d(g,E,S),E=T.left,S=T.right,g.pbox[_]=E,g.pbox[_+1]=S;for(let _=0;_<4;_++)for(let I=0;I<256;I+=2)T=d(g,E,S),E=T.left,S=T.right,g.sbox[_][I]=E,g.sbox[_][I+1]=S;return!0}var m=o.Blowfish=r.extend({_doReset:function(){if(this._keyPriorReset!==this._key){var g=this._keyPriorReset=this._key,y=g.words,v=g.sigBytes/4;p(u,y,v)}},encryptBlock:function(g,y){var v=d(u,g[y],g[y+1]);g[y]=v.left,g[y+1]=v.right},decryptBlock:function(g,y){var v=h(u,g[y],g[y+1]);g[y]=v.left,g[y+1]=v.right},blockSize:64/32,keySize:128/32,ivSize:64/32});n.Blowfish=r._createHelper(m)}(),t.Blowfish})}(Va)),Va.exports}(function(i,e){(function(t,n,s){i.exports=n(he(),yo(),$I(),HI(),ei(),GI(),ti(),ix(),Su(),KI(),sx(),VI(),jI(),qI(),Tu(),WI(),In(),Ke(),zI(),QI(),YI(),XI(),JI(),ZI(),eC(),tC(),nC(),iC(),sC(),rC(),oC(),aC(),lC(),cC(),uC())})(ae,function(t){return t})})(nx);var fC=nx.exports;const dC=tx(fC);var rx={exports:{}};(function(i,e){(function(t,n){i.exports=n()})(ae,function(){var t=1e3,n=6e4,s=36e5,r="millisecond",o="second",a="minute",c="hour",l="day",u="week",f="month",d="quarter",h="year",p="date",m="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,y=/\[([^\]]+)]|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,v={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(N){var F=["th","st","nd","rd"],O=N%100;return"["+N+(F[(O-20)%10]||F[O]||F[0])+"]"}},x=function(N,F,O){var K=String(N);return!K||K.length>=F?N:""+Array(F+1-K.length).join(O)+N},E={s:x,z:function(N){var F=-N.utcOffset(),O=Math.abs(F),K=Math.floor(O/60),B=O%60;return(F<=0?"+":"-")+x(K,2,"0")+":"+x(B,2,"0")},m:function N(F,O){if(F.date()<O.date())return-N(O,F);var K=12*(O.year()-F.year())+(O.month()-F.month()),B=F.clone().add(K,f),G=O-B<0,H=F.clone().add(K+(G?-1:1),f);return+(-(K+(O-B)/(G?B-H:H-B))||0)},a:function(N){return N<0?Math.ceil(N)||0:Math.floor(N)},p:function(N){return{M:f,y:h,w:u,d:l,D:p,h:c,m:a,s:o,ms:r,Q:d}[N]||String(N||"").toLowerCase().replace(/s$/,"")},u:function(N){return N===void 0}},S="en",T={};T[S]=v;var _="$isDayjsObject",I=function(N){return N instanceof k||!(!N||!N[_])},w=function N(F,O,K){var B;if(!F)return S;if(typeof F=="string"){var G=F.toLowerCase();T[G]&&(B=G),O&&(T[G]=O,B=G);var H=F.split("-");if(!B&&H.length>1)return N(H[0])}else{var C=F.name;T[C]=F,B=C}return!K&&B&&(S=B),B||!K&&S},b=function(N,F){if(I(N))return N.clone();var O=typeof F=="object"?F:{};return O.date=N,O.args=arguments,new k(O)},L=E;L.l=w,L.i=I,L.w=function(N,F){return b(N,{locale:F.$L,utc:F.$u,x:F.$x,$offset:F.$offset})};var k=function(){function N(O){this.$L=w(O.locale,null,!0),this.parse(O),this.$x=this.$x||O.x||{},this[_]=!0}var F=N.prototype;return F.parse=function(O){this.$d=function(K){var B=K.date,G=K.utc;if(B===null)return new Date(NaN);if(L.u(B))return new Date;if(B instanceof Date)return new Date(B);if(typeof B=="string"&&!/Z$/i.test(B)){var H=B.match(g);if(H){var C=H[2]-1||0,R=(H[7]||"0").substring(0,3);return G?new Date(Date.UTC(H[1],C,H[3]||1,H[4]||0,H[5]||0,H[6]||0,R)):new Date(H[1],C,H[3]||1,H[4]||0,H[5]||0,H[6]||0,R)}}return new Date(B)}(O),this.init()},F.init=function(){var O=this.$d;this.$y=O.getFullYear(),this.$M=O.getMonth(),this.$D=O.getDate(),this.$W=O.getDay(),this.$H=O.getHours(),this.$m=O.getMinutes(),this.$s=O.getSeconds(),this.$ms=O.getMilliseconds()},F.$utils=function(){return L},F.isValid=function(){return this.$d.toString()!==m},F.isSame=function(O,K){var B=b(O);return this.startOf(K)<=B&&B<=this.endOf(K)},F.isAfter=function(O,K){return b(O)<this.startOf(K)},F.isBefore=function(O,K){return this.endOf(K)<b(O)},F.$g=function(O,K,B){return L.u(O)?this[K]:this.set(B,O)},F.unix=function(){return Math.floor(this.valueOf()/1e3)},F.valueOf=function(){return this.$d.getTime()},F.startOf=function(O,K){var B=this,G=!!L.u(K)||K,H=L.p(O),C=function(ge,de){var Ie=L.w(B.$u?Date.UTC(B.$y,de,ge):new Date(B.$y,de,ge),B);return G?Ie:Ie.endOf(l)},R=function(ge,de){return L.w(B.toDate()[ge].apply(B.toDate("s"),(G?[0,0,0,0]:[23,59,59,999]).slice(de)),B)},P=this.$W,D=this.$M,z=this.$D,Q="set"+(this.$u?"UTC":"");switch(H){case h:return G?C(1,0):C(31,11);case f:return G?C(1,D):C(0,D+1);case u:var se=this.$locale().weekStart||0,ee=(P<se?P+7:P)-se;return C(G?z-ee:z+(6-ee),D);case l:case p:return R(Q+"Hours",0);case c:return R(Q+"Minutes",1);case a:return R(Q+"Seconds",2);case o:return R(Q+"Milliseconds",3);default:return this.clone()}},F.endOf=function(O){return this.startOf(O,!1)},F.$set=function(O,K){var B,G=L.p(O),H="set"+(this.$u?"UTC":""),C=(B={},B[l]=H+"Date",B[p]=H+"Date",B[f]=H+"Month",B[h]=H+"FullYear",B[c]=H+"Hours",B[a]=H+"Minutes",B[o]=H+"Seconds",B[r]=H+"Milliseconds",B)[G],R=G===l?this.$D+(K-this.$W):K;if(G===f||G===h){var P=this.clone().set(p,1);P.$d[C](R),P.init(),this.$d=P.set(p,Math.min(this.$D,P.daysInMonth())).$d}else C&&this.$d[C](R);return this.init(),this},F.set=function(O,K){return this.clone().$set(O,K)},F.get=function(O){return this[L.p(O)]()},F.add=function(O,K){var B,G=this;O=Number(O);var H=L.p(K),C=function(D){var z=b(G);return L.w(z.date(z.date()+Math.round(D*O)),G)};if(H===f)return this.set(f,this.$M+O);if(H===h)return this.set(h,this.$y+O);if(H===l)return C(1);if(H===u)return C(7);var R=(B={},B[a]=n,B[c]=s,B[o]=t,B)[H]||1,P=this.$d.getTime()+O*R;return L.w(P,this)},F.subtract=function(O,K){return this.add(-1*O,K)},F.format=function(O){var K=this,B=this.$locale();if(!this.isValid())return B.invalidDate||m;var G=O||"YYYY-MM-DDTHH:mm:ssZ",H=L.z(this),C=this.$H,R=this.$m,P=this.$M,D=B.weekdays,z=B.months,Q=B.meridiem,se=function(de,Ie,lt,Ce){return de&&(de[Ie]||de(K,G))||lt[Ie].slice(0,Ce)},ee=function(de){return L.s(C%12||12,de,"0")},ge=Q||function(de,Ie,lt){var Ce=de<12?"AM":"PM";return lt?Ce.toLowerCase():Ce};return G.replace(y,function(de,Ie){return Ie||function(lt){switch(lt){case"YY":return String(K.$y).slice(-2);case"YYYY":return L.s(K.$y,4,"0");case"M":return P+1;case"MM":return L.s(P+1,2,"0");case"MMM":return se(B.monthsShort,P,z,3);case"MMMM":return se(z,P);case"D":return K.$D;case"DD":return L.s(K.$D,2,"0");case"d":return String(K.$W);case"dd":return se(B.weekdaysMin,K.$W,D,2);case"ddd":return se(B.weekdaysShort,K.$W,D,3);case"dddd":return D[K.$W];case"H":return String(C);case"HH":return L.s(C,2,"0");case"h":return ee(1);case"hh":return ee(2);case"a":return ge(C,R,!0);case"A":return ge(C,R,!1);case"m":return String(R);case"mm":return L.s(R,2,"0");case"s":return String(K.$s);case"ss":return L.s(K.$s,2,"0");case"SSS":return L.s(K.$ms,3,"0");case"Z":return H}return null}(de)||H.replace(":","")})},F.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},F.diff=function(O,K,B){var G,H=this,C=L.p(K),R=b(O),P=(R.utcOffset()-this.utcOffset())*n,D=this-R,z=function(){return L.m(H,R)};switch(C){case h:G=z()/12;break;case f:G=z();break;case d:G=z()/3;break;case u:G=(D-P)/6048e5;break;case l:G=(D-P)/864e5;break;case c:G=D/s;break;case a:G=D/n;break;case o:G=D/t;break;default:G=D}return B?G:L.a(G)},F.daysInMonth=function(){return this.endOf(f).$D},F.$locale=function(){return T[this.$L]},F.locale=function(O,K){if(!O)return this.$L;var B=this.clone(),G=w(O,K,!0);return G&&(B.$L=G),B},F.clone=function(){return L.w(this.$d,this)},F.toDate=function(){return new Date(this.valueOf())},F.toJSON=function(){return this.isValid()?this.toISOString():null},F.toISOString=function(){return this.$d.toISOString()},F.toString=function(){return this.$d.toUTCString()},N}(),M=k.prototype;return b.prototype=M,[["$ms",r],["$s",o],["$m",a],["$H",c],["$W",l],["$M",f],["$y",h],["$D",p]].forEach(function(N){M[N[1]]=function(F){return this.$g(F,N[0],N[1])}}),b.extend=function(N,F){return N.$i||(N(F,k,b),N.$i=!0),b},b.locale=w,b.isDayjs=I,b.unix=function(N){return b(1e3*N)},b.en=T[S],b.Ls=T,b.p={},b})})(rx);var hC=rx.exports;const pC=tx(hC);exports.CryptoJS=dC;exports.Hls=fn;exports._export_sfc=d4;exports.createSSRApp=Vv;exports.createStore=bA;exports.dayjs=pC;exports.e=Nv;exports.f=Ov;exports.index=j;exports.n=Uv;exports.nextTick$1=bc;exports.o=Fv;exports.p=Hv;exports.resolveComponent=z2;exports.s=Mv;exports.sr=Gv;exports.t=$v;exports.tr=j5;exports.useStore=dA;exports.uviewPlus=VT;
- //# sourceMappingURL=../../.sourcemap/mp-weixin/common/vendor.js.map
|