| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- "use strict";const Q1=(n,e)=>{const t=n.__vccOpts||n;for(const[i,s]of e)t[i]=s;return t};/**
- * @vue/shared v3.4.21
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
- * @license MIT
- **/function Cn(n,e){const t=new Set(n.split(","));return e?i=>t.has(i.toLowerCase()):i=>t.has(i)}const De=Object.freeze({}),vu=Object.freeze([]),He=()=>{},Y1=()=>!1,Jd=n=>n.charCodeAt(0)===111&&n.charCodeAt(1)===110&&(n.charCodeAt(2)>122||n.charCodeAt(2)<97),Eu=n=>n.startsWith("onUpdate:"),xe=Object.assign,Gr=(n,e)=>{const t=n.indexOf(e);t>-1&&n.splice(t,1)},X1=Object.prototype.hasOwnProperty,ie=(n,e)=>X1.call(n,e),te=Array.isArray,Pi=n=>Bt(n)==="[object Map]",Zd=n=>Bt(n)==="[object Set]",q=n=>typeof n=="function",Te=n=>typeof n=="string",Ln=n=>typeof n=="symbol",Ee=n=>n!==null&&typeof n=="object",Ss=n=>(Ee(n)||q(n))&&q(n.then)&&q(n.catch),eh=Object.prototype.toString,Bt=n=>eh.call(n),Kr=n=>Bt(n).slice(8,-1),Ge=n=>Bt(n)==="[object Object]",Wl=n=>Te(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,th=Cn(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),J1=Cn("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),Vr=n=>{const e=Object.create(null);return t=>e[t]||(e[t]=n(t))},Z1=/-(\w)/g,Ut=Vr(n=>n.replace(Z1,(e,t)=>t?t.toUpperCase():"")),ex=/\B([A-Z])/g,Ni=Vr(n=>n.replace(ex,"-$1").toLowerCase()),Ui=Vr(n=>n.charAt(0).toUpperCase()+n.slice(1)),_i=Vr(n=>n?`on${Ui(n)}`:""),xi=(n,e)=>!Object.is(n,e),Zs=(n,e)=>{for(let t=0;t<n.length;t++)n[t](e)},tx=(n,e,t)=>{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,value:t})},ix=n=>{const e=parseFloat(n);return isNaN(e)?n:e};function ih(n){if(te(n)){const e={};for(let t=0;t<n.length;t++){const i=n[t],s=Te(i)?ox(i):ih(i);if(s)for(const r in s)e[r]=s[r]}return e}else if(Te(n)||Ee(n))return n}const nx=/;(?![^(]*\))/g,sx=/:([^]+)/,rx=/\/\*[^]*?\*\//g;function ox(n){const e={};return n.replace(rx,"").split(nx).forEach(t=>{if(t){const i=t.split(sx);i.length>1&&(e[i[0].trim()]=i[1].trim())}}),e}function nh(n){let e="";if(Te(n))e=n;else if(te(n))for(let t=0;t<n.length;t++){const i=nh(n[t]);i&&(e+=i+" ")}else if(Ee(n))for(const t in n)n[t]&&(e+=t+" ");return e.trim()}const ax=n=>Te(n)?n:n==null?"":te(n)||Ee(n)&&(n.toString===eh||!q(n.toString))?JSON.stringify(n,sh,2):String(n),sh=(n,e)=>e&&e.__v_isRef?sh(n,e.value):Pi(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((t,[i,s],r)=>(t[uo(i,r)+" =>"]=s,t),{})}:Zd(e)?{[`Set(${e.size})`]:[...e.values()].map(t=>uo(t))}:Ln(e)?uo(e):Ee(e)&&!te(e)&&!Ge(e)?String(e):e,uo=(n,e="")=>{var t;return Ln(n)?`Symbol(${(t=n.description)!=null?t:e})`:n},lx="d",jr="onShow",qr="onHide",rh="onLaunch",$i="onError",oh="onThemeChange",ah="onPageNotFound",lh="onUnhandledRejection",cx="onExit",Ts="onLoad",zl="onReady",Ql="onUnload",ch="onInit",uh="onSaveExitState",fh="onResize",dh="onBackPress",hh="onPageScroll",Yl="onTabItemTap",Xl="onReachBottom",Jl="onPullDownRefresh",ph="onShareTimeline",gh="onShareChat",Zl="onAddToFavorites",mh="onShareAppMessage",xh="onNavigationBarButtonTap",yh="onNavigationBarSearchInputClicked",vh="onNavigationBarSearchInputChanged",Eh="onNavigationBarSearchInputConfirmed",Ah="onNavigationBarSearchInputFocusChanged",ux="virtualHostStyle",fx="virtualHostClass",dx="virtualHostHidden",Oa="virtualHostId";function hx(n){return n.indexOf("/")===0}function px(n){return hx(n)?n:"/"+n}const gx=(n,e)=>{let t;for(let i=0;i<n.length;i++)t=n[i](e);return t};function Sh(n,e=null){let t;return(...i)=>(n&&(t=n.apply(e,i),n=null),t)}function Th(n,e){if(!Te(e))return;e=e.replace(/\[(\d+)\]/g,".$1");const t=e.split(".");let i=t[0];return n||(n={}),t.length===1?n[i]:Th(n[i],t.slice(1).join("."))}function bh(n){let e={};return Ge(n)&&Object.keys(n).sort().forEach(t=>{const i=t;e[i]=n[i]}),Object.keys(e)?e:n}const mx=/:/g;function xx(n){return Ut(n.replace(mx,"-"))}const yx=encodeURIComponent;function vx(n,e=yx){const t=n?Object.keys(n).map(i=>{let s=n[i];return typeof s===void 0||s===null?s="":Ge(s)&&(s=JSON.stringify(s)),e(i)+"="+e(s)}).filter(i=>i.length>0).join("&"):null;return t?`?${t}`:""}const Ex=[ch,Ts,jr,qr,Ql,dh,hh,Yl,Xl,Jl,ph,mh,gh,Zl,uh,xh,yh,vh,Eh,Ah];function Ax(n){return Ex.indexOf(n)>-1}const _h=[jr,qr,rh,$i,oh,ah,lh,cx,ch,Ts,zl,Ql,fh,dh,hh,Yl,Xl,Jl,ph,Zl,mh,gh,uh,xh,yh,vh,Eh,Ah],Ma={onPageScroll:1,onShareAppMessage:2,onShareTimeline:4};function Ih(n,e,t=!0){return t&&!q(e)?!1:_h.indexOf(n)>-1?!0:n.indexOf("on")===0}let Na;const Ch=[];function Sx(n){if(Na)return n(Na);Ch.push(n)}function Tx(n){Na=n,Ch.forEach(e=>e(n))}const bx=Sh((n,e)=>e(n)),Lh=function(){};Lh.prototype={_id:1,on:function(n,e,t){var i=this.e||(this.e={});return(i[n]||(i[n]=[])).push({fn:e,ctx:t,_id:this._id}),this._id++},once:function(n,e,t){var i=this;function s(){i.off(n,s),e.apply(t,arguments)}return s._=e,this.on(n,s,t)},emit:function(n){var e=[].slice.call(arguments,1),t=((this.e||(this.e={}))[n]||[]).slice(),i=0,s=t.length;for(i;i<s;i++)t[i].fn.apply(t[i].ctx,e);return this},off:function(n,e){var t=this.e||(this.e={}),i=t[n],s=[];if(i&&e){for(var r=i.length-1;r>=0;r--)if(i[r].fn===e||i[r].fn._===e||i[r]._id===e){i.splice(r,1);break}s=i}return s.length?t[n]=s:delete t[n],this}};var _x=Lh;const fo="zh-Hans",Au="zh-Hant",Zn="en",Ix="fr",Cx="es";function Lx(n,e){return!!e.find(t=>n.indexOf(t)!==-1)}function Dx(n,e){return e.find(t=>n.indexOf(t)===0)}function Dh(n,e){if(!n)return;if(n=n.trim().replace(/_/g,"-"),e&&e[n])return n;if(n=n.toLowerCase(),n==="chinese")return fo;if(n.indexOf("zh")===0)return n.indexOf("-hans")>-1?fo:n.indexOf("-hant")>-1||Lx(n,["-tw","-hk","-mo","-cht"])?Au:fo;let t=[Zn,Ix,Cx];e&&Object.keys(e).length>0&&(t=Object.keys(e));const i=Dx(n,t);if(i)return i}function Rx(){var n;let e="";{const t=((n=wx.getAppBaseInfo)===null||n===void 0?void 0:n.call(wx))||wx.getSystemInfoSync(),i=t&&t.language?t.language:Zn;e=Dh(i)||Zn}return e}function Px(n,e){console.warn(`${n}: ${e}`)}function Su(n,e,t,i){i||(i=Px);for(const s in t){const r=Bx(s,e[s],t[s],!ie(e,s));Te(r)&&i(n,r)}}function kx(n,e,t,i){if(!t)return;if(!te(t))return Su(n,e[0]||Object.create(null),t,i);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]),Su(n,c,{[a.name]:a},i)}}function Bx(n,e,t,i){Ge(t)||(t={type:t});const{type:s,required:r,validator:o}=t;if(r&&i)return'Missing required args: "'+n+'"';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}=Ox(e,c[u]);l.push(d||""),a=f}if(!a)return Mx(n,e,l)}if(o)return o(e)}}const Fx=Cn("String,Number,Boolean,Function,Symbol");function Ox(n,e){let t;const i=Nx(e);if(Fx(i)){const s=typeof n;t=s===i.toLowerCase(),!t&&s==="object"&&(t=n instanceof e)}else i==="Object"?t=Ee(n):i==="Array"?t=te(n):t=n instanceof e;return{valid:t,expectedType:i}}function Mx(n,e,t){let i=`Invalid args: type check failed for args "${n}". Expected ${t.map(Ui).join(", ")}`;const s=t[0],r=Kr(e),o=Tu(e,s),a=Tu(e,r);return t.length===1&&bu(s)&&!Ux(s,r)&&(i+=` with value ${o}`),i+=`, got ${r} `,bu(r)&&(i+=`with value ${a}.`),i}function Nx(n){const e=n&&n.toString().match(/^\s*function (\w+)/);return e?e[1]:""}function Tu(n,e){return e==="String"?`"${n}"`:e==="Number"?`${Number(n)}`:`${n}`}function bu(n){return["string","number","boolean"].some(t=>n.toLowerCase()===t)}function Ux(...n){return n.some(e=>e.toLowerCase()==="boolean")}function $x(n){return function(){try{return n.apply(n,arguments)}catch(e){console.error(e)}}}let Hx=1;const Ua={};function Gx(n,e,t,i=!1){return Ua[n]={name:e,keepAlive:i,callback:t},n}function Rh(n,e,t){if(typeof n=="number"){const i=Ua[n];if(i)return i.keepAlive||delete Ua[n],i.callback(e,t)}return e}const Kx="success",Vx="fail",jx="complete";function qx(n){const e={};for(const t in n){const i=n[t];q(i)&&(e[t]=$x(i),delete n[t])}return e}function Wx(n,e){return!n||n.indexOf(":fail")===-1?e+":ok":e+n.substring(n.indexOf(":fail"))}function zx(n,e={},{beforeAll:t,beforeSuccess:i}={}){Ge(e)||(e={});const{success:s,fail:r,complete:o}=qx(e),a=q(s),c=q(r),l=q(o),u=Hx++;return Gx(u,n,f=>{f=f||{},f.errMsg=Wx(f.errMsg,n),q(t)&&t(f),f.errMsg===n+":ok"?(q(i)&&i(f,e),a&&s(f)):c&&r(f),l&&o(f)}),u}const Qx="success",Yx="fail",Xx="complete",yn={},vn={};function Jx(n,e){return function(t){return n(t,e)||t}}function wh(n,e,t){let i=!1;for(let s=0;s<n.length;s++){const r=n[s];if(i)i=Promise.resolve(Jx(r,t));else{const o=r(e,t);if(Ss(o)&&(i=Promise.resolve(o)),o===!1)return{then(){},catch(){}}}}return i||{then(s){return s(e)},catch(){}}}function _u(n,e={}){return[Qx,Yx,Xx].forEach(t=>{const i=n[t];if(!te(i))return;const s=e[t];e[t]=function(o){wh(i,o,e).then(a=>q(s)&&s(a)||a)}}),e}function dr(n,e){const t=[];te(yn.returnValue)&&t.push(...yn.returnValue);const i=vn[n];return i&&te(i.returnValue)&&t.push(...i.returnValue),t.forEach(s=>{e=s(e)||e}),e}function Iu(n){const e=Object.create(null);Object.keys(yn).forEach(i=>{i!=="returnValue"&&(e[i]=yn[i].slice())});const t=vn[n];return t&&Object.keys(t).forEach(i=>{i!=="returnValue"&&(e[i]=(e[i]||[]).concat(t[i]))}),e}function hr(n,e,t,i){const s=Iu(n);return s&&Object.keys(s).length?te(s.invoke)?wh(s.invoke,t).then(o=>e(_u(Iu(n),o),...i)):e(_u(s,t),...i):e(t,...i)}function Zx(n){return!!(Ge(n)&&[Kx,Vx,jx].find(e=>q(n[e])))}function e2(n,e){return(t={},...i)=>Zx(t)?dr(n,hr(n,e,xe({},t),i)):dr(n,new Promise((s,r)=>{hr(n,e,xe({},t,{success:s,fail:r}),i)}))}function t2(n,e){n[0]}function i2(n,e,t){const i={errMsg:e+":ok"};return Rh(n,xe(t||{},i))}function Cu(n,e,t,i={}){const s=e+":fail";let r="";t?t.indexOf(s)===0?r=t:r=s+" "+t:r=s,delete i.errCode;let o=xe({errMsg:r},i);return Rh(n,o)}function Ph(n,e,t,i){kx(n,e,t);const s=t2(e);if(s)return s}function n2(n){return!n||Te(n)?n:n.stack?((typeof globalThis>"u"||!globalThis.harmonyChannel)&&console.error(n.message+`
- `+n.stack),n.message):n}function s2(n,e,t,i){return s=>{const r=zx(n,s,i),o=Ph(n,[s],t);return o?Cu(r,n,o):e(s,{resolve:a=>i2(r,n,a),reject:(a,c)=>Cu(r,n,n2(a),c)})}}function r2(n,e,t,i){return(...s)=>{const r=Ph(n,s,t);if(r)throw new Error(r);return e.apply(null,s)}}function o2(n,e,t,i){return s2(n,e,t,i)}function Vi(n,e,t,i){return r2(n,e,t)}function a2(n,e,t,i){return e2(n,o2(n,e,t,i))}const l2="upx2px",c2=[{name:"upx",type:[Number,String],required:!0}],u2=1e-4,f2=750;let kh=!1,$a=0,Bh=0;function d2(){var n,e;let t,i,s;{const r=((n=wx.getWindowInfo)===null||n===void 0?void 0:n.call(wx))||wx.getSystemInfoSync(),o=((e=wx.getDeviceInfo)===null||e===void 0?void 0:e.call(wx))||wx.getSystemInfoSync();t=r.windowWidth,i=r.pixelRatio,s=o.platform}$a=t,Bh=i,kh=s==="ios"}const Lu=Vi(l2,(n,e)=>{if($a===0&&d2(),n=Number(n),n===0)return 0;let t=e||$a,i=n/f2*t;return i<0&&(i=-i),i=Math.floor(i+u2),i===0&&(Bh===1||!kh?i=1:i=.5),n<0?-i:i},c2);function h2(n,e,...t){e&&t.push(e),console[n].apply(console,t)}const p2="addInterceptor",g2="removeInterceptor",Fh=[{name:"method",type:[String,Object],required:!0}],m2=Fh;function Du(n,e){Object.keys(e).forEach(t=>{q(e[t])&&(n[t]=x2(n[t],e[t]))})}function Ru(n,e){!n||!e||Object.keys(e).forEach(t=>{const i=n[t],s=e[t];te(i)&&q(s)&&Gr(i,s)})}function x2(n,e){const t=e?n?n.concat(e):te(e)?e:[e]:n;return t&&y2(t)}function y2(n){const e=[];for(let t=0;t<n.length;t++)e.indexOf(n[t])===-1&&e.push(n[t]);return e}const v2=Vi(p2,(n,e)=>{Te(n)&&Ge(e)?Du(vn[n]||(vn[n]={}),e):Ge(n)&&Du(yn,n)},Fh),E2=Vi(g2,(n,e)=>{Te(n)?Ge(e)?Ru(vn[n],e):delete vn[n]:Ge(n)&&Ru(yn,n)},m2),A2={},S2="$on",Oh=[{name:"event",type:String,required:!0},{name:"callback",type:Function,required:!0}],T2="$once",b2=Oh,_2="$off",I2=[{name:"event",type:[String,Array]},{name:"callback",type:[Function,Number]}],C2="$emit",L2=[{name:"event",type:String,required:!0}];class D2{constructor(){this.$emitter=new _x}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 En=new D2,R2=Vi(S2,(n,e)=>(En.on(n,e),()=>En.off(n,e)),Oh),w2=Vi(T2,(n,e)=>(En.once(n,e),()=>En.off(n,e)),b2),P2=Vi(_2,(n,e)=>{te(n)||(n=n?[n]:[]),n.forEach(t=>{En.off(t,e)})},I2),k2=Vi(C2,(n,...e)=>{En.emit(n,...e)},L2);let jn,Ha,Ga;function wu(n){try{return JSON.parse(n)}catch{}return n}function B2(n){if(n.type==="enabled")Ga=!0;else if(n.type==="clientId")jn=n.cid,Ha=n.errMsg,Mh(jn,n.errMsg);else if(n.type==="pushMsg"){const e={type:"receive",data:wu(n.message)};for(let t=0;t<di.length;t++){const i=di[t];if(i(e),e.stopped)break}}else n.type==="click"&&di.forEach(e=>{e({type:"click",data:wu(n.message)})})}const Ka=[];function Mh(n,e){Ka.forEach(t=>{t(n,e)}),Ka.length=0}const F2="getPushClientId",O2=a2(F2,(n,{resolve:e,reject:t})=>{Promise.resolve().then(()=>{typeof Ga>"u"&&(Ga=!1,jn="",Ha="uniPush is not enabled"),Ka.push((i,s)=>{i?e({cid:i}):t(s)}),typeof jn<"u"&&Mh(jn,Ha)})}),di=[],M2=n=>{di.indexOf(n)===-1&&di.push(n)},N2=n=>{if(!n)di.length=0;else{const e=di.indexOf(n);e>-1&&di.splice(e,1)}},U2=/^\$|__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/,$2=/^create|Manager$/,H2=["createBLEConnection"],G2=["request","downloadFile","uploadFile","connectSocket"],K2=["createBLEConnection"],V2=/^on|^off/;function er(n){return $2.test(n)&&H2.indexOf(n)===-1}function Nh(n){return U2.test(n)&&K2.indexOf(n)===-1}function j2(n){return V2.test(n)&&n!=="onPush"}function Pu(n){return G2.indexOf(n)!==-1}function q2(n){return!(er(n)||Nh(n)||j2(n))}Promise.prototype.finally||(Promise.prototype.finally=function(n){const e=this.constructor;return this.then(t=>e.resolve(n&&n()).then(()=>t),t=>e.resolve(n&&n()).then(()=>{throw t}))});function ho(n,e){return!q2(n)||!q(e)?e:function(i={},...s){return q(i.success)||q(i.fail)||q(i.complete)?dr(n,hr(n,e,xe({},i),s)):dr(n,new Promise((r,o)=>{hr(n,e,xe({},i,{success:r,fail:o}),s)}))}}const W2=["success","fail","cancel","complete"];function z2(n){function e(s,r,o){return function(a){return r(i(s,a,o))}}function t(s,r,o={},a={},c=!1){if(Ge(r)){const l=c===!0?r:{};q(o)&&(o=o(r,l)||{});for(const u in r)if(ie(o,u)){let f=o[u];q(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(W2.indexOf(u)!==-1){const f=r[u];q(f)&&(l[u]=e(s,f,a))}else!c&&!ie(l,u)&&(l[u]=r[u]);return l}else q(r)&&(q(o)&&o(r,{}),r=e(s,r,a));return r}function i(s,r,o,a=!1){return q(n.returnValue)&&(r=n.returnValue(s,r)),t(s,r,o,{},a||!1)}return function(r,o){const a=ie(n,r);if(!a&&typeof wx[r]!="function")return o;const c=a||q(n.returnValue)||er(r)||Pu(r),l=a||q(o);if(!a&&!o)return function(){console.error(`微信小程序 暂不支持${r}`)};if(!c||!l)return o;const u=n[r];return function(f,d){let h=u||{};q(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(er(r)||Pu(r))&&m&&!m.__v_skip&&(m.__v_skip=!0),Nh(r)?i(r,m,h.returnValue,er(r)):m}}}const pr=()=>{const n=q(getApp)&&getApp({allowDefault:!0});return n&&n.$vm?n.$vm.$locale:Rx()},Q2=n=>{const e=q(getApp)&&getApp();return e&&e.$vm.$locale!==n?(e.$vm.$locale=n,Va.forEach(i=>i({locale:n})),!0):!1},Va=[],Y2=n=>{Va.indexOf(n)===-1&&Va.push(n)};typeof global<"u"&&(global.getLocale=pr);const ku="__DC_STAT_UUID";let Zi;function Uh(n=wx){return function(t,i){Zi=Zi||n.getStorageSync(ku),Zi||(Zi=Date.now()+""+Math.floor(Math.random()*1e7),wx.setStorage({key:ku,data:Zi})),i.deviceId=Zi}}function $h(n,e){if(n.safeArea){const t=n.safeArea;e.safeAreaInsets={top:t.top,left:t.left,right:n.windowWidth-t.right,bottom:n.screenHeight-t.bottom}}}function Hh(n,e){let t="",i="";switch(t=n.split(" ")[0]||e,i=n.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:i}}function X2(n,e){const{brand:t="",model:i="",system:s="",language:r="",theme:o,version:a,platform:c,fontSizeSetting:l,SDKVersion:u,pixelRatio:f,deviceOrientation:d}=n,{osName:h,osVersion:p}=Hh(s,c);let m=a,g=Gh(n,i),y=Kh(t),v=jh(n),x=d,E=f,S=u;const T=(r||"").replace(/_/g,"-"),_={appId:"__UNI__90F7D71",appName:"签约",appVersion:"1.0.0",appVersionCode:100,appLanguage:Vh(T),uniCompileVersion:"4.75",uniCompilerVersion:"4.75",uniRuntimeVersion:"4.75",uniPlatform:"mp-weixin",deviceBrand:y,deviceModel:i,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 Gh(n,e){let t=n.deviceType||"phone";{const i={ipad:"pad",windows:"pc",mac:"pc"},s=Object.keys(i),r=e.toLowerCase();for(let o=0;o<s.length;o++){const a=s[o];if(r.indexOf(a)!==-1){t=i[a];break}}}return t}function Kh(n){let e=n;return e&&(e=e.toLowerCase()),e}function Vh(n){return pr?pr():n}function jh(n){let t=n.hostName||"WeChat";return n.environment?t=n.environment:n.host&&n.host.env&&(t=n.host.env),t}const qh={returnValue:(n,e)=>{$h(n,e),Uh()(n,e),X2(n,e)}},J2=qh,Z2={},ey={args(n,e){let t=parseInt(n.current);if(isNaN(t))return;const i=n.urls;if(!te(i))return;const s=i.length;if(s)return t<0?t=0:t>=s&&(t=s-1),t>0?(e.current=i[t],e.urls=i.filter((r,o)=>o<t?r!==i[t]:!0)):e.current=i[0],{indicator:!1,loop:!1}}},ty={args(n,e){e.alertText=n.title}},iy={returnValue:(n,e)=>{const{brand:t,model:i,system:s="",platform:r=""}=n;let o=Gh(n,i),a=Kh(t);Uh()(n,e);const{osName:c,osVersion:l}=Hh(s,r);e=bh(xe(e,{deviceType:o,deviceBrand:a,deviceModel:i,osName:c,osVersion:l}))}},ny={returnValue:(n,e)=>{const{version:t,language:i,SDKVersion:s,theme:r}=n;let o=jh(n),a=(i||"").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:Vh(a),isUniAppX:!1,uniPlatform:"mp-weixin",uniCompileVersion:"4.75",uniCompilerVersion:"4.75",uniRuntimeVersion:"4.75"};xe(e,c)}},sy={returnValue:(n,e)=>{$h(n,e),e=bh(xe(e,{windowTop:0,windowBottom:0}))}},ry={returnValue:function(n,e){const{locationReducedAccuracy:t}=n;e.locationAccuracy="unsupported",t===!0?e.locationAccuracy="reduced":t===!1&&(e.locationAccuracy="full")}},oy={args(n){const e=getApp({allowDefault:!0})||{};e.$vm?Wi($i,n,e.$vm.$):(wx.$onErrorHandlers||(wx.$onErrorHandlers=[]),wx.$onErrorHandlers.push(n))}},ay={args(n){const e=getApp({allowDefault:!0})||{};if(e.$vm){if(n.__weh){const t=e.$vm.$[$i];if(t){const i=t.indexOf(n.__weh);i>-1&&t.splice(i,1)}}}else{if(!wx.$onErrorHandlers)return;const t=wx.$onErrorHandlers.findIndex(i=>i===n);t!==-1&&wx.$onErrorHandlers.splice(t,1)}}},Wh={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)")}}},ly=Wh,Bu={$on:R2,$off:P2,$once:w2,$emit:k2,upx2px:Lu,rpx2px:Lu,interceptors:A2,addInterceptor:v2,removeInterceptor:E2,onCreateVueApp:Sx,invokeCreateVueAppHook:Tx,getLocale:pr,setLocale:Q2,onLocaleChange:Y2,getPushClientId:O2,onPushMessage:M2,offPushMessage:N2,invokePushCallback:B2,__f__:h2};function cy(n,e,t=wx){const i=z2(e),s={get(r,o){return ie(r,o)?r[o]:ie(n,o)?ho(o,n[o]):ie(Bu,o)?ho(o,Bu[o]):ho(o,i(o,t[o]))}};return new Proxy({},s)}function uy(n){return function({service:t,success:i,fail:s,complete:r}){let o;n[t]?(o={errMsg:"getProvider:ok",service:t,provider:n[t]},q(i)&&i(o)):(o={errMsg:"getProvider:fail:服务["+t+"]不存在"},q(s)&&s(o)),q(r)&&r(o)}}const fy=["qy","env","error","version","lanDebug","cloud","serviceMarket","router","worklet","__webpack_require_UNI_MP_PLUGIN__"],dy=["lanDebug","router","worklet"],Fu=wx.getLaunchOptionsSync?wx.getLaunchOptionsSync():null;function hy(n){return Fu&&Fu.scene===1154&&dy.includes(n)?!1:fy.indexOf(n)>-1||typeof wx[n]=="function"}function zh(){const n={};for(const e in wx)hy(e)&&(n[e]=wx[e]);return typeof globalThis<"u"&&typeof requireMiniProgram>"u"&&(globalThis.wx=n),n}const py=["__route__","__wxExparserNodeId__","__wxWebviewId__"],gy=uy({oauth:["weixin"],share:["weixin"],payment:["wxpay"],push:["weixin"]});function xy(n){const e=Object.create(null);return py.forEach(t=>{e[t]=n[t]}),e}function yy(){const n=Ze.createSelectorQuery(),e=n.in;return n.in=function(i){return i.$scope?e.call(this,i.$scope):e.call(this,xy(i))},n}const Ze=zh();Ze.canIUse("getAppBaseInfo")||(Ze.getAppBaseInfo=Ze.getSystemInfoSync);Ze.canIUse("getWindowInfo")||(Ze.getWindowInfo=Ze.getSystemInfoSync);Ze.canIUse("getDeviceInfo")||(Ze.getDeviceInfo=Ze.getSystemInfoSync);let gr=Ze.getAppBaseInfo&&Ze.getAppBaseInfo();gr||(gr=Ze.getSystemInfoSync());const Ou=gr?gr.host:null,vy=Ou&&Ou.env==="SAAASDK"?Ze.miniapp.shareVideoMessage:Ze.shareVideoMessage;var Ey=Object.freeze({__proto__:null,createSelectorQuery:yy,getProvider:gy,shareVideoMessage:vy});const Ay={args(n,e){n.compressedHeight&&!e.compressHeight&&(e.compressHeight=n.compressedHeight),n.compressedWidth&&!e.compressWidth&&(e.compressWidth=n.compressedWidth)}};var Sy=Object.freeze({__proto__:null,compressImage:Ay,getAppAuthorizeSetting:ry,getAppBaseInfo:ny,getDeviceInfo:iy,getSystemInfo:qh,getSystemInfoSync:J2,getWindowInfo:sy,offError:ay,onError:oy,onSocketMessage:ly,onSocketOpen:Wh,previewImage:ey,redirectTo:Z2,showActionSheet:ty});const hi=zh();var Y=cy(Ey,Sy,hi);/**
- * @dcloudio/uni-mp-vue v3.4.21
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
- * @license MIT
- **/function yi(n,...e){console.warn(`[Vue warn] ${n}`,...e)}let St;class Qh{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=St,!e&&St&&(this.index=(St.scopes||(St.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const t=St;try{return St=this,e()}finally{St=t}}else yi("cannot run an inactive effect scope.")}on(){St=this}off(){St=this.parent}stop(e){if(this._active){let t,i;for(t=0,i=this.effects.length;t<i;t++)this.effects[t].stop();for(t=0,i=this.cleanups.length;t<i;t++)this.cleanups[t]();if(this.scopes)for(t=0,i=this.scopes.length;t<i;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 Ty(n){return new Qh(n)}function by(n,e=St){e&&e.active&&e.effects.push(n)}function _y(){return St}let ki;class ec{constructor(e,t,i,s){this.fn=e,this.trigger=t,this.scheduler=i,this.active=!0,this.deps=[],this._dirtyLevel=4,this._trackId=0,this._runnings=0,this._shouldSchedule=!1,this._depsLength=0,by(this,s)}get dirty(){if(this._dirtyLevel===2||this._dirtyLevel===3){this._dirtyLevel=1,ji();for(let e=0;e<this._depsLength;e++){const t=this.deps[e];if(t.computed&&(Iy(t.computed),this._dirtyLevel>=4))break}this._dirtyLevel===1&&(this._dirtyLevel=0),qi()}return this._dirtyLevel>=4}set dirty(e){this._dirtyLevel=e?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let e=pi,t=ki;try{return pi=!0,ki=this,this._runnings++,Mu(this),this.fn()}finally{Nu(this),this._runnings--,ki=t,pi=e}}stop(){var e;this.active&&(Mu(this),Nu(this),(e=this.onStop)==null||e.call(this),this.active=!1)}}function Iy(n){return n.value}function Mu(n){n._trackId++,n._depsLength=0}function Nu(n){if(n.deps.length>n._depsLength){for(let e=n._depsLength;e<n.deps.length;e++)Yh(n.deps[e],n);n.deps.length=n._depsLength}}function Yh(n,e){const t=n.get(e);t!==void 0&&e._trackId!==t&&(n.delete(e),n.size===0&&n.cleanup())}let pi=!0,ja=0;const Xh=[];function ji(){Xh.push(pi),pi=!1}function qi(){const n=Xh.pop();pi=n===void 0?!0:n}function tc(){ja++}function ic(){for(ja--;!ja&&qa.length;)qa.shift()()}function Jh(n,e,t){var i;if(e.get(n)!==n._trackId){e.set(n,n._trackId);const s=n.deps[n._depsLength];s!==e?(s&&Yh(s,n),n.deps[n._depsLength++]=e):n._depsLength++,(i=n.onTrack)==null||i.call(n,xe({effect:n},t))}}const qa=[];function Zh(n,e,t){var i;tc();for(const s of n.keys()){let r;s._dirtyLevel<e&&(r??(r=n.get(s)===s._trackId))&&(s._shouldSchedule||(s._shouldSchedule=s._dirtyLevel===0),s._dirtyLevel=e),s._shouldSchedule&&(r??(r=n.get(s)===s._trackId))&&((i=s.onTrigger)==null||i.call(s,xe({effect:s},t)),s.trigger(),(!s._runnings||s.allowRecurse)&&s._dirtyLevel!==2&&(s._shouldSchedule=!1,s.scheduler&&qa.push(s.scheduler)))}ic()}const ep=(n,e)=>{const t=new Map;return t.cleanup=n,t.computed=e,t},Wa=new WeakMap,Bi=Symbol("iterate"),za=Symbol("Map key iterate");function Ye(n,e,t){if(pi&&ki){let i=Wa.get(n);i||Wa.set(n,i=new Map);let s=i.get(t);s||i.set(t,s=ep(()=>i.delete(t))),Jh(ki,s,{target:n,type:e,key:t})}}function Wt(n,e,t,i,s,r){const o=Wa.get(n);if(!o)return;let a=[];if(e==="clear")a=[...o.values()];else if(t==="length"&&te(n)){const c=Number(i);o.forEach((l,u)=>{(u==="length"||!Ln(u)&&u>=c)&&a.push(l)})}else switch(t!==void 0&&a.push(o.get(t)),e){case"add":te(n)?Wl(t)&&a.push(o.get("length")):(a.push(o.get(Bi)),Pi(n)&&a.push(o.get(za)));break;case"delete":te(n)||(a.push(o.get(Bi)),Pi(n)&&a.push(o.get(za)));break;case"set":Pi(n)&&a.push(o.get(Bi));break}tc();for(const c of a)c&&Zh(c,4,{target:n,type:e,key:t,newValue:i,oldValue:s,oldTarget:r});ic()}const Cy=Cn("__proto__,__v_isRef,__isVue"),tp=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(Ln)),Uu=Ly();function Ly(){const n={};return["includes","indexOf","lastIndexOf"].forEach(e=>{n[e]=function(...t){const i=fe(this);for(let r=0,o=this.length;r<o;r++)Ye(i,"get",r+"");const s=i[e](...t);return s===-1||s===!1?i[e](...t.map(fe)):s}}),["push","pop","shift","unshift","splice"].forEach(e=>{n[e]=function(...t){ji(),tc();const i=fe(this)[e].apply(this,t);return ic(),qi(),i}}),n}function Dy(n){const e=fe(this);return Ye(e,"has",n),e.hasOwnProperty(n)}class ip{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,i){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 i===(s?r?cp:lp:r?ap:op).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const o=te(e);if(!s){if(o&&ie(Uu,t))return Reflect.get(Uu,t,i);if(t==="hasOwnProperty")return Dy}const a=Reflect.get(e,t,i);return(Ln(t)?tp.has(t):Cy(t))||(s||Ye(e,"get",t),r)?a:et(a)?o&&Wl(t)?a:a.value:Ee(a)?s?up(a):Qr(a):a}}class np extends ip{constructor(e=!1){super(!1,e)}set(e,t,i,s){let r=e[t];if(!this._isShallow){const c=An(r);if(!mr(i)&&!An(i)&&(r=fe(r),i=fe(i)),!te(e)&&et(r)&&!et(i))return c?!1:(r.value=i,!0)}const o=te(e)&&Wl(t)?Number(t)<e.length:ie(e,t),a=Reflect.set(e,t,i,s);return e===fe(s)&&(o?xi(i,r)&&Wt(e,"set",t,i,r):Wt(e,"add",t,i)),a}deleteProperty(e,t){const i=ie(e,t),s=e[t],r=Reflect.deleteProperty(e,t);return r&&i&&Wt(e,"delete",t,void 0,s),r}has(e,t){const i=Reflect.has(e,t);return(!Ln(t)||!tp.has(t))&&Ye(e,"has",t),i}ownKeys(e){return Ye(e,"iterate",te(e)?"length":Bi),Reflect.ownKeys(e)}}class sp extends ip{constructor(e=!1){super(!0,e)}set(e,t){return yi(`Set operation on key "${String(t)}" failed: target is readonly.`,e),!0}deleteProperty(e,t){return yi(`Delete operation on key "${String(t)}" failed: target is readonly.`,e),!0}}const Ry=new np,wy=new sp,Py=new np(!0),ky=new sp(!0),nc=n=>n,Wr=n=>Reflect.getPrototypeOf(n);function Ds(n,e,t=!1,i=!1){n=n.__v_raw;const s=fe(n),r=fe(e);t||(xi(e,r)&&Ye(s,"get",e),Ye(s,"get",r));const{has:o}=Wr(s),a=i?nc:t?rc:es;if(o.call(s,e))return a(n.get(e));if(o.call(s,r))return a(n.get(r));n!==s&&n.get(e)}function Rs(n,e=!1){const t=this.__v_raw,i=fe(t),s=fe(n);return e||(xi(n,s)&&Ye(i,"has",n),Ye(i,"has",s)),n===s?t.has(n):t.has(n)||t.has(s)}function ws(n,e=!1){return n=n.__v_raw,!e&&Ye(fe(n),"iterate",Bi),Reflect.get(n,"size",n)}function $u(n){n=fe(n);const e=fe(this);return Wr(e).has.call(e,n)||(e.add(n),Wt(e,"add",n,n)),this}function Hu(n,e){e=fe(e);const t=fe(this),{has:i,get:s}=Wr(t);let r=i.call(t,n);r?rp(t,i,n):(n=fe(n),r=i.call(t,n));const o=s.call(t,n);return t.set(n,e),r?xi(e,o)&&Wt(t,"set",n,e,o):Wt(t,"add",n,e),this}function Gu(n){const e=fe(this),{has:t,get:i}=Wr(e);let s=t.call(e,n);s?rp(e,t,n):(n=fe(n),s=t.call(e,n));const r=i?i.call(e,n):void 0,o=e.delete(n);return s&&Wt(e,"delete",n,void 0,r),o}function Ku(){const n=fe(this),e=n.size!==0,t=Pi(n)?new Map(n):new Set(n),i=n.clear();return e&&Wt(n,"clear",void 0,void 0,t),i}function Ps(n,e){return function(i,s){const r=this,o=r.__v_raw,a=fe(o),c=e?nc:n?rc:es;return!n&&Ye(a,"iterate",Bi),o.forEach((l,u)=>i.call(s,c(l),c(u),r))}}function ks(n,e,t){return function(...i){const s=this.__v_raw,r=fe(s),o=Pi(r),a=n==="entries"||n===Symbol.iterator&&o,c=n==="keys"&&o,l=s[n](...i),u=t?nc:e?rc:es;return!e&&Ye(r,"iterate",c?za:Bi),{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 Zt(n){return function(...e){{const t=e[0]?`on key "${e[0]}" `:"";yi(`${Ui(n)} operation ${t}failed: target is readonly.`,fe(this))}return n==="delete"?!1:n==="clear"?void 0:this}}function By(){const n={get(r){return Ds(this,r)},get size(){return ws(this)},has:Rs,add:$u,set:Hu,delete:Gu,clear:Ku,forEach:Ps(!1,!1)},e={get(r){return Ds(this,r,!1,!0)},get size(){return ws(this)},has:Rs,add:$u,set:Hu,delete:Gu,clear:Ku,forEach:Ps(!1,!0)},t={get(r){return Ds(this,r,!0)},get size(){return ws(this,!0)},has(r){return Rs.call(this,r,!0)},add:Zt("add"),set:Zt("set"),delete:Zt("delete"),clear:Zt("clear"),forEach:Ps(!0,!1)},i={get(r){return Ds(this,r,!0,!0)},get size(){return ws(this,!0)},has(r){return Rs.call(this,r,!0)},add:Zt("add"),set:Zt("set"),delete:Zt("delete"),clear:Zt("clear"),forEach:Ps(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=ks(r,!1,!1),t[r]=ks(r,!0,!1),e[r]=ks(r,!1,!0),i[r]=ks(r,!0,!0)}),[n,t,e,i]}const[Fy,Oy,My,Ny]=By();function zr(n,e){const t=e?n?Ny:My:n?Oy:Fy;return(i,s,r)=>s==="__v_isReactive"?!n:s==="__v_isReadonly"?n:s==="__v_raw"?i:Reflect.get(ie(t,s)&&s in i?t:i,s,r)}const Uy={get:zr(!1,!1)},$y={get:zr(!1,!0)},Hy={get:zr(!0,!1)},Gy={get:zr(!0,!0)};function rp(n,e,t){const i=fe(t);if(i!==t&&e.call(n,i)){const s=Kr(n);yi(`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 op=new WeakMap,ap=new WeakMap,lp=new WeakMap,cp=new WeakMap;function Ky(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Vy(n){return n.__v_skip||!Object.isExtensible(n)?0:Ky(Kr(n))}function Qr(n){return An(n)?n:Yr(n,!1,Ry,Uy,op)}function jy(n){return Yr(n,!1,Py,$y,ap)}function up(n){return Yr(n,!0,wy,Hy,lp)}function ln(n){return Yr(n,!0,ky,Gy,cp)}function Yr(n,e,t,i,s){if(!Ee(n))return yi(`value cannot be made reactive: ${String(n)}`),n;if(n.__v_raw&&!(e&&n.__v_isReactive))return n;const r=s.get(n);if(r)return r;const o=Vy(n);if(o===0)return n;const a=new Proxy(n,o===2?i:t);return s.set(n,a),a}function hn(n){return An(n)?hn(n.__v_raw):!!(n&&n.__v_isReactive)}function An(n){return!!(n&&n.__v_isReadonly)}function mr(n){return!!(n&&n.__v_isShallow)}function qy(n){return hn(n)||An(n)}function fe(n){const e=n&&n.__v_raw;return e?fe(e):n}function sc(n){return Object.isExtensible(n)&&tx(n,"__v_skip",!0),n}const es=n=>Ee(n)?Qr(n):n,rc=n=>Ee(n)?up(n):n,Wy="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 fp{constructor(e,t,i,s){this.getter=e,this._setter=t,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new ec(()=>e(this._value),()=>tr(this,this.effect._dirtyLevel===2?2:3)),this.effect.computed=this,this.effect.active=this._cacheable=!s,this.__v_isReadonly=i}get value(){const e=fe(this);return(!e._cacheable||e.effect.dirty)&&xi(e._value,e._value=e.effect.run())&&tr(e,4),dp(e),e.effect._dirtyLevel>=2&&(this._warnRecursive&&yi(Wy,`
- getter: `,this.getter),tr(e,2)),e._value}set value(e){this._setter(e)}get _dirty(){return this.effect.dirty}set _dirty(e){this.effect.dirty=e}}function zy(n,e,t=!1){let i,s;const r=q(n);r?(i=n,s=()=>{yi("Write operation failed: computed value is readonly")}):(i=n.get,s=n.set);const o=new fp(i,s,r||!s,t);return e&&!t&&(o.effect.onTrack=e.onTrack,o.effect.onTrigger=e.onTrigger),o}function dp(n){var e;pi&&ki&&(n=fe(n),Jh(ki,(e=n.dep)!=null?e:n.dep=ep(()=>n.dep=void 0,n instanceof fp?n:void 0),{target:n,type:"get",key:"value"}))}function tr(n,e=4,t){n=fe(n);const i=n.dep;i&&Zh(i,e,{target:n,type:"set",key:"value",newValue:t})}function et(n){return!!(n&&n.__v_isRef===!0)}function Qy(n){return Yy(n,!1)}function Yy(n,e){return et(n)?n:new Xy(n,e)}class Xy{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:es(e)}get value(){return dp(this),this._value}set value(e){const t=this.__v_isShallow||mr(e)||An(e);e=t?e:fe(e),xi(e,this._rawValue)&&(this._rawValue=e,this._value=t?e:es(e),tr(this,4,e))}}function hp(n){return et(n)?n.value:n}const Jy={get:(n,e,t)=>hp(Reflect.get(n,e,t)),set:(n,e,t,i)=>{const s=n[e];return et(s)&&!et(t)?(s.value=t,!0):Reflect.set(n,e,t,i)}};function pp(n){return hn(n)?n:new Proxy(n,Jy)}const Fi=[];function oc(n){Fi.push(n)}function ac(){Fi.pop()}function J(n,...e){ji();const t=Fi.length?Fi[Fi.length-1].component:null,i=t&&t.appContext.config.warnHandler,s=Zy();if(i)zt(i,t,11,[n+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 <${eo(t,r.type)}>`).join(`
- `),s]);else{const r=[`[Vue warn]: ${n}`,...e];s.length&&r.push(`
- `,...ev(s)),console.warn(...r)}qi()}function Zy(){let n=Fi[Fi.length-1];if(!n)return[];const e=[];for(;n;){const t=e[0];t&&t.vnode===n?t.recurseCount++:e.push({vnode:n,recurseCount:0});const i=n.component&&n.component.parent;n=i&&i.vnode}return e}function ev(n){const e=[];return n.forEach((t,i)=>{e.push(...i===0?[]:[`
- `],...tv(t))}),e}function tv({vnode:n,recurseCount:e}){const t=e>0?`... (${e} recursive calls)`:"",i=n.component?n.component.parent==null:!1,s=` at <${eo(n.component,n.type,i)}`,r=">"+t;return n.props?[s,...iv(n.props),r]:[s+r]}function iv(n){const e=[],t=Object.keys(n);return t.slice(0,3).forEach(i=>{e.push(...gp(i,n[i]))}),t.length>3&&e.push(" ..."),e}function gp(n,e,t){return Te(e)?(e=JSON.stringify(e),t?e:[`${n}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?t?e:[`${n}=${e}`]:et(e)?(e=gp(n,fe(e.value),!0),t?e:[`${n}=Ref<`,e,">"]):q(e)?[`${n}=fn${e.name?`<${e.name}>`:""}`]:(e=fe(e),t?e:[`${n}=`,e])}const lc={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 zt(n,e,t,i){try{return i?n(...i):n()}catch(s){Xr(s,e,t)}}function vi(n,e,t,i){if(q(n)){const r=zt(n,e,t,i);return r&&Ss(r)&&r.catch(o=>{Xr(o,e,t)}),r}const s=[];for(let r=0;r<n.length;r++)s.push(vi(n[r],e,t,i));return s}function Xr(n,e,t,i=!0){const s=e?e.vnode:null;if(e){let r=e.parent;const o=e.proxy,a=lc[t]||t;for(;r;){const l=r.ec;if(l){for(let u=0;u<l.length;u++)if(l[u](n,o,a)===!1)return}r=r.parent}const c=e.appContext.config.errorHandler;if(c){zt(c,null,10,[n,o,a]);return}}mp(n,t,s,i)}function mp(n,e,t,i=!0){{const s=lc[e]||e;t&&oc(t),J(`Unhandled error${s?` during execution of ${s}`:""}`),t&&ac(),console.error(n)}}let ts=!1,Qa=!1;const $e=[];let Pt=0;const pn=[];let Vt=null,si=0;const xp=Promise.resolve();let cc=null;const nv=100;function uc(n){const e=cc||xp;return n?e.then(this?n.bind(this):n):e}function sv(n){let e=Pt+1,t=$e.length;for(;e<t;){const i=e+t>>>1,s=$e[i],r=is(s);r<n||r===n&&s.pre?e=i+1:t=i}return e}function xr(n){(!$e.length||!$e.includes(n,ts&&n.allowRecurse?Pt+1:Pt))&&(n.id==null?$e.push(n):$e.splice(sv(n.id),0,n),yp())}function yp(){!ts&&!Qa&&(Qa=!0,cc=xp.then(Ap))}function rv(n){return $e.indexOf(n)>-1}function ov(n){const e=$e.indexOf(n);e>Pt&&$e.splice(e,1)}function vp(n){te(n)?pn.push(...n):(!Vt||!Vt.includes(n,n.allowRecurse?si+1:si))&&pn.push(n),yp()}function Ep(n,e,t=ts?Pt+1:0){for(e=e||new Map;t<$e.length;t++){const i=$e[t];if(i&&i.pre){if(fc(e,i))continue;$e.splice(t,1),t--,i()}}}function av(n){if(pn.length){const e=[...new Set(pn)].sort((t,i)=>is(t)-is(i));if(pn.length=0,Vt){Vt.push(...e);return}for(Vt=e,n=n||new Map,si=0;si<Vt.length;si++)fc(n,Vt[si])||Vt[si]();Vt=null,si=0}}const is=n=>n.id==null?1/0:n.id,lv=(n,e)=>{const t=is(n)-is(e);if(t===0){if(n.pre&&!e.pre)return-1;if(e.pre&&!n.pre)return 1}return t};function Ap(n){Qa=!1,ts=!0,n=n||new Map,$e.sort(lv);const e=t=>fc(n,t);try{for(Pt=0;Pt<$e.length;Pt++){const t=$e[Pt];if(t&&t.active!==!1){if(e(t))continue;zt(t,null,14)}}}finally{Pt=0,$e.length=0,av(n),ts=!1,cc=null,($e.length||pn.length)&&Ap(n)}}function fc(n,e){if(!n.has(e))n.set(e,1);else{const t=n.get(e);if(t>nv){const i=e.ownerInstance,s=i&&mc(i.type);return Xr(`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 n.set(e,t+1)}}let kt,$n=[],Ya=!1;function Jr(n,...e){kt?kt.emit(n,...e):Ya||$n.push({event:n,args:e})}function Sp(n,e){var t,i;kt=n,kt?(kt.enabled=!0,$n.forEach(({event:s,args:r})=>kt.emit(s,...r)),$n=[]):typeof window<"u"&&window.HTMLElement&&!((i=(t=window.navigator)==null?void 0:t.userAgent)!=null&&i.includes("jsdom"))?((e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(r=>{Sp(r,e)}),setTimeout(()=>{kt||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Ya=!0,$n=[])},3e3)):(Ya=!0,$n=[])}function cv(n,e){Jr("app:init",n,e,{Fragment:Zv,Text:eE,Comment:tE,Static:iE})}const uv=dc("component:added"),fv=dc("component:updated"),dv=dc("component:removed"),hv=n=>{kt&&typeof kt.cleanupBuffer=="function"&&!kt.cleanupBuffer(n)&&dv(n)};/*! #__NO_SIDE_EFFECTS__ */function dc(n){return e=>{Jr(n,e.appContext.app,e.uid,e.uid===0?void 0:e.parent?e.parent.uid:0,e)}}const pv=Tp("perf:start"),gv=Tp("perf:end");function Tp(n){return(e,t,i)=>{Jr(n,e.appContext.app,e.uid,e,t,i)}}function mv(n,e,t){Jr("component:emit",n.appContext.app,n,e,t)}function xv(n,e,...t){if(n.isUnmounted)return;const i=n.vnode.props||De;{const{emitsOptions:u,propsOptions:[f]}=n;if(u)if(!(e in u))(!f||!(_i(e)in f))&&J(`Component emitted event "${e}" but it is neither declared in the emits option nor as an "${_i(e)}" prop.`);else{const d=u[e];q(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 i){const u=`${o==="modelValue"?"model":o}Modifiers`,{number:f,trim:d}=i[u]||De;d&&(s=t.map(h=>Te(h)?h.trim():h)),f&&(s=t.map(ix))}mv(n,e,s);{const u=e.toLowerCase();u!==e&&i[_i(u)]&&J(`Event "${u}" is emitted in component ${eo(n,n.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 "${Ni(e)}" instead of "${e}".`)}let a,c=i[a=_i(e)]||i[a=_i(Ut(e))];!c&&r&&(c=i[a=_i(Ni(e))]),c&&vi(c,n,6,s);const l=i[a+"Once"];if(l){if(!n.emitted)n.emitted={};else if(n.emitted[a])return;n.emitted[a]=!0,vi(l,n,6,s)}}function bp(n,e,t=!1){const i=e.emitsCache,s=i.get(n);if(s!==void 0)return s;const r=n.emits;let o={},a=!1;if(!q(n)){const c=l=>{const u=bp(l,e,!0);u&&(a=!0,xe(o,u))};!t&&e.mixins.length&&e.mixins.forEach(c),n.extends&&c(n.extends),n.mixins&&n.mixins.forEach(c)}return!r&&!a?(Ee(n)&&i.set(n,null),null):(te(r)?r.forEach(c=>o[c]=null):xe(o,r),Ee(n)&&i.set(n,o),o)}function _p(n,e){return!n||!Jd(e)?!1:(e=e.slice(2).replace(/Once$/,""),ie(n,e[0].toLowerCase()+e.slice(1))||ie(n,Ni(e))||ie(n,e))}let Hi=null;function Vu(n){const e=Hi;return Hi=n,n&&n.type.__scopeId,e}const Xa="components";function yv(n,e){return vv(Xa,n,!0,e)||n}function vv(n,e,t=!0,i=!1){const s=Hi||ke;if(s){const r=s.type;if(n===Xa){const a=mc(r,!1);if(a&&(a===e||a===Ut(e)||a===Ui(Ut(e))))return r}const o=ju(s[n]||r[n],e)||ju(s.appContext[n],e);if(!o&&i)return r;if(t&&!o){const a=n===Xa?`
- If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.`:"";J(`Failed to resolve ${n.slice(0,-1)}: ${e}${a}`)}return o}else J(`resolve${Ui(n.slice(0,-1))} can only be used in render() or setup().`)}function ju(n,e){return n&&(n[e]||n[Ut(e)]||n[Ui(Ut(e))])}const Bs={};function qn(n,e,t){return q(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."),Ip(n,e,t)}function Ip(n,e,{immediate:t,deep:i,flush:s,once:r,onTrack:o,onTrigger:a}=De){if(e&&r){const T=e;e=(..._)=>{T(..._),S()}}i!==void 0&&typeof i=="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.'),i!==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=>i===!0?T:cn(T,i===!1?1:void 0);let f,d=!1,h=!1;if(et(n)?(f=()=>n.value,d=mr(n)):hn(n)?(f=()=>u(n),d=!0):te(n)?(h=!0,d=n.some(T=>hn(T)||mr(T)),f=()=>n.map(T=>{if(et(T))return T.value;if(hn(T))return u(T);if(q(T))return zt(T,l,2);c(T)})):q(n)?e?f=()=>zt(n,l,2):f=()=>(p&&p(),vi(n,l,3,[m])):(f=He,c(n)),e&&i){const T=f;f=()=>cn(T())}let p,m=T=>{p=x.onStop=()=>{zt(T,l,4),p=x.onStop=void 0}},g=h?new Array(n.length).fill(Bs):Bs;const y=()=>{if(!(!x.active||!x.dirty))if(e){const T=x.run();(i||d||(h?T.some((_,I)=>xi(_,g[I])):xi(T,g)))&&(p&&p(),vi(e,l,3,[T,g===Bs?void 0:h&&g[0]===Bs?[]:g,m]),g=T)}else x.run()};y.allowRecurse=!!e;let v;s==="sync"?v=y:s==="post"?v=()=>t0(y,l&&l.suspense):(y.pre=!0,l&&(y.id=l.uid),v=()=>xr(y));const x=new ec(f,He,v),E=_y(),S=()=>{x.stop(),E&&Gr(E.effects,x)};return x.onTrack=o,x.onTrigger=a,e?t?y():g=x.run():s==="post"?t0(x.run.bind(x),l&&l.suspense):x.run(),S}function Ev(n,e,t){const i=this.proxy,s=Te(n)?n.includes(".")?Cp(i,n):()=>i[n]:n.bind(i,i);let r;q(e)?r=e:(r=e.handler,t=e);const o=bs(this),a=Ip(s,r.bind(i),t);return o(),a}function Cp(n,e){const t=e.split(".");return()=>{let i=n;for(let s=0;s<t.length&&i;s++)i=i[t[s]];return i}}function cn(n,e,t=0,i){if(!Ee(n)||n.__v_skip)return n;if(e&&e>0){if(t>=e)return n;t++}if(i=i||new Set,i.has(n))return n;if(i.add(n),et(n))cn(n.value,e,t,i);else if(te(n))for(let s=0;s<n.length;s++)cn(n[s],e,t,i);else if(Zd(n)||Pi(n))n.forEach(s=>{cn(s,e,t,i)});else if(Ge(n))for(const s in n)cn(n[s],e,t,i);return n}function Lp(n){J1(n)&&J("Do not use built-in directive ids as custom directive id: "+n)}function Dp(){return{app:null,config:{isNativeTag:Y1,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 Av=0;function Sv(n,e){return function(i,s=null){q(i)||(i=xe({},i)),s!=null&&!Ee(s)&&(J("root props passed to app.mount() must be an object."),s=null);const r=Dp(),o=new WeakSet,a=r.app={_uid:Av++,_component:i,_props:s,_container:null,_context:r,_instance:null,version:Hp,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&&q(c.install)?(o.add(c),c.install(a,...l)):q(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 sl(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 Lp(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=Wn;Wn=a;try{return c()}finally{Wn=l}}};return a}}let Wn=null;function Tv(n,e){if(!ke)J("provide() can only be used inside setup().");else{let t=ke.provides;const i=ke.parent&&ke.parent.provides;i===t&&(t=ke.provides=Object.create(i)),t[n]=e,ke.type.mpType==="app"&&ke.appContext.app.provide(n,e)}}function ir(n,e,t=!1){const i=ke||Hi;if(i||Wn){const s=i?i.parent==null?i.vnode.appContext&&i.vnode.appContext.provides:i.parent.provides:Wn._context.provides;if(s&&n in s)return s[n];if(arguments.length>1)return t&&q(e)?e.call(i&&i.proxy):e;J(`injection "${String(n)}" not found.`)}else J("inject() can only be used inside setup() or functional components.")}const bv=n=>n.type.__isKeepAlive;function _v(n,e){Rp(n,"a",e)}function Iv(n,e){Rp(n,"da",e)}function Rp(n,e,t=ke){const i=n.__wdc||(n.__wdc=()=>{let s=t;for(;s;){if(s.isDeactivated)return;s=s.parent}return n()});if(Wi(e,i,t),t){let s=t.parent;for(;s&&s.parent;)bv(s.parent.vnode)&&Cv(i,e,t,s),s=s.parent}}function Cv(n,e,t,i){const s=Wi(e,n,i,!0);wp(()=>{Gr(i[e],s)},t)}function Wi(n,e,t=ke,i=!1){if(t){Ax(n)&&(t=t.root);const s=t[n]||(t[n]=[]),r=e.__weh||(e.__weh=(...o)=>{if(t.isUnmounted)return;ji();const a=bs(t),c=vi(e,t,n,o);return a(),qi(),c});return i?s.unshift(r):s.push(r),r}else{const s=_i((lc[n]||n.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 Qt=n=>(e,t=ke)=>(!gc||n==="sp")&&Wi(n,(...i)=>e(...i),t),Lv=Qt("bm"),Dv=Qt("m"),Rv=Qt("bu"),wv=Qt("u"),hc=Qt("bum"),wp=Qt("um"),Pv=Qt("sp"),kv=Qt("rtg"),Bv=Qt("rtc");function Fv(n,e=ke){Wi("ec",n,e)}const Ja=n=>n?Np(n)?_s(n)||n.proxy:Ja(n.parent):null;function Ov(n){return n}const ns=xe(Object.create(null),{$:Ov,$el:n=>n.__$el||(n.__$el={}),$data:n=>n.data,$props:n=>ln(n.props),$attrs:n=>ln(n.attrs),$slots:n=>ln(n.slots),$refs:n=>ln(n.refs),$parent:n=>Ja(n.parent),$root:n=>Ja(n.root),$emit:n=>n.emit,$options:n=>Bp(n),$forceUpdate:n=>n.f||(n.f=()=>{n.effect.dirty=!0,xr(n.update)}),$watch:n=>Ev.bind(n)}),pc=n=>n==="_"||n==="$",po=(n,e)=>n!==De&&!n.__isScriptSetup&&ie(n,e),Pp={get({_:n},e){const{ctx:t,setupState:i,data:s,props:r,accessCache:o,type:a,appContext:c}=n;if(e==="__isVue")return!0;let l;if(e[0]!=="$"){const h=o[e];if(h!==void 0)switch(h){case 1:return i[e];case 2:return s[e];case 4:return t[e];case 3:return r[e]}else{if(po(i,e))return o[e]=1,i[e];if(s!==De&&ie(s,e))return o[e]=2,s[e];if((l=n.propsOptions[0])&&ie(l,e))return o[e]=3,r[e];if(t!==De&&ie(t,e))return o[e]=4,t[e];Za&&(o[e]=0)}}const u=ns[e];let f,d;if(u)return(e==="$attrs"||e==="$slots")&&Ye(n,"get",e),u(n);if((f=a.__cssModules)&&(f=f[e]))return f;if(t!==De&&ie(t,e))return o[e]=4,t[e];if(d=c.config.globalProperties,ie(d,e))return d[e];Hi&&(!Te(e)||e.indexOf("__v")!==0)&&(s!==De&&pc(e[0])&&ie(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.`):n===Hi&&J(`Property ${JSON.stringify(e)} was accessed during render but is not defined on instance.`))},set({_:n},e,t){const{data:i,setupState:s,ctx:r}=n;return po(s,e)?(s[e]=t,!0):s.__isScriptSetup&&ie(s,e)?(J(`Cannot mutate <script setup> binding "${e}" from Options API.`),!1):i!==De&&ie(i,e)?(i[e]=t,!0):ie(n.props,e)?(J(`Attempting to mutate prop "${e}". Props are readonly.`),!1):e[0]==="$"&&e.slice(1)in n?(J(`Attempting to mutate public property "${e}". Properties starting with $ are reserved and readonly.`),!1):(e in n.appContext.config.globalProperties?Object.defineProperty(r,e,{enumerable:!0,configurable:!0,value:t}):r[e]=t,!0)},has({_:{data:n,setupState:e,accessCache:t,ctx:i,appContext:s,propsOptions:r}},o){let a;return!!t[o]||n!==De&&ie(n,o)||po(e,o)||(a=r[0])&&ie(a,o)||ie(i,o)||ie(ns,o)||ie(s.config.globalProperties,o)},defineProperty(n,e,t){return t.get!=null?n._.accessCache[e]=0:ie(t,"value")&&this.set(n,e,t.value,null),Reflect.defineProperty(n,e,t)}};Pp.ownKeys=n=>(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(n));function Mv(n){const e={};return Object.defineProperty(e,"_",{configurable:!0,enumerable:!1,get:()=>n}),Object.keys(ns).forEach(t=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get:()=>ns[t](n),set:He})}),e}function Nv(n){const{ctx:e,propsOptions:[t]}=n;t&&Object.keys(t).forEach(i=>{Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>n.props[i],set:He})})}function Uv(n){const{ctx:e,setupState:t}=n;Object.keys(fe(t)).forEach(i=>{if(!t.__isScriptSetup){if(pc(i[0])){J(`setup() return property ${JSON.stringify(i)} should not start with "$" or "_" which are reserved prefixes for Vue internals.`);return}Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>t[i],set:He})}})}function qu(n){return te(n)?n.reduce((e,t)=>(e[t]=null,e),{}):n}function $v(){const n=Object.create(null);return(e,t)=>{n[t]?J(`${e} property "${t}" is already defined in ${n[t]}.`):n[t]=e}}let Za=!0;function Hv(n){const e=Bp(n),t=n.proxy,i=n.ctx;Za=!1,e.beforeCreate&&Wu(e.beforeCreate,n,"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:R,expose:b,inheritAttrs:L,components:k,directives:M,filters:N}=e,F=$v();{const[G]=n.propsOptions;if(G)for(const H in G)F("Props",H)}function O(){l&&Gv(l,i,F)}if(O(),o)for(const G in o){const H=o[G];q(H)?(Object.defineProperty(i,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){q(s)||J("The data option must be a function. Plain object usage is no longer supported.");const G=s.call(t,t);if(Ss(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{n.data=Qr(G);for(const H in G)F("Data",H),pc(H[0])||Object.defineProperty(i,H,{configurable:!0,enumerable:!0,get:()=>G[H],set:He})}}if(Za=!0,r)for(const G in r){const H=r[G],C=q(H)?H.bind(t,t):q(H.get)?H.get.bind(t,t):He;C===He&&J(`Computed property "${G}" has no getter.`);const D=!q(H)&&q(H.set)?H.set.bind(t):()=>{J(`Write operation failed: computed property "${G}" is readonly.`)},P=$p({get:C,set:D});Object.defineProperty(i,G,{enumerable:!0,configurable:!0,get:()=>P.value,set:w=>P.value=w}),F("Computed",G)}if(a)for(const G in a)kp(a[G],i,t,G);function K(){if(c){const G=q(c)?c.call(t):c;Reflect.ownKeys(G).forEach(H=>{Tv(H,G[H])})}}K(),u&&Wu(u,n,"c");function B(G,H){te(H)?H.forEach(C=>G(C.bind(t))):H&&G(H.bind(t))}if(B(Lv,f),B(Dv,d),B(Rv,h),B(wv,p),B(_v,m),B(Iv,g),B(Fv,I),B(Bv,T),B(kv,_),B(hc,v),B(wp,E),B(Pv,R),te(b))if(b.length){const G=n.exposed||(n.exposed={});b.forEach(H=>{Object.defineProperty(G,H,{get:()=>t[H],set:C=>t[H]=C})})}else n.exposed||(n.exposed={});S&&n.render===He&&(n.render=S),L!=null&&(n.inheritAttrs=L),k&&(n.components=k),M&&(n.directives=M),n.ctx.$onApplyOptions&&n.ctx.$onApplyOptions(e,n,t)}function Gv(n,e,t=He){te(n)&&(n=el(n));for(const i in n){const s=n[i];let r;Ee(s)?"default"in s?r=ir(s.from||i,s.default,!0):r=ir(s.from||i):r=ir(s),et(r)?Object.defineProperty(e,i,{enumerable:!0,configurable:!0,get:()=>r.value,set:o=>r.value=o}):e[i]=r,t("Inject",i)}}function Wu(n,e,t){vi(te(n)?n.map(i=>i.bind(e.proxy)):n.bind(e.proxy),e,t)}function kp(n,e,t,i){const s=i.includes(".")?Cp(t,i):()=>t[i];if(Te(n)){const r=e[n];q(r)?qn(s,r):J(`Invalid watch handler specified by key "${n}"`,r)}else if(q(n))qn(s,n.bind(t));else if(Ee(n))if(te(n))n.forEach(r=>kp(r,e,t,i));else{const r=q(n.handler)?n.handler.bind(t):e[n.handler];q(r)?qn(s,r,n):J(`Invalid watch handler specified by key "${n.handler}"`,r)}else J(`Invalid watch option: "${i}"`,n)}function Bp(n){const e=n.type,{mixins:t,extends:i}=e,{mixins:s,optionsCache:r,config:{optionMergeStrategies:o}}=n.appContext,a=r.get(e);let c;return a?c=a:!s.length&&!t&&!i?c=e:(c={},s.length&&s.forEach(l=>yr(c,l,o,!0)),yr(c,e,o)),Ee(e)&&r.set(e,c),c}function yr(n,e,t,i=!1){const{mixins:s,extends:r}=e;r&&yr(n,r,t,!0),s&&s.forEach(o=>yr(n,o,t,!0));for(const o in e)if(i&&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=Kv[o]||t&&t[o];n[o]=a?a(n[o],e[o]):e[o]}return n}const Kv={data:zu,props:Qu,emits:Qu,methods:Hn,computed:Hn,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:Hn,directives:Hn,watch:jv,provide:zu,inject:Vv};function zu(n,e){return e?n?function(){return xe(q(n)?n.call(this,this):n,q(e)?e.call(this,this):e)}:e:n}function Vv(n,e){return Hn(el(n),el(e))}function el(n){if(te(n)){const e={};for(let t=0;t<n.length;t++)e[n[t]]=n[t];return e}return n}function Xe(n,e){return n?[...new Set([].concat(n,e))]:e}function Hn(n,e){return n?xe(Object.create(null),n,e):e}function Qu(n,e){return n?te(n)&&te(e)?[...new Set([...n,...e])]:xe(Object.create(null),qu(n),qu(e??{})):e}function jv(n,e){if(!n)return e;if(!e)return n;const t=xe(Object.create(null),n);for(const i in e)t[i]=Xe(n[i],e[i]);return t}function qv(n,e,t,i=!1){const s={},r={};n.propsDefaults=Object.create(null),Fp(n,e,s,r);for(const o in n.propsOptions[0])o in s||(s[o]=void 0);Mp(e||{},s,n),t?n.props=i?s:jy(s):n.type.props?n.props=s:n.props=r,n.attrs=r}function Wv(n,e,t,i){const{props:s,attrs:r,vnode:{patchFlag:o}}=n,a=fe(s),[c]=n.propsOptions;let l=!1;if(!void 0&&(i||o>0)&&!(o&16)){if(o&8){const u=n.vnode.dynamicProps;for(let f=0;f<u.length;f++){let d=u[f];if(_p(n.emitsOptions,d))continue;const h=e[d];if(c)if(ie(r,d))h!==r[d]&&(r[d]=h,l=!0);else{const p=Ut(d);s[p]=tl(c,a,p,h,n,!1)}else h!==r[d]&&(r[d]=h,l=!0)}}}else{Fp(n,e,s,r)&&(l=!0);let u;for(const f in a)(!e||!ie(e,f)&&((u=Ni(f))===f||!ie(e,u)))&&(c?t&&(t[f]!==void 0||t[u]!==void 0)&&(s[f]=tl(c,a,f,void 0,n,!0)):delete s[f]);if(r!==a)for(const f in r)(!e||!ie(e,f))&&(delete r[f],l=!0)}l&&Wt(n,"set","$attrs"),Mp(e||{},s,n)}function Fp(n,e,t,i){const[s,r]=n.propsOptions;let o=!1,a;if(e)for(let c in e){if(th(c))continue;const l=e[c];let u;s&&ie(s,u=Ut(c))?!r||!r.includes(u)?t[u]=l:(a||(a={}))[u]=l:_p(n.emitsOptions,c)||(!(c in i)||l!==i[c])&&(i[c]=l,o=!0)}if(r){const c=fe(t),l=a||De;for(let u=0;u<r.length;u++){const f=r[u];t[f]=tl(s,c,f,l[f],n,!ie(l,f))}}return o}function tl(n,e,t,i,s,r){const o=n[t];if(o!=null){const a=ie(o,"default");if(a&&i===void 0){const c=o.default;if(o.type!==Function&&!o.skipFactory&&q(c)){const{propsDefaults:l}=s;if(t in l)i=l[t];else{const u=bs(s);i=l[t]=c.call(null,e),u()}}else i=c}o[0]&&(r&&!a?i=!1:o[1]&&(i===""||i===Ni(t))&&(i=!0))}return i}function Op(n,e,t=!1){const i=e.propsCache,s=i.get(n);if(s)return s;const r=n.props,o={},a=[];let c=!1;if(!q(n)){const u=f=>{c=!0;const[d,h]=Op(f,e,!0);xe(o,d),h&&a.push(...h)};!t&&e.mixins.length&&e.mixins.forEach(u),n.extends&&u(n.extends),n.mixins&&n.mixins.forEach(u)}if(!r&&!c)return Ee(n)&&i.set(n,vu),vu;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=Ut(r[u]);Yu(f)&&(o[f]=De)}else if(r){Ee(r)||J("invalid props options",r);for(const u in r){const f=Ut(u);if(Yu(f)){const d=r[u],h=o[f]=te(d)||q(d)?{type:d}:xe({},d);if(h){const p=Ju(Boolean,h.type),m=Ju(String,h.type);h[0]=p>-1,h[1]=m<0||p<m,(p>-1||ie(h,"default"))&&a.push(f)}}}}const l=[o,a];return Ee(n)&&i.set(n,l),l}function Yu(n){return n[0]!=="$"&&!th(n)?!0:(J(`Invalid prop name: "${n}" is a reserved property.`),!1)}function il(n){return n===null?"null":typeof n=="function"?n.name||"":typeof n=="object"&&n.constructor&&n.constructor.name||""}function Xu(n,e){return il(n)===il(e)}function Ju(n,e){return te(e)?e.findIndex(t=>Xu(t,n)):q(e)&&Xu(e,n)?0:-1}function Mp(n,e,t){const i=fe(e),s=t.propsOptions[0];for(const r in s){let o=s[r];o!=null&&zv(r,i[r],o,ln(i),!ie(n,r)&&!ie(n,Ni(r)))}}function zv(n,e,t,i,s){const{type:r,required:o,validator:a,skipCheck:c}=t;if(o&&s){J('Missing required prop: "'+n+'"');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}=Yv(e,u[d]);f.push(p||""),l=h}if(!l){J(Xv(n,e,f));return}}a&&!a(e,i)&&J('Invalid prop: custom validator check failed for prop "'+n+'".')}}const Qv=Cn("String,Number,Boolean,Function,Symbol,BigInt");function Yv(n,e){let t;const i=il(e);if(Qv(i)){const s=typeof n;t=s===i.toLowerCase(),!t&&s==="object"&&(t=n instanceof e)}else i==="Object"?t=Ee(n):i==="Array"?t=te(n):i==="null"?t=n===null:t=n instanceof e;return{valid:t,expectedType:i}}function Xv(n,e,t){if(t.length===0)return`Prop type [] for prop "${n}" won't match anything. Did you mean to use type Array instead?`;let i=`Invalid prop: type check failed for prop "${n}". Expected ${t.map(Ui).join(" | ")}`;const s=t[0],r=Kr(e),o=Zu(e,s),a=Zu(e,r);return t.length===1&&e0(s)&&!Jv(s,r)&&(i+=` with value ${o}`),i+=`, got ${r} `,e0(r)&&(i+=`with value ${a}.`),i}function Zu(n,e){return e==="String"?`"${n}"`:e==="Number"?`${Number(n)}`:`${n}`}function e0(n){return["string","number","boolean"].some(t=>n.toLowerCase()===t)}function Jv(...n){return n.some(e=>e.toLowerCase()==="boolean")}let Fn,ai;function vr(n,e){n.appContext.config.performance&&Ar()&&ai.mark(`vue-${e}-${n.uid}`),pv(n,e,Ar()?ai.now():Date.now())}function Er(n,e){if(n.appContext.config.performance&&Ar()){const t=`vue-${e}-${n.uid}`,i=t+":end";ai.mark(i),ai.measure(`<${eo(n,n.type)}> ${e}`,t,i),ai.clearMarks(t),ai.clearMarks(i)}gv(n,e,Ar()?ai.now():Date.now())}function Ar(){return Fn!==void 0||(typeof window<"u"&&window.performance?(Fn=!0,ai=window.performance):Fn=!1),Fn}const t0=vp,Zv=Symbol.for("v-fgt"),eE=Symbol.for("v-txt"),tE=Symbol.for("v-cmt"),iE=Symbol.for("v-stc");function nE(n){return n?n.__v_isVNode===!0:!1}const sE="__vInternal";function rE(n){return n?qy(n)||sE in n?xe({},n):n:null}const oE=Dp();let aE=0;function lE(n,e,t){const i=n.type,s=(e?e.appContext:n.appContext)||oE,r={uid:aE++,vnode:n,type:i,parent:e,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,scope:new Qh(!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:Op(i,s),emitsOptions:bp(i,s),emit:null,emitted:null,propsDefaults:De,inheritAttrs:i.inheritAttrs,ctx:De,data:De,props:De,attrs:De,slots:De,refs:De,setupState:De,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=Mv(r),r.root=e?e.root:r,r.emit=xv.bind(null,r),n.ce&&n.ce(r),r}let ke=null;const Zr=()=>ke||Hi;let Sr,nl;Sr=n=>{ke=n},nl=n=>{gc=n};const bs=n=>{const e=ke;return Sr(n),n.scope.on(),()=>{n.scope.off(),Sr(e)}},i0=()=>{ke&&ke.scope.off(),Sr(null)},cE=Cn("slot,component");function sl(n,{isNativeTag:e}){(cE(n)||e(n))&&J("Do not use built-in or reserved HTML elements as component id: "+n)}function Np(n){return n.vnode.shapeFlag&4}let gc=!1;function uE(n,e=!1){e&&nl(e);const{props:t}=n.vnode,i=Np(n);qv(n,t,i,e);const s=i?fE(n,e):void 0;return e&&nl(!1),s}function fE(n,e){const t=n.type;{if(t.name&&sl(t.name,n.appContext.config),t.components){const s=Object.keys(t.components);for(let r=0;r<s.length;r++)sl(s[r],n.appContext.config)}if(t.directives){const s=Object.keys(t.directives);for(let r=0;r<s.length;r++)Lp(s[r])}t.compilerOptions&&pE()&&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.')}n.accessCache=Object.create(null),n.proxy=sc(new Proxy(n.ctx,Pp)),Nv(n);const{setup:i}=t;if(i){const s=n.setupContext=i.length>1?xE(n):null,r=bs(n);ji();const o=zt(i,n,0,[ln(n.props),s]);qi(),r(),Ss(o)?(o.then(i0,i0),J("setup() returned a Promise, but the version of Vue you are using does not support it yet.")):dE(n,o,e)}else Up(n,e)}function dE(n,e,t){q(e)?n.render=e:Ee(e)?(nE(e)&&J("setup() should not return VNodes directly - return a render function instead."),n.devtoolsRawSetupState=e,n.setupState=pp(e),Uv(n)):e!==void 0&&J(`setup() should return an object. Received: ${e===null?"null":typeof e}`),Up(n,t)}let hE;const pE=()=>!hE;function Up(n,e,t){const i=n.type;n.render||(n.render=i.render||He);{const s=bs(n);ji();try{Hv(n)}finally{qi(),s()}}!i.render&&n.render===He&&!e&&(i.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 gE(n){return n.attrsProxy||(n.attrsProxy=new Proxy(n.attrs,{get(e,t){return Ye(n,"get","$attrs"),e[t]},set(){return J("setupContext.attrs is readonly."),!1},deleteProperty(){return J("setupContext.attrs is readonly."),!1}}))}function mE(n){return n.slotsProxy||(n.slotsProxy=new Proxy(n.slots,{get(e,t){return Ye(n,"get","$slots"),e[t]}}))}function xE(n){return Object.freeze({get attrs(){return gE(n)},get slots(){return mE(n)},get emit(){return(t,...i)=>n.emit(t,...i)},expose:t=>{if(n.exposed&&J("expose() should be called only once per setup()."),t!=null){let i=typeof t;i==="object"&&(te(t)?i="array":et(t)&&(i="ref")),i!=="object"&&J(`expose() should be passed a plain object, received ${i}.`)}n.exposed=t||{}}})}function _s(n){if(n.exposed)return n.exposeProxy||(n.exposeProxy=new Proxy(pp(sc(n.exposed)),{get(e,t){return t in e?e[t]:n.proxy[t]},has(e,t){return t in e||t in ns}}))}const yE=/(?:^|[-_])(\w)/g,vE=n=>n.replace(yE,e=>e.toUpperCase()).replace(/[-_]/g,"");function mc(n,e=!0){return q(n)?n.displayName||n.name:n.name||e&&n.__name}function eo(n,e,t=!1){let i=mc(e);if(!i&&e.__file){const s=e.__file.match(/([^/\\]+)\.\w+$/);s&&(i=s[1])}if(!i&&n&&n.parent){const s=r=>{for(const o in r)if(r[o]===e)return o};i=s(n.components||n.parent.type.components)||s(n.appContext.components)}return i?vE(i):t?"App":"Anonymous"}const $p=(n,e)=>{const t=zy(n,e,gc);{const i=Zr();i&&i.appContext.config.warnRecursiveComputed&&(t._warnRecursive=!0)}return t},Hp="3.4.21",xc=J;function Tr(n){return hp(n)}const Ci="[object Array]",Li="[object Object]";function Gp(n,e){const t={};return rl(n,e),nr(n,e,"",t),t}function rl(n,e){if(n=Tr(n),n===e)return;const t=Bt(n),i=Bt(e);if(t==Li&&i==Li)for(let s in e){const r=n[s];r===void 0?n[s]=null:rl(r,e[s])}else t==Ci&&i==Ci&&n.length>=e.length&&e.forEach((s,r)=>{rl(n[r],s)})}function nr(n,e,t,i){if(n=Tr(n),n===e)return;const s=Bt(n),r=Bt(e);if(s==Li)if(r!=Li||Object.keys(n).length<Object.keys(e).length)ei(i,t,n);else for(let o in n){const a=Tr(n[o]),c=e[o],l=Bt(a),u=Bt(c);if(l!=Ci&&l!=Li)a!=c&&ei(i,(t==""?"":t+".")+o,a);else if(l==Ci)u!=Ci||a.length<c.length?ei(i,(t==""?"":t+".")+o,a):a.forEach((f,d)=>{nr(f,c[d],(t==""?"":t+".")+o+"["+d+"]",i)});else if(l==Li)if(u!=Li||Object.keys(a).length<Object.keys(c).length)ei(i,(t==""?"":t+".")+o,a);else for(let f in a)nr(a[f],c[f],(t==""?"":t+".")+o+"."+f,i)}else s==Ci?r!=Ci||n.length<e.length?ei(i,t,n):n.forEach((o,a)=>{nr(o,e[a],t+"["+a+"]",i)}):ei(i,t,n)}function ei(n,e,t){n[e]=t}function EE(n){return $e.includes(n.update)}function n0(n){const t=n.ctx.__next_tick_callbacks;if(t&&t.length){const i=t.slice(0);t.length=0;for(let s=0;s<i.length;s++)i[s]()}}function ol(n,e){const t=n.ctx;if(!t.__next_tick_pending&&!EE(n))return uc(e&&e.bind(n.proxy));let i;return t.__next_tick_callbacks||(t.__next_tick_callbacks=[]),t.__next_tick_callbacks.push(()=>{e?zt(e.bind(n.proxy),n,14):i&&i(n.proxy)}),new Promise(s=>{i=s})}function al(n,e){n=Tr(n);const t=typeof n;if(t==="object"&&n!==null){let i=e.get(n);if(typeof i<"u")return i;if(te(n)){const s=n.length;i=new Array(s),e.set(n,i);for(let r=0;r<s;r++)i[r]=al(n[r],e)}else{i={},e.set(n,i);for(const s in n)ie(n,s)&&(i[s]=al(n[s],e))}return i}if(t!=="symbol")return n}function AE(n){return al(n,typeof WeakMap<"u"?new WeakMap:new Map)}function SE(n,e){const t=n.data,i=Object.create(null);return e.forEach(s=>{i[s]=t[s]}),i}function s0(n,e,t){if(!e)return;e=AE(e),e.$eS=n.$eS||{},e.$eA=n.$eA||{};const i=n.ctx,s=i.mpType;if(s==="page"||s==="component"){e.r0=1;const r=i.$scope,o=Object.keys(e),a=Gp(e,t||SE(r,o));Object.keys(a).length?(i.__next_tick_pending=!0,r.setData(a,()=>{i.__next_tick_pending=!1,n0(n)}),Ep()):n0(n)}}function TE(n){n.globalProperties.$nextTick=function(t){return ol(this.$,t)}}function bE(n,e,t){e.appContext.config.globalProperties.$applyOptions(n,e,t);const i=n.computed;if(i){const s=Object.keys(i);if(s.length){const r=e.ctx;r.$computedKeys||(r.$computedKeys=[]),r.$computedKeys.push(...s)}}delete e.ctx.$onApplyOptions}function Kp(n,e=!1){const{setupState:t,$templateRefs:i,$templateUniElementRefs:s,ctx:{$scope:r,$mpPlatform:o}}=n;if(o==="mp-alipay"||!r||!i&&!s)return;if(e){i&&i.forEach(u=>On(u,null,t)),s&&s.forEach(u=>On(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=IE(f,d.i);return a&&h===null?!0:(On(d,h,t),!1)})},l=()=>{if(i){const u=c(i);u.length&&n.proxy&&n.proxy.$scope&&n.proxy.$scope.setData({r1:1},()=>{c(u)})}};s&&s.length&&ol(n,()=>{s.forEach(u=>{te(u.v)?u.v.forEach(f=>{On(u,f,t)}):On(u,u.v,t)})}),r._$setRef?r._$setRef(l):ol(n,l)}function _E(n){return Ee(n)&&sc(n),n}function IE(n,e){const t=n.find(i=>i&&(i.properties||i.props).uI===e);if(t){const i=t.$vm;return i?_s(i.$)||i:_E(t)}return null}function On({r:n,f:e},t,i){if(q(n))n(t,{});else{const s=Te(n),r=et(n);if(s||r)if(e){if(!r)return;te(n.value)||(n.value=[]);const o=n.value;if(o.indexOf(t)===-1){if(o.push(t),!t)return;t.$&&hc(()=>Gr(o,t),t.$)}}else s?ie(i,n)&&(i[n]=t):et(n)?n.value=t:r0(n);else r0(n)}}function r0(n){xc("Invalid template ref type:",n,`(${typeof n})`)}const ll=vp;function o0(n,e){const t=n.component=lE(n,e.parentComponent,null);return t.renderer=e.mpType?e.mpType:"component",t.ctx.$onApplyOptions=bE,t.ctx.$children=[],e.mpType==="app"&&(t.render=He),e.onBeforeSetup&&e.onBeforeSetup(t,e),oc(n),vr(t,"mount"),vr(t,"init"),uE(t),Er(t,"init"),e.parentComponent&&t.proxy&&e.parentComponent.ctx.$children.push(_s(t)||t.proxy),RE(t),ac(),Er(t,"mount"),t.proxy}const CE=n=>{let e;for(const t in n)(t==="class"||t==="style"||Jd(t))&&((e||(e={}))[t]=n[t]);return e};function a0(n){const{type:e,vnode:t,proxy:i,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}=n;n.$uniElementIds=new Map,n.$templateRefs=[],n.$templateUniElementRefs=[],n.$templateUniElementStyles={},n.$ei=0,g(m),n.__counter=n.__counter===0?1:0;let v;const x=Vu(n);try{if(t.shapeFlag&4){l0(y,r,o,c);const E=s||i;v=u.call(E,E,f,r,h,d,p)}else{l0(y,r,o,e.props?c:CE(c));const E=e;v=E.length>1?E(r,{attrs:c,slots:a,emit:l}):E(r,null)}}catch(E){Xr(E,n,1),v=!1}return Kp(n),Vu(x),v}function l0(n,e,t,i){if(e&&i&&n!==!1){const s=Object.keys(i).filter(r=>r!=="class"&&r!=="style");if(!s.length)return;t&&s.some(Eu)?s.forEach(r=>{(!Eu(r)||!(r.slice(9)in t))&&(e[r]=i[r])}):s.forEach(r=>e[r]=i[r])}}const LE=n=>{ji(),Ep(),qi()};function DE(){const n=this.$scopedSlotsData;if(!n||n.length===0)return;const e=this.ctx.$scope,t=e.data,i=Object.create(null);n.forEach(({path:s,index:r,data:o})=>{const a=Th(t,s),c=Te(r)?`${s}.${r}`:`${s}[${r}]`;if(typeof a>"u"||typeof a[r]>"u")i[c]=o;else{const l=Gp(o,a[r]);Object.keys(l).forEach(u=>{i[c+"."+u]=l[u]})}}),n.length=0,Object.keys(i).length&&e.setData(i)}function go({effect:n,update:e},t){n.allowRecurse=e.allowRecurse=t}function RE(n){const e=DE.bind(n);n.$updateScopedSlots=()=>uc(()=>xr(e));const t=()=>{if(!n.isMounted)hc(()=>{Kp(n,!0)},n),vr(n,"patch"),s0(n,a0(n)),Er(n,"patch"),uv(n);else{const{next:r,bu:o,u:a}=n;oc(r||n.vnode),go(n,!1),LE(),o&&Zs(o),go(n,!0),vr(n,"patch"),s0(n,a0(n)),Er(n,"patch"),a&&ll(a),fv(n),ac()}},i=n.effect=new ec(t,He,()=>xr(s),n.scope),s=n.update=()=>{i.dirty&&i.run()};s.id=n.uid,go(n,!0),i.onTrack=n.rtc?r=>Zs(n.rtc,r):void 0,i.onTrigger=n.rtg?r=>Zs(n.rtg,r):void 0,s.ownerInstance=n,s()}function wE(n){const{bum:e,scope:t,update:i,um:s}=n;e&&Zs(e);{const r=n.parent;if(r){const o=r.ctx.$children,a=_s(n)||n.proxy,c=o.indexOf(a);c>-1&&o.splice(c,1)}}t.stop(),i&&(i.active=!1),s&&ll(s),ll(()=>{n.isUnmounted=!0}),hv(n)}const PE=Sv();function kE(){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 BE(n,e=null){const t=kE();t.__VUE__=!0,Sp(t.__VUE_DEVTOOLS_GLOBAL_HOOK__,t);const i=PE(n,e),s=i._context;TE(s.config);const r=c=>(c.appContext=s,c.shapeFlag=6,c),o=function(l,u){return o0(r(l),u)},a=function(l){return l&&wE(l.$)};return i.mount=function(){n.render=He;const l=o0(r({type:n}),{mpType:"app",mpInstance:null,parentComponent:null,slots:[],props:null});return i._instance=l.$,cv(i,Hp),l.$app=i,l.$createComponent=o,l.$destroyComponent=a,s.$appInstance=l,l},i.unmount=function(){xc("Cannot unmount an app.")},i}function c0(n,e,t,i){q(e)&&Wi(n,e.bind(t),i)}function FE(n,e,t){const i=n.mpType||t.$mpType;!i||i==="component"||i==="page"&&e.renderer==="component"||Object.keys(n).forEach(s=>{if(Ih(s,n[s],!1)){const r=n[s];te(r)?r.forEach(o=>c0(s,o,t,e)):c0(s,r,t,e)}})}function OE(n,e,t){FE(n,e,t)}function ME(n,e,t){return n[e]=t}function NE(n,...e){const t=this[n];return t?t(...e):(console.error(`method ${n} not found`),null)}function UE(n){const e=n.config.errorHandler;return function(i,s,r){e&&e(i,s,r);const o=n._instance;if(!o||!o.proxy)throw i;o[$i]?o.proxy.$callHook($i,i):mp(i,r,s?s.$.vnode:null,!1)}}function $E(n,e){return n?[...new Set([].concat(n,e))]:e}function HE(n){_h.forEach(e=>{n[e]=$E})}let cl;const Fs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",GE=/^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;typeof atob!="function"?cl=function(n){if(n=String(n).replace(/[\t\n\f\r ]+/g,""),!GE.test(n))throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");n+="==".slice(2-(n.length&3));for(var e,t="",i,s,r=0;r<n.length;)e=Fs.indexOf(n.charAt(r++))<<18|Fs.indexOf(n.charAt(r++))<<12|(i=Fs.indexOf(n.charAt(r++)))<<6|(s=Fs.indexOf(n.charAt(r++))),t+=i===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}:cl=atob;function KE(n){return decodeURIComponent(cl(n).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join(""))}function mo(){const n=Y.getStorageSync("uni_id_token")||"",e=n.split(".");if(!n||e.length!==3)return{uid:null,role:[],permission:[],tokenExpired:0};let t;try{t=JSON.parse(KE(e[1]))}catch(i){throw new Error("获取当前用户信息出错,详细错误信息为:"+i.message)}return t.tokenExpired=t.exp*1e3,delete t.exp,delete t.iat,t}function VE(n){n.uniIDHasRole=function(e){const{role:t}=mo();return t.indexOf(e)>-1},n.uniIDHasPermission=function(e){const{permission:t}=mo();return this.uniIDHasRole("admin")||t.indexOf(e)>-1},n.uniIDTokenValid=function(){const{tokenExpired:e}=mo();return e>Date.now()}}function jE(n){const e=n.config;e.errorHandler=bx(n,UE),HE(e.optionMergeStrategies);const t=e.globalProperties;VE(t),t.$set=ME,t.$applyOptions=OE,t.$callMethod=NE,Y.invokeCreateVueAppHook(n)}const ss=Object.create(null);function qE(n){const{uid:e,__counter:t}=Zr(),i=(ss[e]||(ss[e]=[])).push(rE(n))-1;return e+","+i+","+t}function Vp(n){delete ss[n]}function yc(n){if(!n)return;const[e,t]=n.split(",");if(ss[e])return ss[e][parseInt(t)]}var WE={install(n){jE(n),n.config.globalProperties.pruneComponentPropsCache=Vp;const e=n.mount;n.mount=function(i){const s=e.call(n,i),r=zE();return r?r(s):typeof createMiniProgramApp<"u"&&createMiniProgramApp(s),s}}};function zE(){const n="createApp";if(typeof global<"u"&&typeof global[n]<"u")return global[n];if(typeof my<"u")return my[n]}function QE(n){return Te(n)?n:YE(ih(n))}function YE(n){let e="";if(!n||Te(n))return e;for(const t in n)e+=`${t.startsWith("--")?t:Ni(t)}:${n[t]};`;return e}function XE(n,e){const t=Zr(),i=t.ctx,s=typeof e<"u"&&(i.$mpPlatform==="mp-weixin"||i.$mpPlatform==="mp-qq"||i.$mpPlatform==="mp-xhs")&&(Te(e)||typeof e=="number")?"_"+e:"",r="e"+t.$ei+++s,o=i.$scope;if(!n)return delete o[r],r;const a=o[r];return a?a.value=n:o[r]=JE(n,t),r}function JE(n,e){const t=i=>{e3(i);let s=[i];e&&e.ctx.$getTriggerEventDetail&&typeof i.detail=="number"&&(i.detail=e.ctx.$getTriggerEventDetail(i.detail)),i.detail&&i.detail.__args__&&(s=i.detail.__args__);const r=t.value,o=()=>vi(t3(i,r),e,5,s),a=i.target,c=a&&a.dataset?String(a.dataset.eventsync)==="true":!1;if(ZE.includes(i.type)&&!c)setTimeout(o);else{const l=o();return i.type==="input"&&(te(l)||Ss(l))?void 0:l}};return t.value=n,t}const ZE=["tap","longpress","longtap","transitionend","animationstart","animationiteration","animationend","touchforcechange"];function e3(n,e){n.type&&n.target&&(n.preventDefault=He,n.stopPropagation=He,n.stopImmediatePropagation=He,ie(n,"detail")||(n.detail={}),ie(n,"markerId")&&(n.detail=typeof n.detail=="object"?n.detail:{},n.detail.markerId=n.markerId),Ge(n.detail)&&ie(n.detail,"checked")&&!ie(n.detail,"value")&&(n.detail.value=n.detail.checked),Ge(n.detail)&&(n.target=xe({},n.target,n.detail)))}function t3(n,e){if(te(e)){const t=n.stopImmediatePropagation;return n.stopImmediatePropagation=()=>{t&&t.call(n),n._stopped=!0},e.map(i=>s=>!s._stopped&&i(s))}else return e}function i3(n,e){let t;if(te(n)||Te(n)){t=new Array(n.length);for(let i=0,s=n.length;i<s;i++)t[i]=e(n[i],i,i)}else if(typeof n=="number"){if(!Number.isInteger(n))return xc(`The v-for range expect an integer value but got ${n}.`),[];t=new Array(n);for(let i=0;i<n;i++)t[i]=e(i+1,i,i)}else if(Ee(n))if(n[Symbol.iterator])t=Array.from(n,(i,s)=>e(i,s,s));else{const i=Object.keys(n);t=new Array(i.length);for(let s=0,r=i.length;s<r;s++){const o=i[s];t[s]=e(n[o],o,s)}}else t=[];return t}function n3(n,e,t={}){const{$templateRefs:i}=Zr();i.push({i:e,r:n,k:t.k,f:t.f})}const s3=(n,e)=>XE(n,e),r3=(n,e)=>i3(n,e),o3=n=>QE(n),a3=(n,...e)=>xe(n,...e),l3=n=>nh(n),c3=n=>ax(n),u3=n=>qE(n),f3=(n,e,t)=>n3(n,e,t);function d3(n,e=null){return n&&(n.mpType="app"),BE(n,e).use(WE)}const h3=d3;function p3(n,e){if(!n)return;const t=n.split(","),i=t.length;i===1?e._$vueId=t[0]:i===2&&(e._$vueId=t[0],e._$vuePid=t[1])}const g3=["externalClasses"];function m3(n,e){g3.forEach(t=>{ie(e,t)&&(n[t]=e[t])})}const x3=/_(.*)_worklet_factory_/;function y3(n,e){e&&Object.keys(e).forEach(t=>{const i=t.match(x3);if(i){const s=i[1];n[t]=e[t],n[s]=e[s]}})}function v3(n,e){te(e)&&e.forEach(t=>{n[t]=function(i){return this.$vm[t](i)}})}function E3(n,e,t){n.selectAllComponents(e).forEach(s=>{const r=s.properties.uR;t[r]=s.$vm||s})}function A3(n,e){Object.defineProperty(n,"refs",{get(){const t={};return E3(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 jp(n,e){const t=n.$children;for(let s=t.length-1;s>=0;s--){const r=t[s];if(r.$scope._$vueId===e)return r}let i;for(let s=t.length-1;s>=0;s--)if(i=jp(t[s],e),i)return i}function S3(){var n;let e="";{const t=((n=wx.getAppBaseInfo)===null||n===void 0?void 0:n.call(wx))||wx.getSystemInfoSync(),i=t&&t.language?t.language:Zn;e=Dh(i)||Zn}return e}const T3=["createSelectorQuery","createIntersectionObserver","selectAllComponents","selectComponent"];function b3(n,e){return function(i,...s){const r=e.$scope;if(r&&i){const o={__args__:s};r.triggerEvent(i,o)}return n.apply(this,[i,...s])}}function qp(n,e){const t=n.ctx;t.mpType=e.mpType,t.$mpType=e.mpType,t.$mpPlatform="mp-weixin",t.$scope=e.mpInstance,Object.defineProperties(t,{[Oa]:{get(){const i=this.$scope.data[Oa];return i===void 0?"":i}}}),t.$mp={},t._self={},n.slots={},te(e.slots)&&e.slots.length&&(e.slots.forEach(i=>{n.slots[i]=!0}),n.slots[lx]&&(n.slots.default=!0)),t.getOpenerEventChannel=function(){return e.mpInstance.getOpenerEventChannel()},t.$hasHook=C3,t.$callHook=Wp,n.emit=b3(n.emit,t)}function _3(n,e){qp(n,e);const t=n.ctx;T3.forEach(i=>{t[i]=function(...s){const r=t.$scope;if(r&&r[i])return r[i].apply(r,s)}})}function I3(n,e,t){const i=n.ctx;t.forEach(s=>{ie(e,s)&&(n[s]=i[s]=e[s])})}function C3(n){const e=this.$[n];return!!(e&&e.length)}function Wp(n,e){n==="mounted"&&(Wp.call(this,"bm"),this.$.isMounted=!0,n="m");const t=this.$[n];return t&&gx(t,e)}const L3=[Ts,jr,qr,Ql,fh,Yl,Xl,Jl,Zl];function ul(n,e=new Set){if(n){Object.keys(n).forEach(t=>{Ih(t,n[t])&&e.add(t)});{const{extends:t,mixins:i}=n;i&&i.forEach(s=>ul(s,e)),t&&ul(t,e)}}return e}function vc(n,e,t){t.indexOf(e)===-1&&!ie(n,e)&&(n[e]=function(i){return this.$vm&&this.$vm.$callHook(e,i)})}const zp=[zl];function Ec(n,e,t=zp){e.forEach(i=>vc(n,i,t))}function Qp(n,e,t=zp){ul(e).forEach(i=>vc(n,i,t))}function D3(n,e){if(!e)return;Object.keys(Ma).forEach(i=>{e&Ma[i]&&vc(n,i,[])})}const R3=Sh(()=>{const n=[],e=q(getApp)&&getApp({allowDefault:!0});if(e&&e.$vm&&e.$vm.$){const t=e.$vm.$.appContext.mixins;if(te(t)){const i=Object.keys(Ma);t.forEach(s=>{i.forEach(r=>{ie(s,r)&&!n.includes(r)&&n.push(r)})})}}return n});function w3(n){Ec(n,R3())}const P3=[jr,qr,$i,oh,ah,lh];function Ac(n,e){const t=n.$,i={globalData:n.$options&&n.$options.globalData||{},$vm:n,onLaunch(o){this.$vm=n;const a=t.ctx;this.$vm&&a.$scope&&a.$callHook||(qp(t,{mpType:"app",mpInstance:this,slots:[]}),a.globalData=this.globalData,n.$callHook(rh,o))}},s=wx.$onErrorHandlers;s&&(s.forEach(o=>{Wi($i,o,t)}),s.length=0),F3(n);const r=n.$.type;Ec(i,P3),Qp(i,r);{const o=r.methods;o&&xe(i,o)}return i}function k3(n){return function(t){return App(Ac(t))}}function B3(n){return function(t){const i=Ac(t),s=q(getApp)&&getApp({allowDefault:!0});if(!s)return;t.$.ctx.$scope=s;const r=s.globalData;r&&Object.keys(i.globalData).forEach(o=>{ie(r,o)||(r[o]=i.globalData[o])}),Object.keys(i).forEach(o=>{ie(s,o)||(s[o]=i[o])}),Yp(i,t)}}function Yp(n,e){if(q(n.onLaunch)){const t=wx.getLaunchOptionsSync&&wx.getLaunchOptionsSync();n.onLaunch(t)}q(n.onShow)&&wx.onAppShow&&wx.onAppShow(t=>{e.$callHook("onShow",t)}),q(n.onHide)&&wx.onAppHide&&wx.onAppHide(t=>{e.$callHook("onHide",t)})}function F3(n){const e=Qy(S3());Object.defineProperty(n,"$locale",{get(){return e.value},set(t){e.value=t}})}const Xp=["eO","uR","uRIF","uI","uT","uP","uS"];function O3(n,e=!1){const t={};if(!e){let i=function(s){const r=Object.create(null);s&&s.forEach(o=>{r[o]=!0}),this.setData({$slots:r})};Xp.forEach(s=>{t[s]={type:null,value:""}}),t.uS={type:null,value:[]},t.uS.observer=i}return n.behaviors&&n.behaviors.includes("wx://form-field")&&((!n.properties||!n.properties.name)&&(t.name={type:null,value:""}),(!n.properties||!n.properties.value)&&(t.value={type:null,value:""})),t}function M3(n){const e={};return n&&n.virtualHost&&(e[ux]={type:null,value:""},e[fx]={type:null,value:""},e[dx]={type:null,value:""},e[Oa]={type:null,value:""}),e}function Jp(n){n.properties||(n.properties={}),xe(n.properties,O3(n),M3(n.options))}const N3=[String,Number,Boolean,Object,Array,null];function U3(n,e){return te(n)&&n.length===1?n[0]:n}function u0(n,e){const t=U3(n);return N3.indexOf(t)!==-1?t:null}function $3({properties:n},e){te(e)?e.forEach(t=>{n[t]={type:String,value:""}}):Ge(e)&&Object.keys(e).forEach(t=>{const i=e[t];if(Ge(i)){let s=i.default;q(s)&&(s=s());const r=i.type;i.type=u0(r),n[t]={type:i.type,value:s}}else n[t]={type:u0(i)}})}function H3(n,e){return(e?G3(n):yc(n.uP))||{}}function G3(n){const e={};return Ge(n)&&Object.keys(n).forEach(t=>{Xp.indexOf(t)===-1&&(e[t]=n[t])}),e}function K3(n){const e=n.$options;te(e.behaviors)&&e.behaviors.includes("uni://form-field")&&n.$watch("modelValue",()=>{n.$scope&&n.$scope.setData({name:n.name,value:n.modelValue})},{immediate:!0})}function V3(n){return{}}function Zp(n){const e=function(){const i=this.properties.uP;i&&(this.$vm?q3(i,this.$vm.$):this.properties.uT==="m"&&j3(i,this))};n.observers||(n.observers={}),n.observers.uP=e}function j3(n,e){const t=e.properties,i=yc(n)||{};eg(t,i,!1)&&e.setData(i)}function q3(n,e){const t=fe(e.props),i=yc(n)||{};eg(t,i)&&(Wv(e,i,t,!1),rv(e.update)&&ov(e.update),e.update())}function eg(n,e,t=!0){const i=Object.keys(e);if(t&&i.length!==Object.keys(n).length)return!0;for(let s=0;s<i.length;s++){const r=i[s];if(e[r]!==n[r])return!0}return!1}function W3(n){const e=n.behaviors;let t=n.props;t||(n.props=t=[]);const i=[];return te(e)&&e.forEach(s=>{i.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:""}))}),i}function z3(n,e){n.data=V3(),n.behaviors=W3(e)}function tg(n,{parse:e,mocks:t,isPage:i,isPageInProject:s,initRelation:r,handleLink:o,initLifetimes:a}){n=n.default||n;const c={multipleSlots:!0,addGlobalClass:!0,pureDataPattern:/^uP$/};te(n.mixins)&&n.mixins.forEach(u=>{Ee(u.options)&&xe(c,u.options)}),n.options&&xe(c,n.options);const l={options:c,lifetimes:a({mocks:t,isPage:i,initRelation:r,vueOptions:n}),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 z3(l,n),Jp(l),Zp(l),m3(l,n),v3(l.methods,n.wxsCallMethods),y3(l.methods,n.methods),e&&e(l,{handleLink:o}),l}function Q3(n){return function(t){return Component(tg(t,n))}}let xo,yo;function ig(){return getApp().$vm}function Y3(n,e){xo||(xo=ig().$createComponent);const t=xo(n,e);return _s(t.$)||t}function X3(n){return yo||(yo=ig().$destroyComponent),yo(n)}function J3(n,e){const{parse:t,mocks:i,isPage:s,initRelation:r,handleLink:o,initLifetimes:a}=e,c=tg(n,{mocks:i,isPage:s,isPageInProject:!0,initRelation:r,handleLink:o,initLifetimes:a});$3(c,(n.default||n).props);const l=c.methods;return l.onLoad=function(u){return this.options=u,this.$page={fullPath:px(this.route+vx(u))},this.$vm&&this.$vm.$callHook(Ts,u)},Ec(l,L3),Qp(l,n),D3(l,n.__runtimeHooks),w3(l),t&&t(c,{handleLink:o}),c}function Z3(n){return function(t){return Component(J3(t,n))}}function e4(n){return function(t){Yp(Ac(t),t)}}const t4=Page,i4=Component;function f0(n){const e=n.triggerEvent,t=function(i,...s){return e.apply(n,[xx(i),...s])};try{n.triggerEvent=t}catch{n._triggerEvent=t}}function ng(n,e,t){const i=e[n];i?e[n]=function(...s){return f0(this),i.apply(this,s)}:e[n]=function(){f0(this)}}Page=function(n){return ng(Ts,n),t4(n)};Component=function(n){return ng("created",n),n.properties&&n.properties.uP||(Jp(n),Zp(n)),i4(n)};function n4({mocks:n,isPage:e,initRelation:t,vueOptions:i}){return{attached(){let s=this.properties;p3(s.uI,this);const r={vuePid:this._$vuePid};t(this,r);const o=this,a=e(o);let c=s;this.$vm=Y3({type:i,props:H3(c,a)},{mpType:a?"page":"component",mpInstance:o,slots:s.uS||{},parentComponent:r.parent&&r.parent.$,onBeforeSetup(l,u){A3(l,o),I3(l,o,n),_3(l,u)}}),a||K3(this.$vm)},ready(){this.$vm&&(this.$vm.$callHook("mounted"),this.$vm.$callHook(zl))},detached(){this.$vm&&(Vp(this.$vm.$.uid),X3(this.$vm))}}}const s4=["__route__","__wxExparserNodeId__","__wxWebviewId__"];function r4(n){return!!n.route}function o4(n,e){n.triggerEvent("__l",e)}function a4(n){const e=n.detail||n.value,t=e.vuePid;let i;t&&(i=jp(this.$vm,t)),i||(i=this.$vm),e.parent=i}var sg=Object.freeze({__proto__:null,handleLink:a4,initLifetimes:n4,initRelation:o4,isPage:r4,mocks:s4});const l4=k3(),c4=Z3(sg),u4=Q3(sg),f4=e4(),d4=B3();wx.createApp=global.createApp=l4,wx.createPage=c4,wx.createComponent=u4,wx.createPluginApp=global.createPluginApp=f4,wx.createSubpackageApp=global.createSubpackageApp=d4;/*!
- * vuex v4.1.0
- * (c) 2022 Evan You
- * @license MIT
- */var rg="store";function h4(n){return n===void 0&&(n=null),ir(n!==null?n:rg)}function zi(n,e){Object.keys(n).forEach(function(t){return e(n[t],t)})}function p4(n){return n!==null&&typeof n=="object"}function g4(n){return n&&typeof n.then=="function"}function It(n,e){if(!n)throw new Error("[vuex] "+e)}function m4(n,e){return function(){return n(e)}}function og(n,e,t){return e.indexOf(n)<0&&(t&&t.prepend?e.unshift(n):e.push(n)),function(){var i=e.indexOf(n);i>-1&&e.splice(i,1)}}function ag(n,e){n._actions=Object.create(null),n._mutations=Object.create(null),n._wrappedGetters=Object.create(null),n._modulesNamespaceMap=Object.create(null);var t=n.state;to(n,t,[],n._modules.root,!0),Sc(n,t,e)}function Sc(n,e,t){var i=n._state,s=n._scope;n.getters={},n._makeLocalGettersCache=Object.create(null);var r=n._wrappedGetters,o={},a={},c=Ty(!0);c.run(function(){zi(r,function(l,u){o[u]=m4(l,n),a[u]=$p(function(){return o[u]()}),Object.defineProperty(n.getters,u,{get:function(){return a[u].value},enumerable:!0})})}),n._state=Qr({data:e}),n._scope=c,n.strict&&S4(n),i&&t&&n._withCommit(function(){i.data=null}),s&&s.stop()}function to(n,e,t,i,s){var r=!t.length,o=n._modules.getNamespace(t);if(i.namespaced&&(n._modulesNamespaceMap[o]&&console.error("[vuex] duplicate namespace "+o+" for the namespaced module "+t.join("/")),n._modulesNamespaceMap[o]=i),!r&&!s){var a=Tc(e,t.slice(0,-1)),c=t[t.length-1];n._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]=i.state})}var l=i.context=x4(n,o,t);i.forEachMutation(function(u,f){var d=o+f;v4(n,d,u,l)}),i.forEachAction(function(u,f){var d=u.root?f:o+f,h=u.handler||u;E4(n,d,h,l)}),i.forEachGetter(function(u,f){var d=o+f;A4(n,d,u,l)}),i.forEachChild(function(u,f){to(n,e,t.concat(f),u,s)})}function x4(n,e,t){var i=e==="",s={dispatch:i?n.dispatch:function(r,o,a){var c=br(r,o,a),l=c.payload,u=c.options,f=c.type;if((!u||!u.root)&&(f=e+f,!n._actions[f])){console.error("[vuex] unknown local action type: "+c.type+", global type: "+f);return}return n.dispatch(f,l)},commit:i?n.commit:function(r,o,a){var c=br(r,o,a),l=c.payload,u=c.options,f=c.type;if((!u||!u.root)&&(f=e+f,!n._mutations[f])){console.error("[vuex] unknown local mutation type: "+c.type+", global type: "+f);return}n.commit(f,l,u)}};return Object.defineProperties(s,{getters:{get:i?function(){return n.getters}:function(){return y4(n,e)}},state:{get:function(){return Tc(n.state,t)}}}),s}function y4(n,e){if(!n._makeLocalGettersCache[e]){var t={},i=e.length;Object.keys(n.getters).forEach(function(s){if(s.slice(0,i)===e){var r=s.slice(i);Object.defineProperty(t,r,{get:function(){return n.getters[s]},enumerable:!0})}}),n._makeLocalGettersCache[e]=t}return n._makeLocalGettersCache[e]}function v4(n,e,t,i){var s=n._mutations[e]||(n._mutations[e]=[]);s.push(function(o){t.call(n,i.state,o)})}function E4(n,e,t,i){var s=n._actions[e]||(n._actions[e]=[]);s.push(function(o){var a=t.call(n,{dispatch:i.dispatch,commit:i.commit,getters:i.getters,state:i.state,rootGetters:n.getters,rootState:n.state},o);return g4(a)||(a=Promise.resolve(a)),n._devtoolHook?a.catch(function(c){throw n._devtoolHook.emit("vuex:error",c),c}):a})}function A4(n,e,t,i){if(n._wrappedGetters[e]){console.error("[vuex] duplicate getter key: "+e);return}n._wrappedGetters[e]=function(r){return t(i.state,i.getters,r.state,r.getters)}}function S4(n){qn(function(){return n._state.data},function(){It(n._committing,"do not mutate vuex store state outside mutation handlers.")},{deep:!0,flush:"sync"})}function Tc(n,e){return e.reduce(function(t,i){return t[i]},n)}function br(n,e,t){return p4(n)&&n.type&&(t=e,e=n,n=n.type),It(typeof n=="string","expects string as the type, but found "+typeof n+"."),{type:n,payload:e,options:t}}var Ct=function(e,t){this.runtime=t,this._children=Object.create(null),this._rawModule=e;var i=e.state;this.state=(typeof i=="function"?i():i)||{}},lg={namespaced:{configurable:!0}};lg.namespaced.get=function(){return!!this._rawModule.namespaced};Ct.prototype.addChild=function(e,t){this._children[e]=t};Ct.prototype.removeChild=function(e){delete this._children[e]};Ct.prototype.getChild=function(e){return this._children[e]};Ct.prototype.hasChild=function(e){return e in this._children};Ct.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)};Ct.prototype.forEachChild=function(e){zi(this._children,e)};Ct.prototype.forEachGetter=function(e){this._rawModule.getters&&zi(this._rawModule.getters,e)};Ct.prototype.forEachAction=function(e){this._rawModule.actions&&zi(this._rawModule.actions,e)};Ct.prototype.forEachMutation=function(e){this._rawModule.mutations&&zi(this._rawModule.mutations,e)};Object.defineProperties(Ct.prototype,lg);var Qi=function(e){this.register([],e,!1)};Qi.prototype.get=function(e){return e.reduce(function(t,i){return t.getChild(i)},this.root)};Qi.prototype.getNamespace=function(e){var t=this.root;return e.reduce(function(i,s){return t=t.getChild(s),i+(t.namespaced?s+"/":"")},"")};Qi.prototype.update=function(e){cg([],this.root,e)};Qi.prototype.register=function(e,t,i){var s=this;i===void 0&&(i=!0),ug(e,t);var r=new Ct(t,i);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&&zi(t.modules,function(a,c){s.register(e.concat(c),a,i)})};Qi.prototype.unregister=function(e){var t=this.get(e.slice(0,-1)),i=e[e.length-1],s=t.getChild(i);if(!s){console.warn("[vuex] trying to unregister module '"+i+"', which is not registered");return}s.runtime&&t.removeChild(i)};Qi.prototype.isRegistered=function(e){var t=this.get(e.slice(0,-1)),i=e[e.length-1];return t?t.hasChild(i):!1};function cg(n,e,t){if(ug(n,t),e.update(t),t.modules)for(var i in t.modules){if(!e.getChild(i)){console.warn("[vuex] trying to add a new module '"+i+"' on hot reloading, manual reload is needed");return}cg(n.concat(i),e.getChild(i),t.modules[i])}}var d0={assert:function(n){return typeof n=="function"},expected:"function"},T4={assert:function(n){return typeof n=="function"||typeof n=="object"&&typeof n.handler=="function"},expected:'function or object with "handler" function'},h0={getters:d0,mutations:d0,actions:T4};function ug(n,e){Object.keys(h0).forEach(function(t){if(e[t]){var i=h0[t];zi(e[t],function(s,r){It(i.assert(s),b4(n,t,r,s,i.expected))})}})}function b4(n,e,t,i,s){var r=e+" should be "+s+' but "'+e+"."+t+'"';return n.length>0&&(r+=' in module "'+n.join(".")+'"'),r+=" is "+JSON.stringify(i)+".",r}function _4(n){return new ot(n)}var ot=function n(e){var t=this;e===void 0&&(e={}),It(typeof Promise<"u","vuex requires a Promise polyfill in this browser."),It(this instanceof n,"store must be called with the new operator.");var i=e.plugins;i===void 0&&(i=[]);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 Qi(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;to(this,u,[],this._modules.root),Sc(this,u),i.forEach(function(f){return f(t)})},bc={state:{configurable:!0}};ot.prototype.install=function(e,t){e.provide(t||rg,this),e.config.globalProperties.$store=this,this._devtools!==void 0&&this._devtools};bc.state.get=function(){return this._state.data};bc.state.set=function(n){It(!1,"use store.replaceState() to explicit replace store state.")};ot.prototype.commit=function(e,t,i){var s=this,r=br(e,t,i),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")};ot.prototype.dispatch=function(e,t){var i=this,s=br(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,i.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{i._actionSubscribers.filter(function(h){return h.after}).forEach(function(h){return h.after(a,i.state)})}catch(h){console.warn("[vuex] error in after action subscribers: "),console.error(h)}u(d)},function(d){try{i._actionSubscribers.filter(function(h){return h.error}).forEach(function(h){return h.error(a,i.state,d)})}catch(h){console.warn("[vuex] error in error action subscribers: "),console.error(h)}f(d)})})};ot.prototype.subscribe=function(e,t){return og(e,this._subscribers,t)};ot.prototype.subscribeAction=function(e,t){var i=typeof e=="function"?{before:e}:e;return og(i,this._actionSubscribers,t)};ot.prototype.watch=function(e,t,i){var s=this;return It(typeof e=="function","store.watch only accepts a function."),qn(function(){return e(s.state,s.getters)},t,Object.assign({},i))};ot.prototype.replaceState=function(e){var t=this;this._withCommit(function(){t._state.data=e})};ot.prototype.registerModule=function(e,t,i){i===void 0&&(i={}),typeof e=="string"&&(e=[e]),It(Array.isArray(e),"module path must be a string or an Array."),It(e.length>0,"cannot register the root module by using registerModule."),this._modules.register(e,t),to(this,this.state,e,this._modules.get(e),i.preserveState),Sc(this,this.state)};ot.prototype.unregisterModule=function(e){var t=this;typeof e=="string"&&(e=[e]),It(Array.isArray(e),"module path must be a string or an Array."),this._modules.unregister(e),this._withCommit(function(){var i=Tc(t.state,e.slice(0,-1));delete i[e[e.length-1]]}),ag(this)};ot.prototype.hasModule=function(e){return typeof e=="string"&&(e=[e]),It(Array.isArray(e),"module path must be a string or an Array."),this._modules.isRegistered(e)};ot.prototype.hotUpdate=function(e){this._modules.update(e),ag(this,!0)};ot.prototype._withCommit=function(e){var t=this._committing;this._committing=!0,e(),this._committing=t};Object.defineProperties(ot.prototype,bc);const fg=n=>n;function I4(n){return/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/.test(n)}function C4(n){return/^1[23456789]\d{9}$/.test(n)}function L4(n){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(n)}function D4(n){if(!n)return!1;if(typeof n=="number")return n.toString().length!==10&&n.toString().length!==13?!1:!isNaN(new Date(n).getTime());if(typeof n=="string"){const e=Number(n);if(!isNaN(e)&&(e.toString().length===10||e.toString().length===13))return!isNaN(new Date(e).getTime());if(n.length<10||n.length>19||!/^\d{4}[-\/]\d{2}[-\/]\d{2}( \d{1,2}:\d{2}(:\d{2})?)?$/.test(n))return!1;const i=new Date(n);return!isNaN(i.getTime())}return!1}function R4(n){return/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(n)}function _r(n){return/^[\+-]?(\d+\.?\d*|\.\d+|\d\.\d+e\+\d+)$/.test(n)}function w4(n){return typeof n=="string"}function P4(n){return/^\d+$/.test(n)}function k4(n){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(n)}function B4(n){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 n.length===7?t.test(n):n.length===8?e.test(n):!1}function F4(n){return/^[1-9]\d*(,\d{3})*(\.\d{1,2})?$|^0\.\d{1,2}$/.test(n)}function O4(n){return/^[\u4e00-\u9fa5]+$/gi.test(n)}function M4(n){return/^[a-zA-Z]*$/.test(n)}function N4(n){return/^[0-9a-zA-Z]*$/g.test(n)}function U4(n,e){return n.indexOf(e)>=0}function $4(n,e){return n>=e[0]&&n<=e[1]}function H4(n,e){return n.length>=e[0]&&n.length<=e[1]}function G4(n){return/^\d{3,4}-\d{7,8}(-\d{3,4})?$/.test(n)}function fl(n){switch(typeof n){case"undefined":return!0;case"string":if(n.replace(/(^[ \t\n\r]*)|([ \t\n\r]*$)/g,"").length==0)return!0;break;case"boolean":if(!n)return!0;break;case"number":if(n===0||isNaN(n))return!0;break;case"object":if(n===null||n.length===0)return!0;for(const e in n)return!1;return!0}return!1}function K4(n){if(typeof n=="string")try{const e=JSON.parse(n);return!!(typeof e=="object"&&e)}catch{return!1}return!1}function dg(n){return typeof Array.isArray=="function"?Array.isArray(n):Object.prototype.toString.call(n)==="[object Array]"}function V4(n){return Object.prototype.toString.call(n)==="[object Object]"}function j4(n){return Object.prototype.toString.call(n)==="[object Promise]"}function q4(n,e=6){return new RegExp(`^\\d{${e}}$`).test(n)}function dl(n){return typeof n=="function"}function W4(n){return j4(n)&&dl(n.then)&&dl(n.catch)}function z4(n){const e=n.split("?")[0];return/\.(jpeg|jpg|gif|png|svg|webp|jfif|bmp|dpg)/i.test(e)}function Q4(n){return/\.(mp4|mpg|mpeg|dat|asf|avi|rm|rmvb|mov|wmv|flv|mkv|m3u8)/i.test(n)}function Y4(n){return n&&Object.prototype.toString.call(n)==="[object RegExp]"}const hg={email:I4,mobile:C4,url:L4,date:D4,dateISO:R4,number:_r,digits:P4,idCard:k4,carNo:B4,amount:F4,chinese:O4,letter:M4,enOrNum:N4,contains:U4,range:$4,rangeLength:H4,empty:fl,isEmpty:fl,jsonString:K4,landline:G4,object:V4,array:dg,code:q4,func:dl,promise:W4,video:Q4,image:z4,regExp:Y4,string:w4};function pg(n,e=15){return+parseFloat(Number(n).toPrecision(e))}function rs(n){const e=n.toString().split(/[eE]/),t=(e[0].split(".")[1]||"").length-+(e[1]||0);return t>0?t:0}function Ir(n){if(n.toString().indexOf("e")===-1)return Number(n.toString().replace(".",""));const e=rs(n);return e>0?pg(Number(n)*Math.pow(10,e)):Number(n)}function hl(n){(n>Number.MAX_SAFE_INTEGER||n<Number.MIN_SAFE_INTEGER)&&console.warn(`${n} 超出了精度限制,结果可能不正确`)}function gg(n,e){const[t,i,...s]=n;let r=e(t,i);return s.forEach(o=>{r=e(r,o)}),r}function Cr(...n){if(n.length>2)return gg(n,Cr);const[e,t]=n,i=Ir(e),s=Ir(t),r=rs(e)+rs(t),o=i*s;return hl(o),o/Math.pow(10,r)}function mg(...n){if(n.length>2)return gg(n,mg);const[e,t]=n,i=Ir(e),s=Ir(t);return hl(i),hl(s),Cr(i/s,pg(Math.pow(10,rs(t)-rs(e))))}function X4(n,e){const t=Math.pow(10,e);let i=mg(Math.round(Math.abs(Cr(n,t))),t);return n<0&&i!==0&&(i=Cr(i,-1)),i}const pl="3";console.log(`
- %c uview-plus V${pl} %c https://ijry.github.io/uview-plus/
- `,"color: #ffffff; background: #3c9cff; padding:5px 0;","color: #3c9cff;background: #ffffff; padding:5px 0;");const Yi={v:pl,version:pl,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 J4(n=0,e=0,t=0){return Math.max(n,Math.min(e,Number(t)))}function Z4(n,e=!1){return _r(n)?e?`${n}px`:Number(n):/(rpx|upx)$/.test(n)?e?`${Y.upx2px(parseInt(n))}px`:Number(Y.upx2px(parseInt(n))):e?`${parseInt(n)}px`:parseInt(n)}function eA(n=30){return new Promise(e=>{setTimeout(()=>{e()},n)})}function tA(){return Y.getDeviceInfo().platform.toLowerCase()}function xg(){return Y.getSystemInfoSync()}function iA(){let n={};return n=xg(),n}function nA(n,e){if(n>=0&&e>0&&e>=n){const t=e-n+1;return Math.floor(Math.random()*t+n)}return 0}function sA(n=32,e=!0,t=null){const i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),s=[];if(t=t||i.length,n)for(let r=0;r<n;r++)s[r]=i[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]=i[o==19?r&3|8:r])}return e?(s.shift(),`u${s.join("")}`):s.join("")}function Lr(n=void 0){let e=this.$parent;for(;e;)if(n=n.replace(/up-([a-zA-Z0-9-_]+)/g,"u-$1"),e.$options&&e.$options.name!==n)e=e.$parent;else return e;return!1}function rA(n,e="object"){if(fl(n)||typeof n=="object"&&e==="object"||e==="string"&&typeof n=="string")return n;if(e==="object"){n=Gn(n);const i=n.split(";"),s={};for(let r=0;r<i.length;r++)if(i[r]){const o=i[r].split(":");s[Gn(o[0])]=Gn(o[1])}return s}let t="";return typeof n=="object"&&n.forEach((i,s)=>{const r=s.replace(/([A-Z])/g,"-$1").toLowerCase();t+=`${r}:${i};`}),Gn(t)}function oA(n="auto",e=""){return e||(e=Yi.unit||"px"),e=="rpx"&&_r(String(n))&&(n=n*2),n=String(n),_r(n)?`${n}${e}`:n}function _c(n){if([null,void 0,NaN,!1].includes(n)||typeof n!="object"&&typeof n!="function")return n;const e=dg(n)?[]:{};for(const t in n)n.hasOwnProperty(t)&&(e[t]=typeof n[t]=="object"?_c(n[t]):n[t]);return e}function os(n={},e={}){let t=_c(n);if(typeof t!="object"||typeof e!="object")return!1;for(const i in e)e.hasOwnProperty(i)&&(i in t?e[i]==null||typeof t[i]!="object"||typeof e[i]!="object"?t[i]=e[i]:t[i].concat&&e[i].concat?t[i]=t[i].concat(e[i]):t[i]=os(t[i],e[i]):t[i]=e[i]);return t}function un(n,e={}){if(typeof n!="object"||typeof e!="object")return!1;for(const t in e)e.hasOwnProperty(t)&&(t in n?e[t]==null||typeof n[t]!="object"||typeof e[t]!="object"?n[t]=e[t]:n[t].concat&&e[t].concat?n[t]=n[t].concat(e[t]):n[t]=un(n[t],e[t]):n[t]=e[t]);return n}function aA(n){console.error(`uView提示:${n}`)}function lA(n=[]){return n.sort(()=>Math.random()-.5)}String.prototype.padStart||(String.prototype.padStart=function(n,e=" "){if(Object.prototype.toString.call(e)!=="[object String]")throw new TypeError("fillString must be String");const t=this;if(t.length>=n)return String(t);const i=n-t.length;let s=Math.ceil(i/e.length);for(;s>>=1;)e+=e,s===1&&(e+=e);return e.slice(0,i)+t});function yg(n=null,e="yyyy-mm-dd"){let t;n?/^\d{10}$/.test(n.toString().trim())?t=new Date(n*1e3):typeof n=="string"&&/^\d+$/.test(n.trim())?t=new Date(Number(n)):typeof n=="string"&&/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(n)?t=new Date(n):t=new Date(typeof n=="string"?n.replace(/-/g,"/"):n):t=new Date;const i={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 i){const[r]=new RegExp(`${s}+`).exec(e)||[];if(r){const o=s==="y"&&r.length===2?2:0;e=e.replace(r,i[s].slice(o))}}return e}function cA(n=null,e="yyyy-mm-dd"){n==null&&(n=Number(new Date)),n=parseInt(n),n.toString().length==10&&(n*=1e3);let t=new Date().getTime()-n;t=parseInt(t/1e3);let i="";switch(!0){case t<300:i="刚刚";break;case(t>=300&&t<3600):i=`${parseInt(t/60)}分钟前`;break;case(t>=3600&&t<86400):i=`${parseInt(t/3600)}小时前`;break;case(t>=86400&&t<2592e3):i=`${parseInt(t/86400)}天前`;break;default:e===!1?t>=2592e3&&t<365*86400?i=`${parseInt(t/(86400*30))}个月前`:i=`${parseInt(t/(86400*365))}年前`:i=yg(n,e)}return i}function Gn(n,e="both"){return n=String(n),e=="both"?n.replace(/^\s+|\s+$/g,""):e=="left"?n.replace(/^\s*/,""):e=="right"?n.replace(/(\s*$)/g,""):e=="all"?n.replace(/\s+/g,""):n}function gl(n={},e=!0,t="brackets"){const i=e?"?":"",s=[];["indices","brackets","repeat","comma"].indexOf(t)==-1&&(t="brackets");for(const r in n){const o=n[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?i+s.join("&"):""}function uA(n,e=2e3){Y.showToast({title:String(n),icon:"none",duration:e})}function fA(n="success",e=!1){["primary","info","error","warning","success"].indexOf(n)==-1&&(n="success");let t="";switch(n){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 dA(n,e=0,t=".",i=","){n=`${n}`.replace(/[^0-9+-Ee.]/g,"");const s=isFinite(+n)?+n:0,r=isFinite(+e)?Math.abs(e):0,o=typeof i>"u"?",":i,a=typeof t>"u"?".":t;let c="";c=(r?X4(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 hA(n,e=!0){const t=parseInt(n);return e?/s$/.test(n)?n:n>30?`${n}ms`:`${n}s`:/ms$/.test(n)?t:/s$/.test(n)?t>30?t:t*1e3:t}function pA(n){return`00${n}`.slice(-2)}function gA(n,e){const t=Lr.call(n,"u-form-item"),i=Lr.call(n,"u-form");t&&i&&i.validateField(t.prop,()=>{},e)}function mA(n,e){if(typeof n!="object"||n==null||typeof e!="string"||e==="")return"";if(e.indexOf(".")!==-1){const t=e.split(".");let i=n[t[0]]||{};for(let s=1;s<t.length;s++)i&&(i=i[t[s]]);return i}return n[e]}function xA(n,e,t){if(typeof n!="object"||n==null)return;const i=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(),i(s[a],r,o)}};if(!(typeof e!="string"||e===""))if(e.indexOf(".")!==-1){const s=e.split(".");i(n,s,t)}else n[e]=t}function vg(){const n=getCurrentPages();return`/${n[n.length-1].route||""}`}function yA(){return getCurrentPages()}function vA(n,e){return e.split(".").reduce((i,s)=>i&&i[s]!==void 0?i[s]:void 0,n)}function EA(n,e=95){const t=AA(n),i=SA(t.r,t.g,t.b),s={h:i.h,s:i.s,l:Math.min(e,95)};return TA(s.h,s.s,s.l)}function AA(n){const e=n.toLowerCase().trim();if(e.startsWith("#")){const i=e.replace("#",""),s=i.length===3?i.split("").map(r=>r+r).join(""):i;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 SA(n,e,t){n/=255,e/=255,t/=255;const i=Math.max(n,e,t),s=Math.min(n,e,t);let r,o,a=(i+s)/2;if(i===s)r=o=0;else{const c=i-s;switch(o=a>.5?c/(2-i-s):c/(i+s),i){case n:r=(e-t)/c+(e<t?6:0);break;case e:r=(t-n)/c+2;break;case t:r=(n-e)/c+4;break}r=(r*60).toFixed(1)}return{h:+r,s:+(o*100).toFixed(1),l:+(a*100).toFixed(1)}}function TA(n,e,t){t/=100;const i=e*Math.min(t,1-t)/100,s=r=>{const o=(r+n/30)%12,a=t-i*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 Ri={range:J4,getPx:Z4,sleep:eA,os:tA,sys:xg,getWindowInfo:iA,random:nA,guid:sA,$parent:Lr,addStyle:rA,addUnit:oA,deepClone:_c,deepMerge:os,shallowMerge:un,error:aA,randomArray:lA,timeFormat:yg,timeFrom:cA,trim:Gn,queryParams:gl,toast:uA,type2icon:fA,priceFormat:dA,getDuration:hA,padZero:pA,formValidate:gA,getProperty:mA,setProperty:xA,page:vg,pages:yA,getValueByPath:vA,genLightColor:EA};class bA{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 i="";return/.*\/.*\?.*=.*/.test(e)?(i=gl(t,!1),e+=`&${i}`):(i=gl(t),e+=i)}async route(e={},t={}){let i={};typeof e=="string"?(i.url=this.mixinParam(e,t),i.type="navigateTo"):(i=os(this.config,e),i.url=this.mixinParam(e.url,e.params)),i.url!==vg()&&(t.intercept&&(this.config.intercept=t.intercept),i.params=t,i=os(this.config,i),typeof Y.$u.routeIntercept=="function"?await new Promise((r,o)=>{Y.$u.routeIntercept(i,r)})&&this.openPage(i):this.openPage(i))}openPage(e){const{url:t,type:i,delta:s,animationType:r,animationDuration:o}=e;(e.type=="navigateTo"||e.type=="to")&&Y.navigateTo({url:t,animationType:r,animationDuration:o}),(e.type=="redirectTo"||e.type=="redirect")&&Y.redirectTo({url:t}),(e.type=="switchTab"||e.type=="tab")&&Y.switchTab({url:t}),(e.type=="reLaunch"||e.type=="launch")&&Y.reLaunch({url:t}),(e.type=="navigateBack"||e.type=="back")&&Y.navigateBack({delta:s})}}const ml=new bA().route,Eg=fg({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 os(Y.$u,{props:void 0,http:void 0,mixin:void 0})},bem(){return function(n,e,t){const i=`u-${n}--`,s={};return e&&e.map(r=>{s[i+this[r]]=!0}),t&&t.map(r=>{this[r]?s[i+r]=this[r]:delete s[i+r]}),Object.keys(s)}}},methods:{openPage(n="url"){const e=this[n];e&&ml({type:this.linkType,url:e})},navTo(n="",e="navigateTo"){ml({type:this.linkType,url:n})},$uGetRect(n,e){return new Promise(t=>{Y.createSelectorQuery().in(this)[e?"selectAll":"select"](n).boundingClientRect(i=>{e&&Array.isArray(i)&&i.length&&t(i),!e&&i&&t(i)}).exec()})},getParentData(n=""){this.parent||(this.parent={}),this.parent=Lr.call(this,n),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(n){n&&typeof n.stopPropagation=="function"&&n.stopPropagation()},noop(n){this.preventEvent(n)}},onReachBottom(){Y.$emit("uOnReachBottom")},beforeUnmount(){if(this.parent&&hg.array(this.parent.children)){const n=this.parent.children;n.map((e,t)=>{e===this&&n.splice(t,1)})}}}),_A=fg({options:{virtualHost:!0}});function IA(n="rgb(0, 0, 0)",e="rgb(255, 255, 255)",t=10){const i=xl(n,!1),s=i[0],r=i[1],o=i[2],a=xl(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=zn(`rgb(${Math.round(f*m+s)},${Math.round(d*m+r)},${Math.round(h*m+o)})`);m===0&&(g=zn(n)),m===t-1&&(g=zn(e)),p.push(g)}return p}function xl(n,e=!0){const t=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;if(n=String(n).toLowerCase(),n&&t.test(n)){if(n.length===4){let s="#";for(let r=1;r<4;r+=1)s+=n.slice(r,r+1).concat(n.slice(r,r+1));n=s}const i=[];for(let s=1;s<7;s+=2)i.push(parseInt(`0x${n.slice(s,s+2)}`));return e?`rgb(${i[0]},${i[1]},${i[2]})`:i}return/^(rgb|RGB)/.test(n)?n.replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",").map(s=>Number(s)):n}function zn(n){const e=n,t=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;if(/^(rgb|RGB)/.test(e)){const i=e.replace(/(?:\(|\)|rgb|RGB)*/g,"").split(",");let s="#";for(let r=0;r<i.length;r++){let o=Number(i[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 i=e.replace(/#/,"").split("");if(i.length===6)return e;if(i.length===3){let s="#";for(let r=0;r<i.length;r+=1)s+=i[r]+i[r];return s}}else return e}function CA(n,e){n=zn(n);const t=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;let i=String(n).toLowerCase();if(i&&t.test(i)){if(i.length===4){let r="#";for(let o=1;o<4;o+=1)r+=i.slice(o,o+1).concat(i.slice(o,o+1));i=r}const s=[];for(let r=1;r<7;r+=2)s.push(parseInt(`0x${i.slice(r,r+2)}`));return`rgba(${s.join(",")},${e})`}return i}const Os={colorGradient:IA,hexToRgb:xl,rgbToHex:zn,colorToRgba:CA};let en=null;function LA(n,e=500,t=!1){if(en!==null&&clearTimeout(en),t){const i=!en;en=setTimeout(()=>{en=null},e),i&&typeof n=="function"&&n()}else en=setTimeout(()=>{typeof n=="function"&&n()},e)}let tn;function DA(n,e=500,t=!0){t?tn||(tn=!0,typeof n=="function"&&n(),setTimeout(()=>{tn=!1},e)):tn||(tn=!0,setTimeout(()=>{tn=!1,typeof n=="function"&&n()},e))}function RA(n,e){var t,i,s;try{t=n.toString().split(".")[1].length}catch{t=0}try{i=e.toString().split(".")[1].length}catch{i=0}return s=Math.pow(10,Math.max(t,i)),(n*s+e*s)/s}function wA(n,e){var t,i,s,r;try{t=n.toString().split(".")[1].length}catch{t=0}try{i=e.toString().split(".")[1].length}catch{i=0}return s=Math.pow(10,Math.max(t,i)),r=t>=i?t:i,Math.abs(((n*s-e*s)/s).toFixed(r))}function PA(n,e){var t=0,i=n.toString(),s=e.toString();try{t+=i.split(".")[1].length}catch{}try{t+=s.split(".")[1].length}catch{}return Number(i.replace(".",""))*Number(s.replace(".",""))/Math.pow(10,t)}function kA(n,e){var t,i,s=0,r=0;try{s=n.toString().split(".")[1].length}catch{}try{r=e.toString().split(".")[1].length}catch{}return t=Number(n.toString().replace(".","")),i=Number(e.toString().replace(".","")),xyutil.mul(t/i,Math.pow(10,r-s))}const BA={add:RA,sub:wA,mul:PA,div:kA},Ic={toast:10090,noNetwork:10080,popup:10075,mask:10070,navbar:980,topTips:975,sticky:970,indexListSticky:965},io={primary:"#3c9cff",info:"#909399",default:"#909399",warning:"#f9ae3d",error:"#f56c6c",success:"#5ac725",mainColor:"#303133",contentColor:"#606266",tipsColor:"#909399",lightColor:"#c0c4cc",borderColor:"#e4e7ed"},{toString:Ag}=Object.prototype;function Sg(n){return Ag.call(n)==="[object Array]"}function FA(n){return n!==null&&typeof n=="object"}function OA(n){return Ag.call(n)==="[object Date]"}function MA(n){return typeof URLSearchParams<"u"&&n instanceof URLSearchParams}function yl(n,e){if(!(n===null||typeof n>"u"))if(typeof n!="object"&&(n=[n]),Sg(n))for(let t=0,i=n.length;t<i;t++)e.call(null,n[t],t,n);else for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&e.call(null,n[t],t,n)}function NA(n){return Object.prototype.toString.call(n)==="[object Object]"}function vl(){const n={};function e(t,i){typeof n[i]=="object"&&typeof t=="object"?n[i]=vl(n[i],t):typeof t=="object"?n[i]=vl({},t):n[i]=t}for(let t=0,i=arguments.length;t<i;t++)yl(arguments[t],e);return n}function Dr(n){return typeof n>"u"}function p0(n){return encodeURIComponent(n).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function UA(n,e){if(!e)return n;let t;if(MA(e))t=e.toString();else{const i=[];yl(e,(s,r)=>{s===null||typeof s>"u"||(Sg(s)?r=`${r}[]`:s=[s],yl(s,o=>{OA(o)?o=o.toISOString():FA(o)&&(o=JSON.stringify(o)),i.push(`${p0(r)}=${p0(o)}`)}))}),t=i.join("&")}if(t){const i=n.indexOf("#");i!==-1&&(n=n.slice(0,i)),n+=(n.indexOf("?")===-1?"?":"&")+t}return n}function $A(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function HA(n,e){return e?`${n.replace(/\/+$/,"")}/${e.replace(/^\/+/,"")}`:n}function GA(n,e){return n&&!$A(e)?HA(n,e):e}function KA(n,e,t){const{validateStatus:i}=t.config,s=t.statusCode;s&&(!i||i(s))?n(t):e(t)}const g0=(n,e)=>{const t={};return n.forEach(i=>{Dr(e[i])||(t[i]=e[i])}),t},VA=n=>new Promise((e,t)=>{const i=UA(GA(n.baseURL,n.url),n.params),s={url:i,header:n.header,complete:o=>{n.fullPath=i,o.config=n;try{typeof o.data=="string"&&(o.data=JSON.parse(o.data))}catch{}KA(e,t,o)}};let r;if(n.method==="UPLOAD"){delete s.header["content-type"],delete s.header["Content-Type"];const o={filePath:n.filePath,name:n.name},a=["formData"];r=Y.uploadFile({...s,...o,...g0(a,n)})}else if(n.method==="DOWNLOAD")r=Y.downloadFile(s);else{const o=["data","method","timeout","dataType","responseType"];r=Y.request({...s,...g0(o,n)})}n.getTask&&n.getTask(r,n)}),jA=n=>VA(n);function as(){this.handlers=[]}as.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1};as.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)};as.prototype.forEach=function(e){this.handlers.forEach(t=>{t!==null&&e(t)})};const m0=(n,e,t)=>{const i={};return n.forEach(s=>{Dr(t[s])?Dr(e[s])||(i[s]=e[s]):i[s]=t[s]}),i},qA=(n,e={})=>{const t=e.method||n.method||"GET";let i={baseURL:n.baseURL||"",method:t,url:e.url||"",params:e.params||{},custom:{...n.custom||{},...e.custom||{}},header:vl(n.header||{},e.header||{})};return i={...i,...m0(["getTask","validateStatus"],n,e)},t==="DOWNLOAD"||(t==="UPLOAD"?(delete i.header["content-type"],delete i.header["Content-Type"],["filePath","name","formData"].forEach(o=>{Dr(e[o])||(i[o]=e[o])})):i={...i,...m0(["data","timeout","dataType","responseType"],n,e)}),i},WA={baseURL:"",header:{},method:"GET",dataType:"json",responseType:"text",custom:{},timeout:6e4,validateStatus:function(e){return e>=200&&e<300}};var zA=function(){function n(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 i;try{i=Promise}catch{i=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(n(x,e))S=new e;else if(n(x,t))S=new t;else if(n(x,i))S=new i(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;n(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)}n(x,e)&&x.forEach(function(O,K){var B=v(K,E-1),G=v(O,E-1);S.set(B,G)}),n(x,t)&&x.forEach(function(O){var K=v(O,E-1);S.add(K)});for(var I in x){var R=Object.getOwnPropertyDescriptor(x,I);R&&(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 QA{constructor(e={}){NA(e)||(e={},console.warn("设置全局参数必须接收一个Object")),this.config=zA({...WA,...e}),this.interceptors={request:new as,response:new as}}setConfig(e){this.config=e(this.config)}middleware(e){e=qA(this.config,e);const t=[jA,void 0];let i=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;)i=i.then(t.shift(),t.shift());return i}request(e={}){return this.middleware(e)}get(e,t={}){return this.middleware({url:e,method:"GET",...t})}post(e,t,i={}){return this.middleware({url:e,data:t,method:"POST",...i})}put(e,t,i={}){return this.middleware({url:e,data:t,method:"PUT",...i})}delete(e,t,i={}){return this.middleware({url:e,data:t,method:"DELETE",...i})}connect(e,t,i={}){return this.middleware({url:e,data:t,method:"CONNECT",...i})}head(e,t,i={}){return this.middleware({url:e,data:t,method:"HEAD",...i})}options(e,t,i={}){return this.middleware({url:e,data:t,method:"OPTIONS",...i})}trace(e,t,i={}){return this.middleware({url:e,data:t,method:"TRACE",...i})}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 Cc=new QA,YA={actionSheet:{show:!1,title:"",description:"",actions:[],index:"",cancelText:"",closeOnClickAction:!0,safeAreaInsetBottom:!0,openType:"",closeOnClickOverlay:!0,round:0,wrapMaxHeight:"600px"}},XA={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}},JA={alert:{title:"",type:"warning",description:"",closable:!1,showIcon:!1,effect:"light",center:!1,fontSize:14,transitionMode:"fade",duration:0,icon:"",value:!0}},ZA={avatar:{src:"",shape:"circle",size:40,mode:"scaleToFill",text:"",bgColor:"#c0c4cc",color:"#ffffff",fontSize:18,icon:"",mpAvatar:!1,randomBgColor:!1,defaultUrl:"",colorIndex:"",name:""}},eS={avatarGroup:{urls:[],maxCount:5,shape:"circle",mode:"scaleToFill",showMore:!0,size:40,keyName:"",gap:.5,extraValue:0}},tS={backtop:{mode:"circle",icon:"arrow-upward",text:"",duration:100,scrollTop:0,top:400,bottom:100,right:20,zIndex:9,iconStyle:{color:"#909399",fontSize:"19px"}}},iS={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}},nS={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}},sS={"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":"预览视频失败"},rS={"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":"預覽視頻失敗"},oS={"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"},aS={"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"},lS={"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"},cS={"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"},uS={"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":"비디오 미리보기 실패"},fS={"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":"ビデオプレビュー失敗"},dS={"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 Kn={lang:Y.getLocale(),locales:{en:oS,es:aS,fr:lS,de:cS,ko:uS,ja:fS,ru:dS,"zh-Hant":rS,"zh-Hans":sS}};Y.onLocaleChange(n=>{Kn.lang=n});function oe(n,e={}){if(n){let t=Kn.lang;Kn.locales[Kn.lang]||(t="zh-Hans");let i=Kn.locales[t][n]||n;return Object.keys(e).forEach(s=>{const r=new RegExp(`{${s}}`,"g");i=i.replace(r,e[s])}),i}else return n}const hS={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}},pS={carKeyboard:{random:!1}},gS={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"}},mS={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:""}},xS={cellGroup:{title:"",border:!0,customStyle:{}}},yS={checkbox:{name:"",shape:"",size:"",checkbox:!1,disabled:"",activeColor:"",inactiveColor:"",iconSize:"",iconColor:"",label:"",labelSize:"",labelColor:"",labelDisabled:""}},vS={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}},ES={circleProgress:{percentage:30}},AS={code:{seconds:60,startText:oe("up.code.send"),changeText:oe("up.code.resendAfter"),endText:oe("up.code.resend"),keepRunning:!1,uniqueKey:""}},SS={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}},TS={col:{span:12,offset:0,justify:"start",align:"stretch",textAlign:"left"}},bS={collapse:{value:null,accordion:!1,border:!0}},_S={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:""}},IS={columnNotice:{text:"",icon:"volume",mode:"",color:"#f9ae3d",bgColor:"#fdf6ec",fontSize:14,speed:80,step:!1,duration:1500,disableTouch:!0,justifyContent:"flex-start"}},CS={countDown:{time:0,format:"HH:mm:ss",autoStart:!0,millisecond:!1}},LS={countTo:{startVal:0,endVal:0,duration:2e3,autoplay:!0,decimals:0,useEasing:!0,decimal:".",color:"#606266",fontSize:22,bold:!1,separator:""}},DS={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}},RS={divider:{dashed:!1,hairline:!0,dot:!1,textPosition:"center",text:"",textSize:14,textColor:"#909399",lineColor:"#dcdfe6"}},wS={empty:{icon:"",text:"",textColor:"#c0c4cc",textSize:14,iconColor:"#c0c4cc",iconSize:90,mode:"data",width:160,height:160,show:!0,marginTop:0}},PS={form:{model:{},rules:{},errorType:"message",borderBottom:!0,labelPosition:"left",labelWidth:45,labelAlign:"left",labelStyle:{}}},kS={formItem:{label:"",prop:"",rules:[],borderBottom:"",labelPosition:"",labelWidth:"",rightIcon:"",leftIcon:"",required:!1,leftIconStyle:""}},BS={gap:{bgColor:"transparent",height:20,marginTop:0,marginBottom:0,customStyle:{}}},FS={grid:{col:3,border:!1,align:"left"}},OS={gridItem:{name:null,bgColor:"transparent"}},{color:x0}=Yi,MS={icon:{name:"",color:x0["u-content-color"],size:"16px",bold:!1,index:"",hoverClass:"",customPrefix:"uicon",label:"",labelPos:"right",labelSize:"15px",labelColor:x0["u-content-color"],space:"3px",imgMode:"",width:"",height:"",top:0,stop:!1}},NS={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"}},US={indexAnchor:{text:"",color:"#606266",size:14,bgColor:"#f1f1f1",height:32}},$S={indexList:{inactiveColor:"#606266",activeColor:"#5677fc",indexList:[],sticky:!0,customNavHeight:0,safeBottomFix:!1}},HS={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}},GS={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}},KS={line:{color:"#d6d7d9",length:"100%",direction:"row",hairline:!0,margin:0,dashed:!1}},VS={lineProgress:{activeColor:"#19be6b",inactiveColor:"#ececec",percentage:0,showText:!0,height:12,fromRight:!1}},{color:jS}=Yi,qS={link:{color:jS["u-primary"],fontSize:15,underLine:!1,href:"",mpTips:oe("up.link.copyed"),lineColor:"",text:""}},WS={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}},zS={listItem:{anchor:""}},{color:y0}=Yi,QS={loadingIcon:{show:!0,color:y0["u-tips-color"],textColor:y0["u-tips-color"],vertical:!1,mode:"spinner",size:24,textSize:15,text:"",timingFunction:"ease-in-out",duration:1200,inactiveColor:""}},YS={loadingPage:{loadingText:oe("up.common.loading2"),image:"",loadingMode:"circle",loading:!1,bgColor:"#ffffff",color:"#C8C8C8",fontSize:19,iconSize:28,loadingColor:"#C8C8C8",zIndex:10}},XS={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}},JS={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:{}}},ZS={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:io.mainColor,autoBack:!1,titleStyle:""}},e8={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"}},t8={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"}},i8={notify:{top:0,type:"primary",color:"#ffffff",bgColor:"",message:"",duration:3e3,fontSize:15,safeAreaInsetTop:!1}},n8={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}},s8={numberKeyboard:{mode:"number",dotDisabled:!1,random:!1}},r8={overlay:{show:!1,zIndex:10070,duration:300,opacity:.5}},o8={parse:{copyLink:!0,errorImg:"",lazyLoad:!1,loadingImg:"",pauseVideo:!0,previewImg:!0,setTitle:!0,showImgMenu:!0}},a8={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}},l8={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"}},c8={radio:{name:"",shape:"",disabled:"",labelDisabled:"",activeColor:"",inactiveColor:"",iconSize:"",labelSize:"",label:"",labelColor:"",size:"",iconColor:"",placement:""}},u8={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"}},f8={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}},d8={readMore:{showHeight:400,toggle:!1,closeText:oe("up.readMore.expand"),openText:oe("up.readMore.fold"),color:"#2979ff",fontSize:14,textIndent:"2em",name:""}},h8={row:{gutter:0,justify:"start",align:"center"}},p8={rowNotice:{text:"",icon:"volume",mode:"",color:"#f9ae3d",bgColor:"#fdf6ec",fontSize:14,speed:80}},g8={scrollList:{indicatorWidth:50,indicatorBarWidth:20,indicator:!0,indicatorColor:"#f2f2f2",indicatorActiveColor:"#3c9cff",indicatorStyle:""}},m8={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}},x8={section:{title:"",subTitle:oe("up.common.more"),right:!0,fontSize:15,bold:!0,color:"#303133",subColor:"#909399",showLine:!0,lineColor:"",arrow:!0}},y8={skeleton:{loading:!0,animate:!0,rows:0,rowsWidth:"100%",rowsHeight:18,title:!0,titleWidth:"50%",titleHeight:18,avatar:!1,avatarSize:32,avatarShape:"circle"}},v8={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:{}}},E8={statusBar:{bgColor:"transparent",height:0}},A8={steps:{direction:"row",current:0,activeColor:"#3c9cff",inactiveColor:"#969799",activeIcon:"",inactiveIcon:"",dot:!1}},S8={stepsItem:{title:"",desc:"",iconSize:17,error:!1}},T8={sticky:{offsetTop:0,customNavHeight:0,disabled:!1,bgColor:"transparent",zIndex:"",index:""}},b8={subsection:{list:[],current:0,activeColor:"#3c9cff",inactiveColor:"#303133",mode:"button",fontSize:12,bold:!0,bgColor:"#eeeeef",keyName:"name",activeColorKeyName:"activeColorKey",inactiveColorKeyName:"inactiveColorKey",disabled:!1}},_8={swipeAction:{autoClose:!0}},I8={swipeActionItem:{show:!1,closeOnClick:!0,name:"",disabled:!1,threshold:20,autoClose:!0,options:[],duration:300}},C8={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}},L8={swiperIndicator:{length:0,current:0,indicatorActiveColor:"",indicatorInactiveColor:"",indicatorMode:"line"}},D8={switch:{loading:!1,disabled:!1,size:25,activeColor:"#2979ff",inactiveColor:"#ffffff",value:!1,activeValue:!0,inactiveValue:!1,asyncChange:!1,space:0}},R8={tabbar:{value:null,safeAreaInsetBottom:!0,border:!0,zIndex:1,activeColor:"#1989fa",inactiveColor:"#7d7e80",fixed:!0,placeholder:!0,borderColor:"",backgroundColor:""}},w8={tabbarItem:{name:null,icon:"",badge:null,dot:!1,text:"",badgeStyle:"top: 6px;right:2px;",mode:""}},P8={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:{}}},k8={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}},B8={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}},F8={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}},O8={toast:{zIndex:10090,loading:!1,message:"",icon:"",type:"",loadingMode:"",show:"",overlay:!1,position:"center",params:{},duration:2e3,isTab:!1,url:"",callback:null,back:!1}},M8={toolbar:{show:!0,cancelText:oe("up.common.cancel"),confirmText:oe("up.common.confirm"),cancelColor:"#909193",confirmColor:"",title:""}},N8={tooltip:{text:"",copyText:"",size:14,color:"#606266",bgColor:"transparent",direction:"top",zIndex:10071,showCopy:!0,buttons:[],overlay:!0,showToast:!0,popupBgColor:"",triggerMode:"longpress",forcePosition:{}}},U8={transition:{show:!1,mode:"fade",duration:"300",timingFunction:"ease-out"}},$8={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"}},Tg={...YA,...XA,...JA,...ZA,...eS,...tS,...iS,...nS,...hS,...pS,...gS,...mS,...xS,...yS,...vS,...ES,...AS,...SS,...TS,...bS,..._S,...IS,...CS,...LS,...DS,...RS,...wS,...PS,...kS,...BS,...FS,...OS,...MS,...NS,...US,...$S,...HS,...GS,...KS,...VS,...qS,...WS,...zS,...QS,...YS,...XS,...JS,...ZS,...e8,...t8,...i8,...n8,...s8,...r8,...o8,...a8,...l8,...c8,...u8,...f8,...d8,...h8,...p8,...g8,...m8,...x8,...y8,...v8,...E8,...A8,...S8,...T8,...b8,..._8,...I8,...C8,...L8,...D8,...R8,...w8,...P8,...k8,...B8,...F8,...O8,...M8,...N8,...U8,...$8};function H8(n){un(Yi,n.config||{}),un(Tg,n.props||{}),un(io,n.color||{}),un(Ic,n.zIndex||{})}if(Y&&Y.upuiParams){console.log("setting uview-plus");let n=Y.upuiParams();n.httpIns&&n.httpIns(Cc),n.options&&H8(n.options)}let no="none";no="vue3";no="mp";no="weixin";const G8=no;let K8=["primary","success","error","warning","info"];function bg(n){Ri.shallowMerge(Yi,n.config||{}),Ri.shallowMerge(Tg,n.props||{}),Ri.shallowMerge(io,n.color||{}),Ri.shallowMerge(Ic,n.zIndex||{})}Ri.setConfig=bg;const v0={route:ml,date:Ri.timeFormat,colorGradient:Os.colorGradient,hexToRgb:Os.hexToRgb,rgbToHex:Os.rgbToHex,colorToRgba:Os.colorToRgba,test:hg,type:K8,http:Cc,config:Yi,zIndex:Ic,debounce:LA,throttle:DA,calc:BA,mixin:Eg,mpMixin:_A,...Ri,color:io,platform:G8},V8=(n,e="")=>{if(e){Y.upuiParams=e;let t=e();t.httpIns&&t.httpIns(Cc),t.options&&bg(t.options)}Y.$u=v0,n.config.globalProperties.$u=v0,n.mixin(Eg)},j8={install:V8},q8={"^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"},W8=[{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"}}}],z8=[{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"}}}]}],Q8={navigationBarTextStyle:"black",navigationBarTitleText:"【S直播】",navigationBarBackgroundColor:"#f5f5f5",backgroundColor:"#f7f8fa"},Y8={},_g={custom:q8,pages:W8,subPackages:z8,globalStyle:Q8,uniIdRouter:Y8};var X8=[];function J8(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function Nt(n,e,t){return n(t={path:e,exports:{},require:function(i,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 Z8=Nt(function(n,e){var t;n.exports=(t=t||function(i,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=i.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 R=((_=36969*(65535&_)+(_>>16)&I)<<16)+(T=18e3*(65535&T)+(T>>16)&I)&I;return R/=4294967296,(R+=.5)*(i.random()>.5?1:-1)}},E=0;E<g;E+=4){var S=x(4294967296*(y||i.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?i.ceil(S):i.max((0|S)-this._minBufferSize,0))*E,_=i.min(4*T,x);if(T){for(var I=0;I<T;I+=E)this._doProcessBlock(v,I);var R=v.splice(0,T);y.sigBytes-=_}return new l.init(R,_)},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)}),gi=Z8,e6=(Nt(function(n,e){var t;n.exports=(t=gi,function(i){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*i.abs(i.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],R=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],D=E[1],P=E[2],w=E[3];C=f(C,D,P,w,S,7,l[0]),w=f(w,C,D,P,T,12,l[1]),P=f(P,w,C,D,_,17,l[2]),D=f(D,P,w,C,I,22,l[3]),C=f(C,D,P,w,R,7,l[4]),w=f(w,C,D,P,b,12,l[5]),P=f(P,w,C,D,L,17,l[6]),D=f(D,P,w,C,k,22,l[7]),C=f(C,D,P,w,M,7,l[8]),w=f(w,C,D,P,N,12,l[9]),P=f(P,w,C,D,F,17,l[10]),D=f(D,P,w,C,O,22,l[11]),C=f(C,D,P,w,K,7,l[12]),w=f(w,C,D,P,B,12,l[13]),P=f(P,w,C,D,G,17,l[14]),C=d(C,D=f(D,P,w,C,H,22,l[15]),P,w,T,5,l[16]),w=d(w,C,D,P,L,9,l[17]),P=d(P,w,C,D,O,14,l[18]),D=d(D,P,w,C,S,20,l[19]),C=d(C,D,P,w,b,5,l[20]),w=d(w,C,D,P,F,9,l[21]),P=d(P,w,C,D,H,14,l[22]),D=d(D,P,w,C,R,20,l[23]),C=d(C,D,P,w,N,5,l[24]),w=d(w,C,D,P,G,9,l[25]),P=d(P,w,C,D,I,14,l[26]),D=d(D,P,w,C,M,20,l[27]),C=d(C,D,P,w,B,5,l[28]),w=d(w,C,D,P,_,9,l[29]),P=d(P,w,C,D,k,14,l[30]),C=h(C,D=d(D,P,w,C,K,20,l[31]),P,w,b,4,l[32]),w=h(w,C,D,P,M,11,l[33]),P=h(P,w,C,D,O,16,l[34]),D=h(D,P,w,C,G,23,l[35]),C=h(C,D,P,w,T,4,l[36]),w=h(w,C,D,P,R,11,l[37]),P=h(P,w,C,D,k,16,l[38]),D=h(D,P,w,C,F,23,l[39]),C=h(C,D,P,w,B,4,l[40]),w=h(w,C,D,P,S,11,l[41]),P=h(P,w,C,D,I,16,l[42]),D=h(D,P,w,C,L,23,l[43]),C=h(C,D,P,w,N,4,l[44]),w=h(w,C,D,P,K,11,l[45]),P=h(P,w,C,D,H,16,l[46]),C=p(C,D=h(D,P,w,C,_,23,l[47]),P,w,S,6,l[48]),w=p(w,C,D,P,k,10,l[49]),P=p(P,w,C,D,G,15,l[50]),D=p(D,P,w,C,b,21,l[51]),C=p(C,D,P,w,K,6,l[52]),w=p(w,C,D,P,I,10,l[53]),P=p(P,w,C,D,F,15,l[54]),D=p(D,P,w,C,T,21,l[55]),C=p(C,D,P,w,M,6,l[56]),w=p(w,C,D,P,H,10,l[57]),P=p(P,w,C,D,L,15,l[58]),D=p(D,P,w,C,B,21,l[59]),C=p(C,D,P,w,R,6,l[60]),w=p(w,C,D,P,O,10,l[61]),P=p(P,w,C,D,_,15,l[62]),D=p(D,P,w,C,N,21,l[63]),E[0]=E[0]+C|0,E[1]=E[1]+D|0,E[2]=E[2]+P|0,E[3]=E[3]+w|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=i.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)}),Nt(function(n,e){var t;n.exports=(t=gi,void function(){var i=t,s=i.lib.Base,r=i.enc.Utf8;i.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))}})}())}),Nt(function(n,e){n.exports=gi.HmacMD5})),t6=Nt(function(n,e){n.exports=gi.enc.Utf8}),i6=Nt(function(n,e){var t;n.exports=(t=gi,function(){var i=t,s=i.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)}i.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 Ig="uni_id_token",Cg="uni_id_token_expired",n6="uniIdToken",Rr={DEFAULT:"FUNCTION",FUNCTION:"FUNCTION",OBJECT:"OBJECT",CLIENT_DB:"CLIENT_DB"},E0="pending",s6="fulfilled",A0="rejected";function ls(n){return Object.prototype.toString.call(n).slice(8,-1).toLowerCase()}function Lg(n){return ls(n)==="object"}function Dg(n){return typeof n=="function"}function r6(n){return function(){try{return n.apply(n,arguments)}catch(e){console.error(e)}}}const S0="REJECTED",Rg="NOT_PENDING";class Lc{constructor({createPromise:e,retryRule:t=S0}={}){this.createPromise=e,this.status=null,this.promise=null,this.retryRule=t}get needRetry(){if(!this.status)return!0;switch(this.retryRule){case S0:return this.status===A0;case Rg:return this.status!==E0}}exec(){return this.needRetry?(this.status=E0,this.promise=this.createPromise().then(e=>(this.status=s6,Promise.resolve(e)),e=>(this.status=A0,Promise.reject(e))),this.promise):this.promise}}class o6{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 i=this._callback[e];if(!i)return;const s=function(r,o){for(let a=r.length-1;a>=0;a--)if(r[a]===o)return a;return-1}(i,t);i.splice(s,1)}off(e,t){return this.removeListener(e,t)}removeAllListener(e){delete this._callback[e]}emit(e,...t){const i=this._callback[e];if(i)for(let s=0;s<i.length;s++)i[s](...t)}}function Dc(n){return n&&typeof n=="string"?JSON.parse(n):n}const a6=!0,l6="mp-weixin",c6=Dc(X8),Sn=l6,u6=Dc(""),wg=Dc("[]")||[];let f6="";try{f6="__UNI__90F7D71"}catch{}let vo={};function Gi(n,e={}){var t,i;return t=vo,i=n,Object.prototype.hasOwnProperty.call(t,i)||(vo[n]=e),vo[n]}const Pg=["invoke","success","fail","complete"],Ft=Gi("_globalUniCloudInterceptor");function kg(n,e){Ft[n]||(Ft[n]={}),Lg(e)&&Object.keys(e).forEach(t=>{Pg.indexOf(t)>-1&&function(i,s,r){let o=Ft[i][s];o||(o=Ft[i][s]=[]),o.indexOf(r)===-1&&Dg(r)&&o.push(r)}(n,t,e[t])})}function d6(n,e){Ft[n]||(Ft[n]={}),Lg(e)?Object.keys(e).forEach(t=>{Pg.indexOf(t)>-1&&function(i,s,r){const o=Ft[i][s];if(!o)return;const a=o.indexOf(r);a>-1&&o.splice(a,1)}(n,t,e[t])}):delete Ft[n]}function nt(n,e){return n&&n.length!==0?n.reduce((t,i)=>t.then(()=>i(e)),Promise.resolve()):Promise.resolve()}function st(n,e){return Ft[n]&&Ft[n][e]||[]}function h6(n){kg("callObject",n)}const Eo=Gi("_globalUniCloudListener"),Re={RESPONSE:"response",NEED_LOGIN:"needLogin",REFRESH_TOKEN:"refreshToken"},ci={CLIENT_DB:"clientdb",CLOUD_FUNCTION:"cloudfunction",CLOUD_OBJECT:"cloudobject"};function Is(n){return Eo[n]||(Eo[n]=[]),Eo[n]}function Ao(n,e){const t=Is(n);t.includes(e)||t.push(e)}function So(n,e){const t=Is(n),i=t.indexOf(e);i!==-1&&t.splice(i,1)}function mt(n,e){const t=Is(n);for(let i=0;i<t.length;i++)(0,t[i])(e)}let To,bo=!1;function Bg(){return To||(To=new Promise(n=>{bo&&n(),function e(){if(typeof getCurrentPages=="function"){const t=getCurrentPages();t&&t[0]&&(bo=!0,n())}bo||setTimeout(()=>{e()},30)}()}),To)}function Fg(n){const e={};for(const t in n){const i=n[t];Dg(i)&&(e[t]=r6(i))}return e}class Q 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:n=>Y.request(n),uploadFile:n=>Y.uploadFile(n),setStorageSync:(n,e)=>Y.setStorageSync(n,e),getStorageSync:n=>Y.getStorageSync(n),removeStorageSync:n=>Y.removeStorageSync(n),clearStorageSync:()=>Y.clearStorageSync(),connectSocket:n=>Y.connectSocket(n)};function Og(n){return n&&Og(n.__v_raw)||n}function cs(){return{token:Pe.getStorageSync(Ig)||Pe.getStorageSync(n6),tokenExpired:Pe.getStorageSync(Cg)}}function Mg({token:n,tokenExpired:e}={}){n&&Pe.setStorageSync(Ig,n),e&&Pe.setStorageSync(Cg,e)}let _o,Ms;function us(){return _o||(_o=hi.canIUse("getAppBaseInfo")&&hi.canIUse("getDeviceInfo")?{...Y.getAppBaseInfo(),...Y.getDeviceInfo()}:Y.getSystemInfoSync()),_o}function p6(){let n,e;try{if(Y.getLaunchOptionsSync){if(Y.getLaunchOptionsSync.toString().indexOf("not yet implemented")>-1)return;const{scene:t,channel:i}=Y.getLaunchOptionsSync();n=i,e=t}}catch{}return{channel:n,scene:e}}let El={};function Al(){const n=Y.getLocale&&Y.getLocale()||"en";if(Ms)return{...El,...Ms,locale:n,LOCALE:n};const e=us(),{deviceId:t,osName:i,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 Ms={PLATFORM:s,OS:i,APPID:r,DEVICEID:t,...p6(),...e},{...El,...Ms,locale:n,LOCALE:n}}var fn={sign:function(n,e){let t="";return Object.keys(n).sort().forEach(function(i){n[i]&&(t=t+"&"+i+"="+n[i])}),t=t.slice(1),e6(t,e).toString()},wrappedRequest:function(n,e){return new Promise((t,i)=>{e(Object.assign(n,{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 i(new Q({code:a,message:c,requestId:r}))}const o=s.data;if(o.error)return i(new Q({code:o.error.code,message:o.error.message,requestId:r}));o.result=o.data,o.requestId=r,delete o.data,t(o)}}))})},toBase64:function(n){return i6.stringify(t6.parse(n))}},g6=class{constructor(n){["spaceId","clientSecret"].forEach(e=>{if(!Object.prototype.hasOwnProperty.call(n,e))throw new Error(`${e} required`)}),this.config=Object.assign({},{endpoint:n.spaceId.indexOf("mp-")===0?"https://api.next.bspapp.com":"https://api.bspapp.com"},n),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 Lc({createPromise:()=>this.requestAuth(this.setupRequest({method:"serverless.auth.user.anonymousAuthorize",params:"{}"},"auth")).then(e=>{if(!e.result||!e.result.accessToken)throw new Q({code:"AUTH_FAILED",message:"获取accessToken失败"});this.setAccessToken(e.result.accessToken)}),retryRule:Rg})}get hasAccessToken(){return!!this.accessToken}setAccessToken(n){this.accessToken=n}requestWrapped(n){return fn.wrappedRequest(n,this.adapter.request)}requestAuth(n){return this.requestWrapped(n)}request(n,e){return Promise.resolve().then(()=>this.hasAccessToken?e?this.requestWrapped(n):this.requestWrapped(n).catch(t=>new Promise((i,s)=>{!t||t.code!=="GATEWAY_INVALID_TOKEN"&&t.code!=="InvalidParameter.InvalidToken"?s(t):i()}).then(()=>this.getAccessToken()).then(()=>{const i=this.rebuildRequest(n);return this.request(i,!0)})):this.getAccessToken().then(()=>{const t=this.rebuildRequest(n);return this.request(t,!0)}))}rebuildRequest(n){const e=Object.assign({},n);return e.data.token=this.accessToken,e.header["x-basement-token"]=this.accessToken,e.header["x-serverless-sign"]=fn.sign(e.data,this.config.clientSecret),e}setupRequest(n,e){const t=Object.assign({},n,{spaceId:this.config.spaceId,timestamp:Date.now()}),i={"Content-Type":"application/json"};return e!=="auth"&&(t.token=this.accessToken,i["x-basement-token"]=this.accessToken),i["x-serverless-sign"]=fn.sign(t,this.config.clientSecret),{url:this.config.requestUrl,method:"POST",data:t,dataType:"json",header:i}}getAccessToken(){return this._getAccessTokenPromiseHub.exec()}async authorize(){await this.getAccessToken()}callFunction(n){const e={method:"serverless.function.runtime.invoke",params:JSON.stringify({functionTarget:n.name,functionArgs:n.data||{}})};return this.request({...this.setupRequest(e),timeout:n.timeout})}getOSSUploadOptionsFromPath(n){const e={method:"serverless.file.resource.generateProximalSign",params:JSON.stringify(n)};return this.request(this.setupRequest(e))}uploadFileToOSS({url:n,formData:e,name:t,filePath:i,fileType:s,onUploadProgress:r}){return new Promise((o,a)=>{const c=this.adapter.uploadFile({url:n,formData:e,name:t,filePath:i,fileType:s,header:{"X-OSS-server-side-encrpytion":"AES256"},success(l){l&&l.statusCode<400?o(l):a(new Q({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(l){a(new Q({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(n){const e={method:"serverless.file.resource.report",params:JSON.stringify(n)};return this.request(this.setupRequest(e))}async uploadFile({filePath:n,cloudPath:e,fileType:t="image",cloudPathAsRealPath:i=!1,onUploadProgress:s,config:r}){if(ls(e)!=="string")throw new Q({code:"INVALID_PARAM",message:"cloudPath必须为字符串类型"});if(!(e=e.trim()))throw new Q({code:"INVALID_PARAM",message:"cloudPath不可为空"});if(/:\/\//.test(e))throw new Q({code:"INVALID_PARAM",message:"cloudPath不合法"});const o=r&&r.envType||this.config.envType;if(i&&(e[0]!=="/"&&(e="/"+e),e.indexOf("\\")>-1))throw new Q({code:"INVALID_PARAM",message:"使用cloudPath作为路径时,cloudPath不可包含“\\”"});const a=(await this.getOSSUploadOptionsFromPath({env:o,filename:i?e.split("/").pop():e,fileId:i?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=fn.toBase64(x)}const v={url:"https://"+a.host,formData:y,fileName:"file",name:"file",filePath:n,fileType:t};if(await this.uploadFileToOSS(Object.assign({},v,{onUploadProgress:s})),g)return{success:!0,filePath:n,fileID:c};if((await this.reportOSSUpload({id:p})).success)return{success:!0,filePath:n,fileID:c};throw new Q({code:"UPLOAD_FAILED",message:"文件上传失败"})}getTempFileURL({fileList:n}={}){return new Promise((e,t)=>{Array.isArray(n)&&n.length!==0||t(new Q({code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"})),this.getFileInfo({fileList:n}).then(i=>{e({fileList:n.map((s,r)=>{const o=i.fileList[r];return{fileID:s,tempFileURL:o&&o.url||s}})})})})}async getFileInfo({fileList:n}={}){if(!Array.isArray(n)||n.length===0)throw new Q({code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"});const e={method:"serverless.file.resource.info",params:JSON.stringify({id:n.map(t=>t.split("?")[0]).join(",")})};return{fileList:(await this.request(this.setupRequest(e))).result}}},m6={init(n){const e=new g6(n),t={signInAnonymously:function(){return e.authorize()},getLoginState:function(){return Promise.resolve(!1)}};return e.auth=function(){return t},e.customAuth=e.auth,e}};const x6=typeof location<"u"&&location.protocol==="http:"?"http:":"https:";var T0;(function(n){n.local="local",n.none="none",n.session="session"})(T0||(T0={}));var y6=function(){},v6=Nt(function(n,e){var t;n.exports=(t=gi,function(i){var s=t,r=s.lib,o=r.WordArray,a=r.Hasher,c=s.algo,l=[],u=[];(function(){function h(y){for(var v=i.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(i.pow(m,.5))),u[g]=p(i.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 R=f[I-15],b=(R<<25|R>>>7)^(R<<14|R>>>18)^R>>>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)]=i.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)}),Sl=v6,Ng=Nt(function(n,e){n.exports=gi.HmacSHA256});const Cs=()=>{let n;if(!Promise){n=()=>{},n.promise={};const t=()=>{throw new Q({message:'Your Node runtime does support ES6 Promises. Set "global.Promise" to your preferred implementation of promises.'})};return Object.defineProperty(n.promise,"then",{get:t}),Object.defineProperty(n.promise,"catch",{get:t}),n}const e=new Promise((t,i)=>{n=(s,r)=>s?i(s):t(r)});return n.promise=e,n};function E6(n){return n===void 0}function A6(n){return Object.prototype.toString.call(n)==="[object Null]"}function b0(n=""){return n.replace(/([\s\S]+)\s+(请前往云开发AI小助手查看问题:.*)/,"$1")}function _0(n=32){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let t="";for(let i=0;i<n;i++)t+=e.charAt(Math.floor(62*Math.random()));return t}var I0;function S6(n){const e=(t=n,Object.prototype.toString.call(t)==="[object Array]"?n:[n]);var t;for(const i of e){const{isMatch:s,genAdapter:r,runtime:o}=i;if(s())return{adapter:r(),runtime:o}}}(function(n){n.WEB="web",n.WX_MP="wx_mp"})(I0||(I0={}));const Qe={adapter:null,runtime:void 0},T6=["anonymousUuidKey"];class Io extends y6{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 C0(n,e){switch(n){case"local":return e.localStorage||new Io;case"none":return new Io;default:return e.sessionStorage||new Io}}class L0{constructor(e){if(!this._storage){this._persistence=Qe.adapter.primaryStorage||e.persistence,this._storage=C0(this._persistence,Qe.adapter);const t=`access_token_${e.env}`,i=`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:i,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 i=C0(e,Qe.adapter);for(const s in this.keys){const r=this.keys[s];if(t&&T6.includes(s))continue;const o=this._storage.getItem(r);E6(o)||A6(o)||(i.setItem(r,o),this._storage.removeItem(r))}this._storage=i}setStore(e,t,i){if(!this._storage)return;const s={version:i||"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 i=this._storage.getItem(e);return i&&i.indexOf(t)>=0?JSON.parse(i).content:""}removeStore(e){this._storage.removeItem(e)}}const Ug={},$g={};function Dn(n){return Ug[n]}class Hg{constructor(e,t){this.data=t||null,this.name=e}}class b6 extends Hg{constructor(e,t){super("error",{error:e,data:t}),this.error=e}}const Rc=new class{constructor(){this._listeners={}}on(n,e){return function(t,i,s){s[t]=s[t]||[],s[t].push(i)}(n,e,this._listeners),this}off(n,e){return function(t,i,s){if(s&&s[t]){const r=s[t].indexOf(i);r!==-1&&s[t].splice(r,1)}}(n,e,this._listeners),this}fire(n,e){if(n instanceof b6)return console.error(n.error),this;const t=typeof n=="string"?new Hg(n,e||{}):n,i=t.name;if(this._listens(i)){t.target=this;const s=this._listeners[i]?[...this._listeners[i]]:[];for(const r of s)r.call(this,t)}return this}_listens(n){return this._listeners[n]&&this._listeners[n].length>0}};function ni(n,e){Rc.on(n,e)}function rt(n,e={}){Rc.fire(n,e)}function _6(n,e){Rc.off(n,e)}const Tn="loginStateChanged",Gg="loginStateExpire",mi="loginTypeChanged",Tl="anonymousConverted",Kg="refreshAccessToken";var Fe;(function(n){n.ANONYMOUS="ANONYMOUS",n.WECHAT="WECHAT",n.WECHAT_PUBLIC="WECHAT-PUBLIC",n.WECHAT_OPEN="WECHAT-OPEN",n.CUSTOM="CUSTOM",n.EMAIL="EMAIL",n.USERNAME="USERNAME",n.NULL="NULL"})(Fe||(Fe={}));class I6{constructor(){this._fnPromiseMap=new Map}async run(e,t){let i=this._fnPromiseMap.get(e);return i||(i=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,i)),i}_runIdlePromise(){return Promise.resolve()}}class C6{constructor(e){this._singlePromise=new I6,this._cache=Dn(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=_0(),this._cache.setStore(e,t)),this._deviceID=t,t}async _request(e,t,i={}){const s={"x-request-id":_0(),"x-device-id":this._getDeviceId()};if(i.withAccessToken){const{tokenTypeKey:r}=this._cache.keys,o=await this.getAccessToken(),a=this._cache.getStore(r);s.authorization=`${a} ${o}`}return this._reqClass[i.method==="get"?"get":"post"]({url:`${this._baseURL}${e}`,data:t,headers:s})}async _fetchAccessToken(){const{loginTypeKey:e,accessTokenKey:t,accessTokenExpireKey:i,tokenTypeKey:s}=this._cache.keys,r=this._cache.getStore(e);if(r&&r!==Fe.ANONYMOUS)throw new Q({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(i,Date.now()+1e3*c),a}isAccessTokenExpired(e,t){let i=!0;return e&&t&&(i=t<Date.now()),i}async getAccessToken(){const{accessTokenKey:e,accessTokenExpireKey:t}=this._cache.keys,i=this._cache.getStore(e),s=this._cache.getStore(t);return this.isAccessTokenExpired(i,s)?this._fetchAccessToken():i}async refreshAccessToken(){const{accessTokenKey:e,accessTokenExpireKey:t,loginTypeKey:i}=this._cache.keys;return this._cache.removeStore(e),this._cache.removeStore(t),this._cache.setStore(i,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 D0=["auth.getJwt","auth.logout","auth.signInWithTicket","auth.signInAnonymously","auth.signIn","auth.fetchAccessTokenWithRefreshToken","auth.signUpWithEmailAndPassword","auth.activateEndUserMail","auth.sendPasswordResetEmail","auth.resetPasswordWithToken","auth.isUsernameRegistered"],L6={"X-SDK-Version":"1.3.5"};function Co(n,e,t){const i=n[e];n[e]=function(s){const r={},o={};t.forEach(c=>{const{data:l,headers:u}=c.call(n,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},i.call(n,s)}}function Lo(){const n=Math.random().toString(16).slice(2);return{data:{seqId:n},headers:{...L6,"x-seqid":n}}}class D6{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=Dn(this.config.env),this._localCache=(t=this.config.env,$g[t]),this.oauth=new C6(this.config),Co(this._reqClass,"post",[Lo]),Co(this._reqClass,"upload",[Lo]),Co(this._reqClass,"download",[Lo])}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(i){t=i}if(this._refreshAccessTokenPromise=null,this._shouldRefreshAccessTokenHook=null,t)throw t;return e}async _refreshAccessToken(){const{accessTokenKey:e,accessTokenExpireKey:t,refreshTokenKey:i,loginTypeKey:s,anonymousUuidKey:r}=this._cache.keys;this._cache.removeStore(e),this._cache.removeStore(t);let o=this._cache.getStore(i);if(!o)throw new Q({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(i),d=await this.send("auth.signInAnonymously",{anonymous_uuid:u,refresh_token:f});return this.setRefreshToken(d.refresh_token),this._refreshAccessToken()}rt(Gg),this._cache.removeStore(i)}throw new Q({code:c.data.code,message:`刷新access token失败:${c.data.code}`})}if(c.data.access_token)return rt(Kg),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(i),this._cache.setStore(i,c.data.refresh_token),this._refreshAccessToken())}async getAccessToken(){const{accessTokenKey:e,accessTokenExpireKey:t,refreshTokenKey:i}=this._cache.keys;if(!this._cache.getStore(i))throw new Q({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,i){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(D0.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}};i&&i.timeout&&(c.timeout=i.timeout),i&&i.onUploadProgress&&(c.onUploadProgress=i.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}`}(x6,"//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 Q({code:"NETWORK_ERROR",message:"network request error"});return m}async send(e,t={},i={}){const s=await this.request(e,t,{...i,onUploadProgress:t.onUploadProgress});if((s.data.code==="ACCESS_TOKEN_DISABLED"||s.data.code==="ACCESS_TOKEN_EXPIRED")&&D0.indexOf(e)===-1){await this.oauth.refreshAccessToken();const r=await this.request(e,t,{...i,onUploadProgress:t.onUploadProgress});if(r.data.code)throw new Q({code:r.data.code,message:b0(r.data.message)});return r.data}if(s.data.code)throw new Q({code:s.data.code,message:b0(s.data.message)});return s.data}setRefreshToken(e){const{accessTokenKey:t,accessTokenExpireKey:i,refreshTokenKey:s}=this._cache.keys;this._cache.removeStore(t),this._cache.removeStore(i),this._cache.setStore(s,e)}}const Vg={};function Yt(n){return Vg[n]}class so{constructor(e){this.config=e,this._cache=Dn(e.env),this._request=Yt(e.env)}setRefreshToken(e){const{accessTokenKey:t,accessTokenExpireKey:i,refreshTokenKey:s}=this._cache.keys;this._cache.removeStore(t),this._cache.removeStore(i),this._cache.setStore(s,e)}setAccessToken(e,t){const{accessTokenKey:i,accessTokenExpireKey:s}=this._cache.keys;this._cache.setStore(i,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 Q({code:"PARAM_ERROR",message:"envId is not defined"});this._envId=e,this._cache=Dn(this._envId),this._request=Yt(this._envId),this.setUserInfo()}linkWithTicket(e){if(typeof e!="string")throw new Q({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 Q({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:i}=e;return i.forEach(s=>{s.wxOpenId&&s.wxPublicId&&(t=!0)}),{users:i,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:i,avatarUrl:s,province:r,country:o,city:a}=e,{data:c}=await this._request.send("auth.updateUserInfo",{nickName:t,gender:i,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(i=>{this[i]=t[i]}),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 Ls{constructor(e){if(!e)throw new Q({code:"PARAM_ERROR",message:"envId is not defined"});this._cache=Dn(e);const{refreshTokenKey:t,accessTokenKey:i,accessTokenExpireKey:s}=this._cache.keys,r=this._cache.getStore(t),o=this._cache.getStore(i),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 Do extends so{async signIn(){this._cache.updatePersistence("local"),await this._request.oauth.getAccessToken(),rt(Tn),rt(mi,{env:this.config.env,loginType:Fe.ANONYMOUS,persistence:"local"});const e=new Ls(this.config.env);return await e.user.refresh(),e}async linkAndRetrieveDataWithTicket(e){const{anonymousUuidKey:t,refreshTokenKey:i}=this._cache.keys,s=this._cache.getStore(t),r=this._cache.getStore(i),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(),rt(Tl,{env:this.config.env}),rt(mi,{loginType:Fe.CUSTOM,persistence:"local"}),{credential:{refreshToken:o.refresh_token}};throw new Q({message:"匿名转化失败"})}_setAnonymousUUID(e){const{anonymousUuidKey:t,loginTypeKey:i}=this._cache.keys;this._cache.removeStore(t),this._cache.setStore(t,e),this._cache.setStore(i,Fe.ANONYMOUS)}_clearAnonymousUUID(){this._cache.removeStore(this._cache.keys.anonymousUuidKey)}}class R0 extends so{async signIn(e){if(typeof e!="string")throw new Q({code:"PARAM_ERROR",message:"ticket must be a string"});const{refreshTokenKey:t}=this._cache.keys,i=await this._request.send("auth.signInWithTicket",{ticket:e,refresh_token:this._cache.getStore(t)||""});if(i.refresh_token)return this.setRefreshToken(i.refresh_token),await this._request.refreshAccessToken(),rt(Tn),rt(mi,{env:this.config.env,loginType:Fe.CUSTOM,persistence:this.config.persistence}),await this.refreshUserInfo(),new Ls(this.config.env);throw new Q({message:"自定义登录失败"})}}class w0 extends so{async signIn(e,t){if(typeof e!="string")throw new Q({code:"PARAM_ERROR",message:"email must be a string"});const{refreshTokenKey:i}=this._cache.keys,s=await this._request.send("auth.signIn",{loginType:"EMAIL",email:e,password:t,refresh_token:this._cache.getStore(i)||""}),{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(),rt(Tn),rt(mi,{env:this.config.env,loginType:Fe.EMAIL,persistence:this.config.persistence}),new Ls(this.config.env);throw s.code?new Q({code:s.code,message:`邮箱登录失败: ${s.message}`}):new Q({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 P0 extends so{async signIn(e,t){if(typeof e!="string")throw new Q({code:"PARAM_ERROR",message:"username must be a string"});typeof t!="string"&&(t="",console.warn("password is empty"));const{refreshTokenKey:i}=this._cache.keys,s=await this._request.send("auth.signIn",{loginType:Fe.USERNAME,username:e,password:t,refresh_token:this._cache.getStore(i)||""}),{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(),rt(Tn),rt(mi,{env:this.config.env,loginType:Fe.USERNAME,persistence:this.config.persistence}),new Ls(this.config.env);throw s.code?new Q({code:s.code,message:`用户名密码登录失败: ${s.message}`}):new Q({message:"用户名密码登录失败"})}}class w6{constructor(e){this.config=e,this._cache=Dn(e.env),this._request=Yt(e.env),this._onAnonymousConverted=this._onAnonymousConverted.bind(this),this._onLoginTypeChanged=this._onLoginTypeChanged.bind(this),ni(mi,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 Do(this.config)}customAuthProvider(){return new R0(this.config)}emailAuthProvider(){return new w0(this.config)}usernameAuthProvider(){return new P0(this.config)}async signInAnonymously(){return new Do(this.config).signIn()}async signInWithEmailAndPassword(e,t){return new w0(this.config).signIn(e,t)}signInWithUsernameAndPassword(e,t){return new P0(this.config).signIn(e,t)}async linkAndRetrieveDataWithTicket(e){return this._anonymousAuthProvider||(this._anonymousAuthProvider=new Do(this.config)),ni(Tl,this._onAnonymousConverted),await this._anonymousAuthProvider.linkAndRetrieveDataWithTicket(e)}async signOut(){if(this.loginType===Fe.ANONYMOUS)throw new Q({message:"匿名用户不支持登出操作"});const{refreshTokenKey:e,accessTokenKey:t,accessTokenExpireKey:i}=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(i),rt(Tn),rt(mi,{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){ni(Tn,()=>{const i=this.hasLoginState();e.call(this,i)});const t=this.hasLoginState();e.call(this,t)}onLoginStateExpired(e){ni(Gg,e.bind(this))}onAccessTokenRefreshed(e){ni(Kg,e.bind(this))}onAnonymousConverted(e){ni(Tl,e.bind(this))}onLoginTypeChanged(e){ni(mi,()=>{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,i=this._cache.getStore(e),s=this._cache.getStore(t);return this._request.oauth.isAccessTokenExpired(i,s)?null:new Ls(this.config.env)}async isUsernameRegistered(e){if(typeof e!="string")throw new Q({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 R0(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,i=this._cache.getStore(e);return{"x-cloudbase-credentials":this._cache.getStore(t)+"/@@/"+i}}_onAnonymousConverted(e){const{env:t}=e.data;t===this.config.env&&this._cache.updatePersistence(this.config.persistence)}_onLoginTypeChanged(e){const{loginType:t,persistence:i,env:s}=e.data;s===this.config.env&&(this._cache.updatePersistence(i),this._cache.setStore(this._cache.keys.loginTypeKey,t))}}const P6=function(n,e){e=e||Cs();const t=Yt(this.config.env),{cloudPath:i,filePath:s,onUploadProgress:r,fileType:o="image"}=n;return t.send("storage.getUploadMetadata",{path:i}).then(a=>{const{data:{url:c,authorization:l,token:u,fileId:f,cosFileId:d},requestId:h}=a,p={key:i,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:i,fileType:o,onUploadProgress:r}).then(m=>{m.statusCode===201?e(null,{fileID:f,requestId:h}):e(new Q({code:"STORAGE_REQUEST_FAIL",message:`STORAGE_REQUEST_FAIL: ${m.data}`}))}).catch(m=>{e(m)})}).catch(a=>{e(a)}),e.promise},k6=function(n,e){e=e||Cs();const t=Yt(this.config.env),{cloudPath:i}=n;return t.send("storage.getUploadMetadata",{path:i}).then(s=>{e(null,s)}).catch(s=>{e(s)}),e.promise},B6=function({fileList:n},e){if(e=e||Cs(),!n||!Array.isArray(n))return{code:"INVALID_PARAM",message:"fileList必须是非空的数组"};for(let i of n)if(!i||typeof i!="string")return{code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"};const t={fileid_list:n};return Yt(this.config.env).send("storage.batchDeleteFile",t).then(i=>{i.code?e(null,i):e(null,{fileList:i.data.delete_list,requestId:i.requestId})}).catch(i=>{e(i)}),e.promise},jg=function({fileList:n},e){e=e||Cs(),n&&Array.isArray(n)||e(null,{code:"INVALID_PARAM",message:"fileList必须是非空的数组"});let t=[];for(let s of n)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 i={file_list:t};return Yt(this.config.env).send("storage.batchGetDownloadUrl",i).then(s=>{s.code?e(null,s):e(null,{fileList:s.data.download_list,requestId:s.requestId})}).catch(s=>{e(s)}),e.promise},F6=async function({fileID:n},e){const t=(await jg.call(this,{fileList:[{fileID:n,maxAge:600}]})).fileList[0];if(t.code!=="SUCCESS")return e?e(t):new Promise(r=>{r(t)});const i=Yt(this.config.env);let s=t.download_url;if(s=encodeURI(s),!e)return i.download({url:s});e(await i.download({url:s}))},O6=function({name:n,data:e,query:t,parse:i,search:s,timeout:r},o){const a=o||Cs();let c;try{c=e?JSON.stringify(e):""}catch(u){return Promise.reject(u)}if(!n)return Promise.reject(new Q({code:"PARAM_ERROR",message:"函数名不能为空"}));const l={inQuery:t,parse:i,search:s,function_name:n,request_data:c};return Yt(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(i)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 Q({message:"response data must be json"}))}}return a.promise}).catch(u=>{a(u)}),a.promise},k0={timeout:15e3,persistence:"session"},B0=6e5,F0={};class wc{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={...k0,...e},!0){case this.config.timeout>B0:console.warn("timeout大于可配置上限[10分钟],已重置为上限数值"),this.config.timeout=B0;break;case this.config.timeout<100:console.warn("timeout小于可配置下限[100ms],已重置为下限数值"),this.config.timeout=100}return new wc(this.config)}auth({persistence:e}={}){if(this.authObj)return this.authObj;const t=e||Qe.adapter.primaryStorage||k0.persistence;var i;return t!==this.config.persistence&&(this.config.persistence=t),function(s){const{env:r}=s;Ug[r]=new L0(s),$g[r]=new L0({...s,persistence:"local"})}(this.config),i=this.config,Vg[i.env]=new D6(i),this.authObj=new w6(this.config),this.authObj}on(e,t){return ni.apply(this,[e,t])}off(e,t){return _6.apply(this,[e,t])}callFunction(e,t){return O6.apply(this,[e,t])}deleteFile(e,t){return B6.apply(this,[e,t])}getTempFileURL(e,t){return jg.apply(this,[e,t])}downloadFile(e,t){return F6.apply(this,[e,t])}uploadFile(e,t){return P6.apply(this,[e,t])}getUploadMetadata(e,t){return k6.apply(this,[e,t])}registerExtension(e){F0[e.name]=e}async invokeExtension(e,t){const i=F0[e];if(!i)throw new Q({message:`扩展${e} 必须先注册`});return await i.invoke(t,this)}useAdapters(e){const{adapter:t,runtime:i}=S6(e)||{};t&&(Qe.adapter=t),i&&(Qe.runtime=i)}}var qg=new wc;function Ro(n,e,t){t===void 0&&(t={});var i=/\?/.test(e),s="";for(var r in t)s===""?!i&&(e+="?"):s+="&",s+=r+"="+encodeURIComponent(t[r]);return/^http(s)?:\/\//.test(e+=s)?e:""+n+e}class M6{get(e){const{url:t,data:i,headers:s,timeout:r}=e;return new Promise((o,a)=>{Pe.request({url:Ro("https:",t),data:i,method:"GET",header:s,timeout:r,success(c){o(c)},fail(c){a(c)}})})}post(e){const{url:t,data:i,headers:s,timeout:r}=e;return new Promise((o,a)=>{Pe.request({url:Ro("https:",t),data:i,method:"POST",header:s,timeout:r,success(c){o(c)},fail(c){a(c)}})})}upload(e){return new Promise((t,i)=>{const{url:s,file:r,data:o,headers:a,fileType:c}=e,l=Pe.uploadFile({url:Ro("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){i(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 N6={setItem(n,e){Pe.setStorageSync(n,e)},getItem:n=>Pe.getStorageSync(n),removeItem(n){Pe.removeStorageSync(n)},clear(){Pe.clearStorageSync()}};var U6={genAdapter:function(){return{root:{},reqClass:M6,localStorage:N6,primaryStorage:"local"}},isMatch:function(){return!0},runtime:"uni_app"};qg.useAdapters(U6);const Pc=qg,$6=Pc.init;Pc.init=function(n){n.env=n.spaceId;const e=$6.call(this,n);e.config.provider="tencent",e.config.spaceId=n.spaceId;const t=e.auth;return e.auth=function(i){const s=t.call(this,i);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}=Fg(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 O0=Pc;async function H6(n,e){const t=`http://${n}:${e}/system/ping`;try{const s=await(i={url:t,timeout:500},new Promise((r,o)=>{Pe.request({...i,success(a){r(a)},fail(a){o(a)}})}));return!(!s.data||s.data.code!==0)}catch{return!1}var i}async function Wg(n,e){let t;for(let i=0;i<n.length;i++){const s=n[i];if(await H6(s,e)){t=s;break}}return{address:t,port:e}}const G6={"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 K6=class{constructor(n){if(["spaceId","clientSecret"].forEach(e=>{if(!Object.prototype.hasOwnProperty.call(n,e))throw new Error(`${e} required`)}),!n.endpoint)throw new Error("集群空间未配置ApiEndpoint,配置后需要重新关联服务空间后生效");this.config=Object.assign({},n),this.config.provider="dcloud",this.config.requestUrl=this.config.endpoint+"/client",this.config.envType=this.config.envType||"public",this.adapter=Pe}async request(n,e=!0){const t=e;return n=t?await this.setupLocalRequest(n):this.setupRequest(n),Promise.resolve().then(()=>t?this.requestLocal(n):fn.wrappedRequest(n,this.adapter.request))}requestLocal(n){return new Promise((e,t)=>{this.adapter.request(Object.assign(n,{complete(i){if(i||(i={}),!i.statusCode||i.statusCode>=400){const s=i.data&&i.data.code||"SYS_ERR",r=i.data&&i.data.message||"request:fail";return t(new Q({code:s,message:r}))}e({success:!0,result:i.data})}}))})}setupRequest(n){const e=Object.assign({},n,{spaceId:this.config.spaceId,timestamp:Date.now()}),t={"Content-Type":"application/json"};t["x-serverless-sign"]=fn.sign(e,this.config.clientSecret);const i=Al();t["x-client-info"]=encodeURIComponent(JSON.stringify(i));const{token:s}=cs();return t["x-client-token"]=s,{url:this.config.requestUrl,method:"POST",data:e,dataType:"json",header:JSON.parse(JSON.stringify(t))}}async setupLocalRequest(n){const e=Al(),{token:t}=cs(),i=Object.assign({},n,{spaceId:this.config.spaceId,timestamp:Date.now(),clientInfo:e,token:t}),{address:s,servePort:r}=this.__dev__&&this.__dev__.debugInfo||{},{address:o}=await Wg(s,r);return{url:`http://${o}:${r}/${G6[n.method]}`,method:"POST",data:i,dataType:"json",header:JSON.parse(JSON.stringify({"Content-Type":"application/json"}))}}callFunction(n){const e={method:"serverless.function.runtime.invoke",params:JSON.stringify({functionTarget:n.name,functionArgs:n.data||{}})};return this.request(e,!1)}getUploadFileOptions(n){const e={method:"serverless.file.resource.generateProximalSign",params:JSON.stringify(n)};return this.request(e)}reportUploadFile(n){const e={method:"serverless.file.resource.report",params:JSON.stringify(n)};return this.request(e)}uploadFile({filePath:n,cloudPath:e,fileType:t="image",onUploadProgress:i}){if(!e)throw new Q({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:n,fileType:t,success(d){d&&d.statusCode<400?l(d):u(new Q({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(d){u(new Q({code:d.code||"UPLOAD_FAILED",message:d.message||d.errMsg||"文件上传失败"}))}});typeof i=="function"&&f&&typeof f.onProgressUpdate=="function"&&f.onProgressUpdate(d=>{i({loaded:d.totalBytesSent,total:d.totalBytesExpectedToSend})})})}).then(()=>this.reportUploadFile({cloudPath:e})).then(r=>new Promise((o,a)=>{r.success?o({success:!0,filePath:n,fileID:s}):a(new Q({code:"UPLOAD_FAILED",message:"文件上传失败"}))}))}deleteFile({fileList:n}){const e={method:"serverless.file.resource.delete",params:JSON.stringify({fileList:n})};return this.request(e).then(t=>{if(t.success)return t.result;throw new Q({code:"DELETE_FILE_FAILED",message:"删除文件失败"})})}getTempFileURL({fileList:n,maxAge:e}={}){if(!Array.isArray(n)||n.length===0)throw new Q({code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"});const t={method:"serverless.file.resource.getTempFileURL",params:JSON.stringify({fileList:n,maxAge:e})};return this.request(t).then(i=>{if(i.success)return{fileList:i.result.fileList.map(s=>({fileID:s.fileID,tempFileURL:s.tempFileURL}))};throw new Q({code:"GET_TEMP_FILE_URL_FAILED",message:"获取临时文件链接失败"})})}},M0={init(n){const e=new K6(n),t={signInAnonymously:function(){return Promise.resolve()},getLoginState:function(){return Promise.resolve(!1)}};return e.auth=function(){return t},e.customAuth=e.auth,e}},Qn=Nt(function(n,e){n.exports=gi.enc.Hex});function zg(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){var e=16*Math.random()|0;return(n==="x"?e:3&e|8).toString(16)})}function Qg(n="",e={}){const{data:t,functionName:i,method:s,headers:r,signHeaderKeys:o=[],config:a}=e,c=String(Date.now()),l=zg(),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":i,"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=""]=n.split("?")||[],p=function(m){const g="HMAC-SHA256",y=m.signedHeaders.join(";"),v=m.signedHeaders.map(I=>`${I.toLowerCase()}:${m.headers[I]}
- `).join(""),x=Sl(m.body).toString(Qn),E=`${m.method.toUpperCase()}
- ${m.path}
- ${m.query}
- ${v}
- ${y}
- ${x}
- `,S=Sl(E).toString(Qn),T=`${g}
- ${m.timestamp}
- ${S}
- `,_=Ng(T,m.secretKey).toString(Qn);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}${n}`,headers:Object.assign({},u,{Authorization:p})}}function Yg({url:n,data:e,method:t="POST",headers:i={},timeout:s}){return new Promise((r,o)=>{Pe.request({url:n,method:t,data:typeof e=="object"?JSON.stringify(e):e,header:i,dataType:"json",timeout:s,complete:(a={})=>{const c=i["x-trace-id"]||"";if(!a.statusCode||a.statusCode>=400){const{message:l,errMsg:u,trace_id:f}=a.data||{};return o(new Q({code:"SYS_ERR",message:l||u||"request:fail",requestId:f||c}))}r({status:a.statusCode,data:a.data,headers:a.header,requestId:c})}})})}function N0(n,e){const{path:t,data:i,method:s="GET"}=n,{url:r,headers:o}=Qg(t,{functionName:"",data:i,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 Yg({url:r,data:i,method:s,headers:o}).then(a=>{const c=a.data||{};if(!c.success)throw new Q({code:a.errCode,message:a.errMsg,requestId:a.requestId});return c.data||{}}).catch(a=>{throw new Q({code:a.errCode,message:a.errMsg,requestId:a.requestId})})}function V6(n=""){const e=n.trim().replace(/^cloud:\/\//,""),t=e.indexOf("/");if(t<=0)throw new Q({code:"INVALID_PARAM",message:"fileID不合法"});const i=e.substring(0,t),s=e.substring(t+1);return i!==this.config.spaceId&&console.warn("file ".concat(n," does not belong to env ").concat(this.config.spaceId)),s}function j6(n=""){return"cloud://".concat(this.config.spaceId,"/").concat(n.replace(/^\/+/,""))}class q6{constructor(e){this.config=e}signedURL(e,t={}){const i=`/ws/function/${e}`,s=this.config.wsEndpoint.replace(/^ws(s)?:\/\//,""),r=Object.assign({},t,{accessKeyId:this.config.accessKey,signatureNonce:zg(),timestamp:""+Date.now()}),o=[i,["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",Sl(o).toString(Qn)].join(`
- `),c=Ng(a,this.config.secretKey).toString(Qn),l=Object.keys(r).map(u=>`${u}=${encodeURIComponent(r[u])}`).join("&");return`${this.config.wsEndpoint}${i}?${l}&signature=${c}`}}var W6=class{constructor(n){if(["spaceId","spaceAppId","accessKey","secretKey"].forEach(e=>{if(!Object.prototype.hasOwnProperty.call(n,e))throw new Error(`${e} required`)}),n.endpoint){if(typeof n.endpoint!="string")throw new Error("endpoint must be string");if(!/^https:\/\//.test(n.endpoint))throw new Error("endpoint must start with https://");n.endpoint=n.endpoint.replace(/\/$/,"")}this.config=Object.assign({},n,{endpoint:n.endpoint||`https://${n.spaceId}.api-hz.cloudbasefunction.cn`,wsEndpoint:n.wsEndpoint||`wss://${n.spaceId}.api-hz.cloudbasefunction.cn`}),this._websocket=new q6(this.config)}callFunction(n){return function(e,t){const{name:i,data:s,async:r=!1,timeout:o}=e,a="POST",c={"x-to-function-name":i};r&&(c["x-function-invoke-type"]="async");const{url:l,headers:u}=Qg("/functions/invokeFunction",{functionName:i,data:s,method:a,headers:c,signHeaderKeys:["x-to-function-name"],config:t});return Yg({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 Q({code:d,message:f.errMsg,requestId:f.requestId});return{errCode:d,success:d===0,requestId:f.requestId,result:f.data}}).catch(f=>{throw new Q({code:f.errCode,message:f.errMsg,requestId:f.requestId})})}(n,this.config)}uploadFileToOSS({url:n,filePath:e,fileType:t,formData:i,onUploadProgress:s}){return new Promise((r,o)=>{const a=Pe.uploadFile({url:n,filePath:e,fileType:t,formData:i,name:"file",success(c){c&&c.statusCode<400?r(c):o(new Q({code:"UPLOAD_FAILED",message:"文件上传失败"}))},fail(c){o(new Q({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:n,cloudPath:e="",fileType:t="image",onUploadProgress:i}){if(ls(e)!=="string")throw new Q({code:"INVALID_PARAM",message:"cloudPath必须为字符串类型"});if(!(e=e.trim()))throw new Q({code:"INVALID_PARAM",message:"cloudPath不可为空"});if(/:\/\//.test(e))throw new Q({code:"INVALID_PARAM",message:"cloudPath不合法"});const s=await N0({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:n,fileType:t,formData:c,onUploadProgress:i}).then(()=>({fileID:r}))}async getTempFileURL({fileList:n}){return new Promise((e,t)=>{(!n||n.length<0)&&e({code:"INVALID_PARAM",message:"fileList不能为空数组"}),n.length>50&&e({code:"INVALID_PARAM",message:"fileList数组长度不能超过50"});const i=[];for(const s of n){let r;ls(s)!=="string"&&e({code:"INVALID_PARAM",message:"fileList的元素必须是非空的字符串"});try{r=V6.call(this,s)}catch(o){console.warn(o.errCode,o.errMsg),r=s}i.push({file_id:r,expire:600})}N0({path:"/?download_url",data:{file_list:i},method:"POST"},this.config).then(s=>{const{file_list:r=[]}=s;e({fileList:r.map(o=>({fileID:j6.call(this,o.file_id),tempFileURL:o.download_url}))})}).catch(s=>t(s))})}async connectWebSocket(n){const{name:e,query:t}=n;return Pe.connectSocket({url:this._websocket.signedURL(e,t),complete:()=>{}})}},z6={init:n=>{n.provider="alipay";const e=new W6(n);return e.auth=function(){return{signInAnonymously:function(){return Promise.resolve()},getLoginState:function(){return Promise.resolve(!0)}}},e}};function Xg({data:n}){let e;e=Al();const t=JSON.parse(JSON.stringify(n||{}));if(Object.assign(t,{clientInfo:e}),!t.uniIdToken){const{token:i}=cs();i&&(t.uniIdToken=i)}return t}async function U0(n={}){await this.__dev__.initLocalNetwork();const{localAddress:e,localPort:t}=this.__dev__,i={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/${n.name}`;return new Promise((a,c)=>{Pe.request({method:"POST",url:r,data:{name:n.name,platform:Sn,provider:i,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(`此云函数(${n.name})依赖加密公共模块不可本地调试,自动切换为云端已部署的云函数`);break;case"FUNCTION_ENCRYPTED":console.error(`此云函数(${n.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(n)}return new Promise((l,u)=>{const f=Xg.call(this,{data:n.data});Pe.request({method:"POST",url:o,data:{provider:i,platform:Sn,param:f},timeout:n.timeout,success:({statusCode:d,data:h}={})=>!d||d>=400?u(new Q({code:h.code||"SYS_ERR",message:h.message||"request:fail"})):l({result:h}),fail(d){u(new Q({code:d.code||d.errCode||"SYS_ERR",message:d.message||d.errMsg||"request:fail"}))}})})})}const Q6=[{rule:/fc_function_not_found|FUNCTION_NOT_FOUND/,content:",云函数[{functionName}]在云端不存在,请检查此云函数名称是否正确以及该云函数是否已上传到服务空间",mode:"append"}];var Jg=/[\\^$.*+?()[\]{}|]/g,Y6=RegExp(Jg.source);function $0(n,e,t){return n.replace(new RegExp((i=e)&&Y6.test(i)?i.replace(Jg,"\\$&"):i,"g"),t);var i}const ui={NONE:"none",REQUEST:"request",RESPONSE:"response",BOTH:"both"},H0="_globalUniCloudStatus",Zg="_globalUniCloudSecureNetworkCache__{spaceId}",X6="uni-secure-network",kc={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 em(n){const{errSubject:e,subject:t,errCode:i,errMsg:s,code:r,message:o,cause:a}=n||{};return new Q({subject:e||t||X6,code:i||r||kc.SYSTEM_ERROR.code,message:s||o,cause:a})}class J6{constructor({secretType:e,uniCloudIns:t}={}){this.clientType="",this.secretType=e||ui.NONE,this.uniCloudIns=t;const{provider:i,spaceId:s}=this.uniCloudIns.config;var r;this.provider=i,this.spaceId=s,this.scopedGlobalCache=(r=this.uniCloudIns,Gi(Zg.replace("{spaceId}",r.config.spaceId)))}getSystemInfo(){return this._systemInfo||(this._systemInfo=us()),this._systemInfo}get appId(){return this.getSystemInfo().appId}get deviceId(){return this.getSystemInfo().deviceId}async encryptData(e){return this.secretType===ui.NONE?e:this.platformEncryptData(e)}async decryptResult(e){if(this.secretType===ui.NONE)return e;const{errCode:t,errMsg:i,content:s}=e||{};return t||!s?e:this.secretType===ui.REQUEST?s:this.platformDecryptResult(e)}wrapVerifyClientCallFunction(e){const t=this;return async function({name:i,data:s={}}={}){await t.prepare(),(s=JSON.parse(JSON.stringify(s)))._uniCloudOptions=await t.platformGetSignOption();let r=await e({name:i,data:s});return t.isClientKeyNotFound(r)&&(await t.prepare({forceUpdate:!0}),s._uniCloudOptions=await t.platformGetSignOption(),r=await e({name:i,data:s})),r}}wrapEncryptDataCallFunction(e){const t=this;return async function({name:i,data:s={}}={}){await t.prepare();const r=await t.encryptData(s);let o=await e({name:i,data:r});if(t.isClientKeyNotFound(o)){await t.prepare({forceUpdate:!0});const a=await t.encryptData(s);o=await e({name:i,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 bl(n){return parseInt(n)===n}function G0(n){if(!bl(n.length))return!1;for(var e=0;e<n.length;e++)if(!bl(n[e])||n[e]<0||n[e]>255)return!1;return!0}function We(n,e){if(n.buffer&&n.name==="Uint8Array")return e&&(n=n.slice?n.slice():Array.prototype.slice.call(n)),n;if(Array.isArray(n)){if(!G0(n))throw new Error("Array contains invalid value: "+n);return new Uint8Array(n)}if(bl(n.length)&&G0(n))return new Uint8Array(n);throw new Error("unsupported array-like object")}function qe(n){return new Uint8Array(n)}function Je(n,e,t,i,s){i==null&&s==null||(n=n.slice?n.slice(i,s):Array.prototype.slice.call(n,i,s)),e.set(n,t)}var wo,Z6={toBytes:function(n){var e=[],t=0;for(n=encodeURI(n);t<n.length;){var i=n.charCodeAt(t++);i===37?(e.push(parseInt(n.substr(t,2),16)),t+=2):e.push(i)}return We(e)},fromBytes:function(n){for(var e=[],t=0;t<n.length;){var i=n[t];i<128?(e.push(String.fromCharCode(i)),t++):i>191&&i<224?(e.push(String.fromCharCode((31&i)<<6|63&n[t+1])),t+=2):(e.push(String.fromCharCode((15&i)<<12|(63&n[t+1])<<6|63&n[t+2])),t+=3)}return e.join("")}},eT=(wo="0123456789abcdef",{toBytes:function(n){for(var e=[],t=0;t<n.length;t+=2)e.push(parseInt(n.substr(t,2),16));return e},fromBytes:function(n){for(var e=[],t=0;t<n.length;t++){var i=n[t];e.push(wo[(240&i)>>4]+wo[15&i])}return e.join("")}}),tT={16:10,24:12,32:14},iT=[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],ht=[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],Ns=[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],nT=[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],sT=[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],rT=[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],oT=[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],aT=[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],lT=[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],cT=[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],uT=[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],fT=[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],dT=[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],hT=[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],pT=[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 Po(n){for(var e=[],t=0;t<n.length;t+=4)e.push(n[t]<<24|n[t+1]<<16|n[t+2]<<8|n[t+3]);return e}class Si{constructor(e){if(!(this instanceof Si))throw Error("AES must be instanitated with `new`");Object.defineProperty(this,"key",{value:We(e,!0)}),this._prepare()}_prepare(){var e=tT[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 i,s=4*(e+1),r=this.key.length/4,o=Po(this.key);for(t=0;t<r;t++)i=t>>2,this._Ke[i][t%4]=o[t],this._Kd[e-i][t%4]=o[t];for(var a,c=0,l=r;l<s;){if(a=o[r-1],o[0]^=ht[a>>16&255]<<24^ht[a>>8&255]<<16^ht[255&a]<<8^ht[a>>24&255]^iT[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]^=ht[255&a]^ht[a>>8&255]<<8^ht[a>>16&255]<<16^ht[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]=fT[a>>24&255]^dT[a>>16&255]^hT[a>>8&255]^pT[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,i=[0,0,0,0],s=Po(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++)i[r]=nT[s[r]>>24&255]^sT[s[(r+1)%4]>>16&255]^rT[s[(r+2)%4]>>8&255]^oT[255&s[(r+3)%4]]^this._Ke[o][r];s=i.slice()}var a,c=qe(16);for(r=0;r<4;r++)a=this._Ke[t][r],c[4*r]=255&(ht[s[r]>>24&255]^a>>24),c[4*r+1]=255&(ht[s[(r+1)%4]>>16&255]^a>>16),c[4*r+2]=255&(ht[s[(r+2)%4]>>8&255]^a>>8),c[4*r+3]=255&(ht[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,i=[0,0,0,0],s=Po(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++)i[r]=aT[s[r]>>24&255]^lT[s[(r+3)%4]>>16&255]^cT[s[(r+2)%4]>>8&255]^uT[255&s[(r+1)%4]]^this._Kd[o][r];s=i.slice()}var a,c=qe(16);for(r=0;r<4;r++)a=this._Kd[t][r],c[4*r]=255&(Ns[s[r]>>24&255]^a>>24),c[4*r+1]=255&(Ns[s[(r+3)%4]>>16&255]^a>>16),c[4*r+2]=255&(Ns[s[(r+2)%4]>>8&255]^a>>8),c[4*r+3]=255&(Ns[255&s[(r+1)%4]]^a);return c}}class Bc{constructor(e){if(!(this instanceof Bc))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new Si(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),i=qe(16),s=0;s<e.length;s+=16)Je(e,i,0,s,s+16),Je(i=this._aes.encrypt(i),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),i=qe(16),s=0;s<e.length;s+=16)Je(e,i,0,s,s+16),Je(i=this._aes.decrypt(i),t,s);return t}}class Fc{constructor(e,t){if(!(this instanceof Fc))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 Si(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),i=qe(16),s=0;s<e.length;s+=16){Je(e,i,0,s,s+16);for(var r=0;r<16;r++)i[r]^=this._lastCipherblock[r];this._lastCipherblock=this._aes.encrypt(i),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),i=qe(16),s=0;s<e.length;s+=16){Je(e,i,0,s,s+16),i=this._aes.decrypt(i);for(var r=0;r<16;r++)t[s+r]=i[r]^this._lastCipherblock[r];Je(e,this._lastCipherblock,0,s,s+16)}return t}}class Oc{constructor(e,t,i){if(!(this instanceof Oc))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);i||(i=1),this.segmentSize=i,this._shiftRegister=We(t,!0),this._aes=new Si(e)}encrypt(e){if(e.length%this.segmentSize!=0)throw new Error("invalid plaintext size (must be segmentSize bytes)");for(var t,i=We(e,!0),s=0;s<i.length;s+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var r=0;r<this.segmentSize;r++)i[s+r]^=t[r];Je(this._shiftRegister,this._shiftRegister,0,this.segmentSize),Je(i,this._shiftRegister,16-this.segmentSize,s,s+this.segmentSize)}return i}decrypt(e){if(e.length%this.segmentSize!=0)throw new Error("invalid ciphertext size (must be segmentSize bytes)");for(var t,i=We(e,!0),s=0;s<i.length;s+=this.segmentSize){t=this._aes.encrypt(this._shiftRegister);for(var r=0;r<this.segmentSize;r++)i[s+r]^=t[r];Je(this._shiftRegister,this._shiftRegister,0,this.segmentSize),Je(e,this._shiftRegister,16-this.segmentSize,s,s+this.segmentSize)}return i}}class Mc{constructor(e,t){if(!(this instanceof Mc))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 Si(e)}encrypt(e){for(var t=We(e,!0),i=0;i<t.length;i++)this._lastPrecipherIndex===16&&(this._lastPrecipher=this._aes.encrypt(this._lastPrecipher),this._lastPrecipherIndex=0),t[i]^=this._lastPrecipher[this._lastPrecipherIndex++];return t}decrypt(e){return this.encrypt(e)}}class fs{constructor(e){if(!(this instanceof fs))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 Nc{constructor(e,t){if(!(this instanceof Nc))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",t instanceof fs||(t=new fs(t)),this._counter=t,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new Si(e)}encrypt(e){for(var t=We(e,!0),i=0;i<t.length;i++)this._remainingCounterIndex===16&&(this._remainingCounter=this._aes.encrypt(this._counter._counter),this._remainingCounterIndex=0,this._counter.increment()),t[i]^=this._remainingCounter[this._remainingCounterIndex++];return t}decrypt(e){return this.encrypt(e)}}var fi={AES:Si,Counter:fs,ModeOfOperation:{ecb:Bc,cbc:Fc,cfb:Oc,ofb:Mc,ctr:Nc},utils:{hex:eT,utf8:Z6},padding:{pkcs7:{pad:function(n){var e=16-(n=We(n,!0)).length%16,t=qe(n.length+e);Je(n,t);for(var i=n.length;i<t.length;i++)t[i]=e;return t},strip:function(n){if((n=We(n,!0)).length<16)throw new Error("PKCS#7 invalid length");var e=n[n.length-1];if(e>16)throw new Error("PKCS#7 padding byte out of range");for(var t=n.length-e,i=0;i<e;i++)if(n[t+i]!==e)throw new Error("PKCS#7 invalid padding byte");var s=qe(t);return Je(n,s,0,0,t),s}}},_arrayTest:{coerceArray:We,createArray:qe,copyArray:Je}};function K0(n,e,t){const i=new Uint8Array(Y.base64ToArrayBuffer(e)),s=fi.utils.utf8.toBytes(t),r=fi.utils.utf8.toBytes(n),o=new fi.ModeOfOperation.cbc(i,s),a=fi.padding.pkcs7.pad(r),c=o.encrypt(a);return Y.arrayBufferToBase64(c)}let _l,Mn=null;class gT extends J6{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(Mn&&Mn.expireTime){const e=Date.now();if(Mn.expireTime-e>0)return this.userEncryptKey=Mn,this.userEncryptKey}return new Promise((e,t)=>{Y.getUserCryptoManager().getLatestUserKey({success:i=>{Mn=i,this.userEncryptKey=i,e(this.userEncryptKey)},fail:i=>{t(em({...kc.GET_ENCRYPT_KEY_FAILED,cause:i}))}})})}getWxAppId(){return hi.getAccountInfoSync().miniProgram.appId}async platformGetSignOption(){const{encryptKey:e,iv:t,version:i}=await this.getUserEncryptKey();return{verifyClientSign:K0(JSON.stringify({data:JSON.stringify({}),appId:this.appId,deviceId:this.deviceId,wxAppId:this.getWxAppId(),simulator:us().platform==="devtools",timestamp:Date.now()}),e,t),encryptKeyId:i,mpWeixinCode:this.scopedGlobalCache.mpWeixinCode,mpWeixinOpenid:this.scopedGlobalCache.mpWeixinOpenid}}async platformEncryptData(e){const{encryptKey:t,iv:i,version:s}=await this.getUserEncryptKey(),r={secretType:this.secretType,encryptKeyId:s,mpWeixinCode:this.scopedGlobalCache.mpWeixinCode,mpWeixinOpenid:this.scopedGlobalCache.mpWeixinOpenid};return this.secretType===ui.RESPONSE?{content:e,_uniCloudOptions:r}:{content:K0(JSON.stringify({data:JSON.stringify(e),appId:this.appId,deviceId:this.deviceId,wxAppId:this.getWxAppId(),simulator:us().platform==="devtools",timestamp:Date.now()}),t,i),_uniCloudOptions:r}}async platformDecryptResult(e){const{content:t}=e,{encryptKey:i,iv:s}=await this.getUserEncryptKey();return JSON.parse(function(r,o,a){const c=new Uint8Array(Y.base64ToArrayBuffer(r)),l=new Uint8Array(Y.base64ToArrayBuffer(o)),u=fi.utils.utf8.toBytes(a),f=new fi.ModeOfOperation.cbc(l,u),d=fi.padding.pkcs7.strip(f.decrypt(c));return fi.utils.utf8.fromBytes(d)}(t,i,s))}isClientKeyNotFound(){return!1}}function V0({secretType:n}={}){return n===ui.REQUEST||n===ui.RESPONSE||n===ui.BOTH}function j0({name:n,data:e={}}={}){return Sn==="app"}function mT({provider:n,spaceId:e,functionName:t}={}){const{appId:i,uniPlatform:s,osName:r}=us();let o=s;s==="app"&&(o=r);const a=function({provider:f,spaceId:d}={}){const h=c6;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:n,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===i&&(f.platform||"").toLowerCase()===o.toLowerCase()))return!0;throw console.error(`此应用[appId: ${i}, platform: ${o}]不在云端配置的允许访问的应用列表内,参考:https://uniapp.dcloud.net.cn/uniCloud/secure-network.html#verify-client`),em(kc.APP_INFO_INVALID)}function q0({functionName:n,result:e,logPvd:t}){if(this.__dev__.debugLog&&e&&e.requestId){const i=JSON.stringify({spaceId:this.config.spaceId,functionName:n,requestId:e.requestId});console.log(`[${t}-request]${i}[/${t}-request]`)}}function xT(n){const e=n.callFunction,t=function(i){const s=i.name;i.data=Xg.call(n,{data:i.data});const r={aliyun:"aliyun",tencent:"tcb",tcb:"tcb",alipay:"alipay",dcloud:"dcloud"}[this.config.provider],o=V0(i),a=j0(i),c=o||a;return e.call(this,i).then(l=>(l.errCode=0,!c&&q0.call(this,{functionName:s,result:l,logPvd:r}),Promise.resolve(l)),l=>(!c&&q0.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=$0(v,`{$${x}}`,y[x]);for(const x in f)v=$0(v,`{${x}}`,f[x]);return g==="replace"?v:u+v}return u}({message:`[${i.name}]: ${l.message}`,formatter:Q6,extraInfo:{functionName:s}})),Promise.reject(l)))};n.callFunction=function(i){const{provider:s,spaceId:r}=n.config,o=i.name;let a,c;return i.data=i.data||{},n.__dev__.debugInfo&&!n.__dev__.debugInfo.forceRemote&&wg?(n._callCloudFunction||(n._callCloudFunction=t,n._callLocalFunction=U0),a=U0):a=t,a=a.bind(n),j0(i)||(function({name:l,data:u={}}){return l==="uni-id-co"&&u.method==="secureNetworkHandshakeByWeixin"}(i)?c=a.call(n,i):V0(i)?c=new _l({secretType:i.secretType,uniCloudIns:n}).wrapEncryptDataCallFunction(t.bind(n))(i):mT({provider:s,spaceId:r,functionName:o})?c=new _l({secretType:i.secretType,uniCloudIns:n}).wrapVerifyClientCallFunction(t.bind(n))(i):c=a(i)),Object.defineProperty(c,"result",{get:()=>(console.warn("当前返回结果为Promise类型,不可直接访问其result属性,详情请参考:https://uniapp.dcloud.net.cn/uniCloud/faq?id=promise"),{})}),c.then(l=>l)}}_l=gT;const tm=Symbol("CLIENT_DB_INTERNAL");function wr(n,e){return n.then="DoNotReturnProxyWithAFunctionNamedThen",n._internalType=tm,n.inspect=null,n.__v_raw=void 0,new Proxy(n,{get(t,i,s){if(i==="_uniClient")return null;if(typeof i=="symbol")return t[i];if(i in t||typeof i!="string"){const r=t[i];return typeof r=="function"?r.bind(t):r}return e.get(t,i,s)}})}function W0(n){return{on:(e,t)=>{n[e]=n[e]||[],n[e].indexOf(t)>-1||n[e].push(t)},off:(e,t)=>{n[e]=n[e]||[];const i=n[e].indexOf(t);i!==-1&&n[e].splice(i,1)}}}const yT=["db.Geo","db.command","command.aggregate"];function im(n,e){return yT.indexOf(`${n}.${e}`)>-1}function Oi(n){switch(ls(n=Og(n))){case"array":return n.map(e=>Oi(e));case"object":return n._internalType===tm||Object.keys(n).forEach(e=>{n[e]=Oi(n[e])}),n;case"regexp":return{$regexp:{source:n.source,flags:n.flags}};case"date":return{$date:n.toISOString()};default:return n}}function Nn(n){return n&&n.content&&n.content.$method}class vT{constructor(e,t,i){this.content=e,this.prevStage=t||null,this.udb=null,this._database=i}toJSON(){let e=this;const t=[e.content];for(;e.prevStage;)e=e.prevStage,t.push(e.content);return{$db:t.reverse().map(i=>({$method:i.$method,$param:Oi(i.$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=Nn(e),i=Nn(e.prevStage);if(t==="aggregate"&&i==="collection"||t==="pipeline")return!0;e=e.prevStage}return!1}get isCommand(){let e=this;for(;e;){if(Nn(e)==="command")return!0;e=e.prevStage}return!1}get isAggregateCommand(){let e=this;for(;e;){const t=Nn(e),i=Nn(e.prevStage);if(t==="aggregate"&&i==="command")return!0;e=e.prevStage}return!1}getNextStageFn(e){const t=this;return function(){return ds({$method:e,$param:Oi(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 i=this.getAction(),s=this.getCommand();if(s.$db.push({$method:e,$param:Oi(t)}),a6){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:i,command:s})}}function ds(n,e,t){return wr(new vT(n,e,t),{get(i,s){let r="db";return i&&i.content&&(r=i.content.$method),im(r,s)?ds({$method:s},i,t):function(){return ds({$method:s,$param:Oi(Array.from(arguments))},i,t)}}})}function ko({path:n,method:e}){return class{constructor(){this.param=Array.from(arguments)}toJSON(){return{$newDb:[...n.map(t=>({$method:t})),{$method:e,$param:this.param}]}}toString(){return JSON.stringify(this.toJSON())}}}class ET{constructor({uniClient:e={},isJQL:t=!1}={}){this._uniClient=e,this._authCallBacks={},this._dbCallBacks={},e._isDefault&&(this._dbCallBacks=Gi("_globalUniCloudDatabaseCallback")),t||(this.auth=W0(this._authCallBacks)),this._isJQL=t,Object.assign(this,W0(this._dbCallBacks)),this.env=wr({},{get:(i,s)=>({$env:s})}),this.Geo=wr({},{get:(i,s)=>ko({path:["Geo"],method:s})}),this.serverDate=ko({path:[],method:"serverDate"}),this.RegExp=ko({path:[],method:"RegExp"})}getCloudEnv(e){if(typeof e!="string"||!e.trim())throw new Error("getCloudEnv参数错误");return{$env:e.replace("$cloudEnv_","")}}_callback(e,t){const i=this._dbCallBacks;i[e]&&i[e].forEach(s=>{s(...t)})}_callbackAuth(e,t){const i=this._authCallBacks;i[e]&&i[e].forEach(s=>{s(...t)})}multiSend(){const e=Array.from(arguments),t=e.map(i=>{const s=i.getAction(),r=i.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 z0(n,e={}){return wr(new n(e),{get:(t,i)=>im("db",i)?ds({$method:i},null,t):function(){return ds({$method:i,$param:Oi(Array.from(arguments))},null,t)}})}class Q0 extends ET{_parseResult(e){return this._isJQL?e.result:e}_callCloudFunction({action:e,command:t,multiCommand:i,queryList:s}){function r(f,d){if(i&&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]),nt(st(a,"fail"),f).then(()=>nt(st(a,"complete"),f)).then(()=>(r(null,f),mt(Re.RESPONSE,{type:ci.CLIENT_DB,content:f}),Promise.reject(f)))}const l=nt(st(a,"invoke")),u=this._uniClient;return l.then(()=>u.callFunction({name:"DCloud-clientDB",type:Rr.CLIENT_DB,data:{action:e,command:t,multiCommand:i}})).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 Q({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&&(Mg({token:p,tokenExpired:m}),this._callbackAuth("refreshToken",[{token:p,tokenExpired:m}]),this._callback("refreshToken",[{token:p,tokenExpired:m}]),mt(Re.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 nt(st(a,"success"),v).then(()=>nt(st(a,"complete"),v)).then(()=>{r(v,null);const x=o._parseResult(v);return mt(Re.RESPONSE,{type:ci.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 Q({code:f.code||"SYSTEM_ERROR",message:f.message,requestId:f.requestId}))))}}const wi="token无效,跳转登录页面",nm="token过期,跳转登录页面",sm={TOKEN_INVALID_TOKEN_EXPIRED:nm,TOKEN_INVALID_INVALID_CLIENTID:wi,TOKEN_INVALID:wi,TOKEN_INVALID_WRONG_TOKEN:wi,TOKEN_INVALID_ANONYMOUS_USER:wi},AT={"uni-id-token-expired":nm,"uni-id-check-token-failed":wi,"uni-id-token-not-exist":wi,"uni-id-check-device-feature-failed":wi},Il={...sm,...AT,default:"用户未登录或登录状态过期,自动跳转登录页面"};function Y0(n,e){let t="";return t=n?`${n}/${e}`:e,t.replace(/^\//,"")}function X0(n=[],e=""){const t=[],i=[];return n.forEach(s=>{s.needLogin===!0?t.push(Y0(e,s.path)):s.needLogin===!1&&i.push(Y0(e,s.path))}),{needLoginPage:t,notNeedLoginPage:i}}function hs(n){return n.split("?")[0].replace(/^\//,"")}function Uc(){return function(n){let e=n&&n.$page&&n.$page.fullPath;return e?(e.charAt(0)!=="/"&&(e="/"+e),e):""}(function(){const n=getCurrentPages();return n[n.length-1]}())}function rm(){return hs(Uc())}function ST(n="",e={}){if(!n||!(e&&e.list&&e.list.length))return!1;const t=e.list,i=hs(n);return t.some(s=>s.pagePath===i)}const TT=!!_g.uniIdRouter,{loginPage:ps,routerNeedLogin:bT,resToLogin:_T,needLoginPage:om,notNeedLoginPage:IT,loginPageInTabBar:CT}=function({pages:n=[],subPackages:e=[],uniIdRouter:t={},tabBar:i={}}=_g){const{loginPage:s,needLogin:r=[],resToLogin:o=!0}=t,{needLoginPage:a,notNeedLoginPage:c}=X0(n),{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:ST(s,i)}}();if(om.indexOf(ps)>-1)throw new Error(`Login page [${ps}] should not be "needLogin", please check your pages.json`);function am(n){const e=rm();if(n.charAt(0)==="/")return n;const[t,i]=n.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("/")+(i?"?"+i:"")}function LT(n){const e=hs(am(n));return!(IT.indexOf(e)>-1)&&(om.indexOf(e)>-1||bT.some(t=>function(i,s){return new RegExp(s).test(i)}(n,t)))}function lm({redirect:n}){const e=hs(n),t=hs(ps);return rm()!==t&&e!==t}function Cl({api:n,redirect:e}={}){if(!e||!lm({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}(ps,e);CT?n!=="navigateTo"&&n!=="redirectTo"||(n="switchTab"):n==="switchTab"&&(n="navigateTo");const i={navigateTo:Y.navigateTo,redirectTo:Y.redirectTo,switchTab:Y.switchTab,reLaunch:Y.reLaunch};setTimeout(()=>{i[n]({url:t})},0)}function J0({url:n}={}){const e={abortLoginPageJump:!1,autoToLoginPage:!1},t=function(){const{token:i,tokenExpired:s}=cs();let r;if(i){if(s<Date.now()){const o="uni-id-token-expired";r={errCode:o,errMsg:Il[o]}}}else{const o="uni-id-check-token-failed";r={errCode:o,errMsg:Il[o]}}return r}();if(LT(n)&&t){if(t.uniIdRedirectUrl=n,Is(Re.NEED_LOGIN).length>0)return setTimeout(()=>{mt(Re.NEED_LOGIN,t)},0),e.abortLoginPageJump=!0,e;e.autoToLoginPage=!0}return e}function DT(){(function(){const e=Uc(),{abortLoginPageJump:t,autoToLoginPage:i}=J0({url:e});t||i&&Cl({api:"redirectTo",redirect:e})})();const n=["navigateTo","redirectTo","reLaunch","switchTab"];for(let e=0;e<n.length;e++){const t=n[e];Y.addInterceptor(t,{invoke(i){const{abortLoginPageJump:s,autoToLoginPage:r}=J0({url:i.url});return s?i:r?(Cl({api:t,redirect:am(i.url)}),!1):i}})}}function RT(){this.onResponse(n=>{const{type:e,content:t}=n;let i=!1;switch(e){case"cloudobject":i=function(s){if(typeof s!="object")return!1;const{errCode:r}=s||{};return r in Il}(t);break;case"clientdb":i=function(s){if(typeof s!="object")return!1;const{errCode:r}=s||{};return r in sm}(t)}i&&function(s={}){const r=Is(Re.NEED_LOGIN);Bg().then(()=>{const o=Uc();if(o&&lm({redirect:o}))return r.length>0?mt(Re.NEED_LOGIN,Object.assign({uniIdRedirectUrl:o},s)):void(ps&&Cl({api:"navigateTo",redirect:o}))})}(t)})}function wT(n){(function(e){e.onResponse=function(t){Ao(Re.RESPONSE,t)},e.offResponse=function(t){So(Re.RESPONSE,t)}})(n),function(e){e.onNeedLogin=function(t){Ao(Re.NEED_LOGIN,t)},e.offNeedLogin=function(t){So(Re.NEED_LOGIN,t)},TT&&(Gi(H0).needLoginInit||(Gi(H0).needLoginInit=!0,Bg().then(()=>{DT.call(e)}),_T&&RT.call(e)))}(n),function(e){e.onRefreshToken=function(t){Ao(Re.REFRESH_TOKEN,t)},e.offRefreshToken=function(t){So(Re.REFRESH_TOKEN,t)}}(n)}let cm;const Us="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",PT=/^(?:[A-Za-z\d+/]{4})*?(?:[A-Za-z\d+/]{2}(?:==)?|[A-Za-z\d+/]{3}=?)?$/;function kT(){const n=cs().token||"",e=n.split(".");if(!n||e.length!==3)return{uid:null,role:[],permission:[],tokenExpired:0};let t;try{t=JSON.parse((i=e[1],decodeURIComponent(cm(i).split("").map(function(s){return"%"+("00"+s.charCodeAt(0).toString(16)).slice(-2)}).join(""))))}catch(s){throw new Error("获取当前用户信息出错,详细错误信息为:"+s.message)}var i;return t.tokenExpired=1e3*t.exp,delete t.exp,delete t.iat,t}cm=typeof atob!="function"?function(n){if(n=String(n).replace(/[\t\n\f\r ]+/g,""),!PT.test(n))throw new Error("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");var e;n+="==".slice(2-(3&n.length));for(var t,i,s="",r=0;r<n.length;)e=Us.indexOf(n.charAt(r++))<<18|Us.indexOf(n.charAt(r++))<<12|(t=Us.indexOf(n.charAt(r++)))<<6|(i=Us.indexOf(n.charAt(r++))),s+=t===64?String.fromCharCode(e>>16&255):i===64?String.fromCharCode(e>>16&255,e>>8&255):String.fromCharCode(e>>16&255,e>>8&255,255&e);return s}:atob;var BT=Nt(function(n,e){Object.defineProperty(e,"__esModule",{value:!0});const t="chooseAndUploadFile:ok",i="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)=>{Y.chooseImage({count:l,sizeType:u,sourceType:f,extension:d,success(m){h(s(m,"image"))},fail(m){p({errMsg:m.errMsg.replace("chooseImage:fail",i)})}})})}(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)=>{Y.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",i)})}})})}(a),a):r(o,function(c){const{count:l,extension:u}=c;return new Promise((f,d)=>{let h=Y.chooseFile;if(typeof hi<"u"&&typeof hi.chooseMessageFile=="function"&&(h=hi.chooseMessageFile),typeof h!="function")return d({errMsg:i+" 请指定 type 类型,该平台仅支持选择 image 或 video。"});h({type:"all",count:l,extension:u,success(p){f(s(p))},fail(p){d({errMsg:p.errMsg.replace("chooseFile:fail",i)})}})})}(a),a)}}}),FT=J8(BT);const OT={auto:"auto",onready:"onready",manual:"manual"};function um(n){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===OT.manual)return;let i=!1;const s=[];for(let r=2;r<e.length;r++)e[r]!==t[r]&&(s.push(e[r]),i=!0);e[0]!==t[0]&&(this.mixinDatacomPage.current=this.pageCurrent),this.mixinDatacomPage.size=this.pageSize,this.onMixinDatacomPropsChange(i,s)})},methods:{onMixinDatacomPropsChange(e,t){},mixinDatacomEasyGet({getone:e=!1,success:t,fail:i}={}){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,i&&i(s)}))},mixinDatacomGet(e={}){let t;e=e||{},t=typeof __uniX<"u"&&__uniX?n.databaseForJQL(this.spaceInfo):n.database(this.spaceInfo);const i=e.action||this.action;i&&(t=t.action(i));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 MT(n){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:i,loadingOptions:s,errorOptions:r,parseSystemError:o}=t,a=!i;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 nt(st(f,"invoke"),{...p}),m=await u(...h),await nt(st(f,"success"),{...p,result:m}),m}catch(y){throw g=y,await nt(st(f,"fail"),{...p,error:g}),g}finally{await nt(st(f,"complete"),g?{...p,error:g}:{...p,result:m})}}}({fn:async function u(...f){let d;a&&Y.showLoading({title:s.title,mask:s.mask});const h={name:e,type:Rr.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 n.callFunction(h)}catch(x){p=!0,d={result:new Q(x)}}const{errSubject:m,errCode:g,errMsg:y,newToken:v}=d.result||{};if(a&&Y.hideLoading(),v&&v.token&&v.tokenExpired&&(Mg(v),mt(Re.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")Y.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:R,confirmText:b}={}){return new Promise((L,k)=>{Y.showModal({title:T,content:_,showCancel:I,cancelText:R,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 Q({subject:m,code:g,message:y,requestId:d.requestId});throw E.detail=d.result,mt(Re.RESPONSE,{type:ci.CLOUD_OBJECT,content:E}),E}return mt(Re.RESPONSE,{type:ci.CLOUD_OBJECT,content:d.result}),d.result},interceptorName:"callObject",getCallbackArgs:function({params:u}={}){return{objectName:e,methodName:l,params:u}}})}})}}function fm(n){return Gi(Zg.replace("{spaceId}",n.config.spaceId))}async function NT({openid:n,callLoginByWeixin:e=!1}={}){const t=fm(this);if(n&&e)throw new Error("[SecureNetwork] openid and callLoginByWeixin cannot be passed at the same time");if(n)return t.mpWeixinOpenid=n,{};const i=await new Promise((r,o)=>{Y.login({success(a){r(a.code)},fail(a){o(new Error(a.errMsg))}})});return await this.importObject("uni-id-co",{customUI:!0}).secureNetworkHandshakeByWeixin({code:i,callLoginByWeixin:e}),t.mpWeixinCode=i,{code:i}}async function UT(n){const e=fm(this);return e.initPromise||(e.initPromise=NT.call(this,n).then(t=>t).catch(t=>{throw delete e.initPromise,t})),e.initPromise}function $T(n){return function({openid:e,callLoginByWeixin:t=!1}={}){return UT.call(n,{openid:e,callLoginByWeixin:t})}}function HT(n){(function(e){El=e})(n)}function Z0(n){const e=hi.canIUse("getAppBaseInfo"),t={getAppBaseInfo:e?Y.getAppBaseInfo:Y.getSystemInfo,getPushClientId:Y.getPushClientId};return function(i){return new Promise((s,r)=>{e&&n==="getAppBaseInfo"?s(t[n]()):t[n]({...i,success(o){s(o)},fail(o){r(o)}})})}}class GT extends o6{constructor(){super(),this._uniPushMessageCallback=this._receivePushMessage.bind(this),this._currentMessageId=-1,this._payloadQueue=[]}init(){return Promise.all([Z0("getAppBaseInfo")(),Z0("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:i,messageId:s,message:r}=t;this._payloadQueue.push({action:i,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:i,message:s}=e;t==="end"?this._end({messageId:i,message:s}):t==="message"&&this._appendMessage({messageId:i,message:s})}_appendMessage({messageId:e,message:t}={}){this.emit("message",t)}_end({messageId:e,message:t}={}){this.emit("end",t),this.close()}_initMessageListener(){Y.onPushMessage(this._uniPushMessageCallback)}_destroy(){Y.offPushMessage(this._uniPushMessageCallback)}toJSON(){return{appId:this._appId,pushClientId:this._pushClientId,seqId:this._seqId}}close(){this._destroy(),this.emit("close")}}async function KT(n){const e=n.__dev__;if(!e.debugInfo)return;const{address:t,servePort:i}=e.debugInfo,{address:s}=await Wg(t,i);if(s)return e.localAddress=s,void(e.localPort=i);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方法的参数`,Sn.indexOf("mp-")===0&&(o+=`
- - 小程序中如何使用uniCloud,请参考:https://uniapp.dcloud.net.cn/uniCloud/publish.html#useinmp`),!e.debugInfo.forceRemote)throw new Error(o);r(o)}function VT(n){n._initPromiseHub||(n._initPromiseHub=new Lc({createPromise:function(){let e=Promise.resolve();var t;t=1,e=new Promise(s=>{setTimeout(()=>{s()},t)});const i=n.auth();return e.then(()=>i.getLoginState()).then(s=>s?Promise.resolve():i.signInAnonymously())}}))}const jT={tcb:O0,tencent:O0,aliyun:m6,private:M0,dcloud:M0,alipay:z6};let At=new class{init(n){let e={};const t=jT[n.provider];if(!t)throw new Error("未提供正确的provider参数");return e=t.init(n),function(i){const s={};i.__dev__=s,s.debugLog=Sn==="mp-harmony";const r=u6;r&&!r.code&&(s.debugInfo=r);const o=new Lc({createPromise:function(){return KT(i)}});s.initLocalNetwork=function(){return o.exec()}}(e),VT(e),xT(e),function(i){const s=i.uploadFile;i.uploadFile=function(r){return s.call(this,r)}}(e),function(i){i.database=function(s){if(s&&Object.keys(s).length>0)return i.init(s).database();if(this._database)return this._database;const r=z0(Q0,{uniClient:i});return this._database=r,r},i.databaseForJQL=function(s){if(s&&Object.keys(s).length>0)return i.init(s).databaseForJQL();if(this._databaseForJQL)return this._databaseForJQL;const r=z0(Q0,{uniClient:i,isJQL:!0});return this._databaseForJQL=r,r}}(e),function(i){i.getCurrentUserInfo=kT,i.chooseAndUploadFile=FT.initChooseAndUploadFile(i),Object.assign(i,{get mixinDatacom(){return um(i)}}),i.SSEChannel=GT,i.initSecureNetworkByWeixin=$T(i),i.setCustomClientInfo=HT,i.importObject=MT(i)}(e),["callFunction","uploadFile","deleteFile","getTempFileURL","downloadFile","chooseAndUploadFile"].forEach(i=>{if(!e[i])return;const s=e[i];e[i]=function(){return s.apply(e,Array.from(arguments))},e[i]=function(r,o){return function(a){let c=!1;o==="callFunction"&&(c=(a&&a.type||Rr.DEFAULT)!==Rr.DEFAULT);const l=o==="callFunction"&&!c,u=this._initPromiseHub.exec();a=a||{};const{success:f,fail:d,complete:h}=Fg(a),p=u.then(()=>c?Promise.resolve():nt(st(o,"invoke"),a)).then(()=>r.call(this,a)).then(m=>c?Promise.resolve(m):nt(st(o,"success"),m).then(()=>nt(st(o,"complete"),m)).then(()=>(l&&mt(Re.RESPONSE,{type:ci.CLOUD_FUNCTION,content:m}),Promise.resolve(m))),m=>c?Promise.reject(m):nt(st(o,"fail"),m).then(()=>nt(st(o,"complete"),m)).then(()=>(mt(Re.RESPONSE,{type:ci.CLOUD_FUNCTION,content:m}),Promise.reject(m))));if(!(f||d||h))return p;p.then(m=>{f&&f(m),h&&h(m),l&&mt(Re.RESPONSE,{type:ci.CLOUD_FUNCTION,content:m})},m=>{d&&d(m),h&&h(m),l&&mt(Re.RESPONSE,{type:ci.CLOUD_FUNCTION,content:m})})}}(e[i],i).bind(e)}),e.init=this.init,e}};(()=>{const n=wg;let e={};if(n&&n.length===1)e=n[0],At=At.init(e),At._isDefault=!0;else{const t=["auth","callFunction","uploadFile","deleteFile","getTempFileURL","downloadFile"],i=["database","getCurrentUserInfo","importObject"];let s;s=n&&n.length>0?"应用有多个服务空间,请通过uniCloud.init方法指定要使用的服务空间":"应用未关联服务空间,请在uniCloud目录右键关联服务空间",[...t,...i].forEach(r=>{At[r]=function(){if(console.error(s),i.indexOf(r)===-1)return Promise.reject(new Q({code:"SYS_ERR",message:s}));console.error(s)}})}Object.assign(At,{get mixinDatacom(){return um(At)}}),wT(At),At.addInterceptor=kg,At.removeInterceptor=d6,At.interceptObject=h6})();var qT=At;const j=Number.isFinite||function(n){return typeof n=="number"&&isFinite(n)},WT=Number.isSafeInteger||function(n){return typeof n=="number"&&Math.abs(n)<=zT},zT=Number.MAX_SAFE_INTEGER||9007199254740991;let Z=function(n){return n.NETWORK_ERROR="networkError",n.MEDIA_ERROR="mediaError",n.KEY_SYSTEM_ERROR="keySystemError",n.MUX_ERROR="muxError",n.OTHER_ERROR="otherError",n}({}),$=function(n){return n.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",n.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",n.KEY_SYSTEM_NO_SESSION="keySystemNoSession",n.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",n.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",n.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",n.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",n.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",n.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",n.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",n.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR="keySystemDestroyMediaKeysError",n.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR="keySystemDestroyCloseSessionError",n.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR="keySystemDestroyRemoveSessionError",n.MANIFEST_LOAD_ERROR="manifestLoadError",n.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",n.MANIFEST_PARSING_ERROR="manifestParsingError",n.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",n.LEVEL_EMPTY_ERROR="levelEmptyError",n.LEVEL_LOAD_ERROR="levelLoadError",n.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",n.LEVEL_PARSING_ERROR="levelParsingError",n.LEVEL_SWITCH_ERROR="levelSwitchError",n.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",n.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",n.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",n.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",n.FRAG_LOAD_ERROR="fragLoadError",n.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",n.FRAG_DECRYPT_ERROR="fragDecryptError",n.FRAG_PARSING_ERROR="fragParsingError",n.FRAG_GAP="fragGap",n.REMUX_ALLOC_ERROR="remuxAllocError",n.KEY_LOAD_ERROR="keyLoadError",n.KEY_LOAD_TIMEOUT="keyLoadTimeOut",n.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",n.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",n.BUFFER_APPEND_ERROR="bufferAppendError",n.BUFFER_APPENDING_ERROR="bufferAppendingError",n.BUFFER_STALLED_ERROR="bufferStalledError",n.BUFFER_FULL_ERROR="bufferFullError",n.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",n.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",n.ASSET_LIST_LOAD_ERROR="assetListLoadError",n.ASSET_LIST_LOAD_TIMEOUT="assetListLoadTimeout",n.ASSET_LIST_PARSING_ERROR="assetListParsingError",n.INTERSTITIAL_ASSET_ITEM_ERROR="interstitialAssetItemError",n.INTERNAL_EXCEPTION="internalException",n.INTERNAL_ABORTED="aborted",n.ATTACH_MEDIA_ERROR="attachMediaError",n.UNKNOWN="unknown",n}({}),A=function(n){return n.MEDIA_ATTACHING="hlsMediaAttaching",n.MEDIA_ATTACHED="hlsMediaAttached",n.MEDIA_DETACHING="hlsMediaDetaching",n.MEDIA_DETACHED="hlsMediaDetached",n.MEDIA_ENDED="hlsMediaEnded",n.STALL_RESOLVED="hlsStallResolved",n.BUFFER_RESET="hlsBufferReset",n.BUFFER_CODECS="hlsBufferCodecs",n.BUFFER_CREATED="hlsBufferCreated",n.BUFFER_APPENDING="hlsBufferAppending",n.BUFFER_APPENDED="hlsBufferAppended",n.BUFFER_EOS="hlsBufferEos",n.BUFFERED_TO_END="hlsBufferedToEnd",n.BUFFER_FLUSHING="hlsBufferFlushing",n.BUFFER_FLUSHED="hlsBufferFlushed",n.MANIFEST_LOADING="hlsManifestLoading",n.MANIFEST_LOADED="hlsManifestLoaded",n.MANIFEST_PARSED="hlsManifestParsed",n.LEVEL_SWITCHING="hlsLevelSwitching",n.LEVEL_SWITCHED="hlsLevelSwitched",n.LEVEL_LOADING="hlsLevelLoading",n.LEVEL_LOADED="hlsLevelLoaded",n.LEVEL_UPDATED="hlsLevelUpdated",n.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",n.LEVELS_UPDATED="hlsLevelsUpdated",n.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",n.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",n.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",n.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",n.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",n.AUDIO_TRACK_UPDATED="hlsAudioTrackUpdated",n.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",n.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",n.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",n.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",n.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",n.SUBTITLE_TRACK_UPDATED="hlsSubtitleTrackUpdated",n.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",n.CUES_PARSED="hlsCuesParsed",n.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",n.INIT_PTS_FOUND="hlsInitPtsFound",n.FRAG_LOADING="hlsFragLoading",n.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",n.FRAG_LOADED="hlsFragLoaded",n.FRAG_DECRYPTED="hlsFragDecrypted",n.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",n.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",n.FRAG_PARSING_METADATA="hlsFragParsingMetadata",n.FRAG_PARSED="hlsFragParsed",n.FRAG_BUFFERED="hlsFragBuffered",n.FRAG_CHANGED="hlsFragChanged",n.FPS_DROP="hlsFpsDrop",n.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",n.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",n.ERROR="hlsError",n.DESTROYING="hlsDestroying",n.KEY_LOADING="hlsKeyLoading",n.KEY_LOADED="hlsKeyLoaded",n.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",n.BACK_BUFFER_REACHED="hlsBackBufferReached",n.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",n.ASSET_LIST_LOADING="hlsAssetListLoading",n.ASSET_LIST_LOADED="hlsAssetListLoaded",n.INTERSTITIALS_UPDATED="hlsInterstitialsUpdated",n.INTERSTITIALS_BUFFERED_TO_BOUNDARY="hlsInterstitialsBufferedToBoundary",n.INTERSTITIAL_ASSET_PLAYER_CREATED="hlsInterstitialAssetPlayerCreated",n.INTERSTITIAL_STARTED="hlsInterstitialStarted",n.INTERSTITIAL_ASSET_STARTED="hlsInterstitialAssetStarted",n.INTERSTITIAL_ASSET_ENDED="hlsInterstitialAssetEnded",n.INTERSTITIAL_ASSET_ERROR="hlsInterstitialAssetError",n.INTERSTITIAL_ENDED="hlsInterstitialEnded",n.INTERSTITIALS_PRIMARY_RESUMED="hlsInterstitialsPrimaryResumed",n.PLAYOUT_LIMIT_REACHED="hlsPlayoutLimitReached",n.EVENT_CUE_ENTER="hlsEventCueEnter",n}({});var ue={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},X={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};class nn{constructor(e,t=0,i=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_=i}sample(e,t){const i=Math.pow(this.alpha_,e);this.estimate_=t*(1-i)+i*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 QT{constructor(e,t,i,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_=i,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new nn(e),this.fast_=new nn(t),this.defaultTTFB_=s,this.ttfb_=new nn(e)}update(e,t){const{slow_:i,fast_:s,ttfb_:r}=this;i.halfLife!==e&&(this.slow_=new nn(e,i.getEstimate(),i.getTotalWeight())),s.halfLife!==t&&(this.fast_=new nn(t,s.getEstimate(),s.getTotalWeight())),r.halfLife!==e&&(this.ttfb_=new nn(e,r.getEstimate(),r.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const i=8*t,s=e/1e3,r=i/s;this.fast_.sample(s,r),this.slow_.sample(s,r)}sampleTTFB(e){const t=e/1e3,i=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(i,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 YT(n,e,t){return(e=JT(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function me(){return me=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)({}).hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},me.apply(null,arguments)}function ef(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(n);e&&(i=i.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,i)}return t}function ye(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?ef(Object(t),!0).forEach(function(i){YT(n,i,t[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):ef(Object(t)).forEach(function(i){Object.defineProperty(n,i,Object.getOwnPropertyDescriptor(t,i))})}return n}function XT(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var i=t.call(n,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function JT(n){var e=XT(n,"string");return typeof e=="symbol"?e:e+""}class Lt{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 i=`[${e}]:`;this.trace=ri,this.debug=t.debug.bind(null,i),this.log=t.log.bind(null,i),this.warn=t.warn.bind(null,i),this.info=t.info.bind(null,i),this.error=t.error.bind(null,i)}}const ri=function(){},ZT={trace:ri,debug:ri,log:ri,warn:ri,info:ri,error:ri};function Ll(){return me({},ZT)}function e5(n,e){const t=self.console[n];return t?t.bind(self.console,`${e?"["+e+"] ":""}[${n}] >`):ri}function tf(n,e,t){return e[n]?e[n].bind(e):e5(n,t)}const Dl=Ll();function t5(n,e,t){const i=Ll();if(typeof console=="object"&&n===!0||typeof n=="object"){const s=["debug","log","info","warn","error"];s.forEach(r=>{i[r]=tf(r,n,t)});try{i.log(`Debug logs enabled for "${e}" in hls.js version 1.6.7`)}catch{return Ll()}s.forEach(r=>{Dl[r]=tf(r,n)})}else me(Dl,i);return i}const pe=Dl;function Ei(n=!0){return typeof self>"u"?void 0:(n||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function i5(n){return typeof self<"u"&&n===self.ManagedMediaSource}function dm(n,e){const t=Object.keys(n),i=Object.keys(e),s=t.length,r=i.length;return!s||!r||s===r&&!t.some(o=>i.indexOf(o)===-1)}function ut(n,e=!1){if(typeof TextDecoder<"u"){const l=new TextDecoder("utf-8").decode(n);if(e){const u=l.indexOf("\0");return u!==-1?l.substring(0,u):l}return l.replace(/\0/g,"")}const t=n.length;let i,s,r,o="",a=0;for(;a<t;){if(i=n[a++],i===0&&e)return o;if(i===0||i===3)continue;switch(i>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(i);break;case 12:case 13:s=n[a++],o+=String.fromCharCode((i&31)<<6|s&63);break;case 14:s=n[a++],r=n[a++],o+=String.fromCharCode((i&15)<<12|(s&63)<<6|(r&63)<<0);break}}return o}const Di={hexDump:function(n){let e="";for(let t=0;t<n.length;t++){let i=n[t].toString(16);i.length<2&&(i="0"+i),e+=i}return e}};function hm(n){return Uint8Array.from(n.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}function n5(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Bo={exports:{}},nf;function s5(){return nf||(nf=1,function(n,e){(function(t){var i=/^(?=((?:[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=i.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}};n.exports=a})()}(Bo)),Bo.exports}var $c=s5();class Hc{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 pm{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,o5(this,"stats")}setByteRange(e,t){const i=e.split("@",2);let s;i.length===1?s=(t==null?void 0:t.byteRangeEndOffset)||0:s=parseInt(i[1]),this._byteRange=[s,parseInt(i[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 Hc),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=$c.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 we(n){return n.sn!=="initSegment"}class Fo extends pm{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(j(e)&&j(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 i=Object.keys(this.levelkeys);if(i.length===1)return this._decryptdata=this.levelkeys[i[0]].getDecryptData(this.sn)}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null)return null;const e=j(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),i=t.length;if(i>1||i===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(!j(e)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=e}get ref(){return we(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,i,s,r,o=!1){const{elementaryStreams:a}=this,c=a[e];if(!c){a[e]={startPTS:t,endPTS:i,startDTS:s,endDTS:r,partial:o};return}c.startPTS=Math.min(c.startPTS,t),c.endPTS=Math.max(c.endPTS,i),c.startDTS=Math.min(c.startDTS,s),c.endDTS=Math.max(c.endDTS,r)}}class r5 extends pm{constructor(e,t,i,s,r){super(i),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 gm(n,e){const t=Object.getPrototypeOf(n);if(t){const i=Object.getOwnPropertyDescriptor(t,e);return i||gm(t,e)}}function o5(n,e){const t=gm(n,e);t&&(t.enumerable=!0,Object.defineProperty(n,e,t))}const sf=Math.pow(2,32)-1,a5=[].push,mm={video:1,audio:2,id3:3,text:4};function Ue(n){return String.fromCharCode.apply(null,n)}function xm(n,e){const t=n[e]<<8|n[e+1];return t<0?65536+t:t}function ne(n,e){const t=ym(n,e);return t<0?4294967296+t:t}function rf(n,e){let t=ne(n,e);return t*=Math.pow(2,32),t+=ne(n,e+4),t}function ym(n,e){return n[e]<<24|n[e+1]<<16|n[e+2]<<8|n[e+3]}function l5(n){const e=n.byteLength;for(let t=0;t<e;){const i=ne(n,t);if(i>8&&n[t+4]===109&&n[t+5]===111&&n[t+6]===111&&n[t+7]===102)return!0;t=i>1?t+i:e}return!1}function le(n,e){const t=[];if(!e.length)return t;const i=n.byteLength;for(let s=0;s<i;){const r=ne(n,s),o=Ue(n.subarray(s+4,s+8)),a=r>1?s+r:i;if(o===e[0])if(e.length===1)t.push(n.subarray(s+8,a));else{const c=le(n.subarray(s+8,a),e.slice(1));c.length&&a5.apply(t,c)}s=a}return t}function c5(n){const e=[],t=n[0];let i=8;const s=ne(n,i);i+=4;let r=0,o=0;t===0?(r=ne(n,i),o=ne(n,i+4),i+=8):(r=rf(n,i),o=rf(n,i+8),i+=16),i+=2;let a=n.length+o;const c=xm(n,i);i+=2;for(let l=0;l<c;l++){let u=i;const f=ne(n,u);u+=4;const d=f&2147483647;if((f&2147483648)>>>31===1)return pe.warn("SIDX has hierarchical references (not supported)"),null;const p=ne(n,u);u+=4,e.push({referenceSize:d,subsegmentDuration:p,info:{duration:p/s,start:a,end:a+d-1}}),a+=d,u+=4,i=u}return{earliestPresentationTime:r,timescale:s,version:t,referencesCount:c,references:e}}function vm(n){const e=[],t=le(n,["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=ne(o,a===0?12:20),l=le(r,["mdia","mdhd"])[0];if(l){a=l[0];const u=ne(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=u5(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(n,["moov","mvex","trex"]).forEach(s=>{const r=ne(s,4),o=e[r];o&&(o.default={duration:ne(s,12),flags:ne(s,20)})}),e}function u5(n){const e=n.subarray(8),t=e.subarray(86),i=Ue(e.subarray(4,8));let s=i,r;const o=i==="enca"||i==="encv";if(o){const l=le(e,[i])[0].subarray(i==="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+="."+Hs(c[1])+Hs(c[2])+Hs(c[3]),r=$s(a==="avc1"?"dva1":"dvav",t));break}case"mp4a":{const c=le(e,[i])[0],l=le(c.subarray(28),["esds"])[0];if(l&&l.length>7){let u=4;if(l[u++]!==3)break;u=Oo(l,u),u+=2;const f=l[u++];if(f&128&&(u+=2),f&64&&(u+=l[u++]),l[u++]!==4)break;u=Oo(l,u);const d=l[u++];if(d===64)s+="."+Hs(d);else break;if(u+=12,l[u++]!==5)break;u=Oo(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=ne(c,2),h=(l&32)>>5?"H":"L",p=c[12],m=c.subarray(6,12);s+="."+u+f,s+="."+f5(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=$s(a=="hev1"?"dvhe":"dvh1",t);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":{s=$s(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+="."+Rt(l)+"."+Rt(u)+"."+Rt(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+"."+Rt(u)+f+"."+Rt(p)+"."+m+"."+g+y+v+"."+Rt(1)+"."+Rt(1)+"."+Rt(1)+"."+0,r=$s("dav1",t)}break}}return{codec:s,encrypted:o,supplemental:r}}function $s(n,e){const t=le(e,["dvvC"]),i=t.length?t[0]:le(e,["dvcC"])[0];if(i){const s=i[2]>>1&127,r=i[2]<<5&32|i[3]>>3&31;return n+"."+Rt(s)+"."+Rt(r)}}function f5(n){let e=0;for(let t=0;t<32;t++)e|=(n>>t&1)<<31-t;return e>>>0}function Oo(n,e){const t=e+5;for(;n[e++]&128&&e<t;);return e}function Hs(n){return("0"+n.toString(16).toUpperCase()).slice(-2)}function Rt(n){return(n<10?"0":"")+n}function d5(n,e){if(!n||!e)return n;const t=e.keyId;return t&&e.isCommonEncryption&&le(n,["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=h5(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: ${Di.hexDump(p)} -> ${Di.hexDump(t)}`),h.set(t,8))}})})}),n}function h5(n){const e=le(n,["schm"])[0];if(e){const t=Ue(e.subarray(4,8));if(t==="cbcs"||t==="cenc")return le(n,["schi","tenc"])[0]}return null}function p5(n,e,t){const i={},s=le(n,["moof","traf"]);for(let r=0;r<s.length;r++){const o=s[r],a=le(o,["tfhd"])[0],c=ne(a,4),l=e[c];if(!l)continue;const u=i[c]||(i[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=ne(f,4);x===1&&(E===sf?t.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"):(E*=sf+1,E+=ne(f,8))),j(E)&&(!j(u.start)||E<u.start)&&(u.start=E)}const d=l.default,h=ne(a,0)|(d==null?void 0:d.flags);let p=(d==null?void 0:d.duration)||0;h&8&&(h&2?p=ne(a,12):p=ne(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=ne(E,4),T=u.sampleCount;u.sampleCount+=S;const _=E[3]&1,I=E[3]&4,R=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,R?(v=ne(E,M),M+=4):v=p,b&&(M+=4),k&&(M+=4),g+=v,y+=v,N--);N--;)R?(v=ne(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(i).some(r=>i[r].duration)){let r=1/0,o=0;const a=le(n,["sidx"]);for(let c=0;c<a.length;c++){const l=c5(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&&j(o)&&Object.keys(i).forEach(c=>{i[c].duration||(i[c].duration=o*i[c].timescale-i[c].start)})}return i}function g5(n){const e={valid:null,remainder:null},t=le(n,["moof"]);if(t.length<2)return e.remainder=n,e;const i=t[t.length-1];return e.valid=n.slice(0,i.byteOffset-8),e.remainder=n.slice(i.byteOffset-8),e}function yt(n,e){const t=new Uint8Array(n.length+e.length);return t.set(n),t.set(e,n.length),t}function of(n,e){const t=[],i=e.samples,s=e.timescale,r=e.id;let o=!1;return le(i,["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=ne(h,4);return p===1&&(m*=Math.pow(2,32),m+=ne(h,8)),m/s})[0];return d!==void 0&&(n=d),le(f,["tfhd"]).map(h=>{const p=ne(h,4),m=ne(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=ne(h,_),_+=4),E&&(S=ne(h,_),_+=4),T&&(_+=4),e.type==="video"&&(o=ro(e.codec)),le(f,["trun"]).map(I=>{const R=I[0],b=ne(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=ne(I,4);let D=8;L&&(k=ne(I,D),D+=4),M&&(D+=4);let P=k+l;for(let w=0;w<C;w++){if(N?(F=ne(I,D),D+=4):F=x,O?(K=ne(I,D),D+=4):K=S,B&&(D+=4),G&&(R===0?H=ne(I,D):H=ym(I,D),D+=4),e.type===ve.VIDEO){let W=0;for(;W<K;){const z=ne(i,P);if(P+=4,m5(o,i[P])){const se=i.subarray(P,P+z);Gc(se,o?2:1,n+H/s,t)}P+=z,W+=z+4}}n+=F/s}}))})})}),t}function ro(n){if(!n)return!1;const e=n.substring(0,4);return e==="hvc1"||e==="hev1"||e==="dvh1"||e==="dvhe"}function m5(n,e){if(n){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function Gc(n,e,t,i){const s=Em(n);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=xm(s,u);if(u+=2,d===49){const h=ne(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++]}i.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++];i.push({payloadType:o,pts:t,uuid:f.join(""),userData:ut(h),userDataBytes:h})}}}function Em(n){const e=n.byteLength,t=[];let i=1;for(;i<e-2;)n[i]===0&&n[i+1]===0&&n[i+2]===3?(t.push(i+2),i+=2):i++;if(t.length===0)return n;const s=e-t.length,r=new Uint8Array(s);let o=0;for(i=0;i<s;o++,i++)o===t[0]&&(o++,t.shift()),r[i]=n[o];return r}function x5(n){const e=n[0];let t="",i="",s=0,r=0,o=0,a=0,c=0,l=0;if(e===0){for(;Ue(n.subarray(l,l+1))!=="\0";)t+=Ue(n.subarray(l,l+1)),l+=1;for(t+=Ue(n.subarray(l,l+1)),l+=1;Ue(n.subarray(l,l+1))!=="\0";)i+=Ue(n.subarray(l,l+1)),l+=1;i+=Ue(n.subarray(l,l+1)),l+=1,s=ne(n,12),r=ne(n,16),a=ne(n,20),c=ne(n,24),l=28}else if(e===1){l+=4,s=ne(n,l),l+=4;const f=ne(n,l);l+=4;const d=ne(n,l);for(l+=4,o=2**32*f+d,WT(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=ne(n,l),l+=4,c=ne(n,l),l+=4;Ue(n.subarray(l,l+1))!=="\0";)t+=Ue(n.subarray(l,l+1)),l+=1;for(t+=Ue(n.subarray(l,l+1)),l+=1;Ue(n.subarray(l,l+1))!=="\0";)i+=Ue(n.subarray(l,l+1)),l+=1;i+=Ue(n.subarray(l,l+1)),l+=1}const u=n.subarray(l,n.byteLength);return{schemeIdUri:t,value:i,timeScale:s,presentationTime:o,presentationTimeDelta:r,eventDuration:a,id:c,payload:u}}function y5(n,...e){const t=e.length;let i=8,s=t;for(;s--;)i+=e[s].byteLength;const r=new Uint8Array(i);for(r[0]=i>>24&255,r[1]=i>>16&255,r[2]=i>>8&255,r[3]=i&255,r.set(n,4),s=0,i=8;s<t;s++)r.set(e[s],i),i+=e[s].byteLength;return r}function v5(n,e,t){if(n.byteLength!==16)throw new RangeError("Invalid system id");let i,s;i=0,s=new Uint8Array;let r;i>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),y5([112,115,115,104],new Uint8Array([i,0,0,0]),n,r,s,o,t||new Uint8Array)}const Am=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),bn={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 Kc(n,e){const t=bn[e];return!!t&&!!t[n.slice(0,4)]}function Rl(n,e,t=!0){return!n.split(",").some(i=>!Vc(i,e,t))}function Vc(n,e,t=!0){var i;const s=Ei(t);return(i=s==null?void 0:s.isTypeSupported(gs(n,e)))!=null?i:!1}function gs(n,e){return`${e}/mp4;codecs=${n}`}function af(n){if(n){const e=n.substring(0,4);return bn.video[e]}return 2}function Pr(n){const e=Am();return n.split(",").reduce((t,i)=>{const r=e&&ro(i)?9:bn.video[i];return r?(r*2+t)/(t?3:2):(bn.audio[i]+t)/(t?2:1)},0)}const Mo={};function E5(n,e=!0){if(Mo[n])return Mo[n];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[n];for(let s=0;s<t.length;s++){var i;if(Vc(t[s],"audio",e))return Mo[n]=t[s],t[s];if(t[s]==="mp3"&&(i=Ei(e))!=null&&i.isTypeSupported("audio/mpeg"))return""}return n}const A5=/flac|opus|mp4a\.40\.34/i;function kr(n,e=!0){return n.replace(A5,t=>E5(t.toLowerCase(),e))}function S5(n,e){const t=[];if(n){const i=n.split(",");for(let s=0;s<i.length;s++)Kc(i[s],"video")||t.push(i[s])}return e&&t.push(e),t.join(",")}function sr(n,e){if(n&&(n.length>4||["ac-3","ec-3","alac","fLaC","Opus"].indexOf(n)!==-1)&&(lf(n,"audio")||lf(n,"video")))return n;if(e){const t=e.split(",");if(t.length>1){if(n){for(let i=t.length;i--;)if(t[i].substring(0,4)===n.substring(0,4))return t[i]}return t[0]}}return e||n}function lf(n,e){return Kc(n,e)&&Vc(n,e)}function T5(n){const e=n.split(",");for(let t=0;t<e.length;t++){const i=e[t].split(".");i.length>2&&i[0]==="avc1"&&(e[t]=`avc1.${parseInt(i[1]).toString(16)}${("000"+parseInt(i[2]).toString(16)).slice(-4)}`)}return e.join(",")}function b5(n){if(n.startsWith("av01.")){const e=n.split("."),t=["0","111","01","01","01","0"];for(let i=e.length;i>4&&i<10;i++)e[i]=t[i-4];return e.join(".")}return n}function cf(n){const e=Ei(n)||{isTypeSupported:()=>!1};return{mpeg:e.isTypeSupported("audio/mpeg"),mp3:e.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:e.isTypeSupported('audio/mp4; codecs="ac-3"')}}function wl(n){return n.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const Sm={supported:!0,configurations:[],decodingInfoResults:[{supported:!0,powerEfficient:!0,smooth:!0}]};function Tm(n,e){return{supported:!1,configurations:e,decodingInfoResults:[{supported:!1,smooth:!1,powerEfficient:!1}],error:n}}function _5(n,e,t,i,s,r){const o=n.videoCodec,a=n.audioCodec?n.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=>ro(d))||n.width>1920&&n.height>1088||n.height>1920&&n.width>1088||n.frameRate>Math.max(i,30)||n.videoRange!=="SDR"&&n.videoRange!==t||n.bitrate>Math.max(s,8e6))||!!f&&j(u)&&Object.keys(f).some(d=>parseInt(d)>u)}function bm(n,e,t,i={}){const s=n.videoCodec;if(!s&&!n.audioCodec||!t)return Promise.resolve(Sm);const r=[],o=I5(n),a=o.length,c=C5(n,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=>ro(f))&&Am())return Promise.resolve(Tm(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: (${u})`),r))}return Promise.all(r.map(u=>{const f=D5(u);return i[f]||(i[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 I5(n){var e;const t=(e=n.videoCodec)==null?void 0:e.split(","),i=_m(n),s=n.width||640,r=n.height||480,o=n.frameRate||30,a=n.videoRange.toLowerCase();return t?t.map(c=>{const l={contentType:gs(b5(c),"video"),width:s,height:r,bitrate:i,framerate:o};return a!=="sdr"&&(l.transferFunction=a),l}):[]}function C5(n,e,t){var i;const s=(i=n.audioCodec)==null?void 0:i.split(","),r=_m(n);return s&&n.audioGroups?n.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:gs(h,"audio"),bitrate:t?L5(h,r):r};d&&(p.channels=""+d),u.push(p)})}return u},o):o},[]):[]}function L5(n,e){if(e<=1)return 1;let t=128e3;return n==="ec-3"?t=768e3:n==="ac-3"&&(t=64e4),Math.min(e/2,t)}function _m(n){return Math.ceil(Math.max(n.bitrate*.9,n.averageBitrate)/1e3)*1e3||1}function D5(n){let e="";const{audio:t,video:i}=n;if(i){const s=wl(i.contentType);e+=`${s}_r${i.height}x${i.width}f${Math.ceil(i.framerate)}${i.transferFunction||"sd"}_${Math.ceil(i.bitrate/1e5)}`}if(t){const s=wl(t.contentType);e+=`${i?"_":""}${s}_c${t.channels}`}return e}const Pl=["NONE","TYPE-0","TYPE-1",null];function R5(n){return Pl.indexOf(n)>-1}const Br=["SDR","PQ","HLG"];function w5(n){return!!n&&Br.indexOf(n)>-1}var rr={No:"",Yes:"YES",v2:"v2"};function uf(n){const{canSkipUntil:e,canSkipDateRanges:t,age:i}=n,s=i<e/2;return e&&s?t?rr.v2:rr.Yes:rr.No}class ff{constructor(e,t,i){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=i}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 ms{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(i=>!!i).map(i=>i.substring(0,4)).join(","),"supplemental"in e){var t;this.supplemental=e.supplemental;const i=(t=e.supplemental)==null?void 0:t.videoCodec;i&&i!==e.videoCodec&&(this.codecSet+=`,${i.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 df(this._audioGroups,e)}hasSubtitleGroup(e){return df(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t){if(e==="audio"){let i=this._audioGroups;i||(i=this._audioGroups=[]),i.indexOf(t)===-1&&i.push(t)}else if(e==="text"){let i=this._subtitleGroups;i||(i=this._subtitleGroups=[]),i.indexOf(t)===-1&&i.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 df(n,e){return!e||!n?!1:n.indexOf(e)!==-1}function P5(){if(typeof matchMedia=="function"){const n=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(n.media!==e.media)return n.matches===!0}return!1}function k5(n,e){let t=!1,i=[];if(n&&(t=n!=="SDR",i=[n]),e){i=e.allowedVideoRanges||Br.slice(0);const s=i.join("")!=="SDR"&&!e.videoCodec;t=e.preferHDR!==void 0?e.preferHDR:s&&P5(),t||(i=["SDR"])}return{preferHDR:t,allowedVideoRanges:i}}const B5=n=>{const e=new WeakSet;return(t,i)=>{if(n&&(i=n(t,i)),typeof i=="object"&&i!==null){if(e.has(i))return;e.add(i)}return i}},Ae=(n,e)=>JSON.stringify(n,B5(e));function F5(n,e,t,i,s){const r=Object.keys(n),o=i==null?void 0:i.channels,a=i==null?void 0:i.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}=k5(e,s);for(let I=r.length;I--;){const R=n[r[I]];u||(u=R.channels[2]>0),d=Math.min(d,R.minHeight),h=Math.min(h,R.minFramerate),p=Math.min(p,R.minBitrate),x.filter(L=>R.videoRanges[L]>0).length>0&&(f=!0)}d=j(d)?d:0,h=j(h)?h:0;const E=Math.max(1080,d),S=Math.max(30,h);p=j(p)?p:t,t=Math.max(p,t),f||(e=void 0);const T=r.length>1;return{codecSet:r.reduce((I,R)=>{const b=n[R];if(R===I)return I;if(y=f?x.filter(L=>b.videoRanges[L]>0):[],T){if(b.minBitrate>t)return Dt(R,`min bitrate of ${b.minBitrate} > current estimate of ${t}`),I;if(!b.hasDefaultAudio)return Dt(R,"no renditions with default or auto-select sound found"),I;if(a&&R.indexOf(a.substring(0,4))%5!==0)return Dt(R,`audio codec preference "${a}" not found`),I;if(o&&!l){if(!b.channels[o])return Dt(R,`no renditions with ${o} channel sound found (channels options: ${Object.keys(b.channels)})`),I}else if((!a||l)&&u&&b.channels[2]===0)return Dt(R,"no renditions with stereo sound found"),I;if(b.minHeight>E)return Dt(R,`min resolution of ${b.minHeight} > maximum of ${E}`),I;if(b.minFramerate>S)return Dt(R,`min framerate of ${b.minFramerate} > maximum of ${S}`),I;if(!y.some(L=>b.videoRanges[L]>0))return Dt(R,`no variants with VIDEO-RANGE of ${Ae(y)} found`),I;if(c&&R.indexOf(c.substring(0,4))%5!==0)return Dt(R,`video codec preference "${c}" not found`),I;if(b.maxScore<g)return Dt(R,`max score of ${b.maxScore} < selected max of ${g}`),I}return I&&(Pr(R)>=Pr(I)||b.fragmentError>n[I].fragmentError)?I:(m=b.minIndex,g=b.maxScore,R)},void 0),videoRanges:y,preferHDR:v,minFramerate:h,minBitrate:p,minIndex:m}}function Dt(n,e){pe.log(`[abr] start candidates with "${n}" ignored because ${e}`)}function Im(n){return n.reduce((e,t)=>{let i=e.groups[t.groupId];i||(i=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),i.tracks.push(t);const s=t.channels||"2";return i.channels[s]=(i.channels[s]||0)+1,i.hasDefault=i.hasDefault||t.default,i.hasAutoSelect=i.hasAutoSelect||t.autoselect,i.hasDefault&&(e.hasDefaultAudio=!0),i.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function O5(n,e,t,i){return n.slice(t,i+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 hf(n){if(!n)return n;const{lang:e,assocLang:t,characteristics:i,channels:s,audioCodec:r}=n;return{lang:e,assocLang:t,characteristics:i,channels:s,audioCodec:r}}function Ot(n,e,t){if("attrs"in n){const i=e.indexOf(n);if(i!==-1)return i}for(let i=0;i<e.length;i++){const s=e[i];if(Mi(n,s,t))return i}return-1}function Mi(n,e,t){const{groupId:i,name:s,lang:r,assocLang:o,default:a}=n,c=n.forced;return(i===void 0||e.groupId===i)&&(s===void 0||e.name===s)&&(r===void 0||M5(r,e.lang))&&(r===void 0||e.assocLang===o)&&(a===void 0||e.default===a)&&(c===void 0||e.forced===c)&&(!("characteristics"in n)||N5(n.characteristics||"",e.characteristics))&&(t===void 0||t(n,e))}function M5(n,e="--"){return n.length===e.length?n===e:n.startsWith(e)||e.startsWith(n)}function N5(n,e=""){const t=n.split(","),i=e.split(",");return t.length===i.length&&!t.some(s=>i.indexOf(s)===-1)}function Ii(n,e){const{audioCodec:t,channels:i}=n;return(t===void 0||(e.audioCodec||"").substring(0,4)===t.substring(0,4))&&(i===void 0||i===(e.channels||"2"))}function U5(n,e,t,i,s){const r=e[i],a=e.reduce((d,h,p)=>{const m=h.uri;return(d[m]||(d[m]=[])).push(p),d},{})[r.uri];a.length>1&&(i=Math.max.apply(Math,a));const c=r.videoRange,l=r.frameRate,u=r.codecSet.substring(0,4),f=pf(e,i,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 Ot(n,p,s)>-1});return f>-1?f:pf(e,i,d=>{const h=d.audioGroups,p=t.filter(m=>!h||h.indexOf(m.groupId)!==-1);return Ot(n,p,s)>-1})}function pf(n,e,t){for(let i=e;i>-1;i--)if(t(n[i]))return i;for(let i=e+1;i<n.length;i++)if(t(n[i]))return i;return-1}function Fr(n,e){var t;return!!n&&n!==((t=e.loadLevelObj)==null?void 0:t.uri)}class $5 extends Lt{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 i;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(),R=o.levels,b=R[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=((i=(t==null?void 0:t.details)||this.hls.latestLevelDetails)==null?void 0:i.live)===!0,B=this.hls.config.abrBandWidthUpFactor;let G=Number.POSITIVE_INFINITY,H;for(H=p-1;H>h;H--){const w=R[H].maxBitrate,W=!R[H].details||K;if(G=this.getTimeToLoadFrag(N,O,f*w,W),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=R[H].maxBitrate;this.getBwEstimate()*B>C&&this.resetEstimator(C);const D=this.findBestLevel(C,h,H,0,S,1,1);D>-1&&(H=D),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: ${j(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 w=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${H>0?"and switching down":""}
- Fragment duration: ${s.duration.toFixed(3)} s
- Time to underbuffer: ${w.toFixed(3)} s`),s.abortRequests(),this.fragCurrent=this.partCurrent=null,H>h){let W=this.findBestLevel(this.hls.levels[h].bitrate,h,H,0,w,1,1);W===-1&&(W=h),this.hls.nextLoadLevel=this.hls.nextAutoLevel=W,this.resetEstimator(this.hls.levels[W].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 QT(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 i=t.frag;if(!this.ignoreFragment(i)){if(!i.bitrateTest){var s;this.fragCurrent=i,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 i=t.frag,{fragCurrent:s,partCurrent:r}=this;if(i&&s&&i.sn===s.sn&&i.level===s.level){const o=performance.now(),a=r?r.stats:i.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,i,s){const r=e+i/t,o=s?e+this.lastLevelLoadSec:0;return r+o}onLevelLoaded(e,t){const i=this.hls.config,{loading:s}=t.stats,r=s.end-s.first;j(r)&&(this.lastLevelLoadSec=r/1e3),t.details.live?this.bwEstimator.update(i.abrEwmaSlowLive,i.abrEwmaFastLive):this.bwEstimator.update(i.abrEwmaSlowVoD,i.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(t.levelInfo)}onFragLoaded(e,{frag:t,part:i}){const s=i?i.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=i?i.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:i,id:t.type};this.onFragBuffered(A.FRAG_BUFFERED,r),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:i,part:s}=t,r=s!=null&&s.stats.loaded?s.stats:i.stats;if(r.aborted||this.ignoreFragment(i))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(),i.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,i=this.getBwEstimate(),s=this.hls.config.maxStarvationDelay,r=this.findBestLevel(i,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,i=this.bwEstimator.canEstimate(),s=this.lastLoadedFragLevel>-1;if(e!==-1&&(!i||!s||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const r=i&&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:i}=this;if(i.levels.length<=1)return i.loadLevel;const{maxAutoLevel:s,config:r,minAutoLevel:o}=i,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=i.levels[o],m=i.loadLevelObj;return m&&(p==null?void 0:p.bitrate)<m.bitrate?o:i.loadLevel}getStarvationDelay(){const e=this.hls,t=e.media;if(!t)return 1/0;const i=t&&t.playbackRate!==0?Math.abs(t.playbackRate):1,s=e.mainForwardBufferInfo;return(s?s.len:0)/i}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,i,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:R}=y,b=this.audioTracksByGroup||(this.audioTracksByGroup=Im(m));let L=-1;if(E){if(this.firstSelection!==-1)return this.firstSelection;const K=this.codecTiers||(this.codecTiers=O5(p,b,t,i)),B=F5(K,T,e,I,R),{codecSet:G,videoRanges:H,minFramerate:C,minBitrate:D,minIndex:P,preferHDR:w}=B;L=P,S=G,T=w?H[H.length-1]:H[0],_=C,e=Math.max(e,D),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=i;K>=t;K--){var F,O;const B=p[K],G=K>f;if(!B)continue;if(y.useMediaCapabilities&&!B.supportedResult&&!B.supportedPromise){const z=navigator.mediaCapabilities;typeof(z==null?void 0:z.decodingInfo)=="function"&&_5(B,b,T,_,e,I)?(B.supportedPromise=bm(B,b,z,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=Sm}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(z=>z.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 D;G?D=a*e:D=o*e;const P=k&&s>=k*2&&r===0?B.averageBitrate:B.maxBitrate,w=this.getTimeToLoadFrag(M,D,P*C,H===void 0);if(D>=P&&(K===u||B.loadError===0&&B.fragmentError===0)&&(w<=M||!j(w)||x&&!this.bitrateTestDelay||w<l)){const z=this.forcedAutoLevel;return K!==g&&(z===-1||z!==g)&&(N.length&&this.trace(`Skipped level(s) ${N.join(",")} of ${i} 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(D)})-bitrate=${Math.round(D-P)} ttfb:${M.toFixed(1)} avgDuration:${C.toFixed(1)} maxFetchDuration:${l.toFixed(1)} fetchDuration:${w.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:i}=this.hls;return Math.min(Math.max(e,i),t)}}const Cm={search:function(n,e){let t=0,i=n.length-1,s=null,r=null;for(;t<=i;){s=(t+i)/2|0,r=n[s];const o=e(r);if(o>0)t=s+1;else if(o<0)i=s-1;else return r}return null}};function H5(n,e,t){if(e===null||!Array.isArray(n)||!n.length||!j(e))return null;const i=n[0].programDateTime;if(e<(i||0))return null;const s=n[n.length-1].endProgramDateTime;if(e>=(s||0))return null;for(let r=0;r<n.length;++r){const o=n[r];if(K5(e,t,o))return o}return null}function Ki(n,e,t=0,i=0,s=.005){let r=null;if(n){r=e[1+n.sn-e[0].sn]||null;const a=n.endDTS-t;a>0&&a<15e-7&&(t+=15e-7),r&&n.level!==r.level&&r.end<=n.end&&(r=e[2+n.sn-e[0].sn]||null)}else t===0&&e[0].start===0&&(r=e[0]);if(r&&((!n||n.level===r.level)&&gf(t,i,r)===0||G5(r,n,Math.min(s,i))))return r;const o=Cm.search(e,gf.bind(null,t,i));return o&&(o!==n||!r)?o:r}function G5(n,e,t){if(e&&e.start===0&&e.level<n.level&&(e.endPTS||0)>0){const i=e.tagList.reduce((s,r)=>(r[0]==="INF"&&(s+=parseFloat(r[1])),s),t);return n.start<=i}return!1}function gf(n=0,e=0,t){if(t.start<=n&&t.start+t.duration>n)return 0;const i=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-i<=n?1:t.start-i>n&&t.start?-1:0}function K5(n,e,t){const i=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-i>n}function Lm(n,e,t){if(n&&n.startCC<=e&&n.endCC>=e){let i=n.fragments;const{fragmentHint:s}=n;s&&(i=i.concat(s));let r;return Cm.search(i,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 Or(n){switch(n.details){case $.FRAG_LOAD_TIMEOUT:case $.KEY_LOAD_TIMEOUT:case $.LEVEL_LOAD_TIMEOUT:case $.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function mf(n,e){const t=Or(e);return n.default[`${t?"timeout":"error"}Retry`]}function jc(n,e){const t=n.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*n.retryDelayMs,n.maxRetryDelayMs)}function xf(n){return ye(ye({},n),{errorRetry:null,timeoutRetry:null})}function Mr(n,e,t,i){if(!n)return!1;const s=i==null?void 0:i.code,r=e<n.maxNumRetry&&(V5(s)||!!t);return n.shouldRetry?n.shouldRetry(n,e,t,i,r):r}function V5(n){return n===0&&navigator.onLine===!1||!!n&&(n<400||n>499)}var ze={DoNothing:0,SendEndCallback:1,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,InsertDiscontinuity:4,RetryRequest:5},bt={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,SwitchToSDR:4};class j5 extends Lt{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 i;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((i=t.frag)!=null&&i.gap){t.errorAction=xs();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=bt.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:bt.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=xs();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 i=this.hls,s=mf(i.config.playlistLoadPolicy,e),r=this.playlistError++;if(Mr(s,r,Or(e),e.response))return{action:ze.RetryRequest,flags:bt.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,i=this.getVariantLevelIndex(e.frag),s=t.levels[i],{fragLoadPolicy:r,keyLoadPolicy:o}=t.config,a=mf(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++,Mr(a,c,Or(e),e.response)))return{action:ze.RetryRequest,flags:bt.None,retryConfig:a,retryCount:c};const l=this.getLevelSwitchAction(e,i);return a&&(l.retryConfig=a,l.retryCount=c),l}getLevelSwitchAction(e,t){const i=this.hls;t==null&&(t=i.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}=i;!i.autoLevelEnabled&&!i.config.preserveManualLevelOnError&&(i.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 R=f[_].details;if(R){const b=Ki(e.frag,R.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(R=>I.hasAudioGroup(R))||m===X.SUBTITLE&&(c=s.subtitleGroups)!=null&&c.some(R=>I.hasSubtitleGroup(R))||y&&s.audioCodec===I.audioCodec||!y&&s.audioCodec!==I.audioCodec||x&&s.codecSet===I.codecSet)continue}u=_;break}}if(u>-1&&i.loadLevel!==u)return e.levelRetry=!0,this.playlistError=0,{action:ze.SendAlternateToPenaltyBox,flags:bt.None,nextAutoLevel:u}}return{action:ze.SendAlternateToPenaltyBox,flags:bt.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var i;switch((i=t.errorAction)==null?void 0:i.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,i=e.errorAction;if(!i)return;const{flags:s,hdcpLevel:r,nextAutoLevel:o}=i;switch(s){case bt.None:this.switchLevel(e,o);break;case bt.MoveAllAlternatesMatchingHDCP:r&&(t.maxHdcpLevel=Pl[Pl.indexOf(r)-1],i.resolved=!0),this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}i.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 i=wl(e.mimeType),s=this.hls.levels;for(let r=s.length;r--;)s[r][`${e.sourceBufferName}Codec`]===i&&this.hls.removeLevel(r)}}}function xs(n){const e={action:ze.DoNothing,flags:bt.None};return n&&(e.resolved=!0),e}var Be={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class q5{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 i=this.activePartLists[t];if(i)for(let s=i.length;s--;){const r=i[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,i){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&&(!i||a.buffered)){const c=a.body;if(c.start<=e&&e<=c.end)return c}}return null}detectEvictedFragments(e,t,i,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===i&&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 i=e.frag,s=sn(i),r=this.fragments[s];if(!r||r.buffered&&i.gap)return;const o=!i.relurl;Object.keys(t).forEach(a=>{const c=i.elementaryStreams[a];if(!c)return;const l=t[a],u=o||c.partial===!0;r.range[a]=this.getBufferedTimes(i,e.part,u,l)}),r.loaded=null,Object.keys(r.range).length?(r.buffered=!0,(r.body.endList=i.endList||r.body.endList)&&(this.endListFragments[r.body.type]=r),Gs(r)||this.removeParts(i.sn-1,i.type)):this.removeFragment(r.body)}removeParts(e,t){const i=this.activePartLists[t];i&&(this.activePartLists[t]=yf(i,s=>s.fragment.sn>=e))}fragBuffered(e,t){const i=sn(e);let s=this.fragments[i];!s&&t&&(s=this.fragments[i]={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,i,s){const r={time:[],partial:i},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,i,s,r,o=0;const{bufferPadding:a,fragments:c}=this;return Object.keys(c).forEach(l=>{const u=c[l];u&&Gs(u)&&(s=u.body.start-a,r=u.body.end+a,e>=s&&e<=r&&(i=Math.min(e-s,r-e),o<=i&&(t=u.body,o=i)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||Gs(t))}getState(e){const t=sn(e),i=this.fragments[t];return i?i.buffered?Gs(i)?Be.PARTIAL:Be.OK:Be.APPENDING:Be.NOT_LOADED}isTimeBuffered(e,t,i){let s,r;for(let o=0;o<i.length;o++){if(s=i.start(o)-this.bufferPadding,r=i.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 i=t.frag,s=t.part?null:t,r=sn(i);this.fragments[r]={body:i,appendedPTS:null,loaded:s,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:i,part:s,timeRanges:r,type:o}=t;if(i.sn==="initSegment")return;const a=i.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=sn(e);return!!this.fragments[t]}hasFragments(e){const{fragments:t}=this,i=Object.keys(t);if(!e)return i.length>0;for(let s=i.length;s--;){const r=t[i[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,i,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!==i||s&&!c.gap||c.start<t&&c.end>e&&(a.buffered||r)&&this.removeFragment(c)})}removeFragment(e){const t=sn(e);e.clearElementaryStreamInfo();const i=this.activePartLists[e.type];if(i){const s=e.sn;this.activePartLists[e.type]=yf(i,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 i=(e=this.hls)==null||(t=e.latestLevelDetails)==null?void 0:t.partList;i&&i.forEach(s=>s.clearElementaryStreamInfo())}}function Gs(n){var e,t,i;return n.buffered&&(n.body.gap||((e=n.range.video)==null?void 0:e.partial)||((t=n.range.audio)==null?void 0:t.partial)||((i=n.range.audiovideo)==null?void 0:i.partial))}function sn(n){return`${n.type}_${n.level}_${n.sn}`}function yf(n,e){return n.filter(t=>{const i=e(t);return i||t.clearElementaryStreamInfo(),i})}var Ai={cbc:0,ctr:1};class W5{constructor(e,t,i){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=e,this.aesIV=t,this.aesMode=i}decrypt(e,t){switch(this.aesMode){case Ai.cbc:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},t,e);case Ai.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 z5(n){const e=n.byteLength,t=e&&new DataView(n.buffer).getUint8(e-1);return t?n.slice(0,e-t):n}class Q5{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),i=new Uint32Array(4);for(let s=0;s<4;s++)i[s]=t.getUint32(s*4);return i}initTable(){const e=this.sBox,t=this.invSBox,i=this.subMix,s=i[0],r=i[1],o=i[2],a=i[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 i=!0,s=0;for(;s<t.length&&i;)i=t[s]===this.key[s],s++;if(i)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,i){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_(i);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,R,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],R=M^r[2],b=k^r[3],F=4,O=1;O<s;O++)x=c[_>>>24]^l[I>>16&255]^u[R>>8&255]^f[b&255]^r[F],E=c[I>>>24]^l[R>>16&255]^u[b>>8&255]^f[_&255]^r[F+1],S=c[R>>>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[R&255]^r[F+3],_=x,I=E,R=S,b=T,F=F+4;x=o[_>>>24]<<24^o[I>>16&255]<<16^o[R>>8&255]<<8^o[b&255]^r[F],E=o[I>>>24]<<24^o[R>>16&255]<<16^o[b>>8&255]<<8^o[_&255]^r[F+1],S=o[R>>>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[R&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 Y5{constructor(e,t,i){this.subtle=void 0,this.key=void 0,this.aesMode=void 0,this.subtle=e,this.key=t,this.aesMode=i}expandKey(){const e=X5(this.aesMode);return this.subtle.importKey("raw",this.key,{name:e},!1,["encrypt","decrypt"])}}function X5(n){switch(n){case Ai.cbc:return"AES-CBC";case Ai.ctr:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${n}`)}}const J5=16;class qc{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 i=self.crypto;i&&(this.subtle=i.subtle||i.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 i=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?z5(i):i}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,i,s){return this.useSoftware?new Promise((r,o)=>{const a=ArrayBuffer.isView(e)?e:new Uint8Array(e);this.softwareDecrypt(a,t,i,s);const c=this.flush();c?r(c.buffer):o(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(e),t,i,s)}softwareDecrypt(e,t,i,s){const{currentIV:r,currentResult:o,remainderData:a}=this;if(s!==Ai.cbc||t.byteLength!==16)return pe.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),a&&(e=yt(a,e),this.remainderData=null);const c=this.getValidChunk(e);if(!c.length)return null;r&&(i=r);let l=this.softwareDecrypter;l||(l=this.softwareDecrypter=new Q5),l.expandKey(t);const u=o;return this.currentResult=l.decrypt(c.buffer,0,i),this.currentIV=c.slice(-16).buffer,u||null}webCryptoDecrypt(e,t,i,s){if(this.key!==t||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(e,t,i,s));this.key=t,this.fastAesKey=new Y5(this.subtle,t,s)}return this.fastAesKey.expandKey().then(r=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new W5(this.subtle,new Uint8Array(i),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,i,s)))}onWebCryptoError(e,t,i,s){const r=this.enableSoftwareAES;if(r){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,i,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 i=e.length-e.length%J5;return i!==e.length&&(t=e.slice(0,i),this.remainderData=e.slice(i)),t}logOnce(e){this.logEnabled&&(pe.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const vf=Math.pow(2,17);class Z5{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 i=e.url;if(!i)return Promise.reject(new jt({type:Z.NETWORK_ERROR,details:$.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error(`Fragment does not have a ${i?"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(Af(e));return}else e.gap=!1;const l=this.loader=r?new r(s):new o(s),u=Ef(e);e.loader=l;const f=xf(s.fragLoadPolicy.default),d={loadPolicy:f,timeout:f.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:vf};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 jt({type:Z.NETWORK_ERROR,details:$.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:ye({url:i,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 jt({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 jt({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,i){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(Af(e,t));return}const l=this.loader=r?new r(s):new o(s),u=Ef(e,t);e.loader=l;const f=xf(s.fragLoadPolicy.default),d={loadPolicy:f,timeout:f.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:vf};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};i(y),a(y)},onError:(h,p,m,g)=>{this.resetLoader(e,l),c(new jt({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 jt({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 jt({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 i=e.stats,s=t.stats,r=s.total;if(i.loaded+=s.loaded,r){const c=Math.round(e.duration/t.duration),l=Math.min(Math.round(i.loaded/r),c),f=(c-l)*Math.round(i.loaded/l);i.total=i.loaded+f}else i.total=Math.max(i.loaded,i.total);const o=i.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 Ef(n,e=null){const t=e||n,i={frag:n,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},s=t.byteRangeStartOffset,r=t.byteRangeEndOffset;if(j(s)&&j(r)){var o;let a=s,c=r;if(n.sn==="initSegment"&&eb((o=n.decryptdata)==null?void 0:o.method)){const l=r-s;l%16&&(c=r+(16-l%16)),s!==0&&(i.resetIV=!0,a=s-16)}i.rangeStart=a,i.rangeEnd=c}return i}function Af(n,e){const t=new Error(`GAP ${n.gap?"tag":"attribute"} found`),i={type:Z.MEDIA_ERROR,details:$.FRAG_GAP,fatal:!1,frag:n,error:t,networkDetails:null};return e&&(i.part=e),(e||n).stats.aborted=!0,new jt(i)}function eb(n){return n==="AES-128"||n==="AES-256"}class jt extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class Dm extends Lt{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 Wc{constructor(e,t,i,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=Ks(),this.buffering={audio:Ks(),video:Ks(),audiovideo:Ks()},this.level=e,this.sn=t,this.id=i,this.size=s,this.part=r,this.partial=o}}function Ks(){return{start:0,executeStart:0,executeEnd:0,end:0}}const Sf={length:0,start:()=>0,end:()=>0};class re{static isBuffered(e,t){if(e){const i=re.getBuffered(e);for(let s=i.length;s--;)if(t>=i.start(s)&&t<=i.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 i=0;i<e.length;i++)t.push({start:e.start(i),end:e.end(i)});return t}static bufferInfo(e,t,i){if(e){const s=re.bufferedRanges(e);if(s.length)return re.bufferedInfo(s,t,i)}return{len:0,start:t,end:t,bufferedIndex:-1}}static bufferedInfo(e,t,i){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(i)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<i?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+i>=f&&t<d)c=f,l=d,o=l-t;else if(t+i<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||Sf}catch(t){return pe.log("failed to get media.buffered",t),Sf}}}const Rm=/\{\$([a-zA-Z0-9-_]+)\}/g;function Tf(n){return Rm.test(n)}function kl(n,e){if(n.variableList!==null||n.hasVariableRefs){const t=n.variableList;return e.replace(Rm,i=>{const s=i.substring(2,i.length-1),r=t==null?void 0:t[s];return r===void 0?(n.playlistParsingError||(n.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${s}"`)),i):r})}return e}function bf(n,e,t){let i=n.variableList;i||(n.variableList=i={});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){n.playlistParsingError||(n.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${o.message}`))}}else s=e.NAME,r=e.VALUE;s in i?n.playlistParsingError||(n.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${s}"`)):i[s]=r||""}function tb(n,e,t){const i=e.IMPORT;if(t&&i in t){let s=n.variableList;s||(n.variableList=s={}),s[i]=t[i]}else n.playlistParsingError||(n.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${i}"`))}const ib=/^(\d+)x(\d+)$/,_f=/(.+?)=(".*?"|.*?)(?:,|$)/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 i=new Uint8Array(t.length/2);for(let s=0;s<t.length/2;s++)i[s]=parseInt(t.slice(s*2,s*2+2),16);return i}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 i=this[e];return i?parseFloat(i):t}enumeratedString(e){return this[e]}enumeratedStringList(e,t){const i=this[e];return(i?i.split(/[ ,]+/):[]).reduce((s,r)=>(s[r.toLowerCase()]=!0,s),t)}bool(e){return this[e]==="YES"}decimalResolution(e){const t=ib.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e,t){let i;const s={},r='"';for(_f.lastIndex=0;(i=_f.exec(e))!==null;){const o=i[1].trim();let a=i[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=kl(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 nb="com.apple.hls.interstitial";function sb(n){return n!=="ID"&&n!=="CLASS"&&n!=="CUE"&&n!=="START-DATE"&&n!=="DURATION"&&n!=="END-DATE"&&n!=="END-ON-NEXT"}function rb(n){return n==="SCTE35-OUT"||n==="SCTE35-IN"||n==="SCTE35-CMD"}class wm{constructor(e,t,i=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:i,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"]);j(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(j(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===nb}get isValid(){return!!this.id&&!this._badValueForSameId&&j(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 ob=10;class ab{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,i=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!i||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||t===0&&i>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1}get hasProgramDateTime(){return this.fragments.length?j(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||ob}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 i=e.length;i--;)if(e[i].index>t)return e[i].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 gn(n){return n==="AES-128"||n==="AES-256"||n==="AES-256-CTR"}function zc(n){switch(n){case"AES-128":case"AES-256":return Ai.cbc;case"AES-256-CTR":return Ai.ctr;default:throw new Error(`invalid full segment method ${n}`)}}function Pm(n){return Uint8Array.from(atob(n),e=>e.charCodeAt(0))}function Bl(n){return Uint8Array.from(unescape(encodeURIComponent(n)),e=>e.charCodeAt(0))}function lb(n){const e=Bl(n).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function cb(n){const e=function(i,s,r){const o=i[s];i[s]=i[r],i[r]=o};e(n,0,3),e(n,1,2),e(n,4,5),e(n,6,7)}function ub(n){const e=n.split(":");let t=null;if(e[0]==="data"&&e.length===2){const i=e[1].split(";"),s=i[i.length-1].split(",");if(s.length===2){const r=s[0]==="base64",o=s[1];r?(i.splice(-1,1),t=Pm(o)):t=lb(o)}}return t}const Nr=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 Fl(n){switch(n){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 If(n){switch(n){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 or(n){const{drmSystems:e,widevineLicenseUrl:t}=n,i=e?[_e.FAIRPLAY,_e.WIDEVINE,_e.PLAYREADY,_e.CLEARKEY].filter(s=>!!e[s]):[];return!i[_e.WIDEVINE]&&t&&i.push(_e.WIDEVINE),i}const km=function(n){return Nr!=null&&(n=Nr.navigator)!=null&&n.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function fb(n,e,t,i){let s;switch(n){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: ${n}`)}return db(s,e,t,i)}function db(n,e,t,i){return[{initDataTypes:n,persistentState:i.persistentState||"optional",distinctiveIdentifier:i.distinctiveIdentifier||"optional",sessionTypes:i.sessionTypes||[i.sessionType||"temporary"],audioCapabilities:e.map(r=>({contentType:`audio/mp4; codecs=${r}`,robustness:i.audioRobustness||"",encryptionScheme:i.audioEncryptionScheme||null})),videoCapabilities:t.map(r=>({contentType:`video/mp4; codecs=${r}`,robustness:i.videoRobustness||"",encryptionScheme:i.videoEncryptionScheme||null}))}]}function hb(n){var e;return n.sessionType==="persistent-license"||!!((e=n.sessionTypes)!=null&&e.some(t=>t==="persistent-license"))}function pb(n){const e=new Uint16Array(n.buffer,n.byteOffset,n.byteLength/2),t=String.fromCharCode.apply(null,Array.from(e)),i=t.substring(t.indexOf("<"),t.length),o=new DOMParser().parseFromString(i,"text/xml").getElementsByTagName("KID")[0];if(o){const a=o.childNodes[0]?o.childNodes[0].nodeValue:o.getAttribute("VALUE");if(a){const c=Pm(a).subarray(0,16);return cb(c),c}}return null}let Vs={};class oo{static clearKeyUriToKeyIdMap(){Vs={}}constructor(e,t,i,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=i,this.keyFormatVersions=s,this.iv=r,this.encrypted=e?e!=="NONE":!1,this.isCommonEncryption=this.encrypted&&!gn(e),o!=null&&o.startsWith("0x")&&(this.keyId=new Uint8Array(hm(o)))}matches(e){var t,i;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(","))===((i=this.iv)==null?void 0:i.join(","))}isSupported(){if(this.method){if(gn(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(gn(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 i=gb(e);return new oo(this.method,this.uri,"identity",this.keyFormatVersions,i)}if(this.pssh&&this.keyId)return this;const t=ub(this.uri);if(t)switch(this.keyFormat){case it.WIDEVINE:if(this.pssh=t,!this.keyId&&t.length>=22){const i=t.length-22;this.keyId=t.subarray(i,i+16)}break;case it.PLAYREADY:{const i=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=v5(i,null,t),this.keyId=pb(t);break}default:{let i=t.subarray(0,16);if(i.length!==16){const s=new Uint8Array(16);s.set(i,16-i.length),i=s}this.keyId=i;break}}if(!this.keyId||this.keyId.byteLength!==16){let i=Vs[this.uri];if(!i){const s=Object.keys(Vs).length%Number.MAX_SAFE_INTEGER;i=new Uint8Array(16),new DataView(i.buffer,12,4).setUint32(0,s),Vs[this.uri]=i}this.keyId=i}return this}}function gb(n){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=n>>8*(15-t)&255;return e}const Cf=/#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,Lf=/#EXT-X-MEDIA:(.*)/g,mb=/^#EXT(?:INF|-X-TARGETDURATION):/m,No=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),xb=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 Mt{static findGroup(e,t){for(let i=0;i<e.length;i++){const s=e[i];if(s.id===t)return s}}static resolve(e,t){return $c.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return mb.test(e)}static parseMasterPlaylist(e,t){const i=Tf(e),s={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:i},r=[];Cf.lastIndex=0;let o;for(;(o=Cf.exec(e))!=null;)if(o[1]){var a;const l=new Se(o[1],s),u=kl(s,o[2]),f={attrs:l,bitrate:l.decimalInteger("BANDWIDTH")||l.decimalInteger("AVERAGE-BANDWIDTH"),name:l.NAME,url:Mt.resolve(u,t)},d=l.decimalResolution("RESOLUTION");d&&(f.width=d.width,f.height=d.height),wf(l.CODECS,f);const h=l["SUPPLEMENTAL-CODECS"];h&&(f.supplemental={},wf(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=Df(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);bf(s,f,t)}break}case"CONTENT-STEERING":{const f=new Se(u,s);s.contentSteering={uri:Mt.resolve(f["SERVER-URI"],t),pathwayId:f["PATHWAY-ID"]||"."};break}case"START":{s.startTimeOffset=Rf(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,i){let s;const r={},o=i.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(Lf.lastIndex=0;(s=Lf.exec(e))!==null;){const l=new Se(s[1],i),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?Mt.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=Mt.findGroup(f,v.groupId)||f[0];Pf(v,x,"audioCodec"),Pf(v,x,"textCodec")}d.push(v)}}return r}static parseLevelPlaylist(e,t,i,s,r,o){var a;const c={url:t},l=new ab(t),u=l.fragments,f=[];let d=null,h=0,p=0,m=0,g=0,y=0,v=null,x=new Fo(s,c),E,S,T,_=-1,I=!1,R=null,b;if(No.lastIndex=0,l.m3u8=e,l.hasVariableRefs=Tf(e),((a=No.exec(e))==null?void 0:a[0])!=="#EXTM3U")return l.playlistParsingError=new Error("Missing format identifier #EXTM3U"),l;for(;(E=No.exec(e))!==null;){I&&(I=!1,x=new Fo(s,c),x.playlistOffset=m,x.start=m,x.sn=h,x.cc=g,y&&(x.bitrate=y),x.level=i,d&&(x.initSegment=d,d.rawProgramDateTime&&(x.rawProgramDateTime=d.rawProgramDateTime,d.rawProgramDateTime=null),R&&(x.setByteRange(R),R=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(j(x.duration)){x.playlistOffset=m,x.start=m,T&&Bf(x,T,l),x.sn=h,x.level=i,x.cc=g,u.push(x);const F=(" "+E[3]).slice(1);x.relurl=kl(l,F),Ol(x,v,f),v=x,m+=x.duration,h++,p=0,I=!0}}else{if(E=E[0].match(xb),!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&&Gt(l,F,E),l.type=O.toUpperCase();break;case"MEDIA-SEQUENCE":l.startSN!==0?Gt(l,F,E):u.length>0&&Ff(l,F,E),h=l.startSN=parseInt(O);break;case"SKIP":{l.skippedSegments&&Gt(l,F,E);const B=new Se(O,l),G=B.decimalInteger("SKIPPED-SEGMENTS");if(j(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&&Gt(l,F,E),l.targetduration=Math.max(parseInt(O),1);break;case"VERSION":l.version!==null&&Gt(l,F,E),l.version=parseInt(O);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":l.live||Gt(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,j(y)?x.bitrate=y:y=0;break;case"DATERANGE":{const B=new Se(O,l),G=new wm(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?tb(l,B,o):bf(l,B,t)}break}case"DISCONTINUITY-SEQUENCE":l.startCC!==0?Gt(l,F,E):u.length>0&&Ff(l,F,E),l.startCC=g=parseInt(O);break;case"KEY":{const B=Df(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=Rf(O);break;case"MAP":{const B=new Se(O,l);if(x.duration){const G=new Fo(s,c);kf(G,B,i,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;R=`${G-H}@${H}`}else R=null;kf(x,B,i,T),d=x,I=!0}d.cc=g;break}case"SERVER-CONTROL":{b&&Gt(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&&Gt(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),D=new r5(C,x,c,H,G);B.push(D),x.duration+=D.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&&(Ol(x,v,f),x.cc=g,l.fragmentHint=x,T&&Bf(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&&(vb(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&&Bm(f,l),l.endCC=g,l}}function Bm(n,e){const t=n.length;if(!t)return;const i=n[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=i.ref;for(let l=t;l--;){const u=yb(e,c,n,l,s);if(u!==-1){a.tagAnchor=e.fragments[u].ref;break}}}}function yb(n,e,t,i,s){const r=t[i];if(r){const a=r.programDateTime;if(e>=a||i===0){var o;const c=(((o=t[i+1])==null?void 0:o.start)||s)-r.start;if(e<=a+c*1e3){const l=t[i].sn-n.startSN,u=n.fragments;if(u.length>t.length){const d=(t[i+1]||u[u.length-1]).sn-n.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 Df(n,e,t){var i,s;const r=new Se(n,t),o=(i=r.METHOD)!=null?i:"",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?Mt.resolve(a,e):"",d=(l||"1").split("/").map(Number).filter(Number.isFinite);return new oo(o,f,u,d,c,r.KEYID)}function Rf(n){const t=new Se(n).decimalFloatingPoint("TIME-OFFSET");return j(t)?t:null}function wf(n,e){let t=(n||"").split(/[ ,]+/).filter(i=>i);["video","audio","text"].forEach(i=>{const s=t.filter(r=>Kc(r,i));s.length&&(e[`${i}Codec`]=s.map(r=>r.split("/")[0]).join(","),t=t.filter(r=>s.indexOf(r)===-1))}),e.unknownCodecs=t}function Pf(n,e,t){const i=e[t];i&&(n[t]=i)}function vb(n,e){let t=n[e];for(let i=e;i--;){const s=n[i];if(!s)return;s.programDateTime=t.programDateTime-s.duration*1e3,t=s}}function Ol(n,e,t){n.rawProgramDateTime?t.push(n):e!=null&&e.programDateTime&&(n.programDateTime=e.endProgramDateTime)}function kf(n,e,t,i){n.relurl=e.URI,e.BYTERANGE&&n.setByteRange(e.BYTERANGE),n.level=t,n.sn="initSegment",i&&(n.levelkeys=i),n.initSegment=null}function Bf(n,e,t){n.levelkeys=e;const{encryptedFragments:i}=t;(!i.length||i[i.length-1].levelkeys!==e)&&Object.keys(e).some(s=>e[s].isCommonEncryption)&&i.push(n)}function Gt(n,e,t){n.playlistParsingError=new Error(`#EXT-X-${e} must not appear more than once (${t[0]})`)}function Ff(n,e,t){n.playlistParsingError=new Error(`#EXT-X-${e} must appear before the first Media Segment (${t[0]})`)}function Uo(n,e){const t=e.startPTS;if(j(t)){let i=0,s;e.sn>n.sn?(i=t-n.start,s=n):(i=n.start-t,s=e),s.duration!==i&&s.setDuration(i)}else e.sn>n.sn?n.cc===e.cc&&n.minEndPTS?e.setStart(n.start+(n.minEndPTS-n.start)):e.setStart(n.start+n.duration):e.setStart(Math.max(n.start-e.duration,0))}function Fm(n,e,t,i,s,r){i-t<=0&&(pe.warn("Fragment should have a positive duration",e),i=t+e.duration,r=s+e.duration);let a=t,c=i;const l=e.startPTS,u=e.endPTS;if(j(l)){const g=Math.abs(l-t);j(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(i,u),i=Math.max(i,u),r=Math.max(r,e.endDTS)}const f=t-e.start;e.start!==0&&e.setStart(t),e.setDuration(i-e.start),e.startPTS=t,e.maxStartPTS=a,e.startDTS=s,e.endPTS=i,e.minEndPTS=c,e.endDTS=r;const d=e.sn;if(!n||d<n.startSN||d>n.endSN)return 0;let h;const p=d-n.startSN,m=n.fragments;for(m[p]=e,h=p;h>0;h--)Uo(m[h],m[h-1]);for(h=p;h<m.length-1;h++)Uo(m[h],m[h+1]);return n.fragmentHint&&Uo(m[m.length-1],n.fragmentHint),n.PTSKnown=n.alignedSliding=!0,f}function Eb(n,e){if(n===e)return;let t=null;const i=n.fragments;for(let l=i.length-1;l>=0;l--){const u=i[l].initSegment;if(u){t=u;break}}n.fragmentHint&&delete n.fragmentHint.endPTS;let s;Tb(n,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}j(l.startPTS)&&j(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=Ab(n.dateRanges,e));const l=n.fragments.filter(u=>u.rawProgramDateTime);if(n.hasProgramDateTime&&!e.hasProgramDateTime)for(let u=1;u<o.length;u++)o[u].programDateTime===null&&Ol(o[u],o[u-1],l);Bm(l,e)}e.endCC=r[r.length-1].cc}if(!e.startCC){var a;const l=Nm(n,e.startSN-1);e.startCC=(a=l==null?void 0:l.cc)!=null?a:r[0].cc}Sb(n.partList,e.partList,(l,u)=>{u.elementaryStreams=l.elementaryStreams,u.stats=l.stats}),s?Fm(e,s,s.startPTS,s.endPTS,s.startDTS,s.endDTS):Om(n,e),r.length&&(e.totalduration=e.edge-r[0].start),e.driftStartTime=n.driftStartTime,e.driftStart=n.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=n.driftEndTime,e.driftEnd=n.driftEnd,e.advancedDateTime=n.advancedDateTime;e.requestScheduled===-1&&(e.requestScheduled=n.requestScheduled)}function Ab(n,e){const{dateRanges:t,recentlyRemovedDateranges:i}=e,s=me({},n);i&&i.forEach(a=>{delete s[a]});const o=Object.keys(s).length;return o&&Object.keys(t).forEach(a=>{const c=s[a],l=new wm(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 Sb(n,e,t){if(n&&e){let i=0;for(let s=0,r=n.length;s<=r;s++){const o=n[s],a=e[s+i];o&&a&&o.index===a.index&&o.fragment.sn===a.fragment.sn?t(o,a):i--}}}function Tb(n,e,t){const i=e.skippedSegments,s=Math.max(n.startSN,e.startSN)-e.startSN,r=(n.fragmentHint?1:0)+(i?e.endSN:Math.min(n.endSN,e.endSN))-e.startSN,o=e.startSN-n.startSN,a=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,c=n.fragmentHint?n.fragments.concat(n.fragmentHint):n.fragments;for(let l=s;l<=r;l++){const u=c[o+l];let f=a[l];if(i&&!f&&u&&(f=e.fragments[l]=u),u&&f){if(t(u,f,l,a),u.url&&u.url!==f.url){e.playlistParsingError=Of(`media sequence mismatch ${f.sn}:`,n,e,u,f);return}else if(u.cc!==f.cc){e.playlistParsingError=Of(`discontinuity sequence mismatch (${u.cc}!=${f.cc})`,n,e,u,f);return}}}}function Of(n,e,t,i,s){return new Error(`${n} ${s.url}
- Playlist starting @${e.startSN}
- ${e.m3u8}
- Playlist starting @${t.startSN}
- ${t.m3u8}`)}function Om(n,e,t=!0){const i=e.startSN+e.skippedSegments-n.startSN,s=n.fragments,r=i>=0;let o=0;if(r&&i<s.length)o=s[i].start;else if(r&&e.startSN===n.endSN+1)o=n.fragmentEnd;else if(r&&t)o=n.fragmentStart+i*e.levelTargetDuration;else if(!e.skippedSegments&&e.fragmentStart===0)o=n.fragmentStart;else return;Ml(e,o)}function Ml(n,e){if(e){const t=n.fragments;for(let i=n.skippedSegments;i<t.length;i++)t[i].addStart(e);n.fragmentHint&&n.fragmentHint.addStart(e)}}function Mm(n,e=1/0){let t=1e3*n.targetduration;if(n.updated){const i=n.fragments;if(i.length&&t*4>e){const r=i[i.length-1].duration*1e3;r<t&&(t=r)}}else t/=2;return Math.round(t)}function Nm(n,e,t){if(!n)return null;let i=n.fragments[e-n.startSN];return i||(i=n.fragmentHint,i&&i.sn===e)?i:e<n.startSN&&t&&t.sn===e?t:null}function Mf(n,e,t){return n?Um(n.partList,e,t):null}function Um(n,e,t){if(n)for(let i=n.length;i--;){const s=n[i];if(s.index===t&&s.fragment.sn===e)return s}return null}function $m(n){n.forEach((e,t)=>{var i;(i=e.details)==null||i.fragments.forEach(s=>{s.level=t,s.initSegment&&(s.initSegment.level=t)})})}function Yn(n,e){for(let i=0,s=n.length;i<s;i++){var t;if(((t=n[i])==null?void 0:t.cc)===e)return n[i]}return null}function bb(n,e){return!!(n&&e.startCC<n.endCC&&e.endCC>n.startCC)}function Nf(n,e){if(n){const t=n.start+e;n.start=n.startPTS=t,n.endPTS=t+n.duration}}function Hm(n,e){const t=e.fragments;for(let i=0,s=t.length;i<s;i++)Nf(t[i],n);e.fragmentHint&&Nf(e.fragmentHint,n),e.alignedSliding=!0}function _b(n,e){n&&(Gm(e,n),!e.alignedSliding&&n&&Ur(e,n),!e.alignedSliding&&n&&!e.skippedSegments&&Om(n,e,!1))}function Gm(n,e){if(!bb(e,n))return;const t=Math.min(e.endCC,n.endCC),i=Yn(e.fragments,t),s=Yn(n.fragments,t);if(!i||!s)return;pe.log(`Aligning playlist at start of dicontinuity sequence ${t}`);const r=i.start-s.start;Hm(r,n)}function Ur(n,e){if(!n.hasProgramDateTime||!e.hasProgramDateTime)return;const t=n.fragments,i=e.fragments;if(!t.length||!i.length)return;let s,r;const o=Math.min(e.endCC,n.endCC);e.startCC<o&&n.startCC<o&&(s=Yn(i,o),r=Yn(t,o)),(!s||!r)&&(s=i[Math.floor(i.length/2)],r=Yn(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);Hm(l,n)}const Ib={toString:function(n){let e="";const t=n.length;for(let i=0;i<t;i++)e+=`[${n.start(i).toFixed(3)}-${n.end(i).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 Qc extends Dm{constructor(e,t,i,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 ${j(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 Z5(e.config),this.keyLoader=i,this.fragmentTracker=t,this.config=e.config,this.decrypter=new qc(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 i=e.end||0,s=this.config.timelineOffset||0;if(i<=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 i=this.media=this.mediaBuffer=t.media;i.removeEventListener("seeking",this.onMediaSeeking),i.removeEventListener("ended",this.onMediaEnded),i.addEventListener("seeking",this.onMediaSeeking),i.addEventListener("ended",this.onMediaEnded);const s=this.config;this.levels&&s.autoStartLoad&&this.state===V.STOPPED&&this.startLoad(s.startPosition)}onMediaDetaching(e,t){const i=!!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&&!i&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loopSn=void 0,i){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,i){this.startFragRequested=!0,this._loadFragForPlayback(e,t,i)}_loadFragForPlayback(e,t,i){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,i,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:i}=this;if(i.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))&&i.removeFragment(e)}else((t=this.mediaBuffer)==null?void 0:t.buffered.length)===0?i.removeAllFragments():i.hasParts(e.type)&&(i.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),i.getState(e)===Be.PARTIAL&&i.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,i=null){if(!(e-t))return;const s={startOffset:e,endOffset:t,type:i};this.hls.trigger(A.BUFFER_FLUSHING,s)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(i=>{const s=i==null?void 0:i.frag;if(!s||this.fragContextChanged(s)||!this.levels)throw new Error("init load aborted");return i}).then(i=>{const{hls:s}=this,{frag:r,payload:o}=i,a=r.decryptdata;if(o&&o.byteLength>0&&a!=null&&a.key&&a.iv&&gn(a.method)){const c=self.performance.now();return this.decrypter.decrypt(new Uint8Array(o),a.key.buffer,a.iv.buffer,zc(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}}),i.payload=l,this.completeInitSegmentLoad(i)})}return this.completeInitSegmentLoad(i)}).catch(i=>{this.state===V.STOPPED||this.state===V.ERROR||(this.warn(i),this.resetFragmentLoading(e))})}completeInitSegmentLoad(e){const{levels:t}=this;if(!t)throw new Error("init load aborted, missing levels");const i=e.frag.stats;this.state!==V.STOPPED&&(this.state=V.IDLE),e.frag.data=new Uint8Array(e.payload),i.parsing.start=i.buffering.start=self.performance.now(),i.parsing.end=i.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 i=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:${i?Ib.toString(re.getBuffered(i)):"(detached)"})`),we(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:i,part:s,partsLoaded:r}=e,o=!r||r.length===0||r.some(c=>!c),a=new Wc(i.level,i.sn,i.stats.chunkCount+1,0,s?s.index:-1,!o);t.flush(a)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,i=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(we(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(i=Math.max(e.start,i||0),this.loadingParts&&we(e)){const f=o.partList;if(f&&s){i>e.end&&o.fragmentHint&&(e=o.fragmentHint);const d=this.getNextPart(f,e,i);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(i.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:i}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):p}else if(!e.url||this.loadedEndOfParts(f,i))return Promise.resolve(null)}}if(we(e)&&this.loadingParts)this.log(`LL-Part loading OFF after next part miss @${i.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(i.toFixed(3))}`),j(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:i}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):u}doFragPartsLoad(e,t,i,s){return new Promise((r,o)=>{var a;const c=[],l=(a=i.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=Mf(i.details,e.sn,f.index+1)||Um(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:i,part:s,level:r}=t,o=self.performance.now();i.stats.parsing.end=o,s&&(s.stats.parsing.end=o);const a=this.getLevelDetails(),l=a&&i.sn>a.endSN||this.shouldLoadParts(a,i.end);l!==this.loadingParts&&(this.log(`LL-Part loading ${l?"ON":"OFF"} after parsing segment ending @${i.end.toFixed(2)}`),this.loadingParts=l),this.updateLevelTiming(i,s,r,e.partial)}shouldLoadParts(e,t){if(this.config.lowLatencyMode){if(!e)return this.loadingParts;if(e!=null&&e.partList){var i;const r=e.partList[0],o=r.end+(((i=e.fragmentHint)==null?void 0:i.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:i}=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?Mf(c,r,o):null,u=l?l.fragment:Nm(c,r,i);return u?(i&&i!==u&&(u.stats=i.stats),{frag:u,part:l,level:a}):null}bufferFragmentData(e,t,i,s,r){var o;if(!e||this.state!==V.PARSING)return;const{data1:a,data2:c}=e;let l=a;if(a&&c&&(l=yt(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:i,chunkMeta:s,offset:f,parent:t.type,data:l};if(this.hls.trigger(A.BUFFER_APPENDING,d),e.dropped&&e.independent&&!i){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 i=t.currentTime,s=re.bufferInfo(t,i,0),r=e.duration,o=Math.min(this.config.maxFragLookUpTolerance*2,r*.25),a=Math.max(Math.min(e.start-o,s.end-o),i+o);e.start-a>o&&this.flushMainBuffer(a,e.start)}getFwdBufferInfo(e,t){var i;const s=this.getLoadPosition();if(!j(s))return null;const o=this.lastCurrentTime>s||(i=this.media)!=null&&i.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(e,s,t,o)}getFwdBufferInfoAtPos(e,t,i,s){const r=re.bufferInfo(e,t,s);if(r.len===0&&r.nextStart!==void 0){const o=this.fragmentTracker.getBufferedFrag(t,i);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 i;return e?i=Math.max(8*t.maxBufferSize/e,t.maxBufferLength):i=t.maxBufferLength,Math.min(i,t.maxMaxBufferLength)}reduceMaxBufferLength(e,t){const i=this.config,s=Math.max(Math.min(e-t,i.maxBufferLength),t),r=Math.max(e-t*3,i.maxMaxBufferLength/2,s);return r>=s?(i.maxMaxBufferLength=r,this.warn(`Reduce max buffer length to ${r}s`),!0):!1}getAppendedFrag(e,t=X.MAIN){var i;const s=(i=this.fragmentTracker)==null?void 0:i.getAppendedFrag(e,t);return s&&"fragment"in s?s.fragment:s}getNextFragment(e,t){const i=t.fragments,s=i.length;if(!s)return null;const{config:r}=this,o=i[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=i[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(i[f+1]||null,t)}return this.mapToInitFragWhenRequired(u)}isLoopLoading(e,t){const i=this.fragmentTracker.getState(e);return(i===Be.OK||i===Be.PARTIAL&&!!e.gap)&&this.nextLoadPosition>t}getNextFragmentLoopLoading(e,t,i,s,r){let o=null;if(e.gap&&(o=this.getNextFragment(this.nextLoadPosition,t),o&&!o.gap&&i.nextStart)){const a=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,i.nextStart,s,0);if(a!==null&&i.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(Uf(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(Uf(this.hls.config)&&e.type!==X.SUBTITLE){const i=this.hls.interstitialsManager,s=i==null?void 0:i.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=i==null?void 0:i.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,i){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&&i<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 i=e[e.length-1];return i&&t>i.start&&i.loaded}getInitialLiveFragment(e){const t=e.fragments,i=this.fragPrevious;let s=null;if(i){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${i.programDateTime}`),s=H5(t,i.endProgramDateTime,this.config.maxFragLookUpTolerance)),!s){const r=i.sn+1;if(r>=e.startSN&&r<=e.endSN){const o=t[r-e.startSN];i.cc===o.cc&&(s=o,this.log(`Live playlist, switching playlist, load frag with next SN: ${s.sn}`))}s||(s=Lm(e,i.cc,i.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,i){const{config:s}=this;let{fragPrevious:r}=this,{fragments:o,endSN:a}=i;const{fragmentHint:c}=i,{maxFragLookUpTolerance:l}=s,u=i.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=Ki(r,o,e,m)}else d=o[o.length-1];if(d){const p=d.sn-i.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||!i.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,i){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&&j(r);if(o||!a&&!r){_b(i,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 i=this.startPosition;i<t&&(i=-1);const s=this.timelineOffset;if(i===-1){const r=this.startTimeOffset!==null,o=r?this.startTimeOffset:e.startTimeOffset;o!==null&&j(o)?(i=t+o,o<0&&(i+=e.edge),i=Math.min(Math.max(t,i),t+e.totalduration),this.log(`Setting startPosition to ${i} for start time offset ${o} found in ${r?"multivariant":"media"} playlist`),this.startPosition=i):e.live?(i=this.hls.liveSyncPosition||t,this.log(`Setting startPosition to -1 to start at live edge ${i}`),this.startPosition=-1):(this.log("setting startPosition to 0 by default"),this.startPosition=i=0),this.lastCurrentTime=i+s}this.nextLoadPosition=i+s}getLoadPosition(){var e;const{media:t}=this;let i=0;return(e=this.hls)!=null&&e.hasEnoughToStart&&t?i=t.currentTime:this.nextLoadPosition>=0&&(i=this.nextLoadPosition),i}handleFragLoadAborted(e,t){this.transmuxer&&e.type===this.playlistType&&we(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 i=t.frag;if(!i||i.type!==e||!this.levels)return;if(this.fragContextChanged(i)){var s;this.warn(`Frag load error must match current frag to retry ${i.url} > ${(s=this.fragCurrent)==null?void 0:s.url}`);return}const r=t.details===$.FRAG_GAP;r&&this.fragmentTracker.fragBuffered(i,!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===bt.MoveAllAlternatesMatchingHost;if(!d&&h&&we(i)&&!i.endList)this.resetFragmentErrors(e),this.treatAsGap(i),o.resolved=!0;else if((d||h)&&l<u.maxNumRetry){this.resetStartWhenNotLoaded(this.levelLastLoaded);const p=jc(u,l);this.warn(`Fragment ${i.sn} of ${e} ${i.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,i=e.parent,s=this.getFwdBufferInfo(this.mediaBuffer,i),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 ${i} 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,i){if(!e)return;const s=re.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,s,i),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,i,s){const r=i.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:Fm(r,e,u.startPTS,u.endPTS,u.startDTS,u.endDTS);return this.hls.trigger(A.LEVEL_PTS_UPDATED,{details:r,level:i,drift:d,type:l,frag:e,start:u.startPTS,end:u.endPTS}),!0}return c},!1)){var a;if(i.fragmentError===0&&this.treatAsGap(e,i),((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()} "${i.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,i){var s,r;return`${this.playlistLabel()} ${e.level} (${i?"part":"frag"}:[${((s=t&&!i?e.startPTS:(i||e).start)!=null?s:NaN).toFixed(3)}-${((r=t&&!i?e.endPTS:(i||e).end)!=null?r:NaN).toFixed(3)}]${i&&e.type==="main"?"INDEPENDENT="+(i.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 Uf(n){return!!n.interstitialsController&&n.enableInterstitialPlayback!==!1}class Km{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let i;if(e.length)e.length===1?i=e[0]:i=Cb(e,t);else return new Uint8Array(0);return this.reset(),i}reset(){this.chunks.length=0,this.dataLength=0}}function Cb(n,e){const t=new Uint8Array(e);let i=0;for(let s=0;s<n.length;s++){const r=n[s];t.set(r,i),i+=r.length}return t}var $o={exports:{}},$f;function Lb(){return $f||($f=1,function(n){var e=Object.prototype.hasOwnProperty,t="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__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 i:delete c._events[l]}function a(){this._events=new i,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 i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=t,a.EventEmitter=a,n.exports=a}($o)),$o.exports}var Db=Lb(),Yc=n5(Db);const ys="1.6.7",_n={};function Rb(){return typeof __HLS_WORKER_BUNDLE__=="function"}function wb(){const n=_n[ys];if(n)return n.clientCount++,n;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 _n[ys]=s,s}function Pb(n){const e=_n[n];if(e)return e.clientCount++,e;const t=new self.URL(n,self.location.href).href,s={worker:new self.Worker(t),scriptURL:t,clientCount:1};return _n[n]=s,s}function kb(n){const e=_n[n||ys];if(e&&e.clientCount--===1){const{worker:i,objectURL:s}=e;delete _n[n||ys],s&&self.URL.revokeObjectURL(s),i.terminate()}}function Vm(n,e){return e+10<=n.length&&n[e]===51&&n[e+1]===68&&n[e+2]===73&&n[e+3]<255&&n[e+4]<255&&n[e+6]<128&&n[e+7]<128&&n[e+8]<128&&n[e+9]<128}function Xc(n,e){return e+10<=n.length&&n[e]===73&&n[e+1]===68&&n[e+2]===51&&n[e+3]<255&&n[e+4]<255&&n[e+6]<128&&n[e+7]<128&&n[e+8]<128&&n[e+9]<128}function ao(n,e){let t=0;return t=(n[e]&127)<<21,t|=(n[e+1]&127)<<14,t|=(n[e+2]&127)<<7,t|=n[e+3]&127,t}function vs(n,e){const t=e;let i=0;for(;Xc(n,e);){i+=10;const s=ao(n,e+6);i+=s,Vm(n,e+10)&&(i+=10),e+=i}if(i>0)return n.subarray(t,t+i)}function Bb(n,e,t,i){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}`);n.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:${i}, 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:i}}function jm(n,e){return n[e]===255&&(n[e+1]&246)===240}function qm(n,e){return n[e+1]&1?7:9}function Jc(n,e){return(n[e+3]&3)<<11|n[e+4]<<3|(n[e+5]&224)>>>5}function Fb(n,e){return e+5<n.length}function $r(n,e){return e+1<n.length&&jm(n,e)}function Ob(n,e){return Fb(n,e)&&jm(n,e)&&Jc(n,e)<=n.length-e}function Mb(n,e){if($r(n,e)){const t=qm(n,e);if(e+t>=n.length)return!1;const i=Jc(n,e);if(i<=t)return!1;const s=e+i;return s===n.length||$r(n,s)}return!1}function Wm(n,e,t,i,s){if(!n.samplerate){const r=Bb(e,t,i,s);if(!r)return;me(n,r)}}function zm(n){return 1024*9e4/n}function Nb(n,e){const t=qm(n,e);if(e+t<=n.length){const i=Jc(n,e)-t;if(i>0)return{headerLength:t,frameLength:i}}}function Qm(n,e,t,i,s){const r=zm(n.samplerate),o=i+s*r,a=Nb(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||n.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 Ub(n,e){return Xc(n,e)&&ao(n,e+6)+10<=n.length-e}function $b(n){return n instanceof ArrayBuffer?n:n.byteOffset==0&&n.byteLength==n.buffer.byteLength?n.buffer:new Uint8Array(n).buffer}function Ho(n,e=0,t=1/0){return Hb(n,e,t,Uint8Array)}function Hb(n,e,t,i){const s=Gb(n);let r=1;"BYTES_PER_ELEMENT"in i&&(r=i.BYTES_PER_ELEMENT);const o=Kb(n)?n.byteOffset:0,a=(o+n.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 i(s,l,u-l)}function Gb(n){return n instanceof ArrayBuffer?n:n.buffer}function Kb(n){return n&&n.buffer instanceof ArrayBuffer&&n.byteLength!==void 0&&n.byteOffset!==void 0}function Vb(n){const e={key:n.type,description:"",data:"",mimeType:null,pictureType:null},t=3;if(n.size<2)return;if(n.data[0]!==t){console.log("Ignore frame with unrecognized character encoding");return}const i=n.data.subarray(1).indexOf(0);if(i===-1)return;const s=ut(Ho(n.data,1,i)),r=n.data[2+i],o=n.data.subarray(3+i).indexOf(0);if(o===-1)return;const a=ut(Ho(n.data,3+i,o));let c;return s==="-->"?c=ut(Ho(n.data,4+i+o)):c=$b(n.data.subarray(4+i+o)),e.mimeType=s,e.pictureType=r,e.description=a,e.data=c,e}function jb(n){if(n.size<2)return;const e=ut(n.data,!0),t=new Uint8Array(n.data.subarray(e.length+1));return{key:n.type,info:e,data:t.buffer}}function qb(n){if(n.size<2)return;if(n.type==="TXXX"){let t=1;const i=ut(n.data.subarray(t),!0);t+=i.length+1;const s=ut(n.data.subarray(t));return{key:n.type,info:i,data:s}}const e=ut(n.data.subarray(1));return{key:n.type,info:"",data:e}}function Wb(n){if(n.type==="WXXX"){if(n.size<2)return;let t=1;const i=ut(n.data.subarray(t),!0);t+=i.length+1;const s=ut(n.data.subarray(t));return{key:n.type,info:i,data:s}}const e=ut(n.data);return{key:n.type,info:"",data:e}}function zb(n){return n.type==="PRIV"?jb(n):n.type[0]==="W"?Wb(n):n.type==="APIC"?Vb(n):qb(n)}function Qb(n){const e=String.fromCharCode(n[0],n[1],n[2],n[3]),t=ao(n,4),i=10;return{type:e,size:t,data:n.subarray(i,i+t)}}const js=10,Yb=10;function Ym(n){let e=0;const t=[];for(;Xc(n,e);){const i=ao(n,e+6);n[e+5]>>6&1&&(e+=js),e+=js;const s=e+i;for(;e+Yb<s;){const r=Qb(n.subarray(e)),o=zb(r);o&&t.push(o),e+=r.size+js}Vm(n,e)&&(e+=js)}return t}function Xm(n){return n&&n.key==="PRIV"&&n.info==="com.apple.streaming.transportStreamTimestamp"}function Xb(n){if(n.data.byteLength===8){const e=new Uint8Array(n.data),t=e[3]&1;let i=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return i/=45,t&&(i+=4772185884e-2),Math.round(i)}}function Zc(n){const e=Ym(n);for(let t=0;t<e.length;t++){const i=e[t];if(Xm(i))return Xb(i)}}let ct=function(n){return n.audioId3="org.id3",n.dateRange="com.apple.quicktime.HLS",n.emsg="https://aomedia.org/emsg/ID3",n.misbklv="urn:misb:KLV:bin:1910.1",n}({});function wt(n="",e=9e4){return{type:n,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class eu{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,i,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,i){}demux(e,t){this.cachedData&&(e=yt(this.cachedData,e),this.cachedData=null);let i=vs(e,0),s=i?i.length:0,r;const o=this._audioTrack,a=this._id3Track,c=i?Zc(i):void 0,l=e.length;for((this.basePTS===null||this.frameIndex===0&&j(c))&&(this.basePTS=Jb(c,t,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),i&&i.length>0&&a.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:i,type:ct.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 Ub(e,s)?(i=vs(e,s),a.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:i,type:ct.audioId3,duration:Number.POSITIVE_INFINITY}),s+=i.length,r=s):s++;if(s===l&&r!==l){const u=e.slice(r);this.cachedData?this.cachedData=yt(this.cachedData,u):this.cachedData=u}}return{audioTrack:o,videoTrack:wt(),id3Track:a,textTrack:wt()}}demuxSampleAes(e,t,i){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:wt(),id3Track:this._id3Track,textTrack:wt()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const Jb=(n,e,t)=>{if(j(n))return n*90;const i=t?t.baseTime*9e4/t.timescale:0;return e*9e4+i};let qs=null;const Zb=[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],e9=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],t9=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],i9=[0,1,1,4];function Jm(n,e,t,i,s){if(t+24>e.length)return;const r=Zm(e,t);if(r&&t+r.frameLength<=e.length){const o=r.samplesPerFrame*9e4/r.sampleRate,a=i+s*o,c={unit:e.subarray(t,t+r.frameLength),pts:a,dts:a};return n.config=[],n.channelCount=r.channelCount,n.samplerate=r.sampleRate,n.samples.push(c),{sample:c,length:r.frameLength,missing:0}}}function Zm(n,e){const t=n[e+1]>>3&3,i=n[e+1]>>1&3,s=n[e+2]>>4&15,r=n[e+2]>>2&3;if(t!==1&&s!==0&&s!==15&&r!==3){const o=n[e+2]>>1&1,a=n[e+3]>>6,c=t===3?3-i:i===3?3:4,l=Zb[c*14+s-1]*1e3,f=e9[(t===3?0:t===2?1:2)*3+r],d=a===3?1:2,h=t9[t][i],p=i9[i],m=h*8*p,g=Math.floor(h*l/f+o)*p;if(qs===null){const x=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);qs=x?parseInt(x[1]):0}return!!qs&&qs<=87&&i===2&&l>=224e3&&a===0&&(n[e+3]=n[e+3]|128),{sampleRate:f,channelCount:d,frameLength:g,samplesPerFrame:m}}}function tu(n,e){return n[e]===255&&(n[e+1]&224)===224&&(n[e+1]&6)!==0}function e1(n,e){return e+1<n.length&&tu(n,e)}function n9(n,e){return tu(n,e)&&4<=n.length-e}function t1(n,e){if(e+1<n.length&&tu(n,e)){const i=Zm(n,e);let s=4;i!=null&&i.frameLength&&(s=i.frameLength);const r=e+s;return r===n.length||e1(n,r)}return!1}class s9 extends eu{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,i,s){super.resetInitSegment(e,t,i,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 i=vs(e,0);let s=(i==null?void 0:i.length)||0;if(t1(e,s))return!1;for(let r=e.length;s<r;s++)if(Mb(e,s))return t.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return Ob(e,t)}appendFrame(e,t,i){Wm(e,this.observer,t,i,e.manifestCodec);const s=Qm(e,t,i,this.basePTS,this.frameIndex);if(s&&s.missing===0)return s}}const i1=(n,e)=>{let t=0,i=5;e+=i;const s=new Uint32Array(1),r=new Uint32Array(1),o=new Uint8Array(1);for(;i>0;){o[0]=n[e];const a=Math.min(i,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,i-=a}return t};class r9 extends eu{constructor(e){super(),this.observer=void 0,this.observer=e}resetInitSegment(e,t,i,s){super.resetInitSegment(e,t,i,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,i){const s=n1(e,t,i,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=vs(e,0);if(!t)return!1;const i=t.length;return e[i]===11&&e[i+1]===119&&Zc(t)!==void 0&&i1(e,i)<16}}function n1(n,e,t,i,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=i+s*x,S=e.subarray(t,t+u);return n.config=v,n.channelCount=m,n.samplerate=a,n.samples.push({unit:S,pts:E}),u}class o9 extends eu{resetInitSegment(e,t,i,s){super.resetInitSegment(e,t,i,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=vs(e,0);let i=(t==null?void 0:t.length)||0;if(t&&e[i]===11&&e[i+1]===119&&Zc(t)!==void 0&&i1(e,i)<=16)return!1;for(let s=e.length;i<s;i++)if(t1(e,i))return pe.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return n9(e,t)}appendFrame(e,t,i){if(this.basePTS!==null)return Jm(e,t,i,this.basePTS,this.frameIndex)}}const a9=/\/emsg[-/]ID3/i;class l9{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,i,s){const r=this.videoTrack=wt("video",1),o=this.audioTrack=wt("audio",1),a=this.txtTrack=wt("text",1);if(this.id3Track=wt("id3",1),this.timeOffset=0,!(e!=null&&e.byteLength))return;const c=vm(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=mm.text,r.sampleDuration=0,r.duration=o.duration=s}resetContiguity(){this.remainderData=null}static probe(e){return l5(e)}demux(e,t){this.timeOffset=t;let i=e;const s=this.videoTrack,r=this.txtTrack;if(this.config.progressive){this.remainderData&&(i=yt(this.remainderData,e));const a=g5(i);this.remainderData=a.remainder,s.samples=a.valid||new Uint8Array}else s.samples=i;const o=this.extractID3Track(s,t);return r.samples=of(t,s),{videoTrack:s,audioTrack:this.audioTrack,id3Track:o,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,i=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const s=this.extractID3Track(t,this.timeOffset);return i.samples=of(e,t),{videoTrack:t,audioTrack:wt(),id3Track:s,textTrack:wt()}}extractID3Track(e,t){const i=this.id3Track;if(e.samples.length){const s=le(e.samples,["emsg"]);s&&s.forEach(r=>{const o=x5(r);if(a9.test(o.schemeIdUri)){const a=Hf(o,t);let c=o.eventDuration===4294967295?Number.POSITIVE_INFINITY:o.eventDuration/o.timeScale;c<=.001&&(c=Number.POSITIVE_INFINITY);const l=o.payload;i.samples.push({data:l,len:l.byteLength,dts:a,pts:a,type:ct.emsg,duration:c})}else if(this.config.enableEmsgKLVMetadata&&o.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const a=Hf(o,t);i.samples.push({data:o.payload,len:o.payload.byteLength,dts:a,pts:a,type:ct.misbklv,duration:Number.POSITIVE_INFINITY})}})}return i}demuxSampleAes(e,t,i){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 Hf(n,e){return j(n.presentationTime)?n.presentationTime/n.timeScale:e+n.presentationTimeDelta/n.timeScale}class c9{constructor(e,t,i){this.keyData=void 0,this.decrypter=void 0,this.keyData=i,this.decrypter=new qc(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,Ai.cbc)}decryptAacSample(e,t,i){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,i)})}decryptAacSamples(e,t,i){for(;;t++){if(t>=e.length){i();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,i),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,i=new Int8Array(t);let s=0;for(let r=32;r<e.length-16;r+=160,s+=16)i.set(e.subarray(r,r+16),s);return i}getAvcDecryptedUnit(e,t){const i=new Uint8Array(t);let s=0;for(let r=32;r<e.length-16;r+=160,s+=16)e.set(i.subarray(s,s+16),r);return e}decryptAvcSample(e,t,i,s,r){const o=Em(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,i+1,s)})}decryptAvcSamples(e,t,i,s){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,i=0){if(t>=e.length){s();return}const r=e[t].units;for(;!(i>=r.length);i++){const o=r[i];if(!(o.data.length<=48||o.type!==1&&o.type!==5)&&(this.decryptAvcSample(e,t,i,s,o),!this.decrypter.isSync()))return}}}}class s1{constructor(){this.VideoSample=null}createVideoSample(e,t,i){return{key:e,frame:!1,pts:t,dts:i,units:[],length:0}}getLastNalUnit(e){var t;let i=this.VideoSample,s;if((!i||i.units.length===0)&&(i=e[e.length-1]),(t=i)!=null&&t.units){const r=i.units;s=r[r.length-1]}return s}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(e.pts===void 0){const i=t.samples,s=i.length;if(s){const r=i[s-1];e.pts=r.pts,e.dts=r.dts}else{t.dropped++;return}}t.samples.push(e)}}parseNALu(e,t,i){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=yt(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=yt(p.data,t))}return e.naluState=r,a}}class Xn{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,i=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(i,i+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 i=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?i<<t|this.readBits(t):i}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 Gf extends s1{parsePES(e,t,i,s){const r=this.parseNALu(e,i.data,s);let o=this.VideoSample,a,c=!1;i.data=null,o&&r.length&&!e.audFound&&(this.pushAccessUnit(o,e),o=this.VideoSample=this.createVideoSample(!1,i.pts,i.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,i.pts,i.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,i.pts,i.dts)),o.key=!0,o.frame=!0;break;case 6:{a=!0,Gc(l.data,1,i.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,i.pts,i.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 Xn(e);return t.readUByte(),t.readUEG(),t.readUEG()}skipScalingList(e,t){let i=8,s=8,r;for(let o=0;o<e;o++)s!==0&&(r=t.readEG(),s=(i+r+256)%256),i=s===0?i:s}readSPS(e){const t=new Xn(e);let i=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()&&(i=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-i*2-s*2),height:(2-T)*(S+1)*16-(T?2:4)*(r+o),pixelRatio:_}}}class Kf extends s1{constructor(...e){super(...e),this.initVPS=null}parsePES(e,t,i,s){const r=this.parseNALu(e,i.data,s);let o=this.VideoSample,a,c=!1;i.data=null,o&&r.length&&!e.audFound&&(this.pushAccessUnit(o,e),o=this.VideoSample=this.createVideoSample(!1,i.pts,i.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,i.pts,i.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,i.pts,i.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,i.pts,i.dts)),o.key=!0,o.frame=!0;break;case 39:a=!0,Gc(l.data,2,i.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,i.pts,i.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,i.pts,i.dts));break;default:a=!1;break}o&&a&&o.units.push(l)}),s&&o&&(this.pushAccessUnit(o,e),this.VideoSample=null)}pushParameterSet(e,t,i){(i&&i[0]===this.initVPS||!i&&!e.length)&&e.push(t)}getNALuType(e,t){return(e[t]&126)>>>1}ebsp2rbsp(e){const t=new Uint8Array(e.byteLength);let i=0;for(let s=0;s<e.byteLength;s++)s>=2&&e[s]===3&&e[s-1]===0&&e[s-2]===0||(t[i]=e[s],i++);return new Uint8Array(t.buffer,0,i)}pushAccessUnit(e,t){super.pushAccessUnit(e,t),this.initVPS&&(this.initVPS=null)}readVPS(e){const t=new Xn(e);t.readUByte(),t.readUByte(),t.readBits(4),t.skipBits(2),t.readBits(6);const i=t.readBits(3),s=t.readBoolean();return{numTemporalLayers:i+1,temporalIdNested:s}}readSPS(e){const t=new Xn(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.readBits(4);const i=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<i;ce++)v.push(t.readBoolean()),x.push(t.readBoolean());if(i>0)for(let ce=i;ce<8;ce++)t.readBits(2);for(let ce=0;ce<i;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,R=0,b=0,L=0;_&&(I+=t.readUEG(),R+=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:i;ce<=i;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 vt=0;vt<=G;vt++){const je=t.readBoolean();let Me=!1;je||(Me=t.readBoolean()),(je||Me)&&Oe++}G=Oe}else{const Oe=t.readUEG(),vt=t.readUEG();G=Oe+vt;for(let je=0;je<Oe;je++)t.readUEG(),t.readBoolean();for(let je=0;je<vt;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,D=1,P=1,w=!0,W=1,z=0;t.readBoolean(),t.readBoolean();let se=!1;if(t.readBoolean()){if(t.readBoolean()){const Le=t.readUByte(),Et=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],Ht=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];Le>0&&Le<16?(D=Et[Le-1],P=Ht[Le-1]):Le===255&&(D=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(),R+=t.readUEG(),b+=t.readUEG(),L+=t.readUEG()),t.readBoolean()&&(W=t.readBits(32),z=t.readBits(32),t.readBoolean()&&t.readUEG(),t.readBoolean())){const Ht=t.readBoolean(),wn=t.readBoolean();let ft=!1;(Ht||wn)&&(ft=t.readBoolean(),ft&&(t.readUByte(),t.readBits(5),t.readBoolean(),t.readBits(5)),t.readBits(4),t.readBits(4),ft&&t.readBits(4),t.readBits(5),t.readBits(5),t.readBits(5));for(let Xt=0;Xt<=i;Xt++){w=t.readBoolean();const co=w||t.readBoolean();let Pn=!1;co?t.readEG():Pn=t.readBoolean();const kn=Pn?1:t.readUEG()+1;if(Ht)for(let dt=0;dt<kn;dt++)t.readUEG(),t.readUEG(),ft&&(t.readUEG(),t.readUEG()),t.skipBits(1);if(wn)for(let dt=0;dt<kn;dt++)t.readUEG(),t.readUEG(),ft&&(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*R-ce*I,de=T-be*L-be*b}const Ie=s?["A","B","C"][s]:"",at=a<<24|c<<16|l<<8|u;let Ce=0;for(let ce=0;ce<32;ce++)Ce=(Ce|(at>>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:w,fps:z/W}},width:ge,height:de,pixelRatio:[D,P]}}readPPS(e){const t=new Xn(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 oi{constructor(e,t,i,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=i,this.logger=s,this.videoParser=null}static probe(e,t){const i=oi.syncOffset(e);return i>0&&t.warn(`MPEG2-TS detected but first sync word found @ offset ${i}`),i!==-1}static syncOffset(e){const t=e.length;let i=Math.min(Ne*5,t-Ne)+1,s=0;for(;s<i;){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&&(i=Math.min(o+Ne*99,e.length-Ne)+1)),r||(r=Nl(e,c)===0),r&&a>1&&(o===0&&a>2||c+Ne>i))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:mm[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?t:void 0}}resetInitSegment(e,t,i,s){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=oi.createTrack("video"),this._videoTrack.duration=s,this._audioTrack=oi.createTrack("audio",s),this._id3Track=oi.createTrack("id3"),this._txtTrack=oi.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=i}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:i}=this;e&&(e.pesData=null),t&&(t.pesData=null),i&&(i.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,i=!1,s=!1){i||(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=yt(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,oi.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),R=Nl(e,_),b=(e[_+3]&48)>>4;let L;if(b>1){if(L=_+5+e[_+4],L===_+Ne)continue}else L=_+4;switch(R){case u:if(I){if(f&&(r=rn(f,this.logger))){if(this.videoParser===null)switch(o.segmentCodec){case"avc":this.videoParser=new Gf;break;case"hevc":this.videoParser=new Kf;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=rn(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=rn(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=u9(e,L);break;case v:{I&&(L+=e[L]+1);const k=f9(e,L,this.typeSupported,i,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=R;break}}else S++;S>0&&Ul(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:i,id3Track:s,textTrack:r}=e,o=i.pesData,a=t.pesData,c=s.pesData;let l;if(o&&(l=rn(o,this.logger))){if(this.videoParser===null)switch(i.segmentCodec){case"avc":this.videoParser=new Gf;break;case"hevc":this.videoParser=new Kf;break}this.videoParser!==null&&(this.videoParser.parsePES(i,r,l,!0),i.pesData=null)}else i.pesData=o;if(a&&(l=rn(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=rn(c,this.logger))?(this.parseID3PES(s,l),s.pesData=null):s.pesData=c}demuxSampleAes(e,t,i){const s=this.demux(e,i,!0,!this.config.progressive),r=this.sampleAes=new c9(this.observer,this.config,t);return this.decrypt(s,r)}decrypt(e,t){return new Promise(i=>{const{audioTrack:s,videoTrack:r}=e;s.samples&&s.segmentCodec==="aac"?t.decryptAacSamples(s.samples,0,()=>{r.samples?t.decryptAvcSamples(r.samples,0,0,()=>{i(e)}):i(e)}):r.samples&&t.decryptAvcSamples(r.samples,0,0,()=>{i(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 i=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=yt(s.sample.unit,r);else{const h=d-f;s.sample.unit.set(r.subarray(0,f),h),e.samples.push(s.sample),i=s.missing}}let o,a;for(o=i,a=r.length;o<a-1&&!$r(r,o);o++);if(o!==i){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",Ul(this.observer,new Error(f),d,this.logger),!d)return}Wm(e,this.observer,r,o,this.audioCodec);let c;if(t.pts!==void 0)c=t.pts;else if(s){const f=zm(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=Qm(e,r,o,c,l),o+=u.length,u.missing){this.aacOverFlow=u;break}else for(l++;o<a-1&&!$r(r,o);o++);}parseMPEGPES(e,t){const i=t.data,s=i.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(e1(i,o)){const c=Jm(e,i,o,a,r);if(c)o+=c.length,r++;else break}else o++}parseAC3PES(e,t){{const i=t.data,s=t.pts;if(s===void 0){this.logger.warn("[tsdemuxer]: AC3 PES unknown PTS");return}const r=i.length;let o=0,a=0,c;for(;a<r&&(c=n1(e,i,a,s,o++))>0;)a+=c}}parseID3PES(e,t){if(t.pts===void 0){this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const i=me({},t,{type:this._videoTrack?ct.emsg:ct.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(i)}}function Nl(n,e){return((n[e+1]&31)<<8)+n[e+2]}function u9(n,e){return(n[e+10]&31)<<8|n[e+11]}function f9(n,e,t,i,s,r){const o={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},a=(n[e+1]&15)<<8|n[e+2],c=e+3+a-4,l=(n[e+10]&15)<<8|n[e+11];for(e+=12+l;e<c;){const u=Nl(n,e),f=(n[e+3]&15)<<8|n[e+4];switch(n[e]){case 207:if(!i){Go("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(!i){Go("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(!i){Go("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(n[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=n[d+1]+2;d+=m,h-=m}}break;case 194:case 135:return Ul(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 Ul(n,e,t,i){i.warn(`parsing error: ${e.message}`),n.emit(A.ERROR,A.ERROR,{type:Z.MEDIA_ERROR,details:$.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function Go(n,e){e.log(`${n} with AES-128-CBC encryption found in unencrypted stream`)}function rn(n,e){let t=0,i,s,r,o,a;const c=n.data;if(!n||n.size===0)return null;for(;c[0].length<19&&c.length>1;)c[0]=yt(c[0],c[1]),c.splice(1,1);if(i=c[0],(i[0]<<16)+(i[1]<<8)+i[2]===1){if(s=(i[4]<<8)+i[5],s&&s>n.size-6)return null;const u=i[7];u&192&&(o=(i[9]&14)*536870912+(i[10]&255)*4194304+(i[11]&254)*16384+(i[12]&255)*128+(i[13]&254)/2,u&64?(a=(i[14]&14)*536870912+(i[15]&255)*4194304+(i[16]&254)*16384+(i[17]&255)*128+(i[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=i[8];let f=r+9;if(n.size<=f)return null;n.size-=f;const d=new Uint8Array(n.size);for(let h=0,p=c.length;h<p;h++){i=c[h];let m=i.byteLength;if(f)if(f>m){f-=m;continue}else i=i.subarray(f),m-=f,f=0;d.set(i,t),t+=m}return s&&(s-=r+3),{data:d,pts:o,dts:a,len:s}}return null}class d9{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 ti=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]),i=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:i};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 i=8,s=t.length;const r=s;for(;s--;)i+=t[s].byteLength;const o=new Uint8Array(i);for(o[0]=i>>24&255,o[1]=i>>16&255,o[2]=i>>8&255,o[3]=i&255,o.set(e,4),s=0,i=8;s<r;s++)o.set(t[s],i),i+=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 i=Math.floor(t/(ti+1)),s=Math.floor(t%(ti+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,i>>24,i>>16&255,i>>8&255,i&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,i){return U.box(U.types.moof,U.mfhd(e),U.traf(i,t))}static moov(e){let t=e.length;const i=[];for(;t--;)i[t]=U.trak(e[t]);return U.box.apply(null,[U.types.moov,U.mvhd(e[0].timescale||0,e[0].duration||0)].concat(i).concat(U.mvex(e)))}static mvex(e){let t=e.length;const i=[];for(;t--;)i[t]=U.trex(e[t]);return U.box.apply(null,[U.types.mvex,...i])}static mvhd(e,t){t*=e;const i=Math.floor(t/(ti+1)),s=Math.floor(t%(ti+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,i>>24,i>>16&255,i>>8&255,i&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||[],i=new Uint8Array(4+t.length);let s,r;for(s=0;s<t.length;s++)r=t[s].flags,i[s+4]=r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy;return U.box(U.types.sdtp,i)}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=[],i=[],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,i.push(o>>>8&255),i.push(o&255),i=i.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(i))),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,i=(e.duration||0)*(e.timescale||0),s=e.width||0,r=e.height||0,o=Math.floor(i/(ti+1)),a=Math.floor(i%(ti+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 i=U.sdtp(e),s=e.id,r=Math.floor(t/(ti+1)),o=Math.floor(t%(ti+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,i.length+16+20+8+16+8+8),i)}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 i=e.samples||[],s=i.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=i[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 yt(U.FTYP,t)}static hvc1(e){const t=e.params,i=[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),i.length]);let o=r.length;for(let p=0;p<i.length;p+=1){o+=3;for(let m=0;m<i[p].length;m+=1)o+=2+i[p][m].length}const a=new Uint8Array(o);a.set(r,0),o=r.length;const c=i.length-1;for(let p=0;p<i.length;p+=1){a.set(new Uint8Array([32+p|(p===c?128:0),0,i[p].length]),o),o+=3;for(let m=0;m<i[p].length;m+=1)a.set(new Uint8Array([i[p][m].length>>8,i[p][m].length&255]),o),o+=2,a.set(i[p][m],o),o+=i[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 r1=9e4;function iu(n,e,t=1,i=!1){const s=n*e*t;return i?Math.round(s):s}function h9(n,e,t=1,i=!1){return iu(n,e,1/t,i)}function Un(n,e=!1){return iu(n,1e3,1/r1,e)}function p9(n,e=1){return iu(n,r1,1/e)}const g9=10*1e3,m9=1024,x9=1152,y9=1536;let on=null,Ko=null;function Vf(n,e,t,i){return{duration:e,size:t,cts:i,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:n?2:1,isNonSync:n?0:1}}}class ar extends Lt{constructor(e,t,i,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=i,this.ISGenerated=!1,on===null){const o=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);on=o?parseInt(o[1]):0}if(Ko===null){const r=navigator.userAgent.match(/Safari\/(\d+)/i);Ko=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 i=e[0].pts,s=e.reduce((r,o)=>{let a=o.pts,c=a-r;return c<-4294967296&&(t=!0,a=gt(a,i),c=a-r),c>0?r:a},i);return t&&this.debug("PTS rollover detected"),s}remux(e,t,i,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,R,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])||((R=t.pixelRatio)==null?void 0:R[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=v9(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=(gt(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&&(i.samples.length&&(h=o1(i,r,this._initPTS,this._initDTS)),s.samples.length&&(d=a1(s,r,this._initPTS))),{audio:u,video:l,initSegment:f,independent:p,text:d,id3:h}}generateIS(e,t,i,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*i):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*i);h=Math.min(h,gt(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,i,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(!i||f===null){const C=u+t*r,D=o[0].pts-gt(o[0].dts,o[0].pts);on&&f!==null&&Math.abs(C-D-(f+u))<15e3?i=!0:f=C-D-u}const x=f+u;for(let C=0;C<c;C++){const D=o[C];D.pts=gt(D.pts,x),D.dts=gt(D.dts,x),D.dts<o[C>0?C-1:C].dts&&(v=!0)}v&&o.sort(function(C,D){const P=C.dts-D.dts,w=C.pts-D.pts;return P||w}),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(i){const C=p-x,D=C>S,P=C<-1;if((D||P)&&(D?this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${Un(C,!0)} ms (${C}dts) hole between fragments detected at ${t.toFixed(3)}`):this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${Un(-C,!0)} ms (${C}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!P||x>=o[0].pts||on)){p=x;const w=o[0].pts-C;if(D)o[0].dts=p,o[0].pts=w;else{let W=!0;for(let z=0;z<o.length&&!(o[z].dts>w&&W);z++){const se=o[z].pts;if(o[z].dts-=C,o[z].pts-=C,z<o.length-1){const ee=o[z+1].pts,ge=o[z].pts,de=ee<=ge,Ie=ee<=se;W=de==Ie}}}this.log(`Video: Initial PTS/DTS adjusted: ${Un(w,!0)}/${Un(p,!0)}, delta: ${Un(C,!0)} ms`)}}p=Math.max(0,p);let T=0,_=0,I=p;for(let C=0;C<c;C++){const D=o[C],P=D.units,w=P.length;let W=0;for(let z=0;z<w;z++)W+=P[z].data.length;_+=W,T+=w,D.length=W,D.dts<I?(D.dts=I,I+=S/4|0||1):I=D.dts,g=Math.min(D.pts,g),y=Math.max(D.pts,y)}m=o[c-1].dts;const R=_+4*T+8;let b;try{b=new Uint8Array(R)}catch(C){this.observer.emit(A.ERROR,A.ERROR,{type:Z.MUX_ERROR,details:$.REMUX_ALLOC_ERROR,fatal:!1,error:C,bytes:R,reason:`fail allocating video mdat ${R}`});return}const L=new DataView(b.buffer);L.setUint32(0,R),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 D=o[C],P=D.units;let w=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,w+=4+Ie}let W;if(C<c-1)h=o[C+1].dts-D.dts,W=o[C+1].pts-D.pts;else{const se=this.config,ee=C>0?D.dts-o[C-1].dts:S;if(W=C>0?D.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)-D.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 z=Math.round(D.pts-D.dts);M=Math.min(M,h),F=Math.max(F,h),N=Math.min(N,W),O=Math.max(O,W),a.push(Vf(D.key,h,w,z))}if(a.length){if(on){if(on<70){const C=a[0].flags;C.dependsOn=2,C.isNonSync=0}}else if(Ko&&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 D=0,P=a.length;D<P;D++){const w=C+a[D].duration,W=C+a[D].cts;if(D<P-1){const z=w+a[D+1].cts;a[D].duration=z-W}else a[D].duration=D?a[D-1].duration:S;a[D].cts=0,C=w}}}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 x9;case"ac3":return y9;default:return m9}}remuxAudio(e,t,i,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=i=i||m.length&&y>0&&(s&&Math.abs(x-(y+v))<9e3||Math.abs(gt(m[0].pts,x)-(y+v))<20*u),m.forEach(function(O){O.pts=gt(O.pts,x)}),!i||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,D=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&&D<g9&&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 w=0;w<P;w++){let W=d9.getSilentFrame(e.parsedCodec||e.manifestCodec||e.codec,e.channelCount);W||(this.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),W=G.unit.subarray()),m.splice(K,0,{unit:W,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 D=h[O-1];D.duration=Math.round((H-S)/c)}else if(i&&e.segmentCodec==="aac"&&(H=y+v),E=H,_>0){_+=g;try{T=new Uint8Array(_)}catch(D){this.observer.emit(A.ERROR,A.ERROR,{type:Z.MUX_ERROR,details:$.REMUX_ALLOC_ERROR,fatal:!1,error:D,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(Vf(!0,l,C,0)),S=H}const R=h.length;if(!R)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:R};return this.isAudioContiguous=!0,F}}function gt(n,e){let t;if(e===null)return n;for(e<n?t=-8589934592:t=8589934592;Math.abs(n-e)>4294967296;)n+=t;return n}function v9(n){for(let e=0;e<n.length;e++)if(n[e].key)return e;return-1}function o1(n,e,t,i){const s=n.samples.length;if(!s)return;const r=n.inputTimeScale;for(let a=0;a<s;a++){const c=n.samples[a];c.pts=gt(c.pts-t.baseTime*r/t.timescale,e*r)/r,c.dts=gt(c.dts-i.baseTime*r/i.timescale,e*r)/r}const o=n.samples;return n.samples=[],{samples:o}}function a1(n,e,t){const i=n.samples.length;if(!i)return;const s=n.inputTimeScale;for(let o=0;o<i;o++){const a=n.samples[o];a.pts=gt(a.pts-t.baseTime*s/t.timescale,e*s)/s}n.samples.sort((o,a)=>o.pts-a.pts);const r=n.samples;return n.samples=[],{samples:r}}class E9 extends Lt{constructor(e,t,i,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,i,s){this.audioCodec=t,this.videoCodec=i,this.generateInitSegment(d5(e,s)),this.emitInitSegment=!0}generateInitSegment(e){let{audioCodec:t,videoCodec:i}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const s=this.initData=vm(e);s.audio&&(t=jf(s.audio,ve.AUDIO,this)),s.video&&(i=jf(s.video,ve.VIDEO,this));const r={};s.audio&&s.video?r.audiovideo={container:"video/mp4",codec:t+","+i,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:i,supplemental:s.video.supplemental,initSegment:e,id:"main"}:this.warn("initSegment does not contain moov or trak boxes."),this.initTracks=r}remux(e,t,i,s,r,o){var a,c;let{initPTS:l,lastEndTime:u}=this;const f={audio:void 0,video:void 0,text:s,id3:i,initSegment:void 0};j(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=p5(d,p,this),g=p.audio?m[p.audio.id]:null,y=p.video?m[p.video.id]:null,v=Ws(y,1/0),x=Ws(g,1/0),E=Ws(y,0,!0),S=Ws(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)&&(A9(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 R=e?_-l.baseTime/l.timescale:u,b=R+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:R,startDTS:R,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=o1(i,r,l,l),s.samples.length&&(f.text=a1(s,r,l)),f}}function Ws(n,e,t=!1){return(n==null?void 0:n.start)!==void 0?(n.start+(t?n.duration:0))/n.timescale:e}function A9(n,e,t,i){if(n===null)return!0;const s=Math.max(i,1),r=e-n.baseTime/n.timescale;return Math.abs(r-t)>s}function jf(n,e,t){const i=n==null?void 0:n.codec;return i&&i.length>4?i:e===ve.AUDIO?i==="ec-3"||i==="ac-3"||i==="alac"?i:i==="fLaC"||i==="Opus"?kr(i,!1):(t.warn(`Unhandled audio codec "${i}" in mp4 MAP`),i||"mp4a"):(t.warn(`Unhandled video codec "${i}" in mp4 MAP`),i||"avc1")}let qt;try{qt=self.performance.now.bind(self.performance)}catch{qt=Date.now}const lr=[{demux:l9,remux:E9},{demux:oi,remux:ar},{demux:s9,remux:ar},{demux:o9,remux:ar}];lr.splice(2,0,{demux:r9,remux:ar});class qf{constructor(e,t,i,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=i,this.id=r,this.logger=o}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,i,s){const r=i.transmuxing;r.executeStart=qt();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=S9(o,t);if(E&&gn(E.method)){const I=this.getDecrypter(),R=zc(E.method);if(I.isSync()){let b=I.softwareDecrypt(o,E.key.buffer,E.iv.buffer,R);if(i.part>-1){const k=I.flush();b=k&&k.buffer}if(!b)return r.executeEnd=qt(),Vo(i);o=new Uint8Array(b)}else return this.asyncResult=!0,this.decryptionPromise=I.webCryptoDecrypt(o,E.key.buffer,E.iv.buffer,R).then(b=>{const L=this.push(b,null,i);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=qt(),Vo(i)}(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,i);this.asyncResult=Es(T);const _=this.currentTransmuxState;return _.contiguous=!0,_.discontinuity=!1,_.trackSwitch=!1,r.executeEnd=qt(),T}flush(e){const t=e.transmuxing;t.executeStart=qt();const{decrypter:i,currentTransmuxState:s,decryptionPromise:r}=this;if(r)return this.asyncResult=!0,r.then(()=>this.flush(e));const o=[],{timeOffset:a}=s;if(i){const f=i.flush();f&&o.push(this.push(f.buffer,null,e))}const{demuxer:c,remuxer:l}=this;if(!c||!l){t.executeEnd=qt();const f=[Vo(e)];return this.asyncResult?Promise.resolve(f):f}const u=c.flush(a);return Es(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,i){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: ${i.sn}${i.part>-1?" part: "+i.part:""} of ${this.id===X.MAIN?"level":"track"} ${i.level}`);const u=this.remuxer.remux(s,r,o,a,l,c,!0,this.id);e.push({remuxResult:u,chunkMeta:i}),i.transmuxing.executeEnd=qt()}resetInitialTimestamp(e){const{demuxer:t,remuxer:i}=this;!t||!i||(t.resetTimeStamp(e),i.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;!e||!t||(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,i,s,r){const{demuxer:o,remuxer:a}=this;!o||!a||(o.resetInitSegment(e,t,i,s),a.resetInitSegment(e,t,i,r))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,i,s,r){let o;return t&&t.method==="SAMPLE-AES"?o=this.transmuxSampleAes(e,t,i,s,r):o=this.transmuxUnencrypted(e,i,s,r),o}transmuxUnencrypted(e,t,i,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,i,!1,this.id),chunkMeta:s}}transmuxSampleAes(e,t,i,s,r){return this.demuxer.demuxSampleAes(e,t,i).then(o=>({remuxResult:this.remuxer.remux(o.audioTrack,o.videoTrack,o.id3Track,o.textTrack,i,s,!1,this.id),chunkMeta:r}))}configureTransmuxer(e){const{config:t,observer:i,typeSupported:s}=this;let r;for(let f=0,d=lr.length;f<d;f++){var o;if((o=lr[f].demux)!=null&&o.probe(e,this.logger)){r=lr[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(i,t,s,this.logger)),(!a||!(a instanceof u))&&(this.demuxer=new u(i,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 qc(this.config)),e}}function S9(n,e){let t=null;return n.byteLength>0&&(e==null?void 0:e.key)!=null&&e.iv!==null&&e.method!=null&&(t=e),t}const Vo=n=>({remuxResult:{},chunkMeta:n});function Es(n){return"then"in n&&n.then instanceof Function}class T9{constructor(e,t,i,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=i,this.duration=s,this.defaultInitPts=r||null}}class b9{constructor(e,t,i,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=i,this.trackSwitch=s,this.timeOffset=r,this.initSegmentChange=o}}let Wf=0;class l1{constructor(e,t,i,s){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=Wf++,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=i,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 Yc,this.observer.on(A.FRAG_DECRYPTED,o),this.observer.on(A.ERROR,o);const a=cf(r.preferManagedMediaSource);if(this.useWorker&&typeof Worker<"u"){const c=this.hls.logger;if(r.workerPath||Rb()){try{r.workerPath?(c.log(`loading Web Worker ${r.workerPath} for "${t}"`),this.workerContext=Pb(r.workerPath)):(c.log(`injecting Web Worker for "${t}"`),this.workerContext=wb());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 qf(this.observer,a,r,"",t,e.logger)}return}}this.transmuxer=new qf(this.observer,a,r,"",t,e.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const e=this.instanceNo;this.instanceNo=Wf++;const t=this.hls.config,i=cf(t.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:e,typeSupported:i,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),kb(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,i,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 R=!(y&&((f=r.initSegment)==null?void 0:f.url)===((d=y.initSegment)==null?void 0:d.url)),b=new b9(v,_,c,x,m,R);if(!_||v||R){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: ${R}`);const L=new T9(i,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);Es(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:i}=this;if(this.workerContext)this.workerContext.worker.postMessage({instanceNo:t,cmd:"flush",chunkMeta:e});else if(i){const s=i.flush(e);Es(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,i){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:i}))}handleFlushResult(e,t){e.forEach(i=>{this.handleTransmuxComplete(i)}),this.onFlush(t)}configureTransmuxer(e){const{instanceNo:t,transmuxer:i}=this;this.workerContext?this.workerContext.worker.postMessage({instanceNo:t,cmd:"configure",config:e}):i&&i.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}const zf=100;class _9 extends Qc{constructor(e,t,i){super(e,t,i,"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:i,initPTS:s,timescale:r}){if(i===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 i;const s=((i=this.mainFragLoading)==null?void 0:i.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=Lm(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 i=this.lastCurrentTime;this.stopLoad(),this.setInterval(zf),i>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${i.toFixed(3)}`),e=i,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:i}=this,s=t==null?void 0:t[i],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(),i=this.retryDate;if(!i||t>=i||(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:i,part:s,cache:r,complete:o}=t,a=this.mainAnchor;if(this.initPTS[i.cc]!==void 0){this.waitingData=null,this.state=V.FRAG_LOADING;const c=r.flush().buffer,l={frag:i,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:i,media:s,trackId:r}=this,o=t.config;if(!this.buffering||!s&&!this.primaryPrefetch&&(this.startFragRequested||!o.startFragPrefetch)||!(i!=null&&i[r]))return;const a=i[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&&we(y)&&!y.endList&&(!c.live||!this.loadingParts&&g<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(v)===Be.OK&&(this.mainFragLoading=v=null),v&&we(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(i=>new ms(i))}onAudioTrackSwitching(e,t){const i=!!t.url;this.trackId=t.id;const{fragCurrent:s}=this;s&&(s.abortRequests(),this.removeUnbufferedFrags(s.start)),this.resetLoadingState(),i?(this.switchingTrack=t,this.flushAudioIfNeeded(t),this.state!==V.STOPPED&&(this.setInterval(zf),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 i=this.cachedTrackLoadedData;i&&(this.cachedTrackLoadedData=null,this.onAudioTrackLoaded(A.AUDIO_TRACK_LOADED,i))}onAudioTrackLoaded(e,t){var i;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||(i=u.details)!=null&&i.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||(Gm(r,l),r.alignedSliding||Ur(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 i=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 ${i.sn} of level ${i.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(i.start);return}const f=o.defaultAudioCodec||l.audioCodec||"mp4a.40.2";let d=this.transmuxer;d||(d=this.transmuxer=new l1(this.hls,X.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const h=this.initPTS[i.cc],p=(t=i.initSegment)==null?void 0:t.data;if(h!==void 0){const g=s?s.index:-1,y=g!==-1,v=new Wc(i.level,i.sn,i.stats.chunkCount,r.byteLength,g,y);d.push(r,p,f,"",i,s,u.totalduration,!1,v,h)}else{this.log(`Unknown video PTS for cc ${i.cc}, waiting for video PTS before demuxing audio frag ${i.sn} of [${u.startSN} ,${u.endSN}],track ${a}`);const{cache:m}=this.waitingData=this.waitingData||{frag:i,part:s,cache:new Km,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 i=t.tracks.audio;i&&(this.mediaBuffer=i.buffer||null)}onFragLoading(e,t){!this.audioOnly&&t.frag.type===X.MAIN&&we(t.frag)&&(this.mainFragLoading=t,this.state===V.IDLE&&this.tick())}onFragBuffered(e,t){const{frag:i,part:s}=t;if(i.type!==X.AUDIO){!this.audioOnly&&i.type===X.MAIN&&!i.elementaryStreams.video&&!i.elementaryStreams.audiovideo&&(this.audioOnly=!0,this.mainFragLoading=null);return}if(this.fragContextChanged(i)){this.warn(`Fragment ${i.sn}${s?" p: "+s.index:""} of level ${i.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(we(i)){this.fragPrevious=i;const r=this.switchingTrack;r&&(this.bufferedTrack=r,this.switchingTrack=null,this.hls.trigger(A.AUDIO_TRACK_SWITCHED,ye({},r)))}this.fragBufferedComplete(i,s),this.media&&this.tick()}onError(e,t){var i;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&&((i=t.context)==null?void 0:i.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 i=this.mediaBuffer||this.media;i&&(this.afterBufferFlushed(i,t,X.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const i="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:i,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:i,frag:c,details:f},p);s.trigger(A.FRAG_PARSING_METADATA,g)}if(h){const g=me({id:i,frag:c,details:f},h);s.trigger(A.FRAG_PARSING_USERDATA,g)}}_bufferInitSegment(e,t,i,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:i,part:null,chunkMeta:s,parent:i.type,data:a};this.hls.trigger(A.BUFFER_APPENDING,c)}this.tickImmediate()}loadFragment(e,t,i){const s=this.fragmentTracker.getState(e);if(this.switchingTrack||s===Be.NOT_LOADED||s===Be.PARTIAL){var r;if(!we(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&&Ur(t.details,o)}else super.loadFragment(e,t,i)}else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){if(this.media&&this.bufferedTrack){const{name:t,lang:i,assocLang:s,characteristics:r,audioCodec:o,channels:a}=this.bufferedTrack;Mi({name:t,lang:i,assocLang:s,characteristics:r,audioCodec:o,channels:a},e,Ii)||(Fr(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 nu extends Lt{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,i){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=i&&uf(i);return new ff(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(i){this.warn(`Could not construct new URL with HLS Delivery Directives: ${i}`)}return e}playlistLoaded(e,t,i){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||i!=null&&i.live){const u="levelInfo"in t?t.levelInfo:t.track;if(s.reloaded(i),i&&s.fragments.length>0){Eb(i,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=Mm(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,R=I+s.ageHeader;let b=Math.min(R-s.partTarget,s.targetduration*1.5);if(b>0){if(R>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(i!=null&&i.tuneInGoal&&R-s.partTarget>i.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${i.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,i){const s=i||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,i,s){let r=uf(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(i=t.msn,s=t.part,r=rr.No),new ff(i,s,r)}checkRetry(e){const t=e.details,i=Or(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(i&&(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=jc(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 c1(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(!As(n[t].attrs,e[t].attrs))return!1;return!0}function As(n,e,t){const i=n["STABLE-RENDITION-ID"];return i&&!t?i===e["STABLE-RENDITION-ID"]:!(t||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some(s=>n[s]!==e[s])}function $l(n,e){return e.label.toLowerCase()===n.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(n.lang||"").toLowerCase())}class I9 extends nu{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:i,groupId:s,details:r}=t,o=this.tracksInGroup[i];if(!o||o.groupId!==s){this.warn(`Audio track with id:${i} 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 ${i} "${o.name}" lang:${o.lang} group:${s} loaded [${r.startSN}-${r.endSN}]`),i===this.trackId&&this.playlistLoaded(i,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 i=t.audioGroups||null,s=this.groupIds;let r=this.currentTrack;if(!i||(s==null?void 0:s.length)!==(i==null?void 0:i.length)||i!=null&&i.some(a=>(s==null?void 0:s.indexOf(a))===-1)){this.groupIds=i,this.trackId=-1,this.currentTrack=null;const a=this.tracks.filter(d=>!i||i.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=Ot(c,a,Ii);if(d>-1)r=a[d];else{const h=Ot(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): ${i==null?void 0:i.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 i=this.allAudioTracks;if(this.selectDefaultTrack=!1,i.length){const s=this.currentTrack;if(s&&Mi(e,s,Ii))return s;const r=Ot(e,this.tracksInGroup,Ii);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=U5(e,t.levels,i,o,Ii);if(a===-1)return null;t.nextLoadLevel=a}if(e.channels||e.audioCodec){const o=Ot(e,i);if(o>-1)return i[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 i=this.currentTrack,s=t[e],r=s.details&&!s.details.live;if(e===this.trackId&&s===i&&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,i==null?void 0:i.details,s.details);this.loadPlaylist(o)}findTrackId(e){const t=this.tracksInGroup;for(let i=0;i<t.length;i++){const s=t[i];if(!(this.selectDefaultTrack&&!s.default)&&(!e||Mi(e,s,Ii)))return i}if(e){const{name:i,lang:s,assocLang:r,characteristics:o,audioCodec:a,channels:c}=e;for(let l=0;l<t.length;l++){const u=t[l];if(Mi({name:i,lang:s,assocLang:r,characteristics:o,audioCodec:a,channels:c},u,Ii))return l}for(let l=0;l<t.length;l++){const u=t[l];if(As(e.attrs,u.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return l}for(let l=0;l<t.length;l++){const u=t[l];if(As(e.attrs,u.attrs,["LANGUAGE"]))return l}}return-1}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;this.shouldLoadPlaylist(t)&&Fr(t.url,this.hls)&&this.scheduleLoading(t,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const i=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 ${i} "${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:i,groupId:s,deliveryDirectives:t||null,track:e})}}class C9{constructor(e){this.tracks=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.tracks=e}destroy(){this.tracks=this.queues=null}append(e,t,i){if(this.queues===null||this.tracks===null)return;const s=this.queues[t];s.push(e),s.length===1&&!i&&this.executeNext(t)}appendBlocker(e){return new Promise(t=>{const i={label:"async-blocker",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.append(i,e)})}prependBlocker(e){return new Promise(t=>{if(this.queues){const i={label:"async-blocker-prepend",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.queues[e].unshift(i)}})}removeBlockers(){this.queues!==null&&[this.queues.video,this.queues.audio,this.queues.audiovideo].forEach(e=>{var t;const i=(t=e[0])==null?void 0:t.label;(i==="async-blocker"||i==="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 i;if(s.onError(r),this.queues===null||this.tracks===null)return;const o=(i=this.tracks[e])==null?void 0:i.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,i;return(t=this.queues)!=null&&t[e]||(i=this.tracks)!=null&&i[e]?`${e}: (${this.listSbInfo(e)}) ${this.listOps(e)}`:""}listSbInfo(e){var t;const i=(t=this.tracks)==null?void 0:t[e],s=i==null?void 0:i.buffer;return s?`SourceBuffer${s.updating?" updating":""}${i.ended?" ended":""}${i.ending?" ending":""}`:"none"}listOps(e){var t;return((t=this.queues)==null?void 0:t[e].map(i=>i.label).join(", "))||""}}const Qf=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,u1="HlsJsTrackRemovedError";class L9 extends Error{constructor(e){super(e),this.name=u1}}class D9 extends Lt{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=i=>{var s;this.hls&&((s=this.mediaSource)==null?void 0:s.readyState)==="open"&&this.hls.pauseBuffering()},this._onStartStreaming=i=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=i=>{const{media:s,mediaSource:r}=this;i&&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:i,_objectUrl:s}=this;i!==s&&this.error(`Media element src was set while attaching MediaSource (${s} > ${i})`)},this.hls=e,this.fragmentTracker=t,this.appendSource=i5(Ei(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 i={};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(i,s.tracks):this.sourceBuffers.forEach(r=>{const[o]=r;o&&(i[o]=me({},this.tracks[o]),this.removeBuffer(o)),r[0]=r[1]=null}),{media:e,mediaSource:t,tracks:i}}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 i;let s=2;(t.audio&&!t.video||!t.altAudio)&&(s=1),this.bufferCodecEventsTotal=s,this.log(`${s} bufferCodec event(s) expected.`),(i=this.transferData)!=null&&i.mediaSource&&this.sourceBufferCount&&s&&this.bufferCreated()}onMediaAttaching(e,t){const i=this.media=t.media,s=Ei(this.appendSource);if(this.transferData=this.overrides=void 0,i&&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=i.src,this.attachTransferred();else{const a=this._objectUrl=self.URL.createObjectURL(o);if(this.appendSource)try{i.removeAttribute("src");const c=self.ManagedMediaSource;i.disableRemotePlayback=i.disableRemotePlayback||c&&o instanceof c,Yf(i),R9(i,a),i.load()}catch{i.src=a}else i.src=a}i.addEventListener("emptied",this._onMediaEmptied)}}assignMediaSource(e){var t,i;this.log(`${((t=this.transferData)==null?void 0:t.mediaSource)===e?"transferred":"created"} media source: ${(i=e.constructor)==null?void 0:i.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 i=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(i,(c,l)=>c==="initSegment"?void 0:l)};
- transfer tracks: ${Ae(s,(c,l)=>c==="initSegment"?void 0:l)}}`),!dm(s,i)){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(i)}") 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=jo(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 i=!!t.transferMedia;this.transferData=this.overrides=void 0;const{media:s,mediaSource:r,_objectUrl:o}=this;if(r){if(this.log(`media source ${i?"transferring":"detaching"}`),i)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),i||(o&&self.URL.revokeObjectURL(o),this.mediaSrc===o?(s.removeAttribute("src"),this.appendSource&&Yf(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 i=(t=this.tracks[e])==null?void 0:t.buffer;if(this.removeBuffer(e),i)try{var s;(s=this.mediaSource)!=null&&s.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(i)}catch(r){this.warn(`onBufferReset ${e}`,r)}delete this.tracks[e]}removeBuffer(e){this.removeBufferListeners(e),this.sourceBuffers[jo(e)]=[null,null];const t=this.tracks[e];t&&(t.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new C9(this.tracks)}onBufferCodecs(e,t){const i=this.tracks,s=Object.keys(t);this.log(`BUFFER_CODECS: "${s}" (current SB count ${this.sourceBufferCount})`);const r="audiovideo"in t&&(i.audio||i.video)||i.audiovideo&&("audio"in t||"video"in t),o=!r&&this.sourceBufferCount&&this.media&&s.some(a=>!i[a]);if(r||o){this.warn(`Unsupported transition between "${Object.keys(i)}" 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=i[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=i[a]={buffer:void 0,listeners:[],codec:h,supplemental:y,container:m,levelCodec:p,metadata:g,id:d});const _=sr(S,T),I=_==null?void 0:_.replace(Qf,"$1");let R=sr(h,p);const b=(u=R)==null?void 0:u.replace(Qf,"$1");R&&_&&I!==b&&(a.slice(0,5)==="audio"&&(R=kr(R,this.appendSource)),this.log(`switching codec ${S} to ${R}`),R!==(v.pendingCodec||v.codec)&&(v.pendingCodec=R),v.container=m,this.appendChangeType(a,m,R))}),(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 i=this.tracks[t];return e[t]={id:i.id,container:i.container,codec:i.codec,levelCodec:i.levelCodec},e},{})}appendChangeType(e,t,i){const s=`${t};codecs=${i}`,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=i,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 i=e.start,s=i+e.duration*.05;if(((t=this.fragmentTracker.getAppendedFrag(i,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:i}=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=i.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=i.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 R=_.end;if(I){const b=I.frag.start;(R>b||R<this.lastVideoAppendEnd||re.isBuffered(E,b))&&this.unblockAudio()}this.lastVideoAppendEnd=R}}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&&j(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(([R,b])=>{R&&(I[R]=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 R={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 _)R.details=$.BUFFER_FULL_ERROR;else if(_.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!b)R.errorAction=xs(!0);else if(_.name===u1&&this.sourceBufferCount===0)R.errorAction=xs(!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)&&(R.fatal=!0)}this.hls.trigger(A.ERROR,R)}};this.append(T,r,this.isPending(this.tracks[r]))}getFlushOp(e,t,i){return this.log(`queuing "${e}" remove ${t}-${i}`),{label:"remove",execute:()=>{this.removeExecutor(e,t,i)},onStart:()=>{},onComplete:()=>{this.hls.trigger(A.BUFFER_FLUSHED,{type:e})},onError:s=>{this.warn(`Failed to remove ${t}-${i} from "${e}" SourceBuffer`,s)}}}onBufferFlushing(e,t){const{type:i,startOffset:s,endOffset:r}=t;i?this.append(this.getFlushOp(i,s,r),i):this.sourceBuffers.forEach(([o])=>{o&&this.append(this.getFlushOp(o,s,r),o)})}onFragParsed(e,t){const{frag:i,part:s}=t,r=[],o=s?s.elementaryStreams:i.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();i.stats.buffering.end=c,s&&(s.stats.buffering.end=c);const l=s?s.stats:i.stats;this.hls.trigger(A.FRAG_BUFFERED,{frag:i,part:s,stats:l,id:i.type})};r.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${i.type} level: ${i.level} sn: ${i.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,i;return e&&(!((t=this.tracks[e])!=null&&t.ended)||((i=this.tracks[e])==null?void 0:i.ending))})}onBufferEos(e,t){var i;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=((i=this.overrides)==null?void 0:i.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 i;const s=(i=t.errorAction)==null?void 0:i.nextAutoLevel;j(s)&&s!==t.frag.level&&this.resetAppendErrors()}}resetAppendErrors(){this.appendErrors={audio:0,video:0,audiovideo:0}}trimBuffers(){const{hls:e,details:t,media:i}=this;if(!i||t===null||!this.sourceBufferCount)return;const s=e.config,r=i.currentTime,o=t.levelTargetDuration,a=t.live&&s.liveBackBufferLength!==null?s.liveBackBufferLength:s.backBufferLength;if(j(a)&&a>=0){const c=Math.max(a,o),l=Math.floor(r/o)*o-c;this.flushBackBuffer(r,o,l)}if(j(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,i){this.sourceBuffers.forEach(([s,r])=>{if(r){const a=re.getBuffered(r);if(a.length>0&&i>a.start(0)){var o;this.hls.trigger(A.BACK_BUFFER_REACHED,{bufferEnd:i});const c=this.tracks[s];if((o=this.details)!=null&&o.live)this.hls.trigger(A.LIVE_BACK_BUFFER_REACHED,{bufferEnd:i});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:i,type:s})}}})}flushFrontBuffer(e,t,i){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(i>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:i}=this;if(!t||!this.media||(i==null?void 0:i.readyState)!=="open")return null;const s=t.edge;if(t.live&&this.hls.config.liveDurationInfinity){if(t.fragments.length&&t.live&&i.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 j(r)?{duration:r}:null;const o=this.media.duration,a=j(i.duration)?i.duration:0;return s>a&&s>o||!j(o)?{duration:s}:null}updateMediaSource({duration:e,start:t,end:i}){const s=this.mediaSource;!this.media||!s||s.readyState!=="open"||(s.duration!==e&&(j(e)&&this.log(`Updating MediaSource duration to ${e.toFixed(3)}`),s.duration=e),t!==void 0&&i!==void 0&&(this.log(`MediaSource duration is set to ${s.duration}. Setting seekable range to ${t}-${i}.`),s.setLiveSeekableRange(t,i)))}get tracksReady(){const e=this.pendingTrackCount;return e>0&&(e>=this.bufferCodecEventsTotal||this.isPending(this.tracks.audiovideo))}checkPendingTracks(){const{bufferCodecEventsTotal:e,pendingTrackCount:t,tracks:i}=this;if(this.log(`checkPendingTracks (pending: ${t} codec events expected: ${e}) ${Ae(i)}`),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,i])=>{if(t){const s=this.tracks[t];e[t]={buffer:i,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:i}=this;if(!i)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=i.addSourceBuffer(l),f=jo(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 i=e.supplemental;let s=e.codec;i&&(t==="video"||t==="audiovideo")&&Rl(i,"video")&&(s=S5(s,i));const r=sr(s,e.levelCodec);return r?t.slice(0,5)==="audio"?kr(r,this.appendSource):r:""}trackSourceBuffer(e,t){const i=t.buffer;if(!i)return;const s=this.getTrackCodec(t,e);this.tracks[e]={buffer:i,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 i=((e=this.media)==null||(t=e.querySelector)==null?void 0:t.call(e,"source"))||this.media;return i==null?void 0:i.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 i=this.currentOp(e);i&&(i.onComplete(),this.shiftAndExecuteNext(e))}onSBUpdateError(e,t){var i;const s=new Error(`${e} SourceBuffer error. MediaSource readyState: ${(i=this.mediaSource)==null?void 0:i.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,i,s,r,o){const a=t-e.timestampOffset;Math.abs(a)>=i&&(this.log(`Updating ${s} SourceBuffer timestampOffset to ${t} (sn: ${r} cc: ${o})`),e.timestampOffset=t)}removeExecutor(e,t,i){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=j(s.duration)?s.duration:1/0,l=j(r.duration)?r.duration:1/0,u=Math.max(0,t),f=Math.min(i,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 i=this.tracks[t],s=i==null?void 0:i.buffer;if(!s)throw new L9(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);i.ending=!1,i.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:i}=this,s=t.map(o=>this.appendBlocker(o));return t.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(s).then(o=>{i===this.operationQueue&&(e(),this.stepOperationQueue(this.sourceBufferTypes))})}stepOperationQueue(e){e.forEach(t=>{var i;const s=(i=this.tracks[t])==null?void 0:i.buffer;!s||s.updating||this.shiftAndExecuteNext(t)})}append(e,t,i){this.operationQueue&&this.operationQueue.append(e,t,i)}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,i){const s=this.tracks[e];if(!s)return;const r=s.buffer;if(!r)return;const o=i.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 i=t.buffer;i&&(t.listeners.forEach(s=>{i.removeEventListener(s.event,s.listener)}),t.listeners.length=0)}}function Yf(n){const e=n.querySelectorAll("source");[].slice.call(e).forEach(t=>{n.removeChild(t)})}function R9(n,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,n.appendChild(t)}function jo(n){return n==="audio"?1:0}class su{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 i=this.hls.levels[t.droppedLevel];this.isLevelAllowed(i)&&this.restrictedLevels.push({bitrate:i.bitrate,height:i.height,width:i.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 i=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,i.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onLevelsUpdated(e,t){this.timer&&j(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,i=this.getMaxLevel(e.length-1);i!==this.autoLevelCapping&&t.logger.log(`Setting autoLevelCapping to ${i}: ${e[i].height}p@${e[i].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),t.autoLevelCapping=i,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 i=t.filter((s,r)=>this.isLevelAllowed(s)&&r<=e);return this.clientRect=null,su.getMaxLevelByMediaSize(i,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 i=e.getBoundingClientRect();t.width=i.width,t.height=i.height,!t.width&&!t.height&&(t.width=i.right-i.left||e.width||0,t.height=i.bottom-i.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(i=>e.bitrate===i.bitrate&&e.width===i.width&&e.height===i.height)}static getMaxLevelByMediaSize(e,t,i){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,i);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 w9={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},tt=w9,P9={HLS:"h"},k9=P9,B9="CMCD-Object",F9="CMCD-Request",O9="CMCD-Session",M9="CMCD-Status",Vn={OBJECT:B9,REQUEST:F9,SESSION:O9,STATUS:M9},N9={[Vn.OBJECT]:["br","ab","d","ot","tb","tpb","lb","tab","lab","url"],[Vn.REQUEST]:["pb","bl","tbl","dl","ltc","mtp","nor","nrr","rc","sn","sta","su","ttfb","ttfbb","ttlb","cmsdd","cmsds","smrt","df","cs"],[Vn.SESSION]:["cid","pr","sf","sid","st","v","msd"],[Vn.STATUS]:["bs","bsd","cdn","rtp","bg","pt","ec","e"]};class In{constructor(e,t){Array.isArray(e)&&(e=e.map(i=>i instanceof In?i:new In(i))),this.value=e,this.params=t}}const U9="Dict";function $9(n){return Array.isArray(n)?JSON.stringify(n):n instanceof Map?"Map{}":n instanceof Set?"Set{}":typeof n=="object"?JSON.stringify(n):String(n)}function H9(n,e,t,i){return new Error(`failed to ${n} "${$9(e)}" as ${t}`,{cause:i})}function $t(n,e,t){return H9("serialize",n,e,t)}class f1{constructor(e){this.description=e}}const Xf="Bare Item",G9="Boolean";function K9(n){if(typeof n!="boolean")throw $t(n,G9);return n?"?1":"?0"}function V9(n){return btoa(String.fromCharCode(...n))}const j9="Byte Sequence";function q9(n){if(ArrayBuffer.isView(n)===!1)throw $t(n,j9);return`:${V9(n)}:`}const W9="Integer";function z9(n){return n<-999999999999999||999999999999999<n}function d1(n){if(z9(n))throw $t(n,W9);return n.toString()}function Q9(n){return`@${d1(n.getTime()/1e3)}`}function h1(n,e){if(n<0)return-h1(-n,e);const t=Math.pow(10,e);if(Math.abs(n*t%1-.5)<Number.EPSILON){const s=Math.floor(n*t);return(s%2===0?s:s+1)/t}else return Math.round(n*t)/t}const Y9="Decimal";function X9(n){const e=h1(n,3);if(Math.floor(Math.abs(e)).toString().length>12)throw $t(n,Y9);const t=e.toString();return t.includes(".")?t:`${t}.0`}const J9="String",Z9=/[\x00-\x1f\x7f]+/;function e7(n){if(Z9.test(n))throw $t(n,J9);return`"${n.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function t7(n){return n.description||n.toString().slice(7,-1)}const i7="Token";function Jf(n){const e=t7(n);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw $t(e,i7);return e}function Hl(n){switch(typeof n){case"number":if(!j(n))throw $t(n,Xf);return Number.isInteger(n)?d1(n):X9(n);case"string":return e7(n);case"symbol":return Jf(n);case"boolean":return K9(n);case"object":if(n instanceof Date)return Q9(n);if(n instanceof Uint8Array)return q9(n);if(n instanceof f1)return Jf(n);default:throw $t(n,Xf)}}const n7="Key";function Gl(n){if(/^[a-z*][a-z0-9\-_.*]*$/.test(n)===!1)throw $t(n,n7);return n}function ru(n){return n==null?"":Object.entries(n).map(([e,t])=>t===!0?`;${Gl(e)}`:`;${Gl(e)}=${Hl(t)}`).join("")}function p1(n){return n instanceof In?`${Hl(n.value)}${ru(n.params)}`:Hl(n)}function s7(n){return`(${n.value.map(p1).join(" ")})${ru(n.params)}`}function r7(n,e={whitespace:!0}){if(typeof n!="object")throw $t(n,U9);const t=n instanceof Map?n.entries():Object.entries(n),i=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([s,r])=>{r instanceof In||(r=new In(r));let o=Gl(s);return r.value===!0?o+=ru(r.params):(o+="=",Array.isArray(r.value)?o+=s7(r):o+=p1(r)),o}).join(`,${i}`)}function o7(n,e){return r7(n,e)}function a7(n){return["ot","sf","st","e","sta"].includes(n)}function l7(n){return typeof n=="number"?j(n):n!=null&&n!==""&&n!==!1}function c7(n,e){const t=new URL(n),i=new URL(e);if(t.origin!==i.origin)return n;const s=t.pathname.split("/").slice(1),r=i.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 cr=n=>Math.round(n),u7=(n,e)=>(e!=null&&e.baseUrl&&(n=c7(n,e.baseUrl)),encodeURIComponent(n)),zs=n=>cr(n/100)*100,f7={br:cr,d:cr,bl:zs,dl:zs,mtp:zs,nor:u7,rtp:zs,tb:cr};function d7(n,e){const t={};if(n==null||typeof n!="object")return t;const i=Object.keys(n).sort(),s=me({},f7,e==null?void 0:e.formatters),r=e==null?void 0:e.filter;return i.forEach(o=>{if((r==null?void 0:r(o))===!1)return;let a=n[o];const c=s[o];c&&(a=c(a,e)),!(o==="v"&&a===1)&&(o=="pr"&&a===1||l7(a)&&(a7(o)&&typeof a=="string"&&(a=new f1(a)),t[o]=a))}),t}function g1(n,e={}){return n?o7(d7(n,e),me({whitespace:!1},e)):""}function h7(n,e={}){const t={};if(!n)return t;const i=Object.entries(n),s=Object.entries(N9).concat(Object.entries((e==null?void 0:e.customHeaderMap)||{})),r=i.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])||Vn.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]=g1(c,e),o),t)}function p7(n,e,t){return me(n,h7(e,t))}const g7="CMCD";function m7(n,e={}){if(!n)return"";const t=g1(n,e);return`${g7}=${encodeURIComponent(t)}`}const Zf=/CMCD=[^&#]+/;function x7(n,e,t){const i=m7(e,t);if(!i)return n;if(Zf.test(n))return n.replace(Zf,i);const s=n.includes("?")?"&":"?";return`${n}${s}${i}`}class y7{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:tt.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===tt.VIDEO||c===tt.AUDIO||c==tt.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:i}=t;i!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=i.sessionId||e.sessionId,this.cid=i.contentId,this.useHeaders=i.useHeaders===!0,this.includeKeys=i.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 i,s;this.audioBuffer=(i=t.tracks.audio)==null?void 0:i.buffer,this.videoBuffer=(s=t.tracks.video)==null?void 0:s.buffer}createData(){var e;return{v:1,sf:k9.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 i=t.ot===tt.INIT||t.ot===tt.VIDEO||t.ot===tt.MUXED;this.starved&&i&&(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={}),p7(e.headers,t,r)):e.url=x7(e.url,t,r)}getNextFrag(e){var t;const i=(t=this.hls.levels[e.level])==null?void 0:t.details;if(i){const s=e.sn-i.startSN;return i.fragments[s+1]}}getNextPart(e){var t,i;const{index:s,fragment:r}=e,o=(t=this.hls.levels[r.level])==null||(i=t.details)==null?void 0:i.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 tt.TIMED_TEXT;if(e.sn==="initSegment")return tt.INIT;if(t==="audio")return tt.AUDIO;if(t==="main")return this.hls.audioTracks.length?tt.VIDEO:tt.MUXED}getTopBandwidth(e){let t=0,i;const s=this.hls;if(e===tt.AUDIO)i=s.audioTracks;else{const r=s.maxAutoLevel,o=r>-1?r+1:s.levels.length;i=s.levels.slice(0,o)}return i.forEach(r=>{r.bitrate>t&&(t=r.bitrate)}),t>0?t:NaN}getBufferLength(e){const t=this.media,i=e===tt.AUDIO?this.audioBuffer:this.videoBuffer;return!i||!t?NaN:re.bufferInfo(i,t.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,i=e||this.config.loader;return class{constructor(r){this.loader=void 0,this.loader=new i(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,i=e||this.config.loader;return class{constructor(r){this.loader=void 0,this.loader=new i(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 v7=3e5;class E7 extends Lt{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(i=>i!==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:i}=t;i!==null&&(this.pathwayId=i.pathwayId,this.uri=i.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:i}=t;if((i==null?void 0:i.action)===ze.SendAlternateToPenaltyBox&&i.flags===bt.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),i.resolved=this.pathwayId!==o),t.details===$.BUFFER_APPEND_ERROR&&!t.fatal?i.resolved=!0:i.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 i=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${i}"`),t=this.getLevelsForPathway(i),this.pathwayId=i}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 i=this.penalizedPathways,s=performance.now();Object.keys(i).forEach(r=>{s-i[r]>v7&&delete i[r]});for(let r=0;r<e.length;r++){const o=e[r];if(o in i)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,$m(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,i){const s=this.getLevelsForPathway(i).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 i}clonePathways(e){const t=this.levels;if(!t)return;const i={},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&&(i[f.AUDIO]=d,f.AUDIO=d),h&&(s[f.SUBTITLES]=h,f.SUBTITLES=h);const p=m1(u.uri,f["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",c),m=new ms({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),ed(this.audioTracks,i,c,o),ed(this.subtitleTracks,s,c,o)})}loadSteeringManifest(e){const t=this.hls.config,i=t.loader;this.loader&&this.loader.destroy(),this.loader=new i(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 i;const s=(i=this.hls)==null?void 0:i.media;if(s&&!s.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},t)}}function ed(n,e,t,i){n&&Object.keys(e).forEach(s=>{const r=n.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=m1(o.url,o.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),a.groupId=a.attrs["GROUP-ID"]=e[s],a.attrs["PATHWAY-ID"]=i,a});n.push(...r)})}function m1(n,e,t,i){const{HOST:s,PARAMS:r,[t]:o}=i;let a;e&&(a=o==null?void 0:o[e],a&&(n=a));const c=new self.URL(n);return s&&!a&&(c.host=s),r&&Object.keys(r).sort().forEach(l=>{l&&c.searchParams.set(l,r[l])}),c.href}function xt(n,e,t){_t(n,e,t),n.addEventListener(e,t)}function _t(n,e,t){n.removeEventListener(e,t)}class mn extends Lt{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=mn.CDMCleanupPromise?[mn.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:i}=this.config,s=t[e];if(s)return s.licenseUrl;if(e===_e.WIDEVINE&&i)return i}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,i=t[e];if(i)return i.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,i=(o,a,c)=>!!o&&c.indexOf(o)===a,s=t.map(o=>o.audioCodec).filter(i),r=t.map(o=>o.videoCodec).filter(i);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 pt?a(f):a(new pt({type:Z.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_NO_ACCESS,error:f,fatal:!0},f.message))})};c(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:i}=this.config;if(typeof i!="function"){let s=`Configured requestMediaKeySystemAccess is not a function ${i}`;return km===null&&self.location.protocol==="http:"&&(s=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(s))}return i(e,t)}getMediaKeysPromise(e,t,i){const s=fb(e,t,i,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:i}){this.log(`Creating key-system session "${t}" keyId: ${Di.hexDump(e.keyId||[])}`);const s=i.createSession(),r={decryptdata:e,keySystem:t,mediaKeys:i,mediaKeysSession:s,keyStatus:"status-pending"};return this.mediaKeySessions.push(r),r}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const i=this.createMediaKeySessionContext(e),s=this.getKeyIdString(t),r="cenc";this.keyIdToKeySessionPromise[s]=this.generateRequestWithPreferredKeySession(i,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 Di.hexDump(e.keyId)}updateKeySession(e,t){var i;const s=e.mediaKeysSession;return this.log(`Updating key-session "${s.sessionId}" for keyID ${Di.hexDump(((i=e.decryptdata)==null?void 0:i.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})=>If(e)).filter(e=>!!e)}getKeySystemAccess(e){return this.getKeySystemSelectionPromise(e).then(({keySystem:t,mediaKeys:i})=>this.attemptSetMediaKeys(t,i))}selectKeySystem(e){return new Promise((t,i)=>this.getKeySystemSelectionPromise(e).then(({keySystem:s})=>{const r=If(s);r?t(r):i(new Error(`Unable to find format for key-system "${s}"`))}).catch(i))}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=or(this.config),i=e.map(Fl).filter(s=>!!s&&t.indexOf(s)!==-1);return this.selectKeySystem(i)}loadKey(e){const t=e.keyInfo.decryptdata,i=this.getKeyIdString(t),s=`(keyId: ${i} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${s}`);let r=this.keyIdToKeySessionPromise[i];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[i]=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 pt?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),i=this.keyIdToKeySessionPromise[t];if(!i){const s=Fl(e.keyFormat),r=s?[s]:or(this.config);return this.attemptKeySystemAccess(r)}return i}getKeySystemSelectionPromise(e){if(e.length||(e=or(this.config)),e.length===0)throw new pt({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 i=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const s=Promise.all(i).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}"`),i.push(s),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(r=>i.indexOf(r)===-1)})}generateRequestWithPreferredKeySession(e,t,i,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,i,e);if(!p)throw new Error("Invalid response from configured generateRequest filter");t=p.initDataType,i=p.initData?p.initData:null,e.decryptdata.pssh=i?new Uint8Array(i):null}catch(p){var c;if(this.warn(p.message),(c=this.hls)!=null&&c.config.debug)throw p}if(i===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: ${i?i.byteLength:null})`);const u=new Yc,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,Bl("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))};xt(e.mediaKeysSession,"message",f),xt(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 pt({type:Z.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):g==="internal-error"?m(new pt({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,i).then(()=>{var p;this.log(`Request generated for key-session "${(p=e.mediaKeysSession)==null?void 0:p.sessionId}" keyId: ${l}`)}).catch(p=>{throw new pt({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,i)=>{if(typeof i=="string"&&typeof t=="object"){const s=i;i=t,t=s}this.log(`key status change "${t}" for keyStatuses keyId: ${Di.hexDump("buffer"in i?new Uint8Array(i.buffer,i.byteOffset,i.byteLength):new Uint8Array(i))} session keyId: ${Di.hexDump(new Uint8Array(e.decryptdata.keyId||[]))} uri: ${e.decryptdata.uri}`),e.keyStatus=t})}fetchServerCertificate(e){const t=this.config,i=t.loader,s=new i(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 pt({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 pt({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,i){return new Promise((s,r)=>{e.setServerCertificate(i).then(o=>{this.log(`setServerCertificate ${o?"success":"not supported by CDM"} (${i==null?void 0:i.byteLength}) on "${t}"`),s(e)}).catch(o=>{r(new pt({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(i=>this.updateKeySession(e,new Uint8Array(i)).catch(s=>{throw new pt({type:Z.KEY_SYSTEM_ERROR,details:$.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:s,fatal:!0},s.message)}))}unpackPlayReadyKeyMessage(e,t){const i=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!i.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const s=new DOMParser().parseFromString(i,"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 Bl(atob(l))}setupLicenseXHR(e,t,i,s){const r=this.config.licenseXhrSetup;return r?Promise.resolve().then(()=>{if(!i.decryptdata)throw new Error("Key removed");return r.call(this.hls,e,t,i,s)}).catch(o=>{if(!i.decryptdata)throw o;return e.open("POST",t,!0),r.call(this.hls,e,t,i,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 i=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=i.errorRetry,l=c?c.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>l||a.status>=400&&a.status<500)r(new pt({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 i=t.media;this.media=i,xt(i,"waitingforkey",this.onWaitingForKey)}onMediaDetached(){const e=this.media;e&&(_t(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,i=this.mediaKeySessions.slice();this.mediaKeySessions=[],this.mediaKeys=null,oo.clearKeyUriToKeyIdMap();const s=i.length;mn.CDMCleanupPromise=Promise.all(i.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 i=t.reduce((s,r)=>(s.indexOf(r.keyFormat)===-1&&s.push(r.keyFormat),s),[]);this.log(`Selecting key-system from session-keys ${i.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(i)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:i}=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),i&&i.readyState!==XMLHttpRequest.DONE&&i.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(hb(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}`)})})}}}mn.CDMCleanupPromise=void 0;class pt 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 A7{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 i=this.hls.config;if(i.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),i.fpsDroppedMonitoringPeriod)}}onMediaDetaching(){this.media=null}checkFPS(e,t,i){const s=performance.now();if(t){if(this.lastTime){const r=s-this.lastTime,o=i-this.lastDroppedFrames,a=t-this.lastDecodedFrames,c=1e3*o/r,l=this.hls;if(l.trigger(A.FPS_DROP,{currentDropped:o,currentDecoded:a,totalDroppedFrames:i}),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=i,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 x1(n,e){let t;try{t=new Event("addtrack")}catch{t=document.createEvent("Event"),t.initEvent("addtrack",!1,!1)}t.track=n,e.dispatchEvent(t)}function y1(n,e){const t=n.mode;if(t==="disabled"&&(n.mode="hidden"),n.cues&&!n.cues.getCueById(e.id))try{if(n.addCue(e),!n.cues.getCueById(e.id))throw new Error(`addCue is failed for: ${e}`)}catch(i){pe.debug(`[texttrack-utils]: ${i}`);try{const s=new self.TextTrackCue(e.startTime,e.endTime,e.text);s.id=e.id,n.addCue(s)}catch(s){pe.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${s}`)}}t==="disabled"&&(n.mode=t)}function dn(n,e){const t=n.mode;if(t==="disabled"&&(n.mode="hidden"),n.cues)for(let i=n.cues.length;i--;)e&&n.cues[i].removeEventListener("enter",e),n.removeCue(n.cues[i]);t==="disabled"&&(n.mode=t)}function Kl(n,e,t,i){const s=n.mode;if(s==="disabled"&&(n.mode="hidden"),n.cues&&n.cues.length>0){const r=T7(n.cues,e,t);for(let o=0;o<r.length;o++)(!i||i(r[o]))&&n.removeCue(r[o])}s==="disabled"&&(n.mode=s)}function S7(n,e){if(e<=n[0].startTime)return 0;const t=n.length-1;if(e>n[t].endTime)return-1;let i=0,s=t,r;for(;i<=s;)if(r=Math.floor((s+i)/2),e<n[r].startTime)s=r-1;else if(e>n[r].startTime&&i<t)i=r+1;else return r;return n[i].startTime-e<e-n[s].startTime?i:s}function T7(n,e,t){const i=[],s=S7(n,e);if(s>-1)for(let r=s,o=n.length;r<o;r++){const a=n[r];if(a.startTime>=e&&a.endTime<=t)i.push(a);else if(a.startTime>t)return i}return i}function ur(n){const e=[];for(let t=0;t<n.length;t++){const i=n[t];(i.kind==="subtitles"||i.kind==="captions")&&i.label&&e.push(n[t])}return e}class b7 extends nu{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 i=ur(this.media.textTracks);for(let r=0;r<i.length;r++)if(i[r].mode==="hidden")t=i[r];else if(i[r].mode==="showing"){t=i[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 i=this.media;if(!i)return;const s=!!t.transferMedia;if(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||i.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),this.subtitleTrack=-1,this.media=null,s)return;ur(i.textTracks).forEach(o=>{dn(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:i,groupId:s,details:r}=t,o=this.tracksInGroup[i];if(!o||o.groupId!==s){this.warn(`Subtitle track with id:${i} 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 ${i} "${o.name}" lang:${o.lang} group:${s} loaded [${r.startSN}-${r.endSN}]`),i===this.trackId&&this.playlistLoaded(i,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 i=t.subtitleGroups||null,s=this.groupIds;let r=this.currentTrack;if(!i||(s==null?void 0:s.length)!==(i==null?void 0:i.length)||i!=null&&i.some(o=>(s==null?void 0:s.indexOf(o))===-1)){this.groupIds=i,this.trackId=-1,this.currentTrack=null;const o=this.tracks.filter(u=>!i||i.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=Ot(a,o);if(u>-1)r=o[u];else{const f=Ot(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 "${i==null?void 0:i.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,i=this.selectDefaultTrack;for(let s=0;s<t.length;s++){const r=t[s];if(!(i&&!r.default||!i&&!e)&&(!e||Mi(r,e)))return s}if(e){for(let s=0;s<t.length;s++){const r=t[s];if(As(e.attrs,r.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return s}for(let s=0;s<t.length;s++){const r=t[s];if(As(e.attrs,r.attrs,["LANGUAGE"]))return s}}return-1}findTrackForTextTrack(e){if(e){const t=this.tracksInGroup;for(let i=0;i<t.length;i++){const s=t[i];if($l(s,e))return i}}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 i=this.currentTrack;if(i&&Mi(e,i))return i;const s=Ot(e,this.tracksInGroup);if(s>-1){const r=this.tracksInGroup[s];return this.setSubtitleTrack(s),r}else{if(i)return null;{const r=Ot(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 i=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 ${i} "${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:i,groupId:s,deliveryDirectives:t||null,track:e})}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=ur(e.textTracks),i=this.currentTrack;let s;if(i&&(s=t.filter(r=>$l(i,r))[0],s||this.warn(`Unable to find subtitle TextTrack with name "${i.name}" and language "${i.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||!j(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.selectDefaultTrack=!1;const i=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===i&&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,i==null?void 0:i.details,s.details);this.loadPlaylist(f)}}function _7(){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 Jn(n){let e=5381,t=n.length;for(;t;)e=e*33^n.charCodeAt(--t);return(e>>>0).toString()}const xn=.025;let Hr=function(n){return n[n.Point=0]="Point",n[n.Range=1]="Range",n}({});function I7(n,e,t){return`${n.identifier}-${t+1}-${Jn(e)}`}class C7{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 i=this.playoutLimit;return e<=0||isNaN(i)?!1:i===0?!0:(((t=this.assetList[e])==null?void 0:t.startOffset)||0)>i}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 qo(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,i=qo(t,e);return t-i<.1}return!1}get resumptionOffset(){const e=this.resumeOffset,t=j(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 qo(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)<xn))}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"?Hr.Range:Hr.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 L7(this)}}function qo(n,e){return n-e.start<e.duration/2&&!(Math.abs(n-(e.start+e.duration))<xn)?e.start:e.start+e.duration}function v1(n,e,t){const i=new self.URL(n,t);return i.protocol!=="data:"&&i.searchParams.set("_HLS_primary_id",e),i}function Wo(n,e){for(;(t=n.assetList[++e])!=null&&t.error;)var t;return e}function L7(n){return`["${n.identifier}" ${n.cue.pre?"<pre>":n.cue.post?"<post>":""}${n.timelineStart.toFixed(2)}-${n.resumeTime.toFixed(2)}]`}function an(n){const e=n.timelineStart,t=n.duration||0;return`["${n.identifier}" ${e.toFixed(2)}-${(e+t).toFixed(2)}]`}class D7{constructor(e,t,i,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=i,this.assetItem=s;let o=s.uri;try{o=v1(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 i=this.timelineOffset,s=re.bufferInfo(e,i,0);return this.getAssetTime(s.end)>=this._bufferedEosTime-.02}reachedPlayout(e){const i=this.interstitial.playoutLimit;return this.startOffset+e>=i}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 i=e-t;if(Math.abs(i)>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,i=this.duration;return Math.min(Math.max(0,e-t),i)}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=i=>delete i.details;e.levels.forEach(t),e.allAudioTracks.forEach(t),e.allSubtitleTracks.forEach(t),this.hasDetails=!1}}on(e,t,i){this.hls.on(e,t)}once(e,t,i){this.hls.once(e,t)}off(e,t,i){this.hls.off(e,t)}toString(){var e;return`HlsAssetPlayer: ${an(this.assetItem)} ${(e=this.hls)==null?void 0:e.sessionId} ${this.appendInPlace?"append-in-place":""}`}}const td=.033;class R7 extends Lt{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((i,s)=>e<=s.startOffset&&t>s.startOffset?(delete s.error,i+1):i,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 i=-1;e.nextEvent?i=this.findEventIndex(e.nextEvent.identifier)-1:e.previousEvent&&(i=this.findEventIndex(e.previousEvent.identifier)+1);const s=this.items;if(s)for(s[i]||(t===void 0&&(t=e.start),i=this.findItemIndexAtTime(t));i>=0&&(r=s[i])!=null&&r.event;){var r;i--}return i}findItemIndexAtTime(e,t){const i=this.items;if(i)for(let s=0;s<i.length;s++){let r=i[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 i=this.items;if(i)for(let s=e;s<=t&&i[s];s++){const r=i[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 i;if(((i=t[s].event)==null?void 0:i.identifier)===e)return s}return-1}findAssetIndex(e,t){const i=e.assetList,s=i.length;if(s>1)for(let r=0;r<s;r++){const o=i[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 i=(e=this.items)==null||(t=e[this.length-1])==null?void 0:t.event;if(i){const s=i.assetList,r=s[s.length-1];if(r)return r.identifier}return null}parseInterstitialDateRanges(e,t){const i=e.main.details,{dateRanges:s}=i,r=this.events,o=this.parseDateRanges(s,{url:i.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 i=this.events||[];if(i.length||t.length||this.length<2){const s=this.items,r=this.parseSchedule(i,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,i){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 C7(c,t),this.eventMap[a]=l,i===!1&&(l.appendInPlace=i)),s.push(l)}}return s}parseSchedule(e,t){const i=[],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===Hr.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 R=o;o+=y,i.push({event:u,start:S,end:T,playout:{start:R,end:o},integrated:{start:I,end:l}})}else if(g<=r){if(!E){const b=g-c;if(b>td){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}};i.push(N)}else b>0&&p&&(p.cumulativeDuration+=b,i[i.length-1].end=g)}h&&(T=S),u.timelineStart=S;const I=l;l+=v;const R=o;o+=y,i.push({event:u,start:S,end:T,playout:{start:R,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,i.push({previousEvent:((a=i[i.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 i.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 i}setDurations(e,t,i){this.durations={primary:e,playout:t,integrated:i}}resolveOffsets(e,t){const i=t.main.details,s=i.live?1/0:i.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=Ki(null,i.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<td&&(e[c+1].appendInPlace=!1,e[c+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${a}`));const h=j(a.resumeOffset)?a.resumeOffset:a.duration;r+=h})}primaryCanResumeInPlaceAt(e,t){const i=e.resumeTime,s=e.startTime+e.resumptionOffset;return Math.abs(i-s)>xn?(this.log(`"${e.identifier}" resumption ${i} not aligned with estimated timeline end ${s}`),!1):t?!Object.keys(t).some(o=>{const a=t[o].details,c=a.edge;if(i>=c)return this.log(`"${e.identifier}" resumption ${i} past ${o} playlist end ${c}`),!1;const l=Ki(null,a.fragments,i);if(!l)return this.log(`"${e.identifier}" resumption ${i} 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-i)<xn+u||Math.abs(l.end-i)<xn+u?!1:(this.log(`"${e.identifier}" resumption ${i} not aligned with ${o} fragment bounds (${l.start}-${l.end} sn: ${l.sn} cc: ${l.cc})`),!0)}):(this.log(`"${e.identifier}" resumption ${i} can not be aligned with media (none selected)`),!1)}updateAssetDurations(e){if(!e.assetListLoaded)return;const t=e.timelineStart;let i=0,s=!1,r=!1;e.assetList.forEach((o,a)=>{const c=t+i;o.startOffset=i,o.timelineStart=c,s||(s=o.duration===null),r||(r=!!o.error);const l=o.error?0:o.duration||0;i+=l}),s&&!r?e.duration=Math.max(i,e.duration):e.duration=i}removeEvent(e){e.reset(),delete this.eventMap[e.identifier]}}function ii(n){return`[${n.event?'"'+n.event.identifier+'"':"primary"}: ${n.start.toFixed(2)}-${n.end.toFixed(2)}]`}class w7{constructor(e){this.hls=void 0,this.hls=e}destroy(){this.hls=null}loadAssetList(e,t){const i=e.assetListUrl;let s;try{s=v1(i,this.hls.sessionId,e.baseUrl)}catch(d){const h=this.assignAssetListError(e,$.ASSET_LIST_LOAD_ERROR,d,i);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,i,s,r,o){return e.error=i,{type:Z.NETWORK_ERROR,details:t,fatal:!1,interstitial:e,url:s,error:i,networkDetails:o,stats:r}}}function id(n){n==null||n.play().catch(()=>{})}class P7 extends Lt{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 i=this.currentTime;if(i===void 0||this.playbackDisabled)return;const s=i-this.timelinePos;if(Math.abs(s)<1/7056e5)return;const o=s<=-.01;this.timelinePos=i,this.bufferedPos=i;const a=this.playingItem;if(!a){this.checkBuffer();return}if(o&&this.schedule.resetErrorsInRange(i,i-s)&&this.updateSchedule(),this.checkBuffer(),o&&i<a.start||i>=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(i,d))}return}const u=l.timelineStart,f=l.duration||0;(o&&i<u||i>=u+f)&&this.setScheduleToAssetAtTime(i,l)},this.onTimeupdate=()=>{const i=this.currentTime;if(i===void 0||this.playbackDisabled)return;if(i>this.timelinePos)this.timelinePos=i,i>this.bufferedPos&&this.checkBuffer();else return;const s=this.playingItem;if(!s||this.playingLastItem)return;if(i>=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);i>=o&&this.setScheduleToAssetAtTime(i,r)},this.onScheduleUpdate=(i,s)=>{const r=this.schedule,o=this.playingItem,a=r.events||[],c=r.items||[],l=r.durations,u=i.map(p=>p.identifier),f=!!(a.length||u.length);(f||s)&&this.log(`INTERSTITIALS_UPDATED (${a.length}): ${a}
- Schedule: ${c.map(p=>ii(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)>xn&&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(i.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){_t(e,"play",this.onPlay),_t(e,"pause",this.onPause),_t(e,"seeking",this.onSeeking),_t(e,"timeupdate",this.onTimeupdate)}onMediaAttaching(e,t){const i=this.media=t.media;xt(i,"seeking",this.onSeeking),xt(i,"timeupdate",this.onTimeupdate),xt(i,"play",this.onPlay),xt(i,"pause",this.onPause)}onMediaAttached(e,t){const i=this.effectivePlayingItem,s=this.detachedData;if(this.detachedData=null,i===null)this.checkStart();else if(!s){this.clearScheduleState();const r=this.findItemIndex(i);this.setSchedulePosition(r)}}clearScheduleState(){this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null}onMediaDetaching(e,t){const i=!!t.transferMedia,s=this.media;if(this.media=null,!i&&(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,i=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!==Hr.Point){const v=i(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=i(e.playingAsset),R=(I==null?void 0:I.media)||e.primaryMedia;if(R){const b=d==="primary"?R.currentTime:s(g,d,e.playingAsset,"timelinePos","currentTime"),L=f-b,k=(S?b:R.currentTime)+L;if(k>=0&&(!I||S||k<=I.duration)){R.currentTime=k;return}}}if(v){let I=f;if(d!=="primary"){const b=v[d].start,L=f-b;I=v.start+L}const R=!e.isInterstitial(v);if((!e.isInterstitial(g)||g.event.appendInPlace)&&(R||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(R)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,i=(e=this.schedule)==null?void 0:e.items;return!this.playbackStarted||!t||!i?!1:this.findItemIndex(t)===i.length-1}get playbackStarted(){return this.effectivePlayingItem!==null}get currentTime(){var e,t,i;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=(i=r)==null?void 0:i.currentTime;if(!(o===void 0||!j(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 i=this.getAssetPlayer(e);i&&this.transferMediaFromPlayer(i,t)}transferMediaFromPlayer(e,t){const i=e.interstitial.appendInPlace,s=e.media;if(i&&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 i,s;if(e.media===t)return;let r=null;const o=this.hls,a=e!==o,c=a&&e.interstitial.appendInPlace,l=(i=this.detachedData)==null?void 0:i.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 i=this.timelinePos,s=this.effectivePlayingItem;if(i===-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,i){const s=Wo(e,i);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 i=this.schedule,s=t.parentIdentifier,r=i.getEvent(s);if(r){const o=i.findEventIndex(s),a=i.findAssetIndex(r,e);this.advanceAfterAssetEnded(r,o,a-1)}}setSchedulePosition(e,t){const i=this.schedule.items;if(!i||this.playbackDisabled)return;this.log(`setSchedulePosition ${e}, ${t}`);const s=e>=0?i[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} ${an(u)}`),this.endedAsset=u,this.playingAsset=null,this.hls.trigger(A.INTERSTITIAL_ASSET_ENDED,{asset:u,assetListIndex:h,event:l,schedule:i.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} ${ii(r)}`),l.hasPlayed=!0,this.hls.trigger(A.INTERSTITIAL_ENDED,{event:l,schedule:i.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,i,t,r,o)}advanceSchedule(e,t,i,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(i===void 0){i=this.schedule.findAssetIndex(l,this.timelinePos);const h=Wo(l,i-1);if(l.isAssetPastPlayoutLimit(h)){this.advanceAfterAssetEnded(l,e,i);return}i=h}const u=this.waitingItem;this.assetsBuffered(o,a)||this.setBufferingItem(o);let f=this.preloadAssets(l,i);if(this.eventItemsMatch(o,u||s)||(this.waitingItem=o,this.log(`INTERSTITIAL_STARTED ${ii(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[i];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,i||0);return}if(f||(f=this.getAssetPlayer(d.identifier)),f===null||f.destroyed){const h=l.assetList.length;this.warn(`asset ${i+1}/${h} player destroyed ${l}`),f=this.createAssetPlayer(l,d,i)}if(!this.eventItemsMatch(o,this.bufferingItem)&&l.appendInPlace&&this.isAssetBuffered(d))return;this.startAssetPlayer(f,i,t,e,a),this.shouldPlay&&id(f.media)}else o!==null?(this.resumePrimary(o,e,s),this.shouldPlay&&id(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,i){var s;if(this.playingItem=e,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(e),this.log(`resuming ${ii(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(!i)return;const r=this.schedule.items;r&&(this.log(`INTERSTITIALS_PRIMARY_RESUMED ${ii(e)}`),this.hls.trigger(A.INTERSTITIALS_PRIMARY_RESUMED,{schedule:r.slice(0),scheduleIndex:t}),this.checkBuffer())}getPrimaryResumption(e,t){const i=e.start;if(this.primaryLive){const s=this.primaryDetails;if(t===0)return this.hls.startPosition;if(s&&(i<s.fragmentStart||i>s.edge))return this.hls.liveSyncPosition||-1}return i}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,i){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),i&&this.startLoadingPrimaryAt(e,i)),i||(this.timelinePos=e,this.startLoadingPrimaryAt(e,i))}startLoadingPrimaryAt(e,t){var i;const s=this.hls;!s.loadingEnabled||!s.media||Math.abs((((i=s.mainForwardBufferInfo)==null?void 0:i.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 i=this.hls.levels[t.level],s=ye(ye({},this.mediaSelection||this.altSelection),{},{main:i});this.mediaSelection=s,this.schedule.parseInterstitialDateRanges(s,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&&this.schedule.items&&this.checkStart()}onAudioTrackUpdated(e,t){const i=this.hls.audioTracks[t.id],s=this.mediaSelection;if(!s){this.altSelection=ye(ye({},this.altSelection),{},{audio:i});return}const r=ye(ye({},s),{},{audio:i});this.mediaSelection=r}onSubtitleTrackUpdated(e,t){const i=this.hls.subtitleTracks[t.id],s=this.mediaSelection;if(!s){this.altSelection=ye(ye({},this.altSelection),{},{subtitles:i});return}const r=ye(ye({},s),{},{subtitles:i});this.mediaSelection=r}onAudioTrackSwitching(e,t){const i=hf(t);this.playerQueue.forEach(s=>s.hls.setAudioOption(t)||s.hls.setAudioOption(i))}onSubtitleTrackSwitch(e,t){const i=hf(t);this.playerQueue.forEach(s=>s.hls.setSubtitleOption(t)||t.id!==-1&&s.hls.setSubtitleOption(i))}onBufferCodecs(e,t){const i=t.tracks;i&&(this.requiredTracks=i)}onBufferAppended(e,t){this.checkBuffer()}onBufferFlushed(e,t){const i=this.playingItem;if(i&&!this.itemsMatch(i,this.bufferingItem)&&!this.isInterstitial(i)){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 i;const o=this.schedule.findEventIndex(r.identifier),a=(i=this.schedule.items)==null?void 0:i[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 i=this.findItemIndex(t);this.setSchedulePosition(i+1)}else this.shouldPlay=!1}updateItem(e,t){const i=this.schedule.items;if(e&&i){const s=this.findItemIndex(e,t);return i[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 i=e.end+.25,s=re.bufferInfo(this.primaryMedia,i,0);(s.end>i||(s.nextStart||0)>i)&&(this.attachPrimary(i,null),this.flushFrontBuffer(i))}}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 i;return!!t&&(e===t||e.event.identifier===((i=t.event)==null?void 0:i.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 i=re.bufferInfo(this.primaryMedia,this.timelinePos,0);e&&(this.bufferedPos=this.timelinePos),e||(e=i.len<1),this.updateBufferedPos(i.end,t,e)}updateBufferedPos(e,t,i){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 i&&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,i=this.schedule;if(this.itemsMatch(e,t))this.bufferingItem!==e&&(this.bufferingItem=e);else{const{items:s,events:r}=i;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 ${ii(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 i=this.setBufferingItem(e);if(!this.playbackDisabled){if(this.isInterstitial(e))this.bufferedToEvent(e,t);else if(i!==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),i=this.getPrimaryResumption(e,t);this.startLoadingPrimaryAt(i)}bufferedToEvent(e,t){const i=e.event,s=i.assetList.length===0&&!i.assetListLoader,r=i.cue.once;if(s||!r){const o=this.preloadAssets(i,t);if(o!=null&&o.interstitial.appendInPlace){const a=i.assetList[t],c=this.primaryMedia;a&&c&&this.bufferAssetPlayer(o,c)}}}preloadAssets(e,t){const i=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}/${i?1:s} ${e}${l?` live-start: ${u} start-offset: ${l}`:""}`),i)return this.createAsset(e,0,0,c,e.duration,i);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 i=0;i<t.length;i++)if(e===t[i].assetId)return i;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 i=0;i<e.length;i++)if(e[i].media===t)return e[i]}return null}createAsset(e,t,i,s,r,o){const a={parentIdentifier:e.identifier,identifier:I7(e,o,t),duration:r,startOffset:i,timelineStart:s,uri:o};return this.createAssetPlayer(e,a,t)}createAssetPlayer(e,t,i){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:Jn(t.uri)})),this.getAssetPlayer(f)&&this.warn(`Duplicate date range identifier ${e} and asset ${f}`);const p=new D7(this.HlsPlayerClass,d,e,t);this.playerQueue.push(p),e.assetList[i]=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),i,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),R=Wo(e,I);if(!e.isAssetPastPlayoutLimit(R))this.bufferedToItem(T,R);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(i)),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),i,`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),i,E.message)}),this.log(`INTERSTITIAL_ASSET_PLAYER_CREATED ${an(t)}`),this.hls.trigger(A.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:t,assetListIndex:i,event:e,player:p}),p}clearInterstitial(e,t){e.assetList.forEach(i=>{this.clearAssetPlayer(i.identifier,t)}),e.reset()}resetAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);if(t!==-1){this.log(`reset asset player "${e}" after error`);const i=this.playerQueue[t];this.transferMediaFromPlayer(i,null),i.resetDetails()}}clearAssetPlayer(e,t){const i=this.getAssetPlayerQueueIndex(e);if(i!==-1){this.log(`clear asset player "${e}" toSegment: ${t&&ii(t)}`);const s=this.playerQueue[i];this.transferMediaFromPlayer(s,t),this.playerQueue.splice(i,1),s.destroy()}}emptyPlayerQueue(){let e;for(;e=this.playerQueue.pop();)e.destroy();this.playerQueue=[]}startAssetPlayer(e,t,i,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,i[s]),delete u.error),this.log(`INTERSTITIAL_ASSET_STARTED ${t+1}/${l} ${an(a)}`),this.hls.trigger(A.INTERSTITIAL_ASSET_STARTED,{asset:a,assetListIndex:t,event:o,schedule:i.slice(0),scheduleIndex:s,player:e})),this.bufferAssetPlayer(e,r)}bufferAssetPlayer(e,t){var i,s;const{interstitial:r,assetItem:o}=e,a=this.schedule.findEventIndex(r.identifier),c=(i=this.schedule.items)==null?void 0:i[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&&!dm(f,e.tracks)){const d=new Error(`Asset ${an(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,i,s,r){if(e.details===$.BUFFER_STALLED_ERROR)return;const o=t.assetList[s];this.warn(`INTERSTITIAL_ASSET_ERROR ${o&&an(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:xs(!0),asset:o,assetListIndex:s,event:t,schedule:u,scheduleIndex:i,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,i,s)}primaryFallback(e){const t=e.timelineStart,i=this.effectivePlayingItem;if(this.updateSchedule(),i){this.log(`Fallback to primary from event "${e.identifier}" start: ${t} pos: ${this.timelinePos} playing: ${i?ii(i):"<none>"} error: ${e.error}`);let s=this.timelinePos;s===-1&&(s=this.hls.startPosition);const r=this.updateItem(i,s);this.itemsMatch(i,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 i;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=(i=this.bufferingItem)==null?void 0:i.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 i=t.interstitial;i&&this.primaryFallback(i);break}case $.BUFFER_STALLED_ERROR:{this.onTimeupdate(),this.checkBuffer(!0);break}}}}const nd=500;class k7 extends Qc{constructor(e,t,i){super(e,t,i,"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(nd),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:i,success:s}=t;if(this.fragContextChanged(i)||(we(i)&&(this.fragPrevious=i),this.state=V.IDLE),!s)return;const r=this.tracksBuffered[this.currentTrackId];if(!r)return;let o;const a=i.start;for(let l=0;l<r.length;l++)if(a>=r[l].start&&a<=r[l].end){o=r[l];break}const c=i.start+i.duration;o?o.end=c:(o={start:a,end:c},r.push(o)),this.fragmentTracker.fragBuffered(i),this.fragBufferedComplete(i,null),this.media&&this.tick()}onBufferFlushing(e,t){const{startOffset:i,endOffset:s}=t;if(i===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(i,r,X.SUBTITLE)}}onError(e,t){const i=t.frag;(i==null?void 0:i.type)===X.SUBTITLE&&(t.details===$.FRAG_GAP&&this.fragmentTracker.fragBuffered(i,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==V.STOPPED&&(this.state=V.IDLE))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){if(this.levels&&c1(this.levels,t)){this.levels=t.map(i=>new ms(i));return}this.tracksBuffered=[],this.levels=t.map(i=>{const s=new ms(i);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 i;if(this.currentTrackId=t.id,!((i=this.levels)!=null&&i.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(nd)}onSubtitleTrackLoaded(e,t){var i;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||(i=c.details)!=null&&i.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?(Ur(o,f),l=o.fragmentStart):d&&(l=d.start,Ml(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,Ml(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&&(Ki(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:i}=e,s=t.decryptdata,r=this.hls;if(!this.fragContextChanged(t)&&i&&i.byteLength>0&&s!=null&&s.key&&s.iv&&gn(s.method)){const o=performance.now();this.decrypter.decrypt(new Uint8Array(i),s.key.buffer,s.iv.buffer,zc(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,i=t==null?void 0:t[e];if(!i||!t.length||!i.details||this.waitForLive(i))return;const{config:s}=this,r=this.getLoadPosition(),o=re.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],r,s.maxBufferHole),{end:a,len:c}=o,l=i.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=Ki(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,i.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,i,a)}}}loadFragment(e,t,i){we(e)?super.loadFragment(e,t,i):this._loadInitSegment(e,t)}get mediaBufferTimeRanges(){return new B7(this.tracksBuffered[this.currentTrackId]||[])}}class B7{constructor(e){this.buffered=void 0;const t=(i,s,r)=>{if(s=s>>>0,s>r-1)throw new DOMException(`Failed to execute '${i}' on 'TimeRanges': The index provided (${s}) is greater than the maximum bound (${r})`);return e[s][i]};this.buffered={get length(){return e.length},end(i){return t("end",i,e.length)},start(i){return t("start",i,e.length)}}}}const F7={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},E1=n=>String.fromCharCode(F7[n]||n),Tt=15,Kt=100,O7={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},M7={17:2,18:4,21:6,22:8,23:10,19:13,20:15},N7={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},U7={25:2,26:4,29:6,30:8,31:10,27:13,28:15},$7=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class H7{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const i=typeof t=="function"?t():t;pe.log(`${this.time} [${e}] ${i}`)}}}const bi=function(e){const t=[];for(let i=0;i<e.length;i++)t.push(e[i].toString(16));return t};class A1{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 i=0;i<t.length;i++){const s=t[i];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 G7{constructor(){this.uchar=" ",this.penState=new A1}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 K7{constructor(e){this.chars=[],this.pos=0,this.currPenState=new A1,this.cueStartTime=null,this.logger=void 0;for(let t=0;t<Kt;t++)this.chars.push(new G7);this.logger=e}equals(e){for(let t=0;t<Kt;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<Kt;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<Kt;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>Kt&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=Kt)}moveCursor(e){const t=this.pos+e;if(e>1)for(let i=this.pos+1;i<t+1;i++)this.chars[i].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=E1(e);if(this.pos>=Kt){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<Kt;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 i=0;i<Kt;i++){const s=this.chars[i].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 zo{constructor(e){this.rows=[],this.currRow=Tt-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<Tt;t++)this.rows.push(new K7(e));this.logger=e}reset(){for(let e=0;e<Tt;e++)this.rows[e].clear();this.currRow=Tt-1}equals(e){let t=!0;for(let i=0;i<Tt;i++)if(!this.rows[i].equals(e.rows[i])){t=!1;break}return t}copy(e){for(let t=0;t<Tt;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<Tt;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<Tt;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 i=this.rows[this.currRow];if(e.indent!==null){const r=e.indent,o=Math.max(r-1,0);i.setCursor(e.indent),e.color=i.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 i="",s=-1;for(let r=0;r<Tt;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?i="["+t.join(" | ")+"]":i=t.join(`
- `)),i}getTextAndFormat(){return this.rows}}class sd{constructor(e,t,i){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 zo(i),this.nonDisplayedMemory=new zo(i),this.lastOutputScreen=new zo(i),this.currRollUpRow=this.displayedMemory.rows[Tt-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=i}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[Tt-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 i=0;i<e.length;i++)this.writeScreen.insertChar(e[i]);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 i=Math.floor(e/2)-16,s=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=s[i]}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 rd{constructor(e,t,i){this.channels=void 0,this.currentChannel=0,this.cmdHistory=j7(),this.logger=void 0;const s=this.logger=new H7;this.channels=[null,new sd(e,t,s),new sd(e+1,i,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 i=0;i<t.length;i+=2){const s=t[i]&127,r=t[i+1]&127;let o=!1,a=null;if(s===0&&r===0)continue;this.logger.log(3,()=>"["+bi([t[i],t[i+1]])+"] -> ("+bi([s,r])+")");const c=this.cmdHistory;if(s>=16&&s<=31){if(V7(s,r,c)){Qs(null,null,c),this.logger.log(3,()=>"Repeated command ("+bi([s,r])+") is dropped");continue}Qs(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 Qs(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 "+bi([s,r])+" orig: "+bi([t[i],t[i+1]]))}}parseCmd(e,t){const i=(e===20||e===28||e===21||e===29)&&t>=32&&t<=47,s=(e===23||e===31)&&t>=33&&t<=35;if(!(i||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 i=0;if((e===17||e===25)&&t>=32&&t<=47){if(e===17?i=1:i=2,i!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const s=this.channels[i];return s?(s.ccMIDROW(t),this.logger.log(3,()=>"MIDROW ("+bi([e,t])+")"),!0):!1}return!1}parsePAC(e,t){let i;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?i=o===1?O7[e]:N7[e]:i=o===1?M7[e]:U7[e];const a=this.channels[o];return a?(a.setPAC(this.interpretPAC(i,t)),this.currentChannel=o,!0):!1}interpretPAC(e,t){let i;const s={color:null,italics:!1,indent:null,underline:!1,row:e};return t>95?i=t-96:i=t-64,s.underline=(i&1)===1,i<=13?s.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(i/2)]:i<=15?(s.italics=!0,s.color="white"):s.indent=Math.floor((i-16)/2)*4,s}parseChars(e,t){let i,s=null,r=null;if(e>=25?(i=2,r=e-8):(i=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 '"+E1(o)+"' in channel "+i),s=[o]}else e>=32&&e<=127&&(s=t===0?[e]:[e,t]);return s&&this.logger.log(3,()=>"Char codes = "+bi(s).join(",")),s}parseBackgroundAttributes(e,t){const i=(e===16||e===24)&&t>=32&&t<=47,s=(e===23||e===31)&&t>=45&&t<=47;if(!(i||s))return!1;let r;const o={};e===16||e===24?(r=Math.floor((t-32)/2),o.background=$7[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()}Qs(null,null,this.cmdHistory)}cueSplitAtTime(e){for(let t=0;t<this.channels.length;t++){const i=this.channels[t];i&&i.cueSplitAtTime(e)}}}function Qs(n,e,t){t.a=n,t.b=e}function V7(n,e,t){return t.a===n&&t.b===e}function j7(){return{a:null,b:null}}var ou=function(){if(Nr!=null&&Nr.VTTCue)return self.VTTCue;const n=["","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 i(a){return t(n,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,R="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=i(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 R},set:function(b){const L=s(b);if(!L)throw new SyntaxError("An invalid or illegal string was specified.");R=L,this.hasBeenReset=!0}})),u.displayState=void 0}return o.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},o}();class q7{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function S1(n){function e(i,s,r,o){return(i|0)*3600+(s|0)*60+(r|0)+parseFloat(o||0)}const t=n.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 W7{constructor(){this.values=Object.create(null)}set(e,t){!this.get(e)&&t!==""&&(this.values[e]=t)}get(e,t,i){return i?this.has(e)?this.values[e]:t[i]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,i){for(let s=0;s<i.length;++s)if(t===i[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 i=parseFloat(t);if(i>=0&&i<=100)return this.set(e,i),!0}return!1}}function T1(n,e,t,i){const s=i?n.split(i):[n];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 Vl=new ou(0,0,""),Ys=Vl.align==="middle"?"middle":"center";function z7(n,e,t){const i=n;function s(){const a=S1(n);if(a===null)throw new Error("Malformed timestamp: "+i);return n=n.replace(/^[^\sa-zA-Z-]+/,""),a}function r(a,c){const l=new W7;T1(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",Ys,"end"]);break;case"position":p=h.split(","),l.percent(d,p[0]),p.length===2&&l.alt("positionAlign",p[1],["start",Ys,"end","line-left","line-right","auto"]);break;case"size":l.percent(d,h);break;case"align":l.alt(d,h,["start",Ys,"end","left","right"]);break}},/:/,/\s/),c.region=l.get("region",null),c.vertical=l.get("vertical","");let u=l.get("line","auto");u==="auto"&&Vl.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",Ys);let f=l.get("position","auto");f==="auto"&&Vl.position===50&&(f=c.align==="start"||c.align==="left"?0:c.align==="end"||c.align==="right"?100:50),c.position=f}function o(){n=n.replace(/^\s+/,"")}if(o(),e.startTime=s(),o(),n.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+i);n=n.slice(3),o(),e.endTime=s(),o(),r(n,e)}function b1(n){return n.replace(/<br(?: \/)?>/gi,`
- `)}class Q7{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new q7,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 i(){let r=t.buffer,o=0;for(r=b1(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){T1(r,function(o,a){},/:/)}try{let r="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;r=i();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=i(),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 ou(0,0,""),t.state="CUE",r.indexOf("-->")===-1){t.cue.id=r;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{z7(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 Y7=/\r\n|\n\r|\n|\r/g,Qo=function(e,t,i=0){return e.slice(i,i+t.length)===t},X7=function(e){let t=parseInt(e.slice(-3));const i=parseInt(e.slice(-6,-4)),s=parseInt(e.slice(-9,-7)),r=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!j(t)||!j(i)||!j(s)||!j(r))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*i,t+=60*1e3*s,t+=60*60*1e3*r,t};function au(n,e,t){return Jn(n.toString())+Jn(e.toString())+Jn(t)}const J7=function(e,t,i){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=i};function Z7(n,e,t,i,s,r,o){const a=new Q7,c=ut(new Uint8Array(n)).trim().replace(Y7,`
- `).split(`
- `),l=[],u=e?p9(e.baseTime,e.timescale):0;let f="00:00.000",d=0,h=0,p,m=!0;a.oncue=function(g){const y=t[i];let v=t.ccOffset;const x=(d-u)/9e4;if(y!=null&&y.new&&(h!==void 0?v=t.ccOffset=y.start:J7(t,i,x)),x){if(!e){p=new Error("Missing initPTS for VTT MPEGTS");return}v=x-t.presentationOffset}const E=g.endTime-g.startTime,S=gt((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(Qo(g,"X-TIMESTAMP-MAP=")){m=!1,g.slice(16).split(",").forEach(y=>{Qo(y,"LOCAL:")?f=y.slice(6):Qo(y,"MPEGTS:")&&(d=parseInt(y.slice(7)))});try{h=X7(f)/1e3}catch(y){p=y}return}else g===""&&(m=!1);a.parse(g+`
- `)}),a.flush()}const Yo="stpp.ttml.im1t",_1=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,I1=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,e_={left:"start",center:"center",right:"end",start:"start",end:"end"};function od(n,e,t,i){const s=le(new Uint8Array(n),["mdat"]);if(s.length===0){i(new Error("Could not parse IMSC1 mdat"));return}const r=s.map(a=>ut(a)),o=h9(e.baseTime,1,e.timescale);try{r.forEach(a=>t(t_(a,o)))}catch(a){i(a)}}function t_(n,e){const s=new DOMParser().parseFromString(n,"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=ad(Xo(s,"styling","style")),l=ad(Xo(s,"layout","region")),u=Xo(s,"body","[begin]");return[].map.call(u,f=>{const d=C1(f,a);if(!d||!f.hasAttribute("begin"))return null;const h=Zo(f.getAttribute("begin"),o),p=Zo(f.getAttribute("dur"),o);let m=Zo(f.getAttribute("end"),o);if(h===null)throw ld(f);if(m===null){if(p===null)throw ld(f);m=h+p}const g=new ou(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=i_(y,v,c),{textAlign:E}=x;if(E){const S=e_[E];S&&(g.lineAlign=S),g.align=E}return me(g,x),g}).filter(f=>f!==null)}function Xo(n,e,t){const i=n.getElementsByTagName(e)[0];return i?[].slice.call(i.querySelectorAll(t)):[]}function ad(n){return n.reduce((e,t)=>{const i=t.getAttribute("xml:id");return i&&(e[i]=t),e},{})}function C1(n,e){return[].slice.call(n.childNodes).reduce((t,i,s)=>{var r;return i.nodeName==="br"&&s?t+`
- `:(r=i.childNodes)!=null&&r.length?C1(i,e):e?t+i.textContent.trim().replace(/\s+/g," "):t+i.textContent},"")}function i_(n,e,t){const i="http://www.w3.org/ns/ttml#styling";let s=null;const r=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],o=n!=null&&n.hasAttribute("style")?n.getAttribute("style"):null;return o&&t.hasOwnProperty(o)&&(s=t[o]),r.reduce((a,c)=>{const l=Jo(e,i,c)||Jo(n,i,c)||Jo(s,i,c);return l&&(a[c]=l),a},{})}function Jo(n,e,t){return n&&n.hasAttributeNS(e,t)?n.getAttributeNS(e,t):null}function ld(n){return new Error(`Could not parse ttml timestamp ${n}`)}function Zo(n,e){if(!n)return null;let t=S1(n);return t===null&&(_1.test(n)?t=n_(n,e):I1.test(n)&&(t=s_(n,e))),t}function n_(n,e){const t=_1.exec(n),i=(t[4]|0)+(t[5]|0)/e.subFrameRate;return(t[1]|0)*3600+(t[2]|0)*60+(t[3]|0)+i/e.frameRate}function s_(n,e){const t=I1.exec(n),i=Number(t[1]);switch(t[2]){case"h":return i*3600;case"m":return i*60;case"ms":return i*1e3;case"f":return i/e.frameRate;case"t":return i/e.tickRate}return i}class Xs{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,i){(this.startTime===null||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=i,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}class r_{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=ud(),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 Xs(this,"textTrack1"),t=new Xs(this,"textTrack2"),i=new Xs(this,"textTrack3"),s=new Xs(this,"textTrack4");this.cea608Parser1=new rd(1,e,t),this.cea608Parser2=new rd(3,i,s)}addCues(e,t,i,s,r){let o=!1;for(let a=r.length;a--;){const c=r[a],l=o_(c[0],c[1],t,i);if(l>=0&&(c[0]=Math.min(c[0],t),c[1]=Math.max(c[1],i),o=!0,l/(i-t)>.5))return}if(o||r.push([t,i]),this.config.renderTextTracksNatively){const a=this.captionsTracks[e];this.Cues.newCue(a,t,i,s)}else{const a=this.Cues.newCue(null,t,i,s);this.hls.trigger(A.CUES_PARSED,{type:"captions",cues:a,track:e})}}onInitPtsFound(e,{frag:t,id:i,initPTS:s,timescale:r}){const{unparsedVttFrags:o}=this;i===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:i}=this;if(i)for(let s=0;s<i.textTracks.length;s++){const r=i.textTracks[s];if(cd(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:i,media:s}=this,{label:r,languageCode:o}=t[e],a=this.getExistingTrack(r,o);if(a)i[e]=a,dn(i[e]),x1(i[e],s);else{const c=this.createTextTrack("captions",r,o);c&&(c[e]=!0,i[e]=c)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const i=t.label,s={_id:e,label:i,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,i){const s=this.media;if(s)return s.addTextTrack(e,t,i)}onMediaAttaching(e,t){this.media=t.media,t.mediaSource||this._cleanTracks()}onMediaDetaching(e,t){const i=!!t.transferMedia;if(this.media=null,i)return;const{captionsTracks:s}=this;Object.keys(s).forEach(r=>{dn(s[r]),delete s[r]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=ud(),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 i=0;i<t.length;i++)dn(t[i])}onSubtitleTracksUpdated(e,t){const i=t.subtitleTracks||[],s=i.some(r=>r.textCodec===Yo);if(this.config.enableWebVTT||s&&this.config.enableIMSC1){if(c1(this.tracks,i)){this.tracks=i;return}if(this.textTracks=[],this.tracks=i,this.config.renderTextTracksNatively){const o=this.media,a=o?ur(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]&&cd(a[d],c)){f=a[d],a[d]=null;break}f&&(u=f)}if(u)dn(u);else{const f=L1(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(i=>{const s=/(?:CC|SERVICE)([1-4])/.exec(i.instreamId);if(!s)return;const r=`textTrack${s[1]}`,o=this.captionsProperties[r];o&&(o.label=i.name,i.lang&&(o.languageCode=i.lang),o.media=i)})}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 i,s;const{cea608Parser1:r,cea608Parser2:o,lastSn:a}=this,{cc:c,sn:l}=t.frag,u=(i=(s=t.part)==null?void 0:s.index)!=null?i:-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:i,payload:s}=t;if(i.type===X.SUBTITLE)if(s.byteLength){const r=i.decryptdata,o="stats"in t;if(r==null||!r.encrypted||o){const a=this.tracks[i.level],c=this.vttCCs;c[i.cc]||(c[i.cc]={start:i.start,prevCC:this.prevCC,new:!0},this.prevCC=i.cc),a&&a.textCodec===Yo?this._parseIMSC1(i,s):this._parseVTTs(t)}}else this.hls.trigger(A.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const i=this.hls;od(t,this.initPTS[e.cc],s=>{this._appendCues(s,e.level),i.trigger(A.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},s=>{i.logger.log(`Failed to parse IMSC1: ${s}`),i.trigger(A.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:s})})}_parseVTTs(e){var t;const{frag:i,payload:s}=e,{initPTS:r,unparsedVttFrags:o}=this,a=r.length-1;if(!r[i.cc]&&a===-1){o.push(e);return}const c=this.hls,l=(t=i.initSegment)!=null&&t.data?yt(i.initSegment.data,new Uint8Array(s)).buffer:s;Z7(l,this.initPTS[i.cc],this.vttCCs,i.cc,i.start,u=>{this._appendCues(u,i.level),c.trigger(A.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:i})},u=>{const f=u.message==="Missing initPTS for VTT MPEGTS";f?o.push(e):this._fallbackToIMSC1(i,s),c.logger.log(`Failed to parse VTT cue: ${u}`),!(f&&a>i.cc)&&c.trigger(A.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:i,error:u})})}_fallbackToIMSC1(e,t){const i=this.tracks[e.level];i.textCodec||od(t,this.initPTS[e.cc],()=>{i.textCodec=Yo,this._parseIMSC1(e,t)},()=>{i.textCodec="wvtt"})}_appendCues(e,t){const i=this.hls;if(this.config.renderTextTracksNatively){const s=this.textTracks[t];if(!s||s.mode==="disabled")return;e.forEach(r=>y1(s,r))}else{const s=this.tracks[t];if(!s)return;const r=s.default?"default":"subtitles"+t;i.trigger(A.CUES_PARSED,{type:"subtitles",cues:e,track:r})}}onFragDecrypted(e,t){const{frag:i}=t;i.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:i,samples:s}=t;if(!(i.type===X.MAIN&&this.closedCaptionsForLevel(i)==="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:i,endOffsetSubtitles:s,type:r}){const{media:o}=this;if(!(!o||o.currentTime<i)){if(!r||r==="video"){const{captionsTracks:a}=this;Object.keys(a).forEach(c=>Kl(a[c],t,i))}if(this.config.renderTextTracksNatively&&t===0&&s!==void 0){const{textTracks:a}=this;Object.keys(a).forEach(c=>Kl(a[c],t,s))}}}extractCea608Data(e){const t=[[],[]],i=e[0]&31;let s=2;for(let r=0;r<i;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 L1(n){return n.characteristics&&/transcribes-spoken-dialog/gi.test(n.characteristics)&&/describes-music-and-sound/gi.test(n.characteristics)?"captions":"subtitles"}function cd(n,e){return!!n&&n.kind===L1(e)&&$l(e,n)}function o_(n,e,t,i){return Math.min(e,i)-Math.max(n,t)}function ud(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}const a_=/\s/,l_={newCue(n,e,t,i){const s=[];let r,o,a,c,l;const u=self.VTTCue||self.TextTrackCue;for(let d=0;d<i.rows.length;d++)if(r=i.rows[d],a=!0,c=0,l="",!r.isEmpty()){var f;for(let m=0;m<r.chars.length;m++)a_.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=b1(l.trim()),p=au(e,t,h);n!=null&&(f=n.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 n&&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=>y1(n,d))),s}};function c_(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch{}return!1}const u_=/(\d+)-(\d+)\/(\d+)/;class fd{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||p_,this.controller=new self.AbortController,this.stats=new Hc}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,i){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=f_(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=i,this.request=this.fetchSetup(e,r),self.clearTimeout(this.requestTimeout),t.timeout=c&&j(c)?c:l,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(s,e,this.response))},t.timeout),(Es(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 g_(g||"fetch, bad network response",m,f)}s.loading.first=h,s.total=h_(f.headers)||s.total;const p=(d=this.callbacks)==null?void 0:d.onProgress;return p&&j(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&&!j(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,i,s=0,r){const o=new Km,a=e.body.getReader(),c=()=>a.read().then(l=>{if(l.done)return o.dataLength&&r(t,i,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,i,o.flush().buffer,e)):r(t,i,u.buffer,e),c()}).catch(()=>Promise.reject());return c()}}function f_(n,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(me({},n.headers))};return n.rangeEnd&&t.headers.set("Range","bytes="+n.rangeStart+"-"+String(n.rangeEnd-1)),t}function d_(n){const e=u_.exec(n);if(e)return parseInt(e[2])-parseInt(e[1])+1}function h_(n){const e=n.get("Content-Range");if(e){const i=d_(e);if(j(i))return i}const t=n.get("Content-Length");if(t)return parseInt(t)}function p_(n,e){return new self.Request(n.url,e)}class g_ extends Error{constructor(e,t,i){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=i}}const m_=/^age:\s*[\d.]+\s*$/im;class D1{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 Hc,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,i){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=i,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const i=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!==i||this.stats.aborted))return r(i,t.url)}).catch(o=>{if(!(this.loader!==i||this.stats.aborted))return i.open("GET",t.url,!0),r(i,t.url)}).then(()=>{this.loader!==i||this.stats.aborted||this.openAndSendXhr(i,t,e)}).catch(o=>{var a;(a=this.callbacks)==null||a.onError({code:i.status,text:o.message},t,i,s)}):this.openAndSendXhr(i,t,e)}openAndSendXhr(e,t,i){e.readyState||e.open("GET",t.url,!0);const s=t.headers,{maxTimeToFirstByteMs:r,maxLoadTimeMs:o}=i.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),i.timeout=r&&j(r)?r:o,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),i.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:i}=this;if(!e||!t)return;const s=t.readyState,r=this.config;if(!i.aborted&&s>=2&&(i.loading.first===0&&(i.loading.first=Math.max(self.performance.now(),i.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-(i.loading.first-i.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;i.loading.end=Math.max(self.performance.now(),i.loading.first);const m=t.responseType==="arraybuffer"?p.byteLength:p.length;i.loaded=i.total=m,i.bwEstimate=i.total*8e3/(i.loading.end-i.loading.first);const g=(o=this.callbacks)==null?void 0:o.onProgress;g&&g(i,e,p,t);const y={url:t.responseURL,data:p,code:l};(a=this.callbacks)==null||a.onSuccess(y,i,e,t);return}}const f=r.loadPolicy.errorRetry,d=i.retry,h={url:e.url,data:void 0,code:l};if(Mr(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,i)}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(Mr(e,t,!0))this.retry(e);else{var i;pe.warn(`timeout while loading ${(i=this.context)==null?void 0:i.url}`);const s=this.callbacks;s&&(this.abortInternal(),s.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:i}=this;this.retryDelay=jc(e,i.retry),i.retry++,pe.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t==null?void 0:t.url}, retrying ${i.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&&m_.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 x_={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},y_=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:D1,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:$5,bufferController:D9,capLevelController:su,errorController:j5,fpsController:A7,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:km,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:x_},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},v_()),{},{subtitleStreamController:k7,subtitleTrackController:b7,timelineController:r_,audioStreamController:_9,audioTrackController:I9,emeController:mn,cmcdController:y7,contentSteeringController:E7,interstitialsController:P7});function v_(){return{cueHandler:l_,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 E_(n,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 i=jl(n),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=i[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({},i),e)}function jl(n){return n&&typeof n=="object"?Array.isArray(n)?n.map(jl):Object.keys(n).reduce((e,t)=>(e[t]=jl(n[t]),e),{}):n}function A_(n,e){const t=n.loader;t!==fd&&t!==D1?(e.log("[config]: Custom loader detected, cannot enable progressive streaming"),n.progressive=!1):c_()&&(n.loader=fd,n.progressive=!0,n.enableSoftwareAES=!0,e.log("[config]: Progressive streaming enabled, using FetchLoader"))}const fr=2,S_=.1,T_=.05,b_=100;class __ extends Dm{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 i;(i=this.media)!=null&&i.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{if(this.hls){var i;this.ended=((i=this.media)==null?void 0:i.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(b_),this.mediaSource=t.mediaSource;const i=this.media=t.media;xt(i,"playing",this.onMediaPlaying),xt(i,"waiting",this.onMediaWaiting),xt(i,"ended",this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();const{media:i}=this;i&&(_t(i,"playing",this.onMediaPlaying),_t(i,"waiting",this.onMediaWaiting),_t(i,"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 i,s;const r=(i=this.hls)==null?void 0:i.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>fr,I=!d||T||d-e>fr&&!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,R=!!(p!=null&&p.live)?p.targetduration*2:fr,b=h.getPartialFragment(e);if(_>0&&(_<=R||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 i=self.performance.now()-t;this.log(`playback not stuck anymore @${e}, after ${Math.round(i)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(A.STALL_RESOLVED,{})}}nudgeOnVideoHole(e,t){var i;const s=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&(i=this.buffered.audio)!=null&&i.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,i){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(i);if((u||l!=null&&l.live&&i<l.fragmentStart)&&(this._trySkipBufferHole(u)||!this.media))return;const f=e.buffered,d=this.adjacentTraversal(e,i);(f&&f.length>1&&e.len>c.maxBufferHole||e.nextStart&&(e.nextStart-i<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 i=this.fragmentTracker,s=e.nextStart;if(i&&s){const r=i.getFragAtPos(t,X.MAIN),o=i.getFragAtPos(s,X.MAIN);if(r&&o)return o.sn-r.sn<2}return!1}_reportStall(e){const{hls:t,media:i,stallReported:s,stalled:r}=this;if(!s&&r!==null&&i&&t){this.stallReported=!0;const o=new Error(`Playback stalling at @${i.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:i,media:s}=this,r=(t=this.hls)==null?void 0:t.config;if(!s||!i||!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=i.getAppendedFrag(0,X.MAIN);m&&c<m.end&&(p=!0)}if(!p){const m=e||i.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=i.getAppendedFrag(v,X.MAIN)||i.getPartialFragment(v);if(x)v+=x.duration;else{y=!0;break}}if(y)return 0}}}const h=Math.max(c+T_,o+S_);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:i,nudgeRetry:s}=this,r=t==null?void 0:t.config;if(!i||!r)return 0;const o=i.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),i.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(n,e){const t=hd(n.main);if(t&&t.start<=e)return t;const i=hd(n.audio);return i&&i.start<=e?i:null}function hd(n){if(!n)return null;switch(n.state){case V.IDLE:case V.STOPPED:case V.ENDED:case V.ERROR:return null}return n.frag}const I_=.25;function ql(){if(!(typeof self>"u"))return self.VTTCue||self.TextTrackCue}function pd(n,e,t,i,s){let r=new n(e,t,"");try{r.value=i,s&&(r.type=s)}catch{r=new n(e,t,Ae(s?ye({type:s},i):i))}return r}const Js=(()=>{const n=ql();try{n&&new n(0,Number.POSITIVE_INFINITY,"")}catch{return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();class C_{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 i;this.media=t.media,((i=t.overrides)==null?void 0:i.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&&dn(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 i=e[t];if(i.kind==="metadata"&&i.label==="id3")return x1(i,this.media),i}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media)return;const{hls:{config:{enableEmsgMetadataCues:i,enableID3MetadataCues:s}}}=this;if(!i&&!s)return;const{samples:r}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const o=ql();if(o)for(let a=0;a<r.length;a++){const c=r[a].type;if(c===ct.emsg&&!i||!s)continue;const l=Ym(r[a].data);if(l){const u=r[a].pts;let f=u+r[a].duration;f>Js&&(f=Js),f-u<=0&&(f=u+I_);for(let h=0;h<l.length;h++){const p=l[h];if(!Xm(p)){this.updateId3CueEnds(u,c);const m=pd(o,u,f,p,c);m&&this.id3Track.addCue(m)}}}}}updateId3CueEnds(e,t){var i;const s=(i=this.id3Track)==null?void 0:i.cues;if(s)for(let r=s.length;r--;){const o=s[r];o.type===t&&o.startTime<e&&o.endTime===Js&&(o.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:i,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===ct.audioId3&&c:s==="video"?l=u=>u.type===ct.emsg&&a:l=u=>u.type===ct.audioId3&&c||u.type===ct.emsg&&a,Kl(r,t,i,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:i}=this,{dateRanges:s}=e,r=Object.keys(s);let o=this.dateRangeCuesAppended;if(i&&t){var a;if((a=i.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),i.removeCue(m)}catch{}})}}else o=this.dateRangeCuesAppended={}}const c=e.fragments[e.fragments.length-1];if(r.length===0||!j(c==null?void 0:c.programDateTime))return;this.id3Track||(this.id3Track=this.createTrack(this.media));const l=ql();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=Js;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(!sb(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];rb(T)&&(I=hm(I));const b=pd(l,h,y,{key:T,data:I},ct.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 L_{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,i=this.levelDetails;if(!t||!i)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||!i.live)return;const a=this.targetLatency;if(a===null)return;const c=s-a,l=Math.min(this.maxLatency,a+i.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:i,targetduration:s}=e,{liveSyncDuration:r,liveSyncDurationCount:o,lowLatencyMode:a}=this.config,c=this.hls.userConfig;let l=a&&i||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 i=this.levelDetails;if(i===null)return null;const s=i.edge,r=e-t-this.edgeStalled,o=s-i.totalduration,a=s-(this.config.lowLatencyMode&&i.partTarget||i.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 i=e.buffered.length;return(i?e.buffered.end(i-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 i;t.details===$.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&(i=this.levelDetails)!=null&&i.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))}changeMediaPlaybackRate(e,t){var i,s;e.playbackRate!==t&&((i=this.hls)==null||i.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 D_ extends nu{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 i=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=kr(d,i)||void 0),h&&(h=u.videoCodec=T5(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--,bn.audio[d.substring(0,4)]=2):this.isVideoSupported(L)&&(u.videoCodec=h=h?`${h},${L}`:L,y--,bn.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,R=`${`${S||"."}-`}${u.bitrate}-${T}-${x}-${v}-${_}-${E}`;if(r[R])if(r[R].uri!==u.url&&!u.attrs["PATHWAY-ID"]){const b=o[R]+=1;u.attrs["PATHWAY-ID"]=new Array(b+1).join(".");const L=this.createLevel(u);r[R]=L,s.push(L)}else r[R].addGroupId("audio",f.AUDIO),r[R].addGroupId("text",f.SUBTITLES);else{const b=this.createLevel(u);r[R]=b,o[R]=1,s.push(b)}}),this.filterAndSortMediaOptions(s,t,a,c,l)}createLevel(e){const t=new ms(e),i=e.supplemental;if(i!=null&&i.videoCodec&&!this.isVideoSupported(i.videoCodec)){const s=new Error(`SUPPLEMENTAL-CODECS not supported "${i.videoCodec}"`);this.log(s.message),t.supportedResult=Tm(s,[])}return t}isAudioSupported(e){return Rl(e,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(e){return Rl(e,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(e,t,i,s,r){let o=[],a=[],c=e;if((i||s)&&r&&(c=c.filter(({videoCodec:g,videoRange:y,width:v,height:x})=>(!!g||!!(v&&x))&&w5(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)),gd(o)),t.subtitles&&(a=t.subtitles,gd(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(i&&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 Br.indexOf(g.videoRange)-Br.indexOf(y.videoRange);if(g.videoCodec!==y.videoCodec){const v=af(g.videoCodec),x=af(y.videoCodec);if(v!==x)return x-v}if(g.uri===y.uri&&g.codecSet!==y.codecSet){const v=Pr(g.codecSet),x=Pr(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 i=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,i===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 ${i}${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(),i=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=i}}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 i=t.elementaryStreams;if(!Object.keys(i).some(r=>!!i[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 i;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(i=t.deliveryDirectives)!=null&&i.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 i=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||""):""} ${i}`),this.hls.trigger(A.LEVEL_LOADING,{url:i,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 i=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));$m(i),this._levels=i,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=i.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:i})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:i}=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:i}))}}function gd(n){const e={};n.forEach(t=>{const i=t.groupId||"";t.id=e[i]=e[i]||0,e[i]++})}function R1(){return self.SourceBuffer||self.WebKitSourceBuffer}function w1(){if(!Ei())return!1;const e=R1();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function R_(){if(!w1())return!1;const n=Ei();return typeof(n==null?void 0:n.isTypeSupported)=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(e=>n.isTypeSupported(gs(e,"video")))||["mp4a.40.2","fLaC"].some(e=>n.isTypeSupported(gs(e,"audio"))))}function w_(){var n;const e=R1();return typeof(e==null||(n=e.prototype)==null?void 0:n.changeType)=="function"}const P_=100;class k_ extends Qc{constructor(e,t,i){super(e,t,i,"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||!j(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:i,hls:s}=this;if(this.stopLoad(),this.setInterval(P_),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}i>0&&e===-1&&!t&&(this.log(`Override startPosition with lastCurrentTime @${i.toFixed(3)}`),e=i),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:i}=this,s=t==null?void 0:t[i],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(),i=this.retryDate;if(!i||t>=i||(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:i,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(!(i!=null&&i[r]))return;const o=i[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&&we(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,i){const s=this.fragmentTracker.getState(e);s===Be.NOT_LOADED||s===Be.PARTIAL?we(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,i):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 i;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?i=this.fragCurrent.duration*c.maxBitrate/(1e3*l)+1:i=0}else i=0;const o=this.getBufferedFrag(t.currentTime+i);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 i=t.media;xt(i,"playing",this.onMediaPlaying),xt(i,"seeked",this.onMediaSeeked)}onMediaDetaching(e,t){const{media:i}=this;i&&(_t(i,"playing",this.onMediaPlaying),_t(i,"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 i=!1,s=!1;t.levels.forEach(r=>{const o=r.audioCodec;o&&(i=i||o.indexOf("mp4a.40.2")!==-1,s=s||o.indexOf("mp4a.40.5")!==-1)}),this.audioCodecSwitch=i&&s&&!w_(),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:i}=this;if(!i||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 i;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||(i=l.details)!=null&&i.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:i}=this;if(!i)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&&i.duration>s&&(r<s||!c)){const u=t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;if((!c&&i.readyState<4||r<a-u)&&(this._hasEnoughToStart||(this.nextLoadPosition=s),i.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(i,s,0);if(!(f!=null&&(l=f.buffered)!=null&&l.length)){i.currentTime=s;return}if(f.start<=r){i.currentTime=s;return}const{nextStart:h}=re.bufferedInfo(f.buffered,r,0);h&&(i.currentTime=h)}else i.currentTime=s}}_handleFragmentLoadProgress(e){var t;const i=e.frag,{part:s,payload:r}=e,{levels:o}=this;if(!o){this.warn(`Levels were reset while fragment load was in progress. Fragment ${i.sn} of level ${i.level} will not be buffered`);return}const a=o[i.level];if(!a){this.warn(`Level ${i.level} not found on progress`);return}const c=a.details;if(!c){this.warn(`Dropping fragment ${i.sn} of level ${i.level} after level details were reset`),this.fragmentTracker.removeFragment(i);return}const l=a.videoCodec,u=c.PTSKnown||!c.live,f=(t=i.initSegment)==null?void 0:t.data,d=this._getAudioCodec(a),h=this.transmuxer=this.transmuxer||new l1(this.hls,X.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),p=s?s.index:-1,m=p!==-1,g=new Wc(i.level,i.sn,i.stats.chunkCount,r.byteLength,p,m),y=this.initPTS[i.cc];h.push(r,f,d,l,i,s,c.totalduration,u,g,y)}onAudioTrackSwitching(e,t){const i=this.hls,s=this.altAudio===2;if(Fr(t.url,i))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(),i.once(A.BUFFER_FLUSHED,()=>{var o;(o=this.hls)==null||o.trigger(A.AUDIO_TRACK_SWITCHED,t)}),i.trigger(A.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});return}i.trigger(A.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const i=Fr(t.url,this.hls);if(i){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=i?2:0,this.tick()}onBufferCreated(e,t){const i=t.tracks;let s,r,o=!1;for(const a in i){const c=i[a];if(c.id==="main"){if(r=a,s=c,a==="video"){const l=i[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:i,part:s}=t,r=i.type===X.MAIN;if(r){if(this.fragContextChanged(i)){this.warn(`Fragment ${i.sn}${s?" p: "+s.index:""} of level ${i.level} finished buffering, but was aborted. state: ${this.state}`),this.state===V.PARSED&&(this.state=V.IDLE);return}const a=s?s.stats:i.stats;this.fragLastKbps=Math.round(8*a.total/(a.buffering.end-a.loading.first)),we(i)&&(this.fragPrevious=i),this.fragBufferedComplete(i,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 i;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&&((i=t.context)==null?void 0:i.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 i=(t===ve.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;i&&(this.afterBufferFlushed(i,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 i=this.startPosition;if(i>=0&&t<i){if(e.seeking){this.log(`could not seek to ${i}, already seeking at ${t}`);return}const s=this.timelineOffset;s&&i&&(i+=s);const r=this.getLevelDetails(),o=re.getBuffered(e),a=o.length?o.start(0):0,c=a-i,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`),i+=c,this.startPosition=i),t<i&&(this.log(`seek to target start position ${i} from current time ${t} buffer start ${a}`),e.currentTime=i)}}_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(i=>{const{hls:s}=this,r=i==null?void 0:i.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,i),r.bitrateTest=!1})}_handleTransmuxComplete(e){var t;const i=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:i,tracks:p.tracks})}const y=p.initPTS,v=p.timescale,x=this.initPTS[c.cc];j(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:i,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(),R=(I?I.end:this.getLoadPosition())+this.config.maxBufferHole,b=f.firstKeyFramePTS?f.firstKeyFramePTS:E;if(!v&&R<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)>fr&&(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:i,frag:c,details:m,samples:h.samples};s.trigger(A.FRAG_PARSING_METADATA,y)}if(m&&d){const y={id:i,frag:c,details:m,samples:d.samples};s.trigger(A.FRAG_PARSING_USERDATA,y)}}logMuxedErr(e){this.warn(`${we(e)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${e.url}`)}_bufferInitSegment(e,t,i,s){if(this.state!==V.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&(delete t.audio,t.audiovideo&&this.logMuxedErr(i));const{audio:r,video:o,audiovideo:a}=t;if(r){const l=e.audioCodec;let u=sr(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:i,part:null,chunkMeta:s,parent:i.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,i=e==null?void 0:e[t];return i?this.getMaxBufferLength(i.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 i=e.currentTime;if(re.isBuffered(e,i)?t=this.getAppendedFrag(i):re.isBuffered(e,i+.1)&&(t=this.getAppendedFrag(i+.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 j(t)?this.getAppendedFrag(t):null}get currentProgramDateTime(){var e;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;if(j(t)){const i=this.getLevelDetails(),s=this.currentFrag||(i?Ki(null,i.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 B_{constructor(e){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const i in this.keyUriToKeyInfo){const s=this.keyUriToKeyInfo[i].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,i,s,r){return new jt({type:Z.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:r,error:i,networkDetails:s})}loadClear(e,t,i){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&&(!we(e)||!we(o)||e.sn<o.sn)||!i&&s==r-1)return this.emeController.selectKeySystemFormat(o).then(a=>{if(!this.emeController)return;o.setKeyFormat(a);const c=Fl(a);if(c)return this.emeController.getKeySystemAccess([c])})}if(this.config.requireKeySystemAccessOnStart){const s=or(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 i,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((i=a)!=null&&i.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 i={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){const s=this.emeController.loadKey(i);if(s)return(e.keyLoadPromise=s.then(r=>(e.mediaKeySessionContext=r,i))).catch(r=>{throw e.keyLoadPromise=null,r})}return Promise.resolve(i)}loadKeyHTTP(e,t){const i=this.config,s=i.loader,r=new s(i);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=i.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:i,url:s}=e,r=i.loader;t.keyLoader===r&&(t.keyLoader=null,i.loader=null),delete this.keyUriToKeyInfo[s],r&&r.destroy()}}function md(n){const{type:e}=n;switch(e){case ue.AUDIO_TRACK:return X.AUDIO;case ue.SUBTITLE_TRACK:return X.SUBTITLE;default:return X.MAIN}}function ea(n,e){let t=n.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class F_{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,i=t.pLoader,s=t.loader,r=i||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:i}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:ue.MANIFEST,url:i,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(e,t){const{id:i,level:s,pathwayId:r,url:o,deliveryDirectives:a,levelInfo:c}=t;this.load({id:i,level:s,pathwayId:r,responseType:"text",type:ue.LEVEL,url:o,deliveryDirectives:a,levelOrTrack:c})}onAudioTrackLoading(e,t){const{id:i,groupId:s,url:r,deliveryDirectives:o,track:a}=t;this.load({id:i,groupId:s,level:null,responseType:"text",type:ue.AUDIO_TRACK,url:r,deliveryDirectives:o,levelOrTrack:a})}onSubtitleTrackLoading(e,t){const{id:i,groupId:s,url:r,deliveryDirectives:o,track:a}=t;this.load({id:i,groupId:s,level:null,responseType:"text",type:ue.SUBTITLE_TRACK,url:r,deliveryDirectives:o,levelOrTrack:a})}onLevelsUpdated(e,t){const i=this.loaders[ue.LEVEL];if(i){const s=i.context;s&&!t.levels.some(r=>r===s.levelOrTrack)&&(i.abort(),delete this.loaders[ue.LEVEL])}}load(e){var t;const i=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=i.manifestLoadPolicy.default:r=me({},i.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),s=this.createInternalLoader(e),j((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(),Mt.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:i}=this.hls;(e||i)&&(this.hls.logger.log(`${e?"auto":"force"} startLoad with configured startPosition ${t}`),this.hls.startLoad(t))}handleMasterPlaylist(e,t,i,s){const r=this.hls,o=e.data,a=ea(e,i),c=Mt.parseMasterPlaylist(o,a);if(c.playlistParsingError){this.handleManifestParsingError(e,i,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}=Mt.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,i,s,r){const o=this.hls,{id:a,level:c,type:l}=i,u=ea(e,i),f=j(c)?c:j(a)?a:0,d=md(i),h=Mt.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+Mm(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(),i.levelDetails=h,this.handlePlaylistLoaded(h,e,t,i,s,r)}handleManifestParsingError(e,t,i,s,r){this.hls.trigger(A.ERROR,{type:Z.NETWORK_ERROR,details:$.MANIFEST_PARSING_ERROR,fatal:t.type===ue.MANIFEST,url:e.url,err:i,error:i,reason:i.message,response:e,context:t,networkDetails:s,stats:r})}handleNetworkError(e,t,i=!1,s,r){let o=`A network ${i?"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=i?$.MANIFEST_LOAD_TIMEOUT:$.MANIFEST_LOAD_ERROR,l=!0;break;case ue.LEVEL:c=i?$.LEVEL_LOAD_TIMEOUT:$.LEVEL_LOAD_ERROR,l=!1;break;case ue.AUDIO_TRACK:c=i?$.AUDIO_TRACK_LOAD_TIMEOUT:$.AUDIO_TRACK_LOAD_ERROR,l=!1;break;case ue.SUBTITLE_TRACK:c=i?$.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,i,s,r,o){const a=this.hls,{type:c,level:l,id:u,groupId:f,deliveryDirectives:d}=s,h=ea(t,s),p=md(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:i});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:i});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:i,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:i,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:i,networkDetails:r,deliveryDirectives:d});break}}}class li{static get version(){return ys}static isMSESupported(){return w1()}static isSupported(){return R_()}static getMediaSource(){return Ei()}static get Events(){return A}static get MetadataSchema(){return ct}static get ErrorTypes(){return Z}static get ErrorDetails(){return $}static get DefaultConfig(){return li.defaultConfig?li.defaultConfig:y_}static set DefaultConfig(e){li.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 Yc,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=t5(e.debug||!1,"Hls instance",e.assetPlayerId),i=this.config=E_(li.DefaultConfig,e,t);this.userConfig=e,i.progressive&&A_(i,t);const{abrController:s,bufferController:r,capLevelController:o,errorController:a,fpsController:c}=i,l=new a(this),u=this.abrController=new s(this),f=new q5(this),d=i.interstitialsController,h=d?this.interstitialsController=new d(this,li):null,p=this.bufferController=new r(this,f),m=this.capLevelController=new o(this),g=new c(this),y=new F_(this),v=i.contentSteeringController,x=v?new v(this):null,E=this.levelController=new D_(this,x),S=new C_(this),T=new B_(this.config),_=this.streamController=new k_(this,f,T),I=this.gapController=new __(this,f);m.setStreamController(_),g.setStreamController(_);const R=[y,E,_];h&&R.splice(1,0,h),x&&R.splice(1,0,x),this.networkControllers=R;const b=[u,p,I,m,g,S,f];this.audioTrackController=this.createController(i.audioTrackController,R);const L=i.audioStreamController;L&&R.push(this.audioStreamController=new L(this,f,T)),this.subtitleTrackController=this.createController(i.subtitleTrackController,R);const k=i.subtitleStreamController;k&&R.push(this.subtititleStreamController=new k(this,f,T)),this.createController(i.timelineController,b),T.emeController=this.emeController=this.createController(i.emeController,b),this.cmcdController=this.createController(i.cmcdController,b),this.latencyController=this.createController(L_,b),this.coreComponents=b,R.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 i=new e(this);return t&&t.push(i),i}return null}on(e,t,i=this){this._emitter.on(e,t,i)}once(e,t,i=this){this._emitter.once(e,t,i)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,i=this,s){this._emitter.off(e,t,i,s)}listeners(e){return this._emitter.listeners(e)}emit(e,t,i){return this._emitter.emit(e,t,i)}trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(i){if(this.logger.error("An internal error happened while handling event "+e+'. Error message: "'+i.message+'". Here is a stacktrace:',i),!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:i}),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,i=t?e.media:e,s=t?e:{media:i};this._media=i,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,i=this._url,s=this._url=$c.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${s}`),t&&i&&(i!==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 i=0;i<this.networkControllers.length&&(this.networkControllers[i].startLoad(e,t),!(!this.started||!this.networkControllers));i++);}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=_7()),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){R5(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 i=e.length;for(let s=0;s<i;s++)if(e[s].maxBitrate>=t)return s;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:i}=this;let s;if(t===-1&&e!=null&&e.length?s=e.length-1:s=t,i)for(let r=s;r--;){const o=e[r].attrs["HDCP-LEVEL"];if(o&&o<=i)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 i=Im(t);return bm(e,i,navigator.mediaCapabilities)}}li.defaultConfig=void 0;var ae=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function P1(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function O_(n){if(n.__esModule)return n;var e=n.default;if(typeof e=="function"){var t=function i(){return this instanceof i?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(n).forEach(function(i){var s=Object.getOwnPropertyDescriptor(n,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:function(){return n[i]}})}),t}var k1={exports:{}};function M_(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ta={exports:{}};const N_=new Proxy({},{get(n,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.`)}}),U_=Object.freeze(Object.defineProperty({__proto__:null,default:N_},Symbol.toStringTag,{value:"Module"})),$_=O_(U_);var xd;function he(){return xd||(xd=1,function(n,e){(function(t,i){n.exports=i()})(ae,function(){var t=t||function(i,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 M_=="function")try{r=$_}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 R=0;R<T;R+=4)x[S+R>>>2]=E[R>>>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=i.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,R=T/I;v?R=i.ceil(R):R=i.max((R|0)-this._minBufferSize,0);var b=R*_,L=i.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})}(ta)),ta.exports}var ia={exports:{}},yd;function lo(){return yd||(yd=1,function(n,e){(function(t,i){n.exports=i(he())})(ae,function(t){return function(i){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!=i?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})}(ia)),ia.exports}var na={exports:{}},vd;function H_(){return vd||(vd=1,function(n,e){(function(t,i){n.exports=i(he())})(ae,function(t){return function(){if(typeof ArrayBuffer=="function"){var i=t,s=i.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})}(na)),na.exports}var sa={exports:{}},Ed;function G_(){return Ed||(Ed=1,function(n,e){(function(t,i){n.exports=i(he())})(ae,function(t){return function(){var i=t,s=i.lib,r=s.WordArray,o=i.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})}(sa)),sa.exports}var ra={exports:{}},Ad;function Xi(){return Ad||(Ad=1,function(n,e){(function(t,i){n.exports=i(he())})(ae,function(t){return function(){var i=t,s=i.lib,r=s.WordArray,o=i.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})}(ra)),ra.exports}var oa={exports:{}},Sd;function K_(){return Sd||(Sd=1,function(n,e){(function(t,i){n.exports=i(he())})(ae,function(t){return function(){var i=t,s=i.lib,r=s.WordArray,o=i.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})}(oa)),oa.exports}var aa={exports:{}},Td;function Ji(){return Td||(Td=1,function(n,e){(function(t,i){n.exports=i(he())})(ae,function(t){return function(i){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]=i.abs(i.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],R=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],D=E[1],P=E[2],w=E[3];C=f(C,D,P,w,S,7,l[0]),w=f(w,C,D,P,T,12,l[1]),P=f(P,w,C,D,_,17,l[2]),D=f(D,P,w,C,I,22,l[3]),C=f(C,D,P,w,R,7,l[4]),w=f(w,C,D,P,b,12,l[5]),P=f(P,w,C,D,L,17,l[6]),D=f(D,P,w,C,k,22,l[7]),C=f(C,D,P,w,M,7,l[8]),w=f(w,C,D,P,N,12,l[9]),P=f(P,w,C,D,F,17,l[10]),D=f(D,P,w,C,O,22,l[11]),C=f(C,D,P,w,K,7,l[12]),w=f(w,C,D,P,B,12,l[13]),P=f(P,w,C,D,G,17,l[14]),D=f(D,P,w,C,H,22,l[15]),C=d(C,D,P,w,T,5,l[16]),w=d(w,C,D,P,L,9,l[17]),P=d(P,w,C,D,O,14,l[18]),D=d(D,P,w,C,S,20,l[19]),C=d(C,D,P,w,b,5,l[20]),w=d(w,C,D,P,F,9,l[21]),P=d(P,w,C,D,H,14,l[22]),D=d(D,P,w,C,R,20,l[23]),C=d(C,D,P,w,N,5,l[24]),w=d(w,C,D,P,G,9,l[25]),P=d(P,w,C,D,I,14,l[26]),D=d(D,P,w,C,M,20,l[27]),C=d(C,D,P,w,B,5,l[28]),w=d(w,C,D,P,_,9,l[29]),P=d(P,w,C,D,k,14,l[30]),D=d(D,P,w,C,K,20,l[31]),C=h(C,D,P,w,b,4,l[32]),w=h(w,C,D,P,M,11,l[33]),P=h(P,w,C,D,O,16,l[34]),D=h(D,P,w,C,G,23,l[35]),C=h(C,D,P,w,T,4,l[36]),w=h(w,C,D,P,R,11,l[37]),P=h(P,w,C,D,k,16,l[38]),D=h(D,P,w,C,F,23,l[39]),C=h(C,D,P,w,B,4,l[40]),w=h(w,C,D,P,S,11,l[41]),P=h(P,w,C,D,I,16,l[42]),D=h(D,P,w,C,L,23,l[43]),C=h(C,D,P,w,N,4,l[44]),w=h(w,C,D,P,K,11,l[45]),P=h(P,w,C,D,H,16,l[46]),D=h(D,P,w,C,_,23,l[47]),C=p(C,D,P,w,S,6,l[48]),w=p(w,C,D,P,k,10,l[49]),P=p(P,w,C,D,G,15,l[50]),D=p(D,P,w,C,b,21,l[51]),C=p(C,D,P,w,K,6,l[52]),w=p(w,C,D,P,I,10,l[53]),P=p(P,w,C,D,F,15,l[54]),D=p(D,P,w,C,T,21,l[55]),C=p(C,D,P,w,M,6,l[56]),w=p(w,C,D,P,H,10,l[57]),P=p(P,w,C,D,L,15,l[58]),D=p(D,P,w,C,B,21,l[59]),C=p(C,D,P,w,R,6,l[60]),w=p(w,C,D,P,O,10,l[61]),P=p(P,w,C,D,_,15,l[62]),D=p(D,P,w,C,N,21,l[63]),E[0]=E[0]+C|0,E[1]=E[1]+D|0,E[2]=E[2]+P|0,E[3]=E[3]+w|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=i.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})}(aa)),aa.exports}var la={exports:{}},bd;function B1(){return bd||(bd=1,function(n,e){(function(t,i){n.exports=i(he())})(ae,function(t){return function(){var i=t,s=i.lib,r=s.WordArray,o=s.Hasher,a=i.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}});i.SHA1=o._createHelper(l),i.HmacSHA1=o._createHmacHelper(l)}(),t.SHA1})}(la)),la.exports}var ca={exports:{}},_d;function lu(){return _d||(_d=1,function(n,e){(function(t,i){n.exports=i(he())})(ae,function(t){return function(i){var s=t,r=s.lib,o=r.WordArray,a=r.Hasher,c=s.algo,l=[],u=[];(function(){function h(y){for(var v=i.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(i.pow(m,1/2))),u[g]=p(i.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 R=f[I-15],b=(R<<25|R>>>7)^(R<<14|R>>>18)^R>>>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]=i.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})}(ca)),ca.exports}var ua={exports:{}},Id;function V_(){return Id||(Id=1,function(n,e){(function(t,i,s){n.exports=i(he(),lu())})(ae,function(t){return function(){var i=t,s=i.lib,r=s.WordArray,o=i.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}});i.SHA224=a._createHelper(c),i.HmacSHA224=a._createHmacHelper(c)}(),t.SHA224})}(ua)),ua.exports}var fa={exports:{}},Cd;function F1(){return Cd||(Cd=1,function(n,e){(function(t,i,s){n.exports=i(he(),lo())})(ae,function(t){return function(){var i=t,s=i.lib,r=s.Hasher,o=i.x64,a=o.Word,c=o.WordArray,l=i.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],R=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,D=_.low,P=I.high,w=I.low,W=R,z=b,se=L,ee=k,ge=M,de=N,Ie=F,at=O,Ce=K,Ve=B,Rn=G,ce=H,be=C,Oe=D,vt=P,je=w,Me=0;Me<80;Me++){var Le,Et,Ht=d[Me];if(Me<16)Et=Ht.high=p[m+Me*2]|0,Le=Ht.low=p[m+Me*2+1]|0;else{var wn=d[Me-15],ft=wn.high,Xt=wn.low,co=(ft>>>1|Xt<<31)^(ft>>>8|Xt<<24)^ft>>>7,Pn=(Xt>>>1|ft<<31)^(Xt>>>8|ft<<24)^(Xt>>>7|ft<<25),kn=d[Me-2],dt=kn.high,Bn=kn.low,M1=(dt>>>19|Bn<<13)^(dt<<3|Bn>>>29)^dt>>>6,uu=(Bn>>>19|dt<<13)^(Bn<<3|dt>>>29)^(Bn>>>6|dt<<26),fu=d[Me-7],N1=fu.high,U1=fu.low,du=d[Me-16],$1=du.high,hu=du.low;Le=Pn+U1,Et=co+N1+(Le>>>0<Pn>>>0?1:0),Le=Le+uu,Et=Et+M1+(Le>>>0<uu>>>0?1:0),Le=Le+hu,Et=Et+$1+(Le>>>0<hu>>>0?1:0),Ht.high=Et,Ht.low=Le}var H1=Ce&Rn^~Ce&be,pu=Ve&ce^~Ve&Oe,G1=W&se^W&ge^se&ge,K1=z&ee^z&de^ee&de,V1=(W>>>28|z<<4)^(W<<30|z>>>2)^(W<<25|z>>>7),gu=(z>>>28|W<<4)^(z<<30|W>>>2)^(z<<25|W>>>7),j1=(Ce>>>14|Ve<<18)^(Ce>>>18|Ve<<14)^(Ce<<23|Ve>>>9),q1=(Ve>>>14|Ce<<18)^(Ve>>>18|Ce<<14)^(Ve<<23|Ce>>>9),mu=f[Me],W1=mu.high,xu=mu.low,lt=je+q1,Jt=vt+j1+(lt>>>0<je>>>0?1:0),lt=lt+pu,Jt=Jt+H1+(lt>>>0<pu>>>0?1:0),lt=lt+xu,Jt=Jt+W1+(lt>>>0<xu>>>0?1:0),lt=lt+Le,Jt=Jt+Et+(lt>>>0<Le>>>0?1:0),yu=gu+K1,z1=V1+G1+(yu>>>0<gu>>>0?1:0);vt=be,je=Oe,be=Rn,Oe=ce,Rn=Ce,ce=Ve,Ve=at+lt|0,Ce=Ie+Jt+(Ve>>>0<at>>>0?1:0)|0,Ie=ge,at=de,ge=se,de=ee,se=W,ee=z,z=lt+yu|0,W=Jt+z1+(z>>>0<lt>>>0?1:0)|0}b=y.low=b+z,y.high=R+W+(b>>>0<z>>>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+at,E.high=F+Ie+(O>>>0<at>>>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+Rn+(H>>>0<ce>>>0?1:0),D=_.low=D+Oe,_.high=C+be+(D>>>0<Oe>>>0?1:0),w=I.low=w+je,I.high=P+vt+(w>>>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});i.SHA512=r._createHelper(h),i.HmacSHA512=r._createHmacHelper(h)}(),t.SHA512})}(fa)),fa.exports}var da={exports:{}},Ld;function j_(){return Ld||(Ld=1,function(n,e){(function(t,i,s){n.exports=i(he(),lo(),F1())})(ae,function(t){return function(){var i=t,s=i.x64,r=s.Word,o=s.WordArray,a=i.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}});i.SHA384=c._createHelper(l),i.HmacSHA384=c._createHmacHelper(l)}(),t.SHA384})}(da)),da.exports}var ha={exports:{}},Dd;function q_(){return Dd||(Dd=1,function(n,e){(function(t,i,s){n.exports=i(he(),lo())})(ae,function(t){return function(i){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,R=0;R<7;R++){if(S&1){var b=(1<<R)-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 R=0;R<5;R++){for(var b=0,L=0,k=0;k<5;k++){var _=v[R+5*k];b^=_.high,L^=_.low}var M=p[R];M.high=b,M.low=L}for(var R=0;R<5;R++)for(var N=p[(R+4)%5],F=p[(R+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[R+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 D=p[d[B]];D.high=b,D.low=L}var P=p[0],w=v[0];P.high=w.high,P.low=w.low;for(var R=0;R<5;R++)for(var k=0;k<5;k++){var B=R+5*k,_=v[B],W=p[B],z=p[(R+1)%5+5*k],se=p[(R+2)%5+5*k];_.high=W.high^~z.high&se.high,_.low=W.low^~z.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[(i.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 R=E[I],b=R.high,L=R.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})}(ha)),ha.exports}var pa={exports:{}},Rd;function W_(){return Rd||(Rd=1,function(n,e){(function(t,i){n.exports=i(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(i){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 R=_+I,b=T[R];T[R]=(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,D,P,w,W,z,se;P=B=L[0],w=G=L[1],W=H=L[2],z=C=L[3],se=D=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+D|0,B=D,D=C,C=S(H,10),H=G,G=ee,ee=P+T[_+F[I]]|0,I<16?ee+=E(w,W,z)+M[0]:I<32?ee+=x(w,W,z)+M[1]:I<48?ee+=v(w,W,z)+M[2]:I<64?ee+=y(w,W,z)+M[3]:ee+=g(w,W,z)+M[4],ee=ee|0,ee=S(ee,K[I]),ee=ee+se|0,P=se,se=z,z=S(W,10),W=w,w=ee;ee=L[1]+H+z|0,L[1]=L[2]+C+se|0,L[2]=L[3]+D+P|0,L[3]=L[4]+B+w|0,L[4]=L[0]+G+W|0,L[0]=ee},_doFinalize:function(){var T=this._data,_=T.words,I=this._nDataBytes*8,R=T.sigBytes*8;_[R>>>5]|=128<<24-R%32,_[(R+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})}(pa)),pa.exports}var ga={exports:{}},wd;function cu(){return wd||(wd=1,function(n,e){(function(t,i){n.exports=i(he())})(ae,function(t){(function(){var i=t,s=i.lib,r=s.Base,o=i.enc,a=o.Utf8,c=i.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}})})()})}(ga)),ga.exports}var ma={exports:{}},Pd;function z_(){return Pd||(Pd=1,function(n,e){(function(t,i,s){n.exports=i(he(),lu(),cu())})(ae,function(t){return function(){var i=t,s=i.lib,r=s.Base,o=s.WordArray,a=i.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,R=1;R<E;R++){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}});i.PBKDF2=function(f,d,h){return u.create(h).compute(f,d)}}(),t.PBKDF2})}(ma)),ma.exports}var xa={exports:{}},kd;function Ti(){return kd||(kd=1,function(n,e){(function(t,i,s){n.exports=i(he(),B1(),cu())})(ae,function(t){return function(){var i=t,s=i.lib,r=s.Base,o=s.WordArray,a=i.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}});i.EvpKDF=function(u,f,d){return l.create(d).compute(u,f)}}(),t.EvpKDF})}(xa)),xa.exports}var ya={exports:{}},Bd;function Ke(){return Bd||(Bd=1,function(n,e){(function(t,i,s){n.exports=i(he(),Ti())})(ae,function(t){t.lib.Cipher||function(i){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"?R: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=i):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})}},R=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}})}()})}(ya)),ya.exports}var va={exports:{}},Fd;function Q_(){return Fd||(Fd=1,function(n,e){(function(t,i,s){n.exports=i(he(),Ke())})(ae,function(t){return t.mode.CFB=function(){var i=t.lib.BlockCipherMode.extend();i.Encryptor=i.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)}}),i.Decryptor=i.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 i}(),t.mode.CFB})}(va)),va.exports}var Ea={exports:{}},Od;function Y_(){return Od||(Od=1,function(n,e){(function(t,i,s){n.exports=i(he(),Ke())})(ae,function(t){return t.mode.CTR=function(){var i=t.lib.BlockCipherMode.extend(),s=i.Encryptor=i.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 i.Decryptor=s,i}(),t.mode.CTR})}(Ea)),Ea.exports}var Aa={exports:{}},Md;function X_(){return Md||(Md=1,function(n,e){(function(t,i,s){n.exports=i(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 i=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=i.Encryptor=i.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 i.Decryptor=o,i}(),t.mode.CTRGladman})}(Aa)),Aa.exports}var Sa={exports:{}},Nd;function J_(){return Nd||(Nd=1,function(n,e){(function(t,i,s){n.exports=i(he(),Ke())})(ae,function(t){return t.mode.OFB=function(){var i=t.lib.BlockCipherMode.extend(),s=i.Encryptor=i.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 i.Decryptor=s,i}(),t.mode.OFB})}(Sa)),Sa.exports}var Ta={exports:{}},Ud;function Z_(){return Ud||(Ud=1,function(n,e){(function(t,i,s){n.exports=i(he(),Ke())})(ae,function(t){return t.mode.ECB=function(){var i=t.lib.BlockCipherMode.extend();return i.Encryptor=i.extend({processBlock:function(s,r){this._cipher.encryptBlock(s,r)}}),i.Decryptor=i.extend({processBlock:function(s,r){this._cipher.decryptBlock(s,r)}}),i}(),t.mode.ECB})}(Ta)),Ta.exports}var ba={exports:{}},$d;function eI(){return $d||($d=1,function(n,e){(function(t,i,s){n.exports=i(he(),Ke())})(ae,function(t){return t.pad.AnsiX923={pad:function(i,s){var r=i.sigBytes,o=s*4,a=o-r%o,c=r+a-1;i.clamp(),i.words[c>>>2]|=a<<24-c%4*8,i.sigBytes+=a},unpad:function(i){var s=i.words[i.sigBytes-1>>>2]&255;i.sigBytes-=s}},t.pad.Ansix923})}(ba)),ba.exports}var _a={exports:{}},Hd;function tI(){return Hd||(Hd=1,function(n,e){(function(t,i,s){n.exports=i(he(),Ke())})(ae,function(t){return t.pad.Iso10126={pad:function(i,s){var r=s*4,o=r-i.sigBytes%r;i.concat(t.lib.WordArray.random(o-1)).concat(t.lib.WordArray.create([o<<24],1))},unpad:function(i){var s=i.words[i.sigBytes-1>>>2]&255;i.sigBytes-=s}},t.pad.Iso10126})}(_a)),_a.exports}var Ia={exports:{}},Gd;function iI(){return Gd||(Gd=1,function(n,e){(function(t,i,s){n.exports=i(he(),Ke())})(ae,function(t){return t.pad.Iso97971={pad:function(i,s){i.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(i,s)},unpad:function(i){t.pad.ZeroPadding.unpad(i),i.sigBytes--}},t.pad.Iso97971})}(Ia)),Ia.exports}var Ca={exports:{}},Kd;function nI(){return Kd||(Kd=1,function(n,e){(function(t,i,s){n.exports=i(he(),Ke())})(ae,function(t){return t.pad.ZeroPadding={pad:function(i,s){var r=s*4;i.clamp(),i.sigBytes+=r-(i.sigBytes%r||r)},unpad:function(i){for(var s=i.words,r=i.sigBytes-1,r=i.sigBytes-1;r>=0;r--)if(s[r>>>2]>>>24-r%4*8&255){i.sigBytes=r+1;break}}},t.pad.ZeroPadding})}(Ca)),Ca.exports}var La={exports:{}},Vd;function sI(){return Vd||(Vd=1,function(n,e){(function(t,i,s){n.exports=i(he(),Ke())})(ae,function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding})}(La)),La.exports}var Da={exports:{}},jd;function rI(){return jd||(jd=1,function(n,e){(function(t,i,s){n.exports=i(he(),Ke())})(ae,function(t){return function(i){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})}(Da)),Da.exports}var Ra={exports:{}},qd;function oI(){return qd||(qd=1,function(n,e){(function(t,i,s){n.exports=i(he(),Xi(),Ji(),Ti(),Ke())})(ae,function(t){return function(){var i=t,s=i.lib,r=s.BlockCipher,o=i.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],R=x[I],b=x[R],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^R*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,R=this._keySchedule=[],b=0;b<I;b++)b<T?R[b]=S[b]:(x=R[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),R[b]=R[b-T]^x);for(var L=this._invKeySchedule=[],k=0;k<I;k++){var b=I-k;if(k%4)var x=R[b];else var x=R[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,R,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]^R[F&255]^S[O++],G=T[M>>>24]^_[N>>>16&255]^I[F>>>8&255]^R[k&255]^S[O++],H=T[N>>>24]^_[F>>>16&255]^I[k>>>8&255]^R[M&255]^S[O++],C=T[F>>>24]^_[k>>>16&255]^I[M>>>8&255]^R[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});i.AES=r._createHelper(v)}(),t.AES})}(Ra)),Ra.exports}var wa={exports:{}},Wd;function aI(){return Wd||(Wd=1,function(n,e){(function(t,i,s){n.exports=i(he(),Xi(),Ji(),Ti(),Ke())})(ae,function(t){return function(){var i=t,s=i.lib,r=s.WordArray,o=s.BlockCipher,a=i.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[_]=[],R=u[_],E=0;E<24;E++)I[E/6|0]|=x[(l[E]-1+R)%28]<<31-E%6,I[4+(E/6|0)]|=x[28+(l[E+24]-1+R)%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,R=0;R<8;R++)I|=f[R][((_^S[R])&d[R])>>>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}i.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});i.TripleDES=o._createHelper(g)}(),t.TripleDES})}(wa)),wa.exports}var Pa={exports:{}},zd;function lI(){return zd||(zd=1,function(n,e){(function(t,i,s){n.exports=i(he(),Xi(),Ji(),Ti(),Ke())})(ae,function(t){return function(){var i=t,s=i.lib,r=s.StreamCipher,o=i.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}i.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)}});i.RC4Drop=r._createHelper(l)}(),t.RC4})}(Pa)),Pa.exports}var ka={exports:{}},Qd;function cI(){return Qd||(Qd=1,function(n,e){(function(t,i,s){n.exports=i(he(),Xi(),Ji(),Ti(),Ke())})(ae,function(t){return function(){var i=t,s=i.lib,r=s.StreamCipher,o=i.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}i.Rabbit=r._createHelper(u)}(),t.Rabbit})}(ka)),ka.exports}var Ba={exports:{}},Yd;function uI(){return Yd||(Yd=1,function(n,e){(function(t,i,s){n.exports=i(he(),Xi(),Ji(),Ti(),Ke())})(ae,function(t){return function(){var i=t,s=i.lib,r=s.StreamCipher,o=i.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}i.RabbitLegacy=r._createHelper(u)}(),t.RabbitLegacy})}(Ba)),Ba.exports}var Fa={exports:{}},Xd;function fI(){return Xd||(Xd=1,function(n,e){(function(t,i,s){n.exports=i(he(),Xi(),Ji(),Ti(),Ke())})(ae,function(t){return function(){var i=t,s=i.lib,r=s.BlockCipher,o=i.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});i.Blowfish=r._createHelper(m)}(),t.Blowfish})}(Fa)),Fa.exports}(function(n,e){(function(t,i,s){n.exports=i(he(),lo(),H_(),G_(),Xi(),K_(),Ji(),B1(),lu(),V_(),F1(),j_(),q_(),W_(),cu(),z_(),Ti(),Ke(),Q_(),Y_(),X_(),J_(),Z_(),eI(),tI(),iI(),nI(),sI(),rI(),oI(),aI(),lI(),cI(),uI(),fI())})(ae,function(t){return t})})(k1);var dI=k1.exports;const hI=P1(dI);var O1={exports:{}};(function(n,e){(function(t,i){n.exports=i()})(ae,function(){var t=1e3,i=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[_])},R=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=R,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=R(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,D=(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,D)):new Date(H[1],C,H[3]||1,H[4]||0,H[5]||0,H[6]||0,D)}}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)},D=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,w=this.$M,W=this.$D,z="set"+(this.$u?"UTC":"");switch(H){case h:return G?C(1,0):C(31,11);case f:return G?C(1,w):C(0,w+1);case u:var se=this.$locale().weekStart||0,ee=(P<se?P+7:P)-se;return C(G?W-ee:W+(6-ee),w);case l:case p:return D(z+"Hours",0);case c:return D(z+"Minutes",1);case a:return D(z+"Seconds",2);case o:return D(z+"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],D=G===l?this.$D+(K-this.$W):K;if(G===f||G===h){var P=this.clone().set(p,1);P.$d[C](D),P.init(),this.$d=P.set(p,Math.min(this.$D,P.daysInMonth())).$d}else C&&this.$d[C](D);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(w){var W=b(G);return L.w(W.date(W.date()+Math.round(w*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 D=(B={},B[a]=i,B[c]=s,B[o]=t,B)[H]||1,P=this.$d.getTime()+O*D;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,D=this.$m,P=this.$M,w=B.weekdays,W=B.months,z=B.meridiem,se=function(de,Ie,at,Ce){return de&&(de[Ie]||de(K,G))||at[Ie].slice(0,Ce)},ee=function(de){return L.s(C%12||12,de,"0")},ge=z||function(de,Ie,at){var Ce=de<12?"AM":"PM";return at?Ce.toLowerCase():Ce};return G.replace(y,function(de,Ie){return Ie||function(at){switch(at){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,W,3);case"MMMM":return se(W,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,w,2);case"ddd":return se(B.weekdaysShort,K.$W,w,3);case"dddd":return w[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,D,!0);case"A":return ge(C,D,!1);case"m":return String(D);case"mm":return L.s(D,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),D=b(O),P=(D.utcOffset()-this.utcOffset())*i,w=this-D,W=function(){return L.m(H,D)};switch(C){case h:G=W()/12;break;case f:G=W();break;case d:G=W()/3;break;case u:G=(w-P)/6048e5;break;case l:G=(w-P)/864e5;break;case c:G=w/s;break;case a:G=w/i;break;case o:G=w/t;break;default:G=w}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=R(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=R,b.isDayjs=I,b.unix=function(N){return b(1e3*N)},b.en=T[S],b.Ls=T,b.p={},b})})(O1);var pI=O1.exports;const gI=P1(pI);exports.CryptoJS=hI;exports.Hls=li;exports._export_sfc=Q1;exports.createSSRApp=h3;exports.createStore=_4;exports.dayjs=gI;exports.e=a3;exports.f=r3;exports.index=Y;exports.n=l3;exports.nextTick$1=uc;exports.o=s3;exports.p=u3;exports.resolveComponent=yv;exports.s=o3;exports.sr=f3;exports.t=c3;exports.tr=qT;exports.useStore=h4;exports.uviewPlus=j8;
|