(function(Gi,Zt){typeof exports=="object"&&typeof module<"u"?module.exports=Zt():typeof define=="function"&&define.amd?define(Zt):(Gi=typeof globalThis<"u"?globalThis:Gi||self,Gi.GlycerineViewer=Zt())})(this,function(){"use strict";var _le=Object.defineProperty;var QM=Gi=>{throw TypeError(Gi)};var wle=(Gi,Zt,kn)=>Zt in Gi?_le(Gi,Zt,{enumerable:!0,configurable:!0,writable:!0,value:kn}):Gi[Zt]=kn;var _v=(Gi,Zt,kn)=>wle(Gi,typeof Zt!="symbol"?Zt+"":Zt,kn),Gx=(Gi,Zt,kn)=>Zt.has(Gi)||QM("Cannot "+kn);var oi=(Gi,Zt,kn)=>(Gx(Gi,Zt,"read from private field"),kn?kn.call(Gi):Zt.get(Gi)),Gr=(Gi,Zt,kn)=>Zt.has(Gi)?QM("Cannot add the same private member more than once"):Zt instanceof WeakSet?Zt.add(Gi):Zt.set(Gi,kn),Zn=(Gi,Zt,kn,Xs)=>(Gx(Gi,Zt,"write to private field"),Xs?Xs.call(Gi,kn):Zt.set(Gi,kn),kn),dr=(Gi,Zt,kn)=>(Gx(Gi,Zt,"access private method"),kn);/** * @vue/shared v3.5.16 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **//*! #__NO_SIDE_EFFECTS__ */var Yp,bh,Pc,kc,Sl,_h,wh,wv,Tu,$M,Tv,xu,Ic,_n,Th,xh,Ia,Lr,tF,iF,nF,Yl,u0,rF;function Gi(t){const e=Object.create(null);for(const i of t.split(","))e[i]=1;return i=>i in e}const Zt={},kn=[],Xs=()=>{},sF=()=>!1,Xm=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),xv=t=>t.startsWith("onUpdate:"),hr=Object.assign,Sv=(t,e)=>{const i=t.indexOf(e);i>-1&&t.splice(i,1)},oF=Object.prototype.hasOwnProperty,Zi=(t,e)=>oF.call(t,e),Jt=Array.isArray,pd=t=>Zm(t)==="[object Map]",Kx=t=>Zm(t)==="[object Set]",ui=t=>typeof t=="function",In=t=>typeof t=="string",$a=t=>typeof t=="symbol",Sn=t=>t!==null&&typeof t=="object",Yx=t=>(Sn(t)||ui(t))&&ui(t.then)&&ui(t.catch),Xx=Object.prototype.toString,Zm=t=>Xx.call(t),aF=t=>Zm(t).slice(8,-1),Zx=t=>Zm(t)==="[object Object]",Ev=t=>In(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,Ef=Gi(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Qm=t=>{const e=Object.create(null);return i=>e[i]||(e[i]=t(i))},lF=/-(\w)/g,mo=Qm(t=>t.replace(lF,(e,i)=>i?i.toUpperCase():"")),uF=/\B([A-Z])/g,Xl=Qm(t=>t.replace(uF,"-$1").toLowerCase()),Jm=Qm(t=>t.charAt(0).toUpperCase()+t.slice(1)),$m=Qm(t=>t?`on${Jm(t)}`:""),Zl=(t,e)=>!Object.is(t,e),eg=(t,...e)=>{for(let i=0;i{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:n,value:i})},Cv=t=>{const e=parseFloat(t);return isNaN(e)?t:e},cF=t=>{const e=In(t)?Number(t):NaN;return isNaN(e)?t:e};let Jx;const tg=()=>Jx||(Jx=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Ri(t){if(Jt(t)){const e={};for(let i=0;i{if(i){const n=i.split(hF);n.length>1&&(e[n[0].trim()]=n[1].trim())}}),e}function Tt(t){let e="";if(In(t))e=t;else if(Jt(t))for(let i=0;i!!(t&&t.__v_isRef===!0),it=t=>In(t)?t:t==null?"":Jt(t)||Sn(t)&&(t.toString===Xx||!ui(t.toString))?eS(t)?it(t.value):JSON.stringify(t,tS,2):String(t),tS=(t,e)=>eS(e)?tS(t,e.value):pd(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((i,[n,r],s)=>(i[Av(n,s)+" =>"]=r,i),{})}:Kx(e)?{[`Set(${e.size})`]:[...e.values()].map(i=>Av(i))}:$a(e)?Av(e):Sn(e)&&!Jt(e)&&!Zx(e)?String(e):e,Av=(t,e="")=>{var i;return $a(t)?`Symbol(${(i=t.description)!=null?i:e})`:t};/** * @vue/reactivity v3.5.16 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/let Ps;class iS{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=Ps,!e&&Ps&&(this.index=(Ps.scopes||(Ps.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,i;if(this.scopes)for(e=0,i=this.scopes.length;e0&&--this._on===0&&(Ps=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let i,n;for(i=0,n=this.effects.length;i0)return;if(Af){let e=Af;for(Af=void 0;e;){const i=e.next;e.next=void 0,e.flags&=-9,e=i}}let t;for(;Cf;){let e=Cf;for(Cf=void 0;e;){const i=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(n){t||(t=n)}e=i}}if(t)throw t}function oS(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function aS(t){let e,i=t.depsTail,n=i;for(;n;){const r=n.prevDep;n.version===-1?(n===i&&(i=r),Rv(n),vF(n)):e=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=r}t.deps=e,t.depsTail=i}function Iv(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(lS(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function lS(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===Df)||(t.globalVersion=Df,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!Iv(t))))return;t.flags|=2;const e=t.dep,i=vn,n=Fo;vn=t,Fo=!0;try{oS(t);const r=t.fn(t._value);(e.version===0||Zl(r,t._value))&&(t.flags|=128,t._value=r,e.version++)}catch(r){throw e.version++,r}finally{vn=i,Fo=n,aS(t),t.flags&=-3}}function Rv(t,e=!1){const{dep:i,prevSub:n,nextSub:r}=t;if(n&&(n.nextSub=r,t.prevSub=void 0),r&&(r.prevSub=n,t.nextSub=void 0),i.subs===t&&(i.subs=n,!n&&i.computed)){i.computed.flags&=-5;for(let s=i.computed.deps;s;s=s.nextDep)Rv(s,!0)}!e&&!--i.sc&&i.map&&i.map.delete(i.key)}function vF(t){const{prevDep:e,nextDep:i}=t;e&&(e.nextDep=i,t.prevDep=void 0),i&&(i.prevDep=e,t.nextDep=void 0)}let Fo=!0;const uS=[];function aa(){uS.push(Fo),Fo=!1}function la(){const t=uS.pop();Fo=t===void 0?!0:t}function cS(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const i=vn;vn=void 0;try{e()}finally{vn=i}}}let Df=0;class bF{constructor(e,i){this.sub=e,this.dep=i,this.version=i.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Ov{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(e){if(!vn||!Fo||vn===this.computed)return;let i=this.activeLink;if(i===void 0||i.sub!==vn)i=this.activeLink=new bF(vn,this),vn.deps?(i.prevDep=vn.depsTail,vn.depsTail.nextDep=i,vn.depsTail=i):vn.deps=vn.depsTail=i,dS(i);else if(i.version===-1&&(i.version=this.version,i.nextDep)){const n=i.nextDep;n.prevDep=i.prevDep,i.prevDep&&(i.prevDep.nextDep=n),i.prevDep=vn.depsTail,i.nextDep=void 0,vn.depsTail.nextDep=i,vn.depsTail=i,vn.deps===i&&(vn.deps=n)}return i}trigger(e){this.version++,Df++,this.notify(e)}notify(e){Pv();try{for(let i=this.subs;i;i=i.prevSub)i.sub.notify()&&i.sub.dep.notify()}finally{kv()}}}function dS(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let n=e.deps;n;n=n.nextDep)dS(n)}const i=t.dep.subs;i!==t&&(t.prevSub=i,i&&(i.nextSub=t)),t.dep.subs=t}}const Lv=new WeakMap,ic=Symbol(""),Mv=Symbol(""),Pf=Symbol("");function Kr(t,e,i){if(Fo&&vn){let n=Lv.get(t);n||Lv.set(t,n=new Map);let r=n.get(i);r||(n.set(i,r=new Ov),r.map=n,r.key=i),r.track()}}function el(t,e,i,n,r,s){const o=Lv.get(t);if(!o){Df++;return}const u=h=>{h&&h.trigger()};if(Pv(),e==="clear")o.forEach(u);else{const h=Jt(t),p=h&&Ev(i);if(h&&i==="length"){const g=Number(n);o.forEach((y,S)=>{(S==="length"||S===Pf||!$a(S)&&S>=g)&&u(y)})}else switch((i!==void 0||o.has(void 0))&&u(o.get(i)),p&&u(o.get(Pf)),e){case"add":h?p&&u(o.get("length")):(u(o.get(ic)),pd(t)&&u(o.get(Mv)));break;case"delete":h||(u(o.get(ic)),pd(t)&&u(o.get(Mv)));break;case"set":pd(t)&&u(o.get(ic));break}}kv()}function md(t){const e=Pi(t);return e===t?e:(Kr(e,"iterate",Pf),go(t)?e:e.map(Ir))}function ig(t){return Kr(t=Pi(t),"iterate",Pf),t}const _F={__proto__:null,[Symbol.iterator](){return Fv(this,Symbol.iterator,Ir)},concat(...t){return md(this).concat(...t.map(e=>Jt(e)?md(e):e))},entries(){return Fv(this,"entries",t=>(t[1]=Ir(t[1]),t))},every(t,e){return tl(this,"every",t,e,void 0,arguments)},filter(t,e){return tl(this,"filter",t,e,i=>i.map(Ir),arguments)},find(t,e){return tl(this,"find",t,e,Ir,arguments)},findIndex(t,e){return tl(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return tl(this,"findLast",t,e,Ir,arguments)},findLastIndex(t,e){return tl(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return tl(this,"forEach",t,e,void 0,arguments)},includes(...t){return Nv(this,"includes",t)},indexOf(...t){return Nv(this,"indexOf",t)},join(t){return md(this).join(t)},lastIndexOf(...t){return Nv(this,"lastIndexOf",t)},map(t,e){return tl(this,"map",t,e,void 0,arguments)},pop(){return kf(this,"pop")},push(...t){return kf(this,"push",t)},reduce(t,...e){return hS(this,"reduce",t,e)},reduceRight(t,...e){return hS(this,"reduceRight",t,e)},shift(){return kf(this,"shift")},some(t,e){return tl(this,"some",t,e,void 0,arguments)},splice(...t){return kf(this,"splice",t)},toReversed(){return md(this).toReversed()},toSorted(t){return md(this).toSorted(t)},toSpliced(...t){return md(this).toSpliced(...t)},unshift(...t){return kf(this,"unshift",t)},values(){return Fv(this,"values",Ir)}};function Fv(t,e,i){const n=ig(t),r=n[e]();return n!==t&&!go(t)&&(r._next=r.next,r.next=()=>{const s=r._next();return s.value&&(s.value=i(s.value)),s}),r}const wF=Array.prototype;function tl(t,e,i,n,r,s){const o=ig(t),u=o!==t&&!go(t),h=o[e];if(h!==wF[e]){const y=h.apply(t,s);return u?Ir(y):y}let p=i;o!==t&&(u?p=function(y,S){return i.call(this,Ir(y),S,t)}:i.length>2&&(p=function(y,S){return i.call(this,y,S,t)}));const g=h.call(o,p,n);return u&&r?r(g):g}function hS(t,e,i,n){const r=ig(t);let s=i;return r!==t&&(go(t)?i.length>3&&(s=function(o,u,h){return i.call(this,o,u,h,t)}):s=function(o,u,h){return i.call(this,o,Ir(u),h,t)}),r[e](s,...n)}function Nv(t,e,i){const n=Pi(t);Kr(n,"iterate",Pf);const r=n[e](...i);return(r===-1||r===!1)&&Hv(i[0])?(i[0]=Pi(i[0]),n[e](...i)):r}function kf(t,e,i=[]){aa(),Pv();const n=Pi(t)[e].apply(t,i);return kv(),la(),n}const TF=Gi("__proto__,__v_isRef,__isVue"),fS=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter($a));function xF(t){$a(t)||(t=String(t));const e=Pi(this);return Kr(e,"has",t),e.hasOwnProperty(t)}class pS{constructor(e=!1,i=!1){this._isReadonly=e,this._isShallow=i}get(e,i,n){if(i==="__v_skip")return e.__v_skip;const r=this._isReadonly,s=this._isShallow;if(i==="__v_isReactive")return!r;if(i==="__v_isReadonly")return r;if(i==="__v_isShallow")return s;if(i==="__v_raw")return n===(r?s?_S:bS:s?vS:yS).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const o=Jt(e);if(!r){let h;if(o&&(h=_F[i]))return h;if(i==="hasOwnProperty")return xF}const u=Reflect.get(e,i,br(e)?e:n);return($a(i)?fS.has(i):TF(i))||(r||Kr(e,"get",i),s)?u:br(u)?o&&Ev(i)?u:u.value:Sn(u)?r?wS(u):If(u):u}}class mS extends pS{constructor(e=!1){super(!1,e)}set(e,i,n,r){let s=e[i];if(!this._isShallow){const h=Ql(s);if(!go(n)&&!Ql(n)&&(s=Pi(s),n=Pi(n)),!Jt(e)&&br(s)&&!br(n))return h?!1:(s.value=n,!0)}const o=Jt(e)&&Ev(i)?Number(i)t,ng=t=>Reflect.getPrototypeOf(t);function DF(t,e,i){return function(...n){const r=this.__v_raw,s=Pi(r),o=pd(s),u=t==="entries"||t===Symbol.iterator&&o,h=t==="keys"&&o,p=r[t](...n),g=i?Bv:e?ag:Ir;return!e&&Kr(s,"iterate",h?Mv:ic),{next(){const{value:y,done:S}=p.next();return S?{value:y,done:S}:{value:u?[g(y[0]),g(y[1])]:g(y),done:S}},[Symbol.iterator](){return this}}}}function rg(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function PF(t,e){const i={get(r){const s=this.__v_raw,o=Pi(s),u=Pi(r);t||(Zl(r,u)&&Kr(o,"get",r),Kr(o,"get",u));const{has:h}=ng(o),p=e?Bv:t?ag:Ir;if(h.call(o,r))return p(s.get(r));if(h.call(o,u))return p(s.get(u));s!==o&&s.get(r)},get size(){const r=this.__v_raw;return!t&&Kr(Pi(r),"iterate",ic),Reflect.get(r,"size",r)},has(r){const s=this.__v_raw,o=Pi(s),u=Pi(r);return t||(Zl(r,u)&&Kr(o,"has",r),Kr(o,"has",u)),r===u?s.has(r):s.has(r)||s.has(u)},forEach(r,s){const o=this,u=o.__v_raw,h=Pi(u),p=e?Bv:t?ag:Ir;return!t&&Kr(h,"iterate",ic),u.forEach((g,y)=>r.call(s,p(g),p(y),o))}};return hr(i,t?{add:rg("add"),set:rg("set"),delete:rg("delete"),clear:rg("clear")}:{add(r){!e&&!go(r)&&!Ql(r)&&(r=Pi(r));const s=Pi(this);return ng(s).has.call(s,r)||(s.add(r),el(s,"add",r,r)),this},set(r,s){!e&&!go(s)&&!Ql(s)&&(s=Pi(s));const o=Pi(this),{has:u,get:h}=ng(o);let p=u.call(o,r);p||(r=Pi(r),p=u.call(o,r));const g=h.call(o,r);return o.set(r,s),p?Zl(s,g)&&el(o,"set",r,s):el(o,"add",r,s),this},delete(r){const s=Pi(this),{has:o,get:u}=ng(s);let h=o.call(s,r);h||(r=Pi(r),h=o.call(s,r)),u&&u.call(s,r);const p=s.delete(r);return h&&el(s,"delete",r,void 0),p},clear(){const r=Pi(this),s=r.size!==0,o=r.clear();return s&&el(r,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(r=>{i[r]=DF(r,t,e)}),i}function sg(t,e){const i=PF(t,e);return(n,r,s)=>r==="__v_isReactive"?!t:r==="__v_isReadonly"?t:r==="__v_raw"?n:Reflect.get(Zi(i,r)&&r in n?i:n,r,s)}const kF={get:sg(!1,!1)},IF={get:sg(!1,!0)},RF={get:sg(!0,!1)},OF={get:sg(!0,!0)},yS=new WeakMap,vS=new WeakMap,bS=new WeakMap,_S=new WeakMap;function LF(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function MF(t){return t.__v_skip||!Object.isExtensible(t)?0:LF(aF(t))}function If(t){return Ql(t)?t:og(t,!1,SF,kF,yS)}function FF(t){return og(t,!1,CF,IF,vS)}function wS(t){return og(t,!0,EF,RF,bS)}function xle(t){return og(t,!0,AF,OF,_S)}function og(t,e,i,n,r){if(!Sn(t)||t.__v_raw&&!(e&&t.__v_isReactive))return t;const s=MF(t);if(s===0)return t;const o=r.get(t);if(o)return o;const u=new Proxy(t,s===2?n:i);return r.set(t,u),u}function gd(t){return Ql(t)?gd(t.__v_raw):!!(t&&t.__v_isReactive)}function Ql(t){return!!(t&&t.__v_isReadonly)}function go(t){return!!(t&&t.__v_isShallow)}function Hv(t){return t?!!t.__v_raw:!1}function Pi(t){const e=t&&t.__v_raw;return e?Pi(e):t}function NF(t){return!Zi(t,"__v_skip")&&Object.isExtensible(t)&&Qx(t,"__v_skip",!0),t}const Ir=t=>Sn(t)?If(t):t,ag=t=>Sn(t)?wS(t):t;function br(t){return t?t.__v_isRef===!0:!1}function BF(t){return TS(t,!1)}function HF(t){return TS(t,!0)}function TS(t,e){return br(t)?t:new UF(t,e)}class UF{constructor(e,i){this.dep=new Ov,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=i?e:Pi(e),this._value=i?e:Ir(e),this.__v_isShallow=i}get value(){return this.dep.track(),this._value}set value(e){const i=this._rawValue,n=this.__v_isShallow||go(e)||Ql(e);e=n?e:Pi(e),Zl(e,i)&&(this._rawValue=e,this._value=n?e:Ir(e),this.dep.trigger())}}function zF(t){return br(t)?t.value:t}const VF={get:(t,e,i)=>e==="__v_raw"?t:zF(Reflect.get(t,e,i)),set:(t,e,i,n)=>{const r=t[e];return br(r)&&!br(i)?(r.value=i,!0):Reflect.set(t,e,i,n)}};function xS(t){return gd(t)?t:new Proxy(t,VF)}class jF{constructor(e,i,n){this.fn=e,this.setter=i,this._value=void 0,this.dep=new Ov(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Df-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!i,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&vn!==this)return sS(this,!0),!0}get value(){const e=this.dep.track();return lS(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function WF(t,e,i=!1){let n,r;return ui(t)?n=t:(n=t.get,r=t.set),new jF(n,r,i)}const lg={},ug=new WeakMap;let nc;function qF(t,e=!1,i=nc){if(i){let n=ug.get(i);n||ug.set(i,n=[]),n.push(t)}}function GF(t,e,i=Zt){const{immediate:n,deep:r,once:s,scheduler:o,augmentJob:u,call:h}=i,p=J=>r?J:go(J)||r===!1||r===0?il(J,1):il(J);let g,y,S,P,R=!1,k=!1;if(br(t)?(y=()=>t.value,R=go(t)):gd(t)?(y=()=>p(t),R=!0):Jt(t)?(k=!0,R=t.some(J=>gd(J)||go(J)),y=()=>t.map(J=>{if(br(J))return J.value;if(gd(J))return p(J);if(ui(J))return h?h(J,2):J()})):ui(t)?e?y=h?()=>h(t,2):t:y=()=>{if(S){aa();try{S()}finally{la()}}const J=nc;nc=g;try{return h?h(t,3,[P]):t(P)}finally{nc=J}}:y=Xs,e&&r){const J=y,ae=r===!0?1/0:r;y=()=>il(J(),ae)}const M=yF(),L=()=>{g.stop(),M&&M.active&&Sv(M.effects,g)};if(s&&e){const J=e;e=(...ae)=>{J(...ae),L()}}let q=k?new Array(t.length).fill(lg):lg;const Z=J=>{if(!(!(g.flags&1)||!g.dirty&&!J))if(e){const ae=g.run();if(r||R||(k?ae.some((ye,pe)=>Zl(ye,q[pe])):Zl(ae,q))){S&&S();const ye=nc;nc=g;try{const pe=[ae,q===lg?void 0:k&&q[0]===lg?[]:q,P];q=ae,h?h(e,3,pe):e(...pe)}finally{nc=ye}}}else g.run()};return u&&u(Z),g=new nS(y),g.scheduler=o?()=>o(Z,!1):Z,P=J=>qF(J,!1,g),S=g.onStop=()=>{const J=ug.get(g);if(J){if(h)h(J,4);else for(const ae of J)ae();ug.delete(g)}},e?n?Z(!0):q=g.run():o?o(Z.bind(null,!0),!0):g.run(),L.pause=g.pause.bind(g),L.resume=g.resume.bind(g),L.stop=L,L}function il(t,e=1/0,i){if(e<=0||!Sn(t)||t.__v_skip||(i=i||new Set,i.has(t)))return t;if(i.add(t),e--,br(t))il(t.value,e,i);else if(Jt(t))for(let n=0;n{il(n,e,i)});else if(Zx(t)){for(const n in t)il(t[n],e,i);for(const n of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,n)&&il(t[n],e,i)}return t}/** * @vue/runtime-core v3.5.16 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/const Rf=[];let Uv=!1;function Sle(t,...e){if(Uv)return;Uv=!0,aa();const i=Rf.length?Rf[Rf.length-1].component:null,n=i&&i.appContext.config.warnHandler,r=KF();if(n)yd(n,i,11,[t+e.map(s=>{var o,u;return(u=(o=s.toString)==null?void 0:o.call(s))!=null?u:JSON.stringify(s)}).join(""),i&&i.proxy,r.map(({vnode:s})=>`at <${PE(i,s.type)}>`).join(` `),r]);else{const s=[`[Vue warn]: ${t}`,...e];r.length&&s.push(` `,...YF(r)),console.warn(...s)}la(),Uv=!1}function KF(){let t=Rf[Rf.length-1];if(!t)return[];const e=[];for(;t;){const i=e[0];i&&i.vnode===t?i.recurseCount++:e.push({vnode:t,recurseCount:0});const n=t.component&&t.component.parent;t=n&&n.vnode}return e}function YF(t){const e=[];return t.forEach((i,n)=>{e.push(...n===0?[]:[` `],...XF(i))}),e}function XF({vnode:t,recurseCount:e}){const i=e>0?`... (${e} recursive calls)`:"",n=t.component?t.component.parent==null:!1,r=` at <${PE(t.component,t.type,n)}`,s=">"+i;return t.props?[r,...ZF(t.props),s]:[r+s]}function ZF(t){const e=[],i=Object.keys(t);return i.slice(0,3).forEach(n=>{e.push(...SS(n,t[n]))}),i.length>3&&e.push(" ..."),e}function SS(t,e,i){return In(e)?(e=JSON.stringify(e),i?e:[`${t}=${e}`]):typeof e=="number"||typeof e=="boolean"||e==null?i?e:[`${t}=${e}`]:br(e)?(e=SS(t,Pi(e.value),!0),i?e:[`${t}=Ref<`,e,">"]):ui(e)?[`${t}=fn${e.name?`<${e.name}>`:""}`]:(e=Pi(e),i?e:[`${t}=`,e])}function yd(t,e,i,n){try{return n?t(...n):t()}catch(r){cg(r,e,i)}}function No(t,e,i,n){if(ui(t)){const r=yd(t,e,i,n);return r&&Yx(r)&&r.catch(s=>{cg(s,e,i)}),r}if(Jt(t)){const r=[];for(let s=0;s>>1,r=os[n],s=Of(r);s=Of(i)?os.push(t):os.splice($F(e),0,t),t.flags|=1,CS()}}function CS(){dg||(dg=ES.then(PS))}function eN(t){Jt(t)?vd.push(...t):Jl&&t.id===-1?Jl.splice(bd+1,0,t):t.flags&1||(vd.push(t),t.flags|=1),CS()}function AS(t,e,i=ua+1){for(;iOf(i)-Of(n));if(vd.length=0,Jl){Jl.push(...e);return}for(Jl=e,bd=0;bdt.id==null?t.flags&2?-1:1/0:t.id;function PS(t){try{for(ua=0;ua{n._d&&wE(-1);const s=hg(e);let o;try{o=t(...r)}finally{hg(s),n._d&&wE(1)}return o};return n._n=!0,n._c=!0,n._d=!0,n}function dn(t,e){if(_r===null)return t;const i=Eg(_r),n=t.dirs||(t.dirs=[]);for(let r=0;rt.__isTeleport,Lf=t=>t&&(t.disabled||t.disabled===""),OS=t=>t&&(t.defer||t.defer===""),LS=t=>typeof SVGElement<"u"&&t instanceof SVGElement,MS=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,Vv=(t,e)=>{const i=t&&t.to;return In(i)?e?e(i):null:i},FS={name:"Teleport",__isTeleport:!0,process(t,e,i,n,r,s,o,u,h,p){const{mc:g,pc:y,pbc:S,o:{insert:P,querySelector:R,createText:k,createComment:M}}=p,L=Lf(e.props);let{shapeFlag:q,children:Z,dynamicChildren:J}=e;if(t==null){const ae=e.el=k(""),ye=e.anchor=k("");P(ae,i,n),P(ye,i,n);const pe=(ze,tt)=>{q&16&&(r&&r.isCE&&(r.ce._teleportTarget=ze),g(Z,ze,tt,r,s,o,u,h))},le=()=>{const ze=e.target=Vv(e.props,R),tt=NS(ze,e,k,P);ze&&(o!=="svg"&&LS(ze)?o="svg":o!=="mathml"&&MS(ze)&&(o="mathml"),L||(pe(ze,tt),pg(e,!1)))};L&&(pe(i,ye),pg(e,!0)),OS(e.props)?(e.el.__isMounted=!1,ls(()=>{le(),delete e.el.__isMounted},s)):le()}else{if(OS(e.props)&&t.el.__isMounted===!1){ls(()=>{FS.process(t,e,i,n,r,s,o,u,h,p)},s);return}e.el=t.el,e.targetStart=t.targetStart;const ae=e.anchor=t.anchor,ye=e.target=t.target,pe=e.targetAnchor=t.targetAnchor,le=Lf(t.props),ze=le?i:ye,tt=le?ae:pe;if(o==="svg"||LS(ye)?o="svg":(o==="mathml"||MS(ye))&&(o="mathml"),J?(S(t.dynamicChildren,J,ze,r,s,o,u),rb(t,e,!0)):h||y(t,e,ze,tt,r,s,o,u,!1),L)le?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):fg(e,i,ae,p,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const ot=e.target=Vv(e.props,R);ot&&fg(e,ot,null,p,0)}else le&&fg(e,ye,pe,p,1);pg(e,L)}},remove(t,e,i,{um:n,o:{remove:r}},s){const{shapeFlag:o,children:u,anchor:h,targetStart:p,targetAnchor:g,target:y,props:S}=t;if(y&&(r(p),r(g)),s&&r(h),o&16){const P=s||!Lf(S);for(let R=0;R{t.isMounted=!0}),KS(()=>{t.isUnmounting=!0}),t}const yo=[Function,Array],HS={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:yo,onEnter:yo,onAfterEnter:yo,onEnterCancelled:yo,onBeforeLeave:yo,onLeave:yo,onAfterLeave:yo,onLeaveCancelled:yo,onBeforeAppear:yo,onAppear:yo,onAfterAppear:yo,onAppearCancelled:yo},US=t=>{const e=t.subTree;return e.component?US(e.component):e},nN={name:"BaseTransition",props:HS,setup(t,{slots:e}){const i=lc(),n=BS();return()=>{const r=e.default&&Wv(e.default(),!0);if(!r||!r.length)return;const s=zS(r),o=Pi(t),{mode:u}=o;if(n.isLeaving)return jv(s);const h=jS(s);if(!h)return jv(s);let p=Mf(h,o,n,i,y=>p=y);h.type!==Xr&&sc(h,p);let g=i.subTree&&jS(i.subTree);if(g&&g.type!==Xr&&!ac(h,g)&&US(i).type!==Xr){let y=Mf(g,o,n,i);if(sc(g,y),u==="out-in"&&h.type!==Xr)return n.isLeaving=!0,y.afterLeave=()=>{n.isLeaving=!1,i.job.flags&8||i.update(),delete y.afterLeave,g=void 0},jv(s);u==="in-out"&&h.type!==Xr?y.delayLeave=(S,P,R)=>{const k=VS(n,g);k[String(g.key)]=g,S[$l]=()=>{P(),S[$l]=void 0,delete p.delayedLeave,g=void 0},p.delayedLeave=()=>{R(),delete p.delayedLeave,g=void 0}}:g=void 0}else g&&(g=void 0);return s}}};function zS(t){let e=t[0];if(t.length>1){for(const i of t)if(i.type!==Xr){e=i;break}}return e}const rN=nN;function VS(t,e){const{leavingVNodes:i}=t;let n=i.get(e.type);return n||(n=Object.create(null),i.set(e.type,n)),n}function Mf(t,e,i,n,r){const{appear:s,mode:o,persisted:u=!1,onBeforeEnter:h,onEnter:p,onAfterEnter:g,onEnterCancelled:y,onBeforeLeave:S,onLeave:P,onAfterLeave:R,onLeaveCancelled:k,onBeforeAppear:M,onAppear:L,onAfterAppear:q,onAppearCancelled:Z}=e,J=String(t.key),ae=VS(i,t),ye=(ze,tt)=>{ze&&No(ze,n,9,tt)},pe=(ze,tt)=>{const ot=tt[1];ye(ze,tt),Jt(ze)?ze.every(qe=>qe.length<=1)&&ot():ze.length<=1&&ot()},le={mode:o,persisted:u,beforeEnter(ze){let tt=h;if(!i.isMounted)if(s)tt=M||h;else return;ze[$l]&&ze[$l](!0);const ot=ae[J];ot&&ac(t,ot)&&ot.el[$l]&&ot.el[$l](),ye(tt,[ze])},enter(ze){let tt=p,ot=g,qe=y;if(!i.isMounted)if(s)tt=L||p,ot=q||g,qe=Z||y;else return;let at=!1;const Pt=ze[mg]=ci=>{at||(at=!0,ci?ye(qe,[ze]):ye(ot,[ze]),le.delayedLeave&&le.delayedLeave(),ze[mg]=void 0)};tt?pe(tt,[ze,Pt]):Pt()},leave(ze,tt){const ot=String(t.key);if(ze[mg]&&ze[mg](!0),i.isUnmounting)return tt();ye(S,[ze]);let qe=!1;const at=ze[$l]=Pt=>{qe||(qe=!0,tt(),Pt?ye(k,[ze]):ye(R,[ze]),ze[$l]=void 0,ae[ot]===t&&delete ae[ot])};ae[ot]=t,P?pe(P,[ze,at]):at()},clone(ze){const tt=Mf(ze,e,i,n,r);return r&&r(tt),tt}};return le}function jv(t){if(yg(t))return t=eu(t),t.children=null,t}function jS(t){if(!yg(t))return RS(t.type)&&t.children?zS(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:e,children:i}=t;if(i){if(e&16)return i[0];if(e&32&&ui(i.default))return i.default()}}function sc(t,e){t.shapeFlag&6&&t.component?(t.transition=e,sc(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function Wv(t,e=!1,i){let n=[],r=0;for(let s=0;s1)for(let s=0;sgg(R,e&&(Jt(e)?e[k]:e),i,n,r));return}if(_d(n)&&!r){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&gg(t,e,i,n.component.subTree);return}const s=n.shapeFlag&4?Eg(n.component):n.el,o=r?null:s,{i:u,r:h}=t,p=e&&e.r,g=u.refs===Zt?u.refs={}:u.refs,y=u.setupState,S=Pi(y),P=y===Zt?()=>!1:R=>Zi(S,R);if(p!=null&&p!==h&&(In(p)?(g[p]=null,P(p)&&(y[p]=null)):br(p)&&(p.value=null)),ui(h))yd(h,u,12,[o,g]);else{const R=In(h),k=br(h);if(R||k){const M=()=>{if(t.f){const L=R?P(h)?y[h]:g[h]:h.value;r?Jt(L)&&Sv(L,s):Jt(L)?L.includes(s)||L.push(s):R?(g[h]=[s],P(h)&&(y[h]=g[h])):(h.value=[s],t.k&&(g[t.k]=h.value))}else R?(g[h]=o,P(h)&&(y[h]=o)):k&&(h.value=o,t.k&&(g[t.k]=o))};o?(M.id=-1,ls(M,i)):M()}}}tg().requestIdleCallback,tg().cancelIdleCallback;const _d=t=>!!t.type.__asyncLoader,yg=t=>t.type.__isKeepAlive;function sN(t,e){qS(t,"a",e)}function oN(t,e){qS(t,"da",e)}function qS(t,e,i=Rr){const n=t.__wdc||(t.__wdc=()=>{let r=i;for(;r;){if(r.isDeactivated)return;r=r.parent}return t()});if(vg(e,n,i),i){let r=i.parent;for(;r&&r.parent;)yg(r.parent.vnode)&&aN(n,e,i,r),r=r.parent}}function aN(t,e,i,n){const r=vg(e,t,n,!0);Kv(()=>{Sv(n[e],r)},i)}function vg(t,e,i=Rr,n=!1){if(i){const r=i[t]||(i[t]=[]),s=e.__weh||(e.__weh=(...o)=>{aa();const u=jf(i),h=No(e,i,t,o);return u(),la(),h});return n?r.unshift(s):r.push(s),s}}const nl=t=>(e,i=Rr)=>{(!Wf||t==="sp")&&vg(t,(...n)=>e(...n),i)},lN=nl("bm"),Gv=nl("m"),uN=nl("bu"),GS=nl("u"),KS=nl("bum"),Kv=nl("um"),cN=nl("sp"),dN=nl("rtg"),hN=nl("rtc");function fN(t,e=Rr){vg("ec",t,e)}const Yv="components",pN="directives";function Mt(t,e){return Xv(Yv,t,!0,e)||t}const YS=Symbol.for("v-ndc");function fr(t){return In(t)?Xv(Yv,t,!1)||t:t||YS}function Yr(t){return Xv(pN,t)}function Xv(t,e,i=!0,n=!1){const r=_r||Rr;if(r){const s=r.type;if(t===Yv){const u=DE(s,!1);if(u&&(u===e||u===mo(e)||u===Jm(mo(e))))return s}const o=XS(r[t]||s[t],e)||XS(r.appContext[t],e);return!o&&n?s:o}}function XS(t,e){return t&&(t[e]||t[mo(e)]||t[Jm(mo(e))])}function Kt(t,e,i,n){let r;const s=i,o=Jt(t);if(o||In(t)){const u=o&&gd(t);let h=!1,p=!1;u&&(h=!go(t),p=Ql(t),t=ig(t)),r=new Array(t.length);for(let g=0,y=t.length;ge(u,h,void 0,s));else{const u=Object.keys(t);r=new Array(u.length);for(let h=0,p=u.length;h{const s=n.fn(...r);return s&&(s.key=n.key),s}:n.fn)}return t}function pi(t,e,i={},n,r){if(_r.ce||_r.parent&&_d(_r.parent)&&_r.parent.ce)return e!=="default"&&(i.name=e),X(),gt(ct,null,[xt("slot",i,n&&n())],64);let s=t[e];s&&s._c&&(s._d=!1),X();const o=s&&ZS(s(i)),u=i.key||o&&o.key,h=gt(ct,{key:(u&&!$a(u)?u:`_${e}`)+(!o&&n?"_fb":"")},o||(n?n():[]),o&&t._===1?64:-2);return h.scopeId&&(h.slotScopeIds=[h.scopeId+"-s"]),s&&s._c&&(s._d=!0),h}function ZS(t){return t.some(e=>Vf(e)?!(e.type===Xr||e.type===ct&&!ZS(e.children)):!0)?t:null}function _g(t,e){const i={};for(const n in t)i[$m(n)]=t[n];return i}const Zv=t=>t?EE(t)?Eg(t):Zv(t.parent):null,Ff=hr(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>Zv(t.parent),$root:t=>Zv(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>eE(t),$forceUpdate:t=>t.f||(t.f=()=>{zv(t.update)}),$nextTick:t=>t.n||(t.n=JF.bind(t.proxy)),$watch:t=>FN.bind(t)}),Qv=(t,e)=>t!==Zt&&!t.__isScriptSetup&&Zi(t,e),mN={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:i,setupState:n,data:r,props:s,accessCache:o,type:u,appContext:h}=t;let p;if(e[0]!=="$"){const P=o[e];if(P!==void 0)switch(P){case 1:return n[e];case 2:return r[e];case 4:return i[e];case 3:return s[e]}else{if(Qv(n,e))return o[e]=1,n[e];if(r!==Zt&&Zi(r,e))return o[e]=2,r[e];if((p=t.propsOptions[0])&&Zi(p,e))return o[e]=3,s[e];if(i!==Zt&&Zi(i,e))return o[e]=4,i[e];Jv&&(o[e]=0)}}const g=Ff[e];let y,S;if(g)return e==="$attrs"&&Kr(t.attrs,"get",""),g(t);if((y=u.__cssModules)&&(y=y[e]))return y;if(i!==Zt&&Zi(i,e))return o[e]=4,i[e];if(S=h.config.globalProperties,Zi(S,e))return S[e]},set({_:t},e,i){const{data:n,setupState:r,ctx:s}=t;return Qv(r,e)?(r[e]=i,!0):n!==Zt&&Zi(n,e)?(n[e]=i,!0):Zi(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(s[e]=i,!0)},has({_:{data:t,setupState:e,accessCache:i,ctx:n,appContext:r,propsOptions:s}},o){let u;return!!i[o]||t!==Zt&&Zi(t,o)||Qv(e,o)||(u=s[0])&&Zi(u,o)||Zi(n,o)||Zi(Ff,o)||Zi(r.config.globalProperties,o)},defineProperty(t,e,i){return i.get!=null?t._.accessCache[e]=0:Zi(i,"value")&&this.set(t,e,i.value,null),Reflect.defineProperty(t,e,i)}};function QS(t){return Jt(t)?t.reduce((e,i)=>(e[i]=null,e),{}):t}let Jv=!0;function gN(t){const e=eE(t),i=t.proxy,n=t.ctx;Jv=!1,e.beforeCreate&&JS(e.beforeCreate,t,"bc");const{data:r,computed:s,methods:o,watch:u,provide:h,inject:p,created:g,beforeMount:y,mounted:S,beforeUpdate:P,updated:R,activated:k,deactivated:M,beforeDestroy:L,beforeUnmount:q,destroyed:Z,unmounted:J,render:ae,renderTracked:ye,renderTriggered:pe,errorCaptured:le,serverPrefetch:ze,expose:tt,inheritAttrs:ot,components:qe,directives:at,filters:Pt}=e;if(p&&yN(p,n,null),o)for(const Nt in o){const Wt=o[Nt];ui(Wt)&&(n[Nt]=Wt.bind(i))}if(r){const Nt=r.call(i,i);Sn(Nt)&&(t.data=If(Nt))}if(Jv=!0,s)for(const Nt in s){const Wt=s[Nt],wi=ui(Wt)?Wt.bind(i,i):ui(Wt.get)?Wt.get.bind(i,i):Xs,Et=!ui(Wt)&&ui(Wt.set)?Wt.set.bind(i):Xs,ii=uc({get:wi,set:Et});Object.defineProperty(n,Nt,{enumerable:!0,configurable:!0,get:()=>ii.value,set:Ii=>ii.value=Ii})}if(u)for(const Nt in u)$S(u[Nt],n,i,Nt);if(h){const Nt=ui(h)?h.call(i):h;Reflect.ownKeys(Nt).forEach(Wt=>{xN(Wt,Nt[Wt])})}g&&JS(g,t,"c");function Ct(Nt,Wt){Jt(Wt)?Wt.forEach(wi=>Nt(wi.bind(i))):Wt&&Nt(Wt.bind(i))}if(Ct(lN,y),Ct(Gv,S),Ct(uN,P),Ct(GS,R),Ct(sN,k),Ct(oN,M),Ct(fN,le),Ct(hN,ye),Ct(dN,pe),Ct(KS,q),Ct(Kv,J),Ct(cN,ze),Jt(tt))if(tt.length){const Nt=t.exposed||(t.exposed={});tt.forEach(Wt=>{Object.defineProperty(Nt,Wt,{get:()=>i[Wt],set:wi=>i[Wt]=wi})})}else t.exposed||(t.exposed={});ae&&t.render===Xs&&(t.render=ae),ot!=null&&(t.inheritAttrs=ot),qe&&(t.components=qe),at&&(t.directives=at),ze&&WS(t)}function yN(t,e,i=Xs){Jt(t)&&(t=$v(t));for(const n in t){const r=t[n];let s;Sn(r)?"default"in r?s=Bf(r.from||n,r.default,!0):s=Bf(r.from||n):s=Bf(r),br(s)?Object.defineProperty(e,n,{enumerable:!0,configurable:!0,get:()=>s.value,set:o=>s.value=o}):e[n]=s}}function JS(t,e,i){No(Jt(t)?t.map(n=>n.bind(e.proxy)):t.bind(e.proxy),e,i)}function $S(t,e,i,n){let r=n.includes(".")?gE(i,n):()=>i[n];if(In(t)){const s=e[t];ui(s)&&Td(r,s)}else if(ui(t))Td(r,t.bind(i));else if(Sn(t))if(Jt(t))t.forEach(s=>$S(s,e,i,n));else{const s=ui(t.handler)?t.handler.bind(i):e[t.handler];ui(s)&&Td(r,s,t)}}function eE(t){const e=t.type,{mixins:i,extends:n}=e,{mixins:r,optionsCache:s,config:{optionMergeStrategies:o}}=t.appContext,u=s.get(e);let h;return u?h=u:!r.length&&!i&&!n?h=e:(h={},r.length&&r.forEach(p=>wg(h,p,o,!0)),wg(h,e,o)),Sn(e)&&s.set(e,h),h}function wg(t,e,i,n=!1){const{mixins:r,extends:s}=e;s&&wg(t,s,i,!0),r&&r.forEach(o=>wg(t,o,i,!0));for(const o in e)if(!(n&&o==="expose")){const u=vN[o]||i&&i[o];t[o]=u?u(t[o],e[o]):e[o]}return t}const vN={data:tE,props:iE,emits:iE,methods:Nf,computed:Nf,beforeCreate:as,created:as,beforeMount:as,mounted:as,beforeUpdate:as,updated:as,beforeDestroy:as,beforeUnmount:as,destroyed:as,unmounted:as,activated:as,deactivated:as,errorCaptured:as,serverPrefetch:as,components:Nf,directives:Nf,watch:_N,provide:tE,inject:bN};function tE(t,e){return e?t?function(){return hr(ui(t)?t.call(this,this):t,ui(e)?e.call(this,this):e)}:e:t}function bN(t,e){return Nf($v(t),$v(e))}function $v(t){if(Jt(t)){const e={};for(let i=0;i1)return i&&ui(e)?e.call(n&&n.proxy):e}}const rE={},sE=()=>Object.create(rE),oE=t=>Object.getPrototypeOf(t)===rE;function SN(t,e,i,n=!1){const r={},s=sE();t.propsDefaults=Object.create(null),aE(t,e,r,s);for(const o in t.propsOptions[0])o in r||(r[o]=void 0);i?t.props=n?r:FF(r):t.type.props?t.props=r:t.props=s,t.attrs=s}function EN(t,e,i,n){const{props:r,attrs:s,vnode:{patchFlag:o}}=t,u=Pi(r),[h]=t.propsOptions;let p=!1;if((n||o>0)&&!(o&16)){if(o&8){const g=t.vnode.dynamicProps;for(let y=0;y{h=!0;const[S,P]=lE(y,e,!0);hr(o,S),P&&u.push(...P)};!i&&e.mixins.length&&e.mixins.forEach(g),t.extends&&g(t.extends),t.mixins&&t.mixins.forEach(g)}if(!s&&!h)return Sn(t)&&n.set(t,kn),kn;if(Jt(s))for(let g=0;gt[0]==="_"||t==="$stable",ib=t=>Jt(t)?t.map(ca):[ca(t)],AN=(t,e,i)=>{if(e._n)return e;const n=Vt((...r)=>ib(e(...r)),i);return n._c=!1,n},cE=(t,e,i)=>{const n=t._ctx;for(const r in t){if(tb(r))continue;const s=t[r];if(ui(s))e[r]=AN(r,s,n);else if(s!=null){const o=ib(s);e[r]=()=>o}}},dE=(t,e)=>{const i=ib(e);t.slots.default=()=>i},hE=(t,e,i)=>{for(const n in e)(i||!tb(n))&&(t[n]=e[n])},DN=(t,e,i)=>{const n=t.slots=sE();if(t.vnode.shapeFlag&32){const r=e._;r?(hE(n,e,i),i&&Qx(n,"_",r,!0)):cE(e,n)}else e&&dE(t,e)},PN=(t,e,i)=>{const{vnode:n,slots:r}=t;let s=!0,o=Zt;if(n.shapeFlag&32){const u=e._;u?i&&u===1?s=!1:hE(r,e,i):(s=!e.$stable,cE(e,r)),o=e}else e&&(dE(t,e),o={default:1});if(s)for(const u in r)!tb(u)&&o[u]==null&&delete r[u]},ls=jN;function kN(t){return IN(t)}function IN(t,e){const i=tg();i.__VUE__=!0;const{insert:n,remove:r,patchProp:s,createElement:o,createText:u,createComment:h,setText:p,setElementText:g,parentNode:y,nextSibling:S,setScopeId:P=Xs,insertStaticContent:R}=t,k=(Ce,Ie,O,te=null,Ee=null,Oe=null,Q=void 0,ne=null,he=!!Ie.dynamicChildren)=>{if(Ce===Ie)return;Ce&&!ac(Ce,Ie)&&(te=Un(Ce),Ii(Ce,Ee,Oe,!0),Ce=null),Ie.patchFlag===-2&&(he=!1,Ie.dynamicChildren=null);const{type:Le,ref:nt,shapeFlag:je}=Ie;switch(Le){case Hf:M(Ce,Ie,O,te);break;case Xr:L(Ce,Ie,O,te);break;case sb:Ce==null&&q(Ie,O,te,Q);break;case ct:qe(Ce,Ie,O,te,Ee,Oe,Q,ne,he);break;default:je&1?ae(Ce,Ie,O,te,Ee,Oe,Q,ne,he):je&6?at(Ce,Ie,O,te,Ee,Oe,Q,ne,he):(je&64||je&128)&&Le.process(Ce,Ie,O,te,Ee,Oe,Q,ne,he,Si)}nt!=null&&Ee&&gg(nt,Ce&&Ce.ref,Oe,Ie||Ce,!Ie)},M=(Ce,Ie,O,te)=>{if(Ce==null)n(Ie.el=u(Ie.children),O,te);else{const Ee=Ie.el=Ce.el;Ie.children!==Ce.children&&p(Ee,Ie.children)}},L=(Ce,Ie,O,te)=>{Ce==null?n(Ie.el=h(Ie.children||""),O,te):Ie.el=Ce.el},q=(Ce,Ie,O,te)=>{[Ce.el,Ce.anchor]=R(Ce.children,Ie,O,te,Ce.el,Ce.anchor)},Z=({el:Ce,anchor:Ie},O,te)=>{let Ee;for(;Ce&&Ce!==Ie;)Ee=S(Ce),n(Ce,O,te),Ce=Ee;n(Ie,O,te)},J=({el:Ce,anchor:Ie})=>{let O;for(;Ce&&Ce!==Ie;)O=S(Ce),r(Ce),Ce=O;r(Ie)},ae=(Ce,Ie,O,te,Ee,Oe,Q,ne,he)=>{Ie.type==="svg"?Q="svg":Ie.type==="math"&&(Q="mathml"),Ce==null?ye(Ie,O,te,Ee,Oe,Q,ne,he):ze(Ce,Ie,Ee,Oe,Q,ne,he)},ye=(Ce,Ie,O,te,Ee,Oe,Q,ne)=>{let he,Le;const{props:nt,shapeFlag:je,transition:Te,dirs:Ue}=Ce;if(he=Ce.el=o(Ce.type,Oe,nt&&nt.is,nt),je&8?g(he,Ce.children):je&16&&le(Ce.children,he,null,te,Ee,nb(Ce,Oe),Q,ne),Ue&&rc(Ce,null,te,"created"),pe(he,Ce,Ce.scopeId,Q,te),nt){for(const _t in nt)_t!=="value"&&!Ef(_t)&&s(he,_t,null,nt[_t],Oe,te);"value"in nt&&s(he,"value",null,nt.value,Oe),(Le=nt.onVnodeBeforeMount)&&da(Le,te,Ce)}Ue&&rc(Ce,null,te,"beforeMount");const Ze=RN(Ee,Te);Ze&&Te.beforeEnter(he),n(he,Ie,O),((Le=nt&&nt.onVnodeMounted)||Ze||Ue)&&ls(()=>{Le&&da(Le,te,Ce),Ze&&Te.enter(he),Ue&&rc(Ce,null,te,"mounted")},Ee)},pe=(Ce,Ie,O,te,Ee)=>{if(O&&P(Ce,O),te)for(let Oe=0;Oe{for(let Le=he;Le{const ne=Ie.el=Ce.el;let{patchFlag:he,dynamicChildren:Le,dirs:nt}=Ie;he|=Ce.patchFlag&16;const je=Ce.props||Zt,Te=Ie.props||Zt;let Ue;if(O&&oc(O,!1),(Ue=Te.onVnodeBeforeUpdate)&&da(Ue,O,Ie,Ce),nt&&rc(Ie,Ce,O,"beforeUpdate"),O&&oc(O,!0),(je.innerHTML&&Te.innerHTML==null||je.textContent&&Te.textContent==null)&&g(ne,""),Le?tt(Ce.dynamicChildren,Le,ne,O,te,nb(Ie,Ee),Oe):Q||Wt(Ce,Ie,ne,null,O,te,nb(Ie,Ee),Oe,!1),he>0){if(he&16)ot(ne,je,Te,O,Ee);else if(he&2&&je.class!==Te.class&&s(ne,"class",null,Te.class,Ee),he&4&&s(ne,"style",je.style,Te.style,Ee),he&8){const Ze=Ie.dynamicProps;for(let _t=0;_t{Ue&&da(Ue,O,Ie,Ce),nt&&rc(Ie,Ce,O,"updated")},te)},tt=(Ce,Ie,O,te,Ee,Oe,Q)=>{for(let ne=0;ne{if(Ie!==O){if(Ie!==Zt)for(const Oe in Ie)!Ef(Oe)&&!(Oe in O)&&s(Ce,Oe,Ie[Oe],null,Ee,te);for(const Oe in O){if(Ef(Oe))continue;const Q=O[Oe],ne=Ie[Oe];Q!==ne&&Oe!=="value"&&s(Ce,Oe,ne,Q,Ee,te)}"value"in O&&s(Ce,"value",Ie.value,O.value,Ee)}},qe=(Ce,Ie,O,te,Ee,Oe,Q,ne,he)=>{const Le=Ie.el=Ce?Ce.el:u(""),nt=Ie.anchor=Ce?Ce.anchor:u("");let{patchFlag:je,dynamicChildren:Te,slotScopeIds:Ue}=Ie;Ue&&(ne=ne?ne.concat(Ue):Ue),Ce==null?(n(Le,O,te),n(nt,O,te),le(Ie.children||[],O,nt,Ee,Oe,Q,ne,he)):je>0&&je&64&&Te&&Ce.dynamicChildren?(tt(Ce.dynamicChildren,Te,O,Ee,Oe,Q,ne),(Ie.key!=null||Ee&&Ie===Ee.subTree)&&rb(Ce,Ie,!0)):Wt(Ce,Ie,O,nt,Ee,Oe,Q,ne,he)},at=(Ce,Ie,O,te,Ee,Oe,Q,ne,he)=>{Ie.slotScopeIds=ne,Ce==null?Ie.shapeFlag&512?Ee.ctx.activate(Ie,O,te,Q,he):Pt(Ie,O,te,Ee,Oe,Q,he):ci(Ce,Ie,he)},Pt=(Ce,Ie,O,te,Ee,Oe,Q)=>{const ne=Ce.component=XN(Ce,te,Ee);if(yg(Ce)&&(ne.ctx.renderer=Si),ZN(ne,!1,Q),ne.asyncDep){if(Ee&&Ee.registerDep(ne,Ct,Q),!Ce.el){const he=ne.subTree=xt(Xr);L(null,he,Ie,O)}}else Ct(ne,Ce,Ie,O,Ee,Oe,Q)},ci=(Ce,Ie,O)=>{const te=Ie.component=Ce.component;if(zN(Ce,Ie,O))if(te.asyncDep&&!te.asyncResolved){Nt(te,Ie,O);return}else te.next=Ie,te.update();else Ie.el=Ce.el,te.vnode=Ie},Ct=(Ce,Ie,O,te,Ee,Oe,Q)=>{const ne=()=>{if(Ce.isMounted){let{next:je,bu:Te,u:Ue,parent:Ze,vnode:_t}=Ce;{const re=fE(Ce);if(re){je&&(je.el=_t.el,Nt(Ce,je,Q)),re.asyncDep.then(()=>{Ce.isUnmounted||ne()});return}}let Ut=je,K;oc(Ce,!1),je?(je.el=_t.el,Nt(Ce,je,Q)):je=_t,Te&&eg(Te),(K=je.props&&je.props.onVnodeBeforeUpdate)&&da(K,Ze,je,_t),oc(Ce,!0);const j=vE(Ce),oe=Ce.subTree;Ce.subTree=j,k(oe,j,y(oe.el),Un(oe),Ce,Ee,Oe),je.el=j.el,Ut===null&&VN(Ce,j.el),Ue&&ls(Ue,Ee),(K=je.props&&je.props.onVnodeUpdated)&&ls(()=>da(K,Ze,je,_t),Ee)}else{let je;const{el:Te,props:Ue}=Ie,{bm:Ze,m:_t,parent:Ut,root:K,type:j}=Ce,oe=_d(Ie);oc(Ce,!1),Ze&&eg(Ze),!oe&&(je=Ue&&Ue.onVnodeBeforeMount)&&da(je,Ut,Ie),oc(Ce,!0);{K.ce&&K.ce._injectChildStyle(j);const re=Ce.subTree=vE(Ce);k(null,re,O,te,Ce,Ee,Oe),Ie.el=re.el}if(_t&&ls(_t,Ee),!oe&&(je=Ue&&Ue.onVnodeMounted)){const re=Ie;ls(()=>da(je,Ut,re),Ee)}(Ie.shapeFlag&256||Ut&&_d(Ut.vnode)&&Ut.vnode.shapeFlag&256)&&Ce.a&&ls(Ce.a,Ee),Ce.isMounted=!0,Ie=O=te=null}};Ce.scope.on();const he=Ce.effect=new nS(ne);Ce.scope.off();const Le=Ce.update=he.run.bind(he),nt=Ce.job=he.runIfDirty.bind(he);nt.i=Ce,nt.id=Ce.uid,he.scheduler=()=>zv(nt),oc(Ce,!0),Le()},Nt=(Ce,Ie,O)=>{Ie.component=Ce;const te=Ce.vnode.props;Ce.vnode=Ie,Ce.next=null,EN(Ce,Ie.props,te,O),PN(Ce,Ie.children,O),aa(),AS(Ce),la()},Wt=(Ce,Ie,O,te,Ee,Oe,Q,ne,he=!1)=>{const Le=Ce&&Ce.children,nt=Ce?Ce.shapeFlag:0,je=Ie.children,{patchFlag:Te,shapeFlag:Ue}=Ie;if(Te>0){if(Te&128){Et(Le,je,O,te,Ee,Oe,Q,ne,he);return}else if(Te&256){wi(Le,je,O,te,Ee,Oe,Q,ne,he);return}}Ue&8?(nt&16&&un(Le,Ee,Oe),je!==Le&&g(O,je)):nt&16?Ue&16?Et(Le,je,O,te,Ee,Oe,Q,ne,he):un(Le,Ee,Oe,!0):(nt&8&&g(O,""),Ue&16&&le(je,O,te,Ee,Oe,Q,ne,he))},wi=(Ce,Ie,O,te,Ee,Oe,Q,ne,he)=>{Ce=Ce||kn,Ie=Ie||kn;const Le=Ce.length,nt=Ie.length,je=Math.min(Le,nt);let Te;for(Te=0;Tent?un(Ce,Ee,Oe,!0,!1,je):le(Ie,O,te,Ee,Oe,Q,ne,he,je)},Et=(Ce,Ie,O,te,Ee,Oe,Q,ne,he)=>{let Le=0;const nt=Ie.length;let je=Ce.length-1,Te=nt-1;for(;Le<=je&&Le<=Te;){const Ue=Ce[Le],Ze=Ie[Le]=he?tu(Ie[Le]):ca(Ie[Le]);if(ac(Ue,Ze))k(Ue,Ze,O,null,Ee,Oe,Q,ne,he);else break;Le++}for(;Le<=je&&Le<=Te;){const Ue=Ce[je],Ze=Ie[Te]=he?tu(Ie[Te]):ca(Ie[Te]);if(ac(Ue,Ze))k(Ue,Ze,O,null,Ee,Oe,Q,ne,he);else break;je--,Te--}if(Le>je){if(Le<=Te){const Ue=Te+1,Ze=UeTe)for(;Le<=je;)Ii(Ce[Le],Ee,Oe,!0),Le++;else{const Ue=Le,Ze=Le,_t=new Map;for(Le=Ze;Le<=Te;Le++){const St=Ie[Le]=he?tu(Ie[Le]):ca(Ie[Le]);St.key!=null&&_t.set(St.key,Le)}let Ut,K=0;const j=Te-Ze+1;let oe=!1,re=0;const We=new Array(j);for(Le=0;Le=j){Ii(St,Ee,Oe,!0);continue}let qt;if(St.key!=null)qt=_t.get(St.key);else for(Ut=Ze;Ut<=Te;Ut++)if(We[Ut-Ze]===0&&ac(St,Ie[Ut])){qt=Ut;break}qt===void 0?Ii(St,Ee,Oe,!0):(We[qt-Ze]=Le+1,qt>=re?re=qt:oe=!0,k(St,Ie[qt],O,null,Ee,Oe,Q,ne,he),K++)}const st=oe?ON(We):kn;for(Ut=st.length-1,Le=j-1;Le>=0;Le--){const St=Ze+Le,qt=Ie[St],Bt=St+1{const{el:Oe,type:Q,transition:ne,children:he,shapeFlag:Le}=Ce;if(Le&6){ii(Ce.component.subTree,Ie,O,te);return}if(Le&128){Ce.suspense.move(Ie,O,te);return}if(Le&64){Q.move(Ce,Ie,O,Si);return}if(Q===ct){n(Oe,Ie,O);for(let je=0;jene.enter(Oe),Ee);else{const{leave:je,delayLeave:Te,afterLeave:Ue}=ne,Ze=()=>{Ce.ctx.isUnmounted?r(Oe):n(Oe,Ie,O)},_t=()=>{je(Oe,()=>{Ze(),Ue&&Ue()})};Te?Te(Oe,Ze,_t):_t()}else n(Oe,Ie,O)},Ii=(Ce,Ie,O,te=!1,Ee=!1)=>{const{type:Oe,props:Q,ref:ne,children:he,dynamicChildren:Le,shapeFlag:nt,patchFlag:je,dirs:Te,cacheIndex:Ue}=Ce;if(je===-2&&(Ee=!1),ne!=null&&(aa(),gg(ne,null,O,Ce,!0),la()),Ue!=null&&(Ie.renderCache[Ue]=void 0),nt&256){Ie.ctx.deactivate(Ce);return}const Ze=nt&1&&Te,_t=!_d(Ce);let Ut;if(_t&&(Ut=Q&&Q.onVnodeBeforeUnmount)&&da(Ut,Ie,Ce),nt&6)dt(Ce.component,O,te);else{if(nt&128){Ce.suspense.unmount(O,te);return}Ze&&rc(Ce,null,Ie,"beforeUnmount"),nt&64?Ce.type.remove(Ce,Ie,O,Si,te):Le&&!Le.hasOnce&&(Oe!==ct||je>0&&je&64)?un(Le,Ie,O,!1,!0):(Oe===ct&&je&384||!Ee&&nt&16)&&un(he,Ie,O),te&&bi(Ce)}(_t&&(Ut=Q&&Q.onVnodeUnmounted)||Ze)&&ls(()=>{Ut&&da(Ut,Ie,Ce),Ze&&rc(Ce,null,Ie,"unmounted")},O)},bi=Ce=>{const{type:Ie,el:O,anchor:te,transition:Ee}=Ce;if(Ie===ct){hn(O,te);return}if(Ie===sb){J(Ce);return}const Oe=()=>{r(O),Ee&&!Ee.persisted&&Ee.afterLeave&&Ee.afterLeave()};if(Ce.shapeFlag&1&&Ee&&!Ee.persisted){const{leave:Q,delayLeave:ne}=Ee,he=()=>Q(O,Oe);ne?ne(Ce.el,Oe,he):he()}else Oe()},hn=(Ce,Ie)=>{let O;for(;Ce!==Ie;)O=S(Ce),r(Ce),Ce=O;r(Ie)},dt=(Ce,Ie,O)=>{const{bum:te,scope:Ee,job:Oe,subTree:Q,um:ne,m:he,a:Le,parent:nt,slots:{__:je}}=Ce;pE(he),pE(Le),te&&eg(te),nt&&Jt(je)&&je.forEach(Te=>{nt.renderCache[Te]=void 0}),Ee.stop(),Oe&&(Oe.flags|=8,Ii(Q,Ce,Ie,O)),ne&&ls(ne,Ie),ls(()=>{Ce.isUnmounted=!0},Ie),Ie&&Ie.pendingBranch&&!Ie.isUnmounted&&Ce.asyncDep&&!Ce.asyncResolved&&Ce.suspenseId===Ie.pendingId&&(Ie.deps--,Ie.deps===0&&Ie.resolve())},un=(Ce,Ie,O,te=!1,Ee=!1,Oe=0)=>{for(let Q=Oe;Q{if(Ce.shapeFlag&6)return Un(Ce.component.subTree);if(Ce.shapeFlag&128)return Ce.suspense.next();const Ie=S(Ce.anchor||Ce.el),O=Ie&&Ie[IS];return O?S(O):Ie};let rn=!1;const fn=(Ce,Ie,O)=>{Ce==null?Ie._vnode&&Ii(Ie._vnode,null,null,!0):k(Ie._vnode||null,Ce,Ie,null,null,null,O),Ie._vnode=Ce,rn||(rn=!0,AS(),DS(),rn=!1)},Si={p:k,um:Ii,m:ii,r:bi,mt:Pt,mc:le,pc:Wt,pbc:tt,n:Un,o:t};return{render:fn,hydrate:void 0,createApp:TN(fn)}}function nb({type:t,props:e},i){return i==="svg"&&t==="foreignObject"||i==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:i}function oc({effect:t,job:e},i){i?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function RN(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function rb(t,e,i=!1){const n=t.children,r=e.children;if(Jt(n)&&Jt(r))for(let s=0;s>1,t[i[u]]0&&(e[n]=i[s-1]),i[s]=n)}}for(s=i.length,o=i[s-1];s-- >0;)i[s]=o,o=e[o];return i}function fE(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:fE(e)}function pE(t){if(t)for(let e=0;eBf(LN);function Td(t,e,i){return mE(t,e,i)}function mE(t,e,i=Zt){const{immediate:n,deep:r,flush:s,once:o}=i,u=hr({},i),h=e&&n||!e&&s!=="post";let p;if(Wf){if(s==="sync"){const P=MN();p=P.__watcherHandles||(P.__watcherHandles=[])}else if(!h){const P=()=>{};return P.stop=Xs,P.resume=Xs,P.pause=Xs,P}}const g=Rr;u.call=(P,R,k)=>No(P,g,R,k);let y=!1;s==="post"?u.scheduler=P=>{ls(P,g&&g.suspense)}:s!=="sync"&&(y=!0,u.scheduler=(P,R)=>{R?P():zv(P)}),u.augmentJob=P=>{e&&(P.flags|=4),y&&(P.flags|=2,g&&(P.id=g.uid,P.i=g))};const S=GF(t,e,u);return Wf&&(p?p.push(S):h&&S()),S}function FN(t,e,i){const n=this.proxy,r=In(t)?t.includes(".")?gE(n,t):()=>n[t]:t.bind(n,n);let s;ui(e)?s=e:(s=e.handler,i=e);const o=jf(this),u=mE(r,s.bind(n),i);return o(),u}function gE(t,e){const i=e.split(".");return()=>{let n=t;for(let r=0;re==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${mo(e)}Modifiers`]||t[`${Xl(e)}Modifiers`];function BN(t,e,...i){if(t.isUnmounted)return;const n=t.vnode.props||Zt;let r=i;const s=e.startsWith("update:"),o=s&&NN(n,e.slice(7));o&&(o.trim&&(r=i.map(g=>In(g)?g.trim():g)),o.number&&(r=i.map(Cv)));let u,h=n[u=$m(e)]||n[u=$m(mo(e))];!h&&s&&(h=n[u=$m(Xl(e))]),h&&No(h,t,6,r);const p=n[u+"Once"];if(p){if(!t.emitted)t.emitted={};else if(t.emitted[u])return;t.emitted[u]=!0,No(p,t,6,r)}}function yE(t,e,i=!1){const n=e.emitsCache,r=n.get(t);if(r!==void 0)return r;const s=t.emits;let o={},u=!1;if(!ui(t)){const h=p=>{const g=yE(p,e,!0);g&&(u=!0,hr(o,g))};!i&&e.mixins.length&&e.mixins.forEach(h),t.extends&&h(t.extends),t.mixins&&t.mixins.forEach(h)}return!s&&!u?(Sn(t)&&n.set(t,null),null):(Jt(s)?s.forEach(h=>o[h]=null):hr(o,s),Sn(t)&&n.set(t,o),o)}function Tg(t,e){return!t||!Xm(e)?!1:(e=e.slice(2).replace(/Once$/,""),Zi(t,e[0].toLowerCase()+e.slice(1))||Zi(t,Xl(e))||Zi(t,e))}function Ele(){}function vE(t){const{type:e,vnode:i,proxy:n,withProxy:r,propsOptions:[s],slots:o,attrs:u,emit:h,render:p,renderCache:g,props:y,data:S,setupState:P,ctx:R,inheritAttrs:k}=t,M=hg(t);let L,q;try{if(i.shapeFlag&4){const J=r||n,ae=J;L=ca(p.call(ae,J,g,y,P,S,R)),q=u}else{const J=e;L=ca(J.length>1?J(y,{attrs:u,slots:o,emit:h}):J(y,null)),q=e.props?u:HN(u)}}catch(J){Uf.length=0,cg(J,t,1),L=xt(Xr)}let Z=L;if(q&&k!==!1){const J=Object.keys(q),{shapeFlag:ae}=Z;J.length&&ae&7&&(s&&J.some(xv)&&(q=UN(q,s)),Z=eu(Z,q,!1,!0))}return i.dirs&&(Z=eu(Z,null,!1,!0),Z.dirs=Z.dirs?Z.dirs.concat(i.dirs):i.dirs),i.transition&&sc(Z,i.transition),L=Z,hg(M),L}const HN=t=>{let e;for(const i in t)(i==="class"||i==="style"||Xm(i))&&((e||(e={}))[i]=t[i]);return e},UN=(t,e)=>{const i={};for(const n in t)(!xv(n)||!(n.slice(9)in e))&&(i[n]=t[n]);return i};function zN(t,e,i){const{props:n,children:r,component:s}=t,{props:o,children:u,patchFlag:h}=e,p=s.emitsOptions;if(e.dirs||e.transition)return!0;if(i&&h>=0){if(h&1024)return!0;if(h&16)return n?bE(n,o,p):!!o;if(h&8){const g=e.dynamicProps;for(let y=0;yt.__isSuspense;function jN(t,e){e&&e.pendingBranch?Jt(t)?e.effects.push(...t):e.effects.push(t):eN(t)}const ct=Symbol.for("v-fgt"),Hf=Symbol.for("v-txt"),Xr=Symbol.for("v-cmt"),sb=Symbol.for("v-stc"),Uf=[];let Zs=null;function X(t=!1){Uf.push(Zs=t?null:[])}function WN(){Uf.pop(),Zs=Uf[Uf.length-1]||null}let zf=1;function wE(t,e=!1){zf+=t,t<0&&Zs&&e&&(Zs.hasOnce=!0)}function TE(t){return t.dynamicChildren=zf>0?Zs||kn:null,WN(),zf>0&&Zs&&Zs.push(t),t}function se(t,e,i,n,r,s){return TE(Se(t,e,i,n,r,s,!0))}function gt(t,e,i,n,r){return TE(xt(t,e,i,n,r,!0))}function Vf(t){return t?t.__v_isVNode===!0:!1}function ac(t,e){return t.type===e.type&&t.key===e.key}const xE=({key:t})=>t??null,xg=({ref:t,ref_key:e,ref_for:i})=>(typeof t=="number"&&(t=""+t),t!=null?In(t)||br(t)||ui(t)?{i:_r,r:t,k:e,f:!!i}:t:null);function Se(t,e=null,i=null,n=0,r=null,s=t===ct?0:1,o=!1,u=!1){const h={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&xE(e),ref:e&&xg(e),scopeId:kS,slotScopeIds:null,children:i,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:n,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:_r};return u?(ob(h,i),s&128&&t.normalize(h)):i&&(h.shapeFlag|=In(i)?8:16),zf>0&&!o&&Zs&&(h.patchFlag>0||s&6)&&h.patchFlag!==32&&Zs.push(h),h}const xt=qN;function qN(t,e=null,i=null,n=0,r=null,s=!1){if((!t||t===YS)&&(t=Xr),Vf(t)){const u=eu(t,e,!0);return i&&ob(u,i),zf>0&&!s&&Zs&&(u.shapeFlag&6?Zs[Zs.indexOf(t)]=u:Zs.push(u)),u.patchFlag=-2,u}if(iB(t)&&(t=t.__vccOpts),e){e=GN(e);let{class:u,style:h}=e;u&&!In(u)&&(e.class=Tt(u)),Sn(h)&&(Hv(h)&&!Jt(h)&&(h=hr({},h)),e.style=Ri(h))}const o=In(t)?1:_E(t)?128:RS(t)?64:Sn(t)?4:ui(t)?2:0;return Se(t,e,i,n,r,o,s,!0)}function GN(t){return t?Hv(t)||oE(t)?hr({},t):t:null}function eu(t,e,i=!1,n=!1){const{props:r,ref:s,patchFlag:o,children:u,transition:h}=t,p=e?Qi(r||{},e):r,g={__v_isVNode:!0,__v_skip:!0,type:t.type,props:p,key:p&&xE(p),ref:e&&e.ref?i&&s?Jt(s)?s.concat(xg(e)):[s,xg(e)]:xg(e):s,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:u,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==ct?o===-1?16:o|16:o,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:h,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&eu(t.ssContent),ssFallback:t.ssFallback&&eu(t.ssFallback),el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return h&&n&&sc(g,h.clone(g)),g}function Vi(t=" ",e=0){return xt(Hf,null,t,e)}function Be(t="",e=!1){return e?(X(),gt(Xr,null,t)):xt(Xr,null,t)}function ca(t){return t==null||typeof t=="boolean"?xt(Xr):Jt(t)?xt(ct,null,t.slice()):Vf(t)?tu(t):xt(Hf,null,String(t))}function tu(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:eu(t)}function ob(t,e){let i=0;const{shapeFlag:n}=t;if(e==null)e=null;else if(Jt(e))i=16;else if(typeof e=="object")if(n&65){const r=e.default;r&&(r._c&&(r._d=!1),ob(t,r()),r._c&&(r._d=!0));return}else{i=32;const r=e._;!r&&!oE(e)?e._ctx=_r:r===3&&_r&&(_r.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else ui(e)?(e={default:e,_ctx:_r},i=32):(e=String(e),n&64?(i=16,e=[Vi(e)]):i=8);t.children=e,t.shapeFlag|=i}function Qi(...t){const e={};for(let i=0;iRr||_r;let Sg,ab;{const t=tg(),e=(i,n)=>{let r;return(r=t[i])||(r=t[i]=[]),r.push(n),s=>{r.length>1?r.forEach(o=>o(s)):r[0](s)}};Sg=e("__VUE_INSTANCE_SETTERS__",i=>Rr=i),ab=e("__VUE_SSR_SETTERS__",i=>Wf=i)}const jf=t=>{const e=Rr;return Sg(t),t.scope.on(),()=>{t.scope.off(),Sg(e)}},SE=()=>{Rr&&Rr.scope.off(),Sg(null)};function EE(t){return t.vnode.shapeFlag&4}let Wf=!1;function ZN(t,e=!1,i=!1){e&&ab(e);const{props:n,children:r}=t.vnode,s=EE(t);SN(t,n,s,e),DN(t,r,i||e);const o=s?QN(t,e):void 0;return e&&ab(!1),o}function QN(t,e){const i=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,mN);const{setup:n}=i;if(n){aa();const r=t.setupContext=n.length>1?$N(t):null,s=jf(t),o=yd(n,t,0,[t.props,r]),u=Yx(o);if(la(),s(),(u||t.sp)&&!_d(t)&&WS(t),u){if(o.then(SE,SE),e)return o.then(h=>{CE(t,h)}).catch(h=>{cg(h,t,0)});t.asyncDep=o}else CE(t,o)}else AE(t)}function CE(t,e,i){ui(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:Sn(e)&&(t.setupState=xS(e)),AE(t)}function AE(t,e,i){const n=t.type;t.render||(t.render=n.render||Xs);{const r=jf(t);aa();try{gN(t)}finally{la(),r()}}}const JN={get(t,e){return Kr(t,"get",""),t[e]}};function $N(t){const e=i=>{t.exposed=i||{}};return{attrs:new Proxy(t.attrs,JN),slots:t.slots,emit:t.emit,expose:e}}function Eg(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(xS(NF(t.exposed)),{get(e,i){if(i in e)return e[i];if(i in Ff)return Ff[i](t)},has(e,i){return i in e||i in Ff}})):t.proxy}const eB=/(?:^|[-_])(\w)/g,tB=t=>t.replace(eB,e=>e.toUpperCase()).replace(/[-_]/g,"");function DE(t,e=!0){return ui(t)?t.displayName||t.name:t.name||e&&t.__name}function PE(t,e,i=!1){let n=DE(e);if(!n&&e.__file){const r=e.__file.match(/([^/\\]+)\.\w+$/);r&&(n=r[1])}if(!n&&t&&t.parent){const r=s=>{for(const o in s)if(s[o]===e)return o};n=r(t.components||t.parent.type.components)||r(t.appContext.components)}return n?tB(n):i?"App":"Anonymous"}function iB(t){return ui(t)&&"__vccOpts"in t}const uc=(t,e)=>WF(t,e,Wf);function lb(t,e,i){const n=arguments.length;return n===2?Sn(e)&&!Jt(e)?Vf(e)?xt(t,null,[e]):xt(t,e):xt(t,null,e):(n>3?i=Array.prototype.slice.call(arguments,2):n===3&&Vf(i)&&(i=[i]),xt(t,e,i))}const nB="3.5.16";/** * @vue/runtime-dom v3.5.16 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/let ub;const kE=typeof window<"u"&&window.trustedTypes;if(kE)try{ub=kE.createPolicy("vue",{createHTML:t=>t})}catch{}const IE=ub?t=>ub.createHTML(t):t=>t,rB="http://www.w3.org/2000/svg",sB="http://www.w3.org/1998/Math/MathML",rl=typeof document<"u"?document:null,RE=rl&&rl.createElement("template"),oB={insert:(t,e,i)=>{e.insertBefore(t,i||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,i,n)=>{const r=e==="svg"?rl.createElementNS(rB,t):e==="mathml"?rl.createElementNS(sB,t):i?rl.createElement(t,{is:i}):rl.createElement(t);return t==="select"&&n&&n.multiple!=null&&r.setAttribute("multiple",n.multiple),r},createText:t=>rl.createTextNode(t),createComment:t=>rl.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>rl.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,i,n,r,s){const o=i?i.previousSibling:e.lastChild;if(r&&(r===s||r.nextSibling))for(;e.insertBefore(r.cloneNode(!0),i),!(r===s||!(r=r.nextSibling)););else{RE.innerHTML=IE(n==="svg"?`${t}`:n==="mathml"?`${t}`:t);const u=RE.content;if(n==="svg"||n==="mathml"){const h=u.firstChild;for(;h.firstChild;)u.appendChild(h.firstChild);u.removeChild(h)}e.insertBefore(u,i)}return[o?o.nextSibling:e.firstChild,i?i.previousSibling:e.lastChild]}},iu="transition",qf="animation",xd=Symbol("_vtc"),OE={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},LE=hr({},HS,OE),sl=(t=>(t.displayName="Transition",t.props=LE,t))((t,{slots:e})=>lb(rN,FE(t),e)),cc=(t,e=[])=>{Jt(t)?t.forEach(i=>i(...e)):t&&t(...e)},ME=t=>t?Jt(t)?t.some(e=>e.length>1):t.length>1:!1;function FE(t){const e={};for(const qe in t)qe in OE||(e[qe]=t[qe]);if(t.css===!1)return e;const{name:i="v",type:n,duration:r,enterFromClass:s=`${i}-enter-from`,enterActiveClass:o=`${i}-enter-active`,enterToClass:u=`${i}-enter-to`,appearFromClass:h=s,appearActiveClass:p=o,appearToClass:g=u,leaveFromClass:y=`${i}-leave-from`,leaveActiveClass:S=`${i}-leave-active`,leaveToClass:P=`${i}-leave-to`}=t,R=aB(r),k=R&&R[0],M=R&&R[1],{onBeforeEnter:L,onEnter:q,onEnterCancelled:Z,onLeave:J,onLeaveCancelled:ae,onBeforeAppear:ye=L,onAppear:pe=q,onAppearCancelled:le=Z}=e,ze=(qe,at,Pt,ci)=>{qe._enterCancelled=ci,nu(qe,at?g:u),nu(qe,at?p:o),Pt&&Pt()},tt=(qe,at)=>{qe._isLeaving=!1,nu(qe,y),nu(qe,P),nu(qe,S),at&&at()},ot=qe=>(at,Pt)=>{const ci=qe?pe:q,Ct=()=>ze(at,qe,Pt);cc(ci,[at,Ct]),NE(()=>{nu(at,qe?h:s),ha(at,qe?g:u),ME(ci)||BE(at,n,k,Ct)})};return hr(e,{onBeforeEnter(qe){cc(L,[qe]),ha(qe,s),ha(qe,o)},onBeforeAppear(qe){cc(ye,[qe]),ha(qe,h),ha(qe,p)},onEnter:ot(!1),onAppear:ot(!0),onLeave(qe,at){qe._isLeaving=!0;const Pt=()=>tt(qe,at);ha(qe,y),qe._enterCancelled?(ha(qe,S),db()):(db(),ha(qe,S)),NE(()=>{qe._isLeaving&&(nu(qe,y),ha(qe,P),ME(J)||BE(qe,n,M,Pt))}),cc(J,[qe,Pt])},onEnterCancelled(qe){ze(qe,!1,void 0,!0),cc(Z,[qe])},onAppearCancelled(qe){ze(qe,!0,void 0,!0),cc(le,[qe])},onLeaveCancelled(qe){tt(qe),cc(ae,[qe])}})}function aB(t){if(t==null)return null;if(Sn(t))return[cb(t.enter),cb(t.leave)];{const e=cb(t);return[e,e]}}function cb(t){return cF(t)}function ha(t,e){e.split(/\s+/).forEach(i=>i&&t.classList.add(i)),(t[xd]||(t[xd]=new Set)).add(e)}function nu(t,e){e.split(/\s+/).forEach(n=>n&&t.classList.remove(n));const i=t[xd];i&&(i.delete(e),i.size||(t[xd]=void 0))}function NE(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let lB=0;function BE(t,e,i,n){const r=t._endId=++lB,s=()=>{r===t._endId&&n()};if(i!=null)return setTimeout(s,i);const{type:o,timeout:u,propCount:h}=HE(t,e);if(!o)return n();const p=o+"end";let g=0;const y=()=>{t.removeEventListener(p,S),s()},S=P=>{P.target===t&&++g>=h&&y()};setTimeout(()=>{g(i[R]||"").split(", "),r=n(`${iu}Delay`),s=n(`${iu}Duration`),o=UE(r,s),u=n(`${qf}Delay`),h=n(`${qf}Duration`),p=UE(u,h);let g=null,y=0,S=0;e===iu?o>0&&(g=iu,y=o,S=s.length):e===qf?p>0&&(g=qf,y=p,S=h.length):(y=Math.max(o,p),g=y>0?o>p?iu:qf:null,S=g?g===iu?s.length:h.length:0);const P=g===iu&&/\b(transform|all)(,|$)/.test(n(`${iu}Property`).toString());return{type:g,timeout:y,propCount:S,hasTransform:P}}function UE(t,e){for(;t.lengthzE(i)+zE(t[n])))}function zE(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function db(){return document.body.offsetHeight}function uB(t,e,i){const n=t[xd];n&&(e=(e?[e,...n]:[...n]).join(" ")),e==null?t.removeAttribute("class"):i?t.setAttribute("class",e):t.className=e}const Cg=Symbol("_vod"),VE=Symbol("_vsh"),hb={beforeMount(t,{value:e},{transition:i}){t[Cg]=t.style.display==="none"?"":t.style.display,i&&e?i.beforeEnter(t):Gf(t,e)},mounted(t,{value:e},{transition:i}){i&&e&&i.enter(t)},updated(t,{value:e,oldValue:i},{transition:n}){!e!=!i&&(n?e?(n.beforeEnter(t),Gf(t,!0),n.enter(t)):n.leave(t,()=>{Gf(t,!1)}):Gf(t,e))},beforeUnmount(t,{value:e}){Gf(t,e)}};function Gf(t,e){t.style.display=e?t[Cg]:"none",t[VE]=!e}const cB=Symbol(""),dB=/(^|;)\s*display\s*:/;function hB(t,e,i){const n=t.style,r=In(i);let s=!1;if(i&&!r){if(e)if(In(e))for(const o of e.split(";")){const u=o.slice(0,o.indexOf(":")).trim();i[u]==null&&Ag(n,u,"")}else for(const o in e)i[o]==null&&Ag(n,o,"");for(const o in i)o==="display"&&(s=!0),Ag(n,o,i[o])}else if(r){if(e!==i){const o=n[cB];o&&(i+=";"+o),n.cssText=i,s=dB.test(i)}}else e&&t.removeAttribute("style");Cg in t&&(t[Cg]=s?n.display:"",t[VE]&&(n.display="none"))}const jE=/\s*!important$/;function Ag(t,e,i){if(Jt(i))i.forEach(n=>Ag(t,e,n));else if(i==null&&(i=""),e.startsWith("--"))t.setProperty(e,i);else{const n=fB(t,e);jE.test(i)?t.setProperty(Xl(n),i.replace(jE,""),"important"):t[n]=i}}const WE=["Webkit","Moz","ms"],fb={};function fB(t,e){const i=fb[e];if(i)return i;let n=mo(e);if(n!=="filter"&&n in t)return fb[e]=n;n=Jm(n);for(let r=0;rpb||(yB.then(()=>pb=0),pb=Date.now());function bB(t,e){const i=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=i.attached)return;No(_B(n,i.value),e,5,[n])};return i.value=t,i.attached=vB(),i}function _B(t,e){if(Jt(e)){const i=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{i.call(t),t._stopped=!0},e.map(n=>r=>!r._stopped&&n&&n(r))}else return e}const ZE=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,wB=(t,e,i,n,r,s)=>{const o=r==="svg";e==="class"?uB(t,n,o):e==="style"?hB(t,i,n):Xm(e)?xv(e)||mB(t,e,i,n,s):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):TB(t,e,n,o))?(KE(t,e,n),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&GE(t,e,n,o,s,e!=="value")):t._isVueCE&&(/[A-Z]/.test(e)||!In(n))?KE(t,mo(e),n,s,e):(e==="true-value"?t._trueValue=n:e==="false-value"&&(t._falseValue=n),GE(t,e,n,o))};function TB(t,e,i,n){if(n)return!!(e==="innerHTML"||e==="textContent"||e in t&&ZE(e)&&ui(i));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const r=t.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return ZE(e)&&In(i)?!1:e in t}const QE=new WeakMap,JE=new WeakMap,Dg=Symbol("_moveCb"),$E=Symbol("_enterCb"),xB=(t=>(delete t.props.mode,t))({name:"TransitionGroup",props:hr({},LE,{tag:String,moveClass:String}),setup(t,{slots:e}){const i=lc(),n=BS();let r,s;return GS(()=>{if(!r.length)return;const o=t.moveClass||`${t.name||"v"}-move`;if(!AB(r[0].el,i.vnode.el,o)){r=[];return}r.forEach(SB),r.forEach(EB);const u=r.filter(CB);db(),u.forEach(h=>{const p=h.el,g=p.style;ha(p,o),g.transform=g.webkitTransform=g.transitionDuration="";const y=p[Dg]=S=>{S&&S.target!==p||(!S||/transform$/.test(S.propertyName))&&(p.removeEventListener("transitionend",y),p[Dg]=null,nu(p,o))};p.addEventListener("transitionend",y)}),r=[]}),()=>{const o=Pi(t),u=FE(o);let h=o.tag||ct;if(r=[],s)for(let p=0;p{u.split(/\s+/).forEach(h=>h&&n.classList.remove(h))}),i.split(/\s+/).forEach(u=>u&&n.classList.add(u)),n.style.display="none";const s=e.nodeType===1?e:e.parentNode;s.appendChild(n);const{hasTransform:o}=HE(n);return s.removeChild(n),o}const e1=t=>{const e=t.props["onUpdate:modelValue"]||!1;return Jt(e)?i=>eg(e,i):e};function DB(t){t.target.composing=!0}function t1(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const mb=Symbol("_assign"),i1={created(t,{modifiers:{lazy:e,trim:i,number:n}},r){t[mb]=e1(r);const s=n||r.props&&r.props.type==="number";Sd(t,e?"change":"input",o=>{if(o.target.composing)return;let u=t.value;i&&(u=u.trim()),s&&(u=Cv(u)),t[mb](u)}),i&&Sd(t,"change",()=>{t.value=t.value.trim()}),e||(Sd(t,"compositionstart",DB),Sd(t,"compositionend",t1),Sd(t,"change",t1))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,oldValue:i,modifiers:{lazy:n,trim:r,number:s}},o){if(t[mb]=e1(o),t.composing)return;const u=(s||t.type==="number")&&!/^0\d/.test(t.value)?Cv(t.value):t.value,h=e??"";u!==h&&(document.activeElement===t&&t.type!=="range"&&(n&&e===i||r&&t.value.trim()===h)||(t.value=h))}},PB=["ctrl","shift","alt","meta"],kB={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>PB.some(i=>t[`${i}Key`]&&!e.includes(i))},Kf=(t,e)=>{const i=t._withMods||(t._withMods={}),n=e.join(".");return i[n]||(i[n]=(r,...s)=>{for(let o=0;o{const i=t._withKeys||(t._withKeys={}),n=e.join(".");return i[n]||(i[n]=r=>{if(!("key"in r))return;const s=Xl(r.key);if(e.some(o=>o===s||IB[o]===s))return t(r)})},RB=hr({patchProp:wB},oB);let n1;function OB(){return n1||(n1=kN(RB))}const LB=(...t)=>{const e=OB().createApp(...t),{mount:i}=e;return e.mount=n=>{const r=FB(n);if(!r)return;const s=e._component;!ui(s)&&!s.render&&!s.template&&(s.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const o=i(r,!1,MB(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),o},e};function MB(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function FB(t){return In(t)?document.querySelector(t):t}var He={innerWidth(t){if(t){let e=t.offsetWidth,i=getComputedStyle(t);return e+=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight),e}return 0},width(t){if(t){let e=t.offsetWidth,i=getComputedStyle(t);return e-=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight),e}return 0},getWindowScrollTop(){let t=document.documentElement;return(window.pageYOffset||t.scrollTop)-(t.clientTop||0)},getWindowScrollLeft(){let t=document.documentElement;return(window.pageXOffset||t.scrollLeft)-(t.clientLeft||0)},getOuterWidth(t,e){if(t){let i=t.offsetWidth;if(e){let n=getComputedStyle(t);i+=parseFloat(n.marginLeft)+parseFloat(n.marginRight)}return i}return 0},getOuterHeight(t,e){if(t){let i=t.offsetHeight;if(e){let n=getComputedStyle(t);i+=parseFloat(n.marginTop)+parseFloat(n.marginBottom)}return i}return 0},getClientHeight(t,e){if(t){let i=t.clientHeight;if(e){let n=getComputedStyle(t);i+=parseFloat(n.marginTop)+parseFloat(n.marginBottom)}return i}return 0},getViewport(){let t=window,e=document,i=e.documentElement,n=e.getElementsByTagName("body")[0],r=t.innerWidth||i.clientWidth||n.clientWidth,s=t.innerHeight||i.clientHeight||n.clientHeight;return{width:r,height:s}},getOffset(t){if(t){let e=t.getBoundingClientRect();return{top:e.top+(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0),left:e.left+(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0)}}return{top:"auto",left:"auto"}},index(t){if(t){let e=t.parentNode.childNodes,i=0;for(let n=0;ng.height?(y=u.top+h-n,t.style.transformOrigin="bottom",y<0&&(y=h)):(y=s+u.top+h,t.style.transformOrigin="top"),u.left+r>g.width?S=Math.max(0,u.left+p+o-r):S=u.left+p,t.style.top=y+"px",t.style.left=S+"px"}},relativePosition(t,e){if(t){let i=t.offsetParent?{width:t.offsetWidth,height:t.offsetHeight}:this.getHiddenElementDimensions(t);const n=e.offsetHeight,r=e.getBoundingClientRect(),s=this.getViewport();let o,u;r.top+n+i.height>s.height?(o=-1*i.height,t.style.transformOrigin="bottom",r.top+o<0&&(o=-1*r.top)):(o=n,t.style.transformOrigin="top"),i.width>s.width?u=r.left*-1:r.left+i.width>s.width?u=(r.left+i.width-s.width)*-1:u=0,t.style.top=o+"px",t.style.left=u+"px"}},getParents(t,e=[]){return t.parentNode===null?e:this.getParents(t.parentNode,e.concat([t.parentNode]))},getScrollableParents(t){let e=[];if(t){let i=this.getParents(t);const n=/(auto|scroll)/,r=s=>{let o=window.getComputedStyle(s,null);return n.test(o.getPropertyValue("overflow"))||n.test(o.getPropertyValue("overflowX"))||n.test(o.getPropertyValue("overflowY"))};for(let s of i){let o=s.nodeType===1&&s.dataset.scrollselectors;if(o){let u=o.split(",");for(let h of u){let p=this.findSingle(s,h);p&&r(p)&&e.push(p)}}s.nodeType!==9&&r(s)&&e.push(s)}}return e},getHiddenElementOuterHeight(t){if(t){t.style.visibility="hidden",t.style.display="block";let e=t.offsetHeight;return t.style.display="none",t.style.visibility="visible",e}return 0},getHiddenElementOuterWidth(t){if(t){t.style.visibility="hidden",t.style.display="block";let e=t.offsetWidth;return t.style.display="none",t.style.visibility="visible",e}return 0},getHiddenElementDimensions(t){if(t){let e={};return t.style.visibility="hidden",t.style.display="block",e.width=t.offsetWidth,e.height=t.offsetHeight,t.style.display="none",t.style.visibility="visible",e}return 0},fadeIn(t,e){if(t){t.style.opacity=0;let i=+new Date,n=0,r=function(){n=+t.style.opacity+(new Date().getTime()-i)/e,t.style.opacity=n,i=+new Date,+n<1&&(window.requestAnimationFrame&&requestAnimationFrame(r)||setTimeout(r,16))};r()}},fadeOut(t,e){if(t){let i=1,n=50,r=e,s=n/r,o=setInterval(()=>{i-=s,i<=0&&(i=0,clearInterval(o)),t.style.opacity=i},n)}},getUserAgent(){return navigator.userAgent},appendChild(t,e){if(this.isElement(e))e.appendChild(t);else if(e.el&&e.elElement)e.elElement.appendChild(t);else throw new Error("Cannot append "+e+" to "+t)},isElement(t){return typeof HTMLElement=="object"?t instanceof HTMLElement:t&&typeof t=="object"&&t!==null&&t.nodeType===1&&typeof t.nodeName=="string"},scrollInView(t,e){let i=getComputedStyle(t).getPropertyValue("borderTopWidth"),n=i?parseFloat(i):0,r=getComputedStyle(t).getPropertyValue("paddingTop"),s=r?parseFloat(r):0,o=t.getBoundingClientRect(),h=e.getBoundingClientRect().top+document.body.scrollTop-(o.top+document.body.scrollTop)-n-s,p=t.scrollTop,g=t.clientHeight,y=this.getOuterHeight(e);h<0?t.scrollTop=p+h:h+y>g&&(t.scrollTop=p+h-g+y)},clearSelection(){if(window.getSelection)window.getSelection().empty?window.getSelection().empty():window.getSelection().removeAllRanges&&window.getSelection().rangeCount>0&&window.getSelection().getRangeAt(0).getClientRects().length>0&&window.getSelection().removeAllRanges();else if(document.selection&&document.selection.empty)try{document.selection.empty()}catch{}},getSelection(){return window.getSelection?window.getSelection().toString():document.getSelection?document.getSelection().toString():document.selection?document.selection.createRange().text:null},calculateScrollbarWidth(){if(this.calculatedScrollbarWidth!=null)return this.calculatedScrollbarWidth;let t=document.createElement("div");t.className="p-scrollbar-measure",document.body.appendChild(t);let e=t.offsetWidth-t.clientWidth;return document.body.removeChild(t),this.calculatedScrollbarWidth=e,e},getBrowser(){if(!this.browser){let t=this.resolveUserAgent();this.browser={},t.browser&&(this.browser[t.browser]=!0,this.browser.version=t.version),this.browser.chrome?this.browser.webkit=!0:this.browser.webkit&&(this.browser.safari=!0)}return this.browser},resolveUserAgent(){let t=navigator.userAgent.toLowerCase(),e=/(chrome)[ ]([\w.]+)/.exec(t)||/(webkit)[ ]([\w.]+)/.exec(t)||/(opera)(?:.*version|)[ ]([\w.]+)/.exec(t)||/(msie) ([\w.]+)/.exec(t)||t.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(t)||[];return{browser:e[1]||"",version:e[2]||"0"}},isVisible(t){return t&&t.offsetParent!=null},invokeElementMethod(t,e,i){t[e].apply(t,i)},isExist(t){return!!(t!==null&&typeof t<"u"&&t.nodeName&&t.parentNode)},isClient(){return!!(typeof window<"u"&&window.document&&window.document.createElement)},focus(t,e){t&&document.activeElement!==t&&t.focus(e)},isFocusableElement(t,e=""){return this.isElement(t)?t.matches(`button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, [href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, [contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}`):!1},getFocusableElements(t,e=""){let i=this.find(t,`button:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, [href][clientHeight][clientWidth]:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, input:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, select:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, textarea:not([tabindex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, [tabIndex]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}, [contenteditable]:not([tabIndex = "-1"]):not([disabled]):not([style*="display:none"]):not([hidden])${e}`),n=[];for(let r of i)getComputedStyle(r).display!="none"&&getComputedStyle(r).visibility!="hidden"&&n.push(r);return n},getFirstFocusableElement(t,e){const i=this.getFocusableElements(t,e);return i.length>0?i[0]:null},getLastFocusableElement(t,e){const i=this.getFocusableElements(t,e);return i.length>0?i[i.length-1]:null},getNextFocusableElement(t,e,i){const n=this.getFocusableElements(t,i),r=n.length>0?n.findIndex(o=>o===e):-1,s=r>-1&&n.length>=r+1?r+1:-1;return s>-1?n[s]:null},isClickable(t){if(t){const e=t.nodeName,i=t.parentElement&&t.parentElement.nodeName;return e==="INPUT"||e==="TEXTAREA"||e==="BUTTON"||e==="A"||i==="INPUT"||i==="TEXTAREA"||i==="BUTTON"||i==="A"||!!t.closest(".p-button, .p-checkbox, .p-radiobutton")}return!1},applyStyle(t,e){if(typeof e=="string")t.style.cssText=e;else for(let i in e)t.style[i]=e[i]},isIOS(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream},isAndroid(){return/(android)/i.test(navigator.userAgent)},isTouchDevice(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0},exportCSV(t,e){let i=new Blob([t],{type:"application/csv;charset=utf-8;"});if(window.navigator.msSaveOrOpenBlob)navigator.msSaveOrOpenBlob(i,e+".csv");else{let n=document.createElement("a");n.download!==void 0?(n.setAttribute("href",URL.createObjectURL(i)),n.setAttribute("download",e+".csv"),n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n)):(t="data:text/csv;charset=utf-8,"+t,window.open(encodeURI(t)))}}};class r1{constructor(e,i=()=>{}){this.element=e,this.listener=i}bindScrollListener(){this.scrollableParents=He.getScrollableParents(this.element);for(let e=0;e>>0,1)},emit(e,i){let n=t.get(e);n&&n.slice().map(r=>{r(i)})}}}var ft={equals(t,e,i){return i?this.resolveFieldData(t,i)===this.resolveFieldData(e,i):this.deepEquals(t,e)},deepEquals(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){var i=Array.isArray(t),n=Array.isArray(e),r,s,o;if(i&&n){if(s=t.length,s!=e.length)return!1;for(r=s;r--!==0;)if(!this.deepEquals(t[r],e[r]))return!1;return!0}if(i!=n)return!1;var u=t instanceof Date,h=e instanceof Date;if(u!=h)return!1;if(u&&h)return t.getTime()==e.getTime();var p=t instanceof RegExp,g=e instanceof RegExp;if(p!=g)return!1;if(p&&g)return t.toString()==e.toString();var y=Object.keys(t);if(s=y.length,s!==Object.keys(e).length)return!1;for(r=s;r--!==0;)if(!Object.prototype.hasOwnProperty.call(e,y[r]))return!1;for(r=s;r--!==0;)if(o=y[r],!this.deepEquals(t[o],e[o]))return!1;return!0}return t!==t&&e!==e},resolveFieldData(t,e){if(t&&Object.keys(t).length&&e){if(this.isFunction(e))return e(t);if(e.indexOf(".")===-1)return t[e];{let r=e.split("."),s=t;for(var i=0,n=r.length;i-1){n.push(r);break}}return n},reorderArray(t,e,i){t&&e!==i&&(i>=t.length&&(i%=t.length,e%=t.length),t.splice(i,0,t.splice(e,1)[0]))},findIndexInList(t,e){let i=-1;if(e){for(let n=0;n0){let r=!1;for(let s=0;se){i.splice(s,0,t),r=!0;break}r||i.push(t)}else i.push(t)},removeAccents(t){return t&&t.search(/[\xC0-\xFF]/g)>-1&&(t=t.replace(/[\xC0-\xC5]/g,"A").replace(/[\xC6]/g,"AE").replace(/[\xC7]/g,"C").replace(/[\xC8-\xCB]/g,"E").replace(/[\xCC-\xCF]/g,"I").replace(/[\xD0]/g,"D").replace(/[\xD1]/g,"N").replace(/[\xD2-\xD6\xD8]/g,"O").replace(/[\xD9-\xDC]/g,"U").replace(/[\xDD]/g,"Y").replace(/[\xDE]/g,"P").replace(/[\xE0-\xE5]/g,"a").replace(/[\xE6]/g,"ae").replace(/[\xE7]/g,"c").replace(/[\xE8-\xEB]/g,"e").replace(/[\xEC-\xEF]/g,"i").replace(/[\xF1]/g,"n").replace(/[\xF2-\xF6\xF8]/g,"o").replace(/[\xF9-\xFC]/g,"u").replace(/[\xFE]/g,"p").replace(/[\xFD\xFF]/g,"y")),t},getVNodeProp(t,e){let i=t.props;if(i){let n=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),r=Object.prototype.hasOwnProperty.call(i,n)?n:e;return t.type.props[e].type===Boolean&&i[r]===""?!0:i[r]}return null},isEmpty(t){return t==null||t===""||Array.isArray(t)&&t.length===0||!(t instanceof Date)&&typeof t=="object"&&Object.keys(t).length===0},isNotEmpty(t){return!this.isEmpty(t)},isPrintableCharacter(t=""){return this.isNotEmpty(t)&&t.length===1&&t.match(/\S| /)},findLast(t,e){let i;if(this.isNotEmpty(t))try{i=t.findLast(e)}catch{i=[...t].reverse().find(e)}return i},findLastIndex(t,e){let i=-1;if(this.isNotEmpty(t))try{i=t.findLastIndex(e)}catch{i=t.lastIndexOf([...t].reverse().find(e))}return i}},s1=0;function ks(t="pv_id_"){return s1++,`${t}${s1}`}function BB(){let t=[];const e=(o,u,h=999)=>{const p=r(o,u,h),g=p.value+(p.key===o?0:h)+1;return t.push({key:o,value:g}),g},i=o=>{t=t.filter(u=>u.value!==o)},n=(o,u)=>r(o).value,r=(o,u,h=0)=>[...t].reverse().find(p=>!0)||{key:o,value:h},s=o=>o&&parseInt(o.style.zIndex,10)||0;return{get:s,set:(o,u,h)=>{u&&(u.style.zIndex=String(e(o,!0,h)))},clear:o=>{o&&(i(s(o)),o.style.zIndex="")},getCurrent:o=>n(o)}}var ol=BB();const Vn={STARTS_WITH:"startsWith",CONTAINS:"contains",NOT_CONTAINS:"notContains",ENDS_WITH:"endsWith",EQUALS:"equals",NOT_EQUALS:"notEquals",LESS_THAN:"lt",LESS_THAN_OR_EQUAL_TO:"lte",GREATER_THAN:"gt",GREATER_THAN_OR_EQUAL_TO:"gte",DATE_IS:"dateIs",DATE_IS_NOT:"dateIsNot",DATE_BEFORE:"dateBefore",DATE_AFTER:"dateAfter"},Pg={AND:"and",OR:"or"},kg={filter(t,e,i,n,r){let s=[];if(t)for(let o of t)for(let u of e){let h=ft.resolveFieldData(o,u);if(this.filters[n](h,i,r)){s.push(o);break}}return s},filters:{startsWith(t,e,i){if(e==null||e.trim()==="")return!0;if(t==null)return!1;let n=ft.removeAccents(e.toString()).toLocaleLowerCase(i);return ft.removeAccents(t.toString()).toLocaleLowerCase(i).slice(0,n.length)===n},contains(t,e,i){if(e==null||typeof e=="string"&&e.trim()==="")return!0;if(t==null)return!1;let n=ft.removeAccents(e.toString()).toLocaleLowerCase(i);return ft.removeAccents(t.toString()).toLocaleLowerCase(i).indexOf(n)!==-1},notContains(t,e,i){if(e==null||typeof e=="string"&&e.trim()==="")return!0;if(t==null)return!1;let n=ft.removeAccents(e.toString()).toLocaleLowerCase(i);return ft.removeAccents(t.toString()).toLocaleLowerCase(i).indexOf(n)===-1},endsWith(t,e,i){if(e==null||e.trim()==="")return!0;if(t==null)return!1;let n=ft.removeAccents(e.toString()).toLocaleLowerCase(i),r=ft.removeAccents(t.toString()).toLocaleLowerCase(i);return r.indexOf(n,r.length-n.length)!==-1},equals(t,e,i){return e==null||typeof e=="string"&&e.trim()===""?!0:t==null?!1:t.getTime&&e.getTime?t.getTime()===e.getTime():ft.removeAccents(t.toString()).toLocaleLowerCase(i)==ft.removeAccents(e.toString()).toLocaleLowerCase(i)},notEquals(t,e,i){return e==null||typeof e=="string"&&e.trim()===""?!1:t==null?!0:t.getTime&&e.getTime?t.getTime()!==e.getTime():ft.removeAccents(t.toString()).toLocaleLowerCase(i)!=ft.removeAccents(e.toString()).toLocaleLowerCase(i)},in(t,e){if(e==null||e.length===0)return!0;for(let i=0;ie.getTime():t>e},gte(t,e){return e==null?!0:t==null?!1:t.getTime&&e.getTime?t.getTime()>=e.getTime():t>=e},dateIs(t,e){return e==null?!0:t==null?!1:t.toDateString()===e.toDateString()},dateIsNot(t,e){return e==null?!0:t==null?!1:t.toDateString()!==e.toDateString()},dateBefore(t,e){return e==null?!0:t==null?!1:t.getTime()e.getTime()}},register(t,e){this.filters[t]=e}},o1={ripple:!1,inputStyle:"outlined",locale:{startsWith:"Starts with",contains:"Contains",notContains:"Not contains",endsWith:"Ends with",equals:"Equals",notEquals:"Not equals",noFilter:"No Filter",lt:"Less than",lte:"Less than or equal to",gt:"Greater than",gte:"Greater than or equal to",dateIs:"Date is",dateIsNot:"Date is not",dateBefore:"Date is before",dateAfter:"Date is after",clear:"Clear",apply:"Apply",matchAll:"Match All",matchAny:"Match Any",addRule:"Add Rule",removeRule:"Remove Rule",accept:"Yes",reject:"No",choose:"Choose",upload:"Upload",cancel:"Cancel",completed:"Completed",pending:"Pending",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],chooseYear:"Choose Year",chooseMonth:"Choose Month",chooseDate:"Choose Date",prevDecade:"Previous Decade",nextDecade:"Next Decade",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",prevHour:"Previous Hour",nextHour:"Next Hour",prevMinute:"Previous Minute",nextMinute:"Next Minute",prevSecond:"Previous Second",nextSecond:"Next Second",am:"am",pm:"pm",today:"Today",weekHeader:"Wk",firstDayOfWeek:0,dateFormat:"mm/dd/yy",weak:"Weak",medium:"Medium",strong:"Strong",passwordPrompt:"Enter a password",emptyFilterMessage:"No results found",searchMessage:"{0} results are available",selectionMessage:"{0} items selected",emptySelectionMessage:"No selected item",emptySearchMessage:"No results found",emptyMessage:"No available options",aria:{trueLabel:"True",falseLabel:"False",nullLabel:"Not Selected",star:"1 star",stars:"{star} stars",selectAll:"All items selected",unselectAll:"All items unselected",close:"Close",previous:"Previous",next:"Next",navigation:"Navigation",scrollTop:"Scroll Top",moveTop:"Move Top",moveUp:"Move Up",moveDown:"Move Down",moveBottom:"Move Bottom",moveToTarget:"Move to Target",moveToSource:"Move to Source",moveAllToTarget:"Move All to Target",moveAllToSource:"Move All to Source",pageLabel:"{page}",firstPageLabel:"First Page",lastPageLabel:"Last Page",nextPageLabel:"Next Page",prevPageLabel:"Previous Page",rowsPerPageLabel:"Rows per page",jumpToPageDropdownLabel:"Jump to Page Dropdown",jumpToPageInputLabel:"Jump to Page Input",selectRow:"Row Selected",unselectRow:"Row Unselected",expandRow:"Row Expanded",collapseRow:"Row Collapsed",showFilterMenu:"Show Filter Menu",hideFilterMenu:"Hide Filter Menu",filterOperator:"Filter Operator",filterConstraint:"Filter Constraint",editRow:"Row Edit",saveEdit:"Save Edit",cancelEdit:"Cancel Edit",listView:"List View",gridView:"Grid View",slide:"Slide",slideNumber:"{slideNumber}",zoomImage:"Zoom Image",zoomIn:"Zoom In",zoomOut:"Zoom Out",rotateRight:"Rotate Right",rotateLeft:"Rotate Left"}},filterMatchModeOptions:{text:[Vn.STARTS_WITH,Vn.CONTAINS,Vn.NOT_CONTAINS,Vn.ENDS_WITH,Vn.EQUALS,Vn.NOT_EQUALS],numeric:[Vn.EQUALS,Vn.NOT_EQUALS,Vn.LESS_THAN,Vn.LESS_THAN_OR_EQUAL_TO,Vn.GREATER_THAN,Vn.GREATER_THAN_OR_EQUAL_TO],date:[Vn.DATE_IS,Vn.DATE_IS_NOT,Vn.DATE_BEFORE,Vn.DATE_AFTER]},zIndex:{modal:1100,overlay:1e3,menu:1e3,tooltip:1100}},HB=Symbol();function UB(t,e,i,n){const r=document.getElementById(i),s=r.cloneNode(!0),o=r.getAttribute("href").replace(t,e);s.setAttribute("id",i+"-clone"),s.setAttribute("href",o),s.addEventListener("load",()=>{r.remove(),s.setAttribute("id",i),n&&n()}),r.parentNode&&r.parentNode.insertBefore(s,r.nextSibling)}var zB={install:(t,e)=>{let i=e?{...o1,...e}:{...o1};const n={config:If(i),changeTheme:UB};t.config.globalProperties.$primevue=n,t.provide(HB,n)}};/*! * shared v10.0.7 * (c) 2025 kazuya kawaguchi * Released under the MIT License. */const Ig=typeof window<"u",ru=(t,e=!1)=>e?Symbol.for(t):Symbol(t),VB=(t,e,i)=>jB({l:t,k:e,s:i}),jB=t=>JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Qn=t=>typeof t=="number"&&isFinite(t),WB=t=>gb(t)==="[object Date]",Ed=t=>gb(t)==="[object RegExp]",Rg=t=>Ti(t)&&Object.keys(t).length===0,pr=Object.assign,qB=Object.create,an=(t=null)=>qB(t);let a1;const dc=()=>a1||(a1=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:an());function l1(t){return t.replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}const GB=Object.prototype.hasOwnProperty;function Bo(t,e){return GB.call(t,e)}const jn=Array.isArray,En=t=>typeof t=="function",Ot=t=>typeof t=="string",ji=t=>typeof t=="boolean",Ki=t=>t!==null&&typeof t=="object",KB=t=>Ki(t)&&En(t.then)&&En(t.catch),u1=Object.prototype.toString,gb=t=>u1.call(t),Ti=t=>gb(t)==="[object Object]",YB=t=>t==null?"":jn(t)||Ti(t)&&t.toString===u1?JSON.stringify(t,null,2):String(t);function yb(t,e=""){return t.reduce((i,n,r)=>r===0?i+n:i+e+n,"")}function XB(t,e){typeof console<"u"&&(console.warn("[intlify] "+t),e&&console.warn(e.stack))}const Og=t=>!Ki(t)||jn(t);function Lg(t,e){if(Og(t)||Og(e))throw new Error("Invalid value");const i=[{src:t,des:e}];for(;i.length;){const{src:n,des:r}=i.pop();Object.keys(n).forEach(s=>{s!=="__proto__"&&(Ki(n[s])&&!Ki(r[s])&&(r[s]=Array.isArray(n[s])?[]:an()),Og(r[s])||Og(n[s])?r[s]=n[s]:i.push({src:n[s],des:r[s]}))})}}/*! * message-compiler v10.0.7 * (c) 2025 kazuya kawaguchi * Released under the MIT License. */function ZB(t,e,i){return{line:t,column:e,offset:i}}function vb(t,e,i){return{start:t,end:e}}const tn={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},QB=17;function Mg(t,e,i={}){const{domain:n,messages:r,args:s}=i,o=t,u=new SyntaxError(String(o));return u.code=t,e&&(u.location=e),u.domain=n,u}function JB(t){throw t}const al=" ",$B="\r",us=` `,e4="\u2028",t4="\u2029";function i4(t){const e=t;let i=0,n=1,r=1,s=0;const o=pe=>e[pe]===$B&&e[pe+1]===us,u=pe=>e[pe]===us,h=pe=>e[pe]===t4,p=pe=>e[pe]===e4,g=pe=>o(pe)||u(pe)||h(pe)||p(pe),y=()=>i,S=()=>n,P=()=>r,R=()=>s,k=pe=>o(pe)||h(pe)||p(pe)?us:e[pe],M=()=>k(i),L=()=>k(i+s);function q(){return s=0,g(i)&&(n++,r=0),o(i)&&i++,i++,r++,e[i]}function Z(){return o(i+s)&&s++,s++,e[i+s]}function J(){i=0,n=1,r=1,s=0}function ae(pe=0){s=pe}function ye(){const pe=i+s;for(;pe!==i;)q();s=0}return{index:y,line:S,column:P,peekOffset:R,charAt:k,currentChar:M,currentPeek:L,next:q,peek:Z,reset:J,resetPeek:ae,skipToPeek:ye}}const su=void 0,n4=".",c1="'",r4="tokenizer";function s4(t,e={}){const i=e.location!==!1,n=i4(t),r=()=>n.index(),s=()=>ZB(n.line(),n.column(),n.index()),o=s(),u=r(),h={currentType:13,offset:u,startLoc:o,endLoc:o,lastType:13,lastOffset:u,lastStartLoc:o,lastEndLoc:o,braceNest:0,inLinked:!1,text:""},p=()=>h,{onError:g}=e;function y(Q,ne,he,...Le){const nt=p();if(ne.column+=he,ne.offset+=he,g){const je=i?vb(nt.startLoc,ne):null,Te=Mg(Q,je,{domain:r4,args:Le});g(Te)}}function S(Q,ne,he){Q.endLoc=s(),Q.currentType=ne;const Le={type:ne};return i&&(Le.loc=vb(Q.startLoc,Q.endLoc)),he!=null&&(Le.value=he),Le}const P=Q=>S(Q,13);function R(Q,ne){return Q.currentChar()===ne?(Q.next(),ne):(y(tn.EXPECTED_TOKEN,s(),0,ne),"")}function k(Q){let ne="";for(;Q.currentPeek()===al||Q.currentPeek()===us;)ne+=Q.currentPeek(),Q.peek();return ne}function M(Q){const ne=k(Q);return Q.skipToPeek(),ne}function L(Q){if(Q===su)return!1;const ne=Q.charCodeAt(0);return ne>=97&&ne<=122||ne>=65&&ne<=90||ne===95}function q(Q){if(Q===su)return!1;const ne=Q.charCodeAt(0);return ne>=48&&ne<=57}function Z(Q,ne){const{currentType:he}=ne;if(he!==2)return!1;k(Q);const Le=L(Q.currentPeek());return Q.resetPeek(),Le}function J(Q,ne){const{currentType:he}=ne;if(he!==2)return!1;k(Q);const Le=Q.currentPeek()==="-"?Q.peek():Q.currentPeek(),nt=q(Le);return Q.resetPeek(),nt}function ae(Q,ne){const{currentType:he}=ne;if(he!==2)return!1;k(Q);const Le=Q.currentPeek()===c1;return Q.resetPeek(),Le}function ye(Q,ne){const{currentType:he}=ne;if(he!==7)return!1;k(Q);const Le=Q.currentPeek()===".";return Q.resetPeek(),Le}function pe(Q,ne){const{currentType:he}=ne;if(he!==8)return!1;k(Q);const Le=L(Q.currentPeek());return Q.resetPeek(),Le}function le(Q,ne){const{currentType:he}=ne;if(!(he===7||he===11))return!1;k(Q);const Le=Q.currentPeek()===":";return Q.resetPeek(),Le}function ze(Q,ne){const{currentType:he}=ne;if(he!==9)return!1;const Le=()=>{const je=Q.currentPeek();return je==="{"?L(Q.peek()):je==="@"||je==="|"||je===":"||je==="."||je===al||!je?!1:je===us?(Q.peek(),Le()):ot(Q,!1)},nt=Le();return Q.resetPeek(),nt}function tt(Q){k(Q);const ne=Q.currentPeek()==="|";return Q.resetPeek(),ne}function ot(Q,ne=!0){const he=(nt=!1,je="")=>{const Te=Q.currentPeek();return Te==="{"||Te==="@"||!Te?nt:Te==="|"?!(je===al||je===us):Te===al?(Q.peek(),he(!0,al)):Te===us?(Q.peek(),he(!0,us)):!0},Le=he();return ne&&Q.resetPeek(),Le}function qe(Q,ne){const he=Q.currentChar();return he===su?su:ne(he)?(Q.next(),he):null}function at(Q){const ne=Q.charCodeAt(0);return ne>=97&&ne<=122||ne>=65&&ne<=90||ne>=48&&ne<=57||ne===95||ne===36}function Pt(Q){return qe(Q,at)}function ci(Q){const ne=Q.charCodeAt(0);return ne>=97&&ne<=122||ne>=65&&ne<=90||ne>=48&&ne<=57||ne===95||ne===36||ne===45}function Ct(Q){return qe(Q,ci)}function Nt(Q){const ne=Q.charCodeAt(0);return ne>=48&&ne<=57}function Wt(Q){return qe(Q,Nt)}function wi(Q){const ne=Q.charCodeAt(0);return ne>=48&&ne<=57||ne>=65&&ne<=70||ne>=97&&ne<=102}function Et(Q){return qe(Q,wi)}function ii(Q){let ne="",he="";for(;ne=Wt(Q);)he+=ne;return he}function Ii(Q){let ne="";for(;;){const he=Q.currentChar();if(he==="{"||he==="}"||he==="@"||he==="|"||!he)break;if(he===al||he===us)if(ot(Q))ne+=he,Q.next();else{if(tt(Q))break;ne+=he,Q.next()}else ne+=he,Q.next()}return ne}function bi(Q){M(Q);let ne="",he="";for(;ne=Ct(Q);)he+=ne;return Q.currentChar()===su&&y(tn.UNTERMINATED_CLOSING_BRACE,s(),0),he}function hn(Q){M(Q);let ne="";return Q.currentChar()==="-"?(Q.next(),ne+=`-${ii(Q)}`):ne+=ii(Q),Q.currentChar()===su&&y(tn.UNTERMINATED_CLOSING_BRACE,s(),0),ne}function dt(Q){return Q!==c1&&Q!==us}function un(Q){M(Q),R(Q,"'");let ne="",he="";for(;ne=qe(Q,dt);)ne==="\\"?he+=Un(Q):he+=ne;const Le=Q.currentChar();return Le===us||Le===su?(y(tn.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,s(),0),Le===us&&(Q.next(),R(Q,"'")),he):(R(Q,"'"),he)}function Un(Q){const ne=Q.currentChar();switch(ne){case"\\":case"'":return Q.next(),`\\${ne}`;case"u":return rn(Q,ne,4);case"U":return rn(Q,ne,6);default:return y(tn.UNKNOWN_ESCAPE_SEQUENCE,s(),0,ne),""}}function rn(Q,ne,he){R(Q,ne);let Le="";for(let nt=0;nt{const Le=Q.currentChar();return Le==="{"||Le==="@"||Le==="|"||Le==="("||Le===")"||!Le||Le===al?he:(he+=Le,Q.next(),ne(he))};return ne("")}function Ie(Q){M(Q);const ne=R(Q,"|");return M(Q),ne}function O(Q,ne){let he=null;switch(Q.currentChar()){case"{":return ne.braceNest>=1&&y(tn.NOT_ALLOW_NEST_PLACEHOLDER,s(),0),Q.next(),he=S(ne,2,"{"),M(Q),ne.braceNest++,he;case"}":return ne.braceNest>0&&ne.currentType===2&&y(tn.EMPTY_PLACEHOLDER,s(),0),Q.next(),he=S(ne,3,"}"),ne.braceNest--,ne.braceNest>0&&M(Q),ne.inLinked&&ne.braceNest===0&&(ne.inLinked=!1),he;case"@":return ne.braceNest>0&&y(tn.UNTERMINATED_CLOSING_BRACE,s(),0),he=te(Q,ne)||P(ne),ne.braceNest=0,he;default:{let nt=!0,je=!0,Te=!0;if(tt(Q))return ne.braceNest>0&&y(tn.UNTERMINATED_CLOSING_BRACE,s(),0),he=S(ne,1,Ie(Q)),ne.braceNest=0,ne.inLinked=!1,he;if(ne.braceNest>0&&(ne.currentType===4||ne.currentType===5||ne.currentType===6))return y(tn.UNTERMINATED_CLOSING_BRACE,s(),0),ne.braceNest=0,Ee(Q,ne);if(nt=Z(Q,ne))return he=S(ne,4,bi(Q)),M(Q),he;if(je=J(Q,ne))return he=S(ne,5,hn(Q)),M(Q),he;if(Te=ae(Q,ne))return he=S(ne,6,un(Q)),M(Q),he;if(!nt&&!je&&!Te)return he=S(ne,12,Si(Q)),y(tn.INVALID_TOKEN_IN_PLACEHOLDER,s(),0,he.value),M(Q),he;break}}return he}function te(Q,ne){const{currentType:he}=ne;let Le=null;const nt=Q.currentChar();switch((he===7||he===8||he===11||he===9)&&(nt===us||nt===al)&&y(tn.INVALID_LINKED_FORMAT,s(),0),nt){case"@":return Q.next(),Le=S(ne,7,"@"),ne.inLinked=!0,Le;case".":return M(Q),Q.next(),S(ne,8,".");case":":return M(Q),Q.next(),S(ne,9,":");default:return tt(Q)?(Le=S(ne,1,Ie(Q)),ne.braceNest=0,ne.inLinked=!1,Le):ye(Q,ne)||le(Q,ne)?(M(Q),te(Q,ne)):pe(Q,ne)?(M(Q),S(ne,11,mr(Q))):ze(Q,ne)?(M(Q),nt==="{"?O(Q,ne)||Le:S(ne,10,Ce(Q))):(he===7&&y(tn.INVALID_LINKED_FORMAT,s(),0),ne.braceNest=0,ne.inLinked=!1,Ee(Q,ne))}}function Ee(Q,ne){let he={type:13};if(ne.braceNest>0)return O(Q,ne)||P(ne);if(ne.inLinked)return te(Q,ne)||P(ne);switch(Q.currentChar()){case"{":return O(Q,ne)||P(ne);case"}":return y(tn.UNBALANCED_CLOSING_BRACE,s(),0),Q.next(),S(ne,3,"}");case"@":return te(Q,ne)||P(ne);default:{if(tt(Q))return he=S(ne,1,Ie(Q)),ne.braceNest=0,ne.inLinked=!1,he;if(ot(Q))return S(ne,0,Ii(Q));break}}return he}function Oe(){const{currentType:Q,offset:ne,startLoc:he,endLoc:Le}=h;return h.lastType=Q,h.lastOffset=ne,h.lastStartLoc=he,h.lastEndLoc=Le,h.offset=r(),h.startLoc=s(),n.currentChar()===su?S(h,13):Ee(n,h)}return{nextToken:Oe,currentOffset:r,currentPosition:s,context:p}}const o4="parser",a4=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;function l4(t,e,i){switch(t){case"\\\\":return"\\";case"\\'":return"'";default:{const n=parseInt(e||i,16);return n<=55295||n>=57344?String.fromCodePoint(n):"�"}}}function u4(t={}){const e=t.location!==!1,{onError:i}=t;function n(L,q,Z,J,...ae){const ye=L.currentPosition();if(ye.offset+=J,ye.column+=J,i){const pe=e?vb(Z,ye):null,le=Mg(q,pe,{domain:o4,args:ae});i(le)}}function r(L,q,Z){const J={type:L};return e&&(J.start=q,J.end=q,J.loc={start:Z,end:Z}),J}function s(L,q,Z,J){e&&(L.end=q,L.loc&&(L.loc.end=Z))}function o(L,q){const Z=L.context(),J=r(3,Z.offset,Z.startLoc);return J.value=q,s(J,L.currentOffset(),L.currentPosition()),J}function u(L,q){const Z=L.context(),{lastOffset:J,lastStartLoc:ae}=Z,ye=r(5,J,ae);return ye.index=parseInt(q,10),L.nextToken(),s(ye,L.currentOffset(),L.currentPosition()),ye}function h(L,q){const Z=L.context(),{lastOffset:J,lastStartLoc:ae}=Z,ye=r(4,J,ae);return ye.key=q,L.nextToken(),s(ye,L.currentOffset(),L.currentPosition()),ye}function p(L,q){const Z=L.context(),{lastOffset:J,lastStartLoc:ae}=Z,ye=r(9,J,ae);return ye.value=q.replace(a4,l4),L.nextToken(),s(ye,L.currentOffset(),L.currentPosition()),ye}function g(L){const q=L.nextToken(),Z=L.context(),{lastOffset:J,lastStartLoc:ae}=Z,ye=r(8,J,ae);return q.type!==11?(n(L,tn.UNEXPECTED_EMPTY_LINKED_MODIFIER,Z.lastStartLoc,0),ye.value="",s(ye,J,ae),{nextConsumeToken:q,node:ye}):(q.value==null&&n(L,tn.UNEXPECTED_LEXICAL_ANALYSIS,Z.lastStartLoc,0,fa(q)),ye.value=q.value||"",s(ye,L.currentOffset(),L.currentPosition()),{node:ye})}function y(L,q){const Z=L.context(),J=r(7,Z.offset,Z.startLoc);return J.value=q,s(J,L.currentOffset(),L.currentPosition()),J}function S(L){const q=L.context(),Z=r(6,q.offset,q.startLoc);let J=L.nextToken();if(J.type===8){const ae=g(L);Z.modifier=ae.node,J=ae.nextConsumeToken||L.nextToken()}switch(J.type!==9&&n(L,tn.UNEXPECTED_LEXICAL_ANALYSIS,q.lastStartLoc,0,fa(J)),J=L.nextToken(),J.type===2&&(J=L.nextToken()),J.type){case 10:J.value==null&&n(L,tn.UNEXPECTED_LEXICAL_ANALYSIS,q.lastStartLoc,0,fa(J)),Z.key=y(L,J.value||"");break;case 4:J.value==null&&n(L,tn.UNEXPECTED_LEXICAL_ANALYSIS,q.lastStartLoc,0,fa(J)),Z.key=h(L,J.value||"");break;case 5:J.value==null&&n(L,tn.UNEXPECTED_LEXICAL_ANALYSIS,q.lastStartLoc,0,fa(J)),Z.key=u(L,J.value||"");break;case 6:J.value==null&&n(L,tn.UNEXPECTED_LEXICAL_ANALYSIS,q.lastStartLoc,0,fa(J)),Z.key=p(L,J.value||"");break;default:{n(L,tn.UNEXPECTED_EMPTY_LINKED_KEY,q.lastStartLoc,0);const ae=L.context(),ye=r(7,ae.offset,ae.startLoc);return ye.value="",s(ye,ae.offset,ae.startLoc),Z.key=ye,s(Z,ae.offset,ae.startLoc),{nextConsumeToken:J,node:Z}}}return s(Z,L.currentOffset(),L.currentPosition()),{node:Z}}function P(L){const q=L.context(),Z=q.currentType===1?L.currentOffset():q.offset,J=q.currentType===1?q.endLoc:q.startLoc,ae=r(2,Z,J);ae.items=[];let ye=null;do{const ze=ye||L.nextToken();switch(ye=null,ze.type){case 0:ze.value==null&&n(L,tn.UNEXPECTED_LEXICAL_ANALYSIS,q.lastStartLoc,0,fa(ze)),ae.items.push(o(L,ze.value||""));break;case 5:ze.value==null&&n(L,tn.UNEXPECTED_LEXICAL_ANALYSIS,q.lastStartLoc,0,fa(ze)),ae.items.push(u(L,ze.value||""));break;case 4:ze.value==null&&n(L,tn.UNEXPECTED_LEXICAL_ANALYSIS,q.lastStartLoc,0,fa(ze)),ae.items.push(h(L,ze.value||""));break;case 6:ze.value==null&&n(L,tn.UNEXPECTED_LEXICAL_ANALYSIS,q.lastStartLoc,0,fa(ze)),ae.items.push(p(L,ze.value||""));break;case 7:{const tt=S(L);ae.items.push(tt.node),ye=tt.nextConsumeToken||null;break}}}while(q.currentType!==13&&q.currentType!==1);const pe=q.currentType===1?q.lastOffset:L.currentOffset(),le=q.currentType===1?q.lastEndLoc:L.currentPosition();return s(ae,pe,le),ae}function R(L,q,Z,J){const ae=L.context();let ye=J.items.length===0;const pe=r(1,q,Z);pe.cases=[],pe.cases.push(J);do{const le=P(L);ye||(ye=le.items.length===0),pe.cases.push(le)}while(ae.currentType!==13);return ye&&n(L,tn.MUST_HAVE_MESSAGES_IN_PLURAL,Z,0),s(pe,L.currentOffset(),L.currentPosition()),pe}function k(L){const q=L.context(),{offset:Z,startLoc:J}=q,ae=P(L);return q.currentType===13?ae:R(L,Z,J,ae)}function M(L){const q=s4(L,pr({},t)),Z=q.context(),J=r(0,Z.offset,Z.startLoc);return e&&J.loc&&(J.loc.source=L),J.body=k(q),t.onCacheKey&&(J.cacheKey=t.onCacheKey(L)),Z.currentType!==13&&n(q,tn.UNEXPECTED_LEXICAL_ANALYSIS,Z.lastStartLoc,0,L[Z.offset]||""),s(J,q.currentOffset(),q.currentPosition()),J}return{parse:M}}function fa(t){if(t.type===13)return"EOF";const e=(t.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"…":e}function c4(t,e={}){const i={ast:t,helpers:new Set};return{context:()=>i,helper:s=>(i.helpers.add(s),s)}}function d1(t,e){for(let i=0;ih1(i)),t}function h1(t){if(t.items.length===1){const e=t.items[0];(e.type===3||e.type===9)&&(t.static=e.value,delete e.value)}else{const e=[];for(let i=0;io;function h(k,M){o.code+=k}function p(k,M=!0){const L=M?n:"";h(r?L+" ".repeat(k):L)}function g(k=!0){const M=++o.indentLevel;k&&p(M)}function y(k=!0){const M=--o.indentLevel;k&&p(M)}function S(){p(o.indentLevel)}return{context:u,push:h,indent:g,deindent:y,newline:S,helper:k=>`_${k}`,needIndent:()=>o.needIndent}}function p4(t,e){const{helper:i}=t;t.push(`${i("linked")}(`),Ad(t,e.key),e.modifier?(t.push(", "),Ad(t,e.modifier),t.push(", _type")):t.push(", undefined, _type"),t.push(")")}function m4(t,e){const{helper:i,needIndent:n}=t;t.push(`${i("normalize")}([`),t.indent(n());const r=e.items.length;for(let s=0;s1){t.push(`${i("plural")}([`),t.indent(n());const r=e.cases.length;for(let s=0;s{const i=Ot(e.mode)?e.mode:"normal",n=Ot(e.filename)?e.filename:"message.intl";e.sourceMap;const r=e.breakLineCode!=null?e.breakLineCode:i==="arrow"?";":` `,s=e.needIndent?e.needIndent:i!=="arrow",o=t.helpers||[],u=f4(t,{filename:n,breakLineCode:r,needIndent:s});u.push(i==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),u.indent(s),o.length>0&&(u.push(`const { ${yb(o.map(g=>`${g}: _${g}`),", ")} } = ctx`),u.newline()),u.push("return "),Ad(u,t),u.deindent(s),u.push("}"),delete t.helpers;const{code:h,map:p}=u.context();return{ast:t,code:h,map:p?p.toJSON():void 0}};function b4(t,e={}){const i=pr({},e),n=!!i.jit,r=!!i.minify,s=i.optimize==null?!0:i.optimize,u=u4(i).parse(t);return n?(s&&h4(u),r&&Cd(u),{ast:u,code:""}):(d4(u,i),v4(u,i))}/*! * core-base v10.0.7 * (c) 2025 kazuya kawaguchi * Released under the MIT License. */function _4(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(dc().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(dc().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function pa(t){return Ki(t)&&_b(t)===0&&(Bo(t,"b")||Bo(t,"body"))}const f1=["b","body"];function w4(t){return ou(t,f1)}const p1=["c","cases"];function T4(t){return ou(t,p1,[])}const m1=["s","static"];function x4(t){return ou(t,m1)}const g1=["i","items"];function S4(t){return ou(t,g1,[])}const y1=["t","type"];function _b(t){return ou(t,y1)}const v1=["v","value"];function Fg(t,e){const i=ou(t,v1);if(i!=null)return i;throw Xf(e)}const b1=["m","modifier"];function E4(t){return ou(t,b1)}const _1=["k","key"];function C4(t){const e=ou(t,_1);if(e)return e;throw Xf(6)}function ou(t,e,i){for(let n=0;nA4(i,t)}function A4(t,e){const i=w4(e);if(i==null)throw Xf(0);if(_b(i)===1){const s=T4(i);return t.plural(s.reduce((o,u)=>[...o,T1(t,u)],[]))}else return T1(t,i)}function T1(t,e){const i=x4(e);if(i!=null)return t.type==="text"?i:t.normalize([i]);{const n=S4(e).reduce((r,s)=>[...r,Tb(t,s)],[]);return t.normalize(n)}}function Tb(t,e){const i=_b(e);switch(i){case 3:return Fg(e,i);case 9:return Fg(e,i);case 4:{const n=e;if(Bo(n,"k")&&n.k)return t.interpolate(t.named(n.k));if(Bo(n,"key")&&n.key)return t.interpolate(t.named(n.key));throw Xf(i)}case 5:{const n=e;if(Bo(n,"i")&&Qn(n.i))return t.interpolate(t.list(n.i));if(Bo(n,"index")&&Qn(n.index))return t.interpolate(t.list(n.index));throw Xf(i)}case 6:{const n=e,r=E4(n),s=C4(n);return t.linked(Tb(t,s),r?Tb(t,r):void 0,t.type)}case 7:return Fg(e,i);case 8:return Fg(e,i);default:throw new Error(`unhandled node on format message part: ${i}`)}}const D4=t=>t;let Ng=an();function P4(t,e={}){let i=!1;const n=e.onError||JB;return e.onError=r=>{i=!0,n(r)},{...b4(t,e),detectError:i}}function k4(t,e){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&Ot(t)){ji(e.warnHtmlMessage)&&e.warnHtmlMessage;const n=(e.onCacheKey||D4)(t),r=Ng[n];if(r)return r;const{ast:s,detectError:o}=P4(t,{...e,location:!1,jit:!0}),u=wb(s);return o?u:Ng[n]=u}else{const i=t.cacheKey;if(i){const n=Ng[i];return n||(Ng[i]=wb(t))}else return wb(t)}}let Zf=null;function I4(t){Zf=t}function R4(t,e,i){Zf&&Zf.emit("i18n:init",{timestamp:Date.now(),i18n:t,version:e,meta:i})}const O4=L4("function:translate");function L4(t){return e=>Zf&&Zf.emit(t,e)}const ll={INVALID_ARGUMENT:QB,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},M4=24;function ul(t){return Mg(t,null,void 0)}function xb(t,e){return e.locale!=null?x1(e.locale):x1(t.locale)}let Sb;function x1(t){if(Ot(t))return t;if(En(t)){if(t.resolvedOnce&&Sb!=null)return Sb;if(t.constructor.name==="Function"){const e=t();if(KB(e))throw ul(ll.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return Sb=e}else throw ul(ll.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw ul(ll.NOT_SUPPORT_LOCALE_TYPE)}function F4(t,e,i){return[...new Set([i,...jn(e)?e:Ki(e)?Object.keys(e):Ot(e)?[e]:[i]])]}function S1(t,e,i){const n=Ot(i)?i:Qf,r=t;r.__localeChainCache||(r.__localeChainCache=new Map);let s=r.__localeChainCache.get(n);if(!s){s=[];let o=[i];for(;jn(o);)o=E1(s,o,e);const u=jn(e)||!Ti(e)?e:e.default?e.default:null;o=Ot(u)?[u]:u,jn(o)&&E1(s,o,!1),r.__localeChainCache.set(n,s)}return s}function E1(t,e,i){let n=!0;for(let r=0;r{o===void 0?o=u:o+=u},S[1]=()=>{o!==void 0&&(e.push(o),o=void 0)},S[2]=()=>{S[0](),r++},S[3]=()=>{if(r>0)r--,n=4,S[0]();else{if(r=0,o===void 0||(o=j4(o),o===!1))return!1;S[1]()}};function P(){const R=t[i+1];if(n===5&&R==="'"||n===6&&R==='"')return i++,u="\\"+R,S[0](),!0}for(;n!==null;)if(i++,s=t[i],!(s==="\\"&&P())){if(h=V4(s),y=au[n],p=y[h]||y.l||8,p===8||(n=p[0],p[1]!==void 0&&(g=S[p[1]],g&&(u=s,g()===!1))))return;if(n===7)return e}}const C1=new Map;function q4(t,e){return Ki(t)?t[e]:null}function G4(t,e){if(!Ki(t))return null;let i=C1.get(e);if(i||(i=W4(e),i&&C1.set(e,i)),!i)return null;const n=i.length;let r=t,s=0;for(;s`${t.charAt(0).toLocaleUpperCase()}${t.substr(1)}`;function Y4(){return{upper:(t,e)=>e==="text"&&Ot(t)?t.toUpperCase():e==="vnode"&&Ki(t)&&"__v_isVNode"in t?t.children.toUpperCase():t,lower:(t,e)=>e==="text"&&Ot(t)?t.toLowerCase():e==="vnode"&&Ki(t)&&"__v_isVNode"in t?t.children.toLowerCase():t,capitalize:(t,e)=>e==="text"&&Ot(t)?D1(t):e==="vnode"&&Ki(t)&&"__v_isVNode"in t?D1(t.children):t}}let P1;function X4(t){P1=t}let k1;function Z4(t){k1=t}let I1;function Q4(t){I1=t}let R1=null;const J4=t=>{R1=t},$4=()=>R1;let O1=null;const L1=t=>{O1=t},e3=()=>O1;let M1=0;function t3(t={}){const e=En(t.onWarn)?t.onWarn:XB,i=Ot(t.version)?t.version:K4,n=Ot(t.locale)||En(t.locale)?t.locale:Qf,r=En(n)?Qf:n,s=jn(t.fallbackLocale)||Ti(t.fallbackLocale)||Ot(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:r,o=Ti(t.messages)?t.messages:Eb(r),u=Ti(t.datetimeFormats)?t.datetimeFormats:Eb(r),h=Ti(t.numberFormats)?t.numberFormats:Eb(r),p=pr(an(),t.modifiers,Y4()),g=t.pluralRules||an(),y=En(t.missing)?t.missing:null,S=ji(t.missingWarn)||Ed(t.missingWarn)?t.missingWarn:!0,P=ji(t.fallbackWarn)||Ed(t.fallbackWarn)?t.fallbackWarn:!0,R=!!t.fallbackFormat,k=!!t.unresolving,M=En(t.postTranslation)?t.postTranslation:null,L=Ti(t.processor)?t.processor:null,q=ji(t.warnHtmlMessage)?t.warnHtmlMessage:!0,Z=!!t.escapeParameter,J=En(t.messageCompiler)?t.messageCompiler:P1,ae=En(t.messageResolver)?t.messageResolver:k1||q4,ye=En(t.localeFallbacker)?t.localeFallbacker:I1||F4,pe=Ki(t.fallbackContext)?t.fallbackContext:void 0,le=t,ze=Ki(le.__datetimeFormatters)?le.__datetimeFormatters:new Map,tt=Ki(le.__numberFormatters)?le.__numberFormatters:new Map,ot=Ki(le.__meta)?le.__meta:{};M1++;const qe={version:i,cid:M1,locale:n,fallbackLocale:s,messages:o,modifiers:p,pluralRules:g,missing:y,missingWarn:S,fallbackWarn:P,fallbackFormat:R,unresolving:k,postTranslation:M,processor:L,warnHtmlMessage:q,escapeParameter:Z,messageCompiler:J,messageResolver:ae,localeFallbacker:ye,fallbackContext:pe,onWarn:e,__meta:ot};return qe.datetimeFormats=u,qe.numberFormats=h,qe.__datetimeFormatters=ze,qe.__numberFormatters=tt,__INTLIFY_PROD_DEVTOOLS__&&R4(qe,i,ot),qe}const Eb=t=>({[t]:an()});function Cb(t,e,i,n,r){const{missing:s,onWarn:o}=t;if(s!==null){const u=s(t,i,e,r);return Ot(u)?u:e}else return e}function Jf(t,e,i){const n=t;n.__localeChainCache=new Map,t.localeFallbacker(t,i,e)}function i3(t,e){return t===e?!1:t.split("-")[0]===e.split("-")[0]}function n3(t,e){const i=e.indexOf(t);if(i===-1)return!1;for(let n=i+1;n{N1.includes(h)?o[h]=i[h]:s[h]=i[h]}),Ot(n)?s.locale=n:Ti(n)&&(o=n),Ti(r)&&(o=r),[s.key||"",u,s,o]}function B1(t,e,i){const n=t;for(const r in i){const s=`${e}__${r}`;n.__datetimeFormatters.has(s)&&n.__datetimeFormatters.delete(s)}}function H1(t,...e){const{numberFormats:i,unresolving:n,fallbackLocale:r,onWarn:s,localeFallbacker:o}=t,{__numberFormatters:u}=t,[h,p,g,y]=Db(...e),S=ji(g.missingWarn)?g.missingWarn:t.missingWarn;ji(g.fallbackWarn)?g.fallbackWarn:t.fallbackWarn;const P=!!g.part,R=xb(t,g),k=o(t,r,R);if(!Ot(h)||h==="")return new Intl.NumberFormat(R,y).format(p);let M={},L,q=null;const Z="number format";for(let ye=0;ye{U1.includes(h)?o[h]=i[h]:s[h]=i[h]}),Ot(n)?s.locale=n:Ti(n)&&(o=n),Ti(r)&&(o=r),[s.key||"",u,s,o]}function z1(t,e,i){const n=t;for(const r in i){const s=`${e}__${r}`;n.__numberFormatters.has(s)&&n.__numberFormatters.delete(s)}}const r3=t=>t,s3=t=>"",o3="text",a3=t=>t.length===0?"":yb(t),l3=YB;function V1(t,e){return t=Math.abs(t),e===2?t?t>1?1:0:1:t?Math.min(t,2):0}function u3(t){const e=Qn(t.pluralIndex)?t.pluralIndex:-1;return t.named&&(Qn(t.named.count)||Qn(t.named.n))?Qn(t.named.count)?t.named.count:Qn(t.named.n)?t.named.n:e:e}function c3(t,e){e.count||(e.count=t),e.n||(e.n=t)}function d3(t={}){const e=t.locale,i=u3(t),n=Ki(t.pluralRules)&&Ot(e)&&En(t.pluralRules[e])?t.pluralRules[e]:V1,r=Ki(t.pluralRules)&&Ot(e)&&En(t.pluralRules[e])?V1:void 0,s=L=>L[n(i,L.length,r)],o=t.list||[],u=L=>o[L],h=t.named||an();Qn(t.pluralIndex)&&c3(i,h);const p=L=>h[L];function g(L,q){const Z=En(t.messages)?t.messages(L,!!q):Ki(t.messages)?t.messages[L]:!1;return Z||(t.parent?t.parent.message(L):s3)}const y=L=>t.modifiers?t.modifiers[L]:r3,S=Ti(t.processor)&&En(t.processor.normalize)?t.processor.normalize:a3,P=Ti(t.processor)&&En(t.processor.interpolate)?t.processor.interpolate:l3,R=Ti(t.processor)&&Ot(t.processor.type)?t.processor.type:o3,M={list:u,named:p,plural:s,linked:(L,...q)=>{const[Z,J]=q;let ae="text",ye="";q.length===1?Ki(Z)?(ye=Z.modifier||ye,ae=Z.type||ae):Ot(Z)&&(ye=Z||ye):q.length===2&&(Ot(Z)&&(ye=Z||ye),Ot(J)&&(ae=J||ae));const pe=g(L,!0)(M),le=ae==="vnode"&&jn(pe)&&ye?pe[0]:pe;return ye?y(ye)(le,ae):le},message:g,type:R,interpolate:P,normalize:S,values:pr(an(),o,h)};return M}const j1=()=>"",vo=t=>En(t);function W1(t,...e){const{fallbackFormat:i,postTranslation:n,unresolving:r,messageCompiler:s,fallbackLocale:o,messages:u}=t,[h,p]=Pb(...e),g=ji(p.missingWarn)?p.missingWarn:t.missingWarn,y=ji(p.fallbackWarn)?p.fallbackWarn:t.fallbackWarn,S=ji(p.escapeParameter)?p.escapeParameter:t.escapeParameter,P=!!p.resolvedMessage,R=Ot(p.default)||ji(p.default)?ji(p.default)?s?h:()=>h:p.default:i?s?h:()=>h:null,k=i||R!=null&&(Ot(R)||En(R)),M=xb(t,p);S&&h3(p);let[L,q,Z]=P?[h,M,u[M]||an()]:q1(t,h,M,o,y,g),J=L,ae=h;if(!P&&!(Ot(J)||pa(J)||vo(J))&&k&&(J=R,ae=J),!P&&(!(Ot(J)||pa(J)||vo(J))||!Ot(q)))return r?Bg:h;let ye=!1;const pe=()=>{ye=!0},le=vo(J)?J:G1(t,h,q,J,ae,pe);if(ye)return J;const ze=m3(t,q,Z,p),tt=d3(ze),ot=f3(t,le,tt),qe=n?n(ot,h):ot;if(__INTLIFY_PROD_DEVTOOLS__){const at={timestamp:Date.now(),key:Ot(h)?h:vo(J)?J.key:"",locale:q||(vo(J)?J.locale:""),format:Ot(J)?J:vo(J)?J.source:"",message:qe};at.meta=pr({},t.__meta,$4()||{}),O4(at)}return qe}function h3(t){jn(t.list)?t.list=t.list.map(e=>Ot(e)?l1(e):e):Ki(t.named)&&Object.keys(t.named).forEach(e=>{Ot(t.named[e])&&(t.named[e]=l1(t.named[e]))})}function q1(t,e,i,n,r,s){const{messages:o,onWarn:u,messageResolver:h,localeFallbacker:p}=t,g=p(t,n,i);let y=an(),S,P=null;const R="translate";for(let k=0;kn;return p.locale=i,p.key=e,p}const h=o(n,p3(t,i,r,n,u,s));return h.locale=i,h.key=e,h.source=n,h}function f3(t,e,i){return e(i)}function Pb(...t){const[e,i,n]=t,r=an();if(!Ot(e)&&!Qn(e)&&!vo(e)&&!pa(e))throw ul(ll.INVALID_ARGUMENT);const s=Qn(e)?String(e):(vo(e),e);return Qn(i)?r.plural=i:Ot(i)?r.default=i:Ti(i)&&!Rg(i)?r.named=i:jn(i)&&(r.list=i),Qn(n)?r.plural=n:Ot(n)?r.default=n:Ti(n)&&pr(r,n),[s,r]}function p3(t,e,i,n,r,s){return{locale:e,key:i,warnHtmlMessage:r,onError:o=>{throw s&&s(o),o},onCacheKey:o=>VB(e,i,o)}}function m3(t,e,i,n){const{modifiers:r,pluralRules:s,messageResolver:o,fallbackLocale:u,fallbackWarn:h,missingWarn:p,fallbackContext:g}=t,S={locale:e,modifiers:r,pluralRules:s,messages:(P,R)=>{let k=o(i,P);if(k==null&&(g||R)){const[,,M]=q1(g||t,P,e,u,h,p);k=o(M,P)}if(Ot(k)||pa(k)){let M=!1;const q=G1(t,P,e,k,P,()=>{M=!0});return M?j1:q}else return vo(k)?k:j1}};return t.processor&&(S.processor=t.processor),n.list&&(S.list=n.list),n.named&&(S.named=n.named),Qn(n.plural)&&(S.pluralIndex=n.plural),S}_4();/*! * vue-i18n v10.0.7 * (c) 2025 kazuya kawaguchi * Released under the MIT License. */const g3="10.0.7";function y3(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(dc().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(dc().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(dc().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(dc().__INTLIFY_PROD_DEVTOOLS__=!1)}const cs={UNEXPECTED_RETURN_TYPE:M4,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32};function Is(t,...e){return Mg(t,null,void 0)}const kb=ru("__translateVNode"),Ib=ru("__datetimeParts"),Rb=ru("__numberParts"),K1=ru("__setPluralRules"),Y1=ru("__injectWithOption"),Ob=ru("__dispose");function $f(t){if(!Ki(t)||pa(t))return t;for(const e in t)if(Bo(t,e))if(!e.includes("."))Ki(t[e])&&$f(t[e]);else{const i=e.split("."),n=i.length-1;let r=t,s=!1;for(let o=0;o{if("locale"in u&&"resource"in u){const{locale:h,resource:p}=u;h?(o[h]=o[h]||an(),Lg(p,o[h])):Lg(p,o)}else Ot(u)&&Lg(JSON.parse(u),o)}),r==null&&s)for(const u in o)Bo(o,u)&&$f(o[u]);return o}function X1(t){return t.type}function Z1(t,e,i){let n=Ki(e.messages)?e.messages:an();"__i18nGlobal"in i&&(n=Lb(t.locale.value,{messages:n,__i18n:i.__i18nGlobal}));const r=Object.keys(n);r.length&&r.forEach(s=>{t.mergeLocaleMessage(s,n[s])});{if(Ki(e.datetimeFormats)){const s=Object.keys(e.datetimeFormats);s.length&&s.forEach(o=>{t.mergeDateTimeFormat(o,e.datetimeFormats[o])})}if(Ki(e.numberFormats)){const s=Object.keys(e.numberFormats);s.length&&s.forEach(o=>{t.mergeNumberFormat(o,e.numberFormats[o])})}}}function Q1(t){return xt(Hf,null,t,0)}const J1="__INTLIFY_META__",$1=()=>[],v3=()=>!1;let eC=0;function tC(t){return(e,i,n,r)=>t(i,n,lc()||void 0,r)}const b3=()=>{const t=lc();let e=null;return t&&(e=X1(t)[J1])?{[J1]:e}:null};function Mb(t={}){const{__root:e,__injectWithOption:i}=t,n=e===void 0,r=t.flatJson,s=Ig?BF:HF;let o=ji(t.inheritLocale)?t.inheritLocale:!0;const u=s(e&&o?e.locale.value:Ot(t.locale)?t.locale:Qf),h=s(e&&o?e.fallbackLocale.value:Ot(t.fallbackLocale)||jn(t.fallbackLocale)||Ti(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:u.value),p=s(Lb(u.value,t)),g=s(Ti(t.datetimeFormats)?t.datetimeFormats:{[u.value]:{}}),y=s(Ti(t.numberFormats)?t.numberFormats:{[u.value]:{}});let S=e?e.missingWarn:ji(t.missingWarn)||Ed(t.missingWarn)?t.missingWarn:!0,P=e?e.fallbackWarn:ji(t.fallbackWarn)||Ed(t.fallbackWarn)?t.fallbackWarn:!0,R=e?e.fallbackRoot:ji(t.fallbackRoot)?t.fallbackRoot:!0,k=!!t.fallbackFormat,M=En(t.missing)?t.missing:null,L=En(t.missing)?tC(t.missing):null,q=En(t.postTranslation)?t.postTranslation:null,Z=e?e.warnHtmlMessage:ji(t.warnHtmlMessage)?t.warnHtmlMessage:!0,J=!!t.escapeParameter;const ae=e?e.modifiers:Ti(t.modifiers)?t.modifiers:{};let ye=t.pluralRules||e&&e.pluralRules,pe;pe=(()=>{n&&L1(null);const Te={version:g3,locale:u.value,fallbackLocale:h.value,messages:p.value,modifiers:ae,pluralRules:ye,missing:L===null?void 0:L,missingWarn:S,fallbackWarn:P,fallbackFormat:k,unresolving:!0,postTranslation:q===null?void 0:q,warnHtmlMessage:Z,escapeParameter:J,messageResolver:t.messageResolver,messageCompiler:t.messageCompiler,__meta:{framework:"vue"}};Te.datetimeFormats=g.value,Te.numberFormats=y.value,Te.__datetimeFormatters=Ti(pe)?pe.__datetimeFormatters:void 0,Te.__numberFormatters=Ti(pe)?pe.__numberFormatters:void 0;const Ue=t3(Te);return n&&L1(Ue),Ue})(),Jf(pe,u.value,h.value);function ze(){return[u.value,h.value,p.value,g.value,y.value]}const tt=uc({get:()=>u.value,set:Te=>{u.value=Te,pe.locale=u.value}}),ot=uc({get:()=>h.value,set:Te=>{h.value=Te,pe.fallbackLocale=h.value,Jf(pe,u.value,Te)}}),qe=uc(()=>p.value),at=uc(()=>g.value),Pt=uc(()=>y.value);function ci(){return En(q)?q:null}function Ct(Te){q=Te,pe.postTranslation=Te}function Nt(){return M}function Wt(Te){Te!==null&&(L=tC(Te)),M=Te,pe.missing=L}const wi=(Te,Ue,Ze,_t,Ut,K)=>{ze();let j;try{__INTLIFY_PROD_DEVTOOLS__,n||(pe.fallbackContext=e?e3():void 0),j=Te(pe)}finally{__INTLIFY_PROD_DEVTOOLS__,n||(pe.fallbackContext=void 0)}if(Ze!=="translate exists"&&Qn(j)&&j===Bg||Ze==="translate exists"&&!j){const[oe,re]=Ue();return e&&R?_t(e):Ut(oe)}else{if(K(j))return j;throw Is(cs.UNEXPECTED_RETURN_TYPE)}};function Et(...Te){return wi(Ue=>Reflect.apply(W1,null,[Ue,...Te]),()=>Pb(...Te),"translate",Ue=>Reflect.apply(Ue.t,Ue,[...Te]),Ue=>Ue,Ue=>Ot(Ue))}function ii(...Te){const[Ue,Ze,_t]=Te;if(_t&&!Ki(_t))throw Is(cs.INVALID_ARGUMENT);return Et(Ue,Ze,pr({resolvedMessage:!0},_t||{}))}function Ii(...Te){return wi(Ue=>Reflect.apply(F1,null,[Ue,...Te]),()=>Ab(...Te),"datetime format",Ue=>Reflect.apply(Ue.d,Ue,[...Te]),()=>A1,Ue=>Ot(Ue))}function bi(...Te){return wi(Ue=>Reflect.apply(H1,null,[Ue,...Te]),()=>Db(...Te),"number format",Ue=>Reflect.apply(Ue.n,Ue,[...Te]),()=>A1,Ue=>Ot(Ue))}function hn(Te){return Te.map(Ue=>Ot(Ue)||Qn(Ue)||ji(Ue)?Q1(String(Ue)):Ue)}const un={normalize:hn,interpolate:Te=>Te,type:"vnode"};function Un(...Te){return wi(Ue=>{let Ze;const _t=Ue;try{_t.processor=un,Ze=Reflect.apply(W1,null,[_t,...Te])}finally{_t.processor=null}return Ze},()=>Pb(...Te),"translate",Ue=>Ue[kb](...Te),Ue=>[Q1(Ue)],Ue=>jn(Ue))}function rn(...Te){return wi(Ue=>Reflect.apply(H1,null,[Ue,...Te]),()=>Db(...Te),"number format",Ue=>Ue[Rb](...Te),$1,Ue=>Ot(Ue)||jn(Ue))}function fn(...Te){return wi(Ue=>Reflect.apply(F1,null,[Ue,...Te]),()=>Ab(...Te),"datetime format",Ue=>Ue[Ib](...Te),$1,Ue=>Ot(Ue)||jn(Ue))}function Si(Te){ye=Te,pe.pluralRules=ye}function mr(Te,Ue){return wi(()=>{if(!Te)return!1;const Ze=Ot(Ue)?Ue:u.value,_t=O(Ze),Ut=pe.messageResolver(_t,Te);return pa(Ut)||vo(Ut)||Ot(Ut)},()=>[Te],"translate exists",Ze=>Reflect.apply(Ze.te,Ze,[Te,Ue]),v3,Ze=>ji(Ze))}function Ce(Te){let Ue=null;const Ze=S1(pe,h.value,u.value);for(let _t=0;_t{o&&(u.value=Te,pe.locale=Te,Jf(pe,u.value,h.value))}),Td(e.fallbackLocale,Te=>{o&&(h.value=Te,pe.fallbackLocale=Te,Jf(pe,u.value,h.value))}));const je={id:eC,locale:tt,fallbackLocale:ot,get inheritLocale(){return o},set inheritLocale(Te){o=Te,Te&&e&&(u.value=e.locale.value,h.value=e.fallbackLocale.value,Jf(pe,u.value,h.value))},get availableLocales(){return Object.keys(p.value).sort()},messages:qe,get modifiers(){return ae},get pluralRules(){return ye||{}},get isGlobal(){return n},get missingWarn(){return S},set missingWarn(Te){S=Te,pe.missingWarn=S},get fallbackWarn(){return P},set fallbackWarn(Te){P=Te,pe.fallbackWarn=P},get fallbackRoot(){return R},set fallbackRoot(Te){R=Te},get fallbackFormat(){return k},set fallbackFormat(Te){k=Te,pe.fallbackFormat=k},get warnHtmlMessage(){return Z},set warnHtmlMessage(Te){Z=Te,pe.warnHtmlMessage=Te},get escapeParameter(){return J},set escapeParameter(Te){J=Te,pe.escapeParameter=Te},t:Et,getLocaleMessage:O,setLocaleMessage:te,mergeLocaleMessage:Ee,getPostTranslationHandler:ci,setPostTranslationHandler:Ct,getMissingHandler:Nt,setMissingHandler:Wt,[K1]:Si};return je.datetimeFormats=at,je.numberFormats=Pt,je.rt=ii,je.te=mr,je.tm=Ie,je.d=Ii,je.n=bi,je.getDateTimeFormat=Oe,je.setDateTimeFormat=Q,je.mergeDateTimeFormat=ne,je.getNumberFormat=he,je.setNumberFormat=Le,je.mergeNumberFormat=nt,je[Y1]=i,je[kb]=Un,je[Ib]=fn,je[Rb]=rn,je}function _3(t){const e=Ot(t.locale)?t.locale:Qf,i=Ot(t.fallbackLocale)||jn(t.fallbackLocale)||Ti(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:e,n=En(t.missing)?t.missing:void 0,r=ji(t.silentTranslationWarn)||Ed(t.silentTranslationWarn)?!t.silentTranslationWarn:!0,s=ji(t.silentFallbackWarn)||Ed(t.silentFallbackWarn)?!t.silentFallbackWarn:!0,o=ji(t.fallbackRoot)?t.fallbackRoot:!0,u=!!t.formatFallbackMessages,h=Ti(t.modifiers)?t.modifiers:{},p=t.pluralizationRules,g=En(t.postTranslation)?t.postTranslation:void 0,y=Ot(t.warnHtmlInMessage)?t.warnHtmlInMessage!=="off":!0,S=!!t.escapeParameterHtml,P=ji(t.sync)?t.sync:!0;let R=t.messages;if(Ti(t.sharedMessages)){const ae=t.sharedMessages;R=Object.keys(ae).reduce((pe,le)=>{const ze=pe[le]||(pe[le]={});return pr(ze,ae[le]),pe},R||{})}const{__i18n:k,__root:M,__injectWithOption:L}=t,q=t.datetimeFormats,Z=t.numberFormats,J=t.flatJson;return{locale:e,fallbackLocale:i,messages:R,flatJson:J,datetimeFormats:q,numberFormats:Z,missing:n,missingWarn:r,fallbackWarn:s,fallbackRoot:o,fallbackFormat:u,modifiers:h,pluralRules:p,postTranslation:g,warnHtmlMessage:y,escapeParameter:S,messageResolver:t.messageResolver,inheritLocale:P,__i18n:k,__root:M,__injectWithOption:L}}function Fb(t={}){const e=Mb(_3(t)),{__extender:i}=t,n={id:e.id,get locale(){return e.locale.value},set locale(r){e.locale.value=r},get fallbackLocale(){return e.fallbackLocale.value},set fallbackLocale(r){e.fallbackLocale.value=r},get messages(){return e.messages.value},get datetimeFormats(){return e.datetimeFormats.value},get numberFormats(){return e.numberFormats.value},get availableLocales(){return e.availableLocales},get missing(){return e.getMissingHandler()},set missing(r){e.setMissingHandler(r)},get silentTranslationWarn(){return ji(e.missingWarn)?!e.missingWarn:e.missingWarn},set silentTranslationWarn(r){e.missingWarn=ji(r)?!r:r},get silentFallbackWarn(){return ji(e.fallbackWarn)?!e.fallbackWarn:e.fallbackWarn},set silentFallbackWarn(r){e.fallbackWarn=ji(r)?!r:r},get modifiers(){return e.modifiers},get formatFallbackMessages(){return e.fallbackFormat},set formatFallbackMessages(r){e.fallbackFormat=r},get postTranslation(){return e.getPostTranslationHandler()},set postTranslation(r){e.setPostTranslationHandler(r)},get sync(){return e.inheritLocale},set sync(r){e.inheritLocale=r},get warnHtmlInMessage(){return e.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(r){e.warnHtmlMessage=r!=="off"},get escapeParameterHtml(){return e.escapeParameter},set escapeParameterHtml(r){e.escapeParameter=r},get pluralizationRules(){return e.pluralRules||{}},__composer:e,t(...r){return Reflect.apply(e.t,e,[...r])},rt(...r){return Reflect.apply(e.rt,e,[...r])},tc(...r){const[s,o,u]=r,h={plural:1};let p=null,g=null;if(!Ot(s))throw Is(cs.INVALID_ARGUMENT);const y=s;return Ot(o)?h.locale=o:Qn(o)?h.plural=o:jn(o)?p=o:Ti(o)&&(g=o),Ot(u)?h.locale=u:jn(u)?p=u:Ti(u)&&(g=u),Reflect.apply(e.t,e,[y,p||g||{},h])},te(r,s){return e.te(r,s)},tm(r){return e.tm(r)},getLocaleMessage(r){return e.getLocaleMessage(r)},setLocaleMessage(r,s){e.setLocaleMessage(r,s)},mergeLocaleMessage(r,s){e.mergeLocaleMessage(r,s)},d(...r){return Reflect.apply(e.d,e,[...r])},getDateTimeFormat(r){return e.getDateTimeFormat(r)},setDateTimeFormat(r,s){e.setDateTimeFormat(r,s)},mergeDateTimeFormat(r,s){e.mergeDateTimeFormat(r,s)},n(...r){return Reflect.apply(e.n,e,[...r])},getNumberFormat(r){return e.getNumberFormat(r)},setNumberFormat(r,s){e.setNumberFormat(r,s)},mergeNumberFormat(r,s){e.mergeNumberFormat(r,s)}};return n.__extender=i,n}function w3(t,e,i){return{beforeCreate(){const n=lc();if(!n)throw Is(cs.UNEXPECTED_ERROR);const r=this.$options;if(r.i18n){const s=r.i18n;if(r.__i18n&&(s.__i18n=r.__i18n),s.__root=e,this===this.$root)this.$i18n=iC(t,s);else{s.__injectWithOption=!0,s.__extender=i.__vueI18nExtend,this.$i18n=Fb(s);const o=this.$i18n;o.__extender&&(o.__disposer=o.__extender(this.$i18n))}}else if(r.__i18n)if(this===this.$root)this.$i18n=iC(t,r);else{this.$i18n=Fb({__i18n:r.__i18n,__injectWithOption:!0,__extender:i.__vueI18nExtend,__root:e});const s=this.$i18n;s.__extender&&(s.__disposer=s.__extender(this.$i18n))}else this.$i18n=t;r.__i18nGlobal&&Z1(e,r,r),this.$t=(...s)=>this.$i18n.t(...s),this.$rt=(...s)=>this.$i18n.rt(...s),this.$tc=(...s)=>this.$i18n.tc(...s),this.$te=(s,o)=>this.$i18n.te(s,o),this.$d=(...s)=>this.$i18n.d(...s),this.$n=(...s)=>this.$i18n.n(...s),this.$tm=s=>this.$i18n.tm(s),i.__setInstance(n,this.$i18n)},mounted(){},unmounted(){const n=lc();if(!n)throw Is(cs.UNEXPECTED_ERROR);const r=this.$i18n;delete this.$t,delete this.$rt,delete this.$tc,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,r.__disposer&&(r.__disposer(),delete r.__disposer,delete r.__extender),i.__deleteInstance(n),delete this.$i18n}}}function iC(t,e){t.locale=e.locale||t.locale,t.fallbackLocale=e.fallbackLocale||t.fallbackLocale,t.missing=e.missing||t.missing,t.silentTranslationWarn=e.silentTranslationWarn||t.silentFallbackWarn,t.silentFallbackWarn=e.silentFallbackWarn||t.silentFallbackWarn,t.formatFallbackMessages=e.formatFallbackMessages||t.formatFallbackMessages,t.postTranslation=e.postTranslation||t.postTranslation,t.warnHtmlInMessage=e.warnHtmlInMessage||t.warnHtmlInMessage,t.escapeParameterHtml=e.escapeParameterHtml||t.escapeParameterHtml,t.sync=e.sync||t.sync,t.__composer[K1](e.pluralizationRules||t.pluralizationRules);const i=Lb(t.locale,{messages:e.messages,__i18n:e.__i18n});return Object.keys(i).forEach(n=>t.mergeLocaleMessage(n,i[n])),e.datetimeFormats&&Object.keys(e.datetimeFormats).forEach(n=>t.mergeDateTimeFormat(n,e.datetimeFormats[n])),e.numberFormats&&Object.keys(e.numberFormats).forEach(n=>t.mergeNumberFormat(n,e.numberFormats[n])),t}const Nb={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:t=>t==="parent"||t==="global",default:"parent"},i18n:{type:Object}};function T3({slots:t},e){return e.length===1&&e[0]==="default"?(t.default?t.default():[]).reduce((n,r)=>[...n,...r.type===ct?r.children:[r]],[]):e.reduce((i,n)=>{const r=t[n];return r&&(i[n]=r()),i},an())}function nC(){return ct}const rC=qv({name:"i18n-t",props:pr({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:t=>Qn(t)||!isNaN(t)}},Nb),setup(t,e){const{slots:i,attrs:n}=e,r=t.i18n||Bb({useScope:t.scope,__useComponent:!0});return()=>{const s=Object.keys(i).filter(y=>y!=="_"),o=an();t.locale&&(o.locale=t.locale),t.plural!==void 0&&(o.plural=Ot(t.plural)?+t.plural:t.plural);const u=T3(e,s),h=r[kb](t.keypath,u,o),p=pr(an(),n),g=Ot(t.tag)||Ki(t.tag)?t.tag:nC();return lb(g,p,h)}}});function x3(t){return jn(t)&&!Ot(t[0])}function sC(t,e,i,n){const{slots:r,attrs:s}=e;return()=>{const o={part:!0};let u=an();t.locale&&(o.locale=t.locale),Ot(t.format)?o.key=t.format:Ki(t.format)&&(Ot(t.format.key)&&(o.key=t.format.key),u=Object.keys(t.format).reduce((S,P)=>i.includes(P)?pr(an(),S,{[P]:t.format[P]}):S,an()));const h=n(t.value,o,u);let p=[o.key];jn(h)?p=h.map((S,P)=>{const R=r[S.type],k=R?R({[S.type]:S.value,index:P,parts:h}):[S.value];return x3(k)&&(k[0].key=`${S.type}-${P}`),k}):Ot(h)&&(p=[h]);const g=pr(an(),s),y=Ot(t.tag)||Ki(t.tag)?t.tag:nC();return lb(y,g,p)}}const oC=qv({name:"i18n-n",props:pr({value:{type:Number,required:!0},format:{type:[String,Object]}},Nb),setup(t,e){const i=t.i18n||Bb({useScope:t.scope,__useComponent:!0});return sC(t,e,U1,(...n)=>i[Rb](...n))}}),aC=qv({name:"i18n-d",props:pr({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},Nb),setup(t,e){const i=t.i18n||Bb({useScope:t.scope,__useComponent:!0});return sC(t,e,N1,(...n)=>i[Ib](...n))}});function S3(t,e){const i=t;if(t.mode==="composition")return i.__getInstance(e)||t.global;{const n=i.__getInstance(e);return n!=null?n.__composer:t.global.__composer}}function E3(t){const e=o=>{const{instance:u,value:h}=o;if(!u||!u.$)throw Is(cs.UNEXPECTED_ERROR);const p=S3(t,u.$),g=lC(h);return[Reflect.apply(p.t,p,[...uC(g)]),p]};return{created:(o,u)=>{const[h,p]=e(u);Ig&&t.global===p&&(o.__i18nWatcher=Td(p.locale,()=>{u.instance&&u.instance.$forceUpdate()})),o.__composer=p,o.textContent=h},unmounted:o=>{Ig&&o.__i18nWatcher&&(o.__i18nWatcher(),o.__i18nWatcher=void 0,delete o.__i18nWatcher),o.__composer&&(o.__composer=void 0,delete o.__composer)},beforeUpdate:(o,{value:u})=>{if(o.__composer){const h=o.__composer,p=lC(u);o.textContent=Reflect.apply(h.t,h,[...uC(p)])}},getSSRProps:o=>{const[u]=e(o);return{textContent:u}}}}function lC(t){if(Ot(t))return{path:t};if(Ti(t)){if(!("path"in t))throw Is(cs.REQUIRED_VALUE,"path");return t}else throw Is(cs.INVALID_VALUE)}function uC(t){const{path:e,locale:i,args:n,choice:r,plural:s}=t,o={},u=n||{};return Ot(i)&&(o.locale=i),Qn(r)&&(o.plural=r),Qn(s)&&(o.plural=s),[e,u,o]}function C3(t,e,...i){const n=Ti(i[0])?i[0]:{};(ji(n.globalInstall)?n.globalInstall:!0)&&([rC.name,"I18nT"].forEach(s=>t.component(s,rC)),[oC.name,"I18nN"].forEach(s=>t.component(s,oC)),[aC.name,"I18nD"].forEach(s=>t.component(s,aC))),t.directive("t",E3(e))}const A3=ru("global-vue-i18n");function D3(t={},e){const i=__VUE_I18N_LEGACY_API__&&ji(t.legacy)?t.legacy:__VUE_I18N_LEGACY_API__,n=ji(t.globalInjection)?t.globalInjection:!0,r=new Map,[s,o]=P3(t,i),u=ru("");function h(S){return r.get(S)||null}function p(S,P){r.set(S,P)}function g(S){r.delete(S)}const y={get mode(){return __VUE_I18N_LEGACY_API__&&i?"legacy":"composition"},async install(S,...P){if(S.__VUE_I18N_SYMBOL__=u,S.provide(S.__VUE_I18N_SYMBOL__,y),Ti(P[0])){const M=P[0];y.__composerExtend=M.__composerExtend,y.__vueI18nExtend=M.__vueI18nExtend}let R=null;!i&&n&&(R=N3(S,y.global)),__VUE_I18N_FULL_INSTALL__&&C3(S,y,...P),__VUE_I18N_LEGACY_API__&&i&&S.mixin(w3(o,o.__composer,y));const k=S.unmount;S.unmount=()=>{R&&R(),y.dispose(),k()}},get global(){return o},dispose(){s.stop()},__instances:r,__getInstance:h,__setInstance:p,__deleteInstance:g};return y}function Bb(t={}){const e=lc();if(e==null)throw Is(cs.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw Is(cs.NOT_INSTALLED);const i=k3(e),n=R3(i),r=X1(e),s=I3(t,r);if(s==="global")return Z1(n,t,r),n;if(s==="parent"){let h=O3(i,e,t.__useComponent);return h==null&&(h=n),h}const o=i;let u=o.__getInstance(e);if(u==null){const h=pr({},t);"__i18n"in r&&(h.__i18n=r.__i18n),n&&(h.__root=n),u=Mb(h),o.__composerExtend&&(u[Ob]=o.__composerExtend(u)),M3(o,e,u),o.__setInstance(e,u)}return u}function P3(t,e,i){const n=gF(),r=__VUE_I18N_LEGACY_API__&&e?n.run(()=>Fb(t)):n.run(()=>Mb(t));if(r==null)throw Is(cs.UNEXPECTED_ERROR);return[n,r]}function k3(t){const e=Bf(t.isCE?A3:t.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw Is(t.isCE?cs.NOT_INSTALLED_WITH_PROVIDE:cs.UNEXPECTED_ERROR);return e}function I3(t,e){return Rg(t)?"__i18n"in e?"local":"global":t.useScope?t.useScope:"local"}function R3(t){return t.mode==="composition"?t.global:t.global.__composer}function O3(t,e,i=!1){let n=null;const r=e.root;let s=L3(e,i);for(;s!=null;){const o=t;if(t.mode==="composition")n=o.__getInstance(s);else if(__VUE_I18N_LEGACY_API__){const u=o.__getInstance(s);u!=null&&(n=u.__composer,i&&n&&!n[Y1]&&(n=null))}if(n!=null||r===s)break;s=s.parent}return n}function L3(t,e=!1){return t==null?null:e&&t.vnode.ctx||t.parent}function M3(t,e,i){Gv(()=>{},e),Kv(()=>{const n=i;t.__deleteInstance(e);const r=n[Ob];r&&(r(),delete n[Ob])},e)}const F3=["locale","fallbackLocale","availableLocales"],cC=["t","rt","d","n","tm","te"];function N3(t,e){const i=Object.create(null);return F3.forEach(r=>{const s=Object.getOwnPropertyDescriptor(e,r);if(!s)throw Is(cs.UNEXPECTED_ERROR);const o=br(s.value)?{get(){return s.value.value},set(u){s.value.value=u}}:{get(){return s.get&&s.get()}};Object.defineProperty(i,r,o)}),t.config.globalProperties.$i18n=i,cC.forEach(r=>{const s=Object.getOwnPropertyDescriptor(e,r);if(!s||!s.value)throw Is(cs.UNEXPECTED_ERROR);Object.defineProperty(t.config.globalProperties,`$${r}`,s)}),()=>{delete t.config.globalProperties.$i18n,cC.forEach(r=>{delete t.config.globalProperties[`$${r}`]})}}if(y3(),X4(k4),Z4(G4),Q4(S1),__INTLIFY_PROD_DEVTOOLS__){const t=dc();t.__INTLIFY__=!0,I4(t.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const B3={ui:{collection:"Collection",currentlyViewing:"Currently Viewing",fullscreen:"Fullscreen",exitFullscreen:"Exit Fullscreen",index:"Index",image:"Image",images:"Images",annotation:"Annotation",annotations:"Annotations",allAnnotations:"All Annotations",noAnnotations:"No Annotations",about:"About",settings:"Settings",preference:"Preference",language:"Language",allLanguages:"All Languages",annotationFilters:"Annotation Filters",show:"Show",lineColor:"Line Color",allLineColors:"All Line Colors",lineWeight:"Line Weight",allLineWeights:"All Line Weights",display:"Display",light:"Light",informationPanel:"Information Panel",tableColumns:"Table Columns",title:"Title",description:"Description",links:"Links",tags:"Tags",notes:"Notes",attribution:"Attribution",date:"Date",comments:"Comments",canvasInformation:"Canvas Information",search:"Search",thumbnail:"Thumbnail",label:"Label",items:"Items",structures:"Structures",dropManifests:"Drop manifests here",summary:"Summary",rights:"Rights",altRepresentation:"Alternative Representation",homepage:"Homepage",seeAlso:"See Also",provider:"Provider",details:"Details",close:"Close"},message:{invalidImage:"Missing/Unsupported Image",noResults:"No results found.",noAnnotations:"No annotations available"}},H3={ui:{collection:"Sammlung",currentlyViewing:"Aktuell angezeigt",fullscreen:"Vollbild",exitFullscreen:"Vollbildmodus beenden",index:"Index",image:"Bild",images:"Bilder",annotation:"Annotation",annotations:"Annotationen",allAnnotations:"Alle Annotationen",noAnnotations:"Keine Annotationen",about:"Über",settings:"Einstellungen",preference:"Präferenz",language:"Sprache",allLanguages:"Alle Sprachen",annotationFilters:"Anmerkungsfilter",show:"Anzeigen",lineColor:"Linienfarbe",allLineColors:"Alle Linienfarben",lineWeight:"Linienhelligkeit",allLineWeights:"Alle Linienhelligkeiten",display:"Anzeige",light:"Licht",informationPanel:"Informationspanel",tableColumns:"Tabellenspalten",title:"Titel",description:"Beschreibung",links:"Links",tags:"Tags",notes:"Notizen",attribution:"Zuschreibung",date:"Datum",comments:"Kommentare",canvasInformation:"Canvas-Informationen",search:"Suche",thumbnail:"Miniaturbild",label:"Label",items:"Elemente",structures:"Strukturen",dropManifests:"Manifests hier ablegen",summary:"Zusammenfassung",rights:"Rechte",altRepresentation:"Alternative Darstellung",homepage:"Startseite",seeAlso:"Siehe auch",provider:"Anbieter",details:"Details",close:"Schließen"},message:{invalidImage:"Fehlendes/nicht unterstütztes Bild",noResults:"Keine Ergebnisse gefunden.",noAnnotations:"Keine Annotationen verfügbar"}},U3={ui:{collection:"Colección",currentlyViewing:"Viendo actualmente",fullscreen:"Pantalla completa",exitFullscreen:"Salir de pantalla completa",index:"Índice",image:"Imagen",images:"Imágenes",annotation:"Anotación",annotations:"Anotaciones",allAnnotations:"Todas las anotaciones",noAnnotations:"No hay anotaciones",about:"Acerca de",settings:"Configuración",preference:"Preferencia",language:"Idioma",allLanguages:"Todos los idiomas",annotationFilters:"Filtros de anotación",show:"Mostrar",lineColor:"Color de línea",allLineColors:"Todos los colores de línea",lineWeight:"Luminosidad de línea",allLineWeights:"Todas las luminosidades de línea",display:"Visualización",light:"Luz",informationPanel:"Panel de información",tableColumns:"Columnas de la tabla",title:"Título",description:"Descripción",links:"Enlaces",tags:"Etiquetas",notes:"Notas",attribution:"Atribución",date:"Fecha",comments:"Comentarios",canvasInformation:"Información del lienzo",search:"Buscar",thumbnail:"Miniatura",label:"Etiqueta",items:"Elementos",structures:"Estructuras",dropManifests:"Suelta los manifests aquí",summary:"Resumen",rights:"Derechos",altRepresentation:"Representación alternativa",homepage:"Página principal",seeAlso:"Ver también",provider:"Proveedor",details:"Detalles",close:"Cerrar"},message:{invalidImage:"Imagen faltante/no compatible",noResults:"No se encontraron resultados.",noAnnotations:"No hay anotaciones disponibles"}},z3={ui:{collection:"Collection",currentlyViewing:"Actuellement en affichage",fullscreen:"Plein écran",exitFullscreen:"Quitter le plein écran",index:"Index",image:"Image",images:"Images",annotation:"Annotation",annotations:"Annotations",allAnnotations:"Toutes les annotations",noAnnotations:"Aucune annotation",about:"À propos",settings:"Paramètres",preference:"Préférence",language:"Langue",allLanguages:"Toutes les langues",annotationFilters:"Filtres d’annotation",show:"Afficher",lineColor:"Couleur du trait",allLineColors:"Toutes les couleurs de trait",lineWeight:"Luminosité du trait",allLineWeights:"Toutes les luminosités de trait",display:"Affichage",light:"Lumière",informationPanel:"Panneau d’information",tableColumns:"Colonnes du tableau",title:"Titre",description:"Description",links:"Liens",tags:"Étiquettes",notes:"Notes",attribution:"Attribution",date:"Date",comments:"Commentaires",canvasInformation:"Informations sur le canevas",search:"Recherche",thumbnail:"Vignette",label:"Étiquette",items:"Éléments",structures:"Structures",dropManifests:"Déposez les manifests ici",summary:"Résumé",rights:"Droits",altRepresentation:"Représentation alternative",homepage:"Page d’accueil",seeAlso:"Voir aussi",provider:"Fournisseur",details:"Détails",close:"Fermer"},message:{invalidImage:"Image manquante/non prise en charge",noResults:"Aucun résultat trouvé.",noAnnotations:"Aucune annotation disponible"}},V3={ui:{collection:"Collezione",currentlyViewing:"Attualmente in visualizzazione",fullscreen:"Schermo intero",exitFullscreen:"Esci da schermo intero",index:"Indice",image:"Immagine",images:"Immagini",annotation:"Annotazione",annotations:"Annotazioni",allAnnotations:"Tutte le annotazioni",noAnnotations:"Nessuna annotazione",about:"Informazioni",settings:"Impostazioni",preference:"Preferenza",language:"Lingua",allLanguages:"Tutte le lingue",annotationFilters:"Filtri annotazioni",show:"Mostra",lineColor:"Colore della linea",allLineColors:"Tutti i colori della linea",lineWeight:"Luminosità della linea",allLineWeights:"Tutte le luminosità della linea",display:"Visualizzazione",light:"Luce",informationPanel:"Pannello informazioni",tableColumns:"Colonne della tabella",title:"Titolo",description:"Descrizione",links:"Collegamenti",tags:"Tag",notes:"Note",attribution:"Attribuzione",date:"Data",comments:"Commenti",canvasInformation:"Informazioni sulla tela",search:"Cerca",thumbnail:"Miniatura",label:"Etichetta",items:"Elementi",structures:"Strutture",dropManifests:"Trascina i manifests qui",summary:"Riepilogo",rights:"Diritti",altRepresentation:"Rappresentazione alternativa",homepage:"Pagina principale",seeAlso:"Vedi anche",provider:"Fornitore",details:"Dettagli",close:"Chiudi"},message:{invalidImage:"Immagine mancante/non supportata",noResults:"Nessun risultato trovato.",noAnnotations:"Nessuna annotazione disponibile"}},j3={ui:{collection:"Collectie",currentlyViewing:"Momenteel bekeken",fullscreen:"Volledig scherm",exitFullscreen:"Volledig scherm afsluiten",index:"Index",image:"Afbeelding",images:"Afbeeldingen",annotation:"Annotatie",annotations:"Annotaties",allAnnotations:"Alle annotaties",noAnnotations:"Geen annotaties",about:"Over",settings:"Instellingen",preference:"Voorkeur",language:"Taal",allLanguages:"Alle talen",annotationFilters:"Annotatiefilters",show:"Weergeven",lineColor:"Lijnkleur",allLineColors:"Alle lijnkleuren",lineWeight:"Lijnhelderheid",allLineWeights:"Alle lijnhelderheden",display:"Weergave",light:"Licht",informationPanel:"Informatiepaneel",tableColumns:"Tabelkolommen",title:"Titel",description:"Beschrijving",links:"Links",tags:"Tags",notes:"Notities",attribution:"Toeschrijving",date:"Datum",comments:"Opmerkingen",canvasInformation:"Canvasinformatie",search:"Zoeken",thumbnail:"Miniatuur",label:"Label",items:"Items",structures:"Structuren",dropManifests:"Sleep manifests hierheen",summary:"Samenvatting",rights:"Rechten",altRepresentation:"Alternatieve weergave",homepage:"Startpagina",seeAlso:"Zie ook",provider:"Provider",details:"Details",close:"Sluiten"},message:{invalidImage:"Ontbrekende/niet-ondersteunde afbeelding",noResults:"Geen resultaten gevonden.",noAnnotations:"Geen annotaties beschikbaar"}},W3={ui:{collection:"合集",currentlyViewing:"當前查看",fullscreen:"全螢幕",exitFullscreen:"退出全螢幕",index:"索引",image:"圖像",images:"圖像集",annotation:"標註",annotations:"標註集",allAnnotations:"所有標註",noAnnotations:"無標註",about:"關於",settings:"設定",preference:"偏好",language:"語言",allLanguages:"所有語言",annotationFilters:"標註篩選",show:"顯示",lineColor:"線條顏色",allLineColors:"所有線條顏色",lineWeight:"線條亮度",allLineWeights:"所有線條亮度",display:"顯示",light:"亮度",informationPanel:"資訊面板",tableColumns:"表格欄位",title:"標題",description:"描述",links:"連結",tags:"標籤",notes:"備註",attribution:"歸屬",date:"日期",comments:"評論",canvasInformation:"畫布資訊",search:"搜尋",thumbnail:"縮圖",label:"標籤",items:"項目",structures:"結構",dropManifests:"將 manifests 拖放到此處",summary:"摘要",rights:"權限",altRepresentation:"替代表示",homepage:"首頁",seeAlso:"另見",provider:"提供方",details:"詳細資訊",close:"關閉"},message:{invalidImage:"缺少/不支援的圖像",noResults:"未找到結果。",noAnnotations:"暫無標註"}},q3={ui:{collection:"Samling",currentlyViewing:"Aktuelt vises",fullscreen:"Fuld skærm",exitFullscreen:"Forlad fuld skærm",index:"Indeks",image:"Billede",images:"Billeder",annotation:"Annotation",annotations:"Annotationer",allAnnotations:"Alle annotationer",noAnnotations:"Ingen annotationer",about:"Om",settings:"Indstillinger",preference:"Præference",language:"Sprog",allLanguages:"Alle sprog",annotationFilters:"Annotationsfiltre",show:"Vis",lineColor:"Linjefarve",allLineColors:"Alle linjefarver",lineWeight:"Linjelysstyrke",allLineWeights:"Alle linjelysstyrker",display:"Visning",light:"Lys",informationPanel:"Informationspanel",tableColumns:"Tabelkolonner",title:"Titel",description:"Beskrivelse",links:"Links",tags:"Tags",notes:"Noter",attribution:"Attribution",date:"Dato",comments:"Kommentarer",canvasInformation:"Canvas-information",search:"Søg",thumbnail:"Miniaturebillede",label:"Etiket",items:"Elementer",structures:"Strukturer",dropManifests:"Træk manifests her",summary:"Resumé",rights:"Rettigheder",altRepresentation:"Alternativ repræsentation",homepage:"Hjemmeside",seeAlso:"Se også",provider:"Udbyder",details:"Detaljer",close:"Luk"},message:{invalidImage:"Manglende/ikke-understøttet billede",noResults:"Ingen resultater fundet.",noAnnotations:"Ingen annotationer tilgængelige"}},G3={ui:{collection:"Συλλογή",currentlyViewing:"Τρέχουσα προβολή",fullscreen:"Πλήρης οθόνη",exitFullscreen:"Έξοδος από την πλήρη οθόνη",index:"Ευρετήριο",image:"Εικόνα",images:"Εικόνες",annotation:"Σημείωση",annotations:"Σημειώσεις",allAnnotations:"Όλες οι σημειώσεις",noAnnotations:"Δεν υπάρχουν σημειώσεις",about:"Σχετικά",settings:"Ρυθμίσεις",preference:"Προτίμηση",language:"Γλώσσα",allLanguages:"Όλες οι γλώσσες",annotationFilters:"Φίλτρα σημειώσεων",show:"Εμφάνιση",lineColor:"Χρώμα γραμμής",allLineColors:"Όλα τα χρώματα γραμμής",lineWeight:"Φωτεινότητα γραμμής",allLineWeights:"Όλες οι φωτεινότητες γραμμής",display:"Εμφάνιση",light:"Φως",informationPanel:"Πίνακας πληροφοριών",tableColumns:"Στήλες πίνακα",title:"Τίτλος",description:"Περιγραφή",links:"Σύνδεσμοι",tags:"Ετικέτες",notes:"Σημειώσεις",attribution:"Αναφορά",date:"Ημερομηνία",comments:"Σχόλια",canvasInformation:"Πληροφορίες καμβά",search:"Αναζήτηση",thumbnail:"Μικρογραφία",label:"Ετικέτα",items:"Στοιχεία",structures:"Δομές",dropManifests:"Σύρετε τα manifests εδώ",summary:"Περίληψη",rights:"Δικαιώματα",altRepresentation:"Εναλλακτική αναπαράσταση",homepage:"Αρχική σελίδα",seeAlso:"Δείτε επίσης",provider:"Πάροχος",details:"Λεπτομέρειες",close:"Κλείσιμο"},message:{invalidImage:"Εικόνα που λείπει/μη υποστηριζόμενη",noResults:"Δεν βρέθηκαν αποτελέσματα.",noAnnotations:"Δεν υπάρχουν διαθέσιμες σημειώσεις"}},K3={ui:{collection:"Kokoelma",currentlyViewing:"Tällä hetkellä katsotaan",fullscreen:"Koko näyttö",exitFullscreen:"Poistu koko näytöstä",index:"Indeksi",image:"Kuva",images:"Kuvat",annotation:"Merkintä",annotations:"Merkinnät",allAnnotations:"Kaikki merkinnät",noAnnotations:"Ei merkintöjä",about:"Tietoja",settings:"Asetukset",preference:"Mieltymys",language:"Kieli",allLanguages:"Kaikki kielet",annotationFilters:"Merkintäsuodattimet",show:"Näytä",lineColor:"Viivan väri",allLineColors:"Kaikki viivavärit",lineWeight:"Viivan kirkkaus",allLineWeights:"Kaikki viivan kirkkaudet",display:"Näyttö",light:"Valo",informationPanel:"Tietopaneeli",tableColumns:"Taulukkoluokat",title:"Otsikko",description:"Kuvaus",links:"Linkit",tags:"Tunnisteet",notes:"Muistiinpanot",attribution:"Tekijänoikeudet",date:"Päivämäärä",comments:"Kommentit",canvasInformation:"Kangastiedot",search:"Haku",thumbnail:"Pikkukuva",label:"Tunniste",items:"Esineet",structures:"Rakenteet",dropManifests:"Vedä manifestit tähän",summary:"Yhteenveto",rights:"Oikeudet",altRepresentation:"Vaihtoehtoinen esitys",homepage:"Etusivu",seeAlso:"Katso myös",provider:"Toimittaja",details:"Yksityiskohdat",close:"Sulje"},message:{invalidImage:"Puuttuva/ei tuettu kuva",noResults:"Ei tuloksia.",noAnnotations:"Ei saatavilla olevia merkintöjä"}},Y3={ui:{collection:"संग्रह",currentlyViewing:"वर्तमान में देख रहे हैं",fullscreen:"पूर्ण स्क्रीन",exitFullscreen:"पूर्ण स्क्रीन से बाहर जाएं",index:"सूची",image:"चित्र",images:"चित्र",annotation:"टिप्पणी",annotations:"टिप्पणियाँ",allAnnotations:"सभी टिप्पणियाँ",noAnnotations:"कोई टिप्पणियाँ नहीं",about:"के बारे में",settings:"सेटिंग्स",preference:"प्राथमिकता",language:"भाषा",allLanguages:"सभी भाषाएँ",annotationFilters:"टिप्पणी फ़िल्टर",show:"दिखाएं",lineColor:"लाइन का रंग",allLineColors:"सभी लाइन रंग",lineWeight:"लाइन की चमक",allLineWeights:"सभी लाइन चमक",display:"प्रदर्शन",light:"प्रकाश",informationPanel:"जानकारी पैनल",tableColumns:"तालिका कॉलम",title:"शीर्षक",description:"विवरण",links:"लिंक",tags:"टैग",notes:"नोट्स",attribution:"श्रेय",date:"तारीख",comments:"टिप्पणियाँ",canvasInformation:"कैनवास जानकारी",search:"खोज",thumbnail:"थंबनेल",label:"लेबल",items:"आइटम",structures:"संरचनाएँ",dropManifests:"यहाँ मैनिफेस्ट ड्रॉप करें",summary:"सारांश",rights:"अधिकार",altRepresentation:"वैकल्पिक प्रतिनिधित्व",homepage:"मुख्य पृष्ठ",seeAlso:"यह भी देखें",provider:"प्रदाता",details:"विवरण",close:"बंद करें"},message:{invalidImage:"गायब/असमर्थित चित्र",noResults:"कोई परिणाम नहीं मिला।",noAnnotations:"कोई टिप्पणियाँ उपलब्ध नहीं हैं"}},X3={ui:{collection:"コレクション",currentlyViewing:"現在表示中",fullscreen:"全画面表示",exitFullscreen:"全画面表示を終了",index:"インデックス",image:"画像",images:"画像",annotation:"注釈",annotations:"注釈",allAnnotations:"すべての注釈",noAnnotations:"注釈はありません",about:"について",settings:"設定",preference:"設定",language:"言語",allLanguages:"すべての言語",annotationFilters:"注釈フィルター",show:"表示",lineColor:"線の色",allLineColors:"すべての線の色",lineWeight:"線の明度",allLineWeights:"すべての線の明度",display:"表示",light:"ライト",informationPanel:"情報パネル",tableColumns:"テーブル列",title:"タイトル",description:"説明",links:"リンク",tags:"タグ",notes:"ノート",attribution:"帰属",date:"日付",comments:"コメント",canvasInformation:"キャンバス情報",search:"検索",thumbnail:"サムネイル",label:"ラベル",items:"アイテム",structures:"構造",dropManifests:"マニフェストをここにドロップ",summary:"概要",rights:"権利",altRepresentation:"代替表現",homepage:"ホームページ",seeAlso:"関連情報",provider:"提供者",details:"詳細",close:"閉じる"},message:{invalidImage:"画像がない/非対応の画像",noResults:"結果が見つかりませんでした。",noAnnotations:"利用可能な注釈はありません"}},Z3={ui:{collection:"컬렉션",currentlyViewing:"현재 보기",fullscreen:"전체 화면",exitFullscreen:"전체 화면 종료",index:"목록",image:"이미지",images:"이미지들",annotation:"주석",annotations:"주석들",allAnnotations:"모든 주석",noAnnotations:"주석 없음",about:"소개",settings:"설정",preference:"기본 설정",language:"언어",allLanguages:"모든 언어",annotationFilters:"주석 필터",show:"표시",lineColor:"선 색상",allLineColors:"모든 선 색상",lineWeight:"선 밝기",allLineWeights:"모든 선 밝기",display:"디스플레이",light:"빛",informationPanel:"정보 패널",tableColumns:"테이블 열",title:"제목",description:"설명",links:"링크",tags:"태그",notes:"메모",attribution:"저작권 표시",date:"날짜",comments:"댓글",canvasInformation:"캔버스 정보",search:"검색",thumbnail:"썸네일",label:"라벨",items:"항목들",structures:"구조",dropManifests:"여기에 매니페스트를 드롭하세요",summary:"요약",rights:"권리",altRepresentation:"대체 표현",homepage:"홈페이지",seeAlso:"참고",provider:"제공자",details:"세부 사항",close:"닫기"},message:{invalidImage:"이미지 없음/지원되지 않는 이미지",noResults:"결과 없음",noAnnotations:"사용 가능한 주석이 없습니다"}},Q3={ui:{collection:"Samling",currentlyViewing:"For øyeblikket vist",fullscreen:"Fullskjerm",exitFullscreen:"Gå ut av fullskjerm",index:"Indeks",image:"Bilde",images:"Bilder",annotation:"Merknad",annotations:"Merknader",allAnnotations:"Alle merknader",noAnnotations:"Ingen merknader",about:"Om",settings:"Innstillinger",preference:"Preferanse",language:"Språk",allLanguages:"Alle språk",annotationFilters:"Merknadsfiltre",show:"Vis",lineColor:"Linjefarge",allLineColors:"Alle linjefarger",lineWeight:"Lysstyrke på linje",allLineWeights:"Alle lysstyrker på linje",display:"Visning",light:"Lys",informationPanel:"Informasjonspanel",tableColumns:"Tabellkolonner",title:"Tittel",description:"Beskrivelse",links:"Lenker",tags:"Tagger",notes:"Notater",attribution:"Attribution",date:"Dato",comments:"Kommentarer",canvasInformation:"Canvasinformasjon",search:"Søk",thumbnail:"Miniatyrbilde",label:"Etikett",items:"Elementer",structures:"Strukturer",dropManifests:"Dra manifestene hit",summary:"Sammendrag",rights:"Rettigheter",altRepresentation:"Alternativ representasjon",homepage:"Hjemmeside",seeAlso:"Se også",provider:"Leverandør",details:"Detaljer",close:"Lukk"},message:{invalidImage:"Manglende/ikke støttet bilde",noResults:"Ingen resultater funnet.",noAnnotations:"Ingen merknader tilgjengelig"}},J3={ui:{collection:"Kolekcja",currentlyViewing:"Aktualnie oglądane",fullscreen:"Pełny ekran",exitFullscreen:"Wyjdź z pełnego ekranu",index:"Indeks",image:"Obraz",images:"Obrazy",annotation:"Adnotacja",annotations:"Adnotacje",allAnnotations:"Wszystkie adnotacje",noAnnotations:"Brak adnotacji",about:"O",settings:"Ustawienia",preference:"Preferencje",language:"Język",allLanguages:"Wszystkie języki",annotationFilters:"Filtry adnotacji",show:"Pokaż",lineColor:"Kolor linii",allLineColors:"Wszystkie kolory linii",lineWeight:"Jasność linii",allLineWeights:"Wszystkie jasności linii",display:"Wyświetlanie",light:"Światło",informationPanel:"Panel informacji",tableColumns:"Kolumny tabeli",title:"Tytuł",description:"Opis",links:"Linki",tags:"Tagi",notes:"Notatki",attribution:"Atrybucja",date:"Data",comments:"Komentarze",canvasInformation:"Informacje o płótnie",search:"Szukaj",thumbnail:"Miniatura",label:"Etykieta",items:"Elementy",structures:"Struktury",dropManifests:"Upuść manifests tutaj",summary:"Podsumowanie",rights:"Prawa",altRepresentation:"Alternatywne przedstawienie",homepage:"Strona główna",seeAlso:"Zobacz także",provider:"Dostawca",details:"Szczegóły",close:"Zamknij"},message:{invalidImage:"Brakujący/nieobsługiwany obraz",noResults:"Brak wyników.",noAnnotations:"Brak dostępnych adnotacji"}},$3={ui:{collection:"Coleção",currentlyViewing:"Visualizando atualmente",fullscreen:"Tela cheia",exitFullscreen:"Sair da tela cheia",index:"Índice",image:"Imagem",images:"Imagens",annotation:"Anotação",annotations:"Anotações",allAnnotations:"Todas as anotações",noAnnotations:"Nenhuma anotação",about:"Sobre",settings:"Configurações",preference:"Preferência",language:"Idioma",allLanguages:"Todos os idiomas",annotationFilters:"Filtros de anotação",show:"Mostrar",lineColor:"Cor da linha",allLineColors:"Todas as cores de linha",lineWeight:"Luminosidade da linha",allLineWeights:"Todas as luminosidades de linha",display:"Exibição",light:"Luz",informationPanel:"Painel de informações",tableColumns:"Colunas da tabela",title:"Título",description:"Descrição",links:"Links",tags:"Tags",notes:"Notas",attribution:"Atribuição",date:"Data",comments:"Comentários",canvasInformation:"Informações da tela",search:"Pesquisar",thumbnail:"Miniatura",label:"Rótulo",items:"Itens",structures:"Estruturas",dropManifests:"Arraste os manifests aqui",summary:"Resumo",rights:"Direitos",altRepresentation:"Representação alternativa",homepage:"Página inicial",seeAlso:"Veja também",provider:"Fornecedor",details:"Detalhes",close:"Fechar"},message:{invalidImage:"Imagem ausente/não suportada",noResults:"Nenhum resultado encontrado.",noAnnotations:"Nenhuma anotação disponível"}},e5={ui:{collection:"Коллекция",currentlyViewing:"Просматривается в данный момент",fullscreen:"На весь экран",exitFullscreen:"Выход из полного экрана",index:"Индекс",image:"Изображение",images:"Изображения",annotation:"Аннотация",annotations:"Аннотации",allAnnotations:"Все аннотации",noAnnotations:"Нет аннотаций",about:"О программе",settings:"Настройки",preference:"Предпочтения",language:"Язык",allLanguages:"Все языки",annotationFilters:"Фильтры аннотаций",show:"Показать",lineColor:"Цвет линии",allLineColors:"Все цвета линий",lineWeight:"Яркость линии",allLineWeights:"Все яркости линий",display:"Отображение",light:"Освещение",informationPanel:"Информационная панель",tableColumns:"Столбцы таблицы",title:"Заголовок",description:"Описание",links:"Ссылки",tags:"Теги",notes:"Заметки",attribution:"Атрибуция",date:"Дата",comments:"Комментарии",canvasInformation:"Информация о холсте",search:"Поиск",thumbnail:"Миниатюра",label:"Метка",items:"Элементы",structures:"Структуры",dropManifests:"Перетащите манифесты сюда",summary:"Резюме",rights:"Права",altRepresentation:"Альтернативное представление",homepage:"Главная страница",seeAlso:"См. также",provider:"Поставщик",details:"Детали",close:"Закрыть"},message:{invalidImage:"Отсутствует/неподдерживаемое изображение",noResults:"Результатов не найдено.",noAnnotations:"Нет доступных аннотаций"}},t5={ui:{collection:"Samling",currentlyViewing:"För närvarande visning",fullscreen:"Helskärm",exitFullscreen:"Exit helskärm",index:"Index",image:"Bild",images:"Bilder",annotation:"Kommentar",annotations:"Kommentarer",allAnnotations:"Alla kommentarer",noAnnotations:"Inga kommentarer",about:"Om",settings:"Inställningar",preference:"Preferens",language:"Språk",allLanguages:"Alla språk",annotationFilters:"Kommentarfilter",show:"Visa",lineColor:"Linjekulör",allLineColors:"Alla linjekulörer",lineWeight:"Linjelys",allLineWeights:"Alla linjelys",display:"Visning",light:"Ljus",informationPanel:"Informationspanel",tableColumns:"Tabellkolumner",title:"Titel",description:"Beskrivning",links:"Länkar",tags:"Taggar",notes:"Anteckningar",attribution:"Attribuering",date:"Datum",comments:"Kommentarer",canvasInformation:"Canvasinformation",search:"Sök",thumbnail:"Miniatyrbild",label:"Etikett",items:"Föremål",structures:"Strukturer",dropManifests:"Släpp manifests här",summary:"Sammanfattning",rights:"Rättigheter",altRepresentation:"Alternativ representation",homepage:"Hemsida",seeAlso:"Se även",provider:"Leverantör",details:"Detaljer",close:"Stäng"},message:{invalidImage:"Saknad/icke-stödd bild",noResults:"Inga resultat hittades.",noAnnotations:"Inga kommentarer tillgängliga"}},i5={ui:{collection:"Bộ sưu tập",currentlyViewing:"Đang xem",fullscreen:"Toàn màn hình",exitFullscreen:"Thoát toàn màn hình",index:"Chỉ mục",image:"Hình ảnh",images:"Hình ảnh",annotation:"Chú thích",annotations:"Chú thích",allAnnotations:"Tất cả chú thích",noAnnotations:"Không có chú thích",about:"Giới thiệu",settings:"Cài đặt",preference:"Tùy chọn",language:"Ngôn ngữ",allLanguages:"Tất cả ngôn ngữ",annotationFilters:"Bộ lọc chú thích",show:"Hiển thị",lineColor:"Màu đường viền",allLineColors:"Tất cả màu đường viền",lineWeight:"Độ sáng đường viền",allLineWeights:"Tất cả độ sáng đường viền",display:"Hiển thị",light:"Ánh sáng",informationPanel:"Bảng thông tin",tableColumns:"Cột bảng",title:"Tiêu đề",description:"Mô tả",links:"Liên kết",tags:"Thẻ",notes:"Ghi chú",attribution:"Ghi nguồn",date:"Ngày",comments:"Bình luận",canvasInformation:"Thông tin về Canvas",search:"Tìm kiếm",thumbnail:"Hình thu nhỏ",label:"Nhãn",items:"Mục",structures:"Cấu trúc",dropManifests:"Kéo manifest vào đây",summary:"Tóm tắt",rights:"Quyền",altRepresentation:"Biểu diễn thay thế",homepage:"Trang chủ",seeAlso:"Xem thêm",provider:"Nhà cung cấp",details:"Chi tiết",close:"Đóng"},message:{invalidImage:"Thiếu/Ảnh không hỗ trợ",noResults:"Không tìm thấy kết quả.",noAnnotations:"Không có chú thích có sẵn"}},n5=D3({locale:localStorage.getItem("prefLang")||"en",fallbackLocale:"en",messages:{en:B3,de:H3,es:U3,fr:z3,it:V3,nl:j3,zh:W3,da:q3,el:G3,fi:K3,hi:Y3,ja:X3,ko:Z3,no:Q3,pl:J3,pt:$3,ru:e5,sv:t5,vi:i5}}),r5="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAfQAAAEvCAYAAACzLzNmAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAADWmSURBVHhe7d0HXFXl/wfw51wue8oegrgAt+YEFNwrZ5lajjRnmf5alv0qG/5tmf3KpjNnmmmpGSoucCsqbhkiLmSJ7A33/O+5fi0t7uLuez/vV8jz/R5UwqsfznPOeR6O53kGAAAApk1E7wEAAMCEIdABAADMAAIdAADADOAaej1U1UhsSipqnGtqJdbV0jehZyMWVYmtRNVOduJia+l72QcCAADoCQJdRRXVtXa/n7z57NaTN587cjW7L7Xr1KeNX8yYyCarh3UK/JVaAAAAOoVAV0II8p8OpM76fs/VN3KLKn2prZJGXo5przzZauGo8OD1OGsHAABdQqArcD27uPm4r+P/TM8paU6temnZ0PX8mtlRwwM9HG9SCwAAQKsQ6HL8cfr2qFdWnVxVWlXjTC2NuDna5K2YGTm6ewufA9QCAADQGgR6HU6m5nZ/etGBAzUSXnbDm7bYWYvK9s4f2LG5n0sStQAAALQCj639Q8b9ssDJ3x3+TdthLqioljhIf+3fi8qrXakFAACgFQj0f3j75zPf3C+p8qJS665lFYct+PXcZ1QCAABoBQL9EWeu53WLPZcxnEqd2XA4bWpSRmFrKgEAADSGQH/EB78kfkFDnZLwzGrRtosfUAkAAKAxBDrJKazwTUjLjaBS52IvZAx5uMocAACAphDo5GhyTk/GOI5Knauu5W3P37jfiUoAAACNINDJsaRsaaDr19nreV1pCAAAoBEEOskuqPCjod7czS9rSEMAAACNINBJRn5pEA31Jr+4yoOGAAAAGsFKcaTda9szsovK/anUi35t/f9wsrMqySmu9I4M8YkPD/WO79TU4zg2clGfsIlOZbXErqqm1lb63lbY2tZaLKqytbaqELa2Fd7bikWV9OEAAGYHgU76fLg78fLtgvZU6sWY8Mard5+/M6ywrNqdWrLlYTs28zz+MOCfaOJxEkH0b7Hn7w7Zez5jyNn0vK7q/Lm1C3I/3amZ+/GnujX+uWMTjxPUBgAweQh0MnHJ4e2xFzKGUakXo8KD1245fmMilXWytuIqOzX1PCGEe0SI9Ay+mecxO+nZJh22OMKiPN/tujr3ek5JCLXqrUNjj5Mv9G7+3TPhweuoBQBgshDoZO7ahB/XHUqbQaVeDGgfsG3PuYwRVKpEbMVVdQj2SIiQBrwQ8l2aex1xsLEqo8NmqaC0qsFPB1NnrdifMjuvuNKb2loT6OGYPnNA2JfPdm+yyty/lgBgvhDo5M+zd56a8v2RrVTqRddmXodOXsuNorJerDhW0zbY48yDgPeKjwj1iTOnUDpyNbu3sL5+amZRS2rpTJsgt7OLn+86rW2jBmepBQBgMhDopLSyxil0zta8mlrehlo65WgjLra1EZXdL6nyoZZW/DPguzX3PuxkJy6mwyZD+rLkvtl15a1Pf7/wf8JSudTWOWEG5IuJXWaMjWy8mloAACYBgf6IGUuPbdyecGsslTolDYxVm46mv0Clzog4Vts6sME52TV4mqZ3sbcupMNGKb+0yn3W8mPrD1zKGkQtvRNuWPx0QqeX7G2syqkFAGDUEOiPuHWvNLj7u39eraqR2FFLJ6RnzEVvjWz37nsbzyyhlh7xfMuGbhciQh/cRS8N+bgGjjb36aDBZRWU+49fcmjnpVv5HahlMF2aeR5Z/5/oIcb+DRAAgACB/g8f/pq46Ic9yW9QqRPvP9P+jRf6hHybeD2vy4mUnKjjyTlRCWn3Isqqap3oQ/SI50P8XK5EhEkDPsQ7Pqql7z5DBfz9kiqPEZ/tjU/JLG5FLYNrH+x+attbfaIt+ckCADANCPR/EHZAe2bxwX0nUjS7WU2e3q19dwlnfSKOk1BLplbCW124mf+EEPDHknOiT6Xmdi8sr25Ah/Xo8YCPDPM56Olsm0sHdaakosb56S/27z9/I78ztYxG/7YBO1bN6v602IqroRYAgNFBoNfhXlGld/T7MRe1/YhUU2/n5F3v9e+qyhSu9I+FS8oobH0sJSf6QchnR+UVa/cGOlUJn3d4mDTcQ73jhID3drXLokNa839bzn/67e6rb1FpdD4a0+HV6f1Cv6ISAMDoINDluJ1X2uj5bw5tv3KnsB21NCJM3a6dHTVckzBMvlvUUgj3EynZUcdTcqOyCioC6JBeNfJyTBOuwQvX3yPDvA/6N3C4Q4fq5fDV7D6jFx+Mlb4SjXZvAeHu933zB3YMC3C9RC0AAKOCQFegvKrWfu66U0u3HL85gVr1Mj6q6bIvJnbW+qI1N3NLmgjBLrsOL327mVvalA7pVYCHw01hFTsh4KNb+e5VJ+CraiQ20fNjLqXnlDSnltFqG9TgzK53+3e1EnG11AIAMBoIdBUI17TfXJfw47Ws4jBqqaRlQ9fzwjPNwnrs1NKpnMIK36PJOT0fXodPzSxsIf0j5uiw3jwa8MKjco28nK7ToX9ZtP3SB4v/uPQ+lUYPU+8AYKwQ6GrYlnBrTPzlrP7xlzP73s0vr3O71SbeTilRrXz39Wrlt2dA+4Ad1DYI4Xnuh+EuvL98u6CdPhdpecjXzS6DbrCLEx6Va+rjnCL0hRmQdq9vu1tUXu0m+0ATINxPEL9gcGvcIAcAxgaBXk/SLxsn4XmR8CbUwl3rwpv0fNhov6DCneQnUnN6nEq51/1IUnbPs+l54XRIrzycbbIjQn0OtQ5skPjJ7xc+prbJ+GF6xLMjuwRtohIAwCgg0C2YsIf4ydTcHg+vw59Ju9e1upa3pcM65epgfT/A3eG2tm461KfwEK/439/s05NKAACjgECHv1TWSGz1tdiNNBTjpN9ImGgo8vzJT4Y2U3RvAACAviHQQS5dLnbTs6XvnrgrWQOoNDm4OQ4AjA0CHVQm3DegrcVu2gS5nbl4q6AjlSanf/uA7Wtf7qHWXvYAALqEQAeNpGUXh8im6GVvuVEZeWWN6JBcwvXzwrJqdypNkpujTV7S1095UgkAYHAIdNCqu/llDQ9dye77MOTrWuymb1v/nfsu3B1CpcnKWDZGjEVmAMBYINBBp+pa7OatEW3f+2zbxf+jDzFZ178b5eRgKy6lEgDAoBDooFfCYjfZBeV+Pd/fZfJroid9/ZS7m6NNPpUAAAZltJthgHkS9lo3l7Na6bfCel9WFwBAHgQ66F2thBfT0KQ9XCUQAMAY4B8k0DsrkXmsgy4s9UtDAACDQ6CD3pnLxiacbNYdAMA4INBB72zEVpU0NGk2YlEVDQEADA6BDnrnYGNVRkOTZmttVUFDAACDQ6CD3pnDXe7CSnFYVAYAjAkCHQxC2IKUhiapS3OvIzQEADAKCHQwiIhQnzgamqTuod4m/fkDgPlBoINBDOoQsI2GJojnB3ZouJ0KAACjgEAHg2gd1OBcU2/nZCpNSniI96EgT8d0KgEAjAICHQxmUu/mP9DQpIyParachgAARgOBDgYzPqrpMld7a5Pa3KSxt1Pq8M5Bv1AJAGA0EOhgMPY2VuUzB4R9SaVJmNk/7EtzWekOAMwLAh0M6qWBLRaZyrX01kENEsdHNcV0OwAYJQQ6GJStWFS56PnOM6g0akte6DoJi8kAgLFCoIPBRYR6x788sMVnVBqlj8Z0eLVlQ7cLVAIAGB2O57FhFBiHwQv3HjubnhdOpdHo3z5g+9qXe4ygEgDAKOEMHYzG+v9EDw31c7lEpVEID/GKWzYjYiyVAABGC4EORsPdySZvy9zefdsGNThDLYPq1NTj2JrZUSPssKsaAJgATLmD0SmrqnV4cfmxDXsSMww2zT0hqunSRRM7z6QSAMDoIdDBKElfltx3e67O/Xjr+Y8lPLOits6JrbiqLyZ2mTE2svFqagEAmAQEOhi1Eym5PeauS/gxNbOoJbV0pk2Q29nFz3ed1rZRg7PUAgAwGQh0MAk/xia/9vWfl9/OL63ypJbW+DewvzV7cMvPJvdq/j21AABMDgIdTMqGw9en/Ho8faL0zD2KWvXWq5Xf7qe6Nfr5mfDgddQCADBZCHQwSTmFFb67Eu+M2Hvu7pB9l+4+SW2FbK1F5dGt/GKHdwr6tV87/50u9taFdAgAwOQh0MEs7LuQOfhUak73Wp4T1UpqrRjPSTGJSMRJrESi2l6tffYI+5jThwMAmB0EOpiFD39NXPTDnuQ3qPyX+c+0n/vSgLAvqAQAMDtYWAYAAMAMINABAADMAAIdAADADOAaOpgFXEM3U/dvNWU5aS1YbloYX5LnzSpKnVkVvUnHHF+LkxIwK7zYtoq5N7zOtey3jYVE7aa2ShDoYBYQ6GYgK6ktu3WuG38rMZzdvdKBy0puR0cALBLfe9ZHXN//vE+lUvjuFgAMo6LYlZ3ZOplfNWUX/367YrZk2Hm2bf5S7uzvkxDmANIz7gPfzWdF2f5UKoVABwD9uhgzml87fQf7qGMB2/r2Ku7a4YFcdbkTHQWAR2VebU8jpRDoAKAfx9e9zH8WfZNtfOUXLiluKHUBQJGKElcaKYVABwDdOvLTq/zC8Cz2x4JvuMLMIOoCgCrcA6/TSCkEOgDoRuqR/vznPdNZzCdfcqV5PtQFABXxnsHJrGGbBCqVQqADgHYVZgby62f9xn56YQ9XcDeYugCgBj6w7Uluwg8jGCeSUEspPLYGZgGPrRmJ8zuf5X97Z5m2bnLj7V3uMyfPLObsLX0T3ntlcU5ef42ZSFxNHwpgHqysq2TT7MLrW00IdDALCHQDq6m047d/8B13ZusL1KkX3sE1jzWP2s2F9fqThUbHMDtnbHELoCJMuQOAZu6lh/BLhp6rb5jzPiEX+ejpn7LpP/fg3jnpzY1ZPJ61G7IRYQ6gHgQ6ANRfekIUv2R4InfvRih1VMY3jYhlL297gvvPzrbcgDfeZsGdjqhzvRAAHodAB4D6ubR7FL9y4j6upsKBOirhA9ueYDM2duemrB7A/FsmUhsANIRABwD1ndw4k/0851dOUmtNHaV4v5Zn2fPLnuRe3BLOGnU8Sm0A0BIEOgCo5+D377Lt7/9AlVK8Z3AKe+6bUdzsbR1ZaM8YagOAliHQAUB1pzbNYHu/WkCVUnyHEWu5V3e3YK0HbKUWAOgIAh0AVHN5z1P8tvkqnZnzwn8D577FPfP587jRDUA/EOgAoFz6qWj+5//8wjEm/U8x3sqmgpu4dCiLmvY5tQBADxDoAKBYQUYjfs30PzheIqaOXLyD2z3uxV8imbAwDADoFQIdAOST1Ij5tTO3c1VlztSRi/dqcoWbvf0J5t/qLLUAQI8Q6AAgF79z4VdcVnI7KuXiXbzvcDM2RjFXv9vUAgA9Q6ADQN2u7h/Gndgwiyq5eGu7Um7Kmn7MoUEetQDAABDoAPBvFcWu/OY311All3A3u2yLR6+mSdQCAANBoAPAv/C7Fn3KVRa7USkXN3DuPNYsch+VAGBACHQAeFxWchuWsGkGVXLx7Yb8jEfTAIwHAh0AHsNv+e9KZc+b8wGtT8sWjQEAo4FAB4C/CTfC3b3Ymao68SKram7cN6OYSFxDLQAwAgh0APgLf+C792goX/j4b5lbwE2qAMBIINAB4IEbCT24jEudqKoTb+NQxPV+WeXNWQBAfxDoACDDxy97i4Zycb1e+pjZu+ZTCQBGBIEOAIwVZQdwyfFPUlUn3tk7g0VO+opKADAyCHQAYOzcH8/RSC5uwGvvMLFNJZUAYGQQ6ADA+PM7nqVhnXjv5pdYh5FrqQQAI4RAB7B0+bcbc5lJHaiqExcx4VvGcTyVAGCEEOgAlu5S7FM0kq9F7x00AgAjhUAHsHD8jYQoGtaJ9w09z5y9M6kEACOFQAewdNeO96ZR3cJ676QRABgxBDqAJctKastVlztRVScurOefNAQAI4ZAB7Bk109F06hOvIPbPRbU4TiVAGDEEOgAFozPvNqehnUL7RlDIwAwcgh0AAvG5d1sSsM6cf6tztIQAIwcAh3AgvH37zShYd1cvO/SCACMHAIdwFLxEhFXlBVIVd0Q6AAmA4EOYKmKcvxpJB+ePwcwGQh0AEtVVarwcTUZN/+bNAIAI4dAB7BUVWUKA523dclnIqtaKgHAyCHQASxVZakzjerm4onpdgATgkAHsFSVis/QmbMPbogDMCEIdABLdetMJI3q5uh2n0YAYAIQ6ACW6EZCD/7wqlepqpukFv8+AJgQ/IUFsDRCmP80NYarrbGhDgCYAQQ6gCW5e/kJWZgr2WENAEwPAh3AUuSmhfErn9+LMAcwTwh0AEuQfyeYXz7hAFde5E4dADAzCHQAc1ec6ysL85J7ftQBADOEQAcwZ0KYr5CGeUFGY+oAgJlCoAOYq/LCBrIwz73egjqP4+i9PJJaaxoBgAlAoAOYo6oyR7Zy0l65YS7g6b08Jbk+NAIAE4BABzA3NVW2/OqpMezu5Y7UqZuyM/TiPAQ6gAlBoAOYE0mtFb9h1m/cjdNR1JFP2Rl6UXYAjQDABCDQAcyFEOabXt/AJccPpo5CfNexS2lYJ05SY6N0RzYAMBoIdABzwPOcLMwvxYyhjkJ8p9HLuSHvvkKlfCX3MO0OYCIQ6ABmgP/9vaUqh3nrwb9wIxfMYGLbCt7BLZfadUOgA5gMBDqAqdu96FPu9OZpVCkkC/Oxi8cxjntwBd0jKE32Xh4EOoDJQKADmLJ9Sz5gh5a/RZVCfGh0jCzMRVa11GLMvZHCQOfvXulAQwAwcgh0AFMVv3QeO/Dt+1QpxAd3OsSN++6px8JcoOwMPengkzQCACOHQAcwRQmbp7I9iz+hSiFZmE9aMZiJbSqp9RfOv2UiDevEZSZ1YKX5nlQCgBFDoAOYmosxo4Wb4KhSzL/VGVmY2ziUUudxwZ0P0Ui+q/uG0wgAjBgCHcCUJMcP4je9toFjvNK/u7xXk6tsyup+csNc4OB2n/cNPU9VnfikOEy7A5gABDqAqRDCfP2s3zheIqaOXLxbQDo3dV1vZu+aTy35mnSNo1HdUg/3Z7wE/1YAGDn8JQUwBTcSesjCvLbKjjpyycJ8mjTMnb2yqKUQF9ZrJw3rxFVXOLK0472pBAAjhUAHMHZ3Lz/B/zQ1RqUwd/LMlIV5g4Y3qKVc0/ADvK2LwjN5PjlOpeVkAcBwEOgAxiw3LYxf+fxerrrciTpy8fYu99UOcwEnkrAOQ3+mqm5nf38e67oDGDcEOoCxEsJ8+YQDXHmRO3Xk4q3tS7gpa/oxr6ZJ1FIL1/bJTTSsk/A58Ae+fY9KADBCCHQAY5R/J1gW5iX3/KgjlyzMJ68YzPxbnaWW+oI7HeFdfG9TVbejq19hBRmNqAIAI4NABzA2xbm+Koe5lU2FLMyDOx+mVr1x3Z77gYZ14iS11vzuLz6lEgCMDAIdwJiUFzbgV0jDvCCjMXXk4jlRDTf+u6e0EeYyEROX8LbOBVTVibvw51iG9d0BjBICHcBYVJU5spWT9nK511tQRy5ZmI/9chwLjd5FLc3ZOJRyPSb/jyq5+B0ffktDADAiCHQAYyANc3711Bh293JH6sjFM04iC/M2gzdTS3u6v7BYuCZPVZ24W4kR7NCKuVQCgJFAoAMYWk2VrRDm3I3TUdRRiBu5YIZOwlwgnKX3nfMBVXLxuxd9ylIODaQSAIwAAh3AkCS1VvyGWb+pGuZswOtvs86jV1ClG90n/4/3DE6mqk7CWvL8htm/snvpIdQCAANDoAMYCs9z/KbXN3DJ8aqtwtb75Q9Z9Azd32XOiSTcqM8mUyWXsNgNv2rKLlZZ4kItADAgBDqAgQhboHKXYsZQqVjUtM+YClPhWhPU4Tjf8elVVMnFFdxpwq+b9ZvwzQm1AMBAEOgABsDv+mwRd3rzNCoV4juNXs4Gzp1Hpd5wQ9/9D+/mr3QZWe768T58zMdfUgkABoJAB9C33Ys+5Q6vfIMqhYQwl90EZwg2jiXc+O+fokoh7uiaV9jxdS9TCQAGgEAH0Kf4pfPYoeVvUaUQ33rwL7Iw5zieWvrn3zKRjVwwnSrF/ljwDb9zwdfCjX7UAQA9QqAD6EvC5qlsz+JPqFKID42O4cYuHmfQMH+o85jlfJtBKj0mxx1bN4etmLAfO7MB6B8CHUAfpGEu3ARHlUJ8cKdD3LjvnmIiq1pqGRz3zKKJfKOOR6hU7MbpaH7J8LPYyAVAvxDoALp2MWa07I52xiv9+yYL80krBjOxTSW1jIP08+EmrxjEeze/RB2FuPxbzfivhyey9ATVnq8HAI1ZbKDnlVR6Hrma3fvPs3ee2nwsfeK6+LTpW47fGB9z9s7IY8k50fmlVUr3oAZQKjl+EL/ptQ2qhDnzb3VGFuY2DqXUMS7CTXJT1/bhXf1uUUchrrJIttEMO/PbJGoBgA5xPG/4S3T6UlFdaycN7hmbj12fePFWwRPUlqtDY48TE6ObLnu2e5OfqAVG6sNfExf9sCdZ7p3j859pP/elAWFfUKkfNxJ68Csnx3K1VXbUkYv3anKVm/lLJLN3zaeW8RL2al85cR93/05T6ijFNwnfxw16420W0OY0tQBAyywi0MsqaxzXxF2b+f2eq2/kFlX6Ultljbwc0155stXCUeHB662tRNXUBiMyb8OZb1cfTJ1F5b8Ir/KHK5842oiLXRysC53txYUNnGzvN/dzvRoe4n0oPNQr3r+Bwx36MM3cvfwEv/S5eGE1NerIxbsFpHMvbo5gzl5Z1DJ+pfe9+BUT93PZKW2ooxI+rOcf3MA35zHvZleoBQBaYvaBnlNY4Ttj6dFNx1Nyo6lVb33b+u/8YVr4OGd76yJqgYEIf65Hk3N6HkvK7nkyNad7cmZxK0VLlT0a6Ir4udnfCQ/ziosM9ZW+eccFezul0SHVCWG+8vm9XHmR0ss2sjCftq43a9BQ6QIuRqeqVFj6dTd362wkdVQi/bPgWevBm7kBr77LPBpdozYAaMisA/1sel6X5785tL0+Z+XyNPV2Tl4zJ2p4M19nhZtXgHYJAX7oSlZfWYgnZ/e8mVv62HSvssBWNdD/Se2Az00L438cc1SlMHfyzJSdmZtimD9UW23Db3h5K5d0cAh1VCZsA8uC2p/gWvbbxtoM2MIaBKbTIQCoB7MN9KLyatdBC2JPpuUUh1JLa7qFeB369fVefTH9rntVNRKbmMQ7I9cfSpt65GpWH+lLts5c1lWgP6pNkNvZcT2arXgmInido63433uGC9eWfxh9jCu550cduXh7l/uya+ZeTZOoZbp4iYjF/fg2v2/JhxwvqfeiMrxXkyusVf9tXIs+21lgu1PUBgAVmWWgS3heNP7r+J0HLmUNopbWTYhqunTRxM4zqQQdOHQlu+97G8/8LzmzqDW15NJHoD/k62aX8daItu+NiWy8RsRJzzIFxbm+sjAvyGgsqxWQhfmUNf2Yf6uz1DIPt893FbZU5YqyAqlTb7y1XansjN0j8DpzD7zOCWPpe9lbg4bpzNqunD4UAIhZBvrvp26NfXHZsY1U6swf8/pGdm7meYxK0JJzN+53+r+t5z85cjW7L7WU0megPxTq53JpwbMdX40KFF0SHs/icq+3oENy8db2JdyMn6PNLswfqixx4ff+b4FsxTgd4h09soWw50TiKmoBmA2es5JwDfxvMWExp86jV1BbKbML9MoaiW3EOzuTM/LKdL5KVaemHsd2vt1PrRuCQD7h2f+F0iDfcChtqvRVqdYaCYYIdIEbV8YO+K8p8q/OVLonOG9lU8FN+ak/C+58mFrm686FzvyWt1dxOalKZ1cAQD6+WeRe7gXpvxsqMLuFZXYk3BqtjzAXnE7Lizh8NbsPlVBPNbW8eNWB1Fnd3v4jdf2htOnqhrmhOHCV7Be3NUylMOdENdz4756yiDAXNGybwL3yZxs26M25vNiujLoAoCbu2tF+TMWbTs0u0PdeyHiShmqRTVTQ28OhKmLPZwylIdSDcFY+8Zv4Hf/9+cy3hWXVJrM6ny2rZhtc17N21pnUkU8W5mO/HMdCo3dRy3L0mPoFNy8+iO/10gLewTWPugCgjjsXO9FIIbMKdGkocwcvZg6kUn3CnKz0jd79leyKAv7ABQ1+Pwt39U5hmz4f7ErU5c2LumDFatlK100s3OYmdeQTHs2ShXmbwSrtVmaWHBrkcf1emc+9dTiQjfhoJu/Z2PTv7AfQI76y2JWGCplVoJdV1TgWV9So9D/+L3XtUqlCwAuPxdVKeOz/rKZNR9MnDVy45+Td/PIgapkEIcy/d9nK+tqmUkeJEQtmWnSYP0q4M73L2KXca3tasNnb27OoaZ/xrv7KvysCsHCypzxUYFaBXlktsaWh+nhZZCv2j4DnKdp/PX5jwt38sobSAlRw4FLmwDfXJfwg/fOyp5ZJ4JhEFubD7VTacIwtLOnLNlR0pAoe49fiPBs4dx73Vlwwm7k5XDYl798mgY4CABFupmWtB2yhUiGzustdWE2s7evblF/U1JFgL6drkWHecRGhPnFaXRfcjAhhPunbw79X1UiUbliiDuFVrOhbMmXHVfGF83Y23v4MVYp9UdKTfVHWW/g9JcJ6BeOjmi6nQ6BIRZEbSz3ajxeuGRZmBrHCrADpW0NVnu8HMDe8i/cd7ulPp7Dm3WOppZBZBfqdvLKgTm/tUHsKTzjT5jT+5/7fHg34Hi189nu72pnO5hs6cDI1t/sziw/u1XaYC3Qd6O84xrLZjkeoUuyb0u5sYenfT5kg1LWkutyBVZY6P/YmrFIHYG44kYS5+d1Sd1loswr0e0WV3q1f+z2bSqPTzNc5KTzEJy6yhTTkQ7zjLSngkzIKW4/4fH9cQWmVB7W0SpeBPtvhEHvHaR9Viq0v78jeKB5O1d+sOFbzy2u9BnRv4XOAWgAAWmVWgS6s3x4ye2sBlSoTvgR1rxCuW5YS8FkF5f4DPopNyC4q96eW1ukq0F+0P8red95DlWJCmM8tHir9veo+aRS2bf3znX4RYQGuql2EBwBQg1kFurCRR9DMzZVUqoe+DMK9cQbIdhlzDPiSihrnJxfGHlNlPXZjM87uNFvssoMqxbZXtGYzi0bJDfOHfFzs7+6Z37+zr5v9XWoBAGiFWQW6YNDCvScS0/O6UllvwlV1xiTSL5D0nSFO36UeDfjuYT4HPJ1tc+mQyXhv09mvlu9L+Q+VJmOY7UX2o8sWJqrrccZ/2FfZnD1f+ByrZao9vdi9hc++La/36kclAIBWmF2gL4m5Mu/j3y58QqVWPPgKGTrgeT7Uz/VyZJhPXESYd1y3EO9Dxh7wuxMzhk/67vA2Kk1GH5sUtsb1ZyamjdQUOV7ViI0tmMgqmTV1VPPRmA6vTu8X+hWVAAAaM7tAF26M6/bfP1JLKmqUrq9dXw8D3snOqtjHxS7zek5JiKylV8Yd8LfulQb3/XB3YlF5tRu1TIIQ5sIqcHZcDXXkE8J8XOF4Vsarv/yB2Iqr2vFW36gnmnicpBYAgEbMLtAFujhLr8sP0yOeHdklaNO94kqv48k50ceSc3oeTcrqmZJZ1FL/p/GPB7z0/cEGjjb36aDezVl5cvXm4+nPU2kQfqIi5iEqY86iClYisWV5vAO7Wyt/IcFu1jfYJre1KoX5+Wo/NrLghXqF+UMdGnuc3PVOv25UAgBoxCwDvaK61i56fsylm7mlTamlde2D3U/tfrd/ndfqhQ1HjlzN7m3IgJf+ZpKWgW4XIkKl4R7qE9c1xOuwvgI+Mf1+50ELY09RqTd+VkVsmM0lNsT2Mutsc5u6/3a12psdrWnC9lWGsLiqZrJeW/Fd9rvbKuYoUr69dkqNJxuWP5UVSL9B0NRXk7tOHhvZeDWVAAD1ZpaBLkjNLArr99HuMxXVEs3/1f0Hdyeb3L3zB3YMcHeQnxqPEAL+REpO1IOAz+555U5BW3MNeGFd+8Efxx4/fyO/M7V0zkNUyuY57GfP2Z9hVircxPYo4Uz7u7Lu7DPnnayBqJy68t2qdWND8qexHIkzdTQjvJZOfTqsqZOduJhaAAD1YraBLvjj9O1R0348+iuVWmEjFlVseaN33y7NPI9SS23C8/LSYO9lTAEvTNO72FsX0uF6+/3UrbEvLju2kUqde8H+JHvPKZbZc9XUqSfhr4GSPwEhzJ/On8xuSxpQRzteH9r6w7nDW39AJQBAvZh1oAtiz98dMuX7w1uqazW42Emc7cSFa2ZHDZeGYDy1tMIYAl7Esdo2ge6JES28ZEvVdm3udUTdgJe+lLiBC2JPnb91X6W9ezX1rmMse1nF5Vg1lV3rJDsz13aYC1ztrfPPLR4RYG9jpXyKAABADrMPdMGRpJxeLy07tiGnqMKPWmpr7O2U+tPLPUaG+bteppbOCAF/IiW3x7Hk7J7HknJ6Xrqd317Cq/iQs5bUJ+CFjVee+yp+F5U69anzDjbJ/jRVWlTHmXq+xF52zTy11os62ofH2ABAUxYR6ALhRrk1cdde/HbXlTdziyp9qa1UIy/HtDmDW30i3LhkJeJqqa1Xwmpr0rP3aGMP+JGf7487npIbTaXOvGR/hM13VmnzIY0JYT6m4Hl2oUZnq9bK+LrZZZz+bHiw2EqFW+wBAOpgMYH+qIRr9yLir2T1k01v3y5oV1he/dc8qoezTXabIPdzwmNfUS199rVr5K7afpl6ZIwBH+TpdCN6/p8XdX2poLt1GtvstlalFdw0VSqxZiMLpug8zB/6aVb3kYM6NDS5hXgAwDhYZKD/k3Dtl2e8NIk44QeT+4IIAX/qWm6kEO5Hk3N6XriR17GWZ2I6rBfCTXYSIeeF15MOM/285+fMR1RClYoevsbV/LyWloWz90sGUaV7/dsHbF/7co8RVAIAqAWBbobKqmodZI/JGTDgH76qtBnwLzocZe87qbbzWZ0Xw//+rOi9YrkSR9Yp73VWyevnSycWcdXnvhjR0NPFNodaAAAqQ6BbAGMM+LriVhFnroKd8VjMXET120yvTip8Eq8VDWc/V3SkSvdwcxwA1BcC3QIJAZ8gTNEL1+GlIZ94I69zTS1vQ4f1Q/qy44UfpOEuZKqybH3W7iz7n4uSy8sqBPTjlP+EQ5VN2OjCSVTp3rDOgb8smxE5lkoAAJUh0EH2BMDJVOExOeMN+KUuv7Dhdjp/YvBfhL8ebe69ye7xTtTRrQAPh5tnPhsWTCUAgMoQ6PAvQsCfSr3X/Whydk8h6E+k5EbRIb2SvTZlAc+zFM+PlUy3//NbAO2ZXDCW7apqSZXunfp0aOMgT8cbVAIAqASBDkoJAX86LS/8wY5y2T1Pp93rpo2V91TlzMpZqreyzfM0CHT6xkGe94sHsKXlkVTp3tcvdJ00JqLxGioBAFSCQAe1VdZIbIVn+YWA/+3kjefSc0qa0yGdCBbdYyc8l1ClfyvLurJ3Sp6kSvem9Q35esHYJ16hEgBAJSJ6D6AyW7GosnuY90FhQ5G+bf1jhG8JeWFiXDbQ7jeIwnV1L6syquTQ+LdU/Av4W2m8Z41ahJ0CaQgAoDIEOmhECB9hslq4zi2btZb+IItHykjN452TvkiV/Sqa/i6Kp+orJNY00o/ULAQ6AKgPgQ4aSblb2IKGf5HFI2XkX1FZ34CX/oRMZXuPK7j+rRIlswr5vD2N9CMjr6wRDQEAVIZAB40Ul1e70lAxDQI+o9ZVhZl8VX6l+inUc6ALJDyPv5sAoBb8owEaEe6Ap6F6/hnwUkIkCzdpPoxmYSScfNcyK3alRtkGeY/+SmpScoZ/WenvrX3SL4MG/0MAYIkQ6KARbT6+JiQYJw3Xv5Ps71FsVSiN9C+uSqc38dcJgQ4A6kKgg9F6NNFiK1UJdO1Pu8dVNmUlel40DwCgPhDoUG/6PItMrGnIzlUr25dc+HS0G+o/lXehkX7hGjoAqAv/aEC9PXxCTV8+LB1II0Xq+h6jfp/myaogtqfqXzfx64WI4yQ0BABQCQIdTMbxqmB2oLI+17PrN5Ewt2Q4jfRP398sAYDpQ6CDRqytOC1uUK7c68XDWJ7EgSrdeaNoKEup8aJK/xDoAKAuBDpoxN3RLo+GepEpcWXPFUxg5byYOtoXU9mCra/oTJVhcIxDoAOAWhDooBF/D4fbNNSb8zUBbEbhGKq0a09lKJtV9DRVhuFsJy7EGToAqAuBDhpp7uuSREO9Ep5L739/JsuWOFFHcz+WhbPnC8dJz/4N+5haMz9Xg3xNAcC0IdBBI838nA0WPhdq/NkAaaj/WanZneiZtS7SIH+OfVAyiDqGZahvkgDAtCHQQSPN/bQTPsL88sM3dWRJXNiUwmdZ9/uz2dbyNtRVTaHEjq0o78Z63J/D9lQazwZnhvwmCQBMFyesnQ1QX7fulQZ3mfdHOpVqe/Dqk/7Ic38tqS706rtijSNXyZ60vcKGSt+cuArqMlbBi9l9iQO7zzuw2xJ32SNwF2v86Khx2Tq3d6/IUO84KgEAVIJAB41F/vfPpLScYpUXW//7FScsNffv6NYk0E2d8Bjgte+ecbUVi/T6OCAAmD5MuYPGerf1201DhYSgfhDWD9aMrSvMBZYa5oLIMJ84hDkA1AcCHTQWoWR6+EGQS3+U/vcgrJVHtqVOHPVurdo3RwAA/4RAB41FtfTd52BjVUKlzIMQfxDkD8/GH14jV4U6H2s+eH5gh4bbqQAAUAsCHTTmaCsuGdIxaKswfhjkyqbVVWFpZ+kdGnueCvJ0rPcNhgBg2RDooBVhAa6XhCR/EOICDU+xH3xXYFFGdgnaREMAALXhLneot8oaie3WEzfGrdyfMvvy7YL21NaM9OXIS4PcwrKciUVc9bnFIwI8nW1zqQUAoBYEOqgt435Z4Nr4azPWxV+bfr+kSuMtyR5cZ3+weLmlBflDo8Mbr1kypeskKgEA1IZAB5UdS86JXrEvZc7uc3eGS3hmRW0NCK894aqPZb8GrThWc2ThkBaNvZ2uUQsAQG0IdFBI29PqsrNx6UuO5zS5Xc68DOsc+MuyGZFjqQQAqBcEOtQpp7DCd+WBlJe1Pa0O/7b//YHtWwW6nacSAKBeEOjwmDPX87qt2Jc054/Td0bVSHhramtAeH1hWl0eXDsHAG1BoIPWp9WFO7atxaKqsqpaR5yTy+doIy4+9fnQJh5OtveoBQBQbwh0C6btaXVvF7vMSb2a/zA+qunyo8k5PV9cdmwjHYI6/Peptm/PGdzyUyoBADSCQLdA2p5Wbx/sfmpa39AlwzoHbra2ElVTmz2z+EDs4as5/aiERzT3c7lyeMHgVlQCAGgMgW4hdDGtPrRTwy0z+rf4Uhrop6n9mNyiCp9BC2NP3MkrC6YWSNlZi8r2zh/YURrqSdQCANAYAt3MaXta3d3JJndCdLNlU3qHfOvtapdFbbkS0+93HvrJ3qPaucHOPHw1uevksZGNV1MJAKAVCHQzde7G/U5LY6++pu1p9SGdAreou1/3iv0ps9/deHYJlRZtQlSzHxdN7PQilQAAWoNANyPCtPrO07dHLd+XPEca6F2oXW+qTKur6r1NZ79avi/lP1RapL5t/XeuntVjpNiKq6EWAIDWINDNgKGn1VUh4XnRrOXH1v9+6vaz1LIo4SFecRtf7TnIztqqgloAAFqFQDdh2p5WbxXodm5Kn5Bvnu4WvEHdaXVVTVxyeHvshYxhVFqEdsENEra+0aePk524mFoAAFqHQDcx1bUS6x0Jt0dre1p9at+wJR2beJygts7USnirN9YmLNt45PoL1DJr0jPz+A2v9BzsYGNVRi0AAJ1AoJsIYVp9/aG0aasPpr6YU1ThR+1608W0ujoW/3Fp/qLtlz6k0iwN7RT467dTwyfoarYDAOBRCHQjZ4rT6qqSnqVPfnX1qVVUmpWXB7b47N1R7eZRCQCgcwh0I2Tq0+rqOJue12Xq90d+vZtfHkQtk+Zqb52/dGbk2J6tfGOpBQCgFwh0I2Ju0+qqyi+tcp+7NmHpzjO3R1HLJLUNanDmp5d7jAxwd7hNLQAAvUGgGwFznlZXx5bjN8a/t+ns/6QB70ktk2BvY1X65vA270/tG7Lk0bXsAQD0CYFuINqeVhdxrHZg+4bbhVCJCPWOp7bJySup9Hxv05n//Xbi1nhqGbXoFj6xX0zqMj3Qw/EmtQAADAKBrmdCYK05eO1FbU+rT4xuttScpnpPpuZ2XxJz5e39FzMHU8uotA5qkPjKky0XDukYuJVaAAAGhUDXE2Fa/af9qbN+O3Xj2epa3pba9Waq0+rqSr5b1PKrnRff3Z5we7SEZ1bUNpjerX13zRrU8vPIUO84agEAGAUEug5hWl17MvPLAzYfT5+46cj1yek5Jc2prRe+bnYZz4Q3Xvdcj6YrG3s7XaM2AIBRQaDrgLan1YVHoZ6LarJyap/QJbiDmrETKbk9YhLvjDyWnNPz0q38DtTWKmlwp3YP8zkwoEPAjr5t/GOoDQBgtBDoWnT1TmGbH/ckvabtafWRXRpttLexKqc2PKKkosb5RGpOj9NpeeGXb+W3u5pR0OZOXlkwHVaJl4ttVmiA26XWgW7nOzT2OBUZ5nPQ09k2lw4DAJgEBLqGhGn13YkZw1fsT55zMvVeD2rXmyVPq2uL9CXN1UgkYuE9teQSHjPjOIa/BABg8hDo9YRpdQAAMCYIdDVhWh0AAIwRAl0FmFYHAABjh0BXANPqAABgKhDoddD2tHpzP5crU/uEfDM6ovEaTKsDAIAuINBJrYS3ijl7ZySm1QEAwBRZfKAL0+obj1x/YdX+lFna2JMb0+oAAGAIFhvomFYHAABzYlGBru1pdWEJk76tA2Km9gtZ0rOVbyw1AQAA9M4iAr2wrNpt3aFr07U9rT6pZ/MfGnk5Xac2AACAwZh1oAvT6qsOpMz69Xj6hIpqiQO16w3T6gAAYKzMLtAxrQ4AAJbIbAId0+oAAGDJdBbowpmy9JfmeMZznPSdSMQkIo6T0GGtwbQ6AACAFgO9rLLGcVdixoitJ9LHxV/O6lfLMzEd+ou7k03uiM6NfhkVHrz+iSYeJ6mtNkyrAwAAPE7jQM8vrXJftjf5lRX7kucUV9S4UlspYZex14e2/mjwEw1/p5ZS2p5Wd7QRF4/tHrx6er+wrzCtDgAApqzegS4E+Td/Xpn3U1zqS+VVtY7UVtvDYB/YIWC7vCn5a1nFoUtjk17V9rT6092CNzjZiYupDQAAYLLqFehVNRKbuWsSlv5yPH0StTQiDdWi76dFjOvfzn8ntWTT6vsv3h28bF/KnCNXs/tSWwOYVgcAAPNVr0CfvvToph0Jt8dQqRUcY5K1c6KGdWnmdRTT6gAAAOpRO9CXxFyZ9/FvFz6hUquc7cSFrw1r89GHmxMXU6vegr2crk3pE/Lts92brMK0OgAAmDu1An3/xcxB47+O3yn9GSJqaV0zX+ek4spq5+z8igBqqeHvafXolr57OY6pP/0AAABggtQK9EEL9x5PTM/rRqXODO4YuCXmzO1RVCqFaXUAALB0Kgd67PmMoRO/ObyDSp3yb2B/635JpaeyO9oxrQ4AAPCAylPnW07cGEdDnRNuhosI84mj8h+EaXX/Pze92nPA8Y+HhEzrG/I1whwAACydSoEu4XnRwYuZA6nUCw9n23tCeFMpm1af0rvZNyc/Gdps/StRQ4RHz3CNHAAA4AGVptxziyp82ry2LYtKvRBujmvo4XjzRk5JU0yrAwAAKKZSoKfnlDQL/+/OVCr1Qiziqs8tHhHg6WybSy0AAACQQ6Up99KKaica6k2NhLd2d7LJoxIAAAAUUC3QK2v0HugCiUR3z7sDAACYE5UC09FWXEJDvRL2UKchAAAAKKBSoNvZiMtpqFfydl8DAACAxxntGbqHs002DQEAAEAJlQLdx80uU9jilEq9GNwhcBsNAQAAQAmVAl2Y+u7dxm8XlXox6ImGCHQAAAAVqRTogmcjm/xEQ50L8HC42bu1324qAQAAQAmVA71Xa7894SFe8VTq1LtPt59HQwAAAFCByoEumP9Mh7k01JmWDV3Pj+wStIlKAAAAUIFagd6hsXvCf59q+zaVWudsJy5cNrP7GCoBAABARWoFumDO4JafSs+gf6ZSazjGJD/OiHy2ma9zMrUAAABARWoHuuCrF7q9MLyz9qbFra24yqUzI8f20fOd9AAAAOZCpd3W6iL9adwbaxOWbjicNo1a9SJMs6+ZHTU8ItRbLzfcAQAAmKN6B/pDR5Jyei3ecfH94ym50dRSiY1YVDEhqsnyV4a0XujlYodV4QAAADSgcaA/dOZ6Xre9F+4+GX85q19iel5Xaj/Gxd66ICLM52B0S599Tz4R+Ju3q10WHQIAAAANaC3QHyXheVFZZa1jeVWNQ3WtxNrOWlxub2NVJn0zyCYvAAAA5k4ngQ4AAAD6Va+73AEAAMC4INABAADMAAIdAADADCDQAQAAzAACHQAAwAwg0AEAAEweY/8PPuptMq2MzNwAAAAASUVORK5CYII=";let Hb;function s5(t){t.addEventListener("mousedown",dC)}function o5(t){t.removeEventListener("mousedown",dC)}function a5(t){let e=document.createElement("span");e.className="p-ink",e.setAttribute("role","presentation"),e.setAttribute("aria-hidden","true"),t.appendChild(e),e.addEventListener("animationend",hC)}function l5(t){let e=fC(t);e&&(o5(t),e.removeEventListener("animationend",hC),e.remove())}function dC(t){let e=t.currentTarget,i=fC(e);if(!i||getComputedStyle(i,null).display==="none")return;if(He.removeClass(i,"p-ink-active"),!He.getHeight(i)&&!He.getWidth(i)){let o=Math.max(He.getOuterWidth(e),He.getOuterHeight(e));i.style.height=o+"px",i.style.width=o+"px"}let n=He.getOffset(e),r=t.pageX-n.left+document.body.scrollTop-He.getWidth(i)/2,s=t.pageY-n.top+document.body.scrollLeft-He.getHeight(i)/2;i.style.top=s+"px",i.style.left=r+"px",He.addClass(i,"p-ink-active"),Hb=setTimeout(()=>{i&&He.removeClass(i,"p-ink-active")},401)}function hC(t){Hb&&clearTimeout(Hb),He.removeClass(t.currentTarget,"p-ink-active")}function fC(t){for(let e=0;e[i.loading&&!i.icon?(X(),se("span",{key:0,class:Tt(s.iconStyleClass)},null,2)):Be("",!0),i.icon?(X(),se("span",{key:1,class:Tt(s.iconStyleClass)},null,2)):Be("",!0),Se("span",c5,it(i.label||" "),1),i.badge?(X(),se("span",{key:2,class:Tt(s.badgeStyleClass)},it(i.badge),3)):Be("",!0)])],10,u5)),[[o]])}ep.render=d5;var pC={name:"Checkbox",emits:["click","update:modelValue","change","input","focus","blur"],props:{value:null,modelValue:null,binary:Boolean,name:{type:String,default:null},trueValue:{type:null,default:!0},falseValue:{type:null,default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},required:{type:Boolean,default:!1},tabindex:{type:Number,default:null},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},data(){return{focused:!1}},methods:{onClick(t){if(!this.disabled&&!this.readonly){let e;this.binary?e=this.checked?this.falseValue:this.trueValue:this.checked?e=this.modelValue.filter(i=>!ft.equals(i,this.value)):e=this.modelValue?[...this.modelValue,this.value]:[this.value],this.$emit("click",t),this.$emit("update:modelValue",e),this.$emit("change",t),this.$emit("input",e),this.$refs.input.focus()}},onFocus(t){this.focused=!0,this.$emit("focus",t)},onBlur(t){this.focused=!1,this.$emit("blur",t)}},computed:{checked(){return this.binary?this.modelValue===this.trueValue:ft.contains(this.value,this.modelValue)},containerClass(){return["p-checkbox p-component",{"p-checkbox-checked":this.checked,"p-checkbox-disabled":this.disabled,"p-checkbox-focused":this.focused}]}}};const h5={class:"p-hidden-accessible"},f5=["id","value","name","checked","tabindex","disabled","readonly","required","aria-labelledby","aria-label"];function p5(t,e,i,n,r,s){return X(),se("div",{class:Tt(s.containerClass),onClick:e[2]||(e[2]=o=>s.onClick(o))},[Se("div",h5,[Se("input",Qi({ref:"input",id:i.inputId,type:"checkbox",value:i.value,name:i.name,checked:s.checked,tabindex:i.tabindex,disabled:i.disabled,readonly:i.readonly,required:i.required,"aria-labelledby":t.ariaLabelledby,"aria-label":t.ariaLabel,onFocus:e[0]||(e[0]=o=>s.onFocus(o)),onBlur:e[1]||(e[1]=o=>s.onBlur(o))},i.inputProps),null,16,f5)]),Se("div",{ref:"box",class:Tt(["p-checkbox-box",i.inputClass,{"p-highlight":s.checked,"p-disabled":i.disabled,"p-focus":r.focused}]),style:Ri(i.inputStyle)},[Se("span",{class:Tt(["p-checkbox-icon",{"pi pi-check":s.checked}])},null,2)],6)],2)}pC.render=p5;var lu=NB(),Hg={name:"Portal",props:{appendTo:{type:String,default:"body"},disabled:{type:Boolean,default:!1}},data(){return{mounted:!1}},mounted(){this.mounted=He.isClient()},computed:{inline(){return this.disabled||this.appendTo==="self"}}};function m5(t,e,i,n,r,s){return s.inline?pi(t.$slots,"default",{key:0}):r.mounted?(X(),gt(iN,{key:1,to:i.appendTo},[pi(t.$slots,"default")],8,["to"])):Be("",!0)}Hg.render=m5;var Ug={name:"VirtualScroller",emits:["update:numToleratedItems","scroll","scroll-index-change","lazy-load"],props:{id:{type:String,default:null},style:null,class:null,items:{type:Array,default:null},itemSize:{type:[Number,Array],default:0},scrollHeight:null,scrollWidth:null,orientation:{type:String,default:"vertical"},numToleratedItems:{type:Number,default:null},delay:{type:Number,default:0},resizeDelay:{type:Number,default:10},lazy:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loaderDisabled:{type:Boolean,default:!1},columns:{type:Array,default:null},loading:{type:Boolean,default:!1},showSpacer:{type:Boolean,default:!0},showLoader:{type:Boolean,default:!1},tabindex:{type:Number,default:0},inline:{type:Boolean,default:!1},step:{type:Number,default:0},appendOnly:{type:Boolean,default:!1},autoSize:{type:Boolean,default:!1}},data(){return{first:this.isBoth()?{rows:0,cols:0}:0,last:this.isBoth()?{rows:0,cols:0}:0,page:this.isBoth()?{rows:0,cols:0}:0,numItemsInViewport:this.isBoth()?{rows:0,cols:0}:0,lastScrollPos:this.isBoth()?{top:0,left:0}:0,d_numToleratedItems:this.numToleratedItems,d_loading:this.loading,loaderArr:[],spacerStyle:{},contentStyle:{}}},element:null,content:null,lastScrollPos:null,scrollTimeout:null,resizeTimeout:null,defaultWidth:0,defaultHeight:0,defaultContentWidth:0,defaultContentHeight:0,isRangeChanged:!1,lazyLoadState:{},resizeListener:null,initialized:!1,watch:{numToleratedItems(t){this.d_numToleratedItems=t},loading(t){this.d_loading=t},items(t,e){(!e||e.length!==(t||[]).length)&&(this.init(),this.calculateAutoSize())},itemSize(){this.init(),this.calculateAutoSize()},orientation(){this.lastScrollPos=this.isBoth()?{top:0,left:0}:0},scrollHeight(){this.init(),this.calculateAutoSize()},scrollWidth(){this.init(),this.calculateAutoSize()}},mounted(){this.viewInit(),this.lastScrollPos=this.isBoth()?{top:0,left:0}:0,this.lazyLoadState=this.lazyLoadState||{}},updated(){!this.initialized&&this.viewInit()},unmounted(){this.unbindResizeListener(),this.initialized=!1},methods:{viewInit(){He.isVisible(this.element)&&(this.setContentEl(this.content),this.init(),this.bindResizeListener(),this.defaultWidth=He.getWidth(this.element),this.defaultHeight=He.getHeight(this.element),this.defaultContentWidth=He.getWidth(this.content),this.defaultContentHeight=He.getHeight(this.content),this.initialized=!0)},init(){this.disabled||(this.setSize(),this.calculateOptions(),this.setSpacerSize())},isVertical(){return this.orientation==="vertical"},isHorizontal(){return this.orientation==="horizontal"},isBoth(){return this.orientation==="both"},scrollTo(t){this.lastScrollPos=this.both?{top:0,left:0}:0,this.element&&this.element.scrollTo(t)},scrollToIndex(t,e="auto"){const i=this.isBoth(),n=this.isHorizontal(),r=this.first,{numToleratedItems:s}=this.calculateNumItems(),o=this.getContentPosition(),u=this.itemSize,h=(P=0,R)=>P<=R?0:P,p=(P,R,k)=>P*R+k,g=(P=0,R=0)=>this.scrollTo({left:P,top:R,behavior:e});let y=i?{rows:0,cols:0}:0,S=!1;i?(y={rows:h(t[0],s[0]),cols:h(t[1],s[1])},g(p(y.cols,u[1],o.left),p(y.rows,u[0],o.top)),S=y.rows!==r.rows||y.cols!==r.cols):(y=h(t,s),n?g(p(y,u,o.left),0):g(0,p(y,u,o.top)),S=y!==r),this.isRangeChanged=S,this.first=y},scrollInView(t,e,i="auto"){if(e){const n=this.isBoth(),r=this.isHorizontal(),{first:s,viewport:o}=this.getRenderedRange(),u=(g=0,y=0)=>this.scrollTo({left:g,top:y,behavior:i}),h=e==="to-start",p=e==="to-end";if(h){if(n)o.first.rows-s.rows>t[0]?u(o.first.cols*this.itemSize[1],(o.first.rows-1)*this.itemSize[0]):o.first.cols-s.cols>t[1]&&u((o.first.cols-1)*this.itemSize[1],o.first.rows*this.itemSize[0]);else if(o.first-s>t){const g=(o.first-1)*this.itemSize;r?u(g,0):u(0,g)}}else if(p){if(n)o.last.rows-s.rows<=t[0]+1?u(o.first.cols*this.itemSize[1],(o.first.rows+1)*this.itemSize[0]):o.last.cols-s.cols<=t[1]+1&&u((o.first.cols+1)*this.itemSize[1],o.first.rows*this.itemSize[0]);else if(o.last-s<=t+1){const g=(o.first+1)*this.itemSize;r?u(g,0):u(0,g)}}}else this.scrollToIndex(t,i)},getRenderedRange(){const t=(n,r)=>Math.floor(n/(r||n));let e=this.first,i=0;if(this.element){const n=this.isBoth(),r=this.isHorizontal(),{scrollTop:s,scrollLeft:o}=this.element.scrollTop;n?(e={rows:t(s,this.itemSize[0]),cols:t(o,this.itemSize[1])},i={rows:e.rows+this.numItemsInViewport.rows,cols:e.cols+this.numItemsInViewport.cols}):(e=t(r?o:s,this.itemSize),i=e+this.numItemsInViewport)}return{first:this.first,last:this.last,viewport:{first:e,last:i}}},calculateNumItems(){const t=this.isBoth(),e=this.isHorizontal(),i=this.itemSize,n=this.getContentPosition(),r=this.element?this.element.offsetWidth-n.left:0,s=this.element?this.element.offsetHeight-n.top:0,o=(g,y)=>Math.ceil(g/(y||g)),u=g=>Math.ceil(g/2),h=t?{rows:o(s,i[0]),cols:o(r,i[1])}:o(e?r:s,i),p=this.d_numToleratedItems||(t?[u(h.rows),u(h.cols)]:u(h));return{numItemsInViewport:h,numToleratedItems:p}},calculateOptions(){const t=this.isBoth(),e=this.first,{numItemsInViewport:i,numToleratedItems:n}=this.calculateNumItems(),r=(o,u,h,p=!1)=>this.getLast(o+u+(oArray.from({length:i.cols})):Array.from({length:i})),this.lazy&&Promise.resolve().then(()=>{this.lazyLoadState={first:this.step?t?{rows:0,cols:e.cols}:0:e,last:Math.min(this.step?this.step:s,this.items.length)},this.$emit("lazy-load",this.lazyLoadState)})},calculateAutoSize(){this.autoSize&&!this.d_loading&&Promise.resolve().then(()=>{if(this.content){const t=this.isBoth(),e=this.isHorizontal(),i=this.isVertical();this.content.style.minHeight=this.content.style.minWidth="auto",this.content.style.position="relative",this.element.style.contain="none";const[n,r]=[He.getWidth(this.content),He.getHeight(this.content)];n!==this.defaultContentWidth&&(this.element.style.width=""),r!==this.defaultContentHeight&&(this.element.style.height="");const[s,o]=[He.getWidth(this.element),He.getHeight(this.element)];(t||e)&&(this.element.style.width=sthis.element.style[o]=u;t||e?(s("height",r),s("width",n)):s("height",r)}},setSpacerSize(){const t=this.items;if(t){const e=this.isBoth(),i=this.isHorizontal(),n=this.getContentPosition(),r=(s,o,u,h=0)=>this.spacerStyle={...this.spacerStyle,[`${s}`]:(o||[]).length*u+h+"px"};e?(r("height",t,this.itemSize[0],n.y),r("width",this.columns||t[1],this.itemSize[1],n.x)):i?r("width",this.columns||t,this.itemSize,n.x):r("height",t,this.itemSize,n.y)}},setContentPosition(t){if(this.content&&!this.appendOnly){const e=this.isBoth(),i=this.isHorizontal(),n=t?t.first:this.first,r=(o,u)=>o*u,s=(o=0,u=0)=>this.contentStyle={...this.contentStyle,transform:`translate3d(${o}px, ${u}px, 0)`};if(e)s(r(n.cols,this.itemSize[1]),r(n.rows,this.itemSize[0]));else{const o=r(n,this.itemSize);i?s(o,0):s(0,o)}}},onScrollPositionChange(t){const e=t.target,i=this.isBoth(),n=this.isHorizontal(),r=this.getContentPosition(),s=(M,L)=>M?M>L?M-L:M:0,o=(M,L)=>Math.floor(M/(L||M)),u=(M,L,q,Z,J,ae)=>M<=J?J:ae?q-Z-J:L+J-1,h=(M,L,q,Z,J,ae,ye)=>M<=ae?0:Math.max(0,ye?ML?q:M-2*ae),p=(M,L,q,Z,J,ae)=>{let ye=L+Z+2*J;return M>=J&&(ye+=J+1),this.getLast(ye,ae)},g=s(e.scrollTop,r.top),y=s(e.scrollLeft,r.left);let S=i?{rows:0,cols:0}:0,P=this.last,R=!1,k=this.lastScrollPos;if(i){const M=this.lastScrollPos.top<=g,L=this.lastScrollPos.left<=y;if(!this.appendOnly||this.appendOnly&&(M||L)){const q={rows:o(g,this.itemSize[0]),cols:o(y,this.itemSize[1])},Z={rows:u(q.rows,this.first.rows,this.last.rows,this.numItemsInViewport.rows,this.d_numToleratedItems[0],M),cols:u(q.cols,this.first.cols,this.last.cols,this.numItemsInViewport.cols,this.d_numToleratedItems[1],L)};S={rows:h(q.rows,Z.rows,this.first.rows,this.last.rows,this.numItemsInViewport.rows,this.d_numToleratedItems[0],M),cols:h(q.cols,Z.cols,this.first.cols,this.last.cols,this.numItemsInViewport.cols,this.d_numToleratedItems[1],L)},P={rows:p(q.rows,S.rows,this.last.rows,this.numItemsInViewport.rows,this.d_numToleratedItems[0]),cols:p(q.cols,S.cols,this.last.cols,this.numItemsInViewport.cols,this.d_numToleratedItems[1],!0)},R=S.rows!==this.first.rows||P.rows!==this.last.rows||S.cols!==this.first.cols||P.cols!==this.last.cols||this.isRangeChanged,k={top:g,left:y}}}else{const M=n?y:g,L=this.lastScrollPos<=M;if(!this.appendOnly||this.appendOnly&&L){const q=o(M,this.itemSize),Z=u(q,this.first,this.last,this.numItemsInViewport,this.d_numToleratedItems,L);S=h(q,Z,this.first,this.last,this.numItemsInViewport,this.d_numToleratedItems,L),P=p(q,S,this.last,this.numItemsInViewport,this.d_numToleratedItems),R=S!==this.first||P!==this.last||this.isRangeChanged,k=M}}return{first:S,last:P,isRangeChanged:R,scrollPos:k}},onScrollChange(t){const{first:e,last:i,isRangeChanged:n,scrollPos:r}=this.onScrollPositionChange(t);if(n){const s={first:e,last:i};if(this.setContentPosition(s),this.first=e,this.last=i,this.lastScrollPos=r,this.$emit("scroll-index-change",s),this.lazy&&this.isPageChanged(e)){const o={first:this.step?Math.min(this.getPageByFirst(e)*this.step,this.items.length-this.step):e,last:Math.min(this.step?(this.getPageByFirst(e)+1)*this.step:i,this.items.length)};(this.lazyLoadState.first!==o.first||this.lazyLoadState.last!==o.last)&&this.$emit("lazy-load",o),this.lazyLoadState=o}}},onScroll(t){if(this.$emit("scroll",t),this.delay&&this.isPageChanged()){if(this.scrollTimeout&&clearTimeout(this.scrollTimeout),!this.d_loading&&this.showLoader){const{isRangeChanged:e}=this.onScrollPositionChange(t);(e||(this.step?this.isPageChanged():!1))&&(this.d_loading=!0)}this.scrollTimeout=setTimeout(()=>{this.onScrollChange(t),this.d_loading&&this.showLoader&&(!this.lazy||this.loading===void 0)&&(this.d_loading=!1,this.page=this.getPageByFirst())},this.delay)}else this.onScrollChange(t)},onResize(){this.resizeTimeout&&clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{if(He.isVisible(this.element)){const t=this.isBoth(),e=this.isVertical(),i=this.isHorizontal(),[n,r]=[He.getWidth(this.element),He.getHeight(this.element)],[s,o]=[n!==this.defaultWidth,r!==this.defaultHeight];(t?s||o:i?s:e?o:!1)&&(this.d_numToleratedItems=this.numToleratedItems,this.defaultWidth=n,this.defaultHeight=r,this.defaultContentWidth=He.getWidth(this.content),this.defaultContentHeight=He.getHeight(this.content),this.init())}},this.resizeDelay)},bindResizeListener(){this.resizeListener||(this.resizeListener=this.onResize.bind(this),window.addEventListener("resize",this.resizeListener),window.addEventListener("orientationchange",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),window.removeEventListener("orientationchange",this.resizeListener),this.resizeListener=null)},getOptions(t){const e=(this.items||[]).length,i=this.isBoth()?this.first.rows+t:this.first+t;return{index:i,count:e,first:i===0,last:i===e-1,even:i%2===0,odd:i%2!==0}},getLoaderOptions(t,e){let i=this.loaderArr.length;return{index:t,count:i,first:t===0,last:t===i-1,even:t%2===0,odd:t%2!==0,...e}},getPageByFirst(t){return Math.floor(((t??this.first)+this.d_numToleratedItems*4)/(this.step||1))},isPageChanged(t){return this.step?this.page!==this.getPageByFirst(t??this.first):!0},setContentEl(t){this.content=t||this.content||He.findSingle(this.element,".p-virtualscroller-content")},elementRef(t){this.element=t},contentRef(t){this.content=t}},computed:{containerClass(){return["p-virtualscroller",{"p-virtualscroller-inline":this.inline,"p-virtualscroller-both p-both-scroll":this.isBoth(),"p-virtualscroller-horizontal p-horizontal-scroll":this.isHorizontal()},this.class]},contentClass(){return["p-virtualscroller-content",{"p-virtualscroller-loading":this.d_loading}]},loaderClass(){return["p-virtualscroller-loader",{"p-component-overlay":!this.$slots.loader}]},loadedItems(){return this.items&&!this.d_loading?this.isBoth()?this.items.slice(this.appendOnly?0:this.first.rows,this.last.rows).map(t=>this.columns?t:t.slice(this.appendOnly?0:this.first.cols,this.last.cols)):this.isHorizontal()&&this.columns?this.items:this.items.slice(this.appendOnly?0:this.first,this.last):[]},loadedRows(){return this.d_loading?this.loaderDisabled?this.loaderArr:[]:this.loadedItems},loadedColumns(){if(this.columns){const t=this.isBoth(),e=this.isHorizontal();if(t||e)return this.d_loading&&this.loaderDisabled?t?this.loaderArr[0]:this.loaderArr:this.columns.slice(t?this.first.cols:this.first,t?this.last.cols:this.last)}return this.columns}}};const g5=["tabindex"],y5={key:1,class:"p-virtualscroller-loading-icon pi pi-spinner pi-spin"};function v5(t,e,i,n,r,s){return i.disabled?(X(),se(ct,{key:1},[pi(t.$slots,"default"),pi(t.$slots,"content",{items:i.items,rows:i.items,columns:s.loadedColumns})],64)):(X(),se("div",{key:0,ref:s.elementRef,class:Tt(s.containerClass),tabindex:i.tabindex,style:Ri(i.style),onScroll:e[0]||(e[0]=(...o)=>s.onScroll&&s.onScroll(...o))},[pi(t.$slots,"content",{styleClass:s.contentClass,items:s.loadedItems,getItemOptions:s.getOptions,loading:r.d_loading,getLoaderOptions:s.getLoaderOptions,itemSize:i.itemSize,rows:s.loadedRows,columns:s.loadedColumns,contentRef:s.contentRef,spacerStyle:r.spacerStyle,contentStyle:r.contentStyle,vertical:s.isVertical(),horizontal:s.isHorizontal(),both:s.isBoth()},()=>[Se("div",{ref:s.contentRef,class:Tt(s.contentClass),style:Ri(r.contentStyle)},[(X(!0),se(ct,null,Kt(s.loadedItems,(o,u)=>pi(t.$slots,"item",{key:u,item:o,options:s.getOptions(u)})),128))],6)]),i.showSpacer?(X(),se("div",{key:0,class:"p-virtualscroller-spacer",style:Ri(r.spacerStyle)},null,4)):Be("",!0),!i.loaderDisabled&&i.showLoader&&r.d_loading?(X(),se("div",{key:1,class:Tt(s.loaderClass)},[t.$slots&&t.$slots.loader?(X(!0),se(ct,{key:0},Kt(r.loaderArr,(o,u)=>pi(t.$slots,"loader",{key:u,options:s.getLoaderOptions(u,s.isBoth()&&{numCols:t.d_numItemsInViewport.cols})})),128)):(X(),se("i",y5))],2)):Be("",!0)],46,g5))}function b5(t,e){e===void 0&&(e={});var i=e.insertAt;if(!(typeof document>"u")){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",i==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var _5=` .p-virtualscroller { position: relative; overflow: auto; contain: strict; transform: translateZ(0); will-change: scroll-position; outline: 0 none; } .p-virtualscroller-content { position: absolute; top: 0; left: 0; /* contain: content; */ min-height: 100%; min-width: 100%; will-change: transform; } .p-virtualscroller-spacer { position: absolute; top: 0; left: 0; height: 1px; width: 1px; transform-origin: 0 0; pointer-events: none; } .p-virtualscroller .p-virtualscroller-loader { position: sticky; top: 0; left: 0; width: 100%; height: 100%; } .p-virtualscroller-loader.p-component-overlay { display: flex; align-items: center; justify-content: center; } .p-virtualscroller-loading-icon { font-size: 2rem; } .p-virtualscroller-horizontal > .p-virtualscroller-content { display: flex; } /* Inline */ .p-virtualscroller-inline .p-virtualscroller-content { position: static; } `;b5(_5),Ug.render=v5;var Dd={name:"Dropdown",emits:["update:modelValue","change","focus","blur","before-show","before-hide","show","hide","filter"],props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,scrollHeight:{type:String,default:"200px"},filter:Boolean,filterPlaceholder:String,filterLocale:String,filterMatchMode:{type:String,default:"contains"},filterFields:{type:Array,default:null},editable:Boolean,placeholder:{type:String,default:null},disabled:{type:Boolean,default:!1},dataKey:null,showClear:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},panelClass:{type:[String,Object],default:null},panelStyle:{type:Object,default:null},panelProps:{type:null,default:null},filterInputProps:{type:null,default:null},clearIconProps:{type:null,default:null},appendTo:{type:String,default:"body"},loading:{type:Boolean,default:!1},clearIcon:{type:String,default:"pi pi-times"},dropdownIcon:{type:String,default:"pi pi-chevron-down"},filterIcon:{type:String,default:"pi pi-search"},loadingIcon:{type:String,default:"pi pi-spinner pi-spin"},resetFilterOnHide:{type:Boolean,default:!1},virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},autoFilterFocus:{type:Boolean,default:!1},selectOnFocus:{type:Boolean,default:!1},filterMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptyFilterMessage:{type:String,default:null},emptyMessage:{type:String,default:null},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},outsideClickListener:null,scrollHandler:null,resizeListener:null,overlay:null,list:null,virtualScroller:null,searchTimeout:null,searchValue:null,isModelValueChanged:!1,focusOnHover:!1,data(){return{id:this.$attrs.id,focused:!1,focusedOptionIndex:-1,filterValue:null,overlayVisible:!1}},watch:{"$attrs.id":function(t){this.id=t||ks()},modelValue(){this.isModelValueChanged=!0},options(){this.autoUpdateModel()}},mounted(){this.id=this.id||ks(),this.autoUpdateModel()},updated(){this.overlayVisible&&this.isModelValueChanged&&this.scrollInView(this.findSelectedOptionIndex()),this.isModelValueChanged=!1},beforeUnmount(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.scrollHandler&&(this.scrollHandler.destroy(),this.scrollHandler=null),this.overlay&&(ol.clear(this.overlay),this.overlay=null)},methods:{getOptionIndex(t,e){return this.virtualScrollerDisabled?t:e&&e(t).index},getOptionLabel(t){return this.optionLabel?ft.resolveFieldData(t,this.optionLabel):t},getOptionValue(t){return this.optionValue?ft.resolveFieldData(t,this.optionValue):t},getOptionRenderKey(t,e){return(this.dataKey?ft.resolveFieldData(t,this.dataKey):this.getOptionLabel(t))+"_"+e},isOptionDisabled(t){return this.optionDisabled?ft.resolveFieldData(t,this.optionDisabled):!1},isOptionGroup(t){return this.optionGroupLabel&&t.optionGroup&&t.group},getOptionGroupLabel(t){return ft.resolveFieldData(t,this.optionGroupLabel)},getOptionGroupChildren(t){return ft.resolveFieldData(t,this.optionGroupChildren)},getAriaPosInset(t){return(this.optionGroupLabel?t-this.visibleOptions.slice(0,t).filter(e=>this.isOptionGroup(e)).length:t)+1},show(t){this.$emit("before-show"),this.overlayVisible=!0,this.focusedOptionIndex=this.focusedOptionIndex!==-1?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,t&&He.focus(this.$refs.focusInput)},hide(t){const e=()=>{this.$emit("before-hide"),this.overlayVisible=!1,this.focusedOptionIndex=-1,this.searchValue="",this.resetFilterOnHide&&(this.filterValue=null),t&&He.focus(this.$refs.focusInput)};setTimeout(()=>{e()},0)},onFocus(t){this.disabled||(this.focused=!0,this.focusedOptionIndex=this.focusedOptionIndex!==-1?this.focusedOptionIndex:this.overlayVisible&&this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,this.overlayVisible&&this.scrollInView(this.focusedOptionIndex),this.$emit("focus",t))},onBlur(t){this.focused=!1,this.focusedOptionIndex=-1,this.searchValue="",this.$emit("blur",t)},onKeyDown(t){if(this.disabled){t.preventDefault();return}const e=t.metaKey||t.ctrlKey;switch(t.code){case"ArrowDown":this.onArrowDownKey(t);break;case"ArrowUp":this.onArrowUpKey(t,this.editable);break;case"ArrowLeft":case"ArrowRight":this.onArrowLeftKey(t,this.editable);break;case"Home":this.onHomeKey(t,this.editable);break;case"End":this.onEndKey(t,this.editable);break;case"PageDown":this.onPageDownKey(t);break;case"PageUp":this.onPageUpKey(t);break;case"Space":this.onSpaceKey(t,this.editable);break;case"Enter":case"NumpadEnter":this.onEnterKey(t);break;case"Escape":this.onEscapeKey(t);break;case"Tab":this.onTabKey(t);break;case"Backspace":this.onBackspaceKey(t,this.editable);break;case"ShiftLeft":case"ShiftRight":break;default:!e&&ft.isPrintableCharacter(t.key)&&(!this.overlayVisible&&this.show(),!this.editable&&this.searchOptions(t,t.key));break}},onEditableInput(t){const e=t.target.value;this.searchValue="",!this.searchOptions(t,e)&&(this.focusedOptionIndex=-1),this.updateModel(t,e)},onContainerClick(t){this.disabled||this.loading||He.hasClass(t.target,"p-dropdown-clear-icon")||t.target.tagName==="INPUT"||(!this.overlay||!this.overlay.contains(t.target))&&(this.overlayVisible?this.hide(!0):this.show(!0))},onClearClick(t){this.updateModel(t,null)},onFirstHiddenFocus(t){const e=t.relatedTarget===this.$refs.focusInput?He.getFirstFocusableElement(this.overlay,":not(.p-hidden-focusable)"):this.$refs.focusInput;He.focus(e)},onLastHiddenFocus(t){const e=t.relatedTarget===this.$refs.focusInput?He.getLastFocusableElement(this.overlay,":not(.p-hidden-focusable)"):this.$refs.focusInput;He.focus(e)},onOptionSelect(t,e,i=!0){const n=this.getOptionValue(e);this.updateModel(t,n),i&&this.hide(!0)},onOptionMouseMove(t,e){this.focusOnHover&&this.changeFocusedOptionIndex(t,e)},onFilterChange(t){const e=t.target.value;this.filterValue=e,this.focusedOptionIndex=-1,this.$emit("filter",{originalEvent:t,value:e}),!this.virtualScrollerDisabled&&this.virtualScroller.scrollToIndex(0)},onFilterKeyDown(t){switch(t.code){case"ArrowDown":this.onArrowDownKey(t);break;case"ArrowUp":this.onArrowUpKey(t,!0);break;case"ArrowLeft":case"ArrowRight":this.onArrowLeftKey(t,!0);break;case"Home":this.onHomeKey(t,!0);break;case"End":this.onEndKey(t,!0);break;case"Enter":this.onEnterKey(t);break;case"Escape":this.onEscapeKey(t);break;case"Tab":this.onTabKey(t,!0);break}},onFilterBlur(){this.focusedOptionIndex=-1},onFilterUpdated(){this.overlayVisible&&this.alignOverlay()},onOverlayClick(t){lu.emit("overlay-click",{originalEvent:t,target:this.$el})},onOverlayKeyDown(t){switch(t.code){case"Escape":this.onEscapeKey(t);break}},onArrowDownKey(t){const e=this.focusedOptionIndex!==-1?this.findNextOptionIndex(this.focusedOptionIndex):this.findFirstFocusedOptionIndex();this.changeFocusedOptionIndex(t,e),!this.overlayVisible&&this.show(),t.preventDefault()},onArrowUpKey(t,e=!1){if(t.altKey&&!e)this.focusedOptionIndex!==-1&&this.onOptionSelect(t,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(),t.preventDefault();else{const i=this.focusedOptionIndex!==-1?this.findPrevOptionIndex(this.focusedOptionIndex):this.findLastFocusedOptionIndex();this.changeFocusedOptionIndex(t,i),!this.overlayVisible&&this.show(),t.preventDefault()}},onArrowLeftKey(t,e=!1){e&&(this.focusedOptionIndex=-1)},onHomeKey(t,e=!1){e?(t.currentTarget.setSelectionRange(0,0),this.focusedOptionIndex=-1):(this.changeFocusedOptionIndex(t,this.findFirstOptionIndex()),!this.overlayVisible&&this.show()),t.preventDefault()},onEndKey(t,e=!1){if(e){const i=t.currentTarget,n=i.value.length;i.setSelectionRange(n,n),this.focusedOptionIndex=-1}else this.changeFocusedOptionIndex(t,this.findLastOptionIndex()),!this.overlayVisible&&this.show();t.preventDefault()},onPageUpKey(t){this.scrollInView(0),t.preventDefault()},onPageDownKey(t){this.scrollInView(this.visibleOptions.length-1),t.preventDefault()},onEnterKey(t){this.overlayVisible?(this.focusedOptionIndex!==-1&&this.onOptionSelect(t,this.visibleOptions[this.focusedOptionIndex]),this.hide()):this.onArrowDownKey(t),t.preventDefault()},onSpaceKey(t,e=!1){!e&&this.onEnterKey(t)},onEscapeKey(t){this.overlayVisible&&this.hide(!0),t.preventDefault()},onTabKey(t,e=!1){e||(this.overlayVisible&&this.hasFocusableElements()?(He.focus(this.$refs.firstHiddenFocusableElementOnOverlay),t.preventDefault()):(this.focusedOptionIndex!==-1&&this.onOptionSelect(t,this.visibleOptions[this.focusedOptionIndex]),this.overlayVisible&&this.hide(this.filter)))},onBackspaceKey(t,e=!1){e&&!this.overlayVisible&&this.show()},onOverlayEnter(t){ol.set("overlay",t,this.$primevue.config.zIndex.overlay),this.alignOverlay(),this.scrollInView(),this.autoFilterFocus&&He.focus(this.$refs.filterInput)},onOverlayAfterEnter(){this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.$emit("show")},onOverlayLeave(){this.unbindOutsideClickListener(),this.unbindScrollListener(),this.unbindResizeListener(),this.$emit("hide"),this.overlay=null},onOverlayAfterLeave(t){ol.clear(t)},alignOverlay(){this.appendTo==="self"?He.relativePosition(this.overlay,this.$el):(this.overlay.style.minWidth=He.getOuterWidth(this.$el)+"px",He.absolutePosition(this.overlay,this.$el))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=t=>{this.overlayVisible&&this.overlay&&!this.$el.contains(t.target)&&!this.overlay.contains(t.target)&&this.hide()},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new r1(this.$refs.container,()=>{this.overlayVisible&&this.hide()})),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!He.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)},hasFocusableElements(){return He.getFocusableElements(this.overlay,":not(.p-hidden-focusable)").length>0},isOptionMatched(t){return this.isValidOption(t)&&this.getOptionLabel(t).toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale))},isValidOption(t){return t&&!(this.isOptionDisabled(t)||this.isOptionGroup(t))},isValidSelectedOption(t){return this.isValidOption(t)&&this.isSelected(t)},isSelected(t){return this.isValidOption(t)&&ft.equals(this.modelValue,this.getOptionValue(t),this.equalityKey)},findFirstOptionIndex(){return this.visibleOptions.findIndex(t=>this.isValidOption(t))},findLastOptionIndex(){return ft.findLastIndex(this.visibleOptions,t=>this.isValidOption(t))},findNextOptionIndex(t){const e=tthis.isValidOption(i)):-1;return e>-1?e+t+1:t},findPrevOptionIndex(t){const e=t>0?ft.findLastIndex(this.visibleOptions.slice(0,t),i=>this.isValidOption(i)):-1;return e>-1?e:t},findSelectedOptionIndex(){return this.hasSelectedOption?this.visibleOptions.findIndex(t=>this.isValidSelectedOption(t)):-1},findFirstFocusedOptionIndex(){const t=this.findSelectedOptionIndex();return t<0?this.findFirstOptionIndex():t},findLastFocusedOptionIndex(){const t=this.findSelectedOptionIndex();return t<0?this.findLastOptionIndex():t},searchOptions(t,e){this.searchValue=(this.searchValue||"")+e;let i=-1,n=!1;return this.focusedOptionIndex!==-1?(i=this.visibleOptions.slice(this.focusedOptionIndex).findIndex(r=>this.isOptionMatched(r)),i=i===-1?this.visibleOptions.slice(0,this.focusedOptionIndex).findIndex(r=>this.isOptionMatched(r)):i+this.focusedOptionIndex):i=this.visibleOptions.findIndex(r=>this.isOptionMatched(r)),i!==-1&&(n=!0),i===-1&&this.focusedOptionIndex===-1&&(i=this.findFirstFocusedOptionIndex()),i!==-1&&this.changeFocusedOptionIndex(t,i),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.searchValue="",this.searchTimeout=null},500),n},changeFocusedOptionIndex(t,e){this.focusedOptionIndex!==e&&(this.focusedOptionIndex=e,this.scrollInView(),this.selectOnFocus&&this.onOptionSelect(t,this.visibleOptions[e],!1))},scrollInView(t=-1){const e=t!==-1?`${this.id}_${t}`:this.focusedOptionId,i=He.findSingle(this.list,`li[id="${e}"]`);i?i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"start"}):this.virtualScrollerDisabled||setTimeout(()=>{this.virtualScroller&&this.virtualScroller.scrollToIndex(t!==-1?t:this.focusedOptionIndex)},0)},autoUpdateModel(){this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption&&(this.focusedOptionIndex=this.findFirstFocusedOptionIndex(),this.onOptionSelect(null,this.visibleOptions[this.focusedOptionIndex],!1))},updateModel(t,e){this.$emit("update:modelValue",e),this.$emit("change",{originalEvent:t,value:e})},flatOptions(t){return(t||[]).reduce((e,i,n)=>{e.push({optionGroup:i,group:!0,index:n});const r=this.getOptionGroupChildren(i);return r&&r.forEach(s=>e.push(s)),e},[])},overlayRef(t){this.overlay=t},listRef(t,e){this.list=t,e&&e(t)},virtualScrollerRef(t){this.virtualScroller=t}},computed:{containerClass(){return["p-dropdown p-component p-inputwrapper",{"p-disabled":this.disabled,"p-dropdown-clearable":this.showClear&&!this.disabled,"p-focus":this.focused,"p-inputwrapper-filled":this.modelValue,"p-inputwrapper-focus":this.focused||this.overlayVisible,"p-overlay-open":this.overlayVisible}]},inputStyleClass(){return["p-dropdown-label p-inputtext",this.inputClass,{"p-placeholder":!this.editable&&this.label===this.placeholder,"p-dropdown-label-empty":!this.editable&&!this.$slots.value&&(this.label==="p-emptylabel"||this.label.length===0)}]},panelStyleClass(){return["p-dropdown-panel p-component",this.panelClass,{"p-input-filled":this.$primevue.config.inputStyle==="filled","p-ripple-disabled":this.$primevue.config.ripple===!1}]},dropdownIconClass(){return["p-dropdown-trigger-icon",this.loading?this.loadingIcon:this.dropdownIcon]},visibleOptions(){const t=this.optionGroupLabel?this.flatOptions(this.options):this.options||[];if(this.filterValue){const e=kg.filter(t,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale);if(this.optionGroupLabel){const i=this.options||[],n=[];return i.forEach(r=>{const o=this.getOptionGroupChildren(r).filter(u=>e.includes(u));o.length>0&&n.push({...r,[typeof this.optionGroupChildren=="string"?this.optionGroupChildren:"items"]:[...o]})}),this.flatOptions(n)}return e}return t},hasSelectedOption(){return ft.isNotEmpty(this.modelValue)},label(){const t=this.findSelectedOptionIndex();return t!==-1?this.getOptionLabel(this.visibleOptions[t]):this.placeholder||"p-emptylabel"},editableInputValue(){const t=this.findSelectedOptionIndex();return t!==-1?this.getOptionLabel(this.visibleOptions[t]):this.modelValue||""},equalityKey(){return this.optionValue?null:this.dataKey},searchFields(){return this.filterFields||[this.optionLabel]},filterResultMessageText(){return ft.isNotEmpty(this.visibleOptions)?this.filterMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptyFilterMessageText},filterMessageText(){return this.filterMessage||this.$primevue.config.locale.searchMessage||""},emptyFilterMessageText(){return this.emptyFilterMessage||this.$primevue.config.locale.emptySearchMessage||this.$primevue.config.locale.emptyFilterMessage||""},emptyMessageText(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}","1"):this.emptySelectionMessageText},focusedOptionId(){return this.focusedOptionIndex!==-1?`${this.id}_${this.focusedOptionIndex}`:null},ariaSetSize(){return this.visibleOptions.filter(t=>!this.isOptionGroup(t)).length},virtualScrollerDisabled(){return!this.virtualScrollerOptions}},directives:{ripple:Rs},components:{VirtualScroller:Ug,Portal:Hg}};const w5=["id"],T5=["id","value","placeholder","tabindex","disabled","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant"],x5=["id","tabindex","aria-label","aria-labelledby","aria-expanded","aria-controls","aria-activedescendant","aria-disabled"],S5={class:"p-dropdown-trigger"},E5={key:0,class:"p-dropdown-header"},C5={class:"p-dropdown-filter-container"},A5=["value","placeholder","aria-owns","aria-activedescendant"],D5={role:"status","aria-live":"polite",class:"p-hidden-accessible"},P5=["id"],k5=["id"],I5=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousemove"],R5={key:0,class:"p-dropdown-empty-message",role:"option"},O5={key:1,class:"p-dropdown-empty-message",role:"option"},L5={key:1,role:"status","aria-live":"polite",class:"p-hidden-accessible"},M5={role:"status","aria-live":"polite",class:"p-hidden-accessible"};function F5(t,e,i,n,r,s){const o=Mt("VirtualScroller"),u=Mt("Portal"),h=Yr("ripple");return X(),se("div",{ref:"container",id:r.id,class:Tt(s.containerClass),onClick:e[16]||(e[16]=(...p)=>s.onContainerClick&&s.onContainerClick(...p))},[i.editable?(X(),se("input",Qi({key:0,ref:"focusInput",id:i.inputId,type:"text",style:i.inputStyle,class:s.inputStyleClass,value:s.editableInputValue,placeholder:i.placeholder,tabindex:i.disabled?-1:i.tabindex,disabled:i.disabled,autocomplete:"off",role:"combobox","aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabelledby,"aria-haspopup":"listbox","aria-expanded":r.overlayVisible,"aria-controls":r.id+"_list","aria-activedescendant":r.focused?s.focusedOptionId:void 0,onFocus:e[0]||(e[0]=(...p)=>s.onFocus&&s.onFocus(...p)),onBlur:e[1]||(e[1]=(...p)=>s.onBlur&&s.onBlur(...p)),onKeydown:e[2]||(e[2]=(...p)=>s.onKeyDown&&s.onKeyDown(...p)),onInput:e[3]||(e[3]=(...p)=>s.onEditableInput&&s.onEditableInput(...p))},i.inputProps),null,16,T5)):(X(),se("span",Qi({key:1,ref:"focusInput",id:i.inputId,style:i.inputStyle,class:s.inputStyleClass,tabindex:i.disabled?-1:i.tabindex,role:"combobox","aria-label":t.ariaLabel||(s.label==="p-emptylabel"?void 0:s.label),"aria-labelledby":t.ariaLabelledby,"aria-haspopup":"listbox","aria-expanded":r.overlayVisible,"aria-controls":r.id+"_list","aria-activedescendant":r.focused?s.focusedOptionId:void 0,"aria-disabled":i.disabled,onFocus:e[4]||(e[4]=(...p)=>s.onFocus&&s.onFocus(...p)),onBlur:e[5]||(e[5]=(...p)=>s.onBlur&&s.onBlur(...p)),onKeydown:e[6]||(e[6]=(...p)=>s.onKeyDown&&s.onKeyDown(...p))},i.inputProps),[pi(t.$slots,"value",{value:i.modelValue,placeholder:i.placeholder},()=>[Vi(it(s.label==="p-emptylabel"?" ":s.label||"empty"),1)])],16,x5)),i.showClear&&i.modelValue!=null?(X(),se("i",Qi({key:2,class:["p-dropdown-clear-icon",i.clearIcon],onClick:e[7]||(e[7]=(...p)=>s.onClearClick&&s.onClearClick(...p))},i.clearIconProps),null,16)):Be("",!0),Se("div",S5,[pi(t.$slots,"indicator",{},()=>[Se("span",{class:Tt(s.dropdownIconClass),"aria-hidden":"true"},null,2)])]),xt(u,{appendTo:i.appendTo},{default:Vt(()=>[xt(sl,{name:"p-connected-overlay",onEnter:s.onOverlayEnter,onAfterEnter:s.onOverlayAfterEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},{default:Vt(()=>[r.overlayVisible?(X(),se("div",Qi({key:0,ref:s.overlayRef,style:i.panelStyle,class:s.panelStyleClass,onClick:e[14]||(e[14]=(...p)=>s.onOverlayClick&&s.onOverlayClick(...p)),onKeydown:e[15]||(e[15]=(...p)=>s.onOverlayKeyDown&&s.onOverlayKeyDown(...p))},i.panelProps),[Se("span",{ref:"firstHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:e[8]||(e[8]=(...p)=>s.onFirstHiddenFocus&&s.onFirstHiddenFocus(...p))},null,544),pi(t.$slots,"header",{value:i.modelValue,options:s.visibleOptions}),i.filter?(X(),se("div",E5,[Se("div",C5,[Se("input",Qi({ref:"filterInput",type:"text",value:r.filterValue,onVnodeUpdated:e[9]||(e[9]=(...p)=>s.onFilterUpdated&&s.onFilterUpdated(...p)),class:"p-dropdown-filter p-inputtext p-component",placeholder:i.filterPlaceholder,role:"searchbox",autocomplete:"off","aria-owns":r.id+"_list","aria-activedescendant":s.focusedOptionId,onKeydown:e[10]||(e[10]=(...p)=>s.onFilterKeyDown&&s.onFilterKeyDown(...p)),onBlur:e[11]||(e[11]=(...p)=>s.onFilterBlur&&s.onFilterBlur(...p)),onInput:e[12]||(e[12]=(...p)=>s.onFilterChange&&s.onFilterChange(...p))},i.filterInputProps),null,16,A5),Se("span",{class:Tt(["p-dropdown-filter-icon",i.filterIcon])},null,2)]),Se("span",D5,it(s.filterResultMessageText),1)])):Be("",!0),Se("div",{class:"p-dropdown-items-wrapper",style:Ri({"max-height":s.virtualScrollerDisabled?i.scrollHeight:""})},[xt(o,Qi({ref:s.virtualScrollerRef},i.virtualScrollerOptions,{items:s.visibleOptions,style:{height:i.scrollHeight},tabindex:-1,disabled:s.virtualScrollerDisabled}),bg({content:Vt(({styleClass:p,contentRef:g,items:y,getItemOptions:S,contentStyle:P,itemSize:R})=>[Se("ul",{ref:k=>s.listRef(k,g),id:r.id+"_list",class:Tt(["p-dropdown-items",p]),style:Ri(P),role:"listbox"},[(X(!0),se(ct,null,Kt(y,(k,M)=>(X(),se(ct,{key:s.getOptionRenderKey(k,s.getOptionIndex(M,S))},[s.isOptionGroup(k)?(X(),se("li",{key:0,id:r.id+"_"+s.getOptionIndex(M,S),style:Ri({height:R?R+"px":void 0}),class:"p-dropdown-item-group",role:"option"},[pi(t.$slots,"optiongroup",{option:k.optionGroup,index:s.getOptionIndex(M,S)},()=>[Vi(it(s.getOptionGroupLabel(k.optionGroup)),1)])],12,k5)):dn((X(),se("li",{key:1,id:r.id+"_"+s.getOptionIndex(M,S),style:Ri({height:R?R+"px":void 0}),class:Tt(["p-dropdown-item",{"p-highlight":s.isSelected(k),"p-focus":r.focusedOptionIndex===s.getOptionIndex(M,S),"p-disabled":s.isOptionDisabled(k)}]),role:"option","aria-label":s.getOptionLabel(k),"aria-selected":s.isSelected(k),"aria-disabled":s.isOptionDisabled(k),"aria-setsize":s.ariaSetSize,"aria-posinset":s.getAriaPosInset(s.getOptionIndex(M,S)),onClick:L=>s.onOptionSelect(L,k),onMousemove:L=>s.onOptionMouseMove(L,s.getOptionIndex(M,S))},[pi(t.$slots,"option",{option:k,index:s.getOptionIndex(M,S)},()=>[Vi(it(s.getOptionLabel(k)),1)])],46,I5)),[[h]])],64))),128)),r.filterValue&&(!y||y&&y.length===0)?(X(),se("li",R5,[pi(t.$slots,"emptyfilter",{},()=>[Vi(it(s.emptyFilterMessageText),1)])])):!i.options||i.options&&i.options.length===0?(X(),se("li",O5,[pi(t.$slots,"empty",{},()=>[Vi(it(s.emptyMessageText),1)])])):Be("",!0)],14,P5)]),_:2},[t.$slots.loader?{name:"loader",fn:Vt(({options:p})=>[pi(t.$slots,"loader",{options:p})]),key:"0"}:void 0]),1040,["items","style","disabled"])],4),pi(t.$slots,"footer",{value:i.modelValue,options:s.visibleOptions}),!i.options||i.options&&i.options.length===0?(X(),se("span",L5,it(s.emptyMessageText),1)):Be("",!0),Se("span",M5,it(s.selectedMessageText),1),Se("span",{ref:"lastHiddenFocusableElementOnOverlay",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:0,onFocus:e[13]||(e[13]=(...p)=>s.onLastHiddenFocus&&s.onLastHiddenFocus(...p))},null,544)],16)):Be("",!0)]),_:3},8,["onEnter","onAfterEnter","onLeave","onAfterLeave"])]),_:3},8,["appendTo"])],10,w5)}function N5(t,e){e===void 0&&(e={});var i=e.insertAt;if(!(typeof document>"u")){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",i==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var B5=` .p-dropdown { display: inline-flex; cursor: pointer; position: relative; user-select: none; } .p-dropdown-clear-icon { position: absolute; top: 50%; margin-top: -0.5rem; } .p-dropdown-trigger { display: flex; align-items: center; justify-content: center; flex-shrink: 0; } .p-dropdown-label { display: block; white-space: nowrap; overflow: hidden; flex: 1 1 auto; width: 1%; text-overflow: ellipsis; cursor: pointer; } .p-dropdown-label-empty { overflow: hidden; opacity: 0; } input.p-dropdown-label { cursor: default; } .p-dropdown .p-dropdown-panel { min-width: 100%; } .p-dropdown-panel { position: absolute; top: 0; left: 0; } .p-dropdown-items-wrapper { overflow: auto; } .p-dropdown-item { cursor: pointer; font-weight: normal; white-space: nowrap; position: relative; overflow: hidden; } .p-dropdown-item-group { cursor: auto; } .p-dropdown-items { margin: 0; padding: 0; list-style-type: none; } .p-dropdown-filter { width: 100%; } .p-dropdown-filter-container { position: relative; } .p-dropdown-filter-icon { position: absolute; top: 50%; margin-top: -0.5rem; } .p-fluid .p-dropdown { display: flex; } .p-fluid .p-dropdown .p-dropdown-label { width: 1%; } `;N5(B5),Dd.render=F5;var mC={name:"InputSwitch",emits:["click","update:modelValue","change","input","focus","blur"],props:{modelValue:{type:null,default:!1},trueValue:{type:null,default:!0},falseValue:{type:null,default:!1},disabled:{type:Boolean,default:!1},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},data(){return{focused:!1}},methods:{onClick(t){if(!this.disabled){const e=this.checked?this.falseValue:this.trueValue;this.$emit("click",t),this.$emit("update:modelValue",e),this.$emit("change",t),this.$emit("input",e),this.$refs.input.focus()}t.preventDefault()},onFocus(t){this.focused=!0,this.$emit("focus",t)},onBlur(t){this.focused=!1,this.$emit("blur",t)}},computed:{containerClass(){return["p-inputswitch p-component",{"p-inputswitch-checked":this.checked,"p-disabled":this.disabled,"p-focus":this.focused}]},checked(){return this.modelValue===this.trueValue}}};const H5={class:"p-hidden-accessible"},U5=["id","checked","disabled","aria-checked","aria-labelledby","aria-label"],z5=Se("span",{class:"p-inputswitch-slider"},null,-1);function V5(t,e,i,n,r,s){return X(),se("div",{class:Tt(s.containerClass),onClick:e[2]||(e[2]=o=>s.onClick(o))},[Se("div",H5,[Se("input",Qi({ref:"input",id:i.inputId,type:"checkbox",role:"switch",class:i.inputClass,style:i.inputStyle,checked:s.checked,disabled:i.disabled,"aria-checked":s.checked,"aria-labelledby":t.ariaLabelledby,"aria-label":t.ariaLabel,onFocus:e[0]||(e[0]=o=>s.onFocus(o)),onBlur:e[1]||(e[1]=o=>s.onBlur(o))},i.inputProps),null,16,U5)]),z5],2)}function j5(t,e){e===void 0&&(e={});var i=e.insertAt;if(!(typeof document>"u")){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",i==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var W5=` .p-inputswitch { position: relative; display: inline-block; } .p-inputswitch-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; border: 1px solid transparent; } .p-inputswitch-slider:before { position: absolute; content: ''; top: 50%; } `;j5(W5),mC.render=V5;var gC={name:"Message",emits:["close"],props:{severity:{type:String,default:"info"},closable:{type:Boolean,default:!0},sticky:{type:Boolean,default:!0},life:{type:Number,default:3e3},icon:{type:String,default:null},closeIcon:{type:String,default:"pi pi-times"},closeButtonProps:{type:null,default:null}},timeout:null,data(){return{visible:!0}},mounted(){this.sticky||this.x()},methods:{close(t){this.visible=!1,this.$emit("close",t)},x(){setTimeout(()=>{this.visible=!1},this.life)}},computed:{containerClass(){return"p-message p-component p-message-"+this.severity},iconClass(){return["p-message-icon pi",this.icon?this.icon:{"pi-info-circle":this.severity==="info","pi-check":this.severity==="success","pi-exclamation-triangle":this.severity==="warn","pi-times-circle":this.severity==="error"}]},closeAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0}},directives:{ripple:Rs}};const q5={class:"p-message-wrapper"},G5={class:"p-message-text"},K5=["aria-label"];function Y5(t,e,i,n,r,s){const o=Yr("ripple");return X(),gt(sl,{name:"p-message",appear:""},{default:Vt(()=>[dn(Se("div",{class:Tt(s.containerClass),role:"alert","aria-live":"assertive","aria-atomic":"true"},[Se("div",q5,[Se("span",{class:Tt(s.iconClass)},null,2),Se("div",G5,[pi(t.$slots,"default")]),i.closable?dn((X(),se("button",Qi({key:0,class:"p-message-close p-link","aria-label":s.closeAriaLabel,type:"button",onClick:e[0]||(e[0]=u=>s.close(u))},i.closeButtonProps),[Se("i",{class:Tt(["p-message-close-icon",i.closeIcon])},null,2)],16,K5)),[[o]]):Be("",!0)])],2),[[hb,r.visible]])]),_:3})}function X5(t,e){e===void 0&&(e={});var i=e.insertAt;if(!(typeof document>"u")){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",i==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var Z5=` .p-message-wrapper { display: flex; align-items: center; } .p-message-close { display: flex; align-items: center; justify-content: center; } .p-message-close.p-link { margin-left: auto; overflow: hidden; position: relative; } .p-message-enter-from { opacity: 0; } .p-message-enter-active { transition: opacity 0.3s; } .p-message.p-message-leave-from { max-height: 1000px; } .p-message.p-message-leave-to { max-height: 0; opacity: 0; margin: 0 !important; } .p-message-leave-active { overflow: hidden; transition: max-height 0.3s cubic-bezier(0, 1, 0, 1), opacity 0.3s, margin 0.15s; } .p-message-leave-active .p-message-close { display: none; } `;X5(Z5),gC.render=Y5;var yC={name:"Listbox",emits:["update:modelValue","change","focus","blur","filter"],props:{modelValue:null,options:Array,optionLabel:null,optionValue:null,optionDisabled:null,optionGroupLabel:null,optionGroupChildren:null,listStyle:null,disabled:Boolean,dataKey:null,multiple:Boolean,metaKeySelection:Boolean,filter:Boolean,filterPlaceholder:String,filterLocale:String,filterMatchMode:{type:String,default:"contains"},filterFields:{type:Array,default:null},filterInputProps:null,virtualScrollerOptions:{type:Object,default:null},autoOptionFocus:{type:Boolean,default:!0},selectOnFocus:{type:Boolean,default:!1},filterMessage:{type:String,default:null},selectionMessage:{type:String,default:null},emptySelectionMessage:{type:String,default:null},emptyFilterMessage:{type:String,default:null},emptyMessage:{type:String,default:null},filterIcon:{type:String,default:"pi pi-search"},tabindex:{type:Number,default:0},"aria-label":{type:String,default:null},"aria-labelledby":{type:String,default:null}},list:null,virtualScroller:null,optionTouched:!1,startRangeIndex:-1,searchTimeout:null,searchValue:"",focusOnHover:!1,data(){return{id:this.$attrs.id,filterValue:null,focused:!1,focusedOptionIndex:-1}},watch:{"$attrs.id":function(t){this.id=t||ks()},options(){this.autoUpdateModel()}},mounted(){this.id=this.id||ks(),this.autoUpdateModel()},methods:{getOptionIndex(t,e){return this.virtualScrollerDisabled?t:e&&e(t).index},getOptionLabel(t){return this.optionLabel?ft.resolveFieldData(t,this.optionLabel):t},getOptionValue(t){return this.optionValue?ft.resolveFieldData(t,this.optionValue):t},getOptionRenderKey(t,e){return(this.dataKey?ft.resolveFieldData(t,this.dataKey):this.getOptionLabel(t))+"_"+e},isOptionDisabled(t){return this.optionDisabled?ft.resolveFieldData(t,this.optionDisabled):!1},isOptionGroup(t){return this.optionGroupLabel&&t.optionGroup&&t.group},getOptionGroupLabel(t){return ft.resolveFieldData(t,this.optionGroupLabel)},getOptionGroupChildren(t){return ft.resolveFieldData(t,this.optionGroupChildren)},getAriaPosInset(t){return(this.optionGroupLabel?t-this.visibleOptions.slice(0,t).filter(e=>this.isOptionGroup(e)).length:t)+1},onFirstHiddenFocus(){He.focus(this.list);const t=He.getFirstFocusableElement(this.$el,":not(.p-hidden-focusable)");this.$refs.lastHiddenFocusableElement.tabIndex=ft.isEmpty(t)?-1:void 0,this.$refs.firstHiddenFocusableElement.tabIndex=-1},onLastHiddenFocus(t){if(t.relatedTarget===this.list){const i=He.getFirstFocusableElement(this.$el,":not(.p-hidden-focusable)");He.focus(i),this.$refs.firstHiddenFocusableElement.tabIndex=void 0}else He.focus(this.$refs.firstHiddenFocusableElement);this.$refs.lastHiddenFocusableElement.tabIndex=-1},onFocusout(t){!this.$el.contains(t.relatedTarget)&&this.$refs.lastHiddenFocusableElement&&this.$refs.firstHiddenFocusableElement&&(this.$refs.lastHiddenFocusableElement.tabIndex=this.$refs.firstHiddenFocusableElement.tabIndex=void 0)},onListFocus(t){this.focused=!0,this.focusedOptionIndex=this.focusedOptionIndex!==-1?this.focusedOptionIndex:this.autoOptionFocus?this.findFirstFocusedOptionIndex():-1,this.$emit("focus",t)},onListBlur(t){this.focused=!1,this.focusedOptionIndex=this.startRangeIndex=-1,this.searchValue="",this.$emit("blur",t)},onListKeyDown(t){const e=t.metaKey||t.ctrlKey;switch(t.code){case"ArrowDown":this.onArrowDownKey(t);break;case"ArrowUp":this.onArrowUpKey(t);break;case"Home":this.onHomeKey(t);break;case"End":this.onEndKey(t);break;case"PageDown":this.onPageDownKey(t);break;case"PageUp":this.onPageUpKey(t);break;case"Enter":case"Space":this.onSpaceKey(t);break;case"Tab":break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(t);break;default:if(this.multiple&&t.code==="KeyA"&&e){const i=this.visibleOptions.filter(n=>this.isValidOption(n)).map(n=>this.getOptionValue(n));this.updateModel(t,i),t.preventDefault();break}!e&&ft.isPrintableCharacter(t.key)&&(this.searchOptions(t,t.key),t.preventDefault());break}},onOptionSelect(t,e,i=-1){this.disabled||this.isOptionDisabled(e)||(this.multiple?this.onOptionSelectMultiple(t,e):this.onOptionSelectSingle(t,e),this.optionTouched=!1,i!==-1&&(this.focusedOptionIndex=i))},onOptionMouseDown(t,e){this.changeFocusedOptionIndex(t,e)},onOptionMouseMove(t,e){this.focusOnHover&&this.changeFocusedOptionIndex(t,e)},onOptionTouchEnd(){this.disabled||(this.optionTouched=!0)},onOptionSelectSingle(t,e){let i=this.isSelected(e),n=!1,r=null;if(this.optionTouched?!1:this.metaKeySelection){let o=t.metaKey||t.ctrlKey;i?o&&(r=null,n=!0):(r=this.getOptionValue(e),n=!0)}else r=i?null:this.getOptionValue(e),n=!0;n&&this.updateModel(t,r)},onOptionSelectMultiple(t,e){let i=this.isSelected(e),n=null;if(this.optionTouched?!1:this.metaKeySelection){let s=t.metaKey||t.ctrlKey;i?n=s?this.removeOption(e):[this.getOptionValue(e)]:(n=s?this.modelValue||[]:[],n=[...n,this.getOptionValue(e)])}else n=i?this.removeOption(e):[...this.modelValue||[],this.getOptionValue(e)];this.updateModel(t,n)},onOptionSelectRange(t,e=-1,i=-1){if(e===-1&&(e=this.findNearestSelectedOptionIndex(i,!0)),i===-1&&(i=this.findNearestSelectedOptionIndex(e)),e!==-1&&i!==-1){const n=Math.min(e,i),r=Math.max(e,i),s=this.visibleOptions.slice(n,r+1).filter(o=>this.isValidOption(o)).map(o=>this.getOptionValue(o));this.updateModel(t,s)}},onFilterChange(t){this.$emit("filter",{originalEvent:t,value:t.target.value}),this.focusedOptionIndex=this.startRangeIndex=-1},onFilterBlur(){this.focusedOptionIndex=this.startRangeIndex=-1},onFilterKeyDown(t){switch(t.code){case"ArrowDown":this.onArrowDownKey(t);break;case"ArrowUp":this.onArrowUpKey(t);break;case"ArrowLeft":case"ArrowRight":this.onArrowLeftKey(t,!0);break;case"Home":this.onHomeKey(t,!0);break;case"End":this.onEndKey(t,!0);break;case"Enter":this.onEnterKey(t);break;case"ShiftLeft":case"ShiftRight":this.onShiftKey(t);break}},onArrowDownKey(t){const e=this.focusedOptionIndex!==-1?this.findNextOptionIndex(this.focusedOptionIndex):this.findFirstFocusedOptionIndex();this.multiple&&t.shiftKey&&this.onOptionSelectRange(t,this.startRangeIndex,e),this.changeFocusedOptionIndex(t,e),t.preventDefault()},onArrowUpKey(t){const e=this.focusedOptionIndex!==-1?this.findPrevOptionIndex(this.focusedOptionIndex):this.findLastFocusedOptionIndex();this.multiple&&t.shiftKey&&this.onOptionSelectRange(t,e,this.startRangeIndex),this.changeFocusedOptionIndex(t,e),t.preventDefault()},onArrowLeftKey(t,e=!1){e&&(this.focusedOptionIndex=-1)},onHomeKey(t,e=!1){if(e)t.currentTarget.setSelectionRange(0,0),this.focusedOptionIndex=-1;else{let i=t.metaKey||t.ctrlKey,n=this.findFirstOptionIndex();this.multiple&&t.shiftKey&&i&&this.onOptionSelectRange(t,n,this.startRangeIndex),this.changeFocusedOptionIndex(t,n)}t.preventDefault()},onEndKey(t,e=!1){if(e){const i=t.currentTarget,n=i.value.length;i.setSelectionRange(n,n),this.focusedOptionIndex=-1}else{let i=t.metaKey||t.ctrlKey,n=this.findLastOptionIndex();this.multiple&&t.shiftKey&&i&&this.onOptionSelectRange(t,this.startRangeIndex,n),this.changeFocusedOptionIndex(t,n)}t.preventDefault()},onPageUpKey(t){this.scrollInView(0),t.preventDefault()},onPageDownKey(t){this.scrollInView(this.visibleOptions.length-1),t.preventDefault()},onEnterKey(t){this.focusedOptionIndex!==-1&&(this.multiple&&t.shiftKey?this.onOptionSelectRange(t,this.focusedOptionIndex):this.onOptionSelect(t,this.visibleOptions[this.focusedOptionIndex])),t.preventDefault()},onSpaceKey(t){this.onEnterKey(t)},onShiftKey(){this.startRangeIndex=this.focusedOptionIndex},isOptionMatched(t){return this.isValidOption(t)&&this.getOptionLabel(t).toLocaleLowerCase(this.filterLocale).startsWith(this.searchValue.toLocaleLowerCase(this.filterLocale))},isValidOption(t){return t&&!(this.isOptionDisabled(t)||this.isOptionGroup(t))},isValidSelectedOption(t){return this.isValidOption(t)&&this.isSelected(t)},isSelected(t){const e=this.getOptionValue(t);return this.multiple?(this.modelValue||[]).some(i=>ft.equals(i,e,this.equalityKey)):ft.equals(this.modelValue,e,this.equalityKey)},findFirstOptionIndex(){return this.visibleOptions.findIndex(t=>this.isValidOption(t))},findLastOptionIndex(){return ft.findLastIndex(this.visibleOptions,t=>this.isValidOption(t))},findNextOptionIndex(t){const e=tthis.isValidOption(i)):-1;return e>-1?e+t+1:t},findPrevOptionIndex(t){const e=t>0?ft.findLastIndex(this.visibleOptions.slice(0,t),i=>this.isValidOption(i)):-1;return e>-1?e:t},findFirstSelectedOptionIndex(){return this.hasSelectedOption?this.visibleOptions.findIndex(t=>this.isValidSelectedOption(t)):-1},findLastSelectedOptionIndex(){return this.hasSelectedOption?ft.findLastIndex(this.visibleOptions,t=>this.isValidSelectedOption(t)):-1},findNextSelectedOptionIndex(t){const e=this.hasSelectedOption&&tthis.isValidSelectedOption(i)):-1;return e>-1?e+t+1:-1},findPrevSelectedOptionIndex(t){const e=this.hasSelectedOption&&t>0?ft.findLastIndex(this.visibleOptions.slice(0,t),i=>this.isValidSelectedOption(i)):-1;return e>-1?e:-1},findNearestSelectedOptionIndex(t,e=!1){let i=-1;return this.hasSelectedOption&&(e?(i=this.findPrevSelectedOptionIndex(t),i=i===-1?this.findNextSelectedOptionIndex(t):i):(i=this.findNextSelectedOptionIndex(t),i=i===-1?this.findPrevSelectedOptionIndex(t):i)),i>-1?i:t},findFirstFocusedOptionIndex(){const t=this.findFirstSelectedOptionIndex();return t<0?this.findFirstOptionIndex():t},findLastFocusedOptionIndex(){const t=this.findLastSelectedOptionIndex();return t<0?this.findLastOptionIndex():t},searchOptions(t,e){this.searchValue=(this.searchValue||"")+e;let i=-1;this.focusedOptionIndex!==-1?(i=this.visibleOptions.slice(this.focusedOptionIndex).findIndex(n=>this.isOptionMatched(n)),i=i===-1?this.visibleOptions.slice(0,this.focusedOptionIndex).findIndex(n=>this.isOptionMatched(n)):i+this.focusedOptionIndex):i=this.visibleOptions.findIndex(n=>this.isOptionMatched(n)),i===-1&&this.focusedOptionIndex===-1&&(i=this.findFirstFocusedOptionIndex()),i!==-1&&this.changeFocusedOptionIndex(t,i),this.searchTimeout&&clearTimeout(this.searchTimeout),this.searchTimeout=setTimeout(()=>{this.searchValue="",this.searchTimeout=null},500)},removeOption(t){return this.modelValue.filter(e=>!ft.equals(e,this.getOptionValue(t),this.equalityKey))},changeFocusedOptionIndex(t,e){this.focusedOptionIndex!==e&&(this.focusedOptionIndex=e,this.scrollInView(),this.selectOnFocus&&!this.multiple&&this.onOptionSelect(t,this.visibleOptions[e]))},scrollInView(t=-1){const e=t!==-1?`${this.id}_${t}`:this.focusedOptionId,i=He.findSingle(this.list,`li[id="${e}"]`);i?i.scrollIntoView&&i.scrollIntoView({block:"nearest",inline:"nearest"}):this.virtualScrollerDisabled||this.virtualScroller&&this.virtualScroller.scrollToIndex(t!==-1?t:this.focusedOptionIndex)},autoUpdateModel(){this.selectOnFocus&&this.autoOptionFocus&&!this.hasSelectedOption&&!this.multiple&&(this.focusedOptionIndex=this.findFirstFocusedOptionIndex(),this.onOptionSelect(null,this.visibleOptions[this.focusedOptionIndex]))},updateModel(t,e){this.$emit("update:modelValue",e),this.$emit("change",{originalEvent:t,value:e})},flatOptions(t){return(t||[]).reduce((e,i,n)=>{e.push({optionGroup:i,group:!0,index:n});const r=this.getOptionGroupChildren(i);return r&&r.forEach(s=>e.push(s)),e},[])},listRef(t,e){this.list=t,e&&e(t)},virtualScrollerRef(t){this.virtualScroller=t}},computed:{containerClass(){return["p-listbox p-component",{"p-focus":this.focused,"p-disabled":this.disabled}]},visibleOptions(){const t=this.optionGroupLabel?this.flatOptions(this.options):this.options||[];return this.filterValue?kg.filter(t,this.searchFields,this.filterValue,this.filterMatchMode,this.filterLocale):t},hasSelectedOption(){return ft.isNotEmpty(this.modelValue)},equalityKey(){return this.optionValue?null:this.dataKey},searchFields(){return this.filterFields||[this.optionLabel]},filterResultMessageText(){return ft.isNotEmpty(this.visibleOptions)?this.filterMessageText.replaceAll("{0}",this.visibleOptions.length):this.emptyFilterMessageText},filterMessageText(){return this.filterMessage||this.$primevue.config.locale.searchMessage||""},emptyFilterMessageText(){return this.emptyFilterMessage||this.$primevue.config.locale.emptySearchMessage||this.$primevue.config.locale.emptyFilterMessage||""},emptyMessageText(){return this.emptyMessage||this.$primevue.config.locale.emptyMessage||""},selectionMessageText(){return this.selectionMessage||this.$primevue.config.locale.selectionMessage||""},emptySelectionMessageText(){return this.emptySelectionMessage||this.$primevue.config.locale.emptySelectionMessage||""},selectedMessageText(){return this.hasSelectedOption?this.selectionMessageText.replaceAll("{0}",this.multiple?this.modelValue.length:"1"):this.emptySelectionMessageText},focusedOptionId(){return this.focusedOptionIndex!==-1?`${this.id}_${this.focusedOptionIndex}`:null},ariaSetSize(){return this.visibleOptions.filter(t=>!this.isOptionGroup(t)).length},virtualScrollerDisabled(){return!this.virtualScrollerOptions}},directives:{ripple:Rs},components:{VirtualScroller:Ug}};const Q5=["id"],J5=["tabindex"],$5={key:0,class:"p-listbox-header"},e9={class:"p-listbox-filter-container"},t9=["placeholder","aria-owns","aria-activedescendant","tabindex"],i9={role:"status","aria-live":"polite",class:"p-hidden-accessible"},n9=["id","aria-multiselectable","aria-label","aria-labelledby","aria-activedescendant","aria-disabled"],r9=["id"],s9=["id","aria-label","aria-selected","aria-disabled","aria-setsize","aria-posinset","onClick","onMousedown","onMousemove"],o9={key:0,class:"p-listbox-empty-message",role:"option"},a9={key:1,class:"p-listbox-empty-message",role:"option"},l9={key:1,role:"status","aria-live":"polite",class:"p-hidden-accessible"},u9={role:"status","aria-live":"polite",class:"p-hidden-accessible"},c9=["tabindex"];function d9(t,e,i,n,r,s){const o=Mt("VirtualScroller"),u=Yr("ripple");return X(),se("div",{id:r.id,class:Tt(s.containerClass),onFocusout:e[10]||(e[10]=(...h)=>s.onFocusout&&s.onFocusout(...h))},[Se("span",{ref:"firstHiddenFocusableElement",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:i.disabled?-1:i.tabindex,onFocus:e[0]||(e[0]=(...h)=>s.onFirstHiddenFocus&&s.onFirstHiddenFocus(...h))},null,40,J5),pi(t.$slots,"header",{value:i.modelValue,options:s.visibleOptions}),i.filter?(X(),se("div",$5,[Se("div",e9,[dn(Se("input",Qi({ref:"filterInput","onUpdate:modelValue":e[1]||(e[1]=h=>r.filterValue=h),type:"text",class:"p-listbox-filter p-inputtext p-component",placeholder:i.filterPlaceholder,role:"searchbox",autocomplete:"off","aria-owns":r.id+"_list","aria-activedescendant":s.focusedOptionId,tabindex:!i.disabled&&!r.focused?i.tabindex:-1,onInput:e[2]||(e[2]=(...h)=>s.onFilterChange&&s.onFilterChange(...h)),onBlur:e[3]||(e[3]=(...h)=>s.onFilterBlur&&s.onFilterBlur(...h)),onKeydown:e[4]||(e[4]=(...h)=>s.onFilterKeyDown&&s.onFilterKeyDown(...h))},i.filterInputProps),null,16,t9),[[i1,r.filterValue]]),Se("span",{class:Tt(["p-listbox-filter-icon",i.filterIcon])},null,2)]),Se("span",i9,it(s.filterResultMessageText),1)])):Be("",!0),Se("div",{ref:"listWrapper",class:"p-listbox-list-wrapper",style:Ri(i.listStyle)},[xt(o,Qi({ref:s.virtualScrollerRef},i.virtualScrollerOptions,{style:i.listStyle,items:s.visibleOptions,tabindex:-1,disabled:s.virtualScrollerDisabled}),bg({content:Vt(({styleClass:h,contentRef:p,items:g,getItemOptions:y,contentStyle:S,itemSize:P})=>[Se("ul",{ref:R=>s.listRef(R,p),id:r.id+"_list",class:Tt(["p-listbox-list",h]),style:Ri(S),tabindex:-1,role:"listbox","aria-multiselectable":i.multiple,"aria-label":t.ariaLabel,"aria-labelledby":t.ariaLabelledby,"aria-activedescendant":r.focused?s.focusedOptionId:void 0,"aria-disabled":i.disabled,onFocus:e[6]||(e[6]=(...R)=>s.onListFocus&&s.onListFocus(...R)),onBlur:e[7]||(e[7]=(...R)=>s.onListBlur&&s.onListBlur(...R)),onKeydown:e[8]||(e[8]=(...R)=>s.onListKeyDown&&s.onListKeyDown(...R))},[(X(!0),se(ct,null,Kt(g,(R,k)=>(X(),se(ct,{key:s.getOptionRenderKey(R,s.getOptionIndex(k,y))},[s.isOptionGroup(R)?(X(),se("li",{key:0,id:r.id+"_"+s.getOptionIndex(k,y),style:Ri({height:P?P+"px":void 0}),class:"p-listbox-item-group",role:"option"},[pi(t.$slots,"optiongroup",{option:R.optionGroup,index:s.getOptionIndex(k,y)},()=>[Vi(it(s.getOptionGroupLabel(R.optionGroup)),1)])],12,r9)):dn((X(),se("li",{key:1,id:r.id+"_"+s.getOptionIndex(k,y),style:Ri({height:P?P+"px":void 0}),class:Tt(["p-listbox-item",{"p-highlight":s.isSelected(R),"p-focus":r.focusedOptionIndex===s.getOptionIndex(k,y),"p-disabled":s.isOptionDisabled(R)}]),role:"option","aria-label":s.getOptionLabel(R),"aria-selected":s.isSelected(R),"aria-disabled":s.isOptionDisabled(R),"aria-setsize":s.ariaSetSize,"aria-posinset":s.getAriaPosInset(s.getOptionIndex(k,y)),onClick:M=>s.onOptionSelect(M,R,s.getOptionIndex(k,y)),onMousedown:M=>s.onOptionMouseDown(M,s.getOptionIndex(k,y)),onMousemove:M=>s.onOptionMouseMove(M,s.getOptionIndex(k,y)),onTouchend:e[5]||(e[5]=M=>s.onOptionTouchEnd())},[pi(t.$slots,"option",{option:R,index:s.getOptionIndex(k,y)},()=>[Vi(it(s.getOptionLabel(R)),1)])],46,s9)),[[u]])],64))),128)),r.filterValue&&(!g||g&&g.length===0)?(X(),se("li",o9,[pi(t.$slots,"emptyfilter",{},()=>[Vi(it(s.emptyFilterMessageText),1)])])):!i.options||i.options&&i.options.length===0?(X(),se("li",a9,[pi(t.$slots,"empty",{},()=>[Vi(it(s.emptyMessageText),1)])])):Be("",!0)],46,n9)]),_:2},[t.$slots.loader?{name:"loader",fn:Vt(({options:h})=>[pi(t.$slots,"loader",{options:h})]),key:"0"}:void 0]),1040,["style","items","disabled"])],4),pi(t.$slots,"footer",{value:i.modelValue,options:s.visibleOptions}),!i.options||i.options&&i.options.length===0?(X(),se("span",l9,it(s.emptyMessageText),1)):Be("",!0),Se("span",u9,it(s.selectedMessageText),1),Se("span",{ref:"lastHiddenFocusableElement",role:"presentation","aria-hidden":"true",class:"p-hidden-accessible p-hidden-focusable",tabindex:i.disabled?-1:i.tabindex,onFocus:e[9]||(e[9]=(...h)=>s.onLastHiddenFocus&&s.onLastHiddenFocus(...h))},null,40,c9)],42,Q5)}function h9(t,e){e===void 0&&(e={});var i=e.insertAt;if(!(typeof document>"u")){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",i==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var f9=` .p-listbox-list-wrapper { overflow: auto; } .p-listbox-list { list-style-type: none; margin: 0; padding: 0; } .p-listbox-item { cursor: pointer; position: relative; overflow: hidden; } .p-listbox-item-group { cursor: auto; } .p-listbox-filter-container { position: relative; } .p-listbox-filter-icon { position: absolute; top: 50%; margin-top: -0.5rem; } .p-listbox-filter { width: 100%; } `;h9(f9),yC.render=d9;var vC={name:"Chip",emits:["remove"],props:{label:{type:String,default:null},icon:{type:String,default:null},image:{type:String,default:null},removable:{type:Boolean,default:!1},removeIcon:{type:String,default:"pi pi-times-circle"}},data(){return{visible:!0}},methods:{onKeydown(t){(t.key==="Enter"||t.key==="Backspace")&&this.close(t)},close(t){this.visible=!1,this.$emit("remove",t)}},computed:{containerClass(){return["p-chip p-component",{"p-chip-image":this.image!=null}]},iconClass(){return["p-chip-icon",this.icon]},removeIconClass(){return["p-chip-remove-icon",this.removeIcon]}}};const p9=["aria-label"],m9=["src"],g9={key:2,class:"p-chip-text"};function y9(t,e,i,n,r,s){return r.visible?(X(),se("div",{key:0,class:Tt(s.containerClass),"aria-label":i.label},[pi(t.$slots,"default",{},()=>[i.image?(X(),se("img",{key:0,src:i.image},null,8,m9)):i.icon?(X(),se("span",{key:1,class:Tt(s.iconClass)},null,2)):Be("",!0),i.label?(X(),se("div",g9,it(i.label),1)):Be("",!0)]),i.removable?(X(),se("span",{key:0,tabindex:"0",class:Tt(s.removeIconClass),onClick:e[0]||(e[0]=(...o)=>s.close&&s.close(...o)),onKeydown:e[1]||(e[1]=(...o)=>s.onKeydown&&s.onKeydown(...o))},null,34)):Be("",!0)],10,p9)):Be("",!0)}function v9(t,e){e===void 0&&(e={});var i=e.insertAt;if(!(typeof document>"u")){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",i==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var b9=` .p-chip { display: inline-flex; align-items: center; } .p-chip-text { line-height: 1.5; } .p-chip-icon.pi { line-height: 1.5; } .p-chip-remove-icon { line-height: 1.5; cursor: pointer; } .p-chip img { border-radius: 50%; } `;v9(b9),vC.render=y9;var Ub={name:"TabView",emits:["update:activeIndex","tab-change","tab-click"],props:{activeIndex:{type:Number,default:0},lazy:{type:Boolean,default:!1},scrollable:{type:Boolean,default:!1},tabindex:{type:Number,default:0},selectOnFocus:{type:Boolean,default:!1},previousButtonProps:{type:null,default:null},nextButtonProps:{type:null,default:null}},data(){return{id:this.$attrs.id,d_activeIndex:this.activeIndex,isPrevButtonDisabled:!0,isNextButtonDisabled:!1}},watch:{"$attrs.id":function(t){this.id=t||ks()},activeIndex(t){this.d_activeIndex=t,this.scrollInView({index:t})}},mounted(){this.id=this.id||ks(),this.updateInkBar(),this.scrollable&&this.updateButtonState()},updated(){this.updateInkBar()},methods:{isTabPanel(t){return t.type.name==="TabPanel"},isTabActive(t){return this.d_activeIndex===t},getTabProp(t,e){return t.props?t.props[e]:void 0},getKey(t,e){return this.getTabProp(t,"header")||e},getTabHeaderActionId(t){return`${this.id}_${t}_header_action`},getTabContentId(t){return`${this.id}_${t}_content`},onScroll(t){this.scrollable&&this.updateButtonState(),t.preventDefault()},onPrevButtonClick(){const t=this.$refs.content,e=He.getWidth(t)-this.getVisibleButtonWidths(),i=t.scrollLeft-e;t.scrollLeft=i<=0?0:i},onNextButtonClick(){const t=this.$refs.content,e=He.getWidth(t)-this.getVisibleButtonWidths(),i=t.scrollLeft+e,n=t.scrollWidth-e;t.scrollLeft=i>=n?n:i},onTabClick(t,e,i){this.changeActiveIndex(t,e,i),this.$emit("tab-click",{originalEvent:t,index:i})},onTabKeyDown(t,e,i){switch(t.code){case"ArrowLeft":this.onTabArrowLeftKey(t);break;case"ArrowRight":this.onTabArrowRightKey(t);break;case"Home":this.onTabHomeKey(t);break;case"End":this.onTabEndKey(t);break;case"PageDown":this.onPageDownKey(t);break;case"PageUp":this.onPageUpKey(t);break;case"Enter":case"Space":this.onTabEnterKey(t,e,i);break}},onTabArrowRightKey(t){const e=this.findNextHeaderAction(t.target.parentElement);e?this.changeFocusedTab(t,e):this.onTabHomeKey(t),t.preventDefault()},onTabArrowLeftKey(t){const e=this.findPrevHeaderAction(t.target.parentElement);e?this.changeFocusedTab(t,e):this.onTabEndKey(t),t.preventDefault()},onTabHomeKey(t){const e=this.findFirstHeaderAction();this.changeFocusedTab(t,e),t.preventDefault()},onTabEndKey(t){const e=this.findLastHeaderAction();this.changeFocusedTab(t,e),t.preventDefault()},onPageDownKey(t){this.scrollInView({index:this.$refs.nav.children.length-2}),t.preventDefault()},onPageUpKey(t){this.scrollInView({index:0}),t.preventDefault()},onTabEnterKey(t,e,i){this.changeActiveIndex(t,e,i),t.preventDefault()},findNextHeaderAction(t,e=!1){const i=e?t:t.nextElementSibling;return i?He.hasClass(i,"p-disabled")||He.hasClass(i,"p-tabview-ink-bar")?this.findNextHeaderAction(i):He.findSingle(i,".p-tabview-header-action"):null},findPrevHeaderAction(t,e=!1){const i=e?t:t.previousElementSibling;return i?He.hasClass(i,"p-disabled")||He.hasClass(i,"p-tabview-ink-bar")?this.findPrevHeaderAction(i):He.findSingle(i,".p-tabview-header-action"):null},findFirstHeaderAction(){return this.findNextHeaderAction(this.$refs.nav.firstElementChild,!0)},findLastHeaderAction(){return this.findPrevHeaderAction(this.$refs.nav.lastElementChild,!0)},changeActiveIndex(t,e,i){!this.getTabProp(e,"disabled")&&this.d_activeIndex!==i&&(this.d_activeIndex=i,this.$emit("update:activeIndex",i),this.$emit("tab-change",{originalEvent:t,index:i}),this.scrollInView({index:i}))},changeFocusedTab(t,e){if(e&&(He.focus(e),this.scrollInView({element:e}),this.selectOnFocus)){const i=parseInt(e.parentElement.dataset.index,10),n=this.tabs[i];this.changeActiveIndex(t,n,i)}},scrollInView({element:t,index:e=-1}){const i=t||this.$refs.nav.children[e];i&&i.scrollIntoView&&i.scrollIntoView({block:"nearest"})},updateInkBar(){let t=this.$refs.nav.children[this.d_activeIndex];this.$refs.inkbar.style.width=He.getWidth(t)+"px",this.$refs.inkbar.style.left=He.getOffset(t).left-He.getOffset(this.$refs.nav).left+"px"},updateButtonState(){const t=this.$refs.content,{scrollLeft:e,scrollWidth:i}=t,n=He.getWidth(t);this.isPrevButtonDisabled=e===0,this.isNextButtonDisabled=parseInt(e)===i-n},getVisibleButtonWidths(){const{prevBtn:t,nextBtn:e}=this.$refs;return[t,e].reduce((i,n)=>n?i+He.getWidth(n):i,0)},getTabHeaderClass(t,e){return["p-tabview-header",this.getTabProp(t,"headerClass"),{"p-highlight":this.d_activeIndex===e,"p-disabled":this.getTabProp(t,"disabled")}]},getTabContentClass(t){return["p-tabview-panel",this.getTabProp(t,"contentClass")]}},computed:{contentClasses(){return["p-tabview p-component",{"p-tabview-scrollable":this.scrollable}]},tabs(){return this.$slots.default().reduce((t,e)=>(this.isTabPanel(e)?t.push(e):e.children&&e.children instanceof Array&&e.children.forEach(i=>{this.isTabPanel(i)&&t.push(i)}),t),[])},prevButtonAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.previous:void 0},nextButtonAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.next:void 0}},directives:{ripple:Rs}};const _9={class:"p-tabview-nav-container"},w9=["tabindex","aria-label"],T9=[Se("span",{class:"pi pi-chevron-left","aria-hidden":"true"},null,-1)],x9={ref:"nav",class:"p-tabview-nav",role:"tablist"},S9=["data-index"],E9=["id","tabindex","aria-disabled","aria-selected","aria-controls","onClick","onKeydown"],C9={key:0,class:"p-tabview-title"},A9={ref:"inkbar",class:"p-tabview-ink-bar",role:"presentation","aria-hidden":"true"},D9=["tabindex","aria-label"],P9=[Se("span",{class:"pi pi-chevron-right","aria-hidden":"true"},null,-1)],k9={class:"p-tabview-panels"},I9=["aria-labelledby"];function R9(t,e,i,n,r,s){const o=Yr("ripple");return X(),se("div",{class:Tt(s.contentClasses)},[Se("div",_9,[i.scrollable&&!r.isPrevButtonDisabled?dn((X(),se("button",Qi({key:0,ref:"prevBtn",type:"button",class:"p-tabview-nav-prev p-tabview-nav-btn p-link",tabindex:i.tabindex,"aria-label":s.prevButtonAriaLabel,onClick:e[0]||(e[0]=(...u)=>s.onPrevButtonClick&&s.onPrevButtonClick(...u))},i.previousButtonProps),T9,16,w9)),[[o]]):Be("",!0),Se("div",{ref:"content",class:"p-tabview-nav-content",onScroll:e[1]||(e[1]=(...u)=>s.onScroll&&s.onScroll(...u))},[Se("ul",x9,[(X(!0),se(ct,null,Kt(s.tabs,(u,h)=>(X(),se("li",Qi({key:s.getKey(u,h),style:s.getTabProp(u,"headerStyle"),class:s.getTabHeaderClass(u,h),role:"presentation","data-index":h},s.getTabProp(u,"headerProps")),[dn((X(),se("a",Qi({id:s.getTabHeaderActionId(h),class:"p-tabview-nav-link p-tabview-header-action",tabindex:s.getTabProp(u,"disabled")||!s.isTabActive(h)?-1:i.tabindex,role:"tab","aria-disabled":s.getTabProp(u,"disabled"),"aria-selected":s.isTabActive(h),"aria-controls":s.getTabContentId(h),onClick:p=>s.onTabClick(p,u,h),onKeydown:p=>s.onTabKeyDown(p,u,h)},s.getTabProp(u,"headerActionProps")),[u.props&&u.props.header?(X(),se("span",C9,it(u.props.header),1)):Be("",!0),u.children&&u.children.header?(X(),gt(fr(u.children.header),{key:1})):Be("",!0)],16,E9)),[[o]])],16,S9))),128)),Se("li",A9,null,512)],512)],544),i.scrollable&&!r.isNextButtonDisabled?dn((X(),se("button",Qi({key:1,ref:"nextBtn",type:"button",class:"p-tabview-nav-next p-tabview-nav-btn p-link",tabindex:i.tabindex,"aria-label":s.nextButtonAriaLabel,onClick:e[2]||(e[2]=(...u)=>s.onNextButtonClick&&s.onNextButtonClick(...u))},i.nextButtonProps),P9,16,D9)),[[o]]):Be("",!0)]),Se("div",k9,[(X(!0),se(ct,null,Kt(s.tabs,(u,h)=>(X(),se(ct,{key:s.getKey(u,h)},[!i.lazy||s.isTabActive(h)?dn((X(),se("div",Qi({key:0,style:s.getTabProp(u,"contentStyle"),class:s.getTabContentClass(u),role:"tabpanel","aria-labelledby":s.getTabHeaderActionId(h)},s.getTabProp(u,"contentProps")),[(X(),gt(fr(u)))],16,I9)),[[hb,i.lazy?!0:s.isTabActive(h)]]):Be("",!0)],64))),128))])],2)}function O9(t,e){e===void 0&&(e={});var i=e.insertAt;if(!(typeof document>"u")){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",i==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var L9=` .p-tabview-nav-container { position: relative; } .p-tabview-scrollable .p-tabview-nav-container { overflow: hidden; } .p-tabview-nav-content { overflow-x: auto; overflow-y: hidden; scroll-behavior: smooth; scrollbar-width: none; overscroll-behavior: contain auto; } .p-tabview-nav { display: flex; margin: 0; padding: 0; list-style-type: none; flex: 1 1 auto; } .p-tabview-header-action { cursor: pointer; user-select: none; display: flex; align-items: center; position: relative; text-decoration: none; overflow: hidden; } .p-tabview-ink-bar { display: none; z-index: 1; } .p-tabview-header-action:focus { z-index: 1; } .p-tabview-title { line-height: 1; white-space: nowrap; } .p-tabview-nav-btn { position: absolute; top: 0; z-index: 2; height: 100%; display: flex; align-items: center; justify-content: center; } .p-tabview-nav-prev { left: 0; } .p-tabview-nav-next { right: 0; } .p-tabview-nav-content::-webkit-scrollbar { display: none; } `;O9(L9),Ub.render=R9;var zb={name:"TabPanel",props:{header:null,headerStyle:null,headerClass:null,headerProps:null,headerActionProps:null,contentStyle:null,contentClass:null,contentProps:null,disabled:Boolean}};function M9(t,e,i,n,r,s){return pi(t.$slots,"default")}zb.render=M9;var Vb={name:"InputText",emits:["update:modelValue"],props:{modelValue:null},methods:{onInput(t){this.$emit("update:modelValue",t.target.value)}},computed:{filled(){return this.modelValue!=null&&this.modelValue.toString().length>0}}};const F9=["value"];function N9(t,e,i,n,r,s){return X(),se("input",{class:Tt(["p-inputtext p-component",{"p-filled":s.filled}]),value:i.modelValue,onInput:e[0]||(e[0]=(...o)=>s.onInput&&s.onInput(...o))},null,42,F9)}Vb.render=N9;var bC={name:"InputNumber",emits:["update:modelValue","input","focus","blur"],props:{modelValue:{type:Number,default:null},format:{type:Boolean,default:!0},showButtons:{type:Boolean,default:!1},buttonLayout:{type:String,default:"stacked"},incrementButtonClass:{type:String,default:null},decrementButtonClass:{type:String,default:null},incrementButtonIcon:{type:String,default:"pi pi-angle-up"},decrementButtonIcon:{type:String,default:"pi pi-angle-down"},locale:{type:String,default:void 0},localeMatcher:{type:String,default:void 0},mode:{type:String,default:"decimal"},prefix:{type:String,default:null},suffix:{type:String,default:null},currency:{type:String,default:void 0},currencyDisplay:{type:String,default:void 0},useGrouping:{type:Boolean,default:!0},minFractionDigits:{type:Number,default:void 0},maxFractionDigits:{type:Number,default:void 0},min:{type:Number,default:null},max:{type:Number,default:null},step:{type:Number,default:1},allowEmpty:{type:Boolean,default:!0},highlightOnFocus:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},placeholder:{type:String,default:null},inputId:{type:String,default:null},inputClass:{type:[String,Object],default:null},inputStyle:{type:Object,default:null},inputProps:{type:null,default:null},incrementButtonProps:{type:null,default:null},decrementButtonProps:{type:null,default:null},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},numberFormat:null,_numeral:null,_decimal:null,_group:null,_minusSign:null,_currency:null,_suffix:null,_prefix:null,_index:null,groupChar:"",isSpecialChar:null,prefixChar:null,suffixChar:null,timer:null,data(){return{d_modelValue:this.modelValue,focused:!1}},watch:{modelValue(t){this.d_modelValue=t},locale(t,e){this.updateConstructParser(t,e)},localeMatcher(t,e){this.updateConstructParser(t,e)},mode(t,e){this.updateConstructParser(t,e)},currency(t,e){this.updateConstructParser(t,e)},currencyDisplay(t,e){this.updateConstructParser(t,e)},useGrouping(t,e){this.updateConstructParser(t,e)},minFractionDigits(t,e){this.updateConstructParser(t,e)},maxFractionDigits(t,e){this.updateConstructParser(t,e)},suffix(t,e){this.updateConstructParser(t,e)},prefix(t,e){this.updateConstructParser(t,e)}},created(){this.constructParser()},methods:{getOptions(){return{localeMatcher:this.localeMatcher,style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay,useGrouping:this.useGrouping,minimumFractionDigits:this.minFractionDigits,maximumFractionDigits:this.maxFractionDigits}},constructParser(){this.numberFormat=new Intl.NumberFormat(this.locale,this.getOptions());const t=[...new Intl.NumberFormat(this.locale,{useGrouping:!1}).format(9876543210)].reverse(),e=new Map(t.map((i,n)=>[i,n]));this._numeral=new RegExp(`[${t.join("")}]`,"g"),this._group=this.getGroupingExpression(),this._minusSign=this.getMinusSignExpression(),this._currency=this.getCurrencyExpression(),this._decimal=this.getDecimalExpression(),this._suffix=this.getSuffixExpression(),this._prefix=this.getPrefixExpression(),this._index=i=>e.get(i)},updateConstructParser(t,e){t!==e&&this.constructParser()},escapeRegExp(t){return t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},getDecimalExpression(){const t=new Intl.NumberFormat(this.locale,{...this.getOptions(),useGrouping:!1});return new RegExp(`[${t.format(1.1).replace(this._currency,"").trim().replace(this._numeral,"")}]`,"g")},getGroupingExpression(){const t=new Intl.NumberFormat(this.locale,{useGrouping:!0});return this.groupChar=t.format(1e6).trim().replace(this._numeral,"").charAt(0),new RegExp(`[${this.groupChar}]`,"g")},getMinusSignExpression(){const t=new Intl.NumberFormat(this.locale,{useGrouping:!1});return new RegExp(`[${t.format(-1).trim().replace(this._numeral,"")}]`,"g")},getCurrencyExpression(){if(this.currency){const t=new Intl.NumberFormat(this.locale,{style:"currency",currency:this.currency,currencyDisplay:this.currencyDisplay,minimumFractionDigits:0,maximumFractionDigits:0});return new RegExp(`[${t.format(1).replace(/\s/g,"").replace(this._numeral,"").replace(this._group,"")}]`,"g")}return new RegExp("[]","g")},getPrefixExpression(){if(this.prefix)this.prefixChar=this.prefix;else{const t=new Intl.NumberFormat(this.locale,{style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay});this.prefixChar=t.format(1).split("1")[0]}return new RegExp(`${this.escapeRegExp(this.prefixChar||"")}`,"g")},getSuffixExpression(){if(this.suffix)this.suffixChar=this.suffix;else{const t=new Intl.NumberFormat(this.locale,{style:this.mode,currency:this.currency,currencyDisplay:this.currencyDisplay,minimumFractionDigits:0,maximumFractionDigits:0});this.suffixChar=t.format(1).split("1")[1]}return new RegExp(`${this.escapeRegExp(this.suffixChar||"")}`,"g")},formatValue(t){if(t!=null){if(t==="-")return t;if(this.format){let i=new Intl.NumberFormat(this.locale,this.getOptions()).format(t);return this.prefix&&(i=this.prefix+i),this.suffix&&(i=i+this.suffix),i}return t.toString()}return""},parseValue(t){let e=t.replace(this._suffix,"").replace(this._prefix,"").trim().replace(/\s/g,"").replace(this._currency,"").replace(this._group,"").replace(this._minusSign,"-").replace(this._decimal,".").replace(this._numeral,this._index);if(e){if(e==="-")return e;let i=+e;return isNaN(i)?null:i}return null},repeat(t,e,i){if(this.readonly)return;let n=e||500;this.clearTimer(),this.timer=setTimeout(()=>{this.repeat(t,40,i)},n),this.spin(t,i)},spin(t,e){if(this.$refs.input){let i=this.step*e,n=this.parseValue(this.$refs.input.$el.value)||0,r=this.validateValue(n+i);this.updateInput(r,null,"spin"),this.updateModel(t,r),this.handleOnInput(t,n,r)}},onUpButtonMouseDown(t){this.disabled||(this.$refs.input.$el.focus(),this.repeat(t,null,1),t.preventDefault())},onUpButtonMouseUp(){this.disabled||this.clearTimer()},onUpButtonMouseLeave(){this.disabled||this.clearTimer()},onUpButtonKeyUp(){this.disabled||this.clearTimer()},onUpButtonKeyDown(t){(t.keyCode===32||t.keyCode===13)&&this.repeat(t,null,1)},onDownButtonMouseDown(t){this.disabled||(this.$refs.input.$el.focus(),this.repeat(t,null,-1),t.preventDefault())},onDownButtonMouseUp(){this.disabled||this.clearTimer()},onDownButtonMouseLeave(){this.disabled||this.clearTimer()},onDownButtonKeyUp(){this.disabled||this.clearTimer()},onDownButtonKeyDown(t){(t.keyCode===32||t.keyCode===13)&&this.repeat(t,null,-1)},onUserInput(){this.isSpecialChar&&(this.$refs.input.$el.value=this.lastValue),this.isSpecialChar=!1},onInputKeyDown(t){if(this.readonly)return;if(this.lastValue=t.target.value,t.shiftKey||t.altKey){this.isSpecialChar=!0;return}let e=t.target.selectionStart,i=t.target.selectionEnd,n=t.target.value,r=null;switch(t.altKey&&t.preventDefault(),t.code){case"ArrowUp":this.spin(t,1),t.preventDefault();break;case"ArrowDown":this.spin(t,-1),t.preventDefault();break;case"ArrowLeft":this.isNumeralChar(n.charAt(e-1))||t.preventDefault();break;case"ArrowRight":this.isNumeralChar(n.charAt(e))||t.preventDefault();break;case"Tab":case"Enter":r=this.validateValue(this.parseValue(n)),this.$refs.input.$el.value=this.formatValue(r),this.$refs.input.$el.setAttribute("aria-valuenow",r),this.updateModel(t,r);break;case"Backspace":{if(t.preventDefault(),e===i){const s=n.charAt(e-1),{decimalCharIndex:o,decimalCharIndexWithoutPrefix:u}=this.getDecimalCharIndexes(n);if(this.isNumeralChar(s)){const h=this.getDecimalLength(n);if(this._group.test(s))this._group.lastIndex=0,r=n.slice(0,e-2)+n.slice(e-1);else if(this._decimal.test(s))this._decimal.lastIndex=0,h?this.$refs.input.$el.setSelectionRange(e-1,e-1):r=n.slice(0,e-1)+n.slice(e);else if(o>0&&e>o){const p=this.isDecimalMode()&&(this.minFractionDigits||0)0?r:""):r=n.slice(0,e-1)+n.slice(e)}this.updateValue(t,r,null,"delete-single")}else r=this.deleteRange(n,e,i),this.updateValue(t,r,null,"delete-range");break}case"Delete":if(t.preventDefault(),e===i){const s=n.charAt(e),{decimalCharIndex:o,decimalCharIndexWithoutPrefix:u}=this.getDecimalCharIndexes(n);if(this.isNumeralChar(s)){const h=this.getDecimalLength(n);if(this._group.test(s))this._group.lastIndex=0,r=n.slice(0,e)+n.slice(e+2);else if(this._decimal.test(s))this._decimal.lastIndex=0,h?this.$refs.input.$el.setSelectionRange(e+1,e+1):r=n.slice(0,e)+n.slice(e+1);else if(o>0&&e>o){const p=this.isDecimalMode()&&(this.minFractionDigits||0)0?r:""):r=n.slice(0,e)+n.slice(e+1)}this.updateValue(t,r,null,"delete-back-single")}else r=this.deleteRange(n,e,i),this.updateValue(t,r,null,"delete-range");break;case"Home":this.min&&(this.updateModel(t,this.min),t.preventDefault());break;case"End":this.max&&(this.updateModel(t,this.max),t.preventDefault());break}},onInputKeyPress(t){if(this.readonly)return;t.preventDefault();let e=t.which||t.keyCode,i=String.fromCharCode(e);const n=this.isDecimalSign(i),r=this.isMinusSign(i);(48<=e&&e<=57||r||n)&&this.insert(t,i,{isDecimalSign:n,isMinusSign:r})},onPaste(t){t.preventDefault();let e=(t.clipboardData||window.clipboardData).getData("Text");if(e){let i=this.parseValue(e);i!=null&&this.insert(t,i.toString())}},allowMinusSign(){return this.min===null||this.min<0},isMinusSign(t){return this._minusSign.test(t)||t==="-"?(this._minusSign.lastIndex=0,!0):!1},isDecimalSign(t){return this._decimal.test(t)?(this._decimal.lastIndex=0,!0):!1},isDecimalMode(){return this.mode==="decimal"},getDecimalCharIndexes(t){let e=t.search(this._decimal);this._decimal.lastIndex=0;const n=t.replace(this._prefix,"").trim().replace(/\s/g,"").replace(this._currency,"").search(this._decimal);return this._decimal.lastIndex=0,{decimalCharIndex:e,decimalCharIndexWithoutPrefix:n}},getCharIndexes(t){const e=t.search(this._decimal);this._decimal.lastIndex=0;const i=t.search(this._minusSign);this._minusSign.lastIndex=0;const n=t.search(this._suffix);this._suffix.lastIndex=0;const r=t.search(this._currency);return this._currency.lastIndex=0,{decimalCharIndex:e,minusCharIndex:i,suffixCharIndex:n,currencyCharIndex:r}},insert(t,e,i={isDecimalSign:!1,isMinusSign:!1}){const n=e.search(this._minusSign);if(this._minusSign.lastIndex=0,!this.allowMinusSign()&&n!==-1)return;const r=this.$refs.input.$el.selectionStart,s=this.$refs.input.$el.selectionEnd;let o=this.$refs.input.$el.value.trim();const{decimalCharIndex:u,minusCharIndex:h,suffixCharIndex:p,currencyCharIndex:g}=this.getCharIndexes(o);let y;if(i.isMinusSign)r===0&&(y=o,(h===-1||s!==0)&&(y=this.insertText(o,e,0,s)),this.updateValue(t,y,e,"insert"));else if(i.isDecimalSign)u>0&&r===u?this.updateValue(t,o,e,"insert"):u>r&&u0&&r>u){if(r+e.length-(u+1)<=S){const R=g>=r?g-1:p>=r?p:o.length;y=o.slice(0,r)+e+o.slice(r+e.length,R)+o.slice(R),this.updateValue(t,y,e,P)}}else y=this.insertText(o,e,r,s),this.updateValue(t,y,e,P)}},insertText(t,e,i,n){if((e==="."?e:e.split(".")).length===2){const s=t.slice(i,n).search(this._decimal);return this._decimal.lastIndex=0,s>0?t.slice(0,i)+this.formatValue(e)+t.slice(n):t||this.formatValue(e)}else return n-i===t.length?this.formatValue(e):i===0?e+t.slice(n):n===t.length?t.slice(0,i)+e:t.slice(0,i)+e+t.slice(n)},deleteRange(t,e,i){let n;return i-e===t.length?n="":e===0?n=t.slice(i):i===t.length?n=t.slice(0,e):n=t.slice(0,e)+t.slice(i),n},initCursor(){let t=this.$refs.input.$el.selectionStart,e=this.$refs.input.$el.value,i=e.length,n=null,r=(this.prefixChar||"").length;e=e.replace(this._prefix,""),t=t-r;let s=e.charAt(t);if(this.isNumeralChar(s))return t+r;let o=t-1;for(;o>=0;)if(s=e.charAt(o),this.isNumeralChar(s)){n=o+r;break}else o--;if(n!==null)this.$refs.input.$el.setSelectionRange(n+1,n+1);else{for(o=t;othis.max?this.max:t},updateInput(t,e,i,n){e=e||"";let r=this.$refs.input.$el.value,s=this.formatValue(t),o=r.length;if(s!==n&&(s=this.concatValues(s,n)),o===0){this.$refs.input.$el.value=s,this.$refs.input.$el.setSelectionRange(0,0);const h=this.initCursor()+e.length;this.$refs.input.$el.setSelectionRange(h,h)}else{let u=this.$refs.input.$el.selectionStart,h=this.$refs.input.$el.selectionEnd;this.$refs.input.$el.value=s;let p=s.length;if(i==="range-insert"){const g=this.parseValue((r||"").slice(0,u)),S=(g!==null?g.toString():"").split("").join(`(${this.groupChar})?`),P=new RegExp(S,"g");P.test(s);const R=e.split("").join(`(${this.groupChar})?`),k=new RegExp(R,"g");k.test(s.slice(P.lastIndex)),h=P.lastIndex+k.lastIndex,this.$refs.input.$el.setSelectionRange(h,h)}else if(p===o)i==="insert"||i==="delete-back-single"?this.$refs.input.$el.setSelectionRange(h+1,h+1):i==="delete-single"?this.$refs.input.$el.setSelectionRange(h-1,h-1):(i==="delete-range"||i==="spin")&&this.$refs.input.$el.setSelectionRange(h,h);else if(i==="delete-back-single"){let g=r.charAt(h-1),y=r.charAt(h),S=o-p,P=this._group.test(y);P&&S===1?h+=1:!P&&this.isNumeralChar(g)&&(h+=-1*S+1),this._group.lastIndex=0,this.$refs.input.$el.setSelectionRange(h,h)}else if(r==="-"&&i==="insert"){this.$refs.input.$el.setSelectionRange(0,0);const y=this.initCursor()+e.length+1;this.$refs.input.$el.setSelectionRange(y,y)}else h=h+(p-o),this.$refs.input.$el.setSelectionRange(h,h)}this.$refs.input.$el.setAttribute("aria-valuenow",t)},concatValues(t,e){if(t&&e){let i=e.search(this._decimal);return this._decimal.lastIndex=0,this.suffixChar?t.replace(this.suffixChar,"").split(this._decimal)[0]+e.replace(this.suffixChar,"").slice(i)+this.suffixChar:i!==-1?t.split(this._decimal)[0]+e.slice(i):t}return t},getDecimalLength(t){if(t){const e=t.split(this._decimal);if(e.length===2)return e[1].replace(this._suffix,"").trim().replace(/\s/g,"").replace(this._currency,"").length}return 0},updateModel(t,e){this.d_modelValue=e,this.$emit("update:modelValue",e)},onInputFocus(t){this.focused=!0,!this.disabled&&!this.readonly&&this.$refs.input.$el.value!==He.getSelection()&&this.highlightOnFocus&&t.target.select(),this.$emit("focus",t)},onInputBlur(t){this.focused=!1;let e=t.target,i=this.validateValue(this.parseValue(e.value));this.$emit("blur",{originalEvent:t,value:e.value}),e.value=this.formatValue(i),e.setAttribute("aria-valuenow",i),this.updateModel(t,i)},clearTimer(){this.timer&&clearInterval(this.timer)},maxBoundry(){return this.d_modelValue>=this.max},minBoundry(){return this.d_modelValue<=this.min}},computed:{containerClass(){return["p-inputnumber p-component p-inputwrapper",{"p-inputwrapper-filled":this.filled,"p-inputwrapper-focus":this.focused,"p-inputnumber-buttons-stacked":this.showButtons&&this.buttonLayout==="stacked","p-inputnumber-buttons-horizontal":this.showButtons&&this.buttonLayout==="horizontal","p-inputnumber-buttons-vertical":this.showButtons&&this.buttonLayout==="vertical"}]},upButtonClass(){return["p-inputnumber-button p-inputnumber-button-up",this.incrementButtonClass,{"p-disabled":this.showButtons&&this.max!==null&&this.maxBoundry()}]},downButtonClass(){return["p-inputnumber-button p-inputnumber-button-down",this.decrementButtonClass,{"p-disabled":this.showButtons&&this.min!==null&&this.minBoundry()}]},filled(){return this.modelValue!=null&&this.modelValue.toString().length>0},upButtonListeners(){return{mousedown:t=>this.onUpButtonMouseDown(t),mouseup:t=>this.onUpButtonMouseUp(t),mouseleave:t=>this.onUpButtonMouseLeave(t),keydown:t=>this.onUpButtonKeyDown(t),keyup:t=>this.onUpButtonKeyUp(t)}},downButtonListeners(){return{mousedown:t=>this.onDownButtonMouseDown(t),mouseup:t=>this.onDownButtonMouseUp(t),mouseleave:t=>this.onDownButtonMouseLeave(t),keydown:t=>this.onDownButtonKeyDown(t),keyup:t=>this.onDownButtonKeyUp(t)}},formattedValue(){const t=!this.modelValue&&!this.allowEmpty?0:this.modelValue;return this.formatValue(t)},getFormatter(){return this.numberFormat}},components:{INInputText:Vb,INButton:ep}};const B9={key:0,class:"p-inputnumber-button-group"};function H9(t,e,i,n,r,s){const o=Mt("INInputText"),u=Mt("INButton");return X(),se("span",{class:Tt(s.containerClass)},[xt(o,Qi({ref:"input",id:i.inputId,class:["p-inputnumber-input",i.inputClass],role:"spinbutton",style:i.inputStyle,value:s.formattedValue,"aria-valuemin":i.min,"aria-valuemax":i.max,"aria-valuenow":i.modelValue,disabled:i.disabled,readonly:i.readonly,placeholder:i.placeholder,"aria-labelledby":t.ariaLabelledby,"aria-label":t.ariaLabel,onInput:s.onUserInput,onKeydown:s.onInputKeyDown,onKeypress:s.onInputKeyPress,onPaste:s.onPaste,onClick:s.onInputClick,onFocus:s.onInputFocus,onBlur:s.onInputBlur},i.inputProps),null,16,["id","class","style","value","aria-valuemin","aria-valuemax","aria-valuenow","disabled","readonly","placeholder","aria-labelledby","aria-label","onInput","onKeydown","onKeypress","onPaste","onClick","onFocus","onBlur"]),i.showButtons&&i.buttonLayout==="stacked"?(X(),se("span",B9,[xt(u,Qi({class:s.upButtonClass,icon:i.incrementButtonIcon},_g(s.upButtonListeners),{disabled:i.disabled,tabindex:-1,"aria-hidden":"true"},i.incrementButtonProps),null,16,["class","icon","disabled"]),xt(u,Qi({class:s.downButtonClass,icon:i.decrementButtonIcon},_g(s.downButtonListeners),{disabled:i.disabled,tabindex:-1,"aria-hidden":"true"},i.decrementButtonProps),null,16,["class","icon","disabled"])])):Be("",!0),i.showButtons&&i.buttonLayout!=="stacked"?(X(),gt(u,Qi({key:1,class:s.upButtonClass,icon:i.incrementButtonIcon},_g(s.upButtonListeners),{disabled:i.disabled,tabindex:-1,"aria-hidden":"true"},i.incrementButtonProps),null,16,["class","icon","disabled"])):Be("",!0),i.showButtons&&i.buttonLayout!=="stacked"?(X(),gt(u,Qi({key:2,class:s.downButtonClass,icon:i.decrementButtonIcon},_g(s.downButtonListeners),{disabled:i.disabled,tabindex:-1,"aria-hidden":"true"},i.decrementButtonProps),null,16,["class","icon","disabled"])):Be("",!0)],2)}function U9(t,e){e===void 0&&(e={});var i=e.insertAt;if(!(typeof document>"u")){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",i==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var z9=` .p-inputnumber { display: inline-flex; } .p-inputnumber-button { display: flex; align-items: center; justify-content: center; flex: 0 0 auto; } .p-inputnumber-buttons-stacked .p-button.p-inputnumber-button .p-button-label, .p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button .p-button-label { display: none; } .p-inputnumber-buttons-stacked .p-button.p-inputnumber-button-up { border-top-left-radius: 0; border-bottom-left-radius: 0; border-bottom-right-radius: 0; padding: 0; } .p-inputnumber-buttons-stacked .p-inputnumber-input { border-top-right-radius: 0; border-bottom-right-radius: 0; } .p-inputnumber-buttons-stacked .p-button.p-inputnumber-button-down { border-top-left-radius: 0; border-top-right-radius: 0; border-bottom-left-radius: 0; padding: 0; } .p-inputnumber-buttons-stacked .p-inputnumber-button-group { display: flex; flex-direction: column; } .p-inputnumber-buttons-stacked .p-inputnumber-button-group .p-button.p-inputnumber-button { flex: 1 1 auto; } .p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-up { order: 3; border-top-left-radius: 0; border-bottom-left-radius: 0; } .p-inputnumber-buttons-horizontal .p-inputnumber-input { order: 2; border-radius: 0; } .p-inputnumber-buttons-horizontal .p-button.p-inputnumber-button-down { order: 1; border-top-right-radius: 0; border-bottom-right-radius: 0; } .p-inputnumber-buttons-vertical { flex-direction: column; } .p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-up { order: 1; border-bottom-left-radius: 0; border-bottom-right-radius: 0; width: 100%; } .p-inputnumber-buttons-vertical .p-inputnumber-input { order: 2; border-radius: 0; text-align: center; } .p-inputnumber-buttons-vertical .p-button.p-inputnumber-button-down { order: 3; border-top-left-radius: 0; border-top-right-radius: 0; width: 100%; } .p-inputnumber-input { flex: 1 1 auto; } .p-fluid .p-inputnumber { width: 100%; } .p-fluid .p-inputnumber .p-inputnumber-input { width: 1%; } .p-fluid .p-inputnumber-buttons-vertical .p-inputnumber-input { width: 100%; } `;U9(z9),bC.render=H9;var _C={name:"CurrentPageReport",props:{pageCount:{type:Number,default:0},currentPage:{type:Number,default:0},page:{type:Number,default:0},first:{type:Number,default:0},rows:{type:Number,default:0},totalRecords:{type:Number,default:0},template:{type:String,default:"({currentPage} of {totalPages})"}},computed:{text(){return this.template.replace("{currentPage}",this.currentPage).replace("{totalPages}",this.pageCount).replace("{first}",this.pageCount>0?this.first+1:0).replace("{last}",Math.min(this.first+this.rows,this.totalRecords)).replace("{rows}",this.rows).replace("{totalRecords}",this.totalRecords)}}};const V9={class:"p-paginator-current"};function j9(t,e,i,n,r,s){return X(),se("span",V9,it(s.text),1)}_C.render=j9;var wC={name:"FirstPageLink",computed:{containerClass(){return["p-paginator-first p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:Rs}};const W9=[Se("span",{class:"p-paginator-icon pi pi-angle-double-left"},null,-1)];function q9(t,e,i,n,r,s){const o=Yr("ripple");return dn((X(),se("button",{class:Tt(s.containerClass),type:"button"},W9,2)),[[o]])}wC.render=q9;var TC={name:"JumpToPageDropdown",emits:["page-change"],props:{page:Number,pageCount:Number,disabled:Boolean},methods:{onChange(t){this.$emit("page-change",t)}},computed:{pageOptions(){let t=[];for(let e=0;es.onChange(u)),class:"p-paginator-page-options",disabled:i.disabled},null,8,["modelValue","options","disabled"])}TC.render=G9;var xC={name:"JumpToPageInput",inheritAttrs:!1,emits:["page-change"],props:{page:Number,pageCount:Number,disabled:Boolean},data(){return{d_page:this.page}},watch:{page(t){this.d_page=t}},methods:{onChange(t){t!==this.page&&(this.d_page=t,this.$emit("page-change",t-1))}},computed:{inputArialabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.jumpToPageInputLabel:void 0}},components:{JTPInput:bC}};function K9(t,e,i,n,r,s){const o=Mt("JTPInput");return X(),gt(o,{ref:"jtpInput",modelValue:r.d_page,class:"p-paginator-page-input","aria-label":s.inputArialabel,disabled:i.disabled,"onUpdate:modelValue":s.onChange},null,8,["modelValue","aria-label","disabled","onUpdate:modelValue"])}xC.render=K9;var SC={name:"LastPageLink",computed:{containerClass(){return["p-paginator-last p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:Rs}};const Y9=[Se("span",{class:"p-paginator-icon pi pi-angle-double-right"},null,-1)];function X9(t,e,i,n,r,s){const o=Yr("ripple");return dn((X(),se("button",{class:Tt(s.containerClass),type:"button"},Y9,2)),[[o]])}SC.render=X9;var EC={name:"NextPageLink",computed:{containerClass(){return["p-paginator-next p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:Rs}};const Z9=[Se("span",{class:"p-paginator-icon pi pi-angle-right"},null,-1)];function Q9(t,e,i,n,r,s){const o=Yr("ripple");return dn((X(),se("button",{class:Tt(s.containerClass),type:"button"},Z9,2)),[[o]])}EC.render=Q9;var CC={name:"PageLinks",inheritAttrs:!1,emits:["click"],props:{value:Array,page:Number},methods:{onPageLinkClick(t,e){this.$emit("click",{originalEvent:t,value:e})},ariaPageLabel(t){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.pageLabel.replace(/{page}/g,t):void 0}},computed:{},directives:{ripple:Rs}};const J9={class:"p-paginator-pages"},$9=["aria-label","aria-current","onClick"];function e6(t,e,i,n,r,s){const o=Yr("ripple");return X(),se("span",J9,[(X(!0),se(ct,null,Kt(i.value,u=>dn((X(),se("button",{key:u,class:Tt(["p-paginator-page p-paginator-element p-link",{"p-highlight":u-1===i.page}]),type:"button","aria-label":s.ariaPageLabel(u),"aria-current":u-1===i.page?"page":void 0,onClick:h=>s.onPageLinkClick(h,u)},[Vi(it(u),1)],10,$9)),[[o]])),128))])}CC.render=e6;var AC={name:"PrevPageLink",computed:{containerClass(){return["p-paginator-prev p-paginator-element p-link",{"p-disabled":this.$attrs.disabled}]}},directives:{ripple:Rs}};const t6=[Se("span",{class:"p-paginator-icon pi pi-angle-left"},null,-1)];function i6(t,e,i,n,r,s){const o=Yr("ripple");return dn((X(),se("button",{class:Tt(s.containerClass),type:"button"},t6,2)),[[o]])}AC.render=i6;var DC={name:"RowsPerPageDropdown",emits:["rows-change"],props:{options:Array,rows:Number,disabled:Boolean},methods:{onChange(t){this.$emit("rows-change",t)}},computed:{rowsOptions(){let t=[];if(this.options)for(let e=0;es.onChange(u)),class:"p-paginator-rpp-options",disabled:i.disabled},null,8,["modelValue","options","disabled"])}DC.render=n6;var PC={name:"Paginator",emits:["update:first","update:rows","page"],props:{totalRecords:{type:Number,default:0},rows:{type:Number,default:0},first:{type:Number,default:0},pageLinkSize:{type:Number,default:5},rowsPerPageOptions:{type:Array,default:null},template:{type:[Object,String],default:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown"},currentPageReportTemplate:{type:null,default:"({currentPage} of {totalPages})"},alwaysShow:{type:Boolean,default:!0}},data(){return{d_first:this.first,d_rows:this.rows}},watch:{first(t){this.d_first=t},rows(t){this.d_rows=t},totalRecords(t){this.page>0&&t&&this.d_first>=t&&this.changePage(this.pageCount-1)}},mounted(){this.setPaginatorAttribute(),this.createStyle()},methods:{changePage(t){const e=this.pageCount;if(t>=0&&tparseInt(n)-parseInt(r)).forEach(n=>{i[n]=this.template[n]});for(const[n,[r]]of Object.entries(Object.entries(i))){const s=Object.entries(i)[n-1]?`and (min-width:${Object.keys(i)[n-1]})`:"";r==="default"?t+=` @media screen ${s} { .paginator[${this.attributeSelector}], .p-paginator-default{ display: flex !important; } } `:t+=` .paginator[${this.attributeSelector}], .p-paginator-${r} { display: none !important; } @media screen ${s} and (max-width: ${r}) { .paginator[${this.attributeSelector}], .p-paginator-${r} { display: flex !important; } .paginator[${this.attributeSelector}], .p-paginator-default{ display: none !important; } } `}this.styleElement.innerHTML=t}},hasBreakpoints(){return typeof this.template=="object"},getPaginatorClasses(t){return[{"p-paginator-default":!this.hasBreakpoints(),[`p-paginator-${t}`]:this.hasBreakpoints()}]},setPaginatorAttribute(){this.$refs.paginator&&this.$refs.paginator.length>=0&&[...this.$refs.paginator].forEach(t=>{t.setAttribute(this.attributeSelector,"")})},getAriaLabel(t){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria[t]:void 0}},computed:{templateItems(){let t={};if(this.hasBreakpoints()){t=this.template,t.default||(t.default="FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown");for(const e in t)t[e]=this.template[e].split(" ").map(i=>i.trim());return t}return t.default=this.template.split(" ").map(e=>e.trim()),t},page(){return Math.floor(this.d_first/this.d_rows)},pageCount(){return Math.ceil(this.totalRecords/this.d_rows)},isFirstPage(){return this.page===0},isLastPage(){return this.page===this.pageCount-1},calculatePageLinkBoundaries(){const t=this.pageCount,e=Math.min(this.pageLinkSize,t);let i=Math.max(0,Math.ceil(this.page-e/2)),n=Math.min(t-1,i+e-1);const r=this.pageLinkSize-(n-i+1);return i=Math.max(0,i-r),[i,n]},pageLinks(){let t=[],e=this.calculatePageLinkBoundaries,i=e[0],n=e[1];for(var r=i;r<=n;r++)t.push(r+1);return t},currentState(){return{page:this.page,first:this.d_first,rows:this.d_rows}},empty(){return this.pageCount===0},currentPage(){return this.pageCount>0?this.page+1:0},attributeSelector(){return ks()}},components:{CurrentPageReport:_C,FirstPageLink:wC,LastPageLink:SC,NextPageLink:EC,PageLinks:CC,PrevPageLink:AC,RowsPerPageDropdown:DC,JumpToPageDropdown:TC,JumpToPageInput:xC}};const r6={key:0},s6={key:0,class:"p-paginator-left-content"},o6={key:1,class:"p-paginator-right-content"};function a6(t,e,i,n,r,s){const o=Mt("FirstPageLink"),u=Mt("PrevPageLink"),h=Mt("NextPageLink"),p=Mt("LastPageLink"),g=Mt("PageLinks"),y=Mt("CurrentPageReport"),S=Mt("RowsPerPageDropdown"),P=Mt("JumpToPageDropdown"),R=Mt("JumpToPageInput");return i.alwaysShow||s.pageLinks&&s.pageLinks.length>1?(X(),se("nav",r6,[(X(!0),se(ct,null,Kt(s.templateItems,(k,M)=>(X(),se("div",{key:M,ref_for:!0,ref:"paginator",class:Tt(["p-paginator p-component",s.getPaginatorClasses(M)])},[t.$slots.start?(X(),se("div",s6,[pi(t.$slots,"start",{state:s.currentState})])):Be("",!0),(X(!0),se(ct,null,Kt(k,L=>(X(),se(ct,{key:L},[L==="FirstPageLink"?(X(),gt(o,{key:0,"aria-label":s.getAriaLabel("firstPageLabel"),onClick:e[0]||(e[0]=q=>s.changePageToFirst(q)),disabled:s.isFirstPage||s.empty},null,8,["aria-label","disabled"])):L==="PrevPageLink"?(X(),gt(u,{key:1,"aria-label":s.getAriaLabel("prevPageLabel"),onClick:e[1]||(e[1]=q=>s.changePageToPrev(q)),disabled:s.isFirstPage||s.empty},null,8,["aria-label","disabled"])):L==="NextPageLink"?(X(),gt(h,{key:2,"aria-label":s.getAriaLabel("nextPageLabel"),onClick:e[2]||(e[2]=q=>s.changePageToNext(q)),disabled:s.isLastPage||s.empty},null,8,["aria-label","disabled"])):L==="LastPageLink"?(X(),gt(p,{key:3,"aria-label":s.getAriaLabel("lastPageLabel"),onClick:e[3]||(e[3]=q=>s.changePageToLast(q)),disabled:s.isLastPage||s.empty},null,8,["aria-label","disabled"])):L==="PageLinks"?(X(),gt(g,{key:4,"aria-label":s.getAriaLabel("pageLabel"),value:s.pageLinks,page:s.page,onClick:e[4]||(e[4]=q=>s.changePageLink(q))},null,8,["aria-label","value","page"])):L==="CurrentPageReport"?(X(),gt(y,{key:5,"aria-live":"polite",template:i.currentPageReportTemplate,currentPage:s.currentPage,page:s.page,pageCount:s.pageCount,first:r.d_first,rows:r.d_rows,totalRecords:i.totalRecords},null,8,["template","currentPage","page","pageCount","first","rows","totalRecords"])):L==="RowsPerPageDropdown"&&i.rowsPerPageOptions?(X(),gt(S,{key:6,"aria-label":s.getAriaLabel("rowsPerPageLabel"),rows:r.d_rows,options:i.rowsPerPageOptions,onRowsChange:e[5]||(e[5]=q=>s.onRowChange(q)),disabled:s.empty},null,8,["aria-label","rows","options","disabled"])):L==="JumpToPageDropdown"?(X(),gt(P,{key:7,"aria-label":s.getAriaLabel("jumpToPageDropdownLabel"),page:s.page,pageCount:s.pageCount,onPageChange:e[6]||(e[6]=q=>s.changePage(q)),disabled:s.empty},null,8,["aria-label","page","pageCount","disabled"])):L==="JumpToPageInput"?(X(),gt(R,{key:8,page:s.currentPage,onPageChange:e[7]||(e[7]=q=>s.changePage(q)),disabled:s.empty},null,8,["page","disabled"])):Be("",!0)],64))),128)),t.$slots.end?(X(),se("div",o6,[pi(t.$slots,"end",{state:s.currentState})])):Be("",!0)],2))),128))])):Be("",!0)}function l6(t,e){e===void 0&&(e={});var i=e.insertAt;if(!(typeof document>"u")){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",i==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var u6=` .p-paginator-default { display: flex; } .p-paginator { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; } .p-paginator-left-content { margin-right: auto; } .p-paginator-right-content { margin-left: auto; } .p-paginator-page, .p-paginator-next, .p-paginator-last, .p-paginator-first, .p-paginator-prev, .p-paginator-current { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; line-height: 1; user-select: none; overflow: hidden; position: relative; } .p-paginator-element:focus { z-index: 1; position: relative; } `;l6(u6),PC.render=a6;function c6(t,e){const{onFocusIn:i,onFocusOut:n}=e.value||{};t.$_pfocustrap_mutationobserver=new MutationObserver(r=>{r.forEach(s=>{if(s.type==="childList"&&!t.contains(document.activeElement)){const o=u=>{const h=He.isFocusableElement(u)?u:He.getFirstFocusableElement(u);return ft.isNotEmpty(h)?h:o(u.nextSibling)};He.focus(o(s.nextSibling))}})}),t.$_pfocustrap_mutationobserver.disconnect(),t.$_pfocustrap_mutationobserver.observe(t,{childList:!0}),t.$_pfocustrap_focusinlistener=r=>i&&i(r),t.$_pfocustrap_focusoutlistener=r=>n&&n(r),t.addEventListener("focusin",t.$_pfocustrap_focusinlistener),t.addEventListener("focusout",t.$_pfocustrap_focusoutlistener)}function kC(t){t.$_pfocustrap_mutationobserver&&t.$_pfocustrap_mutationobserver.disconnect(),t.$_pfocustrap_focusinlistener&&t.removeEventListener("focusin",t.$_pfocustrap_focusinlistener)&&(t.$_pfocustrap_focusinlistener=null),t.$_pfocustrap_focusoutlistener&&t.removeEventListener("focusout",t.$_pfocustrap_focusoutlistener)&&(t.$_pfocustrap_focusoutlistener=null)}function d6(t,e){const{autoFocusSelector:i="",firstFocusableSelector:n="",autoFocus:r=!1}=e.value||{};let s=He.getFirstFocusableElement(t,`[autofocus]:not(.p-hidden-focusable)${i}`);r&&!s&&(s=He.getFirstFocusableElement(t,`:not(.p-hidden-focusable)${n}`)),He.focus(s)}function h6(t){const{currentTarget:e,relatedTarget:i}=t,n=i===e.$_pfocustrap_lasthiddenfocusableelement?He.getFirstFocusableElement(e.parentElement,`:not(.p-hidden-focusable)${e.$_pfocustrap_focusableselector}`):e.$_pfocustrap_lasthiddenfocusableelement;He.focus(n)}function f6(t){const{currentTarget:e,relatedTarget:i}=t,n=i===e.$_pfocustrap_firsthiddenfocusableelement?He.getLastFocusableElement(e.parentElement,`:not(.p-hidden-focusable)${e.$_pfocustrap_focusableselector}`):e.$_pfocustrap_firsthiddenfocusableelement;He.focus(n)}function p6(t,e){const{tabIndex:i=0,firstFocusableSelector:n="",lastFocusableSelector:r=""}=e.value||{},s=h=>{const p=document.createElement("span");return p.classList="p-hidden-accessible p-hidden-focusable",p.tabIndex=i,p.setAttribute("aria-hidden","true"),p.setAttribute("role","presentation"),p.addEventListener("focus",h),p},o=s(h6),u=s(f6);o.$_pfocustrap_lasthiddenfocusableelement=u,o.$_pfocustrap_focusableselector=n,u.$_pfocustrap_firsthiddenfocusableelement=o,u.$_pfocustrap_focusableselector=r,t.prepend(o),t.append(u)}const IC={mounted(t,e){const{disabled:i}=e.value||{};i||(p6(t,e),c6(t,e),d6(t,e))},updated(t,e){const{disabled:i}=e.value||{};i&&kC(t)},unmounted(t){kC(t)}};var RC={name:"RowCheckbox",emits:["change"],props:{value:null,checked:null},data(){return{focused:!1}},methods:{onClick(t){this.$attrs.disabled||(this.$emit("change",{originalEvent:t,data:this.value}),He.focus(this.$refs.input)),t.preventDefault()},onFocus(){this.focused=!0},onBlur(){this.focused=!1},onKeydown(t){switch(t.code){case"Space":{this.onClick(t);break}}}},computed:{checkboxAriaLabel(){return this.$primevue.config.locale.aria?this.checked?this.$primevue.config.locale.aria.selectRow:this.$primevue.config.locale.aria.unselectRow:void 0}}};const m6={class:"p-hidden-accessible"},g6=["checked","disabled","tabindex","aria-label"];function y6(t,e,i,n,r,s){return X(),se("div",{class:Tt(["p-checkbox p-component",{"p-checkbox-focused":r.focused}]),onClick:e[3]||(e[3]=(...o)=>s.onClick&&s.onClick(...o))},[Se("div",m6,[Se("input",{ref:"input",type:"checkbox",checked:i.checked,disabled:t.$attrs.disabled,tabindex:t.$attrs.disabled?null:"0","aria-label":s.checkboxAriaLabel,onFocus:e[0]||(e[0]=o=>s.onFocus(o)),onBlur:e[1]||(e[1]=o=>s.onBlur(o)),onKeydown:e[2]||(e[2]=(...o)=>s.onKeydown&&s.onKeydown(...o))},null,40,g6)]),Se("div",{ref:"box",class:Tt(["p-checkbox-box p-component",{"p-highlight":i.checked,"p-disabled":t.$attrs.disabled,"p-focus":r.focused}])},[Se("span",{class:Tt(["p-checkbox-icon",{"pi pi-check":i.checked}])},null,2)],2)],2)}RC.render=y6;var OC={name:"RowRadioButton",inheritAttrs:!1,emits:["change"],props:{value:null,checked:null,name:null},data(){return{focused:!1}},methods:{onClick(t){this.disabled||this.checked||(this.$emit("change",{originalEvent:t,data:this.value}),He.focus(this.$refs.input))},onFocus(){this.focused=!0},onBlur(){this.focused=!1}}};const v6={class:"p-hidden-accessible"},b6=["checked","disabled","name"],_6=[Se("div",{class:"p-radiobutton-icon"},null,-1)];function w6(t,e,i,n,r,s){return X(),se("div",{class:Tt(["p-radiobutton p-component",{"p-radiobutton-focused":r.focused}]),onClick:e[3]||(e[3]=(...o)=>s.onClick&&s.onClick(...o))},[Se("div",v6,[Se("input",{ref:"input",type:"radio",checked:i.checked,disabled:t.$attrs.disabled,name:i.name,tabindex:"0",onFocus:e[0]||(e[0]=o=>s.onFocus(o)),onBlur:e[1]||(e[1]=o=>s.onBlur(o)),onKeydown:e[2]||(e[2]=Yf(Kf((...o)=>s.onClick&&s.onClick(...o),["prevent"]),["space"]))},null,40,b6)]),Se("div",{ref:"box",class:Tt(["p-radiobutton-box p-component",{"p-highlight":i.checked,"p-disabled":t.$attrs.disabled,"p-focus":r.focused}])},_6,2)],2)}OC.render=w6;var LC={name:"BodyCell",emits:["cell-edit-init","cell-edit-complete","cell-edit-cancel","row-edit-init","row-edit-save","row-edit-cancel","row-toggle","radio-change","checkbox-change","editing-meta-change"],props:{rowData:{type:Object,default:null},column:{type:Object,default:null},frozenRow:{type:Boolean,default:!1},rowIndex:{type:Number,default:null},index:{type:Number,default:null},rowTogglerIcon:{type:Array,default:null},selected:{type:Boolean,default:!1},editing:{type:Boolean,default:!1},editingMeta:{type:Object,default:null},editMode:{type:String,default:null},responsiveLayout:{type:String,default:"stack"},virtualScrollerContentProps:{type:Object,default:null},ariaControls:{type:String,default:null},name:{type:String,default:null}},documentEditListener:null,selfClick:!1,overlayEventListener:null,data(){return{d_editing:this.editing,styleObject:{},isRowExpanded:!1}},watch:{editing(t){this.d_editing=t},"$data.d_editing":function(t){this.$emit("editing-meta-change",{data:this.rowData,field:this.field||`field_${this.index}`,index:this.rowIndex,editing:t})}},mounted(){this.columnProp("frozen")&&this.updateStickyPosition()},updated(){this.columnProp("frozen")&&this.updateStickyPosition(),this.d_editing&&(this.editMode==="cell"||this.editMode==="row"&&this.columnProp("rowEditor"))&&setTimeout(()=>{const t=He.getFirstFocusableElement(this.$el);t&&t.focus()},1)},beforeUnmount(){this.overlayEventListener&&(lu.off("overlay-click",this.overlayEventListener),this.overlayEventListener=null)},methods:{columnProp(t){return ft.getVNodeProp(this.column,t)},resolveFieldData(){return ft.resolveFieldData(this.rowData,this.field)},toggleRow(t){this.isRowExpanded=!this.isRowExpanded,this.$emit("row-toggle",{originalEvent:t,data:this.rowData})},toggleRowWithRadio(t,e){this.$emit("radio-change",{originalEvent:t.originalEvent,index:e,data:t.data})},toggleRowWithCheckbox(t,e){this.$emit("checkbox-change",{originalEvent:t.originalEvent,index:e,data:t.data})},isEditable(){return this.column.children&&this.column.children.editor!=null},bindDocumentEditListener(){this.documentEditListener||(this.documentEditListener=t=>{this.selfClick||this.completeEdit(t,"outside"),this.selfClick=!1},document.addEventListener("click",this.documentEditListener))},unbindDocumentEditListener(){this.documentEditListener&&(document.removeEventListener("click",this.documentEditListener),this.documentEditListener=null,this.selfClick=!1)},switchCellToViewMode(){this.d_editing=!1,this.unbindDocumentEditListener(),lu.off("overlay-click",this.overlayEventListener),this.overlayEventListener=null},onClick(t){this.editMode==="cell"&&this.isEditable()&&(this.selfClick=!0,this.d_editing||(this.d_editing=!0,this.bindDocumentEditListener(),this.$emit("cell-edit-init",{originalEvent:t,data:this.rowData,field:this.field,index:this.rowIndex}),this.overlayEventListener=e=>{this.$el&&this.$el.contains(e.target)&&(this.selfClick=!0)},lu.on("overlay-click",this.overlayEventListener)))},completeEdit(t,e){const i={originalEvent:t,data:this.rowData,newData:this.editingRowData,value:this.rowData[this.field],newValue:this.editingRowData[this.field],field:this.field,index:this.rowIndex,type:e,defaultPrevented:!1,preventDefault:function(){this.defaultPrevented=!0}};this.$emit("cell-edit-complete",i),i.defaultPrevented||this.switchCellToViewMode()},onKeyDown(t){if(this.editMode==="cell")switch(t.code){case"Enter":this.completeEdit(t,"enter");break;case"Escape":this.switchCellToViewMode(),this.$emit("cell-edit-cancel",{originalEvent:t,data:this.rowData,field:this.field,index:this.rowIndex});break;case"Tab":this.completeEdit(t,"tab"),t.shiftKey?this.moveToPreviousCell(t):this.moveToNextCell(t);break}},moveToPreviousCell(t){let e=this.findCell(t.target),i=this.findPreviousEditableColumn(e);i&&(He.invokeElementMethod(i,"click"),t.preventDefault())},moveToNextCell(t){let e=this.findCell(t.target),i=this.findNextEditableColumn(e);i&&(He.invokeElementMethod(i,"click"),t.preventDefault())},findCell(t){if(t){let e=t;for(;e&&!He.hasClass(e,"p-cell-editing");)e=e.parentElement;return e}else return null},findPreviousEditableColumn(t){let e=t.previousElementSibling;if(!e){let i=t.parentElement.previousElementSibling;i&&(e=i.lastElementChild)}return e?He.hasClass(e,"p-editable-column")?e:this.findPreviousEditableColumn(e):null},findNextEditableColumn(t){let e=t.nextElementSibling;if(!e){let i=t.parentElement.nextElementSibling;i&&(e=i.firstElementChild)}return e?He.hasClass(e,"p-editable-column")?e:this.findNextEditableColumn(e):null},isEditingCellValid(){return He.find(this.$el,".p-invalid").length===0},onRowEditInit(t){this.$emit("row-edit-init",{originalEvent:t,data:this.rowData,newData:this.editingRowData,field:this.field,index:this.rowIndex})},onRowEditSave(t){this.$emit("row-edit-save",{originalEvent:t,data:this.rowData,newData:this.editingRowData,field:this.field,index:this.rowIndex})},onRowEditCancel(t){this.$emit("row-edit-cancel",{originalEvent:t,data:this.rowData,newData:this.editingRowData,field:this.field,index:this.rowIndex})},editorInitCallback(t){this.$emit("row-edit-init",{originalEvent:t,data:this.rowData,newData:this.editingRowData,field:this.field,index:this.rowIndex})},editorSaveCallback(t){this.editMode==="row"?this.$emit("row-edit-save",{originalEvent:t,data:this.rowData,newData:this.editingRowData,field:this.field,index:this.rowIndex}):this.completeEdit(t,"enter")},editorCancelCallback(t){this.editMode==="row"?this.$emit("row-edit-cancel",{originalEvent:t,data:this.rowData,newData:this.editingRowData,field:this.field,index:this.rowIndex}):(this.switchCellToViewMode(),this.$emit("cell-edit-cancel",{originalEvent:t,data:this.rowData,field:this.field,index:this.rowIndex}))},updateStickyPosition(){if(this.columnProp("frozen"))if(this.columnProp("alignFrozen")==="right"){let e=0,i=this.$el.nextElementSibling;i&&(e=He.getOuterWidth(i)+parseFloat(i.style.right||0)),this.styleObject.right=e+"px"}else{let e=0,i=this.$el.previousElementSibling;i&&(e=He.getOuterWidth(i)+parseFloat(i.style.left||0)),this.styleObject.left=e+"px"}},getVirtualScrollerProp(t){return this.virtualScrollerContentProps?this.virtualScrollerContentProps[t]:null}},computed:{editingRowData(){return this.editingMeta[this.rowIndex]?this.editingMeta[this.rowIndex].data:this.rowData},field(){return this.columnProp("field")},containerClass(){return[this.columnProp("bodyClass"),this.columnProp("class"),{"p-selection-column":this.columnProp("selectionMode")!=null,"p-editable-column":this.isEditable(),"p-cell-editing":this.d_editing,"p-frozen-column":this.columnProp("frozen")}]},containerStyle(){let t=this.columnProp("bodyStyle"),e=this.columnProp("style");return this.columnProp("frozen")?[e,t,this.styleObject]:[e,t]},loading(){return this.getVirtualScrollerProp("loading")},loadingOptions(){const t=this.getVirtualScrollerProp("getLoaderOptions");return t&&t(this.rowIndex,{cellIndex:this.index,cellFirst:this.index===0,cellLast:this.index===this.getVirtualScrollerProp("columns").length-1,cellEven:this.index%2===0,cellOdd:this.index%2!==0,column:this.column,field:this.field})},expandButtonAriaLabel(){return this.$primevue.config.locale.aria?this.isRowExpanded?this.$primevue.config.locale.aria.expandRow:this.$primevue.config.locale.aria.collapseRow:void 0},initButtonAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.editRow:void 0},saveButtonAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.saveEdit:void 0},cancelButtonAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.cancelEdit:void 0}},components:{DTRadioButton:OC,DTCheckbox:RC},directives:{ripple:Rs}};const T6={key:0,class:"p-column-title"},x6=["aria-expanded","aria-controls","aria-label"],S6=["aria-label"],E6=[Se("span",{class:"p-row-editor-init-icon pi pi-fw pi-pencil"},null,-1)],C6=["aria-label"],A6=[Se("span",{class:"p-row-editor-save-icon pi pi-fw pi-check"},null,-1)],D6=["aria-label"],P6=[Se("span",{class:"p-row-editor-cancel-icon pi pi-fw pi-times"},null,-1)];function k6(t,e,i,n,r,s){const o=Mt("DTRadioButton"),u=Mt("DTCheckbox"),h=Yr("ripple");return s.loading?(X(),se("td",{key:0,style:Ri(s.containerStyle),class:Tt(s.containerClass)},[(X(),gt(fr(i.column.children.loading),{data:i.rowData,column:i.column,field:s.field,index:i.rowIndex,frozenRow:i.frozenRow,loadingOptions:s.loadingOptions},null,8,["data","column","field","index","frozenRow","loadingOptions"]))],6)):(X(),se("td",{key:1,style:Ri(s.containerStyle),class:Tt(s.containerClass),onClick:e[6]||(e[6]=(...p)=>s.onClick&&s.onClick(...p)),onKeydown:e[7]||(e[7]=(...p)=>s.onKeyDown&&s.onKeyDown(...p)),role:"cell"},[i.responsiveLayout==="stack"?(X(),se("span",T6,it(s.columnProp("header")),1)):Be("",!0),i.column.children&&i.column.children.body&&!r.d_editing?(X(),gt(fr(i.column.children.body),{key:1,data:i.rowData,column:i.column,field:s.field,index:i.rowIndex,frozenRow:i.frozenRow,editorInitCallback:s.editorInitCallback},null,8,["data","column","field","index","frozenRow","editorInitCallback"])):i.column.children&&i.column.children.editor&&r.d_editing?(X(),gt(fr(i.column.children.editor),{key:2,data:s.editingRowData,column:i.column,field:s.field,index:i.rowIndex,frozenRow:i.frozenRow,editorSaveCallback:s.editorSaveCallback,editorCancelCallback:s.editorCancelCallback},null,8,["data","column","field","index","frozenRow","editorSaveCallback","editorCancelCallback"])):i.column.children&&i.column.children.body&&!i.column.children.editor&&r.d_editing?(X(),gt(fr(i.column.children.body),{key:3,data:s.editingRowData,column:i.column,field:s.field,index:i.rowIndex,frozenRow:i.frozenRow},null,8,["data","column","field","index","frozenRow"])):s.columnProp("selectionMode")?(X(),se(ct,{key:4},[s.columnProp("selectionMode")==="single"?(X(),gt(o,{key:0,value:i.rowData,name:i.name,checked:i.selected,onChange:e[0]||(e[0]=p=>s.toggleRowWithRadio(p,i.rowIndex))},null,8,["value","name","checked"])):s.columnProp("selectionMode")==="multiple"?(X(),gt(u,{key:1,value:i.rowData,checked:i.selected,"aria-selected":i.selected?!0:void 0,onChange:e[1]||(e[1]=p=>s.toggleRowWithCheckbox(p,i.rowIndex))},null,8,["value","checked","aria-selected"])):Be("",!0)],64)):s.columnProp("rowReorder")?(X(),se("i",{key:5,class:Tt(["p-datatable-reorderablerow-handle",s.columnProp("rowReorderIcon")||"pi pi-bars"])},null,2)):s.columnProp("expander")?dn((X(),se("button",{key:6,class:"p-row-toggler p-link",type:"button","aria-expanded":r.isRowExpanded,"aria-controls":i.ariaControls,"aria-label":s.expandButtonAriaLabel,onClick:e[2]||(e[2]=(...p)=>s.toggleRow&&s.toggleRow(...p))},[Se("span",{class:Tt(i.rowTogglerIcon)},null,2)],8,x6)),[[h]]):i.editMode==="row"&&s.columnProp("rowEditor")?(X(),se(ct,{key:7},[r.d_editing?Be("",!0):dn((X(),se("button",{key:0,class:"p-row-editor-init p-link",type:"button","aria-label":s.initButtonAriaLabel,onClick:e[3]||(e[3]=(...p)=>s.onRowEditInit&&s.onRowEditInit(...p))},E6,8,S6)),[[h]]),r.d_editing?dn((X(),se("button",{key:1,class:"p-row-editor-save p-link",type:"button","aria-label":s.saveButtonAriaLabel,onClick:e[4]||(e[4]=(...p)=>s.onRowEditSave&&s.onRowEditSave(...p))},A6,8,C6)),[[h]]):Be("",!0),r.d_editing?dn((X(),se("button",{key:2,class:"p-row-editor-cancel p-link",type:"button","aria-label":s.cancelButtonAriaLabel,onClick:e[5]||(e[5]=(...p)=>s.onRowEditCancel&&s.onRowEditCancel(...p))},P6,8,D6)),[[h]]):Be("",!0)],64)):(X(),se(ct,{key:8},[Vi(it(s.resolveFieldData()),1)],64))],38))}LC.render=k6;var MC={name:"TableBody",emits:["rowgroup-toggle","row-click","row-dblclick","row-rightclick","row-touchend","row-keydown","row-mousedown","row-dragstart","row-dragover","row-dragleave","row-dragend","row-drop","row-toggle","radio-change","checkbox-change","cell-edit-init","cell-edit-complete","cell-edit-cancel","row-edit-init","row-edit-save","row-edit-cancel","editing-meta-change"],props:{value:{type:Array,default:null},columns:{type:null,default:null},frozenRow:{type:Boolean,default:!1},empty:{type:Boolean,default:!1},rowGroupMode:{type:String,default:null},groupRowsBy:{type:[Array,String,Function],default:null},expandableRowGroups:{type:Boolean,default:!1},expandedRowGroups:{type:Array,default:null},first:{type:Number,default:0},dataKey:{type:String,default:null},expandedRowIcon:{type:String,default:null},collapsedRowIcon:{type:String,default:null},expandedRows:{type:Array,default:null},expandedRowKeys:{type:null,default:null},selection:{type:[Array,Object],default:null},selectionKeys:{type:null,default:null},selectionMode:{type:String,default:null},contextMenu:{type:Boolean,default:!1},contextMenuSelection:{type:Object,default:null},rowClass:{type:null,default:null},rowStyle:{type:null,default:null},editMode:{type:String,default:null},compareSelectionBy:{type:String,default:"deepEquals"},editingRows:{type:Array,default:null},editingRowKeys:{type:null,default:null},editingMeta:{type:Object,default:null},templates:{type:null,default:null},scrollable:{type:Boolean,default:!1},responsiveLayout:{type:String,default:"stack"},virtualScrollerContentProps:{type:Object,default:null},isVirtualScrollerDisabled:{type:Boolean,default:!1}},data(){return{rowGroupHeaderStyleObject:{},tabindexArray:[],isARowSelected:!1}},mounted(){this.frozenRow&&this.updateFrozenRowStickyPosition(),this.scrollable&&this.rowGroupMode==="subheader"&&this.updateFrozenRowGroupHeaderStickyPosition()},updated(){this.frozenRow&&this.updateFrozenRowStickyPosition(),this.scrollable&&this.rowGroupMode==="subheader"&&this.updateFrozenRowGroupHeaderStickyPosition()},methods:{columnProp(t,e){return ft.getVNodeProp(t,e)},shouldRenderRowGroupHeader(t,e,i){let n=ft.resolveFieldData(e,this.groupRowsBy),r=t[i-1];if(r){let s=ft.resolveFieldData(r,this.groupRowsBy);return n!==s}else return!0},getRowKey(t,e){return this.dataKey?ft.resolveFieldData(t,this.dataKey):this.getRowIndex(e)},getRowIndex(t){const e=this.getVirtualScrollerProp("getItemOptions");return e?e(t).index:this.first+t},getRowStyle(t){if(this.rowStyle)return this.rowStyle(t)},getRowClass(t){let e=[];if(this.selectionMode&&e.push("p-selectable-row"),this.selection&&e.push({"p-highlight":this.isSelected(t)}),this.contextMenuSelection&&e.push({"p-highlight-contextmenu":this.isSelectedWithContextMenu(t)}),this.rowClass){let i=this.rowClass(t);i&&e.push(i)}return e},shouldRenderRowGroupFooter(t,e,i){if(this.expandableRowGroups&&!this.isRowGroupExpanded(e))return!1;{let n=ft.resolveFieldData(e,this.groupRowsBy),r=t[i+1];if(r){let s=ft.resolveFieldData(r,this.groupRowsBy);return n!==s}else return!0}},shouldRenderBodyCell(t,e,i){if(this.rowGroupMode){if(this.rowGroupMode==="subheader")return this.groupRowsBy!==this.columnProp(e,"field");if(this.rowGroupMode==="rowspan")if(this.isGrouped(e)){let n=t[i-1];if(n){let r=ft.resolveFieldData(t[i],this.columnProp(e,"field")),s=ft.resolveFieldData(n,this.columnProp(e,"field"));return r!==s}else return!0}else return!0}else return!this.columnProp(e,"hidden")},calculateRowGroupSize(t,e,i){if(this.isGrouped(e)){let n=ft.resolveFieldData(t[i],this.columnProp(e,"field")),r=n,s=0;for(;n===r;){s++;let o=t[++i];if(o)r=ft.resolveFieldData(o,this.columnProp(e,"field"));else break}return s===1?null:s}else return null},rowTogglerIcon(t){return["p-row-toggler-icon pi",this.isRowExpanded(t)?this.expandedRowIcon:this.collapsedRowIcon]},rowGroupTogglerIcon(t){return["p-row-toggler-icon pi",this.isRowGroupExpanded(t)?this.expandedRowIcon:this.collapsedRowIcon]},isGrouped(t){return this.groupRowsBy&&this.columnProp(t,"field")?Array.isArray(this.groupRowsBy)?this.groupRowsBy.indexOf(t.props.field)>-1:this.groupRowsBy===t.props.field:!1},isRowEditing(t){return t&&this.editingRows?this.dataKey?this.editingRowKeys?this.editingRowKeys[ft.resolveFieldData(t,this.dataKey)]!==void 0:!1:this.findIndex(t,this.editingRows)>-1:!1},isRowExpanded(t){return t&&this.expandedRows?this.dataKey?this.expandedRowKeys?this.expandedRowKeys[ft.resolveFieldData(t,this.dataKey)]!==void 0:!1:this.findIndex(t,this.expandedRows)>-1:!1},isRowGroupExpanded(t){if(this.expandableRowGroups&&this.expandedRowGroups){let e=ft.resolveFieldData(t,this.groupRowsBy);return this.expandedRowGroups.indexOf(e)>-1}return!1},isSelected(t){return t&&this.selection?this.dataKey?this.selectionKeys?this.selectionKeys[ft.resolveFieldData(t,this.dataKey)]!==void 0:!1:this.selection instanceof Array?this.findIndexInSelection(t)>-1:this.equals(t,this.selection):!1},isSelectedWithContextMenu(t){return t&&this.contextMenuSelection?this.equals(t,this.contextMenuSelection,this.dataKey):!1},findIndexInSelection(t){return this.findIndex(t,this.selection)},findIndex(t,e){let i=-1;if(e&&e.length){for(let n=0;n{this.columnProp(e,"selectionMode")==="single"&&t--,this.columnProp(e,"hidden")&&t++}),this.columns?this.columns.length-t:0},rowGroupHeaderStyle(){return this.scrollable?{top:this.rowGroupHeaderStyleObject.top}:null},bodyStyle(){return this.getVirtualScrollerProp("contentStyle")},expandedRowId(){return ks()},nameAttributeSelector(){return ks()}},components:{DTBodyCell:LC}};const I6=["colspan"],R6=["onClick"],O6=["tabindex","aria-selected","onClick","onDblclick","onContextmenu","onKeydown","onDragstart","onDragover"],L6=["id"],M6=["colspan"],F6=["colspan"],N6={key:1,class:"p-datatable-emptymessage",role:"row"},B6=["colspan"];function H6(t,e,i,n,r,s){const o=Mt("DTBodyCell");return X(),se("tbody",{ref:s.bodyRef,class:"p-datatable-tbody",role:"rowgroup",style:Ri(s.bodyStyle)},[i.empty?(X(),se("tr",N6,[Se("td",{colspan:s.columnsLength},[i.templates.empty?(X(),gt(fr(i.templates.empty),{key:0})):Be("",!0)],8,B6)])):(X(!0),se(ct,{key:0},Kt(i.value,(u,h)=>(X(),se(ct,null,[i.templates.groupheader&&i.rowGroupMode==="subheader"&&s.shouldRenderRowGroupHeader(i.value,u,s.getRowIndex(h))?(X(),se("tr",{key:s.getRowKey(u,s.getRowIndex(h))+"_subheader",class:"p-rowgroup-header",style:Ri(s.rowGroupHeaderStyle),role:"row"},[Se("td",{colspan:s.columnsLength-1},[i.expandableRowGroups?(X(),se("button",{key:0,class:"p-row-toggler p-link",onClick:p=>s.onRowGroupToggle(p,u),type:"button"},[Se("span",{class:Tt(s.rowGroupTogglerIcon(u))},null,2)],8,R6)):Be("",!0),(X(),gt(fr(i.templates.groupheader),{data:u,index:s.getRowIndex(h)},null,8,["data","index"]))],8,I6)],4)):Be("",!0),!i.expandableRowGroups||s.isRowGroupExpanded(u)?(X(),se("tr",{key:s.getRowKey(u,s.getRowIndex(h)),class:Tt(s.getRowClass(u)),style:Ri(s.getRowStyle(u)),tabindex:s.setRowTabindex(h),role:"row","aria-selected":i.selectionMode?s.isSelected(u):null,onClick:p=>s.onRowClick(p,u,s.getRowIndex(h)),onDblclick:p=>s.onRowDblClick(p,u,s.getRowIndex(h)),onContextmenu:p=>s.onRowRightClick(p,u,s.getRowIndex(h)),onTouchend:e[9]||(e[9]=p=>s.onRowTouchEnd(p)),onKeydown:p=>s.onRowKeyDown(p,u,s.getRowIndex(h)),onMousedown:e[10]||(e[10]=p=>s.onRowMouseDown(p)),onDragstart:p=>s.onRowDragStart(p,s.getRowIndex(h)),onDragover:p=>s.onRowDragOver(p,s.getRowIndex(h)),onDragleave:e[11]||(e[11]=p=>s.onRowDragLeave(p)),onDragend:e[12]||(e[12]=p=>s.onRowDragEnd(p)),onDrop:e[13]||(e[13]=p=>s.onRowDrop(p))},[(X(!0),se(ct,null,Kt(i.columns,(p,g)=>(X(),se(ct,null,[s.shouldRenderBodyCell(i.value,p,s.getRowIndex(h))?(X(),gt(o,{key:s.columnProp(p,"columnKey")||s.columnProp(p,"field")||g,rowData:u,column:p,rowIndex:s.getRowIndex(h),index:g,selected:s.isSelected(u),rowTogglerIcon:s.columnProp(p,"expander")?s.rowTogglerIcon(u):null,frozenRow:i.frozenRow,rowspan:i.rowGroupMode==="rowspan"?s.calculateRowGroupSize(i.value,p,s.getRowIndex(h)):null,editMode:i.editMode,editing:i.editMode==="row"&&s.isRowEditing(u),editingMeta:i.editingMeta,responsiveLayout:i.responsiveLayout,virtualScrollerContentProps:i.virtualScrollerContentProps,ariaControls:s.expandedRowId+"_"+h+"_expansion",name:s.nameAttributeSelector,onRadioChange:e[0]||(e[0]=y=>s.onRadioChange(y)),onCheckboxChange:e[1]||(e[1]=y=>s.onCheckboxChange(y)),onRowToggle:e[2]||(e[2]=y=>s.onRowToggle(y)),onCellEditInit:e[3]||(e[3]=y=>s.onCellEditInit(y)),onCellEditComplete:e[4]||(e[4]=y=>s.onCellEditComplete(y)),onCellEditCancel:e[5]||(e[5]=y=>s.onCellEditCancel(y)),onRowEditInit:e[6]||(e[6]=y=>s.onRowEditInit(y)),onRowEditSave:e[7]||(e[7]=y=>s.onRowEditSave(y)),onRowEditCancel:e[8]||(e[8]=y=>s.onRowEditCancel(y)),onEditingMetaChange:s.onEditingMetaChange},null,8,["rowData","column","rowIndex","index","selected","rowTogglerIcon","frozenRow","rowspan","editMode","editing","editingMeta","responsiveLayout","virtualScrollerContentProps","ariaControls","name","onEditingMetaChange"])):Be("",!0)],64))),256))],46,O6)):Be("",!0),i.templates.expansion&&i.expandedRows&&s.isRowExpanded(u)?(X(),se("tr",{key:s.getRowKey(u,s.getRowIndex(h))+"_expansion",id:s.expandedRowId+"_"+h+"_expansion",class:"p-datatable-row-expansion",role:"row"},[Se("td",{colspan:s.columnsLength},[(X(),gt(fr(i.templates.expansion),{data:u,index:s.getRowIndex(h)},null,8,["data","index"]))],8,M6)],8,L6)):Be("",!0),i.templates.groupfooter&&i.rowGroupMode==="subheader"&&s.shouldRenderRowGroupFooter(i.value,u,s.getRowIndex(h))?(X(),se("tr",{key:s.getRowKey(u,s.getRowIndex(h))+"_subfooter",class:"p-rowgroup-footer",role:"row"},[Se("td",{colspan:s.columnsLength-1},[(X(),gt(fr(i.templates.groupfooter),{data:u,index:s.getRowIndex(h)},null,8,["data","index"]))],8,F6)])):Be("",!0)],64))),256))],4)}MC.render=H6;var FC={name:"FooterCell",props:{column:{type:null,default:null}},data(){return{styleObject:{}}},mounted(){this.columnProp("frozen")&&this.updateStickyPosition()},updated(){this.columnProp("frozen")&&this.updateStickyPosition()},methods:{columnProp(t){return ft.getVNodeProp(this.column,t)},updateStickyPosition(){if(this.columnProp("frozen"))if(this.columnProp("alignFrozen")==="right"){let e=0,i=this.$el.nextElementSibling;i&&(e=He.getOuterWidth(i)+parseFloat(i.style.right||0)),this.styleObject.right=e+"px"}else{let e=0,i=this.$el.previousElementSibling;i&&(e=He.getOuterWidth(i)+parseFloat(i.style.left||0)),this.styleObject.left=e+"px"}}},computed:{containerClass(){return[this.columnProp("footerClass"),this.columnProp("class"),{"p-frozen-column":this.columnProp("frozen")}]},containerStyle(){let t=this.columnProp("footerStyle"),e=this.columnProp("style");return this.columnProp("frozen")?[e,t,this.styleObject]:[e,t]}}};const U6=["colspan","rowspan"];function z6(t,e,i,n,r,s){return X(),se("td",{style:Ri(s.containerStyle),class:Tt(s.containerClass),role:"cell",colspan:s.columnProp("colspan"),rowspan:s.columnProp("rowspan")},[i.column.children&&i.column.children.footer?(X(),gt(fr(i.column.children.footer),{key:0,column:i.column},null,8,["column"])):Be("",!0),Vi(" "+it(s.columnProp("footer")),1)],14,U6)}FC.render=z6;var NC={name:"TableFooter",props:{columnGroup:{type:null,default:null},columns:{type:null,default:null}},methods:{columnProp(t,e){return ft.getVNodeProp(t,e)},getFooterRows(){let t=[],e=this.columnGroup;if(e.children&&e.children.default){for(let i of e.children.default())i.type.name==="Row"?t.push(i):i.children&&i.children instanceof Array&&(t=i.children);return t}},getFooterColumns(t){let e=[];if(t.children&&t.children.default)return t.children.default().forEach(i=>{i.children&&i.children instanceof Array?e=[...e,...i.children]:i.type.name==="Column"&&e.push(i)}),e}},computed:{hasFooter(){let t=!1;if(this.columnGroup)t=!0;else if(this.columns){for(let e of this.columns)if(this.columnProp(e,"footer")||e.children&&e.children.footer){t=!0;break}}return t}},components:{DTFooterCell:FC}};const V6={key:0,class:"p-datatable-tfoot",role:"rowgroup"},j6={key:0,role:"row"};function W6(t,e,i,n,r,s){const o=Mt("DTFooterCell");return s.hasFooter?(X(),se("tfoot",V6,[i.columnGroup?(X(!0),se(ct,{key:1},Kt(s.getFooterRows(),(u,h)=>(X(),se("tr",{key:h,role:"row"},[(X(!0),se(ct,null,Kt(s.getFooterColumns(u),(p,g)=>(X(),se(ct,{key:s.columnProp(p,"columnKey")||s.columnProp(p,"field")||g},[s.columnProp(p,"hidden")?Be("",!0):(X(),gt(o,{key:0,column:p},null,8,["column"]))],64))),128))]))),128)):(X(),se("tr",j6,[(X(!0),se(ct,null,Kt(i.columns,(u,h)=>(X(),se(ct,{key:s.columnProp(u,"columnKey")||s.columnProp(u,"field")||h},[s.columnProp(u,"hidden")?Be("",!0):(X(),gt(o,{key:0,column:u},null,8,["column"]))],64))),128))]))])):Be("",!0)}NC.render=W6;var jb={name:"ColumnFilter",emits:["filter-change","filter-apply","operator-change","matchmode-change","constraint-add","constraint-remove","filter-clear","apply-click"],props:{field:{type:String,default:null},type:{type:String,default:"text"},display:{type:String,default:null},showMenu:{type:Boolean,default:!0},matchMode:{type:String,default:null},showOperator:{type:Boolean,default:!0},showClearButton:{type:Boolean,default:!0},showApplyButton:{type:Boolean,default:!0},showMatchModes:{type:Boolean,default:!0},showAddButton:{type:Boolean,default:!0},matchModeOptions:{type:Array,default:null},maxConstraints:{type:Number,default:2},filterElement:null,filterHeaderTemplate:null,filterFooterTemplate:null,filterClearTemplate:null,filterApplyTemplate:null,filters:{type:Object,default:null},filtersStore:{type:Object,default:null},filterMenuClass:{type:String,default:null},filterMenuStyle:{type:null,default:null},filterInputProps:{type:null,default:null}},data(){return{overlayVisible:!1,defaultMatchMode:null,defaultOperator:null}},overlay:null,selfClick:!1,overlayEventListener:null,beforeUnmount(){this.overlayEventListener&&(lu.off("overlay-click",this.overlayEventListener),this.overlayEventListener=null),this.overlay&&(ol.clear(this.overlay),this.onOverlayHide())},mounted(){if(this.filters&&this.filters[this.field]){let t=this.filters[this.field];t.operator?(this.defaultMatchMode=t.constraints[0].matchMode,this.defaultOperator=t.operator):this.defaultMatchMode=this.filters[this.field].matchMode}},methods:{clearFilter(){let t={...this.filters};t[this.field].operator?(t[this.field].constraints.splice(1),t[this.field].operator=this.defaultOperator,t[this.field].constraints[0]={value:null,matchMode:this.defaultMatchMode}):(t[this.field].value=null,t[this.field].matchMode=this.defaultMatchMode),this.$emit("filter-clear"),this.$emit("filter-change",t),this.$emit("filter-apply"),this.hide()},applyFilter(){this.$emit("apply-click",{field:this.field,constraints:this.filters[this.field]}),this.$emit("filter-apply"),this.hide()},hasFilter(){if(this.filtersStore){let t=this.filtersStore[this.field];if(t)return t.operator?!this.isFilterBlank(t.constraints[0].value):!this.isFilterBlank(t.value)}return!1},hasRowFilter(){return this.filters[this.field]&&!this.isFilterBlank(this.filters[this.field].value)},isFilterBlank(t){return t!=null?typeof t=="string"&&t.trim().length==0||t instanceof Array&&t.length==0:!0},toggleMenu(){this.overlayVisible=!this.overlayVisible},onToggleButtonKeyDown(t){switch(t.code){case"Enter":case"Space":this.toggleMenu(),t.preventDefault();break;case"Escape":this.overlayVisible=!1;break}},onRowMatchModeChange(t){let e={...this.filters};e[this.field].matchMode=t,this.$emit("matchmode-change",{field:this.field,matchMode:t}),this.$emit("filter-change",e),this.$emit("filter-apply"),this.hide()},onRowMatchModeKeyDown(t){let e=t.target;switch(t.code){case"ArrowDown":var i=this.findNextItem(e);i&&(e.removeAttribute("tabindex"),i.tabIndex="0",i.focus()),t.preventDefault();break;case"ArrowUp":var n=this.findPrevItem(e);n&&(e.removeAttribute("tabindex"),n.tabIndex="0",n.focus()),t.preventDefault();break}},isRowMatchModeSelected(t){return this.filters[this.field].matchMode===t},onOperatorChange(t){let e={...this.filters};e[this.field].operator=t,this.$emit("filter-change",e),this.$emit("operator-change",{field:this.field,operator:t}),this.showApplyButton||this.$emit("filter-apply")},onMenuMatchModeChange(t,e){let i={...this.filters};i[this.field].constraints[e].matchMode=t,this.$emit("matchmode-change",{field:this.field,matchMode:t,index:e}),this.showApplyButton||this.$emit("filter-apply")},addConstraint(){let t={...this.filters},e={value:null,matchMode:this.defaultMatchMode};t[this.field].constraints.push(e),this.$emit("constraint-add",{field:this.field,constraing:e}),this.$emit("filter-change",t),this.showApplyButton||this.$emit("filter-apply")},removeConstraint(t){let e={...this.filters},i=e[this.field].constraints.splice(t,1);this.$emit("constraint-remove",{field:this.field,constraing:i}),this.$emit("filter-change",e),this.showApplyButton||this.$emit("filter-apply")},filterCallback(){this.$emit("filter-apply")},findNextItem(t){let e=t.nextElementSibling;return e?He.hasClass(e,"p-column-filter-separator")?this.findNextItem(e):e:t.parentElement.firstElementChild},findPrevItem(t){let e=t.previousElementSibling;return e?He.hasClass(e,"p-column-filter-separator")?this.findPrevItem(e):e:t.parentElement.lastElementChild},hide(){this.overlayVisible=!1,He.focus(this.$refs.icon)},onContentClick(t){this.selfClick=!0,lu.emit("overlay-click",{originalEvent:t,target:this.overlay})},onContentMouseDown(){this.selfClick=!0},onOverlayEnter(t){this.filterMenuStyle&&He.applyStyle(this.overlay,this.filterMenuStyle),ol.set("overlay",t,this.$primevue.config.zIndex.overlay),He.absolutePosition(this.overlay,this.$refs.icon),this.bindOutsideClickListener(),this.bindScrollListener(),this.bindResizeListener(),this.overlayEventListener=e=>{this.isOutsideClicked(e.target)||(this.selfClick=!0)},lu.on("overlay-click",this.overlayEventListener)},onOverlayLeave(){this.onOverlayHide()},onOverlayAfterLeave(t){ol.clear(t)},onOverlayHide(){this.unbindOutsideClickListener(),this.unbindResizeListener(),this.unbindScrollListener(),this.overlay=null,lu.off("overlay-click",this.overlayEventListener),this.overlayEventListener=null},overlayRef(t){this.overlay=t},isOutsideClicked(t){return!this.isTargetClicked(t)&&this.overlay&&!(this.overlay.isSameNode(t)||this.overlay.contains(t))},isTargetClicked(t){return this.$refs.icon&&(this.$refs.icon.isSameNode(t)||this.$refs.icon.contains(t))},bindOutsideClickListener(){this.outsideClickListener||(this.outsideClickListener=t=>{this.overlayVisible&&!this.selfClick&&this.isOutsideClicked(t.target)&&(this.overlayVisible=!1),this.selfClick=!1},document.addEventListener("click",this.outsideClickListener))},unbindOutsideClickListener(){this.outsideClickListener&&(document.removeEventListener("click",this.outsideClickListener),this.outsideClickListener=null,this.selfClick=!1)},bindScrollListener(){this.scrollHandler||(this.scrollHandler=new r1(this.$refs.icon,()=>{this.overlayVisible&&this.hide()})),this.scrollHandler.bindScrollListener()},unbindScrollListener(){this.scrollHandler&&this.scrollHandler.unbindScrollListener()},bindResizeListener(){this.resizeListener||(this.resizeListener=()=>{this.overlayVisible&&!He.isTouchDevice()&&this.hide()},window.addEventListener("resize",this.resizeListener))},unbindResizeListener(){this.resizeListener&&(window.removeEventListener("resize",this.resizeListener),this.resizeListener=null)}},computed:{containerClass(){return["p-column-filter p-fluid",{"p-column-filter-row":this.display==="row","p-column-filter-menu":this.display==="menu"}]},overlayClass(){return[this.filterMenuClass,{"p-column-filter-overlay p-component p-fluid":!0,"p-column-filter-overlay-menu":this.display==="menu","p-input-filled":this.$primevue.config.inputStyle==="filled","p-ripple-disabled":this.$primevue.config.ripple===!1}]},showMenuButton(){return this.showMenu&&(this.display==="row"?this.type!=="boolean":!0)},overlayId(){return ks()},matchModes(){return this.matchModeOptions||this.$primevue.config.filterMatchModeOptions[this.type].map(t=>({label:this.$primevue.config.locale[t],value:t}))},isShowMatchModes(){return this.type!=="boolean"&&this.showMatchModes&&this.matchModes},operatorOptions(){return[{label:this.$primevue.config.locale.matchAll,value:Pg.AND},{label:this.$primevue.config.locale.matchAny,value:Pg.OR}]},noFilterLabel(){return this.$primevue.config.locale?this.$primevue.config.locale.noFilter:void 0},isShowOperator(){return this.showOperator&&this.filters[this.field].operator},operator(){return this.filters[this.field].operator},fieldConstraints(){return this.filters[this.field].constraints||[this.filters[this.field]]},showRemoveIcon(){return this.fieldConstraints.length>1},removeRuleButtonLabel(){return this.$primevue.config.locale?this.$primevue.config.locale.removeRule:void 0},addRuleButtonLabel(){return this.$primevue.config.locale?this.$primevue.config.locale.addRule:void 0},isShowAddConstraint(){return this.showAddButton&&this.filters[this.field].operator&&this.fieldConstraints&&this.fieldConstraints.lengths.toggleMenu()),onKeydown:e[1]||(e[1]=g=>s.onToggleButtonKeyDown(g))},G6,42,q6)):Be("",!0),i.showClearButton&&i.display==="row"?(X(),se("button",{key:2,class:Tt([{"p-hidden-space":!s.hasRowFilter()},"p-column-filter-clear-button p-link"]),type:"button",onClick:e[2]||(e[2]=g=>s.clearFilter())},K6,2)):Be("",!0),xt(h,null,{default:Vt(()=>[xt(sl,{name:"p-connected-overlay",onEnter:s.onOverlayEnter,onLeave:s.onOverlayLeave,onAfterLeave:s.onOverlayAfterLeave},{default:Vt(()=>[r.overlayVisible?dn((X(),se("div",{key:0,ref:s.overlayRef,id:s.overlayId,"aria-modal":r.overlayVisible,role:"dialog",class:Tt(s.overlayClass),onKeydown:e[10]||(e[10]=Yf((...g)=>s.hide&&s.hide(...g),["escape"])),onClick:e[11]||(e[11]=(...g)=>s.onContentClick&&s.onContentClick(...g)),onMousedown:e[12]||(e[12]=(...g)=>s.onContentMouseDown&&s.onContentMouseDown(...g))},[(X(),gt(fr(i.filterHeaderTemplate),{field:i.field,filterModel:i.filters[i.field],filterCallback:s.filterCallback},null,8,["field","filterModel","filterCallback"])),i.display==="row"?(X(),se("ul",X6,[(X(!0),se(ct,null,Kt(s.matchModes,(g,y)=>(X(),se("li",{key:g.label,class:Tt(["p-column-filter-row-item",{"p-highlight":s.isRowMatchModeSelected(g.value)}]),onClick:S=>s.onRowMatchModeChange(g.value),onKeydown:[e[3]||(e[3]=S=>s.onRowMatchModeKeyDown(S)),Yf(Kf(S=>s.onRowMatchModeChange(g.value),["prevent"]),["enter"])],tabindex:y===0?"0":null},it(g.label),43,Z6))),128)),Q6,Se("li",{class:"p-column-filter-row-item",onClick:e[4]||(e[4]=g=>s.clearFilter()),onKeydown:[e[5]||(e[5]=g=>s.onRowMatchModeKeyDown(g)),e[6]||(e[6]=Yf(g=>t.onRowClearItemClick(),["enter"]))]},it(s.noFilterLabel),33)])):(X(),se(ct,{key:1},[s.isShowOperator?(X(),se("div",J6,[xt(o,{options:s.operatorOptions,modelValue:s.operator,"aria-label":s.filterOperatorAriaLabel,class:"p-column-filter-operator-dropdown",optionLabel:"label",optionValue:"value","onUpdate:modelValue":e[7]||(e[7]=g=>s.onOperatorChange(g))},null,8,["options","modelValue","aria-label"])])):Be("",!0),Se("div",$6,[(X(!0),se(ct,null,Kt(s.fieldConstraints,(g,y)=>(X(),se("div",{key:y,class:"p-column-filter-constraint"},[s.isShowMatchModes?(X(),gt(o,{key:0,options:s.matchModes,modelValue:g.matchMode,class:"p-column-filter-matchmode-dropdown",optionLabel:"label",optionValue:"value","aria-label":s.filterConstraintAriaLabel,"onUpdate:modelValue":S=>s.onMenuMatchModeChange(S,y)},null,8,["options","modelValue","aria-label","onUpdate:modelValue"])):Be("",!0),i.display==="menu"?(X(),gt(fr(i.filterElement),{key:1,field:i.field,filterModel:g,filterCallback:s.filterCallback},null,8,["field","filterModel","filterCallback"])):Be("",!0),Se("div",null,[s.showRemoveIcon?(X(),gt(u,{key:0,type:"button",icon:"pi pi-trash",class:"p-column-filter-remove-button p-button-text p-button-danger p-button-sm",onClick:S=>s.removeConstraint(y),label:s.removeRuleButtonLabel},null,8,["onClick","label"])):Be("",!0)])]))),128))]),s.isShowAddConstraint?(X(),se("div",e8,[xt(u,{type:"button",label:s.addRuleButtonLabel,icon:"pi pi-plus",class:"p-column-filter-add-button p-button-text p-button-sm",onClick:e[8]||(e[8]=g=>s.addConstraint())},null,8,["label"])])):Be("",!0),Se("div",t8,[!i.filterClearTemplate&&i.showClearButton?(X(),gt(u,{key:0,type:"button",class:"p-button-outlined p-button-sm",label:s.clearButtonLabel,onClick:s.clearFilter},null,8,["label","onClick"])):(X(),gt(fr(i.filterClearTemplate),{key:1,field:i.field,filterModel:i.filters[i.field],filterCallback:s.clearFilter},null,8,["field","filterModel","filterCallback"])),i.showApplyButton?(X(),se(ct,{key:2},[i.filterApplyTemplate?(X(),gt(fr(i.filterApplyTemplate),{key:1,field:i.field,filterModel:i.filters[i.field],filterCallback:s.applyFilter},null,8,["field","filterModel","filterCallback"])):(X(),gt(u,{key:0,type:"button",class:"p-button-sm",label:s.applyButtonLabel,onClick:e[9]||(e[9]=g=>s.applyFilter())},null,8,["label"]))],64)):Be("",!0)])],64)),(X(),gt(fr(i.filterFooterTemplate),{field:i.field,filterModel:i.filters[i.field],filterCallback:s.filterCallback},null,8,["field","filterModel","filterCallback"]))],42,Y6)),[[p,{autoFocus:!0}]]):Be("",!0)]),_:1},8,["onEnter","onLeave","onAfterLeave"])]),_:1})],2)}jb.render=i8;var Wb={name:"HeaderCheckbox",emits:["change"],props:{checked:null,disabled:null},data(){return{focused:!1}},methods:{onClick(t){this.disabled||(this.$emit("change",{originalEvent:t,checked:!this.checked}),He.focus(this.$refs.input))},onFocus(){this.focused=!0},onBlur(){this.focused=!1}},computed:{headerCheckboxAriaLabel(){return this.$primevue.config.locale.aria?this.checked?this.$primevue.config.locale.aria.selectAll:this.$primevue.config.locale.aria.unselectAll:void 0}}};const n8={class:"p-hidden-accessible"},r8=["checked","disabled","tabindex","aria-label"];function s8(t,e,i,n,r,s){return X(),se("div",{class:Tt(["p-checkbox p-component",{"p-checkbox-focused":r.focused,"p-disabled":i.disabled}]),onClick:e[2]||(e[2]=(...o)=>s.onClick&&s.onClick(...o)),onKeydown:e[3]||(e[3]=Yf(Kf((...o)=>s.onClick&&s.onClick(...o),["prevent"]),["space"]))},[Se("div",n8,[Se("input",{ref:"input",type:"checkbox",checked:i.checked,disabled:i.disabled,tabindex:i.disabled?null:"0","aria-label":s.headerCheckboxAriaLabel,onFocus:e[0]||(e[0]=o=>s.onFocus(o)),onBlur:e[1]||(e[1]=o=>s.onBlur(o))},null,40,r8)]),Se("div",{ref:"box",class:Tt(["p-checkbox-box p-component",{"p-highlight":i.checked,"p-disabled":i.disabled,"p-focus":r.focused}])},[Se("span",{class:Tt(["p-checkbox-icon",{"pi pi-check":i.checked}])},null,2)],2)],34)}Wb.render=s8;var BC={name:"HeaderCell",emits:["column-click","column-mousedown","column-dragstart","column-dragover","column-dragleave","column-drop","column-resizestart","checkbox-change","filter-change","filter-apply","operator-change","matchmode-change","constraint-add","constraint-remove","filter-clear","apply-click"],props:{column:{type:Object,default:null},resizableColumns:{type:Boolean,default:!1},groupRowsBy:{type:[Array,String,Function],default:null},sortMode:{type:String,default:"single"},groupRowSortField:{type:[String,Function],default:null},sortField:{type:[String,Function],default:null},sortOrder:{type:Number,default:null},multiSortMeta:{type:Array,default:null},allRowsSelected:{type:Boolean,default:!1},empty:{type:Boolean,default:!1},filterDisplay:{type:String,default:null},filters:{type:Object,default:null},filtersStore:{type:Object,default:null},filterColumn:{type:Boolean,default:!1},reorderableColumns:{type:Boolean,default:!1},filterInputProps:{type:null,default:null}},data(){return{styleObject:{}}},mounted(){this.columnProp("frozen")&&this.updateStickyPosition()},updated(){this.columnProp("frozen")&&this.updateStickyPosition()},methods:{columnProp(t){return ft.getVNodeProp(this.column,t)},onClick(t){this.$emit("column-click",{originalEvent:t,column:this.column})},onKeyDown(t){(t.code==="Enter"||t.code==="Space")&&t.currentTarget.nodeName==="TH"&&He.hasClass(t.currentTarget,"p-sortable-column")&&(this.$emit("column-click",{originalEvent:t,column:this.column}),t.preventDefault())},onMouseDown(t){this.$emit("column-mousedown",{originalEvent:t,column:this.column})},onDragStart(t){this.$emit("column-dragstart",t)},onDragOver(t){this.$emit("column-dragover",t)},onDragLeave(t){this.$emit("column-dragleave",t)},onDrop(t){this.$emit("column-drop",t)},onResizeStart(t){this.$emit("column-resizestart",t)},getMultiSortMetaIndex(){return this.multiSortMeta.findIndex(t=>t.field===this.columnProp("field")||t.field===this.columnProp("sortField"))},getBadgeValue(){let t=this.getMultiSortMetaIndex();return this.groupRowsBy&&this.groupRowsBy===this.groupRowSortField&&t>-1?t:t+1},isMultiSorted(){return this.sortMode==="multiple"&&this.columnProp("sortable")&&this.getMultiSortMetaIndex()>-1},isColumnSorted(){return this.sortMode==="single"?this.sortField&&(this.sortField===this.columnProp("field")||this.sortField===this.columnProp("sortField")):this.isMultiSorted()},updateStickyPosition(){if(this.columnProp("frozen")){if(this.columnProp("alignFrozen")==="right"){let i=0,n=this.$el.nextElementSibling;n&&(i=He.getOuterWidth(n)+parseFloat(n.style.right||0)),this.styleObject.right=i+"px"}else{let i=0,n=this.$el.previousElementSibling;n&&(i=He.getOuterWidth(n)+parseFloat(n.style.left||0)),this.styleObject.left=i+"px"}let e=this.$el.parentElement.nextElementSibling;if(e){let i=He.index(this.$el);e.children[i].style.left=this.styleObject.left,e.children[i].style.right=this.styleObject.right}}},onHeaderCheckboxChange(t){this.$emit("checkbox-change",t)}},computed:{containerClass(){return[this.filterColumn?this.columnProp("filterHeaderClass"):this.columnProp("headerClass"),this.columnProp("class"),{"p-sortable-column":this.columnProp("sortable"),"p-resizable-column":this.resizableColumns,"p-highlight":this.isColumnSorted(),"p-filter-column":this.filterColumn,"p-frozen-column":this.columnProp("frozen"),"p-reorderable-column":this.reorderableColumns}]},containerStyle(){let t=this.filterColumn?this.columnProp("filterHeaderStyle"):this.columnProp("headerStyle"),e=this.columnProp("style");return this.columnProp("frozen")?[e,t,this.styleObject]:[e,t]},sortableColumnIcon(){let t=!1,e=null;if(this.sortMode==="single")t=this.sortField&&(this.sortField===this.columnProp("field")||this.sortField===this.columnProp("sortField")),e=t?this.sortOrder:0;else if(this.sortMode==="multiple"){let i=this.getMultiSortMetaIndex();i>-1&&(t=!0,e=this.multiSortMeta[i].order)}return["p-sortable-column-icon pi pi-fw",{"pi-sort-alt":!t,"pi-sort-amount-up-alt":t&&e>0,"pi-sort-amount-down":t&&e<0}]},ariaSort(){if(this.columnProp("sortable")){const t=this.sortableColumnIcon;return t[1]["pi-sort-amount-down"]?"descending":t[1]["pi-sort-amount-up-alt"]?"ascending":"none"}else return null}},components:{DTHeaderCheckbox:Wb,DTColumnFilter:jb}};const o8=["tabindex","colspan","rowspan","aria-sort"],a8={class:"p-column-header-content"},l8={key:1,class:"p-column-title"},u8={key:3,class:"p-sortable-column-badge"};function c8(t,e,i,n,r,s){const o=Mt("DTHeaderCheckbox"),u=Mt("DTColumnFilter");return X(),se("th",{style:Ri(s.containerStyle),class:Tt(s.containerClass),tabindex:s.columnProp("sortable")?"0":null,role:"columnheader",colspan:s.columnProp("colspan"),rowspan:s.columnProp("rowspan"),"aria-sort":s.ariaSort,onClick:e[8]||(e[8]=(...h)=>s.onClick&&s.onClick(...h)),onKeydown:e[9]||(e[9]=(...h)=>s.onKeyDown&&s.onKeyDown(...h)),onMousedown:e[10]||(e[10]=(...h)=>s.onMouseDown&&s.onMouseDown(...h)),onDragstart:e[11]||(e[11]=(...h)=>s.onDragStart&&s.onDragStart(...h)),onDragover:e[12]||(e[12]=(...h)=>s.onDragOver&&s.onDragOver(...h)),onDragleave:e[13]||(e[13]=(...h)=>s.onDragLeave&&s.onDragLeave(...h)),onDrop:e[14]||(e[14]=(...h)=>s.onDrop&&s.onDrop(...h))},[i.resizableColumns&&!s.columnProp("frozen")?(X(),se("span",{key:0,class:"p-column-resizer",onMousedown:e[0]||(e[0]=(...h)=>s.onResizeStart&&s.onResizeStart(...h))},null,32)):Be("",!0),Se("div",a8,[i.column.children&&i.column.children.header?(X(),gt(fr(i.column.children.header),{key:0,column:i.column},null,8,["column"])):Be("",!0),s.columnProp("header")?(X(),se("span",l8,it(s.columnProp("header")),1)):Be("",!0),s.columnProp("sortable")?(X(),se("span",{key:2,class:Tt(s.sortableColumnIcon)},null,2)):Be("",!0),s.isMultiSorted()?(X(),se("span",u8,it(s.getBadgeValue()),1)):Be("",!0),s.columnProp("selectionMode")==="multiple"&&i.filterDisplay!=="row"?(X(),gt(o,{key:4,checked:i.allRowsSelected,onChange:s.onHeaderCheckboxChange,disabled:i.empty},null,8,["checked","onChange","disabled"])):Be("",!0),i.filterDisplay==="menu"&&i.column.children&&i.column.children.filter?(X(),gt(u,{key:5,field:s.columnProp("filterField")||s.columnProp("field"),type:s.columnProp("dataType"),display:"menu",showMenu:s.columnProp("showFilterMenu"),filterElement:i.column.children&&i.column.children.filter,filterHeaderTemplate:i.column.children&&i.column.children.filterheader,filterFooterTemplate:i.column.children&&i.column.children.filterfooter,filterClearTemplate:i.column.children&&i.column.children.filterclear,filterApplyTemplate:i.column.children&&i.column.children.filterapply,filters:i.filters,filtersStore:i.filtersStore,filterInputProps:i.filterInputProps,onFilterChange:e[1]||(e[1]=h=>t.$emit("filter-change",h)),onFilterApply:e[2]||(e[2]=h=>t.$emit("filter-apply")),filterMenuStyle:s.columnProp("filterMenuStyle"),filterMenuClass:s.columnProp("filterMenuClass"),showOperator:s.columnProp("showFilterOperator"),showClearButton:s.columnProp("showClearButton"),showApplyButton:s.columnProp("showApplyButton"),showMatchModes:s.columnProp("showFilterMatchModes"),showAddButton:s.columnProp("showAddButton"),matchModeOptions:s.columnProp("filterMatchModeOptions"),maxConstraints:s.columnProp("maxConstraints"),onOperatorChange:e[3]||(e[3]=h=>t.$emit("operator-change",h)),onMatchmodeChange:e[4]||(e[4]=h=>t.$emit("matchmode-change",h)),onConstraintAdd:e[5]||(e[5]=h=>t.$emit("constraint-add",h)),onConstraintRemove:e[6]||(e[6]=h=>t.$emit("constraint-remove",h)),onApplyClick:e[7]||(e[7]=h=>t.$emit("apply-click",h))},null,8,["field","type","showMenu","filterElement","filterHeaderTemplate","filterFooterTemplate","filterClearTemplate","filterApplyTemplate","filters","filtersStore","filterInputProps","filterMenuStyle","filterMenuClass","showOperator","showClearButton","showApplyButton","showMatchModes","showAddButton","matchModeOptions","maxConstraints"])):Be("",!0)])],46,o8)}BC.render=c8;var HC={name:"TableHeader",emits:["column-click","column-mousedown","column-dragstart","column-dragover","column-dragleave","column-drop","column-resizestart","checkbox-change","filter-change","filter-apply","operator-change","matchmode-change","constraint-add","constraint-remove","filter-clear","apply-click"],props:{columnGroup:{type:null,default:null},columns:{type:null,default:null},rowGroupMode:{type:String,default:null},groupRowsBy:{type:[Array,String,Function],default:null},resizableColumns:{type:Boolean,default:!1},allRowsSelected:{type:Boolean,default:!1},empty:{type:Boolean,default:!1},sortMode:{type:String,default:"single"},groupRowSortField:{type:[String,Function],default:null},sortField:{type:[String,Function],default:null},sortOrder:{type:Number,default:null},multiSortMeta:{type:Array,default:null},filterDisplay:{type:String,default:null},filters:{type:Object,default:null},filtersStore:{type:Object,default:null},reorderableColumns:{type:Boolean,default:!1},filterInputProps:{type:null,default:null}},methods:{columnProp(t,e){return ft.getVNodeProp(t,e)},getFilterColumnHeaderClass(t){return["p-filter-column",this.columnProp(t,"filterHeaderClass"),this.columnProp(t,"class"),{"p-frozen-column":this.columnProp(t,"frozen")}]},getFilterColumnHeaderStyle(t){return[this.columnProp(t,"filterHeaderStyle"),this.columnProp(t,"style")]},getHeaderRows(){let t=[],e=this.columnGroup;if(e.children&&e.children.default){for(let i of e.children.default())i.type.name==="Row"?t.push(i):i.children&&i.children instanceof Array&&(t=i.children);return t}},getHeaderColumns(t){let e=[];if(t.children&&t.children.default)return t.children.default().forEach(i=>{i.children&&i.children instanceof Array?e=[...e,...i.children]:i.type.name==="Column"&&e.push(i)}),e}},components:{DTHeaderCell:BC,DTHeaderCheckbox:Wb,DTColumnFilter:jb}};const d8={class:"p-datatable-thead",role:"rowgroup"},h8={role:"row"},f8={key:0,role:"row"};function p8(t,e,i,n,r,s){const o=Mt("DTHeaderCell"),u=Mt("DTHeaderCheckbox"),h=Mt("DTColumnFilter");return X(),se("thead",d8,[i.columnGroup?(X(!0),se(ct,{key:1},Kt(s.getHeaderRows(),(p,g)=>(X(),se("tr",{key:g,role:"row"},[(X(!0),se(ct,null,Kt(s.getHeaderColumns(p),(y,S)=>(X(),se(ct,{key:s.columnProp(y,"columnKey")||s.columnProp(y,"field")||S},[!s.columnProp(y,"hidden")&&(i.rowGroupMode!=="subheader"||i.groupRowsBy!==s.columnProp(y,"field"))&&typeof y.children!="string"?(X(),gt(o,{key:0,column:y,onColumnClick:e[23]||(e[23]=P=>t.$emit("column-click",P)),onColumnMousedown:e[24]||(e[24]=P=>t.$emit("column-mousedown",P)),groupRowsBy:i.groupRowsBy,groupRowSortField:i.groupRowSortField,sortMode:i.sortMode,sortField:i.sortField,sortOrder:i.sortOrder,multiSortMeta:i.multiSortMeta,allRowsSelected:i.allRowsSelected,empty:i.empty,onCheckboxChange:e[25]||(e[25]=P=>t.$emit("checkbox-change",P)),filters:i.filters,filterDisplay:i.filterDisplay,filtersStore:i.filtersStore,onFilterChange:e[26]||(e[26]=P=>t.$emit("filter-change",P)),onFilterApply:e[27]||(e[27]=P=>t.$emit("filter-apply")),onOperatorChange:e[28]||(e[28]=P=>t.$emit("operator-change",P)),onMatchmodeChange:e[29]||(e[29]=P=>t.$emit("matchmode-change",P)),onConstraintAdd:e[30]||(e[30]=P=>t.$emit("constraint-add",P)),onConstraintRemove:e[31]||(e[31]=P=>t.$emit("constraint-remove",P)),onApplyClick:e[32]||(e[32]=P=>t.$emit("apply-click",P))},null,8,["column","groupRowsBy","groupRowSortField","sortMode","sortField","sortOrder","multiSortMeta","allRowsSelected","empty","filters","filterDisplay","filtersStore"])):Be("",!0)],64))),128))]))),128)):(X(),se(ct,{key:0},[Se("tr",h8,[(X(!0),se(ct,null,Kt(i.columns,(p,g)=>(X(),se(ct,{key:s.columnProp(p,"columnKey")||s.columnProp(p,"field")||g},[!s.columnProp(p,"hidden")&&(i.rowGroupMode!=="subheader"||i.groupRowsBy!==s.columnProp(p,"field"))?(X(),gt(o,{key:0,column:p,onColumnClick:e[0]||(e[0]=y=>t.$emit("column-click",y)),onColumnMousedown:e[1]||(e[1]=y=>t.$emit("column-mousedown",y)),onColumnDragstart:e[2]||(e[2]=y=>t.$emit("column-dragstart",y)),onColumnDragover:e[3]||(e[3]=y=>t.$emit("column-dragover",y)),onColumnDragleave:e[4]||(e[4]=y=>t.$emit("column-dragleave",y)),onColumnDrop:e[5]||(e[5]=y=>t.$emit("column-drop",y)),groupRowsBy:i.groupRowsBy,groupRowSortField:i.groupRowSortField,reorderableColumns:i.reorderableColumns,resizableColumns:i.resizableColumns,onColumnResizestart:e[6]||(e[6]=y=>t.$emit("column-resizestart",y)),sortMode:i.sortMode,sortField:i.sortField,sortOrder:i.sortOrder,multiSortMeta:i.multiSortMeta,allRowsSelected:i.allRowsSelected,empty:i.empty,onCheckboxChange:e[7]||(e[7]=y=>t.$emit("checkbox-change",y)),filters:i.filters,filterDisplay:i.filterDisplay,filtersStore:i.filtersStore,filterInputProps:i.filterInputProps,onFilterChange:e[8]||(e[8]=y=>t.$emit("filter-change",y)),onFilterApply:e[9]||(e[9]=y=>t.$emit("filter-apply")),onOperatorChange:e[10]||(e[10]=y=>t.$emit("operator-change",y)),onMatchmodeChange:e[11]||(e[11]=y=>t.$emit("matchmode-change",y)),onConstraintAdd:e[12]||(e[12]=y=>t.$emit("constraint-add",y)),onConstraintRemove:e[13]||(e[13]=y=>t.$emit("constraint-remove",y)),onApplyClick:e[14]||(e[14]=y=>t.$emit("apply-click",y))},null,8,["column","groupRowsBy","groupRowSortField","reorderableColumns","resizableColumns","sortMode","sortField","sortOrder","multiSortMeta","allRowsSelected","empty","filters","filterDisplay","filtersStore","filterInputProps"])):Be("",!0)],64))),128))]),i.filterDisplay==="row"?(X(),se("tr",f8,[(X(!0),se(ct,null,Kt(i.columns,(p,g)=>(X(),se(ct,{key:s.columnProp(p,"columnKey")||s.columnProp(p,"field")||g},[!s.columnProp(p,"hidden")&&(i.rowGroupMode!=="subheader"||i.groupRowsBy!==s.columnProp(p,"field"))?(X(),se("th",{key:0,style:Ri(s.getFilterColumnHeaderStyle(p)),class:Tt(s.getFilterColumnHeaderClass(p))},[s.columnProp(p,"selectionMode")==="multiple"?(X(),gt(u,{key:0,checked:i.allRowsSelected,disabled:i.empty,onChange:e[15]||(e[15]=y=>t.$emit("checkbox-change",y))},null,8,["checked","disabled"])):Be("",!0),p.children&&p.children.filter?(X(),gt(h,{key:1,field:s.columnProp(p,"filterField")||s.columnProp(p,"field"),type:s.columnProp(p,"dataType"),display:"row",showMenu:s.columnProp(p,"showFilterMenu"),filterElement:p.children&&p.children.filter,filterHeaderTemplate:p.children&&p.children.filterheader,filterFooterTemplate:p.children&&p.children.filterfooter,filterClearTemplate:p.children&&p.children.filterclear,filterApplyTemplate:p.children&&p.children.filterapply,filters:i.filters,filtersStore:i.filtersStore,filterInputProps:i.filterInputProps,onFilterChange:e[16]||(e[16]=y=>t.$emit("filter-change",y)),onFilterApply:e[17]||(e[17]=y=>t.$emit("filter-apply")),filterMenuStyle:s.columnProp(p,"filterMenuStyle"),filterMenuClass:s.columnProp(p,"filterMenuClass"),showOperator:s.columnProp(p,"showFilterOperator"),showClearButton:s.columnProp(p,"showClearButton"),showApplyButton:s.columnProp(p,"showApplyButton"),showMatchModes:s.columnProp(p,"showFilterMatchModes"),showAddButton:s.columnProp(p,"showAddButton"),matchModeOptions:s.columnProp(p,"filterMatchModeOptions"),maxConstraints:s.columnProp(p,"maxConstraints"),onOperatorChange:e[18]||(e[18]=y=>t.$emit("operator-change",y)),onMatchmodeChange:e[19]||(e[19]=y=>t.$emit("matchmode-change",y)),onConstraintAdd:e[20]||(e[20]=y=>t.$emit("constraint-add",y)),onConstraintRemove:e[21]||(e[21]=y=>t.$emit("constraint-remove",y)),onApplyClick:e[22]||(e[22]=y=>t.$emit("apply-click",y))},null,8,["field","type","showMenu","filterElement","filterHeaderTemplate","filterFooterTemplate","filterClearTemplate","filterApplyTemplate","filters","filtersStore","filterInputProps","filterMenuStyle","filterMenuClass","showOperator","showClearButton","showApplyButton","showMatchModes","showAddButton","matchModeOptions","maxConstraints"])):Be("",!0)],6)):Be("",!0)],64))),128))])):Be("",!0)],64))])}HC.render=p8;var qb={name:"DataTable",emits:["value-change","update:first","update:rows","page","update:sortField","update:sortOrder","update:multiSortMeta","sort","filter","row-click","row-dblclick","update:selection","row-select","row-unselect","update:contextMenuSelection","row-contextmenu","row-unselect-all","row-select-all","select-all-change","column-resize-end","column-reorder","row-reorder","update:expandedRows","row-collapse","row-expand","update:expandedRowGroups","rowgroup-collapse","rowgroup-expand","update:filters","state-restore","state-save","cell-edit-init","cell-edit-complete","cell-edit-cancel","update:editingRows","row-edit-init","row-edit-save","row-edit-cancel"],props:{value:{type:Array,default:null},dataKey:{type:[String,Function],default:null},rows:{type:Number,default:0},first:{type:Number,default:0},totalRecords:{type:Number,default:0},paginator:{type:Boolean,default:!1},paginatorPosition:{type:String,default:"bottom"},alwaysShowPaginator:{type:Boolean,default:!0},paginatorTemplate:{type:[Object,String],default:"FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink RowsPerPageDropdown"},pageLinkSize:{type:Number,default:5},rowsPerPageOptions:{type:Array,default:null},currentPageReportTemplate:{type:String,default:"({currentPage} of {totalPages})"},lazy:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},loadingIcon:{type:String,default:"pi pi-spinner"},sortField:{type:[String,Function],default:null},sortOrder:{type:Number,default:null},defaultSortOrder:{type:Number,default:1},multiSortMeta:{type:Array,default:null},sortMode:{type:String,default:"single"},removableSort:{type:Boolean,default:!1},filters:{type:Object,default:null},filterDisplay:{type:String,default:null},globalFilterFields:{type:Array,default:null},filterLocale:{type:String,default:void 0},selection:{type:[Array,Object],default:null},selectionMode:{type:String,default:null},compareSelectionBy:{type:String,default:"deepEquals"},metaKeySelection:{type:Boolean,default:!0},contextMenu:{type:Boolean,default:!1},contextMenuSelection:{type:Object,default:null},selectAll:{type:Boolean,default:null},rowHover:{type:Boolean,default:!1},csvSeparator:{type:String,default:","},exportFilename:{type:String,default:"download"},exportFunction:{type:Function,default:null},resizableColumns:{type:Boolean,default:!1},columnResizeMode:{type:String,default:"fit"},reorderableColumns:{type:Boolean,default:!1},expandedRows:{type:Array,default:null},expandedRowIcon:{type:String,default:"pi-chevron-down"},collapsedRowIcon:{type:String,default:"pi-chevron-right"},rowGroupMode:{type:String,default:null},groupRowsBy:{type:[Array,String,Function],default:null},expandableRowGroups:{type:Boolean,default:!1},expandedRowGroups:{type:Array,default:null},stateStorage:{type:String,default:"session"},stateKey:{type:String,default:null},editMode:{type:String,default:null},editingRows:{type:Array,default:null},rowClass:{type:null,default:null},rowStyle:{type:null,default:null},scrollable:{type:Boolean,default:!1},virtualScrollerOptions:{type:Object,default:null},scrollHeight:{type:String,default:null},frozenValue:{type:Array,default:null},responsiveLayout:{type:String,default:"scroll"},breakpoint:{type:String,default:"960px"},showGridlines:{type:Boolean,default:!1},stripedRows:{type:Boolean,default:!1},tableStyle:{type:null,default:null},tableClass:{type:String,default:null},tableProps:{type:null,default:null},filterInputProps:{type:null,default:null}},data(){return{d_first:this.first,d_rows:this.rows,d_sortField:this.sortField,d_sortOrder:this.sortOrder,d_multiSortMeta:this.multiSortMeta?[...this.multiSortMeta]:[],d_groupRowsSortMeta:null,d_selectionKeys:null,d_expandedRowKeys:null,d_columnOrder:null,d_editingRowKeys:null,d_editingMeta:{},d_filters:this.cloneFilters(this.filters)}},rowTouched:!1,anchorRowIndex:null,rangeRowIndex:null,documentColumnResizeListener:null,documentColumnResizeEndListener:null,lastResizeHelperX:null,resizeColumnElement:null,columnResizing:!1,colReorderIconWidth:null,colReorderIconHeight:null,draggedColumn:null,draggedRowIndex:null,droppedRowIndex:null,rowDragging:null,columnWidthsState:null,tableWidthState:null,columnWidthsRestored:!1,watch:{first(t){this.d_first=t},rows(t){this.d_rows=t},sortField(t){this.d_sortField=t},sortOrder(t){this.d_sortOrder=t},multiSortMeta(t){this.d_multiSortMeta=t},selection:{immediate:!0,handler(t){this.dataKey&&this.updateSelectionKeys(t)}},expandedRows(t){this.dataKey&&this.updateExpandedRowKeys(t)},editingRows(t){this.dataKey&&this.updateEditingRowKeys(t)},filters:{deep:!0,handler:function(t){this.d_filters=this.cloneFilters(t)}}},beforeMount(){this.isStateful()&&this.restoreState()},mounted(){this.$el.setAttribute(this.attributeSelector,""),this.responsiveLayout==="stack"&&!this.scrollable&&this.createResponsiveStyle(),this.isStateful()&&this.resizableColumns&&this.restoreColumnWidths(),this.editMode==="row"&&this.dataKey&&!this.d_editingRowKeys&&this.updateEditingRowKeys(this.editingRows)},beforeUnmount(){this.unbindColumnResizeEvents(),this.destroyStyleElement(),this.destroyResponsiveStyle()},updated(){this.isStateful()&&this.saveState(),this.editMode==="row"&&this.dataKey&&!this.d_editingRowKeys&&this.updateEditingRowKeys(this.editingRows)},methods:{columnProp(t,e){return ft.getVNodeProp(t,e)},onPage(t){this.clearEditingMetaData(),this.d_first=t.first,this.d_rows=t.rows;let e=this.createLazyLoadEvent(t);e.pageCount=t.pageCount,e.page=t.page,this.$emit("update:first",this.d_first),this.$emit("update:rows",this.d_rows),this.$emit("page",e),this.$emit("value-change",this.processedData)},onColumnHeaderClick(t){const e=t.originalEvent,i=t.column;if(this.columnProp(i,"sortable")){const n=e.target,r=this.columnProp(i,"sortField")||this.columnProp(i,"field");(He.hasClass(n,"p-sortable-column")||He.hasClass(n,"p-column-title")||He.hasClass(n,"p-column-header-content")||He.hasClass(n,"p-sortable-column-icon")||He.hasClass(n.parentElement,"p-sortable-column-icon"))&&(He.clearSelection(),this.sortMode==="single"?(this.d_sortField===r?this.removableSort&&this.d_sortOrder*-1===this.defaultSortOrder?(this.d_sortOrder=null,this.d_sortField=null):this.d_sortOrder=this.d_sortOrder*-1:(this.d_sortOrder=this.defaultSortOrder,this.d_sortField=r),this.$emit("update:sortField",this.d_sortField),this.$emit("update:sortOrder",this.d_sortOrder),this.resetPage()):this.sortMode==="multiple"&&(e.metaKey||e.ctrlKey||(this.d_multiSortMeta=this.d_multiSortMeta.filter(o=>o.field===r)),this.addMultiSortField(r),this.$emit("update:multiSortMeta",this.d_multiSortMeta)),this.$emit("sort",this.createLazyLoadEvent(e)),this.$emit("value-change",this.processedData))}},sortSingle(t){if(this.clearEditingMetaData(),this.groupRowsBy&&this.groupRowsBy===this.sortField)return this.d_multiSortMeta=[{field:this.sortField,order:this.sortOrder||this.defaultSortOrder},{field:this.d_sortField,order:this.d_sortOrder}],this.sortMultiple(t);let e=[...t];return e.sort((i,n)=>{let r=ft.resolveFieldData(i,this.d_sortField),s=ft.resolveFieldData(n,this.d_sortField),o=null;return r==null&&s!=null?o=-1:r!=null&&s==null?o=1:r==null&&s==null?o=0:typeof r=="string"&&typeof s=="string"?o=r.localeCompare(s,void 0,{numeric:!0}):o=rs?1:0,this.d_sortOrder*o}),e},sortMultiple(t){if(this.clearEditingMetaData(),this.groupRowsBy&&(this.d_groupRowsSortMeta||this.d_multiSortMeta.length&&this.groupRowsBy===this.d_multiSortMeta[0].field)){const i=this.d_multiSortMeta[0];!this.d_groupRowsSortMeta&&(this.d_groupRowsSortMeta=i),i.field!==this.d_groupRowsSortMeta.field&&(this.d_multiSortMeta=[this.d_groupRowsSortMeta,...this.d_multiSortMeta])}let e=[...t];return e.sort((i,n)=>this.multisortField(i,n,0)),e},multisortField(t,e,i){const n=ft.resolveFieldData(t,this.d_multiSortMeta[i].field),r=ft.resolveFieldData(e,this.d_multiSortMeta[i].field);let s=null;if(typeof n=="string"||n instanceof String){if(n.localeCompare&&n!==r)return this.d_multiSortMeta[i].order*n.localeCompare(r,void 0,{numeric:!0})}else s=ni?this.multisortField(t,e,i+1):0:this.d_multiSortMeta[i].order*s},addMultiSortField(t){let e=this.d_multiSortMeta.findIndex(i=>i.field===t);e>=0?this.removableSort&&this.d_multiSortMeta[e].order*-1===this.defaultSortOrder?this.d_multiSortMeta.splice(e,1):this.d_multiSortMeta[e]={field:t,order:this.d_multiSortMeta[e].order*-1}:this.d_multiSortMeta.push({field:t,order:this.defaultSortOrder}),this.d_multiSortMeta=[...this.d_multiSortMeta]},filter(t){if(!t)return;this.clearEditingMetaData();let e;this.filters.global&&(e=this.globalFilterFields||this.columns.map(r=>this.columnProp(r,"filterField")||this.columnProp(r,"field")));let i=[];for(let r=0;rP!=g);this.$emit("update:selection",y)}this.$emit("row-unselect",{originalEvent:e,data:s,index:o,type:"row"})}else{if(this.isSingleSelectionMode())this.$emit("update:selection",s);else if(this.isMultipleSelectionMode()){let g=p?this.selection||[]:[];g=[...g,s],this.$emit("update:selection",g)}this.$emit("row-select",{originalEvent:e,data:s,index:o,type:"row"})}}else if(this.selectionMode==="single")u?(this.$emit("update:selection",null),this.$emit("row-unselect",{originalEvent:e,data:s,index:o,type:"row"})):(this.$emit("update:selection",s),this.$emit("row-select",{originalEvent:e,data:s,index:o,type:"row"}));else if(this.selectionMode==="multiple")if(u){const p=this.findIndexInSelection(s),g=this.selection.filter((y,S)=>S!=p);this.$emit("update:selection",g),this.$emit("row-unselect",{originalEvent:e,data:s,index:o,type:"row"})}else{const p=this.selection?[...this.selection,s]:[s];this.$emit("update:selection",p),this.$emit("row-select",{originalEvent:e,data:s,index:o,type:"row"})}}}this.rowTouched=!1,r&&(r.tabIndex="-1",He.find(n,"tr.p-selectable-row")[i].tabIndex="0")}},onRowDblClick(t){const e=t.originalEvent;He.isClickable(e.target)||this.$emit("row-dblclick",t)},onRowRightClick(t){He.clearSelection(),t.originalEvent.target.focus(),this.$emit("update:contextMenuSelection",t.data),this.$emit("row-contextmenu",t)},onRowTouchEnd(){this.rowTouched=!0},onRowKeyDown(t,e){const i=t.originalEvent,n=t.data,r=t.index,s=i.metaKey||i.ctrlKey;if(this.selectionMode){const o=i.target;switch(i.code){case"ArrowDown":this.onArrowDownKey(i,o,r,e);break;case"ArrowUp":this.onArrowUpKey(i,o,r,e);break;case"Home":this.onHomeKey(i,o,r,e);break;case"End":this.onEndKey(i,o,r,e);break;case"Enter":this.onEnterKey(i,n,r);break;case"Space":this.onSpaceKey(i,n,r,e);break;case"Tab":this.onTabKey(i,r);break;default:if(i.code==="KeyA"&&s){const u=this.dataToRender(e.rows);this.$emit("update:selection",u)}break}}},onArrowDownKey(t,e,i,n){const r=this.findNextSelectableRow(e);if(r&&this.focusRowChange(e,r),t.shiftKey){const s=this.dataToRender(n.rows),o=i+1>=s.length?s.length-1:i+1;this.onRowClick({originalEvent:t,data:s[o],index:o})}t.preventDefault()},onArrowUpKey(t,e,i,n){const r=this.findPrevSelectableRow(e);if(r&&this.focusRowChange(e,r),t.shiftKey){const s=this.dataToRender(n.rows),o=i-1<=0?0:i-1;this.onRowClick({originalEvent:t,data:s[o],index:o})}t.preventDefault()},onHomeKey(t,e,i,n){const r=this.findFirstSelectableRow();if(r&&this.focusRowChange(e,r),t.ctrlKey&&t.shiftKey){const s=this.dataToRender(n.rows);this.$emit("update:selection",s.slice(0,i+1))}t.preventDefault()},onEndKey(t,e,i,n){const r=this.findLastSelectableRow();if(r&&this.focusRowChange(e,r),t.ctrlKey&&t.shiftKey){const s=this.dataToRender(n.rows);this.$emit("update:selection",s.slice(i,s.length))}t.preventDefault()},onEnterKey(t,e,i){this.onRowClick({originalEvent:t,data:e,index:i}),t.preventDefault()},onSpaceKey(t,e,i,n){if(this.onEnterKey(t,e,i),t.shiftKey&&this.selection!==null){const r=this.dataToRender(n.rows);let s;if(this.selection.length>0){let u,h;u=ft.findIndexInList(this.selection[0],r),h=ft.findIndexInList(this.selection[this.selection.length-1],r),s=i<=u?h:u}else s=ft.findIndexInList(this.selection,r);const o=s!==i?r.slice(Math.min(s,i),Math.max(s,i)+1):e;this.$emit("update:selection",o)}},onTabKey(t,e){const i=this.$refs.bodyRef&&this.$refs.bodyRef.$el,n=He.find(i,"tr.p-selectable-row");if(t.code==="Tab"&&n&&n.length>0){const r=He.findSingle(i,"tr.p-highlight"),s=He.findSingle(i,'tr.p-selectable-row[tabindex="0"]');r?(r.tabIndex="0",s&&s!==r&&(s.tabIndex="-1")):(n[0].tabIndex="0",s!==n[0]&&(n[e].tabIndex="-1"))}},findNextSelectableRow(t){let e=t.nextElementSibling;return e?He.hasClass(e,"p-selectable-row")?e:this.findNextSelectableRow(e):null},findPrevSelectableRow(t){let e=t.previousElementSibling;return e?He.hasClass(e,"p-selectable-row")?e:this.findPrevSelectableRow(e):null},findFirstSelectableRow(){return He.findSingle(this.$refs.table,".p-selectable-row")},findLastSelectableRow(){const t=He.find(this.$refs.table,".p-selectable-row");return t?t[t.length-1]:null},focusRowChange(t,e){t.tabIndex="-1",e.tabIndex="0",He.focus(e)},toggleRowWithRadio(t){const e=t.data;this.isSelected(e)?(this.$emit("update:selection",null),this.$emit("row-unselect",{originalEvent:t.originalEvent,data:e,index:t.index,type:"radiobutton"})):(this.$emit("update:selection",e),this.$emit("row-select",{originalEvent:t.originalEvent,data:e,index:t.index,type:"radiobutton"}))},toggleRowWithCheckbox(t){const e=t.data;if(this.isSelected(e)){const i=this.findIndexInSelection(e),n=this.selection.filter((r,s)=>s!=i);this.$emit("update:selection",n),this.$emit("row-unselect",{originalEvent:t.originalEvent,data:e,index:t.index,type:"checkbox"})}else{let i=this.selection?[...this.selection]:[];i=[...i,e],this.$emit("update:selection",i),this.$emit("row-select",{originalEvent:t.originalEvent,data:e,index:t.index,type:"checkbox"})}},toggleRowsWithCheckbox(t){if(this.selectAll!==null)this.$emit("select-all-change",t);else{const{originalEvent:e,checked:i}=t;let n=[];i?(n=this.frozenValue?[...this.frozenValue,...this.processedData]:this.processedData,this.$emit("row-select-all",{originalEvent:e,data:n})):this.$emit("row-unselect-all",{originalEvent:e}),this.$emit("update:selection",n)}},isSingleSelectionMode(){return this.selectionMode==="single"},isMultipleSelectionMode(){return this.selectionMode==="multiple"},isSelected(t){return t&&this.selection?this.dataKey?this.d_selectionKeys?this.d_selectionKeys[ft.resolveFieldData(t,this.dataKey)]!==void 0:!1:this.selection instanceof Array?this.findIndexInSelection(t)>-1:this.equals(t,this.selection):!1},findIndexInSelection(t){return this.findIndex(t,this.selection)},findIndex(t,e){let i=-1;if(e&&e.length){for(let n=0;nthis.anchorRowIndex?(e=this.anchorRowIndex,i=this.rangeRowIndex):this.rangeRowIndex{i+=` `;let o=!1;for(let u=0;uparseInt(n,10)){if(this.columnResizeMode==="fit"){let s=this.resizeColumnElement.nextElementSibling.offsetWidth-t;i>15&&s>15&&this.resizeTableCells(i,s)}else if(this.columnResizeMode==="expand"){const r=this.$refs.table.offsetWidth+t+"px",s=o=>{o&&(o.style.width=o.style.minWidth=r)};if(s(this.$refs.table),!this.virtualScrollerDisabled){const o=this.$refs.bodyRef&&this.$refs.bodyRef.$el,u=this.$refs.frozenBodyRef&&this.$refs.frozenBodyRef.$el;s(o),s(u)}this.resizeTableCells(i)}this.$emit("column-resize-end",{element:this.resizeColumnElement,delta:t})}this.$refs.resizeHelper.style.display="none",this.resizeColumn=null,He.removeClass(this.$el,"p-unselectable-text"),this.unbindColumnResizeEvents(),this.isStateful()&&this.saveState()},resizeTableCells(t,e){let i=He.index(this.resizeColumnElement),n=[];He.find(this.$refs.table,".p-datatable-thead > tr > th").forEach(u=>n.push(He.getOuterWidth(u))),this.destroyStyleElement(),this.createStyleElement();let s="",o=`.p-datatable[${this.attributeSelector}] > .p-datatable-wrapper ${this.virtualScrollerDisabled?"":"> .p-virtualscroller"} > .p-datatable-table`;n.forEach((u,h)=>{let p=h===i?t:e&&h===i+1?e:u,g=`width: ${p}px !important; max-width: ${p}px !important`;s+=` ${o} > .p-datatable-thead > tr > th:nth-child(${h+1}), ${o} > .p-datatable-tbody > tr > td:nth-child(${h+1}), ${o} > .p-datatable-tfoot > tr > td:nth-child(${h+1}) { ${g} } `}),this.styleElement.innerHTML=s},bindColumnResizeEvents(){this.documentColumnResizeListener||(this.documentColumnResizeListener=document.addEventListener("mousemove",()=>{this.columnResizing&&this.onColumnResize(event)})),this.documentColumnResizeEndListener||(this.documentColumnResizeEndListener=document.addEventListener("mouseup",()=>{this.columnResizing&&(this.columnResizing=!1,this.onColumnResizeEnd())}))},unbindColumnResizeEvents(){this.documentColumnResizeListener&&(document.removeEventListener("document",this.documentColumnResizeListener),this.documentColumnResizeListener=null),this.documentColumnResizeEndListener&&(document.removeEventListener("document",this.documentColumnResizeEndListener),this.documentColumnResizeEndListener=null)},onColumnHeaderMouseDown(t){const e=t.originalEvent,i=t.column;this.reorderableColumns&&this.columnProp(i,"reorderableColumn")!==!1&&(e.target.nodeName==="INPUT"||e.target.nodeName==="TEXTAREA"||He.hasClass(e.target,"p-column-resizer")?e.currentTarget.draggable=!1:e.currentTarget.draggable=!0)},onColumnHeaderDragStart(t){if(this.columnResizing){t.preventDefault();return}this.colReorderIconWidth=He.getHiddenElementOuterWidth(this.$refs.reorderIndicatorUp),this.colReorderIconHeight=He.getHiddenElementOuterHeight(this.$refs.reorderIndicatorUp),this.draggedColumn=this.findParentHeader(t.target),t.dataTransfer.setData("text","b")},onColumnHeaderDragOver(t){let e=this.findParentHeader(t.target);if(this.reorderableColumns&&this.draggedColumn&&e){t.preventDefault();let i=He.getOffset(this.$el),n=He.getOffset(e);if(this.draggedColumn!==e){let r=n.left-i.left,s=n.left+e.offsetWidth/2;this.$refs.reorderIndicatorUp.style.top=n.top-i.top-(this.colReorderIconHeight-1)+"px",this.$refs.reorderIndicatorDown.style.top=n.top-i.top+e.offsetHeight+"px",t.pageX>s?(this.$refs.reorderIndicatorUp.style.left=r+e.offsetWidth-Math.ceil(this.colReorderIconWidth/2)+"px",this.$refs.reorderIndicatorDown.style.left=r+e.offsetWidth-Math.ceil(this.colReorderIconWidth/2)+"px",this.dropPosition=1):(this.$refs.reorderIndicatorUp.style.left=r-Math.ceil(this.colReorderIconWidth/2)+"px",this.$refs.reorderIndicatorDown.style.left=r-Math.ceil(this.colReorderIconWidth/2)+"px",this.dropPosition=-1),this.$refs.reorderIndicatorUp.style.display="block",this.$refs.reorderIndicatorDown.style.display="block"}}},onColumnHeaderDragLeave(t){this.reorderableColumns&&this.draggedColumn&&(t.preventDefault(),this.$refs.reorderIndicatorUp.style.display="none",this.$refs.reorderIndicatorDown.style.display="none")},onColumnHeaderDrop(t){if(t.preventDefault(),this.draggedColumn){let e=He.index(this.draggedColumn),i=He.index(this.findParentHeader(t.target)),n=e!==i;n&&(i-e===1&&this.dropPosition===-1||i-e===-1&&this.dropPosition===1)&&(n=!1),n&&(ft.reorderArray(this.columns,e,i),this.updateReorderableColumns(),this.$emit("column-reorder",{originalEvent:t,dragIndex:e,dropIndex:i})),this.$refs.reorderIndicatorUp.style.display="none",this.$refs.reorderIndicatorDown.style.display="none",this.draggedColumn.draggable=!1,this.draggedColumn=null,this.dropPosition=null}},findParentHeader(t){if(t.nodeName==="TH")return t;{let e=t.parentElement;for(;e.nodeName!=="TH"&&(e=e.parentElement,!!e););return e}},findColumnByKey(t,e){if(t&&t.length)for(let i=0;ithis.droppedRowIndex?this.droppedRowIndex:this.droppedRowIndex===0?0:this.droppedRowIndex-1,i=[...this.processedData];ft.reorderArray(i,this.draggedRowIndex+this.d_first,e+this.d_first),this.$emit("row-reorder",{originalEvent:t,dragIndex:this.draggedRowIndex,dropIndex:e,value:i})}this.onRowDragLeave(t),this.onRowDragEnd(t),t.preventDefault()},toggleRow(t){let e=t.data,i,n,r=this.expandedRows?[...this.expandedRows]:[];this.dataKey?i=this.d_expandedRowKeys?this.d_expandedRowKeys[ft.resolveFieldData(e,this.dataKey)]!==void 0:!1:(n=this.findIndex(e,this.expandedRows),i=n>-1),i?(n==null&&(n=this.findIndex(e,this.expandedRows)),r.splice(n,1),this.$emit("update:expandedRows",r),this.$emit("row-collapse",t)):(r.push(e),this.$emit("update:expandedRows",r),this.$emit("row-expand",t))},toggleRowGroup(t){const e=t.originalEvent,i=t.data,n=ft.resolveFieldData(i,this.groupRowsBy);let r=this.expandedRowGroups?[...this.expandedRowGroups]:[];this.isRowGroupExpanded(i)?(r=r.filter(s=>s!==n),this.$emit("update:expandedRowGroups",r),this.$emit("rowgroup-collapse",{originalEvent:e,data:n})):(r.push(n),this.$emit("update:expandedRowGroups",r),this.$emit("rowgroup-expand",{originalEvent:e,data:n}))},isRowGroupExpanded(t){if(this.expandableRowGroups&&this.expandedRowGroups){let e=ft.resolveFieldData(t,this.groupRowsBy);return this.expandedRowGroups.indexOf(e)>-1}return!1},isStateful(){return this.stateKey!=null},getStorage(){switch(this.stateStorage){case"local":return window.localStorage;case"session":return window.sessionStorage;default:throw new Error(this.stateStorage+' is not a valid value for the state storage, supported values are "local" and "session".')}},saveState(){const t=this.getStorage();let e={};this.paginator&&(e.first=this.d_first,e.rows=this.d_rows),this.d_sortField&&(e.sortField=this.d_sortField,e.sortOrder=this.d_sortOrder),this.d_multiSortMeta&&(e.multiSortMeta=this.d_multiSortMeta),this.hasFilters&&(e.filters=this.filters),this.resizableColumns&&this.saveColumnWidths(e),this.reorderableColumns&&(e.columnOrder=this.d_columnOrder),this.expandedRows&&(e.expandedRows=this.expandedRows,e.expandedRowKeys=this.d_expandedRowKeys),this.expandedRowGroups&&(e.expandedRowGroups=this.expandedRowGroups),this.selection&&(e.selection=this.selection,e.selectionKeys=this.d_selectionKeys),Object.keys(e).length&&t.setItem(this.stateKey,JSON.stringify(e)),this.$emit("state-save",e)},restoreState(){const e=this.getStorage().getItem(this.stateKey),i=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/,n=function(r,s){return typeof s=="string"&&i.test(s)?new Date(s):s};if(e){let r=JSON.parse(e,n);this.paginator&&(this.d_first=r.first,this.d_rows=r.rows),r.sortField&&(this.d_sortField=r.sortField,this.d_sortOrder=r.sortOrder),r.multiSortMeta&&(this.d_multiSortMeta=r.multiSortMeta),r.filters&&this.$emit("update:filters",r.filters),this.resizableColumns&&(this.columnWidthsState=r.columnWidths,this.tableWidthState=r.tableWidth),this.reorderableColumns&&(this.d_columnOrder=r.columnOrder),r.expandedRows&&(this.d_expandedRowKeys=r.expandedRowKeys,this.$emit("update:expandedRows",r.expandedRows)),r.expandedRowGroups&&this.$emit("update:expandedRowGroups",r.expandedRowGroups),r.selection&&(this.d_selectionKeys=r.d_selectionKeys,this.$emit("update:selection",r.selection)),this.$emit("state-restore",r)}},saveColumnWidths(t){let e=[];He.find(this.$el,".p-datatable-thead > tr > th").forEach(n=>e.push(He.getOuterWidth(n))),t.columnWidths=e.join(","),this.columnResizeMode==="expand"&&(t.tableWidth=He.getOuterWidth(this.$refs.table)+"px")},restoreColumnWidths(){if(this.columnWidthsState){let t=this.columnWidthsState.split(",");if(this.columnResizeMode==="expand"&&this.tableWidthState&&(this.$refs.table.style.width=this.tableWidthState,this.$refs.table.style.minWidth=this.tableWidthState,this.$el.style.width=this.tableWidthState),ft.isNotEmpty(t)){this.createStyleElement();let e="",i=`.p-datatable[${this.attributeSelector}] > .p-datatable-wrapper ${this.virtualScrollerDisabled?"":"> .p-virtualscroller"} > .p-datatable-table`;t.forEach((n,r)=>{let s=`width: ${n}px !important; max-width: ${n}px !important`;e+=` ${i} > .p-datatable-thead > tr > th:nth-child(${r+1}), ${i} > .p-datatable-tbody > tr > td:nth-child(${r+1}), ${i} > .p-datatable-tfoot > tr > td:nth-child(${r+1}) { ${s} } `}),this.styleElement.innerHTML=e}}},onCellEditInit(t){this.$emit("cell-edit-init",t)},onCellEditComplete(t){this.$emit("cell-edit-complete",t)},onCellEditCancel(t){this.$emit("cell-edit-cancel",t)},onRowEditInit(t){let e=this.editingRows?[...this.editingRows]:[];e.push(t.data),this.$emit("update:editingRows",e),this.$emit("row-edit-init",t)},onRowEditSave(t){let e=[...this.editingRows];e.splice(this.findIndex(t.data,e),1),this.$emit("update:editingRows",e),this.$emit("row-edit-save",t)},onRowEditCancel(t){let e=[...this.editingRows];e.splice(this.findIndex(t.data,e),1),this.$emit("update:editingRows",e),this.$emit("row-edit-cancel",t)},onEditingMetaChange(t){let{data:e,field:i,index:n,editing:r}=t,s={...this.d_editingMeta},o=s[n];if(r)!o&&(o=s[n]={data:{...e},fields:[]}),o.fields.push(i);else if(o){const u=o.fields.filter(h=>h!==i);u.length?o.fields=u:delete s[n]}this.d_editingMeta=s},clearEditingMetaData(){this.editMode&&(this.d_editingMeta={})},createLazyLoadEvent(t){return{originalEvent:t,first:this.d_first,rows:this.d_rows,sortField:this.d_sortField,sortOrder:this.d_sortOrder,multiSortMeta:this.d_multiSortMeta,filters:this.d_filters}},hasGlobalFilter(){return this.filters&&Object.prototype.hasOwnProperty.call(this.filters,"global")},getChildren(){return this.$slots.default?this.$slots.default():null},onFilterChange(t){this.d_filters=t},onFilterApply(){this.d_first=0,this.$emit("update:first",this.d_first),this.$emit("update:filters",this.d_filters),this.lazy&&this.$emit("filter",this.createLazyLoadEvent())},cloneFilters(){let t={};return this.filters&&Object.entries(this.filters).forEach(([e,i])=>{t[e]=i.operator?{operator:i.operator,constraints:i.constraints.map(n=>({...n}))}:{...i}}),t},updateReorderableColumns(){let t=[];this.columns.forEach(e=>t.push(this.columnProp(e,"columnKey")||this.columnProp(e,"field"))),this.d_columnOrder=t},createStyleElement(){this.styleElement=document.createElement("style"),this.styleElement.type="text/css",document.head.appendChild(this.styleElement)},createResponsiveStyle(){if(!this.responsiveStyleElement){this.responsiveStyleElement=document.createElement("style"),this.responsiveStyleElement.type="text/css",document.head.appendChild(this.responsiveStyleElement);let t=`.p-datatable-wrapper ${this.virtualScrollerDisabled?"":"> .p-virtualscroller"} > .p-datatable-table`,e=`.p-datatable[${this.attributeSelector}] > ${t}`,i=`.p-datatable[${this.attributeSelector}].p-datatable-gridlines > ${t}`,n=` @media screen and (max-width: ${this.breakpoint}) { ${e} > .p-datatable-thead > tr > th, ${e} > .p-datatable-tfoot > tr > td { display: none !important; } ${e} > .p-datatable-tbody > tr > td { display: flex; width: 100% !important; align-items: center; justify-content: space-between; } ${e} > .p-datatable-tbody > tr > td:not(:last-child) { border: 0 none; } ${i} > .p-datatable-tbody > tr > td:last-child { border-top: 0; border-right: 0; border-left: 0; } ${e} > .p-datatable-tbody > tr > td > .p-column-title { display: block; } } `;this.responsiveStyleElement.innerHTML=n}},destroyResponsiveStyle(){this.responsiveStyleElement&&(document.head.removeChild(this.responsiveStyleElement),this.responsiveStyleElement=null)},destroyStyleElement(){this.styleElement&&(document.head.removeChild(this.styleElement),this.styleElement=null)},recursiveGetChildren(t,e){return e||(e=[]),t&&t.length&&t.forEach(i=>{i.children instanceof Array?e.concat(this.recursiveGetChildren(i.children,e)):i.type.name=="Column"&&e.push(i)}),e},dataToRender(t){const e=t||this.processedData;if(e&&this.paginator){const i=this.lazy?0:this.d_first;return e.slice(i,i+this.d_rows)}return e},getVirtualScrollerRef(){return this.$refs.virtualScroller},hasSpacerStyle(t){return ft.isNotEmpty(t)}},computed:{containerClass(){return["p-datatable p-component",{"p-datatable-hoverable-rows":this.rowHover||this.selectionMode,"p-datatable-resizable":this.resizableColumns,"p-datatable-resizable-fit":this.resizableColumns&&this.columnResizeMode==="fit","p-datatable-scrollable":this.scrollable,"p-datatable-flex-scrollable":this.scrollable&&this.scrollHeight==="flex","p-datatable-responsive-stack":this.responsiveLayout==="stack","p-datatable-responsive-scroll":this.responsiveLayout==="scroll","p-datatable-striped":this.stripedRows,"p-datatable-gridlines":this.showGridlines,"p-datatable-grouped-header":this.headerColumnGroup!=null,"p-datatable-grouped-footer":this.footerColumnGroup!=null}]},tableStyleClass(){return["p-datatable-table",{"p-datatable-scrollable-table":this.scrollable,"p-datatable-resizable-table":this.resizableColumns,"p-datatable-resizable-table-fit":this.resizableColumns&&this.columnResizeMode==="fit"},this.tableClass]},columns(){let t=this.getChildren();if(!t)return;const e=this.recursiveGetChildren(t,[]);if(this.reorderableColumns&&this.d_columnOrder){let i=[];for(let n of this.d_columnOrder){let r=this.findColumnByKey(e,n);r&&!this.columnProp(r,"hidden")&&i.push(r)}return[...i,...e.filter(n=>i.indexOf(n)<0)]}return e},headerColumnGroup(){const t=this.getChildren();if(t){for(let e of t)if(e.type.name==="ColumnGroup"&&this.columnProp(e,"type")==="header")return e}return null},footerColumnGroup(){const t=this.getChildren();if(t){for(let e of t)if(e.type.name==="ColumnGroup"&&this.columnProp(e,"type")==="footer")return e}return null},hasFilters(){return this.filters&&Object.keys(this.filters).length>0&&this.filters.constructor===Object},processedData(){let t=this.value||[];return this.lazy||t&&t.length&&(this.hasFilters&&(t=this.filter(t)),this.sorted&&(this.sortMode==="single"?t=this.sortSingle(t):this.sortMode==="multiple"&&(t=this.sortMultiple(t)))),t},totalRecordsLength(){if(this.lazy)return this.totalRecords;{const t=this.processedData;return t?t.length:0}},empty(){const t=this.processedData;return!t||t.length===0},paginatorTop(){return this.paginator&&(this.paginatorPosition!=="bottom"||this.paginatorPosition==="both")},paginatorBottom(){return this.paginator&&(this.paginatorPosition!=="top"||this.paginatorPosition==="both")},sorted(){return this.d_sortField||this.d_multiSortMeta&&this.d_multiSortMeta.length>0},loadingIconClass(){return["p-datatable-loading-icon pi-spin",this.loadingIcon]},allRowsSelected(){if(this.selectAll!==null)return this.selectAll;{const t=this.frozenValue?[...this.frozenValue,...this.processedData]:this.processedData;return ft.isNotEmpty(t)&&this.selection&&Array.isArray(this.selection)&&t.every(e=>this.selection.some(i=>this.equals(i,e)))}},attributeSelector(){return ks()},groupRowSortField(){return this.sortMode==="single"?this.sortField:this.d_groupRowsSortMeta?this.d_groupRowsSortMeta.field:null},virtualScrollerDisabled(){return ft.isEmpty(this.virtualScrollerOptions)||!this.scrollable}},components:{DTPaginator:PC,DTTableHeader:HC,DTTableBody:MC,DTTableFooter:NC,DTVirtualScroller:Ug}};const m8={key:0,class:"p-datatable-loading-overlay p-component-overlay"},g8={key:1,class:"p-datatable-header"},y8={key:3,class:"p-datatable-footer"},v8={ref:"resizeHelper",class:"p-column-resizer-helper",style:{display:"none"}},b8={key:5,ref:"reorderIndicatorUp",class:"pi pi-arrow-down p-datatable-reorder-indicator-up",style:{position:"absolute",display:"none"}},_8={key:6,ref:"reorderIndicatorDown",class:"pi pi-arrow-up p-datatable-reorder-indicator-down",style:{position:"absolute",display:"none"}};function w8(t,e,i,n,r,s){const o=Mt("DTPaginator"),u=Mt("DTTableHeader"),h=Mt("DTTableBody"),p=Mt("DTTableFooter"),g=Mt("DTVirtualScroller");return X(),se("div",{class:Tt(s.containerClass),"data-scrollselectors":".p-datatable-wrapper"},[pi(t.$slots,"default"),i.loading?(X(),se("div",m8,[t.$slots.loading?pi(t.$slots,"loading",{key:0}):(X(),se("i",{key:1,class:Tt(s.loadingIconClass)},null,2))])):Be("",!0),t.$slots.header?(X(),se("div",g8,[pi(t.$slots,"header")])):Be("",!0),s.paginatorTop?(X(),gt(o,{key:2,rows:r.d_rows,first:r.d_first,totalRecords:s.totalRecordsLength,pageLinkSize:i.pageLinkSize,template:i.paginatorTemplate,rowsPerPageOptions:i.rowsPerPageOptions,currentPageReportTemplate:i.currentPageReportTemplate,class:"p-paginator-top",onPage:e[0]||(e[0]=y=>s.onPage(y)),alwaysShow:i.alwaysShowPaginator},bg({_:2},[t.$slots.paginatorstart?{name:"start",fn:Vt(()=>[pi(t.$slots,"paginatorstart")]),key:"0"}:void 0,t.$slots.paginatorend?{name:"end",fn:Vt(()=>[pi(t.$slots,"paginatorend")]),key:"1"}:void 0]),1032,["rows","first","totalRecords","pageLinkSize","template","rowsPerPageOptions","currentPageReportTemplate","alwaysShow"])):Be("",!0),Se("div",{class:"p-datatable-wrapper",style:Ri({maxHeight:s.virtualScrollerDisabled?i.scrollHeight:""})},[xt(g,Qi({ref:"virtualScroller"},i.virtualScrollerOptions,{items:s.processedData,columns:s.columns,style:i.scrollHeight!=="flex"?{height:i.scrollHeight}:void 0,scrollHeight:i.scrollHeight!=="flex"?void 0:"100%",disabled:s.virtualScrollerDisabled,loaderDisabled:"",inline:"",autoSize:"",showSpacer:!1}),{content:Vt(y=>[Se("table",Qi({ref:"table",role:"table",class:s.tableStyleClass,style:[i.tableStyle,y.spacerStyle]},i.tableProps),[xt(u,{columnGroup:s.headerColumnGroup,columns:y.columns,rowGroupMode:i.rowGroupMode,groupRowsBy:i.groupRowsBy,groupRowSortField:s.groupRowSortField,reorderableColumns:i.reorderableColumns,resizableColumns:i.resizableColumns,allRowsSelected:s.allRowsSelected,empty:s.empty,sortMode:i.sortMode,sortField:r.d_sortField,sortOrder:r.d_sortOrder,multiSortMeta:r.d_multiSortMeta,filters:r.d_filters,filtersStore:i.filters,filterDisplay:i.filterDisplay,filterInputProps:i.filterInputProps,onColumnClick:e[1]||(e[1]=S=>s.onColumnHeaderClick(S)),onColumnMousedown:e[2]||(e[2]=S=>s.onColumnHeaderMouseDown(S)),onFilterChange:s.onFilterChange,onFilterApply:s.onFilterApply,onColumnDragstart:e[3]||(e[3]=S=>s.onColumnHeaderDragStart(S)),onColumnDragover:e[4]||(e[4]=S=>s.onColumnHeaderDragOver(S)),onColumnDragleave:e[5]||(e[5]=S=>s.onColumnHeaderDragLeave(S)),onColumnDrop:e[6]||(e[6]=S=>s.onColumnHeaderDrop(S)),onColumnResizestart:e[7]||(e[7]=S=>s.onColumnResizeStart(S)),onCheckboxChange:e[8]||(e[8]=S=>s.toggleRowsWithCheckbox(S))},null,8,["columnGroup","columns","rowGroupMode","groupRowsBy","groupRowSortField","reorderableColumns","resizableColumns","allRowsSelected","empty","sortMode","sortField","sortOrder","multiSortMeta","filters","filtersStore","filterDisplay","filterInputProps","onFilterChange","onFilterApply"]),i.frozenValue?(X(),gt(h,{key:0,ref:"frozenBodyRef",value:i.frozenValue,frozenRow:!0,class:"p-datatable-frozen-tbody",columns:y.columns,first:r.d_first,dataKey:i.dataKey,selection:i.selection,selectionKeys:r.d_selectionKeys,selectionMode:i.selectionMode,contextMenu:i.contextMenu,contextMenuSelection:i.contextMenuSelection,rowGroupMode:i.rowGroupMode,groupRowsBy:i.groupRowsBy,expandableRowGroups:i.expandableRowGroups,rowClass:i.rowClass,rowStyle:i.rowStyle,editMode:i.editMode,compareSelectionBy:i.compareSelectionBy,scrollable:i.scrollable,expandedRowIcon:i.expandedRowIcon,collapsedRowIcon:i.collapsedRowIcon,expandedRows:i.expandedRows,expandedRowKeys:r.d_expandedRowKeys,expandedRowGroups:i.expandedRowGroups,editingRows:i.editingRows,editingRowKeys:r.d_editingRowKeys,templates:t.$slots,responsiveLayout:i.responsiveLayout,isVirtualScrollerDisabled:!0,onRowgroupToggle:s.toggleRowGroup,onRowClick:e[9]||(e[9]=S=>s.onRowClick(S)),onRowDblclick:e[10]||(e[10]=S=>s.onRowDblClick(S)),onRowRightclick:e[11]||(e[11]=S=>s.onRowRightClick(S)),onRowTouchend:s.onRowTouchEnd,onRowKeydown:s.onRowKeyDown,onRowMousedown:s.onRowMouseDown,onRowDragstart:e[12]||(e[12]=S=>s.onRowDragStart(S)),onRowDragover:e[13]||(e[13]=S=>s.onRowDragOver(S)),onRowDragleave:e[14]||(e[14]=S=>s.onRowDragLeave(S)),onRowDragend:e[15]||(e[15]=S=>s.onRowDragEnd(S)),onRowDrop:e[16]||(e[16]=S=>s.onRowDrop(S)),onRowToggle:e[17]||(e[17]=S=>s.toggleRow(S)),onRadioChange:e[18]||(e[18]=S=>s.toggleRowWithRadio(S)),onCheckboxChange:e[19]||(e[19]=S=>s.toggleRowWithCheckbox(S)),onCellEditInit:e[20]||(e[20]=S=>s.onCellEditInit(S)),onCellEditComplete:e[21]||(e[21]=S=>s.onCellEditComplete(S)),onCellEditCancel:e[22]||(e[22]=S=>s.onCellEditCancel(S)),onRowEditInit:e[23]||(e[23]=S=>s.onRowEditInit(S)),onRowEditSave:e[24]||(e[24]=S=>s.onRowEditSave(S)),onRowEditCancel:e[25]||(e[25]=S=>s.onRowEditCancel(S)),editingMeta:r.d_editingMeta,onEditingMetaChange:s.onEditingMetaChange},null,8,["value","columns","first","dataKey","selection","selectionKeys","selectionMode","contextMenu","contextMenuSelection","rowGroupMode","groupRowsBy","expandableRowGroups","rowClass","rowStyle","editMode","compareSelectionBy","scrollable","expandedRowIcon","collapsedRowIcon","expandedRows","expandedRowKeys","expandedRowGroups","editingRows","editingRowKeys","templates","responsiveLayout","onRowgroupToggle","onRowTouchend","onRowKeydown","onRowMousedown","editingMeta","onEditingMetaChange"])):Be("",!0),xt(h,{ref:"bodyRef",value:s.dataToRender(y.rows),class:Tt(y.styleClass),columns:y.columns,empty:s.empty,first:r.d_first,dataKey:i.dataKey,selection:i.selection,selectionKeys:r.d_selectionKeys,selectionMode:i.selectionMode,contextMenu:i.contextMenu,contextMenuSelection:i.contextMenuSelection,rowGroupMode:i.rowGroupMode,groupRowsBy:i.groupRowsBy,expandableRowGroups:i.expandableRowGroups,rowClass:i.rowClass,rowStyle:i.rowStyle,editMode:i.editMode,compareSelectionBy:i.compareSelectionBy,scrollable:i.scrollable,expandedRowIcon:i.expandedRowIcon,collapsedRowIcon:i.collapsedRowIcon,expandedRows:i.expandedRows,expandedRowKeys:r.d_expandedRowKeys,expandedRowGroups:i.expandedRowGroups,editingRows:i.editingRows,editingRowKeys:r.d_editingRowKeys,templates:t.$slots,responsiveLayout:i.responsiveLayout,virtualScrollerContentProps:y,isVirtualScrollerDisabled:s.virtualScrollerDisabled,onRowgroupToggle:s.toggleRowGroup,onRowClick:e[26]||(e[26]=S=>s.onRowClick(S)),onRowDblclick:e[27]||(e[27]=S=>s.onRowDblClick(S)),onRowRightclick:e[28]||(e[28]=S=>s.onRowRightClick(S)),onRowTouchend:s.onRowTouchEnd,onRowKeydown:S=>s.onRowKeyDown(S,y),onRowMousedown:s.onRowMouseDown,onRowDragstart:e[29]||(e[29]=S=>s.onRowDragStart(S)),onRowDragover:e[30]||(e[30]=S=>s.onRowDragOver(S)),onRowDragleave:e[31]||(e[31]=S=>s.onRowDragLeave(S)),onRowDragend:e[32]||(e[32]=S=>s.onRowDragEnd(S)),onRowDrop:e[33]||(e[33]=S=>s.onRowDrop(S)),onRowToggle:e[34]||(e[34]=S=>s.toggleRow(S)),onRadioChange:e[35]||(e[35]=S=>s.toggleRowWithRadio(S)),onCheckboxChange:e[36]||(e[36]=S=>s.toggleRowWithCheckbox(S)),onCellEditInit:e[37]||(e[37]=S=>s.onCellEditInit(S)),onCellEditComplete:e[38]||(e[38]=S=>s.onCellEditComplete(S)),onCellEditCancel:e[39]||(e[39]=S=>s.onCellEditCancel(S)),onRowEditInit:e[40]||(e[40]=S=>s.onRowEditInit(S)),onRowEditSave:e[41]||(e[41]=S=>s.onRowEditSave(S)),onRowEditCancel:e[42]||(e[42]=S=>s.onRowEditCancel(S)),editingMeta:r.d_editingMeta,onEditingMetaChange:s.onEditingMetaChange},null,8,["value","class","columns","empty","first","dataKey","selection","selectionKeys","selectionMode","contextMenu","contextMenuSelection","rowGroupMode","groupRowsBy","expandableRowGroups","rowClass","rowStyle","editMode","compareSelectionBy","scrollable","expandedRowIcon","collapsedRowIcon","expandedRows","expandedRowKeys","expandedRowGroups","editingRows","editingRowKeys","templates","responsiveLayout","virtualScrollerContentProps","isVirtualScrollerDisabled","onRowgroupToggle","onRowTouchend","onRowKeydown","onRowMousedown","editingMeta","onEditingMetaChange"]),s.hasSpacerStyle(y.spacerStyle)?(X(),se("tbody",{key:1,style:Ri({height:`calc(${y.spacerStyle.height} - ${y.rows.length*y.itemSize}px)`}),class:"p-datatable-virtualscroller-spacer"},null,4)):Be("",!0),xt(p,{columnGroup:s.footerColumnGroup,columns:y.columns},null,8,["columnGroup","columns"])],16)]),_:1},16,["items","columns","style","scrollHeight","disabled"])],4),t.$slots.footer?(X(),se("div",y8,[pi(t.$slots,"footer")])):Be("",!0),s.paginatorBottom?(X(),gt(o,{key:4,rows:r.d_rows,first:r.d_first,totalRecords:s.totalRecordsLength,pageLinkSize:i.pageLinkSize,template:i.paginatorTemplate,rowsPerPageOptions:i.rowsPerPageOptions,currentPageReportTemplate:i.currentPageReportTemplate,class:"p-paginator-bottom",onPage:e[43]||(e[43]=y=>s.onPage(y)),alwaysShow:i.alwaysShowPaginator},bg({_:2},[t.$slots.paginatorstart?{name:"start",fn:Vt(()=>[pi(t.$slots,"paginatorstart")]),key:"0"}:void 0,t.$slots.paginatorend?{name:"end",fn:Vt(()=>[pi(t.$slots,"paginatorend")]),key:"1"}:void 0]),1032,["rows","first","totalRecords","pageLinkSize","template","rowsPerPageOptions","currentPageReportTemplate","alwaysShow"])):Be("",!0),Se("div",v8,null,512),i.reorderableColumns?(X(),se("span",b8,null,512)):Be("",!0),i.reorderableColumns?(X(),se("span",_8,null,512)):Be("",!0)],2)}function T8(t,e){e===void 0&&(e={});var i=e.insertAt;if(!(typeof document>"u")){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",i==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var x8=` .p-datatable { position: relative; } .p-datatable > .p-datatable-wrapper { overflow: auto; } .p-datatable-table { border-spacing: 0px; width: 100%; } .p-datatable .p-sortable-column { cursor: pointer; user-select: none; } .p-datatable .p-sortable-column .p-column-title, .p-datatable .p-sortable-column .p-sortable-column-icon, .p-datatable .p-sortable-column .p-sortable-column-badge { vertical-align: middle; } .p-datatable .p-sortable-column .p-sortable-column-badge { display: inline-flex; align-items: center; justify-content: center; } .p-datatable-hoverable-rows .p-selectable-row { cursor: pointer; } /* Scrollable */ .p-datatable-scrollable > .p-datatable-wrapper { position: relative; } .p-datatable-scrollable-table > .p-datatable-thead { position: sticky; top: 0; z-index: 1; } .p-datatable-scrollable-table > .p-datatable-frozen-tbody { position: sticky; z-index: 1; } .p-datatable-scrollable-table > .p-datatable-tfoot { position: sticky; bottom: 0; z-index: 1; } .p-datatable-scrollable .p-frozen-column { position: sticky; background: inherit; } .p-datatable-scrollable th.p-frozen-column { z-index: 1; } .p-datatable-flex-scrollable { display: flex; flex-direction: column; height: 100%; } .p-datatable-flex-scrollable > .p-datatable-wrapper { display: flex; flex-direction: column; flex: 1; height: 100%; } .p-datatable-scrollable-table > .p-datatable-tbody > .p-rowgroup-header { position: sticky; z-index: 1; } /* Resizable */ .p-datatable-resizable-table > .p-datatable-thead > tr > th, .p-datatable-resizable-table > .p-datatable-tfoot > tr > td, .p-datatable-resizable-table > .p-datatable-tbody > tr > td { overflow: hidden; white-space: nowrap; } .p-datatable-resizable-table > .p-datatable-thead > tr > th.p-resizable-column:not(.p-frozen-column) { background-clip: padding-box; position: relative; } .p-datatable-resizable-table-fit > .p-datatable-thead > tr > th.p-resizable-column:last-child .p-column-resizer { display: none; } .p-datatable .p-column-resizer { display: block; position: absolute !important; top: 0; right: 0; margin: 0; width: 0.5rem; height: 100%; padding: 0px; cursor: col-resize; border: 1px solid transparent; } .p-datatable .p-column-header-content { display: flex; align-items: center; } .p-datatable .p-column-resizer-helper { width: 1px; position: absolute; z-index: 10; display: none; } .p-datatable .p-row-editor-init, .p-datatable .p-row-editor-save, .p-datatable .p-row-editor-cancel { display: inline-flex; align-items: center; justify-content: center; overflow: hidden; position: relative; } /* Expand */ .p-datatable .p-row-toggler { display: inline-flex; align-items: center; justify-content: center; overflow: hidden; position: relative; } /* Reorder */ .p-datatable-reorder-indicator-up, .p-datatable-reorder-indicator-down { position: absolute; display: none; } .p-reorderable-column, .p-datatable-reorderablerow-handle { cursor: move; } /* Loader */ .p-datatable .p-datatable-loading-overlay { position: absolute; display: flex; align-items: center; justify-content: center; z-index: 2; } /* Filter */ .p-column-filter-row { display: flex; align-items: center; width: 100%; } .p-column-filter-menu { display: inline-flex; margin-left: auto; } .p-column-filter-row .p-column-filter-element { flex: 1 1 auto; width: 1%; } .p-column-filter-menu-button, .p-column-filter-clear-button { display: inline-flex; justify-content: center; align-items: center; cursor: pointer; text-decoration: none; overflow: hidden; position: relative; } .p-column-filter-overlay { position: absolute; top: 0; left: 0; } .p-column-filter-row-items { margin: 0; padding: 0; list-style: none; } .p-column-filter-row-item { cursor: pointer; } .p-column-filter-add-button, .p-column-filter-remove-button { justify-content: center; } .p-column-filter-add-button .p-button-label, .p-column-filter-remove-button .p-button-label { flex-grow: 0; } .p-column-filter-buttonbar { display: flex; align-items: center; justify-content: space-between; } .p-column-filter-buttonbar .p-button:not(.p-button-icon-only) { width: auto; } /* Responsive */ .p-datatable .p-datatable-tbody > tr > td > .p-column-title { display: none; } /* VirtualScroller */ .p-datatable-virtualscroller-spacer { display: flex; } .p-datatable .p-virtualscroller .p-virtualscroller-loading { transform: none !important; min-height: 0; position: sticky; top: 0; left: 0; } `;T8(x8),qb.render=w8;var UC={name:"Column",props:{columnKey:{type:null,default:null},field:{type:[String,Function],default:null},sortField:{type:[String,Function],default:null},filterField:{type:[String,Function],default:null},dataType:{type:String,default:"text"},sortable:{type:Boolean,default:!1},header:{type:null,default:null},footer:{type:null,default:null},style:{type:null,default:null},class:{type:String,default:null},headerStyle:{type:null,default:null},headerClass:{type:String,default:null},bodyStyle:{type:null,default:null},bodyClass:{type:String,default:null},footerStyle:{type:null,default:null},footerClass:{type:String,default:null},showFilterMenu:{type:Boolean,default:!0},showFilterOperator:{type:Boolean,default:!0},showClearButton:{type:Boolean,default:!0},showApplyButton:{type:Boolean,default:!0},showFilterMatchModes:{type:Boolean,default:!0},showAddButton:{type:Boolean,default:!0},filterMatchModeOptions:{type:Array,default:null},maxConstraints:{type:Number,default:2},excludeGlobalFilter:{type:Boolean,default:!1},filterHeaderClass:{type:String,default:null},filterHeaderStyle:{type:null,default:null},filterMenuClass:{type:String,default:null},filterMenuStyle:{type:null,default:null},selectionMode:{type:String,default:null},expander:{type:Boolean,default:!1},colspan:{type:Number,default:null},rowspan:{type:Number,default:null},rowReorder:{type:Boolean,default:!1},rowReorderIcon:{type:String,default:"pi pi-bars"},reorderableColumn:{type:Boolean,default:!0},rowEditor:{type:Boolean,default:!1},frozen:{type:Boolean,default:!1},alignFrozen:{type:String,default:"left"},exportable:{type:Boolean,default:!0},exportHeader:{type:String,default:null},exportFooter:{type:String,default:null},filterMatchMode:{type:String,default:null},hidden:{type:Boolean,default:!1}},render(){return null}},zC={name:"TreeNode",emits:["node-toggle","node-click","checkbox-change"],props:{node:{type:null,default:null},expandedKeys:{type:null,default:null},selectionKeys:{type:null,default:null},selectionMode:{type:String,default:null},templates:{type:null,default:null},level:{type:Number,default:null},index:{type:Number,default:null}},nodeTouched:!1,mounted(){this.$refs.currentNode.closest(".p-treeselect-items-wrapper")&&this.setAllNodesTabIndexes()},methods:{toggle(){this.$emit("node-toggle",this.node)},label(t){return typeof t.label=="function"?t.label():t.label},onChildNodeToggle(t){this.$emit("node-toggle",t)},onClick(t){He.hasClass(t.target,"p-tree-toggler")||He.hasClass(t.target.parentElement,"p-tree-toggler")||(this.isCheckboxSelectionMode()?this.toggleCheckbox():this.$emit("node-click",{originalEvent:t,nodeTouched:this.nodeTouched,node:this.node}),this.nodeTouched=!1)},onChildNodeClick(t){this.$emit("node-click",t)},onTouchEnd(){this.nodeTouched=!0},onKeyDown(t){if(this.isSameNode(t))switch(t.code){case"Tab":this.onTabKey(t);break;case"ArrowDown":this.onArrowDown(t);break;case"ArrowUp":this.onArrowUp(t);break;case"ArrowRight":this.onArrowRight(t);break;case"ArrowLeft":this.onArrowLeft(t);break;case"Enter":case"Space":this.onEnterKey(t);break}},onArrowDown(t){const e=t.target,i=e.children[1];if(i)this.focusRowChange(e,i.children[0]);else if(e.nextElementSibling)this.focusRowChange(e,e.nextElementSibling);else{let n=this.findNextSiblingOfAncestor(e);n&&this.focusRowChange(e,n)}t.preventDefault()},onArrowUp(t){const e=t.target;if(e.previousElementSibling)this.focusRowChange(e,e.previousElementSibling,this.findLastVisibleDescendant(e.previousElementSibling));else{let i=this.getParentNodeElement(e);i&&this.focusRowChange(e,i)}t.preventDefault()},onArrowRight(t){this.leaf||this.expanded||(t.currentTarget.tabIndex=-1,this.$emit("node-toggle",this.node),this.$nextTick(()=>{this.onArrowDown(t)}))},onArrowLeft(t){const e=He.findSingle(t.currentTarget,".p-tree-toggler");if(this.level===0&&!this.expanded)return!1;if(this.expanded&&!this.leaf)return e.click(),!1;const i=this.findBeforeClickableNode(t.currentTarget);i&&this.focusRowChange(t.currentTarget,i)},onEnterKey(t){this.setTabIndexForSelectionMode(t,this.nodeTouched),this.onClick(t),t.preventDefault()},onTabKey(){this.setAllNodesTabIndexes()},setAllNodesTabIndexes(){const t=He.find(this.$refs.currentNode.closest(".p-tree-container"),".p-treenode"),e=[...t].some(i=>i.getAttribute("aria-selected")==="true"||i.getAttribute("aria-checked")==="true");if([...t].forEach(i=>{i.tabIndex=-1}),e){const i=[...t].filter(n=>n.getAttribute("aria-selected")==="true"||n.getAttribute("aria-checked")==="true");i[0].tabIndex=0;return}[...t][0].tabIndex=0},setTabIndexForSelectionMode(t,e){if(this.selectionMode!==null){const i=[...He.find(this.$refs.currentNode.parentElement,".p-treenode")];t.currentTarget.tabIndex=e===!1?-1:0,i.every(n=>n.tabIndex===-1)&&(i[0].tabIndex=0)}},focusRowChange(t,e,i){t.tabIndex="-1",e.tabIndex="0",this.focusNode(i||e)},findBeforeClickableNode(t){const e=t.closest("ul").closest("li");if(e){const i=He.findSingle(e,"button");return i&&i.style.visibility!=="hidden"?e:this.findBeforeClickableNode(t.previousElementSibling)}return null},toggleCheckbox(){let t=this.selectionKeys?{...this.selectionKeys}:{};const e=!this.checked;this.propagateDown(this.node,e,t),this.$emit("checkbox-change",{node:this.node,check:e,selectionKeys:t})},propagateDown(t,e,i){if(e?i[t.key]={checked:!0,partialChecked:!1}:delete i[t.key],t.children&&t.children.length)for(let n of t.children)this.propagateDown(n,e,i)},propagateUp(t){let e=t.check,i={...t.selectionKeys},n=0,r=!1;for(let s of this.node.children)i[s.key]&&i[s.key].checked?n++:i[s.key]&&i[s.key].partialChecked&&(r=!0);e&&n===this.node.children.length?i[this.node.key]={checked:!0,partialChecked:!1}:(e||delete i[this.node.key],r||n>0&&n!==this.node.children.length?i[this.node.key]={checked:!1,partialChecked:!0}:delete i[this.node.key]),this.$emit("checkbox-change",{node:t.node,check:t.check,selectionKeys:i})},onChildCheckboxChange(t){this.$emit("checkbox-change",t)},findNextSiblingOfAncestor(t){let e=this.getParentNodeElement(t);return e?e.nextElementSibling?e.nextElementSibling:this.findNextSiblingOfAncestor(e):null},findLastVisibleDescendant(t){const e=t.children[1];if(e){const i=e.children[e.children.length-1];return this.findLastVisibleDescendant(i)}else return t},getParentNodeElement(t){const e=t.parentElement.parentElement;return He.hasClass(e,"p-treenode")?e:null},focusNode(t){t.focus()},isCheckboxSelectionMode(){return this.selectionMode==="checkbox"},isSameNode(t){return t.currentTarget&&(t.currentTarget.isSameNode(t.target)||t.currentTarget.isSameNode(t.target.closest(".p-treenode")))}},computed:{hasChildren(){return this.node.children&&this.node.children.length>0},expanded(){return this.expandedKeys&&this.expandedKeys[this.node.key]===!0},leaf(){return this.node.leaf===!1?!1:!(this.node.children&&this.node.children.length)},selectable(){return this.node.selectable===!1?!1:this.selectionMode!=null},selected(){return this.selectionMode&&this.selectionKeys?this.selectionKeys[this.node.key]===!0:!1},containerClass(){return["p-treenode",{"p-treenode-leaf":this.leaf}]},contentClass(){return["p-treenode-content",this.node.styleClass,{"p-treenode-selectable":this.selectable,"p-highlight":this.checkboxMode?this.checked:this.selected}]},icon(){return["p-treenode-icon",this.node.icon]},toggleIcon(){return["p-tree-toggler-icon pi pi-fw",this.expanded?this.node.expandedIcon||"pi-chevron-down":this.node.collapsedIcon||"pi-chevron-right"]},checkboxClass(){return["p-checkbox-box",{"p-highlight":this.checked,"p-indeterminate":this.partialChecked}]},checkboxIcon(){return["p-checkbox-icon",{"pi pi-check":this.checked,"pi pi-minus":this.partialChecked}]},checkboxMode(){return this.selectionMode==="checkbox"&&this.node.selectable!==!1},checked(){return this.selectionKeys?this.selectionKeys[this.node.key]&&this.selectionKeys[this.node.key].checked:!1},partialChecked(){return this.selectionKeys?this.selectionKeys[this.node.key]&&this.selectionKeys[this.node.key].partialChecked:!1},ariaChecked(){return this.selectionMode==="single"||this.selectionMode==="multiple"?this.selected:void 0},ariaSelected(){return this.checkboxMode?this.checked:void 0}},directives:{ripple:Rs}};const S8=["aria-label","aria-selected","aria-expanded","aria-setsize","aria-posinset","aria-level","aria-checked","tabindex"],E8={key:0,class:"p-checkbox p-component","aria-hidden":"true"},C8={class:"p-treenode-label"},A8={key:0,class:"p-treenode-children",role:"group"};function D8(t,e,i,n,r,s){const o=Mt("TreeNode",!0),u=Yr("ripple");return X(),se("li",{ref:"currentNode",class:Tt(s.containerClass),role:"treeitem","aria-label":s.label(i.node),"aria-selected":s.ariaSelected,"aria-expanded":s.expanded,"aria-setsize":i.node.children?i.node.children.length:0,"aria-posinset":i.index+1,"aria-level":i.level,"aria-checked":s.ariaChecked,tabindex:i.index===0?0:-1,onKeydown:e[3]||(e[3]=(...h)=>s.onKeyDown&&s.onKeyDown(...h))},[Se("div",{class:Tt(s.contentClass),onClick:e[1]||(e[1]=(...h)=>s.onClick&&s.onClick(...h)),onTouchend:e[2]||(e[2]=(...h)=>s.onTouchEnd&&s.onTouchEnd(...h)),style:Ri(i.node.style)},[dn((X(),se("button",{type:"button",class:"p-tree-toggler p-link",onClick:e[0]||(e[0]=(...h)=>s.toggle&&s.toggle(...h)),tabindex:"-1","aria-hidden":"true"},[Se("span",{class:Tt(s.toggleIcon)},null,2)])),[[u]]),s.checkboxMode?(X(),se("div",E8,[Se("div",{class:Tt(s.checkboxClass),role:"checkbox"},[Se("span",{class:Tt(s.checkboxIcon)},null,2)],2)])):Be("",!0),Se("span",{class:Tt(s.icon)},null,2),Se("span",C8,[i.templates[i.node.type]||i.templates.default?(X(),gt(fr(i.templates[i.node.type]||i.templates.default),{key:0,node:i.node},null,8,["node"])):(X(),se(ct,{key:1},[Vi(it(s.label(i.node)),1)],64))])],38),s.hasChildren&&s.expanded?(X(),se("ul",A8,[(X(!0),se(ct,null,Kt(i.node.children,h=>(X(),gt(o,{key:h.key,node:h,templates:i.templates,level:i.level+1,expandedKeys:i.expandedKeys,onNodeToggle:s.onChildNodeToggle,onNodeClick:s.onChildNodeClick,selectionMode:i.selectionMode,selectionKeys:i.selectionKeys,onCheckboxChange:s.propagateUp},null,8,["node","templates","level","expandedKeys","onNodeToggle","onNodeClick","selectionMode","selectionKeys","onCheckboxChange"]))),128))])):Be("",!0)],42,S8)}zC.render=D8;var VC={name:"Tree",emits:["node-expand","node-collapse","update:expandedKeys","update:selectionKeys","node-select","node-unselect"],props:{value:{type:null,default:null},expandedKeys:{type:null,default:null},selectionKeys:{type:null,default:null},selectionMode:{type:String,default:null},metaKeySelection:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},loadingIcon:{type:String,default:"pi pi-spinner"},filter:{type:Boolean,default:!1},filterBy:{type:String,default:"label"},filterMode:{type:String,default:"lenient"},filterPlaceholder:{type:String,default:null},filterLocale:{type:String,default:void 0},scrollHeight:{type:String,default:null},level:{type:Number,default:0},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},data(){return{d_expandedKeys:this.expandedKeys||{},filterValue:null}},watch:{expandedKeys(t){this.d_expandedKeys=t}},methods:{onNodeToggle(t){const e=t.key;this.d_expandedKeys[e]?(delete this.d_expandedKeys[e],this.$emit("node-collapse",t)):(this.d_expandedKeys[e]=!0,this.$emit("node-expand",t)),this.d_expandedKeys={...this.d_expandedKeys},this.$emit("update:expandedKeys",this.d_expandedKeys)},onNodeClick(t){if(this.selectionMode!=null&&t.node.selectable!==!1){const i=(t.nodeTouched?!1:this.metaKeySelection)?this.handleSelectionWithMetaKey(t):this.handleSelectionWithoutMetaKey(t);this.$emit("update:selectionKeys",i)}},onCheckboxChange(t){this.$emit("update:selectionKeys",t.selectionKeys),t.check?this.$emit("node-select",t.node):this.$emit("node-unselect",t.node)},handleSelectionWithMetaKey(t){const e=t.originalEvent,i=t.node,n=e.metaKey||e.ctrlKey,r=this.isNodeSelected(i);let s;return r&&n?(this.isSingleSelectionMode()?s={}:(s={...this.selectionKeys},delete s[i.key]),this.$emit("node-unselect",i)):(this.isSingleSelectionMode()?s={}:this.isMultipleSelectionMode()&&(s=n?this.selectionKeys?{...this.selectionKeys}:{}:{}),s[i.key]=!0,this.$emit("node-select",i)),s},handleSelectionWithoutMetaKey(t){const e=t.node,i=this.isNodeSelected(e);let n;return this.isSingleSelectionMode()?i?(n={},this.$emit("node-unselect",e)):(n={},n[e.key]=!0,this.$emit("node-select",e)):i?(n={...this.selectionKeys},delete n[e.key],this.$emit("node-unselect",e)):(n=this.selectionKeys?{...this.selectionKeys}:{},n[e.key]=!0,this.$emit("node-select",e)),n},isSingleSelectionMode(){return this.selectionMode==="single"},isMultipleSelectionMode(){return this.selectionMode==="multiple"},isNodeSelected(t){return this.selectionMode&&this.selectionKeys?this.selectionKeys[t.key]===!0:!1},isChecked(t){return this.selectionKeys?this.selectionKeys[t.key]&&this.selectionKeys[t.key].checked:!1},isNodeLeaf(t){return t.leaf===!1?!1:!(t.children&&t.children.length)},onFilterKeydown(t){t.which===13&&t.preventDefault()},findFilteredNodes(t,e){if(t){let i=!1;if(t.children){let n=[...t.children];t.children=[];for(let r of n){let s={...r};this.isFilterMatched(s,e)&&(i=!0,t.children.push(s))}}if(i)return!0}},isFilterMatched(t,{searchFields:e,filterText:i,strict:n}){let r=!1;for(let s of e)String(ft.resolveFieldData(t,s)).toLocaleLowerCase(this.filterLocale).indexOf(i)>-1&&(r=!0);return(!r||n&&!this.isNodeLeaf(t))&&(r=this.findFilteredNodes(t,{searchFields:e,filterText:i,strict:n})||r),r}},computed:{containerClass(){return["p-tree p-component",{"p-tree-selectable":this.selectionMode!=null,"p-tree-loading":this.loading,"p-tree-flex-scrollable":this.scrollHeight==="flex"}]},loadingIconClass(){return["p-tree-loading-icon pi-spin",this.loadingIcon]},filteredValue(){let t=[];const e=this.filterBy.split(","),i=this.filterValue.trim().toLocaleLowerCase(this.filterLocale),n=this.filterMode==="strict";for(let r of this.value){let s={...r},o={searchFields:e,filterText:i,strict:n};(n&&(this.findFilteredNodes(s,o)||this.isFilterMatched(s,o))||!n&&(this.isFilterMatched(s,o)||this.findFilteredNodes(s,o)))&&t.push(s)}return t},valueToRender(){return this.filterValue&&this.filterValue.trim().length>0?this.filteredValue:this.value}},components:{TreeNode:zC}};const P8={key:0,class:"p-tree-loading-overlay p-component-overlay"},k8={key:1,class:"p-tree-filter-container"},I8=["placeholder"],R8=Se("span",{class:"p-tree-filter-icon pi pi-search"},null,-1),O8=["aria-labelledby","aria-label"];function L8(t,e,i,n,r,s){const o=Mt("TreeNode");return X(),se("div",{class:Tt(s.containerClass)},[i.loading?(X(),se("div",P8,[Se("i",{class:Tt(s.loadingIconClass)},null,2)])):Be("",!0),i.filter?(X(),se("div",k8,[dn(Se("input",{"onUpdate:modelValue":e[0]||(e[0]=u=>r.filterValue=u),type:"text",autocomplete:"off",class:"p-tree-filter p-inputtext p-component",placeholder:i.filterPlaceholder,onKeydown:e[1]||(e[1]=(...u)=>s.onFilterKeydown&&s.onFilterKeydown(...u))},null,40,I8),[[i1,r.filterValue]]),R8])):Be("",!0),Se("div",{class:"p-tree-wrapper",style:Ri({maxHeight:i.scrollHeight})},[Se("ul",{class:"p-tree-container",role:"tree","aria-labelledby":t.ariaLabelledby,"aria-label":t.ariaLabel},[(X(!0),se(ct,null,Kt(s.valueToRender,(u,h)=>(X(),gt(o,{key:u.key,node:u,templates:t.$slots,level:i.level+1,index:h,expandedKeys:r.d_expandedKeys,onNodeToggle:s.onNodeToggle,onNodeClick:s.onNodeClick,selectionMode:i.selectionMode,selectionKeys:i.selectionKeys,onCheckboxChange:s.onCheckboxChange},null,8,["node","templates","level","index","expandedKeys","onNodeToggle","onNodeClick","selectionMode","selectionKeys","onCheckboxChange"]))),128))],8,O8)],4)],2)}function M8(t,e){e===void 0&&(e={});var i=e.insertAt;if(!(typeof document>"u")){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",i==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var F8=` .p-tree-container { margin: 0; padding: 0; list-style-type: none; overflow: auto; } .p-treenode-children { margin: 0; padding: 0; list-style-type: none; } .p-tree-wrapper { overflow: auto; } .p-treenode-selectable { cursor: pointer; user-select: none; } .p-tree-toggler { cursor: pointer; user-select: none; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; position: relative; flex-shrink: 0; } .p-treenode-leaf > .p-treenode-content .p-tree-toggler { visibility: hidden; } .p-treenode-content { display: flex; align-items: center; } .p-tree-filter { width: 100%; } .p-tree-filter-container { position: relative; display: block; width: 100%; } .p-tree-filter-icon { position: absolute; top: 50%; margin-top: -0.5rem; } .p-tree-loading { position: relative; min-height: 4rem; } .p-tree .p-tree-loading-overlay { position: absolute; z-index: 1; display: flex; align-items: center; justify-content: center; } .p-tree-flex-scrollable { display: flex; flex: 1; height: 100%; flex-direction: column; } .p-tree-flex-scrollable .p-tree-wrapper { flex: 1; } `;M8(F8),VC.render=L8;var jC={name:"Slider",emits:["update:modelValue","change","slideend"],props:{modelValue:[Number,Array],min:{type:Number,default:0},max:{type:Number,default:100},orientation:{type:String,default:"horizontal"},step:{type:Number,default:null},range:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},tabindex:{type:Number,default:0},"aria-labelledby":{type:String,default:null},"aria-label":{type:String,default:null}},dragging:!1,handleIndex:null,initX:null,initY:null,barWidth:null,barHeight:null,dragListener:null,dragEndListener:null,beforeUnmount(){this.unbindDragListeners()},methods:{updateDomData(){let t=this.$el.getBoundingClientRect();this.initX=t.left+He.getWindowScrollLeft(),this.initY=t.top+He.getWindowScrollTop(),this.barWidth=this.$el.offsetWidth,this.barHeight=this.$el.offsetHeight},setValue(t){let e,i=t.touches?t.touches[0].pageX:t.pageX,n=t.touches?t.touches[0].pageY:t.pageY;this.orientation==="horizontal"?e=(i-this.initX)*100/this.barWidth:e=(this.initY+this.barHeight-n)*100/this.barHeight;let r=(this.max-this.min)*(e/100)+this.min;if(this.step){const s=this.range?this.modelValue[this.handleIndex]:this.modelValue,o=r-s;o<0?r=s+Math.ceil(r/this.step-s/this.step)*this.step:o>0&&(r=s+Math.floor(r/this.step-s/this.step)*this.step)}else r=Math.floor(r);this.updateModel(t,r)},updateModel(t,e){let i=parseFloat(e.toFixed(10)),n;this.range?(n=this.modelValue?[...this.modelValue]:[],this.handleIndex==0?(i=this.max&&(i=this.max),n[0]=i):(i>this.max?i=this.max:i<=this.min&&(i=this.min),n[1]=i)):(ithis.max&&(i=this.max),n=i),this.$emit("update:modelValue",n),this.$emit("change",n)},onDragStart(t,e){this.disabled||(He.addClass(this.$el,"p-slider-sliding"),this.dragging=!0,this.updateDomData(),this.range&&this.modelValue[0]===this.max?this.handleIndex=0:this.handleIndex=e,t.currentTarget.focus(),t.preventDefault())},onDrag(t){this.dragging&&(this.setValue(t),t.preventDefault())},onDragEnd(t){this.dragging&&(this.dragging=!1,He.removeClass(this.$el,"p-slider-sliding"),this.$emit("slideend",{originalEvent:t,value:this.modelValue}))},onBarClick(t){this.disabled||He.hasClass(t.target,"p-slider-handle")||(this.updateDomData(),this.setValue(t))},onMouseDown(t,e){this.bindDragListeners(),this.onDragStart(t,e)},onKeyDown(t,e){switch(this.handleIndex=e,t.code){case"ArrowDown":case"ArrowLeft":this.decrementValue(t,e),t.preventDefault();break;case"ArrowUp":case"ArrowRight":this.incrementValue(t,e),t.preventDefault();break;case"PageDown":this.decrementValue(t,e,!0),t.preventDefault();break;case"PageUp":this.incrementValue(t,e,!0),t.preventDefault();break;case"Home":this.updateModel(t,this.min),t.preventDefault();break;case"End":this.updateModel(t,this.max),t.preventDefault();break}},decrementValue(t,e,i=!1){let n;this.range?this.step?n=this.modelValue[e]-this.step:n=this.modelValue[e]-1:this.step?n=this.modelValue-this.step:!this.step&&i?n=this.modelValue-10:n=this.modelValue-1,this.updateModel(t,n),t.preventDefault()},incrementValue(t,e,i=!1){let n;this.range?this.step?n=this.modelValue[e]+this.step:n=this.modelValue[e]+1:this.step?n=this.modelValue+this.step:!this.step&&i?n=this.modelValue+10:n=this.modelValue+1,this.updateModel(t,n),t.preventDefault()},bindDragListeners(){this.dragListener||(this.dragListener=this.onDrag.bind(this),document.addEventListener("mousemove",this.dragListener)),this.dragEndListener||(this.dragEndListener=this.onDragEnd.bind(this),document.addEventListener("mouseup",this.dragEndListener))},unbindDragListeners(){this.dragListener&&(document.removeEventListener("mousemove",this.dragListener),this.dragListener=null),this.dragEndListener&&(document.removeEventListener("mouseup",this.dragEndListener),this.dragEndListener=null)}},computed:{containerClass(){return["p-slider p-component",{"p-disabled":this.disabled,"p-slider-horizontal":this.orientation==="horizontal","p-slider-vertical":this.orientation==="vertical"}]},horizontal(){return this.orientation==="horizontal"},vertical(){return this.orientation==="vertical"},rangeStyle(){if(this.range){const t=this.rangeEndPosition>this.rangeStartPosition?this.rangeEndPosition-this.rangeStartPosition:this.rangeStartPosition-this.rangeEndPosition,e=this.rangeEndPosition>this.rangeStartPosition?this.rangeStartPosition:this.rangeEndPosition;return this.horizontal?{left:e+"%",width:t+"%"}:{bottom:e+"%",height:t+"%"}}else return this.horizontal?{width:this.handlePosition+"%"}:{height:this.handlePosition+"%"}},handleStyle(){return this.horizontal?{left:this.handlePosition+"%"}:{bottom:this.handlePosition+"%"}},handlePosition(){return this.modelValuethis.max?100:(this.modelValue-this.min)*100/(this.max-this.min)},rangeStartPosition(){return this.modelValue&&this.modelValue[0]?(this.modelValue[0]this.max?100:this.modelValue[1]-this.min)*100/(this.max-this.min):100},rangeStartHandleStyle(){return this.horizontal?{left:this.rangeStartPosition+"%"}:{bottom:this.rangeStartPosition+"%"}},rangeEndHandleStyle(){return this.horizontal?{left:this.rangeEndPosition+"%"}:{bottom:this.rangeEndPosition+"%"}}}};const N8=["tabindex","aria-valuemin","aria-valuenow","aria-valuemax","aria-labelledby","aria-label","aria-orientation"],B8=["tabindex","aria-valuemin","aria-valuenow","aria-valuemax","aria-labelledby","aria-label","aria-orientation"],H8=["tabindex","aria-valuemin","aria-valuenow","aria-valuemax","aria-labelledby","aria-label","aria-orientation"];function U8(t,e,i,n,r,s){return X(),se("div",{class:Tt(s.containerClass),onClick:e[15]||(e[15]=(...o)=>s.onBarClick&&s.onBarClick(...o))},[Se("span",{class:"p-slider-range",style:Ri(s.rangeStyle)},null,4),i.range?Be("",!0):(X(),se("span",{key:0,class:"p-slider-handle",style:Ri(s.handleStyle),onTouchstart:e[0]||(e[0]=o=>s.onDragStart(o)),onTouchmove:e[1]||(e[1]=o=>s.onDrag(o)),onTouchend:e[2]||(e[2]=o=>s.onDragEnd(o)),onMousedown:e[3]||(e[3]=o=>s.onMouseDown(o)),onKeydown:e[4]||(e[4]=o=>s.onKeyDown(o)),tabindex:i.tabindex,role:"slider","aria-valuemin":i.min,"aria-valuenow":i.modelValue,"aria-valuemax":i.max,"aria-labelledby":t.ariaLabelledby,"aria-label":t.ariaLabel,"aria-orientation":i.orientation},null,44,N8)),i.range?(X(),se("span",{key:1,class:"p-slider-handle",style:Ri(s.rangeStartHandleStyle),onTouchstart:e[5]||(e[5]=o=>s.onDragStart(o,0)),onTouchmove:e[6]||(e[6]=o=>s.onDrag(o)),onTouchend:e[7]||(e[7]=o=>s.onDragEnd(o)),onMousedown:e[8]||(e[8]=o=>s.onMouseDown(o,0)),onKeydown:e[9]||(e[9]=o=>s.onKeyDown(o,0)),tabindex:i.tabindex,role:"slider","aria-valuemin":i.min,"aria-valuenow":i.modelValue?i.modelValue[0]:null,"aria-valuemax":i.max,"aria-labelledby":t.ariaLabelledby,"aria-label":t.ariaLabel,"aria-orientation":i.orientation},null,44,B8)):Be("",!0),i.range?(X(),se("span",{key:2,class:"p-slider-handle",style:Ri(s.rangeEndHandleStyle),onTouchstart:e[10]||(e[10]=o=>s.onDragStart(o,1)),onTouchmove:e[11]||(e[11]=o=>s.onDrag(o)),onTouchend:e[12]||(e[12]=o=>s.onDragEnd(o)),onMousedown:e[13]||(e[13]=o=>s.onMouseDown(o,1)),onKeydown:e[14]||(e[14]=o=>s.onKeyDown(o,1)),tabindex:i.tabindex,role:"slider","aria-valuemin":i.min,"aria-valuenow":i.modelValue?i.modelValue[1]:null,"aria-valuemax":i.max,"aria-labelledby":t.ariaLabelledby,"aria-label":t.ariaLabel,"aria-orientation":i.orientation},null,44,H8)):Be("",!0)],2)}function z8(t,e){e===void 0&&(e={});var i=e.insertAt;if(!(typeof document>"u")){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",i==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var V8=` .p-slider { position: relative; } .p-slider .p-slider-handle { position: absolute; cursor: grab; touch-action: none; display: block; } .p-slider-range { position: absolute; display: block; } .p-slider-horizontal .p-slider-range { top: 0; left: 0; height: 100%; } .p-slider-horizontal .p-slider-handle { top: 50%; } .p-slider-vertical { height: 100px; } .p-slider-vertical .p-slider-handle { left: 50%; } .p-slider-vertical .p-slider-range { bottom: 0; left: 0; width: 100%; } `;z8(V8),jC.render=U8;var WC={name:"Dialog",inheritAttrs:!1,emits:["update:visible","show","hide","after-hide","maximize","unmaximize","dragend"],props:{header:{type:null,default:null},footer:{type:null,default:null},visible:{type:Boolean,default:!1},modal:{type:Boolean,default:null},contentStyle:{type:null,default:null},contentClass:{type:String,default:null},contentProps:{type:null,default:null},rtl:{type:Boolean,default:null},maximizable:{type:Boolean,default:!1},dismissableMask:{type:Boolean,default:!1},closable:{type:Boolean,default:!0},closeOnEscape:{type:Boolean,default:!0},showHeader:{type:Boolean,default:!0},baseZIndex:{type:Number,default:0},autoZIndex:{type:Boolean,default:!0},position:{type:String,default:"center"},breakpoints:{type:Object,default:null},draggable:{type:Boolean,default:!0},keepInViewport:{type:Boolean,default:!0},minX:{type:Number,default:0},minY:{type:Number,default:0},appendTo:{type:String,default:"body"},closeIcon:{type:String,default:"pi pi-times"},maximizeIcon:{type:String,default:"pi pi-window-maximize"},minimizeIcon:{type:String,default:"pi pi-window-minimize"},closeButtonProps:{type:null,default:null},_instance:null},provide(){return{dialogRef:uc(()=>this._instance)}},data(){return{containerVisible:this.visible,maximized:!1,focusableMax:null,focusableClose:null}},documentKeydownListener:null,container:null,mask:null,content:null,headerContainer:null,footerContainer:null,maximizableButton:null,closeButton:null,styleElement:null,dragging:null,documentDragListener:null,documentDragEndListener:null,lastPageX:null,lastPageY:null,updated(){this.visible&&(this.containerVisible=this.visible)},beforeUnmount(){this.unbindDocumentState(),this.unbindGlobalListeners(),this.destroyStyle(),this.mask&&this.autoZIndex&&ol.clear(this.mask),this.container=null,this.mask=null},mounted(){this.breakpoints&&this.createStyle()},methods:{close(){this.$emit("update:visible",!1)},onBeforeEnter(t){t.setAttribute(this.attributeSelector,"")},onEnter(){this.$emit("show"),this.focus(),this.enableDocumentSettings(),this.bindGlobalListeners(),this.autoZIndex&&ol.set("modal",this.mask,this.baseZIndex+this.$primevue.config.zIndex.modal)},onBeforeLeave(){this.modal&&He.addClass(this.mask,"p-component-overlay-leave")},onLeave(){this.$emit("hide"),this.focusableClose=null,this.focusableMax=null},onAfterLeave(){this.autoZIndex&&ol.clear(this.mask),this.containerVisible=!1,this.unbindDocumentState(),this.unbindGlobalListeners(),this.$emit("after-hide")},onMaskClick(t){this.dismissableMask&&this.modal&&this.mask===t.target&&this.close()},focus(){const t=i=>i.querySelector("[autofocus]");let e=this.$slots.footer&&t(this.footerContainer);e||(e=this.$slots.header&&t(this.headerContainer),e||(e=this.$slots.default&&t(this.content),e||(this.maximizable?(this.focusableMax=!0,e=this.maximizableButton):(this.focusableClose=!0,e=this.closeButton)))),e&&He.focus(e)},maximize(t){this.maximized?(this.maximized=!1,this.$emit("unmaximize",t)):(this.maximized=!0,this.$emit("maximize",t)),this.modal||(this.maximized?He.addClass(document.body,"p-overflow-hidden"):He.removeClass(document.body,"p-overflow-hidden"))},enableDocumentSettings(){(this.modal||this.maximizable&&this.maximized)&&He.addClass(document.body,"p-overflow-hidden")},unbindDocumentState(){(this.modal||this.maximizable&&this.maximized)&&He.removeClass(document.body,"p-overflow-hidden")},onKeyDown(t){t.code==="Escape"&&this.closeOnEscape&&this.close()},bindDocumentKeyDownListener(){this.documentKeydownListener||(this.documentKeydownListener=this.onKeyDown.bind(this),window.document.addEventListener("keydown",this.documentKeydownListener))},unbindDocumentKeyDownListener(){this.documentKeydownListener&&(window.document.removeEventListener("keydown",this.documentKeydownListener),this.documentKeydownListener=null)},getPositionClass(){const e=["left","right","top","topleft","topright","bottom","bottomleft","bottomright"].find(i=>i===this.position);return e?`p-dialog-${e}`:""},containerRef(t){this.container=t},maskRef(t){this.mask=t},contentRef(t){this.content=t},headerContainerRef(t){this.headerContainer=t},footerContainerRef(t){this.footerContainer=t},maximizableRef(t){this.maximizableButton=t},closeButtonRef(t){this.closeButton=t},createStyle(){if(!this.styleElement){this.styleElement=document.createElement("style"),this.styleElement.type="text/css",document.head.appendChild(this.styleElement);let t="";for(let e in this.breakpoints)t+=` @media screen and (max-width: ${e}) { .p-dialog[${this.attributeSelector}] { width: ${this.breakpoints[e]} !important; } } `;this.styleElement.innerHTML=t}},destroyStyle(){this.styleElement&&(document.head.removeChild(this.styleElement),this.styleElement=null)},initDrag(t){He.hasClass(t.target,"p-dialog-header-icon")||He.hasClass(t.target.parentElement,"p-dialog-header-icon")||this.draggable&&(this.dragging=!0,this.lastPageX=t.pageX,this.lastPageY=t.pageY,this.container.style.margin="0",He.addClass(document.body,"p-unselectable-text"))},bindGlobalListeners(){this.draggable&&(this.bindDocumentDragListener(),this.bindDocumentDragEndListener()),this.closeOnEscape&&this.closable&&this.bindDocumentKeyDownListener()},unbindGlobalListeners(){this.unbindDocumentDragListener(),this.unbindDocumentDragEndListener(),this.unbindDocumentKeyDownListener()},bindDocumentDragListener(){this.documentDragListener=t=>{if(this.dragging){let e=He.getOuterWidth(this.container),i=He.getOuterHeight(this.container),n=t.pageX-this.lastPageX,r=t.pageY-this.lastPageY,s=this.container.getBoundingClientRect(),o=s.left+n,u=s.top+r,h=He.getViewport();this.container.style.position="fixed",this.keepInViewport?(o>=this.minX&&o+e=this.minY&&u+i{this.dragging&&(this.dragging=!1,He.removeClass(document.body,"p-unselectable-text"),this.$emit("dragend",t))},window.document.addEventListener("mouseup",this.documentDragEndListener)},unbindDocumentDragEndListener(){this.documentDragEndListener&&(window.document.removeEventListener("mouseup",this.documentDragEndListener),this.documentDragEndListener=null)}},computed:{maskClass(){return["p-dialog-mask",{"p-component-overlay p-component-overlay-enter":this.modal},this.getPositionClass()]},dialogClass(){return["p-dialog p-component",{"p-dialog-rtl":this.rtl,"p-dialog-maximized":this.maximizable&&this.maximized,"p-input-filled":this.$primevue.config.inputStyle==="filled","p-ripple-disabled":this.$primevue.config.ripple===!1}]},maximizeIconClass(){return["p-dialog-header-maximize-icon",{[this.maximizeIcon]:!this.maximized,[this.minimizeIcon]:this.maximized}]},ariaId(){return ks()},ariaLabelledById(){return this.header!=null||this.$attrs["aria-labelledby"]!==null?this.ariaId+"_header":null},closeAriaLabel(){return this.$primevue.config.locale.aria?this.$primevue.config.locale.aria.close:void 0},attributeSelector(){return ks()},contentStyleClass(){return["p-dialog-content",this.contentClass]}},directives:{ripple:Rs,focustrap:IC},components:{Portal:Hg}};const j8=["aria-labelledby","aria-modal"],W8=["id"],q8={class:"p-dialog-header-icons"},G8=["autofocus","tabindex"],K8=["autofocus","aria-label"];function Y8(t,e,i,n,r,s){const o=Mt("Portal"),u=Yr("ripple"),h=Yr("focustrap");return X(),gt(o,{appendTo:i.appendTo},{default:Vt(()=>[r.containerVisible?(X(),se("div",{key:0,ref:s.maskRef,class:Tt(s.maskClass),onClick:e[3]||(e[3]=(...p)=>s.onMaskClick&&s.onMaskClick(...p))},[xt(sl,{name:"p-dialog",onBeforeEnter:s.onBeforeEnter,onEnter:s.onEnter,onBeforeLeave:s.onBeforeLeave,onLeave:s.onLeave,onAfterLeave:s.onAfterLeave,appear:""},{default:Vt(()=>[i.visible?dn((X(),se("div",Qi({key:0,ref:s.containerRef,class:s.dialogClass,role:"dialog","aria-labelledby":s.ariaLabelledById,"aria-modal":i.modal},t.$attrs),[i.showHeader?(X(),se("div",{key:0,ref:s.headerContainerRef,class:"p-dialog-header",onMousedown:e[2]||(e[2]=(...p)=>s.initDrag&&s.initDrag(...p))},[pi(t.$slots,"header",{},()=>[i.header?(X(),se("span",{key:0,id:s.ariaLabelledById,class:"p-dialog-title"},it(i.header),9,W8)):Be("",!0)]),Se("div",q8,[i.maximizable?dn((X(),se("button",{key:0,ref:s.maximizableRef,autofocus:r.focusableMax,class:"p-dialog-header-icon p-dialog-header-maximize p-link",onClick:e[0]||(e[0]=(...p)=>s.maximize&&s.maximize(...p)),type:"button",tabindex:i.maximizable?"0":"-1"},[Se("span",{class:Tt(s.maximizeIconClass)},null,2)],8,G8)),[[u]]):Be("",!0),i.closable?dn((X(),se("button",Qi({key:1,ref:s.closeButtonRef,autofocus:r.focusableClose,class:"p-dialog-header-icon p-dialog-header-close p-link",onClick:e[1]||(e[1]=(...p)=>s.close&&s.close(...p)),"aria-label":s.closeAriaLabel,type:"button"},i.closeButtonProps),[Se("span",{class:Tt(["p-dialog-header-close-icon",i.closeIcon])},null,2)],16,K8)),[[u]]):Be("",!0)])],544)):Be("",!0),Se("div",Qi({ref:s.contentRef,class:s.contentStyleClass,style:i.contentStyle},i.contentProps),[pi(t.$slots,"default")],16),i.footer||t.$slots.footer?(X(),se("div",{key:1,ref:s.footerContainerRef,class:"p-dialog-footer"},[pi(t.$slots,"footer",{},()=>[Vi(it(i.footer),1)])],512)):Be("",!0)],16,j8)),[[h,{disabled:!i.modal}]]):Be("",!0)]),_:3},8,["onBeforeEnter","onEnter","onBeforeLeave","onLeave","onAfterLeave"])],2)):Be("",!0)]),_:3},8,["appendTo"])}function X8(t,e){e===void 0&&(e={});var i=e.insertAt;if(!(typeof document>"u")){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",i==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var Z8=` .p-dialog-mask { position: fixed; top: 0; left: 0; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; pointer-events: none; } .p-dialog-mask.p-component-overlay { pointer-events: auto; } .p-dialog { display: flex; flex-direction: column; pointer-events: auto; max-height: 90%; transform: scale(1); } .p-dialog-content { overflow-y: auto; } .p-dialog-header { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; } .p-dialog-footer { flex-shrink: 0; } .p-dialog .p-dialog-header-icons { display: flex; align-items: center; } .p-dialog .p-dialog-header-icon { display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; } /* Fluid */ .p-fluid .p-dialog-footer .p-button { width: auto; } /* Animation */ /* Center */ .p-dialog-enter-active { transition: all 150ms cubic-bezier(0, 0, 0.2, 1); } .p-dialog-leave-active { transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1); } .p-dialog-enter-from, .p-dialog-leave-to { opacity: 0; transform: scale(0.7); } /* Top, Bottom, Left, Right, Top* and Bottom* */ .p-dialog-top .p-dialog, .p-dialog-bottom .p-dialog, .p-dialog-left .p-dialog, .p-dialog-right .p-dialog, .p-dialog-topleft .p-dialog, .p-dialog-topright .p-dialog, .p-dialog-bottomleft .p-dialog, .p-dialog-bottomright .p-dialog { margin: 0.75rem; transform: translate3d(0px, 0px, 0px); } .p-dialog-top .p-dialog-enter-active, .p-dialog-top .p-dialog-leave-active, .p-dialog-bottom .p-dialog-enter-active, .p-dialog-bottom .p-dialog-leave-active, .p-dialog-left .p-dialog-enter-active, .p-dialog-left .p-dialog-leave-active, .p-dialog-right .p-dialog-enter-active, .p-dialog-right .p-dialog-leave-active, .p-dialog-topleft .p-dialog-enter-active, .p-dialog-topleft .p-dialog-leave-active, .p-dialog-topright .p-dialog-enter-active, .p-dialog-topright .p-dialog-leave-active, .p-dialog-bottomleft .p-dialog-enter-active, .p-dialog-bottomleft .p-dialog-leave-active, .p-dialog-bottomright .p-dialog-enter-active, .p-dialog-bottomright .p-dialog-leave-active { transition: all 0.3s ease-out; } .p-dialog-top .p-dialog-enter-from, .p-dialog-top .p-dialog-leave-to { transform: translate3d(0px, -100%, 0px); } .p-dialog-bottom .p-dialog-enter-from, .p-dialog-bottom .p-dialog-leave-to { transform: translate3d(0px, 100%, 0px); } .p-dialog-left .p-dialog-enter-from, .p-dialog-left .p-dialog-leave-to, .p-dialog-topleft .p-dialog-enter-from, .p-dialog-topleft .p-dialog-leave-to, .p-dialog-bottomleft .p-dialog-enter-from, .p-dialog-bottomleft .p-dialog-leave-to { transform: translate3d(-100%, 0px, 0px); } .p-dialog-right .p-dialog-enter-from, .p-dialog-right .p-dialog-leave-to, .p-dialog-topright .p-dialog-enter-from, .p-dialog-topright .p-dialog-leave-to, .p-dialog-bottomright .p-dialog-enter-from, .p-dialog-bottomright .p-dialog-leave-to { transform: translate3d(100%, 0px, 0px); } /* Maximize */ .p-dialog-maximized { -webkit-transition: none; transition: none; transform: none; width: 100vw !important; height: 100vh !important; top: 0px !important; left: 0px !important; max-height: 100%; height: 100%; } .p-dialog-maximized .p-dialog-content { flex-grow: 1; } /* Position */ .p-dialog-left { justify-content: flex-start; } .p-dialog-right { justify-content: flex-end; } .p-dialog-top { align-items: flex-start; } .p-dialog-topleft { justify-content: flex-start; align-items: flex-start; } .p-dialog-topright { justify-content: flex-end; align-items: flex-start; } .p-dialog-bottom { align-items: flex-end; } .p-dialog-bottomleft { justify-content: flex-start; align-items: flex-end; } .p-dialog-bottomright { justify-content: flex-end; align-items: flex-end; } .p-confirm-dialog .p-dialog-content { display: flex; align-items: center; } `;X8(Z8),WC.render=Y8;var cl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function uu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function qC(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var i=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};i.prototype=e.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(i,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}),i}var GC={exports:{}};(function(t){//! openseadragon 3.1.0 //! Built on 2022-06-07 //! Git commit: v3.1.0-1-c1c380f //! http://openseadragon.github.io //! License: http://openseadragon.github.io/license/ function e(i){return new e.Viewer(i)}(function(i){i.version={versionStr:"3.1.0",major:parseInt("3",10),minor:parseInt("1",10),revision:parseInt("0",10)};var n={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regexp","[object Object]":"object"},r=Object.prototype.toString,s=Object.prototype.hasOwnProperty;i.isFunction=function(o){return i.type(o)==="function"},i.isArray=Array.isArray||function(o){return i.type(o)==="array"},i.isWindow=function(o){return o&&typeof o=="object"&&"setInterval"in o},i.type=function(o){return o==null?String(o):n[r.call(o)]||"object"},i.isPlainObject=function(o){if(!o||e.type(o)!=="object"||o.nodeType||i.isWindow(o)||o.constructor&&!s.call(o,"constructor")&&!s.call(o.constructor.prototype,"isPrototypeOf"))return!1;var u;for(var h in o)u=h;return u===void 0||s.call(o,u)},i.isEmptyObject=function(o){for(var u in o)return!1;return!0},i.freezeObject=function(o){return Object.freeze?i.freezeObject=Object.freeze:i.freezeObject=function(u){return u},i.freezeObject(o)},i.supportsCanvas=function(){var o=document.createElement("canvas");return!!(i.isFunction(o.getContext)&&o.getContext("2d"))}(),i.isCanvasTainted=function(o){var u=!1;try{o.getContext("2d").getImageData(0,0,1,1)}catch{u=!0}return u},i.supportsAddEventListener=function(){return!!(document.documentElement.addEventListener&&document.addEventListener)}(),i.supportsRemoveEventListener=function(){return!!(document.documentElement.removeEventListener&&document.removeEventListener)}(),i.supportsEventListenerOptions=function(){var o=0;if(i.supportsAddEventListener)try{var u={get capture(){return o++,!1},get once(){return o++,!1},get passive(){return o++,!1}};window.addEventListener("test",null,u),window.removeEventListener("test",null,u)}catch{o=0}return o>=3}(),i.getCurrentPixelDensityRatio=function(){if(i.supportsCanvas){var o=document.createElement("canvas").getContext("2d"),u=window.devicePixelRatio||1,h=o.webkitBackingStorePixelRatio||o.mozBackingStorePixelRatio||o.msBackingStorePixelRatio||o.oBackingStorePixelRatio||o.backingStorePixelRatio||1;return Math.max(u,1)/h}else return 1},i.pixelDensityRatio=i.getCurrentPixelDensityRatio()})(e),function(i){i.extend=function(){var h,p,g,y,S,P,R=arguments[0]||{},k=arguments.length,M=!1,L=1;for(typeof R=="boolean"&&(M=R,R=arguments[1]||{},L=2),typeof R!="object"&&!e.isFunction(R)&&(R={}),k===L&&(R=this,--L);L=g.x&&p.x=g.y},getMousePosition:function(h){if(typeof h.pageX=="number")i.getMousePosition=function(p){var g=new i.Point;return g.x=p.pageX,g.y=p.pageY,g};else if(typeof h.clientX=="number")i.getMousePosition=function(p){var g=new i.Point;return g.x=p.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,g.y=p.clientY+document.body.scrollTop+document.documentElement.scrollTop,g};else throw new Error("Unknown event mouse position, no known technique.");return i.getMousePosition(h)},getPageScroll:function(){var h=document.documentElement||{},p=document.body||{};if(typeof window.pageXOffset=="number")i.getPageScroll=function(){return new i.Point(window.pageXOffset,window.pageYOffset)};else if(p.scrollLeft||p.scrollTop)i.getPageScroll=function(){return new i.Point(document.body.scrollLeft,document.body.scrollTop)};else if(h.scrollLeft||h.scrollTop)i.getPageScroll=function(){return new i.Point(document.documentElement.scrollLeft,document.documentElement.scrollTop)};else return new i.Point(0,0);return i.getPageScroll()},setPageScroll:function(h){if(typeof window.scrollTo<"u")i.setPageScroll=function(y){window.scrollTo(y.x,y.y)};else{var p=i.getPageScroll();if(p.x===h.x&&p.y===h.y)return;document.body.scrollLeft=h.x,document.body.scrollTop=h.y;var g=i.getPageScroll();if(g.x!==p.x&&g.y!==p.y){i.setPageScroll=function(y){document.body.scrollLeft=y.x,document.body.scrollTop=y.y};return}if(document.documentElement.scrollLeft=h.x,document.documentElement.scrollTop=h.y,g=i.getPageScroll(),g.x!==p.x&&g.y!==p.y){i.setPageScroll=function(y){document.documentElement.scrollLeft=y.x,document.documentElement.scrollTop=y.y};return}i.setPageScroll=function(y){}}i.setPageScroll(h)},getWindowSize:function(){var h=document.documentElement||{},p=document.body||{};if(typeof window.innerWidth=="number")i.getWindowSize=function(){return new i.Point(window.innerWidth,window.innerHeight)};else if(h.clientWidth||h.clientHeight)i.getWindowSize=function(){return new i.Point(document.documentElement.clientWidth,document.documentElement.clientHeight)};else if(p.clientWidth||p.clientHeight)i.getWindowSize=function(){return new i.Point(document.body.clientWidth,document.body.clientHeight)};else throw new Error("Unknown window size, no known technique.");return i.getWindowSize()},makeCenteredNode:function(h){h=i.getElement(h);var p=[i.makeNeutralElement("div"),i.makeNeutralElement("div"),i.makeNeutralElement("div")];return i.extend(p[0].style,{display:"table",height:"100%",width:"100%"}),i.extend(p[1].style,{display:"table-row"}),i.extend(p[2].style,{display:"table-cell",verticalAlign:"middle",textAlign:"center"}),p[0].appendChild(p[1]),p[1].appendChild(p[2]),p[2].appendChild(h),p[0]},makeNeutralElement:function(h){var p=document.createElement(h),g=p.style;return g.background="transparent none",g.border="none",g.margin="0px",g.padding="0px",g.position="static",p},now:function(){return Date.now?i.now=Date.now:i.now=function(){return new Date().getTime()},i.now()},makeTransparentImage:function(h){var p=i.makeNeutralElement("img");return p.src=h,p},setElementOpacity:function(h,p,g){var y,S;h=i.getElement(h),g&&!i.Browser.alpha&&(p=Math.round(p)),i.Browser.opacity?h.style.opacity=p<1?p:"":p<1?(y=Math.round(100*p),S="alpha(opacity="+y+")",h.style.filter=S):h.style.filter=""},setElementTouchActionNone:function(h){h=i.getElement(h),typeof h.style.touchAction<"u"?h.style.touchAction="none":typeof h.style.msTouchAction<"u"&&(h.style.msTouchAction="none")},setElementPointerEvents:function(h,p){h=i.getElement(h),typeof h.style<"u"&&typeof h.style.pointerEvents<"u"&&(h.style.pointerEvents=p)},setElementPointerEventsNone:function(h){i.setElementPointerEvents(h,"none")},addClass:function(h,p){h=i.getElement(h),h.className?(" "+h.className+" ").indexOf(" "+p+" ")===-1&&(h.className+=" "+p):h.className=p},indexOf:function(h,p,g){return Array.prototype.indexOf?this.indexOf=function(y,S,P){return y.indexOf(S,P)}:this.indexOf=function(y,S,P){var R,k=P||0,M;if(!y)throw new TypeError;if(M=y.length,M===0||k>=M)return-1;for(k<0&&(k=M-Math.abs(k)),R=k;R=200&&M.status<300||M.status===0&&k!=="http:"&&k!=="https:"?p(M):i.isFunction(g)?g(M):i.console.error("AJAX request returned %d: %s",M.status,h))};var L=R?"POST":"GET";try{if(M.open(L,h,!0),P&&(M.responseType=P),S)for(var q in S)Object.prototype.hasOwnProperty.call(S,q)&&S[q]&&M.setRequestHeader(q,S[q]);y&&(M.withCredentials=!0),M.send(R)}catch(Z){i.console.error("%s while making AJAX request: %s",Z.name,Z.message),M.onreadystatechange=function(){},i.isFunction(g)&&g(M,Z)}return M},jsonp:function(h){var p,g=h.url,y=document.head||document.getElementsByTagName("head")[0]||document.documentElement,S=h.callbackName||"openseadragon"+i.now(),P=window[S],R="$1"+S+"$2",k=h.param||"callback",M=h.callback;g=g.replace(/(=)\?(&|$)|\?\?/i,R),g+=(/\?/.test(g)?"&":"?")+k+"="+S,window[S]=function(L){if(P)window[S]=P;else try{delete window[S]}catch{}M&&i.isFunction(M)&&M(L)},p=document.createElement("script"),(h.async!==void 0||h.async!==!1)&&(p.async="async"),h.scriptCharset&&(p.charset=h.scriptCharset),p.src=g,p.onload=p.onreadystatechange=function(L,q){(q||!p.readyState||/loaded|complete/.test(p.readyState))&&(p.onload=p.onreadystatechange=null,y&&p.parentNode&&y.removeChild(p),p=void 0)},y.insertBefore(p,y.firstChild)},createFromDZI:function(){throw"OpenSeadragon.createFromDZI is deprecated, use Viewer.open."},parseXml:function(h){if(window.DOMParser)i.parseXml=function(p){var g=null,y;return y=new DOMParser,g=y.parseFromString(p,"text/xml"),g};else if(window.ActiveXObject)i.parseXml=function(p){var g=null;return g=new ActiveXObject("Microsoft.XMLDOM"),g.async=!1,g.loadXML(p),g};else throw new Error("Browser doesn't support XML DOM.");return i.parseXml(h)},parseJSON:function(h){return i.parseJSON=window.JSON.parse,i.parseJSON(h)},imageFormatSupported:function(h){return h=h||"",!!s[h.toLowerCase()]},setImageFormatsSupported:function(h){i.extend(s,h)}});var r=function(h){};i.console=window.console||{log:r,debug:r,info:r,warn:r,error:r,assert:r},i.Browser={vendor:i.BROWSERS.UNKNOWN,version:0,alpha:!0};var s={bmp:!1,jpeg:!0,jpg:!0,png:!0,tif:!1,wdp:!1},o={};(function(){var h=navigator.appVersion,p=navigator.userAgent,g;switch(navigator.appName){case"Microsoft Internet Explorer":window.attachEvent&&window.ActiveXObject&&(i.Browser.vendor=i.BROWSERS.IE,i.Browser.version=parseFloat(p.substring(p.indexOf("MSIE")+5,p.indexOf(";",p.indexOf("MSIE")))));break;case"Netscape":window.addEventListener&&(p.indexOf("Edge")>=0?(i.Browser.vendor=i.BROWSERS.EDGE,i.Browser.version=parseFloat(p.substring(p.indexOf("Edge")+5))):p.indexOf("Edg")>=0?(i.Browser.vendor=i.BROWSERS.CHROMEEDGE,i.Browser.version=parseFloat(p.substring(p.indexOf("Edg")+4))):p.indexOf("Firefox")>=0?(i.Browser.vendor=i.BROWSERS.FIREFOX,i.Browser.version=parseFloat(p.substring(p.indexOf("Firefox")+8))):p.indexOf("Safari")>=0?(i.Browser.vendor=p.indexOf("Chrome")>=0?i.BROWSERS.CHROME:i.BROWSERS.SAFARI,i.Browser.version=parseFloat(p.substring(p.substring(0,p.indexOf("Safari")).lastIndexOf("/")+1,p.indexOf("Safari")))):(g=new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})"),g.exec(p)!==null&&(i.Browser.vendor=i.BROWSERS.IE,i.Browser.version=parseFloat(RegExp.$1))));break;case"Opera":i.Browser.vendor=i.BROWSERS.OPERA,i.Browser.version=parseFloat(h);break}var y=window.location.search.substring(1),S=y.split("&"),P,R,k;for(k=0;k0){var M=P.substring(0,R),L=P.substring(R+1);try{o[M]=decodeURIComponent(L)}catch{i.console.error("Ignoring malformed URL parameter: %s=%s",M,L)}}i.Browser.alpha=!(i.Browser.vendor===i.BROWSERS.CHROME&&i.Browser.version<2),i.Browser.opacity=!0,i.Browser.vendor===i.BROWSERS.IE&&i.Browser.version<11&&i.console.error("Internet Explorer versions < 11 are not supported by OpenSeadragon")})(),function(h){var p=h.requestAnimationFrame||h.mozRequestAnimationFrame||h.webkitRequestAnimationFrame||h.msRequestAnimationFrame,g=h.cancelAnimationFrame||h.mozCancelAnimationFrame||h.webkitCancelAnimationFrame||h.msCancelAnimationFrame;if(p&&g)i.requestAnimationFrame=function(){return p.apply(h,arguments)},i.cancelAnimationFrame=function(){return g.apply(h,arguments)};else{var y=[],S=[],P=0,R;i.requestAnimationFrame=function(k){return y.push([++P,k]),R||(R=setInterval(function(){if(y.length){var M=i.now(),L=S;for(S=y,y=L;S.length;)S.shift()[1](M)}else clearInterval(R),R=void 0},1e3/50)),P},i.cancelAnimationFrame=function(k){var M,L;for(M=0,L=y.length;M8||"onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll",i.MouseTracker.subscribeEvents=["click","dblclick","keydown","keyup","keypress","focus","blur","contextmenu",i.MouseTracker.wheelEventName],i.MouseTracker.wheelEventName==="DOMMouseScroll"&&i.MouseTracker.subscribeEvents.push("MozMousePixelScroll"),window.PointerEvent?(i.MouseTracker.havePointerEvents=!0,i.MouseTracker.subscribeEvents.push("pointerenter","pointerleave","pointerover","pointerout","pointerdown","pointerup","pointermove","pointercancel"),i.MouseTracker.havePointerCapture=function(){var K=document.createElement("div");return i.isFunction(K.setPointerCapture)&&i.isFunction(K.releasePointerCapture)}(),i.MouseTracker.havePointerCapture&&i.MouseTracker.subscribeEvents.push("gotpointercapture","lostpointercapture")):(i.MouseTracker.havePointerEvents=!1,i.MouseTracker.subscribeEvents.push("mouseenter","mouseleave","mouseover","mouseout","mousedown","mouseup","mousemove"),i.MouseTracker.mousePointerId="legacy-mouse",i.MouseTracker.havePointerCapture=function(){var K=document.createElement("div");return i.isFunction(K.setCapture)&&i.isFunction(K.releaseCapture)}(),i.MouseTracker.havePointerCapture&&i.MouseTracker.subscribeEvents.push("losecapture"),"ontouchstart"in window&&i.MouseTracker.subscribeEvents.push("touchstart","touchend","touchmove","touchcancel"),"ongesturestart"in window&&i.MouseTracker.subscribeEvents.push("gesturestart","gesturechange")),i.MouseTracker.GesturePointList=function(K){this._gPoints=[],this.type=K,this.buttons=0,this.contacts=0,this.clicks=0,this.captureCount=0},i.MouseTracker.GesturePointList.prototype={getLength:function(){return this._gPoints.length},asArray:function(){return this._gPoints},add:function(K){return this._gPoints.push(K)},removeById:function(K){var j,oe=this._gPoints.length;for(j=0;j1&&(this.type==="mouse"||this.type==="pen")&&(i.console.warn("GesturePointList.addContact() Implausible contacts value"),this.contacts=1)},removeContact:function(){--this.contacts,this.contacts<0&&(this.contacts=0)}};function o(K){var j=n[K.hash],oe,re,We,st,St,qt=j.activePointersLists.length;for(oe=0;oe0){for(St=[],st=We.asArray(),re=0;rej.touches.length-We&&i.console.warn("Tracked touch contact count doesn't match event.touches.length");var qt={originalEvent:j,eventType:"pointerdown",pointerType:"touch",isEmulated:!1};for(Q(K,qt),re=0;re"u"?!0:r.attachToViewer,this.autoFade=typeof r.autoFade>"u"?!0:r.autoFade,this.element=n,this.anchor=r.anchor,this.container=s,this.anchor===i.ControlAnchor.ABSOLUTE?(this.wrapper=i.makeNeutralElement("div"),this.wrapper.style.position="absolute",this.wrapper.style.top=typeof r.top=="number"?r.top+"px":r.top,this.wrapper.style.left=typeof r.left=="number"?r.left+"px":r.left,this.wrapper.style.height=typeof r.height=="number"?r.height+"px":r.height,this.wrapper.style.width=typeof r.width=="number"?r.width+"px":r.width,this.wrapper.style.margin="0px",this.wrapper.style.padding="0px",this.element.style.position="relative",this.element.style.top="0px",this.element.style.left="0px",this.element.style.height="100%",this.element.style.width="100%"):(this.wrapper=i.makeNeutralElement("div"),this.wrapper.style.display="inline-block",this.anchor===i.ControlAnchor.NONE&&(this.wrapper.style.width=this.wrapper.style.height="100%")),this.wrapper.appendChild(this.element),r.attachToViewer?this.anchor===i.ControlAnchor.TOP_RIGHT||this.anchor===i.ControlAnchor.BOTTOM_RIGHT?this.container.insertBefore(this.wrapper,this.container.firstChild):this.container.appendChild(this.wrapper):o.appendChild(this.wrapper)},i.Control.prototype={destroy:function(){this.wrapper.removeChild(this.element),this.anchor!==i.ControlAnchor.NONE&&this.container.removeChild(this.wrapper)},isVisible:function(){return this.wrapper.style.display!=="none"},setVisible:function(n){this.wrapper.style.display=n?this.anchor===i.ControlAnchor.ABSOLUTE?"block":"inline-block":"none"},setOpacity:function(n){this.element[i.SIGNAL]&&i.Browser.vendor===i.BROWSERS.IE?i.setElementOpacity(this.element,n,!0):i.setElementOpacity(this.wrapper,n,!0)}}}(e),function(i){i.ControlDock=function(r){var s=["topleft","topright","bottomright","bottomleft"],o,u;for(i.extend(!0,this,{id:"controldock-"+i.now()+"-"+Math.floor(Math.random()*1e6),container:i.makeNeutralElement("div"),controls:[]},r),this.container.onsubmit=function(){return!1},this.element&&(this.element=i.getElement(this.element),this.element.appendChild(this.container),this.element.style.position="relative",this.container.style.width="100%",this.container.style.height="100%"),u=0;u=0)){switch(s.anchor){case i.ControlAnchor.TOP_RIGHT:o=this.controls.topright,r.style.position="relative",r.style.paddingRight="0px",r.style.paddingTop="0px";break;case i.ControlAnchor.BOTTOM_RIGHT:o=this.controls.bottomright,r.style.position="relative",r.style.paddingRight="0px",r.style.paddingBottom="0px";break;case i.ControlAnchor.BOTTOM_LEFT:o=this.controls.bottomleft,r.style.position="relative",r.style.paddingLeft="0px",r.style.paddingBottom="0px";break;case i.ControlAnchor.TOP_LEFT:o=this.controls.topleft,r.style.position="relative",r.style.paddingLeft="0px",r.style.paddingTop="0px";break;case i.ControlAnchor.ABSOLUTE:o=this.container,r.style.margin="0px",r.style.padding="0px";break;default:case i.ControlAnchor.NONE:o=this.container,r.style.margin="0px",r.style.padding="0px";break}this.controls.push(new i.Control(r,s,o)),r.style.display="inline-block"}},removeControl:function(r){r=i.getElement(r);var s=n(this,r);return s>=0&&(this.controls[s].destroy(),this.controls.splice(s,1)),this},clearControls:function(){for(;this.controls.length>0;)this.controls.pop().destroy();return this},areControlsEnabled:function(){var r;for(r=this.controls.length-1;r>=0;r--)if(this.controls[r].isVisible())return!0;return!1},setControlsEnabled:function(r){var s;for(s=this.controls.length-1;s>=0;s--)this.controls[s].setVisible(r);return this}};function n(r,s){var o=r.controls,u;for(u=o.length-1;u>=0;u--)if(o[u].element===s)return u;return-1}}(e),function(i){i.Placement=i.freezeObject({CENTER:0,TOP_LEFT:1,TOP:2,TOP_RIGHT:3,RIGHT:4,BOTTOM_RIGHT:5,BOTTOM:6,BOTTOM_LEFT:7,LEFT:8,properties:{0:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!1,isVerticallyCentered:!0,isBottom:!1},1:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!0,isVerticallyCentered:!1,isBottom:!1},2:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!0,isVerticallyCentered:!1,isBottom:!1},3:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!0,isVerticallyCentered:!1,isBottom:!1},4:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!1,isVerticallyCentered:!0,isBottom:!1},5:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!1,isVerticallyCentered:!1,isBottom:!0},6:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!1,isVerticallyCentered:!1,isBottom:!0},7:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!1,isVerticallyCentered:!1,isBottom:!0},8:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!1,isVerticallyCentered:!0,isBottom:!1}}})}(e),function(i){var n={},r=1;i.Viewer=function(O){var te=arguments,Ee=this,Oe;if(i.isPlainObject(O)||(O={id:te[0],xmlPath:te.length>1?te[1]:void 0,prefixUrl:te.length>2?te[2]:void 0,controls:te.length>3?te[3]:void 0,overlays:te.length>4?te[4]:void 0}),O.config&&(i.extend(!0,O,O.config),delete O.config),i.extend(!0,this,{id:O.id,hash:O.hash||r++,initialPage:0,element:null,container:null,canvas:null,overlays:[],overlaysContainer:null,previousBody:[],customControls:[],source:null,drawer:null,world:null,viewport:null,navigator:null,collectionViewport:null,collectionDrawer:null,navImages:null,buttons:null,profiler:null},i.DEFAULT_SETTINGS,O),typeof this.hash>"u")throw new Error("A hash must be defined, either by specifying options.id or options.hash.");for(typeof n[this.hash]<"u"&&i.console.warn("Hash "+this.hash+" has already been used."),n[this.hash]={fsBoundsDelta:new i.Point(1,1),prevContainerSize:null,animating:!1,forceRedraw:!1,mouseInside:!1,group:null,zooming:!1,zoomFactor:null,lastZoomTime:null,fullPage:!1,onfullscreenchange:null},this._sequenceIndex=0,this._firstOpen=!0,this._updateRequestId=null,this._loadQueue=[],this.currentOverlays=[],this._updatePixelDensityRatioBind=null,this._lastScrollTime=i.now(),i.EventSource.call(this),this.addHandler("open-failed",function(Q){var ne=i.getString("Errors.OpenFailed",Q.eventSource,Q.message);Ee._showMessage(ne)}),i.ControlDock.call(this,O),this.xmlPath&&(this.tileSources=[this.xmlPath]),this.element=this.element||document.getElementById(this.id),this.canvas=i.makeNeutralElement("div"),this.canvas.className="openseadragon-canvas",function(Q){Q.width="100%",Q.height="100%",Q.overflow="hidden",Q.position="absolute",Q.top="0px",Q.left="0px"}(this.canvas.style),i.setElementTouchActionNone(this.canvas),O.tabIndex!==""&&(this.canvas.tabIndex=O.tabIndex===void 0?0:O.tabIndex),this.container.className="openseadragon-container",function(Q){Q.width="100%",Q.height="100%",Q.position="relative",Q.overflow="hidden",Q.left="0px",Q.top="0px",Q.textAlign="left"}(this.container.style),i.setElementTouchActionNone(this.container),this.container.insertBefore(this.canvas,this.container.firstChild),this.element.appendChild(this.container),this.bodyWidth=document.body.style.width,this.bodyHeight=document.body.style.height,this.bodyOverflow=document.body.style.overflow,this.docOverflow=document.documentElement.style.overflow,this.innerTracker=new i.MouseTracker({userData:"Viewer.innerTracker",element:this.canvas,startDisabled:!this.mouseNavEnabled,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,dblClickTimeThreshold:this.dblClickTimeThreshold,dblClickDistThreshold:this.dblClickDistThreshold,contextMenuHandler:i.delegate(this,M),keyDownHandler:i.delegate(this,L),keyHandler:i.delegate(this,q),clickHandler:i.delegate(this,Z),dblClickHandler:i.delegate(this,J),dragHandler:i.delegate(this,ae),dragEndHandler:i.delegate(this,ye),enterHandler:i.delegate(this,pe),leaveHandler:i.delegate(this,le),pressHandler:i.delegate(this,ze),releaseHandler:i.delegate(this,tt),nonPrimaryPressHandler:i.delegate(this,ot),nonPrimaryReleaseHandler:i.delegate(this,qe),scrollHandler:i.delegate(this,Pt),pinchHandler:i.delegate(this,at)}),this.outerTracker=new i.MouseTracker({userData:"Viewer.outerTracker",element:this.container,startDisabled:!this.mouseNavEnabled,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,dblClickTimeThreshold:this.dblClickTimeThreshold,dblClickDistThreshold:this.dblClickDistThreshold,enterHandler:i.delegate(this,ci),leaveHandler:i.delegate(this,Ct)}),this.toolbar&&(this.toolbar=new i.ControlDock({element:this.toolbar})),this.bindStandardControls(),n[this.hash].prevContainerSize=s(this.container),this.world=new i.World({viewer:this}),this.world.addHandler("add-item",function(Q){Ee.source=Ee.world.getItemAt(0).source,n[Ee.hash].forceRedraw=!0,Ee._updateRequestId||(Ee._updateRequestId=p(Ee,Nt))}),this.world.addHandler("remove-item",function(Q){Ee.world.getItemCount()?Ee.source=Ee.world.getItemAt(0).source:Ee.source=null,n[Ee.hash].forceRedraw=!0}),this.world.addHandler("metrics-change",function(Q){Ee.viewport&&Ee.viewport._setContentBounds(Ee.world.getHomeBounds(),Ee.world.getContentFactor())}),this.world.addHandler("item-index-change",function(Q){Ee.source=Ee.world.getItemAt(0).source}),this.viewport=new i.Viewport({containerSize:n[this.hash].prevContainerSize,springStiffness:this.springStiffness,animationTime:this.animationTime,minZoomImageRatio:this.minZoomImageRatio,maxZoomPixelRatio:this.maxZoomPixelRatio,visibilityRatio:this.visibilityRatio,wrapHorizontal:this.wrapHorizontal,wrapVertical:this.wrapVertical,defaultZoomLevel:this.defaultZoomLevel,minZoomLevel:this.minZoomLevel,maxZoomLevel:this.maxZoomLevel,viewer:this,degrees:this.degrees,flipped:this.flipped,navigatorRotate:this.navigatorRotate,homeFillsViewer:this.homeFillsViewer,margins:this.viewportMargins,silenceMultiImageWarnings:this.silenceMultiImageWarnings}),this.viewport._setContentBounds(this.world.getHomeBounds(),this.world.getContentFactor()),this.imageLoader=new i.ImageLoader({jobLimit:this.imageLoaderLimit,timeout:O.timeout}),this.tileCache=new i.TileCache({maxImageCacheCount:this.maxImageCacheCount}),this.drawer=new i.Drawer({viewer:this,viewport:this.viewport,element:this.canvas,debugGridColor:this.debugGridColor}),this.overlaysContainer=i.makeNeutralElement("div"),this.canvas.appendChild(this.overlaysContainer),this.drawer.canRotate()||(this.rotateLeft&&(Oe=this.buttonGroup.buttons.indexOf(this.rotateLeft),this.buttonGroup.buttons.splice(Oe,1),this.buttonGroup.element.removeChild(this.rotateLeft.element)),this.rotateRight&&(Oe=this.buttonGroup.buttons.indexOf(this.rotateRight),this.buttonGroup.buttons.splice(Oe,1),this.buttonGroup.element.removeChild(this.rotateRight.element))),this._addUpdatePixelDensityRatioEvent(),this.showNavigator&&(this.navigator=new i.Navigator({id:this.navigatorId,position:this.navigatorPosition,sizeRatio:this.navigatorSizeRatio,maintainSizeRatio:this.navigatorMaintainSizeRatio,top:this.navigatorTop,left:this.navigatorLeft,width:this.navigatorWidth,height:this.navigatorHeight,autoResize:this.navigatorAutoResize,autoFade:this.navigatorAutoFade,prefixUrl:this.prefixUrl,viewer:this,navigatorRotate:this.navigatorRotate,background:this.navigatorBackground,opacity:this.navigatorOpacity,borderColor:this.navigatorBorderColor,displayRegionColor:this.navigatorDisplayRegionColor,crossOriginPolicy:this.crossOriginPolicy})),this.sequenceMode&&this.bindSequenceControls(),this.tileSources&&this.open(this.tileSources),Oe=0;Oe-1&&O.index=0&&O=0)return this;var ne=u(this,Q);return this.currentOverlays.push(ne),ne.drawHTML(this.overlaysContainer,this.viewport),this.raiseEvent("add-overlay",{element:O,location:Q.location,placement:Q.placement}),this},updateOverlay:function(O,te,Ee){var Oe;return O=i.getElement(O),Oe=h(this.currentOverlays,O),Oe>=0&&(this.currentOverlays[Oe].update(te,Ee),n[this.hash].forceRedraw=!0,this.raiseEvent("update-overlay",{element:O,location:te,placement:Ee})),this},removeOverlay:function(O){var te;return O=i.getElement(O),te=h(this.currentOverlays,O),te>=0&&(this.currentOverlays[te].destroy(),this.currentOverlays.splice(te,1),n[this.hash].forceRedraw=!0,this.raiseEvent("remove-overlay",{element:O})),this},clearOverlays:function(){for(;this.currentOverlays.length>0;)this.currentOverlays.pop().destroy();return n[this.hash].forceRedraw=!0,this.raiseEvent("clear-overlay",{}),this},getOverlayById:function(O){var te;return O=i.getElement(O),te=h(this.currentOverlays,O),te>=0?this.currentOverlays[te]:null},_updateSequenceButtons:function(O){this.nextButton&&(!this.tileSources||this.tileSources.length-1===O?this.navPrevNextWrap||this.nextButton.disable():this.nextButton.enable()),this.previousButton&&(O>0?this.previousButton.enable():this.navPrevNextWrap||this.previousButton.disable())},_showMessage:function(O){this._hideMessage();var te=i.makeNeutralElement("div");te.appendChild(document.createTextNode(O)),this.messageDiv=i.makeCenteredNode(te),i.addClass(this.messageDiv,"openseadragon-message"),this.container.appendChild(this.messageDiv)},_hideMessage:function(){var O=this.messageDiv;O&&(O.parentNode.removeChild(O),delete this.messageDiv)},gestureSettingsByDeviceType:function(O){switch(O){case"mouse":return this.gestureSettingsMouse;case"touch":return this.gestureSettingsTouch;case"pen":return this.gestureSettingsPen;default:return this.gestureSettingsUnknown}},_drawOverlays:function(){var O,te=this.currentOverlays.length;for(O=0;O1&&(this.referenceStrip=new i.ReferenceStrip({id:this.referenceStripElement,position:this.referenceStripPosition,sizeRatio:this.referenceStripSizeRatio,scroll:this.referenceStripScroll,height:this.referenceStripHeight,width:this.referenceStripWidth,tileSources:this.tileSources,prefixUrl:this.prefixUrl,useCanvas:this.useCanvas,viewer:this}),this.referenceStrip.setFocus(this._sequenceIndex))}else i.console.warn('Attempting to display a reference strip while "sequenceMode" is off.')},_addUpdatePixelDensityRatioEvent:function(){this._updatePixelDensityRatioBind=this._updatePixelDensityRatio.bind(this),i.addEvent(window,"resize",this._updatePixelDensityRatioBind)},_removeUpdatePixelDensityRatioEvent:function(){i.removeEvent(window,"resize",this._updatePixelDensityRatioBind)},_updatePixelDensityRatio:function(){var O=i.pixelDensityRatio,te=i.getCurrentPixelDensityRatio();O!==te&&(i.pixelDensityRatio=te,this.world.resetItems(),this.forceRedraw())},goToPreviousPage:function(){var O=this._sequenceIndex-1;this.navPrevNextWrap&&O<0&&(O+=this.tileSources.length),this.goToPage(O)},goToNextPage:function(){var O=this._sequenceIndex+1;this.navPrevNextWrap&&O>=this.tileSources.length&&(O=0),this.goToPage(O)},isAnimating:function(){return n[this.hash].animating}});function s(O){return O=i.getElement(O),new i.Point(O.clientWidth===0?1:O.clientWidth,O.clientHeight===0?1:O.clientHeight)}function o(O,te,Ee,Oe,Q){var ne=O;if(i.type(te)==="string"){if(te.match(/^\s*<.*>\s*$/))te=i.parseXml(te);else if(te.match(/^\s*[{[].*[}\]]\s*$/))try{var he=i.parseJSON(te);te=he}catch{}}function Le(nt,je){nt.ready?Oe(nt):(nt.addHandler("ready",function(){Oe(nt)}),nt.addHandler("open-failed",function(Te){Q({message:Te.message,source:je})}))}setTimeout(function(){if(i.type(te)==="string")te=new i.TileSource({url:te,crossOriginPolicy:Ee.crossOriginPolicy!==void 0?Ee.crossOriginPolicy:O.crossOriginPolicy,ajaxWithCredentials:O.ajaxWithCredentials,ajaxHeaders:Ee.ajaxHeaders?Ee.ajaxHeaders:O.ajaxHeaders,splitHashDataForPost:O.splitHashDataForPost,useCanvas:O.useCanvas,success:function(Ue){Oe(Ue.tileSource)}}),te.addHandler("open-failed",function(Ue){Q(Ue)});else if(i.isPlainObject(te)||te.nodeType)if(te.crossOriginPolicy===void 0&&(Ee.crossOriginPolicy!==void 0||O.crossOriginPolicy!==void 0)&&(te.crossOriginPolicy=Ee.crossOriginPolicy!==void 0?Ee.crossOriginPolicy:O.crossOriginPolicy),te.ajaxWithCredentials===void 0&&(te.ajaxWithCredentials=O.ajaxWithCredentials),te.useCanvas===void 0&&(te.useCanvas=O.useCanvas),i.isFunction(te.getTileUrl)){var nt=new i.TileSource(te);nt.getTileUrl=te.getTileUrl,Oe(nt)}else{var je=i.TileSource.determineType(ne,te);if(!je){Q({message:"Unable to load TileSource",source:te});return}var Te=je.prototype.configure.apply(ne,[te]);Le(new je(Te),te)}else Le(te,te)})}function u(O,te){if(te instanceof i.Overlay)return te;var Ee=null;if(te.element)Ee=i.getElement(te.element);else{var Oe=te.id?te.id:"openseadragon-overlay-"+Math.floor(Math.random()*1e7);Ee=i.getElement(te.id),Ee||(Ee=document.createElement("a"),Ee.href="#/overlay/"+Oe),Ee.id=Oe,i.addClass(Ee,te.className?te.className:"openseadragon-overlay")}var Q=te.location,ne=te.width,he=te.height;if(!Q){var Le=te.x,nt=te.y;if(te.px!==void 0){var je=O.viewport.imageToViewportRectangle(new i.Rect(te.px,te.py,ne||0,he||0));Le=je.x,nt=je.y,ne=ne!==void 0?je.width:void 0,he=he!==void 0?je.height:void 0}Q=new i.Point(Le,nt)}var Te=te.placement;return Te&&i.type(Te)==="string"&&(Te=i.Placement[te.placement.toUpperCase()]),new i.Overlay({element:Ee,location:Q,placement:Te,onDraw:te.onDraw,checkResize:te.checkResize,width:ne,height:he,rotationMode:te.rotationMode})}function h(O,te){var Ee;for(Ee=O.length-1;Ee>=0;Ee--)if(O[Ee].element===te)return Ee;return-1}function p(O,te){return i.requestAnimationFrame(function(){te(O)})}function g(O){i.requestAnimationFrame(function(){S(O)})}function y(O){O.autoHideControls&&(O.controlsShouldFade=!0,O.controlsFadeBeginTime=i.now()+O.controlsFadeDelay,window.setTimeout(function(){g(O)},O.controlsFadeDelay))}function S(O){var te,Ee,Oe,Q;if(O.controlsShouldFade){for(te=i.now(),Ee=te-O.controlsFadeBeginTime,Oe=1-Ee/O.controlsFadeLength,Oe=Math.min(1,Oe),Oe=Math.max(0,Oe),Q=O.controls.length-1;Q>=0;Q--)O.controls[Q].autoFade&&O.controls[Q].setOpacity(Oe);Oe>0&&g(O)}}function P(O){var te;for(O.controlsShouldFade=!1,te=O.controls.length-1;te>=0;te--)O.controls[te].setOpacity(1)}function R(){P(this)}function k(){y(this)}function M(O){var te={tracker:O.eventSource,position:O.position,originalEvent:O.originalEvent,preventDefault:O.preventDefault};this.raiseEvent("canvas-contextmenu",te),O.preventDefault=te.preventDefault}function L(O){var te={originalEvent:O.originalEvent,preventDefaultAction:!1,preventVerticalPan:O.preventVerticalPan||!this.panVertical,preventHorizontalPan:O.preventHorizontalPan||!this.panHorizontal};if(this.raiseEvent("canvas-key",te),!te.preventDefaultAction&&!O.ctrl&&!O.alt&&!O.meta)switch(O.keyCode){case 38:te.preventVerticalPan||(O.shift?this.viewport.zoomBy(1.1):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new i.Point(0,-this.pixelsPerArrowPress))),this.viewport.applyConstraints()),O.preventDefault=!0;break;case 40:te.preventVerticalPan||(O.shift?this.viewport.zoomBy(.9):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new i.Point(0,this.pixelsPerArrowPress))),this.viewport.applyConstraints()),O.preventDefault=!0;break;case 37:te.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new i.Point(-this.pixelsPerArrowPress,0))),this.viewport.applyConstraints()),O.preventDefault=!0;break;case 39:te.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new i.Point(this.pixelsPerArrowPress,0))),this.viewport.applyConstraints()),O.preventDefault=!0;break;default:O.preventDefault=!1;break}else O.preventDefault=!1}function q(O){var te={originalEvent:O.originalEvent,preventDefaultAction:!1,preventVerticalPan:O.preventVerticalPan||!this.panVertical,preventHorizontalPan:O.preventHorizontalPan||!this.panHorizontal};if(this.raiseEvent("canvas-key",te),!te.preventDefaultAction&&!O.ctrl&&!O.alt&&!O.meta)switch(O.keyCode){case 43:case 61:this.viewport.zoomBy(1.1),this.viewport.applyConstraints(),O.preventDefault=!0;break;case 45:this.viewport.zoomBy(.9),this.viewport.applyConstraints(),O.preventDefault=!0;break;case 48:this.viewport.goHome(),this.viewport.applyConstraints(),O.preventDefault=!0;break;case 119:case 87:te.preventVerticalPan||(O.shift?this.viewport.zoomBy(1.1):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new i.Point(0,-40))),this.viewport.applyConstraints()),O.preventDefault=!0;break;case 115:case 83:te.preventVerticalPan||(O.shift?this.viewport.zoomBy(.9):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new i.Point(0,40))),this.viewport.applyConstraints()),O.preventDefault=!0;break;case 97:te.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new i.Point(-40,0))),this.viewport.applyConstraints()),O.preventDefault=!0;break;case 100:te.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new i.Point(40,0))),this.viewport.applyConstraints()),O.preventDefault=!0;break;case 114:this.viewport.flipped?this.viewport.setRotation(i.positiveModulo(this.viewport.degrees-this.rotationIncrement,360)):this.viewport.setRotation(i.positiveModulo(this.viewport.degrees+this.rotationIncrement,360)),this.viewport.applyConstraints(),O.preventDefault=!0;break;case 82:this.viewport.flipped?this.viewport.setRotation(i.positiveModulo(this.viewport.degrees+this.rotationIncrement,360)):this.viewport.setRotation(i.positiveModulo(this.viewport.degrees-this.rotationIncrement,360)),this.viewport.applyConstraints(),O.preventDefault=!0;break;case 102:this.viewport.toggleFlip(),O.preventDefault=!0;break;case 106:this.goToPreviousPage();break;case 107:this.goToNextPage();break;default:O.preventDefault=!1;break}else O.preventDefault=!1}function Z(O){var te,Ee=document.activeElement===this.canvas;Ee||this.canvas.focus(),this.viewport.flipped&&(O.position.x=this.viewport.getContainerSize().x-O.position.x);var Oe={tracker:O.eventSource,position:O.position,quick:O.quick,shift:O.shift,originalEvent:O.originalEvent,originalTarget:O.originalTarget,preventDefaultAction:!1};this.raiseEvent("canvas-click",Oe),!Oe.preventDefaultAction&&this.viewport&&O.quick&&(te=this.gestureSettingsByDeviceType(O.pointerType),te.clickToZoom&&(this.viewport.zoomBy(O.shift?1/this.zoomPerClick:this.zoomPerClick,te.zoomToRefPoint?this.viewport.pointFromPixel(O.position,!0):null),this.viewport.applyConstraints()))}function J(O){var te,Ee={tracker:O.eventSource,position:O.position,shift:O.shift,originalEvent:O.originalEvent,preventDefaultAction:!1};this.raiseEvent("canvas-double-click",Ee),!Ee.preventDefaultAction&&this.viewport&&(te=this.gestureSettingsByDeviceType(O.pointerType),te.dblClickToZoom&&(this.viewport.zoomBy(O.shift?1/this.zoomPerClick:this.zoomPerClick,te.zoomToRefPoint?this.viewport.pointFromPixel(O.position,!0):null),this.viewport.applyConstraints()))}function ae(O){var te,Ee={tracker:O.eventSource,pointerType:O.pointerType,position:O.position,delta:O.delta,speed:O.speed,direction:O.direction,shift:O.shift,originalEvent:O.originalEvent,preventDefaultAction:!1};if(this.raiseEvent("canvas-drag",Ee),te=this.gestureSettingsByDeviceType(O.pointerType),te.dragToPan&&!Ee.preventDefaultAction&&this.viewport){if(this.panHorizontal||(O.delta.x=0),this.panVertical||(O.delta.y=0),this.viewport.flipped&&(O.delta.x=-O.delta.x),this.constrainDuringPan){var Oe=this.viewport.deltaPointsFromPixels(O.delta.negate());this.viewport.centerSpringX.target.value+=Oe.x,this.viewport.centerSpringY.target.value+=Oe.y;var Q=this.viewport.getBounds(),ne=this.viewport.getConstrainedBounds();this.viewport.centerSpringX.target.value-=Oe.x,this.viewport.centerSpringY.target.value-=Oe.y,Q.x!==ne.x&&(O.delta.x=0),Q.y!==ne.y&&(O.delta.y=0)}this.viewport.panBy(this.viewport.deltaPointsFromPixels(O.delta.negate()),te.flickEnabled&&!this.constrainDuringPan)}}function ye(O){var te={tracker:O.eventSource,pointerType:O.pointerType,position:O.position,speed:O.speed,direction:O.direction,shift:O.shift,originalEvent:O.originalEvent,preventDefaultAction:!1};if(this.raiseEvent("canvas-drag-end",te),!te.preventDefaultAction&&this.viewport){var Ee=this.gestureSettingsByDeviceType(O.pointerType);if(Ee.flickEnabled&&O.speed>=Ee.flickMinSpeed){var Oe=0;this.panHorizontal&&(Oe=Ee.flickMomentum*O.speed*Math.cos(O.direction));var Q=0;this.panVertical&&(Q=Ee.flickMomentum*O.speed*Math.sin(O.direction));var ne=this.viewport.pixelFromPoint(this.viewport.getCenter(!0)),he=this.viewport.pointFromPixel(new i.Point(ne.x-Oe,ne.y-Q));this.viewport.panTo(he,!1)}this.viewport.applyConstraints()}}function pe(O){this.raiseEvent("canvas-enter",{tracker:O.eventSource,pointerType:O.pointerType,position:O.position,buttons:O.buttons,pointers:O.pointers,insideElementPressed:O.insideElementPressed,buttonDownAny:O.buttonDownAny,originalEvent:O.originalEvent})}function le(O){this.raiseEvent("canvas-exit",{tracker:O.eventSource,pointerType:O.pointerType,position:O.position,buttons:O.buttons,pointers:O.pointers,insideElementPressed:O.insideElementPressed,buttonDownAny:O.buttonDownAny,originalEvent:O.originalEvent})}function ze(O){this.raiseEvent("canvas-press",{tracker:O.eventSource,pointerType:O.pointerType,position:O.position,insideElementPressed:O.insideElementPressed,insideElementReleased:O.insideElementReleased,originalEvent:O.originalEvent})}function tt(O){this.raiseEvent("canvas-release",{tracker:O.eventSource,pointerType:O.pointerType,position:O.position,insideElementPressed:O.insideElementPressed,insideElementReleased:O.insideElementReleased,originalEvent:O.originalEvent})}function ot(O){this.raiseEvent("canvas-nonprimary-press",{tracker:O.eventSource,position:O.position,pointerType:O.pointerType,button:O.button,buttons:O.buttons,originalEvent:O.originalEvent})}function qe(O){this.raiseEvent("canvas-nonprimary-release",{tracker:O.eventSource,position:O.position,pointerType:O.pointerType,button:O.button,buttons:O.buttons,originalEvent:O.originalEvent})}function at(O){var te,Ee,Oe,Q,ne={tracker:O.eventSource,pointerType:O.pointerType,gesturePoints:O.gesturePoints,lastCenter:O.lastCenter,center:O.center,lastDistance:O.lastDistance,distance:O.distance,shift:O.shift,originalEvent:O.originalEvent,preventDefaultPanAction:!1,preventDefaultZoomAction:!1,preventDefaultRotateAction:!1};if(this.raiseEvent("canvas-pinch",ne),this.viewport&&(te=this.gestureSettingsByDeviceType(O.pointerType),te.pinchToZoom&&(!ne.preventDefaultPanAction||!ne.preventDefaultZoomAction)&&(Ee=this.viewport.pointFromPixel(O.center,!0),te.zoomToRefPoint&&!ne.preventDefaultPanAction&&(Oe=this.viewport.pointFromPixel(O.lastCenter,!0),Q=Oe.minus(Ee),this.panHorizontal||(Q.x=0),this.panVertical||(Q.y=0),this.viewport.panBy(Q,!0)),ne.preventDefaultZoomAction||this.viewport.zoomBy(O.distance/O.lastDistance,Ee,!0),this.viewport.applyConstraints()),te.pinchRotate&&!ne.preventDefaultRotateAction)){var he=Math.atan2(O.gesturePoints[0].currentPos.y-O.gesturePoints[1].currentPos.y,O.gesturePoints[0].currentPos.x-O.gesturePoints[1].currentPos.x),Le=Math.atan2(O.gesturePoints[0].lastPos.y-O.gesturePoints[1].lastPos.y,O.gesturePoints[0].lastPos.x-O.gesturePoints[1].lastPos.x);this.viewport.setRotation(this.viewport.getRotation()+(he-Le)*(180/Math.PI))}}function Pt(O){var te,Ee,Oe,Q,ne;Q=i.now(),ne=Q-this._lastScrollTime,ne>this.minScrollDeltaTime?(this._lastScrollTime=Q,te={tracker:O.eventSource,position:O.position,scroll:O.scroll,shift:O.shift,originalEvent:O.originalEvent,preventDefaultAction:!1,preventDefault:!0},this.raiseEvent("canvas-scroll",te),!te.preventDefaultAction&&this.viewport&&(this.viewport.flipped&&(O.position.x=this.viewport.getContainerSize().x-O.position.x),Ee=this.gestureSettingsByDeviceType(O.pointerType),Ee.scrollToZoom&&(Oe=Math.pow(this.zoomPerScroll,O.scroll),this.viewport.zoomBy(Oe,Ee.zoomToRefPoint?this.viewport.pointFromPixel(O.position,!0):null),this.viewport.applyConstraints())),O.preventDefault=te.preventDefault):O.preventDefault=!0}function ci(O){n[this.hash].mouseInside=!0,P(this),this.raiseEvent("container-enter",{tracker:O.eventSource,pointerType:O.pointerType,position:O.position,buttons:O.buttons,pointers:O.pointers,insideElementPressed:O.insideElementPressed,buttonDownAny:O.buttonDownAny,originalEvent:O.originalEvent})}function Ct(O){O.pointers<1&&(n[this.hash].mouseInside=!1,n[this.hash].animating||y(this)),this.raiseEvent("container-exit",{tracker:O.eventSource,pointerType:O.pointerType,position:O.position,buttons:O.buttons,pointers:O.pointers,insideElementPressed:O.insideElementPressed,buttonDownAny:O.buttonDownAny,originalEvent:O.originalEvent})}function Nt(O){Wt(O),O.isOpen()?O._updateRequestId=p(O,Nt):O._updateRequestId=!1}function Wt(O){if(!(O._opening||!n[O.hash])){if(O.autoResize){var te=s(O.container),Ee=n[O.hash].prevContainerSize;if(!te.equals(Ee)){var Oe=O.viewport;if(O.preserveImageSizeOnResize){var Q=Ee.x/te.x,ne=Oe.getZoom()*Q,he=Oe.getCenter();Oe.resize(te,!1),Oe.zoomTo(ne,null,!0),Oe.panTo(he,!0)}else{var Le=Oe.getBounds();Oe.resize(te,!0),Oe.fitBoundsWithConstraints(Le,!0)}n[O.hash].prevContainerSize=te,n[O.hash].forceRedraw=!0}}var nt=O.viewport.update(),je=O.world.update()||nt;nt&&O.raiseEvent("viewport-change"),O.referenceStrip&&(je=O.referenceStrip.update(O.viewport)||je);var Te=n[O.hash].animating;!Te&&je&&(O.raiseEvent("animation-start"),P(O));var Ue=Te&&!je;Ue&&(n[O.hash].animating=!1),(je||Ue||n[O.hash].forceRedraw||O.world.needsDraw())&&(wi(O),O._drawOverlays(),O.navigator&&O.navigator.update(O.viewport),n[O.hash].forceRedraw=!1,je&&O.raiseEvent("animation")),Ue&&(O.raiseEvent("animation-finish"),n[O.hash].mouseInside||y(O)),n[O.hash].animating=je}}function wi(O){O.imageLoader.clear(),O.drawer.clear(),O.world.draw(),O.raiseEvent("update-viewport",{})}function Et(O,te){return O?O+te:te}function ii(){n[this.hash].lastZoomTime=i.now(),n[this.hash].zoomFactor=this.zoomPerSecond,n[this.hash].zooming=!0,hn(this)}function Ii(){n[this.hash].lastZoomTime=i.now(),n[this.hash].zoomFactor=1/this.zoomPerSecond,n[this.hash].zooming=!0,hn(this)}function bi(){n[this.hash].zooming=!1}function hn(O){i.requestAnimationFrame(i.delegate(O,dt))}function dt(){var O,te,Ee;n[this.hash].zooming&&this.viewport&&(O=i.now(),te=O-n[this.hash].lastZoomTime,Ee=Math.pow(n[this.hash].zoomFactor,te/1e3),this.viewport.zoomBy(Ee),this.viewport.applyConstraints(),n[this.hash].lastZoomTime=O,hn(this))}function un(){this.viewport&&(n[this.hash].zooming=!1,this.viewport.zoomBy(this.zoomPerClick/1),this.viewport.applyConstraints())}function Un(){this.viewport&&(n[this.hash].zooming=!1,this.viewport.zoomBy(1/this.zoomPerClick),this.viewport.applyConstraints())}function rn(){this.buttonGroup&&(this.buttonGroup.emulateEnter(),this.buttonGroup.emulateLeave())}function fn(){this.viewport&&this.viewport.goHome()}function Si(){this.isFullPage()&&!i.isFullScreen()?this.setFullPage(!1):this.setFullScreen(!this.isFullPage()),this.buttonGroup&&this.buttonGroup.emulateLeave(),this.fullPageButton.element.focus(),this.viewport&&this.viewport.applyConstraints()}function mr(){if(this.viewport){var O=this.viewport.getRotation();this.viewport.flipped?O=i.positiveModulo(O+this.rotationIncrement,360):O=i.positiveModulo(O-this.rotationIncrement,360),this.viewport.setRotation(O)}}function Ce(){if(this.viewport){var O=this.viewport.getRotation();this.viewport.flipped?O=i.positiveModulo(O-this.rotationIncrement,360):O=i.positiveModulo(O+this.rotationIncrement,360),this.viewport.setRotation(O)}}function Ie(){this.viewport.toggleFlip()}}(e),function(i){i.Navigator=function(p){var g=p.viewer,y=this,S,P;p.id?(this.element=document.getElementById(p.id),p.controlOptions={anchor:i.ControlAnchor.NONE,attachToViewer:!1,autoFade:!1}):(p.id="navigator-"+i.now(),this.element=i.makeNeutralElement("div"),p.controlOptions={anchor:i.ControlAnchor.TOP_RIGHT,attachToViewer:!0,autoFade:p.autoFade},p.position&&(p.position==="BOTTOM_RIGHT"?p.controlOptions.anchor=i.ControlAnchor.BOTTOM_RIGHT:p.position==="BOTTOM_LEFT"?p.controlOptions.anchor=i.ControlAnchor.BOTTOM_LEFT:p.position==="TOP_RIGHT"?p.controlOptions.anchor=i.ControlAnchor.TOP_RIGHT:p.position==="TOP_LEFT"?p.controlOptions.anchor=i.ControlAnchor.TOP_LEFT:p.position==="ABSOLUTE"&&(p.controlOptions.anchor=i.ControlAnchor.ABSOLUTE,p.controlOptions.top=p.top,p.controlOptions.left=p.left,p.controlOptions.height=p.height,p.controlOptions.width=p.width))),this.element.id=p.id,this.element.className+=" navigator",p=i.extend(!0,{sizeRatio:i.DEFAULT_SETTINGS.navigatorSizeRatio},p,{element:this.element,tabIndex:-1,showNavigator:!1,mouseNavEnabled:!1,showNavigationControl:!1,showSequenceControl:!1,immediateRender:!0,blendTime:0,animationTime:0,autoResize:p.autoResize,minZoomImageRatio:1,background:p.background,opacity:p.opacity,borderColor:p.borderColor,displayRegionColor:p.displayRegionColor}),p.minPixelRatio=this.minPixelRatio=g.minPixelRatio,i.setElementTouchActionNone(this.element),this.borderWidth=2,this.fudge=new i.Point(1,1),this.totalBorderWidths=new i.Point(this.borderWidth*2,this.borderWidth*2).minus(this.fudge),p.controlOptions.anchor!==i.ControlAnchor.NONE&&function(M,L){M.margin="0px",M.border=L+"px solid "+p.borderColor,M.padding="0px",M.background=p.background,M.opacity=p.opacity,M.overflow="hidden"}(this.element.style,this.borderWidth),this.displayRegion=i.makeNeutralElement("div"),this.displayRegion.id=this.element.id+"-displayregion",this.displayRegion.className="displayregion",function(M,L){M.position="relative",M.top="0px",M.left="0px",M.fontSize="0px",M.overflow="hidden",M.border=L+"px solid "+p.displayRegionColor,M.margin="0px",M.padding="0px",M.background="transparent",M.float="left",M.cssFloat="left",M.styleFloat="left",M.zIndex=999999999,M.cursor="default"}(this.displayRegion.style,this.borderWidth),i.setElementPointerEventsNone(this.displayRegion),i.setElementTouchActionNone(this.displayRegion),this.displayRegionContainer=i.makeNeutralElement("div"),this.displayRegionContainer.id=this.element.id+"-displayregioncontainer",this.displayRegionContainer.className="displayregioncontainer",this.displayRegionContainer.style.width="100%",this.displayRegionContainer.style.height="100%",i.setElementPointerEventsNone(this.displayRegionContainer),i.setElementTouchActionNone(this.displayRegionContainer),g.addControl(this.element,p.controlOptions),this._resizeWithViewer=p.controlOptions.anchor!==i.ControlAnchor.ABSOLUTE&&p.controlOptions.anchor!==i.ControlAnchor.NONE,p.width&&p.height?(this.setWidth(p.width),this.setHeight(p.height)):this._resizeWithViewer&&(S=i.getElementSize(g.element),this.element.style.height=Math.round(S.y*p.sizeRatio)+"px",this.element.style.width=Math.round(S.x*p.sizeRatio)+"px",this.oldViewerSize=S,P=i.getElementSize(this.element),this.elementArea=P.x*P.y),this.oldContainerSize=new i.Point(0,0),i.Viewer.apply(this,[p]),this.displayRegionContainer.appendChild(this.displayRegion),this.element.getElementsByTagName("div")[0].appendChild(this.displayRegionContainer);function R(M){u(y.displayRegionContainer,M),u(y.displayRegion,-M),y.viewport.setRotation(M)}if(p.navigatorRotate){var k=p.viewer.viewport?p.viewer.viewport.getRotation():p.viewer.degrees||0;R(k),p.viewer.addHandler("rotate",function(M){R(M.degrees)})}this.innerTracker.destroy(),this.innerTracker=new i.MouseTracker({userData:"Navigator.innerTracker",element:this.element,dragHandler:i.delegate(this,r),clickHandler:i.delegate(this,n),releaseHandler:i.delegate(this,s),scrollHandler:i.delegate(this,o),preProcessEventHandler:function(M){M.eventType==="wheel"&&(M.preventDefault=!0)}}),this.outerTracker.userData="Navigator.outerTracker",i.setElementPointerEventsNone(this.canvas),i.setElementPointerEventsNone(this.container),this.addHandler("reset-size",function(){y.viewport&&y.viewport.goHome(!0)}),g.world.addHandler("item-index-change",function(M){window.setTimeout(function(){var L=y.world.getItemAt(M.previousIndex);y.world.setItemIndex(L,M.newIndex)},1)}),g.world.addHandler("remove-item",function(M){var L=M.item,q=y._getMatchingItem(L);q&&y.world.removeItem(q)}),this.update(g.viewport)},i.extend(i.Navigator.prototype,i.EventSource.prototype,i.Viewer.prototype,{updateSize:function(){if(this.viewport){var p=new i.Point(this.container.clientWidth===0?1:this.container.clientWidth,this.container.clientHeight===0?1:this.container.clientHeight);p.equals(this.oldContainerSize)||(this.viewport.resize(p,!0),this.viewport.goHome(!0),this.oldContainerSize=p,this.drawer.clear(),this.world.draw())}},setWidth:function(p){this.width=p,this.element.style.width=typeof p=="number"?p+"px":p,this._resizeWithViewer=!1},setHeight:function(p){this.height=p,this.element.style.height=typeof p=="number"?p+"px":p,this._resizeWithViewer=!1},setFlip:function(p){return this.viewport.setFlip(p),this.setDisplayTransform(this.viewer.viewport.getFlip()?"scale(-1,1)":"scale(1,1)"),this},setDisplayTransform:function(p){h(this.displayRegion,p),h(this.canvas,p),h(this.element,p)},update:function(p){var g,y,S,P,R,k;if(g=i.getElementSize(this.viewer.element),this._resizeWithViewer&&g.x&&g.y&&!g.equals(this.oldViewerSize)&&(this.oldViewerSize=g,this.maintainSizeRatio||!this.elementArea?(y=g.x*this.sizeRatio,S=g.y*this.sizeRatio):(y=Math.sqrt(this.elementArea*(g.x/g.y)),S=this.elementArea/y),this.element.style.width=Math.round(y)+"px",this.element.style.height=Math.round(S)+"px",this.elementArea||(this.elementArea=y*S),this.updateSize()),p&&this.viewport){P=p.getBoundsNoRotate(!0),R=this.viewport.pixelFromPointNoRotate(P.getTopLeft(),!1),k=this.viewport.pixelFromPointNoRotate(P.getBottomRight(),!1).minus(this.totalBorderWidths);var M=this.displayRegion.style;M.display=this.world.getItemCount()?"block":"none",M.top=Math.round(R.y)+"px",M.left=Math.round(R.x)+"px";var L=Math.abs(R.x-k.x),q=Math.abs(R.y-k.y);M.width=Math.round(Math.max(L,0))+"px",M.height=Math.round(Math.max(q,0))+"px"}},addTiledImage:function(p){var g=this,y=p.originalTiledImage;delete p.original;var S=i.extend({},p,{success:function(P){var R=P.item;R._originalForNavigator=y,g._matchBounds(R,y,!0),g._matchOpacity(R,y),g._matchCompositeOperation(R,y);function k(){g._matchBounds(R,y)}function M(){g._matchOpacity(R,y)}function L(){g._matchCompositeOperation(R,y)}y.addHandler("bounds-change",k),y.addHandler("clip-change",k),y.addHandler("opacity-change",M),y.addHandler("composite-operation-change",L)}});return i.Viewer.prototype.addTiledImage.apply(this,[S])},destroy:function(){return i.Viewer.prototype.destroy.apply(this)},_getMatchingItem:function(p){for(var g=this.world.getItemCount(),y,S=0;S1||s.y>1));r++);return r-1},getTileAtPoint:function(r,s){var o=s.x>=0&&s.x<=1&&s.y>=0&&s.y<=1/this.aspectRatio;i.console.assert(o,"[TileSource.getTileAtPoint] must be called with a valid point.");var u=this.dimensions.x*this.getLevelScale(r),h=s.x*u,p=s.y*u,g=Math.floor(h/this.getTileWidth(r)),y=Math.floor(p/this.getTileHeight(r));s.x>=1&&(g=this.getNumTiles(r).x-1);var S=1e-15;return s.y>=1/this.aspectRatio-S&&(y=this.getNumTiles(r).y-1),new i.Point(g,y)},getTileBounds:function(r,s,o,u){var h=this.dimensions.times(this.getLevelScale(r)),p=this.getTileWidth(r),g=this.getTileHeight(r),y=s===0?0:p*s-this.tileOverlap,S=o===0?0:g*o-this.tileOverlap,P=p+(s===0?1:2)*this.tileOverlap,R=g+(o===0?1:2)*this.tileOverlap,k=1/h.x;return P=Math.min(P,h.x-y),R=Math.min(R,h.y-S),u?new i.Rect(0,0,P,R):new i.Rect(y*k,S*k,P*k,R*k)},getImageInfo:function(r){var s=this,o,u,h,p,g,y,S;r&&(g=r.split("/"),y=g[g.length-1],S=y.lastIndexOf("."),S>-1&&(g[g.length-1]=y.slice(0,S)));var P=null;if(this.splitHashDataForPost){var R=r.indexOf("#");R!==-1&&(P=r.substring(R+1),r=r.substr(0,R))}u=function(k){typeof k=="string"&&(k=i.parseXml(k));var M=i.TileSource.determineType(s,k,r);if(!M){s.raiseEvent("open-failed",{message:"Unable to load TileSource",source:r});return}p=M.prototype.configure.apply(s,[k,r,P]),p.ajaxWithCredentials===void 0&&(p.ajaxWithCredentials=s.ajaxWithCredentials),h=new M(p),s.ready=!0,s.raiseEvent("ready",{tileSource:h})},r.match(/\.js$/)?(o=r.split("/").pop().replace(".js",""),i.jsonp({url:r,async:!1,callbackName:o,callback:u})):i.makeAjaxRequest({url:r,postData:P,withCredentials:this.ajaxWithCredentials,headers:this.ajaxHeaders,success:function(k){var M=n(k);u(M)},error:function(k,M){var L;try{L="HTTP "+k.status+" attempting to load TileSource: "+r}catch{var q;typeof M>"u"||!M.toString?q="Unknown error":q=M.toString(),L=q+" attempting to load TileSource: "+r}i.console.error(L),s.raiseEvent("open-failed",{message:L,source:r,postData:P})}})},supports:function(r,s){return!1},configure:function(r,s,o){throw new Error("Method not implemented.")},getTileUrl:function(r,s,o){throw new Error("Method not implemented.")},getTilePostData:function(r,s,o){return null},getTileAjaxHeaders:function(r,s,o){return{}},getTileHashKey:function(r,s,o,u,h,p){return h?u+"+"+JSON.stringify(h):u},tileExists:function(r,s,o){var u=this.getNumTiles(r);return r>=this.minLevel&&r<=this.maxLevel&&s>=0&&o>=0&&s=0;R--)for(k=this.displayRects[R],M=k.minLevel;M<=k.maxLevel;M++)this._levelRects[M]||(this._levelRects[M]=[]),this._levelRects[M].push(k);i.TileSource.apply(this,[L])},i.extend(i.DziTileSource.prototype,i.TileSource.prototype,{supports:function(s,o){var u;return s.Image?u=s.Image.xmlns:s.documentElement&&(s.documentElement.localName==="Image"||s.documentElement.tagName==="Image")&&(u=s.documentElement.namespaceURI),u=(u||"").toLowerCase(),u.indexOf("schemas.microsoft.com/deepzoom/2008")!==-1||u.indexOf("schemas.microsoft.com/deepzoom/2009")!==-1},configure:function(s,o,u){var h;return i.isPlainObject(s)?h=r(this,s):h=n(this,s),o&&!h.tilesUrl&&(h.tilesUrl=o.replace(/([^/]+?)(\.(dzi|xml|js)?(\?[^/]*)?)?\/?$/,"$1_files/"),o.search(/\.(dzi|xml|js)\?/)!==-1?h.queryParams=o.match(/\?.*/):h.queryParams=""),h},getTileUrl:function(s,o,u){return[this.tilesUrl,s,"/",o,"_",u,".",this.fileFormat,this.queryParams].join("")},tileExists:function(s,o,u){var h=this._levelRects[s],p,g,y,S,P,R,k;if(this.minLevel&&sthis.maxLevel)return!1;if(!h||!h.length)return!0;for(k=h.length-1;k>=0;k--)if(p=h[k],!(sp.maxLevel)&&(g=this.getLevelScale(s),y=p.x*g,S=p.y*g,P=y+p.width*g,R=S+p.height*g,y=Math.floor(y/this._tileWidth),S=Math.floor(S/this._tileWidth),P=Math.ceil(P/this._tileWidth),R=Math.ceil(R/this._tileWidth),y<=o&&o0?u.tileSize=Math.max.apply(null,P):u.tileSize=y}else this.sizes&&this.sizes.length>0?(this.emulateLegacyImagePyramid=!0,u.levels=r(this),i.extend(!0,u,{width:u.levels[u.levels.length-1].width,height:u.levels[u.levels.length-1].height,tileSize:Math.max(u.height,u.width),tileOverlap:0,minLevel:0,maxLevel:u.levels.length-1}),this.levels=u.levels):i.console.error("Nothing in the info.json to construct image pyramids from");if(!u.maxLevel&&!this.emulateLegacyImagePyramid)if(!this.scale_factors)u.maxLevel=Number(Math.ceil(Math.log(Math.max(this.width,this.height),2)));else{var k=Math.max.apply(null,this.scale_factors);u.maxLevel=Math.round(Math.log(k)*Math.LOG2E)}i.TileSource.apply(this,[u])},i.extend(i.IIIFTileSource.prototype,i.TileSource.prototype,{supports:function(u,h){return u.protocol&&u.protocol==="http://iiif.io/api/image"||u["@context"]&&(u["@context"]==="http://library.stanford.edu/iiif/image-api/1.1/context.json"||u["@context"]==="http://iiif.io/api/image/1/context.json")||u.profile&&u.profile.indexOf("http://library.stanford.edu/iiif/image-api/compliance.html")===0||u.identifier&&u.width&&u.height?!0:!!(u.documentElement&&u.documentElement.tagName==="info"&&u.documentElement.namespaceURI==="http://library.stanford.edu/iiif/image-api/ns/")},configure:function(u,h,p){if(i.isPlainObject(u)){if(!u["@context"])u["@context"]="http://iiif.io/api/image/1.0/context.json",u["@id"]=h.replace("/info.json",""),u.version=1;else{var y=u["@context"];if(Array.isArray(y)){for(var S=0;S0&&u>=this.minLevel&&u<=this.maxLevel&&(h=this.levels[u].width/this.levels[this.maxLevel].width),h}return i.TileSource.prototype.getLevelScale.call(this,u)},getNumTiles:function(u){if(this.emulateLegacyImagePyramid){var h=this.getLevelScale(u);return h?new i.Point(1,1):new i.Point(0,0)}return i.TileSource.prototype.getNumTiles.call(this,u)},getTileAtPoint:function(u,h){return this.emulateLegacyImagePyramid?new i.Point(0,0):i.TileSource.prototype.getTileAtPoint.call(this,u,h)},getTileUrl:function(u,h,p){if(this.emulateLegacyImagePyramid){var g=null;return this.levels.length>0&&u>=this.minLevel&&u<=this.maxLevel&&(g=this.levels[u].url),g}var y="0",S=Math.pow(.5,this.maxLevel-u),P=Math.ceil(this.width*S),R=Math.ceil(this.height*S),k,M,L,q,Z,J,ae,ye,pe,le,ze,tt,ot,qe;return k=this.getTileWidth(u),M=this.getTileHeight(u),L=Math.ceil(k/S),q=Math.ceil(M/S),this.version===1?ot="native."+this.tileFormat:ot="default."+this.tileFormat,P1&&u.profile[1].supports&&(y=u.profile[1].supports.indexOf("sizeByW")!==-1),u.version===3&&u.extraFeatures&&(y=u.extraFeatures.indexOf("sizeByWh")!==-1),!g||y}function r(u){for(var h=[],p=0;pg?y=p/256:y=g/256,h.maxLevel=Math.ceil(Math.log(y)/Math.log(2))-1,h.tileSize=256,h.width=p,h.height=g,i.TileSource.apply(this,[h])},i.extend(i.TmsTileSource.prototype,i.TileSource.prototype,{supports:function(n,r){return n.type&&n.type==="tiledmapservice"},configure:function(n,r,s){return n},getTileUrl:function(n,r,s){var o=this.getNumTiles(n).y-1;return this.tilesUrl+n+"/"+r+"/"+(o-s)+".png"}})}(e),function(i){i.ZoomifyTileSource=function(n){typeof n.tileSize>"u"&&(n.tileSize=256),typeof n.fileFormat>"u"&&(n.fileFormat="jpg",this.fileFormat=n.fileFormat);var r={x:n.width,y:n.height};for(n.imageSizes=[{x:n.width,y:n.height}],n.gridSize=[this._getGridSize(n.width,n.height,n.tileSize)];parseInt(r.x,10)>n.tileSize||parseInt(r.y,10)>n.tileSize;)r.x=Math.floor(r.x/2),r.y=Math.floor(r.y/2),n.imageSizes.push({x:r.x,y:r.y}),n.gridSize.push(this._getGridSize(r.x,r.y,n.tileSize));n.imageSizes.reverse(),n.gridSize.reverse(),n.minLevel=0,n.maxLevel=n.gridSize.length-1,e.TileSource.apply(this,[n])},i.extend(i.ZoomifyTileSource.prototype,i.TileSource.prototype,{_getGridSize:function(n,r,s){return{x:Math.ceil(n/s),y:Math.ceil(r/s)}},_calculateAbsoluteTileNumber:function(n,r,s){for(var o=0,u={},h=0;h0?(h=u.levels[u.levels.length-1].width,p=u.levels[u.levels.length-1].height):(h=0,p=0,i.console.error("No supported image formats found")),i.extend(!0,u,{width:h,height:p,tileSize:Math.max(p,h),tileOverlap:0,minLevel:0,maxLevel:u.levels.length>0?u.levels.length-1:0}),i.TileSource.apply(this,[u]),this.levels=u.levels},i.extend(i.LegacyTileSource.prototype,i.TileSource.prototype,{supports:function(o,u){return o.type&&o.type==="legacy-image-pyramid"||o.documentElement&&o.documentElement.getAttribute("type")==="legacy-image-pyramid"},configure:function(o,u,h){var p;return i.isPlainObject(o)?p=s(this,o):p=r(this,o),p},getLevelScale:function(o){var u=NaN;return this.levels.length>0&&o>=this.minLevel&&o<=this.maxLevel&&(u=this.levels[o].width/this.levels[this.maxLevel].width),u},getNumTiles:function(o){var u=this.getLevelScale(o);return u?new i.Point(1,1):new i.Point(0,0)},getTileUrl:function(o,u,h){var p=null;return this.levels.length>0&&o>=this.minLevel&&o<=this.maxLevel&&(p=this.levels[o].url),p}});function n(o){var u=[],h,p;for(p=0;p");return u.sort(function(g,y){return g.height-y.height})}function r(o,u){if(!u||!u.documentElement)throw new Error(i.getString("Errors.Xml"));var h=u.documentElement,p=h.tagName,g=null,y=[],S,P;if(p==="image")try{for(g={type:h.getAttribute("type"),levels:[]},y=h.getElementsByTagName("level"),P=0;P=this.minLevel&&n<=this.maxLevel&&(r=this.levels[n].width/this.levels[this.maxLevel].width),r},getNumTiles:function(n){var r=this.getLevelScale(n);return r?new i.Point(1,1):new i.Point(0,0)},getTileUrl:function(n,r,s){var o=null;return n>=this.minLevel&&n<=this.maxLevel&&(o=this.levels[n].url),o},getContext2D:function(n,r,s){var o=null;return n>=this.minLevel&&n<=this.maxLevel&&(o=this.levels[n].context2D),o},destroy:function(){this._freeupCanvasMemory()},_buildLevels:function(){var n=[{url:this._image.src,width:this._image.naturalWidth,height:this._image.naturalHeight}];if(!this.buildPyramid||!i.supportsCanvas||!this.useCanvas)return delete this._image,n;var r=this._image.naturalWidth,s=this._image.naturalHeight,o=document.createElement("canvas"),u=o.getContext("2d");if(o.width=r,o.height=s,u.drawImage(this._image,0,0,r,s),n[0].context2D=u,delete this._image,i.isCanvasTainted(o))return n;for(;r>=2&&s>=2;){r=Math.floor(r/2),s=Math.floor(s/2);var h=document.createElement("canvas"),p=h.getContext("2d");h.width=r,h.height=s,p.drawImage(o,0,0,r,s),n.splice(0,0,{context2D:p,width:r,height:s}),o=h,u=p}return n},_freeupCanvasMemory:function(){for(var n=0;n0&&n(p))}function s(p){p.shouldFade=!0,p.fadeBeginTime=i.now()+p.fadeDelay,window.setTimeout(function(){n(p)},p.fadeDelay)}function o(p){p.shouldFade=!1,p.imgGroup&&i.setElementOpacity(p.imgGroup,1,!0)}function u(p,g){p.element.disabled||(g>=i.ButtonState.GROUP&&p.currentState===i.ButtonState.REST&&(o(p),p.currentState=i.ButtonState.GROUP),g>=i.ButtonState.HOVER&&p.currentState===i.ButtonState.GROUP&&(p.imgHover&&(p.imgHover.style.visibility=""),p.currentState=i.ButtonState.HOVER),g>=i.ButtonState.DOWN&&p.currentState===i.ButtonState.HOVER&&(p.imgDown&&(p.imgDown.style.visibility=""),p.currentState=i.ButtonState.DOWN))}function h(p,g){p.element.disabled||(g<=i.ButtonState.HOVER&&p.currentState===i.ButtonState.DOWN&&(p.imgDown&&(p.imgDown.style.visibility="hidden"),p.currentState=i.ButtonState.HOVER),g<=i.ButtonState.GROUP&&p.currentState===i.ButtonState.HOVER&&(p.imgHover&&(p.imgHover.style.visibility="hidden"),p.currentState=i.ButtonState.GROUP),g<=i.ButtonState.REST&&p.currentState===i.ButtonState.GROUP&&(s(p),p.currentState=i.ButtonState.REST))}}(e),function(i){i.ButtonGroup=function(n){i.extend(!0,this,{buttons:[],clickTimeThreshold:i.DEFAULT_SETTINGS.clickTimeThreshold,clickDistThreshold:i.DEFAULT_SETTINGS.clickDistThreshold,labelText:""},n);var r=this.buttons.concat([]),s=this,o;if(this.element=n.element||i.makeNeutralElement("div"),!n.group)for(this.element.style.display="inline-block",o=0;o=270?(h=this.getTopRight(),this.x=h.x,this.y=h.y,p=this.height,this.height=this.width,this.width=p,this.degrees-=270):this.degrees>=180?(h=this.getBottomRight(),this.x=h.x,this.y=h.y,this.degrees-=180):this.degrees>=90&&(h=this.getBottomLeft(),this.x=h.x,this.y=h.y,p=this.height,this.height=this.width,this.width=p,this.degrees-=90)},i.Rect.fromSummits=function(n,r,s){var o=n.distanceTo(r),u=n.distanceTo(s),h=r.minus(n),p=Math.atan(h.y/h.x);return h.x<0?p+=Math.PI:h.y<0&&(p+=2*Math.PI),new i.Rect(n.x,n.y,o,u,p/Math.PI*180)},i.Rect.prototype={clone:function(){return new i.Rect(this.x,this.y,this.width,this.height,this.degrees)},getAspectRatio:function(){return this.width/this.height},getTopLeft:function(){return new i.Point(this.x,this.y)},getBottomRight:function(){return new i.Point(this.x+this.width,this.y+this.height).rotate(this.degrees,this.getTopLeft())},getTopRight:function(){return new i.Point(this.x+this.width,this.y).rotate(this.degrees,this.getTopLeft())},getBottomLeft:function(){return new i.Point(this.x,this.y+this.height).rotate(this.degrees,this.getTopLeft())},getCenter:function(){return new i.Point(this.x+this.width/2,this.y+this.height/2).rotate(this.degrees,this.getTopLeft())},getSize:function(){return new i.Point(this.width,this.height)},equals:function(n){return n instanceof i.Rect&&this.x===n.x&&this.y===n.y&&this.width===n.width&&this.height===n.height&&this.degrees===n.degrees},times:function(n){return new i.Rect(this.x*n,this.y*n,this.width*n,this.height*n,this.degrees)},translate:function(n){return new i.Rect(this.x+n.x,this.y+n.y,this.width,this.height,this.degrees)},union:function(n){var r=this.getBoundingBox(),s=n.getBoundingBox(),o=Math.min(r.x,s.x),u=Math.min(r.y,s.y),h=Math.max(r.x+r.width,s.x+s.width),p=Math.max(r.y+r.height,s.y+s.height);return new i.Rect(o,u,h-o,p-u)},intersection:function(n){var r=1e-10,s=[],o=this.getTopLeft();n.containsPoint(o,r)&&s.push(o);var u=this.getTopRight();n.containsPoint(u,r)&&s.push(u);var h=this.getBottomLeft();n.containsPoint(h,r)&&s.push(h);var p=this.getBottomRight();n.containsPoint(p,r)&&s.push(p);var g=n.getTopLeft();this.containsPoint(g,r)&&s.push(g);var y=n.getTopRight();this.containsPoint(y,r)&&s.push(y);var S=n.getBottomLeft();this.containsPoint(S,r)&&s.push(S);var P=n.getBottomRight();this.containsPoint(P,r)&&s.push(P);for(var R=this._getSegments(),k=n._getSegments(),M=0;Mpe&&(pe=ot.x),ot.yze&&(ze=ot.y)}return new i.Rect(ye,le,pe-ye,ze-le)},_getSegments:function(){var n=this.getTopLeft(),r=this.getTopRight(),s=this.getBottomLeft(),o=this.getBottomRight();return[[n,r],[r,o],[o,s],[s,n]]},rotate:function(n,r){if(n=i.positiveModulo(n,360),n===0)return this.clone();r=r||this.getCenter();var s=this.getTopLeft().rotate(n,r),o=this.getTopRight().rotate(n,r),u=o.minus(s);u=u.apply(function(p){var g=1e-15;return Math.abs(p)=-r&&(n.x-o.x)*h.x+(n.y-o.y)*h.y<=r&&(n.x-s.x)*p.x+(n.y-s.y)*p.y>=-r&&(n.x-u.x)*p.x+(n.y-u.y)*p.y<=r},toString:function(){return"["+Math.round(this.x*100)/100+", "+Math.round(this.y*100)/100+", "+Math.round(this.width*100)/100+"x"+Math.round(this.height*100)/100+", "+Math.round(this.degrees*100)/100+"deg]"}}}(e),function(i){var n={};i.ReferenceStrip=function(S){var P=this,R=S.viewer,k=i.getElementSize(R.element),M,L,q;for(S.id||(S.id="referencestrip-"+i.now(),this.element=i.makeNeutralElement("div"),this.element.id=S.id,this.element.className="referencestrip"),S=i.extend(!0,{sizeRatio:i.DEFAULT_SETTINGS.referenceStripSizeRatio,position:i.DEFAULT_SETTINGS.referenceStripPosition,scroll:i.DEFAULT_SETTINGS.referenceStripScroll,clickTimeThreshold:i.DEFAULT_SETTINGS.clickTimeThreshold},S,{element:this.element}),i.extend(this,S),n[this.id]={animating:!1},this.minPixelRatio=this.viewer.minPixelRatio,this.element.tabIndex=0,L=this.element.style,L.marginTop="0px",L.marginRight="0px",L.marginBottom="0px",L.marginLeft="0px",L.left="0px",L.bottom="0px",L.border="0px",L.background="#000",L.position="relative",i.setElementTouchActionNone(this.element),i.setElementOpacity(this.element,.8),this.viewer=R,this.tracker=new i.MouseTracker({userData:"ReferenceStrip.tracker",element:this.element,clickHandler:i.delegate(this,r),dragHandler:i.delegate(this,s),scrollHandler:i.delegate(this,o),enterHandler:i.delegate(this,h),leaveHandler:i.delegate(this,p),keyDownHandler:i.delegate(this,g),keyHandler:i.delegate(this,y),preProcessEventHandler:function(Z){Z.eventType==="wheel"&&(Z.preventDefault=!0)}}),S.width&&S.height?(this.element.style.width=S.width+"px",this.element.style.height=S.height+"px",R.addControl(this.element,{anchor:i.ControlAnchor.BOTTOM_LEFT})):S.scroll==="horizontal"?(this.element.style.width=k.x*S.sizeRatio*R.tileSources.length+12*R.tileSources.length+"px",this.element.style.height=k.y*S.sizeRatio+"px",R.addControl(this.element,{anchor:i.ControlAnchor.BOTTOM_LEFT})):(this.element.style.height=k.y*S.sizeRatio*R.tileSources.length+12*R.tileSources.length+"px",this.element.style.width=k.x*S.sizeRatio+"px",R.addControl(this.element,{anchor:i.ControlAnchor.TOP_LEFT})),this.panelWidth=k.x*this.sizeRatio+8,this.panelHeight=k.y*this.sizeRatio+8,this.panels=[],this.miniViewers={},q=0;qL+R.x-this.panelWidth?(Z=Math.min(Z,k-R.x),this.element.style.marginLeft=-Z+"px",u(this,R.x,-Z)):Zq+R.y-this.panelHeight?(Z=Math.min(Z,M-R.y),this.element.style.marginTop=-Z+"px",u(this,R.y,-Z)):Z0?P>-(k-L.x)&&(this.element.style.marginLeft=P+S.delta.x*2+"px",u(this,L.x,P+S.delta.x*2)):-S.delta.x<0&&P<0&&(this.element.style.marginLeft=P+S.delta.x*2+"px",u(this,L.x,P+S.delta.x*2)):-S.delta.y>0?R>-(M-L.y)&&(this.element.style.marginTop=R+S.delta.y*2+"px",u(this,L.y,R+S.delta.y*2)):-S.delta.y<0&&R<0&&(this.element.style.marginTop=R+S.delta.y*2+"px",u(this,L.y,R+S.delta.y*2))}}function o(S){if(this.element){var P=Number(this.element.style.marginLeft.replace("px","")),R=Number(this.element.style.marginTop.replace("px","")),k=Number(this.element.style.width.replace("px","")),M=Number(this.element.style.height.replace("px","")),L=i.getElementSize(this.viewer.canvas);this.scroll==="horizontal"?S.scroll>0?P>-(k-L.x)&&(this.element.style.marginLeft=P-S.scroll*60+"px",u(this,L.x,P-S.scroll*60)):S.scroll<0&&P<0&&(this.element.style.marginLeft=P-S.scroll*60+"px",u(this,L.x,P-S.scroll*60)):S.scroll<0?R>L.y-M&&(this.element.style.marginTop=R+S.scroll*60+"px",u(this,L.y,R+S.scroll*60)):S.scroll>0&&R<0&&(this.element.style.marginTop=R+S.scroll*60+"px",u(this,L.y,R+S.scroll*60)),S.preventDefault=!0}}function u(S,P,R){var k,M,L,q,Z,J;for(S.scroll==="horizontal"?k=S.panelWidth:k=S.panelHeight,M=Math.ceil(P/k)+5,L=Math.ceil((Math.abs(R)+P)/k)+1,M=L-M,M=M<0?0:M,Z=M;Z1?s[1].springStiffness:5,animationTime:s.length>1?s[1].animationTime:1.5}),i.console.assert(typeof r.springStiffness=="number"&&r.springStiffness!==0,"[OpenSeadragon.Spring] options.springStiffness must be a non-zero number"),i.console.assert(typeof r.animationTime=="number"&&r.animationTime>=0,"[OpenSeadragon.Spring] options.animationTime must be a number greater than or equal to 0"),r.exponential&&(this._exponential=!0,delete r.exponential),i.extend(!0,this,r),this.current={value:typeof this.initial=="number"?this.initial:this._exponential?0:1,time:i.now()},i.console.assert(!this._exponential||this.current.value!==0,"[OpenSeadragon.Spring] value must be non-zero for exponential springs"),this.start={value:this.current.value,time:this.current.time},this.target={value:this.current.value,time:this.current.time},this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},i.Spring.prototype={resetTo:function(r){i.console.assert(!this._exponential||r!==0,"[OpenSeadragon.Spring.resetTo] target must be non-zero for exponential springs"),this.start.value=this.target.value=this.current.value=r,this.start.time=this.target.time=this.current.time=i.now(),this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},springTo:function(r){i.console.assert(!this._exponential||r!==0,"[OpenSeadragon.Spring.springTo] target must be non-zero for exponential springs"),this.start.value=this.current.value,this.start.time=this.current.time,this.target.value=r,this.target.time=this.start.time+1e3*this.animationTime,this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value))},shiftBy:function(r){this.start.value+=r,this.target.value+=r,this._exponential&&(i.console.assert(this.target.value!==0&&this.start.value!==0,"[OpenSeadragon.Spring.shiftBy] spring value must be non-zero for exponential springs"),this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value))},setExponential:function(r){this._exponential=r,this._exponential&&(i.console.assert(this.current.value!==0&&this.target.value!==0&&this.start.value!==0,"[OpenSeadragon.Spring.setExponential] spring value must be non-zero for exponential springs"),this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},update:function(){this.current.time=i.now();var r,s;this._exponential?(r=this.start._logValue,s=this.target._logValue):(r=this.start.value,s=this.target.value);var o=this.current.time>=this.target.time?s:r+(s-r)*n(this.springStiffness,(this.current.time-this.start.time)/(this.target.time-this.start.time)),u=this.current.value;return this._exponential?this.current.value=Math.exp(o):this.current.value=o,u!==this.current.value},isAtTargetValue:function(){return this.current.value===this.target.value}};function n(r,s){return(1-Math.exp(r*-s))/(1-Math.exp(-r))}}(e),function(i){function n(s){i.extend(!0,this,{timeout:i.DEFAULT_SETTINGS.timeout,jobId:null},s),this.image=null}n.prototype={errorMsg:null,start:function(){var s=this,o=this.abort;this.image=new Image,this.image.onload=function(){s.finish(!0)},this.image.onabort=this.image.onerror=function(){s.errorMsg="Image load aborted",s.finish(!1)},this.jobId=window.setTimeout(function(){s.errorMsg="Image load exceeded timeout ("+s.timeout+" ms)",s.finish(!1)},this.timeout),this.loadWithAjax?(this.request=i.makeAjaxRequest({url:this.src,withCredentials:this.ajaxWithCredentials,headers:this.ajaxHeaders,responseType:"arraybuffer",postData:this.postData,success:function(u){var h;try{h=new window.Blob([u.response])}catch(S){var p=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder;if(S.name==="TypeError"&&p){var g=new p;g.append(u.response),h=g.getBlob()}}h.size===0&&(s.errorMsg="Empty image response.",s.finish(!1));var y=(window.URL||window.webkitURL).createObjectURL(h);s.image.src=y},error:function(u){s.errorMsg="Image load aborted - XHR error: Ajax returned "+u.status,s.finish(!1)}}),this.abort=function(){s.request.abort(),typeof o=="function"&&o()}):(this.crossOriginPolicy!==!1&&(this.image.crossOrigin=this.crossOriginPolicy),this.image.src=this.src)},finish:function(s){this.image.onload=this.image.onerror=this.image.onabort=null,s||(this.image=null),this.jobId&&window.clearTimeout(this.jobId),this.callback(this)}},i.ImageLoader=function(s){i.extend(!0,this,{jobLimit:i.DEFAULT_SETTINGS.imageLoaderLimit,timeout:i.DEFAULT_SETTINGS.timeout,jobQueue:[],jobsInProgress:0},s)},i.ImageLoader.prototype={addJob:function(s){var o=this,u=function(g){r(o,g,s.callback)},h={src:s.src,loadWithAjax:s.loadWithAjax,ajaxHeaders:s.loadWithAjax?s.ajaxHeaders:null,crossOriginPolicy:s.crossOriginPolicy,ajaxWithCredentials:s.ajaxWithCredentials,postData:s.postData,callback:u,abort:s.abort,timeout:this.timeout},p=new n(h);!this.jobLimit||this.jobsInProgress0&&(h=s.jobQueue.shift(),h.start(),s.jobsInProgress++),u(o.image,o.errorMsg,o.request)}}(e),function(i){i.Tile=function(n,r,s,o,u,h,p,g,y,S,P,R){this.level=n,this.x=r,this.y=s,this.bounds=o,this.sourceBounds=S,this.exists=u,this.url=h,this.postData=P,this.context2D=p,this.loadWithAjax=g,this.ajaxHeaders=y,R===void 0&&(i.console.error("Tile constructor needs 'cacheKey' variable: creation tile cache in Tile class is deprecated. TileSource.prototype.getTileHashKey will be used."),R=i.TileSource.prototype.getTileHashKey(n,r,s,h,y,P)),this.cacheKey=R,this.loaded=!1,this.loading=!1,this.element=null,this.imgElement=null,this.image=null,this.style=null,this.position=null,this.size=null,this.flipped=!1,this.blendStart=null,this.opacity=null,this.squaredDistance=null,this.visibility=null,this.beingDrawn=!1,this.lastTouchTime=0,this.isRightMost=!1,this.isBottomMost=!1},i.Tile.prototype={toString:function(){return this.level+"/"+this.x+"_"+this.y},_hasTransparencyChannel:function(){return!!this.context2D||this.url.match(".png")},drawHTML:function(n){if(!this.cacheImageRecord){i.console.warn("[Tile.drawHTML] attempting to draw tile %s when it's not cached",this.toString());return}if(!this.loaded){i.console.warn("Attempting to draw tile %s when it's not yet loaded.",this.toString());return}this.element||(this.element=i.makeNeutralElement("div"),this.imgElement=this.cacheImageRecord.getImage().cloneNode(),this.imgElement.style.msInterpolationMode="nearest-neighbor",this.imgElement.style.width="100%",this.imgElement.style.height="100%",this.style=this.element.style,this.style.position="absolute"),this.element.parentNode!==n&&n.appendChild(this.element),this.imgElement.parentNode!==this.element&&this.element.appendChild(this.imgElement),this.style.top=this.position.y+"px",this.style.left=this.position.x+"px",this.style.height=this.size.y+"px",this.style.width=this.size.x+"px",this.flipped&&(this.style.transform="scaleX(-1)"),i.setElementOpacity(this.element,this.opacity)},drawCanvas:function(n,r,s,o,u){var h=this.position.times(i.pixelDensityRatio),p=this.size.times(i.pixelDensityRatio),g;if(!this.context2D&&!this.cacheImageRecord){i.console.warn("[Tile.drawCanvas] attempting to draw tile %s when it's not cached",this.toString());return}if(g=this.context2D||this.cacheImageRecord.getRenderedContext(),!this.loaded||!g){i.console.warn("Attempting to draw tile %s when it's not yet loaded.",this.toString());return}n.save(),n.globalAlpha=this.opacity,typeof s=="number"&&s!==1&&(h=h.times(s),p=p.times(s)),o instanceof i.Point&&(h=h.plus(o)),n.globalAlpha===1&&this._hasTransparencyChannel()&&(u&&(h.x=Math.round(h.x),h.y=Math.round(h.y),p.x=Math.round(p.x),p.y=Math.round(p.y)),n.clearRect(h.x,h.y,p.x,p.y)),r({context:n,tile:this,rendered:g});var y,S;this.sourceBounds?(y=Math.min(this.sourceBounds.width,g.canvas.width),S=Math.min(this.sourceBounds.height,g.canvas.height)):(y=g.canvas.width,S=g.canvas.height),n.translate(h.x+p.x/2,0),this.flipped&&n.scale(-1,1),n.drawImage(g.canvas,0,0,y,S,-p.x/2,h.y,p.x,p.y),n.restore()},getScaleForEdgeSmoothing:function(){var n;if(this.cacheImageRecord)n=this.cacheImageRecord.getRenderedContext();else if(this.context2D)n=this.context2D;else return i.console.warn("[Tile.drawCanvas] attempting to get tile scale %s when tile's not cached",this.toString()),1;return n.canvas.width/(this.size.x*i.pixelDensityRatio)},getTranslationForEdgeSmoothing:function(n,r,s){var o=Math.max(1,Math.ceil((s.x-r.x)/2)),u=Math.max(1,Math.ceil((s.y-r.y)/2));return new i.Point(o,u).minus(this.position.times(i.pixelDensityRatio).times(n||1).apply(function(h){return h%1}))},unload:function(){this.imgElement&&this.imgElement.parentNode&&this.imgElement.parentNode.removeChild(this.imgElement),this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=null,this.imgElement=null,this.loaded=!1,this.loading=!1}}}(e),function(i){i.OverlayPlacement=i.Placement,i.OverlayRotationMode=i.freezeObject({NO_ROTATION:1,EXACT:2,BOUNDING_BOX:3}),i.Overlay=function(n,r,s){var o;i.isPlainObject(n)?o=n:o={element:n,location:r,placement:s},this.element=o.element,this.style=o.element.style,this._init(o)},i.Overlay.prototype={_init:function(n){this.location=n.location,this.placement=n.placement===void 0?i.Placement.TOP_LEFT:n.placement,this.onDraw=n.onDraw,this.checkResize=n.checkResize===void 0?!0:n.checkResize,this.width=n.width===void 0?null:n.width,this.height=n.height===void 0?null:n.height,this.rotationMode=n.rotationMode||i.OverlayRotationMode.EXACT,this.location instanceof i.Rect&&(this.width=this.location.width,this.height=this.location.height,this.location=this.location.getTopLeft(),this.placement=i.Placement.TOP_LEFT),this.scales=this.width!==null&&this.height!==null,this.bounds=new i.Rect(this.location.x,this.location.y,this.width,this.height),this.position=this.location},adjust:function(n,r){var s=i.Placement.properties[this.placement];s&&(s.isHorizontallyCentered?n.x-=r.x/2:s.isRight&&(n.x-=r.x),s.isVerticallyCentered?n.y-=r.y/2:s.isBottom&&(n.y-=r.y))},destroy:function(){var n=this.element,r=this.style;n.parentNode&&(n.parentNode.removeChild(n),n.prevElementParent&&(r.display="none",document.body.appendChild(n))),this.onDraw=null,r.top="",r.left="",r.position="",this.width!==null&&(r.width=""),this.height!==null&&(r.height="");var s=i.getCssPropertyWithVendorPrefix("transformOrigin"),o=i.getCssPropertyWithVendorPrefix("transform");s&&o&&(r[s]="",r[o]="")},drawHTML:function(n,r){var s=this.element;s.parentNode!==n&&(s.prevElementParent=s.parentNode,s.prevNextSibling=s.nextSibling,n.appendChild(s),this.style.position="absolute",this.size=i.getElementSize(s));var o=this._getOverlayPositionAndSize(r),u=o.position,h=this.size=o.size,p=o.rotate;if(this.onDraw)this.onDraw(u,h,this.element);else{var g=this.style;g.left=u.x+"px",g.top=u.y+"px",this.width!==null&&(g.width=h.x+"px"),this.height!==null&&(g.height=h.y+"px");var y=i.getCssPropertyWithVendorPrefix("transformOrigin"),S=i.getCssPropertyWithVendorPrefix("transform");y&&S&&(p?(g[y]=this._getTransformOrigin(),g[S]="rotate("+p+"deg)"):(g[y]="",g[S]="")),g.display="block"}},_getOverlayPositionAndSize:function(n){var r=n.pixelFromPoint(this.location,!0),s=this._getSizeInPixels(n);this.adjust(r,s);var o=0;if(n.degrees&&this.rotationMode!==i.OverlayRotationMode.NO_ROTATION)if(this.rotationMode===i.OverlayRotationMode.BOUNDING_BOX&&this.width!==null&&this.height!==null){var u=new i.Rect(r.x,r.y,s.x,s.y),h=this._getBoundingBox(u,n.degrees);r=h.getTopLeft(),s=h.getSize()}else o=n.degrees;return{position:r,size:s,rotate:o}},_getSizeInPixels:function(n){var r=this.size.x,s=this.size.y;if(this.width!==null||this.height!==null){var o=n.deltaPixelsFromPointsNoRotate(new i.Point(this.width||0,this.height||0),!0);this.width!==null&&(r=o.x),this.height!==null&&(s=o.y)}if(this.checkResize&&(this.width===null||this.height===null)){var u=this.size=i.getElementSize(this.element);this.width===null&&(r=u.x),this.height===null&&(s=u.y)}return new i.Point(r,s)},_getBoundingBox:function(n,r){var s=this._getPlacementPoint(n);return n.rotate(r,s).getBoundingBox()},_getPlacementPoint:function(n){var r=new i.Point(n.x,n.y),s=i.Placement.properties[this.placement];return s&&(s.isHorizontallyCentered?r.x+=n.width/2:s.isRight&&(r.x+=n.width),s.isVerticallyCentered?r.y+=n.height/2:s.isBottom&&(r.y+=n.height)),r},_getTransformOrigin:function(){var n="",r=i.Placement.properties[this.placement];return r&&(r.isLeft?n="left":r.isRight&&(n="right"),r.isTop?n+=" top":r.isBottom&&(n+=" bottom")),n},update:function(n,r){var s=i.isPlainObject(n)?n:{location:n,placement:r};this._init({location:s.location||this.location,placement:s.placement!==void 0?s.placement:this.placement,onDraw:s.onDraw||this.onDraw,checkResize:s.checkResize||this.checkResize,width:s.width!==void 0?s.width:this.width,height:s.height!==void 0?s.height:this.height,rotationMode:s.rotationMode||this.rotationMode})},getBounds:function(n){i.console.assert(n,"A viewport must now be passed to Overlay.getBounds.");var r=this.width,s=this.height;if(r===null||s===null){var o=n.deltaPointsFromPixelsNoRotate(this.size,!0);r===null&&(r=o.x),s===null&&(s=o.y)}var u=this.location.clone();return this.adjust(u,new i.Point(r,s)),this._adjustBoundsForRotation(n,new i.Rect(u.x,u.y,r,s))},_adjustBoundsForRotation:function(n,r){if(!n||n.degrees===0||this.rotationMode===i.OverlayRotationMode.EXACT)return r;if(this.rotationMode===i.OverlayRotationMode.BOUNDING_BOX){if(this.width===null||this.height===null)return r;var s=this._getOverlayPositionAndSize(n);return n.viewerElementToViewportRectangle(new i.Rect(s.position.x,s.position.y,s.size.x,s.size.y))}return r.rotate(-n.degrees,this._getPlacementPoint(r))}}}(e),function(i){i.Drawer=function(n){i.console.assert(n.viewer,"[Drawer] options.viewer is required");var r=arguments;if(i.isPlainObject(n)||(n={source:r[0],viewport:r[1],element:r[2]}),i.console.assert(n.viewport,"[Drawer] options.viewport is required"),i.console.assert(n.element,"[Drawer] options.element is required"),n.source&&i.console.error("[Drawer] options.source is no longer accepted; use TiledImage instead"),this.viewer=n.viewer,this.viewport=n.viewport,this.debugGridColor=typeof n.debugGridColor=="string"?[n.debugGridColor]:n.debugGridColor||i.DEFAULT_SETTINGS.debugGridColor,n.opacity&&i.console.error("[Drawer] options.opacity is no longer accepted; set the opacity on the TiledImage instead"),this.useCanvas=i.supportsCanvas&&(this.viewer?this.viewer.useCanvas:!0),this.container=i.getElement(n.element),this.canvas=i.makeNeutralElement(this.useCanvas?"canvas":"div"),this.context=this.useCanvas?this.canvas.getContext("2d"):null,this.sketchCanvas=null,this.sketchContext=null,this.element=this.container,this.container.dir="ltr",this.useCanvas){var s=this._calculateCanvasSize();this.canvas.width=s.x,this.canvas.height=s.y}this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.position="absolute",i.setElementOpacity(this.canvas,this.opacity,!0),i.setElementPointerEventsNone(this.canvas),i.setElementTouchActionNone(this.canvas),this.container.style.textAlign="left",this.container.appendChild(this.canvas),this._imageSmoothingEnabled=!0},i.Drawer.prototype={addOverlay:function(n,r,s,o){return i.console.error("drawer.addOverlay is deprecated. Use viewer.addOverlay instead."),this.viewer.addOverlay(n,r,s,o),this},updateOverlay:function(n,r,s){return i.console.error("drawer.updateOverlay is deprecated. Use viewer.updateOverlay instead."),this.viewer.updateOverlay(n,r,s),this},removeOverlay:function(n){return i.console.error("drawer.removeOverlay is deprecated. Use viewer.removeOverlay instead."),this.viewer.removeOverlay(n),this},clearOverlays:function(){return i.console.error("drawer.clearOverlays is deprecated. Use viewer.clearOverlays instead."),this.viewer.clearOverlays(),this},viewportCoordToDrawerCoord:function(n){var r=this.viewport.pixelFromPointNoRotate(n,!0);return new i.Point(r.x*i.pixelDensityRatio,r.y*i.pixelDensityRatio)},clipWithPolygons:function(n,r){if(this.useCanvas){var s=this._getContext(r);s.beginPath(),n.forEach(function(o){o.forEach(function(u,h){s[h===0?"moveTo":"lineTo"](u.x,u.y)})}),s.clip()}},setOpacity:function(n){i.console.error("drawer.setOpacity is deprecated. Use tiledImage.setOpacity instead.");for(var r=this.viewer.world,s=0;sr&&(r=o)}return r},needsUpdate:function(){return i.console.error("[Drawer.needsUpdate] this function is deprecated. Use World.needsDraw instead."),this.viewer.world.needsDraw()},numTilesLoaded:function(){return i.console.error("[Drawer.numTilesLoaded] this function is deprecated. Use TileCache.numTilesLoaded instead."),this.viewer.tileCache.numTilesLoaded()},reset:function(){return i.console.error("[Drawer.reset] this function is deprecated. Use World.resetItems instead."),this.viewer.world.resetItems(),this},update:function(){return i.console.error("[Drawer.update] this function is deprecated. Use Drawer.clear and World.draw instead."),this.clear(),this.viewer.world.draw(),this},canRotate:function(){return this.useCanvas},destroy:function(){this.canvas.width=1,this.canvas.height=1,this.sketchCanvas=null,this.sketchContext=null},clear:function(){if(this.canvas.innerHTML="",this.useCanvas){var n=this._calculateCanvasSize();if((this.canvas.width!==n.x||this.canvas.height!==n.y)&&(this.canvas.width=n.x,this.canvas.height=n.y,this._updateImageSmoothingEnabled(this.context),this.sketchCanvas!==null)){var r=this._calculateSketchCanvasSize();this.sketchCanvas.width=r.x,this.sketchCanvas.height=r.y,this._updateImageSmoothingEnabled(this.sketchContext)}this._clear()}},_clear:function(n,r){if(this.useCanvas){var s=this._getContext(n);if(r)s.clearRect(r.x,r.y,r.width,r.height);else{var o=s.canvas;s.clearRect(0,0,o.width,o.height)}}},viewportToDrawerRectangle:function(n){var r=this.viewport.pixelFromPointNoRotate(n.getTopLeft(),!0),s=this.viewport.deltaPixelsFromPointsNoRotate(n.getSize(),!0);return new i.Rect(r.x*i.pixelDensityRatio,r.y*i.pixelDensityRatio,s.x*i.pixelDensityRatio,s.y*i.pixelDensityRatio)},drawTile:function(n,r,s,o,u,h){if(i.console.assert(n,"[Drawer.drawTile] tile is required"),i.console.assert(r,"[Drawer.drawTile] drawingHandler is required"),this.useCanvas){var p=this._getContext(s);o=o||1,n.drawCanvas(p,r,o,u,h)}else n.drawHTML(this.canvas)},_getContext:function(n){var r=this.context;if(n){if(this.sketchCanvas===null){this.sketchCanvas=document.createElement("canvas");var s=this._calculateSketchCanvasSize();if(this.sketchCanvas.width=s.x,this.sketchCanvas.height=s.y,this.sketchContext=this.sketchCanvas.getContext("2d"),this.viewport.getRotation()===0){var o=this;this.viewer.addHandler("rotate",function u(){if(o.viewport.getRotation()!==0){o.viewer.removeHandler("rotate",u);var h=o._calculateSketchCanvasSize();o.sketchCanvas.width=h.x,o.sketchCanvas.height=h.y}})}this._updateImageSmoothingEnabled(this.sketchContext)}r=this.sketchContext}return r},saveContext:function(n){this.useCanvas&&this._getContext(n).save()},restoreContext:function(n){this.useCanvas&&this._getContext(n).restore()},setClip:function(n,r){if(this.useCanvas){var s=this._getContext(r);s.beginPath(),s.rect(n.x,n.y,n.width,n.height),s.clip()}},drawRectangle:function(n,r,s){if(this.useCanvas){var o=this._getContext(s);o.save(),o.fillStyle=r,o.fillRect(n.x,n.y,n.width,n.height),o.restore()}},blendSketch:function(n,r,s,o){var u=n;if(i.isPlainObject(u)||(u={opacity:n,scale:r,translate:s,compositeOperation:o}),!(!this.useCanvas||!this.sketchCanvas)){n=u.opacity,o=u.compositeOperation;var h=u.bounds;if(this.context.save(),this.context.globalAlpha=n,o&&(this.context.globalCompositeOperation=o),h)h.x<0&&(h.width+=h.x,h.x=0),h.x+h.width>this.canvas.width&&(h.width=this.canvas.width-h.x),h.y<0&&(h.height+=h.y,h.y=0),h.y+h.height>this.canvas.height&&(h.height=this.canvas.height-h.y),this.context.drawImage(this.sketchCanvas,h.x,h.y,h.width,h.height,h.x,h.y,h.width,h.height);else{r=u.scale||1,s=u.translate;var p=s instanceof i.Point?s:new i.Point(0,0),g=0,y=0;if(s){var S=this.sketchCanvas.width-this.canvas.width,P=this.sketchCanvas.height-this.canvas.height;g=Math.round(S/2),y=Math.round(P/2)}this.context.drawImage(this.sketchCanvas,p.x-g*r,p.y-y*r,(this.canvas.width+2*g)*r,(this.canvas.height+2*y)*r,-g,-y,this.canvas.width+2*g,this.canvas.height+2*y)}this.context.restore()}},drawDebugInfo:function(n,r,s,o){if(this.useCanvas){var u=this.viewer.world.getIndexOfItem(o)%this.debugGridColor.length,h=this.context;h.save(),h.lineWidth=2*i.pixelDensityRatio,h.font="small-caps bold "+13*i.pixelDensityRatio+"px arial",h.strokeStyle=this.debugGridColor[u],h.fillStyle=this.debugGridColor[u],this.viewport.degrees!==0&&this._offsetForRotation({degrees:this.viewport.degrees}),o.getRotation(!0)%360!==0&&this._offsetForRotation({degrees:o.getRotation(!0),point:o.viewport.pixelFromPointNoRotate(o._getRotationPoint(!0),!0)}),o.viewport.degrees===0&&o.getRotation(!0)%360===0&&o._drawer.viewer.viewport.getFlip()&&o._drawer._flip(),h.strokeRect(n.position.x*i.pixelDensityRatio,n.position.y*i.pixelDensityRatio,n.size.x*i.pixelDensityRatio,n.size.y*i.pixelDensityRatio);var p=(n.position.x+n.size.x/2)*i.pixelDensityRatio,g=(n.position.y+n.size.y/2)*i.pixelDensityRatio;h.translate(p,g),h.rotate(Math.PI/180*-this.viewport.degrees),h.translate(-p,-g),n.x===0&&n.y===0&&(h.fillText("Zoom: "+this.viewport.getZoom(),n.position.x*i.pixelDensityRatio,(n.position.y-30)*i.pixelDensityRatio),h.fillText("Pan: "+this.viewport.getBounds().toString(),n.position.x*i.pixelDensityRatio,(n.position.y-20)*i.pixelDensityRatio)),h.fillText("Level: "+n.level,(n.position.x+10)*i.pixelDensityRatio,(n.position.y+20)*i.pixelDensityRatio),h.fillText("Column: "+n.x,(n.position.x+10)*i.pixelDensityRatio,(n.position.y+30)*i.pixelDensityRatio),h.fillText("Row: "+n.y,(n.position.x+10)*i.pixelDensityRatio,(n.position.y+40)*i.pixelDensityRatio),h.fillText("Order: "+s+" of "+r,(n.position.x+10)*i.pixelDensityRatio,(n.position.y+50)*i.pixelDensityRatio),h.fillText("Size: "+n.size.toString(),(n.position.x+10)*i.pixelDensityRatio,(n.position.y+60)*i.pixelDensityRatio),h.fillText("Position: "+n.position.toString(),(n.position.x+10)*i.pixelDensityRatio,(n.position.y+70)*i.pixelDensityRatio),this.viewport.degrees!==0&&this._restoreRotationChanges(),o.getRotation(!0)%360!==0&&this._restoreRotationChanges(),o.viewport.degrees===0&&o.getRotation(!0)%360===0&&o._drawer.viewer.viewport.getFlip()&&o._drawer._flip(),h.restore()}},debugRect:function(n){if(this.useCanvas){var r=this.context;r.save(),r.lineWidth=2*i.pixelDensityRatio,r.strokeStyle=this.debugGridColor[0],r.fillStyle=this.debugGridColor[0],r.strokeRect(n.x*i.pixelDensityRatio,n.y*i.pixelDensityRatio,n.width*i.pixelDensityRatio,n.height*i.pixelDensityRatio),r.restore()}},setImageSmoothingEnabled:function(n){this.useCanvas&&(this._imageSmoothingEnabled=n,this._updateImageSmoothingEnabled(this.context),this.viewer.forceRedraw())},_updateImageSmoothingEnabled:function(n){n.msImageSmoothingEnabled=this._imageSmoothingEnabled,n.imageSmoothingEnabled=this._imageSmoothingEnabled},getCanvasSize:function(n){var r=this._getContext(n).canvas;return new i.Point(r.width,r.height)},getCanvasCenter:function(){return new i.Point(this.canvas.width/2,this.canvas.height/2)},_offsetForRotation:function(n){var r=n.point?n.point.times(i.pixelDensityRatio):this.getCanvasCenter(),s=this._getContext(n.useSketch);s.save(),s.translate(r.x,r.y),this.viewer.viewport.flipped?(s.rotate(Math.PI/180*-n.degrees),s.scale(-1,1)):s.rotate(Math.PI/180*n.degrees),s.translate(-r.x,-r.y)},_flip:function(n){n=n||{};var r=n.point?n.point.times(i.pixelDensityRatio):this.getCanvasCenter(),s=this._getContext(n.useSketch);s.translate(r.x,0),s.scale(-1,1),s.translate(-r.x,0)},_restoreRotationChanges:function(n){var r=this._getContext(n);r.restore()},_calculateCanvasSize:function(){var n=i.pixelDensityRatio,r=this.viewport.getContainerSize();return{x:Math.round(r.x*n),y:Math.round(r.y*n)}},_calculateSketchCanvasSize:function(){var n=this._calculateCanvasSize();if(this.viewport.getRotation()===0)return n;var r=Math.ceil(Math.sqrt(n.x*n.x+n.y*n.y));return{x:r,y:r}}}}(e),function(i){i.Viewport=function(n){var r=arguments;r.length&&r[0]instanceof i.Point&&(n={containerSize:r[0],contentSize:r[1],config:r[2]}),n.config&&(i.extend(!0,n,n.config),delete n.config),this._margins=i.extend({left:0,top:0,right:0,bottom:0},n.margins||{}),delete n.margins,i.extend(!0,this,{containerSize:null,contentSize:null,zoomPoint:null,viewer:null,springStiffness:i.DEFAULT_SETTINGS.springStiffness,animationTime:i.DEFAULT_SETTINGS.animationTime,minZoomImageRatio:i.DEFAULT_SETTINGS.minZoomImageRatio,maxZoomPixelRatio:i.DEFAULT_SETTINGS.maxZoomPixelRatio,visibilityRatio:i.DEFAULT_SETTINGS.visibilityRatio,wrapHorizontal:i.DEFAULT_SETTINGS.wrapHorizontal,wrapVertical:i.DEFAULT_SETTINGS.wrapVertical,defaultZoomLevel:i.DEFAULT_SETTINGS.defaultZoomLevel,minZoomLevel:i.DEFAULT_SETTINGS.minZoomLevel,maxZoomLevel:i.DEFAULT_SETTINGS.maxZoomLevel,degrees:i.DEFAULT_SETTINGS.degrees,flipped:i.DEFAULT_SETTINGS.flipped,homeFillsViewer:i.DEFAULT_SETTINGS.homeFillsViewer,silenceMultiImageWarnings:i.DEFAULT_SETTINGS.silenceMultiImageWarnings},n),this._updateContainerInnerSize(),this.centerSpringX=new i.Spring({initial:0,springStiffness:this.springStiffness,animationTime:this.animationTime}),this.centerSpringY=new i.Spring({initial:0,springStiffness:this.springStiffness,animationTime:this.animationTime}),this.zoomSpring=new i.Spring({exponential:!0,initial:1,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._oldCenterX=this.centerSpringX.current.value,this._oldCenterY=this.centerSpringY.current.value,this._oldZoom=this.zoomSpring.current.value,this._setContentBounds(new i.Rect(0,0,1,1),1),this.goHome(!0),this.update()},i.Viewport.prototype={resetContentSize:function(n){return i.console.assert(n,"[Viewport.resetContentSize] contentSize is required"),i.console.assert(n instanceof i.Point,"[Viewport.resetContentSize] contentSize must be an OpenSeadragon.Point"),i.console.assert(n.x>0,"[Viewport.resetContentSize] contentSize.x must be greater than 0"),i.console.assert(n.y>0,"[Viewport.resetContentSize] contentSize.y must be greater than 0"),this._setContentBounds(new i.Rect(0,0,1,n.y/n.x),n.x),this},setHomeBounds:function(n,r){i.console.error("[Viewport.setHomeBounds] this function is deprecated; The content bounds should not be set manually."),this._setContentBounds(n,r)},_setContentBounds:function(n,r){i.console.assert(n,"[Viewport._setContentBounds] bounds is required"),i.console.assert(n instanceof i.Rect,"[Viewport._setContentBounds] bounds must be an OpenSeadragon.Rect"),i.console.assert(n.width>0,"[Viewport._setContentBounds] bounds.width must be greater than 0"),i.console.assert(n.height>0,"[Viewport._setContentBounds] bounds.height must be greater than 0"),this._contentBoundsNoRotate=n.clone(),this._contentSizeNoRotate=this._contentBoundsNoRotate.getSize().times(r),this._contentBounds=n.rotate(this.degrees).getBoundingBox(),this._contentSize=this._contentBounds.getSize().times(r),this._contentAspectRatio=this._contentSize.x/this._contentSize.y,this.viewer&&this.viewer.raiseEvent("reset-size",{contentSize:this._contentSizeNoRotate.clone(),contentFactor:r,homeBounds:this._contentBoundsNoRotate.clone(),contentBounds:this._contentBounds.clone()})},getHomeZoom:function(){if(this.defaultZoomLevel)return this.defaultZoomLevel;var n=this._contentAspectRatio/this.getAspectRatio(),r;return this.homeFillsViewer?r=n>=1?n:1:r=n>=1?1:n,r/this._contentBounds.width},getHomeBounds:function(){return this.getHomeBoundsNoRotate().rotate(-this.getRotation())},getHomeBoundsNoRotate:function(){var n=this._contentBounds.getCenter(),r=1/this.getHomeZoom(),s=r/this.getAspectRatio();return new i.Rect(n.x-r/2,n.y-s/2,r,s)},goHome:function(n){return this.viewer&&this.viewer.raiseEvent("home",{immediately:n}),this.fitBounds(this.getHomeBounds(),n)},getMinZoom:function(){var n=this.getHomeZoom(),r=this.minZoomLevel?this.minZoomLevel:this.minZoomImageRatio*n;return r},getMaxZoom:function(){var n=this.maxZoomLevel;return n||(n=this._contentSize.x*this.maxZoomPixelRatio/this._containerInnerSize.x,n/=this._contentBounds.width),Math.max(n,this.getHomeZoom())},getAspectRatio:function(){return this._containerInnerSize.x/this._containerInnerSize.y},getContainerSize:function(){return new i.Point(this.containerSize.x,this.containerSize.y)},getMargins:function(){return i.extend({},this._margins)},setMargins:function(n){i.console.assert(i.type(n)==="object","[Viewport.setMargins] margins must be an object"),this._margins=i.extend({left:0,top:0,right:0,bottom:0},n),this._updateContainerInnerSize(),this.viewer&&this.viewer.forceRedraw()},getBounds:function(n){return this.getBoundsNoRotate(n).rotate(-this.getRotation())},getBoundsNoRotate:function(n){var r=this.getCenter(n),s=1/this.getZoom(n),o=s/this.getAspectRatio();return new i.Rect(r.x-s/2,r.y-o/2,s,o)},getBoundsWithMargins:function(n){return this.getBoundsNoRotateWithMargins(n).rotate(-this.getRotation(),this.getCenter(n))},getBoundsNoRotateWithMargins:function(n){var r=this.getBoundsNoRotate(n),s=this._containerInnerSize.x*this.getZoom(n);return r.x-=this._margins.left/s,r.y-=this._margins.top/s,r.width+=(this._margins.left+this._margins.right)/s,r.height+=(this._margins.top+this._margins.bottom)/s,r},getCenter:function(n){var r=new i.Point(this.centerSpringX.current.value,this.centerSpringY.current.value),s=new i.Point(this.centerSpringX.target.value,this.centerSpringY.target.value),o,u,h,p,g,y,S,P;return n?r:this.zoomPoint?(o=this.pixelFromPoint(this.zoomPoint,!0),u=this.getZoom(),h=1/u,p=h/this.getAspectRatio(),g=new i.Rect(r.x-h/2,r.y-p/2,h,p),y=this._pixelFromPoint(this.zoomPoint,g),S=y.minus(o),P=S.divide(this._containerInnerSize.x*u),s.plus(P)):s},getZoom:function(n){return n?this.zoomSpring.current.value:this.zoomSpring.target.value},_applyZoomConstraints:function(n){return Math.max(Math.min(n,this.getMaxZoom()),this.getMinZoom())},_applyBoundaryConstraints:function(n){var r=new i.Rect(n.x,n.y,n.width,n.height);if(!this.wrapHorizontal){var s=this.visibilityRatio*r.width,o=r.x+r.width,u=this._contentBoundsNoRotate.x+this._contentBoundsNoRotate.width,h=this._contentBoundsNoRotate.x-o+s,p=u-r.x-s;s>this._contentBoundsNoRotate.width?r.x+=(h+p)/2:p<0?r.x+=p:h>0&&(r.x+=h)}if(!this.wrapVertical){var g=this.visibilityRatio*r.height,y=r.y+r.height,S=this._contentBoundsNoRotate.y+this._contentBoundsNoRotate.height,P=this._contentBoundsNoRotate.y-y+g,R=S-r.y-g;g>this._contentBoundsNoRotate.height?r.y+=(P+R)/2:R<0?r.y+=R:P>0&&(r.y+=P)}return r},_raiseConstraintsEvent:function(n){this.viewer&&this.viewer.raiseEvent("constrain",{immediately:n})},applyConstraints:function(n){var r=this.getZoom(),s=this._applyZoomConstraints(r);r!==s&&this.zoomTo(s,this.zoomPoint,n);var o=this.getBoundsNoRotate(),u=this._applyBoundaryConstraints(o);return this._raiseConstraintsEvent(n),(o.x!==u.x||o.y!==u.y||n)&&this.fitBounds(u.rotate(-this.getRotation()),n),this},ensureVisible:function(n){return this.applyConstraints(n)},_fitBounds:function(n,r){r=r||{};var s=r.immediately||!1,o=r.constraints||!1,u=this.getAspectRatio(),h=n.getCenter(),p=new i.Rect(n.x,n.y,n.width,n.height,n.degrees+this.getRotation()).getBoundingBox();p.getAspectRatio()>=u?p.height=p.width/u:p.width=p.height*u,p.x=h.x-p.width/2,p.y=h.y-p.height/2;var g=1/p.width;if(o){var y=p.getAspectRatio(),S=this._applyZoomConstraints(g);g!==S&&(g=S,p.width=1/g,p.x=h.x-p.width/2,p.height=p.width/y,p.y=h.y-p.height/2),p=this._applyBoundaryConstraints(p),h=p.getCenter(),this._raiseConstraintsEvent(s)}if(s)return this.panTo(h,!0),this.zoomTo(g,null,!0);this.panTo(this.getCenter(!0),!0),this.zoomTo(this.getZoom(!0),null,!0);var P=this.getBounds(),R=this.getZoom();if(R===0||Math.abs(g/R-1)<1e-8)return this.zoomTo(g,!0),this.panTo(h,s);p=p.rotate(-this.getRotation());var k=p.getTopLeft().times(g).minus(P.getTopLeft().times(R)).divide(g-R);return this.zoomTo(g,k,s)},fitBounds:function(n,r){return this._fitBounds(n,{immediately:r,constraints:!1})},fitBoundsWithConstraints:function(n,r){return this._fitBounds(n,{immediately:r,constraints:!0})},fitVertically:function(n){var r=new i.Rect(this._contentBounds.x+this._contentBounds.width/2,this._contentBounds.y,0,this._contentBounds.height);return this.fitBounds(r,n)},fitHorizontally:function(n){var r=new i.Rect(this._contentBounds.x,this._contentBounds.y+this._contentBounds.height/2,this._contentBounds.width,0);return this.fitBounds(r,n)},getConstrainedBounds:function(n){var r,s;return r=this.getBounds(n),s=this._applyBoundaryConstraints(r),s},panBy:function(n,r){var s=new i.Point(this.centerSpringX.target.value,this.centerSpringY.target.value);return this.panTo(s.plus(n),r)},panTo:function(n,r){return r?(this.centerSpringX.resetTo(n.x),this.centerSpringY.resetTo(n.y)):(this.centerSpringX.springTo(n.x),this.centerSpringY.springTo(n.y)),this.viewer&&this.viewer.raiseEvent("pan",{center:n,immediately:r}),this},zoomBy:function(n,r,s){return this.zoomTo(this.zoomSpring.target.value*n,r,s)},zoomTo:function(n,r,s){var o=this;return this.zoomPoint=r instanceof i.Point&&!isNaN(r.x)&&!isNaN(r.y)?r:null,s?this._adjustCenterSpringsForZoomPoint(function(){o.zoomSpring.resetTo(n)}):this.zoomSpring.springTo(n),this.viewer&&this.viewer.raiseEvent("zoom",{zoom:n,refPoint:r,immediately:s}),this},setRotation:function(n){return!this.viewer||!this.viewer.drawer.canRotate()?this:(this.degrees=i.positiveModulo(n,360),this._setContentBounds(this.viewer.world.getHomeBounds(),this.viewer.world.getContentFactor()),this.viewer.forceRedraw(),this.viewer.raiseEvent("rotate",{degrees:n}),this)},getRotation:function(){return this.degrees},resize:function(n,r){var s=this.getBoundsNoRotate(),o=s,u;return this.containerSize.x=n.x,this.containerSize.y=n.y,this._updateContainerInnerSize(),r&&(u=n.x/this.containerSize.x,o.width=s.width*u,o.height=o.width/this.getAspectRatio()),this.viewer&&this.viewer.raiseEvent("resize",{newContainerSize:n,maintain:r}),this.fitBounds(o,!0)},_updateContainerInnerSize:function(){this._containerInnerSize=new i.Point(Math.max(1,this.containerSize.x-(this._margins.left+this._margins.right)),Math.max(1,this.containerSize.y-(this._margins.top+this._margins.bottom)))},update:function(){var n=this;this._adjustCenterSpringsForZoomPoint(function(){n.zoomSpring.update()}),this.centerSpringX.update(),this.centerSpringY.update();var r=this.centerSpringX.current.value!==this._oldCenterX||this.centerSpringY.current.value!==this._oldCenterY||this.zoomSpring.current.value!==this._oldZoom;return this._oldCenterX=this.centerSpringX.current.value,this._oldCenterY=this.centerSpringY.current.value,this._oldZoom=this.zoomSpring.current.value,r},_adjustCenterSpringsForZoomPoint:function(n){if(this.zoomPoint){var r=this.pixelFromPoint(this.zoomPoint,!0);n();var s=this.pixelFromPoint(this.zoomPoint,!0),o=s.minus(r),u=this.deltaPointsFromPixels(o,!0);this.centerSpringX.shiftBy(u.x),this.centerSpringY.shiftBy(u.y),this.zoomSpring.isAtTargetValue()&&(this.zoomPoint=null)}else n()},deltaPixelsFromPointsNoRotate:function(n,r){return n.times(this._containerInnerSize.x*this.getZoom(r))},deltaPixelsFromPoints:function(n,r){return this.deltaPixelsFromPointsNoRotate(n.rotate(this.getRotation()),r)},deltaPointsFromPixelsNoRotate:function(n,r){return n.divide(this._containerInnerSize.x*this.getZoom(r))},deltaPointsFromPixels:function(n,r){return this.deltaPointsFromPixelsNoRotate(n,r).rotate(-this.getRotation())},pixelFromPointNoRotate:function(n,r){return this._pixelFromPointNoRotate(n,this.getBoundsNoRotate(r))},pixelFromPoint:function(n,r){return this._pixelFromPoint(n,this.getBoundsNoRotate(r))},_pixelFromPointNoRotate:function(n,r){return n.minus(r.getTopLeft()).times(this._containerInnerSize.x/r.width).plus(new i.Point(this._margins.left,this._margins.top))},_pixelFromPoint:function(n,r){return this._pixelFromPointNoRotate(n.rotate(this.getRotation(),this.getCenter(!0)),r)},pointFromPixelNoRotate:function(n,r){var s=this.getBoundsNoRotate(r);return n.minus(new i.Point(this._margins.left,this._margins.top)).divide(this._containerInnerSize.x/s.width).plus(s.getTopLeft())},pointFromPixel:function(n,r){return this.pointFromPixelNoRotate(n,r).rotate(-this.getRotation(),this.getCenter(!0))},_viewportToImageDelta:function(n,r){var s=this._contentBoundsNoRotate.width;return new i.Point(n*this._contentSizeNoRotate.x/s,r*this._contentSizeNoRotate.x/s)},viewportToImageCoordinates:function(n,r){if(n instanceof i.Point)return this.viewportToImageCoordinates(n.x,n.y);if(this.viewer){var s=this.viewer.world.getItemCount();if(s>1)this.silenceMultiImageWarnings||i.console.error("[Viewport.viewportToImageCoordinates] is not accurate with multi-image; use TiledImage.viewportToImageCoordinates instead.");else if(s===1){var o=this.viewer.world.getItemAt(0);return o.viewportToImageCoordinates(n,r,!0)}}return this._viewportToImageDelta(n-this._contentBoundsNoRotate.x,r-this._contentBoundsNoRotate.y)},_imageToViewportDelta:function(n,r){var s=this._contentBoundsNoRotate.width;return new i.Point(n/this._contentSizeNoRotate.x*s,r/this._contentSizeNoRotate.x*s)},imageToViewportCoordinates:function(n,r){if(n instanceof i.Point)return this.imageToViewportCoordinates(n.x,n.y);if(this.viewer){var s=this.viewer.world.getItemCount();if(s>1)this.silenceMultiImageWarnings||i.console.error("[Viewport.imageToViewportCoordinates] is not accurate with multi-image; use TiledImage.imageToViewportCoordinates instead.");else if(s===1){var o=this.viewer.world.getItemAt(0);return o.imageToViewportCoordinates(n,r,!0)}}var u=this._imageToViewportDelta(n,r);return u.x+=this._contentBoundsNoRotate.x,u.y+=this._contentBoundsNoRotate.y,u},imageToViewportRectangle:function(n,r,s,o){var u=n;if(u instanceof i.Rect||(u=new i.Rect(n,r,s,o)),this.viewer){var h=this.viewer.world.getItemCount();if(h>1)this.silenceMultiImageWarnings||i.console.error("[Viewport.imageToViewportRectangle] is not accurate with multi-image; use TiledImage.imageToViewportRectangle instead.");else if(h===1){var p=this.viewer.world.getItemAt(0);return p.imageToViewportRectangle(n,r,s,o,!0)}}var g=this.imageToViewportCoordinates(u.x,u.y),y=this._imageToViewportDelta(u.width,u.height);return new i.Rect(g.x,g.y,y.x,y.y,u.degrees)},viewportToImageRectangle:function(n,r,s,o){var u=n;if(u instanceof i.Rect||(u=new i.Rect(n,r,s,o)),this.viewer){var h=this.viewer.world.getItemCount();if(h>1)this.silenceMultiImageWarnings||i.console.error("[Viewport.viewportToImageRectangle] is not accurate with multi-image; use TiledImage.viewportToImageRectangle instead.");else if(h===1){var p=this.viewer.world.getItemAt(0);return p.viewportToImageRectangle(n,r,s,o,!0)}}var g=this.viewportToImageCoordinates(u.x,u.y),y=this._viewportToImageDelta(u.width,u.height);return new i.Rect(g.x,g.y,y.x,y.y,u.degrees)},viewerElementToImageCoordinates:function(n){var r=this.pointFromPixel(n,!0);return this.viewportToImageCoordinates(r)},imageToViewerElementCoordinates:function(n){var r=this.imageToViewportCoordinates(n);return this.pixelFromPoint(r,!0)},windowToImageCoordinates:function(n){i.console.assert(this.viewer,"[Viewport.windowToImageCoordinates] the viewport must have a viewer.");var r=n.minus(i.getElementPosition(this.viewer.element));return this.viewerElementToImageCoordinates(r)},imageToWindowCoordinates:function(n){i.console.assert(this.viewer,"[Viewport.imageToWindowCoordinates] the viewport must have a viewer.");var r=this.imageToViewerElementCoordinates(n);return r.plus(i.getElementPosition(this.viewer.element))},viewerElementToViewportCoordinates:function(n){return this.pointFromPixel(n,!0)},viewportToViewerElementCoordinates:function(n){return this.pixelFromPoint(n,!0)},viewerElementToViewportRectangle:function(n){return i.Rect.fromSummits(this.pointFromPixel(n.getTopLeft(),!0),this.pointFromPixel(n.getTopRight(),!0),this.pointFromPixel(n.getBottomLeft(),!0))},viewportToViewerElementRectangle:function(n){return i.Rect.fromSummits(this.pixelFromPoint(n.getTopLeft(),!0),this.pixelFromPoint(n.getTopRight(),!0),this.pixelFromPoint(n.getBottomLeft(),!0))},windowToViewportCoordinates:function(n){i.console.assert(this.viewer,"[Viewport.windowToViewportCoordinates] the viewport must have a viewer.");var r=n.minus(i.getElementPosition(this.viewer.element));return this.viewerElementToViewportCoordinates(r)},viewportToWindowCoordinates:function(n){i.console.assert(this.viewer,"[Viewport.viewportToWindowCoordinates] the viewport must have a viewer.");var r=this.viewportToViewerElementCoordinates(n);return r.plus(i.getElementPosition(this.viewer.element))},viewportToImageZoom:function(n){if(this.viewer){var r=this.viewer.world.getItemCount();if(r>1)this.silenceMultiImageWarnings||i.console.error("[Viewport.viewportToImageZoom] is not accurate with multi-image.");else if(r===1){var s=this.viewer.world.getItemAt(0);return s.viewportToImageZoom(n)}}var o=this._contentSizeNoRotate.x,u=this._containerInnerSize.x,h=this._contentBoundsNoRotate.width,p=u/o*h;return n*p},imageToViewportZoom:function(n){if(this.viewer){var r=this.viewer.world.getItemCount();if(r>1)this.silenceMultiImageWarnings||i.console.error("[Viewport.imageToViewportZoom] is not accurate with multi-image.");else if(r===1){var s=this.viewer.world.getItemAt(0);return s.imageToViewportZoom(n)}}var o=this._contentSizeNoRotate.x,u=this._containerInnerSize.x,h=this._contentBoundsNoRotate.width,p=o/u/h;return n*p},toggleFlip:function(){return this.setFlip(!this.getFlip()),this},getFlip:function(){return this.flipped},setFlip:function(n){return this.flipped===n?this:(this.flipped=n,this.viewer.navigator&&this.viewer.navigator.setFlip(this.getFlip()),this.viewer.forceRedraw(),this.viewer.raiseEvent("flip",{flipped:n}),this)}}}(e),function(i){i.TiledImage=function(u){var h=this;i.console.assert(u.tileCache,"[TiledImage] options.tileCache is required"),i.console.assert(u.drawer,"[TiledImage] options.drawer is required"),i.console.assert(u.viewer,"[TiledImage] options.viewer is required"),i.console.assert(u.imageLoader,"[TiledImage] options.imageLoader is required"),i.console.assert(u.source,"[TiledImage] options.source is required"),i.console.assert(!u.clip||u.clip instanceof i.Rect,"[TiledImage] options.clip must be an OpenSeadragon.Rect if present"),i.EventSource.call(this),this._tileCache=u.tileCache,delete u.tileCache,this._drawer=u.drawer,delete u.drawer,this._imageLoader=u.imageLoader,delete u.imageLoader,u.clip instanceof i.Rect&&(this._clip=u.clip.clone()),delete u.clip;var p=u.x||0;delete u.x;var g=u.y||0;delete u.y,this.normHeight=u.source.dimensions.y/u.source.dimensions.x,this.contentAspectX=u.source.dimensions.x/u.source.dimensions.y;var y=1;u.width?(y=u.width,delete u.width,u.height&&(i.console.error("specifying both width and height to a tiledImage is not supported"),delete u.height)):u.height&&(y=u.height/this.normHeight,delete u.height);var S=u.fitBounds;delete u.fitBounds;var P=u.fitBoundsPlacement||e.Placement.CENTER;delete u.fitBoundsPlacement;var R=u.degrees||0;delete u.degrees,i.extend(!0,this,{viewer:null,tilesMatrix:{},coverage:{},loadingCoverage:{},lastDrawn:[],lastResetTime:0,_midDraw:!1,_needsDraw:!0,_hasOpaqueTile:!1,_tilesLoading:0,springStiffness:i.DEFAULT_SETTINGS.springStiffness,animationTime:i.DEFAULT_SETTINGS.animationTime,minZoomImageRatio:i.DEFAULT_SETTINGS.minZoomImageRatio,wrapHorizontal:i.DEFAULT_SETTINGS.wrapHorizontal,wrapVertical:i.DEFAULT_SETTINGS.wrapVertical,immediateRender:i.DEFAULT_SETTINGS.immediateRender,blendTime:i.DEFAULT_SETTINGS.blendTime,alwaysBlend:i.DEFAULT_SETTINGS.alwaysBlend,minPixelRatio:i.DEFAULT_SETTINGS.minPixelRatio,smoothTileEdgesMinZoom:i.DEFAULT_SETTINGS.smoothTileEdgesMinZoom,iOSDevice:i.DEFAULT_SETTINGS.iOSDevice,debugMode:i.DEFAULT_SETTINGS.debugMode,crossOriginPolicy:i.DEFAULT_SETTINGS.crossOriginPolicy,ajaxWithCredentials:i.DEFAULT_SETTINGS.ajaxWithCredentials,placeholderFillStyle:i.DEFAULT_SETTINGS.placeholderFillStyle,opacity:i.DEFAULT_SETTINGS.opacity,preload:i.DEFAULT_SETTINGS.preload,compositeOperation:i.DEFAULT_SETTINGS.compositeOperation,subPixelRoundingForTransparency:i.DEFAULT_SETTINGS.subPixelRoundingForTransparency},u),this._preload=this.preload,delete this.preload,this._fullyLoaded=!1,this._xSpring=new i.Spring({initial:p,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._ySpring=new i.Spring({initial:g,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._scaleSpring=new i.Spring({initial:y,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._degreesSpring=new i.Spring({initial:R,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._updateForScale(),S&&this.fitBounds(S,P,!0),this._drawingHandler=function(k){h.viewer.raiseEvent("tile-drawing",i.extend({tiledImage:h},k))}},i.extend(i.TiledImage.prototype,i.EventSource.prototype,{needsDraw:function(){return this._needsDraw},getFullyLoaded:function(){return this._fullyLoaded},_setFullyLoaded:function(u){u!==this._fullyLoaded&&(this._fullyLoaded=u,this.raiseEvent("fully-loaded-change",{fullyLoaded:this._fullyLoaded}))},reset:function(){this._tileCache.clearTilesFor(this),this.lastResetTime=i.now(),this._needsDraw=!0},update:function(){var u=this._xSpring.update(),h=this._ySpring.update(),p=this._scaleSpring.update(),g=this._degreesSpring.update();return u||h||p||g?(this._updateForScale(),this._needsDraw=!0,!0):!1},draw:function(){this.opacity!==0||this._preload?(this._midDraw=!0,this._updateViewport(),this._midDraw=!1):this._needsDraw=!1},destroy:function(){this.reset(),this.source.destroy&&this.source.destroy()},getBounds:function(u){return this.getBoundsNoRotate(u).rotate(this.getRotation(u),this._getRotationPoint(u))},getBoundsNoRotate:function(u){return u?new i.Rect(this._xSpring.current.value,this._ySpring.current.value,this._worldWidthCurrent,this._worldHeightCurrent):new i.Rect(this._xSpring.target.value,this._ySpring.target.value,this._worldWidthTarget,this._worldHeightTarget)},getWorldBounds:function(){return i.console.error("[TiledImage.getWorldBounds] is deprecated; use TiledImage.getBounds instead"),this.getBounds()},getClippedBounds:function(u){var h=this.getBoundsNoRotate(u);if(this._clip){var p=u?this._worldWidthCurrent:this._worldWidthTarget,g=p/this.source.dimensions.x,y=this._clip.times(g);h=new i.Rect(h.x+y.x,h.y+y.y,y.width,y.height)}return h.rotate(this.getRotation(u),this._getRotationPoint(u))},getTileBounds:function(u,h,p){var g=this.source.getNumTiles(u),y=(g.x+h%g.x)%g.x,S=(g.y+p%g.y)%g.y,P=this.source.getTileBounds(u,y,S);return this.getFlip()&&(P.x=1-P.x-P.width),P.x+=(h-y)/g.x,P.y+=this._worldHeightCurrent/this._worldWidthCurrent*((p-S)/g.y),P},getContentSize:function(){return new i.Point(this.source.dimensions.x,this.source.dimensions.y)},getSizeInWindowCoordinates:function(){var u=this.imageToWindowCoordinates(new i.Point(0,0)),h=this.imageToWindowCoordinates(this.getContentSize());return new i.Point(h.x-u.x,h.y-u.y)},_viewportToImageDelta:function(u,h,p){var g=p?this._scaleSpring.current.value:this._scaleSpring.target.value;return new i.Point(u*(this.source.dimensions.x/g),h*(this.source.dimensions.y*this.contentAspectX/g))},viewportToImageCoordinates:function(u,h,p){var g;return u instanceof i.Point?(p=h,g=u):g=new i.Point(u,h),g=g.rotate(-this.getRotation(p),this._getRotationPoint(p)),p?this._viewportToImageDelta(g.x-this._xSpring.current.value,g.y-this._ySpring.current.value):this._viewportToImageDelta(g.x-this._xSpring.target.value,g.y-this._ySpring.target.value)},_imageToViewportDelta:function(u,h,p){var g=p?this._scaleSpring.current.value:this._scaleSpring.target.value;return new i.Point(u/this.source.dimensions.x*g,h/this.source.dimensions.y/this.contentAspectX*g)},imageToViewportCoordinates:function(u,h,p){u instanceof i.Point&&(p=h,h=u.y,u=u.x);var g=this._imageToViewportDelta(u,h);return p?(g.x+=this._xSpring.current.value,g.y+=this._ySpring.current.value):(g.x+=this._xSpring.target.value,g.y+=this._ySpring.target.value),g.rotate(this.getRotation(p),this._getRotationPoint(p))},imageToViewportRectangle:function(u,h,p,g,y){var S=u;S instanceof i.Rect?y=h:S=new i.Rect(u,h,p,g);var P=this.imageToViewportCoordinates(S.getTopLeft(),y),R=this._imageToViewportDelta(S.width,S.height,y);return new i.Rect(P.x,P.y,R.x,R.y,S.degrees+this.getRotation(y))},viewportToImageRectangle:function(u,h,p,g,y){var S=u;u instanceof i.Rect?y=h:S=new i.Rect(u,h,p,g);var P=this.viewportToImageCoordinates(S.getTopLeft(),y),R=this._viewportToImageDelta(S.width,S.height,y);return new i.Rect(P.x,P.y,R.x,R.y,S.degrees-this.getRotation(y))},viewerElementToImageCoordinates:function(u){var h=this.viewport.pointFromPixel(u,!0);return this.viewportToImageCoordinates(h)},imageToViewerElementCoordinates:function(u){var h=this.imageToViewportCoordinates(u);return this.viewport.pixelFromPoint(h,!0)},windowToImageCoordinates:function(u){var h=u.minus(e.getElementPosition(this.viewer.element));return this.viewerElementToImageCoordinates(h)},imageToWindowCoordinates:function(u){var h=this.imageToViewerElementCoordinates(u);return h.plus(e.getElementPosition(this.viewer.element))},_viewportToTiledImageRectangle:function(u){var h=this._scaleSpring.current.value;return u=u.rotate(-this.getRotation(!0),this._getRotationPoint(!0)),new i.Rect((u.x-this._xSpring.current.value)/h,(u.y-this._ySpring.current.value)/h,u.width/h,u.height/h,u.degrees)},viewportToImageZoom:function(u){var h=this._scaleSpring.current.value*this.viewport._containerInnerSize.x/this.source.dimensions.x;return h*u},imageToViewportZoom:function(u){var h=this._scaleSpring.current.value*this.viewport._containerInnerSize.x/this.source.dimensions.x;return u/h},setPosition:function(u,h){var p=this._xSpring.target.value===u.x&&this._ySpring.target.value===u.y;if(h){if(p&&this._xSpring.current.value===u.x&&this._ySpring.current.value===u.y)return;this._xSpring.resetTo(u.x),this._ySpring.resetTo(u.y),this._needsDraw=!0}else{if(p)return;this._xSpring.springTo(u.x),this._ySpring.springTo(u.y),this._needsDraw=!0}p||this._raiseBoundsChange()},setWidth:function(u,h){this._setScale(u,h)},setHeight:function(u,h){this._setScale(u/this.normHeight,h)},setCroppingPolygons:function(u){var h=function(g){return g instanceof i.Point||typeof g.x=="number"&&typeof g.y=="number"},p=function(g){return g.map(function(y){try{if(h(y))return{x:y.x,y:y.y};throw new Error}catch{throw new Error("A Provided cropping polygon point is not supported")}})};try{if(!i.isArray(u))throw new Error("Provided cropping polygon is not an array");this._croppingPolygons=u.map(function(g){return p(g)})}catch(g){i.console.error("[TiledImage.setCroppingPolygons] Cropping polygon format not supported"),i.console.error(g),this._croppingPolygons=null}},resetCroppingPolygons:function(){this._croppingPolygons=null},fitBounds:function(u,h,p){h=h||i.Placement.CENTER;var g=i.Placement.properties[h],y=this.contentAspectX,S=0,P=0,R=1,k=1;if(this._clip&&(y=this._clip.getAspectRatio(),R=this._clip.width/this.source.dimensions.x,k=this._clip.height/this.source.dimensions.y,u.getAspectRatio()>y?(S=this._clip.x/this._clip.height*u.height,P=this._clip.y/this._clip.height*u.height):(S=this._clip.x/this._clip.width*u.width,P=this._clip.y/this._clip.width*u.width)),u.getAspectRatio()>y){var M=u.height/k,L=0;g.isHorizontallyCentered?L=(u.width-u.height*y)/2:g.isRight&&(L=u.width-u.height*y),this.setPosition(new i.Point(u.x-S+L,u.y-P),p),this.setHeight(M,p)}else{var q=u.width/R,Z=0;g.isVerticallyCentered?Z=(u.height-u.width/y)/2:g.isBottom&&(Z=u.height-u.width/y),this.setPosition(new i.Point(u.x-S,u.y-P+Z),p),this.setWidth(q,p)}},getClip:function(){return this._clip?this._clip.clone():null},setClip:function(u){i.console.assert(!u||u instanceof i.Rect,"[TiledImage.setClip] newClip must be an OpenSeadragon.Rect or null"),u instanceof i.Rect?this._clip=u.clone():this._clip=null,this._needsDraw=!0,this.raiseEvent("clip-change")},getFlip:function(){return!!this.flipped},setFlip:function(u){this.flipped=!!u,this._needsDraw=!0,this._raiseBoundsChange()},getOpacity:function(){return this.opacity},setOpacity:function(u){u!==this.opacity&&(this.opacity=u,this._needsDraw=!0,this.raiseEvent("opacity-change",{opacity:this.opacity}))},getPreload:function(){return this._preload},setPreload:function(u){this._preload=!!u,this._needsDraw=!0},getRotation:function(u){return u?this._degreesSpring.current.value:this._degreesSpring.target.value},setRotation:function(u,h){this._degreesSpring.target.value===u&&this._degreesSpring.isAtTargetValue()||(h?this._degreesSpring.resetTo(u):this._degreesSpring.springTo(u),this._needsDraw=!0,this._raiseBoundsChange())},_getRotationPoint:function(u){return this.getBoundsNoRotate(u).getCenter()},getCompositeOperation:function(){return this.compositeOperation},setCompositeOperation:function(u){u!==this.compositeOperation&&(this.compositeOperation=u,this._needsDraw=!0,this.raiseEvent("composite-operation-change",{compositeOperation:this.compositeOperation}))},_setScale:function(u,h){var p=this._scaleSpring.target.value===u;if(h){if(p&&this._scaleSpring.current.value===u)return;this._scaleSpring.resetTo(u),this._updateForScale(),this._needsDraw=!0}else{if(p)return;this._scaleSpring.springTo(u),this._updateForScale(),this._needsDraw=!0}p||this._raiseBoundsChange()},_updateForScale:function(){this._worldWidthTarget=this._scaleSpring.target.value,this._worldHeightTarget=this.normHeight*this._scaleSpring.target.value,this._worldWidthCurrent=this._scaleSpring.current.value,this._worldHeightCurrent=this.normHeight*this._scaleSpring.current.value},_raiseBoundsChange:function(){this.raiseEvent("bounds-change")},_isBottomItem:function(){return this.viewer.world.getItemAt(0)===this},_getLevelsInterval:function(){var u=Math.max(this.source.minLevel,Math.floor(Math.log(this.minZoomImageRatio)/Math.log(2))),h=this.viewport.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(0),!0).x*this._scaleSpring.current.value,p=Math.min(Math.abs(this.source.maxLevel),Math.abs(Math.floor(Math.log(h/this.minPixelRatio)/Math.log(2))));return p=Math.max(p,this.source.minLevel||0),u=Math.min(u,p),{lowestLevel:u,highestLevel:p}},_updateViewport:function(){for(this._needsDraw=!1,this._tilesLoading=0,this.loadingCoverage={};this.lastDrawn.length>0;){var u=this.lastDrawn.pop();u.beingDrawn=!1}var h=this.viewport,p=this._viewportToTiledImageRectangle(h.getBoundsWithMargins(!0));if(!this.wrapHorizontal&&!this.wrapVertical){var g=this._viewportToTiledImageRectangle(this.getClippedBounds(!0));if(p=p.intersection(g),p===null)return}for(var y=this._getLevelsInterval(),S=y.lowestLevel,P=y.highestLevel,R=null,k=!1,M=i.now(),L=P;L>=S;L--){var q=!1,Z=h.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(L),!0).x*this._scaleSpring.current.value;if(L===S||!k&&Z>=this.minPixelRatio)q=!0,k=!0;else if(!k)continue;var J=h.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(L),!1).x*this._scaleSpring.current.value,ae=h.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(Math.max(this.source.getClosestLevel(),0)),!1).x*this._scaleSpring.current.value,ye=this.immediateRender?1:ae,pe=Math.min(1,(Z-.5)/.5),le=ye/Math.abs(ye-J);if(R=this._updateLevel(k,q,L,pe,le,p,M,R),this._providesCoverage(this.coverage,L))break}this._drawTiles(this.lastDrawn),R&&!R.context2D?(this._loadTile(R,M),this._needsDraw=!0,this._setFullyLoaded(!1)):this._setFullyLoaded(this._tilesLoading===0)},_getCornerTiles:function(u,h,p){var g,y;this.wrapHorizontal?(g=i.positiveModulo(h.x,1),y=i.positiveModulo(p.x,1)):(g=Math.max(0,h.x),y=Math.min(1,p.x));var S,P,R=1/this.source.aspectRatio;this.wrapVertical?(S=i.positiveModulo(h.y,R),P=i.positiveModulo(p.y,R)):(S=Math.max(0,h.y),P=Math.min(R,p.y));var k=this.source.getTileAtPoint(u,new i.Point(g,S)),M=this.source.getTileAtPoint(u,new i.Point(y,P)),L=this.source.getNumTiles(u);return this.wrapHorizontal&&(k.x+=L.x*Math.floor(h.x),M.x+=L.x*Math.floor(p.x)),this.wrapVertical&&(k.y+=L.y*Math.floor(h.y/R),M.y+=L.y*Math.floor(p.y/R)),{topLeft:k,bottomRight:M}},_updateLevel:function(u,h,p,g,y,S,P,R){var k=S.getBoundingBox().getTopLeft(),M=S.getBoundingBox().getBottomRight();this.viewer&&this.viewer.raiseEvent("update-level",{tiledImage:this,havedrawn:u,level:p,opacity:g,visibility:y,drawArea:S,topleft:k,bottomright:M,currenttime:P,best:R}),this._resetCoverage(this.coverage,p),this._resetCoverage(this.loadingCoverage,p);var L=this._getCornerTiles(p,k,M),q=L.topLeft,Z=L.bottomRight,J=this.source.getNumTiles(p),ae=this.viewport.pixelFromPoint(this.viewport.getCenter());this.getFlip()&&(Z.x+=1,this.wrapHorizontal||(Z.x=Math.min(Z.x,J.x-1)));for(var ye=q.x;ye<=Z.x;ye++)for(var pe=q.y;pe<=Z.y;pe++){var le;if(this.getFlip()){var ze=(J.x+ye%J.x)%J.x;le=ye+J.x-ze-ze-1}else le=ye;S.intersection(this.getTileBounds(p,le,pe))!==null&&(R=this._updateTile(h,u,le,pe,p,g,y,ae,J,P,R))}return R},_updateTile:function(u,h,p,g,y,S,P,R,k,M,L){var q=this._getTile(p,g,y,M,k,this._worldWidthCurrent,this._worldHeightCurrent),Z=h;this.viewer&&this.viewer.raiseEvent("update-tile",{tiledImage:this,tile:q}),this._setCoverage(this.coverage,y,p,g,!1);var J=q.loaded||q.loading||this._isCovered(this.loadingCoverage,y,p,g);if(this._setCoverage(this.loadingCoverage,y,p,g,J),!q.exists||(u&&!Z&&(this._isCovered(this.coverage,y,p,g)?this._setCoverage(this.coverage,y,p,g,!0):Z=!0),!Z))return L;if(this._positionTile(q,this.source.tileOverlap,this.viewport,R,P),!q.loaded)if(q.context2D)this._setTileLoaded(q);else{var ae=this._tileCache.getImageRecord(q.cacheKey);if(ae){var ye=ae.getImage();this._setTileLoaded(q,ye)}}if(q.loaded){var pe=this._blendTile(q,p,g,y,S,M);pe&&(this._needsDraw=!0)}else q.loading?this._tilesLoading++:J||(L=this._compareTiles(L,q));return L},_getTile:function(u,h,p,g,y,S,P){var R,k,M,L,q,Z,J,ae,ye,pe,le=this.tilesMatrix,ze=this.source;return le[p]||(le[p]={}),le[p][u]||(le[p][u]={}),(!le[p][u][h]||!le[p][u][h].flipped!=!this.flipped)&&(R=(y.x+u%y.x)%y.x,k=(y.y+h%y.y)%y.y,M=this.getTileBounds(p,u,h),L=ze.getTileBounds(p,R,k,!0),q=ze.tileExists(p,R,k),Z=ze.getTileUrl(p,R,k),J=ze.getTilePostData(p,R,k),this.loadTilesWithAjax?(ae=ze.getTileAjaxHeaders(p,R,k),i.isPlainObject(this.ajaxHeaders)&&(ae=i.extend({},this.ajaxHeaders,ae))):ae=null,ye=ze.getContext2D?ze.getContext2D(p,R,k):void 0,pe=new i.Tile(p,u,h,M,q,Z,ye,this.loadTilesWithAjax,ae,L,J,ze.getTileHashKey(p,R,k,Z,ae,J)),this.getFlip()?R===0&&(pe.isRightMost=!0):R===y.x-1&&(pe.isRightMost=!0),k===y.y-1&&(pe.isBottomMost=!0),pe.flipped=this.flipped,le[p][u][h]=pe),pe=le[p][u][h],pe.lastTouchTime=g,pe},_loadTile:function(u,h){var p=this;u.loading=!0,this._imageLoader.addJob({src:u.url,postData:u.postData,loadWithAjax:u.loadWithAjax,ajaxHeaders:u.ajaxHeaders,crossOriginPolicy:this.crossOriginPolicy,ajaxWithCredentials:this.ajaxWithCredentials,callback:function(g,y,S){p._onTileLoad(u,h,g,y,S)},abort:function(){u.loading=!1}})},_onTileLoad:function(u,h,p,g,y){if(!p){i.console.error("Tile %s failed to load: %s - error: %s",u,u.url,g),this.viewer.raiseEvent("tile-load-failed",{tile:u,tiledImage:this,time:h,message:g,tileRequest:y}),u.loading=!1,u.exists=!1;return}if(hu.visibility||h.visibility===u.visibility&&h.squaredDistance1&&P>this.smoothTileEdgesMinZoom&&!this.iOSDevice&&this.getRotation(!0)%360===0&&i.supportsCanvas&&this.viewer.useCanvas&&(p=!0,g=h.getScaleForEdgeSmoothing(),y=h.getTranslationForEdgeSmoothing(g,this._drawer.getCanvasSize(!1),this._drawer.getCanvasSize(!0)));var R;p&&(g||(R=this.viewport.viewportToViewerElementRectangle(this.getClippedBounds(!0)).getIntegerBoundingBox(),this._drawer.viewer.viewport.getFlip()&&(this.viewport.degrees!==0||this.getRotation(!0)%360!==0)&&(R.x=this._drawer.viewer.container.clientWidth-(R.x+R.width)),R=R.times(i.pixelDensityRatio)),this._drawer._clear(!0,R)),g||(this.viewport.degrees!==0&&this._drawer._offsetForRotation({degrees:this.viewport.degrees,useSketch:p}),this.getRotation(!0)%360!==0&&this._drawer._offsetForRotation({degrees:this.getRotation(!0),point:this.viewport.pixelFromPointNoRotate(this._getRotationPoint(!0),!0),useSketch:p}),this.viewport.degrees===0&&this.getRotation(!0)%360===0&&this._drawer.viewer.viewport.getFlip()&&this._drawer._flip());var k=!1;if(this._clip){this._drawer.saveContext(p);var M=this.imageToViewportRectangle(this._clip,!0);M=M.rotate(-this.getRotation(!0),this._getRotationPoint(!0));var L=this._drawer.viewportToDrawerRectangle(M);g&&(L=L.times(g)),y&&(L=L.translate(y)),this._drawer.setClip(L,p),k=!0}if(this._croppingPolygons){this._drawer.saveContext(p);try{var q=this._croppingPolygons.map(function(ze){return ze.map(function(tt){var ot=this.imageToViewportCoordinates(tt.x,tt.y,!0).rotate(-this.getRotation(!0),this._getRotationPoint(!0)),qe=this._drawer.viewportCoordToDrawerCoord(ot);return g&&(qe=qe.times(g)),qe})});this._drawer.clipWithPolygons(q,p)}catch(ze){i.console.error(ze)}k=!0}if(this.placeholderFillStyle&&this._hasOpaqueTile===!1){var Z=this._drawer.viewportToDrawerRectangle(this.getBounds(!0));g&&(Z=Z.times(g)),y&&(Z=Z.translate(y));var J=null;typeof this.placeholderFillStyle=="function"?J=this.placeholderFillStyle(this,this._drawer.context):J=this.placeholderFillStyle,this._drawer.drawRectangle(Z,J,p)}var ae=o(this.subPixelRoundingForTransparency),ye=!1;if(ae===i.SUBPIXEL_ROUNDING_OCCURRENCES.ALWAYS)ye=!0;else if(ae===i.SUBPIXEL_ROUNDING_OCCURRENCES.ONLY_AT_REST){var pe=this.viewer&&this.viewer.isAnimating();ye=!pe}for(var le=u.length-1;le>=0;le--)h=u[le],this._drawer.drawTile(h,this._drawingHandler,p,g,y,ye),h.beingDrawn=!0,this.viewer&&this.viewer.raiseEvent("tile-drawn",{tiledImage:this,tile:h});k&&this._drawer.restoreContext(p),g||(this.getRotation(!0)%360!==0&&this._drawer._restoreRotationChanges(p),this.viewport.degrees!==0&&this._drawer._restoreRotationChanges(p)),p&&(g&&(this.viewport.degrees!==0&&this._drawer._offsetForRotation({degrees:this.viewport.degrees,useSketch:!1}),this.getRotation(!0)%360!==0&&this._drawer._offsetForRotation({degrees:this.getRotation(!0),point:this.viewport.pixelFromPointNoRotate(this._getRotationPoint(!0),!0),useSketch:!1})),this._drawer.blendSketch({opacity:this.opacity,scale:g,translate:y,compositeOperation:this.compositeOperation,bounds:R}),g&&(this.getRotation(!0)%360!==0&&this._drawer._restoreRotationChanges(!1),this.viewport.degrees!==0&&this._drawer._restoreRotationChanges(!1))),g||this.viewport.degrees===0&&this.getRotation(!0)%360===0&&this._drawer.viewer.viewport.getFlip()&&this._drawer._flip(),this._drawDebugInfo(u)}},_drawDebugInfo:function(u){if(this.debugMode)for(var h=u.length-1;h>=0;h--){var p=u[h];try{this._drawer.drawDebugInfo(p,u.length,h,this)}catch(g){i.console.error(g)}}},_providesCoverage:function(u,h,p,g){var y,S,P,R;if(!u[h])return!1;if(p===void 0||g===void 0){y=u[h];for(P in y)if(Object.prototype.hasOwnProperty.call(y,P)){S=y[P];for(R in S)if(Object.prototype.hasOwnProperty.call(S,R)&&!S[R])return!1}return!0}return u[h][p]===void 0||u[h][p][g]===void 0||u[h][p][g]===!0},_isCovered:function(u,h,p,g){return p===void 0||g===void 0?this._providesCoverage(u,h+1):this._providesCoverage(u,h+1,2*p,2*g)&&this._providesCoverage(u,h+1,2*p,2*g+1)&&this._providesCoverage(u,h+1,2*p+1,2*g)&&this._providesCoverage(u,h+1,2*p+1,2*g+1)},_setCoverage:function(u,h,p,g,y){if(!u[h]){i.console.warn("Setting coverage for a tile before its level's coverage has been reset: %s",h);return}u[h][p]||(u[h][p]={}),u[h][p][g]=y},_resetCoverage:function(u,h){u[h]={}}});var n=i.SUBPIXEL_ROUNDING_OCCURRENCES.NEVER;function r(u){return u!==i.SUBPIXEL_ROUNDING_OCCURRENCES.ALWAYS&&u!==i.SUBPIXEL_ROUNDING_OCCURRENCES.ONLY_AT_REST&&u!==i.SUBPIXEL_ROUNDING_OCCURRENCES.NEVER}function s(u){return r(u)?n:u}function o(u){if(typeof u=="number")return s(u);if(!u||!i.Browser)return n;var h=u[i.Browser.vendor];return r(h)&&(h=u["*"]),s(h)}}(e),function(i){var n=function(s){i.console.assert(s,"[TileCache.cacheTile] options is required"),i.console.assert(s.tile,"[TileCache.cacheTile] options.tile is required"),i.console.assert(s.tiledImage,"[TileCache.cacheTile] options.tiledImage is required"),this.tile=s.tile,this.tiledImage=s.tiledImage},r=function(s){i.console.assert(s,"[ImageRecord] options is required"),i.console.assert(s.image,"[ImageRecord] options.image is required"),this._image=s.image,this._tiles=[]};r.prototype={destroy:function(){this._image=null,this._renderedContext=null,this._tiles=null},getImage:function(){return this._image},getRenderedContext:function(){if(!this._renderedContext){var s=document.createElement("canvas");s.width=this._image.width,s.height=this._image.height,this._renderedContext=s.getContext("2d"),this._renderedContext.drawImage(this._image,0,0),this._image=null}return this._renderedContext},setRenderedContext:function(s){i.console.error("ImageRecord.setRenderedContext is deprecated. The rendered context should be created by the ImageRecord itself when calling ImageRecord.getRenderedContext."),this._renderedContext=s},addTile:function(s){i.console.assert(s,"[ImageRecord.addTile] tile is required"),this._tiles.push(s)},removeTile:function(s){for(var o=0;othis._maxImageCacheCount){for(var p=null,g=-1,y=null,S,P,R,k,M,L,q=this._tilesLoaded.length-1;q>=0;q--)if(L=this._tilesLoaded[q],S=L.tile,!(S.level<=o||S.beingDrawn)){if(!p){p=S,g=q,y=L;continue}k=S.lastTouchTime,P=p.lastTouchTime,M=S.level,R=p.level,(kR)&&(p=S,g=q,y=L)}p&&g>=0&&(this._unloadTile(y),u=g)}this._tilesLoaded[u]=new n({tile:s.tile,tiledImage:s.tiledImage})},clearTilesFor:function(s){i.console.assert(s,"[TileCache.clearTilesFor] tiledImage is required");for(var o,u=0;u=this._items.length)throw new Error("Index bigger than number of layers.");r===s||s===-1||(this._items.splice(s,1),this._items.splice(r,0,n),this._needsDraw=!0,this.raiseEvent("item-index-change",{item:n,previousIndex:s,newIndex:r}))},removeItem:function(n){i.console.assert(n,"[World.removeItem] item is required");var r=i.indexOf(this._items,n);r!==-1&&(n.removeHandler("bounds-change",this._delegatedFigureSizes),n.removeHandler("clip-change",this._delegatedFigureSizes),n.destroy(),this._items.splice(r,1),this._figureSizes(),this._needsDraw=!0,this._raiseRemoveItem(n))},removeAll:function(){this.viewer._cancelPendingImages();var n,r;for(r=0;rk.height?M=h:M=h*(k.width/k.height),L=M*(k.height/k.width),q=new i.Point(S+(h-M)/2,P+(h-L)/2),R.setPosition(q,r),R.setWidth(M,r),s==="horizontal"?S+=g:P+=g;this.setAutoRefigureSizes(!0)},_figureSizes:function(){var n=this._homeBounds?this._homeBounds.clone():null,r=this._contentSize?this._contentSize.clone():null,s=this._contentFactor||0;if(!this._items.length)this._homeBounds=new i.Rect(0,0,1,1),this._contentSize=new i.Point(1,1),this._contentFactor=1;else{var o=this._items[0],u=o.getBounds();this._contentFactor=o.getContentSize().x/u.width;for(var h=o.getClippedBounds().getBoundingBox(),p=h.x,g=h.y,y=h.x+h.width,S=h.y+h.height,P=1;Pd in l?i(l,d,{enumerable:!0,configurable:!0,writable:!0,value:a}):l[d]=a,r=(l,d,a)=>(n(l,typeof d!="symbol"?d+"":d,a),a),s,o,u,h,p,g,y,S={},P=[],R=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function k(l,d){for(var a in d)l[a]=d[a];return l}function M(l){var d=l.parentNode;d&&d.removeChild(l)}function L(l,d,a){var c,f,m,v={};for(m in d)m=="key"?c=d[m]:m=="ref"?f=d[m]:v[m]=d[m];if(arguments.length>2&&(v.children=arguments.length>3?s.call(arguments,2):a),typeof l=="function"&&l.defaultProps!=null)for(m in l.defaultProps)v[m]===void 0&&(v[m]=l.defaultProps[m]);return q(l,v,c,f,null)}function q(l,d,a,c,f){var m={type:l,props:d,key:a,ref:c,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:f??++u};return f==null&&o.vnode!=null&&o.vnode(m),m}function Z(){return{current:null}}function J(l){return l.children}function ae(l,d){this.props=l,this.context=d}function ye(l,d){if(d==null)return l.__?ye(l.__,l.__.__k.indexOf(l)+1):null;for(var a;d0?q(Y.type,Y.props,Y.key,null,Y.__v):Y)!=null){if(Y.__=a,Y.__b=a.__b+1,(H=ke[E])===null||H&&Y.key==H.key&&Y.type===H.type)ke[E]=void 0;else for(N=0;N2&&(v.children=arguments.length>3?s.call(arguments,2):a),q(l.type,v,c||l.key,f||l.ref,null)}function rn(l,d){var a={__c:d="__cC"+y++,__:l,Consumer:function(c,f){return c.children(f)},Provider:function(c){var f,m;return this.getChildContext||(f=[],(m={})[d]=this,this.getChildContext=function(){return m},this.shouldComponentUpdate=function(v){this.props.value!==v.value&&f.some(le)},this.sub=function(v){f.push(v);var _=v.componentWillUnmount;v.componentWillUnmount=function(){f.splice(f.indexOf(v),1),_&&_.call(v)}}),c.children}};return a.Provider.__=a.Consumer.contextType=a}s=P.slice,o={__e:function(l,d){for(var a,c,f;d=d.__;)if((a=d.__c)&&!a.__)try{if((c=a.constructor)&&c.getDerivedStateFromError!=null&&(a.setState(c.getDerivedStateFromError(l)),f=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(l),f=a.__d),f)return a.__E=a}catch(m){l=m}throw l}},u=0,ae.prototype.setState=function(l,d){var a;a=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=k({},this.state),typeof l=="function"&&(l=l(k({},a),this.props)),l&&k(a,l),l!=null&&this.__v&&(d&&this.__h.push(d),le(this))},ae.prototype.forceUpdate=function(l){this.__v&&(this.__e=!0,l&&this.__h.push(l),le(this))},ae.prototype.render=J,h=[],p=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ze.__r=0,y=0;var fn,Si,mr,Ce=0,Ie=[],O=o.__b,te=o.__r,Ee=o.diffed,Oe=o.__c,Q=o.unmount;function ne(l,d){o.__h&&o.__h(Si,l,Ce||d),Ce=0;var a=Si.__H||(Si.__H={__:[],__h:[]});return l>=a.__.length&&a.__.push({}),a.__[l]}function he(l){return Ce=1,Le(qt,l)}function Le(l,d,a){var c=ne(fn++,2);return c.t=l,c.__c||(c.__=[a?a(d):qt(void 0,d),function(f){var m=c.t(c.__[0],f);c.__[0]!==m&&(c.__=[m,c.__[1]],c.__c.setState({}))}],c.__c=Si),c.__}function nt(l,d){var a=ne(fn++,3);!o.__s&&St(a.__H,d)&&(a.__=l,a.__H=d,Si.__H.__h.push(a))}function je(l,d){var a=ne(fn++,4);!o.__s&&St(a.__H,d)&&(a.__=l,a.__H=d,Si.__h.push(a))}function Te(l){return Ce=5,Ze(function(){return{current:l}},[])}function Ue(l,d,a){Ce=6,je(function(){typeof l=="function"?l(d()):l&&(l.current=d())},a==null?a:a.concat(l))}function Ze(l,d){var a=ne(fn++,7);return St(a.__H,d)&&(a.__=l(),a.__H=d,a.__h=l),a.__}function _t(l,d){return Ce=8,Ze(function(){return l},d)}function Ut(l){var d=Si.context[l.__c],a=ne(fn++,9);return a.c=l,d?(a.__==null&&(a.__=!0,d.sub(Si)),d.props.value):l.__}function K(l,d){o.useDebugValue&&o.useDebugValue(d?d(l):l)}function j(l){var d=ne(fn++,10),a=he();return d.__=l,Si.componentDidCatch||(Si.componentDidCatch=function(c){d.__&&d.__(c),a[1](c)}),[a[0],function(){a[1](void 0)}]}function oe(){var l;for(Ie.sort(function(d,a){return d.__v.__b-a.__v.__b});l=Ie.pop();)if(l.__P)try{l.__H.__h.forEach(We),l.__H.__h.forEach(st),l.__H.__h=[]}catch(d){l.__H.__h=[],o.__e(d,l.__v)}}o.__b=function(l){Si=null,O&&O(l)},o.__r=function(l){te&&te(l),fn=0;var d=(Si=l.__c).__H;d&&(d.__h.forEach(We),d.__h.forEach(st),d.__h=[])},o.diffed=function(l){Ee&&Ee(l);var d=l.__c;d&&d.__H&&d.__H.__h.length&&(Ie.push(d)!==1&&mr===o.requestAnimationFrame||((mr=o.requestAnimationFrame)||function(a){var c,f=function(){clearTimeout(m),re&&cancelAnimationFrame(c),setTimeout(a)},m=setTimeout(f,100);re&&(c=requestAnimationFrame(f))})(oe)),Si=null},o.__c=function(l,d){d.some(function(a){try{a.__h.forEach(We),a.__h=a.__h.filter(function(c){return!c.__||st(c)})}catch(c){d.some(function(f){f.__h&&(f.__h=[])}),d=[],o.__e(c,a.__v)}}),Oe&&Oe(l,d)},o.unmount=function(l){Q&&Q(l);var d,a=l.__c;a&&a.__H&&(a.__H.__.forEach(function(c){try{We(c)}catch(f){d=f}}),d&&o.__e(d,a.__v))};var re=typeof requestAnimationFrame=="function";function We(l){var d=Si,a=l.__c;typeof a=="function"&&(l.__c=void 0,a()),Si=d}function st(l){var d=Si;l.__c=l.__(),Si=d}function St(l,d){return!l||l.length!==d.length||d.some(function(a,c){return a!==l[c]})}function qt(l,d){return typeof d=="function"?d(l):d}function Bt(l,d){for(var a in d)l[a]=d[a];return l}function zn(l,d){for(var a in l)if(a!=="__source"&&!(a in d))return!0;for(var c in d)if(c!=="__source"&&l[c]!==d[c])return!0;return!1}function Oi(l){this.props=l}function Er(l,d){function a(f){var m=this.props.ref,v=m==f.ref;return!v&&m&&(m.call?m(null):m.current=null),d?!d(this.props,f)||!v:zn(this.props,f)}function c(f){return this.shouldComponentUpdate=a,L(l,f)}return c.displayName="Memo("+(l.displayName||l.name)+")",c.prototype.isReactComponent=!0,c.__f=!0,c}(Oi.prototype=new ae).isPureReactComponent=!0,Oi.prototype.shouldComponentUpdate=function(l,d){return zn(this.props,l)||zn(this.state,d)};var _s=o.__b;o.__b=function(l){l.type&&l.type.__f&&l.ref&&(l.props.ref=l.ref,l.ref=null),_s&&_s(l)};var gr=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;function Vs(l){function d(a,c){var f=Bt({},a);return delete f.ref,l(f,(c=a.ref||c)&&(typeof c!="object"||"current"in c)?c:null)}return d.$$typeof=gr,d.render=d,d.prototype.isReactComponent=d.__f=!0,d.displayName="ForwardRef("+(l.displayName||l.name)+")",d}var qo=function(l,d){return l==null?null:qe(qe(l).map(d))},yt={map:qo,forEach:qo,count:function(l){return l?qe(l).length:0},only:function(l){var d=qe(l);if(d.length!==1)throw"Children.only";return d[0]},toArray:qe},no=o.__e;o.__e=function(l,d,a){if(l.then){for(var c,f=d;f=f.__;)if((c=f.__c)&&c.__c)return d.__e==null&&(d.__e=a.__e,d.__k=a.__k),c.__c(l,d)}no(l,d,a)};var Su=o.unmount;function sr(){this.__u=0,this.t=null,this.__b=null}function er(l){var d=l.__.__c;return d&&d.__e&&d.__e(l)}function hi(l){var d,a,c;function f(m){if(d||(d=l()).then(function(v){a=v.default||v},function(v){c=v}),c)throw c;if(!a)throw d;return L(a,m)}return f.displayName="Lazy",f.__f=!0,f}function ws(){this.u=null,this.o=null}o.unmount=function(l){var d=l.__c;d&&d.__R&&d.__R(),d&&l.__h===!0&&(l.type=null),Su&&Su(l)},(sr.prototype=new ae).__c=function(l,d){var a=d.__c,c=this;c.t==null&&(c.t=[]),c.t.push(a);var f=er(c.__v),m=!1,v=function(){m||(m=!0,a.__R=null,f?f(_):_())};a.__R=v;var _=function(){if(!--c.__u){if(c.state.__e){var x=c.state.__e;c.__v.__k[0]=function N(H,Y,ee){return H&&(H.__v=null,H.__k=H.__k&&H.__k.map(function(be){return N(be,Y,ee)}),H.__c&&H.__c.__P===Y&&(H.__e&&ee.insertBefore(H.__e,H.__d),H.__c.__e=!0,H.__c.__P=ee)),H}(x,x.__c.__P,x.__c.__O)}var E;for(c.setState({__e:c.__b=null});E=c.t.pop();)E.forceUpdate()}},w=d.__h===!0;c.__u++||w||c.setState({__e:c.__b=c.__v.__k[0]}),l.then(v,v)},sr.prototype.componentWillUnmount=function(){this.t=[]},sr.prototype.render=function(l,d){if(this.__b){if(this.__v.__k){var a=document.createElement("div"),c=this.__v.__k[0].__c;this.__v.__k[0]=function m(v,_,w){return v&&(v.__c&&v.__c.__H&&(v.__c.__H.__.forEach(function(x){typeof x.__c=="function"&&x.__c()}),v.__c.__H=null),(v=Bt({},v)).__c!=null&&(v.__c.__P===w&&(v.__c.__P=_),v.__c=null),v.__k=v.__k&&v.__k.map(function(x){return m(x,_,w)})),v}(this.__b,a,c.__O=c.__P)}this.__b=null}var f=d.__e&&L(J,null,l.fallback);return f&&(f.__h=null),[L(J,null,d.__e?null:l.children),f]};var Li=function(l,d,a){if(++a[1]===a[0]&&l.o.delete(d),l.props.revealOrder&&(l.props.revealOrder[0]!=="t"||!l.o.size))for(a=l.u;a;){for(;a.length>3;)a.pop()();if(a[1]>>1,1),d.i.removeChild(c)}}),dt(L(Gn,{context:d.context},l.__v),d.l)):d.l&&d.componentWillUnmount()}function wn(l,d){return L(Ts,{__v:l,i:d})}(ws.prototype=new ae).__e=function(l){var d=this,a=er(d.__v),c=d.o.get(l);return c[0]++,function(f){var m=function(){d.props.revealOrder?(c.push(f),Li(d,l,c)):f()};a?a(m):m()}},ws.prototype.render=function(l){this.u=null,this.o=new Map;var d=qe(l.children);l.revealOrder&&l.revealOrder[0]==="b"&&d.reverse();for(var a=d.length;a--;)this.o.set(d[a],this.u=[1,0,this.u]);return l.children},ws.prototype.componentDidUpdate=ws.prototype.componentDidMount=function(){var l=this;this.o.forEach(function(d,a){Li(l,a,d)})};var Ln=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Mr=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|marker(?!H|W|U)|overline|paint|stop|strikethrough|stroke|text(?!L)|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,or=typeof document<"u",_i=function(l){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/i:/fil|che|ra/i).test(l)};function Kn(l,d,a){return d.__k==null&&(d.textContent=""),dt(l,d),typeof a=="function"&&a(),l?l.__c:null}function gi(l,d,a){return un(l,d),typeof a=="function"&&a(),l?l.__c:null}ae.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(l){Object.defineProperty(ae.prototype,l,{configurable:!0,get:function(){return this["UNSAFE_"+l]},set:function(d){Object.defineProperty(this,l,{configurable:!0,writable:!0,value:d})}})});var xs=o.event;function Go(){}function Ra(){return this.cancelBubble}function Ht(){return this.defaultPrevented}o.event=function(l){return xs&&(l=xs(l)),l.persist=Go,l.isPropagationStopped=Ra,l.isDefaultPrevented=Ht,l.nativeEvent=l};var Re,rt={configurable:!0,get:function(){return this.class}},Dt=o.vnode;o.vnode=function(l){var d=l.type,a=l.props,c=a;if(typeof d=="string"){var f=d.indexOf("-")===-1;for(var m in c={},a){var v=a[m];or&&m==="children"&&d==="noscript"||m==="value"&&"defaultValue"in a&&v==null||(m==="defaultValue"&&"value"in a&&a.value==null?m="value":m==="download"&&v===!0?v="":/ondoubleclick/i.test(m)?m="ondblclick":/^onchange(textarea|input)/i.test(m+d)&&!_i(a.type)?m="oninput":/^onfocus$/i.test(m)?m="onfocusin":/^onblur$/i.test(m)?m="onfocusout":/^on(Ani|Tra|Tou|BeforeInp)/.test(m)?m=m.toLowerCase():f&&Mr.test(m)?m=m.replace(/[A-Z0-9]/,"-$&").toLowerCase():v===null&&(v=void 0),c[m]=v)}d=="select"&&c.multiple&&Array.isArray(c.value)&&(c.value=qe(a.children).forEach(function(_){_.props.selected=c.value.indexOf(_.props.value)!=-1})),d=="select"&&c.defaultValue!=null&&(c.value=qe(a.children).forEach(function(_){_.props.selected=c.multiple?c.defaultValue.indexOf(_.props.value)!=-1:c.defaultValue==_.props.value})),l.props=c,a.class!=a.className&&(rt.enumerable="className"in a,a.className!=null&&(c.class=a.className),Object.defineProperty(c,"className",rt))}l.$$typeof=Ln,Dt&&Dt(l)};var Ci=o.__r;o.__r=function(l){Ci&&Ci(l),Re=l.__c};var Mn={ReactCurrentDispatcher:{current:{readContext:function(l){return Re.__n[l.__c].props.value}}}},An="17.0.2";function tr(l){return L.bind(null,l)}function Cr(l){return!!l&&l.$$typeof===Ln}function Bi(l){return Cr(l)?Un.apply(null,arguments):l}function js(l){return!!l.__k&&(dt(null,l),!0)}function Fn(l){return l&&(l.base||l.nodeType===1&&l)||null}var Oa=function(l,d){return l(d)},La=function(l,d){return l(d)},Eu=J,Je={useState:he,useReducer:Le,useEffect:nt,useLayoutEffect:je,useRef:Te,useImperativeHandle:Ue,useMemo:Ze,useCallback:_t,useContext:Ut,useDebugValue:K,version:"17.0.2",Children:yt,render:Kn,hydrate:gi,unmountComponentAtNode:js,createPortal:wn,createElement:L,createContext:rn,createFactory:tr,cloneElement:Bi,createRef:Z,Fragment:J,isValidElement:Cr,findDOMNode:Fn,Component:ae,PureComponent:Oi,memo:Er,forwardRef:Vs,flushSync:La,unstable_batchedUpdates:Oa,StrictMode:J,Suspense:sr,SuspenseList:ws,lazy:hi,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Mn},Cu=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",default:Je,version:An,Children:yt,render:Kn,hydrate:gi,unmountComponentAtNode:js,createPortal:wn,createFactory:tr,cloneElement:Bi,isValidElement:Cr,findDOMNode:Fn,PureComponent:Oi,memo:Er,forwardRef:Vs,flushSync:La,unstable_batchedUpdates:Oa,StrictMode:Eu,Suspense:sr,SuspenseList:ws,lazy:hi,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Mn,createElement:L,createContext:rn,createRef:Z,Fragment:J,Component:ae,useState:he,useReducer:Le,useEffect:nt,useLayoutEffect:je,useRef:Te,useImperativeHandle:Ue,useMemo:Ze,useCallback:_t,useContext:Ut,useDebugValue:K,useErrorBoundary:j}),Fr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof cl<"u"?cl:typeof self<"u"?self:{};function El(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}function Ko(l){if(l.__esModule)return l;var d=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(l).forEach(function(a){var c=Object.getOwnPropertyDescriptor(l,a);Object.defineProperty(d,a,c.get?c:{enumerable:!0,get:function(){return l[a]}})}),d}var Co={exports:{}};function Au(){}Au.prototype={on:function(l,d,a){var c=this.e||(this.e={});return(c[l]||(c[l]=[])).push({fn:d,ctx:a}),this},once:function(l,d,a){var c=this;function f(){c.off(l,f),d.apply(a,arguments)}return f._=d,this.on(l,f,a)},emit:function(l){var d=[].slice.call(arguments,1),a=((this.e||(this.e={}))[l]||[]).slice(),c=0,f=a.length;for(c;c0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const a=(l=window.document)===null||l===void 0||(l=l.documentElement)===null||l===void 0?void 0:l.style;if(!a||d in a)return"";for(let c=0;cd===a.identifier)||l.changedTouches&&(0,lr.findInArray)(l.changedTouches,a=>d===a.identifier)}function cn(l){if(l.targetTouches&&l.targetTouches[0])return l.targetTouches[0].identifier;if(l.changedTouches&&l.changedTouches[0])return l.changedTouches[0].identifier}function Rl(l){if(!l)return;let d=l.getElementById("react-draggable-style-el");d||(d=l.createElement("style"),d.type="text/css",d.id="react-draggable-style-el",d.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} `,d.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;} `,l.getElementsByTagName("head")[0].appendChild(d)),l.body&&Ih(l.body,"react-draggable-transparent-selection")}function Ol(l){if(l)try{if(l.body&&Uc(l.body,"react-draggable-transparent-selection"),l.selection)l.selection.empty();else{const d=(l.defaultView||window).getSelection();d&&d.type!=="Caret"&&d.removeAllRanges()}}catch{}}function Ih(l,d){l.classList?l.classList.add(d):l.className.match(new RegExp("(?:^|\\s)".concat(d,"(?!\\S)")))||(l.className+=" ".concat(d))}function Uc(l,d){l.classList?l.classList.remove(d):l.className=l.className.replace(new RegExp("(?:^|\\s)".concat(d,"(?!\\S)"),"g"),"")}var Nr={};Object.defineProperty(Nr,"__esModule",{value:!0}),Nr.canDragX=ro,Nr.canDragY=is,Nr.createCoreData=zc,Nr.createDraggableData=nm,Nr.getBoundPosition=Ss,Nr.getControlPosition=Rh,Nr.snapToGrid=Hr;var ir=ts,Br=pn;function Ss(l,d,a){if(!l.props.bounds)return[d,a];let{bounds:c}=l.props;c=typeof c=="string"?c:rm(c);const f=Vc(l);if(typeof c=="string"){const{ownerDocument:m}=f,v=m.defaultView;let _;if(c==="parent"?_=f.parentNode:_=m.querySelector(c),!(_ instanceof v.HTMLElement))throw new Error('Bounds selector "'+c+'" could not find an element.');const w=_,x=v.getComputedStyle(f),E=v.getComputedStyle(w);c={left:-f.offsetLeft+(0,ir.int)(E.paddingLeft)+(0,ir.int)(x.marginLeft),top:-f.offsetTop+(0,ir.int)(E.paddingTop)+(0,ir.int)(x.marginTop),right:(0,Br.innerWidth)(w)-(0,Br.outerWidth)(f)-f.offsetLeft+(0,ir.int)(E.paddingRight)-(0,ir.int)(x.marginRight),bottom:(0,Br.innerHeight)(w)-(0,Br.outerHeight)(f)-f.offsetTop+(0,ir.int)(E.paddingBottom)-(0,ir.int)(x.marginBottom)}}return(0,ir.isNum)(c.right)&&(d=Math.min(d,c.right)),(0,ir.isNum)(c.bottom)&&(a=Math.min(a,c.bottom)),(0,ir.isNum)(c.left)&&(d=Math.max(d,c.left)),(0,ir.isNum)(c.top)&&(a=Math.max(a,c.top)),[d,a]}function Hr(l,d,a){const c=Math.round(d/l[0])*l[0],f=Math.round(a/l[1])*l[1];return[c,f]}function ro(l){return l.props.axis==="both"||l.props.axis==="x"}function is(l){return l.props.axis==="both"||l.props.axis==="y"}function Rh(l,d,a){const c=typeof d=="number"?(0,Br.getTouch)(l,d):null;if(typeof d=="number"&&!c)return null;const f=Vc(a),m=a.props.offsetParent||f.offsetParent||f.ownerDocument.body;return(0,Br.offsetXYFromParent)(c||l,m,a.props.scale)}function zc(l,d,a){const c=!(0,ir.isNum)(l.lastX),f=Vc(l);return c?{node:f,deltaX:0,deltaY:0,lastX:d,lastY:a,x:d,y:a}:{node:f,deltaX:d-l.lastX,deltaY:a-l.lastY,lastX:l.lastX,lastY:l.lastY,x:d,y:a}}function nm(l,d){const a=l.props.scale;return{node:d.node,x:l.state.x+d.deltaX/a,y:l.state.y+d.deltaY/a,deltaX:d.deltaX/a,deltaY:d.deltaY/a,lastX:l.state.x,lastY:l.state.y}}function rm(l){return{left:l.left,top:l.top,right:l.right,bottom:l.bottom}}function Vc(l){const d=l.findDOMNode();if(!d)throw new Error(": Unmounted during event!");return d}var Do={},Xo={};Object.defineProperty(Xo,"__esModule",{value:!0}),Xo.default=Lu;function Lu(){}Object.defineProperty(Do,"__esModule",{value:!0}),Do.default=void 0;var Zo=sm(Ar),nr=jc(Ao.exports),Po=jc(Ar),ur=pn,so=Nr,Mu=ts,Ba=jc(Xo);function jc(l){return l&&l.__esModule?l:{default:l}}function Wc(l){if(typeof WeakMap!="function")return null;var d=new WeakMap,a=new WeakMap;return(Wc=function(c){return c?a:d})(l)}function sm(l,d){if(l&&l.__esModule)return l;if(l===null||typeof l!="object"&&typeof l!="function")return{default:l};var a=Wc(d);if(a&&a.has(l))return a.get(l);var c={},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var m in l)if(m!=="default"&&Object.prototype.hasOwnProperty.call(l,m)){var v=f?Object.getOwnPropertyDescriptor(l,m):null;v&&(v.get||v.set)?Object.defineProperty(c,m,v):c[m]=l[m]}return c.default=l,a&&a.set(l,c),c}function mn(l,d,a){return d=om(d),d in l?Object.defineProperty(l,d,{value:a,enumerable:!0,configurable:!0,writable:!0}):l[d]=a,l}function om(l){var d=Fu(l,"string");return typeof d=="symbol"?d:String(d)}function Fu(l,d){if(typeof l!="object"||l===null)return l;var a=l[Symbol.toPrimitive];if(a!==void 0){var c=a.call(l,d);if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(l)}const Es={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let qs=Es.mouse;class Ll extends Zo.Component{constructor(){super(...arguments),mn(this,"dragging",!1),mn(this,"lastX",NaN),mn(this,"lastY",NaN),mn(this,"touchIdentifier",null),mn(this,"mounted",!1),mn(this,"handleDragStart",d=>{if(this.props.onMouseDown(d),!this.props.allowAnyClick&&typeof d.button=="number"&&d.button!==0)return!1;const a=this.findDOMNode();if(!a||!a.ownerDocument||!a.ownerDocument.body)throw new Error(" not mounted on DragStart!");const{ownerDocument:c}=a;if(this.props.disabled||!(d.target instanceof c.defaultView.Node)||this.props.handle&&!(0,ur.matchesSelectorAndParentsTo)(d.target,this.props.handle,a)||this.props.cancel&&(0,ur.matchesSelectorAndParentsTo)(d.target,this.props.cancel,a))return;d.type==="touchstart"&&d.preventDefault();const f=(0,ur.getTouchIdentifier)(d);this.touchIdentifier=f;const m=(0,so.getControlPosition)(d,f,this);if(m==null)return;const{x:v,y:_}=m,w=(0,so.createCoreData)(this,v,_);(0,Ba.default)("DraggableCore: handleDragStart: %j",w),(0,Ba.default)("calling",this.props.onStart),!(this.props.onStart(d,w)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,ur.addUserSelectStyles)(c),this.dragging=!0,this.lastX=v,this.lastY=_,(0,ur.addEvent)(c,qs.move,this.handleDrag),(0,ur.addEvent)(c,qs.stop,this.handleDragStop))}),mn(this,"handleDrag",d=>{const a=(0,so.getControlPosition)(d,this.touchIdentifier,this);if(a==null)return;let{x:c,y:f}=a;if(Array.isArray(this.props.grid)){let v=c-this.lastX,_=f-this.lastY;if([v,_]=(0,so.snapToGrid)(this.props.grid,v,_),!v&&!_)return;c=this.lastX+v,f=this.lastY+_}const m=(0,so.createCoreData)(this,c,f);if((0,Ba.default)("DraggableCore: handleDrag: %j",m),this.props.onDrag(d,m)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const v=document.createEvent("MouseEvents");v.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(v)}return}this.lastX=c,this.lastY=f}),mn(this,"handleDragStop",d=>{if(!this.dragging)return;const a=(0,so.getControlPosition)(d,this.touchIdentifier,this);if(a==null)return;let{x:c,y:f}=a;if(Array.isArray(this.props.grid)){let _=c-this.lastX||0,w=f-this.lastY||0;[_,w]=(0,so.snapToGrid)(this.props.grid,_,w),c=this.lastX+_,f=this.lastY+w}const m=(0,so.createCoreData)(this,c,f);if(this.props.onStop(d,m)===!1||this.mounted===!1)return!1;const v=this.findDOMNode();v&&this.props.enableUserSelectHack&&(0,ur.removeUserSelectStyles)(v.ownerDocument),(0,Ba.default)("DraggableCore: handleDragStop: %j",m),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,v&&((0,Ba.default)("DraggableCore: Removing handlers"),(0,ur.removeEvent)(v.ownerDocument,qs.move,this.handleDrag),(0,ur.removeEvent)(v.ownerDocument,qs.stop,this.handleDragStop))}),mn(this,"onMouseDown",d=>(qs=Es.mouse,this.handleDragStart(d))),mn(this,"onMouseUp",d=>(qs=Es.mouse,this.handleDragStop(d))),mn(this,"onTouchStart",d=>(qs=Es.touch,this.handleDragStart(d))),mn(this,"onTouchEnd",d=>(qs=Es.touch,this.handleDragStop(d)))}componentDidMount(){this.mounted=!0;const d=this.findDOMNode();d&&(0,ur.addEvent)(d,Es.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const d=this.findDOMNode();if(d){const{ownerDocument:a}=d;(0,ur.removeEvent)(a,Es.mouse.move,this.handleDrag),(0,ur.removeEvent)(a,Es.touch.move,this.handleDrag),(0,ur.removeEvent)(a,Es.mouse.stop,this.handleDragStop),(0,ur.removeEvent)(a,Es.touch.stop,this.handleDragStop),(0,ur.removeEvent)(d,Es.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,ur.removeUserSelectStyles)(a)}}findDOMNode(){var d,a;return(d=this.props)!==null&&d!==void 0&&d.nodeRef?(a=this.props)===null||a===void 0||(a=a.nodeRef)===null||a===void 0?void 0:a.current:Po.default.findDOMNode(this)}render(){return Zo.cloneElement(Zo.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}Do.default=Ll,mn(Ll,"displayName","DraggableCore"),mn(Ll,"propTypes",{allowAnyClick:nr.default.bool,children:nr.default.node.isRequired,disabled:nr.default.bool,enableUserSelectHack:nr.default.bool,offsetParent:function(l,d){if(l[d]&&l[d].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:nr.default.arrayOf(nr.default.number),handle:nr.default.string,cancel:nr.default.string,nodeRef:nr.default.object,onStart:nr.default.func,onDrag:nr.default.func,onStop:nr.default.func,onMouseDown:nr.default.func,scale:nr.default.number,className:Mu.dontSetMe,style:Mu.dontSetMe,transform:Mu.dontSetMe}),mn(Ll,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),function(l){Object.defineProperty(l,"__esModule",{value:!0}),Object.defineProperty(l,"DraggableCore",{enumerable:!0,get:function(){return w.default}}),l.default=void 0;var d=H(Ar),a=E(Ao.exports),c=E(Ar),f=E(Rc),m=pn,v=Nr,_=ts,w=E(Do),x=E(Xo);function E(U){return U&&U.__esModule?U:{default:U}}function N(U){if(typeof WeakMap!="function")return null;var ce=new WeakMap,Pe=new WeakMap;return(N=function(Ae){return Ae?Pe:ce})(U)}function H(U,ce){if(U&&U.__esModule)return U;if(U===null||typeof U!="object"&&typeof U!="function")return{default:U};var Pe=N(ce);if(Pe&&Pe.has(U))return Pe.get(U);var Ae={},Ne=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var Fe in U)if(Fe!=="default"&&Object.prototype.hasOwnProperty.call(U,Fe)){var lt=Ne?Object.getOwnPropertyDescriptor(U,Fe):null;lt&&(lt.get||lt.set)?Object.defineProperty(Ae,Fe,lt):Ae[Fe]=U[Fe]}return Ae.default=U,Pe&&Pe.set(U,Ae),Ae}function Y(){return Y=Object.assign?Object.assign.bind():function(U){for(var ce=1;ce{if((0,x.default)("Draggable: onDragStart: %j",Ae),this.props.onStart(Pe,(0,v.createDraggableData)(this,Ae))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),ee(this,"onDrag",(Pe,Ae)=>{if(!this.state.dragging)return!1;(0,x.default)("Draggable: onDrag: %j",Ae);const Ne=(0,v.createDraggableData)(this,Ae),Fe={x:Ne.x,y:Ne.y,slackX:0,slackY:0};if(this.props.bounds){const{x:lt,y:ht}=Fe;Fe.x+=this.state.slackX,Fe.y+=this.state.slackY;const[At,Lt]=(0,v.getBoundPosition)(this,Fe.x,Fe.y);Fe.x=At,Fe.y=Lt,Fe.slackX=this.state.slackX+(lt-Fe.x),Fe.slackY=this.state.slackY+(ht-Fe.y),Ne.x=Fe.x,Ne.y=Fe.y,Ne.deltaX=Fe.x-this.state.x,Ne.deltaY=Fe.y-this.state.y}if(this.props.onDrag(Pe,Ne)===!1)return!1;this.setState(Fe)}),ee(this,"onDragStop",(Pe,Ae)=>{if(!this.state.dragging||this.props.onStop(Pe,(0,v.createDraggableData)(this,Ae))===!1)return!1;(0,x.default)("Draggable: onDragStop: %j",Ae);const Ne={dragging:!1,slackX:0,slackY:0};if(this.props.position){const{x:Fe,y:lt}=this.props.position;Ne.x=Fe,Ne.y=lt}this.setState(Ne)}),this.state={dragging:!1,dragged:!1,x:ce.position?ce.position.x:ce.defaultPosition.x,y:ce.position?ce.position.y:ce.defaultPosition.y,prevPropsPosition:{...ce.position},slackX:0,slackY:0,isElementSVG:!1},ce.position&&!(ce.onDrag||ce.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var ce,Pe;return(ce=(Pe=this.props)===null||Pe===void 0||(Pe=Pe.nodeRef)===null||Pe===void 0?void 0:Pe.current)!==null&&ce!==void 0?ce:c.default.findDOMNode(this)}render(){const{axis:ce,bounds:Pe,children:Ae,defaultPosition:Ne,defaultClassName:Fe,defaultClassNameDragging:lt,defaultClassNameDragged:ht,position:At,positionOffset:Lt,scale:kt,...Yt}=this.props;let Xt={},di=null;const li=!At||this.state.dragging,Fi=At||Ne,zi={x:(0,v.canDragX)(this)&&li?this.state.x:Fi.x,y:(0,v.canDragY)(this)&&li?this.state.y:Fi.y};this.state.isElementSVG?di=(0,m.createSVGTransform)(zi,Lt):Xt=(0,m.createCSSTransform)(zi,Lt);const Tn=(0,f.default)(Ae.props.className||"",Fe,{[lt]:this.state.dragging,[ht]:this.state.dragged});return d.createElement(w.default,Y({},Yt,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),d.cloneElement(d.Children.only(Ae),{className:Tn,style:{...Ae.props.style,...Xt},transform:di}))}}l.default=ke,ee(ke,"displayName","Draggable"),ee(ke,"propTypes",{...w.default.propTypes,axis:a.default.oneOf(["both","x","y","none"]),bounds:a.default.oneOfType([a.default.shape({left:a.default.number,right:a.default.number,top:a.default.number,bottom:a.default.number}),a.default.string,a.default.oneOf([!1])]),defaultClassName:a.default.string,defaultClassNameDragging:a.default.string,defaultClassNameDragged:a.default.string,defaultPosition:a.default.shape({x:a.default.number,y:a.default.number}),positionOffset:a.default.shape({x:a.default.oneOfType([a.default.number,a.default.string]),y:a.default.oneOfType([a.default.number,a.default.string])}),position:a.default.shape({x:a.default.number,y:a.default.number}),className:_.dontSetMe,style:_.dontSetMe,transform:_.dontSetMe}),ee(ke,"defaultProps",{...w.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(Sh);const{default:Nu,DraggableCore:am}=Sh;Du.exports=Nu,Du.exports.default=Nu,Du.exports.DraggableCore=am;var lm=Du.exports,Oh=["second","minute","hour","day","week","month","year"];function qc(l,d){if(d===0)return["just now","right now"];var a=Oh[Math.floor(d/2)];return l>1&&(a+="s"),[l+" "+a+" ago","in "+l+" "+a]}var Lh=["秒","分钟","小时","天","周","个月","年"];function $i(l,d){if(d===0)return["刚刚","片刻后"];var a=Lh[~~(d/2)];return[l+" "+a+"前",l+" "+a+"后"]}var Gc={},gn=function(l,d){Gc[l]=d},Bu=function(l){return Gc[l]||Gc.en_US},Qo=[60,60,24,7,365/7/12,12];function Kc(l){return l instanceof Date?l:!isNaN(l)||/^\d+$/.test(l)?new Date(parseInt(l)):(l=(l||"").trim().replace(/\.\d+/,"").replace(/-/,"/").replace(/-/,"/").replace(/(\d)T(\d)/,"$1 $2").replace(/Z/," UTC").replace(/([+-]\d\d):?(\d\d)/," $1$2"),new Date(l))}function Yc(l,d){var a=l<0?1:0;l=Math.abs(l);for(var c=l,f=0;l>=Qo[f]&&f(f===0?9:1)&&(f+=1),d(l,f,c)[a].replace("%s",l.toString())}function Jo(l,d){var a=d?Kc(d):new Date;return(+a-+Kc(l))/1e3}function um(l){for(var d=1,a=0,c=Math.abs(l);l>=Qo[a]&&a{l.current&&!l.current.contains(event.target)&&d()};nt(()=>(document.addEventListener("mousedown",a),()=>document.removeEventListener("mousedown",a)))}var Fh=Object.prototype.toString,Nh=function(l){var d=Fh.call(l),a=d==="[object Arguments]";return a||(a=d!=="[object Array]"&&l!==null&&typeof l=="object"&&typeof l.length=="number"&&l.length>=0&&Fh.call(l.callee)==="[object Function]"),a},Bh;if(!Object.keys){var Nl=Object.prototype.hasOwnProperty,Qc=Object.prototype.toString,Jc=Nh,$c=Object.prototype.propertyIsEnumerable,Hh=!$c.call({toString:null},"toString"),Ur=$c.call(function(){},"prototype"),Cs=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],za=function(l){var d=l.constructor;return d&&d.prototype===l},hm={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},Va=function(){if(typeof window>"u")return!1;for(var l in window)try{if(!hm["$"+l]&&Nl.call(window,l)&&window[l]!==null&&typeof window[l]=="object")try{za(window[l])}catch{return!0}}catch{return!0}return!1}(),Uh=function(l){if(typeof window>"u"||!Va)return za(l);try{return za(l)}catch{return!1}};Bh=function(l){var d=l!==null&&typeof l=="object",a=Qc.call(l)==="[object Function]",c=Jc(l),f=d&&Qc.call(l)==="[object String]",m=[];if(!d&&!a&&!c)throw new TypeError("Object.keys called on a non-object");var v=Ur&&a;if(f&&l.length>0&&!Nl.call(l,0))for(var _=0;_0)for(var w=0;w"u"||!yn?yi:yn(Uint8Array),Pn={"%AggregateError%":typeof AggregateError>"u"?yi:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?yi:ArrayBuffer,"%ArrayIteratorPrototype%":Wa&&yn?yn([][Symbol.iterator]()):yi,"%AsyncFromSyncIteratorPrototype%":yi,"%AsyncFunction%":Ai,"%AsyncGenerator%":Ai,"%AsyncGeneratorFunction%":Ai,"%AsyncIteratorPrototype%":Ai,"%Atomics%":typeof Atomics>"u"?yi:Atomics,"%BigInt%":typeof BigInt>"u"?yi:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?yi:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?yi:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?yi:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?yi:Float32Array,"%Float64Array%":typeof Float64Array>"u"?yi:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?yi:FinalizationRegistry,"%Function%":ea,"%GeneratorFunction%":Ai,"%Int8Array%":typeof Int8Array>"u"?yi:Int8Array,"%Int16Array%":typeof Int16Array>"u"?yi:Int16Array,"%Int32Array%":typeof Int32Array>"u"?yi:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Wa&&yn?yn(yn([][Symbol.iterator]())):yi,"%JSON%":typeof JSON=="object"?JSON:yi,"%Map%":typeof Map>"u"?yi:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Wa||!yn?yi:yn(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?yi:Promise,"%Proxy%":typeof Proxy>"u"?yi:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?yi:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?yi:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Wa||!yn?yi:yn(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?yi:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Wa&&yn?yn(""[Symbol.iterator]()):yi,"%Symbol%":Wa?Symbol:yi,"%SyntaxError%":oo,"%ThrowTypeError%":Qh,"%TypedArray%":ta,"%TypeError%":ao,"%Uint8Array%":typeof Uint8Array>"u"?yi:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?yi:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?yi:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?yi:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?yi:WeakMap,"%WeakRef%":typeof WeakRef>"u"?yi:WeakRef,"%WeakSet%":typeof WeakSet>"u"?yi:WeakSet};if(yn)try{null.error}catch(l){var Gs=yn(yn(l));Pn["%Error.prototype%"]=Gs}var xm=function l(d){var a;if(d==="%AsyncFunction%")a=qu("async function () {}");else if(d==="%GeneratorFunction%")a=qu("function* () {}");else if(d==="%AsyncGeneratorFunction%")a=qu("async function* () {}");else if(d==="%AsyncGenerator%"){var c=l("%AsyncGeneratorFunction%");c&&(a=c.prototype)}else if(d==="%AsyncIteratorPrototype%"){var f=l("%AsyncGenerator%");f&&yn&&(a=yn(f.prototype))}return Pn[d]=a,a},nd={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Ul=ed,Gu=Hl,Sm=Ul.call(Function.call,Array.prototype.concat),Em=Ul.call(Function.apply,Array.prototype.splice),$h=Ul.call(Function.call,String.prototype.replace),Ku=Ul.call(Function.call,String.prototype.slice),Cm=Ul.call(Function.call,RegExp.prototype.exec),ef=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,T=/\\(\\)?/g,A=function(l){var d=Ku(l,0,1),a=Ku(l,-1);if(d==="%"&&a!=="%")throw new oo("invalid intrinsic syntax, expected closing `%`");if(a==="%"&&d!=="%")throw new oo("invalid intrinsic syntax, expected opening `%`");var c=[];return $h(l,ef,function(f,m,v,_){c[c.length]=v?$h(_,T,"$1"):m||f}),c},I=function(l,d){var a=l,c;if(Gu(nd,a)&&(c=nd[a],a="%"+c[0]+"%"),Gu(Pn,a)){var f=Pn[a];if(f===Ai&&(f=xm(a)),typeof f>"u"&&!d)throw new ao("intrinsic "+l+" exists, but is not available. Please file an issue!");return{alias:c,name:a,value:f}}throw new oo("intrinsic "+l+" does not exist!")},D=function(l,d){if(typeof l!="string"||l.length===0)throw new ao("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof d!="boolean")throw new ao('"allowMissing" argument must be a boolean');if(Cm(/^%?[^%]*%?$/,l)===null)throw new oo("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var a=A(l),c=a.length>0?a[0]:"",f=I("%"+c+"%",d),m=f.name,v=f.value,_=!1,w=f.alias;w&&(c=w[0],Em(a,Sm([0,1],w)));for(var x=1,E=!0;x=a.length){var ee=ns(v,N);E=!!ee,E&&"get"in ee&&!("originalValue"in ee.get)?v=ee.get:v=v[N]}else E=Gu(v,N),v=v[N];E&&!_&&(Pn[m]=v)}}return v},F=D,z=F("%Object.defineProperty%",!0),ue=function(){if(z)try{return z({},"a",{value:1}),!0}catch{return!1}return!1};ue.hasArrayLengthDefineBug=function(){if(!ue())return null;try{return z([],"length",{value:1}).length!==1}catch{return!0}};var fe=ue,ve=fm,we=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",Me=Object.prototype.toString,Ge=Array.prototype.concat,wt=Object.defineProperty,et=function(l){return typeof l=="function"&&Me.call(l)==="[object Function]"},jt=fe(),ai=wt&&jt,Yn=function(l,d,a,c){if(d in l){if(c===!0){if(l[d]===a)return}else if(!et(c)||!c())return}ai?wt(l,d,{configurable:!0,enumerable:!1,value:a,writable:!0}):l[d]=a},yr=function(l,d){var a=arguments.length>2?arguments[2]:{},c=ve(d);we&&(c=Ge.call(c,Object.getOwnPropertySymbols(d)));for(var f=0;f3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Xu("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Xu("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Xu("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Xu("`loose`, if provided, must be a boolean");var c=arguments.length>3?arguments[3]:null,f=arguments.length>4?arguments[4]:null,m=arguments.length>5?arguments[5]:null,v=arguments.length>6?arguments[6]:!1,_=!!c0&&c0(l,d);if(Ks)Ks(l,d,{configurable:m===null&&_?_.configurable:!m,enumerable:c===null&&_?_.enumerable:!c,value:a,writable:f===null&&_?_.writable:!f});else if(v||!c&&!f&&!m)l[d]=a;else throw new As("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},d0=D,h0=pt,f0=fe(),Ni=Ga,rd=d0("%TypeError%"),p0=d0("%Math.floor%"),Am=function(l,d){if(typeof l!="function")throw new rd("`fn` is not a function");if(typeof d!="number"||d<0||d>4294967295||p0(d)!==d)throw new rd("`length` must be a positive 32-bit integer");var a=arguments.length>2&&!!arguments[2],c=!0,f=!0;if("length"in l&&Ni){var m=Ni(l,"length");m&&!m.configurable&&(c=!1),m&&!m.writable&&(f=!1)}return(c||f||!a)&&(f0?h0(l,"length",d,!0,!0):h0(l,"length",d)),l};(function(l){var d=ed,a=D,c=Am,f=a("%TypeError%"),m=a("%Function.prototype.apply%"),v=a("%Function.prototype.call%"),_=a("%Reflect.apply%",!0)||d.call(v,m),w=a("%Object.defineProperty%",!0),x=a("%Math.max%");if(w)try{w({},"a",{value:1})}catch{w=null}l.exports=function(N){if(typeof N!="function")throw new f("a function is required");var H=_(d,v,arguments);return c(H,1+x(0,N.length-(arguments.length-1)),!0)};var E=function(){return _(d,m,arguments)};w?w(l.exports,"apply",{value:E}):l.exports.apply=E})(lo);var m0=D,g0=lo.exports,dT=g0(m0("String.prototype.indexOf")),ia=function(l,d){var a=m0(l,!!d);return typeof a=="function"&&dT(l,".prototype.")>-1?g0(a):a},hT=D,na=hT("%TypeError%"),fT=function(l,d){if(l==null)throw new na(d||"Cannot call method on "+l);return l},Zu=fT,pT=D,y0=pT("%Array%"),v0=!y0.isArray&&ia("Object.prototype.toString"),mT=y0.isArray||function(l){return v0(l)==="[object Array]"},b0=mT,tf=D,gT=ia,ra=tf("%TypeError%"),_0=b0,yT=tf("%Reflect.apply%",!0)||gT("Function.prototype.apply"),vT=function(l,d){var a=arguments.length>2?arguments[2]:[];if(!_0(a))throw new ra("Assertion failed: optional `argumentsList`, if provided, must be a List");return yT(l,d,a)},bT={},_T=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",default:bT}),wT=Ko(_T),Dm=typeof Map=="function"&&Map.prototype,Pm=Object.getOwnPropertyDescriptor&&Dm?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,nf=Dm&&Pm&&typeof Pm.get=="function"?Pm.get:null,w0=Dm&&Map.prototype.forEach,km=typeof Set=="function"&&Set.prototype,Im=Object.getOwnPropertyDescriptor&&km?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Oo=km&&Im&&typeof Im.get=="function"?Im.get:null,T0=km&&Set.prototype.forEach,TT=typeof WeakMap=="function"&&WeakMap.prototype,sd=TT?WeakMap.prototype.has:null,xT=typeof WeakSet=="function"&&WeakSet.prototype,od=xT?WeakSet.prototype.has:null,ST=typeof WeakRef=="function"&&WeakRef.prototype,x0=ST?WeakRef.prototype.deref:null,ET=Boolean.prototype.valueOf,sa=Object.prototype.toString,Qu=Function.prototype.toString,CT=String.prototype.match,Rm=String.prototype.slice,Ka=String.prototype.replace,AT=String.prototype.toUpperCase,S0=String.prototype.toLowerCase,rf=RegExp.prototype.test,zl=Array.prototype.concat,Ds=Array.prototype.join,Mi=Array.prototype.slice,b=Math.floor,C=typeof BigInt=="function"?BigInt.prototype.valueOf:null,B=Object.getOwnPropertySymbols,V=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,ie=typeof Symbol=="function"&&typeof Symbol.iterator=="object",De=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===ie||!0)?Symbol.toStringTag:null,Ye=Object.prototype.propertyIsEnumerable,Rt=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(l){return l.__proto__}:null);function ni(l,d){if(l===1/0||l===-1/0||l!==l||l&&l>-1e3&&l<1e3||rf.call(/e/,d))return d;var a=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof l=="number"){var c=l<0?-b(-l):b(l);if(c!==l){var f=String(c),m=Rm.call(d,f.length+1);return Ka.call(f,a,"$&_")+"."+Ka.call(Ka.call(m,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Ka.call(d,a,"$&_")}var Ei=wT,Dr=Ei.custom,Lo=mR(Dr)?Dr:null,Ya=function l(d,a,c,f){var m=a||{};if(Ju(m,"quoteStyle")&&m.quoteStyle!=="single"&&m.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Ju(m,"maxStringLength")&&(typeof m.maxStringLength=="number"?m.maxStringLength<0&&m.maxStringLength!==1/0:m.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var v=Ju(m,"customInspect")?m.customInspect:!0;if(typeof v!="boolean"&&v!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Ju(m,"indent")&&m.indent!==null&&m.indent!==" "&&!(parseInt(m.indent,10)===m.indent&&m.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Ju(m,"numericSeparator")&&typeof m.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var _=m.numericSeparator;if(typeof d>"u")return"undefined";if(d===null)return"null";if(typeof d=="boolean")return d?"true":"false";if(typeof d=="string")return yR(d,m);if(typeof d=="number"){if(d===0)return 1/0/d>0?"0":"-0";var w=String(d);return _?ni(d,w):w}if(typeof d=="bigint"){var x=String(d)+"n";return _?ni(d,x):x}var E=typeof m.depth>"u"?5:m.depth;if(typeof c>"u"&&(c=0),c>=E&&E>0&&typeof d=="object")return DT(d)?"[Array]":"[Object]";var N=s$(m,c);if(typeof f>"u")f=[];else if(gR(f,d)>=0)return"[Circular]";function H(Yt,Xt,di){if(Xt&&(f=Mi.call(f),f.push(Xt)),di){var li={depth:m.depth};return Ju(m,"quoteStyle")&&(li.quoteStyle=m.quoteStyle),l(Yt,li,c+1,f)}return l(Yt,m,c+1,f)}if(typeof d=="function"&&!pR(d)){var Y=ZJ(d),ee=E0(d,H);return"[Function"+(Y?": "+Y:" (anonymous)")+"]"+(ee.length>0?" { "+Ds.call(ee,", ")+" }":"")}if(mR(d)){var be=ie?Ka.call(String(d),/^(Symbol\(.*\))_[^)]*$/,"$1"):V.call(d);return typeof d=="object"&&!ie?Om(be):be}if(i$(d)){for(var me="<"+S0.call(String(d.nodeName)),ke=d.attributes||[],U=0;U",me}if(DT(d)){if(d.length===0)return"[]";var ce=E0(d,H);return N&&!r$(ce)?"["+kT(ce,N)+"]":"[ "+Ds.call(ce,", ")+" ]"}if(WJ(d)){var Pe=E0(d,H);return!("cause"in Error.prototype)&&"cause"in d&&!Ye.call(d,"cause")?"{ ["+String(d)+"] "+Ds.call(zl.call("[cause]: "+H(d.cause),Pe),", ")+" }":Pe.length===0?"["+String(d)+"]":"{ ["+String(d)+"] "+Ds.call(Pe,", ")+" }"}if(typeof d=="object"&&v){if(Lo&&typeof d[Lo]=="function"&&Ei)return Ei(d,{depth:E-c});if(v!=="symbol"&&typeof d.inspect=="function")return d.inspect()}if(QJ(d)){var Ae=[];return w0&&w0.call(d,function(Yt,Xt){Ae.push(H(Xt,d,!0)+" => "+H(Yt,d))}),vR("Map",nf.call(d),Ae,N)}if(e$(d)){var Ne=[];return T0&&T0.call(d,function(Yt){Ne.push(H(Yt,d))}),vR("Set",Oo.call(d),Ne,N)}if(JJ(d))return PT("WeakMap");if(t$(d))return PT("WeakSet");if($J(d))return PT("WeakRef");if(GJ(d))return Om(H(Number(d)));if(YJ(d))return Om(H(C.call(d)));if(KJ(d))return Om(ET.call(d));if(qJ(d))return Om(H(String(d)));if(typeof window<"u"&&d===window)return"{ [object Window] }";if(d===Fr)return"{ [object globalThis] }";if(!jJ(d)&&!pR(d)){var Fe=E0(d,H),lt=Rt?Rt(d)===Object.prototype:d instanceof Object||d.constructor===Object,ht=d instanceof Object?"":"null prototype",At=!lt&&De&&Object(d)===d&&De in d?Rm.call($u(d),8,-1):ht?"Object":"",Lt=lt||typeof d.constructor!="function"?"":d.constructor.name?d.constructor.name+" ":"",kt=Lt+(At||ht?"["+Ds.call(zl.call([],At||[],ht||[]),": ")+"] ":"");return Fe.length===0?kt+"{}":N?kt+"{"+kT(Fe,N)+"}":kt+"{ "+Ds.call(Fe,", ")+" }"}return String(d)};function fR(l,d,a){var c=(a.quoteStyle||d)==="double"?'"':"'";return c+l+c}function VJ(l){return Ka.call(String(l),/"/g,""")}function DT(l){return $u(l)==="[object Array]"&&(!De||!(typeof l=="object"&&De in l))}function jJ(l){return $u(l)==="[object Date]"&&(!De||!(typeof l=="object"&&De in l))}function pR(l){return $u(l)==="[object RegExp]"&&(!De||!(typeof l=="object"&&De in l))}function WJ(l){return $u(l)==="[object Error]"&&(!De||!(typeof l=="object"&&De in l))}function qJ(l){return $u(l)==="[object String]"&&(!De||!(typeof l=="object"&&De in l))}function GJ(l){return $u(l)==="[object Number]"&&(!De||!(typeof l=="object"&&De in l))}function KJ(l){return $u(l)==="[object Boolean]"&&(!De||!(typeof l=="object"&&De in l))}function mR(l){if(ie)return l&&typeof l=="object"&&l instanceof Symbol;if(typeof l=="symbol")return!0;if(!l||typeof l!="object"||!V)return!1;try{return V.call(l),!0}catch{}return!1}function YJ(l){if(!l||typeof l!="object"||!C)return!1;try{return C.call(l),!0}catch{}return!1}var XJ=Object.prototype.hasOwnProperty||function(l){return l in this};function Ju(l,d){return XJ.call(l,d)}function $u(l){return sa.call(l)}function ZJ(l){if(l.name)return l.name;var d=CT.call(Qu.call(l),/^function\s*([\w$]+)/);return d?d[1]:null}function gR(l,d){if(l.indexOf)return l.indexOf(d);for(var a=0,c=l.length;ad.maxStringLength){var a=l.length-d.maxStringLength,c="... "+a+" more character"+(a>1?"s":"");return yR(Rm.call(l,0,d.maxStringLength),d)+c}var f=Ka.call(Ka.call(l,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,n$);return fR(f,"single",d)}function n$(l){var d=l.charCodeAt(0),a={8:"b",9:"t",10:"n",12:"f",13:"r"}[d];return a?"\\"+a:"\\x"+(d<16?"0":"")+AT.call(d.toString(16))}function Om(l){return"Object("+l+")"}function PT(l){return l+" { ? }"}function vR(l,d,a,c){var f=c?kT(a,c):Ds.call(a,", ");return l+" ("+d+") {"+f+"}"}function r$(l){for(var d=0;d=0)return!1;return!0}function s$(l,d){var a;if(l.indent===" ")a=" ";else if(typeof l.indent=="number"&&l.indent>0)a=Ds.call(Array(l.indent+1)," ");else return null;return{base:a,prev:Ds.call(Array(d+1),a)}}function kT(l,d){if(l.length===0)return"";var a=` `+d.prev+d.base;return a+Ds.call(l,","+a)+` `+d.prev}function E0(l,d){var a=DT(l),c=[];if(a){c.length=l.length;for(var f=0;f"u")return"Undefined";if(typeof l=="function"||typeof l=="object")return"Object";if(typeof l=="number")return"Number";if(typeof l=="boolean")return"Boolean";if(typeof l=="string")return"String"},a$=o$,Lm=function(l){return typeof l=="symbol"?"Symbol":typeof l=="bigint"?"BigInt":a$(l)},l$=D,_R=l$("%TypeError%"),u$=Ya,c$=bR,d$=Lm,wR=function(l,d){if(d$(l)!=="Object")throw new _R("Assertion failed: Type(O) is not Object");if(!c$(d))throw new _R("Assertion failed: IsPropertyKey(P) is not true, got "+u$(d));return l[d]},h$=D,TR=h$("%TypeError%"),f$=bR,p$=Lm,m$=function(l,d){if(p$(l)!=="Object")throw new TR("Assertion failed: `O` must be an Object");if(!f$(d))throw new TR("Assertion failed: `P` must be a Property Key");return d in l},xR=Function.prototype.toString,sf=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,IT,C0;if(typeof sf=="function"&&typeof Object.defineProperty=="function")try{IT=Object.defineProperty({},"length",{get:function(){throw C0}}),C0={},sf(function(){throw 42},null,IT)}catch(l){l!==C0&&(sf=null)}else sf=null;var g$=/^\s*class\b/,RT=function(l){try{var d=xR.call(l);return g$.test(d)}catch{return!1}},OT=function(l){try{return RT(l)?!1:(xR.call(l),!0)}catch{return!1}},A0=Object.prototype.toString,y$="[object Object]",v$="[object Function]",b$="[object GeneratorFunction]",_$="[object HTMLAllCollection]",w$="[object HTML document.all class]",T$="[object HTMLCollection]",x$=typeof Symbol=="function"&&!!Symbol.toStringTag,S$=!(0 in[,]),LT=function(){return!1};if(typeof document=="object"){var E$=document.all;A0.call(E$)===A0.call(document.all)&&(LT=function(l){if((S$||!l)&&(typeof l>"u"||typeof l=="object"))try{var d=A0.call(l);return(d===_$||d===w$||d===T$||d===y$)&&l("")==null}catch{}return!1})}var SR=sf?function(l){if(LT(l))return!0;if(!l||typeof l!="function"&&typeof l!="object")return!1;try{sf(l,null,IT)}catch(d){if(d!==C0)return!1}return!RT(l)&&OT(l)}:function(l){if(LT(l))return!0;if(!l||typeof l!="function"&&typeof l!="object")return!1;if(x$)return OT(l);if(RT(l))return!1;var d=A0.call(l);return d!==v$&&d!==b$&&!/^\[object HTML/.test(d)?!1:OT(l)},C$=SR,A$=Number.MAX_SAFE_INTEGER||9007199254740991,D$=function(l){return l===null||typeof l!="function"&&typeof l!="object"},P$=function(l){return l===null||typeof l!="function"&&typeof l!="object"},k$=ju,MT=function(){return k$()&&!!Symbol.toStringTag},I$=Date.prototype.getDay,R$=function(l){try{return I$.call(l),!0}catch{return!1}},O$=Object.prototype.toString,L$="[object Date]",M$=MT(),F$=function(l){return typeof l!="object"||l===null?!1:M$?R$(l):O$.call(l)===L$},FT={exports:{}},N$=Object.prototype.toString,B$=Kh();if(B$){var H$=Symbol.prototype.toString,U$=/^Symbol\(.*\)$/,z$=function(l){return typeof l.valueOf()!="symbol"?!1:U$.test(H$.call(l))};FT.exports=function(l){if(typeof l=="symbol")return!0;if(N$.call(l)!=="[object Symbol]")return!1;try{return z$(l)}catch{return!1}}}else FT.exports=function(l){return!1};var V$=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol",NT=P$,ER=SR,j$=F$,CR=FT.exports,W$=function(l,d){if(typeof l>"u"||l===null)throw new TypeError("Cannot call method on "+l);if(typeof d!="string"||d!=="number"&&d!=="string")throw new TypeError('hint must be "string" or "number"');var a=d==="string"?["toString","valueOf"]:["valueOf","toString"],c,f,m;for(m=0;m1&&(arguments[1]===String?d="string":arguments[1]===Number&&(d="number"));var a;if(V$&&(Symbol.toPrimitive?a=q$(l,Symbol.toPrimitive):CR(l)&&(a=Symbol.prototype.valueOf)),typeof a<"u"){var c=a.call(l,d);if(NT(c))return c;throw new TypeError("unable to convert exotic object to primitive")}return d==="default"&&(j$(l)||CR(l))&&(d="string"),W$(l,d==="default"?"number":d)},AR=G$,K$=function(l){return arguments.length>1?AR(l,arguments[1]):AR(l)},BT=ia,DR=MT(),PR,kR,HT,UT;if(DR){PR=BT("Object.prototype.hasOwnProperty"),kR=BT("RegExp.prototype.exec"),HT={};var zT=function(){throw HT};UT={toString:zT,valueOf:zT},typeof Symbol.toPrimitive=="symbol"&&(UT[Symbol.toPrimitive]=zT)}var Y$=BT("Object.prototype.toString"),X$=Object.getOwnPropertyDescriptor,Z$="[object RegExp]",Q$=DR?function(l){if(!l||typeof l!="object")return!1;var d=X$(l,"lastIndex"),a=d&&PR(d,"value");if(!a)return!1;try{kR(l,UT)}catch(c){return c===HT}}:function(l){return!l||typeof l!="object"&&typeof l!="function"?!1:Y$(l)===Z$},J$=ia,$$=D,eee=Q$,tee=J$("RegExp.prototype.exec"),iee=$$("%TypeError%"),nee=function(l){if(!eee(l))throw new iee("`regex` must be a RegExp");return function(d){return tee(l,d)!==null}},IR=D,ree=IR("%String%"),see=IR("%TypeError%"),RR=function(l){if(typeof l=="symbol")throw new see("Cannot convert a Symbol value to a string");return ree(l)},oee=Zu,aee=RR,lee=ia,OR=lee("String.prototype.replace"),LR=/^\s$/.test("᠎"),uee=LR?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,cee=LR?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/,MR=function(){var l=aee(oee(this));return OR(OR(l,uee,""),cee,"")},dee=MR,FR="​",of="᠎",NR=function(){return String.prototype.trim&&FR.trim()===FR&&of.trim()===of&&("_"+of).trim()==="_"+of&&(of+"_").trim()===of+"_"?String.prototype.trim:dee},hee=zr,fee=NR,pee=function(){var l=fee();return hee(String.prototype,{trim:l},{trim:function(){return String.prototype.trim!==l}}),l},mee=lo.exports,gee=zr,yee=Zu,vee=MR,BR=NR,bee=pee,_ee=mee(BR()),HR=function(l){return yee(l),_ee(l)};gee(HR,{getPolyfill:BR,implementation:vee,shim:bee});var UR=HR,D0=D,VT=D0("%Number%"),wee=D0("%RegExp%"),Tee=D0("%TypeError%"),zR=D0("%parseInt%"),xee=ia,P0=nee,VR=xee("String.prototype.slice"),See=P0(/^0b[01]+$/i),Eee=P0(/^0o[0-7]+$/i),Cee=P0(/^[-+]0x[0-9a-f]+$/i),Aee=["…","​","￾"].join(""),Dee=new wee("["+Aee+"]","g"),Pee=P0(Dee),kee=UR,Iee=Lm,Ree=function l(d){if(Iee(d)!=="String")throw new Tee("Assertion failed: `argument` is not a String");if(See(d))return VT(zR(VR(d,2),2));if(Eee(d))return VT(zR(VR(d,2),8));if(Pee(d)||Cee(d))return NaN;var a=kee(d);return a!==d?l(a):VT(d)},jR=D,WR=jR("%TypeError%"),qR=jR("%Number%"),Oee=D$,Lee=K$,Mee=Ree,Fee=function(l){var d=Oee(l)?l:Lee(l,qR);if(typeof d=="symbol")throw new WR("Cannot convert a Symbol value to a number");if(typeof d=="bigint")throw new WR("Conversion from 'BigInt' to 'number' is not allowed.");return typeof d=="string"?Mee(d):qR(d)},Nee=Lm,Bee=Math.floor,Hee=function(l){return Nee(l)==="BigInt"?l:Bee(l)},Uee=D,GR=Hee,zee=Uee("%TypeError%"),Vee=function(l){if(typeof l!="number"&&typeof l!="bigint")throw new zee("argument must be a Number or a BigInt");var d=l<0?-GR(-l):GR(l);return d===0?0:d},KR=Number.isNaN||function(l){return l!==l},jee=KR,Wee=function(l){return(typeof l=="number"||typeof l=="bigint")&&!jee(l)&&l!==1/0&&l!==-1/0},qee=Fee,Gee=Vee,Kee=KR,Yee=Wee,Xee=function(l){var d=qee(l);return Kee(d)||d===0?0:Yee(d)?Gee(d):d},YR=A$,Zee=Xee,Qee=function(l){var d=Zee(l);return d<=0?0:d>YR?YR:d},Jee=D,$ee=Jee("%TypeError%"),ete=wR,tte=Qee,ite=Lm,nte=function(l){if(ite(l)!=="Object")throw new $ee("Assertion failed: `obj` must be an Object");return tte(ete(l,"length"))},rte=D,ste=rte("%Object%"),ote=Zu,ate=function(l){return ote(l),ste(l)},lte=String.prototype.valueOf,ute=function(l){try{return lte.call(l),!0}catch{return!1}},cte=Object.prototype.toString,dte="[object String]",hte=MT(),fte=function(l){return typeof l=="string"?!0:typeof l!="object"?!1:hte?ute(l):cte.call(l)===dte},pte=D,mte=ia,gte=pte("%TypeError%"),yte=vT,vte=wR,bte=m$,_te=C$,wte=nte,Tte=ate,xte=RR,Ste=fte,Ete=mte("String.prototype.split"),XR=Object("a"),Cte=XR[0]!=="a"||!(0 in XR),ZR=function(l){var d=Tte(this),a=Cte&&Ste(this)?Ete(this,""):d,c=wte(a);if(!_te(l))throw new gte("Array.prototype.forEach callback must be a function");var f;arguments.length>1&&(f=arguments[1]);for(var m=0;m=12&&d<=14)?1:2},lO={pluralTypes:{arabic:function(l){if(l<3)return l;var d=l%100;return d>=3&&d<=10?3:d>=11?4:5},bosnian_serbian:WT,chinese:function(){return 0},croatian:WT,french:function(l){return l>=2?1:0},german:function(l){return l!==1?1:0},russian:WT,lithuanian:function(l){return l%10===1&&l%100!==11?0:l%10>=2&&l%10<=9&&(l%100<11||l%100>19)?1:2},czech:function(l){return l===1?0:l>=2&&l<=4?1:2},polish:function(l){if(l===1)return 0;var d=l%10;return 2<=d&&d<=4&&(l%100<10||l%100>=20)?1:2},icelandic:function(l){return l%10!==1||l%100===11?1:0},slovenian:function(l){var d=l%100;return d===1?0:d===2?1:d===3||d===4?2:3},romanian:function(l){if(l===1)return 0;var d=l%100;return l===0||d>=2&&d<=19?1:2}},pluralTypeToLanguages:{arabic:["ar"],bosnian_serbian:["bs-Latn-BA","bs-Cyrl-BA","srl-RS","sr-RS"],chinese:["id","id-ID","ja","ko","ko-KR","lo","ms","th","th-TH","zh"],croatian:["hr","hr-HR"],german:["fa","da","de","en","es","fi","el","he","hi-IN","hu","hu-HU","it","nl","no","pt","sv","tr"],french:["fr","tl","pt-br"],russian:["ru","ru-RU"],lithuanian:["lt"],czech:["cs","cs-CZ","sk"],polish:["pl"],icelandic:["is","mk"],slovenian:["sl-SL"],romanian:["ro"]}};function sie(l){var d={};return k0(jT(l),function(a){var c=a[0],f=a[1];k0(f,function(m){d[m]=c})}),d}function oie(l,d){var a=sie(l.pluralTypeToLanguages);return a[d]||a[aO.call(d,/-/,1)[0]]||a.en}function aie(l,d,a){return l.pluralTypes[d](a)}function lie(){var l={};return function(d,a){var c=l[a];return c&&!d.pluralTypes[c]&&(c=null,l[a]=c),c||(c=oie(d,a),c&&(l[a]=c)),c}}function uO(l){return l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function uie(l){var d=l&&l.prefix||"%{",a=l&&l.suffix||"}";if(d===I0||a===I0)throw new RangeError('"'+I0+'" token is reserved for pluralization');return new RegExp(uO(d)+"(.*?)"+uO(a),"g")}var cie=lie(),die=/%\{(.*?)\}/g;function qT(l,d,a,c,f,m){if(typeof l!="string")throw new TypeError("Polyglot.transformPhrase expects argument #1 to be string");if(d==null)return l;var v=l,_=c||die,w=m||oO,x=typeof d=="number"?{smart_count:d}:d;if(x.smart_count!=null&&l){var E=f||lO,N=aO.call(l,I0),H=a||"en",Y=cie(E,H),ee=aie(E,Y,x.smart_count);v=nie(N[ee]||N[0])}return v=w.call(v,_,function(be,me){return!sO(x,me)||x[me]==null?be:x[me]}),v}function Vl(l){var d=l||{};this.phrases={},this.extend(d.phrases||{}),this.currentLocale=d.locale||"en";var a=d.allowMissing?qT:null;this.onMissingKey=typeof d.onMissingKey=="function"?d.onMissingKey:a,this.warn=d.warn||rie,this.replaceImplementation=d.replace||oO,this.tokenRegex=uie(d.interpolation),this.pluralRules=d.pluralRules||lO}Vl.prototype.locale=function(l){return l&&(this.currentLocale=l),this.currentLocale},Vl.prototype.extend=function(l,d){k0(jT(l||{}),function(a){var c=a[0],f=a[1],m=d?d+"."+c:c;typeof f=="object"?this.extend(f,m):this.phrases[m]=f},this)},Vl.prototype.unset=function(l,d){typeof l=="string"?delete this.phrases[l]:k0(jT(l||{}),function(a){var c=a[0],f=a[1],m=d?d+"."+c:c;typeof f=="object"?this.unset(f,m):delete this.phrases[m]},this)},Vl.prototype.clear=function(){this.phrases={}},Vl.prototype.replace=function(l){this.clear(),this.extend(l)},Vl.prototype.t=function(l,d){var a,c,f=d??{};if(typeof this.phrases[l]=="string")a=this.phrases[l];else if(typeof f._=="string")a=f._;else if(this.onMissingKey){var m=this.onMissingKey;c=m(l,f,this.currentLocale,this.tokenRegex,this.pluralRules,this.replaceImplementation)}else this.warn('Missing translation for key: "'+l+'"'),c=l;return typeof a=="string"&&(c=qT(a,f,this.currentLocale,this.tokenRegex,this.pluralRules,this.replaceImplementation)),c},Vl.prototype.has=function(l){return sO(this.phrases,l)},Vl.transformPhrase=function(l,d,a){return qT(l,d,a)};var hie=Vl,fie={"Add a comment...":"إضافة تعليق","Add a reply...":"إضافة رد","Add tag...":"إضافة علامة",Cancel:"إلغاء",Close:"إغلاق",Edit:"Edit",Delete:"Delete",Ok:"تم"},pie={"Add a comment...":"Napsat komentář...","Add a reply...":"Odpovědět...","Add tag...":"Přidat štítek...",Cancel:"Zrušit",Close:"Zavřít",Edit:"Upravit",Delete:"Smazat",Ok:"Ok"},mie={"Add a comment...":"Kommentar schreiben...","Add a reply...":"Antwort schreiben...","Add tag...":"Tag...",Cancel:"Abbrechen",Close:"Schliessen",Edit:"Bearbeiten",Delete:"Löschen",Ok:"Ok"},gie={"Add a comment...":"Σχολίασε...","Add a reply...":"Απάντησε...","Add tag...":"Πρόσθεσε tag...",Cancel:"Άκυρο",Close:"Κλείσιμο",Edit:"Επεξεργασία",Delete:"Διαγραφή",Ok:"Ok"},yie={"Add a comment...":"Agregar un comentario...","Add a reply...":"Agregar una respuesta...","Add tag...":"Etiquetar...",Cancel:"Cancelar",Close:"Cerrar",Edit:"Editar",Delete:"Eliminar",Ok:"Ok"},vie={"Add a comment...":"Lisää kommentti","Add a reply...":"Lisää vastaus","Add tag...":"Lisää tunniste",Cancel:"Peruuta",Close:"Sulje",Edit:"Muokkaa",Delete:"Poista",Ok:"Ok"},bie={"Add a comment...":"Ajouter un commentaire...","Add a reply...":"Ajouter une réponse...","Add tag...":"Ajouter une étiquette...",Cancel:"Annuler",Close:"Fermer",Edit:"Éditer",Delete:"Supprimer",Ok:"Ok"},_ie={"Add a comment...":"Engadir un comentario...","Add a reply...":"Engadir unha resposta...","Add tag...":"Etiquetar...",Cancel:"Cancelar",Close:"Pechar",Edit:"Edit",Delete:"Delete",Ok:"Ok"},wie={"Add a comment...":"टिप्पणी जोड़ें","Add a reply...":"जवाब दें","Add tag...":"टैग लगाएँ",Cancel:"रद्द करें",Close:"बंद करें",Edit:"संपादित करें",Delete:"हटाएँ",Ok:"ठीक है"},Tie={"Add a comment...":"Commenta...","Add a reply...":"Rispondi...","Add tag...":"Aggiungi tag...",Cancel:"Annulla",Close:"Chiudi",Edit:"Edit",Delete:"Delete",Ok:"Ok"},xie={"Add a comment...":"コメントを追加する...","Add a reply...":"返信する...","Add tag...":"タグを追加する...",Cancel:"キャンセル",Close:"閉じる",Edit:"編集",Delete:"削除",Ok:"Ok"},Sie={"Add a comment...":"댓글 추가","Add a reply...":"답글 추가","Add tag...":"태그 추가",Cancel:"취소",Close:"닫기",Edit:"수정",Delete:"삭제",Ok:"확인"},Eie={"Add a comment...":"Commentaar toevoegen...","Add a reply...":"Antwoord toevoegen...","Add tag...":"Tag toevoegen...",Cancel:"Afbreken",Close:"Sluiten",Edit:"Bewerken",Delete:"Verwijderen",Ok:"Ok"},Cie={"Add a comment...":"Adicionar um comentário...","Add a reply...":"Adicionar uma resposta...","Add tag...":"Etiquetar...",Cancel:"Cancelar",Close:"Fechar",Edit:"Editar",Delete:"Apagar",Ok:"Ok"},Aie={"Add a comment...":"Добавить комментарий...","Add a reply...":"Добавить ответ...","Add tag...":"Добавить тэг...",Cancel:"Отмена",Close:"Закрыть",Edit:"Редактировать",Delete:"Удалить",Ok:"Ок"},Die={"Add a comment...":"Skriv en kommentar...","Add a reply...":"Skriv ett svar...","Add tag...":"Tagg...",Cancel:"Cancel",Close:"Stäng",Edit:"Edit",Delete:"Delete",Ok:"Ok"},Pie={"Add a comment...":"เพิ่มคอมเมนต์...","Add a reply...":"ตอบกลับ...","Add tag...":"เพิ่มแท็ก...",Cancel:"ยกเลิก",Close:"ปิด",Edit:"แก้ไข",Delete:"ลบ",Ok:"ตกลง"},kie={"Add a comment...":"Yorum ekle...","Add a reply...":"Cevap ekle...","Add tag...":"Tag Ekle...",Cancel:"İptal",Close:"Kapat",Edit:"Düzenle",Delete:"Sil",Ok:"Tamam"},Iie={"Add a comment...":"تبصرہ کریں","Add a reply...":"جواب دیں","Add tag...":"ٹیگ لگائیں",Cancel:"منسوخ کریں",Close:"بند کریں",Edit:"ترمیم کریں",Delete:"ہٹائیں",Ok:"ٹھیک ہے"},Rie={"Add a comment...":"添加注释...","Add a reply...":"添加回复...","Add tag...":"标签...",Cancel:"取消",Close:"关闭",Edit:"编辑",Delete:"删除",Ok:"确认"},Oie={"Add a comment...":"添加评论...","Add a reply...":"添加回复...","Add tag...":"添加标签...",Cancel:"取消",Close:"关闭",Edit:"编辑",Delete:"删除",Ok:"确认"},Lie={"Add a comment...":"添加評論...","Add a reply...":"添加回覆...","Add tag...":"添加標籤...",Cancel:"取消",Close:"關閉",Edit:"編輯",Delete:"刪除",Ok:"確認"},cO={};Object.defineProperty(cO,"__esModule",{value:!0});var GT=[["ثانية","ثانيتين","%s ثوان","%s ثانية"],["دقيقة","دقيقتين","%s دقائق","%s دقيقة"],["ساعة","ساعتين","%s ساعات","%s ساعة"],["يوم","يومين","%s أيام","%s يوماً"],["أسبوع","أسبوعين","%s أسابيع","%s أسبوعاً"],["شهر","شهرين","%s أشهر","%s شهراً"],["عام","عامين","%s أعوام","%s عاماً"]];function Mie(l,d){return d<3?GT[l][d-1]:d>=3&&d<=10?GT[l][2]:GT[l][3]}function Fie(l,d){if(d===0)return["منذ لحظات","بعد لحظات"];var a=Mie(Math.floor(d/2),l);return["منذ "+a,"بعد "+a]}var Nie=cO.default=Fie,dO={};Object.defineProperty(dO,"__esModule",{value:!0});function Bie(l,d){var a=0,c=d==1||d==3||d==5||d==7||d==9||d==11||d==13;return c&&l>=5&&(a=1),[[["právě teď","právě teď"]],[["před %s vteřinami","za %s vteřiny"],["před %s vteřinami","za %s vteřin"]],[["před minutou","za minutu"]],[["před %s minutami","za %s minuty"],["před %s minutami","za %s minut"]],[["před hodinou","za hodinu"]],[["před %s hodinami","za %s hodiny"],["před %s hodinami","za %s hodin"]],[["včera","zítra"]],[["před %s dny","za %s dny"],["před %s dny","za %s dnů"]],[["minulý týden","příští týden"]],[["před %s týdny","za %s týdny"],["před %s týdny","za %s týdnů"]],[["minulý měsíc","přístí měsíc"]],[["před %s měsíci","za %s měsíce"],["před %s měsíci","za %s měsíců"]],[["před rokem","přístí rok"]],[["před %s lety","za %s roky"],["před %s lety","za %s let"]]][d][a]}var Hie=dO.default=Bie,hO={};Object.defineProperty(hO,"__esModule",{value:!0});function Uie(l,d){return[["gerade eben","vor einer Weile"],["vor %s Sekunden","in %s Sekunden"],["vor 1 Minute","in 1 Minute"],["vor %s Minuten","in %s Minuten"],["vor 1 Stunde","in 1 Stunde"],["vor %s Stunden","in %s Stunden"],["vor 1 Tag","in 1 Tag"],["vor %s Tagen","in %s Tagen"],["vor 1 Woche","in 1 Woche"],["vor %s Wochen","in %s Wochen"],["vor 1 Monat","in 1 Monat"],["vor %s Monaten","in %s Monaten"],["vor 1 Jahr","in 1 Jahr"],["vor %s Jahren","in %s Jahren"]][d]}var zie=hO.default=Uie,fO={};Object.defineProperty(fO,"__esModule",{value:!0});function Vie(l,d){return[["μόλις τώρα","σε λίγο"],["%s δευτερόλεπτα πριν","σε %s δευτερόλεπτα"],["1 λεπτό πριν","σε 1 λεπτό"],["%s λεπτά πριν","σε %s λεπτά"],["1 ώρα πριν","σε 1 ώρα"],["%s ώρες πριν","σε %s ώρες"],["1 μέρα πριν","σε 1 μέρα"],["%s μέρες πριν","σε %s μέρες"],["1 εβδομάδα πριν","σε 1 εβδομάδα"],["%s εβδομάδες πριν","σε %s εβδομάδες"],["1 μήνα πριν","σε 1 μήνα"],["%s μήνες πριν","σε %s μήνες"],["1 χρόνο πριν","σε 1 χρόνο"],["%s χρόνια πριν","σε %s χρόνια"]][d]}var jie=fO.default=Vie,pO={};Object.defineProperty(pO,"__esModule",{value:!0});function Wie(l,d){return[["justo ahora","en un rato"],["hace %s segundos","en %s segundos"],["hace 1 minuto","en 1 minuto"],["hace %s minutos","en %s minutos"],["hace 1 hora","en 1 hora"],["hace %s horas","en %s horas"],["hace 1 día","en 1 día"],["hace %s días","en %s días"],["hace 1 semana","en 1 semana"],["hace %s semanas","en %s semanas"],["hace 1 mes","en 1 mes"],["hace %s meses","en %s meses"],["hace 1 año","en 1 año"],["hace %s años","en %s años"]][d]}var qie=pO.default=Wie,mO={};Object.defineProperty(mO,"__esModule",{value:!0});function Gie(l,d){return[["juuri äsken","juuri nyt"],["%s sekuntia sitten","%s sekunnin päästä"],["minuutti sitten","minuutin päästä"],["%s minuuttia sitten","%s minuutin päästä"],["tunti sitten","tunnin päästä"],["%s tuntia sitten","%s tunnin päästä"],["päivä sitten","päivän päästä"],["%s päivää sitten","%s päivän päästä"],["viikko sitten","viikon päästä"],["%s viikkoa sitten","%s viikon päästä"],["kuukausi sitten","kuukauden päästä"],["%s kuukautta sitten","%s kuukauden päästä"],["vuosi sitten","vuoden päästä"],["%s vuotta sitten","%s vuoden päästä"]][d]}var Kie=mO.default=Gie,gO={};Object.defineProperty(gO,"__esModule",{value:!0});function Yie(l,d){return[["à l'instant","dans un instant"],["il y a %s secondes","dans %s secondes"],["il y a 1 minute","dans 1 minute"],["il y a %s minutes","dans %s minutes"],["il y a 1 heure","dans 1 heure"],["il y a %s heures","dans %s heures"],["il y a 1 jour","dans 1 jour"],["il y a %s jours","dans %s jours"],["il y a 1 semaine","dans 1 semaine"],["il y a %s semaines","dans %s semaines"],["il y a 1 mois","dans 1 mois"],["il y a %s mois","dans %s mois"],["il y a 1 an","dans 1 an"],["il y a %s ans","dans %s ans"]][d]}var Xie=gO.default=Yie,yO={};Object.defineProperty(yO,"__esModule",{value:!0});function Zie(l,d){return[["xusto agora","daquí a un pouco"],["hai %s segundos","en %s segundos"],["hai 1 minuto","nun minuto"],["hai %s minutos","en %s minutos"],["hai 1 hora","nunha hora"],["hai %s horas","en %s horas"],["hai 1 día","nun día"],["hai %s días","en %s días"],["hai 1 semana","nunha semana"],["hai %s semanas","en %s semanas"],["hai 1 mes","nun mes"],["hai %s meses","en %s meses"],["hai 1 ano","nun ano"],["hai %s anos","en %s anos"]][d]}var Qie=yO.default=Zie,vO={};Object.defineProperty(vO,"__esModule",{value:!0});function Jie(l,d){return[["अभी","कुछ समय"],["%s सेकंड पहले","%s सेकंड में"],["1 मिनट पहले","1 मिनट में"],["%s मिनट पहले","%s मिनट में"],["1 घंटे पहले","1 घंटे में"],["%s घंटे पहले","%s घंटे में"],["1 दिन पहले","1 दिन में"],["%s दिन पहले","%s दिनों में"],["1 सप्ताह पहले","1 सप्ताह में"],["%s हफ्ते पहले","%s हफ्तों में"],["1 महीने पहले","1 महीने में"],["%s महीने पहले","%s महीनों में"],["1 साल पहले","1 साल में"],["%s साल पहले","%s साल में"]][d]}var $ie=vO.default=Jie,bO={};Object.defineProperty(bO,"__esModule",{value:!0});function ene(l,d){return[["poco fa","fra poco"],["%s secondi fa","fra %s secondi"],["un minuto fa","fra un minuto"],["%s minuti fa","fra %s minuti"],["un'ora fa","fra un'ora"],["%s ore fa","fra %s ore"],["un giorno fa","fra un giorno"],["%s giorni fa","fra %s giorni"],["una settimana fa","fra una settimana"],["%s settimane fa","fra %s settimane"],["un mese fa","fra un mese"],["%s mesi fa","fra %s mesi"],["un anno fa","fra un anno"],["%s anni fa","fra %s anni"]][d]}var tne=bO.default=ene,_O={};Object.defineProperty(_O,"__esModule",{value:!0});function ine(l,d){return[["すこし前","すぐに"],["%s秒前","%s秒以内"],["1分前","1分以内"],["%s分前","%s分以内"],["1時間前","1時間以内"],["%s時間前","%s時間以内"],["1日前","1日以内"],["%s日前","%s日以内"],["1週間前","1週間以内"],["%s週間前","%s週間以内"],["1ヶ月前","1ヶ月以内"],["%sヶ月前","%sヶ月以内"],["1年前","1年以内"],["%s年前","%s年以内"]][d]}var nne=_O.default=ine,wO={};Object.defineProperty(wO,"__esModule",{value:!0});function rne(l,d){return[["방금","곧"],["%s초 전","%s초 후"],["1분 전","1분 후"],["%s분 전","%s분 후"],["1시간 전","1시간 후"],["%s시간 전","%s시간 후"],["1일 전","1일 후"],["%s일 전","%s일 후"],["1주일 전","1주일 후"],["%s주일 전","%s주일 후"],["1개월 전","1개월 후"],["%s개월 전","%s개월 후"],["1년 전","1년 후"],["%s년 전","%s년 후"]][d]}var sne=wO.default=rne,TO={};Object.defineProperty(TO,"__esModule",{value:!0});function one(l,d){return[["recent","binnenkort"],["%s seconden geleden","binnen %s seconden"],["1 minuut geleden","binnen 1 minuut"],["%s minuten geleden","binnen %s minuten"],["1 uur geleden","binnen 1 uur"],["%s uur geleden","binnen %s uur"],["1 dag geleden","binnen 1 dag"],["%s dagen geleden","binnen %s dagen"],["1 week geleden","binnen 1 week"],["%s weken geleden","binnen %s weken"],["1 maand geleden","binnen 1 maand"],["%s maanden geleden","binnen %s maanden"],["1 jaar geleden","binnen 1 jaar"],["%s jaar geleden","binnen %s jaar"]][d]}var ane=TO.default=one,xO={};Object.defineProperty(xO,"__esModule",{value:!0});function lne(l,d){return[["agora mesmo","agora"],["há %s segundos","em %s segundos"],["há um minuto","em um minuto"],["há %s minutos","em %s minutos"],["há uma hora","em uma hora"],["há %s horas","em %s horas"],["há um dia","em um dia"],["há %s dias","em %s dias"],["há uma semana","em uma semana"],["há %s semanas","em %s semanas"],["há um mês","em um mês"],["há %s meses","em %s meses"],["há um ano","em um ano"],["há %s anos","em %s anos"]][d]}var une=xO.default=lne,SO={};Object.defineProperty(SO,"__esModule",{value:!0});function ad(l,d,a,c,f){var m=f%10,v=c;return f===1?v=l:m===1&&f>20?v=d:m>1&&m<5&&(f>20||f<10)&&(v=a),v}var EO=ad.bind(null,"секунду","%s секунду","%s секунды","%s секунд"),CO=ad.bind(null,"минуту","%s минуту","%s минуты","%s минут"),AO=ad.bind(null,"час","%s час","%s часа","%s часов"),DO=ad.bind(null,"день","%s день","%s дня","%s дней"),PO=ad.bind(null,"неделю","%s неделю","%s недели","%s недель"),kO=ad.bind(null,"месяц","%s месяц","%s месяца","%s месяцев"),IO=ad.bind(null,"год","%s год","%s года","%s лет");function cne(l,d){switch(d){case 0:return["только что","через несколько секунд"];case 1:return[EO(l)+" назад","через "+EO(l)];case 2:case 3:return[CO(l)+" назад","через "+CO(l)];case 4:case 5:return[AO(l)+" назад","через "+AO(l)];case 6:return["вчера","завтра"];case 7:return[DO(l)+" назад","через "+DO(l)];case 8:case 9:return[PO(l)+" назад","через "+PO(l)];case 10:case 11:return[kO(l)+" назад","через "+kO(l)];case 12:case 13:return[IO(l)+" назад","через "+IO(l)];default:return["",""]}}var dne=SO.default=cne,RO={};Object.defineProperty(RO,"__esModule",{value:!0});function hne(l,d){return[["just nu","om en stund"],["%s sekunder sedan","om %s sekunder"],["1 minut sedan","om 1 minut"],["%s minuter sedan","om %s minuter"],["1 timme sedan","om 1 timme"],["%s timmar sedan","om %s timmar"],["1 dag sedan","om 1 dag"],["%s dagar sedan","om %s dagar"],["1 vecka sedan","om 1 vecka"],["%s veckor sedan","om %s veckor"],["1 månad sedan","om 1 månad"],["%s månader sedan","om %s månader"],["1 år sedan","om 1 år"],["%s år sedan","om %s år"]][d]}var fne=RO.default=hne,OO={};Object.defineProperty(OO,"__esModule",{value:!0});function pne(l,d){return[["เมื่อสักครู่นี้","อีกสักครู่"],["%s วินาทีที่แล้ว","ใน %s วินาที"],["1 นาทีที่แล้ว","ใน 1 นาที"],["%s นาทีที่แล้ว","ใน %s นาที"],["1 ชั่วโมงที่แล้ว","ใน 1 ชั่วโมง"],["%s ชั่วโมงที่แล้ว","ใน %s ชั่วโมง"],["1 วันที่แล้ว","ใน 1 วัน"],["%s วันที่แล้ว","ใน %s วัน"],["1 อาทิตย์ที่แล้ว","ใน 1 อาทิตย์"],["%s อาทิตย์ที่แล้ว","ใน %s อาทิตย์"],["1 เดือนที่แล้ว","ใน 1 เดือน"],["%s เดือนที่แล้ว","ใน %s เดือน"],["1 ปีที่แล้ว","ใน 1 ปี"],["%s ปีที่แล้ว","ใน %s ปี"]][d]}var mne=OO.default=pne,LO={};Object.defineProperty(LO,"__esModule",{value:!0});function gne(l,d){return[["az önce","şimdi"],["%s saniye önce","%s saniye içinde"],["1 dakika önce","1 dakika içinde"],["%s dakika önce","%s dakika içinde"],["1 saat önce","1 saat içinde"],["%s saat önce","%s saat içinde"],["1 gün önce","1 gün içinde"],["%s gün önce","%s gün içinde"],["1 hafta önce","1 hafta içinde"],["%s hafta önce","%s hafta içinde"],["1 ay önce","1 ay içinde"],["%s ay önce","%s ay içinde"],["1 yıl önce","1 yıl içinde"],["%s yıl önce","%s yıl içinde"]][d]}var yne=LO.default=gne,MO={};Object.defineProperty(MO,"__esModule",{value:!0});var vne=["秒","分钟","小时","天","周","个月","年"];function bne(l,d){if(d===0)return["刚刚","片刻后"];var a=vne[~~(d/2)];return[l+" "+a+"前",l+" "+a+"后"]}var FO=MO.default=bne,NO={};Object.defineProperty(NO,"__esModule",{value:!0});function _ne(l,d){return[["剛剛","片刻後"],["%s 秒前","%s 秒後"],["1 分鐘前","1 分鐘後"],["%s 分鐘前","%s 分鐘後"],["1 小時前","1 小時後"],["%s 小時前","%s 小時後"],["1 天前","1 天後"],["%s 天前","%s 天後"],["1 週前","1 週後"],["%s 週前","%s 週後"],["1 個月前","1 個月後"],["%s 個月前","%s 個月後"],["1 年前","1 年後"],["%s 年前","%s 年後"]][d]}var wne=NO.default=_ne;const af={ar:fie,cs:pie,de:mie,el:gie,es:yie,fi:vie,fr:bie,gl:_ie,hi:wie,it:Tie,ja:xie,ko:Sie,nl:Eie,pt:Cie,ru:Aie,sv:Die,th:Pie,tr:kie,ur:Iie,zh:Rie,"zh-CN":Oie,"zh-TW":Lie},Tne=Object.keys(af),ld=new hie({allowMissing:!0});ld.init=(l,d)=>{ld.clear(),l&&(ld.locale(l),ld.extend(af[l])),d&&ld.extend(d)},gn("ar",Nie),gn("cs",Hie),gn("de",zie),gn("el",jie),gn("es",qie),gn("fi",Kie),gn("fr",Xie),gn("gl",Qie),gn("hi",$ie),gn("it",tne),gn("ja",nne),gn("ko",sne),gn("nl",ane),gn("pt",une),gn("ru",dne),gn("sv",fne),gn("th",mne),gn("tr",yne),gn("zh",FO),gn("zh-CN",FO),gn("zh-TW",wne),ld.registerMessages=(l,d)=>{af[l]?af[l]={...af[l],...d}:af[l]=d};var uo=ld,xne=l=>{const d=Te();return dm(d,()=>l.onClickOutside()),Je.createElement("ul",{ref:d,className:"r6o-comment-dropdown-menu"},Je.createElement("li",{onClick:l.onEdit},uo.t("Edit")),Je.createElement("li",{onClick:l.onDelete},uo.t("Delete")))},BO={},KT={},YT={exports:{}};/*! autosize 4.0.4 license: MIT http://www.jacklmoore.com/autosize */(function(l,d){(function(a,c){c(l,d)})(Fr,function(a,c){var f=typeof Map=="function"?new Map:function(){var E=[],N=[];return{has:function(H){return E.indexOf(H)>-1},get:function(H){return N[E.indexOf(H)]},set:function(H,Y){E.indexOf(H)===-1&&(E.push(H),N.push(Y))},delete:function(H){var Y=E.indexOf(H);Y>-1&&(E.splice(Y,1),N.splice(Y,1))}}}(),m=function(E){return new Event(E,{bubbles:!0})};try{new Event("test")}catch{m=function(E){var N=document.createEvent("Event");return N.initEvent(E,!0,!1),N}}function v(E){if(!E||!E.nodeName||E.nodeName!=="TEXTAREA"||f.has(E))return;var N=null,H=null,Y=null;function ee(){var Ae=window.getComputedStyle(E,null);Ae.resize==="vertical"?E.style.resize="none":Ae.resize==="both"&&(E.style.resize="horizontal"),Ae.boxSizing==="content-box"?N=-(parseFloat(Ae.paddingTop)+parseFloat(Ae.paddingBottom)):N=parseFloat(Ae.borderTopWidth)+parseFloat(Ae.borderBottomWidth),isNaN(N)&&(N=0),U()}function be(Ae){{var Ne=E.style.width;E.style.width="0px",E.offsetWidth,E.style.width=Ne}E.style.overflowY=Ae}function me(Ae){for(var Ne=[];Ae&&Ae.parentNode&&Ae.parentNode instanceof Element;)Ae.parentNode.scrollTop&&Ne.push({node:Ae.parentNode,scrollTop:Ae.parentNode.scrollTop}),Ae=Ae.parentNode;return Ne}function ke(){if(E.scrollHeight!==0){var Ae=me(E),Ne=document.documentElement&&document.documentElement.scrollTop;E.style.height="",E.style.height=E.scrollHeight+N+"px",H=E.clientWidth,Ae.forEach(function(Fe){Fe.node.scrollTop=Fe.scrollTop}),Ne&&(document.documentElement.scrollTop=Ne)}}function U(){ke();var Ae=Math.round(parseFloat(E.style.height)),Ne=window.getComputedStyle(E,null),Fe=Ne.boxSizing==="content-box"?Math.round(parseFloat(Ne.height)):E.offsetHeight;if(Fe"u"||typeof window.getComputedStyle!="function"?(x=function(E){return E},x.destroy=function(E){return E},x.update=function(E){return E}):(x=function(E,N){return E&&Array.prototype.forEach.call(E.length?E:[E],function(H){return v(H)}),E},x.destroy=function(E){return E&&Array.prototype.forEach.call(E.length?E:[E],_),E},x.update=function(E){return E&&Array.prototype.forEach.call(E.length?E:[E],w),E}),c.default=x,a.exports=c.default})})(YT,YT.exports);var Sne=function(l,d,a){return a=window.getComputedStyle,(a?a(l):l.currentStyle)[d.replace(/-(\w)/gi,function(c,f){return f.toUpperCase()})]},Ene=Sne,XT=Ene;function Cne(l){var d=XT(l,"line-height"),a=parseFloat(d,10);if(d===a+""){var c=l.style.lineHeight;l.style.lineHeight=d+"em",d=XT(l,"line-height"),a=parseFloat(d,10),c?l.style.lineHeight=c:delete l.style.lineHeight}if(d.indexOf("pt")!==-1?(a*=4,a/=3):d.indexOf("mm")!==-1?(a*=96,a/=25.4):d.indexOf("cm")!==-1?(a*=96,a/=2.54):d.indexOf("in")!==-1?a*=96:d.indexOf("pc")!==-1&&(a*=16),a=Math.round(a),d==="normal"){var f=l.nodeName,m=document.createElement(f);m.innerHTML=" ",f.toUpperCase()==="TEXTAREA"&&m.setAttribute("rows","1");var v=XT(l,"font-size");m.style.fontSize=v,m.style.padding="0px",m.style.border="0px";var _=document.body;_.appendChild(m);var w=m.offsetHeight;a=w,_.removeChild(m)}return a}var Ane=Cne,Dne=Fr&&Fr.__extends||function(){var l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,a){d.__proto__=a}||function(d,a){for(var c in a)a.hasOwnProperty(c)&&(d[c]=a[c])};return function(d,a){l(d,a);function c(){this.constructor=d}d.prototype=a===null?Object.create(a):(c.prototype=a.prototype,new c)}}(),ZT=Fr&&Fr.__assign||Object.assign||function(l){for(var d,a=1,c=arguments.length;a{a.which===13&&a.ctrlKey&&this.props.onSaveAndClose()}),r(this,"onKeyUp",a=>{a.which===46&&a.stopPropagation()}),this.element=Z()}componentDidMount(){this.props.focus&&this.element.current&&this.element.current.focus({preventScroll:!0})}render(){return Je.createElement(One,{ref:this.element,className:"r6o-editable-text",value:this.props.content,placeholder:this.props.placeholder||uo.t("Add a comment..."),disabled:!this.props.editable,onChange:this.props.onChange,onKeyUp:this.onKeyUp,onKeyDown:this.onKeyDown})}}function ri(){return ri=Object.assign?Object.assign.bind():function(l){for(var d=1;d0?Vr(uf,--Ys):0,lf--,cr===10&&(lf=1,N0--),cr}function co(){return cr=Ys2||Hm(cr)>3?"":" "}function Kne(l,d){for(;--d&&co()&&!(cr<48||cr>102||cr>57&&cr<65||cr>70&&cr<97););return Bm(l,H0()+(d<6&&Za()==32&&co()==32))}function tx(l){for(;co();)switch(cr){case l:return Ys;case 34:case 39:l!==34&&l!==39&&tx(cr);break;case 40:l===41&&tx(l);break;case 92:co();break}return Ys}function Yne(l,d){for(;co()&&l+cr!==57&&!(l+cr===84&&Za()===47););return"/*"+Bm(d,Ys-1)+"*"+M0(l===47?l:co())}function Xne(l){for(;!Hm(Za());)co();return Bm(l,Ys)}function Zne(l){return GO(z0("",null,null,null,[""],l=qO(l),0,[0],l))}function z0(l,d,a,c,f,m,v,_,w){for(var x=0,E=0,N=v,H=0,Y=0,ee=0,be=1,me=1,ke=1,U=0,ce="",Pe=f,Ae=m,Ne=c,Fe=ce;me;)switch(ee=U,U=co()){case 40:if(ee!=108&&Vr(Fe,N-1)==58){$T(Fe+=Xi(U0(U),"&","&\f"),"&\f")!=-1&&(ke=-1);break}case 34:case 39:case 91:Fe+=U0(U);break;case 9:case 10:case 13:case 32:Fe+=Gne(ee);break;case 92:Fe+=Kne(H0()-1,7);continue;case 47:switch(Za()){case 42:case 47:F0(Qne(Yne(co(),H0()),d,a),w);break;default:Fe+="/"}break;case 123*be:_[x++]=Xa(Fe)*ke;case 125*be:case 59:case 0:switch(U){case 0:case 125:me=0;case 59+E:ke==-1&&(Fe=Xi(Fe,/\f/g,"")),Y>0&&Xa(Fe)-N&&F0(Y>32?YO(Fe+";",c,a,N-1):YO(Xi(Fe," ","")+";",c,a,N-2),w);break;case 59:Fe+=";";default:if(F0(Ne=KO(Fe,d,a,x,E,f,_,ce,Pe=[],Ae=[],N),m),U===123)if(E===0)z0(Fe,d,Ne,Ne,Pe,m,N,_,Ae);else switch(H===99&&Vr(Fe,3)===110?100:H){case 100:case 108:case 109:case 115:z0(l,Ne,Ne,c&&F0(KO(l,Ne,Ne,0,0,f,_,ce,f,Pe=[],N),Ae),f,Ae,N,_,c?Pe:Ae);break;default:z0(Fe,Ne,Ne,Ne,[""],Ae,0,_,Ae)}}x=E=Y=0,be=ke=1,ce=Fe="",N=v;break;case 58:N=1+Xa(Fe),Y=ee;default:if(be<1){if(U==123)--be;else if(U==125&&be++==0&&qne()==125)continue}switch(Fe+=M0(U),U*be){case 38:ke=E>0?1:(Fe+="\f",-1);break;case 44:_[x++]=(Xa(Fe)-1)*ke,ke=1;break;case 64:Za()===45&&(Fe+=U0(co())),H=Za(),E=N=Xa(ce=Fe+=Xne(H0())),U++;break;case 45:ee===45&&Xa(Fe)==2&&(be=0)}}return m}function KO(l,d,a,c,f,m,v,_,w,x,E){for(var N=f-1,H=f===0?m:[""],Y=ex(H),ee=0,be=0,me=0;ee0?H[ke]+" "+U:Xi(U,/&\f/g,H[ke])))&&(w[me++]=ce);return B0(l,d,a,f===0?QT:_,w,x,E)}function Qne(l,d,a){return B0(l,d,a,zO,M0(Wne()),Fm(l,2,-2),0)}function YO(l,d,a,c){return B0(l,d,a,JT,Fm(l,0,c),Fm(l,c+1,-1),c)}function cf(l,d){for(var a="",c=ex(l),f=0;f6)switch(Vr(l,d+1)){case 109:if(Vr(l,d+4)!==45)break;case 102:return Xi(l,/(.+:)(.+)-([^]+)/,"$1"+Yi+"$2-$3$1"+L0+(Vr(l,d+3)==108?"$3":"$2-$3"))+l;case 115:return~$T(l,"stretch")?ZO(Xi(l,"stretch","fill-available"),d)+l:l}break;case 4949:if(Vr(l,d+1)!==115)break;case 6444:switch(Vr(l,Xa(l)-3-(~$T(l,"!important")&&10))){case 107:return Xi(l,":",":"+Yi)+l;case 101:return Xi(l,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Yi+(Vr(l,14)===45?"inline-":"")+"box$3$1"+Yi+"$2$3$1"+rs+"$2box$3")+l}break;case 5936:switch(Vr(l,d+11)){case 114:return Yi+l+rs+Xi(l,/[svh]\w+-[tblr]{2}/,"tb")+l;case 108:return Yi+l+rs+Xi(l,/[svh]\w+-[tblr]{2}/,"tb-rl")+l;case 45:return Yi+l+rs+Xi(l,/[svh]\w+-[tblr]{2}/,"lr")+l}return Yi+l+rs+l+l}return l}var are=function(l,d,a,c){if(l.length>-1&&!l.return)switch(l.type){case JT:l.return=ZO(l.value,l.length);break;case VO:return cf([Nm(l,{value:Xi(l.value,"@","@"+Yi)})],c);case QT:if(l.length)return jne(l.props,function(f){switch(Vne(f,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return cf([Nm(l,{props:[Xi(f,/:(read-\w+)/,":"+L0+"$1")]})],c);case"::placeholder":return cf([Nm(l,{props:[Xi(f,/:(plac\w+)/,":"+Yi+"input-$1")]}),Nm(l,{props:[Xi(f,/:(plac\w+)/,":"+L0+"$1")]}),Nm(l,{props:[Xi(f,/:(plac\w+)/,rs+"input-$1")]})],c)}return""})}},lre=[are],ure=function(l){var d=l.key;if(d==="css"){var a=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(a,function(ee){var be=ee.getAttribute("data-emotion");be.indexOf(" ")!==-1&&(document.head.appendChild(ee),ee.setAttribute("data-s",""))})}var c=l.stylisPlugins||lre,f={},m,v=[];m=l.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+d+' "]'),function(ee){for(var be=ee.getAttribute("data-emotion").split(" "),me=1;me=4;++c,f-=4)a=l.charCodeAt(c)&255|(l.charCodeAt(++c)&255)<<8|(l.charCodeAt(++c)&255)<<16|(l.charCodeAt(++c)&255)<<24,a=(a&65535)*1540483477+((a>>>16)*59797<<16),a^=a>>>24,d=(a&65535)*1540483477+((a>>>16)*59797<<16)^(d&65535)*1540483477+((d>>>16)*59797<<16);switch(f){case 3:d^=(l.charCodeAt(c+2)&255)<<16;case 2:d^=(l.charCodeAt(c+1)&255)<<8;case 1:d^=l.charCodeAt(c)&255,d=(d&65535)*1540483477+((d>>>16)*59797<<16)}return d^=d>>>13,d=(d&65535)*1540483477+((d>>>16)*59797<<16),((d^d>>>15)>>>0).toString(36)}var bre={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},_re=/[A-Z]|^ms/g,wre=/_EMO_([^_]+?)_([^]*?)_EMO_/g,nL=function(l){return l.charCodeAt(1)===45},rL=function(l){return l!=null&&typeof l!="boolean"},ox=tre(function(l){return nL(l)?l:l.replace(_re,"-$&").toLowerCase()}),sL=function(l,d){switch(l){case"animation":case"animationName":if(typeof d=="string")return d.replace(wre,function(a,c,f){return Qa={name:c,styles:f,next:Qa},c})}return bre[l]!==1&&!nL(l)&&typeof d=="number"&&d!==0?d+"px":d};function Um(l,d,a){if(a==null)return"";if(a.__emotion_styles!==void 0)return a;switch(typeof a){case"boolean":return"";case"object":{if(a.anim===1)return Qa={name:a.name,styles:a.styles,next:Qa},a.name;if(a.styles!==void 0){var c=a.next;if(c!==void 0)for(;c!==void 0;)Qa={name:c.name,styles:c.styles,next:Qa},c=c.next;var f=a.styles+";";return f}return Tre(l,d,a)}case"function":{if(l!==void 0){var m=Qa,v=a(l);return Qa=m,Um(l,d,v)}break}}if(d==null)return a;var _=d[a];return _!==void 0?_:a}function Tre(l,d,a){var c="";if(Array.isArray(a))for(var f=0;f=0)&&(a[f]=l[f]);return a}function df(l,d){if(l==null)return{};var a=dx(l,d),c,f;if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(l);for(f=0;f=0)&&(!Object.prototype.propertyIsEnumerable.call(l,c)||(a[c]=l[c]))}return a}function hf(l){return hf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(d){return typeof d}:function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},hf(l)}var dL={};Object.defineProperty(dL,"__esModule",{value:!0});var hx=Object.assign||function(l){for(var d=1;d=0||!Object.prototype.hasOwnProperty.call(l,c)||(a[c]=l[c]);return a}function Nre(l,d){if(!(l instanceof d))throw new TypeError("Cannot call a class as a function")}function Bre(l,d){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:l}function Hre(l,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);l.prototype=Object.create(d&&d.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(l,d):l.__proto__=d)}var mL={position:"absolute",top:0,left:0,visibility:"hidden",height:0,overflow:"scroll",whiteSpace:"pre"},Ure=["extraWidth","injectStyles","inputClassName","inputRef","inputStyle","minWidth","onAutosize","placeholderIsMinWidth"],zre=function(l){return Ure.forEach(function(d){return delete l[d]}),l},gL=function(l,d){d.style.fontSize=l.fontSize,d.style.fontFamily=l.fontFamily,d.style.fontWeight=l.fontWeight,d.style.fontStyle=l.fontStyle,d.style.letterSpacing=l.letterSpacing,d.style.textTransform=l.textTransform},yL=typeof window<"u"&&window.navigator?/MSIE |Trident\/|Edge\//.test(window.navigator.userAgent):!1,vL=function(){return yL?"_"+Math.random().toString(36).substr(2,12):void 0},fx=function(l){Hre(d,l),hL(d,null,[{key:"getDerivedStateFromProps",value:function(a,c){var f=a.id;return f!==c.prevId?{inputId:f||vL(),prevId:f}:null}}]);function d(a){Nre(this,d);var c=Bre(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,a));return c.inputRef=function(f){c.input=f,typeof c.props.inputRef=="function"&&c.props.inputRef(f)},c.placeHolderSizerRef=function(f){c.placeHolderSizer=f},c.sizerRef=function(f){c.sizer=f},c.state={inputWidth:a.minWidth,inputId:a.id||vL(),prevId:a.id},c}return hL(d,[{key:"componentDidMount",value:function(){this.mounted=!0,this.copyInputStyles(),this.updateInputWidth()}},{key:"componentDidUpdate",value:function(a,c){c.inputWidth!==this.state.inputWidth&&typeof this.props.onAutosize=="function"&&this.props.onAutosize(this.state.inputWidth),this.updateInputWidth()}},{key:"componentWillUnmount",value:function(){this.mounted=!1}},{key:"copyInputStyles",value:function(){if(!(!this.mounted||!window.getComputedStyle)){var a=this.input&&window.getComputedStyle(this.input);!a||(gL(a,this.sizer),this.placeHolderSizer&&gL(a,this.placeHolderSizer))}}},{key:"updateInputWidth",value:function(){if(!(!this.mounted||!this.sizer||typeof this.sizer.scrollWidth>"u")){var a=void 0;this.props.placeholder&&(!this.props.value||this.props.value&&this.props.placeholderIsMinWidth)?a=Math.max(this.sizer.scrollWidth,this.placeHolderSizer.scrollWidth)+2:a=this.sizer.scrollWidth+2;var c=this.props.type==="number"&&this.props.extraWidth===void 0?16:parseInt(this.props.extraWidth)||0;a+=c,a"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function Gre(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l}function Kre(l,d){return d&&(typeof d=="object"||typeof d=="function")?d:Gre(l)}function nv(l){var d=qre();return function(){var a=iv(l),c;if(d){var f=iv(this).constructor;c=Reflect.construct(a,arguments,f)}else c=a.apply(this,arguments);return Kre(this,c)}}var rv=function(){};function Yre(l,d){return d?d[0]==="-"?l+d:l+"__"+d:l}function Xre(l,d,a){var c=[a];if(d&&l)for(var f in d)d.hasOwnProperty(f)&&d[f]&&c.push("".concat(Yre(l,f)));return c.filter(function(m){return m}).map(function(m){return String(m).trim()}).join(" ")}var TL=function(l){return Array.isArray(l)?l.filter(Boolean):hf(l)==="object"&&l!==null?[l]:[]},xL=function(l){l.className,l.clearValue,l.cx,l.getStyles,l.getValue,l.hasValue,l.isMulti,l.isRtl,l.options,l.selectOption,l.selectProps,l.setValue,l.theme;var d=df(l,["className","clearValue","cx","getStyles","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"]);return jr({},d)};function px(l){return[document.documentElement,document.body,window].indexOf(l)>-1}function SL(l){return px(l)?window.pageYOffset:l.scrollTop}function sv(l,d){if(px(l)){window.scrollTo(0,d);return}l.scrollTop=d}function Zre(l){var d=getComputedStyle(l),a=d.position==="absolute",c=/(auto|scroll)/,f=document.documentElement;if(d.position==="fixed")return f;for(var m=l;m=m.parentElement;)if(d=getComputedStyle(m),!(a&&d.position==="static")&&c.test(d.overflow+d.overflowY+d.overflowX))return m;return f}function Qre(l,d,a,c){return a*((l=l/c-1)*l*l+1)+d}function ov(l,d){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,c=arguments.length>3&&arguments[3]!==void 0?arguments[3]:rv,f=SL(l),m=d-f,v=10,_=0;function w(){_+=v;var x=Qre(_,f,m,a);sv(l,x),_a.bottom?sv(l,Math.min(d.offsetTop+d.clientHeight-l.offsetHeight+f,l.scrollHeight)):c.top-f=be)return{placement:"bottom",maxHeight:d};if(At>=be&&!v)return m&&ov(x,Lt,Yt),{placement:"bottom",maxHeight:d};if(!v&&At>=c||v&<>=c){m&&ov(x,Lt,Yt);var Xt=v?lt-Ae:At-Ae;return{placement:"bottom",maxHeight:Xt}}if(f==="auto"||v){var di=d,li=v?Fe:ht;return li>=c&&(di=Math.min(li-Ae-w.controlHeight,d)),{placement:"top",maxHeight:di}}if(f==="bottom")return m&&sv(x,Lt),{placement:"bottom",maxHeight:d};break;case"top":if(Fe>=be)return{placement:"top",maxHeight:d};if(ht>=be&&!v)return m&&ov(x,kt,Yt),{placement:"top",maxHeight:d};if(!v&&ht>=c||v&&Fe>=c){var Fi=d;return(!v&&ht>=c||v&&Fe>=c)&&(Fi=v?Fe-Ne:ht-Ne),m&&ov(x,kt,Yt),{placement:"top",maxHeight:Fi}}return{placement:"bottom",maxHeight:d};default:throw new Error('Invalid placement provided "'.concat(f,'".'))}return E}function rse(l){var d={bottom:"top",top:"bottom"};return l?d[l]:"bottom"}var mx=function(l){return l==="auto"?"bottom":l},sse=function(l){var d,a=l.placement,c=l.theme,f=c.borderRadius,m=c.spacing,v=c.colors;return d={label:"menu"},jl(d,rse(a),"100%"),jl(d,"backgroundColor",v.neutral0),jl(d,"borderRadius",f),jl(d,"boxShadow","0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)"),jl(d,"marginBottom",m.menuGutter),jl(d,"marginTop",m.menuGutter),jl(d,"position","absolute"),jl(d,"width","100%"),jl(d,"zIndex",1),d},AL=rn({getPortalPlacement:null}),DL=function(l){tv(a,l);var d=nv(a);function a(){var c;J0(this,a);for(var f=arguments.length,m=new Array(f),v=0;vl.length)&&(d=l.length);for(var a=0,c=new Array(d);a-1}};function hoe(l){l.in,l.out,l.onExited,l.appear,l.enter,l.exit;var d=l.innerRef;l.emotion;var a=df(l,["in","out","onExited","appear","enter","exit","innerRef","emotion"]);return si("input",ri({ref:d},a,{css:cx({label:"dummyInput",background:0,border:0,fontSize:"inherit",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(0)"},"","")}))}var foe=function(l){l.preventDefault(),l.stopPropagation()};function poe(l){var d=l.isEnabled,a=l.onBottomArrive,c=l.onBottomLeave,f=l.onTopArrive,m=l.onTopLeave,v=Te(!1),_=Te(!1),w=Te(0),x=Te(null),E=_t(function(me,ke){if(x.current!==null){var U=x.current,ce=U.scrollTop,Pe=U.scrollHeight,Ae=U.clientHeight,Ne=x.current,Fe=ke>0,lt=Pe-Ae-ce,ht=!1;lt>ke&&v.current&&(c&&c(me),v.current=!1),Fe&&_.current&&(m&&m(me),_.current=!1),Fe&&ke>lt?(a&&!v.current&&a(me),Ne.scrollTop=Pe,ht=!0,v.current=!0):!Fe&&-ke>ce&&(f&&!_.current&&f(me),Ne.scrollTop=0,ht=!0,_.current=!0),ht&&foe(me)}},[]),N=_t(function(me){E(me,me.deltaY)},[E]),H=_t(function(me){w.current=me.changedTouches[0].clientY},[]),Y=_t(function(me){var ke=w.current-me.changedTouches[0].clientY;E(me,ke)},[E]),ee=_t(function(me){if(me){var ke=ise?{passive:!1}:!1;typeof me.addEventListener=="function"&&me.addEventListener("wheel",N,ke),typeof me.addEventListener=="function"&&me.addEventListener("touchstart",H,ke),typeof me.addEventListener=="function"&&me.addEventListener("touchmove",Y,ke)}},[Y,H,N]),be=_t(function(me){!me||(typeof me.removeEventListener=="function"&&me.removeEventListener("wheel",N,!1),typeof me.removeEventListener=="function"&&me.removeEventListener("touchstart",H,!1),typeof me.removeEventListener=="function"&&me.removeEventListener("touchmove",Y,!1))},[Y,H,N]);return nt(function(){if(d){var me=x.current;return ee(me),function(){be(me)}}},[d,ee,be]),function(me){x.current=me}}var WL=["boxSizing","height","overflow","paddingRight","position"],qL={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function GL(l){l.preventDefault()}function KL(l){l.stopPropagation()}function YL(){var l=this.scrollTop,d=this.scrollHeight,a=l+this.offsetHeight;l===0?this.scrollTop=1:a===d&&(this.scrollTop=l-1)}function XL(){return"ontouchstart"in window||navigator.maxTouchPoints}var ZL=!!(typeof window<"u"&&window.document&&window.document.createElement),Vm=0,ff={capture:!1,passive:!1};function moe(l){var d=l.isEnabled,a=l.accountForScrollbars,c=a===void 0?!0:a,f=Te({}),m=Te(null),v=_t(function(w){if(ZL){var x=document.body,E=x&&x.style;if(c&&WL.forEach(function(ee){var be=E&&E[ee];f.current[ee]=be}),c&&Vm<1){var N=parseInt(f.current.paddingRight,10)||0,H=document.body?document.body.clientWidth:0,Y=window.innerWidth-H+N||0;Object.keys(qL).forEach(function(ee){var be=qL[ee];E&&(E[ee]=be)}),E&&(E.paddingRight="".concat(Y,"px"))}x&&XL()&&(x.addEventListener("touchmove",GL,ff),w&&(w.addEventListener("touchstart",YL,ff),w.addEventListener("touchmove",KL,ff))),Vm+=1}},[]),_=_t(function(w){if(ZL){var x=document.body,E=x&&x.style;Vm=Math.max(Vm-1,0),c&&Vm<1&&WL.forEach(function(N){var H=f.current[N];E&&(E[N]=H)}),x&&XL()&&(x.removeEventListener("touchmove",GL,ff),w&&(w.removeEventListener("touchstart",YL,ff),w.removeEventListener("touchmove",KL,ff)))}},[]);return nt(function(){if(d){var w=m.current;return v(w),function(){_(w)}}},[d,v,_]),function(w){m.current=w}}var goe=function(){return document.activeElement&&document.activeElement.blur()},yoe={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function voe(l){var d=l.children,a=l.lockEnabled,c=l.captureEnabled,f=c===void 0?!0:c,m=l.onBottomArrive,v=l.onBottomLeave,_=l.onTopArrive,w=l.onTopLeave,x=poe({isEnabled:f,onBottomArrive:m,onBottomLeave:v,onTopArrive:_,onTopLeave:w}),E=moe({isEnabled:a}),N=function(H){x(H),E(H)};return si(Je.Fragment,null,a&&si("div",{onClick:goe,css:yoe}),d(N))}var boe=function(l){return l.label},_oe=function(l){return l.label},woe=function(l){return l.value},Toe=function(l){return!!l.isDisabled},xoe={clearIndicator:Tse,container:fse,control:Dse,dropdownIndicator:_se,group:kse,groupHeading:Rse,indicatorsContainer:yse,indicatorSeparator:Sse,input:Lse,loadingIndicator:Ase,loadingMessage:cse,menu:sse,menuList:ase,menuPortal:dse,multiValue:Nse,multiValueLabel:Bse,multiValueRemove:Hse,noOptionsMessage:use,option:jse,placeholder:qse,singleValue:Kse,valueContainer:mse},Soe={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},Eoe=4,QL=4,Coe=38,Aoe=QL*2,Doe={baseUnit:QL,controlHeight:Coe,menuGutter:Aoe},xx={borderRadius:Eoe,colors:Soe,spacing:Doe},Poe={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:EL(),captureMenuScroll:!EL(),closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:doe(),formatGroupLabel:boe,getOptionLabel:_oe,getOptionValue:woe,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:Toe,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!ese(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(l){var d=l.count;return"".concat(d," result").concat(d!==1?"s":""," available")},styles:{},tabIndex:"0",tabSelectsValue:!0};function JL(l,d,a,c){var f=nM(l,d,a),m=rM(l,d,a),v=iM(l,d),_=lv(l,d);return{type:"option",data:d,isDisabled:f,isSelected:m,label:v,value:_,index:c}}function $L(l,d){return l.options.map(function(a,c){if(a.options){var f=a.options.map(function(v,_){return JL(l,v,d,_)}).filter(function(v){return tM(l,v)});return f.length>0?{type:"group",data:a,options:f,index:c}:void 0}var m=JL(l,a,d,c);return tM(l,m)?m:void 0}).filter(function(a){return!!a})}function eM(l){return l.reduce(function(d,a){return a.type==="group"?d.push.apply(d,HL(a.options.map(function(c){return c.data}))):d.push(a.data),d},[])}function koe(l,d){return eM($L(l,d))}function tM(l,d){var a=l.inputValue,c=a===void 0?"":a,f=d.data,m=d.isSelected,v=d.label,_=d.value;return(!oM(l)||!m)&&sM(l,{label:v,value:_,data:f},c)}function Ioe(l,d){var a=l.focusedValue,c=l.selectValue,f=c.indexOf(a);if(f>-1){var m=d.indexOf(a);if(m>-1)return a;if(f-1?a:d[0]}var iM=function(l,d){return l.getOptionLabel(d)},lv=function(l,d){return l.getOptionValue(d)};function nM(l,d,a){return typeof l.isOptionDisabled=="function"?l.isOptionDisabled(d,a):!1}function rM(l,d,a){if(a.indexOf(d)>-1)return!0;if(typeof l.isOptionSelected=="function")return l.isOptionSelected(d,a);var c=lv(l,d);return a.some(function(f){return lv(l,f)===c})}function sM(l,d,a){return l.filterOption?l.filterOption(d,a):!0}var oM=function(l){var d=l.hideSelectedOptions,a=l.isMulti;return d===void 0?a:d},Ooe=1,aM=function(l){tv(a,l);var d=nv(a);function a(c){var f;return J0(this,a),f=d.call(this,c),f.state={ariaSelection:null,focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0},f.blockOptionHover=!1,f.isComposing=!1,f.commonProps=void 0,f.initialTouchX=0,f.initialTouchY=0,f.instancePrefix="",f.openAfterFocus=!1,f.scrollToFocusedOptionOnUpdate=!1,f.userIsDragging=void 0,f.controlRef=null,f.getControlRef=function(m){f.controlRef=m},f.focusedOptionRef=null,f.getFocusedOptionRef=function(m){f.focusedOptionRef=m},f.menuListRef=null,f.getMenuListRef=function(m){f.menuListRef=m},f.inputRef=null,f.getInputRef=function(m){f.inputRef=m},f.focus=f.focusInput,f.blur=f.blurInput,f.onChange=function(m,v){var _=f.props,w=_.onChange,x=_.name;v.name=x,f.ariaOnChange(m,v),w(m,v)},f.setValue=function(m){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"set-value",_=arguments.length>2?arguments[2]:void 0,w=f.props,x=w.closeMenuOnSelect,E=w.isMulti;f.onInputChange("",{action:"set-value"}),x&&(f.setState({inputIsHiddenAfterUpdate:!E}),f.onMenuClose()),f.setState({clearFocusValueOnUpdate:!0}),f.onChange(m,{action:v,option:_})},f.selectOption=function(m){var v=f.props,_=v.blurInputOnSelect,w=v.isMulti,x=v.name,E=f.state.selectValue,N=w&&f.isOptionSelected(m,E),H=f.isOptionDisabled(m,E);if(N){var Y=f.getOptionValue(m);f.setValue(E.filter(function(ee){return f.getOptionValue(ee)!==Y}),"deselect-option",m)}else if(!H)w?f.setValue([].concat(HL(E),[m]),"select-option",m):f.setValue(m,"select-option");else{f.ariaOnChange(m,{action:"select-option",name:x});return}_&&f.blurInput()},f.removeValue=function(m){var v=f.props.isMulti,_=f.state.selectValue,w=f.getOptionValue(m),x=_.filter(function(N){return f.getOptionValue(N)!==w}),E=v?x:x[0]||null;f.onChange(E,{action:"remove-value",removedValue:m}),f.focusInput()},f.clearValue=function(){var m=f.state.selectValue;f.onChange(f.props.isMulti?[]:null,{action:"clear",removedValues:m})},f.popValue=function(){var m=f.props.isMulti,v=f.state.selectValue,_=v[v.length-1],w=v.slice(0,v.length-1),x=m?w:w[0]||null;f.onChange(x,{action:"pop-value",removedValue:_})},f.getValue=function(){return f.state.selectValue},f.cx=function(){for(var m=arguments.length,v=new Array(m),_=0;_E||x>E}},f.onTouchEnd=function(m){f.userIsDragging||(f.controlRef&&!f.controlRef.contains(m.target)&&f.menuListRef&&!f.menuListRef.contains(m.target)&&f.blurInput(),f.initialTouchX=0,f.initialTouchY=0)},f.onControlTouchEnd=function(m){f.userIsDragging||f.onControlMouseDown(m)},f.onClearIndicatorTouchEnd=function(m){f.userIsDragging||f.onClearIndicatorMouseDown(m)},f.onDropdownIndicatorTouchEnd=function(m){f.userIsDragging||f.onDropdownIndicatorMouseDown(m)},f.handleInputChange=function(m){var v=m.currentTarget.value;f.setState({inputIsHiddenAfterUpdate:!1}),f.onInputChange(v,{action:"input-change"}),f.props.menuIsOpen||f.onMenuOpen()},f.onInputFocus=function(m){f.props.onFocus&&f.props.onFocus(m),f.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(f.openAfterFocus||f.props.openMenuOnFocus)&&f.openMenu("first"),f.openAfterFocus=!1},f.onInputBlur=function(m){if(f.menuListRef&&f.menuListRef.contains(document.activeElement)){f.inputRef.focus();return}f.props.onBlur&&f.props.onBlur(m),f.onInputChange("",{action:"input-blur"}),f.onMenuClose(),f.setState({focusedValue:null,isFocused:!1})},f.onOptionHover=function(m){f.blockOptionHover||f.state.focusedOption===m||f.setState({focusedOption:m})},f.shouldHideSelectedOptions=function(){return oM(f.props)},f.onKeyDown=function(m){var v=f.props,_=v.isMulti,w=v.backspaceRemovesValue,x=v.escapeClearsValue,E=v.inputValue,N=v.isClearable,H=v.isDisabled,Y=v.menuIsOpen,ee=v.onKeyDown,be=v.tabSelectsValue,me=v.openMenuOnFocus,ke=f.state,U=ke.focusedOption,ce=ke.focusedValue,Pe=ke.selectValue;if(!H&&!(typeof ee=="function"&&(ee(m),m.defaultPrevented))){switch(f.blockOptionHover=!0,m.key){case"ArrowLeft":if(!_||E)return;f.focusValue("previous");break;case"ArrowRight":if(!_||E)return;f.focusValue("next");break;case"Delete":case"Backspace":if(E)return;if(ce)f.removeValue(ce);else{if(!w)return;_?f.popValue():N&&f.clearValue()}break;case"Tab":if(f.isComposing||m.shiftKey||!Y||!be||!U||me&&f.isOptionSelected(U,Pe))return;f.selectOption(U);break;case"Enter":if(m.keyCode===229)break;if(Y){if(!U||f.isComposing)return;f.selectOption(U);break}return;case"Escape":Y?(f.setState({inputIsHiddenAfterUpdate:!1}),f.onInputChange("",{action:"menu-close"}),f.onMenuClose()):N&&x&&f.clearValue();break;case" ":if(E)return;if(!Y){f.openMenu("first");break}if(!U)return;f.selectOption(U);break;case"ArrowUp":Y?f.focusOption("up"):f.openMenu("last");break;case"ArrowDown":Y?f.focusOption("down"):f.openMenu("first");break;case"PageUp":if(!Y)return;f.focusOption("pageup");break;case"PageDown":if(!Y)return;f.focusOption("pagedown");break;case"Home":if(!Y)return;f.focusOption("first");break;case"End":if(!Y)return;f.focusOption("last");break;default:return}m.preventDefault()}},f.instancePrefix="react-select-"+(f.props.instanceId||++Ooe),f.state.selectValue=TL(c.value),f}return $0(a,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput()}},{key:"componentDidUpdate",value:function(c){var f=this.props,m=f.isDisabled,v=f.menuIsOpen,_=this.state.isFocused;(_&&!m&&c.isDisabled||_&&v&&!c.menuIsOpen)&&this.focusInput(),_&&m&&!c.isDisabled&&this.setState({isFocused:!1},this.onMenuClose),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Jre(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close"}),this.props.onMenuClose()}},{key:"onInputChange",value:function(c,f){this.props.onInputChange(c,f)}},{key:"focusInput",value:function(){!this.inputRef||this.inputRef.focus()}},{key:"blurInput",value:function(){!this.inputRef||this.inputRef.blur()}},{key:"openMenu",value:function(c){var f=this,m=this.state,v=m.selectValue,_=m.isFocused,w=this.buildFocusableOptions(),x=c==="first"?0:w.length-1;if(!this.props.isMulti){var E=w.indexOf(v[0]);E>-1&&(x=E)}this.scrollToFocusedOptionOnUpdate=!(_&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:w[x]},function(){return f.onMenuOpen()})}},{key:"focusValue",value:function(c){var f=this.state,m=f.selectValue,v=f.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var _=m.indexOf(v);v||(_=-1);var w=m.length-1,x=-1;if(m.length){switch(c){case"previous":_===0?x=0:_===-1?x=w:x=_-1;break;case"next":_>-1&&_0&&arguments[0]!==void 0?arguments[0]:"first",f=this.props.pageSize,m=this.state.focusedOption,v=this.getFocusableOptions();if(v.length){var _=0,w=v.indexOf(m);m||(w=-1),c==="up"?_=w>0?w-1:v.length-1:c==="down"?_=(w+1)%v.length:c==="pageup"?(_=w-f,_<0&&(_=0)):c==="pagedown"?(_=w+f,_>v.length-1&&(_=v.length-1)):c==="last"&&(_=v.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:v[_],focusedValue:null})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(xx):jr(jr({},xx),this.props.theme):xx}},{key:"getCommonProps",value:function(){var c=this.clearValue,f=this.cx,m=this.getStyles,v=this.getValue,_=this.selectOption,w=this.setValue,x=this.props,E=x.isMulti,N=x.isRtl,H=x.options,Y=this.hasValue();return{clearValue:c,cx:f,getStyles:m,getValue:v,hasValue:Y,isMulti:E,isRtl:N,options:H,selectOption:_,selectProps:x,setValue:w,theme:this.getTheme()}}},{key:"hasValue",value:function(){var c=this.state.selectValue;return c.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var c=this.props,f=c.isClearable,m=c.isMulti;return f===void 0?m:f}},{key:"isOptionDisabled",value:function(c,f){return nM(this.props,c,f)}},{key:"isOptionSelected",value:function(c,f){return rM(this.props,c,f)}},{key:"filterOption",value:function(c,f){return sM(this.props,c,f)}},{key:"formatOptionLabel",value:function(c,f){if(typeof this.props.formatOptionLabel=="function"){var m=this.props.inputValue,v=this.state.selectValue;return this.props.formatOptionLabel(c,{context:f,inputValue:m,selectValue:v})}else return this.getOptionLabel(c)}},{key:"formatGroupLabel",value:function(c){return this.props.formatGroupLabel(c)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var c=this.props,f=c.isDisabled,m=c.isSearchable,v=c.inputId,_=c.inputValue,w=c.tabIndex,x=c.form,E=this.getComponents(),N=E.Input,H=this.state.inputIsHidden,Y=this.commonProps,ee=v||this.getElementId("input"),be={"aria-autocomplete":"list","aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"]};return m?Je.createElement(N,ri({},Y,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:ee,innerRef:this.getInputRef,isDisabled:f,isHidden:H,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:w,form:x,type:"text",value:_},be)):Je.createElement(hoe,ri({id:ee,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:rv,onFocus:this.onInputFocus,readOnly:!0,disabled:f,tabIndex:w,form:x,value:""},be))}},{key:"renderPlaceholderOrValue",value:function(){var c=this,f=this.getComponents(),m=f.MultiValue,v=f.MultiValueContainer,_=f.MultiValueLabel,w=f.MultiValueRemove,x=f.SingleValue,E=f.Placeholder,N=this.commonProps,H=this.props,Y=H.controlShouldRenderValue,ee=H.isDisabled,be=H.isMulti,me=H.inputValue,ke=H.placeholder,U=this.state,ce=U.selectValue,Pe=U.focusedValue,Ae=U.isFocused;if(!this.hasValue()||!Y)return me?null:Je.createElement(E,ri({},N,{key:"placeholder",isDisabled:ee,isFocused:Ae}),ke);if(be){var Ne=ce.map(function(lt,ht){var At=lt===Pe;return Je.createElement(m,ri({},N,{components:{Container:v,Label:_,Remove:w},isFocused:At,isDisabled:ee,key:"".concat(c.getOptionValue(lt)).concat(ht),index:ht,removeProps:{onClick:function(){return c.removeValue(lt)},onTouchEnd:function(){return c.removeValue(lt)},onMouseDown:function(Lt){Lt.preventDefault(),Lt.stopPropagation()}},data:lt}),c.formatOptionLabel(lt,"value"))});return Ne}if(me)return null;var Fe=ce[0];return Je.createElement(x,ri({},N,{data:Fe,isDisabled:ee}),this.formatOptionLabel(Fe,"value"))}},{key:"renderClearIndicator",value:function(){var c=this.getComponents(),f=c.ClearIndicator,m=this.commonProps,v=this.props,_=v.isDisabled,w=v.isLoading,x=this.state.isFocused;if(!this.isClearable()||!f||_||!this.hasValue()||w)return null;var E={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return Je.createElement(f,ri({},m,{innerProps:E,isFocused:x}))}},{key:"renderLoadingIndicator",value:function(){var c=this.getComponents(),f=c.LoadingIndicator,m=this.commonProps,v=this.props,_=v.isDisabled,w=v.isLoading,x=this.state.isFocused;if(!f||!w)return null;var E={"aria-hidden":"true"};return Je.createElement(f,ri({},m,{innerProps:E,isDisabled:_,isFocused:x}))}},{key:"renderIndicatorSeparator",value:function(){var c=this.getComponents(),f=c.DropdownIndicator,m=c.IndicatorSeparator;if(!f||!m)return null;var v=this.commonProps,_=this.props.isDisabled,w=this.state.isFocused;return Je.createElement(m,ri({},v,{isDisabled:_,isFocused:w}))}},{key:"renderDropdownIndicator",value:function(){var c=this.getComponents(),f=c.DropdownIndicator;if(!f)return null;var m=this.commonProps,v=this.props.isDisabled,_=this.state.isFocused,w={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return Je.createElement(f,ri({},m,{innerProps:w,isDisabled:v,isFocused:_}))}},{key:"renderMenu",value:function(){var c=this,f=this.getComponents(),m=f.Group,v=f.GroupHeading,_=f.Menu,w=f.MenuList,x=f.MenuPortal,E=f.LoadingMessage,N=f.NoOptionsMessage,H=f.Option,Y=this.commonProps,ee=this.state.focusedOption,be=this.props,me=be.captureMenuScroll,ke=be.inputValue,U=be.isLoading,ce=be.loadingMessage,Pe=be.minMenuHeight,Ae=be.maxMenuHeight,Ne=be.menuIsOpen,Fe=be.menuPlacement,lt=be.menuPosition,ht=be.menuPortalTarget,At=be.menuShouldBlockScroll,Lt=be.menuShouldScrollIntoView,kt=be.noOptionsMessage,Yt=be.onMenuScrollToTop,Xt=be.onMenuScrollToBottom;if(!Ne)return null;var di=function(Wi,Kl){var oa=Wi.type,ss=Wi.data,fo=Wi.isDisabled,Ja=Wi.isSelected,Mo=Wi.label,bf=Wi.value,_f=ee===ss,fd=fo?void 0:function(){return c.onOptionHover(ss)},wf=fo?void 0:function(){return c.selectOption(ss)},Tf="".concat(c.getElementId("option"),"-").concat(Kl),xf={id:Tf,onClick:wf,onMouseMove:fd,onMouseOver:fd,tabIndex:-1};return Je.createElement(H,ri({},Y,{innerProps:xf,data:ss,isDisabled:fo,isSelected:Ja,key:Tf,label:Mo,type:oa,value:bf,isFocused:_f,innerRef:_f?c.getFocusedOptionRef:void 0}),c.formatOptionLabel(Wi.data,"menu"))},li;if(this.hasOptions())li=this.getCategorizedOptions().map(function(Wi){if(Wi.type==="group"){var Kl=Wi.data,oa=Wi.options,ss=Wi.index,fo="".concat(c.getElementId("group"),"-").concat(ss),Ja="".concat(fo,"-heading");return Je.createElement(m,ri({},Y,{key:fo,data:Kl,options:oa,Heading:v,headingProps:{id:Ja,data:Wi.data},label:c.formatGroupLabel(Wi.data)}),Wi.options.map(function(Mo){return di(Mo,"".concat(ss,"-").concat(Mo.index))}))}else if(Wi.type==="option")return di(Wi,"".concat(Wi.index))});else if(U){var Fi=ce({inputValue:ke});if(Fi===null)return null;li=Je.createElement(E,Y,Fi)}else{var zi=kt({inputValue:ke});if(zi===null)return null;li=Je.createElement(N,Y,zi)}var Tn={minMenuHeight:Pe,maxMenuHeight:Ae,menuPlacement:Fe,menuPosition:lt,menuShouldScrollIntoView:Lt},zt=Je.createElement(DL,ri({},Y,Tn),function(Wi){var Kl=Wi.ref,oa=Wi.placerProps,ss=oa.placement,fo=oa.maxHeight;return Je.createElement(_,ri({},Y,Tn,{innerRef:Kl,innerProps:{onMouseDown:c.onMenuMouseDown,onMouseMove:c.onMenuMouseMove},isLoading:U,placement:ss}),Je.createElement(voe,{captureEnabled:me,onTopArrive:Yt,onBottomArrive:Xt,lockEnabled:At},function(Ja){return Je.createElement(w,ri({},Y,{innerRef:function(Mo){c.getMenuListRef(Mo),Ja(Mo)},isLoading:U,maxHeight:fo,focusedOption:ee}),li)}))});return ht||lt==="fixed"?Je.createElement(x,ri({},Y,{appendTo:ht,controlElement:this.controlRef,menuPlacement:Fe,menuPosition:lt}),zt):zt}},{key:"renderFormField",value:function(){var c=this,f=this.props,m=f.delimiter,v=f.isDisabled,_=f.isMulti,w=f.name,x=this.state.selectValue;if(!(!w||v))if(_)if(m){var E=x.map(function(Y){return c.getOptionValue(Y)}).join(m);return Je.createElement("input",{name:w,type:"hidden",value:E})}else{var N=x.length>0?x.map(function(Y,ee){return Je.createElement("input",{key:"i-".concat(ee),name:w,type:"hidden",value:c.getOptionValue(Y)})}):Je.createElement("input",{name:w,type:"hidden"});return Je.createElement("div",null,N)}else{var H=x[0]?this.getOptionValue(x[0]):"";return Je.createElement("input",{name:w,type:"hidden",value:H})}}},{key:"renderLiveRegion",value:function(){var c=this.commonProps,f=this.state,m=f.ariaSelection,v=f.focusedOption,_=f.focusedValue,w=f.isFocused,x=f.selectValue,E=this.getFocusableOptions();return Je.createElement(aoe,ri({},c,{ariaSelection:m,focusedOption:v,focusedValue:_,isFocused:w,selectValue:x,focusableOptions:E}))}},{key:"render",value:function(){var c=this.getComponents(),f=c.Control,m=c.IndicatorsContainer,v=c.SelectContainer,_=c.ValueContainer,w=this.props,x=w.className,E=w.id,N=w.isDisabled,H=w.menuIsOpen,Y=this.state.isFocused,ee=this.commonProps=this.getCommonProps();return Je.createElement(v,ri({},ee,{className:x,innerProps:{id:E,onKeyDown:this.onKeyDown},isDisabled:N,isFocused:Y}),this.renderLiveRegion(),Je.createElement(f,ri({},ee,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:N,isFocused:Y,menuIsOpen:H}),Je.createElement(_,ri({},ee,{isDisabled:N}),this.renderPlaceholderOrValue(),this.renderInput()),Je.createElement(m,ri({},ee,{isDisabled:N}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(c,f){var m=f.prevProps,v=f.clearFocusValueOnUpdate,_=f.inputIsHiddenAfterUpdate,w=c.options,x=c.value,E=c.menuIsOpen,N=c.inputValue,H={};if(m&&(x!==m.value||w!==m.options||E!==m.menuIsOpen||N!==m.inputValue)){var Y=TL(x),ee=E?koe(c,Y):[],be=v?Ioe(f,Y):null,me=Roe(f,ee);H={selectValue:Y,focusedOption:me,focusedValue:be,clearFocusValueOnUpdate:!1}}var ke=_!=null&&c!==m?{inputIsHidden:_,inputIsHiddenAfterUpdate:void 0}:{};return jr(jr(jr({},H),ke),{},{prevProps:c})}}]),a}(ae);aM.defaultProps=Poe;var Loe={defaultInputValue:"",defaultMenuIsOpen:!1,defaultValue:null},Moe=function(l){var d,a;return a=d=function(c){tv(m,c);var f=nv(m);function m(){var v;J0(this,m);for(var _=arguments.length,w=new Array(_),x=0;x<_;x++)w[x]=arguments[x];return v=f.call.apply(f,[this].concat(w)),v.select=void 0,v.state={inputValue:v.props.inputValue!==void 0?v.props.inputValue:v.props.defaultInputValue,menuIsOpen:v.props.menuIsOpen!==void 0?v.props.menuIsOpen:v.props.defaultMenuIsOpen,value:v.props.value!==void 0?v.props.value:v.props.defaultValue},v.onChange=function(E,N){v.callProp("onChange",E,N),v.setState({value:E})},v.onInputChange=function(E,N){var H=v.callProp("onInputChange",E,N);v.setState({inputValue:H!==void 0?H:E})},v.onMenuOpen=function(){v.callProp("onMenuOpen"),v.setState({menuIsOpen:!0})},v.onMenuClose=function(){v.callProp("onMenuClose"),v.setState({menuIsOpen:!1})},v}return $0(m,[{key:"focus",value:function(){this.select.focus()}},{key:"blur",value:function(){this.select.blur()}},{key:"getProp",value:function(v){return this.props[v]!==void 0?this.props[v]:this.state[v]}},{key:"callProp",value:function(v){if(typeof this.props[v]=="function"){for(var _,w=arguments.length,x=new Array(w>1?w-1:0),E=1;E{const d=l.content?Sx.find(a=>a.value===l.content):null;return Je.createElement("div",{className:"r6o-purposedropdown"},Je.createElement(Noe,{value:d,onChange:l.onChange,options:Sx,isDisabled:!l.editable}))};const Boe=l=>Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1000 940",width:l.width},Je.createElement("metadata",null,"IcoFont Icons"),Je.createElement("title",null,"simple-down"),Je.createElement("glyph",{glyphName:"simple-down",unicode:"",horizAdvX:"1000"}),Je.createElement("path",{fill:"currentColor",d:"M200 392.6l300 300 300-300-85.10000000000002-85.10000000000002-214.89999999999998 214.79999999999995-214.89999999999998-214.89999999999998-85.10000000000002 85.20000000000005z"})),Hoe=l=>Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"180 150 700 800",width:l.width},Je.createElement("metadata",null,"IcoFont Icons"),Je.createElement("title",null,"close"),Je.createElement("glyph",{glyphName:"close",unicode:"",horizAdvX:"1000"}),Je.createElement("path",{fill:"currentColor",d:"M709.8 206.6c-64.39999999999998 65.50000000000003-128.89999999999998 131.20000000000002-194.19999999999993 197.6-8.600000000000023 8.699999999999989-22.400000000000034 8.800000000000011-31 0-65-66-129.70000000000005-131.8-194.5-197.6-8.600000000000023-8.699999999999989-22.400000000000034-8.599999999999994-30.900000000000034 0.09999999999999432-15.699999999999989 16.200000000000017-31.099999999999994 32.30000000000001-47.099999999999994 48.80000000000001-8.5 8.800000000000011-8.299999999999983 23 0.20000000000001705 31.69999999999999 63.099999999999966 64.19999999999999 127.89999999999998 130.10000000000002 193.59999999999997 197 8.600000000000023 8.699999999999989 8.5 22.80000000000001 0 31.599999999999966-65.19999999999999 66.40000000000009-130.2 132.5-194.7 198.10000000000002-8.5 8.700000000000045-8.5 22.800000000000068 0.20000000000001705 31.399999999999977l47.79999999999998 47.90000000000009c8.600000000000023 8.599999999999909 22.600000000000023 8.599999999999909 31.100000000000023-0.10000000000002274l194.2-197.30000000000007c8.600000000000023-8.699999999999932 22.399999999999977-8.699999999999932 31 0 64.70000000000005 65.80000000000007 129.20000000000005 131.4000000000001 194.20000000000005 197.5 8.599999999999909 8.700000000000045 22.5 8.800000000000068 31 0.10000000000002274 16-16.199999999999932 31.699999999999932-32.19999999999993 47.59999999999991-48.299999999999955 8.600000000000023-8.700000000000045 8.600000000000023-22.899999999999977 0.10000000000002274-31.600000000000023-63.799999999999955-65-128.5-130.89999999999998-194.19999999999993-197.79999999999995-8.600000000000023-8.700000000000045-8.600000000000023-22.900000000000034 0-31.600000000000023 65.19999999999993-66.40000000000003 130.0999999999999-132.5 194.5-198.20000000000005 8.599999999999909-8.699999999999989 8.5-22.799999999999955-0.10000000000002274-31.49999999999997l-47.80000000000007-48.099999999999994c-8.5-8.5-22.399999999999977-8.400000000000006-31 0.29999999999998295z"})),Uoe=l=>Je.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",width:l.width},Je.createElement("path",{fill:"currentColor",d:"M268 416h24a12 12 0 0 0 12-12V188a12 12 0 0 0-12-12h-24a12 12 0 0 0-12 12v216a12 12 0 0 0 12 12zM432 80h-82.41l-34-56.7A48 48 0 0 0 274.41 0H173.59a48 48 0 0 0-41.16 23.3L98.41 80H16A16 16 0 0 0 0 96v16a16 16 0 0 0 16 16h16v336a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128h16a16 16 0 0 0 16-16V96a16 16 0 0 0-16-16zM171.84 50.91A6 6 0 0 1 177 48h94a6 6 0 0 1 5.15 2.91L293.61 80H154.39zM368 464H80V128h288zm-212-48h24a12 12 0 0 0 12-12V188a12 12 0 0 0-12-12h-24a12 12 0 0 0-12 12v216a12 12 0 0 0 12 12z"}));var zoe=l=>{const[d,a]=he(!1),[c,f]=he(!1),m=N=>{a(!0),f(!1)},v=N=>{l.onDelete(l.body),f(!1)},_=N=>l.onUpdate(l.body,{...l.body,value:N.target.value}),w=N=>l.onUpdate(l.body,{...l.body,purpose:N.value}),x=l.body.modified||l.body.created,E=l.body.creator&&Je.createElement("div",{className:"r6o-lastmodified"},Je.createElement("span",{className:"r6o-lastmodified-by"},l.body.creator.name||l.body.creator.id),l.body.created&&Je.createElement("span",{className:"r6o-lastmodified-at"},Je.createElement(Zc,{datetime:l.env.toClientTime(x),locale:uo.locale()})));return l.readOnly?Je.createElement("div",{className:"r6o-widget comment"},Je.createElement("div",{className:"r6o-readonly-comment"},l.body.value),E):Je.createElement("div",{className:d?"r6o-widget comment editable":"r6o-widget comment"},Je.createElement(UO,{editable:d,content:l.body.value,onChange:_,onSaveAndClose:l.onSaveAndClose}),!d&&E,l.purposeSelector&&Je.createElement(lM,{editable:d,content:l.body.purpose,onChange:w,onSaveAndClose:l.onSaveAndClose}),Je.createElement("div",{className:c?"r6o-icon r6o-arrow-down r6o-menu-open":"r6o-icon r6o-arrow-down",onClick:()=>f(!c)},Je.createElement(Boe,{width:12})),c&&Je.createElement(xne,{onEdit:m,onDelete:v,onClickOutside:()=>f(!1)}))};const Voe=Sx.map(l=>l.value),uM=(l,d)=>{const a=d?Voe.indexOf(l.purpose)>-1:l.purpose=="commenting"||l.purpose=="replying";return l.type==="TextualBody"&&(!Object.prototype.hasOwnProperty.call(l,"purpose")||a)},cM=(l,d)=>{var a,c;if(d.editable===!0)return!1;if(d.editable===!1)return!0;if(d.editable==="MINE_ONLY"){const f=(a=l.creator)==null?void 0:a.id;return((c=d.env.user)==null?void 0:c.id)!==f}return d.readOnly},joe=(l,d)=>l||{type:"TextualBody",value:"",purpose:d?"replying":"commenting",draft:!0},dM=l=>{const d=l.annotation?l.annotation.bodies.filter(w=>uM(w,l.purposeSelector)):[],a=joe(d.find(w=>w.draft==!0),d.length>1),c=d.filter(w=>w!=a),f=w=>{const x=a.value,E=w.target.value;x.length===0&&E.length>0?l.onAppendBody({...a,value:E}):x.length>0&&E.length===0?l.onRemoveBody(a):l.onUpdateBody(a,{...a,value:E})},m=w=>l.onUpdateBody(a,{...a,purpose:w.value}),v=!l.readOnly&&l.annotation,_=c.length===0||!l.disableReply;return Je.createElement(Je.Fragment,null,c.map((w,x)=>Je.createElement(zoe,{key:x,env:l.env,purposeSelector:l.purposeSelector,readOnly:cM(w,l),body:w,onUpdate:l.onUpdateBody,onDelete:l.onRemoveBody,onSaveAndClose:l.onSaveAndClose})),v&&_&&Je.createElement("div",{className:"r6o-widget comment editable"},Je.createElement(UO,{focus:l.focus,content:a.value,editable:!0,placeholder:c.length>0?uo.t("Add a reply..."):l.textPlaceHolder||uo.t("Add a comment..."),onChange:f,onSaveAndClose:()=>l.onSaveAndClose()}),l.purposeSelector&&a.value.length>0&&Je.createElement(lM,{editable:!0,content:a.purpose,onChange:m,onSaveAndClose:()=>l.onSaveAndClose()})))};dM.disableDelete=(l,d)=>l.bodies.filter(a=>uM(a,d.purposeSelector)).some(a=>cM(a,d));var hM=dM;function fM(l,d){l.prototype=Object.create(d.prototype),l.prototype.constructor=l,ev(l,d)}function Woe(l,d){return l.classList?!!d&&l.classList.contains(d):(" "+(l.className.baseVal||l.className)+" ").indexOf(" "+d+" ")!==-1}function qoe(l,d){l.classList?l.classList.add(d):Woe(l,d)||(typeof l.className=="string"?l.className=l.className+" "+d:l.setAttribute("class",(l.className&&l.className.baseVal||"")+" "+d))}function pM(l,d){return l.replace(new RegExp("(^|\\s)"+d+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function Goe(l,d){l.classList?l.classList.remove(d):typeof l.className=="string"?l.className=pM(l.className,d):l.setAttribute("class",pM(l.className&&l.className.baseVal||"",d))}var mM={disabled:!1},gM=Je.createContext(null),yM=function(l){return l.scrollTop},jm="unmounted",ud="exited",cd="entering",pf="entered",Ex="exiting",Wl=function(l){fM(d,l);function d(c,f){var m;m=l.call(this,c,f)||this;var v=f,_=v&&!v.isMounting?c.enter:c.appear,w;return m.appearStatus=null,c.in?_?(w=ud,m.appearStatus=cd):w=pf:c.unmountOnExit||c.mountOnEnter?w=jm:w=ud,m.state={status:w},m.nextCallback=null,m}d.getDerivedStateFromProps=function(c,f){var m=c.in;return m&&f.status===jm?{status:ud}:null};var a=d.prototype;return a.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},a.componentDidUpdate=function(c){var f=null;if(c!==this.props){var m=this.state.status;this.props.in?m!==cd&&m!==pf&&(f=cd):(m===cd||m===pf)&&(f=Ex)}this.updateStatus(!1,f)},a.componentWillUnmount=function(){this.cancelNextCallback()},a.getTimeouts=function(){var c=this.props.timeout,f,m,v;return f=m=v=c,c!=null&&typeof c!="number"&&(f=c.exit,m=c.enter,v=c.appear!==void 0?c.appear:m),{exit:f,enter:m,appear:v}},a.updateStatus=function(c,f){if(c===void 0&&(c=!1),f!==null)if(this.cancelNextCallback(),f===cd){if(this.props.unmountOnExit||this.props.mountOnEnter){var m=this.props.nodeRef?this.props.nodeRef.current:Je.findDOMNode(this);m&&yM(m)}this.performEnter(c)}else this.performExit();else this.props.unmountOnExit&&this.state.status===ud&&this.setState({status:jm})},a.performEnter=function(c){var f=this,m=this.props.enter,v=this.context?this.context.isMounting:c,_=this.props.nodeRef?[v]:[Je.findDOMNode(this),v],w=_[0],x=_[1],E=this.getTimeouts(),N=v?E.appear:E.enter;if(!c&&!m||mM.disabled){this.safeSetState({status:pf},function(){f.props.onEntered(w)});return}this.props.onEnter(w,x),this.safeSetState({status:cd},function(){f.props.onEntering(w,x),f.onTransitionEnd(N,function(){f.safeSetState({status:pf},function(){f.props.onEntered(w,x)})})})},a.performExit=function(){var c=this,f=this.props.exit,m=this.getTimeouts(),v=this.props.nodeRef?void 0:Je.findDOMNode(this);if(!f||mM.disabled){this.safeSetState({status:ud},function(){c.props.onExited(v)});return}this.props.onExit(v),this.safeSetState({status:Ex},function(){c.props.onExiting(v),c.onTransitionEnd(m.exit,function(){c.safeSetState({status:ud},function(){c.props.onExited(v)})})})},a.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},a.safeSetState=function(c,f){f=this.setNextCallback(f),this.setState(c,f)},a.setNextCallback=function(c){var f=this,m=!0;return this.nextCallback=function(v){m&&(m=!1,f.nextCallback=null,c(v))},this.nextCallback.cancel=function(){m=!1},this.nextCallback},a.onTransitionEnd=function(c,f){this.setNextCallback(f);var m=this.props.nodeRef?this.props.nodeRef.current:Je.findDOMNode(this),v=c==null&&!this.props.addEndListener;if(!m||v){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var _=this.props.nodeRef?[this.nextCallback]:[m,this.nextCallback],w=_[0],x=_[1];this.props.addEndListener(w,x)}c!=null&&setTimeout(this.nextCallback,c)},a.render=function(){var c=this.state.status;if(c===jm)return null;var f=this.props,m=f.children;f.in,f.mountOnEnter,f.unmountOnExit,f.appear,f.enter,f.exit,f.timeout,f.addEndListener,f.onEnter,f.onEntering,f.onEntered,f.onExit,f.onExiting,f.onExited,f.nodeRef;var v=dx(f,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Je.createElement(gM.Provider,{value:null},typeof m=="function"?m(c,v):Je.cloneElement(Je.Children.only(m),v))},d}(Je.Component);Wl.contextType=gM,Wl.propTypes={};function mf(){}Wl.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:mf,onEntering:mf,onEntered:mf,onExit:mf,onExiting:mf,onExited:mf},Wl.UNMOUNTED=jm,Wl.EXITED=ud,Wl.ENTERING=cd,Wl.ENTERED=pf,Wl.EXITING=Ex;var Koe=Wl,Yoe=function(l,d){return l&&d&&d.split(" ").forEach(function(a){return qoe(l,a)})},Cx=function(l,d){return l&&d&&d.split(" ").forEach(function(a){return Goe(l,a)})},Ax=function(l){fM(d,l);function d(){for(var c,f=arguments.length,m=new Array(f),v=0;vd.filter(a=>(a.label?a.label:a).toLowerCase().startsWith(l.toLowerCase())),Qoe=(l,d)=>d(l);var Joe=l=>{const d=Te(),[a,c]=he(l.initialValue||""),[f,m]=he([]),[v,_]=he(null);nt(()=>{l.focus&&d.current.querySelector("input").focus({preventScroll:!0})},[]),nt(()=>{l.onChange&&l.onChange(a)},[a]);const w=H=>{if(typeof l.vocabulary=="function"){const Y=Qoe(H,l.vocabulary);Y.then?Y.then(m):m(Y)}else{const Y=Zoe(H,l.vocabulary);m(Y)}},x=()=>{if(v!==null)l.onSubmit(f[v]);else{const H=a.trim();if(H){const Y=Array.isArray(l.vocabulary)?l.vocabulary.find(ee=>(ee.label||ee).toLowerCase()===H.toLowerCase()):null;Y?l.onSubmit(Y):l.onSubmit(H)}}c(""),m([]),_(null)},E=H=>{if(H.which===13)x();else if(H.which===27)l.onCancel&&l.onCancel();else if(f.length>0){if(H.which===38)if(v===null)_(0);else{const Y=Math.max(0,v-1);_(Y)}else if(H.which===40)if(v===null)_(0);else{const Y=Math.min(f.length-1,v+1);_(Y)}}else H.which===40&&Array.isArray(l.vocabulary)&&m(l.vocabulary)},N=H=>{const{value:Y}=H.target;c(Y),_(null),Y?w(Y):m([])};return Je.createElement("div",{ref:d,className:"r6o-autocomplete"},Je.createElement("div",null,Je.createElement("input",{onKeyDown:E,onChange:N,value:a,placeholder:l.placeholder})),Je.createElement("ul",null,f.length>0&&f.map((H,Y)=>Je.createElement("li",{key:`${H.label?H.label:H}${Y}`,onClick:x,onMouseEnter:()=>_(Y),style:v===Y?{backgroundColor:"#bde4ff"}:{}},H.label?H.label:H))))};const $oe=l=>l||{type:"TextualBody",value:"",purpose:"tagging",draft:!0};var vM=l=>{const d=l.annotation?l.annotation.bodies.filter(N=>N.purpose==="tagging"):[],a=$oe(d.slice().reverse().find(N=>N.draft)),c=d.filter(N=>N!=a),[f,m]=he(!1),v=N=>H=>{m(f===N?!1:N)},_=N=>{const H=a.value.trim(),Y=N.trim();H.length===0&&Y.length>0?l.onAppendBody({...a,value:Y}):H.length>0&&Y.length===0?l.onRemoveBody(a):H!==Y&&l.onUpdateBody(a,{...a,value:Y})},w=N=>H=>{H.stopPropagation(),l.onRemoveBody(N)},x=N=>{const H=N.uri?{type:"SpecificResource",purpose:"tagging",source:{id:N.uri,label:N.label}}:{type:"TextualBody",purpose:"tagging",value:N.label||N};a.value.trim().length===0?l.onAppendBody(H):l.onUpdateBody(a,H)},E=N=>N.value||N.source.label;return Je.createElement("div",{className:"r6o-widget r6o-tag"},c.length>0&&Je.createElement("ul",{className:"r6o-taglist"},c.map(N=>Je.createElement("li",{key:E(N),onClick:v(N)},Je.createElement("span",{className:"r6o-label"},E(N)),!l.readOnly&&Je.createElement(Xoe,{in:f===N,timeout:200,classNames:"r6o-delete"},Je.createElement("span",{className:"r6o-delete-wrapper",onClick:w(N)},Je.createElement("span",{className:"r6o-delete"},Je.createElement(Hoe,{width:12}))))))),!l.readOnly&&Je.createElement(Joe,{focus:l.focus,placeholder:l.textPlaceHolder||uo.t("Add tag..."),vocabulary:l.vocabulary||[],onChange:_,onSubmit:x}))};class bM extends ae{constructor(d){super(d),this.element=Je.createRef()}renderWidget(d){const a=this.props.widget({annotation:d.annotation,readOnly:d.readOnly,...d.config,onAppendBody:(c,f)=>d.onAppendBody(c,f),onUpdateBody:(c,f,m)=>d.onUpdateBody(c,f,m),onUpsertBody:(c,f,m)=>d.onUpsertBody(c,f,m),onRemoveBody:(c,f)=>d.onRemoveBody(c,f),onBatchModify:(c,f)=>d.onBatchModify(c,f),onSetProperty:(c,f)=>d.onSetProperty(c,f),onAddContext:c=>d.onAddContext(c),onSaveAndClose:()=>d.onSaveAndClose()});for(;this.element.current.firstChild;)this.element.current.removeChild(this.element.current.lastChild);this.element.current.appendChild(a)}componentDidMount(){this.renderWidget(this.props)}componentWillReceiveProps(d){this.element.current&&this.props.annotation!==d.annotation&&this.renderWidget(d)}render(){return Je.createElement("div",{ref:this.element,className:"widget"})}}window.React=Je,window.ReactDOM=Je;const eae={COMMENT:hM,TAG:vM},tae=[Je.createElement(hM,null),Je.createElement(vM,null)],iae=l=>{const d=c=>{var f;return typeof c=="function"&&!!((f=c.prototype)!=null&&f.isReactComponent)},a=c=>typeof c=="function"&&(String(c).match(/return .+\(['|"].+['|"],\s*\{/g)||String(c).match(/return .+preact_compat/)||String(c).match(/return .+\.createElement/g));return d(l)||a(l)},nae=l=>{const d=(a,c,f)=>{if(typeof a=="string"||a instanceof String)return Je.createElement(eae[a],c);if((f==null?void 0:f.toLowerCase())==="react")return Je.createElement(a,c);if((f==null?void 0:f.toLowerCase())==="plainjs")return Je.createElement(bM,{widget:a,config:c});if(iae(a))return Je.createElement(a,c);if(typeof a=="function"||a instanceof Function)return Je.createElement(bM,{widget:a,config:c});throw`${a} is not a valid plugin`};if(l.widget){const{widget:a,force:c,...f}=l;return d(a,f,c)}else return d(l)},_M=14;var wM=(l,d,a,c)=>{const f=l.getBoundingClientRect();d.className="r6o-editor r6o-arrow-top r6o-arrow-left";const{left:m,top:v,right:_,bottom:w}=a.getBoundingClientRect();if(d.style.top=`${w-f.top+_M}px`,d.style.left=`${m-f.left}px`,c){const x=d.children[1].getBoundingClientRect(),{innerWidth:E,innerHeight:N}=l.ownerDocument.defaultView;if(x.right>E&&(d.classList.remove("r6o-arrow-left"),d.classList.add("r6o-arrow-right"),d.style.left=`${_-x.width-f.left}px`),x.bottom>N){d.classList.remove("r6o-arrow-top"),d.classList.add("r6o-arrow-bottom");const Y=d.children[1].getBoundingClientRect().height;d.style.top=`${v-f.top-Y-_M}px`}const H=d.children[1].getBoundingClientRect();if(H.top<0){d.classList.add("pushed","down"),d.style.top=`${-f.top}px`;const Y=w-f.top;H.height-f.top>Y&&d.classList.remove("r6o-arrow-bottom")}H.left<0&&(d.classList.add("pushed","right"),d.style.left=`${-f.left}px`),requestAnimationFrame(()=>d.style.opacity=1)}};const TM=l=>{const{top:d,left:a,width:c,height:f}=l.getBoundingClientRect();return`${d}, ${a}, ${c}, ${f}`};class rae extends ae{constructor(d){super(d),r(this,"initResizeObserver",()=>{const a=this.props.autoPosition===void 0?!0:this.props.autoPosition;if(window!=null&&window.ResizeObserver){const c=new ResizeObserver(()=>{this.state.dragged||wM(this.props.wrapperEl,this.element.current,this.props.selectedElement,a)});return c.observe(this.props.wrapperEl),()=>c.disconnect()}else this.state.dragged||wM(this.props.wrapperEl,this.element.current,this.props.selectedElement,a)}),r(this,"creationMeta",a=>{const c={},{user:f}=this.props.env;return f&&(c.creator={},f.id&&(c.creator.id=f.id),f.displayName&&(c.creator.name=f.displayName),c[a.created?"modified":"created"]=this.props.env.getCurrentTimeAdjusted()),c}),r(this,"getCurrentAnnotation",()=>this.state.currentAnnotation.clone()),r(this,"hasChanges",()=>{var a;return!((a=this.props.annotation)!=null&&a.isEqual(this.state.currentAnnotation))}),r(this,"updateCurrentAnnotation",(a,c)=>{this.setState({currentAnnotation:this.state.currentAnnotation.clone(a)},()=>{c?this.onOk():this.props.onChanged&&this.props.onChanged()})}),r(this,"onAppendBody",(a,c)=>this.updateCurrentAnnotation({body:[...this.state.currentAnnotation.bodies,{...a,...this.creationMeta(a)}]},c)),r(this,"onUpdateBody",(a,c,f)=>this.updateCurrentAnnotation({body:this.state.currentAnnotation.bodies.map(m=>m===a?{...c,...this.creationMeta(c)}:m)},f)),r(this,"onRemoveBody",(a,c)=>this.updateCurrentAnnotation({body:this.state.currentAnnotation.bodies.filter(f=>f!==a)},c)),r(this,"onUpsertBody",(a,c,f)=>{if(a==null&&c!=null)this.onAppendBody(c,f);else if(a!=null&&c!=null)this.onUpdateBody(a,c,f);else if(a!=null&&c==null){const m=this.state.currentAnnotation.bodies.find(v=>v.purpose===a.purpose);m?this.onUpdateBody(m,a,f):this.onAppendBody(a,f)}}),r(this,"onBatchModify",(a,c)=>{const f=a.filter(x=>x.action==="upsert"&&x.body).map(x=>({previous:this.state.currentAnnotation.bodies.find(E=>E.purpose===x.body.purpose),updated:{...x.body,...this.creationMeta(x.body)}})),m=a.filter(x=>x.action==="remove").map(x=>x.body),v=[...a.filter(x=>x.action==="append"||x.action==="upsert"&&x.updated&&!x.previous).map(x=>({...x.body,...this.creationMeta(x.body)})),...f.filter(x=>!x.previous).map(x=>x.updated)],_=[...a.filter(x=>x.action==="update"||x.action==="upsert"&&x.updated&&x.previous).map(x=>({previous:x.previous,updated:{...x.updated,...this.creationMeta(x.updated)}})),...f.filter(x=>x.previous)],w=[...this.state.currentAnnotation.bodies.filter(x=>!m.includes(x)).map(x=>{const E=_.find(N=>N.previous===x);return E?E.updated:x}),...v];this.updateCurrentAnnotation({body:w},c)}),r(this,"onSetProperty",(a,c)=>{if(["@context","id","type","body","target"].includes(a))throw new Exception(`Cannot set ${a} - not allowed`);if(c)this.updateCurrentAnnotation({[a]:c});else{const f=this.currentAnnotation.clone();delete f[a],this.setState({currentAnnotation:f})}}),r(this,"onAddContext",a=>{const{currentAnnotation:c}=this.state,f=Array.isArray(c.context)?c.context:[c.context];f.indexOf(a)<0&&(f.push(a),this.updateCurrentAnnotation({"@context":f}))}),r(this,"onCancel",()=>this.props.onCancel(this.props.annotation)),r(this,"onOk",()=>{const a=f=>f.clone({body:f.bodies.map(({draft:m,...v})=>v)}),{currentAnnotation:c}=this.state;c.bodies.length===0&&!this.props.allowEmpty?c.isSelection?this.onCancel():this.props.onAnnotationDeleted(this.props.annotation):c.isSelection?this.props.onAnnotationCreated(a(c).toAnnotation()):this.props.onAnnotationUpdated(a(c),this.props.annotation)}),r(this,"onDelete",()=>this.props.onAnnotationDeleted(this.props.annotation)),this.element=Je.createRef(),this.state={currentAnnotation:d.annotation,dragged:!1,selectionBounds:TM(d.selectedElement)}}componentWillReceiveProps(d){var a;const{selectionBounds:c}=this.state,f=TM(d.selectedElement);(a=this.props.annotation)!=null&&a.isEqual(d.annotation)?this.setState({selectionBounds:f}):this.setState({currentAnnotation:d.annotation,selectionBounds:f}),this.props.modifiedTarget!=d.modifiedTarget&&this.state.currentAnnotation&&this.updateCurrentAnnotation({target:this.props.modifiedTarget}),c!=f&&this.element.current&&(this.removeObserver&&this.removeObserver(),this.removeObserver=this.initResizeObserver())}componentDidMount(){this.removeObserver=this.initResizeObserver(),new MutationObserver(()=>{this.element.current&&(this.removeObserver&&this.removeObserver(),this.removeObserver=this.initResizeObserver())}).observe(this.element.current,{childList:!0,subtree:!0})}componentWillUnmount(){this.removeObserver&&this.removeObserver()}render(){const{currentAnnotation:d}=this.state,a=this.props.widgets?this.props.widgets.map(nae):tae,c=m=>m.type.disableDelete?m.type.disableDelete(d,{...m.props,readOnly:this.props.readOnly,env:this.props.env}):!1,f=d&&(d.bodies.length>0||this.props.allowEmpty)&&!this.props.readOnly&&!d.isSelection&&!a.some(c);return Je.createElement(lm,{disabled:!this.props.detachable,handle:".r6o-draggable",cancel:".r6o-btn, .r6o-btn *",onDrag:()=>this.setState({dragged:!0})},Je.createElement("div",{ref:this.element,className:this.state.dragged?"r6o-editor dragged":"r6o-editor"},Je.createElement("div",{className:"r6o-arrow"}),Je.createElement("div",{className:"r6o-editor-inner"},a.map((m,v)=>Je.cloneElement(m,{key:`${v}`,focus:v===0,annotation:d,readOnly:this.props.readOnly,env:this.props.env,onAppendBody:this.onAppendBody,onUpdateBody:this.onUpdateBody,onRemoveBody:this.onRemoveBody,onUpsertBody:this.onUpsertBody,onBatchModify:this.onBatchModify,onSetProperty:this.onSetProperty,onAddContext:this.onAddContext,onSaveAndClose:this.onOk})),this.props.readOnly?Je.createElement("div",{className:"r6o-footer"},Je.createElement("button",{className:"r6o-btn",onClick:this.onCancel},uo.t("Close"))):Je.createElement("div",{className:this.props.detachable?"r6o-footer r6o-draggable":"r6o-footer"},f&&Je.createElement("button",{className:"r6o-btn left delete-annotation",title:uo.t("Delete"),onClick:this.onDelete},Je.createElement(Uoe,{width:12})),Je.createElement("button",{className:"r6o-btn outline",onClick:this.onCancel},uo.t("Cancel")),Je.createElement("button",{className:"r6o-btn ",onClick:this.onOk},uo.t("Ok"))))))}}var uv,sae=new Uint8Array(16);function oae(){if(!uv&&(uv=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!uv))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return uv(sae)}var aae=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function lae(l){return typeof l=="string"&&aae.test(l)}for(var Wr=[],Dx=0;Dx<256;++Dx)Wr.push((Dx+256).toString(16).substr(1));function uae(l){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,a=(Wr[l[d+0]]+Wr[l[d+1]]+Wr[l[d+2]]+Wr[l[d+3]]+"-"+Wr[l[d+4]]+Wr[l[d+5]]+"-"+Wr[l[d+6]]+Wr[l[d+7]]+"-"+Wr[l[d+8]]+Wr[l[d+9]]+"-"+Wr[l[d+10]]+Wr[l[d+11]]+Wr[l[d+12]]+Wr[l[d+13]]+Wr[l[d+14]]+Wr[l[d+15]]).toLowerCase();if(!lae(a))throw TypeError("Stringified UUID is invalid");return a}function xM(l,d,a){l=l||{};var c=l.random||(l.rng||oae)();return c[6]=c[6]&15|64,c[8]=c[8]&63|128,uae(c)}var cae=function l(d,a){if(d===a)return!0;if(d&&a&&typeof d=="object"&&typeof a=="object"){if(d.constructor!==a.constructor)return!1;var c,f,m;if(Array.isArray(d)){if(c=d.length,c!=a.length)return!1;for(f=c;f--!==0;)if(!l(d[f],a[f]))return!1;return!0}if(d.constructor===RegExp)return d.source===a.source&&d.flags===a.flags;if(d.valueOf!==Object.prototype.valueOf)return d.valueOf()===a.valueOf();if(d.toString!==Object.prototype.toString)return d.toString()===a.toString();if(m=Object.keys(d),c=m.length,c!==Object.keys(a).length)return!1;for(f=c;f--!==0;)if(!Object.prototype.hasOwnProperty.call(a,m[f]))return!1;for(f=c;f--!==0;){var v=m[f];if(!l(d[v],a[v]))return!1}return!0}return d!==d&&a!==a},SM=cae;const Px=class{constructor(l,d){r(this,"clone",(a,c)=>new Px({...this.underlying,...a},{...this.opts,...c})),r(this,"selector",a=>{const{target:c}=this.underlying;if(c.selector)return(Array.isArray(c.selector)?c.selector:[c.selector]).find(f=>f.type===a)}),this.underlying=l,this.opts=d}isEqual(l){return(l==null?void 0:l.type)!=="Annotation"?!1:this.underlying===l.underlying?!0:!this.underlying.id||!l.underlying.id?!1:SM(this.underlying,l.underlying)}get readOnly(){var l;return(l=this.opts)==null?void 0:l.readOnly}get id(){return this.underlying.id}get context(){return this.underlying["@context"]}get type(){return this.underlying.type}get motivation(){return this.underlying.motivation}get body(){return this.underlying.body}get target(){return this.underlying.target}get bodies(){return Array.isArray(this.underlying.body)?this.underlying.body:[this.underlying.body]}set bodies(l){this.underlying.body=l}get targets(){return Array.isArray(this.underlying.target)?this.underlying.target:[this.underlying.target]}get quote(){var l;return(l=this.selector("TextQuoteSelector"))==null?void 0:l.exact}get start(){var l;return(l=this.selector("TextPositionSelector"))==null?void 0:l.start}get end(){var l;return(l=this.selector("TextPositionSelector"))==null?void 0:l.end}};let dd=Px;r(dd,"create",l=>{const d={"@context":"http://www.w3.org/ns/anno.jsonld",type:"Annotation",id:`#${xM()}`,body:[]};return new Px({...d,...l})});class Wm{constructor(d,a){r(this,"clone",c=>{const f=new Wm;return f.underlying=JSON.parse(JSON.stringify(this.underlying)),c&&(f.underlying={...f.underlying,...c}),f}),r(this,"selector",c=>{const{target:f}=this.underlying;if(f.selector)return(Array.isArray(f.selector)?f.selector:[f.selector]).find(m=>m.type===c)}),r(this,"toAnnotation",()=>{const c=Object.assign({},this.underlying,{type:"Annotation",id:`#${xM()}`});return new dd(c)}),this.underlying={"@context":"http://www.w3.org/ns/anno.jsonld",type:"Selection",body:a||[],target:d}}get context(){return this.underlying["@context"]}get type(){return this.underlying.type}get body(){return this.underlying.body}get target(){return this.underlying.target}get targets(){return Array.isArray(this.underlying.target)?this.underlying.target:[this.underlying.target]}isEqual(d){return d?SM(this.underlying,d.underlying):!1}get bodies(){return Array.isArray(this.underlying.body)?this.underlying.body:[this.underlying.body]}get quote(){var d;return(d=this.selector("TextQuoteSelector"))==null?void 0:d.exact}get isSelection(){return!0}}let kx=0;var dae=()=>({setServerTime:l=>{const d=Date.now();kx=l-d},getCurrentTimeAdjusted:()=>new Date(Date.now()+kx).toISOString(),toClientTime:l=>Date.parse(l)-kx});const hae=(l,d)=>{if(l){const a=l==="auto"?window.navigator.userLanguage||window.navigator.language:l,c=a.split("-")[0].toLowerCase(),f=[a,c].find(m=>Tne.includes(m));f||console.warn(`Unsupported locale '${a}'. Falling back to default en.`),uo.init(f,d)}else uo.init(null,d)};var EM={exports:{}};(function(l){//! openseadragon 3.0.0 //! Built on 2021-12-15 //! Git commit: v3.0.0-0-3eded36 //! http://openseadragon.github.io //! License: http://openseadragon.github.io/license/ function d(a){return new d.Viewer(a)}(function(a){a.version={versionStr:"3.0.0",major:parseInt("3",10),minor:parseInt("0",10),revision:parseInt("0",10)};var c={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regexp","[object Object]":"object"},f=Object.prototype.toString,m=Object.prototype.hasOwnProperty;a.isFunction=function(v){return a.type(v)==="function"},a.isArray=Array.isArray||function(v){return a.type(v)==="array"},a.isWindow=function(v){return v&&typeof v=="object"&&"setInterval"in v},a.type=function(v){return v==null?String(v):c[f.call(v)]||"object"},a.isPlainObject=function(v){if(!v||d.type(v)!=="object"||v.nodeType||a.isWindow(v)||v.constructor&&!m.call(v,"constructor")&&!m.call(v.constructor.prototype,"isPrototypeOf"))return!1;var _;for(var w in v)_=w;return _===void 0||m.call(v,_)},a.isEmptyObject=function(v){for(var _ in v)return!1;return!0},a.freezeObject=function(v){return Object.freeze?a.freezeObject=Object.freeze:a.freezeObject=function(_){return _},a.freezeObject(v)},a.supportsCanvas=function(){var v=document.createElement("canvas");return!!(a.isFunction(v.getContext)&&v.getContext("2d"))}(),a.isCanvasTainted=function(v){var _=!1;try{v.getContext("2d").getImageData(0,0,1,1)}catch{_=!0}return _},a.supportsAddEventListener=function(){return!!(document.documentElement.addEventListener&&document.addEventListener)}(),a.supportsRemoveEventListener=function(){return!!(document.documentElement.removeEventListener&&document.removeEventListener)}(),a.supportsEventListenerOptions=function(){var v=0;if(a.supportsAddEventListener)try{var _={get capture(){return v++,!1},get once(){return v++,!1},get passive(){return v++,!1}};window.addEventListener("test",null,_),window.removeEventListener("test",null,_)}catch{v=0}return v>=3}(),a.getCurrentPixelDensityRatio=function(){if(a.supportsCanvas){var v=document.createElement("canvas").getContext("2d"),_=window.devicePixelRatio||1,w=v.webkitBackingStorePixelRatio||v.mozBackingStorePixelRatio||v.msBackingStorePixelRatio||v.oBackingStorePixelRatio||v.backingStorePixelRatio||1;return Math.max(_,1)/w}else return 1},a.pixelDensityRatio=a.getCurrentPixelDensityRatio()})(d),function(a){a.extend=function(){var w,x,E,N,H,Y,ee=arguments[0]||{},be=arguments.length,me=!1,ke=1;for(typeof ee=="boolean"&&(me=ee,ee=arguments[1]||{},ke=2),typeof ee!="object"&&!d.isFunction(ee)&&(ee={}),be===ke&&(ee=this,--ke);ke=E.x&&x.x=E.y},getMousePosition:function(w){if(typeof w.pageX=="number")a.getMousePosition=function(x){var E=new a.Point;return E.x=x.pageX,E.y=x.pageY,E};else if(typeof w.clientX=="number")a.getMousePosition=function(x){var E=new a.Point;return E.x=x.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,E.y=x.clientY+document.body.scrollTop+document.documentElement.scrollTop,E};else throw new Error("Unknown event mouse position, no known technique.");return a.getMousePosition(w)},getPageScroll:function(){var w=document.documentElement||{},x=document.body||{};if(typeof window.pageXOffset=="number")a.getPageScroll=function(){return new a.Point(window.pageXOffset,window.pageYOffset)};else if(x.scrollLeft||x.scrollTop)a.getPageScroll=function(){return new a.Point(document.body.scrollLeft,document.body.scrollTop)};else if(w.scrollLeft||w.scrollTop)a.getPageScroll=function(){return new a.Point(document.documentElement.scrollLeft,document.documentElement.scrollTop)};else return new a.Point(0,0);return a.getPageScroll()},setPageScroll:function(w){if(typeof window.scrollTo<"u")a.setPageScroll=function(N){window.scrollTo(N.x,N.y)};else{var x=a.getPageScroll();if(x.x===w.x&&x.y===w.y)return;document.body.scrollLeft=w.x,document.body.scrollTop=w.y;var E=a.getPageScroll();if(E.x!==x.x&&E.y!==x.y){a.setPageScroll=function(N){document.body.scrollLeft=N.x,document.body.scrollTop=N.y};return}if(document.documentElement.scrollLeft=w.x,document.documentElement.scrollTop=w.y,E=a.getPageScroll(),E.x!==x.x&&E.y!==x.y){a.setPageScroll=function(N){document.documentElement.scrollLeft=N.x,document.documentElement.scrollTop=N.y};return}a.setPageScroll=function(N){}}a.setPageScroll(w)},getWindowSize:function(){var w=document.documentElement||{},x=document.body||{};if(typeof window.innerWidth=="number")a.getWindowSize=function(){return new a.Point(window.innerWidth,window.innerHeight)};else if(w.clientWidth||w.clientHeight)a.getWindowSize=function(){return new a.Point(document.documentElement.clientWidth,document.documentElement.clientHeight)};else if(x.clientWidth||x.clientHeight)a.getWindowSize=function(){return new a.Point(document.body.clientWidth,document.body.clientHeight)};else throw new Error("Unknown window size, no known technique.");return a.getWindowSize()},makeCenteredNode:function(w){w=a.getElement(w);var x=[a.makeNeutralElement("div"),a.makeNeutralElement("div"),a.makeNeutralElement("div")];return a.extend(x[0].style,{display:"table",height:"100%",width:"100%"}),a.extend(x[1].style,{display:"table-row"}),a.extend(x[2].style,{display:"table-cell",verticalAlign:"middle",textAlign:"center"}),x[0].appendChild(x[1]),x[1].appendChild(x[2]),x[2].appendChild(w),x[0]},makeNeutralElement:function(w){var x=document.createElement(w),E=x.style;return E.background="transparent none",E.border="none",E.margin="0px",E.padding="0px",E.position="static",x},now:function(){return Date.now?a.now=Date.now:a.now=function(){return new Date().getTime()},a.now()},makeTransparentImage:function(w){var x=a.makeNeutralElement("img");return x.src=w,x},setElementOpacity:function(w,x,E){var N,H;w=a.getElement(w),E&&!a.Browser.alpha&&(x=Math.round(x)),a.Browser.opacity?w.style.opacity=x<1?x:"":x<1?(N=Math.round(100*x),H="alpha(opacity="+N+")",w.style.filter=H):w.style.filter=""},setElementTouchActionNone:function(w){w=a.getElement(w),typeof w.style.touchAction<"u"?w.style.touchAction="none":typeof w.style.msTouchAction<"u"&&(w.style.msTouchAction="none")},setElementPointerEvents:function(w,x){w=a.getElement(w),typeof w.style.pointerEvents<"u"&&(w.style.pointerEvents=x)},setElementPointerEventsNone:function(w){a.setElementPointerEvents(w,"none")},addClass:function(w,x){w=a.getElement(w),w.className?(" "+w.className+" ").indexOf(" "+x+" ")===-1&&(w.className+=" "+x):w.className=x},indexOf:function(w,x,E){return Array.prototype.indexOf?this.indexOf=function(N,H,Y){return N.indexOf(H,Y)}:this.indexOf=function(N,H,Y){var ee,be=Y||0,me;if(!N)throw new TypeError;if(me=N.length,me===0||be>=me)return-1;for(be<0&&(be=me-Math.abs(be)),ee=be;ee=200&&be.status<300||be.status===0&&ee!=="http:"&&ee!=="https:"?x(be):(a.console.log("AJAX request returned %d: %s",be.status,w),a.isFunction(E)&&E(be)))};try{if(be.open("GET",w,!0),Y&&(be.responseType=Y),H)for(var me in H)Object.prototype.hasOwnProperty.call(H,me)&&H[me]&&be.setRequestHeader(me,H[me]);N&&(be.withCredentials=!0),be.send(null)}catch(ke){a.console.log("%s while making AJAX request: %s",ke.name,ke.message),be.onreadystatechange=function(){},a.isFunction(E)&&E(be,ke)}return be},jsonp:function(w){var x,E=w.url,N=document.head||document.getElementsByTagName("head")[0]||document.documentElement,H=w.callbackName||"openseadragon"+a.now(),Y=window[H],ee="$1"+H+"$2",be=w.param||"callback",me=w.callback;E=E.replace(/(=)\?(&|$)|\?\?/i,ee),E+=(/\?/.test(E)?"&":"?")+be+"="+H,window[H]=function(ke){if(Y)window[H]=Y;else try{delete window[H]}catch{}me&&a.isFunction(me)&&me(ke)},x=document.createElement("script"),(w.async!==void 0||w.async!==!1)&&(x.async="async"),w.scriptCharset&&(x.charset=w.scriptCharset),x.src=E,x.onload=x.onreadystatechange=function(ke,U){(U||!x.readyState||/loaded|complete/.test(x.readyState))&&(x.onload=x.onreadystatechange=null,N&&x.parentNode&&N.removeChild(x),x=void 0)},N.insertBefore(x,N.firstChild)},createFromDZI:function(){throw"OpenSeadragon.createFromDZI is deprecated, use Viewer.open."},parseXml:function(w){if(window.DOMParser)a.parseXml=function(x){var E=null,N;return N=new DOMParser,E=N.parseFromString(x,"text/xml"),E};else if(window.ActiveXObject)a.parseXml=function(x){var E=null;return E=new ActiveXObject("Microsoft.XMLDOM"),E.async=!1,E.loadXML(x),E};else throw new Error("Browser doesn't support XML DOM.");return a.parseXml(w)},parseJSON:function(w){return a.parseJSON=window.JSON.parse,a.parseJSON(w)},imageFormatSupported:function(w){return w=w||"",!!m[w.toLowerCase()]},setImageFormatsSupported:function(w){a.extend(m,w)}});var f=function(w){};a.console=window.console||{log:f,debug:f,info:f,warn:f,error:f,assert:f},a.Browser={vendor:a.BROWSERS.UNKNOWN,version:0,alpha:!0};var m={bmp:!1,jpeg:!0,jpg:!0,png:!0,tif:!1,wdp:!1},v={};(function(){var w=navigator.appVersion,x=navigator.userAgent,E;switch(navigator.appName){case"Microsoft Internet Explorer":window.attachEvent&&window.ActiveXObject&&(a.Browser.vendor=a.BROWSERS.IE,a.Browser.version=parseFloat(x.substring(x.indexOf("MSIE")+5,x.indexOf(";",x.indexOf("MSIE")))));break;case"Netscape":window.addEventListener&&(x.indexOf("Edge")>=0?(a.Browser.vendor=a.BROWSERS.EDGE,a.Browser.version=parseFloat(x.substring(x.indexOf("Edge")+5))):x.indexOf("Edg")>=0?(a.Browser.vendor=a.BROWSERS.CHROMEEDGE,a.Browser.version=parseFloat(x.substring(x.indexOf("Edg")+4))):x.indexOf("Firefox")>=0?(a.Browser.vendor=a.BROWSERS.FIREFOX,a.Browser.version=parseFloat(x.substring(x.indexOf("Firefox")+8))):x.indexOf("Safari")>=0?(a.Browser.vendor=x.indexOf("Chrome")>=0?a.BROWSERS.CHROME:a.BROWSERS.SAFARI,a.Browser.version=parseFloat(x.substring(x.substring(0,x.indexOf("Safari")).lastIndexOf("/")+1,x.indexOf("Safari")))):(E=new RegExp("Trident/.*rv:([0-9]{1,}[.0-9]{0,})"),E.exec(x)!==null&&(a.Browser.vendor=a.BROWSERS.IE,a.Browser.version=parseFloat(RegExp.$1))));break;case"Opera":a.Browser.vendor=a.BROWSERS.OPERA,a.Browser.version=parseFloat(w);break}var N=window.location.search.substring(1),H=N.split("&"),Y,ee,be;for(be=0;be0){var me=Y.substring(0,ee),ke=Y.substring(ee+1);try{v[me]=decodeURIComponent(ke)}catch{a.console.error("Ignoring malformed URL parameter: %s=%s",me,ke)}}a.Browser.alpha=!(a.Browser.vendor===a.BROWSERS.CHROME&&a.Browser.version<2),a.Browser.opacity=!0,a.Browser.vendor===a.BROWSERS.IE&&a.Browser.version<11&&a.console.error("Internet Explorer versions < 11 are not supported by OpenSeadragon")})(),function(w){var x=w.requestAnimationFrame||w.mozRequestAnimationFrame||w.webkitRequestAnimationFrame||w.msRequestAnimationFrame,E=w.cancelAnimationFrame||w.mozCancelAnimationFrame||w.webkitCancelAnimationFrame||w.msCancelAnimationFrame;if(x&&E)a.requestAnimationFrame=function(){return x.apply(w,arguments)},a.cancelAnimationFrame=function(){return E.apply(w,arguments)};else{var N=[],H=[],Y=0,ee;a.requestAnimationFrame=function(be){return N.push([++Y,be]),ee||(ee=setInterval(function(){if(N.length){var me=a.now(),ke=H;for(H=N,N=ke;H.length;)H.shift()[1](me)}else clearInterval(ee),ee=void 0},1e3/50)),Y},a.cancelAnimationFrame=function(be){var me,ke;for(me=0,ke=N.length;me8||"onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll",a.MouseTracker.subscribeEvents=["click","dblclick","keydown","keyup","keypress","focus","blur","contextmenu",a.MouseTracker.wheelEventName],a.MouseTracker.wheelEventName==="DOMMouseScroll"&&a.MouseTracker.subscribeEvents.push("MozMousePixelScroll"),window.PointerEvent?(a.MouseTracker.havePointerEvents=!0,a.MouseTracker.subscribeEvents.push("pointerenter","pointerleave","pointerover","pointerout","pointerdown","pointerup","pointermove","pointercancel"),a.MouseTracker.havePointerCapture=function(){var $=document.createElement("div");return a.isFunction($.setPointerCapture)&&a.isFunction($.releasePointerCapture)}(),a.MouseTracker.havePointerCapture&&a.MouseTracker.subscribeEvents.push("gotpointercapture","lostpointercapture")):(a.MouseTracker.havePointerEvents=!1,a.MouseTracker.subscribeEvents.push("mouseenter","mouseleave","mouseover","mouseout","mousedown","mouseup","mousemove"),a.MouseTracker.mousePointerId="legacy-mouse",a.MouseTracker.havePointerCapture=function(){var $=document.createElement("div");return a.isFunction($.setCapture)&&a.isFunction($.releaseCapture)}(),a.MouseTracker.havePointerCapture&&a.MouseTracker.subscribeEvents.push("losecapture"),"ontouchstart"in window&&a.MouseTracker.subscribeEvents.push("touchstart","touchend","touchmove","touchcancel"),"ongesturestart"in window&&a.MouseTracker.subscribeEvents.push("gesturestart","gesturechange")),a.MouseTracker.GesturePointList=function($){this._gPoints=[],this.type=$,this.buttons=0,this.contacts=0,this.clicks=0,this.captureCount=0},a.MouseTracker.GesturePointList.prototype={getLength:function(){return this._gPoints.length},asArray:function(){return this._gPoints},add:function($){return this._gPoints.push($)},removeById:function($){var G,de=this._gPoints.length;for(G=0;G1&&(this.type==="mouse"||this.type==="pen")&&(a.console.warn("GesturePointList.addContact() Implausible contacts value"),this.contacts=1)},removeContact:function(){--this.contacts,this.contacts<0&&(a.console.warn("GesturePointList.removeContact() Implausible contacts value"),this.contacts=0)}};function v($){var G=c[$.hash],de,ge,$e,bt,ei,on=G.activePointersLists.length;for(de=0;de0){for(ei=[],bt=$e.asArray(),ge=0;geG.touches.length-$e&&a.console.warn("Tracked touch contact count doesn't match event.touches.length");var on={originalEvent:G,eventType:"pointerdown",pointerType:"touch",isEmulated:!1};for(ut($,on),ge=0;ge<$e;ge++)bt={id:G.changedTouches[ge].identifier,type:"touch",isPrimary:ei.getLength()===0,currentPos:be(G.changedTouches[ge]),currentTime:de},Ft($,on,bt),fi($,on,bt,0),Gt($,bt,!0);on.preventDefault&&!on.defaultPrevented&&a.cancelEvent(G),on.stopPropagation&&a.stopEvent(G)}function li($,G){var de,ge,$e=G.changedTouches.length,bt;de=a.now();var ei={originalEvent:G,eventType:"pointerup",pointerType:"touch",isEmulated:!1};for(ut($,ei),ge=0;ge<$e;ge++)bt={id:G.changedTouches[ge].identifier,type:"touch",currentPos:be(G.changedTouches[ge]),currentTime:de},Xn($,ei,bt,0),Gt($,bt,!1),en($,ei,bt);ei.preventDefault&&!ei.defaultPrevented&&a.cancelEvent(G),ei.stopPropagation&&a.stopEvent(G)}function Fi($,G){var de,ge,$e=G.changedTouches.length,bt;de=a.now();var ei={originalEvent:G,eventType:"pointermove",pointerType:"touch",isEmulated:!1};for(ut($,ei),ge=0;ge<$e;ge++)bt={id:G.changedTouches[ge].identifier,type:"touch",currentPos:be(G.changedTouches[ge]),currentTime:de},Ui($,ei,bt);ei.preventDefault&&!ei.defaultPrevented&&a.cancelEvent(G),ei.stopPropagation&&a.stopEvent(G)}function zi($,G){var de=G.changedTouches.length,ge,$e,bt={originalEvent:G,eventType:"pointercancel",pointerType:"touch",isEmulated:!1};for(ut($,bt),ge=0;ge0&&G.removeContact(),ge=G.removeById(de.id)):ge=G.getLength(),ge}function vt($,G){switch(G.eventType){case"pointermove":G.isStoppable=!0,G.isCancelable=!0,G.preventDefault=!1,G.preventGesture=!$.hasGestureHandlers,G.stopPropagation=!1;break;case"pointerover":case"pointerout":case"contextmenu":case"keydown":case"keyup":case"keypress":G.isStoppable=!0,G.isCancelable=!0,G.preventDefault=!1,G.preventGesture=!1,G.stopPropagation=!1;break;case"pointerdown":G.isStoppable=!0,G.isCancelable=!0,G.preventDefault=!1,G.preventGesture=!$.hasGestureHandlers,G.stopPropagation=!1;break;case"pointerup":G.isStoppable=!0,G.isCancelable=!0,G.preventDefault=!1,G.preventGesture=!$.hasGestureHandlers,G.stopPropagation=!1;break;case"wheel":G.isStoppable=!0,G.isCancelable=!0,G.preventDefault=!1,G.preventGesture=!$.hasScrollHandler,G.stopPropagation=!1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":G.isStoppable=!0,G.isCancelable=!1,G.preventDefault=!1,G.preventGesture=!1,G.stopPropagation=!1;break;case"click":G.isStoppable=!0,G.isCancelable=!0,G.preventDefault=!!$.clickHandler,G.preventGesture=!1,G.stopPropagation=!1;break;case"dblclick":G.isStoppable=!0,G.isCancelable=!0,G.preventDefault=!!$.dblClickHandler,G.preventGesture=!1,G.stopPropagation=!1;break;case"focus":case"blur":case"pointerenter":case"pointerleave":default:G.isStoppable=!1,G.isCancelable=!1,G.preventDefault=!1,G.preventGesture=!1,G.stopPropagation=!1;break}}function ut($,G){G.eventSource=$,G.eventPhase=G.originalEvent&&typeof G.originalEvent.eventPhase<"u"?G.originalEvent.eventPhase:0,G.defaultPrevented=a.eventIsCanceled(G.originalEvent),G.shouldCapture=!1,G.shouldReleaseCapture=!1,G.userData=$.userData,vt($,G),$.preProcessEventHandler&&$.preProcessEventHandler(G)}function Gt($,G,de){var ge=$.getActivePointersListByType(G.type),$e=ge.getById(G.id);$e?de&&!$e.captured?($e.captured=!0,ge.captureCount++):!de&&$e.captured&&($e.captured=!1,ge.captureCount--,ge.captureCount<0&&(ge.captureCount=0,a.console.warn("updatePointerCaptured() - pointsList.captureCount went negative"))):a.console.warn("updatePointerCaptured() called on untracked pointer")}function Ft($,G,de){var ge=$.getActivePointersListByType(de.type),$e;$e=ge.getById(de.id),$e?($e.insideElement=!0,$e.lastPos=$e.currentPos,$e.lastTime=$e.currentTime,$e.currentPos=de.currentPos,$e.currentTime=de.currentTime,de=$e):(de.captured=!1,de.insideElementPressed=!1,de.insideElement=!0,xe(ge,de)),$.enterHandler&&$.enterHandler({eventSource:$,pointerType:de.type,position:ke(de.currentPos,$.element),buttons:ge.buttons,pointers:$.getActivePointerCount(),insideElementPressed:de.insideElementPressed,buttonDownAny:ge.buttons!==0,isTouchEvent:de.type==="touch",originalEvent:G.originalEvent,userData:$.userData})}function en($,G,de){var ge=$.getActivePointersListByType(de.type),$e,bt;$e=ge.getById(de.id),$e?($e.captured?($e.insideElement=!1,$e.lastPos=$e.currentPos,$e.lastTime=$e.currentTime,$e.currentPos=de.currentPos,$e.currentTime=de.currentTime):Qe($,ge,$e),de=$e):(de.captured=!1,de.insideElementPressed=!1),($.leaveHandler||$.exitHandler)&&(bt={eventSource:$,pointerType:de.type,position:de.currentPos&&ke(de.currentPos,$.element),buttons:ge.buttons,pointers:$.getActivePointerCount(),insideElementPressed:de.insideElementPressed,buttonDownAny:ge.buttons!==0,isTouchEvent:de.type==="touch",originalEvent:G.originalEvent,userData:$.userData},$.leaveHandler&&$.leaveHandler(bt),$.exitHandler&&$.exitHandler(bt))}function xn($,G,de){var ge,$e;ge=$.getActivePointersListByType(de.type),$e=ge.getById(de.id),$e?de=$e:(de.captured=!1,de.insideElementPressed=!1),$.overHandler&&$.overHandler({eventSource:$,pointerType:de.type,position:ke(de.currentPos,$.element),buttons:ge.buttons,pointers:$.getActivePointerCount(),insideElementPressed:de.insideElementPressed,buttonDownAny:ge.buttons!==0,isTouchEvent:de.type==="touch",originalEvent:G.originalEvent,userData:$.userData})}function qi($,G,de){var ge,$e;ge=$.getActivePointersListByType(de.type),$e=ge.getById(de.id),$e?de=$e:(de.captured=!1,de.insideElementPressed=!1),$.outHandler&&$.outHandler({eventSource:$,pointerType:de.type,position:de.currentPos&&ke(de.currentPos,$.element),buttons:ge.buttons,pointers:$.getActivePointerCount(),insideElementPressed:de.insideElementPressed,buttonDownAny:ge.buttons!==0,isTouchEvent:de.type==="touch",originalEvent:G.originalEvent,userData:$.userData})}function fi($,G,de,ge){var $e=c[$.hash],bt=$.getActivePointersListByType(de.type),ei;if(typeof G.originalEvent.buttons<"u"?bt.buttons=G.originalEvent.buttons:ge===0?bt.buttons|=1:ge===1?bt.buttons|=4:ge===2?bt.buttons|=2:ge===3?bt.buttons|=8:ge===4?bt.buttons|=16:ge===5&&(bt.buttons|=32),ge!==0){G.shouldCapture=!1,G.shouldReleaseCapture=!1,$.nonPrimaryPressHandler&&!G.preventGesture&&!G.defaultPrevented&&(G.preventDefault=!0,$.nonPrimaryPressHandler({eventSource:$,pointerType:de.type,position:ke(de.currentPos,$.element),button:ge,buttons:bt.buttons,isTouchEvent:de.type==="touch",originalEvent:G.originalEvent,userData:$.userData}));return}if(ei=bt.getById(de.id),ei)ei.insideElementPressed=!0,ei.insideElement=!0,ei.originalTarget=G.originalEvent.target,ei.contactPos=de.currentPos,ei.contactTime=de.currentTime,ei.lastPos=ei.currentPos,ei.lastTime=ei.currentTime,ei.currentPos=de.currentPos,ei.currentTime=de.currentTime,de=ei;else{a.console.warn("pointerdown event on untracked pointer"),de.captured=!1,de.insideElementPressed=!0,de.insideElement=!0,de.originalTarget=G.originalEvent.target,xe(bt,de);return}bt.addContact(),!G.preventGesture&&!G.defaultPrevented?(G.shouldCapture=!0,G.shouldReleaseCapture=!1,G.preventDefault=!0,($.dragHandler||$.dragEndHandler||$.pinchHandler)&&a.MouseTracker.gesturePointVelocityTracker.addPoint($,de),bt.contacts===1?$.pressHandler&&!G.preventGesture&&$.pressHandler({eventSource:$,pointerType:de.type,position:ke(de.contactPos,$.element),buttons:bt.buttons,isTouchEvent:de.type==="touch",originalEvent:G.originalEvent,userData:$.userData}):bt.contacts===2&&$.pinchHandler&&de.type==="touch"&&($e.pinchGPoints=bt.asArray(),$e.lastPinchDist=$e.currentPinchDist=$e.pinchGPoints[0].currentPos.distanceTo($e.pinchGPoints[1].currentPos),$e.lastPinchCenter=$e.currentPinchCenter=U($e.pinchGPoints[0].currentPos,$e.pinchGPoints[1].currentPos))):(G.shouldCapture=!1,G.shouldReleaseCapture=!1)}function Xn($,G,de,ge){var $e=c[$.hash],bt=$.getActivePointersListByType(de.type),ei,on,ti,po=!1,kr;if(typeof G.originalEvent.buttons<"u"?bt.buttons=G.originalEvent.buttons:ge===0?bt.buttons^=-2:ge===1?bt.buttons^=-5:ge===2?bt.buttons^=-3:ge===3?bt.buttons^=-9:ge===4?bt.buttons^=-17:ge===5&&(bt.buttons^=-33),G.shouldCapture=!1,ge!==0){G.shouldReleaseCapture=!1,$.nonPrimaryReleaseHandler&&!G.preventGesture&&!G.defaultPrevented&&(G.preventDefault=!0,$.nonPrimaryReleaseHandler({eventSource:$,pointerType:de.type,position:ke(de.currentPos,$.element),button:ge,buttons:bt.buttons,isTouchEvent:de.type==="touch",originalEvent:G.originalEvent,userData:$.userData}));return}ti=bt.getById(de.id),ti?(bt.removeContact(),ti.captured&&(po=!0),ti.lastPos=ti.currentPos,ti.lastTime=ti.currentTime,ti.currentPos=de.currentPos,ti.currentTime=de.currentTime,ti.insideElement||Qe($,bt,ti),ei=ti.currentPos,on=ti.currentTime):(a.console.warn("updatePointerUp(): pointerup on untracked gPoint"),de.captured=!1,de.insideElementPressed=!1,de.insideElement=!0,xe(bt,de),ti=de),!G.preventGesture&&!G.defaultPrevented&&(po?(G.shouldReleaseCapture=!0,G.preventDefault=!0,($.dragHandler||$.dragEndHandler||$.pinchHandler)&&a.MouseTracker.gesturePointVelocityTracker.removePoint($,ti),bt.contacts===0?($.releaseHandler&&$.releaseHandler({eventSource:$,pointerType:ti.type,position:ke(ei,$.element),buttons:bt.buttons,insideElementPressed:ti.insideElementPressed,insideElementReleased:ti.insideElement,isTouchEvent:ti.type==="touch",originalEvent:G.originalEvent,userData:$.userData}),$.dragEndHandler&&$e.sentDragEvent&&$.dragEndHandler({eventSource:$,pointerType:ti.type,position:ke(ti.currentPos,$.element),speed:ti.speed,direction:ti.direction,shift:G.originalEvent.shiftKey,isTouchEvent:ti.type==="touch",originalEvent:G.originalEvent,userData:$.userData}),$e.sentDragEvent=!1,($.clickHandler||$.dblClickHandler)&&ti.insideElement&&(kr=on-ti.contactTime<=$.clickTimeThreshold&&ti.contactPos.distanceTo(ei)<=$.clickDistThreshold,$.clickHandler&&$.clickHandler({eventSource:$,pointerType:ti.type,position:ke(ti.currentPos,$.element),quick:kr,shift:G.originalEvent.shiftKey,isTouchEvent:ti.type==="touch",originalEvent:G.originalEvent,originalTarget:ti.originalTarget,userData:$.userData}),$.dblClickHandler&&kr&&(bt.clicks++,bt.clicks===1?($e.lastClickPos=ei,$e.dblClickTimeOut=setTimeout(function(){bt.clicks=0},$.dblClickTimeThreshold)):bt.clicks===2&&(clearTimeout($e.dblClickTimeOut),bt.clicks=0,$e.lastClickPos.distanceTo(ei)<=$.dblClickDistThreshold&&$.dblClickHandler({eventSource:$,pointerType:ti.type,position:ke(ti.currentPos,$.element),shift:G.originalEvent.shiftKey,isTouchEvent:ti.type==="touch",originalEvent:G.originalEvent,userData:$.userData}),$e.lastClickPos=null)))):bt.contacts===2&&$.pinchHandler&&ti.type==="touch"&&($e.pinchGPoints=bt.asArray(),$e.lastPinchDist=$e.currentPinchDist=$e.pinchGPoints[0].currentPos.distanceTo($e.pinchGPoints[1].currentPos),$e.lastPinchCenter=$e.currentPinchCenter=U($e.pinchGPoints[0].currentPos,$e.pinchGPoints[1].currentPos))):(G.shouldReleaseCapture=!1,$.releaseHandler&&($.releaseHandler({eventSource:$,pointerType:ti.type,position:ke(ei,$.element),buttons:bt.buttons,insideElementPressed:ti.insideElementPressed,insideElementReleased:ti.insideElement,isTouchEvent:ti.type==="touch",originalEvent:G.originalEvent,userData:$.userData}),G.preventDefault=!0)))}function Ui($,G,de){var ge=c[$.hash],$e=$.getActivePointersListByType(de.type),bt,ei,on;if(typeof G.originalEvent.buttons<"u"&&($e.buttons=G.originalEvent.buttons),bt=$e.getById(de.id),bt)bt.lastPos=bt.currentPos,bt.lastTime=bt.currentTime,bt.currentPos=de.currentPos,bt.currentTime=de.currentTime;else return;G.shouldCapture=!1,G.shouldReleaseCapture=!1,$.stopHandler&&de.type==="mouse"&&(clearTimeout($.stopTimeOut),$.stopTimeOut=setTimeout(function(){tc($,G.originalEvent,de.type)},$.stopDelay)),$e.contacts===0?$.moveHandler&&$.moveHandler({eventSource:$,pointerType:de.type,position:ke(de.currentPos,$.element),buttons:$e.buttons,isTouchEvent:de.type==="touch",originalEvent:G.originalEvent,userData:$.userData}):$e.contacts===1?($.moveHandler&&(bt=$e.asArray()[0],$.moveHandler({eventSource:$,pointerType:bt.type,position:ke(bt.currentPos,$.element),buttons:$e.buttons,isTouchEvent:bt.type==="touch",originalEvent:G.originalEvent,userData:$.userData})),$.dragHandler&&!G.preventGesture&&!G.defaultPrevented&&(bt=$e.asArray()[0],on=bt.currentPos.minus(bt.lastPos),$.dragHandler({eventSource:$,pointerType:bt.type,position:ke(bt.currentPos,$.element),buttons:$e.buttons,delta:on,speed:bt.speed,direction:bt.direction,shift:G.originalEvent.shiftKey,isTouchEvent:bt.type==="touch",originalEvent:G.originalEvent,userData:$.userData}),G.preventDefault=!0,ge.sentDragEvent=!0)):$e.contacts===2&&($.moveHandler&&(ei=$e.asArray(),$.moveHandler({eventSource:$,pointerType:ei[0].type,position:ke(U(ei[0].currentPos,ei[1].currentPos),$.element),buttons:$e.buttons,isTouchEvent:ei[0].type==="touch",originalEvent:G.originalEvent,userData:$.userData})),$.pinchHandler&&de.type==="touch"&&!G.preventGesture&&!G.defaultPrevented&&(on=ge.pinchGPoints[0].currentPos.distanceTo(ge.pinchGPoints[1].currentPos),on!==ge.currentPinchDist&&(ge.lastPinchDist=ge.currentPinchDist,ge.currentPinchDist=on,ge.lastPinchCenter=ge.currentPinchCenter,ge.currentPinchCenter=U(ge.pinchGPoints[0].currentPos,ge.pinchGPoints[1].currentPos),$.pinchHandler({eventSource:$,pointerType:"touch",gesturePoints:ge.pinchGPoints,lastCenter:ke(ge.lastPinchCenter,$.element),center:ke(ge.currentPinchCenter,$.element),lastDistance:ge.lastPinchDist,distance:ge.currentPinchDist,shift:G.originalEvent.shiftKey,originalEvent:G.originalEvent,userData:$.userData}),G.preventDefault=!0)))}function qr($,G,de){var ge=$.getActivePointersListByType(de.type),$e;$e=ge.getById(de.id),$e&&Qe($,ge,$e)}function tc($,G,de){$.stopHandler&&$.stopHandler({eventSource:$,pointerType:de,position:me(G,$.element),buttons:$.getActivePointersListByType(de).buttons,isTouchEvent:de==="touch",originalEvent:G,userData:$.userData})}}(d),function(a){a.ControlAnchor={NONE:0,TOP_LEFT:1,TOP_RIGHT:2,BOTTOM_RIGHT:3,BOTTOM_LEFT:4,ABSOLUTE:5},a.Control=function(c,f,m){var v=c.parentNode;typeof f=="number"&&(a.console.error("Passing an anchor directly into the OpenSeadragon.Control constructor is deprecated; please use an options object instead. Support for this deprecated variant is scheduled for removal in December 2013"),f={anchor:f}),f.attachToViewer=typeof f.attachToViewer>"u"?!0:f.attachToViewer,this.autoFade=typeof f.autoFade>"u"?!0:f.autoFade,this.element=c,this.anchor=f.anchor,this.container=m,this.anchor===a.ControlAnchor.ABSOLUTE?(this.wrapper=a.makeNeutralElement("div"),this.wrapper.style.position="absolute",this.wrapper.style.top=typeof f.top=="number"?f.top+"px":f.top,this.wrapper.style.left=typeof f.left=="number"?f.left+"px":f.left,this.wrapper.style.height=typeof f.height=="number"?f.height+"px":f.height,this.wrapper.style.width=typeof f.width=="number"?f.width+"px":f.width,this.wrapper.style.margin="0px",this.wrapper.style.padding="0px",this.element.style.position="relative",this.element.style.top="0px",this.element.style.left="0px",this.element.style.height="100%",this.element.style.width="100%"):(this.wrapper=a.makeNeutralElement("div"),this.wrapper.style.display="inline-block",this.anchor===a.ControlAnchor.NONE&&(this.wrapper.style.width=this.wrapper.style.height="100%")),this.wrapper.appendChild(this.element),f.attachToViewer?this.anchor===a.ControlAnchor.TOP_RIGHT||this.anchor===a.ControlAnchor.BOTTOM_RIGHT?this.container.insertBefore(this.wrapper,this.container.firstChild):this.container.appendChild(this.wrapper):v.appendChild(this.wrapper)},a.Control.prototype={destroy:function(){this.wrapper.removeChild(this.element),this.anchor!==a.ControlAnchor.NONE&&this.container.removeChild(this.wrapper)},isVisible:function(){return this.wrapper.style.display!=="none"},setVisible:function(c){this.wrapper.style.display=c?this.anchor===a.ControlAnchor.ABSOLUTE?"block":"inline-block":"none"},setOpacity:function(c){this.element[a.SIGNAL]&&a.Browser.vendor===a.BROWSERS.IE?a.setElementOpacity(this.element,c,!0):a.setElementOpacity(this.wrapper,c,!0)}}}(d),function(a){a.ControlDock=function(f){var m=["topleft","topright","bottomright","bottomleft"],v,_;for(a.extend(!0,this,{id:"controldock-"+a.now()+"-"+Math.floor(Math.random()*1e6),container:a.makeNeutralElement("div"),controls:[]},f),this.container.onsubmit=function(){return!1},this.element&&(this.element=a.getElement(this.element),this.element.appendChild(this.container),this.element.style.position="relative",this.container.style.width="100%",this.container.style.height="100%"),_=0;_=0)){switch(m.anchor){case a.ControlAnchor.TOP_RIGHT:v=this.controls.topright,f.style.position="relative",f.style.paddingRight="0px",f.style.paddingTop="0px";break;case a.ControlAnchor.BOTTOM_RIGHT:v=this.controls.bottomright,f.style.position="relative",f.style.paddingRight="0px",f.style.paddingBottom="0px";break;case a.ControlAnchor.BOTTOM_LEFT:v=this.controls.bottomleft,f.style.position="relative",f.style.paddingLeft="0px",f.style.paddingBottom="0px";break;case a.ControlAnchor.TOP_LEFT:v=this.controls.topleft,f.style.position="relative",f.style.paddingLeft="0px",f.style.paddingTop="0px";break;case a.ControlAnchor.ABSOLUTE:v=this.container,f.style.margin="0px",f.style.padding="0px";break;default:case a.ControlAnchor.NONE:v=this.container,f.style.margin="0px",f.style.padding="0px";break}this.controls.push(new a.Control(f,m,v)),f.style.display="inline-block"}},removeControl:function(f){f=a.getElement(f);var m=c(this,f);return m>=0&&(this.controls[m].destroy(),this.controls.splice(m,1)),this},clearControls:function(){for(;this.controls.length>0;)this.controls.pop().destroy();return this},areControlsEnabled:function(){var f;for(f=this.controls.length-1;f>=0;f--)if(this.controls[f].isVisible())return!0;return!1},setControlsEnabled:function(f){var m;for(m=this.controls.length-1;m>=0;m--)this.controls[m].setVisible(f);return this}};function c(f,m){var v=f.controls,_;for(_=v.length-1;_>=0;_--)if(v[_].element===m)return _;return-1}}(d),function(a){a.Placement=a.freezeObject({CENTER:0,TOP_LEFT:1,TOP:2,TOP_RIGHT:3,RIGHT:4,BOTTOM_RIGHT:5,BOTTOM:6,BOTTOM_LEFT:7,LEFT:8,properties:{0:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!1,isVerticallyCentered:!0,isBottom:!1},1:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!0,isVerticallyCentered:!1,isBottom:!1},2:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!0,isVerticallyCentered:!1,isBottom:!1},3:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!0,isVerticallyCentered:!1,isBottom:!1},4:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!1,isVerticallyCentered:!0,isBottom:!1},5:{isLeft:!1,isHorizontallyCentered:!1,isRight:!0,isTop:!1,isVerticallyCentered:!1,isBottom:!0},6:{isLeft:!1,isHorizontallyCentered:!0,isRight:!1,isTop:!1,isVerticallyCentered:!1,isBottom:!0},7:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!1,isVerticallyCentered:!1,isBottom:!0},8:{isLeft:!0,isHorizontallyCentered:!1,isRight:!1,isTop:!1,isVerticallyCentered:!0,isBottom:!1}}})}(d),function(a){var c={},f=1;a.Viewer=function(W){var xe=arguments,Qe=this,vt;if(a.isPlainObject(W)||(W={id:xe[0],xmlPath:xe.length>1?xe[1]:void 0,prefixUrl:xe.length>2?xe[2]:void 0,controls:xe.length>3?xe[3]:void 0,overlays:xe.length>4?xe[4]:void 0}),W.config&&(a.extend(!0,W,W.config),delete W.config),a.extend(!0,this,{id:W.id,hash:W.hash||f++,initialPage:0,element:null,container:null,canvas:null,overlays:[],overlaysContainer:null,previousBody:[],customControls:[],source:null,drawer:null,world:null,viewport:null,navigator:null,collectionViewport:null,collectionDrawer:null,navImages:null,buttons:null,profiler:null},a.DEFAULT_SETTINGS,W),typeof this.hash>"u")throw new Error("A hash must be defined, either by specifying options.id or options.hash.");for(typeof c[this.hash]<"u"&&a.console.warn("Hash "+this.hash+" has already been used."),c[this.hash]={fsBoundsDelta:new a.Point(1,1),prevContainerSize:null,animating:!1,forceRedraw:!1,mouseInside:!1,group:null,zooming:!1,zoomFactor:null,lastZoomTime:null,fullPage:!1,onfullscreenchange:null},this._sequenceIndex=0,this._firstOpen=!0,this._updateRequestId=null,this._loadQueue=[],this.currentOverlays=[],this._updatePixelDensityRatioBind=null,this._lastScrollTime=a.now(),a.EventSource.call(this),this.addHandler("open-failed",function(ut){var Gt=a.getString("Errors.OpenFailed",ut.eventSource,ut.message);Qe._showMessage(Gt)}),a.ControlDock.call(this,W),this.xmlPath&&(this.tileSources=[this.xmlPath]),this.element=this.element||document.getElementById(this.id),this.canvas=a.makeNeutralElement("div"),this.canvas.className="openseadragon-canvas",function(ut){ut.width="100%",ut.height="100%",ut.overflow="hidden",ut.position="absolute",ut.top="0px",ut.left="0px"}(this.canvas.style),a.setElementTouchActionNone(this.canvas),W.tabIndex!==""&&(this.canvas.tabIndex=W.tabIndex===void 0?0:W.tabIndex),this.container.className="openseadragon-container",function(ut){ut.width="100%",ut.height="100%",ut.position="relative",ut.overflow="hidden",ut.left="0px",ut.top="0px",ut.textAlign="left"}(this.container.style),a.setElementTouchActionNone(this.container),this.container.insertBefore(this.canvas,this.container.firstChild),this.element.appendChild(this.container),this.bodyWidth=document.body.style.width,this.bodyHeight=document.body.style.height,this.bodyOverflow=document.body.style.overflow,this.docOverflow=document.documentElement.style.overflow,this.innerTracker=new a.MouseTracker({userData:"Viewer.innerTracker",element:this.canvas,startDisabled:!this.mouseNavEnabled,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,dblClickTimeThreshold:this.dblClickTimeThreshold,dblClickDistThreshold:this.dblClickDistThreshold,contextMenuHandler:a.delegate(this,me),keyDownHandler:a.delegate(this,ke),keyHandler:a.delegate(this,U),clickHandler:a.delegate(this,ce),dblClickHandler:a.delegate(this,Pe),dragHandler:a.delegate(this,Ae),dragEndHandler:a.delegate(this,Ne),enterHandler:a.delegate(this,Fe),leaveHandler:a.delegate(this,lt),pressHandler:a.delegate(this,ht),releaseHandler:a.delegate(this,At),nonPrimaryPressHandler:a.delegate(this,Lt),nonPrimaryReleaseHandler:a.delegate(this,kt),scrollHandler:a.delegate(this,Xt),pinchHandler:a.delegate(this,Yt)}),this.outerTracker=new a.MouseTracker({userData:"Viewer.outerTracker",element:this.container,startDisabled:!this.mouseNavEnabled,clickTimeThreshold:this.clickTimeThreshold,clickDistThreshold:this.clickDistThreshold,dblClickTimeThreshold:this.dblClickTimeThreshold,dblClickDistThreshold:this.dblClickDistThreshold,enterHandler:a.delegate(this,di),leaveHandler:a.delegate(this,li)}),this.toolbar&&(this.toolbar=new a.ControlDock({element:this.toolbar})),this.bindStandardControls(),c[this.hash].prevContainerSize=m(this.container),this.world=new a.World({viewer:this}),this.world.addHandler("add-item",function(ut){Qe.source=Qe.world.getItemAt(0).source,c[Qe.hash].forceRedraw=!0,Qe._updateRequestId||(Qe._updateRequestId=x(Qe,Fi))}),this.world.addHandler("remove-item",function(ut){Qe.world.getItemCount()?Qe.source=Qe.world.getItemAt(0).source:Qe.source=null,c[Qe.hash].forceRedraw=!0}),this.world.addHandler("metrics-change",function(ut){Qe.viewport&&Qe.viewport._setContentBounds(Qe.world.getHomeBounds(),Qe.world.getContentFactor())}),this.world.addHandler("item-index-change",function(ut){Qe.source=Qe.world.getItemAt(0).source}),this.viewport=new a.Viewport({containerSize:c[this.hash].prevContainerSize,springStiffness:this.springStiffness,animationTime:this.animationTime,minZoomImageRatio:this.minZoomImageRatio,maxZoomPixelRatio:this.maxZoomPixelRatio,visibilityRatio:this.visibilityRatio,wrapHorizontal:this.wrapHorizontal,wrapVertical:this.wrapVertical,defaultZoomLevel:this.defaultZoomLevel,minZoomLevel:this.minZoomLevel,maxZoomLevel:this.maxZoomLevel,viewer:this,degrees:this.degrees,flipped:this.flipped,navigatorRotate:this.navigatorRotate,homeFillsViewer:this.homeFillsViewer,margins:this.viewportMargins}),this.viewport._setContentBounds(this.world.getHomeBounds(),this.world.getContentFactor()),this.imageLoader=new a.ImageLoader({jobLimit:this.imageLoaderLimit,timeout:W.timeout}),this.tileCache=new a.TileCache({maxImageCacheCount:this.maxImageCacheCount}),this.drawer=new a.Drawer({viewer:this,viewport:this.viewport,element:this.canvas,debugGridColor:this.debugGridColor}),this.overlaysContainer=a.makeNeutralElement("div"),this.canvas.appendChild(this.overlaysContainer),this.drawer.canRotate()||(this.rotateLeft&&(vt=this.buttonGroup.buttons.indexOf(this.rotateLeft),this.buttonGroup.buttons.splice(vt,1),this.buttonGroup.element.removeChild(this.rotateLeft.element)),this.rotateRight&&(vt=this.buttonGroup.buttons.indexOf(this.rotateRight),this.buttonGroup.buttons.splice(vt,1),this.buttonGroup.element.removeChild(this.rotateRight.element))),this._addUpdatePixelDensityRatioEvent(),this.showNavigator&&(this.navigator=new a.Navigator({id:this.navigatorId,position:this.navigatorPosition,sizeRatio:this.navigatorSizeRatio,maintainSizeRatio:this.navigatorMaintainSizeRatio,top:this.navigatorTop,left:this.navigatorLeft,width:this.navigatorWidth,height:this.navigatorHeight,autoResize:this.navigatorAutoResize,autoFade:this.navigatorAutoFade,prefixUrl:this.prefixUrl,viewer:this,navigatorRotate:this.navigatorRotate,background:this.navigatorBackground,opacity:this.navigatorOpacity,borderColor:this.navigatorBorderColor,displayRegionColor:this.navigatorDisplayRegionColor,crossOriginPolicy:this.crossOriginPolicy})),this.sequenceMode&&this.bindSequenceControls(),this.tileSources&&this.open(this.tileSources),vt=0;vt-1&&W.index=0&&W=0)return this;var Gt=_(this,ut);return this.currentOverlays.push(Gt),Gt.drawHTML(this.overlaysContainer,this.viewport),this.raiseEvent("add-overlay",{element:W,location:ut.location,placement:ut.placement}),this},updateOverlay:function(W,xe,Qe){var vt;return W=a.getElement(W),vt=w(this.currentOverlays,W),vt>=0&&(this.currentOverlays[vt].update(xe,Qe),c[this.hash].forceRedraw=!0,this.raiseEvent("update-overlay",{element:W,location:xe,placement:Qe})),this},removeOverlay:function(W){var xe;return W=a.getElement(W),xe=w(this.currentOverlays,W),xe>=0&&(this.currentOverlays[xe].destroy(),this.currentOverlays.splice(xe,1),c[this.hash].forceRedraw=!0,this.raiseEvent("remove-overlay",{element:W})),this},clearOverlays:function(){for(;this.currentOverlays.length>0;)this.currentOverlays.pop().destroy();return c[this.hash].forceRedraw=!0,this.raiseEvent("clear-overlay",{}),this},getOverlayById:function(W){var xe;return W=a.getElement(W),xe=w(this.currentOverlays,W),xe>=0?this.currentOverlays[xe]:null},_updateSequenceButtons:function(W){this.nextButton&&(!this.tileSources||this.tileSources.length-1===W?this.navPrevNextWrap||this.nextButton.disable():this.nextButton.enable()),this.previousButton&&(W>0?this.previousButton.enable():this.navPrevNextWrap||this.previousButton.disable())},_showMessage:function(W){this._hideMessage();var xe=a.makeNeutralElement("div");xe.appendChild(document.createTextNode(W)),this.messageDiv=a.makeCenteredNode(xe),a.addClass(this.messageDiv,"openseadragon-message"),this.container.appendChild(this.messageDiv)},_hideMessage:function(){var W=this.messageDiv;W&&(W.parentNode.removeChild(W),delete this.messageDiv)},gestureSettingsByDeviceType:function(W){switch(W){case"mouse":return this.gestureSettingsMouse;case"touch":return this.gestureSettingsTouch;case"pen":return this.gestureSettingsPen;default:return this.gestureSettingsUnknown}},_drawOverlays:function(){var W,xe=this.currentOverlays.length;for(W=0;W1&&(this.referenceStrip=new a.ReferenceStrip({id:this.referenceStripElement,position:this.referenceStripPosition,sizeRatio:this.referenceStripSizeRatio,scroll:this.referenceStripScroll,height:this.referenceStripHeight,width:this.referenceStripWidth,tileSources:this.tileSources,prefixUrl:this.prefixUrl,useCanvas:this.useCanvas,viewer:this}),this.referenceStrip.setFocus(this._sequenceIndex))}else a.console.warn('Attempting to display a reference strip while "sequenceMode" is off.')},_addUpdatePixelDensityRatioEvent:function(){this._updatePixelDensityRatioBind=this._updatePixelDensityRatio.bind(this),a.addEvent(window,"resize",this._updatePixelDensityRatioBind)},_removeUpdatePixelDensityRatioEvent:function(){a.removeEvent(window,"resize",this._updatePixelDensityRatioBind)},_updatePixelDensityRatio:function(){var W=a.pixelDensityRatio,xe=a.getCurrentPixelDensityRatio();W!==xe&&(a.pixelDensityRatio=xe,this.world.resetItems(),this.forceRedraw())},goToPreviousPage:function(){var W=this._sequenceIndex-1;this.navPrevNextWrap&&W<0&&(W+=this.tileSources.length),this.goToPage(W)},goToNextPage:function(){var W=this._sequenceIndex+1;this.navPrevNextWrap&&W>=this.tileSources.length&&(W=0),this.goToPage(W)}});function m(W){return W=a.getElement(W),new a.Point(W.clientWidth===0?1:W.clientWidth,W.clientHeight===0?1:W.clientHeight)}function v(W,xe,Qe,vt,ut){var Gt=W;if(a.type(xe)==="string"){if(xe.match(/^\s*<.*>\s*$/))xe=a.parseXml(xe);else if(xe.match(/^\s*[{[].*[}\]]\s*$/))try{var Ft=a.parseJSON(xe);xe=Ft}catch{}}function en(xn,qi){xn.ready?vt(xn):(xn.addHandler("ready",function(){vt(xn)}),xn.addHandler("open-failed",function(fi){ut({message:fi.message,source:qi})}))}setTimeout(function(){if(a.type(xe)==="string")xe=new a.TileSource({url:xe,crossOriginPolicy:Qe.crossOriginPolicy!==void 0?Qe.crossOriginPolicy:W.crossOriginPolicy,ajaxWithCredentials:W.ajaxWithCredentials,ajaxHeaders:Qe.ajaxHeaders?Qe.ajaxHeaders:W.ajaxHeaders,useCanvas:W.useCanvas,success:function(Xn){vt(Xn.tileSource)}}),xe.addHandler("open-failed",function(Xn){ut(Xn)});else if(a.isPlainObject(xe)||xe.nodeType)if(xe.crossOriginPolicy===void 0&&(Qe.crossOriginPolicy!==void 0||W.crossOriginPolicy!==void 0)&&(xe.crossOriginPolicy=Qe.crossOriginPolicy!==void 0?Qe.crossOriginPolicy:W.crossOriginPolicy),xe.ajaxWithCredentials===void 0&&(xe.ajaxWithCredentials=W.ajaxWithCredentials),xe.useCanvas===void 0&&(xe.useCanvas=W.useCanvas),a.isFunction(xe.getTileUrl)){var xn=new a.TileSource(xe);xn.getTileUrl=xe.getTileUrl,vt(xn)}else{var qi=a.TileSource.determineType(Gt,xe);if(!qi){ut({message:"Unable to load TileSource",source:xe});return}var fi=qi.prototype.configure.apply(Gt,[xe]);en(new qi(fi),xe)}else en(xe,xe)})}function _(W,xe){if(xe instanceof a.Overlay)return xe;var Qe=null;if(xe.element)Qe=a.getElement(xe.element);else{var vt=xe.id?xe.id:"openseadragon-overlay-"+Math.floor(Math.random()*1e7);Qe=a.getElement(xe.id),Qe||(Qe=document.createElement("a"),Qe.href="#/overlay/"+vt),Qe.id=vt,a.addClass(Qe,xe.className?xe.className:"openseadragon-overlay")}var ut=xe.location,Gt=xe.width,Ft=xe.height;if(!ut){var en=xe.x,xn=xe.y;if(xe.px!==void 0){var qi=W.viewport.imageToViewportRectangle(new a.Rect(xe.px,xe.py,Gt||0,Ft||0));en=qi.x,xn=qi.y,Gt=Gt!==void 0?qi.width:void 0,Ft=Ft!==void 0?qi.height:void 0}ut=new a.Point(en,xn)}var fi=xe.placement;return fi&&a.type(fi)==="string"&&(fi=a.Placement[xe.placement.toUpperCase()]),new a.Overlay({element:Qe,location:ut,placement:fi,onDraw:xe.onDraw,checkResize:xe.checkResize,width:Gt,height:Ft,rotationMode:xe.rotationMode})}function w(W,xe){var Qe;for(Qe=W.length-1;Qe>=0;Qe--)if(W[Qe].element===xe)return Qe;return-1}function x(W,xe){return a.requestAnimationFrame(function(){xe(W)})}function E(W){a.requestAnimationFrame(function(){H(W)})}function N(W){!W.autoHideControls||(W.controlsShouldFade=!0,W.controlsFadeBeginTime=a.now()+W.controlsFadeDelay,window.setTimeout(function(){E(W)},W.controlsFadeDelay))}function H(W){var xe,Qe,vt,ut;if(W.controlsShouldFade){for(xe=a.now(),Qe=xe-W.controlsFadeBeginTime,vt=1-Qe/W.controlsFadeLength,vt=Math.min(1,vt),vt=Math.max(0,vt),ut=W.controls.length-1;ut>=0;ut--)W.controls[ut].autoFade&&W.controls[ut].setOpacity(vt);vt>0&&E(W)}}function Y(W){var xe;for(W.controlsShouldFade=!1,xe=W.controls.length-1;xe>=0;xe--)W.controls[xe].setOpacity(1)}function ee(){Y(this)}function be(){N(this)}function me(W){var xe={tracker:W.eventSource,position:W.position,originalEvent:W.originalEvent,preventDefault:W.preventDefault};this.raiseEvent("canvas-contextmenu",xe),W.preventDefault=xe.preventDefault}function ke(W){var xe={originalEvent:W.originalEvent,preventDefaultAction:!1,preventVerticalPan:W.preventVerticalPan,preventHorizontalPan:W.preventHorizontalPan};if(this.raiseEvent("canvas-key",xe),!xe.preventDefaultAction&&!W.ctrl&&!W.alt&&!W.meta)switch(W.keyCode){case 38:xe.preventVerticalPan||(W.shift?this.viewport.zoomBy(1.1):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new a.Point(0,-this.pixelsPerArrowPress))),this.viewport.applyConstraints()),W.preventDefault=!0;break;case 40:xe.preventVerticalPan||(W.shift?this.viewport.zoomBy(.9):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new a.Point(0,this.pixelsPerArrowPress))),this.viewport.applyConstraints()),W.preventDefault=!0;break;case 37:xe.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new a.Point(-this.pixelsPerArrowPress,0))),this.viewport.applyConstraints()),W.preventDefault=!0;break;case 39:xe.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new a.Point(this.pixelsPerArrowPress,0))),this.viewport.applyConstraints()),W.preventDefault=!0;break;default:W.preventDefault=!1;break}else W.preventDefault=!1}function U(W){var xe={originalEvent:W.originalEvent,preventDefaultAction:!1,preventVerticalPan:W.preventVerticalPan,preventHorizontalPan:W.preventHorizontalPan};if(this.raiseEvent("canvas-key",xe),!xe.preventDefaultAction&&!W.ctrl&&!W.alt&&!W.meta)switch(W.keyCode){case 43:case 61:this.viewport.zoomBy(1.1),this.viewport.applyConstraints(),W.preventDefault=!0;break;case 45:this.viewport.zoomBy(.9),this.viewport.applyConstraints(),W.preventDefault=!0;break;case 48:this.viewport.goHome(),this.viewport.applyConstraints(),W.preventDefault=!0;break;case 119:case 87:xe.preventVerticalPan||(W.shift?this.viewport.zoomBy(1.1):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new a.Point(0,-40))),this.viewport.applyConstraints()),W.preventDefault=!0;break;case 115:case 83:xe.preventVerticalPan||(W.shift?this.viewport.zoomBy(.9):this.viewport.panBy(this.viewport.deltaPointsFromPixels(new a.Point(0,40))),this.viewport.applyConstraints()),W.preventDefault=!0;break;case 97:xe.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new a.Point(-40,0))),this.viewport.applyConstraints()),W.preventDefault=!0;break;case 100:xe.preventHorizontalPan||(this.viewport.panBy(this.viewport.deltaPointsFromPixels(new a.Point(40,0))),this.viewport.applyConstraints()),W.preventDefault=!0;break;case 114:this.viewport.flipped?this.viewport.setRotation(a.positiveModulo(this.viewport.degrees-this.rotationIncrement,360)):this.viewport.setRotation(a.positiveModulo(this.viewport.degrees+this.rotationIncrement,360)),this.viewport.applyConstraints(),W.preventDefault=!0;break;case 82:this.viewport.flipped?this.viewport.setRotation(a.positiveModulo(this.viewport.degrees+this.rotationIncrement,360)):this.viewport.setRotation(a.positiveModulo(this.viewport.degrees-this.rotationIncrement,360)),this.viewport.applyConstraints(),W.preventDefault=!0;break;case 102:this.viewport.toggleFlip(),W.preventDefault=!0;break;case 106:this.goToPreviousPage();break;case 107:this.goToNextPage();break;default:W.preventDefault=!1;break}else W.preventDefault=!1}function ce(W){var xe,Qe=document.activeElement===this.canvas;Qe||this.canvas.focus(),this.viewport.flipped&&(W.position.x=this.viewport.getContainerSize().x-W.position.x);var vt={tracker:W.eventSource,position:W.position,quick:W.quick,shift:W.shift,originalEvent:W.originalEvent,originalTarget:W.originalTarget,preventDefaultAction:!1};this.raiseEvent("canvas-click",vt),!vt.preventDefaultAction&&this.viewport&&W.quick&&(xe=this.gestureSettingsByDeviceType(W.pointerType),xe.clickToZoom&&(this.viewport.zoomBy(W.shift?1/this.zoomPerClick:this.zoomPerClick,xe.zoomToRefPoint?this.viewport.pointFromPixel(W.position,!0):null),this.viewport.applyConstraints()))}function Pe(W){var xe,Qe={tracker:W.eventSource,position:W.position,shift:W.shift,originalEvent:W.originalEvent,preventDefaultAction:!1};this.raiseEvent("canvas-double-click",Qe),!Qe.preventDefaultAction&&this.viewport&&(xe=this.gestureSettingsByDeviceType(W.pointerType),xe.dblClickToZoom&&(this.viewport.zoomBy(W.shift?1/this.zoomPerClick:this.zoomPerClick,xe.zoomToRefPoint?this.viewport.pointFromPixel(W.position,!0):null),this.viewport.applyConstraints()))}function Ae(W){var xe,Qe={tracker:W.eventSource,pointerType:W.pointerType,position:W.position,delta:W.delta,speed:W.speed,direction:W.direction,shift:W.shift,originalEvent:W.originalEvent,preventDefaultAction:!1};if(this.raiseEvent("canvas-drag",Qe),xe=this.gestureSettingsByDeviceType(W.pointerType),xe.dragToPan&&!Qe.preventDefaultAction&&this.viewport){if(this.panHorizontal||(W.delta.x=0),this.panVertical||(W.delta.y=0),this.viewport.flipped&&(W.delta.x=-W.delta.x),this.constrainDuringPan){var vt=this.viewport.deltaPointsFromPixels(W.delta.negate());this.viewport.centerSpringX.target.value+=vt.x,this.viewport.centerSpringY.target.value+=vt.y;var ut=this.viewport.getBounds(),Gt=this.viewport.getConstrainedBounds();this.viewport.centerSpringX.target.value-=vt.x,this.viewport.centerSpringY.target.value-=vt.y,ut.x!==Gt.x&&(W.delta.x=0),ut.y!==Gt.y&&(W.delta.y=0)}this.viewport.panBy(this.viewport.deltaPointsFromPixels(W.delta.negate()),xe.flickEnabled&&!this.constrainDuringPan)}}function Ne(W){var xe={tracker:W.eventSource,pointerType:W.pointerType,position:W.position,speed:W.speed,direction:W.direction,shift:W.shift,originalEvent:W.originalEvent,preventDefaultAction:!1};if(this.raiseEvent("canvas-drag-end",xe),!xe.preventDefaultAction&&this.viewport){var Qe=this.gestureSettingsByDeviceType(W.pointerType);if(Qe.flickEnabled&&W.speed>=Qe.flickMinSpeed){var vt=0;this.panHorizontal&&(vt=Qe.flickMomentum*W.speed*Math.cos(W.direction));var ut=0;this.panVertical&&(ut=Qe.flickMomentum*W.speed*Math.sin(W.direction));var Gt=this.viewport.pixelFromPoint(this.viewport.getCenter(!0)),Ft=this.viewport.pointFromPixel(new a.Point(Gt.x-vt,Gt.y-ut));this.viewport.panTo(Ft,!1)}this.viewport.applyConstraints()}}function Fe(W){this.raiseEvent("canvas-enter",{tracker:W.eventSource,pointerType:W.pointerType,position:W.position,buttons:W.buttons,pointers:W.pointers,insideElementPressed:W.insideElementPressed,buttonDownAny:W.buttonDownAny,originalEvent:W.originalEvent})}function lt(W){this.raiseEvent("canvas-exit",{tracker:W.eventSource,pointerType:W.pointerType,position:W.position,buttons:W.buttons,pointers:W.pointers,insideElementPressed:W.insideElementPressed,buttonDownAny:W.buttonDownAny,originalEvent:W.originalEvent})}function ht(W){this.raiseEvent("canvas-press",{tracker:W.eventSource,pointerType:W.pointerType,position:W.position,insideElementPressed:W.insideElementPressed,insideElementReleased:W.insideElementReleased,originalEvent:W.originalEvent})}function At(W){this.raiseEvent("canvas-release",{tracker:W.eventSource,pointerType:W.pointerType,position:W.position,insideElementPressed:W.insideElementPressed,insideElementReleased:W.insideElementReleased,originalEvent:W.originalEvent})}function Lt(W){this.raiseEvent("canvas-nonprimary-press",{tracker:W.eventSource,position:W.position,pointerType:W.pointerType,button:W.button,buttons:W.buttons,originalEvent:W.originalEvent})}function kt(W){this.raiseEvent("canvas-nonprimary-release",{tracker:W.eventSource,position:W.position,pointerType:W.pointerType,button:W.button,buttons:W.buttons,originalEvent:W.originalEvent})}function Yt(W){var xe,Qe,vt,ut,Gt={tracker:W.eventSource,pointerType:W.pointerType,gesturePoints:W.gesturePoints,lastCenter:W.lastCenter,center:W.center,lastDistance:W.lastDistance,distance:W.distance,shift:W.shift,originalEvent:W.originalEvent,preventDefaultPanAction:!1,preventDefaultZoomAction:!1,preventDefaultRotateAction:!1};if(this.raiseEvent("canvas-pinch",Gt),this.viewport&&(xe=this.gestureSettingsByDeviceType(W.pointerType),xe.pinchToZoom&&(!Gt.preventDefaultPanAction||!Gt.preventDefaultZoomAction)&&(Qe=this.viewport.pointFromPixel(W.center,!0),Gt.preventDefaultZoomAction||this.viewport.zoomBy(W.distance/W.lastDistance,Qe,!0),xe.zoomToRefPoint&&!Gt.preventDefaultPanAction&&(vt=this.viewport.pointFromPixel(W.lastCenter,!0),ut=vt.minus(Qe),this.panHorizontal||(ut.x=0),this.panVertical||(ut.y=0),this.viewport.panBy(ut,!0)),this.viewport.applyConstraints()),xe.pinchRotate&&!Gt.preventDefaultRotateAction)){var Ft=Math.atan2(W.gesturePoints[0].currentPos.y-W.gesturePoints[1].currentPos.y,W.gesturePoints[0].currentPos.x-W.gesturePoints[1].currentPos.x),en=Math.atan2(W.gesturePoints[0].lastPos.y-W.gesturePoints[1].lastPos.y,W.gesturePoints[0].lastPos.x-W.gesturePoints[1].lastPos.x);this.viewport.setRotation(this.viewport.getRotation()+(Ft-en)*(180/Math.PI))}}function Xt(W){var xe,Qe,vt,ut,Gt;ut=a.now(),Gt=ut-this._lastScrollTime,Gt>this.minScrollDeltaTime?(this._lastScrollTime=ut,xe={tracker:W.eventSource,position:W.position,scroll:W.scroll,shift:W.shift,originalEvent:W.originalEvent,preventDefaultAction:!1,preventDefault:!0},this.raiseEvent("canvas-scroll",xe),!xe.preventDefaultAction&&this.viewport&&(this.viewport.flipped&&(W.position.x=this.viewport.getContainerSize().x-W.position.x),Qe=this.gestureSettingsByDeviceType(W.pointerType),Qe.scrollToZoom&&(vt=Math.pow(this.zoomPerScroll,W.scroll),this.viewport.zoomBy(vt,Qe.zoomToRefPoint?this.viewport.pointFromPixel(W.position,!0):null),this.viewport.applyConstraints())),W.preventDefault=xe.preventDefault):W.preventDefault=!0}function di(W){c[this.hash].mouseInside=!0,Y(this),this.raiseEvent("container-enter",{tracker:W.eventSource,pointerType:W.pointerType,position:W.position,buttons:W.buttons,pointers:W.pointers,insideElementPressed:W.insideElementPressed,buttonDownAny:W.buttonDownAny,originalEvent:W.originalEvent})}function li(W){W.pointers<1&&(c[this.hash].mouseInside=!1,c[this.hash].animating||N(this)),this.raiseEvent("container-exit",{tracker:W.eventSource,pointerType:W.pointerType,position:W.position,buttons:W.buttons,pointers:W.pointers,insideElementPressed:W.insideElementPressed,buttonDownAny:W.buttonDownAny,originalEvent:W.originalEvent})}function Fi(W){zi(W),W.isOpen()?W._updateRequestId=x(W,Fi):W._updateRequestId=!1}function zi(W){if(!(W._opening||!c[W.hash])){if(W.autoResize){var xe=m(W.container),Qe=c[W.hash].prevContainerSize;if(!xe.equals(Qe)){var vt=W.viewport;if(W.preserveImageSizeOnResize){var ut=Qe.x/xe.x,Gt=vt.getZoom()*ut,Ft=vt.getCenter();vt.resize(xe,!1),vt.zoomTo(Gt,null,!0),vt.panTo(Ft,!0)}else{var en=vt.getBounds();vt.resize(xe,!0),vt.fitBoundsWithConstraints(en,!0)}c[W.hash].prevContainerSize=xe,c[W.hash].forceRedraw=!0}}var xn=W.viewport.update(),qi=W.world.update()||xn;xn&&W.raiseEvent("viewport-change"),W.referenceStrip&&(qi=W.referenceStrip.update(W.viewport)||qi),!c[W.hash].animating&&qi&&(W.raiseEvent("animation-start"),Y(W)),(qi||c[W.hash].forceRedraw||W.world.needsDraw())&&(Tn(W),W._drawOverlays(),W.navigator&&W.navigator.update(W.viewport),c[W.hash].forceRedraw=!1,qi&&W.raiseEvent("animation")),c[W.hash].animating&&!qi&&(W.raiseEvent("animation-finish"),c[W.hash].mouseInside||N(W)),c[W.hash].animating=qi}}function Tn(W){W.imageLoader.clear(),W.drawer.clear(),W.world.draw(),W.raiseEvent("update-viewport",{})}function zt(W,xe){return W?W+xe:xe}function Wi(){c[this.hash].lastZoomTime=a.now(),c[this.hash].zoomFactor=this.zoomPerSecond,c[this.hash].zooming=!0,ss(this)}function Kl(){c[this.hash].lastZoomTime=a.now(),c[this.hash].zoomFactor=1/this.zoomPerSecond,c[this.hash].zooming=!0,ss(this)}function oa(){c[this.hash].zooming=!1}function ss(W){a.requestAnimationFrame(a.delegate(W,fo))}function fo(){var W,xe,Qe;c[this.hash].zooming&&this.viewport&&(W=a.now(),xe=W-c[this.hash].lastZoomTime,Qe=Math.pow(c[this.hash].zoomFactor,xe/1e3),this.viewport.zoomBy(Qe),this.viewport.applyConstraints(),c[this.hash].lastZoomTime=W,ss(this))}function Ja(){this.viewport&&(c[this.hash].zooming=!1,this.viewport.zoomBy(this.zoomPerClick/1),this.viewport.applyConstraints())}function Mo(){this.viewport&&(c[this.hash].zooming=!1,this.viewport.zoomBy(1/this.zoomPerClick),this.viewport.applyConstraints())}function bf(){this.buttonGroup&&(this.buttonGroup.emulateEnter(),this.buttonGroup.emulateLeave())}function _f(){this.viewport&&this.viewport.goHome()}function fd(){this.isFullPage()&&!a.isFullScreen()?this.setFullPage(!1):this.setFullScreen(!this.isFullPage()),this.buttonGroup&&this.buttonGroup.emulateLeave(),this.fullPageButton.element.focus(),this.viewport&&this.viewport.applyConstraints()}function wf(){if(this.viewport){var W=this.viewport.getRotation();this.viewport.flipped?W=a.positiveModulo(W+this.rotationIncrement,360):W=a.positiveModulo(W-this.rotationIncrement,360),this.viewport.setRotation(W)}}function Tf(){if(this.viewport){var W=this.viewport.getRotation();this.viewport.flipped?W=a.positiveModulo(W-this.rotationIncrement,360):W=a.positiveModulo(W+this.rotationIncrement,360),this.viewport.setRotation(W)}}function xf(){this.viewport.toggleFlip()}}(d),function(a){a.Navigator=function(x){var E=x.viewer,N=this,H,Y;x.id?(this.element=document.getElementById(x.id),x.controlOptions={anchor:a.ControlAnchor.NONE,attachToViewer:!1,autoFade:!1}):(x.id="navigator-"+a.now(),this.element=a.makeNeutralElement("div"),x.controlOptions={anchor:a.ControlAnchor.TOP_RIGHT,attachToViewer:!0,autoFade:x.autoFade},x.position&&(x.position==="BOTTOM_RIGHT"?x.controlOptions.anchor=a.ControlAnchor.BOTTOM_RIGHT:x.position==="BOTTOM_LEFT"?x.controlOptions.anchor=a.ControlAnchor.BOTTOM_LEFT:x.position==="TOP_RIGHT"?x.controlOptions.anchor=a.ControlAnchor.TOP_RIGHT:x.position==="TOP_LEFT"?x.controlOptions.anchor=a.ControlAnchor.TOP_LEFT:x.position==="ABSOLUTE"&&(x.controlOptions.anchor=a.ControlAnchor.ABSOLUTE,x.controlOptions.top=x.top,x.controlOptions.left=x.left,x.controlOptions.height=x.height,x.controlOptions.width=x.width))),this.element.id=x.id,this.element.className+=" navigator",x=a.extend(!0,{sizeRatio:a.DEFAULT_SETTINGS.navigatorSizeRatio},x,{element:this.element,tabIndex:-1,showNavigator:!1,mouseNavEnabled:!1,showNavigationControl:!1,showSequenceControl:!1,immediateRender:!0,blendTime:0,animationTime:0,autoResize:x.autoResize,minZoomImageRatio:1,background:x.background,opacity:x.opacity,borderColor:x.borderColor,displayRegionColor:x.displayRegionColor}),x.minPixelRatio=this.minPixelRatio=E.minPixelRatio,a.setElementTouchActionNone(this.element),this.borderWidth=2,this.fudge=new a.Point(1,1),this.totalBorderWidths=new a.Point(this.borderWidth*2,this.borderWidth*2).minus(this.fudge),x.controlOptions.anchor!==a.ControlAnchor.NONE&&function(me,ke){me.margin="0px",me.border=ke+"px solid "+x.borderColor,me.padding="0px",me.background=x.background,me.opacity=x.opacity,me.overflow="hidden"}(this.element.style,this.borderWidth),this.displayRegion=a.makeNeutralElement("div"),this.displayRegion.id=this.element.id+"-displayregion",this.displayRegion.className="displayregion",function(me,ke){me.position="relative",me.top="0px",me.left="0px",me.fontSize="0px",me.overflow="hidden",me.border=ke+"px solid "+x.displayRegionColor,me.margin="0px",me.padding="0px",me.background="transparent",me.float="left",me.cssFloat="left",me.styleFloat="left",me.zIndex=999999999,me.cursor="default"}(this.displayRegion.style,this.borderWidth),a.setElementPointerEventsNone(this.displayRegion),a.setElementTouchActionNone(this.displayRegion),this.displayRegionContainer=a.makeNeutralElement("div"),this.displayRegionContainer.id=this.element.id+"-displayregioncontainer",this.displayRegionContainer.className="displayregioncontainer",this.displayRegionContainer.style.width="100%",this.displayRegionContainer.style.height="100%",a.setElementPointerEventsNone(this.displayRegionContainer),a.setElementTouchActionNone(this.displayRegionContainer),E.addControl(this.element,x.controlOptions),this._resizeWithViewer=x.controlOptions.anchor!==a.ControlAnchor.ABSOLUTE&&x.controlOptions.anchor!==a.ControlAnchor.NONE,x.width&&x.height?(this.setWidth(x.width),this.setHeight(x.height)):this._resizeWithViewer&&(H=a.getElementSize(E.element),this.element.style.height=Math.round(H.y*x.sizeRatio)+"px",this.element.style.width=Math.round(H.x*x.sizeRatio)+"px",this.oldViewerSize=H,Y=a.getElementSize(this.element),this.elementArea=Y.x*Y.y),this.oldContainerSize=new a.Point(0,0),a.Viewer.apply(this,[x]),this.displayRegionContainer.appendChild(this.displayRegion),this.element.getElementsByTagName("div")[0].appendChild(this.displayRegionContainer);function ee(me){_(N.displayRegionContainer,me),_(N.displayRegion,-me),N.viewport.setRotation(me)}if(x.navigatorRotate){var be=x.viewer.viewport?x.viewer.viewport.getRotation():x.viewer.degrees||0;ee(be),x.viewer.addHandler("rotate",function(me){ee(me.degrees)})}this.innerTracker.destroy(),this.innerTracker=new a.MouseTracker({userData:"Navigator.innerTracker",element:this.element,dragHandler:a.delegate(this,f),clickHandler:a.delegate(this,c),releaseHandler:a.delegate(this,m),scrollHandler:a.delegate(this,v),preProcessEventHandler:function(me){me.eventType==="wheel"&&(me.preventDefault=!0)}}),this.outerTracker.userData="Navigator.outerTracker",a.setElementPointerEventsNone(this.canvas),a.setElementPointerEventsNone(this.container),this.addHandler("reset-size",function(){N.viewport&&N.viewport.goHome(!0)}),E.world.addHandler("item-index-change",function(me){window.setTimeout(function(){var ke=N.world.getItemAt(me.previousIndex);N.world.setItemIndex(ke,me.newIndex)},1)}),E.world.addHandler("remove-item",function(me){var ke=me.item,U=N._getMatchingItem(ke);U&&N.world.removeItem(U)}),this.update(E.viewport)},a.extend(a.Navigator.prototype,a.EventSource.prototype,a.Viewer.prototype,{updateSize:function(){if(this.viewport){var x=new a.Point(this.container.clientWidth===0?1:this.container.clientWidth,this.container.clientHeight===0?1:this.container.clientHeight);x.equals(this.oldContainerSize)||(this.viewport.resize(x,!0),this.viewport.goHome(!0),this.oldContainerSize=x,this.drawer.clear(),this.world.draw())}},setWidth:function(x){this.width=x,this.element.style.width=typeof x=="number"?x+"px":x,this._resizeWithViewer=!1},setHeight:function(x){this.height=x,this.element.style.height=typeof x=="number"?x+"px":x,this._resizeWithViewer=!1},setFlip:function(x){return this.viewport.setFlip(x),this.setDisplayTransform(this.viewer.viewport.getFlip()?"scale(-1,1)":"scale(1,1)"),this},setDisplayTransform:function(x){w(this.displayRegion,x),w(this.canvas,x),w(this.element,x)},update:function(x){var E,N,H,Y,ee,be;if(E=a.getElementSize(this.viewer.element),this._resizeWithViewer&&E.x&&E.y&&!E.equals(this.oldViewerSize)&&(this.oldViewerSize=E,this.maintainSizeRatio||!this.elementArea?(N=E.x*this.sizeRatio,H=E.y*this.sizeRatio):(N=Math.sqrt(this.elementArea*(E.x/E.y)),H=this.elementArea/N),this.element.style.width=Math.round(N)+"px",this.element.style.height=Math.round(H)+"px",this.elementArea||(this.elementArea=N*H),this.updateSize()),x&&this.viewport){Y=x.getBoundsNoRotate(!0),ee=this.viewport.pixelFromPointNoRotate(Y.getTopLeft(),!1),be=this.viewport.pixelFromPointNoRotate(Y.getBottomRight(),!1).minus(this.totalBorderWidths);var me=this.displayRegion.style;me.display=this.world.getItemCount()?"block":"none",me.top=Math.round(ee.y)+"px",me.left=Math.round(ee.x)+"px";var ke=Math.abs(ee.x-be.x),U=Math.abs(ee.y-be.y);me.width=Math.round(Math.max(ke,0))+"px",me.height=Math.round(Math.max(U,0))+"px"}},addTiledImage:function(x){var E=this,N=x.originalTiledImage;delete x.original;var H=a.extend({},x,{success:function(Y){var ee=Y.item;ee._originalForNavigator=N,E._matchBounds(ee,N,!0),E._matchOpacity(ee,N),E._matchCompositeOperation(ee,N);function be(){E._matchBounds(ee,N)}function me(){E._matchOpacity(ee,N)}function ke(){E._matchCompositeOperation(ee,N)}N.addHandler("bounds-change",be),N.addHandler("clip-change",be),N.addHandler("opacity-change",me),N.addHandler("composite-operation-change",ke)}});return a.Viewer.prototype.addTiledImage.apply(this,[H])},destroy:function(){return a.Viewer.prototype.destroy.apply(this)},_getMatchingItem:function(x){for(var E=this.world.getItemCount(),N,H=0;H1||m.y>1));f++);return f-1},getTileAtPoint:function(f,m){var v=m.x>=0&&m.x<=1&&m.y>=0&&m.y<=1/this.aspectRatio;a.console.assert(v,"[TileSource.getTileAtPoint] must be called with a valid point.");var _=this.dimensions.x*this.getLevelScale(f),w=m.x*_,x=m.y*_,E=Math.floor(w/this.getTileWidth(f)),N=Math.floor(x/this.getTileHeight(f));m.x>=1&&(E=this.getNumTiles(f).x-1);var H=1e-15;return m.y>=1/this.aspectRatio-H&&(N=this.getNumTiles(f).y-1),new a.Point(E,N)},getTileBounds:function(f,m,v,_){var w=this.dimensions.times(this.getLevelScale(f)),x=this.getTileWidth(f),E=this.getTileHeight(f),N=m===0?0:x*m-this.tileOverlap,H=v===0?0:E*v-this.tileOverlap,Y=x+(m===0?1:2)*this.tileOverlap,ee=E+(v===0?1:2)*this.tileOverlap,be=1/w.x;return Y=Math.min(Y,w.x-N),ee=Math.min(ee,w.y-H),_?new a.Rect(0,0,Y,ee):new a.Rect(N*be,H*be,Y*be,ee*be)},getImageInfo:function(f){var m=this,v,_,w,x,E,N,H;f&&(E=f.split("/"),N=E[E.length-1],H=N.lastIndexOf("."),H>-1&&(E[E.length-1]=N.slice(0,H))),_=function(Y){typeof Y=="string"&&(Y=a.parseXml(Y));var ee=a.TileSource.determineType(m,Y,f);if(!ee){m.raiseEvent("open-failed",{message:"Unable to load TileSource",source:f});return}x=ee.prototype.configure.apply(m,[Y,f]),x.ajaxWithCredentials===void 0&&(x.ajaxWithCredentials=m.ajaxWithCredentials),w=new ee(x),m.ready=!0,m.raiseEvent("ready",{tileSource:w})},f.match(/\.js$/)?(v=f.split("/").pop().replace(".js",""),a.jsonp({url:f,async:!1,callbackName:v,callback:_})):a.makeAjaxRequest({url:f,withCredentials:this.ajaxWithCredentials,headers:this.ajaxHeaders,success:function(Y){var ee=c(Y);_(ee)},error:function(Y,ee){var be;try{be="HTTP "+Y.status+" attempting to load TileSource"}catch{var me;typeof ee>"u"||!ee.toString?me="Unknown error":me=ee.toString(),be=me+" attempting to load TileSource"}m.raiseEvent("open-failed",{message:be,source:f})}})},supports:function(f,m){return!1},configure:function(f,m){throw new Error("Method not implemented.")},getTileUrl:function(f,m,v){throw new Error("Method not implemented.")},getTileAjaxHeaders:function(f,m,v){return{}},tileExists:function(f,m,v){var _=this.getNumTiles(f);return f>=this.minLevel&&f<=this.maxLevel&&m>=0&&v>=0&&m<_.x&&v<_.y}},a.extend(!0,a.TileSource.prototype,a.EventSource.prototype);function c(f){var m=f.responseText,v=f.status,_,w;if(f){if(f.status!==200&&f.status!==0)throw v=f.status,_=v===404?"Not Found":f.statusText,new Error(a.getString("Errors.Status",v,_))}else throw new Error(a.getString("Errors.Security"));if(m.match(/\s*<.*/))try{w=f.responseXML&&f.responseXML.documentElement?f.responseXML:a.parseXml(m)}catch{w=f.responseText}else if(m.match(/\s*[{[].*/))try{w=a.parseJSON(m)}catch{w=m}else w=m;return w}a.TileSource.determineType=function(f,m,v){var _;for(_ in d)if(_.match(/.+TileSource$/)&&a.isFunction(d[_])&&a.isFunction(d[_].prototype.supports)&&d[_].prototype.supports.call(f,m,v))return d[_];return a.console.error("No TileSource was able to open %s %s",v,m),null}}(d),function(a){a.DziTileSource=function(m,v,_,w,x,E,N,H,Y){var ee,be,me,ke;if(a.isPlainObject(m)?ke=m:ke={width:arguments[0],height:arguments[1],tileSize:arguments[2],tileOverlap:arguments[3],tilesUrl:arguments[4],fileFormat:arguments[5],displayRects:arguments[6],minLevel:arguments[7],maxLevel:arguments[8]},this._levelRects={},this.tilesUrl=ke.tilesUrl,this.fileFormat=ke.fileFormat,this.displayRects=ke.displayRects,this.displayRects)for(ee=this.displayRects.length-1;ee>=0;ee--)for(be=this.displayRects[ee],me=be.minLevel;me<=be.maxLevel;me++)this._levelRects[me]||(this._levelRects[me]=[]),this._levelRects[me].push(be);a.TileSource.apply(this,[ke])},a.extend(a.DziTileSource.prototype,a.TileSource.prototype,{supports:function(m,v){var _;return m.Image?_=m.Image.xmlns:m.documentElement&&(m.documentElement.localName==="Image"||m.documentElement.tagName==="Image")&&(_=m.documentElement.namespaceURI),_=(_||"").toLowerCase(),_.indexOf("schemas.microsoft.com/deepzoom/2008")!==-1||_.indexOf("schemas.microsoft.com/deepzoom/2009")!==-1},configure:function(m,v){var _;return a.isPlainObject(m)?_=f(this,m):_=c(this,m),v&&!_.tilesUrl&&(_.tilesUrl=v.replace(/([^/]+?)(\.(dzi|xml|js)?(\?[^/]*)?)?\/?$/,"$1_files/"),v.search(/\.(dzi|xml|js)\?/)!==-1?_.queryParams=v.match(/\?.*/):_.queryParams=""),_},getTileUrl:function(m,v,_){return[this.tilesUrl,m,"/",v,"_",_,".",this.fileFormat,this.queryParams].join("")},tileExists:function(m,v,_){var w=this._levelRects[m],x,E,N,H,Y,ee,be;if(this.minLevel&&mthis.maxLevel)return!1;if(!w||!w.length)return!0;for(be=w.length-1;be>=0;be--)if(x=w[be],!(mx.maxLevel)&&(E=this.getLevelScale(m),N=x.x*E,H=x.y*E,Y=N+x.width*E,ee=H+x.height*E,N=Math.floor(N/this._tileWidth),H=Math.floor(H/this._tileWidth),Y=Math.ceil(Y/this._tileWidth),ee=Math.ceil(ee/this._tileWidth),N<=v&&v0?_.tileSize=Math.max.apply(null,Y):_.tileSize=N}else this.sizes&&this.sizes.length>0?(this.emulateLegacyImagePyramid=!0,_.levels=f(this),a.extend(!0,_,{width:_.levels[_.levels.length-1].width,height:_.levels[_.levels.length-1].height,tileSize:Math.max(_.height,_.width),tileOverlap:0,minLevel:0,maxLevel:_.levels.length-1}),this.levels=_.levels):a.console.error("Nothing in the info.json to construct image pyramids from");if(!_.maxLevel&&!this.emulateLegacyImagePyramid)if(!this.scale_factors)_.maxLevel=Number(Math.ceil(Math.log(Math.max(this.width,this.height),2)));else{var be=Math.max.apply(null,this.scale_factors);_.maxLevel=Math.round(Math.log(be)*Math.LOG2E)}a.TileSource.apply(this,[_])},a.extend(a.IIIFTileSource.prototype,a.TileSource.prototype,{supports:function(_,w){return _.protocol&&_.protocol==="http://iiif.io/api/image"||_["@context"]&&(_["@context"]==="http://library.stanford.edu/iiif/image-api/1.1/context.json"||_["@context"]==="http://iiif.io/api/image/1/context.json")||_.profile&&_.profile.indexOf("http://library.stanford.edu/iiif/image-api/compliance.html")===0||_.identifier&&_.width&&_.height?!0:!!(_.documentElement&&_.documentElement.tagName==="info"&&_.documentElement.namespaceURI==="http://library.stanford.edu/iiif/image-api/ns/")},configure:function(_,w){if(a.isPlainObject(_)){if(!_["@context"])_["@context"]="http://iiif.io/api/image/1.0/context.json",_["@id"]=w.replace("/info.json",""),_.version=1;else{var x=_["@context"];if(Array.isArray(x)){for(var E=0;E0&&_>=this.minLevel&&_<=this.maxLevel&&(w=this.levels[_].width/this.levels[this.maxLevel].width),w}return a.TileSource.prototype.getLevelScale.call(this,_)},getNumTiles:function(_){if(this.emulateLegacyImagePyramid){var w=this.getLevelScale(_);return w?new a.Point(1,1):new a.Point(0,0)}return a.TileSource.prototype.getNumTiles.call(this,_)},getTileAtPoint:function(_,w){return this.emulateLegacyImagePyramid?new a.Point(0,0):a.TileSource.prototype.getTileAtPoint.call(this,_,w)},getTileUrl:function(_,w,x){if(this.emulateLegacyImagePyramid){var E=null;return this.levels.length>0&&_>=this.minLevel&&_<=this.maxLevel&&(E=this.levels[_].url),E}var N="0",H=Math.pow(.5,this.maxLevel-_),Y=Math.ceil(this.width*H),ee=Math.ceil(this.height*H),be,me,ke,U,ce,Pe,Ae,Ne,Fe,lt,ht,At,Lt,kt;return be=this.getTileWidth(_),me=this.getTileHeight(_),ke=Math.ceil(be/H),U=Math.ceil(me/H),this.version===1?Lt="native."+this.tileFormat:Lt="default."+this.tileFormat,Y1&&_.profile[1].supports&&(N=_.profile[1].supports.indexOf("sizeByW")!==-1),_.version===3&&_.extraFeatures&&(N=_.extraFeatures.indexOf("sizeByWh")!==-1),!E||N}function f(_){for(var w=[],x=0;x<_.sizes.length;x++)w.push({url:_["@id"]+"/full/"+_.sizes[x].width+","+(_.version===3?_.sizes[x].height:"")+"/0/default."+_.tileFormat,width:_.sizes[x].width,height:_.sizes[x].height});return w.sort(function(E,N){return E.width-N.width})}function m(_){if(!_||!_.documentElement)throw new Error(a.getString("Errors.Xml"));var w=_.documentElement,x=w.tagName,E=null;if(x==="info")try{return E={},v(w,E),E}catch(N){throw N instanceof Error?N:new Error(a.getString("Errors.IIIF"))}throw new Error(a.getString("Errors.IIIF"))}function v(_,w,x){var E,N;if(_.nodeType===3&&x)N=_.nodeValue.trim(),N.match(/^\d*$/)&&(N=Number(N)),w[x]?(a.isArray(w[x])||(w[x]=[w[x]]),w[x].push(N)):w[x]=N;else if(_.nodeType===1)for(E=0;E<_.childNodes.length;E++)v(_.childNodes[E],w,_.nodeName)}}(d),function(a){a.OsmTileSource=function(c,f,m,v,_){var w;a.isPlainObject(c)?w=c:w={width:arguments[0],height:arguments[1],tileSize:arguments[2],tileOverlap:arguments[3],tilesUrl:arguments[4]},(!w.width||!w.height)&&(w.width=65572864,w.height=65572864),w.tileSize||(w.tileSize=256,w.tileOverlap=0),w.tilesUrl||(w.tilesUrl="http://tile.openstreetmap.org/"),w.minLevel=8,a.TileSource.apply(this,[w])},a.extend(a.OsmTileSource.prototype,a.TileSource.prototype,{supports:function(c,f){return c.type&&c.type==="openstreetmaps"},configure:function(c,f){return c},getTileUrl:function(c,f,m){return this.tilesUrl+(c-8)+"/"+f+"/"+m+".png"}})}(d),function(a){a.TmsTileSource=function(c,f,m,v,_){var w;a.isPlainObject(c)?w=c:w={width:arguments[0],height:arguments[1],tileSize:arguments[2],tileOverlap:arguments[3],tilesUrl:arguments[4]};var x=Math.ceil(w.width/256)*256,E=Math.ceil(w.height/256)*256,N;x>E?N=x/256:N=E/256,w.maxLevel=Math.ceil(Math.log(N)/Math.log(2))-1,w.tileSize=256,w.width=x,w.height=E,a.TileSource.apply(this,[w])},a.extend(a.TmsTileSource.prototype,a.TileSource.prototype,{supports:function(c,f){return c.type&&c.type==="tiledmapservice"},configure:function(c,f){return c},getTileUrl:function(c,f,m){var v=this.getNumTiles(c).y-1;return this.tilesUrl+c+"/"+f+"/"+(v-m)+".png"}})}(d),function(a){a.ZoomifyTileSource=function(c){typeof c.tileSize>"u"&&(c.tileSize=256),typeof c.fileFormat>"u"&&(c.fileFormat="jpg",this.fileFormat=c.fileFormat);var f={x:c.width,y:c.height};for(c.imageSizes=[{x:c.width,y:c.height}],c.gridSize=[this._getGridSize(c.width,c.height,c.tileSize)];parseInt(f.x,10)>c.tileSize||parseInt(f.y,10)>c.tileSize;)f.x=Math.floor(f.x/2),f.y=Math.floor(f.y/2),c.imageSizes.push({x:f.x,y:f.y}),c.gridSize.push(this._getGridSize(f.x,f.y,c.tileSize));c.imageSizes.reverse(),c.gridSize.reverse(),c.minLevel=0,c.maxLevel=c.gridSize.length-1,d.TileSource.apply(this,[c])},a.extend(a.ZoomifyTileSource.prototype,a.TileSource.prototype,{_getGridSize:function(c,f,m){return{x:Math.ceil(c/m),y:Math.ceil(f/m)}},_calculateAbsoluteTileNumber:function(c,f,m){for(var v=0,_={},w=0;w0?(w=_.levels[_.levels.length-1].width,x=_.levels[_.levels.length-1].height):(w=0,x=0,a.console.error("No supported image formats found")),a.extend(!0,_,{width:w,height:x,tileSize:Math.max(x,w),tileOverlap:0,minLevel:0,maxLevel:_.levels.length>0?_.levels.length-1:0}),a.TileSource.apply(this,[_]),this.levels=_.levels},a.extend(a.LegacyTileSource.prototype,a.TileSource.prototype,{supports:function(v,_){return v.type&&v.type==="legacy-image-pyramid"||v.documentElement&&v.documentElement.getAttribute("type")==="legacy-image-pyramid"},configure:function(v,_){var w;return a.isPlainObject(v)?w=m(this,v):w=f(this,v),w},getLevelScale:function(v){var _=NaN;return this.levels.length>0&&v>=this.minLevel&&v<=this.maxLevel&&(_=this.levels[v].width/this.levels[this.maxLevel].width),_},getNumTiles:function(v){var _=this.getLevelScale(v);return _?new a.Point(1,1):new a.Point(0,0)},getTileUrl:function(v,_,w){var x=null;return this.levels.length>0&&v>=this.minLevel&&v<=this.maxLevel&&(x=this.levels[v].url),x}});function c(v){var _=[],w,x;for(x=0;x");return _.sort(function(E,N){return E.height-N.height})}function f(v,_){if(!_||!_.documentElement)throw new Error(a.getString("Errors.Xml"));var w=_.documentElement,x=w.tagName,E=null,N=[],H,Y;if(x==="image")try{for(E={type:w.getAttribute("type"),levels:[]},N=w.getElementsByTagName("level"),Y=0;Y=this.minLevel&&c<=this.maxLevel&&(f=this.levels[c].width/this.levels[this.maxLevel].width),f},getNumTiles:function(c){var f=this.getLevelScale(c);return f?new a.Point(1,1):new a.Point(0,0)},getTileUrl:function(c,f,m){var v=null;return c>=this.minLevel&&c<=this.maxLevel&&(v=this.levels[c].url),v},getContext2D:function(c,f,m){var v=null;return c>=this.minLevel&&c<=this.maxLevel&&(v=this.levels[c].context2D),v},destroy:function(){this._freeupCanvasMemory()},_buildLevels:function(){var c=[{url:this._image.src,width:this._image.naturalWidth,height:this._image.naturalHeight}];if(!this.buildPyramid||!a.supportsCanvas||!this.useCanvas)return delete this._image,c;var f=this._image.naturalWidth,m=this._image.naturalHeight,v=document.createElement("canvas"),_=v.getContext("2d");if(v.width=f,v.height=m,_.drawImage(this._image,0,0,f,m),c[0].context2D=_,delete this._image,a.isCanvasTainted(v))return c;for(;f>=2&&m>=2;){f=Math.floor(f/2),m=Math.floor(m/2);var w=document.createElement("canvas"),x=w.getContext("2d");w.width=f,w.height=m,x.drawImage(v,0,0,f,m),c.splice(0,0,{context2D:x,width:f,height:m}),v=w,_=x}return c},_freeupCanvasMemory:function(){for(var c=0;c0&&c(x))}function m(x){x.shouldFade=!0,x.fadeBeginTime=a.now()+x.fadeDelay,window.setTimeout(function(){c(x)},x.fadeDelay)}function v(x){x.shouldFade=!1,x.imgGroup&&a.setElementOpacity(x.imgGroup,1,!0)}function _(x,E){x.element.disabled||(E>=a.ButtonState.GROUP&&x.currentState===a.ButtonState.REST&&(v(x),x.currentState=a.ButtonState.GROUP),E>=a.ButtonState.HOVER&&x.currentState===a.ButtonState.GROUP&&(x.imgHover&&(x.imgHover.style.visibility=""),x.currentState=a.ButtonState.HOVER),E>=a.ButtonState.DOWN&&x.currentState===a.ButtonState.HOVER&&(x.imgDown&&(x.imgDown.style.visibility=""),x.currentState=a.ButtonState.DOWN))}function w(x,E){x.element.disabled||(E<=a.ButtonState.HOVER&&x.currentState===a.ButtonState.DOWN&&(x.imgDown&&(x.imgDown.style.visibility="hidden"),x.currentState=a.ButtonState.HOVER),E<=a.ButtonState.GROUP&&x.currentState===a.ButtonState.HOVER&&(x.imgHover&&(x.imgHover.style.visibility="hidden"),x.currentState=a.ButtonState.GROUP),E<=a.ButtonState.REST&&x.currentState===a.ButtonState.GROUP&&(m(x),x.currentState=a.ButtonState.REST))}}(d),function(a){a.ButtonGroup=function(c){a.extend(!0,this,{buttons:[],clickTimeThreshold:a.DEFAULT_SETTINGS.clickTimeThreshold,clickDistThreshold:a.DEFAULT_SETTINGS.clickDistThreshold,labelText:""},c);var f=this.buttons.concat([]),m=this,v;if(this.element=c.element||a.makeNeutralElement("div"),!c.group)for(this.element.style.display="inline-block",v=0;v=270?(w=this.getTopRight(),this.x=w.x,this.y=w.y,x=this.height,this.height=this.width,this.width=x,this.degrees-=270):this.degrees>=180?(w=this.getBottomRight(),this.x=w.x,this.y=w.y,this.degrees-=180):this.degrees>=90&&(w=this.getBottomLeft(),this.x=w.x,this.y=w.y,x=this.height,this.height=this.width,this.width=x,this.degrees-=90)},a.Rect.fromSummits=function(c,f,m){var v=c.distanceTo(f),_=c.distanceTo(m),w=f.minus(c),x=Math.atan(w.y/w.x);return w.x<0?x+=Math.PI:w.y<0&&(x+=2*Math.PI),new a.Rect(c.x,c.y,v,_,x/Math.PI*180)},a.Rect.prototype={clone:function(){return new a.Rect(this.x,this.y,this.width,this.height,this.degrees)},getAspectRatio:function(){return this.width/this.height},getTopLeft:function(){return new a.Point(this.x,this.y)},getBottomRight:function(){return new a.Point(this.x+this.width,this.y+this.height).rotate(this.degrees,this.getTopLeft())},getTopRight:function(){return new a.Point(this.x+this.width,this.y).rotate(this.degrees,this.getTopLeft())},getBottomLeft:function(){return new a.Point(this.x,this.y+this.height).rotate(this.degrees,this.getTopLeft())},getCenter:function(){return new a.Point(this.x+this.width/2,this.y+this.height/2).rotate(this.degrees,this.getTopLeft())},getSize:function(){return new a.Point(this.width,this.height)},equals:function(c){return c instanceof a.Rect&&this.x===c.x&&this.y===c.y&&this.width===c.width&&this.height===c.height&&this.degrees===c.degrees},times:function(c){return new a.Rect(this.x*c,this.y*c,this.width*c,this.height*c,this.degrees)},translate:function(c){return new a.Rect(this.x+c.x,this.y+c.y,this.width,this.height,this.degrees)},union:function(c){var f=this.getBoundingBox(),m=c.getBoundingBox(),v=Math.min(f.x,m.x),_=Math.min(f.y,m.y),w=Math.max(f.x+f.width,m.x+m.width),x=Math.max(f.y+f.height,m.y+m.height);return new a.Rect(v,_,w-v,x-_)},intersection:function(c){var f=1e-10,m=[],v=this.getTopLeft();c.containsPoint(v,f)&&m.push(v);var _=this.getTopRight();c.containsPoint(_,f)&&m.push(_);var w=this.getBottomLeft();c.containsPoint(w,f)&&m.push(w);var x=this.getBottomRight();c.containsPoint(x,f)&&m.push(x);var E=c.getTopLeft();this.containsPoint(E,f)&&m.push(E);var N=c.getTopRight();this.containsPoint(N,f)&&m.push(N);var H=c.getBottomLeft();this.containsPoint(H,f)&&m.push(H);var Y=c.getBottomRight();this.containsPoint(Y,f)&&m.push(Y);for(var ee=this._getSegments(),be=c._getSegments(),me=0;meFe&&(Fe=Lt.x),Lt.yht&&(ht=Lt.y)}return new a.Rect(Ne,lt,Fe-Ne,ht-lt)},_getSegments:function(){var c=this.getTopLeft(),f=this.getTopRight(),m=this.getBottomLeft(),v=this.getBottomRight();return[[c,f],[f,v],[v,m],[m,c]]},rotate:function(c,f){if(c=a.positiveModulo(c,360),c===0)return this.clone();f=f||this.getCenter();var m=this.getTopLeft().rotate(c,f),v=this.getTopRight().rotate(c,f),_=v.minus(m);_=_.apply(function(x){var E=1e-15;return Math.abs(x)=-f&&(c.x-v.x)*w.x+(c.y-v.y)*w.y<=f&&(c.x-m.x)*x.x+(c.y-m.y)*x.y>=-f&&(c.x-_.x)*x.x+(c.y-_.y)*x.y<=f},toString:function(){return"["+Math.round(this.x*100)/100+", "+Math.round(this.y*100)/100+", "+Math.round(this.width*100)/100+"x"+Math.round(this.height*100)/100+", "+Math.round(this.degrees*100)/100+"deg]"}}}(d),function(a){var c={};a.ReferenceStrip=function(H){var Y=this,ee=H.viewer,be=a.getElementSize(ee.element),me,ke,U;for(H.id||(H.id="referencestrip-"+a.now(),this.element=a.makeNeutralElement("div"),this.element.id=H.id,this.element.className="referencestrip"),H=a.extend(!0,{sizeRatio:a.DEFAULT_SETTINGS.referenceStripSizeRatio,position:a.DEFAULT_SETTINGS.referenceStripPosition,scroll:a.DEFAULT_SETTINGS.referenceStripScroll,clickTimeThreshold:a.DEFAULT_SETTINGS.clickTimeThreshold},H,{element:this.element}),a.extend(this,H),c[this.id]={animating:!1},this.minPixelRatio=this.viewer.minPixelRatio,this.element.tabIndex=0,ke=this.element.style,ke.marginTop="0px",ke.marginRight="0px",ke.marginBottom="0px",ke.marginLeft="0px",ke.left="0px",ke.bottom="0px",ke.border="0px",ke.background="#000",ke.position="relative",a.setElementTouchActionNone(this.element),a.setElementOpacity(this.element,.8),this.viewer=ee,this.tracker=new a.MouseTracker({userData:"ReferenceStrip.tracker",element:this.element,clickHandler:a.delegate(this,f),dragHandler:a.delegate(this,m),scrollHandler:a.delegate(this,v),enterHandler:a.delegate(this,w),leaveHandler:a.delegate(this,x),keyDownHandler:a.delegate(this,E),keyHandler:a.delegate(this,N),preProcessEventHandler:function(ce){ce.eventType==="wheel"&&(ce.preventDefault=!0)}}),H.width&&H.height?(this.element.style.width=H.width+"px",this.element.style.height=H.height+"px",ee.addControl(this.element,{anchor:a.ControlAnchor.BOTTOM_LEFT})):H.scroll==="horizontal"?(this.element.style.width=be.x*H.sizeRatio*ee.tileSources.length+12*ee.tileSources.length+"px",this.element.style.height=be.y*H.sizeRatio+"px",ee.addControl(this.element,{anchor:a.ControlAnchor.BOTTOM_LEFT})):(this.element.style.height=be.y*H.sizeRatio*ee.tileSources.length+12*ee.tileSources.length+"px",this.element.style.width=be.x*H.sizeRatio+"px",ee.addControl(this.element,{anchor:a.ControlAnchor.TOP_LEFT})),this.panelWidth=be.x*this.sizeRatio+8,this.panelHeight=be.y*this.sizeRatio+8,this.panels=[],this.miniViewers={},U=0;Uke+ee.x-this.panelWidth?(ce=Math.min(ce,be-ee.x),this.element.style.marginLeft=-ce+"px",_(this,ee.x,-ce)):ceU+ee.y-this.panelHeight?(ce=Math.min(ce,me-ee.y),this.element.style.marginTop=-ce+"px",_(this,ee.y,-ce)):ce0?Y>-(be-ke.x)&&(this.element.style.marginLeft=Y+H.delta.x*2+"px",_(this,ke.x,Y+H.delta.x*2)):-H.delta.x<0&&Y<0&&(this.element.style.marginLeft=Y+H.delta.x*2+"px",_(this,ke.x,Y+H.delta.x*2)):-H.delta.y>0?ee>-(me-ke.y)&&(this.element.style.marginTop=ee+H.delta.y*2+"px",_(this,ke.y,ee+H.delta.y*2)):-H.delta.y<0&&ee<0&&(this.element.style.marginTop=ee+H.delta.y*2+"px",_(this,ke.y,ee+H.delta.y*2))}}function v(H){if(this.element){var Y=Number(this.element.style.marginLeft.replace("px","")),ee=Number(this.element.style.marginTop.replace("px","")),be=Number(this.element.style.width.replace("px","")),me=Number(this.element.style.height.replace("px","")),ke=a.getElementSize(this.viewer.canvas);this.scroll==="horizontal"?H.scroll>0?Y>-(be-ke.x)&&(this.element.style.marginLeft=Y-H.scroll*60+"px",_(this,ke.x,Y-H.scroll*60)):H.scroll<0&&Y<0&&(this.element.style.marginLeft=Y-H.scroll*60+"px",_(this,ke.x,Y-H.scroll*60)):H.scroll<0?ee>ke.y-me&&(this.element.style.marginTop=ee+H.scroll*60+"px",_(this,ke.y,ee+H.scroll*60)):H.scroll>0&&ee<0&&(this.element.style.marginTop=ee+H.scroll*60+"px",_(this,ke.y,ee+H.scroll*60)),H.preventDefault=!0}}function _(H,Y,ee){var be,me,ke,U,ce,Pe;for(H.scroll==="horizontal"?be=H.panelWidth:be=H.panelHeight,me=Math.ceil(Y/be)+5,ke=Math.ceil((Math.abs(ee)+Y)/be)+1,me=ke-me,me=me<0?0:me,ce=me;ce1?m[1].springStiffness:5,animationTime:m.length>1?m[1].animationTime:1.5}),a.console.assert(typeof f.springStiffness=="number"&&f.springStiffness!==0,"[OpenSeadragon.Spring] options.springStiffness must be a non-zero number"),a.console.assert(typeof f.animationTime=="number"&&f.animationTime>=0,"[OpenSeadragon.Spring] options.animationTime must be a number greater than or equal to 0"),f.exponential&&(this._exponential=!0,delete f.exponential),a.extend(!0,this,f),this.current={value:typeof this.initial=="number"?this.initial:this._exponential?0:1,time:a.now()},a.console.assert(!this._exponential||this.current.value!==0,"[OpenSeadragon.Spring] value must be non-zero for exponential springs"),this.start={value:this.current.value,time:this.current.time},this.target={value:this.current.value,time:this.current.time},this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},a.Spring.prototype={resetTo:function(f){a.console.assert(!this._exponential||f!==0,"[OpenSeadragon.Spring.resetTo] target must be non-zero for exponential springs"),this.start.value=this.target.value=this.current.value=f,this.start.time=this.target.time=this.current.time=a.now(),this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},springTo:function(f){a.console.assert(!this._exponential||f!==0,"[OpenSeadragon.Spring.springTo] target must be non-zero for exponential springs"),this.start.value=this.current.value,this.start.time=this.current.time,this.target.value=f,this.target.time=this.start.time+1e3*this.animationTime,this._exponential&&(this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value))},shiftBy:function(f){this.start.value+=f,this.target.value+=f,this._exponential&&(a.console.assert(this.target.value!==0&&this.start.value!==0,"[OpenSeadragon.Spring.shiftBy] spring value must be non-zero for exponential springs"),this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value))},setExponential:function(f){this._exponential=f,this._exponential&&(a.console.assert(this.current.value!==0&&this.target.value!==0&&this.start.value!==0,"[OpenSeadragon.Spring.setExponential] spring value must be non-zero for exponential springs"),this.start._logValue=Math.log(this.start.value),this.target._logValue=Math.log(this.target.value),this.current._logValue=Math.log(this.current.value))},update:function(){this.current.time=a.now();var f,m;this._exponential?(f=this.start._logValue,m=this.target._logValue):(f=this.start.value,m=this.target.value);var v=this.current.time>=this.target.time?m:f+(m-f)*c(this.springStiffness,(this.current.time-this.start.time)/(this.target.time-this.start.time)),_=this.current.value;return this._exponential?this.current.value=Math.exp(v):this.current.value=v,_!==this.current.value},isAtTargetValue:function(){return this.current.value===this.target.value}};function c(f,m){return(1-Math.exp(f*-m))/(1-Math.exp(-f))}}(d),function(a){function c(m){a.extend(!0,this,{timeout:a.DEFAULT_SETTINGS.timeout,jobId:null},m),this.image=null}c.prototype={errorMsg:null,start:function(){var m=this,v=this.abort;this.image=new Image,this.image.onload=function(){m.finish(!0)},this.image.onabort=this.image.onerror=function(){m.errorMsg="Image load aborted",m.finish(!1)},this.jobId=window.setTimeout(function(){m.errorMsg="Image load exceeded timeout ("+m.timeout+" ms)",m.finish(!1)},this.timeout),this.loadWithAjax?(this.request=a.makeAjaxRequest({url:this.src,withCredentials:this.ajaxWithCredentials,headers:this.ajaxHeaders,responseType:"arraybuffer",success:function(_){var w;try{w=new window.Blob([_.response])}catch(H){var x=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder;if(H.name==="TypeError"&&x){var E=new x;E.append(_.response),w=E.getBlob()}}w.size===0&&(m.errorMsg="Empty image response.",m.finish(!1));var N=(window.URL||window.webkitURL).createObjectURL(w);m.image.src=N},error:function(_){m.errorMsg="Image load aborted - XHR error",m.finish(!1)}}),this.abort=function(){m.request.abort(),typeof v=="function"&&v()}):(this.crossOriginPolicy!==!1&&(this.image.crossOrigin=this.crossOriginPolicy),this.image.src=this.src)},finish:function(m){this.image.onload=this.image.onerror=this.image.onabort=null,m||(this.image=null),this.jobId&&window.clearTimeout(this.jobId),this.callback(this)}},a.ImageLoader=function(m){a.extend(!0,this,{jobLimit:a.DEFAULT_SETTINGS.imageLoaderLimit,timeout:a.DEFAULT_SETTINGS.timeout,jobQueue:[],jobsInProgress:0},m)},a.ImageLoader.prototype={addJob:function(m){var v=this,_=function(E){f(v,E,m.callback)},w={src:m.src,loadWithAjax:m.loadWithAjax,ajaxHeaders:m.loadWithAjax?m.ajaxHeaders:null,crossOriginPolicy:m.crossOriginPolicy,ajaxWithCredentials:m.ajaxWithCredentials,callback:_,abort:m.abort,timeout:this.timeout},x=new c(w);!this.jobLimit||this.jobsInProgress0&&(w=m.jobQueue.shift(),w.start(),m.jobsInProgress++),_(v.image,v.errorMsg,v.request)}}(d),function(a){a.Tile=function(c,f,m,v,_,w,x,E,N,H){this.level=c,this.x=f,this.y=m,this.bounds=v,this.sourceBounds=H,this.exists=_,this.url=w,this.context2D=x,this.loadWithAjax=E,this.ajaxHeaders=N,this.ajaxHeaders?this.cacheKey=this.url+"+"+JSON.stringify(this.ajaxHeaders):this.cacheKey=this.url,this.loaded=!1,this.loading=!1,this.element=null,this.imgElement=null,this.image=null,this.style=null,this.position=null,this.size=null,this.flipped=!1,this.blendStart=null,this.opacity=null,this.squaredDistance=null,this.visibility=null,this.beingDrawn=!1,this.lastTouchTime=0,this.isRightMost=!1,this.isBottomMost=!1},a.Tile.prototype={toString:function(){return this.level+"/"+this.x+"_"+this.y},_hasTransparencyChannel:function(){return!!this.context2D||this.url.match(".png")},drawHTML:function(c){if(!this.cacheImageRecord){a.console.warn("[Tile.drawHTML] attempting to draw tile %s when it's not cached",this.toString());return}if(!this.loaded){a.console.warn("Attempting to draw tile %s when it's not yet loaded.",this.toString());return}this.element||(this.element=a.makeNeutralElement("div"),this.imgElement=this.cacheImageRecord.getImage().cloneNode(),this.imgElement.style.msInterpolationMode="nearest-neighbor",this.imgElement.style.width="100%",this.imgElement.style.height="100%",this.style=this.element.style,this.style.position="absolute"),this.element.parentNode!==c&&c.appendChild(this.element),this.imgElement.parentNode!==this.element&&this.element.appendChild(this.imgElement),this.style.top=this.position.y+"px",this.style.left=this.position.x+"px",this.style.height=this.size.y+"px",this.style.width=this.size.x+"px",this.flipped&&(this.style.transform="scaleX(-1)"),a.setElementOpacity(this.element,this.opacity)},drawCanvas:function(c,f,m,v){var _=this.position.times(a.pixelDensityRatio),w=this.size.times(a.pixelDensityRatio),x;if(!this.context2D&&!this.cacheImageRecord){a.console.warn("[Tile.drawCanvas] attempting to draw tile %s when it's not cached",this.toString());return}if(x=this.context2D||this.cacheImageRecord.getRenderedContext(),!this.loaded||!x){a.console.warn("Attempting to draw tile %s when it's not yet loaded.",this.toString());return}c.save(),c.globalAlpha=this.opacity,typeof m=="number"&&m!==1&&(_=_.times(m),w=w.times(m)),v instanceof a.Point&&(_=_.plus(v)),c.globalAlpha===1&&this._hasTransparencyChannel()&&c.clearRect(_.x,_.y,w.x,w.y),f({context:c,tile:this,rendered:x});var E,N;this.sourceBounds?(E=Math.min(this.sourceBounds.width,x.canvas.width),N=Math.min(this.sourceBounds.height,x.canvas.height)):(E=x.canvas.width,N=x.canvas.height),c.translate(_.x+w.x/2,0),this.flipped&&c.scale(-1,1),c.drawImage(x.canvas,0,0,E,N,-w.x/2,_.y,w.x,w.y),c.restore()},getScaleForEdgeSmoothing:function(){var c;if(this.cacheImageRecord)c=this.cacheImageRecord.getRenderedContext();else if(this.context2D)c=this.context2D;else return a.console.warn("[Tile.drawCanvas] attempting to get tile scale %s when tile's not cached",this.toString()),1;return c.canvas.width/(this.size.x*a.pixelDensityRatio)},getTranslationForEdgeSmoothing:function(c,f,m){var v=Math.max(1,Math.ceil((m.x-f.x)/2)),_=Math.max(1,Math.ceil((m.y-f.y)/2));return new a.Point(v,_).minus(this.position.times(a.pixelDensityRatio).times(c||1).apply(function(w){return w%1}))},unload:function(){this.imgElement&&this.imgElement.parentNode&&this.imgElement.parentNode.removeChild(this.imgElement),this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=null,this.imgElement=null,this.loaded=!1,this.loading=!1}}}(d),function(a){a.OverlayPlacement=a.Placement,a.OverlayRotationMode=a.freezeObject({NO_ROTATION:1,EXACT:2,BOUNDING_BOX:3}),a.Overlay=function(c,f,m){var v;a.isPlainObject(c)?v=c:v={element:c,location:f,placement:m},this.element=v.element,this.style=v.element.style,this._init(v)},a.Overlay.prototype={_init:function(c){this.location=c.location,this.placement=c.placement===void 0?a.Placement.TOP_LEFT:c.placement,this.onDraw=c.onDraw,this.checkResize=c.checkResize===void 0?!0:c.checkResize,this.width=c.width===void 0?null:c.width,this.height=c.height===void 0?null:c.height,this.rotationMode=c.rotationMode||a.OverlayRotationMode.EXACT,this.location instanceof a.Rect&&(this.width=this.location.width,this.height=this.location.height,this.location=this.location.getTopLeft(),this.placement=a.Placement.TOP_LEFT),this.scales=this.width!==null&&this.height!==null,this.bounds=new a.Rect(this.location.x,this.location.y,this.width,this.height),this.position=this.location},adjust:function(c,f){var m=a.Placement.properties[this.placement];!m||(m.isHorizontallyCentered?c.x-=f.x/2:m.isRight&&(c.x-=f.x),m.isVerticallyCentered?c.y-=f.y/2:m.isBottom&&(c.y-=f.y))},destroy:function(){var c=this.element,f=this.style;c.parentNode&&(c.parentNode.removeChild(c),c.prevElementParent&&(f.display="none",document.body.appendChild(c))),this.onDraw=null,f.top="",f.left="",f.position="",this.width!==null&&(f.width=""),this.height!==null&&(f.height="");var m=a.getCssPropertyWithVendorPrefix("transformOrigin"),v=a.getCssPropertyWithVendorPrefix("transform");m&&v&&(f[m]="",f[v]="")},drawHTML:function(c,f){var m=this.element;m.parentNode!==c&&(m.prevElementParent=m.parentNode,m.prevNextSibling=m.nextSibling,c.appendChild(m),this.style.position="absolute",this.size=a.getElementSize(m));var v=this._getOverlayPositionAndSize(f),_=v.position,w=this.size=v.size,x=v.rotate;if(this.onDraw)this.onDraw(_,w,this.element);else{var E=this.style;E.left=_.x+"px",E.top=_.y+"px",this.width!==null&&(E.width=w.x+"px"),this.height!==null&&(E.height=w.y+"px");var N=a.getCssPropertyWithVendorPrefix("transformOrigin"),H=a.getCssPropertyWithVendorPrefix("transform");N&&H&&(x?(E[N]=this._getTransformOrigin(),E[H]="rotate("+x+"deg)"):(E[N]="",E[H]="")),E.display="block"}},_getOverlayPositionAndSize:function(c){var f=c.pixelFromPoint(this.location,!0),m=this._getSizeInPixels(c);this.adjust(f,m);var v=0;if(c.degrees&&this.rotationMode!==a.OverlayRotationMode.NO_ROTATION)if(this.rotationMode===a.OverlayRotationMode.BOUNDING_BOX&&this.width!==null&&this.height!==null){var _=new a.Rect(f.x,f.y,m.x,m.y),w=this._getBoundingBox(_,c.degrees);f=w.getTopLeft(),m=w.getSize()}else v=c.degrees;return{position:f,size:m,rotate:v}},_getSizeInPixels:function(c){var f=this.size.x,m=this.size.y;if(this.width!==null||this.height!==null){var v=c.deltaPixelsFromPointsNoRotate(new a.Point(this.width||0,this.height||0),!0);this.width!==null&&(f=v.x),this.height!==null&&(m=v.y)}if(this.checkResize&&(this.width===null||this.height===null)){var _=this.size=a.getElementSize(this.element);this.width===null&&(f=_.x),this.height===null&&(m=_.y)}return new a.Point(f,m)},_getBoundingBox:function(c,f){var m=this._getPlacementPoint(c);return c.rotate(f,m).getBoundingBox()},_getPlacementPoint:function(c){var f=new a.Point(c.x,c.y),m=a.Placement.properties[this.placement];return m&&(m.isHorizontallyCentered?f.x+=c.width/2:m.isRight&&(f.x+=c.width),m.isVerticallyCentered?f.y+=c.height/2:m.isBottom&&(f.y+=c.height)),f},_getTransformOrigin:function(){var c="",f=a.Placement.properties[this.placement];return f&&(f.isLeft?c="left":f.isRight&&(c="right"),f.isTop?c+=" top":f.isBottom&&(c+=" bottom")),c},update:function(c,f){var m=a.isPlainObject(c)?c:{location:c,placement:f};this._init({location:m.location||this.location,placement:m.placement!==void 0?m.placement:this.placement,onDraw:m.onDraw||this.onDraw,checkResize:m.checkResize||this.checkResize,width:m.width!==void 0?m.width:this.width,height:m.height!==void 0?m.height:this.height,rotationMode:m.rotationMode||this.rotationMode})},getBounds:function(c){a.console.assert(c,"A viewport must now be passed to Overlay.getBounds.");var f=this.width,m=this.height;if(f===null||m===null){var v=c.deltaPointsFromPixelsNoRotate(this.size,!0);f===null&&(f=v.x),m===null&&(m=v.y)}var _=this.location.clone();return this.adjust(_,new a.Point(f,m)),this._adjustBoundsForRotation(c,new a.Rect(_.x,_.y,f,m))},_adjustBoundsForRotation:function(c,f){if(!c||c.degrees===0||this.rotationMode===a.OverlayRotationMode.EXACT)return f;if(this.rotationMode===a.OverlayRotationMode.BOUNDING_BOX){if(this.width===null||this.height===null)return f;var m=this._getOverlayPositionAndSize(c);return c.viewerElementToViewportRectangle(new a.Rect(m.position.x,m.position.y,m.size.x,m.size.y))}return f.rotate(-c.degrees,this._getPlacementPoint(f))}}}(d),function(a){a.Drawer=function(c){a.console.assert(c.viewer,"[Drawer] options.viewer is required");var f=arguments;if(a.isPlainObject(c)||(c={source:f[0],viewport:f[1],element:f[2]}),a.console.assert(c.viewport,"[Drawer] options.viewport is required"),a.console.assert(c.element,"[Drawer] options.element is required"),c.source&&a.console.error("[Drawer] options.source is no longer accepted; use TiledImage instead"),this.viewer=c.viewer,this.viewport=c.viewport,this.debugGridColor=typeof c.debugGridColor=="string"?[c.debugGridColor]:c.debugGridColor||a.DEFAULT_SETTINGS.debugGridColor,c.opacity&&a.console.error("[Drawer] options.opacity is no longer accepted; set the opacity on the TiledImage instead"),this.useCanvas=a.supportsCanvas&&(this.viewer?this.viewer.useCanvas:!0),this.container=a.getElement(c.element),this.canvas=a.makeNeutralElement(this.useCanvas?"canvas":"div"),this.context=this.useCanvas?this.canvas.getContext("2d"):null,this.sketchCanvas=null,this.sketchContext=null,this.element=this.container,this.container.dir="ltr",this.useCanvas){var m=this._calculateCanvasSize();this.canvas.width=m.x,this.canvas.height=m.y}this.canvas.style.width="100%",this.canvas.style.height="100%",this.canvas.style.position="absolute",a.setElementOpacity(this.canvas,this.opacity,!0),a.setElementPointerEventsNone(this.canvas),a.setElementTouchActionNone(this.canvas),this.container.style.textAlign="left",this.container.appendChild(this.canvas),this._imageSmoothingEnabled=!0},a.Drawer.prototype={addOverlay:function(c,f,m,v){return a.console.error("drawer.addOverlay is deprecated. Use viewer.addOverlay instead."),this.viewer.addOverlay(c,f,m,v),this},updateOverlay:function(c,f,m){return a.console.error("drawer.updateOverlay is deprecated. Use viewer.updateOverlay instead."),this.viewer.updateOverlay(c,f,m),this},removeOverlay:function(c){return a.console.error("drawer.removeOverlay is deprecated. Use viewer.removeOverlay instead."),this.viewer.removeOverlay(c),this},clearOverlays:function(){return a.console.error("drawer.clearOverlays is deprecated. Use viewer.clearOverlays instead."),this.viewer.clearOverlays(),this},viewportCoordToDrawerCoord:function(c){var f=this.viewport.pixelFromPointNoRotate(c,!0);return new a.Point(f.x*a.pixelDensityRatio,f.y*a.pixelDensityRatio)},clipWithPolygons:function(c,f){if(this.useCanvas){var m=this._getContext(f);m.beginPath(),c.forEach(function(v){v.forEach(function(_,w){m[w===0?"moveTo":"lineTo"](_.x,_.y)})}),m.clip()}},setOpacity:function(c){a.console.error("drawer.setOpacity is deprecated. Use tiledImage.setOpacity instead.");for(var f=this.viewer.world,m=0;mf&&(f=v)}return f},needsUpdate:function(){return a.console.error("[Drawer.needsUpdate] this function is deprecated. Use World.needsDraw instead."),this.viewer.world.needsDraw()},numTilesLoaded:function(){return a.console.error("[Drawer.numTilesLoaded] this function is deprecated. Use TileCache.numTilesLoaded instead."),this.viewer.tileCache.numTilesLoaded()},reset:function(){return a.console.error("[Drawer.reset] this function is deprecated. Use World.resetItems instead."),this.viewer.world.resetItems(),this},update:function(){return a.console.error("[Drawer.update] this function is deprecated. Use Drawer.clear and World.draw instead."),this.clear(),this.viewer.world.draw(),this},canRotate:function(){return this.useCanvas},destroy:function(){this.canvas.width=1,this.canvas.height=1,this.sketchCanvas=null,this.sketchContext=null},clear:function(){if(this.canvas.innerHTML="",this.useCanvas){var c=this._calculateCanvasSize();if((this.canvas.width!==c.x||this.canvas.height!==c.y)&&(this.canvas.width=c.x,this.canvas.height=c.y,this._updateImageSmoothingEnabled(this.context),this.sketchCanvas!==null)){var f=this._calculateSketchCanvasSize();this.sketchCanvas.width=f.x,this.sketchCanvas.height=f.y,this._updateImageSmoothingEnabled(this.sketchContext)}this._clear()}},_clear:function(c,f){if(this.useCanvas){var m=this._getContext(c);if(f)m.clearRect(f.x,f.y,f.width,f.height);else{var v=m.canvas;m.clearRect(0,0,v.width,v.height)}}},viewportToDrawerRectangle:function(c){var f=this.viewport.pixelFromPointNoRotate(c.getTopLeft(),!0),m=this.viewport.deltaPixelsFromPointsNoRotate(c.getSize(),!0);return new a.Rect(f.x*a.pixelDensityRatio,f.y*a.pixelDensityRatio,m.x*a.pixelDensityRatio,m.y*a.pixelDensityRatio)},drawTile:function(c,f,m,v,_){if(a.console.assert(c,"[Drawer.drawTile] tile is required"),a.console.assert(f,"[Drawer.drawTile] drawingHandler is required"),this.useCanvas){var w=this._getContext(m);v=v||1,c.drawCanvas(w,f,v,_)}else c.drawHTML(this.canvas)},_getContext:function(c){var f=this.context;if(c){if(this.sketchCanvas===null){this.sketchCanvas=document.createElement("canvas");var m=this._calculateSketchCanvasSize();if(this.sketchCanvas.width=m.x,this.sketchCanvas.height=m.y,this.sketchContext=this.sketchCanvas.getContext("2d"),this.viewport.getRotation()===0){var v=this;this.viewer.addHandler("rotate",function _(){if(v.viewport.getRotation()!==0){v.viewer.removeHandler("rotate",_);var w=v._calculateSketchCanvasSize();v.sketchCanvas.width=w.x,v.sketchCanvas.height=w.y}})}this._updateImageSmoothingEnabled(this.sketchContext)}f=this.sketchContext}return f},saveContext:function(c){!this.useCanvas||this._getContext(c).save()},restoreContext:function(c){!this.useCanvas||this._getContext(c).restore()},setClip:function(c,f){if(this.useCanvas){var m=this._getContext(f);m.beginPath(),m.rect(c.x,c.y,c.width,c.height),m.clip()}},drawRectangle:function(c,f,m){if(this.useCanvas){var v=this._getContext(m);v.save(),v.fillStyle=f,v.fillRect(c.x,c.y,c.width,c.height),v.restore()}},blendSketch:function(c,f,m,v){var _=c;if(a.isPlainObject(_)||(_={opacity:c,scale:f,translate:m,compositeOperation:v}),!(!this.useCanvas||!this.sketchCanvas)){c=_.opacity,v=_.compositeOperation;var w=_.bounds;if(this.context.save(),this.context.globalAlpha=c,v&&(this.context.globalCompositeOperation=v),w)w.x<0&&(w.width+=w.x,w.x=0),w.x+w.width>this.canvas.width&&(w.width=this.canvas.width-w.x),w.y<0&&(w.height+=w.y,w.y=0),w.y+w.height>this.canvas.height&&(w.height=this.canvas.height-w.y),this.context.drawImage(this.sketchCanvas,w.x,w.y,w.width,w.height,w.x,w.y,w.width,w.height);else{f=_.scale||1,m=_.translate;var x=m instanceof a.Point?m:new a.Point(0,0),E=0,N=0;if(m){var H=this.sketchCanvas.width-this.canvas.width,Y=this.sketchCanvas.height-this.canvas.height;E=Math.round(H/2),N=Math.round(Y/2)}this.context.drawImage(this.sketchCanvas,x.x-E*f,x.y-N*f,(this.canvas.width+2*E)*f,(this.canvas.height+2*N)*f,-E,-N,this.canvas.width+2*E,this.canvas.height+2*N)}this.context.restore()}},drawDebugInfo:function(c,f,m,v){if(this.useCanvas){var _=this.viewer.world.getIndexOfItem(v)%this.debugGridColor.length,w=this.context;w.save(),w.lineWidth=2*a.pixelDensityRatio,w.font="small-caps bold "+13*a.pixelDensityRatio+"px arial",w.strokeStyle=this.debugGridColor[_],w.fillStyle=this.debugGridColor[_],this.viewport.degrees!==0&&this._offsetForRotation({degrees:this.viewport.degrees}),v.getRotation(!0)%360!==0&&this._offsetForRotation({degrees:v.getRotation(!0),point:v.viewport.pixelFromPointNoRotate(v._getRotationPoint(!0),!0)}),v.viewport.degrees===0&&v.getRotation(!0)%360===0&&v._drawer.viewer.viewport.getFlip()&&v._drawer._flip(),w.strokeRect(c.position.x*a.pixelDensityRatio,c.position.y*a.pixelDensityRatio,c.size.x*a.pixelDensityRatio,c.size.y*a.pixelDensityRatio);var x=(c.position.x+c.size.x/2)*a.pixelDensityRatio,E=(c.position.y+c.size.y/2)*a.pixelDensityRatio;w.translate(x,E),w.rotate(Math.PI/180*-this.viewport.degrees),w.translate(-x,-E),c.x===0&&c.y===0&&(w.fillText("Zoom: "+this.viewport.getZoom(),c.position.x*a.pixelDensityRatio,(c.position.y-30)*a.pixelDensityRatio),w.fillText("Pan: "+this.viewport.getBounds().toString(),c.position.x*a.pixelDensityRatio,(c.position.y-20)*a.pixelDensityRatio)),w.fillText("Level: "+c.level,(c.position.x+10)*a.pixelDensityRatio,(c.position.y+20)*a.pixelDensityRatio),w.fillText("Column: "+c.x,(c.position.x+10)*a.pixelDensityRatio,(c.position.y+30)*a.pixelDensityRatio),w.fillText("Row: "+c.y,(c.position.x+10)*a.pixelDensityRatio,(c.position.y+40)*a.pixelDensityRatio),w.fillText("Order: "+m+" of "+f,(c.position.x+10)*a.pixelDensityRatio,(c.position.y+50)*a.pixelDensityRatio),w.fillText("Size: "+c.size.toString(),(c.position.x+10)*a.pixelDensityRatio,(c.position.y+60)*a.pixelDensityRatio),w.fillText("Position: "+c.position.toString(),(c.position.x+10)*a.pixelDensityRatio,(c.position.y+70)*a.pixelDensityRatio),this.viewport.degrees!==0&&this._restoreRotationChanges(),v.getRotation(!0)%360!==0&&this._restoreRotationChanges(),v.viewport.degrees===0&&v.getRotation(!0)%360===0&&v._drawer.viewer.viewport.getFlip()&&v._drawer._flip(),w.restore()}},debugRect:function(c){if(this.useCanvas){var f=this.context;f.save(),f.lineWidth=2*a.pixelDensityRatio,f.strokeStyle=this.debugGridColor[0],f.fillStyle=this.debugGridColor[0],f.strokeRect(c.x*a.pixelDensityRatio,c.y*a.pixelDensityRatio,c.width*a.pixelDensityRatio,c.height*a.pixelDensityRatio),f.restore()}},setImageSmoothingEnabled:function(c){this.useCanvas&&(this._imageSmoothingEnabled=c,this._updateImageSmoothingEnabled(this.context),this.viewer.forceRedraw())},_updateImageSmoothingEnabled:function(c){c.msImageSmoothingEnabled=this._imageSmoothingEnabled,c.imageSmoothingEnabled=this._imageSmoothingEnabled},getCanvasSize:function(c){var f=this._getContext(c).canvas;return new a.Point(f.width,f.height)},getCanvasCenter:function(){return new a.Point(this.canvas.width/2,this.canvas.height/2)},_offsetForRotation:function(c){var f=c.point?c.point.times(a.pixelDensityRatio):this.getCanvasCenter(),m=this._getContext(c.useSketch);m.save(),m.translate(f.x,f.y),this.viewer.viewport.flipped?(m.rotate(Math.PI/180*-c.degrees),m.scale(-1,1)):m.rotate(Math.PI/180*c.degrees),m.translate(-f.x,-f.y)},_flip:function(c){c=c||{};var f=c.point?c.point.times(a.pixelDensityRatio):this.getCanvasCenter(),m=this._getContext(c.useSketch);m.translate(f.x,0),m.scale(-1,1),m.translate(-f.x,0)},_restoreRotationChanges:function(c){var f=this._getContext(c);f.restore()},_calculateCanvasSize:function(){var c=a.pixelDensityRatio,f=this.viewport.getContainerSize();return{x:Math.round(f.x*c),y:Math.round(f.y*c)}},_calculateSketchCanvasSize:function(){var c=this._calculateCanvasSize();if(this.viewport.getRotation()===0)return c;var f=Math.ceil(Math.sqrt(c.x*c.x+c.y*c.y));return{x:f,y:f}}}}(d),function(a){a.Viewport=function(c){var f=arguments;f.length&&f[0]instanceof a.Point&&(c={containerSize:f[0],contentSize:f[1],config:f[2]}),c.config&&(a.extend(!0,c,c.config),delete c.config),this._margins=a.extend({left:0,top:0,right:0,bottom:0},c.margins||{}),delete c.margins,a.extend(!0,this,{containerSize:null,contentSize:null,zoomPoint:null,viewer:null,springStiffness:a.DEFAULT_SETTINGS.springStiffness,animationTime:a.DEFAULT_SETTINGS.animationTime,minZoomImageRatio:a.DEFAULT_SETTINGS.minZoomImageRatio,maxZoomPixelRatio:a.DEFAULT_SETTINGS.maxZoomPixelRatio,visibilityRatio:a.DEFAULT_SETTINGS.visibilityRatio,wrapHorizontal:a.DEFAULT_SETTINGS.wrapHorizontal,wrapVertical:a.DEFAULT_SETTINGS.wrapVertical,defaultZoomLevel:a.DEFAULT_SETTINGS.defaultZoomLevel,minZoomLevel:a.DEFAULT_SETTINGS.minZoomLevel,maxZoomLevel:a.DEFAULT_SETTINGS.maxZoomLevel,degrees:a.DEFAULT_SETTINGS.degrees,flipped:a.DEFAULT_SETTINGS.flipped,homeFillsViewer:a.DEFAULT_SETTINGS.homeFillsViewer},c),this._updateContainerInnerSize(),this.centerSpringX=new a.Spring({initial:0,springStiffness:this.springStiffness,animationTime:this.animationTime}),this.centerSpringY=new a.Spring({initial:0,springStiffness:this.springStiffness,animationTime:this.animationTime}),this.zoomSpring=new a.Spring({exponential:!0,initial:1,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._oldCenterX=this.centerSpringX.current.value,this._oldCenterY=this.centerSpringY.current.value,this._oldZoom=this.zoomSpring.current.value,this._setContentBounds(new a.Rect(0,0,1,1),1),this.goHome(!0),this.update()},a.Viewport.prototype={resetContentSize:function(c){return a.console.assert(c,"[Viewport.resetContentSize] contentSize is required"),a.console.assert(c instanceof a.Point,"[Viewport.resetContentSize] contentSize must be an OpenSeadragon.Point"),a.console.assert(c.x>0,"[Viewport.resetContentSize] contentSize.x must be greater than 0"),a.console.assert(c.y>0,"[Viewport.resetContentSize] contentSize.y must be greater than 0"),this._setContentBounds(new a.Rect(0,0,1,c.y/c.x),c.x),this},setHomeBounds:function(c,f){a.console.error("[Viewport.setHomeBounds] this function is deprecated; The content bounds should not be set manually."),this._setContentBounds(c,f)},_setContentBounds:function(c,f){a.console.assert(c,"[Viewport._setContentBounds] bounds is required"),a.console.assert(c instanceof a.Rect,"[Viewport._setContentBounds] bounds must be an OpenSeadragon.Rect"),a.console.assert(c.width>0,"[Viewport._setContentBounds] bounds.width must be greater than 0"),a.console.assert(c.height>0,"[Viewport._setContentBounds] bounds.height must be greater than 0"),this._contentBoundsNoRotate=c.clone(),this._contentSizeNoRotate=this._contentBoundsNoRotate.getSize().times(f),this._contentBounds=c.rotate(this.degrees).getBoundingBox(),this._contentSize=this._contentBounds.getSize().times(f),this._contentAspectRatio=this._contentSize.x/this._contentSize.y,this.viewer&&this.viewer.raiseEvent("reset-size",{contentSize:this._contentSizeNoRotate.clone(),contentFactor:f,homeBounds:this._contentBoundsNoRotate.clone(),contentBounds:this._contentBounds.clone()})},getHomeZoom:function(){if(this.defaultZoomLevel)return this.defaultZoomLevel;var c=this._contentAspectRatio/this.getAspectRatio(),f;return this.homeFillsViewer?f=c>=1?c:1:f=c>=1?1:c,f/this._contentBounds.width},getHomeBounds:function(){return this.getHomeBoundsNoRotate().rotate(-this.getRotation())},getHomeBoundsNoRotate:function(){var c=this._contentBounds.getCenter(),f=1/this.getHomeZoom(),m=f/this.getAspectRatio();return new a.Rect(c.x-f/2,c.y-m/2,f,m)},goHome:function(c){return this.viewer&&this.viewer.raiseEvent("home",{immediately:c}),this.fitBounds(this.getHomeBounds(),c)},getMinZoom:function(){var c=this.getHomeZoom(),f=this.minZoomLevel?this.minZoomLevel:this.minZoomImageRatio*c;return f},getMaxZoom:function(){var c=this.maxZoomLevel;return c||(c=this._contentSize.x*this.maxZoomPixelRatio/this._containerInnerSize.x,c/=this._contentBounds.width),Math.max(c,this.getHomeZoom())},getAspectRatio:function(){return this._containerInnerSize.x/this._containerInnerSize.y},getContainerSize:function(){return new a.Point(this.containerSize.x,this.containerSize.y)},getMargins:function(){return a.extend({},this._margins)},setMargins:function(c){a.console.assert(a.type(c)==="object","[Viewport.setMargins] margins must be an object"),this._margins=a.extend({left:0,top:0,right:0,bottom:0},c),this._updateContainerInnerSize(),this.viewer&&this.viewer.forceRedraw()},getBounds:function(c){return this.getBoundsNoRotate(c).rotate(-this.getRotation())},getBoundsNoRotate:function(c){var f=this.getCenter(c),m=1/this.getZoom(c),v=m/this.getAspectRatio();return new a.Rect(f.x-m/2,f.y-v/2,m,v)},getBoundsWithMargins:function(c){return this.getBoundsNoRotateWithMargins(c).rotate(-this.getRotation(),this.getCenter(c))},getBoundsNoRotateWithMargins:function(c){var f=this.getBoundsNoRotate(c),m=this._containerInnerSize.x*this.getZoom(c);return f.x-=this._margins.left/m,f.y-=this._margins.top/m,f.width+=(this._margins.left+this._margins.right)/m,f.height+=(this._margins.top+this._margins.bottom)/m,f},getCenter:function(c){var f=new a.Point(this.centerSpringX.current.value,this.centerSpringY.current.value),m=new a.Point(this.centerSpringX.target.value,this.centerSpringY.target.value),v,_,w,x,E,N,H,Y;return c?f:this.zoomPoint?(v=this.pixelFromPoint(this.zoomPoint,!0),_=this.getZoom(),w=1/_,x=w/this.getAspectRatio(),E=new a.Rect(f.x-w/2,f.y-x/2,w,x),N=this._pixelFromPoint(this.zoomPoint,E),H=N.minus(v),Y=H.divide(this._containerInnerSize.x*_),m.plus(Y)):m},getZoom:function(c){return c?this.zoomSpring.current.value:this.zoomSpring.target.value},_applyZoomConstraints:function(c){return Math.max(Math.min(c,this.getMaxZoom()),this.getMinZoom())},_applyBoundaryConstraints:function(c){var f=new a.Rect(c.x,c.y,c.width,c.height);if(!this.wrapHorizontal){var m=this.visibilityRatio*f.width,v=f.x+f.width,_=this._contentBoundsNoRotate.x+this._contentBoundsNoRotate.width,w=this._contentBoundsNoRotate.x-v+m,x=_-f.x-m;m>this._contentBoundsNoRotate.width?f.x+=(w+x)/2:x<0?f.x+=x:w>0&&(f.x+=w)}if(!this.wrapVertical){var E=this.visibilityRatio*f.height,N=f.y+f.height,H=this._contentBoundsNoRotate.y+this._contentBoundsNoRotate.height,Y=this._contentBoundsNoRotate.y-N+E,ee=H-f.y-E;E>this._contentBoundsNoRotate.height?f.y+=(Y+ee)/2:ee<0?f.y+=ee:Y>0&&(f.y+=Y)}return f},_raiseConstraintsEvent:function(c){this.viewer&&this.viewer.raiseEvent("constrain",{immediately:c})},applyConstraints:function(c){var f=this.getZoom(),m=this._applyZoomConstraints(f);f!==m&&this.zoomTo(m,this.zoomPoint,c);var v=this.getBoundsNoRotate(),_=this._applyBoundaryConstraints(v);return this._raiseConstraintsEvent(c),(v.x!==_.x||v.y!==_.y||c)&&this.fitBounds(_.rotate(-this.getRotation()),c),this},ensureVisible:function(c){return this.applyConstraints(c)},_fitBounds:function(c,f){f=f||{};var m=f.immediately||!1,v=f.constraints||!1,_=this.getAspectRatio(),w=c.getCenter(),x=new a.Rect(c.x,c.y,c.width,c.height,c.degrees+this.getRotation()).getBoundingBox();x.getAspectRatio()>=_?x.height=x.width/_:x.width=x.height*_,x.x=w.x-x.width/2,x.y=w.y-x.height/2;var E=1/x.width;if(v){var N=x.getAspectRatio(),H=this._applyZoomConstraints(E);E!==H&&(E=H,x.width=1/E,x.x=w.x-x.width/2,x.height=x.width/N,x.y=w.y-x.height/2),x=this._applyBoundaryConstraints(x),w=x.getCenter(),this._raiseConstraintsEvent(m)}if(m)return this.panTo(w,!0),this.zoomTo(E,null,!0);this.panTo(this.getCenter(!0),!0),this.zoomTo(this.getZoom(!0),null,!0);var Y=this.getBounds(),ee=this.getZoom();if(ee===0||Math.abs(E/ee-1)<1e-8)return this.zoomTo(E,!0),this.panTo(w,m);x=x.rotate(-this.getRotation());var be=x.getTopLeft().times(E).minus(Y.getTopLeft().times(ee)).divide(E-ee);return this.zoomTo(E,be,m)},fitBounds:function(c,f){return this._fitBounds(c,{immediately:f,constraints:!1})},fitBoundsWithConstraints:function(c,f){return this._fitBounds(c,{immediately:f,constraints:!0})},fitVertically:function(c){var f=new a.Rect(this._contentBounds.x+this._contentBounds.width/2,this._contentBounds.y,0,this._contentBounds.height);return this.fitBounds(f,c)},fitHorizontally:function(c){var f=new a.Rect(this._contentBounds.x,this._contentBounds.y+this._contentBounds.height/2,this._contentBounds.width,0);return this.fitBounds(f,c)},getConstrainedBounds:function(c){var f,m;return f=this.getBounds(c),m=this._applyBoundaryConstraints(f),m},panBy:function(c,f){var m=new a.Point(this.centerSpringX.target.value,this.centerSpringY.target.value);return this.panTo(m.plus(c),f)},panTo:function(c,f){return f?(this.centerSpringX.resetTo(c.x),this.centerSpringY.resetTo(c.y)):(this.centerSpringX.springTo(c.x),this.centerSpringY.springTo(c.y)),this.viewer&&this.viewer.raiseEvent("pan",{center:c,immediately:f}),this},zoomBy:function(c,f,m){return this.zoomTo(this.zoomSpring.target.value*c,f,m)},zoomTo:function(c,f,m){var v=this;return this.zoomPoint=f instanceof a.Point&&!isNaN(f.x)&&!isNaN(f.y)?f:null,m?this._adjustCenterSpringsForZoomPoint(function(){v.zoomSpring.resetTo(c)}):this.zoomSpring.springTo(c),this.viewer&&this.viewer.raiseEvent("zoom",{zoom:c,refPoint:f,immediately:m}),this},setRotation:function(c){return!this.viewer||!this.viewer.drawer.canRotate()?this:(this.degrees=a.positiveModulo(c,360),this._setContentBounds(this.viewer.world.getHomeBounds(),this.viewer.world.getContentFactor()),this.viewer.forceRedraw(),this.viewer.raiseEvent("rotate",{degrees:c}),this)},getRotation:function(){return this.degrees},resize:function(c,f){var m=this.getBoundsNoRotate(),v=m,_;return this.containerSize.x=c.x,this.containerSize.y=c.y,this._updateContainerInnerSize(),f&&(_=c.x/this.containerSize.x,v.width=m.width*_,v.height=v.width/this.getAspectRatio()),this.viewer&&this.viewer.raiseEvent("resize",{newContainerSize:c,maintain:f}),this.fitBounds(v,!0)},_updateContainerInnerSize:function(){this._containerInnerSize=new a.Point(Math.max(1,this.containerSize.x-(this._margins.left+this._margins.right)),Math.max(1,this.containerSize.y-(this._margins.top+this._margins.bottom)))},update:function(){var c=this;this._adjustCenterSpringsForZoomPoint(function(){c.zoomSpring.update()}),this.centerSpringX.update(),this.centerSpringY.update();var f=this.centerSpringX.current.value!==this._oldCenterX||this.centerSpringY.current.value!==this._oldCenterY||this.zoomSpring.current.value!==this._oldZoom;return this._oldCenterX=this.centerSpringX.current.value,this._oldCenterY=this.centerSpringY.current.value,this._oldZoom=this.zoomSpring.current.value,f},_adjustCenterSpringsForZoomPoint:function(c){if(this.zoomPoint){var f=this.pixelFromPoint(this.zoomPoint,!0);c();var m=this.pixelFromPoint(this.zoomPoint,!0),v=m.minus(f),_=this.deltaPointsFromPixels(v,!0);this.centerSpringX.shiftBy(_.x),this.centerSpringY.shiftBy(_.y),this.zoomSpring.isAtTargetValue()&&(this.zoomPoint=null)}else c()},deltaPixelsFromPointsNoRotate:function(c,f){return c.times(this._containerInnerSize.x*this.getZoom(f))},deltaPixelsFromPoints:function(c,f){return this.deltaPixelsFromPointsNoRotate(c.rotate(this.getRotation()),f)},deltaPointsFromPixelsNoRotate:function(c,f){return c.divide(this._containerInnerSize.x*this.getZoom(f))},deltaPointsFromPixels:function(c,f){return this.deltaPointsFromPixelsNoRotate(c,f).rotate(-this.getRotation())},pixelFromPointNoRotate:function(c,f){return this._pixelFromPointNoRotate(c,this.getBoundsNoRotate(f))},pixelFromPoint:function(c,f){return this._pixelFromPoint(c,this.getBoundsNoRotate(f))},_pixelFromPointNoRotate:function(c,f){return c.minus(f.getTopLeft()).times(this._containerInnerSize.x/f.width).plus(new a.Point(this._margins.left,this._margins.top))},_pixelFromPoint:function(c,f){return this._pixelFromPointNoRotate(c.rotate(this.getRotation(),this.getCenter(!0)),f)},pointFromPixelNoRotate:function(c,f){var m=this.getBoundsNoRotate(f);return c.minus(new a.Point(this._margins.left,this._margins.top)).divide(this._containerInnerSize.x/m.width).plus(m.getTopLeft())},pointFromPixel:function(c,f){return this.pointFromPixelNoRotate(c,f).rotate(-this.getRotation(),this.getCenter(!0))},_viewportToImageDelta:function(c,f){var m=this._contentBoundsNoRotate.width;return new a.Point(c*this._contentSizeNoRotate.x/m,f*this._contentSizeNoRotate.x/m)},viewportToImageCoordinates:function(c,f){if(c instanceof a.Point)return this.viewportToImageCoordinates(c.x,c.y);if(this.viewer){var m=this.viewer.world.getItemCount();if(m>1)a.console.error("[Viewport.viewportToImageCoordinates] is not accurate with multi-image; use TiledImage.viewportToImageCoordinates instead.");else if(m===1){var v=this.viewer.world.getItemAt(0);return v.viewportToImageCoordinates(c,f,!0)}}return this._viewportToImageDelta(c-this._contentBoundsNoRotate.x,f-this._contentBoundsNoRotate.y)},_imageToViewportDelta:function(c,f){var m=this._contentBoundsNoRotate.width;return new a.Point(c/this._contentSizeNoRotate.x*m,f/this._contentSizeNoRotate.x*m)},imageToViewportCoordinates:function(c,f){if(c instanceof a.Point)return this.imageToViewportCoordinates(c.x,c.y);if(this.viewer){var m=this.viewer.world.getItemCount();if(m>1)a.console.error("[Viewport.imageToViewportCoordinates] is not accurate with multi-image; use TiledImage.imageToViewportCoordinates instead.");else if(m===1){var v=this.viewer.world.getItemAt(0);return v.imageToViewportCoordinates(c,f,!0)}}var _=this._imageToViewportDelta(c,f);return _.x+=this._contentBoundsNoRotate.x,_.y+=this._contentBoundsNoRotate.y,_},imageToViewportRectangle:function(c,f,m,v){var _=c;if(_ instanceof a.Rect||(_=new a.Rect(c,f,m,v)),this.viewer){var w=this.viewer.world.getItemCount();if(w>1)a.console.error("[Viewport.imageToViewportRectangle] is not accurate with multi-image; use TiledImage.imageToViewportRectangle instead.");else if(w===1){var x=this.viewer.world.getItemAt(0);return x.imageToViewportRectangle(c,f,m,v,!0)}}var E=this.imageToViewportCoordinates(_.x,_.y),N=this._imageToViewportDelta(_.width,_.height);return new a.Rect(E.x,E.y,N.x,N.y,_.degrees)},viewportToImageRectangle:function(c,f,m,v){var _=c;if(_ instanceof a.Rect||(_=new a.Rect(c,f,m,v)),this.viewer){var w=this.viewer.world.getItemCount();if(w>1)a.console.error("[Viewport.viewportToImageRectangle] is not accurate with multi-image; use TiledImage.viewportToImageRectangle instead.");else if(w===1){var x=this.viewer.world.getItemAt(0);return x.viewportToImageRectangle(c,f,m,v,!0)}}var E=this.viewportToImageCoordinates(_.x,_.y),N=this._viewportToImageDelta(_.width,_.height);return new a.Rect(E.x,E.y,N.x,N.y,_.degrees)},viewerElementToImageCoordinates:function(c){var f=this.pointFromPixel(c,!0);return this.viewportToImageCoordinates(f)},imageToViewerElementCoordinates:function(c){var f=this.imageToViewportCoordinates(c);return this.pixelFromPoint(f,!0)},windowToImageCoordinates:function(c){a.console.assert(this.viewer,"[Viewport.windowToImageCoordinates] the viewport must have a viewer.");var f=c.minus(a.getElementPosition(this.viewer.element));return this.viewerElementToImageCoordinates(f)},imageToWindowCoordinates:function(c){a.console.assert(this.viewer,"[Viewport.imageToWindowCoordinates] the viewport must have a viewer.");var f=this.imageToViewerElementCoordinates(c);return f.plus(a.getElementPosition(this.viewer.element))},viewerElementToViewportCoordinates:function(c){return this.pointFromPixel(c,!0)},viewportToViewerElementCoordinates:function(c){return this.pixelFromPoint(c,!0)},viewerElementToViewportRectangle:function(c){return a.Rect.fromSummits(this.pointFromPixel(c.getTopLeft(),!0),this.pointFromPixel(c.getTopRight(),!0),this.pointFromPixel(c.getBottomLeft(),!0))},viewportToViewerElementRectangle:function(c){return a.Rect.fromSummits(this.pixelFromPoint(c.getTopLeft(),!0),this.pixelFromPoint(c.getTopRight(),!0),this.pixelFromPoint(c.getBottomLeft(),!0))},windowToViewportCoordinates:function(c){a.console.assert(this.viewer,"[Viewport.windowToViewportCoordinates] the viewport must have a viewer.");var f=c.minus(a.getElementPosition(this.viewer.element));return this.viewerElementToViewportCoordinates(f)},viewportToWindowCoordinates:function(c){a.console.assert(this.viewer,"[Viewport.viewportToWindowCoordinates] the viewport must have a viewer.");var f=this.viewportToViewerElementCoordinates(c);return f.plus(a.getElementPosition(this.viewer.element))},viewportToImageZoom:function(c){if(this.viewer){var f=this.viewer.world.getItemCount();if(f>1)a.console.error("[Viewport.viewportToImageZoom] is not accurate with multi-image.");else if(f===1){var m=this.viewer.world.getItemAt(0);return m.viewportToImageZoom(c)}}var v=this._contentSizeNoRotate.x,_=this._containerInnerSize.x,w=this._contentBoundsNoRotate.width,x=_/v*w;return c*x},imageToViewportZoom:function(c){if(this.viewer){var f=this.viewer.world.getItemCount();if(f>1)a.console.error("[Viewport.imageToViewportZoom] is not accurate with multi-image.");else if(f===1){var m=this.viewer.world.getItemAt(0);return m.imageToViewportZoom(c)}}var v=this._contentSizeNoRotate.x,_=this._containerInnerSize.x,w=this._contentBoundsNoRotate.width,x=v/_/w;return c*x},toggleFlip:function(){return this.setFlip(!this.getFlip()),this},getFlip:function(){return this.flipped},setFlip:function(c){return this.flipped===c?this:(this.flipped=c,this.viewer.navigator&&this.viewer.navigator.setFlip(this.getFlip()),this.viewer.forceRedraw(),this.viewer.raiseEvent("flip",{flipped:c}),this)}}}(d),function(a){a.TiledImage=function(U){var ce=this;a.console.assert(U.tileCache,"[TiledImage] options.tileCache is required"),a.console.assert(U.drawer,"[TiledImage] options.drawer is required"),a.console.assert(U.viewer,"[TiledImage] options.viewer is required"),a.console.assert(U.imageLoader,"[TiledImage] options.imageLoader is required"),a.console.assert(U.source,"[TiledImage] options.source is required"),a.console.assert(!U.clip||U.clip instanceof a.Rect,"[TiledImage] options.clip must be an OpenSeadragon.Rect if present"),a.EventSource.call(this),this._tileCache=U.tileCache,delete U.tileCache,this._drawer=U.drawer,delete U.drawer,this._imageLoader=U.imageLoader,delete U.imageLoader,U.clip instanceof a.Rect&&(this._clip=U.clip.clone()),delete U.clip;var Pe=U.x||0;delete U.x;var Ae=U.y||0;delete U.y,this.normHeight=U.source.dimensions.y/U.source.dimensions.x,this.contentAspectX=U.source.dimensions.x/U.source.dimensions.y;var Ne=1;U.width?(Ne=U.width,delete U.width,U.height&&(a.console.error("specifying both width and height to a tiledImage is not supported"),delete U.height)):U.height&&(Ne=U.height/this.normHeight,delete U.height);var Fe=U.fitBounds;delete U.fitBounds;var lt=U.fitBoundsPlacement||d.Placement.CENTER;delete U.fitBoundsPlacement;var ht=U.degrees||0;delete U.degrees,a.extend(!0,this,{viewer:null,tilesMatrix:{},coverage:{},loadingCoverage:{},lastDrawn:[],lastResetTime:0,_midDraw:!1,_needsDraw:!0,_hasOpaqueTile:!1,_tilesLoading:0,springStiffness:a.DEFAULT_SETTINGS.springStiffness,animationTime:a.DEFAULT_SETTINGS.animationTime,minZoomImageRatio:a.DEFAULT_SETTINGS.minZoomImageRatio,wrapHorizontal:a.DEFAULT_SETTINGS.wrapHorizontal,wrapVertical:a.DEFAULT_SETTINGS.wrapVertical,immediateRender:a.DEFAULT_SETTINGS.immediateRender,blendTime:a.DEFAULT_SETTINGS.blendTime,alwaysBlend:a.DEFAULT_SETTINGS.alwaysBlend,minPixelRatio:a.DEFAULT_SETTINGS.minPixelRatio,smoothTileEdgesMinZoom:a.DEFAULT_SETTINGS.smoothTileEdgesMinZoom,iOSDevice:a.DEFAULT_SETTINGS.iOSDevice,debugMode:a.DEFAULT_SETTINGS.debugMode,crossOriginPolicy:a.DEFAULT_SETTINGS.crossOriginPolicy,ajaxWithCredentials:a.DEFAULT_SETTINGS.ajaxWithCredentials,placeholderFillStyle:a.DEFAULT_SETTINGS.placeholderFillStyle,opacity:a.DEFAULT_SETTINGS.opacity,preload:a.DEFAULT_SETTINGS.preload,compositeOperation:a.DEFAULT_SETTINGS.compositeOperation},U),this._preload=this.preload,delete this.preload,this._fullyLoaded=!1,this._xSpring=new a.Spring({initial:Pe,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._ySpring=new a.Spring({initial:Ae,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._scaleSpring=new a.Spring({initial:Ne,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._degreesSpring=new a.Spring({initial:ht,springStiffness:this.springStiffness,animationTime:this.animationTime}),this._updateForScale(),Fe&&this.fitBounds(Fe,lt,!0),this._drawingHandler=function(At){ce.viewer.raiseEvent("tile-drawing",a.extend({tiledImage:ce},At))}},a.extend(a.TiledImage.prototype,a.EventSource.prototype,{needsDraw:function(){return this._needsDraw},getFullyLoaded:function(){return this._fullyLoaded},_setFullyLoaded:function(U){U!==this._fullyLoaded&&(this._fullyLoaded=U,this.raiseEvent("fully-loaded-change",{fullyLoaded:this._fullyLoaded}))},reset:function(){this._tileCache.clearTilesFor(this),this.lastResetTime=a.now(),this._needsDraw=!0},update:function(){var U=this._xSpring.update(),ce=this._ySpring.update(),Pe=this._scaleSpring.update(),Ae=this._degreesSpring.update();return U||ce||Pe||Ae?(this._updateForScale(),this._needsDraw=!0,!0):!1},draw:function(){this.opacity!==0||this._preload?(this._midDraw=!0,this._updateViewport(),this._midDraw=!1):this._needsDraw=!1},destroy:function(){this.reset(),this.source.destroy&&this.source.destroy()},getBounds:function(U){return this.getBoundsNoRotate(U).rotate(this.getRotation(U),this._getRotationPoint(U))},getBoundsNoRotate:function(U){return U?new a.Rect(this._xSpring.current.value,this._ySpring.current.value,this._worldWidthCurrent,this._worldHeightCurrent):new a.Rect(this._xSpring.target.value,this._ySpring.target.value,this._worldWidthTarget,this._worldHeightTarget)},getWorldBounds:function(){return a.console.error("[TiledImage.getWorldBounds] is deprecated; use TiledImage.getBounds instead"),this.getBounds()},getClippedBounds:function(U){var ce=this.getBoundsNoRotate(U);if(this._clip){var Pe=U?this._worldWidthCurrent:this._worldWidthTarget,Ae=Pe/this.source.dimensions.x,Ne=this._clip.times(Ae);ce=new a.Rect(ce.x+Ne.x,ce.y+Ne.y,Ne.width,Ne.height)}return ce.rotate(this.getRotation(U),this._getRotationPoint(U))},getTileBounds:function(U,ce,Pe){var Ae=this.source.getNumTiles(U),Ne=(Ae.x+ce%Ae.x)%Ae.x,Fe=(Ae.y+Pe%Ae.y)%Ae.y,lt=this.source.getTileBounds(U,Ne,Fe);return this.getFlip()&&(lt.x=1-lt.x-lt.width),lt.x+=(ce-Ne)/Ae.x,lt.y+=this._worldHeightCurrent/this._worldWidthCurrent*((Pe-Fe)/Ae.y),lt},getContentSize:function(){return new a.Point(this.source.dimensions.x,this.source.dimensions.y)},getSizeInWindowCoordinates:function(){var U=this.imageToWindowCoordinates(new a.Point(0,0)),ce=this.imageToWindowCoordinates(this.getContentSize());return new a.Point(ce.x-U.x,ce.y-U.y)},_viewportToImageDelta:function(U,ce,Pe){var Ae=Pe?this._scaleSpring.current.value:this._scaleSpring.target.value;return new a.Point(U*(this.source.dimensions.x/Ae),ce*(this.source.dimensions.y*this.contentAspectX/Ae))},viewportToImageCoordinates:function(U,ce,Pe){var Ae;return U instanceof a.Point?(Pe=ce,Ae=U):Ae=new a.Point(U,ce),Ae=Ae.rotate(-this.getRotation(Pe),this._getRotationPoint(Pe)),Pe?this._viewportToImageDelta(Ae.x-this._xSpring.current.value,Ae.y-this._ySpring.current.value):this._viewportToImageDelta(Ae.x-this._xSpring.target.value,Ae.y-this._ySpring.target.value)},_imageToViewportDelta:function(U,ce,Pe){var Ae=Pe?this._scaleSpring.current.value:this._scaleSpring.target.value;return new a.Point(U/this.source.dimensions.x*Ae,ce/this.source.dimensions.y/this.contentAspectX*Ae)},imageToViewportCoordinates:function(U,ce,Pe){U instanceof a.Point&&(Pe=ce,ce=U.y,U=U.x);var Ae=this._imageToViewportDelta(U,ce);return Pe?(Ae.x+=this._xSpring.current.value,Ae.y+=this._ySpring.current.value):(Ae.x+=this._xSpring.target.value,Ae.y+=this._ySpring.target.value),Ae.rotate(this.getRotation(Pe),this._getRotationPoint(Pe))},imageToViewportRectangle:function(U,ce,Pe,Ae,Ne){var Fe=U;Fe instanceof a.Rect?Ne=ce:Fe=new a.Rect(U,ce,Pe,Ae);var lt=this.imageToViewportCoordinates(Fe.getTopLeft(),Ne),ht=this._imageToViewportDelta(Fe.width,Fe.height,Ne);return new a.Rect(lt.x,lt.y,ht.x,ht.y,Fe.degrees+this.getRotation(Ne))},viewportToImageRectangle:function(U,ce,Pe,Ae,Ne){var Fe=U;U instanceof a.Rect?Ne=ce:Fe=new a.Rect(U,ce,Pe,Ae);var lt=this.viewportToImageCoordinates(Fe.getTopLeft(),Ne),ht=this._viewportToImageDelta(Fe.width,Fe.height,Ne);return new a.Rect(lt.x,lt.y,ht.x,ht.y,Fe.degrees-this.getRotation(Ne))},viewerElementToImageCoordinates:function(U){var ce=this.viewport.pointFromPixel(U,!0);return this.viewportToImageCoordinates(ce)},imageToViewerElementCoordinates:function(U){var ce=this.imageToViewportCoordinates(U);return this.viewport.pixelFromPoint(ce,!0)},windowToImageCoordinates:function(U){var ce=U.minus(d.getElementPosition(this.viewer.element));return this.viewerElementToImageCoordinates(ce)},imageToWindowCoordinates:function(U){var ce=this.imageToViewerElementCoordinates(U);return ce.plus(d.getElementPosition(this.viewer.element))},_viewportToTiledImageRectangle:function(U){var ce=this._scaleSpring.current.value;return U=U.rotate(-this.getRotation(!0),this._getRotationPoint(!0)),new a.Rect((U.x-this._xSpring.current.value)/ce,(U.y-this._ySpring.current.value)/ce,U.width/ce,U.height/ce,U.degrees)},viewportToImageZoom:function(U){var ce=this._scaleSpring.current.value*this.viewport._containerInnerSize.x/this.source.dimensions.x;return ce*U},imageToViewportZoom:function(U){var ce=this._scaleSpring.current.value*this.viewport._containerInnerSize.x/this.source.dimensions.x;return U/ce},setPosition:function(U,ce){var Pe=this._xSpring.target.value===U.x&&this._ySpring.target.value===U.y;if(ce){if(Pe&&this._xSpring.current.value===U.x&&this._ySpring.current.value===U.y)return;this._xSpring.resetTo(U.x),this._ySpring.resetTo(U.y),this._needsDraw=!0}else{if(Pe)return;this._xSpring.springTo(U.x),this._ySpring.springTo(U.y),this._needsDraw=!0}Pe||this._raiseBoundsChange()},setWidth:function(U,ce){this._setScale(U,ce)},setHeight:function(U,ce){this._setScale(U/this.normHeight,ce)},setCroppingPolygons:function(U){var ce=function(Ae){return Ae instanceof a.Point||typeof Ae.x=="number"&&typeof Ae.y=="number"},Pe=function(Ae){return Ae.map(function(Ne){try{if(ce(Ne))return{x:Ne.x,y:Ne.y};throw new Error}catch{throw new Error("A Provided cropping polygon point is not supported")}})};try{if(!a.isArray(U))throw new Error("Provided cropping polygon is not an array");this._croppingPolygons=U.map(function(Ae){return Pe(Ae)})}catch(Ae){a.console.error("[TiledImage.setCroppingPolygons] Cropping polygon format not supported"),a.console.error(Ae),this._croppingPolygons=null}},resetCroppingPolygons:function(){this._croppingPolygons=null},fitBounds:function(U,ce,Pe){ce=ce||a.Placement.CENTER;var Ae=a.Placement.properties[ce],Ne=this.contentAspectX,Fe=0,lt=0,ht=1,At=1;if(this._clip&&(Ne=this._clip.getAspectRatio(),ht=this._clip.width/this.source.dimensions.x,At=this._clip.height/this.source.dimensions.y,U.getAspectRatio()>Ne?(Fe=this._clip.x/this._clip.height*U.height,lt=this._clip.y/this._clip.height*U.height):(Fe=this._clip.x/this._clip.width*U.width,lt=this._clip.y/this._clip.width*U.width)),U.getAspectRatio()>Ne){var Lt=U.height/At,kt=0;Ae.isHorizontallyCentered?kt=(U.width-U.height*Ne)/2:Ae.isRight&&(kt=U.width-U.height*Ne),this.setPosition(new a.Point(U.x-Fe+kt,U.y-lt),Pe),this.setHeight(Lt,Pe)}else{var Yt=U.width/ht,Xt=0;Ae.isVerticallyCentered?Xt=(U.height-U.width/Ne)/2:Ae.isBottom&&(Xt=U.height-U.width/Ne),this.setPosition(new a.Point(U.x-Fe,U.y-lt+Xt),Pe),this.setWidth(Yt,Pe)}},getClip:function(){return this._clip?this._clip.clone():null},setClip:function(U){a.console.assert(!U||U instanceof a.Rect,"[TiledImage.setClip] newClip must be an OpenSeadragon.Rect or null"),U instanceof a.Rect?this._clip=U.clone():this._clip=null,this._needsDraw=!0,this.raiseEvent("clip-change")},getFlip:function(){return!!this.flipped},setFlip:function(U){this.flipped=!!U,this._needsDraw=!0,this._raiseBoundsChange()},getOpacity:function(){return this.opacity},setOpacity:function(U){U!==this.opacity&&(this.opacity=U,this._needsDraw=!0,this.raiseEvent("opacity-change",{opacity:this.opacity}))},getPreload:function(){return this._preload},setPreload:function(U){this._preload=!!U,this._needsDraw=!0},getRotation:function(U){return U?this._degreesSpring.current.value:this._degreesSpring.target.value},setRotation:function(U,ce){this._degreesSpring.target.value===U&&this._degreesSpring.isAtTargetValue()||(ce?this._degreesSpring.resetTo(U):this._degreesSpring.springTo(U),this._needsDraw=!0,this._raiseBoundsChange())},_getRotationPoint:function(U){return this.getBoundsNoRotate(U).getCenter()},getCompositeOperation:function(){return this.compositeOperation},setCompositeOperation:function(U){U!==this.compositeOperation&&(this.compositeOperation=U,this._needsDraw=!0,this.raiseEvent("composite-operation-change",{compositeOperation:this.compositeOperation}))},_setScale:function(U,ce){var Pe=this._scaleSpring.target.value===U;if(ce){if(Pe&&this._scaleSpring.current.value===U)return;this._scaleSpring.resetTo(U),this._updateForScale(),this._needsDraw=!0}else{if(Pe)return;this._scaleSpring.springTo(U),this._updateForScale(),this._needsDraw=!0}Pe||this._raiseBoundsChange()},_updateForScale:function(){this._worldWidthTarget=this._scaleSpring.target.value,this._worldHeightTarget=this.normHeight*this._scaleSpring.target.value,this._worldWidthCurrent=this._scaleSpring.current.value,this._worldHeightCurrent=this.normHeight*this._scaleSpring.current.value},_raiseBoundsChange:function(){this.raiseEvent("bounds-change")},_isBottomItem:function(){return this.viewer.world.getItemAt(0)===this},_getLevelsInterval:function(){var U=Math.max(this.source.minLevel,Math.floor(Math.log(this.minZoomImageRatio)/Math.log(2))),ce=this.viewport.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(0),!0).x*this._scaleSpring.current.value,Pe=Math.min(Math.abs(this.source.maxLevel),Math.abs(Math.floor(Math.log(ce/this.minPixelRatio)/Math.log(2))));return Pe=Math.max(Pe,this.source.minLevel||0),U=Math.min(U,Pe),{lowestLevel:U,highestLevel:Pe}},_updateViewport:function(){for(this._needsDraw=!1,this._tilesLoading=0,this.loadingCoverage={};this.lastDrawn.length>0;){var U=this.lastDrawn.pop();U.beingDrawn=!1}var ce=this.viewport,Pe=this._viewportToTiledImageRectangle(ce.getBoundsWithMargins(!0));if(!this.wrapHorizontal&&!this.wrapVertical){var Ae=this._viewportToTiledImageRectangle(this.getClippedBounds(!0));if(Pe=Pe.intersection(Ae),Pe===null)return}for(var Ne=this._getLevelsInterval(),Fe=Ne.lowestLevel,lt=Ne.highestLevel,ht=null,At=!1,Lt=a.now(),kt=lt;kt>=Fe;kt--){var Yt=!1,Xt=ce.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(kt),!0).x*this._scaleSpring.current.value;if(kt===Fe||!At&&Xt>=this.minPixelRatio)Yt=!0,At=!0;else if(!At)continue;var di=ce.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(kt),!1).x*this._scaleSpring.current.value,li=ce.deltaPixelsFromPointsNoRotate(this.source.getPixelRatio(Math.max(this.source.getClosestLevel(),0)),!1).x*this._scaleSpring.current.value,Fi=this.immediateRender?1:li,zi=Math.min(1,(Xt-.5)/.5),Tn=Fi/Math.abs(Fi-di);if(ht=c(this,At,Yt,kt,zi,Tn,Pe,Lt,ht),N(this.coverage,kt))break}me(this,this.lastDrawn),ht&&!ht.context2D?(v(this,ht,Lt),this._needsDraw=!0,this._setFullyLoaded(!1)):this._setFullyLoaded(this._tilesLoading===0)},_getCornerTiles:function(U,ce,Pe){var Ae,Ne;this.wrapHorizontal?(Ae=a.positiveModulo(ce.x,1),Ne=a.positiveModulo(Pe.x,1)):(Ae=Math.max(0,ce.x),Ne=Math.min(1,Pe.x));var Fe,lt,ht=1/this.source.aspectRatio;this.wrapVertical?(Fe=a.positiveModulo(ce.y,ht),lt=a.positiveModulo(Pe.y,ht)):(Fe=Math.max(0,ce.y),lt=Math.min(ht,Pe.y));var At=this.source.getTileAtPoint(U,new a.Point(Ae,Fe)),Lt=this.source.getTileAtPoint(U,new a.Point(Ne,lt)),kt=this.source.getNumTiles(U);return this.wrapHorizontal&&(At.x+=kt.x*Math.floor(ce.x),Lt.x+=kt.x*Math.floor(Pe.x)),this.wrapVertical&&(At.y+=kt.y*Math.floor(ce.y/ht),Lt.y+=kt.y*Math.floor(Pe.y/ht)),{topLeft:At,bottomRight:Lt}}});function c(U,ce,Pe,Ae,Ne,Fe,lt,ht,At){var Lt=lt.getBoundingBox().getTopLeft(),kt=lt.getBoundingBox().getBottomRight();U.viewer&&U.viewer.raiseEvent("update-level",{tiledImage:U,havedrawn:ce,level:Ae,opacity:Ne,visibility:Fe,drawArea:lt,topleft:Lt,bottomright:kt,currenttime:ht,best:At}),ee(U.coverage,Ae),ee(U.loadingCoverage,Ae);var Yt=U._getCornerTiles(Ae,Lt,kt),Xt=Yt.topLeft,di=Yt.bottomRight,li=U.source.getNumTiles(Ae),Fi=U.viewport.pixelFromPoint(U.viewport.getCenter());U.getFlip()&&(di.x+=1,U.wrapHorizontal||(di.x=Math.min(di.x,li.x-1)));for(var zi=Xt.x;zi<=di.x;zi++)for(var Tn=Xt.y;Tn<=di.y;Tn++){var zt;if(U.getFlip()){var Wi=(li.x+zi%li.x)%li.x;zt=zi+li.x-Wi-Wi-1}else zt=zi;lt.intersection(U.getTileBounds(Ae,zt,Tn))!==null&&(At=f(U,Pe,ce,zt,Tn,Ae,Ne,Fe,Fi,li,ht,At))}return At}function f(U,ce,Pe,Ae,Ne,Fe,lt,ht,At,Lt,kt,Yt){var Xt=m(Ae,Ne,Fe,U,U.source,U.tilesMatrix,kt,Lt,U._worldWidthCurrent,U._worldHeightCurrent),di=Pe;U.viewer&&U.viewer.raiseEvent("update-tile",{tiledImage:U,tile:Xt}),Y(U.coverage,Fe,Ae,Ne,!1);var li=Xt.loaded||Xt.loading||H(U.loadingCoverage,Fe,Ae,Ne);if(Y(U.loadingCoverage,Fe,Ae,Ne,li),!Xt.exists||(ce&&!di&&(H(U.coverage,Fe,Ae,Ne)?Y(U.coverage,Fe,Ae,Ne,!0):di=!0),!di))return Yt;if(x(Xt,U.source.tileOverlap,U.viewport,At,ht,U),!Xt.loaded)if(Xt.context2D)w(U,Xt);else{var Fi=U._tileCache.getImageRecord(Xt.cacheKey);if(Fi){var zi=Fi.getImage();w(U,Xt,zi)}}if(Xt.loaded){var Tn=E(U,Xt,Ae,Ne,Fe,lt,kt);Tn&&(U._needsDraw=!0)}else Xt.loading?U._tilesLoading++:li||(Yt=be(Yt,Xt));return Yt}function m(U,ce,Pe,Ae,Ne,Fe,lt,ht,At,Lt){var kt,Yt,Xt,di,li,Fi,zi,Tn,zt;return Fe[Pe]||(Fe[Pe]={}),Fe[Pe][U]||(Fe[Pe][U]={}),(!Fe[Pe][U][ce]||!Fe[Pe][U][ce].flipped!=!Ae.flipped)&&(kt=(ht.x+U%ht.x)%ht.x,Yt=(ht.y+ce%ht.y)%ht.y,Xt=Ae.getTileBounds(Pe,U,ce),di=Ne.getTileBounds(Pe,kt,Yt,!0),li=Ne.tileExists(Pe,kt,Yt),Fi=Ne.getTileUrl(Pe,kt,Yt),Ae.loadTilesWithAjax?(zi=Ne.getTileAjaxHeaders(Pe,kt,Yt),a.isPlainObject(Ae.ajaxHeaders)&&(zi=a.extend({},Ae.ajaxHeaders,zi))):zi=null,Tn=Ne.getContext2D?Ne.getContext2D(Pe,kt,Yt):void 0,zt=new a.Tile(Pe,U,ce,Xt,li,Fi,Tn,Ae.loadTilesWithAjax,zi,di),Ae.getFlip()?kt===0&&(zt.isRightMost=!0):kt===ht.x-1&&(zt.isRightMost=!0),Yt===ht.y-1&&(zt.isBottomMost=!0),zt.flipped=Ae.flipped,Fe[Pe][U][ce]=zt),zt=Fe[Pe][U][ce],zt.lastTouchTime=lt,zt}function v(U,ce,Pe){ce.loading=!0,U._imageLoader.addJob({src:ce.url,loadWithAjax:ce.loadWithAjax,ajaxHeaders:ce.ajaxHeaders,crossOriginPolicy:U.crossOriginPolicy,ajaxWithCredentials:U.ajaxWithCredentials,callback:function(Ae,Ne,Fe){_(U,ce,Pe,Ae,Ne,Fe)},abort:function(){ce.loading=!1}})}function _(U,ce,Pe,Ae,Ne,Fe){if(!Ae){a.console.log("Tile %s failed to load: %s - error: %s",ce,ce.url,Ne),U.viewer.raiseEvent("tile-load-failed",{tile:ce,tiledImage:U,time:Pe,message:Ne,tileRequest:Fe}),ce.loading=!1,ce.exists=!1;return}if(PeU.visibility||ce.visibility===U.visibility&&ce.squaredDistance1&&ht>U.smoothTileEdgesMinZoom&&!U.iOSDevice&&U.getRotation(!0)%360===0&&a.supportsCanvas&&(Ae=!0,Ne=Pe.getScaleForEdgeSmoothing(),Fe=Pe.getTranslationForEdgeSmoothing(Ne,U._drawer.getCanvasSize(!1),U._drawer.getCanvasSize(!0)));var At;Ae&&(Ne||(At=U.viewport.viewportToViewerElementRectangle(U.getClippedBounds(!0)).getIntegerBoundingBox(),U._drawer.viewer.viewport.getFlip()&&(U.viewport.degrees!==0||U.getRotation(!0)%360!==0)&&(At.x=U._drawer.viewer.container.clientWidth-(At.x+At.width)),At=At.times(a.pixelDensityRatio)),U._drawer._clear(!0,At)),Ne||(U.viewport.degrees!==0&&U._drawer._offsetForRotation({degrees:U.viewport.degrees,useSketch:Ae}),U.getRotation(!0)%360!==0&&U._drawer._offsetForRotation({degrees:U.getRotation(!0),point:U.viewport.pixelFromPointNoRotate(U._getRotationPoint(!0),!0),useSketch:Ae}),U.viewport.degrees===0&&U.getRotation(!0)%360===0&&U._drawer.viewer.viewport.getFlip()&&U._drawer._flip());var Lt=!1;if(U._clip){U._drawer.saveContext(Ae);var kt=U.imageToViewportRectangle(U._clip,!0);kt=kt.rotate(-U.getRotation(!0),U._getRotationPoint(!0));var Yt=U._drawer.viewportToDrawerRectangle(kt);Ne&&(Yt=Yt.times(Ne)),Fe&&(Yt=Yt.translate(Fe)),U._drawer.setClip(Yt,Ae),Lt=!0}if(U._croppingPolygons){U._drawer.saveContext(Ae);try{var Xt=U._croppingPolygons.map(function(zi){return zi.map(function(Tn){var zt=U.imageToViewportCoordinates(Tn.x,Tn.y,!0).rotate(-U.getRotation(!0),U._getRotationPoint(!0)),Wi=U._drawer.viewportCoordToDrawerCoord(zt);return Ne&&(Wi=Wi.times(Ne)),Wi})});U._drawer.clipWithPolygons(Xt,Ae)}catch(zi){a.console.error(zi)}Lt=!0}if(U.placeholderFillStyle&&U._hasOpaqueTile===!1){var di=U._drawer.viewportToDrawerRectangle(U.getBounds(!0));Ne&&(di=di.times(Ne)),Fe&&(di=di.translate(Fe));var li=null;typeof U.placeholderFillStyle=="function"?li=U.placeholderFillStyle(U,U._drawer.context):li=U.placeholderFillStyle,U._drawer.drawRectangle(di,li,Ae)}for(var Fi=ce.length-1;Fi>=0;Fi--)Pe=ce[Fi],U._drawer.drawTile(Pe,U._drawingHandler,Ae,Ne,Fe),Pe.beingDrawn=!0,U.viewer&&U.viewer.raiseEvent("tile-drawn",{tiledImage:U,tile:Pe});Lt&&U._drawer.restoreContext(Ae),Ne||(U.getRotation(!0)%360!==0&&U._drawer._restoreRotationChanges(Ae),U.viewport.degrees!==0&&U._drawer._restoreRotationChanges(Ae)),Ae&&(Ne&&(U.viewport.degrees!==0&&U._drawer._offsetForRotation({degrees:U.viewport.degrees,useSketch:!1}),U.getRotation(!0)%360!==0&&U._drawer._offsetForRotation({degrees:U.getRotation(!0),point:U.viewport.pixelFromPointNoRotate(U._getRotationPoint(!0),!0),useSketch:!1})),U._drawer.blendSketch({opacity:U.opacity,scale:Ne,translate:Fe,compositeOperation:U.compositeOperation,bounds:At}),Ne&&(U.getRotation(!0)%360!==0&&U._drawer._restoreRotationChanges(!1),U.viewport.degrees!==0&&U._drawer._restoreRotationChanges(!1))),Ne||U.viewport.degrees===0&&U.getRotation(!0)%360===0&&U._drawer.viewer.viewport.getFlip()&&U._drawer._flip(),ke(U,ce)}}function ke(U,ce){if(U.debugMode)for(var Pe=ce.length-1;Pe>=0;Pe--){var Ae=ce[Pe];try{U._drawer.drawDebugInfo(Ae,ce.length,Pe,U)}catch(Ne){a.console.error(Ne)}}}}(d),function(a){var c=function(m){a.console.assert(m,"[TileCache.cacheTile] options is required"),a.console.assert(m.tile,"[TileCache.cacheTile] options.tile is required"),a.console.assert(m.tiledImage,"[TileCache.cacheTile] options.tiledImage is required"),this.tile=m.tile,this.tiledImage=m.tiledImage},f=function(m){a.console.assert(m,"[ImageRecord] options is required"),a.console.assert(m.image,"[ImageRecord] options.image is required"),this._image=m.image,this._tiles=[]};f.prototype={destroy:function(){this._image=null,this._renderedContext=null,this._tiles=null},getImage:function(){return this._image},getRenderedContext:function(){if(!this._renderedContext){var m=document.createElement("canvas");m.width=this._image.width,m.height=this._image.height,this._renderedContext=m.getContext("2d"),this._renderedContext.drawImage(this._image,0,0),this._image=null}return this._renderedContext},setRenderedContext:function(m){a.console.error("ImageRecord.setRenderedContext is deprecated. The rendered context should be created by the ImageRecord itself when calling ImageRecord.getRenderedContext."),this._renderedContext=m},addTile:function(m){a.console.assert(m,"[ImageRecord.addTile] tile is required"),this._tiles.push(m)},removeTile:function(m){for(var v=0;vthis._maxImageCacheCount){for(var x=null,E=-1,N=null,H,Y,ee,be,me,ke,U=this._tilesLoaded.length-1;U>=0;U--)if(ke=this._tilesLoaded[U],H=ke.tile,!(H.level<=v||H.beingDrawn)){if(!x){x=H,E=U,N=ke;continue}be=H.lastTouchTime,Y=x.lastTouchTime,me=H.level,ee=x.level,(beee)&&(x=H,E=U,N=ke)}x&&E>=0&&(this._unloadTile(N),_=E)}this._tilesLoaded[_]=new c({tile:m.tile,tiledImage:m.tiledImage})},clearTilesFor:function(m){a.console.assert(m,"[TileCache.clearTilesFor] tiledImage is required");for(var v,_=0;_=this._items.length)throw new Error("Index bigger than number of layers.");f===m||m===-1||(this._items.splice(m,1),this._items.splice(f,0,c),this._needsDraw=!0,this.raiseEvent("item-index-change",{item:c,previousIndex:m,newIndex:f}))},removeItem:function(c){a.console.assert(c,"[World.removeItem] item is required");var f=a.indexOf(this._items,c);f!==-1&&(c.removeHandler("bounds-change",this._delegatedFigureSizes),c.removeHandler("clip-change",this._delegatedFigureSizes),c.destroy(),this._items.splice(f,1),this._figureSizes(),this._needsDraw=!0,this._raiseRemoveItem(c))},removeAll:function(){this.viewer._cancelPendingImages();var c,f;for(f=0;fbe.height?me=w:me=w*(be.width/be.height),ke=me*(be.height/be.width),U=new a.Point(H+(w-me)/2,Y+(w-ke)/2),ee.setPosition(U,f),ee.setWidth(me,f),m==="horizontal"?H+=E:Y+=E;this.setAutoRefigureSizes(!0)},_figureSizes:function(){var c=this._homeBounds?this._homeBounds.clone():null,f=this._contentSize?this._contentSize.clone():null,m=this._contentFactor||0;if(!this._items.length)this._homeBounds=new a.Rect(0,0,1,1),this._contentSize=new a.Point(1,1),this._contentFactor=1;else{var v=this._items[0],_=v.getBounds();this._contentFactor=v.getContentSize().x/_.width;for(var w=v.getClippedBounds().getBoundingBox(),x=w.x,E=w.y,N=w.x+w.width,H=w.y+w.height,Y=1;Y{const d=l.getAttribute("class");return d?new Set(d.split(" ")):new Set},Gl=(l,d)=>{const a=Ix(l);a.add(d),l.setAttribute("class",Array.from(a).join(" "))},cv=(l,d)=>{const a=Ix(l);a.delete(d),a.size===0?l.removeAttribute("class"):l.setAttribute("class",Array.from(a).join(" "))},Rx=(l,d)=>Ix(l).has(d),ec=(l,d)=>{const a=l.selector("FragmentSelector");if(a!=null&&a.conformsTo.startsWith("http://www.w3.org/TR/media-frags")){const{value:c}=a,f=c.includes(":")?c.substring(c.indexOf("=")+1,c.indexOf(":")):"pixel",m=c.includes(":")?c.substring(c.indexOf(":")+1):c.substring(c.indexOf("=")+1);let[v,_,w,x]=m.split(",").map(parseFloat);return f.toLowerCase()==="percent"&&(v=v*d.naturalWidth/100,_=_*d.naturalHeight/100,w=w*d.naturalWidth/100,x=x*d.naturalHeight/100),{x:v,y:_,w,h:x}}},fae=(l,d,a,c,f)=>({source:f==null?void 0:f.src,selector:{type:"FragmentSelector",conformsTo:"http://www.w3.org/TR/media-frags/",value:`xywh=pixel:${l},${d},${a},${c}`}}),pae=(l,d,a,c,f)=>{const m=l/f.naturalWidth*100,v=d/f.naturalHeight*100,_=a/f.naturalWidth*100,w=c/f.naturalHeight*100;return{source:f.src,selector:{type:"FragmentSelector",conformsTo:"http://www.w3.org/TR/media-frags/",value:`xywh=percent:${m},${v},${_},${w}`}}},gf=(l,d,a,c,f,m)=>(m==null?void 0:m.toLowerCase())==="percent"?pae(l,d,a,c,f):fae(l,d,a,c,f),dv=(l,d,a,c,f)=>{l.setAttribute("x",d),l.setAttribute("y",a),l.setAttribute("width",c),l.setAttribute("height",f)},hv=(l,d,a)=>{l.setAttribute("cx",d),l.setAttribute("cy",a),l.setAttribute("r",7)},CM=(l,d,a,c,f)=>{const m=document.createElementNS(Hi,"path");m.setAttribute("fill-rule","evenodd");const{naturalWidth:v,naturalHeight:_}=l;return m.setAttribute("d",`M0 0 h${v} v${_} h-${v} z M${d} ${a} h${c} v${f} h-${c} z`),m},AM=(l,d,a,c,f,m)=>{const{naturalWidth:v,naturalHeight:_}=d;l.setAttribute("d",`M0 0 h${v} v${_} h-${v} z M${a} ${c} h${f} v${m} h-${f} z`)},Ox=(l,d,a,c)=>{const{x:f,y:m,w:v,h:_}=l.type==="Annotation"||l.type==="Selection"?ec(l,d):{x:l,y:d,w:a,h:c},w=document.createElementNS(Hi,"g");if(v===0&&_===0){Gl(w,"a9s-point"),Gl(w,"a9s-non-scaling"),w.setAttribute("transform-origin",`${f} ${m}`);const x=document.createElementNS(Hi,"circle"),E=document.createElementNS(Hi,"circle");E.setAttribute("class","a9s-inner"),hv(E,f,m),x.setAttribute("class","a9s-outer"),hv(x,f,m),w.appendChild(x),w.appendChild(E)}else{const x=document.createElementNS(Hi,"rect"),E=document.createElementNS(Hi,"rect");E.setAttribute("class","a9s-inner"),dv(E,f,m,v,_),x.setAttribute("class","a9s-outer"),dv(x,f,m,v,_),w.appendChild(x),w.appendChild(E)}return w},Lx=l=>{const d=l.querySelector(".a9s-outer");if(d.nodeName==="rect"){const a=parseFloat(d.getAttribute("x")),c=parseFloat(d.getAttribute("y")),f=parseFloat(d.getAttribute("width")),m=parseFloat(d.getAttribute("height"));return{x:a,y:c,w:f,h:m}}else{const a=parseFloat(d.getAttribute("cx")),c=parseFloat(d.getAttribute("cy"));return{x:a,y:c,w:0,h:0}}},DM=(l,d,a,c,f)=>{const m=l.querySelector(".a9s-inner"),v=l.querySelector(".a9s-outer");v.nodeName==="rect"?(dv(m,d,a,c,f),dv(v,d,a,c,f)):(hv(m,d,a),hv(v,d,a))},mae=(l,d)=>{const{w:a,h:c}=ec(l,d);return a*c};class gae{constructor(d,a,c,f,m){r(this,"dragTo",(v,_)=>{this.group.style.display=null,this.opposite=[v,_];const{x:w,y:x,w:E,h:N}=this.bbox;AM(this.mask,this.env.image,w,x,E,N),DM(this.rect,w,x,E,N)}),r(this,"getBoundingClientRect",()=>this.rect.getBoundingClientRect()),r(this,"toSelection",()=>{const{x:v,y:_,w,h:x}=this.bbox;return new Wm(gf(v,_,w,x,this.env.image,this.config.fragmentUnit))}),r(this,"destroy",()=>{this.group.parentNode.removeChild(this.group),this.mask=null,this.rect=null,this.group=null}),this.anchor=[d,a],this.opposite=[d,a],this.config=f,this.env=m,this.group=document.createElementNS(Hi,"g"),this.mask=CM(m.image,d,a,2,2),this.mask.setAttribute("class","a9s-selection-mask"),this.rect=Ox(d,a,2,2),this.rect.setAttribute("class","a9s-selection"),this.group.style.pointerEvents="none",this.group.style.display="none",this.group.appendChild(this.mask),this.group.appendChild(this.rect),c.appendChild(this.group)}get bbox(){const d=this.opposite[0]-this.anchor[0],a=this.opposite[1]-this.anchor[1];return{x:d>0?this.anchor[0]:this.opposite[0],y:a>0?this.anchor[1]:this.opposite[1],w:Math.max(1,Math.abs(d)),h:Math.max(1,Math.abs(a))}}get element(){return this.rect}}const yae={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup"},Mx=()=>"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,vae=l=>{let d=null;const a=(f,m)=>new MouseEvent(f,{screenX:m.screenX,screenY:m.screenY,clientX:m.clientX,clientY:m.clientY,pageX:m.pageX,pageY:m.pageY,bubbles:!0}),c=f=>{const m=f.changedTouches[0],v=a(yae[f.type],m);m.target.dispatchEvent(v),f.preventDefault(),(f.type==="touchstart"||f.type==="touchmove")&&(d&&clearTimeout(d),d=setTimeout(()=>{const _=a("dblclick",m);m.target.dispatchEvent(_)},800)),f.type==="touchend"&&d&&clearTimeout(d)};l.addEventListener("touchstart",c,!0),l.addEventListener("touchmove",c,!0),l.addEventListener("touchend",c,!0),l.addEventListener("touchcancel",c,!0)},fv="An implementation is missing",bae=Mx();class PM extends Cl{constructor(d,a,c){super(),r(this,"enableResponsive",()=>{window.ResizeObserver&&(this.resizeObserver=new ResizeObserver(()=>{const m=this.svg.getBoundingClientRect(),{width:v,height:_}=this.svg.viewBox.baseVal;this.scale=Math.max(v/m.width,_/m.height),this.onScaleChanged&&this.onScaleChanged(this.scale)}),this.resizeObserver.observe(this.svg.parentNode))}),r(this,"getSVGPoint",m=>{const v=this.svg.createSVGPoint();if(bae){const _=this.svg.getBoundingClientRect(),w=m.clientX-_.x,x=m.clientY-_.y,{left:E,top:N}=this.svg.getBoundingClientRect();return v.x=w+E,v.y=x+N,v.matrixTransform(this.g.getScreenCTM().inverse())}else return v.x=m.offsetX,v.y=m.offsetY,v.matrixTransform(this.g.getCTM().inverse())}),r(this,"drawHandle",(m,v)=>{const _=document.createElementNS(Hi,"g");_.setAttribute("class","a9s-handle");const w=document.createElementNS(Hi,"g"),x=Y=>{const ee=document.createElementNS(Hi,"circle");return ee.setAttribute("cx",m),ee.setAttribute("cy",v),ee.setAttribute("r",Y),ee.setAttribute("transform-origin",`${m} ${v}`),ee},E=this.config.handleRadius||6,N=x(E);N.setAttribute("class","a9s-handle-inner");const H=x(E+1);return H.setAttribute("class","a9s-handle-outer"),w.appendChild(H),w.appendChild(N),_.appendChild(w),_}),r(this,"setHandleXY",(m,v,_)=>{const w=m.querySelector(".a9s-handle-inner");w.setAttribute("cx",v),w.setAttribute("cy",_),w.setAttribute("transform-origin",`${v} ${_}`);const x=m.querySelector(".a9s-handle-outer");x.setAttribute("cx",v),x.setAttribute("cy",_),x.setAttribute("transform-origin",`${v} ${_}`)}),r(this,"getHandleXY",m=>{const v=m.querySelector(".a9s-handle-outer");return{x:parseFloat(v.getAttribute("cx")),y:parseFloat(v.getAttribute("cy"))}}),r(this,"scaleHandle",m=>{const v=m.querySelector(".a9s-handle-inner"),_=m.querySelector(".a9s-handle-outer"),w=this.scale*(this.config.handleRadius||6);v.setAttribute("r",w),_.setAttribute("r",w)}),this.svg=d.closest("svg"),this.g=d,this.config=a,this.env=c,this.scale=1;const{image:f}=c;(f instanceof Element||f instanceof HTMLDocument)&&this.enableResponsive()}destroy(){this.resizeObserver&&this.resizeObserver.disconnect(),this.resizeObserver=null}}class Fx extends PM{constructor(d,a,c){super(d,a,c),r(this,"attachListeners",({mouseMove:f,mouseUp:m,dblClick:v})=>{f&&(this.mouseMove=_=>{const{x:w,y:x}=this.getSVGPoint(_);this.started||(this.emit("startSelection",{x:w,y:x}),this.started=!0),f(w,x,_)},this.svg.addEventListener("mousemove",this.mouseMove)),m&&(this.mouseUp=_=>{if(_.button!==0)return;const{x:w,y:x}=this.getSVGPoint(_);m(w,x,_)},document.addEventListener("mouseup",this.mouseUp)),v&&(this.dblClick=_=>{const{x:w,y:x}=this.getSVGPoint(_);v(w,x,_)},document.addEventListener("dblclick",this.dblClick))}),r(this,"detachListeners",()=>{this.mouseMove&&this.svg.removeEventListener("mousemove",this.mouseMove),this.mouseUp&&document.removeEventListener("mouseup",this.mouseUp),this.dblClick&&document.removeEventListener("dblclick",this.dblClick)}),r(this,"start",(f,m)=>{const{x:v,y:_}=this.getSVGPoint(f),{naturalWidth:w,naturalHeight:x}=this.env.image,E=v<0?0:v>w?w:v,N=_<0?0:_>x?x:_;this.startDrawing(E,N,m,f)}),r(this,"startDrawing",f=>{throw new Error(fv)}),r(this,"createEditableShape",(f,m)=>{throw new Error(fv)}),this.started=!1}get isDrawing(){throw new Error(fv)}}Fx.supports=l=>{throw new Error(fv)};const kM="An implementation is missing";class IM extends PM{constructor(d,a,c,f){super(a,c,f),r(this,"updateState",m=>{throw new Error(kM)}),this.annotation=d}get element(){throw new Error(kM)}}const _ae=/firefox/i.test(navigator.userAgent),RM=(l,d,a,c,f)=>{l.setAttribute("width",c),l.setAttribute("height",f),_ae?(l.setAttribute("x",0),l.setAttribute("y",0),l.setAttribute("transform",`translate(${d}, ${a})`)):(l.setAttribute("x",d),l.setAttribute("y",a))},wae=(l,d)=>{const{x:a,y:c,width:f,height:m}=d.getBBox(),v=document.createElementNS(Hi,"svg");v.setAttribute("class","a9s-formatter-el"),RM(v,a,c,f,m);const _=document.createElementNS(Hi,"g");_.appendChild(l),v.appendChild(_),d.append(v)},pv=(l,d,a)=>{if(!a)return l;const c=a.reduce((_,w)=>{const x=w(d);if(!x)return _;if(typeof x=="string"||x instanceof String)_.className=_.className?`${_.className} ${x}`:x;else if(x.nodeType===Node.ELEMENT_NODE)_.elements=_.elements?[..._.elements,x]:[x];else{const{className:E,style:N,element:H}=x;E&&(_.className=_.className?`${_.className} ${E}`:E),N&&(_.style=_.style?`${_.style} ${N}`:N),H&&(_.elements=_.elements?[..._.elements,H]:[H])}for(const E in x)x.hasOwnProperty(E)&&E.startsWith("data-")&&(_[E]=x[E]);return _},{}),{className:f,style:m,elements:v}=c;if(f&&Gl(l,f),m){const _=l.querySelector(".a9s-outer"),w=l.querySelector(".a9s-inner");_&&w?(_.setAttribute("style","display:none"),w.setAttribute("style",m)):l.setAttribute("style",m)}v&&v.forEach(_=>wae(_,l));for(const _ in c)c.hasOwnProperty(_)&&_.startsWith("data-")&&l.setAttribute(_,c[_])},OM=(l,d,a,c,f)=>{const m=l.querySelector(".a9s-formatter-el");m&&RM(m,d,a,c,f)},qm="corner",mv="edge";class Tae extends IM{constructor(d,a,c,f){super(d,a,c,f),r(this,"onScaleChanged",()=>this.handles.map(this.scaleHandle)),r(this,"setSize",(E,N,H,Y)=>{DM(this.rectangle,E,N,H,Y),AM(this.mask,this.env.image,E,N,H,Y),OM(this.elementGroup,E,N,H,Y);const[ee,be,me,ke,U,ce,Pe,Ae]=this.handles;this.setHandleXY(ee,E,N),this.setHandleXY(be,E+H,N),this.setHandleXY(me,E+H,N+Y),this.setHandleXY(ke,E,N+Y),this.enableEdgeControls&&(this.setHandleXY(U,E+H/2,N),this.setHandleXY(ce,E+H,N+Y/2),this.setHandleXY(Pe,E+H/2,N+Y),this.setHandleXY(Ae,E,N+Y/2))}),r(this,"stretchCorners",(E,N,H)=>{const Y=this.getHandleXY(N),ee=H.x-Y.x,be=H.y-Y.y,me=ee>0?Y.x:H.x,ke=be>0?Y.y:H.y,U=Math.abs(ee),ce=Math.abs(be);return this.setSize(me,ke,U,ce),{x:me,y:ke,w:U,h:ce}}),r(this,"stretchEdge",(E,N,H)=>{const Y=this.getHandleXY(N),ee=Lx(this.rectangle),be=E%2===0,me=be?ee.w:H.x-Y.x,ke=be?H.y-Y.y:ee.h,U=be?ee.x:me>0?Y.x:H.x,ce=be?ke>0?Y.y:H.y:ee.y,Pe=Math.abs(me),Ae=Math.abs(ke);return this.setSize(U,ce,Pe,Ae),{x:U,y:ce,w:Pe,h:Ae}}),r(this,"onGrab",(E,N)=>H=>{if(H.button!==0)return;this.grabbedElem=E,this.grabbedType=N;const Y=this.getSVGPoint(H),{x:ee,y:be}=Lx(this.rectangle);this.mouseOffset={x:Y.x-ee,y:Y.y-be}}),r(this,"onMouseMove",E=>{if(E.button!==0)return;const N=(H,Y)=>H<0?0:H>Y?Y:H;if(this.grabbedElem){const H=this.getSVGPoint(E);if(this.grabbedElem===this.rectangle){const{w:Y,h:ee}=Lx(this.rectangle),{naturalWidth:be,naturalHeight:me}=this.env.image,ke=N(H.x-this.mouseOffset.x,be-Y),U=N(H.y-this.mouseOffset.y,me-ee);this.setSize(ke,U,Y,ee),this.emit("update",gf(ke,U,Y,ee,this.env.image,this.config.fragmentUnit))}else{const Y=this.handles.indexOf(this.grabbedElem),ee=this.handles[Y^2],{x:be,y:me,w:ke,h:U}=this.grabbedType===qm?this.stretchCorners(Y,ee,H):this.stretchEdge(Y,ee,H);this.emit("update",gf(be,me,ke,U,this.env.image,this.config.fragmentUnit))}}}),r(this,"onMouseUp",E=>{this.grabbedElem=null,this.grabbedType=null,this.mouseOffset=null}),r(this,"updateState",E=>{const{x:N,y:H,w:Y,h:ee}=ec(E,this.env.image);this.setSize(N,H,Y,ee)}),this.svg.addEventListener("mousemove",this.onMouseMove),this.svg.addEventListener("mouseup",this.onMouseUp);const{x:m,y:v,w:_,h:w}=ec(d,f.image);this.containerGroup=document.createElementNS(Hi,"g"),this.mask=CM(f.image,m,v,_,w),this.mask.setAttribute("class","a9s-selection-mask"),this.containerGroup.appendChild(this.mask),this.elementGroup=document.createElementNS(Hi,"g"),this.elementGroup.setAttribute("class","a9s-annotation editable selected"),this.elementGroup.setAttribute("data-id",d.id),this.rectangle=Ox(m,v,_,w),this.rectangle.querySelector(".a9s-inner").addEventListener("mousedown",this.onGrab(this.rectangle)),this.elementGroup.appendChild(this.rectangle),this.enableEdgeControls=c.enableEdgeControls;const x=this.enableEdgeControls?[[m+_/2,v,mv],[m+_,v+w/2,mv],[m+_/2,v+w,mv],[m,v+w/2,mv]]:[];this.handles=[[m,v,qm],[m+_,v,qm],[m+_,v+w,qm],[m,v+w,qm],...x].map(E=>{const[N,H,Y]=E,ee=this.drawHandle(N,H);return ee.addEventListener("mousedown",this.onGrab(ee,Y)),this.elementGroup.appendChild(ee),ee}),this.containerGroup.appendChild(this.elementGroup),a.appendChild(this.containerGroup),pv(this.rectangle,d,c.formatters),this.grabbedElem=null,this.grabbedType=null,this.mouseOffset=null}get element(){return this.elementGroup}destroy(){this.containerGroup.parentNode.removeChild(this.containerGroup),super.destroy()}}class gv extends Fx{constructor(d,a,c){super(d,a,c),r(this,"startDrawing",(f,m)=>{this.attachListeners({mouseMove:this.onMouseMove,mouseUp:this.onMouseUp}),this.rubberband=new gae(f,m,this.g,this.config,this.env)}),r(this,"stop",()=>{this.rubberband&&(this.rubberband.destroy(),this.rubberband=null)}),r(this,"onMouseMove",(f,m)=>{const{naturalWidth:v,naturalHeight:_}=this.env.image,w=Math.min(Math.max(f,0),v),x=Math.min(Math.max(m,0),_);this.rubberband.dragTo(w,x)}),r(this,"onMouseUp",()=>{this.detachListeners(),this.started=!1;const{width:f,height:m}=this.rubberband.getBoundingClientRect(),v=this.config.minSelectionWidth||4,_=this.config.minSelectionHeight||4;if(f>=v&&m>=_){const{element:w}=this.rubberband;w.annotation=this.rubberband.toSelection(),this.emit("complete",w)}else this.emit("cancel");this.stop()}),r(this,"createEditableShape",(f,m)=>new Tae(f,this.g,{...this.config,formatters:m},this.env)),this.rubberband=null}get isDrawing(){return this.rubberband!=null}}gv.identifier="rect",gv.supports=l=>{const d=l.selector("FragmentSelector");return d==null?void 0:d.conformsTo.startsWith("http://www.w3.org/TR/media-frags")};const yv=l=>{let d=0,a=l.length-1;for(let c=0;c{const f=l[0]-d,m=l[1]-a;return Math.sqrt(f*f+m*m)<=c},Sae=(l,d,a,c,f,m)=>{const _=Math.cos(0),w=Math.sin(0),x=l[0]-d,E=l[1]-a,N=_*x+w*E,H=w*x-_*E;return N*N/(c*c)+H*H/(f*f)<=1},Nx=(l,d)=>{const a=l[0],c=l[1];let f=!1;for(let m=0,v=d.length-1;mc!=E>c&&a<(x-_)*(c-w)/(E-w)+_&&(f=!f)}return f},Eae=(l,d)=>{for(let a of l)if(!Nx(a,d))return!1;return!0},Cae=(l,d,a,c,f,m)=>{const v=l[0],_=l[1],w=c-d,x=f-a,E=Math.sqrt(w*w+x*x);return Math.abs((v-d)*x-(_-a)*w)/E<=m},LM=l=>{const d=l.getAttribute("d").split(/(?=M|m|L|l|H|h|V|v|Z|z)/g).map(f=>f.trim()),a=[];let c=[];for(let f of d){const m=f.substring(0,1);if(m.toLowerCase()==="z")a.push([...c]),c=[];else{const v=f.substring(1).split(" ").map(E=>parseFloat(E.trim())),_=m===m.toUpperCase(),w=_?v[0]:v[0]+c[c.length-1][0],x=_?v[1]:v[1]+c[c.length-1][1];c.push([w,x])}}return c.length>0&&a.push([...c]),a},Aae=l=>{const d=new XMLSerializer().serializeToString(l.documentElement).replace("",``);return new DOMParser().parseFromString(d,"image/svg+xml").documentElement},MM=l=>{const d=c=>{Array.from(c.attributes).forEach(f=>{f.name.startsWith("on")&&c.removeAttribute(f.name)})},a=l.getElementsByTagName("script");return Array.from(a).reverse().forEach(c=>c.parentNode.removeChild(c)),d(l),Array.from(l.querySelectorAll("*")).forEach(d),l},hd=l=>{const d=l.selector("SvgSelector");if(d){const a=new DOMParser,{value:c}=d,f=a.parseFromString(c,"image/svg+xml"),m=f.lookupPrefix(Hi),v=f.lookupNamespaceURI(null);return m||v?MM(f).firstChild:MM(Aae(f)).firstChild}},FM=l=>{const d=hd(l),a=document.createElementNS(Hi,"g"),c=d.cloneNode(!0);c.setAttribute("class","a9s-inner");const f=d.cloneNode(!0);return f.setAttribute("class","a9s-outer"),a.appendChild(f),a.appendChild(c),a},Bx=(l,d)=>{const a=l.querySelector(".a9s-inner").cloneNode(!0);a.removeAttribute("class"),a.removeAttribute("xmlns");let c=a.outerHTML||new XMLSerializer().serializeToString(a);return c=c.replace(` xmlns="${Hi}"`,""),{source:d==null?void 0:d.src,selector:{type:"SvgSelector",value:`${c}`}}},Dae=l=>{const d=hd(l),a=d.nodeName.toLowerCase();if(a==="polygon")return Pae(d);if(a==="circle")return kae(d);if(a==="ellipse")return Iae(d);if(a=="path")return Rae(d);if(a=="line")return 0;throw`Unsupported SVG shape type: ${a}`},Pae=l=>{const d=l.getAttribute("points").trim().split(" ").map(a=>a.split(",").map(c=>parseFloat(c.trim())));return yv(d)},kae=l=>{const d=l.getAttribute("r");return d*d*Math.PI},Iae=l=>{const d=l.getAttribute("rx"),a=l.getAttribute("ry");return d*a*Math.PI},Rae=l=>{const d=LM(l);if(d.length==1)return yv(d[0]);{const a=f=>d.find(m=>{if(f!==m)return Eae(f,m)});let c=0;for(let f of d)a(f)?c-=yv(f):c+=yv(f);return c}};class NM{constructor(d,a){r(this,"redraw",()=>{this.mask.setAttribute("d",`M0 0 h${this.w} v${this.h} h-${this.w} z M${this.polygon.getAttribute("points")} z`)}),r(this,"destroy",()=>this.mask.parentNode.removeChild(this.mask)),this.w=d.naturalWidth,this.h=d.naturalHeight,this.polygon=a,this.mask=document.createElementNS(Hi,"path"),this.mask.setAttribute("fill-rule","evenodd"),this.mask.setAttribute("class","a9s-selection-mask"),this.mask.setAttribute("d",`M0 0 h${this.w} v${this.h} h-${this.w} z M${this.polygon.getAttribute("points")} z`)}get element(){return this.mask}}class Oae{constructor(d,a,c){r(this,"setPoints",f=>{const m=f.map(v=>`${v[0]},${v[1]}`).join(" ");this.outer.setAttribute("points",m),this.inner.setAttribute("points",m)}),r(this,"getBoundingClientRect",()=>this.outer.getBoundingClientRect()),r(this,"dragTo",f=>{this.group.style.display=null,this.mousepos=f;const m=[...this.points,f];this.setPoints(m),this.mask.redraw()}),r(this,"addPoint",()=>{const[f,m]=this.mousepos,v=this.points[this.points.length-1];Math.pow(f-v[0],2)+Math.pow(m-v[1],2)>4&&(this.points=[...this.points,this.mousepos],this.setPoints(this.points),this.mask.redraw())}),r(this,"destroy",()=>{this.group.parentNode.removeChild(this.group),this.polygon=null,this.group=null}),r(this,"toSelection",()=>new Wm(Bx(this.group,this.env.image))),this.points=[d],this.env=c,this.mousepos=d,this.group=document.createElementNS(Hi,"g"),this.polygon=document.createElementNS(Hi,"g"),this.polygon.setAttribute("class","a9s-selection"),this.outer=document.createElementNS(Hi,"polygon"),this.outer.setAttribute("class","a9s-outer"),this.inner=document.createElementNS(Hi,"polygon"),this.inner.setAttribute("class","a9s-inner"),this.setPoints(this.points),this.mask=new NM(c.image,this.inner),this.polygon.appendChild(this.outer),this.polygon.appendChild(this.inner),this.group.style.display="none",this.group.appendChild(this.mask.element),this.group.appendChild(this.polygon),a.appendChild(this.group)}get element(){return this.polygon}}const Hx=l=>{const d=l.querySelector(".a9s-inner").points,a=[];for(let c=0;cl.querySelector(".a9s-inner").getBBox();class Mae extends IM{constructor(d,a,c,f){super(d,a,c,f),r(this,"onScaleChanged",()=>this.handles.map(this.scaleHandle)),r(this,"setPoints",m=>{const v=Y=>Math.round(10*Y)/10,_=m.map(Y=>`${v(Y.x)},${v(Y.y)}`).join(" ");this.shape.querySelector(".a9s-inner").setAttribute("points",_);const w=this.shape.querySelector(".a9s-outer");w.setAttribute("points",_),this.mask.redraw();const{x,y:E,width:N,height:H}=w.getBBox();OM(this.elementGroup,x,E,N,H)}),r(this,"onGrab",m=>v=>{v.button===0&&(this.grabbedElem=m,this.grabbedAt=this.getSVGPoint(v))}),r(this,"onMouseMove",m=>{const v=(_,w,x)=>_+w<0?-_:_+w>x?x-_:w;if(this.grabbedElem){const _=this.getSVGPoint(m);if(this.grabbedElem===this.shape){const{x:w,y:x,width:E,height:N}=Lae(this.shape),{naturalWidth:H,naturalHeight:Y}=this.env.image,ee=v(w,_.x-this.grabbedAt.x,H-E),be=v(x,_.y-this.grabbedAt.y,Y-N),me=Hx(this.shape).map(ke=>({x:ke.x+ee,y:ke.y+be}));this.grabbedAt=_,this.setPoints(me),me.forEach((ke,U)=>this.setHandleXY(this.handles[U],ke.x,ke.y)),this.emit("update",Bx(this.shape,this.env.image))}else{const w=this.handles.indexOf(this.grabbedElem),x=Hx(this.shape).map((E,N)=>N===w?_:E);this.setPoints(x),this.setHandleXY(this.handles[w],_.x,_.y),this.emit("update",Bx(this.shape,this.env.image))}}}),r(this,"onMouseUp",m=>{this.grabbedElem=null,this.grabbedAt=null}),r(this,"updateState",m=>{const v=hd(m).getAttribute("points").split(" ").map(_=>{const[w,x]=_.split(",").map(E=>parseFloat(E.trim()));return{x:w,y:x}});this.setPoints(v),v.forEach((_,w)=>this.setHandleXY(this.handles[w],_.x,_.y))}),r(this,"destroy",()=>{this.containerGroup.parentNode.removeChild(this.containerGroup),super.destroy()}),this.svg.addEventListener("mousemove",this.onMouseMove),this.svg.addEventListener("mouseup",this.onMouseUp),this.containerGroup=document.createElementNS(Hi,"g"),this.shape=FM(d),this.shape.querySelector(".a9s-inner").addEventListener("mousedown",this.onGrab(this.shape)),this.mask=new NM(f.image,this.shape.querySelector(".a9s-inner")),this.containerGroup.appendChild(this.mask.element),this.elementGroup=document.createElementNS(Hi,"g"),this.elementGroup.setAttribute("class","a9s-annotation editable selected"),this.elementGroup.setAttribute("data-id",d.id),this.elementGroup.appendChild(this.shape),this.handles=Hx(this.shape).map(m=>{const v=this.drawHandle(m.x,m.y);return v.addEventListener("mousedown",this.onGrab(v)),this.elementGroup.appendChild(v),v}),this.containerGroup.appendChild(this.elementGroup),a.appendChild(this.containerGroup),pv(this.shape,d,c.formatters),this.grabbedElem=null,this.grabbedAt=null}get element(){return this.elementGroup}}class Ux extends Fx{constructor(d,a,c){super(d,a,c),r(this,"startDrawing",(f,m,v)=>{this._isDrawing=!0,this._startOnSingleClick=v,this.attachListeners({mouseMove:this.onMouseMove,mouseUp:this.onMouseUp,dblClick:this.onDblClick}),this.rubberband=new Oae([f,m],this.g,this.env)}),r(this,"stop",()=>{this.detachListeners(),this._isDrawing=!1,this.rubberband&&(this.rubberband.destroy(),this.rubberband=null)}),r(this,"onMouseMove",(f,m)=>this.rubberband.dragTo([f,m])),r(this,"onMouseUp",()=>{const{width:f,height:m}=this.rubberband.getBoundingClientRect(),v=this.config.minSelectionWidth||4,_=this.config.minSelectionHeight||4;f>=v||m>=_?this.rubberband.addPoint():this._startOnSingleClick||(this.emit("cancel"),this.stop())}),r(this,"onDblClick",()=>{this._isDrawing=!1;const f=this.rubberband.element;f.annotation=this.rubberband.toSelection(),this.emit("complete",f),this.stop()}),r(this,"createEditableShape",(f,m)=>new Mae(f,this.g,{...this.config,formatters:m},this.env)),this._isDrawing=!1,this._startOnSingleClick=!1}get isDrawing(){return this._isDrawing}}Ux.identifier="polygon",Ux.supports=l=>{var d;const a=l.selector("SvgSelector");if(a)return(d=a.value)==null?void 0:d.match(/^this._registered.map(f=>f.identifier)),r(this,"registerTool",f=>{const m=f.identifier;this.listTools().includes(m)&&this.unregisterTool(m),this._registered.unshift(f)}),r(this,"unregisterTool",f=>this._registered=this._registered.filter(m=>m.identifier!==f)),r(this,"setCurrent",f=>{this._current&&this._current.destroy();const m=typeof f=="string"||f instanceof String?this._registered.find(v=>v.identifier===f):f;this._current=new m(this._g,this._config,this._env),this._current.on("startSelection",v=>this.emit("startSelection",v)),this._current.on("complete",v=>this.emit("complete",v)),this._current.on("cancel",v=>this.emit("cancel",v))}),r(this,"forAnnotation",f=>{var m;const[v,..._]=f.targets,w=(m=v.renderedVia)==null?void 0:m.name,x=w?this._registered.find(E=>E.identifier===w):this._registered.find(E=>E.supports(f));return x?new x(this._g,this._config,this._env):null}),this._g=d,this._config=a,this._env=c,this._registered=[gv,Ux],this.setCurrent(gv)}get current(){return this._current}}const Nae={FragmentSelector:Ox,SvgSelector:FM},Bae={FragmentSelector:mae,SvgSelector:Dae},BM=l=>{const d=l.targets[0];if(d)return Array.isArray(d.selector)?d.selector[0]:d.selector},zx=(l,d)=>Nae[BM(l).type](l,d),HM=(l,d)=>Bae[BM(l).type](l,d);class Hae{constructor(d){const a=document.createElementNS(Hi,"svg");a.setAttribute("class","a9s-osd-crosshair-container");const c=document.createElementNS(Hi,"g");c.setAttribute("class","a9s-crosshair"),a.appendChild(c);const f=document.createElementNS(Hi,"line"),m=document.createElementNS(Hi,"line");c.appendChild(f),c.appendChild(m),d.parentElement.appendChild(a);const v=_=>{const{offsetX:w,offsetY:x}=_,E=d.parentElement.offsetWidth,N=d.parentElement.offsetHeight;f.setAttribute("x1",0),f.setAttribute("y1",x),f.setAttribute("x2",E),f.setAttribute("y2",x),m.setAttribute("x1",w),m.setAttribute("y1",0),m.setAttribute("x2",w),m.setAttribute("y2",N)};d.addEventListener("pointermove",v),d.parentElement.addEventListener("pointermove",v)}}function Uae(l,d,a,c,f){UM(l,d,a||0,c||l.length-1,f||zae)}function UM(l,d,a,c,f){for(;c>a;){if(c-a>600){var m=c-a+1,v=d-a+1,_=Math.log(m),w=.5*Math.exp(2*_/3),x=.5*Math.sqrt(_*w*(m-w)/m)*(v-m/2<0?-1:1),E=Math.max(a,Math.floor(d-v*w/m+x)),N=Math.min(c,Math.floor(d+(m-v)*w/m+x));UM(l,d,E,N,f)}var H=l[d],Y=a,ee=c;for(Gm(l,a,d),f(l[c],H)>0&&Gm(l,a,c);Y0;)ee--}f(l[a],H)===0?Gm(l,a,ee):(ee++,Gm(l,ee,c)),ee<=d&&(a=ee+1),d<=ee&&(c=ee-1)}}function Gm(l,d,a){var c=l[d];l[d]=l[a],l[a]=c}function zae(l,d){return ld?1:0}class Vae{constructor(d=9){this._maxEntries=Math.max(4,d),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(d){let a=this.data;const c=[];if(!bv(d,a))return c;const f=this.toBBox,m=[];for(;a;){for(let v=0;v=0&&m[a].children.length>this._maxEntries;)this._split(m,a),a--;this._adjustParentBBoxes(f,m,a)}_split(d,a){const c=d[a],f=c.children.length,m=this._minEntries;this._chooseSplitAxis(c,m,f);const v=this._chooseSplitIndex(c,m,f),_=vf(c.children.splice(v,c.children.length-v));_.height=c.height,_.leaf=c.leaf,yf(c,this.toBBox),yf(_,this.toBBox),a?d[a-1].children.push(_):this._splitRoot(c,_)}_splitRoot(d,a){this.data=vf([d,a]),this.data.height=d.height+1,this.data.leaf=!1,yf(this.data,this.toBBox)}_chooseSplitIndex(d,a,c){let f,m=1/0,v=1/0;for(let _=a;_<=c-a;_++){const w=Km(d,0,_,this.toBBox),x=Km(d,_,c,this.toBBox),E=Kae(w,x),N=Vx(w)+Vx(x);E=a;x--){const E=d.children[x];Ym(_,d.leaf?m(E):E),w+=vv(_)}return w}_adjustParentBBoxes(d,a,c){for(let f=c;f>=0;f--)Ym(a[f],d)}_condense(d){for(let a=d.length-1,c;a>=0;a--)d[a].children.length===0?a>0?(c=d[a-1].children,c.splice(c.indexOf(d[a]),1)):this.clear():yf(d[a],this.toBBox)}}function jae(l,d,a){if(!a)return d.indexOf(l);for(let c=0;c=l.minX&&d.maxY>=l.minY}function vf(l){return{children:l,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function zM(l,d,a,c,f){const m=[d,a];for(;m.length;){if(a=m.pop(),d=m.pop(),a-d<=c)continue;const v=d+Math.ceil((a-d)/c/2)*c;Uae(l,v,d,a,f),m.push(d,v,v,a)}}const Wx=(l,d)=>{if(l.targets[0].selector.type==="FragmentSelector"){const{x:a,y:c,w:f,h:m}=ec(l,d);return{minX:a,minY:c,maxX:a+f,maxY:c+m}}else{const a=zx(l,d),c=document.createElementNS(Hi,"svg");c.style.position="absolute",c.style.opacity=0,c.style.top=0,c.style.left=0,c.appendChild(a),document.body.appendChild(c);const{x:f,y:m,width:v,height:_}=a.getBBox();return document.body.removeChild(c),{minX:f,minY:m,maxX:f+v,maxY:m+_}}},Yae=l=>{var d;const a=l.targets[0];return Array.isArray(a.selector)?a.selector[0].type:(d=a.selector)==null?void 0:d.type},Xae=(l,d,a,c)=>{const f=hd(a),m=f.nodeName.toLowerCase(),v=[l,d];if(m==="polygon"){const _=Array.from(f.points).map(w=>[w.x,w.y]);return Nx(v,_)}else if(m==="circle"){const _=f.getAttribute("cx"),w=f.getAttribute("cy"),x=f.getAttribute("r");return xae(v,_,w,x)}else if(m==="ellipse"){const _=f.getAttribute("cx"),w=f.getAttribute("cy"),x=f.getAttribute("rx"),E=f.getAttribute("ry");return Sae(v,_,w,x,E)}else{if(m==="path")return LM(f).find(_=>Nx(v,_));if(m==="line"){const _=parseInt(f.getAttribute("x1")),w=parseInt(f.getAttribute("y1")),x=parseInt(f.getAttribute("x2")),E=parseInt(f.getAttribute("y2"));return Cae(v,_,w,x,E,c)}else throw`Unsupported SVG shape type: ${m}`}};class Zae{constructor(d){r(this,"clear",()=>this.spatial_index.clear()),r(this,"getAnnotationAt",(a,c,f)=>{const m=f?5/f:5,v=this.spatial_index.search({minX:a-m,minY:c-m,maxX:a+m,maxY:c+m}).map(_=>_.annotation).filter(_=>{const w=Yae(_);if(w==="FragmentSelector")return!0;if(w==="SvgSelector")return Xae(a,c,_,m);throw`Unsupported selector type: ${w}`});if(v.length>0)return v.sort((_,w)=>HM(_,this.env.image)-HM(w,this.env.image)),v[0]}),r(this,"getAnnotationsIntersecting",a=>{const c=a.minX,f=c?a:Wx(a,this.env.image),m=this.spatial_index.search(f).map(v=>v.annotation);return c?m:m.filter(v=>!v.isEqual(a))}),r(this,"insert",a=>{(Array.isArray(a)?a:[a]).forEach(c=>{this.spatial_index.insert({...Wx(c,this.env.image),annotation:c})})}),r(this,"getBounds",a=>this.getBounds(a,this.env.image)),r(this,"remove",a=>{const c={...Wx(a,this.env.image),annotation:a};this.spatial_index.remove(c,(f,m)=>f.annotation.id===m.annotation.id)}),this.env=d,d.store=this,this.spatial_index=new Vae}}const VM=(l,d)=>{const a=(Rx(d,".a9s-annotation")?d:d.closest(".a9s-annotation")).querySelector(".a9s-outer").getBoundingClientRect(),{canvas:c}=l.drawer,f=c.getBoundingClientRect(),m=c.width/f.width,v=c.height/f.height,_=a.x-f.x,w=a.y-f.y,{width:x,height:E}=a,N=document.createElement("CANVAS"),H=N.getContext("2d");N.width=x,N.height=E,H.drawImage(c,_*m,w*v,x*m,E*v,0,0,x,E);const Y=l.viewport.viewerElementToImageCoordinates(new ql.Point(_,w)),ee=l.viewport.viewportToImageZoom(l.viewport.getZoom());return{snippet:N,transform:be=>{const me=Y.x+be[0]/m/ee,ke=Y.y+be[1]/v/ee;return[me,ke]}}},Qae=Mx();class jM extends Cl{constructor(d){super(),r(this,"_getShapeAt",c=>{const f=w=>{const x=this.svg.createSVGPoint();if(window.TouchEvent&&w instanceof TouchEvent){const E=this.svg.getBoundingClientRect(),N=w.touches[0],H=N.clientX-E.x,Y=N.clientY-E.y,{left:ee,top:be}=this.svg.getBoundingClientRect();return x.x=H+ee,x.y=Y+be,x.matrixTransform(this.g.getScreenCTM().inverse())}else return x.x=w.offsetX,x.y=w.offsetY,x.matrixTransform(this.g.getCTM().inverse())},{x:m,y:v}=f(c),_=this.store.getAnnotationAt(m,v,this.currentScale());if(_)return this.findShape(_)}),r(this,"_initDrawingTools",c=>{var f;let m=!1,v=!1,_=!1;this.tools=new Fae(this.g,this.config,this.env),this.tools.on("complete",E=>{v=!1,this.onDrawingComplete(E)}),this.mouseTracker=new ql.MouseTracker({element:this.svg,preProcessEventHandler:E=>{this.mouseTracker.enabled||(E.preventDefault=!1,E.preventGesture=!0),this.selectedShape&&E.eventType==="wheel"&&(E.preventDefault=!1,this.viewer.canvas.dispatchEvent(new E.originalEvent.constructor(E.eventType,E.originalEvent)))},pressHandler:E=>{this.tools.current.isDrawing||(this.tools.current.start(E.originalEvent,this.drawOnSingleClick&&!this.hoveredShape),c||this.scaleTool(this.tools.current))},moveHandler:E=>{if(this.tools.current.isDrawing){const{x:N,y:H}=this.tools.current.getSVGPoint(E.originalEvent);v||E.originalEvent.stopPropagation(),this.tools.current.onMouseMove(N,H,E.originalEvent),m||(this.emit("startSelection",{x:N,y:H}),m=!0),!_&&this.tools.current.onDragStart&&(this.tools.current.onDragStart(N,H,E.originalEvent),_=!0)}},releaseHandler:E=>{if(this.tools.current.isDrawing){const{x:N,y:H}=this.tools.current.getSVGPoint(E.originalEvent);m&&(this.emit("endSelection",{x:N,y:H}),v=!0),this.tools.current.onMouseUp(N,H,E.originalEvent),_&&this.tools.current.onDragEnd&&this.tools.current.onDragEnd()}m=!1,_=!1}});const w=this.config.hotkey?this.config.hotkey.key?this.config.hotkey.key.toLowerCase():this.config.hotkey.toLowerCase():"shift",x=(f=this.config.hotkey)==null?void 0:f.inverted;this.mouseTracker.enabled=x,this.onKeyDown&&document.removeEventListener("keydown",this.onKeyDown),this.onKeyUp&&document.removeEventListener("keydown",this.onKeyDown),this.onKeyDown=E=>{if(E.key.toLowerCase()===w&&!this.selectedShape){const N=!this.readOnly&&!x;this.mouseTracker.enabled=N,this.tools.current.enabled=N}},this.onKeyUp=E=>{E.key.toLowerCase()===w&&!this.tools.current.isDrawing&&(this.mouseTracker.enabled=x,this.tools.current.enabled=x,v=!1)},document.addEventListener("keydown",this.onKeyDown),document.addEventListener("keyup",this.onKeyUp)}),r(this,"_initMouseEvents",()=>{this.svg.addEventListener("mousemove",f=>{var m,v;if(!((m=this.tools)!=null&&m.current.isDrawing)&&!f.target.closest(".a9s-annotation.editable.selected")){const _=this._getShapeAt(f);if((_==null?void 0:_.annotation)!==((v=this.hoveredShape)==null?void 0:v.annotation)){if(this.hoveredShape){const w=this.hoveredShape.element||this.hoveredShape;cv(w,"hover"),this.emit("mouseLeaveAnnotation",this.hoveredShape.annotation,this.hoveredShape)}_&&(Gl(_,"hover"),this.emit("mouseEnterAnnotation",_.annotation,_))}this.hoveredShape=_}}),this.svg.parentElement.addEventListener("mouseleave",()=>{this.hoveredShape&&(cv(this.hoveredShape,"hover"),this.emit("mouseLeaveAnnotation",this.hoveredShape.annotation,this.hoveredShape),this.hoveredShape=null)});let c=null;this.viewer.addHandler("canvas-press",()=>c=new Date().getTime()),this.viewer.addHandler("canvas-click",f=>{var m;const{originalEvent:v}=f;if(!((m=this.tools.current)!=null&&m.isDrawing||this.disableSelect)&&new Date().getTime()-c<250){const _=v.target.closest(".a9s-annotation.editable.selected")?this.selectedShape:this._getShapeAt(v);_?(f.preventDefaultAction=!0,this.selectShape(_)):_||(this.deselect(),this.emit("select",{}))}this.disableSelect&&this.hoveredShape&&this.emit("clickAnnotation",this.hoveredShape.annotation,this.hoveredShape)})}),r(this,"_lazy",c=>{if(this.viewer.world.getItemAt(0))c();else{const f=()=>{c(),this.viewer.removeHandler("open",f),this.viewer.world.removeHandler("add-item",f)};this.viewer.addHandler("open",f),this.viewer.world.addHandler("add-item",f)}}),r(this,"_refreshNonScalingAnnotations",()=>{const c=this.currentScale();Array.from(this.svg.querySelectorAll(".a9s-non-scaling")).forEach(f=>f.setAttribute("transform",`scale(${1/c})`))}),r(this,"addAnnotation",(c,f)=>{const m=f||this.g,v=zx(c,this.env.image);return Gl(v,"a9s-annotation"),v.setAttribute("data-id",c.id),v.annotation=c,m.appendChild(v),pv(v,c,this.formatters),this.scaleFormatterElements(v),v}),r(this,"addDrawingTool",c=>this.tools.registerTool(c)),r(this,"addOrUpdateAnnotation",(c,f)=>{var m;const v=(m=this.selectedShape)==null?void 0:m.annotation;(v===c||v!=null&&v.isSelection||v==f)&&this.deselect(),f&&this.removeAnnotation(c),this.removeAnnotation(c);const _=this.addAnnotation(c);Rx(_,"a9s-non-scaling")&&_.setAttribute("transform",`scale(${1/this.currentScale()})`),this.store.insert(c)}),r(this,"currentScale",()=>{const c=this.viewer.viewport.getContainerSize().x;return this.viewer.viewport.getZoom(!0)*c/this.viewer.world.getContentFactor()}),r(this,"deselect",()=>{var c;if((c=this.tools)==null||c.current.stop(),this.selectedShape){const{annotation:f}=this.selectedShape;if(this.selectedShape.destroy){if(this.selectedShape.mouseTracker.destroy(),this.selectedShape.destroy(),!f.isSelection){const m=this.addAnnotation(f);Rx(m,"a9s-non-scaling")&&m.setAttribute("transform",`scale(${1/this.currentScale()})`)}}else cv(this.selectedShape,"selected");this.selectedShape=null}}),r(this,"destroy",()=>{this.deselect(),this.svg.parentNode.removeChild(this.svg)}),r(this,"findShape",c=>{const f=c!=null&&c.id?c.id:c;return this.g.querySelector(`.a9s-annotation[data-id="${f}"]`)}),r(this,"_fit",(c,f,m)=>{const v=this.findShape(c);if(v){const _=f?typeof f=="boolean"?f:f.immediately:!1,w=(f==null?void 0:f.padding)||0,x=this.viewer.container.getBoundingClientRect(),E=Math.min(2*w/x.width,2*w/x.height),{x:N,y:H,width:Y,height:ee}=v.getBBox(),be=N-E*Y,me=H-E*ee,ke=Y+2*E*Y,U=ee+2*E*ee,ce=this.viewer.viewport.imageToViewportRectangle(be,me,ke,U);this.viewer.viewport[m](ce,_)}}),r(this,"fitBounds",(c,f)=>this._fit(c,f,"fitBounds")),r(this,"fitBoundsWithConstraints",(c,f)=>this._fit(c,f,"fitBoundsWithConstraints")),r(this,"getAnnotations",()=>Array.from(this.g.querySelectorAll(".a9s-annotation")).map(c=>c.annotation)),r(this,"getAnnotationsIntersecting",c=>{const f=c.id?c:this.findShape(c).annotation;return this.store.getAnnotationsIntersecting(f)}),r(this,"getImageSnippetById",c=>{const f=this.findShape(c);if(f)return VM(this.viewer,f)}),r(this,"getSelectedImageSnippet",()=>{var c;if(this.selectedShape){const f=(c=this.selectedShape.element)!=null?c:this.selectedShape;return VM(this.viewer,f)}}),r(this,"init",c=>{this.deselect(),Array.from(this.g.querySelectorAll(".a9s-annotation")).forEach(f=>this.g.removeChild(f)),this.store.clear(),this._lazy(()=>{console.time("Took"),console.log("Drawing..."),this.loaded||(this.g.style.display="none"),c.forEach(f=>this.addAnnotation(f)),console.log("Indexing..."),this.store.insert(c),console.timeEnd("Took"),this.resize()})}),r(this,"listDrawingTools",()=>this.tools.listTools()),r(this,"overrideId",(c,f)=>{const m=this.findShape(c);m.setAttribute("data-id",f);const{annotation:v}=m,_=v.clone({id:f});return m.annotation=_,this.store.remove(v),this.store.insert(_),_}),r(this,"panTo",(c,f)=>{const m=this.findShape(c);if(m){const{top:v,left:_,width:w,height:x}=m.getBoundingClientRect(),E=_+w/2+window.scrollX,N=v+x/2+window.scrollY,H=this.viewer.viewport.windowToViewportCoordinates(new ql.Point(E,N));this.viewer.viewport.panTo(H,f)}}),r(this,"removeAnnotation",c=>{var f,m;const v=c.type?c.id:c;((f=this.selectedShape)==null?void 0:f.annotation.id)===v&&this.deselect();const _=this.findShape(c);if(_){const{annotation:w}=_;((m=this.selectedShape)==null?void 0:m.annotation)===w&&this.deselect(),_.parentNode.removeChild(_),this.store.remove(w)}}),r(this,"removeDrawingTool",c=>{var f;return(f=this.tools)==null?void 0:f.unregisterTool(c)}),r(this,"scaleFormatterElements",c=>{const f=1/this.currentScale();if(c){const m=c.querySelector(".a9s-annotation:not(.a9s-non-scaling) .a9s-formatter-el");m&&m.firstChild.setAttribute("transform",`scale(${f})`)}else Array.from(this.g.querySelectorAll(".a9s-annotation:not(.a9s-non-scaling) .a9s-formatter-el")).forEach(m=>m.firstChild.setAttribute("transform",`scale(${f})`))}),r(this,"scaleTool",c=>{if(c){const f=1/this.currentScale();c.scale=f,c.onScaleChanged&&c.onScaleChanged(f)}}),r(this,"selectAnnotation",(c,f)=>{this.selectedShape&&this.deselect();const m=this.findShape(c);if(m){this.selectShape(m,f);const v=this.selectedShape.element?this.selectedShape.element:this.selectedShape;return{annotation:m.annotation,element:v}}else this.deselect()}),r(this,"selectShape",(c,f)=>{var m;if(!f&&!c.annotation.isSelection&&this.emit("clickAnnotation",c.annotation,c),((m=this.selectedShape)==null?void 0:m.annotation)===c.annotation)return;this.selectedShape&&this.selectedShape.annotation!==c.annotation&&this.deselect();const{annotation:v}=c;if(this.readOnly||v.readOnly||this.headless)this.selectedShape=c,Gl(c,"selected"),f||this.emit("select",{annotation:v,element:c,skipEvent:f});else{const _=this.tools.forAnnotation(v);if(_){setTimeout(()=>{c.parentNode.removeChild(c),f||this.emit("select",{annotation:v,element:this.selectedShape.element})},1),this.selectedShape=_.createEditableShape(v,this.formatters),this.scaleTool(this.selectedShape),this.scaleFormatterElements(this.selectedShape.element),this.selectedShape.element.annotation=v;const w=new ql.MouseTracker({element:this.svg,preProcessEventHandler:x=>{x.stopPropagation=!0,x.preventDefault=!1,x.preventGesture=!0}}).setTracking(!1);this.selectedShape.element.addEventListener("mouseenter",()=>{this.hoveredShape=this.selectedShape,w.setTracking(!0)}),this.selectedShape.element.addEventListener("mouseleave",()=>{this.hoveredShape=null,w.setTracking(!1)}),this.selectedShape.mouseTracker=w,this.selectedShape.on("update",x=>this.emit("updateTarget",this.selectedShape.element,x))}else this.selectedShape=c,f||this.emit("select",{annotation:v,element:this.selectedShape})}}),r(this,"setDrawingEnabled",c=>{if(this.mouseTracker){const f=c&&!this.readOnly;this.mouseTracker.enabled=f,this.mouseTracker.setTracking(f),this.tools.current&&(this.tools.current.enabled=f)}}),r(this,"setDrawingTool",c=>{var f;this.tools&&((f=this.tools.current)==null||f.stop(),this.tools.setCurrent(c))}),r(this,"setVisible",c=>{c?this.svg.style.display=null:(this.deselect(),this.svg.style.display="none")}),r(this,"stopDrawing",()=>{var c;(c=this.tools)!=null&&c.current&&(this.tools.current.isDrawing&&this.tools.current.stop(),this.mouseTracker.enabled=!1,this.tools.current.enabled=!1)}),this.viewer=d.viewer,this.config=d.config,this.env=d.env,this.readOnly=d.config.readOnly,this.headless=d.config.headless,d.config.formatter?this.formatters=[d.config.formatter]:d.config.formatters&&(this.formatters=Array.isArray(d.config.formatters)?d.config.formatters:[d.config.formatters]),this.disableSelect=d.config.disableSelect,this.drawOnSingleClick=d.config.drawOnSingleClick,this.svg=document.createElementNS(Hi,"svg"),Qae?(this.svg.setAttribute("class","a9s-annotationlayer a9s-osd-annotationlayer touch"),vae(this.svg)):this.svg.setAttribute("class","a9s-annotationlayer a9s-osd-annotationlayer"),this.g=document.createElementNS(Hi,"g"),this.svg.appendChild(this.g),this.viewer.canvas.appendChild(this.svg),this.viewer.addHandler("animation",()=>this.resize()),this.viewer.addHandler("rotate",()=>this.resize()),this.viewer.addHandler("resize",()=>this.resize()),this.viewer.addHandler("flip",()=>this.resize()),this.loaded=!1;const a=()=>{const{x:c,y:f}=this.viewer.world.getItemAt(0).source.dimensions,m=this.viewer.world.getItemAt(0).source["@id"]||new URL(this.viewer.world.getItemAt(0).source.url,document.baseURI).href;this.env.image={src:m,naturalWidth:c,naturalHeight:f},d.config.crosshair&&(this.crosshair||(this.crosshair=new Hae(this.svg),Gl(this.svg,"no-cursor"))),this.loaded||this.emit("load",m),this.loaded=!0,this.g.style.display="inline",this.resize()};this.viewer.addHandler("open",a),this.viewer.world.addHandler("add-item",a),this.viewer.world.getItemAt(0)&&a(),this.store=new Zae(this.env),this.selectedShape=null,this.hoveredShape=null,this._initMouseEvents()}resize(){var d;const a=this.viewer.viewport.getFlip(),c=this.viewer.viewport.pixelFromPoint(new ql.Point(0,0),!0);a&&(c.x=this.viewer.viewport._containerInnerSize.x-c.x);const f=this.currentScale(),m=a?-f:f,v=this.viewer.viewport.getRotation();this.g.setAttribute("transform",`translate(${c.x}, ${c.y}) scale(${m}, ${f}) rotate(${v})`),this._refreshNonScalingAnnotations(),this.scaleFormatterElements(),this.selectedShape&&(this.selectedShape.element?(this.scaleTool(this.selectedShape),this.emit("viewportChange",this.selectedShape.element)):this.emit("viewportChange",this.selectedShape)),(d=this.tools)!=null&&d.current&&this.scaleTool(this.tools.current)}}class Jae extends jM{constructor(d){super(d),r(this,"onDrawingComplete",a=>{var c;this.mouseTracker.enabled=(c=this.config.hotkey)==null?void 0:c.inverted,this.selectShape(a),this.emit("createSelection",a.annotation)}),this._initDrawingTools()}}const qx=l=>{const d=l.viewport.viewportToImageRectangle(l.viewport.getBounds(!0)),a=l.viewport.getContainerSize().x,c=l.viewport.getZoom(!0)*a/l.world.getContentFactor();return{extent:d,scale:c}},$ae=l=>{var d;const a=l.targets[0];return a?Array.isArray(a.selector)?a.selector[0].type:(d=a.selector)==null?void 0:d.type:null},WM=(l,d)=>{const{extent:a,scale:c}=qx(l),{selector:f}=d,m=dd.create({target:d});if(f.type==="SvgSelector"){const v=hd(m),_=v.nodeName.toLowerCase();let w=null;if(_==="polygon")w=ele(v,a,c);else if(_==="circle")w=tle(v,a,c);else if(_==="ellipse")w=ile(v,a,c);else if(_==="path")w=nle(v,a,c);else throw`Unsupported SVG shape type: ${_}`;let x=w.outerHTML||new XMLSerializer().serializeToString(w);return x=x.replace(` xmlns="${Hi}"`,""),{...d,selector:{type:"SvgSelector",value:`${x}`}}}else if(f.type==="FragmentSelector"){const{x:v,y:_,w,h:x}=ec(m),E=a.x+v/c,N=a.y+_/c,H=w/c,Y=x/c;return w===0&&x===0?{...gf(E,N,H,Y),renderedVia:{name:"point"}}:gf(E,N,H,Y)}else throw`Unsupported selector type: ${f.type}`},ele=(l,d,a)=>{const c=Array.from(l.points).map(f=>{const m=d.x+f.x/a,v=d.y+f.y/a;return m+","+v}).join(" ");return l.setAttribute("points",c),l},tle=(l,d,a)=>{const c=parseFloat(l.getAttribute("cx")),f=parseFloat(l.getAttribute("cy")),m=parseFloat(l.getAttribute("r"));return l.setAttribute("cx",d.x+c/a),l.setAttribute("cy",d.y+f/a),l.setAttribute("r",m/a),l},ile=(l,d,a)=>{const c=parseFloat(l.getAttribute("cx")),f=parseFloat(l.getAttribute("cy")),m=parseFloat(l.getAttribute("rx")),v=parseFloat(l.getAttribute("ry"));return l.setAttribute("cx",d.x+c/a),l.setAttribute("cy",d.y+f/a),l.setAttribute("rx",m/a),l.setAttribute("ry",v/a),l},nle=(l,d,a)=>{const c=l.getAttribute("d").split(/(?=M|m|L|l|H|h|V|v|Z|z)/g).map(f=>f.trim()).map(f=>{const m=f.substring(0,1);if(m.toLowerCase()==="z")return m;{const v=f.substring(1).split(" ").map(E=>parseFloat(E.trim())),_=m===m.toUpperCase(),w=_?d.x+v[0]/a:v[0]/a,x=_?d.y+v[1]/a:v[1]/a;return m+" "+w+" "+x}}).join(" ");return l.setAttribute("d",c),l},qM=(l,d)=>{const{extent:a,scale:c}=qx(l),f=d.selector("FragmentSelector");if(d.selector("SvgSelector")){const m=hd(d),v=m.nodeName.toLowerCase();let _=null;if(v==="polygon")_=rle(m,a,c);else if(v==="circle")_=sle(m,a,c);else if(v==="ellipse")_=ole(m,a,c);else if(v==="path")_=ale(m,a,c);else throw`Unsupported SVG shape type: ${v}`;let w=_.outerHTML||new XMLSerializer().serializeToString(_);w=w.replace(` xmlns="${Hi}"`,"");const x={selector:{type:"SvgSelector",value:`${w}`}};return d.clone({target:x})}else if(f){const{x:m,y:v,w:_,h:w}=ec(d),x=(m-a.x)*c,E=(v-a.y)*c,N=gf(x,E,_*c,w*c);return d.clone({target:N})}},rle=(l,d,a)=>{const c=Array.from(l.points).map(f=>{const m=a*(f.x-d.x),v=a*(f.y-d.y);return m+","+v}).join(" ");return l.setAttribute("points",c),l},sle=(l,d,a)=>{const c=l.getAttribute("cx"),f=l.getAttribute("cy"),m=l.getAttribute("r");return l.setAttribute("cx",a*(c-d.x)),l.setAttribute("cy",a*(f-d.y)),l.setAttribute("r",m*a),l},ole=(l,d,a)=>{const c=l.getAttribute("cx"),f=l.getAttribute("cy"),m=l.getAttribute("rx"),v=l.getAttribute("ry");return l.setAttribute("cx",a*(c-d.x)),l.setAttribute("cy",a*(f-d.y)),l.setAttribute("rx",m*a),l.setAttribute("ry",v*a),l},ale=(l,d,a)=>{const c=l.getAttribute("d").split(/(?=M|m|L|l|H|h|V|v|Z|z)/g).map(f=>f.trim()).map(f=>{const m=f.substring(0,1);if(m.toLowerCase()==="z")return m;{const v=f.substring(1).split(" ").filter(E=>E).map(E=>parseFloat(E.trim())),_=m===m.toUpperCase(),w=_?a*(v[0]-d.x):a*v[0],x=_?a*(v[1]-d.y):a*v[1];return m+" "+w+" "+x}}).join(" ");return l.setAttribute("d",c),l},GM=(l,d)=>{const{extent:a,scale:c}=qx(l),f=$ae(d.annotation);if(f==="FragmentSelector")lle(d,a,c);else if(f==="SvgSelector")ule(d,a,c);else throw`Unsupported selector type type: ${f}`;const m=d.querySelector(".a9s-formatter-el");if(m){const{x:v,y:_}=d.querySelector(".a9s-inner").getBBox();m.setAttribute("x",v),m.setAttribute("y",_)}},lle=(l,d,a)=>{const{x:c,y:f,w:m,h:v}=ec(l.annotation),_=l.querySelector(".a9s-outer"),w=l.querySelector(".a9s-inner"),x=a*(c-d.x),E=a*(f-d.y);m===0&&v===0?[_,w].forEach(N=>{N.setAttribute("cx",x),N.setAttribute("cy",E)}):[_,w].forEach(N=>{N.setAttribute("x",x),N.setAttribute("y",E),N.setAttribute("width",m*a),N.setAttribute("height",v*a)})},ule=(l,d,a)=>{const c=hd(l.annotation),f=c.nodeName.toLowerCase();if(f==="polygon")cle(l,c,d,a);else if(f==="circle")dle(l,c,d,a);else if(f==="ellipse")hle(l,c,d,a);else if(f==="path")fle(l,c,d,a);else throw`Unsupported SVG shape type: ${f}`},cle=(l,d,a,c)=>{const f=Array.from(d.points).map(m=>{const v=c*(m.x-a.x),_=c*(m.y-a.y);return v+","+_}).join(" ");l.querySelector(".a9s-outer").setAttribute("points",f),l.querySelector(".a9s-inner").setAttribute("points",f)},dle=(l,d,a,c)=>{const f=c*(d.getAttribute("cx")-a.x),m=c*(d.getAttribute("cy")-a.y),v=c*d.getAttribute("r"),_=l.querySelector(".a9s-outer");_.setAttribute("cx",f),_.setAttribute("cy",m),_.setAttribute("r",v);const w=l.querySelector(".a9s-inner");w.setAttribute("cx",f),w.setAttribute("cy",m),w.setAttribute("r",v)},hle=(l,d,a,c)=>{const f=c*(d.getAttribute("cx")-a.x),m=c*(d.getAttribute("cy")-a.y),v=c*d.getAttribute("rx"),_=c*d.getAttribute("ry"),w=l.querySelector(".a9s-outer");w.setAttribute("cx",f),w.setAttribute("cy",m),w.setAttribute("rx",v),w.setAttribute("ry",_);const x=l.querySelector(".a9s-inner");x.setAttribute("cx",f),x.setAttribute("cy",m),x.setAttribute("rx",v),x.setAttribute("ry",_)},fle=(l,d,a,c)=>{const f=d.getAttribute("d").split(/(?=M|m|L|l|H|h|V|v|Z|z)/g).map(m=>m.trim()).map(m=>{const v=m.substring(0,1);if(v.toLowerCase()==="z")return v;{const _=m.substring(1).split(" ").filter(N=>N).map(N=>parseFloat(N.trim())),w=v===v.toUpperCase(),x=w?c*(_[0]-a.x):c*_[0],E=w?c*(_[1]-a.y):c*_[1];return v+" "+x+" "+E}}).join(" ");l.querySelector(".a9s-inner").setAttribute("d",f),l.querySelector(".a9s-outer").setAttribute("d",f)},ple=Mx();class mle extends jM{constructor(d){super(d),r(this,"_fit",(a,c,f)=>{const m=c?typeof c=="boolean"?c:c.immediately:!1,v=(c==null?void 0:c.padding)||0,_=this.findShape(a);if(_){const w=this.viewer.container.getBoundingClientRect(),x=_.getBoundingClientRect(),E=x.x-w.x,N=x.y-w.y,{width:H,height:Y}=x,ee=E-v,be=N-v,me=H+2*v,ke=Y+2*v,U=this.viewer.viewport.viewerElementToViewportRectangle(new ql.Rect(ee,be,me,ke));this.viewer.viewport[f](U,m)}}),r(this,"_getShapeAt",a=>{const c=w=>{if(ple){const x=this.svg.getBoundingClientRect(),E=w.clientX-x.x,N=w.clientY-x.y;return new ql.Point(E,N)}else return new ql.Point(w.offsetX,w.offsetY)},f=this.viewer.viewport.viewerElementToViewportCoordinates(c(a)),{x:m,y:v}=this.viewer.viewport.viewportToImageCoordinates(f.x,f.y),_=this.store.getAnnotationAt(m,v,this.currentScale());if(_)return this.findShape(_)}),r(this,"_refreshNonScalingAnnotations",()=>{}),r(this,"addAnnotation",(a,c)=>{const f=c||this.g,m=zx(a,this.env.image);return Gl(m,"a9s-annotation"),m.setAttribute("data-id",a.id),m.annotation=a,GM(this.viewer,m),f.appendChild(m),pv(m,a,this.formatters),m}),r(this,"addOrUpdateAnnotation",(a,c)=>{var f;const m=(f=this.selectedShape)==null?void 0:f.annotation;(m===a||m!=null&&m.isSelection||m==c)&&this.deselect(),c&&this.removeAnnotation(a),this.removeAnnotation(a),this.addAnnotation(a),this.store.insert(a)}),r(this,"deselect",()=>{var a;if((a=this.tools)==null||a.current.stop(),this.selectedShape){const{annotation:c}=this.selectedShape;this.selectedShape.destroy?(this.selectedShape.mouseTracker.destroy(),this.selectedShape.destroy(),c.isSelection||this.addAnnotation(c)):cv(this.selectedShape,"selected"),this.selectedShape=null}}),r(this,"onDrawingComplete",a=>{const c=a.annotation.clone({target:WM(this.viewer,a.annotation.target)});a.annotation=c,this.selectShape(a),this.emit("createSelection",a.annotation),this.mouseTracker.enabled=!1}),r(this,"selectShape",(a,c)=>{var f;if(!c&&!a.annotation.isSelection&&this.emit("clickAnnotation",a.annotation,a),((f=this.selectedShape)==null?void 0:f.annotation)===a.annotation)return;this.selectedShape&&this.selectedShape.annotation!==a.annotation&&this.deselect(!0);const{annotation:m}=a;if(this.readOnly||m.readOnly||this.headless)this.selectedShape=a,Gl(a,"selected"),c||this.emit("select",{annotation:m,element:a,skipEvent:c});else{setTimeout(()=>{a.parentNode.removeChild(a),c||this.emit("select",{annotation:m,element:this.selectedShape.element})},1);const v=this.tools.forAnnotation(m);this.selectedShape=v.createEditableShape(m),this.selectedShape.element.annotation=m;const _=qM(this.viewer,m);this.selectedShape.updateState(_);const w=new ql.MouseTracker({element:this.svg,preProcessEventHandler:x=>{x.stopPropagation=!0,x.preventDefault=!1,x.preventGesture=!0}}).setTracking(!1);this.selectedShape.element.addEventListener("mouseenter",()=>{this.hoveredShape=this.selectedShape,w.setTracking(!0)}),this.selectedShape.element.addEventListener("mouseleave",()=>{this.hoveredShape=null,w.setTracking(!1)}),this.selectedShape.mouseTracker=w,this.selectedShape.on("update",x=>{const E=WM(this.viewer,x);this.selectedShape.element.annotation=this.selectedShape.annotation.clone({target:E}),this.emit("updateTarget",this.selectedShape.element,E)})}}),this._initDrawingTools(!0)}resize(){if(this.store&&(Array.from(this.g.querySelectorAll(".a9s-annotation:not(.selected)")).forEach(d=>GM(this.viewer,d)),this.selectedShape))if(this.selectedShape.element){const d=qM(this.viewer,this.selectedShape.element.annotation);this.selectedShape.updateState&&this.selectedShape.updateState(d),this.emit("viewportChange",this.selectedShape.element)}else this.emit("viewportChange",this.selectedShape)}}var gle=0;function KM(l,d,a,c,f){var m,v,_={};for(v in d)v=="ref"?m=d[v]:_[v]=d[v];var w={type:l,props:_,key:a,ref:m,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--gle,__source:c,__self:f};if(typeof l=="function"&&(m=l.defaultProps))for(v in m)_[v]===void 0&&(_[v]=m[v]);return o.vnode&&o.vnode(w),w}class yle extends ae{constructor(d){super(d),r(this,"clearState",a=>this.setState({selectedAnnotation:null,selectedDOMElement:null,modifiedTarget:null,beforeHeadlessModify:null},a)),r(this,"forwardEvent",(a,c)=>{this.annotationLayer.on(a,(f,m)=>{this.props[c](f.clone(),m)})}),r(this,"onKeyUp",a=>{if(a.which===27){this.annotationLayer.stopDrawing();const{selectedAnnotation:c}=this.state;c&&(this.cancelSelected(),this.props.onCancelSelected(c))}else if(a.which===46){const{disableDeleteKey:c}=this.props.config;if(!c){const{selectedAnnotation:f}=this.state;f&&(f.isSelection?this.onCancelAnnotation(f):this.onDeleteAnnotation(f))}}}),r(this,"handleStartSelect",a=>this.props.onSelectionStarted(a)),r(this,"handleEndSelect",a=>this.props.onSelectionEnded(a)),r(this,"handleSelect",(a,c)=>{this.state.editorDisabled?this.onHeadlessSelect(a,c):this.onNormalSelect(a,c)}),r(this,"onNormalSelect",(a,c)=>{const{annotation:f,element:m}=a;if(f){const v=()=>{this.setState({selectedAnnotation:f,selectedDOMElement:m,modifiedTarget:null},()=>{c||(f.isSelection?this.props.onSelectionCreated(f.clone()):this.props.onAnnotationSelected(f.clone(),m))})},{selectedAnnotation:_}=this.state;_&&!_.isEqual(f)?this.clearState(()=>{this.props.onCancelSelected(_),v()}):v()}else{const{selectedAnnotation:v}=this.state;v?this.clearState(()=>this.props.onCancelSelected(v)):this.clearState()}}),r(this,"onHeadlessSelect",(a,c)=>{this.saveSelected().then(()=>{this.onNormalSelect(a,c)})}),r(this,"handleUpdateTarget",(a,c)=>{this.setState({selectedDOMElement:a,modifiedTarget:c});const f=JSON.parse(JSON.stringify(c));this.props.onSelectionTargetChanged(f)}),r(this,"handleViewportChange",a=>this.setState({selectedDOMElement:a})),r(this,"overrideAnnotationId",a=>c=>{const{id:f}=a;this.state.selectedAnnotation?this.setState({selectedAnnotation:null,selectedDOMElement:null,modifiedTarget:null},()=>{this.annotationLayer.overrideId(f,c)}):this.annotationLayer.overrideId(f,c)}),r(this,"onCreateOrUpdateAnnotation",(a,c)=>(f,m)=>{let v=f.isSelection?f.toAnnotation():f;v=this.state.modifiedTarget?v.clone({target:this.state.modifiedTarget}):v.clone(),this.clearState(()=>{this.annotationLayer.addOrUpdateAnnotation(v,m),m?this.props[a](v,m.clone()):this.props[a](v,this.overrideAnnotationId(v)),c&&c()})}),r(this,"onDeleteAnnotation",a=>{this.clearState(),this.annotationLayer.removeAnnotation(a),this.props.onAnnotationDeleted(a)}),r(this,"onCancelAnnotation",(a,c)=>{this.state.editorDisabled||this.annotationLayer.deselect(),this.props.onCancelSelected(a),this.clearState(c)}),r(this,"addAnnotation",a=>{var c;a.id===((c=this.state.selectedAnnotation)==null?void 0:c.id)&&(this.annotationLayer.deselect(),this.clearState()),this.annotationLayer.addOrUpdateAnnotation(a.clone())}),r(this,"addDrawingTool",a=>this.annotationLayer.addDrawingTool(a)),r(this,"cancelSelected",()=>new Promise(a=>{this.annotationLayer.deselect(),this.state.selectedAnnotation?this.clearState(a):a()})),r(this,"fitBounds",(a,c)=>this.annotationLayer.fitBounds(a,c)),r(this,"fitBoundsWithConstraints",(a,c)=>this.annotationLayer.fitBoundsWithConstraints(a,c)),r(this,"getAnnotationById",a=>{var c;return(c=this.annotationLayer.findShape(a))==null?void 0:c.annotation}),r(this,"getAnnotations",()=>this.annotationLayer.getAnnotations().map(a=>a.clone())),r(this,"getAnnotationsIntersecting",a=>this.annotationLayer.getAnnotationsIntersecting(a)),r(this,"getImageSnippetById",a=>this.annotationLayer.getImageSnippetById(a)),r(this,"getSelected",()=>{var a;if(this.state.selectedAnnotation)return this.state.editorDisabled?this.state.selectedAnnotation:(a=this._editor.current)==null?void 0:a.getCurrentAnnotation()}),r(this,"getSelectedImageSnippet",()=>this.annotationLayer.getSelectedImageSnippet()),r(this,"listDrawingTools",()=>this.annotationLayer.listDrawingTools()),r(this,"panTo",(a,c)=>this.annotationLayer.panTo(a,c)),r(this,"removeAnnotation",a=>this.annotationLayer.removeAnnotation(a)),r(this,"removeDrawingTool",a=>this.annotationLayer.removeDrawingTool(a)),r(this,"saveSelected",()=>new Promise(a=>{const c=this.state.selectedAnnotation;if(c)if(this._editor.current)this._editor.current.onOk(),a();else if(c.isSelection)c.bodies.length>0||this.props.config.allowEmpty?this.onCreateOrUpdateAnnotation("onAnnotationCreated",a)(c):(this.annotationLayer.deselect(),a());else{const{beforeHeadlessModify:f,modifiedTarget:m}=this.state;f?this.onCreateOrUpdateAnnotation("onAnnotationUpdated",a)(c,f):m?this.onCreateOrUpdateAnnotation("onAnnotationUpdated",a)(c,c):this.onCancelAnnotation(c,a)}else a()})),r(this,"selectAnnotation",a=>{const c=this.annotationLayer.selectAnnotation(a,!0);if(c)return this.handleSelect(c,!0),c.annotation.clone();this.clearState()}),r(this,"setAnnotations",a=>this.annotationLayer.init(a.map(c=>c.clone()))),r(this,"setDrawingEnabled",a=>this.annotationLayer.setDrawingEnabled(a)),r(this,"setDrawingTool",a=>this.annotationLayer.setDrawingTool(a)),r(this,"setVisible",a=>{this.annotationLayer.setVisible(a),a||this.clearState()}),r(this,"updateSelected",(a,c)=>new Promise(f=>{this.state.selectedAnnotation&&(c?this.state.selectedAnnotation.isSelection?this.onCreateOrUpdateAnnotation("onAnnotationCreated",f)(a):this.onCreateOrUpdateAnnotation("onAnnotationUpdated",f)(a,this.state.selectedAnnotation):this.setState({selectedAnnotation:a,beforeHeadlessModify:this.state.beforeHeadlessModify||this.state.selectedAnnotation},f))})),this.state={selectedAnnotation:null,selectedDOMElement:null,modifiedTarget:null,readOnly:d.config.readOnly,editorDisabled:d.config.disableEditor,widgets:d.config.widgets,beforeHeadlessModify:null},this._editor=Je.createRef()}componentDidMount(){this.annotationLayer=this.props.config.gigapixelMode?new mle(this.props):new Jae(this.props),this.annotationLayer.on("load",this.props.onLoad),this.annotationLayer.on("startSelection",this.handleStartSelect),this.annotationLayer.on("endSelection",this.handleEndSelect),this.annotationLayer.on("select",this.handleSelect),this.annotationLayer.on("updateTarget",this.handleUpdateTarget),this.annotationLayer.on("viewportChange",this.handleViewportChange),this.forwardEvent("clickAnnotation","onClickAnnotation"),this.forwardEvent("mouseEnterAnnotation","onMouseEnterAnnotation"),this.forwardEvent("mouseLeaveAnnotation","onMouseLeaveAnnotation"),document.addEventListener("keyup",this.onKeyUp)}componentWillUnmount(){this.annotationLayer.destroy(),document.removeEventListener("keyup",this.onKeyUp)}get disableEditor(){return this.state.editorDisabled}set disableEditor(d){this.setState({editorDisabled:d})}get disableSelect(){return this.annotationLayer.disableSelect}set disableSelect(d){this.annotationLayer.disableSelect=d}get formatters(){return this.annotationLayer.formatters}set formatters(d){this.annotationLayer.formatters=d}get readOnly(){return this.state.readOnly}set readOnly(d){this.annotationLayer.readOnly=d,this.setState({readOnly:d})}get widgets(){return this.state.widgets}set widgets(d){this.setState({widgets:d})}render(){var d;const a=this.state.selectedAnnotation&&!this.state.editorDisabled,c=this.state.readOnly||((d=this.state.selectedAnnotation)==null?void 0:d.readOnly);return a&&KM(rae,{ref:this._editor,detachable:!0,wrapperEl:this.props.wrapperEl,annotation:this.state.selectedAnnotation,modifiedTarget:this.state.modifiedTarget,selectedElement:this.state.selectedDOMElement,readOnly:c,allowEmpty:this.props.config.allowEmpty,widgets:this.state.widgets,env:this.props.env,onAnnotationCreated:this.onCreateOrUpdateAnnotation("onAnnotationCreated"),onAnnotationUpdated:this.onCreateOrUpdateAnnotation("onAnnotationUpdated"),onAnnotationDeleted:this.onDeleteAnnotation,onCancel:this.onCancelAnnotation})}}class vle{constructor(d,a){r(this,"handleAnnotationCreated",(f,m)=>this._emitter.emit("createAnnotation",f.underlying,m)),r(this,"handleAnnotationDeleted",f=>this._emitter.emit("deleteAnnotation",f.underlying)),r(this,"handleAnnotationSelected",(f,m)=>this._emitter.emit("selectAnnotation",f.underlying,m)),r(this,"handleAnnotationUpdated",(f,m)=>this._emitter.emit("updateAnnotation",f.underlying,m.underlying)),r(this,"handleCancelSelected",f=>this._emitter.emit("cancelSelected",f.underlying)),r(this,"handleClickAnnotation",(f,m)=>this._emitter.emit("clickAnnotation",f.underlying,m)),r(this,"handleLoad",f=>this._emitter.emit("load",f)),r(this,"handleSelectionCreated",f=>this._emitter.emit("createSelection",f.underlying)),r(this,"handleSelectionStarted",f=>this._emitter.emit("startSelection",f)),r(this,"handleSelectionEnded",f=>this._emitter.emit("endSelection",f)),r(this,"handleSelectionTargetChanged",f=>this._emitter.emit("changeSelectionTarget",f)),r(this,"handleMouseEnterAnnotation",(f,m)=>this._emitter.emit("mouseEnterAnnotation",f.underlying,m)),r(this,"handleMouseLeaveAnnotation",(f,m)=>this._emitter.emit("mouseLeaveAnnotation",f.underlying,m)),r(this,"_wrap",f=>(f==null?void 0:f.type)==="Annotation"?new dd(f):f),r(this,"addAnnotation",f=>this._app.current.addAnnotation(new dd(f))),r(this,"addDrawingTool",f=>this._app.current.addDrawingTool(f)),r(this,"cancelSelected",()=>this._app.current.cancelSelected()),r(this,"clearAnnotations",()=>this.setAnnotations([])),r(this,"clearAuthInfo",()=>this._env.user=null),r(this,"destroy",()=>Je.unmountComponentAtNode(this.appContainerEl)),r(this,"fitBounds",(f,m)=>this._app.current.fitBounds(this._wrap(f),m)),r(this,"fitBoundsWithConstraints",(f,m)=>this._app.current.fitBoundsWithConstraints(this._wrap(f),m)),r(this,"getAnnotationById",f=>{const m=this._app.current.getAnnotationById(f);return m==null?void 0:m.underlying}),r(this,"getAnnotations",()=>this._app.current.getAnnotations().map(f=>f.underlying)),r(this,"getAnnotationsIntersecting",f=>this._app.current.getAnnotationsIntersecting(this._wrap(f))),r(this,"getImageSnippetById",f=>this._app.current.getImageSnippetById(f)),r(this,"getSelected",()=>{const f=this._app.current.getSelected();return f==null?void 0:f.underlying}),r(this,"getSelectedImageSnippet",()=>this._app.current.getSelectedImageSnippet()),r(this,"listDrawingTools",()=>this._app.current.listDrawingTools()),r(this,"loadAnnotations",f=>fetch(f).then(m=>m.json()).then(m=>(this.setAnnotations(m),m))),r(this,"off",(f,m)=>this._emitter.off(f,m)),r(this,"on",(f,m)=>this._emitter.on(f,m)),r(this,"once",(f,m)=>this._emitter.once(f,m)),r(this,"panTo",(f,m)=>this._app.current.panTo(this._wrap(f),m)),r(this,"removeAnnotation",f=>this._app.current.removeAnnotation(this._wrap(f))),r(this,"removeDrawingTool",f=>this._app.current.removeDrawingTool(f)),r(this,"saveSelected",()=>this._app.current.saveSelected()),r(this,"selectAnnotation",f=>{const m=this._app.current.selectAnnotation(this._wrap(f));return m==null?void 0:m.underlying}),r(this,"setAnnotations",f=>{const m=(f||[]).map(v=>new dd(v));this._app.current.setAnnotations(m)}),r(this,"setAuthInfo",f=>this._env.user=f),r(this,"setDrawingEnabled",f=>this._app.current.setDrawingEnabled(f)),r(this,"setDrawingTool",f=>this._app.current.setDrawingTool(f)),r(this,"setServerTime",f=>this._env.setServerTime(f)),r(this,"setVisible",f=>this._app.current.setVisible(f)),r(this,"updateSelected",(f,m)=>{let v=null;f.type==="Annotation"?v=new dd(f):f.type==="Selection"&&(v=new Wm(f.target,f.body)),v&&this._app.current.updateSelected(v,m)});const c=a||{};this._app=Je.createRef(),this._emitter=new Cl,this._env=dae(),this._element=d.element,window.getComputedStyle(this._element).getPropertyValue("position")==="static"&&(this._element.style.position="relative"),hae(c.locale,c.messages),this.appContainerEl=document.createElement("DIV"),this._element.appendChild(this.appContainerEl),Je.render(KM(yle,{ref:this._app,viewer:d,wrapperEl:this._element,config:c,env:this._env,onSelectionStarted:this.handleSelectionStarted,onSelectionEnded:this.handleSelectionEnded,onSelectionCreated:this.handleSelectionCreated,onSelectionTargetChanged:this.handleSelectionTargetChanged,onAnnotationCreated:this.handleAnnotationCreated,onAnnotationSelected:this.handleAnnotationSelected,onAnnotationUpdated:this.handleAnnotationUpdated,onAnnotationDeleted:this.handleAnnotationDeleted,onCancelSelected:this.handleCancelSelected,onClickAnnotation:this.handleClickAnnotation,onLoad:this.handleLoad,onMouseEnterAnnotation:this.handleMouseEnterAnnotation,onMouseLeaveAnnotation:this.handleMouseLeaveAnnotation}),this.appContainerEl)}get disableEditor(){return this._app.current.disableEditor}set disableEditor(d){this._app.current.disableEditor=d}get disableSelect(){return this._app.current.disableSelect}set disableSelect(d){this._app.current.disableSelect=d}get formatters(){return this._app.current.formatters||[]}set formatters(d){if(d){const a=Array.isArray(d)?d:[d];this._app.current.formatters=a}else this._app.current.formatters=null}get readOnly(){return this._app.current.readOnly}set readOnly(d){this._app.current.readOnly=d}get widgets(){return this._app.current.widgets}set widgets(d){this._app.current.widgets=d}}var ble=(l,d)=>new vle(l,d);return ble})})(KC);var $8=KC.exports;const eH=uu($8),vh=class vh{static getLanguageName(e){const i=vh.bcp47Languages.find(n=>n.code===e);return i?i.name:null}static getLanguageCode(e){const i=vh.bcp47Languages.find(n=>n.name===e);return i?i.code:null}};_v(vh,"bcp47Languages",[{name:"Afar",code:"aa"},{name:"Abkhaz",code:"ab"},{name:"Avestan",code:"ae"},{name:"Afrikaans",code:"af"},{name:"Akan",code:"ak"},{name:"Amharic",code:"am"},{name:"Aragonese",code:"an"},{name:"Arabic",code:"ar"},{name:"Assamese",code:"as"},{name:"Avaric",code:"av"},{name:"Aymara",code:"ay"},{name:"Azerbaijani",code:"az"},{name:"Bashkir",code:"ba"},{name:"Belarusian",code:"be"},{name:"Bulgarian",code:"bg"},{name:"Bihari languages",code:"bh"},{name:"Bislama",code:"bi"},{name:"Bambara",code:"bm"},{name:"Bengali",code:"bn"},{name:"Tibetan",code:"bo"},{name:"Breton",code:"br"},{name:"Bosnian",code:"bs"},{name:"Catalan; Valencian",code:"ca"},{name:"Chechen",code:"ce"},{name:"Chamorro",code:"ch"},{name:"Corsican",code:"co"},{name:"Cree",code:"cr"},{name:"Czech",code:"cs"},{name:"Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic",code:"cu"},{name:"Chuvash",code:"cv"},{name:"Welsh",code:"cy"},{name:"Danish",code:"da"},{name:"German",code:"de"},{name:"Divehi; Dhivehi; Maldivian",code:"dv"},{name:"Dzongkha",code:"dz"},{name:"Ewe",code:"ee"},{name:"Greek, Modern (1453-)",code:"el"},{name:"English",code:"en"},{name:"Esperanto",code:"eo"},{name:"Spanish; Castilian",code:"es"},{name:"Estonian",code:"et"},{name:"Basque",code:"eu"},{name:"Persian",code:"fa"},{name:"Fulah",code:"ff"},{name:"Finnish",code:"fi"},{name:"Fijian",code:"fj"},{name:"Faroese",code:"fo"},{name:"French",code:"fr"},{name:"Western Frisian",code:"fy"},{name:"Irish",code:"ga"},{name:"Gaelic; Scottish Gaelic",code:"gd"},{name:"Galician",code:"gl"},{name:"Guarani",code:"gn"},{name:"Gujarati",code:"gu"},{name:"Manx",code:"gv"},{name:"Hausa",code:"ha"},{name:"Hebrew",code:"he"},{name:"Hindi",code:"hi"},{name:"Hiri Motu",code:"ho"},{name:"Croatian",code:"hr"},{name:"Haitian; Haitian Creole",code:"ht"},{name:"Hungarian",code:"hu"},{name:"Armenian",code:"hy"},{name:"Herero",code:"hz"},{name:"Interlingua (International Auxiliary Language Association)",code:"ia"},{name:"Indonesian",code:"id"},{name:"Interlingue; Occidental",code:"ie"},{name:"Igbo",code:"ig"},{name:"Sichuan Yi; Nuosu",code:"ii"},{name:"Inupiaq",code:"ik"},{name:"Ido",code:"io"},{name:"Icelandic",code:"is"},{name:"Italian",code:"it"},{name:"Inuktitut",code:"iu"},{name:"Japanese",code:"ja"},{name:"Javanese",code:"jv"},{name:"Georgian",code:"ka"},{name:"Kongo",code:"kg"},{name:"Kikuyu; Gikuyu",code:"ki"},{name:"Kuanyama; Kwanyama",code:"kj"},{name:"Kazakh",code:"kk"},{name:"Kalaallisut; Greenlandic",code:"kl"},{name:"Central Khmer",code:"km"},{name:"Kannada",code:"kn"},{name:"Korean",code:"ko"},{name:"Kanuri",code:"kr"},{name:"Kashmiri",code:"ks"},{name:"Kurdish",code:"ku"},{name:"Komi",code:"kv"},{name:"Cornish",code:"kw"},{name:"Kirghiz; Kyrgyz",code:"ky"},{name:"Latin",code:"la"},{name:"Luxembourgish; Letzeburgesch",code:"lb"},{name:"Ganda",code:"lg"},{name:"Limburgan; Limburger; Limburgish",code:"li"},{name:"Lingala",code:"ln"},{name:"Lao",code:"lo"},{name:"Lithuanian",code:"lt"},{name:"Luba-Katanga",code:"lu"},{name:"Latvian",code:"lv"},{name:"Malagasy",code:"mg"},{name:"Marshallese",code:"mh"},{name:"Maori",code:"mi"},{name:"Macedonian",code:"mk"},{name:"Malayalam",code:"ml"},{name:"Mongolian",code:"mn"},{name:"Marathi",code:"mr"},{name:"Malay",code:"ms"},{name:"Maltese",code:"mt"},{name:"Burmese",code:"my"},{name:"Nauru",code:"na"},{name:"Bokmål, Norwegian; Norwegian Bokmål",code:"nb"},{name:"Ndebele, North; North Ndebele",code:"nd"},{name:"Nepali",code:"ne"},{name:"Ndonga",code:"ng"},{name:"Dutch; Flemish",code:"nl"},{name:"Norwegian Nynorsk; Nynorsk, Norwegian",code:"nn"},{name:"Norwegian",code:"no"},{name:"Ndebele, South; South Ndebele",code:"nr"},{name:"Navajo; Navaho",code:"nv"},{name:"Chichewa; Chewa; Nyanja",code:"ny"},{name:"Occitan (post 1500)",code:"oc"},{name:"Ojibwa",code:"oj"},{name:"Oromo",code:"om"},{name:"Oriya",code:"or"},{name:"Ossetian; Ossetic",code:"os"},{name:"Panjabi; Punjabi",code:"pa"},{name:"Pali",code:"pi"},{name:"Polish",code:"pl"},{name:"Pushto; Pashto",code:"ps"},{name:"Portuguese",code:"pt"},{name:"Quechua",code:"qu"},{name:"Romansh",code:"rm"},{name:"Rundi",code:"rn"},{name:"Romanian; Moldavian; Moldovan",code:"ro"},{name:"Russian",code:"ru"},{name:"Kinyarwanda",code:"rw"},{name:"Sanskrit",code:"sa"},{name:"Sardinian",code:"sc"},{name:"Sindhi",code:"sd"},{name:"Northern Sami",code:"se"},{name:"Sango",code:"sg"},{name:"Sinhala; Sinhalese",code:"si"},{name:"Slovak",code:"sk"},{name:"Slovenian",code:"sl"},{name:"Samoan",code:"sm"},{name:"Shona",code:"sn"},{name:"Somali",code:"so"},{name:"Albanian",code:"sq"},{name:"Serbian",code:"sr"},{name:"Swati",code:"ss"},{name:"Sotho, Southern",code:"st"},{name:"Sundanese",code:"su"},{name:"Swedish",code:"sv"},{name:"Swahili",code:"sw"},{name:"Tamil",code:"ta"},{name:"Telugu",code:"te"},{name:"Tajik",code:"tg"},{name:"Thai",code:"th"},{name:"Tigrinya",code:"ti"},{name:"Turkmen",code:"tk"},{name:"Tagalog",code:"tl"},{name:"Tswana",code:"tn"},{name:"Tonga (Tonga Islands)",code:"to"},{name:"Turkish",code:"tr"},{name:"Tsonga",code:"ts"},{name:"Tatar",code:"tt"},{name:"Twi",code:"tw"},{name:"Tahitian",code:"ty"},{name:"Uighur; Uyghur",code:"ug"},{name:"Ukrainian",code:"uk"},{name:"Urdu",code:"ur"},{name:"Uzbek",code:"uz"},{name:"Venda",code:"ve"},{name:"Vietnamese",code:"vi"},{name:"Volapük",code:"vo"},{name:"Walloon",code:"wa"},{name:"Wolof",code:"wo"},{name:"Xhosa",code:"xh"},{name:"Yiddish",code:"yi"},{name:"Yoruba",code:"yo"},{name:"Zhuang; Chuang",code:"za"},{name:"Chinese",code:"zh"},{name:"Zulu",code:"zu"}]),_v(vh,"uiLanguages",[{name:"English",code:"en"},{name:"Français",code:"fr"},{name:"Deutsch",code:"de"},{name:"Italiano",code:"it"},{name:"Español",code:"es"},{name:"Nederlands",code:"nl"},{name:"Dansk",code:"da"},{name:"Português",code:"pt"},{name:"Ελληνικά",code:"el"},{name:"Polski",code:"pl"},{name:"Svenska",code:"sv"},{name:"Norsk",code:"no"},{name:"Suomi",code:"fi"},{name:"Русский",code:"ru"},{name:"हिन्दी",code:"hi"},{name:"日本語",code:"ja"},{name:"한국어",code:"ko"},{name:"Tiếng Việt",code:"vi"},{name:"中文",code:"zh"}]);let dl=vh;function tH(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var YC={exports:{}};(function(t,e){(function(i,n){t.exports=n()})(cl,function(){var i;function n(){return i.apply(null,arguments)}function r(b){i=b}function s(b){return b instanceof Array||Object.prototype.toString.call(b)==="[object Array]"}function o(b){return b!=null&&Object.prototype.toString.call(b)==="[object Object]"}function u(b,C){return Object.prototype.hasOwnProperty.call(b,C)}function h(b){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(b).length===0;var C;for(C in b)if(u(b,C))return!1;return!0}function p(b){return b===void 0}function g(b){return typeof b=="number"||Object.prototype.toString.call(b)==="[object Number]"}function y(b){return b instanceof Date||Object.prototype.toString.call(b)==="[object Date]"}function S(b,C){var B=[],V,ie=b.length;for(V=0;V>>0,V;for(V=0;V0)for(B=0;B=0;return(De?B?"+":"":"-")+Math.pow(10,Math.max(0,ie)).toString().substr(1)+V}var ii=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Ii=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,bi={},hn={};function dt(b,C,B,V){var ie=V;typeof V=="string"&&(ie=function(){return this[V]()}),b&&(hn[b]=ie),C&&(hn[C[0]]=function(){return Et(ie.apply(this,arguments),C[1],C[2])}),B&&(hn[B]=function(){return this.localeData().ordinal(ie.apply(this,arguments),b)})}function un(b){return b.match(/\[[\s\S]/)?b.replace(/^\[|\]$/g,""):b.replace(/\\/g,"")}function Un(b){var C=b.match(ii),B,V;for(B=0,V=C.length;B=0&&Ii.test(b);)b=b.replace(Ii,V),Ii.lastIndex=0,B-=1;return b}var Si={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function mr(b){var C=this._longDateFormat[b],B=this._longDateFormat[b.toUpperCase()];return C||!B?C:(this._longDateFormat[b]=B.match(ii).map(function(V){return V==="MMMM"||V==="MM"||V==="DD"||V==="dddd"?V.slice(1):V}).join(""),this._longDateFormat[b])}var Ce="Invalid date";function Ie(){return this._invalidDate}var O="%d",te=/\d{1,2}/;function Ee(b){return this._ordinal.replace("%d",b)}var Oe={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Q(b,C,B,V){var ie=this._relativeTime[B];return at(ie)?ie(b,C,B,V):ie.replace(/%d/i,b)}function ne(b,C){var B=this._relativeTime[b>0?"future":"past"];return at(B)?B(C):B.replace(/%s/i,C)}var he={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Le(b){return typeof b=="string"?he[b]||he[b.toLowerCase()]:void 0}function nt(b){var C={},B,V;for(V in b)u(b,V)&&(B=Le(V),B&&(C[B]=b[V]));return C}var je={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function Te(b){var C=[],B;for(B in b)u(b,B)&&C.push({unit:B,priority:je[B]});return C.sort(function(V,ie){return V.priority-ie.priority}),C}var Ue=/\d/,Ze=/\d\d/,_t=/\d{3}/,Ut=/\d{4}/,K=/[+-]?\d{6}/,j=/\d\d?/,oe=/\d\d\d\d?/,re=/\d\d\d\d\d\d?/,We=/\d{1,3}/,st=/\d{1,4}/,St=/[+-]?\d{1,6}/,qt=/\d+/,Bt=/[+-]?\d+/,zn=/Z|[+-]\d\d:?\d\d/gi,Oi=/Z|[+-]\d\d(?::?\d\d)?/gi,Er=/[+-]?\d+(\.\d{1,3})?/,_s=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,gr=/^[1-9]\d?/,Vs=/^([1-9]\d|\d)/,qo;qo={};function yt(b,C,B){qo[b]=at(C)?C:function(V,ie){return V&&B?B:C}}function no(b,C){return u(qo,b)?qo[b](C._strict,C._locale):new RegExp(Su(b))}function Su(b){return sr(b.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(C,B,V,ie,De){return B||V||ie||De}))}function sr(b){return b.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function er(b){return b<0?Math.ceil(b)||0:Math.floor(b)}function hi(b){var C=+b,B=0;return C!==0&&isFinite(C)&&(B=er(C)),B}var ws={};function Li(b,C){var B,V=C,ie;for(typeof b=="string"&&(b=[b]),g(C)&&(V=function(De,Ye){Ye[C]=hi(De)}),ie=b.length,B=0;B68?1900:2e3)};var Re=Dt("FullYear",!0);function rt(){return wn(this.year())}function Dt(b,C){return function(B){return B!=null?(Mn(this,b,B),n.updateOffset(this,C),this):Ci(this,b)}}function Ci(b,C){if(!b.isValid())return NaN;var B=b._d,V=b._isUTC;switch(C){case"Milliseconds":return V?B.getUTCMilliseconds():B.getMilliseconds();case"Seconds":return V?B.getUTCSeconds():B.getSeconds();case"Minutes":return V?B.getUTCMinutes():B.getMinutes();case"Hours":return V?B.getUTCHours():B.getHours();case"Date":return V?B.getUTCDate():B.getDate();case"Day":return V?B.getUTCDay():B.getDay();case"Month":return V?B.getUTCMonth():B.getMonth();case"FullYear":return V?B.getUTCFullYear():B.getFullYear();default:return NaN}}function Mn(b,C,B){var V,ie,De,Ye,Rt;if(!(!b.isValid()||isNaN(B))){switch(V=b._d,ie=b._isUTC,C){case"Milliseconds":return void(ie?V.setUTCMilliseconds(B):V.setMilliseconds(B));case"Seconds":return void(ie?V.setUTCSeconds(B):V.setSeconds(B));case"Minutes":return void(ie?V.setUTCMinutes(B):V.setMinutes(B));case"Hours":return void(ie?V.setUTCHours(B):V.setHours(B));case"Date":return void(ie?V.setUTCDate(B):V.setDate(B));case"FullYear":break;default:return}De=B,Ye=b.month(),Rt=b.date(),Rt=Rt===29&&Ye===1&&!wn(De)?28:Rt,ie?V.setUTCFullYear(De,Ye,Rt):V.setFullYear(De,Ye,Rt)}}function An(b){return b=Le(b),at(this[b])?this[b]():this}function tr(b,C){if(typeof b=="object"){b=nt(b);var B=Te(b),V,ie=B.length;for(V=0;V=0?(Rt=new Date(b+400,C,B,V,ie,De,Ye),isFinite(Rt.getFullYear())&&Rt.setFullYear(b)):Rt=new Date(b,C,B,V,ie,De,Ye),Rt}function Al(b){var C,B;return b<100&&b>=0?(B=Array.prototype.slice.call(arguments),B[0]=b+400,C=new Date(Date.UTC.apply(null,B)),isFinite(C.getUTCFullYear())&&C.setUTCFullYear(b)):C=new Date(Date.UTC.apply(null,arguments)),C}function Ma(b,C,B){var V=7+C-B,ie=(7+Al(b,0,V).getUTCDay()-C)%7;return-ie+V-1}function Pu(b,C,B,V,ie){var De=(7+B-V)%7,Ye=Ma(b,V,ie),Rt=1+7*(C-1)+De+Ye,ni,Ei;return Rt<=0?(ni=b-1,Ei=Ht(ni)+Rt):Rt>Ht(b)?(ni=b+1,Ei=Rt-Ht(b)):(ni=b,Ei=Rt),{year:ni,dayOfYear:Ei}}function ar(b,C,B){var V=Ma(b.year(),C,B),ie=Math.floor((b.dayOfYear()-V-1)/7)+1,De,Ye;return ie<1?(Ye=b.year()-1,De=ie+Ws(Ye,C,B)):ie>Ws(b.year(),C,B)?(De=ie-Ws(b.year(),C,B),Ye=b.year()+1):(Ye=b.year(),De=ie),{week:De,year:Ye}}function Ws(b,C,B){var V=Ma(b,C,B),ie=Ma(b+1,C,B);return(Ht(b)-V+ie)/7}dt("w",["ww",2],"wo","week"),dt("W",["WW",2],"Wo","isoWeek"),yt("w",j,gr),yt("ww",j,Ze),yt("W",j,gr),yt("WW",j,Ze),Gn(["w","ww","W","WW"],function(b,C,B,V){C[V.substr(0,1)]=hi(b)});function ku(b){return ar(b,this._week.dow,this._week.doy).week}var Fa={dow:0,doy:6};function Dl(){return this._week.dow}function Na(){return this._week.doy}function Rc(b){var C=this.localeData().week(this);return b==null?C:this.add((b-C)*7,"d")}function pn(b){var C=ar(this,1,4).week;return b==null?C:this.add((b-C)*7,"d")}dt("d",0,"do","day"),dt("dd",0,0,function(b){return this.localeData().weekdaysMin(this,b)}),dt("ddd",0,0,function(b){return this.localeData().weekdaysShort(this,b)}),dt("dddd",0,0,function(b){return this.localeData().weekdays(this,b)}),dt("e",0,0,"weekday"),dt("E",0,0,"isoWeekday"),yt("d",j),yt("e",j),yt("E",j),yt("dd",function(b,C){return C.weekdaysMinRegex(b)}),yt("ddd",function(b,C){return C.weekdaysShortRegex(b)}),yt("dddd",function(b,C){return C.weekdaysRegex(b)}),Gn(["dd","ddd","dddd"],function(b,C,B,V){var ie=B._locale.weekdaysParse(b,V,B._strict);ie!=null?C.d=ie:M(B).invalidWeekday=b}),Gn(["d","e","E"],function(b,C,B,V){C[V]=hi(b)});function ts(b,C){return typeof b!="string"?b:isNaN(b)?(b=C.weekdaysParse(b),typeof b=="number"?b:null):parseInt(b,10)}function Xp(b,C){return typeof b=="string"?C.weekdaysParse(b)%7||7:isNaN(b)?null:b}function Oc(b,C){return b.slice(C,7).concat(b.slice(0,C))}var Zp="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Pl="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Eh="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Yo=_s,Iu=_s,Ch=_s;function Lc(b,C){var B=s(this._weekdays)?this._weekdays:this._weekdays[b&&b!==!0&&this._weekdays.isFormat.test(C)?"format":"standalone"];return b===!0?Oc(B,this._week.dow):b?B[b.day()]:B}function Qp(b){return b===!0?Oc(this._weekdaysShort,this._week.dow):b?this._weekdaysShort[b.day()]:this._weekdaysShort}function Ru(b){return b===!0?Oc(this._weekdaysMin,this._week.dow):b?this._weekdaysMin[b.day()]:this._weekdaysMin}function lr(b,C,B){var V,ie,De,Ye=b.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],V=0;V<7;++V)De=R([2e3,1]).day(V),this._minWeekdaysParse[V]=this.weekdaysMin(De,"").toLocaleLowerCase(),this._shortWeekdaysParse[V]=this.weekdaysShort(De,"").toLocaleLowerCase(),this._weekdaysParse[V]=this.weekdays(De,"").toLocaleLowerCase();return B?C==="dddd"?(ie=Bi.call(this._weekdaysParse,Ye),ie!==-1?ie:null):C==="ddd"?(ie=Bi.call(this._shortWeekdaysParse,Ye),ie!==-1?ie:null):(ie=Bi.call(this._minWeekdaysParse,Ye),ie!==-1?ie:null):C==="dddd"?(ie=Bi.call(this._weekdaysParse,Ye),ie!==-1||(ie=Bi.call(this._shortWeekdaysParse,Ye),ie!==-1)?ie:(ie=Bi.call(this._minWeekdaysParse,Ye),ie!==-1?ie:null)):C==="ddd"?(ie=Bi.call(this._shortWeekdaysParse,Ye),ie!==-1||(ie=Bi.call(this._weekdaysParse,Ye),ie!==-1)?ie:(ie=Bi.call(this._minWeekdaysParse,Ye),ie!==-1?ie:null)):(ie=Bi.call(this._minWeekdaysParse,Ye),ie!==-1||(ie=Bi.call(this._weekdaysParse,Ye),ie!==-1)?ie:(ie=Bi.call(this._shortWeekdaysParse,Ye),ie!==-1?ie:null))}function Mc(b,C,B){var V,ie,De;if(this._weekdaysParseExact)return lr.call(this,b,C,B);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),V=0;V<7;V++){if(ie=R([2e3,1]).day(V),B&&!this._fullWeekdaysParse[V]&&(this._fullWeekdaysParse[V]=new RegExp("^"+this.weekdays(ie,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[V]=new RegExp("^"+this.weekdaysShort(ie,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[V]=new RegExp("^"+this.weekdaysMin(ie,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[V]||(De="^"+this.weekdays(ie,"")+"|^"+this.weekdaysShort(ie,"")+"|^"+this.weekdaysMin(ie,""),this._weekdaysParse[V]=new RegExp(De.replace(".",""),"i")),B&&C==="dddd"&&this._fullWeekdaysParse[V].test(b))return V;if(B&&C==="ddd"&&this._shortWeekdaysParse[V].test(b))return V;if(B&&C==="dd"&&this._minWeekdaysParse[V].test(b))return V;if(!B&&this._weekdaysParse[V].test(b))return V}}function Ah(b){if(!this.isValid())return b!=null?this:NaN;var C=Ci(this,"Day");return b!=null?(b=ts(b,this.localeData()),this.add(b-C,"d")):C}function Jp(b){if(!this.isValid())return b!=null?this:NaN;var C=(this.day()+7-this.localeData()._week.dow)%7;return b==null?C:this.add(b-C,"d")}function kl(b){if(!this.isValid())return b!=null?this:NaN;if(b!=null){var C=Xp(b,this.localeData());return this.day(this.day()%7?C:C-7)}else return this.day()||7}function Fc(b){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Nc.call(this),b?this._weekdaysStrictRegex:this._weekdaysRegex):(u(this,"_weekdaysRegex")||(this._weekdaysRegex=Yo),this._weekdaysStrictRegex&&b?this._weekdaysStrictRegex:this._weekdaysRegex)}function $p(b){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Nc.call(this),b?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(u(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Iu),this._weekdaysShortStrictRegex&&b?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function Dh(b){return this._weekdaysParseExact?(u(this,"_weekdaysRegex")||Nc.call(this),b?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(u(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ch),this._weekdaysMinStrictRegex&&b?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Nc(){function b(Dr,Lo){return Lo.length-Dr.length}var C=[],B=[],V=[],ie=[],De,Ye,Rt,ni,Ei;for(De=0;De<7;De++)Ye=R([2e3,1]).day(De),Rt=sr(this.weekdaysMin(Ye,"")),ni=sr(this.weekdaysShort(Ye,"")),Ei=sr(this.weekdays(Ye,"")),C.push(Rt),B.push(ni),V.push(Ei),ie.push(Rt),ie.push(ni),ie.push(Ei);C.sort(b),B.sort(b),V.sort(b),ie.sort(b),this._weekdaysRegex=new RegExp("^("+ie.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+V.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+B.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+C.join("|")+")","i")}function Bc(){return this.hours()%12||12}function em(){return this.hours()||24}dt("H",["HH",2],0,"hour"),dt("h",["hh",2],0,Bc),dt("k",["kk",2],0,em),dt("hmm",0,0,function(){return""+Bc.apply(this)+Et(this.minutes(),2)}),dt("hmmss",0,0,function(){return""+Bc.apply(this)+Et(this.minutes(),2)+Et(this.seconds(),2)}),dt("Hmm",0,0,function(){return""+this.hours()+Et(this.minutes(),2)}),dt("Hmmss",0,0,function(){return""+this.hours()+Et(this.minutes(),2)+Et(this.seconds(),2)});function Ph(b,C){dt(b,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),C)})}Ph("a",!0),Ph("A",!1);function kh(b,C){return C._meridiemParse}yt("a",kh),yt("A",kh),yt("H",j,Vs),yt("h",j,gr),yt("k",j,gr),yt("HH",j,Ze),yt("hh",j,Ze),yt("kk",j,Ze),yt("hmm",oe),yt("hmmss",re),yt("Hmm",oe),yt("Hmmss",re),Li(["H","HH"],_i),Li(["k","kk"],function(b,C,B){var V=hi(b);C[_i]=V===24?0:V}),Li(["a","A"],function(b,C,B){B._isPm=B._locale.isPM(b),B._meridiem=b}),Li(["h","hh"],function(b,C,B){C[_i]=hi(b),M(B).bigHour=!0}),Li("hmm",function(b,C,B){var V=b.length-2;C[_i]=hi(b.substr(0,V)),C[Kn]=hi(b.substr(V)),M(B).bigHour=!0}),Li("hmmss",function(b,C,B){var V=b.length-4,ie=b.length-2;C[_i]=hi(b.substr(0,V)),C[Kn]=hi(b.substr(V,2)),C[gi]=hi(b.substr(ie)),M(B).bigHour=!0}),Li("Hmm",function(b,C,B){var V=b.length-2;C[_i]=hi(b.substr(0,V)),C[Kn]=hi(b.substr(V))}),Li("Hmmss",function(b,C,B){var V=b.length-4,ie=b.length-2;C[_i]=hi(b.substr(0,V)),C[Kn]=hi(b.substr(V,2)),C[gi]=hi(b.substr(ie))});function tm(b){return(b+"").toLowerCase().charAt(0)==="p"}var Hc=/[ap]\.?m?\.?/i,im=Dt("Hours",!0);function Ou(b,C,B){return b>11?B?"pm":"PM":B?"am":"AM"}var Il={calendar:Wt,longDateFormat:Si,invalidDate:Ce,ordinal:O,dayOfMonthOrdinalParse:te,relativeTime:Oe,months:Fn,monthsShort:Oa,week:Fa,weekdays:Zp,weekdaysMin:Eh,weekdaysShort:Pl,meridiemParse:Hc},cn={},Rl={},Ol;function Ih(b,C){var B,V=Math.min(b.length,C.length);for(B=0;B0;){if(ie=Br(De.slice(0,B).join("-")),ie)return ie;if(V&&V.length>=B&&Ih(De,V)>=B-1)break;B--}C++}return Ol}function ir(b){return!!(b&&b.match("^[^/\\\\]*$"))}function Br(b){var C=null,B;if(cn[b]===void 0&&t&&t.exports&&ir(b))try{C=Ol._abbr,B=tH,B("./locale/"+b),Ss(C)}catch{cn[b]=null}return cn[b]}function Ss(b,C){var B;return b&&(p(C)?B=is(b):B=Hr(b,C),B?Ol=B:typeof console<"u"&&console.warn&&console.warn("Locale "+b+" not found. Did you forget to load it?")),Ol._abbr}function Hr(b,C){if(C!==null){var B,V=Il;if(C.abbr=b,cn[b]!=null)qe("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),V=cn[b]._config;else if(C.parentLocale!=null)if(cn[C.parentLocale]!=null)V=cn[C.parentLocale]._config;else if(B=Br(C.parentLocale),B!=null)V=B._config;else return Rl[C.parentLocale]||(Rl[C.parentLocale]=[]),Rl[C.parentLocale].push({name:b,config:C}),null;return cn[b]=new Ct(ci(V,C)),Rl[b]&&Rl[b].forEach(function(ie){Hr(ie.name,ie.config)}),Ss(b),cn[b]}else return delete cn[b],null}function ro(b,C){if(C!=null){var B,V,ie=Il;cn[b]!=null&&cn[b].parentLocale!=null?cn[b].set(ci(cn[b]._config,C)):(V=Br(b),V!=null&&(ie=V._config),C=ci(ie,C),V==null&&(C.abbr=b),B=new Ct(C),B.parentLocale=cn[b],cn[b]=B),Ss(b)}else cn[b]!=null&&(cn[b].parentLocale!=null?(cn[b]=cn[b].parentLocale,b===Ss()&&Ss(b)):cn[b]!=null&&delete cn[b]);return cn[b]}function is(b){var C;if(b&&b._locale&&b._locale._abbr&&(b=b._locale._abbr),!b)return Ol;if(!s(b)){if(C=Br(b),C)return C;b=[b]}return Nr(b)}function Rh(){return Nt(cn)}function zc(b){var C,B=b._a;return B&&M(b).overflow===-2&&(C=B[Mr]<0||B[Mr]>11?Mr:B[or]<1||B[or]>js(B[Ln],B[Mr])?or:B[_i]<0||B[_i]>24||B[_i]===24&&(B[Kn]!==0||B[gi]!==0||B[xs]!==0)?_i:B[Kn]<0||B[Kn]>59?Kn:B[gi]<0||B[gi]>59?gi:B[xs]<0||B[xs]>999?xs:-1,M(b)._overflowDayOfYear&&(Cor)&&(C=or),M(b)._overflowWeeks&&C===-1&&(C=Go),M(b)._overflowWeekday&&C===-1&&(C=Ra),M(b).overflow=C),b}var nm=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,rm=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Vc=/Z|[+-]\d\d(?::?\d\d)?/,Do=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],Xo=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Lu=/^\/?Date\((-?\d+)/i,Zo=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,nr={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Po(b){var C,B,V=b._i,ie=nm.exec(V)||rm.exec(V),De,Ye,Rt,ni,Ei=Do.length,Dr=Xo.length;if(ie){for(M(b).iso=!0,C=0,B=Ei;CHt(Ye)||b._dayOfYear===0)&&(M(b)._overflowDayOfYear=!0),B=Al(Ye,0,b._dayOfYear),b._a[Mr]=B.getUTCMonth(),b._a[or]=B.getUTCDate()),C=0;C<3&&b._a[C]==null;++C)b._a[C]=V[C]=ie[C];for(;C<7;C++)b._a[C]=V[C]=b._a[C]==null?C===2?1:0:b._a[C];b._a[_i]===24&&b._a[Kn]===0&&b._a[gi]===0&&b._a[xs]===0&&(b._nextDay=!0,b._a[_i]=0),b._d=(b._useUTC?Al:Ao).apply(null,V),De=b._useUTC?b._d.getUTCDay():b._d.getDay(),b._tzm!=null&&b._d.setUTCMinutes(b._d.getUTCMinutes()-b._tzm),b._nextDay&&(b._a[_i]=24),b._w&&typeof b._w.d<"u"&&b._w.d!==De&&(M(b).weekdayMismatch=!0)}}function Es(b){var C,B,V,ie,De,Ye,Rt,ni,Ei;C=b._w,C.GG!=null||C.W!=null||C.E!=null?(De=1,Ye=4,B=mn(C.GG,b._a[Ln],ar($i(),1,4).year),V=mn(C.W,1),ie=mn(C.E,1),(ie<1||ie>7)&&(ni=!0)):(De=b._locale._week.dow,Ye=b._locale._week.doy,Ei=ar($i(),De,Ye),B=mn(C.gg,b._a[Ln],Ei.year),V=mn(C.w,Ei.week),C.d!=null?(ie=C.d,(ie<0||ie>6)&&(ni=!0)):C.e!=null?(ie=C.e+De,(C.e<0||C.e>6)&&(ni=!0)):ie=De),V<1||V>Ws(B,De,Ye)?M(b)._overflowWeeks=!0:ni!=null?M(b)._overflowWeekday=!0:(Rt=Pu(B,V,ie,De,Ye),b._a[Ln]=Rt.year,b._dayOfYear=Rt.dayOfYear)}n.ISO_8601=function(){},n.RFC_2822=function(){};function qs(b){if(b._f===n.ISO_8601){Po(b);return}if(b._f===n.RFC_2822){Wc(b);return}b._a=[],M(b).empty=!0;var C=""+b._i,B,V,ie,De,Ye,Rt=C.length,ni=0,Ei,Dr;for(ie=fn(b._f,b._locale).match(ii)||[],Dr=ie.length,B=0;B0&&M(b).unusedInput.push(Ye),C=C.slice(C.indexOf(V)+V.length),ni+=V.length),hn[De]?(V?M(b).empty=!1:M(b).unusedTokens.push(De),Ts(De,V,b)):b._strict&&!V&&M(b).unusedTokens.push(De);M(b).charsLeftOver=Rt-ni,C.length>0&&M(b).unusedInput.push(C),b._a[_i]<=12&&M(b).bigHour===!0&&b._a[_i]>0&&(M(b).bigHour=void 0),M(b).parsedDateParts=b._a.slice(0),M(b).meridiem=b._meridiem,b._a[_i]=Ll(b._locale,b._a[_i],b._meridiem),Ei=M(b).era,Ei!==null&&(b._a[Ln]=b._locale.erasConvertYear(Ei,b._a[Ln])),Fu(b),zc(b)}function Ll(b,C,B){var V;return B==null?C:b.meridiemHour!=null?b.meridiemHour(C,B):(b.isPM!=null&&(V=b.isPM(B),V&&C<12&&(C+=12),!V&&C===12&&(C=0)),C)}function Nu(b){var C,B,V,ie,De,Ye,Rt=!1,ni=b._f.length;if(ni===0){M(b).invalidFormat=!0,b._d=new Date(NaN);return}for(ie=0;iethis?this:b:Z()});function Bu(b,C){var B,V;if(C.length===1&&s(C[0])&&(C=C[0]),!C.length)return $i();for(B=C[0],V=1;Vthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Bh(){if(!p(this._isDSTShifted))return this._isDSTShifted;var b={},C;return ye(b,this),b=Oh(b),b._a?(C=b._isUTC?R(b._a):$i(b._a),this._isDSTShifted=this.isValid()&&Xc(b._a,C.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Nl(){return this.isValid()?!this._isUTC:!1}function Qc(){return this.isValid()?this._isUTC:!1}function Jc(){return this.isValid()?this._isUTC&&this._offset===0:!1}var $c=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Hh=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Ur(b,C){var B=b,V=null,ie,De,Ye;return Uu(b)?B={ms:b._milliseconds,d:b._days,M:b._months}:g(b)||!isNaN(+b)?(B={},C?B[C]=+b:B.milliseconds=+b):(V=$c.exec(b))?(ie=V[1]==="-"?-1:1,B={y:0,d:hi(V[or])*ie,h:hi(V[_i])*ie,m:hi(V[Kn])*ie,s:hi(V[gi])*ie,ms:hi(zu(V[xs]*1e3))*ie}):(V=Hh.exec(b))?(ie=V[1]==="-"?-1:1,B={y:Cs(V[2],ie),M:Cs(V[3],ie),w:Cs(V[4],ie),d:Cs(V[5],ie),h:Cs(V[6],ie),m:Cs(V[7],ie),s:Cs(V[8],ie)}):B==null?B={}:typeof B=="object"&&("from"in B||"to"in B)&&(Ye=hm($i(B.from),$i(B.to)),B={},B.ms=Ye.milliseconds,B.M=Ye.months),De=new Hu(B),Uu(b)&&u(b,"_locale")&&(De._locale=b._locale),Uu(b)&&u(b,"_isValid")&&(De._isValid=b._isValid),De}Ur.fn=Hu.prototype,Ur.invalid=Ml;function Cs(b,C){var B=b&&parseFloat(b.replace(",","."));return(isNaN(B)?0:B)*C}function za(b,C){var B={};return B.months=C.month()-b.month()+(C.year()-b.year())*12,b.clone().add(B.months,"M").isAfter(C)&&--B.months,B.milliseconds=+C-+b.clone().add(B.months,"M"),B}function hm(b,C){var B;return b.isValid()&&C.isValid()?(C=Vu(C,b),b.isBefore(C)?B=za(b,C):(B=za(C,b),B.milliseconds=-B.milliseconds,B.months=-B.months),B):{milliseconds:0,months:0}}function Va(b,C){return function(B,V){var ie,De;return V!==null&&!isNaN(+V)&&(qe(C,"moment()."+C+"(period, number) is deprecated. Please use moment()."+C+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),De=B,B=V,V=De),ie=Ur(B,V),Uh(this,ie,b),this}}function Uh(b,C,B,V){var ie=C._milliseconds,De=zu(C._days),Ye=zu(C._months);b.isValid()&&(V=V??!0,Ye&&Co(b,Ci(b,"Month")+Ye*B),De&&Mn(b,"Date",Ci(b,"Date")+De*B),ie&&b._d.setTime(b._d.valueOf()+ie*B),V&&n.updateOffset(b,De||Ye))}var zh=Va(1,"add"),Vh=Va(-1,"subtract");function jh(b){return typeof b=="string"||b instanceof String}function Wh(b){return le(b)||y(b)||jh(b)||g(b)||qh(b)||Bl(b)||b===null||b===void 0}function Bl(b){var C=o(b)&&!h(b),B=!1,V=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],ie,De,Ye=V.length;for(ie=0;ieB.valueOf():B.valueOf()9999?rn(B,C?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):at(Date.prototype.toISOString)?C?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",rn(B,"Z")):rn(B,C?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function _m(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var b="moment",C="",B,V,ie,De;return this.isLocal()||(b=this.utcOffset()===0?"moment.utc":"moment.parseZone",C="Z"),B="["+b+'("]',V=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",ie="-MM-DD[T]HH:mm:ss.SSS",De=C+'[")]',this.format(B+V+ie+De)}function wm(b){b||(b=this.isUtc()?n.defaultFormatUtc:n.defaultFormat);var C=rn(this,b);return this.localeData().postformat(C)}function Tm(b,C){return this.isValid()&&(le(b)&&b.isValid()||$i(b).isValid())?Ur({to:this,from:b}).locale(this.locale()).humanize(!C):this.localeData().invalidDate()}function ed(b){return this.from($i(),b)}function Zh(b,C){return this.isValid()&&(le(b)&&b.isValid()||$i(b).isValid())?Ur({from:this,to:b}).locale(this.locale()).humanize(!C):this.localeData().invalidDate()}function td(b){return this.to($i(),b)}function id(b){var C;return b===void 0?this._locale._abbr:(C=is(b),C!=null&&(this._locale=C),this)}var Hl=tt("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(b){return b===void 0?this.localeData():this.locale(b)});function yi(){return this._locale}var oo=1e3,ea=60*oo,ao=60*ea,qu=(365*400+97)*24*ao;function ns(b,C){return(b%C+C)%C}function ja(b,C,B){return b<100&&b>=0?new Date(b+400,C,B)-qu:new Date(b,C,B).valueOf()}function Qh(b,C,B){return b<100&&b>=0?Date.UTC(b+400,C,B)-qu:Date.UTC(b,C,B)}function Wa(b){var C,B;if(b=Le(b),b===void 0||b==="millisecond"||!this.isValid())return this;switch(B=this._isUTC?Qh:ja,b){case"year":C=B(this.year(),0,1);break;case"quarter":C=B(this.year(),this.month()-this.month()%3,1);break;case"month":C=B(this.year(),this.month(),1);break;case"week":C=B(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":C=B(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":C=B(this.year(),this.month(),this.date());break;case"hour":C=this._d.valueOf(),C-=ns(C+(this._isUTC?0:this.utcOffset()*ea),ao);break;case"minute":C=this._d.valueOf(),C-=ns(C,ea);break;case"second":C=this._d.valueOf(),C-=ns(C,oo);break}return this._d.setTime(C),n.updateOffset(this,!0),this}function Jh(b){var C,B;if(b=Le(b),b===void 0||b==="millisecond"||!this.isValid())return this;switch(B=this._isUTC?Qh:ja,b){case"year":C=B(this.year()+1,0,1)-1;break;case"quarter":C=B(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":C=B(this.year(),this.month()+1,1)-1;break;case"week":C=B(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":C=B(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":C=B(this.year(),this.month(),this.date()+1)-1;break;case"hour":C=this._d.valueOf(),C+=ao-ns(C+(this._isUTC?0:this.utcOffset()*ea),ao)-1;break;case"minute":C=this._d.valueOf(),C+=ea-ns(C,ea)-1;break;case"second":C=this._d.valueOf(),C+=oo-ns(C,oo)-1;break}return this._d.setTime(C),n.updateOffset(this,!0),this}function yn(){return this._d.valueOf()-(this._offset||0)*6e4}function Ai(){return Math.floor(this.valueOf()/1e3)}function ta(){return new Date(this.valueOf())}function Pn(){var b=this;return[b.year(),b.month(),b.date(),b.hour(),b.minute(),b.second(),b.millisecond()]}function Gs(){var b=this;return{years:b.year(),months:b.month(),date:b.date(),hours:b.hours(),minutes:b.minutes(),seconds:b.seconds(),milliseconds:b.milliseconds()}}function xm(){return this.isValid()?this.toISOString():null}function nd(){return q(this)}function Ul(){return P({},M(this))}function Gu(){return M(this).overflow}function Sm(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}dt("N",0,0,"eraAbbr"),dt("NN",0,0,"eraAbbr"),dt("NNN",0,0,"eraAbbr"),dt("NNNN",0,0,"eraName"),dt("NNNNN",0,0,"eraNarrow"),dt("y",["y",1],"yo","eraYear"),dt("y",["yy",2],0,"eraYear"),dt("y",["yyy",3],0,"eraYear"),dt("y",["yyyy",4],0,"eraYear"),yt("N",z),yt("NN",z),yt("NNN",z),yt("NNNN",ue),yt("NNNNN",fe),Li(["N","NN","NNN","NNNN","NNNNN"],function(b,C,B,V){var ie=B._locale.erasParse(b,V,B._strict);ie?M(B).era=ie:M(B).invalidEra=b}),yt("y",qt),yt("yy",qt),yt("yyy",qt),yt("yyyy",qt),yt("yo",ve),Li(["y","yy","yyy","yyyy"],Ln),Li(["yo"],function(b,C,B,V){var ie;B._locale._eraYearOrdinalRegex&&(ie=b.match(B._locale._eraYearOrdinalRegex)),B._locale.eraYearOrdinalParse?C[Ln]=B._locale.eraYearOrdinalParse(b,ie):C[Ln]=parseInt(b,10)});function Em(b,C){var B,V,ie,De=this._eras||is("en")._eras;for(B=0,V=De.length;B=0)return De[V]}function Ku(b,C){var B=b.since<=b.until?1:-1;return C===void 0?n(b.since).year():n(b.since).year()+(C-b.offset)*B}function Cm(){var b,C,B,V=this.localeData().eras();for(b=0,C=V.length;bDe&&(C=De),zr.call(this,b,C,B,V,ie))}function zr(b,C,B,V,ie){var De=Pu(b,C,B,V,ie),Ye=Al(De.year,0,De.dayOfYear);return this.year(Ye.getUTCFullYear()),this.month(Ye.getUTCMonth()),this.date(Ye.getUTCDate()),this}dt("Q",0,"Qo","quarter"),yt("Q",Ue),Li("Q",function(b,C){C[Mr]=(hi(b)-1)*3});function lo(b){return b==null?Math.ceil((this.month()+1)/3):this.month((b-1)*3+this.month()%3)}dt("D",["DD",2],"Do","date"),yt("D",j,gr),yt("DD",j,Ze),yt("Do",function(b,C){return b?C._dayOfMonthOrdinalParse||C._ordinalParse:C._dayOfMonthOrdinalParseLenient}),Li(["D","DD"],or),Li("Do",function(b,C){C[or]=hi(b.match(j)[0])});var qa=Dt("Date",!0);dt("DDD",["DDDD",3],"DDDo","dayOfYear"),yt("DDD",We),yt("DDDD",_t),Li(["DDD","DDDD"],function(b,C,B){B._dayOfYear=hi(b)});function Ro(b){var C=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return b==null?C:this.add(b-C,"d")}dt("m",["mm",2],0,"minute"),yt("m",j,Vs),yt("mm",j,Ze),Li(["m","mm"],Kn);var Ga=Dt("Minutes",!1);dt("s",["ss",2],0,"second"),yt("s",j,Vs),yt("ss",j,Ze),Li(["s","ss"],gi);var Yu=Dt("Seconds",!1);dt("S",0,0,function(){return~~(this.millisecond()/100)}),dt(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),dt(0,["SSS",3],0,"millisecond"),dt(0,["SSSS",4],0,function(){return this.millisecond()*10}),dt(0,["SSSSS",5],0,function(){return this.millisecond()*100}),dt(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),dt(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),dt(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),dt(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),yt("S",We,Ue),yt("SS",We,Ze),yt("SSS",We,_t);var Di,Ks;for(Di="SSSS";Di.length<=9;Di+="S")yt(Di,qt);function As(b,C){C[xs]=hi(("0."+b)*1e3)}for(Di="S";Di.length<=9;Di+="S")Li(Di,As);Ks=Dt("Milliseconds",!1),dt("z",0,0,"zoneAbbr"),dt("zz",0,0,"zoneName");function Xu(){return this._isUTC?"UTC":""}function c0(){return this._isUTC?"Coordinated Universal Time":""}var pt=pe.prototype;pt.add=zh,pt.calendar=Gh,pt.clone=pm,pt.diff=bm,pt.endOf=Jh,pt.format=wm,pt.from=Tm,pt.fromNow=ed,pt.to=Zh,pt.toNow=td,pt.get=An,pt.invalidAt=Gu,pt.isAfter=Kh,pt.isBefore=Yh,pt.isBetween=mm,pt.isSame=gm,pt.isSameOrAfter=ym,pt.isSameOrBefore=vm,pt.isValid=nd,pt.lang=Hl,pt.locale=id,pt.localeData=yi,pt.max=gn,pt.min=Gc,pt.parsingFlags=Ul,pt.set=tr,pt.startOf=Wa,pt.subtract=Vh,pt.toArray=Pn,pt.toObject=Gs,pt.toDate=ta,pt.toISOString=Io,pt.inspect=_m,typeof Symbol<"u"&&Symbol.for!=null&&(pt[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),pt.toJSON=xm,pt.toString=Xh,pt.unix=Ai,pt.valueOf=yn,pt.creationData=Sm,pt.eraName=Cm,pt.eraNarrow=ef,pt.eraAbbr=T,pt.eraYear=A,pt.year=Re,pt.isLeapYear=rt,pt.weekYear=Ge,pt.isoWeekYear=wt,pt.quarter=pt.quarters=lo,pt.month=Au,pt.daysInMonth=Cl,pt.week=pt.weeks=Rc,pt.isoWeek=pt.isoWeeks=pn,pt.weeksInYear=ai,pt.weeksInWeekYear=Yn,pt.isoWeeksInYear=et,pt.isoWeeksInISOWeekYear=jt,pt.date=qa,pt.day=pt.days=Ah,pt.weekday=Jp,pt.isoWeekday=kl,pt.dayOfYear=Ro,pt.hour=pt.hours=im,pt.minute=pt.minutes=Ga,pt.second=pt.seconds=Yu,pt.millisecond=pt.milliseconds=Ks,pt.utcOffset=$o,pt.utc=Ua,pt.local=Zc,pt.parseZone=dm,pt.hasAlignedHourOffset=Fh,pt.isDST=Nh,pt.isLocal=Nl,pt.isUtcOffset=Qc,pt.isUtc=Jc,pt.isUTC=Jc,pt.zoneAbbr=Xu,pt.zoneName=c0,pt.dates=tt("dates accessor is deprecated. Use date instead.",qa),pt.months=tt("months accessor is deprecated. Use month instead",Au),pt.years=tt("years accessor is deprecated. Use year instead",Re),pt.zone=tt("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Dn),pt.isDSTShifted=tt("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Bh);function d0(b){return $i(b*1e3)}function h0(){return $i.apply(null,arguments).parseZone()}function f0(b){return b}var Ni=Ct.prototype;Ni.calendar=wi,Ni.longDateFormat=mr,Ni.invalidDate=Ie,Ni.ordinal=Ee,Ni.preparse=f0,Ni.postformat=f0,Ni.relativeTime=Q,Ni.pastFuture=ne,Ni.set=Pt,Ni.eras=Em,Ni.erasParse=$h,Ni.erasConvertYear=Ku,Ni.erasAbbrRegex=D,Ni.erasNameRegex=I,Ni.erasNarrowRegex=F,Ni.months=Cu,Ni.monthsShort=Fr,Ni.monthsParse=Ko,Ni.monthsRegex=Sh,Ni.monthsShortRegex=Du,Ni.week=ku,Ni.firstDayOfYear=Na,Ni.firstDayOfWeek=Dl,Ni.weekdays=Lc,Ni.weekdaysMin=Ru,Ni.weekdaysShort=Qp,Ni.weekdaysParse=Mc,Ni.weekdaysRegex=Fc,Ni.weekdaysShortRegex=$p,Ni.weekdaysMinRegex=Dh,Ni.isPM=tm,Ni.meridiem=Ou;function rd(b,C,B,V){var ie=is(),De=R().set(V,C);return ie[B](De,b)}function p0(b,C,B){if(g(b)&&(C=b,b=void 0),b=b||"",C!=null)return rd(b,C,B,"month");var V,ie=[];for(V=0;V<12;V++)ie[V]=rd(b,V,B,"month");return ie}function Am(b,C,B,V){typeof b=="boolean"?(g(C)&&(B=C,C=void 0),C=C||""):(C=b,B=C,b=!1,g(C)&&(B=C,C=void 0),C=C||"");var ie=is(),De=b?ie._week.dow:0,Ye,Rt=[];if(B!=null)return rd(C,(B+De)%7,V,"day");for(Ye=0;Ye<7;Ye++)Rt[Ye]=rd(C,(Ye+De)%7,V,"day");return Rt}function m0(b,C){return p0(b,C,"months")}function g0(b,C){return p0(b,C,"monthsShort")}function dT(b,C,B){return Am(b,C,B,"weekdays")}function ia(b,C,B){return Am(b,C,B,"weekdaysShort")}function hT(b,C,B){return Am(b,C,B,"weekdaysMin")}Ss("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(b){var C=b%10,B=hi(b%100/10)===1?"th":C===1?"st":C===2?"nd":C===3?"rd":"th";return b+B}}),n.lang=tt("moment.lang is deprecated. Use moment.locale instead.",Ss),n.langData=tt("moment.langData is deprecated. Use moment.localeData instead.",is);var na=Math.abs;function fT(){var b=this._data;return this._milliseconds=na(this._milliseconds),this._days=na(this._days),this._months=na(this._months),b.milliseconds=na(b.milliseconds),b.seconds=na(b.seconds),b.minutes=na(b.minutes),b.hours=na(b.hours),b.months=na(b.months),b.years=na(b.years),this}function Zu(b,C,B,V){var ie=Ur(C,B);return b._milliseconds+=V*ie._milliseconds,b._days+=V*ie._days,b._months+=V*ie._months,b._bubble()}function pT(b,C){return Zu(this,b,C,1)}function y0(b,C){return Zu(this,b,C,-1)}function v0(b){return b<0?Math.floor(b):Math.ceil(b)}function mT(){var b=this._milliseconds,C=this._days,B=this._months,V=this._data,ie,De,Ye,Rt,ni;return b>=0&&C>=0&&B>=0||b<=0&&C<=0&&B<=0||(b+=v0(tf(B)+C)*864e5,C=0,B=0),V.milliseconds=b%1e3,ie=er(b/1e3),V.seconds=ie%60,De=er(ie/60),V.minutes=De%60,Ye=er(De/60),V.hours=Ye%24,C+=er(Ye/24),ni=er(b0(C)),B+=ni,C-=v0(tf(ni)),Rt=er(B/12),B%=12,V.days=C,V.months=B,V.years=Rt,this}function b0(b){return b*4800/146097}function tf(b){return b*146097/4800}function gT(b){if(!this.isValid())return NaN;var C,B,V=this._milliseconds;if(b=Le(b),b==="month"||b==="quarter"||b==="year")switch(C=this._days+V/864e5,B=this._months+b0(C),b){case"month":return B;case"quarter":return B/3;case"year":return B/12}else switch(C=this._days+Math.round(tf(this._months)),b){case"week":return C/7+V/6048e5;case"day":return C+V/864e5;case"hour":return C*24+V/36e5;case"minute":return C*1440+V/6e4;case"second":return C*86400+V/1e3;case"millisecond":return Math.floor(C*864e5)+V;default:throw new Error("Unknown unit "+b)}}function ra(b){return function(){return this.as(b)}}var _0=ra("ms"),yT=ra("s"),vT=ra("m"),bT=ra("h"),_T=ra("d"),wT=ra("w"),Dm=ra("M"),Pm=ra("Q"),nf=ra("y"),w0=_0;function km(){return Ur(this)}function Im(b){return b=Le(b),this.isValid()?this[b+"s"]():NaN}function Oo(b){return function(){return this.isValid()?this._data[b]:NaN}}var T0=Oo("milliseconds"),TT=Oo("seconds"),sd=Oo("minutes"),xT=Oo("hours"),od=Oo("days"),ST=Oo("months"),x0=Oo("years");function ET(){return er(this.days()/7)}var sa=Math.round,Qu={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function CT(b,C,B,V,ie){return ie.relativeTime(C||1,!!B,b,V)}function Rm(b,C,B,V){var ie=Ur(b).abs(),De=sa(ie.as("s")),Ye=sa(ie.as("m")),Rt=sa(ie.as("h")),ni=sa(ie.as("d")),Ei=sa(ie.as("M")),Dr=sa(ie.as("w")),Lo=sa(ie.as("y")),Ya=De<=B.ss&&["s",De]||De0,Ya[4]=V,CT.apply(null,Ya)}function Ka(b){return b===void 0?sa:typeof b=="function"?(sa=b,!0):!1}function AT(b,C){return Qu[b]===void 0?!1:C===void 0?Qu[b]:(Qu[b]=C,b==="s"&&(Qu.ss=C-1),!0)}function S0(b,C){if(!this.isValid())return this.localeData().invalidDate();var B=!1,V=Qu,ie,De;return typeof b=="object"&&(C=b,b=!1),typeof b=="boolean"&&(B=b),typeof C=="object"&&(V=Object.assign({},Qu,C),C.s!=null&&C.ss==null&&(V.ss=C.s-1)),ie=this.localeData(),De=Rm(this,!B,V,ie),B&&(De=ie.pastFuture(+this,De)),ie.postformat(De)}var rf=Math.abs;function zl(b){return(b>0)-(b<0)||+b}function Ds(){if(!this.isValid())return this.localeData().invalidDate();var b=rf(this._milliseconds)/1e3,C=rf(this._days),B=rf(this._months),V,ie,De,Ye,Rt=this.asSeconds(),ni,Ei,Dr,Lo;return Rt?(V=er(b/60),ie=er(V/60),b%=60,V%=60,De=er(B/12),B%=12,Ye=b?b.toFixed(3).replace(/\.?0+$/,""):"",ni=Rt<0?"-":"",Ei=zl(this._months)!==zl(Rt)?"-":"",Dr=zl(this._days)!==zl(Rt)?"-":"",Lo=zl(this._milliseconds)!==zl(Rt)?"-":"",ni+"P"+(De?Ei+De+"Y":"")+(B?Ei+B+"M":"")+(C?Dr+C+"D":"")+(ie||V||b?"T":"")+(ie?Lo+ie+"H":"")+(V?Lo+V+"M":"")+(b?Lo+Ye+"S":"")):"P0D"}var Mi=Hu.prototype;Mi.isValid=cm,Mi.abs=fT,Mi.add=pT,Mi.subtract=y0,Mi.as=gT,Mi.asMilliseconds=_0,Mi.asSeconds=yT,Mi.asMinutes=vT,Mi.asHours=bT,Mi.asDays=_T,Mi.asWeeks=wT,Mi.asMonths=Dm,Mi.asQuarters=Pm,Mi.asYears=nf,Mi.valueOf=w0,Mi._bubble=mT,Mi.clone=km,Mi.get=Im,Mi.milliseconds=T0,Mi.seconds=TT,Mi.minutes=sd,Mi.hours=xT,Mi.days=od,Mi.weeks=ET,Mi.months=ST,Mi.years=x0,Mi.humanize=S0,Mi.toISOString=Ds,Mi.toString=Ds,Mi.toJSON=Ds,Mi.locale=id,Mi.localeData=yi,Mi.toIsoString=tt("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ds),Mi.lang=Hl,dt("X",0,0,"unix"),dt("x",0,0,"valueOf"),yt("x",Bt),yt("X",Er),Li("X",function(b,C,B){B._d=new Date(parseFloat(b)*1e3)}),Li("x",function(b,C,B){B._d=new Date(hi(b))});//! moment.js return n.version="2.30.1",r($i),n.fn=pt,n.min=Qo,n.max=Kc,n.now=Yc,n.utc=R,n.unix=d0,n.months=m0,n.isDate=y,n.locale=Ss,n.invalid=Z,n.duration=Ur,n.isMoment=le,n.weekdays=dT,n.parseZone=h0,n.localeData=is,n.isDuration=Uu,n.monthsShort=g0,n.weekdaysMin=hT,n.defineLocale=Hr,n.updateLocale=ro,n.locales=Rh,n.weekdaysShort=ia,n.normalizeUnits=Le,n.relativeTimeRounding=Ka,n.relativeTimeThreshold=AT,n.calendarFormat=ju,n.prototype=pt,n.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},n})})(YC);var iH=YC.exports;const nH=uu(iH);class ds{static formatDate(e){return nH(e).format("DD/MM/YYYY")}static createTermObject(e){const i={key:e.term_id,label:e.term_label,data:{label:e.term_label}};return e.vocabulary_id&&(i.data.vocabId=e.vocabulary_id),e.vocabulary_name&&(i.data.vocabTitle=e.vocabulary_name),e.data&&(e.data.description&&(i.data.description=e.data.description),e.data.trace&&(i.data.trace=e.data.trace),e.data.link&&(i.data.link=e.data.link)),i}static annotoriousFormatter(){return function(e){var u,h,p,g,y,S;let i="rdwb-ano-shape",n="Medium",r="#506DAC";if(typeof e.body[0]<"u"){const P=e.body[0].value;typeof((h=(u=P.fields)==null?void 0:u["Line Color"])==null?void 0:h.en)<"u"&&(r=P.fields["Line Color"].en[0]),typeof((g=(p=P.fields)==null?void 0:p["Line Weight"])==null?void 0:g.en)<"u"&&(n=P.fields["Line Weight"].en[0])}let s=0;n==="Light"?s=.7:n==="Dark"&&(s=-.5);let o=`stroke:${ds.adjustColor(r,s)};fill:${ds.adjustColor(r,s)};fill-opacity:0`;return((S=(y=e.target)==null?void 0:y.renderedVia)==null?void 0:S.name)==="point"&&(o=`fill:${ds.adjustColor(r,s)};`),{className:i,style:o}}}static isURL(e){return e.match(/^https?:\/\/\S*$/i)}static generateUUID(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,e=>(+e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+e/4).toString(16))}static adjustColor(e,i){e=String(e).replace(/[^0-9a-f]/gi,""),e.length<6&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),i=i||0;let n="#",r,s;for(s=0;s<3;s++)r=parseInt(e.substring(s*2,s*2+2),16),r=Math.round(Math.min(Math.max(0,r+r*i),255)).toString(16),n+=("00"+r).substring(r.length);return n}}const ma=(t,e)=>{const i=t.__vccOpts||t;for(const[n,r]of e)i[n]=r;return i},rH={name:"TermTagGroup",props:{terms:{type:Array,required:!0},readOnly:{type:Boolean,default:!1}},emits:["tagRemove"],data(){return{activeTerm:null}},computed:{activeTermUrl(){var t;if(this.activeTerm){if((t=this.activeTerm.data)!=null&&t.link)return this.activeTerm.data.link;if(ds.isURL(this.activeTerm.key))return this.activeTerm.key}return null}},methods:{selectTerm(t){this.activeTerm&&this.activeTerm.key===t.key?this.activeTerm=null:this.activeTerm=t},removeTag(t){this.activeTerm=null,this.$emit("tagRemove",t)}}},sH={key:0,class:"term-tag-group flex flex-wrap gap-2"},oH=["aria-label"],aH=["onClick"],lH=["onClick"],uH={key:1,class:"text-sm flex flex-wrap gap-2 mt-4"},cH={key:2,class:"mt-5"},dH={key:3,class:"text-sm mt-5"},hH=["href"];function fH(t,e,i,n,r,s){var o;return X(),se("div",null,[i.terms&&i.terms.length>0?(X(),se("div",sH,[(X(!0),se(ct,null,Kt(i.terms,u=>(X(),se("div",{key:u.key,class:Tt(["p-chip p-component",{active:r.activeTerm&&r.activeTerm.key===u.key}]),"aria-label":u.label},[Se("div",{class:"p-chip-text",onClick:h=>s.selectTerm(u)},it(u.label),9,aH),i.readOnly?Be("",!0):(X(),se("span",{key:0,tabindex:"0",class:"p-chip-remove-icon pi pi-times-circle",onClick:h=>s.removeTag(u)},null,8,lH))],10,oH))),128))])):Be("",!0),r.activeTerm&&r.activeTerm.data&&(r.activeTerm.data.vocabTitle||r.activeTerm.data.trace)?(X(),se("div",uH,[Se("span",null,it(r.activeTerm.data.vocabTitle),1),r.activeTerm.data.trace?(X(!0),se(ct,{key:0},Kt(r.activeTerm.data.trace,u=>(X(),se(ct,null,[e[0]||(e[0]=Se("span",null,">",-1)),Se("span",null,it(u.label),1)],64))),256)):Be("",!0),e[1]||(e[1]=Se("span",null,">",-1)),Se("span",null,it(r.activeTerm.label),1)])):Be("",!0),r.activeTerm&&((o=r.activeTerm.data)!=null&&o.description)?(X(),se("div",cH,it(r.activeTerm.data.description),1)):Be("",!0),s.activeTermUrl?(X(),se("div",dH,[Se("a",{href:s.activeTermUrl,target:"_blank"},it(t.$t("ui.details")),9,hH)])):Be("",!0)])}const XC=ma(rH,[["render",fH],["__scopeId","data-v-577e06d9"]]);/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */const{entries:ZC,setPrototypeOf:QC,isFrozen:pH,getPrototypeOf:mH,getOwnPropertyDescriptor:gH}=Object;let{freeze:hs,seal:bo,create:JC}=Object,{apply:Gb,construct:Kb}=typeof Reflect<"u"&&Reflect;hs||(hs=function(e){return e}),bo||(bo=function(e){return e}),Gb||(Gb=function(e,i,n){return e.apply(i,n)}),Kb||(Kb=function(e,i){return new e(...i)});const zg=ps(Array.prototype.forEach),yH=ps(Array.prototype.lastIndexOf),$C=ps(Array.prototype.pop),tp=ps(Array.prototype.push),vH=ps(Array.prototype.splice),Vg=ps(String.prototype.toLowerCase),Yb=ps(String.prototype.toString),eA=ps(String.prototype.match),ip=ps(String.prototype.replace),bH=ps(String.prototype.indexOf),_H=ps(String.prototype.trim),Ho=ps(Object.prototype.hasOwnProperty),fs=ps(RegExp.prototype.test),np=wH(TypeError);function ps(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var i=arguments.length,n=new Array(i>1?i-1:0),r=1;r2&&arguments[2]!==void 0?arguments[2]:Vg;QC&&QC(t,null);let n=e.length;for(;n--;){let r=e[n];if(typeof r=="string"){const s=i(r);s!==r&&(pH(e)||(e[n]=s),r=s)}t[r]=!0}return t}function TH(t){for(let e=0;e/gm),AH=bo(/\$\{[\w\W]*/gm),DH=bo(/^data-[\-\w.\u00B7-\uFFFF]+$/),PH=bo(/^aria-[\-\w]+$/),sA=bo(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),kH=bo(/^(?:\w+script|data):/i),IH=bo(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),oA=bo(/^html$/i),RH=bo(/^[a-z][.\w]*(-[.\w]+)+$/i);var aA=Object.freeze({__proto__:null,ARIA_ATTR:PH,ATTR_WHITESPACE:IH,CUSTOM_ELEMENT:RH,DATA_ATTR:DH,DOCTYPE_NAME:oA,ERB_EXPR:CH,IS_ALLOWED_URI:sA,IS_SCRIPT_OR_DATA:kH,MUSTACHE_EXPR:EH,TMPLIT_EXPR:AH});const sp={element:1,text:3,progressingInstruction:7,comment:8,document:9},OH=function(){return typeof window>"u"?null:window},LH=function(e,i){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const r="data-tt-policy-suffix";i&&i.hasAttribute(r)&&(n=i.getAttribute(r));const s="dompurify"+(n?"#"+n:"");try{return e.createPolicy(s,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},lA=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function uA(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:OH();const e=Ht=>uA(Ht);if(e.version="3.2.6",e.removed=[],!t||!t.document||t.document.nodeType!==sp.document||!t.Element)return e.isSupported=!1,e;let{document:i}=t;const n=i,r=n.currentScript,{DocumentFragment:s,HTMLTemplateElement:o,Node:u,Element:h,NodeFilter:p,NamedNodeMap:g=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:y,DOMParser:S,trustedTypes:P}=t,R=h.prototype,k=rp(R,"cloneNode"),M=rp(R,"remove"),L=rp(R,"nextSibling"),q=rp(R,"childNodes"),Z=rp(R,"parentNode");if(typeof o=="function"){const Ht=i.createElement("template");Ht.content&&Ht.content.ownerDocument&&(i=Ht.content.ownerDocument)}let J,ae="";const{implementation:ye,createNodeIterator:pe,createDocumentFragment:le,getElementsByTagName:ze}=i,{importNode:tt}=n;let ot=lA();e.isSupported=typeof ZC=="function"&&typeof Z=="function"&&ye&&ye.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:qe,ERB_EXPR:at,TMPLIT_EXPR:Pt,DATA_ATTR:ci,ARIA_ATTR:Ct,IS_SCRIPT_OR_DATA:Nt,ATTR_WHITESPACE:Wt,CUSTOM_ELEMENT:wi}=aA;let{IS_ALLOWED_URI:Et}=aA,ii=null;const Ii=ki({},[...tA,...Xb,...Zb,...Qb,...iA]);let bi=null;const hn=ki({},[...nA,...Jb,...rA,...jg]);let dt=Object.seal(JC(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),un=null,Un=null,rn=!0,fn=!0,Si=!1,mr=!0,Ce=!1,Ie=!0,O=!1,te=!1,Ee=!1,Oe=!1,Q=!1,ne=!1,he=!0,Le=!1;const nt="user-content-";let je=!0,Te=!1,Ue={},Ze=null;const _t=ki({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ut=null;const K=ki({},["audio","video","img","source","image","track"]);let j=null;const oe=ki({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),re="http://www.w3.org/1998/Math/MathML",We="http://www.w3.org/2000/svg",st="http://www.w3.org/1999/xhtml";let St=st,qt=!1,Bt=null;const zn=ki({},[re,We,st],Yb);let Oi=ki({},["mi","mo","mn","ms","mtext"]),Er=ki({},["annotation-xml"]);const _s=ki({},["title","style","font","a","script"]);let gr=null;const Vs=["application/xhtml+xml","text/html"],qo="text/html";let yt=null,no=null;const Su=i.createElement("form"),sr=function(Re){return Re instanceof RegExp||Re instanceof Function},er=function(){let Re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(no&&no===Re)){if((!Re||typeof Re!="object")&&(Re={}),Re=hl(Re),gr=Vs.indexOf(Re.PARSER_MEDIA_TYPE)===-1?qo:Re.PARSER_MEDIA_TYPE,yt=gr==="application/xhtml+xml"?Yb:Vg,ii=Ho(Re,"ALLOWED_TAGS")?ki({},Re.ALLOWED_TAGS,yt):Ii,bi=Ho(Re,"ALLOWED_ATTR")?ki({},Re.ALLOWED_ATTR,yt):hn,Bt=Ho(Re,"ALLOWED_NAMESPACES")?ki({},Re.ALLOWED_NAMESPACES,Yb):zn,j=Ho(Re,"ADD_URI_SAFE_ATTR")?ki(hl(oe),Re.ADD_URI_SAFE_ATTR,yt):oe,Ut=Ho(Re,"ADD_DATA_URI_TAGS")?ki(hl(K),Re.ADD_DATA_URI_TAGS,yt):K,Ze=Ho(Re,"FORBID_CONTENTS")?ki({},Re.FORBID_CONTENTS,yt):_t,un=Ho(Re,"FORBID_TAGS")?ki({},Re.FORBID_TAGS,yt):hl({}),Un=Ho(Re,"FORBID_ATTR")?ki({},Re.FORBID_ATTR,yt):hl({}),Ue=Ho(Re,"USE_PROFILES")?Re.USE_PROFILES:!1,rn=Re.ALLOW_ARIA_ATTR!==!1,fn=Re.ALLOW_DATA_ATTR!==!1,Si=Re.ALLOW_UNKNOWN_PROTOCOLS||!1,mr=Re.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ce=Re.SAFE_FOR_TEMPLATES||!1,Ie=Re.SAFE_FOR_XML!==!1,O=Re.WHOLE_DOCUMENT||!1,Oe=Re.RETURN_DOM||!1,Q=Re.RETURN_DOM_FRAGMENT||!1,ne=Re.RETURN_TRUSTED_TYPE||!1,Ee=Re.FORCE_BODY||!1,he=Re.SANITIZE_DOM!==!1,Le=Re.SANITIZE_NAMED_PROPS||!1,je=Re.KEEP_CONTENT!==!1,Te=Re.IN_PLACE||!1,Et=Re.ALLOWED_URI_REGEXP||sA,St=Re.NAMESPACE||st,Oi=Re.MATHML_TEXT_INTEGRATION_POINTS||Oi,Er=Re.HTML_INTEGRATION_POINTS||Er,dt=Re.CUSTOM_ELEMENT_HANDLING||{},Re.CUSTOM_ELEMENT_HANDLING&&sr(Re.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(dt.tagNameCheck=Re.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Re.CUSTOM_ELEMENT_HANDLING&&sr(Re.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(dt.attributeNameCheck=Re.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Re.CUSTOM_ELEMENT_HANDLING&&typeof Re.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(dt.allowCustomizedBuiltInElements=Re.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ce&&(fn=!1),Q&&(Oe=!0),Ue&&(ii=ki({},iA),bi=[],Ue.html===!0&&(ki(ii,tA),ki(bi,nA)),Ue.svg===!0&&(ki(ii,Xb),ki(bi,Jb),ki(bi,jg)),Ue.svgFilters===!0&&(ki(ii,Zb),ki(bi,Jb),ki(bi,jg)),Ue.mathMl===!0&&(ki(ii,Qb),ki(bi,rA),ki(bi,jg))),Re.ADD_TAGS&&(ii===Ii&&(ii=hl(ii)),ki(ii,Re.ADD_TAGS,yt)),Re.ADD_ATTR&&(bi===hn&&(bi=hl(bi)),ki(bi,Re.ADD_ATTR,yt)),Re.ADD_URI_SAFE_ATTR&&ki(j,Re.ADD_URI_SAFE_ATTR,yt),Re.FORBID_CONTENTS&&(Ze===_t&&(Ze=hl(Ze)),ki(Ze,Re.FORBID_CONTENTS,yt)),je&&(ii["#text"]=!0),O&&ki(ii,["html","head","body"]),ii.table&&(ki(ii,["tbody"]),delete un.tbody),Re.TRUSTED_TYPES_POLICY){if(typeof Re.TRUSTED_TYPES_POLICY.createHTML!="function")throw np('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Re.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw np('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');J=Re.TRUSTED_TYPES_POLICY,ae=J.createHTML("")}else J===void 0&&(J=LH(P,r)),J!==null&&typeof ae=="string"&&(ae=J.createHTML(""));hs&&hs(Re),no=Re}},hi=ki({},[...Xb,...Zb,...xH]),ws=ki({},[...Qb,...SH]),Li=function(Re){let rt=Z(Re);(!rt||!rt.tagName)&&(rt={namespaceURI:St,tagName:"template"});const Dt=Vg(Re.tagName),Ci=Vg(rt.tagName);return Bt[Re.namespaceURI]?Re.namespaceURI===We?rt.namespaceURI===st?Dt==="svg":rt.namespaceURI===re?Dt==="svg"&&(Ci==="annotation-xml"||Oi[Ci]):!!hi[Dt]:Re.namespaceURI===re?rt.namespaceURI===st?Dt==="math":rt.namespaceURI===We?Dt==="math"&&Er[Ci]:!!ws[Dt]:Re.namespaceURI===st?rt.namespaceURI===We&&!Er[Ci]||rt.namespaceURI===re&&!Oi[Ci]?!1:!ws[Dt]&&(_s[Dt]||!hi[Dt]):!!(gr==="application/xhtml+xml"&&Bt[Re.namespaceURI]):!1},Gn=function(Re){tp(e.removed,{element:Re});try{Z(Re).removeChild(Re)}catch{M(Re)}},Ts=function(Re,rt){try{tp(e.removed,{attribute:rt.getAttributeNode(Re),from:rt})}catch{tp(e.removed,{attribute:null,from:rt})}if(rt.removeAttribute(Re),Re==="is")if(Oe||Q)try{Gn(rt)}catch{}else try{rt.setAttribute(Re,"")}catch{}},wn=function(Re){let rt=null,Dt=null;if(Ee)Re=""+Re;else{const An=eA(Re,/^[\r\n\t ]+/);Dt=An&&An[0]}gr==="application/xhtml+xml"&&St===st&&(Re=''+Re+"");const Ci=J?J.createHTML(Re):Re;if(St===st)try{rt=new S().parseFromString(Ci,gr)}catch{}if(!rt||!rt.documentElement){rt=ye.createDocument(St,"template",null);try{rt.documentElement.innerHTML=qt?ae:Ci}catch{}}const Mn=rt.body||rt.documentElement;return Re&&Dt&&Mn.insertBefore(i.createTextNode(Dt),Mn.childNodes[0]||null),St===st?ze.call(rt,O?"html":"body")[0]:O?rt.documentElement:Mn},Ln=function(Re){return pe.call(Re.ownerDocument||Re,Re,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},Mr=function(Re){return Re instanceof y&&(typeof Re.nodeName!="string"||typeof Re.textContent!="string"||typeof Re.removeChild!="function"||!(Re.attributes instanceof g)||typeof Re.removeAttribute!="function"||typeof Re.setAttribute!="function"||typeof Re.namespaceURI!="string"||typeof Re.insertBefore!="function"||typeof Re.hasChildNodes!="function")},or=function(Re){return typeof u=="function"&&Re instanceof u};function _i(Ht,Re,rt){zg(Ht,Dt=>{Dt.call(e,Re,rt,no)})}const Kn=function(Re){let rt=null;if(_i(ot.beforeSanitizeElements,Re,null),Mr(Re))return Gn(Re),!0;const Dt=yt(Re.nodeName);if(_i(ot.uponSanitizeElement,Re,{tagName:Dt,allowedTags:ii}),Ie&&Re.hasChildNodes()&&!or(Re.firstElementChild)&&fs(/<[/\w!]/g,Re.innerHTML)&&fs(/<[/\w!]/g,Re.textContent)||Re.nodeType===sp.progressingInstruction||Ie&&Re.nodeType===sp.comment&&fs(/<[/\w]/g,Re.data))return Gn(Re),!0;if(!ii[Dt]||un[Dt]){if(!un[Dt]&&xs(Dt)&&(dt.tagNameCheck instanceof RegExp&&fs(dt.tagNameCheck,Dt)||dt.tagNameCheck instanceof Function&&dt.tagNameCheck(Dt)))return!1;if(je&&!Ze[Dt]){const Ci=Z(Re)||Re.parentNode,Mn=q(Re)||Re.childNodes;if(Mn&&Ci){const An=Mn.length;for(let tr=An-1;tr>=0;--tr){const Cr=k(Mn[tr],!0);Cr.__removalCount=(Re.__removalCount||0)+1,Ci.insertBefore(Cr,L(Re))}}}return Gn(Re),!0}return Re instanceof h&&!Li(Re)||(Dt==="noscript"||Dt==="noembed"||Dt==="noframes")&&fs(/<\/no(script|embed|frames)/i,Re.innerHTML)?(Gn(Re),!0):(Ce&&Re.nodeType===sp.text&&(rt=Re.textContent,zg([qe,at,Pt],Ci=>{rt=ip(rt,Ci," ")}),Re.textContent!==rt&&(tp(e.removed,{element:Re.cloneNode()}),Re.textContent=rt)),_i(ot.afterSanitizeElements,Re,null),!1)},gi=function(Re,rt,Dt){if(he&&(rt==="id"||rt==="name")&&(Dt in i||Dt in Su))return!1;if(!(fn&&!Un[rt]&&fs(ci,rt))){if(!(rn&&fs(Ct,rt))){if(!bi[rt]||Un[rt]){if(!(xs(Re)&&(dt.tagNameCheck instanceof RegExp&&fs(dt.tagNameCheck,Re)||dt.tagNameCheck instanceof Function&&dt.tagNameCheck(Re))&&(dt.attributeNameCheck instanceof RegExp&&fs(dt.attributeNameCheck,rt)||dt.attributeNameCheck instanceof Function&&dt.attributeNameCheck(rt))||rt==="is"&&dt.allowCustomizedBuiltInElements&&(dt.tagNameCheck instanceof RegExp&&fs(dt.tagNameCheck,Dt)||dt.tagNameCheck instanceof Function&&dt.tagNameCheck(Dt))))return!1}else if(!j[rt]){if(!fs(Et,ip(Dt,Wt,""))){if(!((rt==="src"||rt==="xlink:href"||rt==="href")&&Re!=="script"&&bH(Dt,"data:")===0&&Ut[Re])){if(!(Si&&!fs(Nt,ip(Dt,Wt,"")))){if(Dt)return!1}}}}}}return!0},xs=function(Re){return Re!=="annotation-xml"&&eA(Re,wi)},Go=function(Re){_i(ot.beforeSanitizeAttributes,Re,null);const{attributes:rt}=Re;if(!rt||Mr(Re))return;const Dt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:bi,forceKeepAttr:void 0};let Ci=rt.length;for(;Ci--;){const Mn=rt[Ci],{name:An,namespaceURI:tr,value:Cr}=Mn,Bi=yt(An),js=Cr;let Fn=An==="value"?js:_H(js);if(Dt.attrName=Bi,Dt.attrValue=Fn,Dt.keepAttr=!0,Dt.forceKeepAttr=void 0,_i(ot.uponSanitizeAttribute,Re,Dt),Fn=Dt.attrValue,Le&&(Bi==="id"||Bi==="name")&&(Ts(An,Re),Fn=nt+Fn),Ie&&fs(/((--!?|])>)|<\/(style|title)/i,Fn)){Ts(An,Re);continue}if(Dt.forceKeepAttr)continue;if(!Dt.keepAttr){Ts(An,Re);continue}if(!mr&&fs(/\/>/i,Fn)){Ts(An,Re);continue}Ce&&zg([qe,at,Pt],La=>{Fn=ip(Fn,La," ")});const Oa=yt(Re.nodeName);if(!gi(Oa,Bi,Fn)){Ts(An,Re);continue}if(J&&typeof P=="object"&&typeof P.getAttributeType=="function"&&!tr)switch(P.getAttributeType(Oa,Bi)){case"TrustedHTML":{Fn=J.createHTML(Fn);break}case"TrustedScriptURL":{Fn=J.createScriptURL(Fn);break}}if(Fn!==js)try{tr?Re.setAttributeNS(tr,An,Fn):Re.setAttribute(An,Fn),Mr(Re)?Gn(Re):$C(e.removed)}catch{Ts(An,Re)}}_i(ot.afterSanitizeAttributes,Re,null)},Ra=function Ht(Re){let rt=null;const Dt=Ln(Re);for(_i(ot.beforeSanitizeShadowDOM,Re,null);rt=Dt.nextNode();)_i(ot.uponSanitizeShadowNode,rt,null),Kn(rt),Go(rt),rt.content instanceof s&&Ht(rt.content);_i(ot.afterSanitizeShadowDOM,Re,null)};return e.sanitize=function(Ht){let Re=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},rt=null,Dt=null,Ci=null,Mn=null;if(qt=!Ht,qt&&(Ht=""),typeof Ht!="string"&&!or(Ht))if(typeof Ht.toString=="function"){if(Ht=Ht.toString(),typeof Ht!="string")throw np("dirty is not a string, aborting")}else throw np("toString is not a function");if(!e.isSupported)return Ht;if(te||er(Re),e.removed=[],typeof Ht=="string"&&(Te=!1),Te){if(Ht.nodeName){const Cr=yt(Ht.nodeName);if(!ii[Cr]||un[Cr])throw np("root node is forbidden and cannot be sanitized in-place")}}else if(Ht instanceof u)rt=wn(""),Dt=rt.ownerDocument.importNode(Ht,!0),Dt.nodeType===sp.element&&Dt.nodeName==="BODY"||Dt.nodeName==="HTML"?rt=Dt:rt.appendChild(Dt);else{if(!Oe&&!Ce&&!O&&Ht.indexOf("<")===-1)return J&&ne?J.createHTML(Ht):Ht;if(rt=wn(Ht),!rt)return Oe?null:ne?ae:""}rt&&Ee&&Gn(rt.firstChild);const An=Ln(Te?Ht:rt);for(;Ci=An.nextNode();)Kn(Ci),Go(Ci),Ci.content instanceof s&&Ra(Ci.content);if(Te)return Ht;if(Oe){if(Q)for(Mn=le.call(rt.ownerDocument);rt.firstChild;)Mn.appendChild(rt.firstChild);else Mn=rt;return(bi.shadowroot||bi.shadowrootmode)&&(Mn=tt.call(n,Mn,!0)),Mn}let tr=O?rt.outerHTML:rt.innerHTML;return O&&ii["!doctype"]&&rt.ownerDocument&&rt.ownerDocument.doctype&&rt.ownerDocument.doctype.name&&fs(oA,rt.ownerDocument.doctype.name)&&(tr=" `+tr),Ce&&zg([qe,at,Pt],Cr=>{tr=ip(tr,Cr," ")}),J&&ne?J.createHTML(tr):tr},e.setConfig=function(){let Ht=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};er(Ht),te=!0},e.clearConfig=function(){no=null,te=!1},e.isValidAttribute=function(Ht,Re,rt){no||er({});const Dt=yt(Ht),Ci=yt(Re);return gi(Dt,Ci,rt)},e.addHook=function(Ht,Re){typeof Re=="function"&&tp(ot[Ht],Re)},e.removeHook=function(Ht,Re){if(Re!==void 0){const rt=yH(ot[Ht],Re);return rt===-1?void 0:vH(ot[Ht],rt,1)[0]}return $C(ot[Ht])},e.removeHooks=function(Ht){ot[Ht]=[]},e.removeAllHooks=function(){ot=lA()},e}var MH=uA();class Wg{static detectHtml(e){return e?e.charAt(0)==="<"&&e.charAt(e.length-1)===">":!1}static sanitizeHtml(e){const i={ALLOWED_TAGS:["a","b","br","i","img","p","small","span","sub","sup"],ALLOWED_ATTR:["href","src","alt"],ALLOW_DATA_ATTR:!1,ALLOWED_URI_REGEXP:/^(?:https?|mailto):\/\/\S*|mailto:\S*$/i};return MH.sanitize(e,i)}}const FH={name:"ImageViewer",components:{TermTagGroup:XC,Dialog:WC,TabView:Ub,TabPanel:zb,Dropdown:Dd,Button:ep},props:{image:{type:String,required:!0},plainImage:{type:Boolean,default:!1},annotations:{type:Array},defaultLanguage:{type:String,default:"en"},light:{type:Number,default:100},displayAnnotations:{type:Boolean,default:!0},highlightedAnnotationId:{type:String,default:null}},emits:["osdInitialized","canvasLoaded","annotationsLoaded","mouseEnterAnnotation","mouseLeaveAnnotation","annotationPopupOpened","annotationPopupClosed"],data(){return{showPopup:!1,popupData:{id:null,language:"en",languages:[],title:{},description:{},links:{},attribution:null,date:null,notes:[],tags:[],comments:[]}}},computed:{webAnnotations(){var e;const t=[];if(this.annotations)for(const i of this.annotations)(e=i.target)!=null&&e.selector&&t.push({"@context":"http://www.w3.org/ns/anno.jsonld",id:i.id,type:"Annotation",body:[{type:"TextualBody",value:i}],target:i.target});return t},popupHasData(){return this.popupData.description[this.popupData.language]||this.popupData.attribution||this.popupData.date||this.popupData.notes.length>0||this.popupData.links[this.popupData.language]||this.popupData.languages.length>1||this.popupData.tags.length>0||this.popupData.comments.length>0}},watch:{annotations(t,e){if(this.annotorious&&(this.annotorious.clearAnnotations(),this.webAnnotations.length>0)){this.annotorious.setAnnotations(this.webAnnotations);const i=[];if(t&&Array.isArray(t))for(const n of t)i.push(n.data);i>0&&this.$emit("annotationsLoaded",i)}},light(t,e){this.setLightLevel()},highlightedAnnotationId(t,e){if(this.annotorious&&(this.$refs.container.querySelectorAll(".highlighted").forEach(n=>n.classList.remove("highlighted")),t)){const n=this.$refs.container.querySelector(`[data-id="${t}"]`);n&&n.classList.add("highlighted")}}},setup(){return{osdViewer:null,annotorious:null,HtmlUtility:Wg}},mounted(){this.initViewer()},methods:{initViewer(){const t={element:this.$refs.container,visibilityRatio:1,crossOriginPolicy:!1,prefixUrl:"https://openseadragon.github.io/openseadragon/images/",showZoomControl:!1,showHomeControl:!1,showFullPageControl:!1};if(this.plainImage?t.tileSources={type:"image",url:this.image,buildPyramid:!1}:t.tileSources=[this.image+"/info.json"],this.osdViewer=J8(t),this.$emit("osdInitialized",this.osdViewer),this.displayAnnotations){if(this.annotorious=eH(this.osdViewer,{disableEditor:!0,readOnly:!0,formatters:ds.annotoriousFormatter()}),this.webAnnotations.length>0){this.annotorious.setAnnotations(this.webAnnotations);const e=[];for(const i of this.annotations)e.push(i.data);this.$emit("annotationsLoaded",e)}this.annotorious.on("selectAnnotation",e=>{this.openPopup(e)}),this.annotorious.on("mouseEnterAnnotation",(e,i)=>{this.$emit("mouseEnterAnnotation",e.id)}),this.annotorious.on("mouseLeaveAnnotation",(e,i)=>{this.$emit("mouseLeaveAnnotation",e.id)}),this.$refs.container.querySelector(".a9s-annotationlayer"),this.setLightLevel()}this.$emit("canvasLoaded")},openPopup(t){this.loadPopupData(t),this.showPopup=!0,this.$emit("annotationPopupOpened",t.id)},onPopupClose(){this.annotorious.cancelSelected(),this.$emit("annotationPopupClosed",this.popupData.id)},initPopupData(){this.popupData={id:null,language:"en",languages:[],title:{},description:{},links:{},attribution:null,date:null,notes:[],tags:[],comments:[]}},loadPopupData(t){var e,i,n,r,s,o;if(this.initPopupData(),this.popupData.id=t.id,typeof t.body[0]<"u"){const u=t.body[0].value;if(u.fields){const h=this.getAnnotationLanguageCodes(u);h.indexOf(this.defaultLanguage)>-1?this.popupData.language=this.defaultLanguage:h.indexOf("en")===-1?this.popupData.language=h[0]:this.popupData.language="en";for(const p of h){const g=dl.getLanguageName(p);g&&this.popupData.languages.push({code:p,name:g})}for(const p of h)typeof((e=u.fields.Title)==null?void 0:e[p])<"u"&&(this.popupData.title[p]=u.fields.Title[p][0]),typeof((i=u.fields.Description)==null?void 0:i[p])<"u"&&(this.popupData.description[p]=u.fields.Description[p][0]),typeof((n=u.fields.Link)==null?void 0:n[p])<"u"&&(this.popupData.links[p]=u.fields.Link[p]);if(typeof((r=u.fields.Attribution)==null?void 0:r.en)<"u"&&(this.popupData.attribution=u.fields.Attribution.en[0]),typeof((s=u.fields.Date)==null?void 0:s.en)<"u"&&(this.popupData.date=u.fields.Date.en[0]),typeof((o=u.fields.Note)==null?void 0:o.en)<"u"&&(this.popupData.notes=u.fields.Note.en),typeof u.fields.Tag<"u")for(const p in u.fields.Tag)u.fields.Tag[p].forEach(g=>{const y=ds.createTermObject(g);this.popupData.tags.push(y)});if(typeof u.fields.Comment<"u")for(const p in u.fields.Comment)u.fields.Comment[p].forEach(g=>{this.popupData.comments.push({language:p,text:g.value,format:g.format})})}}},getAnnotationLanguageCodes(t){let e=[];const i=["Title","Description","Link"];if(t.fields)for(const n in t.fields){if(i.indexOf(n)===-1)continue;const r=t.fields[n];if(r)for(const s in r)e.indexOf(s)===-1&&e.push(s)}return e},formatDate(t){return ds.formatDate(t)},setLightLevel(){const t=this.$refs.container.querySelector(".a9s-annotationlayer");t.style.backgroundColor=`rgba(33,33,33,${1-this.light/100}`}}},NH={ref:"container",class:"w-full h-full bg-gray-900 anno-viewer-view"},BH={key:0,class:"p-fluid formgrid grid"},HH={class:"field col-12 flex justify-content-end"},UH={key:1},zH={key:2},VH=["href"],jH={key:0,class:"mb-4"},WH={key:1,class:"text-sm text-right"},qH={key:2,class:"text-sm text-right"},GH={key:0,class:"mb-4"},KH={class:"mb-4"},YH=["innerHTML"];function XH(t,e,i,n,r,s){const o=Mt("Dropdown"),u=Mt("TabPanel"),h=Mt("TermTagGroup"),p=Mt("TabView"),g=Mt("Button"),y=Mt("Dialog");return X(),se(ct,null,[Se("div",NH,null,512),xt(y,{visible:r.showPopup,"onUpdate:visible":e[2]||(e[2]=S=>r.showPopup=S),onHide:s.onPopupClose,modal:"",header:r.popupData.title[r.popupData.language]??t.$t("ui.annotation"),style:{width:"50rem"},breakpoints:{"1199px":"75vw","575px":"90vw"},"append-to":"self",pt:{mask:S=>({style:{"z-index":1e3}})}},{footer:Vt(()=>[xt(g,{label:t.$t("ui.close"),icon:"pi pi-times",onClick:e[1]||(e[1]=S=>r.showPopup=!1),outlined:""},null,8,["label"])]),default:Vt(()=>[s.popupHasData?(X(),gt(p,{key:0},{default:Vt(()=>[r.popupData.languages.length>1||r.popupData.description[r.popupData.language]||r.popupData.links[r.popupData.language]?(X(),gt(u,{key:0,header:t.$t("ui.about")},{default:Vt(()=>[r.popupData.languages.length>0?(X(),se("div",BH,[Se("div",HH,[xt(o,{id:"anoLanguage",class:"w-5 lg:w-3",modelValue:r.popupData.language,"onUpdate:modelValue":e[0]||(e[0]=S=>r.popupData.language=S),"append-to":"self",options:r.popupData.languages,"option-label":"name","option-value":"code"},null,8,["modelValue","options"])])])):Be("",!0),r.popupData.description?(X(),se("p",UH,it(r.popupData.description[r.popupData.language]),1)):Be("",!0),r.popupData.links[r.popupData.language]&&r.popupData.links[r.popupData.language].length>0?(X(),se("div",zH,[Se("h5",null,it(t.$t("ui.links")),1),Se("ul",null,[(X(!0),se(ct,null,Kt(r.popupData.links[r.popupData.language],S=>(X(),se("li",null,[Se("a",{href:S.url,target:"_blank"},it(S.text?S.text:S.url),9,VH)]))),256))])])):Be("",!0)]),_:1},8,["header"])):Be("",!0),r.popupData.tags.length>0?(X(),gt(u,{key:1,header:t.$t("ui.tags")},{default:Vt(()=>[xt(h,{class:"mb-4",terms:r.popupData.tags,"read-only":""},null,8,["terms"])]),_:1},8,["header"])):Be("",!0),r.popupData.attribution||r.popupData.date||r.popupData.notes.length>0?(X(),gt(u,{key:2,header:t.$t("ui.notes")},{default:Vt(()=>[r.popupData.notes.length>0?(X(),se("div",jH,[(X(!0),se(ct,null,Kt(r.popupData.notes,S=>(X(),se("p",null,it(S),1))),256))])):Be("",!0),r.popupData.attribution?(X(),se("div",WH,it(r.popupData.attribution),1)):Be("",!0),r.popupData.date?(X(),se("div",qH,it(s.formatDate(r.popupData.date)),1)):Be("",!0)]),_:1},8,["header"])):Be("",!0),r.popupData.comments.length>0?(X(),gt(u,{key:3,header:t.$t("ui.comments")},{default:Vt(()=>[r.popupData.comments.length>0?(X(),se("div",GH,[(X(!0),se(ct,null,Kt(r.popupData.comments,S=>(X(),se("div",KH,[S.format==="text/html"?(X(),se("div",{key:0,innerHTML:n.HtmlUtility.sanitizeHtml(S.text)},null,8,YH)):(X(),se(ct,{key:1},[Vi(it(S.text),1)],64))]))),256))])):Be("",!0)]),_:1},8,["header"])):Be("",!0)]),_:1})):Be("",!0)]),_:1},8,["visible","onHide","header"])],64)}const ZH=ma(FH,[["render",XH]]);class QH{constructor(e){this.image=e,this.canvas=document.createElement("canvas"),this.canvas.width=this.image.width,this.canvas.height=this.image.height,this.canvasContext=this.canvas.getContext("2d")}crop(e){const i=this._calculateCropRectCoordinates(e),n=i[1][0]-i[0][0],r=i[1][1]-i[0][1];this.canvasContext.save(),this.resetCanvas(),this.canvasContext.beginPath(),this.canvasContext.moveTo(e[0][0],e[0][1]);for(let s=1;sr)&&(r=u),(s===null||h>s)&&(s=h)}return[[i,n],[r,s]]}}class JH{static cropAnnotationImage(e,i){if(!i.hasLoaded())return null;if(!e.target.selector)return i.getImageElement().src;const n=i.getRatio(),r=new QH(i.getImageElement()),s=e.target.selector;if(s.type==="SvgSelector"){if(s.value.match(/{const y=g.split(","),S=parseFloat(y[0])*n,P=parseFloat(y[1])*n;p.push([S,P])}),r.crop(p)}else if(s.value.match(/parseFloat(p)*n);return r.cropSvgPath(h)}}else if(s.type==="FragmentSelector"){let o=s.value;if(o.match(/=pixel:/)&&(o=o.replace(/=pixel:/,"=")),o.match(/^xywh=([0-9\-.,]+)$/)){const h=[...o.matchAll(/^xywh=([0-9\-.,]+)$/g)][0][1].split(","),p=parseFloat(h[0])*n,g=parseFloat(h[1])*n,y=parseFloat(h[2])*n,S=parseFloat(h[3])*n;if(y>0&&S>0){const P=[[p,g],[p+y,g],[p+y,g+S],[p,g+S]];return r.crop(P)}else if(y===0&&S===0)return r.cropCircle([p,g],50)}}return null}}function cA(t,e){return function(){return t.apply(e,arguments)}}const{toString:$H}=Object.prototype,{getPrototypeOf:$b}=Object,{iterator:qg,toStringTag:dA}=Symbol,Gg=(t=>e=>{const i=$H.call(e);return t[i]||(t[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Uo=t=>(t=t.toLowerCase(),e=>Gg(e)===t),Kg=t=>e=>typeof e===t,{isArray:Pd}=Array,op=Kg("undefined");function eU(t){return t!==null&&!op(t)&&t.constructor!==null&&!op(t.constructor)&&Os(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const hA=Uo("ArrayBuffer");function tU(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&hA(t.buffer),e}const iU=Kg("string"),Os=Kg("function"),fA=Kg("number"),Yg=t=>t!==null&&typeof t=="object",nU=t=>t===!0||t===!1,Xg=t=>{if(Gg(t)!=="object")return!1;const e=$b(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(dA in t)&&!(qg in t)},rU=Uo("Date"),sU=Uo("File"),oU=Uo("Blob"),aU=Uo("FileList"),lU=t=>Yg(t)&&Os(t.pipe),uU=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||Os(t.append)&&((e=Gg(t))==="formdata"||e==="object"&&Os(t.toString)&&t.toString()==="[object FormData]"))},cU=Uo("URLSearchParams"),[dU,hU,fU,pU]=["ReadableStream","Request","Response","Headers"].map(Uo),mU=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ap(t,e,{allOwnKeys:i=!1}={}){if(t===null||typeof t>"u")return;let n,r;if(typeof t!="object"&&(t=[t]),Pd(t))for(n=0,r=t.length;n0;)if(r=i[n],e===r.toLowerCase())return r;return null}const hc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,mA=t=>!op(t)&&t!==hc;function e_(){const{caseless:t}=mA(this)&&this||{},e={},i=(n,r)=>{const s=t&&pA(e,r)||r;Xg(e[s])&&Xg(n)?e[s]=e_(e[s],n):Xg(n)?e[s]=e_({},n):Pd(n)?e[s]=n.slice():e[s]=n};for(let n=0,r=arguments.length;n(ap(e,(r,s)=>{i&&Os(r)?t[s]=cA(r,i):t[s]=r},{allOwnKeys:n}),t),yU=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),vU=(t,e,i,n)=>{t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),i&&Object.assign(t.prototype,i)},bU=(t,e,i,n)=>{let r,s,o;const u={};if(e=e||{},t==null)return e;do{for(r=Object.getOwnPropertyNames(t),s=r.length;s-- >0;)o=r[s],(!n||n(o,t,e))&&!u[o]&&(e[o]=t[o],u[o]=!0);t=i!==!1&&$b(t)}while(t&&(!i||i(t,e))&&t!==Object.prototype);return e},_U=(t,e,i)=>{t=String(t),(i===void 0||i>t.length)&&(i=t.length),i-=e.length;const n=t.indexOf(e,i);return n!==-1&&n===i},wU=t=>{if(!t)return null;if(Pd(t))return t;let e=t.length;if(!fA(e))return null;const i=new Array(e);for(;e-- >0;)i[e]=t[e];return i},TU=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&$b(Uint8Array)),xU=(t,e)=>{const n=(t&&t[qg]).call(t);let r;for(;(r=n.next())&&!r.done;){const s=r.value;e.call(t,s[0],s[1])}},SU=(t,e)=>{let i;const n=[];for(;(i=t.exec(e))!==null;)n.push(i);return n},EU=Uo("HTMLFormElement"),CU=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(i,n,r){return n.toUpperCase()+r}),gA=(({hasOwnProperty:t})=>(e,i)=>t.call(e,i))(Object.prototype),AU=Uo("RegExp"),yA=(t,e)=>{const i=Object.getOwnPropertyDescriptors(t),n={};ap(i,(r,s)=>{let o;(o=e(r,s,t))!==!1&&(n[s]=o||r)}),Object.defineProperties(t,n)},DU=t=>{yA(t,(e,i)=>{if(Os(t)&&["arguments","caller","callee"].indexOf(i)!==-1)return!1;const n=t[i];if(Os(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+i+"'")})}})},PU=(t,e)=>{const i={},n=r=>{r.forEach(s=>{i[s]=!0})};return Pd(t)?n(t):n(String(t).split(e)),i},kU=()=>{},IU=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function RU(t){return!!(t&&Os(t.append)&&t[dA]==="FormData"&&t[qg])}const OU=t=>{const e=new Array(10),i=(n,r)=>{if(Yg(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[r]=n;const s=Pd(n)?[]:{};return ap(n,(o,u)=>{const h=i(o,r+1);!op(h)&&(s[u]=h)}),e[r]=void 0,s}}return n};return i(t,0)},LU=Uo("AsyncFunction"),MU=t=>t&&(Yg(t)||Os(t))&&Os(t.then)&&Os(t.catch),vA=((t,e)=>t?setImmediate:e?((i,n)=>(hc.addEventListener("message",({source:r,data:s})=>{r===hc&&s===i&&n.length&&n.shift()()},!1),r=>{n.push(r),hc.postMessage(i,"*")}))(`axios@${Math.random()}`,[]):i=>setTimeout(i))(typeof setImmediate=="function",Os(hc.postMessage)),FU=typeof queueMicrotask<"u"?queueMicrotask.bind(hc):typeof process<"u"&&process.nextTick||vA,Ke={isArray:Pd,isArrayBuffer:hA,isBuffer:eU,isFormData:uU,isArrayBufferView:tU,isString:iU,isNumber:fA,isBoolean:nU,isObject:Yg,isPlainObject:Xg,isReadableStream:dU,isRequest:hU,isResponse:fU,isHeaders:pU,isUndefined:op,isDate:rU,isFile:sU,isBlob:oU,isRegExp:AU,isFunction:Os,isStream:lU,isURLSearchParams:cU,isTypedArray:TU,isFileList:aU,forEach:ap,merge:e_,extend:gU,trim:mU,stripBOM:yU,inherits:vU,toFlatObject:bU,kindOf:Gg,kindOfTest:Uo,endsWith:_U,toArray:wU,forEachEntry:xU,matchAll:SU,isHTMLForm:EU,hasOwnProperty:gA,hasOwnProp:gA,reduceDescriptors:yA,freezeMethods:DU,toObjectSet:PU,toCamelCase:CU,noop:kU,toFiniteNumber:IU,findKey:pA,global:hc,isContextDefined:mA,isSpecCompliantForm:RU,toJSONObject:OU,isAsyncFn:LU,isThenable:MU,setImmediate:vA,asap:FU,isIterable:t=>t!=null&&Os(t[qg])};function vi(t,e,i,n,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),i&&(this.config=i),n&&(this.request=n),r&&(this.response=r,this.status=r.status?r.status:null)}Ke.inherits(vi,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ke.toJSONObject(this.config),code:this.code,status:this.status}}});const bA=vi.prototype,_A={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{_A[t]={value:t}}),Object.defineProperties(vi,_A),Object.defineProperty(bA,"isAxiosError",{value:!0}),vi.from=(t,e,i,n,r,s)=>{const o=Object.create(bA);return Ke.toFlatObject(t,o,function(h){return h!==Error.prototype},u=>u!=="isAxiosError"),vi.call(o,t.message,e,i,n,r),o.cause=t,o.name=t.name,s&&Object.assign(o,s),o};const NU=null;function t_(t){return Ke.isPlainObject(t)||Ke.isArray(t)}function wA(t){return Ke.endsWith(t,"[]")?t.slice(0,-2):t}function TA(t,e,i){return t?t.concat(e).map(function(r,s){return r=wA(r),!i&&s?"["+r+"]":r}).join(i?".":""):e}function BU(t){return Ke.isArray(t)&&!t.some(t_)}const HU=Ke.toFlatObject(Ke,{},null,function(e){return/^is[A-Z]/.test(e)});function Zg(t,e,i){if(!Ke.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,i=Ke.toFlatObject(i,{metaTokens:!0,dots:!1,indexes:!1},!1,function(k,M){return!Ke.isUndefined(M[k])});const n=i.metaTokens,r=i.visitor||g,s=i.dots,o=i.indexes,h=(i.Blob||typeof Blob<"u"&&Blob)&&Ke.isSpecCompliantForm(e);if(!Ke.isFunction(r))throw new TypeError("visitor must be a function");function p(R){if(R===null)return"";if(Ke.isDate(R))return R.toISOString();if(!h&&Ke.isBlob(R))throw new vi("Blob is not supported. Use a Buffer instead.");return Ke.isArrayBuffer(R)||Ke.isTypedArray(R)?h&&typeof Blob=="function"?new Blob([R]):Buffer.from(R):R}function g(R,k,M){let L=R;if(R&&!M&&typeof R=="object"){if(Ke.endsWith(k,"{}"))k=n?k:k.slice(0,-2),R=JSON.stringify(R);else if(Ke.isArray(R)&&BU(R)||(Ke.isFileList(R)||Ke.endsWith(k,"[]"))&&(L=Ke.toArray(R)))return k=wA(k),L.forEach(function(Z,J){!(Ke.isUndefined(Z)||Z===null)&&e.append(o===!0?TA([k],J,s):o===null?k:k+"[]",p(Z))}),!1}return t_(R)?!0:(e.append(TA(M,k,s),p(R)),!1)}const y=[],S=Object.assign(HU,{defaultVisitor:g,convertValue:p,isVisitable:t_});function P(R,k){if(!Ke.isUndefined(R)){if(y.indexOf(R)!==-1)throw Error("Circular reference detected in "+k.join("."));y.push(R),Ke.forEach(R,function(L,q){(!(Ke.isUndefined(L)||L===null)&&r.call(e,L,Ke.isString(q)?q.trim():q,k,S))===!0&&P(L,k?k.concat(q):[q])}),y.pop()}}if(!Ke.isObject(t))throw new TypeError("data must be an object");return P(t),e}function xA(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function i_(t,e){this._pairs=[],t&&Zg(t,this,e)}const SA=i_.prototype;SA.append=function(e,i){this._pairs.push([e,i])},SA.toString=function(e){const i=e?function(n){return e.call(this,n,xA)}:xA;return this._pairs.map(function(r){return i(r[0])+"="+i(r[1])},"").join("&")};function UU(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function EA(t,e,i){if(!e)return t;const n=i&&i.encode||UU;Ke.isFunction(i)&&(i={serialize:i});const r=i&&i.serialize;let s;if(r?s=r(e,i):s=Ke.isURLSearchParams(e)?e.toString():new i_(e,i).toString(n),s){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}class CA{constructor(){this.handlers=[]}use(e,i,n){return this.handlers.push({fulfilled:e,rejected:i,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Ke.forEach(this.handlers,function(n){n!==null&&e(n)})}}const AA={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},zU={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:i_,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},n_=typeof window<"u"&&typeof document<"u",r_=typeof navigator=="object"&&navigator||void 0,VU=n_&&(!r_||["ReactNative","NativeScript","NS"].indexOf(r_.product)<0),jU=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",WU=n_&&window.location.href||"http://localhost",Zr={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:n_,hasStandardBrowserEnv:VU,hasStandardBrowserWebWorkerEnv:jU,navigator:r_,origin:WU},Symbol.toStringTag,{value:"Module"})),...zU};function qU(t,e){return Zg(t,new Zr.classes.URLSearchParams,Object.assign({visitor:function(i,n,r,s){return Zr.isNode&&Ke.isBuffer(i)?(this.append(n,i.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function GU(t){return Ke.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function KU(t){const e={},i=Object.keys(t);let n;const r=i.length;let s;for(n=0;n=i.length;return o=!o&&Ke.isArray(r)?r.length:o,h?(Ke.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!u):((!r[o]||!Ke.isObject(r[o]))&&(r[o]=[]),e(i,n,r[o],s)&&Ke.isArray(r[o])&&(r[o]=KU(r[o])),!u)}if(Ke.isFormData(t)&&Ke.isFunction(t.entries)){const i={};return Ke.forEachEntry(t,(n,r)=>{e(GU(n),r,i,0)}),i}return null}function YU(t,e,i){if(Ke.isString(t))try{return(e||JSON.parse)(t),Ke.trim(t)}catch(n){if(n.name!=="SyntaxError")throw n}return(i||JSON.stringify)(t)}const lp={transitional:AA,adapter:["xhr","http","fetch"],transformRequest:[function(e,i){const n=i.getContentType()||"",r=n.indexOf("application/json")>-1,s=Ke.isObject(e);if(s&&Ke.isHTMLForm(e)&&(e=new FormData(e)),Ke.isFormData(e))return r?JSON.stringify(DA(e)):e;if(Ke.isArrayBuffer(e)||Ke.isBuffer(e)||Ke.isStream(e)||Ke.isFile(e)||Ke.isBlob(e)||Ke.isReadableStream(e))return e;if(Ke.isArrayBufferView(e))return e.buffer;if(Ke.isURLSearchParams(e))return i.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let u;if(s){if(n.indexOf("application/x-www-form-urlencoded")>-1)return qU(e,this.formSerializer).toString();if((u=Ke.isFileList(e))||n.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return Zg(u?{"files[]":e}:e,h&&new h,this.formSerializer)}}return s||r?(i.setContentType("application/json",!1),YU(e)):e}],transformResponse:[function(e){const i=this.transitional||lp.transitional,n=i&&i.forcedJSONParsing,r=this.responseType==="json";if(Ke.isResponse(e)||Ke.isReadableStream(e))return e;if(e&&Ke.isString(e)&&(n&&!this.responseType||r)){const o=!(i&&i.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(u){if(o)throw u.name==="SyntaxError"?vi.from(u,vi.ERR_BAD_RESPONSE,this,null,this.response):u}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Zr.classes.FormData,Blob:Zr.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ke.forEach(["delete","get","head","post","put","patch"],t=>{lp.headers[t]={}});const XU=Ke.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ZU=t=>{const e={};let i,n,r;return t&&t.split(` `).forEach(function(o){r=o.indexOf(":"),i=o.substring(0,r).trim().toLowerCase(),n=o.substring(r+1).trim(),!(!i||e[i]&&XU[i])&&(i==="set-cookie"?e[i]?e[i].push(n):e[i]=[n]:e[i]=e[i]?e[i]+", "+n:n)}),e},PA=Symbol("internals");function up(t){return t&&String(t).trim().toLowerCase()}function Qg(t){return t===!1||t==null?t:Ke.isArray(t)?t.map(Qg):String(t)}function QU(t){const e=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=i.exec(t);)e[n[1]]=n[2];return e}const JU=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function s_(t,e,i,n,r){if(Ke.isFunction(n))return n.call(this,e,i);if(r&&(e=i),!!Ke.isString(e)){if(Ke.isString(n))return e.indexOf(n)!==-1;if(Ke.isRegExp(n))return n.test(e)}}function $U(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,i,n)=>i.toUpperCase()+n)}function ez(t,e){const i=Ke.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(t,n+i,{value:function(r,s,o){return this[n].call(this,e,r,s,o)},configurable:!0})})}let Ls=class{constructor(e){e&&this.set(e)}set(e,i,n){const r=this;function s(u,h,p){const g=up(h);if(!g)throw new Error("header name must be a non-empty string");const y=Ke.findKey(r,g);(!y||r[y]===void 0||p===!0||p===void 0&&r[y]!==!1)&&(r[y||h]=Qg(u))}const o=(u,h)=>Ke.forEach(u,(p,g)=>s(p,g,h));if(Ke.isPlainObject(e)||e instanceof this.constructor)o(e,i);else if(Ke.isString(e)&&(e=e.trim())&&!JU(e))o(ZU(e),i);else if(Ke.isObject(e)&&Ke.isIterable(e)){let u={},h,p;for(const g of e){if(!Ke.isArray(g))throw TypeError("Object iterator must return a key-value pair");u[p=g[0]]=(h=u[p])?Ke.isArray(h)?[...h,g[1]]:[h,g[1]]:g[1]}o(u,i)}else e!=null&&s(i,e,n);return this}get(e,i){if(e=up(e),e){const n=Ke.findKey(this,e);if(n){const r=this[n];if(!i)return r;if(i===!0)return QU(r);if(Ke.isFunction(i))return i.call(this,r,n);if(Ke.isRegExp(i))return i.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,i){if(e=up(e),e){const n=Ke.findKey(this,e);return!!(n&&this[n]!==void 0&&(!i||s_(this,this[n],n,i)))}return!1}delete(e,i){const n=this;let r=!1;function s(o){if(o=up(o),o){const u=Ke.findKey(n,o);u&&(!i||s_(n,n[u],u,i))&&(delete n[u],r=!0)}}return Ke.isArray(e)?e.forEach(s):s(e),r}clear(e){const i=Object.keys(this);let n=i.length,r=!1;for(;n--;){const s=i[n];(!e||s_(this,this[s],s,e,!0))&&(delete this[s],r=!0)}return r}normalize(e){const i=this,n={};return Ke.forEach(this,(r,s)=>{const o=Ke.findKey(n,s);if(o){i[o]=Qg(r),delete i[s];return}const u=e?$U(s):String(s).trim();u!==s&&delete i[s],i[u]=Qg(r),n[u]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const i=Object.create(null);return Ke.forEach(this,(n,r)=>{n!=null&&n!==!1&&(i[r]=e&&Ke.isArray(n)?n.join(", "):n)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,i])=>e+": "+i).join(` `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...i){const n=new this(e);return i.forEach(r=>n.set(r)),n}static accessor(e){const n=(this[PA]=this[PA]={accessors:{}}).accessors,r=this.prototype;function s(o){const u=up(o);n[u]||(ez(r,o),n[u]=!0)}return Ke.isArray(e)?e.forEach(s):s(e),this}};Ls.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Ke.reduceDescriptors(Ls.prototype,({value:t},e)=>{let i=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(n){this[i]=n}}}),Ke.freezeMethods(Ls);function o_(t,e){const i=this||lp,n=e||i,r=Ls.from(n.headers);let s=n.data;return Ke.forEach(t,function(u){s=u.call(i,s,r.normalize(),e?e.status:void 0)}),r.normalize(),s}function kA(t){return!!(t&&t.__CANCEL__)}function kd(t,e,i){vi.call(this,t??"canceled",vi.ERR_CANCELED,e,i),this.name="CanceledError"}Ke.inherits(kd,vi,{__CANCEL__:!0});function IA(t,e,i){const n=i.config.validateStatus;!i.status||!n||n(i.status)?t(i):e(new vi("Request failed with status code "+i.status,[vi.ERR_BAD_REQUEST,vi.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function tz(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function iz(t,e){t=t||10;const i=new Array(t),n=new Array(t);let r=0,s=0,o;return e=e!==void 0?e:1e3,function(h){const p=Date.now(),g=n[s];o||(o=p),i[r]=h,n[r]=p;let y=s,S=0;for(;y!==r;)S+=i[y++],y=y%t;if(r=(r+1)%t,r===s&&(s=(s+1)%t),p-o{i=g,r=null,s&&(clearTimeout(s),s=null),t.apply(null,p)};return[(...p)=>{const g=Date.now(),y=g-i;y>=n?o(p,g):(r=p,s||(s=setTimeout(()=>{s=null,o(r)},n-y)))},()=>r&&o(r)]}const Jg=(t,e,i=3)=>{let n=0;const r=iz(50,250);return nz(s=>{const o=s.loaded,u=s.lengthComputable?s.total:void 0,h=o-n,p=r(h),g=o<=u;n=o;const y={loaded:o,total:u,progress:u?o/u:void 0,bytes:h,rate:p||void 0,estimated:p&&u&&g?(u-o)/p:void 0,event:s,lengthComputable:u!=null,[e?"download":"upload"]:!0};t(y)},i)},RA=(t,e)=>{const i=t!=null;return[n=>e[0]({lengthComputable:i,total:t,loaded:n}),e[1]]},OA=t=>(...e)=>Ke.asap(()=>t(...e)),rz=Zr.hasStandardBrowserEnv?((t,e)=>i=>(i=new URL(i,Zr.origin),t.protocol===i.protocol&&t.host===i.host&&(e||t.port===i.port)))(new URL(Zr.origin),Zr.navigator&&/(msie|trident)/i.test(Zr.navigator.userAgent)):()=>!0,sz=Zr.hasStandardBrowserEnv?{write(t,e,i,n,r,s){const o=[t+"="+encodeURIComponent(e)];Ke.isNumber(i)&&o.push("expires="+new Date(i).toGMTString()),Ke.isString(n)&&o.push("path="+n),Ke.isString(r)&&o.push("domain="+r),s===!0&&o.push("secure"),document.cookie=o.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function oz(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function az(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function LA(t,e,i){let n=!oz(e);return t&&(n||i==!1)?az(t,e):e}const MA=t=>t instanceof Ls?{...t}:t;function fc(t,e){e=e||{};const i={};function n(p,g,y,S){return Ke.isPlainObject(p)&&Ke.isPlainObject(g)?Ke.merge.call({caseless:S},p,g):Ke.isPlainObject(g)?Ke.merge({},g):Ke.isArray(g)?g.slice():g}function r(p,g,y,S){if(Ke.isUndefined(g)){if(!Ke.isUndefined(p))return n(void 0,p,y,S)}else return n(p,g,y,S)}function s(p,g){if(!Ke.isUndefined(g))return n(void 0,g)}function o(p,g){if(Ke.isUndefined(g)){if(!Ke.isUndefined(p))return n(void 0,p)}else return n(void 0,g)}function u(p,g,y){if(y in e)return n(p,g);if(y in t)return n(void 0,p)}const h={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:u,headers:(p,g,y)=>r(MA(p),MA(g),y,!0)};return Ke.forEach(Object.keys(Object.assign({},t,e)),function(g){const y=h[g]||r,S=y(t[g],e[g],g);Ke.isUndefined(S)&&y!==u||(i[g]=S)}),i}const FA=t=>{const e=fc({},t);let{data:i,withXSRFToken:n,xsrfHeaderName:r,xsrfCookieName:s,headers:o,auth:u}=e;e.headers=o=Ls.from(o),e.url=EA(LA(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),u&&o.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):"")));let h;if(Ke.isFormData(i)){if(Zr.hasStandardBrowserEnv||Zr.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((h=o.getContentType())!==!1){const[p,...g]=h?h.split(";").map(y=>y.trim()).filter(Boolean):[];o.setContentType([p||"multipart/form-data",...g].join("; "))}}if(Zr.hasStandardBrowserEnv&&(n&&Ke.isFunction(n)&&(n=n(e)),n||n!==!1&&rz(e.url))){const p=r&&s&&sz.read(s);p&&o.set(r,p)}return e},lz=typeof XMLHttpRequest<"u"&&function(t){return new Promise(function(i,n){const r=FA(t);let s=r.data;const o=Ls.from(r.headers).normalize();let{responseType:u,onUploadProgress:h,onDownloadProgress:p}=r,g,y,S,P,R;function k(){P&&P(),R&&R(),r.cancelToken&&r.cancelToken.unsubscribe(g),r.signal&&r.signal.removeEventListener("abort",g)}let M=new XMLHttpRequest;M.open(r.method.toUpperCase(),r.url,!0),M.timeout=r.timeout;function L(){if(!M)return;const Z=Ls.from("getAllResponseHeaders"in M&&M.getAllResponseHeaders()),ae={data:!u||u==="text"||u==="json"?M.responseText:M.response,status:M.status,statusText:M.statusText,headers:Z,config:t,request:M};IA(function(pe){i(pe),k()},function(pe){n(pe),k()},ae),M=null}"onloadend"in M?M.onloadend=L:M.onreadystatechange=function(){!M||M.readyState!==4||M.status===0&&!(M.responseURL&&M.responseURL.indexOf("file:")===0)||setTimeout(L)},M.onabort=function(){M&&(n(new vi("Request aborted",vi.ECONNABORTED,t,M)),M=null)},M.onerror=function(){n(new vi("Network Error",vi.ERR_NETWORK,t,M)),M=null},M.ontimeout=function(){let J=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const ae=r.transitional||AA;r.timeoutErrorMessage&&(J=r.timeoutErrorMessage),n(new vi(J,ae.clarifyTimeoutError?vi.ETIMEDOUT:vi.ECONNABORTED,t,M)),M=null},s===void 0&&o.setContentType(null),"setRequestHeader"in M&&Ke.forEach(o.toJSON(),function(J,ae){M.setRequestHeader(ae,J)}),Ke.isUndefined(r.withCredentials)||(M.withCredentials=!!r.withCredentials),u&&u!=="json"&&(M.responseType=r.responseType),p&&([S,R]=Jg(p,!0),M.addEventListener("progress",S)),h&&M.upload&&([y,P]=Jg(h),M.upload.addEventListener("progress",y),M.upload.addEventListener("loadend",P)),(r.cancelToken||r.signal)&&(g=Z=>{M&&(n(!Z||Z.type?new kd(null,t,M):Z),M.abort(),M=null)},r.cancelToken&&r.cancelToken.subscribe(g),r.signal&&(r.signal.aborted?g():r.signal.addEventListener("abort",g)));const q=tz(r.url);if(q&&Zr.protocols.indexOf(q)===-1){n(new vi("Unsupported protocol "+q+":",vi.ERR_BAD_REQUEST,t));return}M.send(s||null)})},uz=(t,e)=>{const{length:i}=t=t?t.filter(Boolean):[];if(e||i){let n=new AbortController,r;const s=function(p){if(!r){r=!0,u();const g=p instanceof Error?p:this.reason;n.abort(g instanceof vi?g:new kd(g instanceof Error?g.message:g))}};let o=e&&setTimeout(()=>{o=null,s(new vi(`timeout ${e} of ms exceeded`,vi.ETIMEDOUT))},e);const u=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(p=>{p.unsubscribe?p.unsubscribe(s):p.removeEventListener("abort",s)}),t=null)};t.forEach(p=>p.addEventListener("abort",s));const{signal:h}=n;return h.unsubscribe=()=>Ke.asap(u),h}},cz=function*(t,e){let i=t.byteLength;if(i{const r=dz(t,e);let s=0,o,u=h=>{o||(o=!0,n&&n(h))};return new ReadableStream({async pull(h){try{const{done:p,value:g}=await r.next();if(p){u(),h.close();return}let y=g.byteLength;if(i){let S=s+=y;i(S)}h.enqueue(new Uint8Array(g))}catch(p){throw u(p),p}},cancel(h){return u(h),r.return()}},{highWaterMark:2})},$g=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",BA=$g&&typeof ReadableStream=="function",fz=$g&&(typeof TextEncoder=="function"?(t=>e=>t.encode(e))(new TextEncoder):async t=>new Uint8Array(await new Response(t).arrayBuffer())),HA=(t,...e)=>{try{return!!t(...e)}catch{return!1}},pz=BA&&HA(()=>{let t=!1;const e=new Request(Zr.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),UA=64*1024,a_=BA&&HA(()=>Ke.isReadableStream(new Response("").body)),ey={stream:a_&&(t=>t.body)};$g&&(t=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!ey[e]&&(ey[e]=Ke.isFunction(t[e])?i=>i[e]():(i,n)=>{throw new vi(`Response type '${e}' is not supported`,vi.ERR_NOT_SUPPORT,n)})})})(new Response);const mz=async t=>{if(t==null)return 0;if(Ke.isBlob(t))return t.size;if(Ke.isSpecCompliantForm(t))return(await new Request(Zr.origin,{method:"POST",body:t}).arrayBuffer()).byteLength;if(Ke.isArrayBufferView(t)||Ke.isArrayBuffer(t))return t.byteLength;if(Ke.isURLSearchParams(t)&&(t=t+""),Ke.isString(t))return(await fz(t)).byteLength},gz=async(t,e)=>{const i=Ke.toFiniteNumber(t.getContentLength());return i??mz(e)},l_={http:NU,xhr:lz,fetch:$g&&(async t=>{let{url:e,method:i,data:n,signal:r,cancelToken:s,timeout:o,onDownloadProgress:u,onUploadProgress:h,responseType:p,headers:g,withCredentials:y="same-origin",fetchOptions:S}=FA(t);p=p?(p+"").toLowerCase():"text";let P=uz([r,s&&s.toAbortSignal()],o),R;const k=P&&P.unsubscribe&&(()=>{P.unsubscribe()});let M;try{if(h&&pz&&i!=="get"&&i!=="head"&&(M=await gz(g,n))!==0){let ae=new Request(e,{method:"POST",body:n,duplex:"half"}),ye;if(Ke.isFormData(n)&&(ye=ae.headers.get("content-type"))&&g.setContentType(ye),ae.body){const[pe,le]=RA(M,Jg(OA(h)));n=NA(ae.body,UA,pe,le)}}Ke.isString(y)||(y=y?"include":"omit");const L="credentials"in Request.prototype;R=new Request(e,{...S,signal:P,method:i.toUpperCase(),headers:g.normalize().toJSON(),body:n,duplex:"half",credentials:L?y:void 0});let q=await fetch(R);const Z=a_&&(p==="stream"||p==="response");if(a_&&(u||Z&&k)){const ae={};["status","statusText","headers"].forEach(ze=>{ae[ze]=q[ze]});const ye=Ke.toFiniteNumber(q.headers.get("content-length")),[pe,le]=u&&RA(ye,Jg(OA(u),!0))||[];q=new Response(NA(q.body,UA,pe,()=>{le&&le(),k&&k()}),ae)}p=p||"text";let J=await ey[Ke.findKey(ey,p)||"text"](q,t);return!Z&&k&&k(),await new Promise((ae,ye)=>{IA(ae,ye,{data:J,headers:Ls.from(q.headers),status:q.status,statusText:q.statusText,config:t,request:R})})}catch(L){throw k&&k(),L&&L.name==="TypeError"&&/Load failed|fetch/i.test(L.message)?Object.assign(new vi("Network Error",vi.ERR_NETWORK,t,R),{cause:L.cause||L}):vi.from(L,L&&L.code,t,R)}})};Ke.forEach(l_,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const zA=t=>`- ${t}`,yz=t=>Ke.isFunction(t)||t===null||t===!1,VA={getAdapter:t=>{t=Ke.isArray(t)?t:[t];const{length:e}=t;let i,n;const r={};for(let s=0;s`adapter ${u} `+(h===!1?"is not supported by the environment":"is not available in the build"));let o=e?s.length>1?`since : `+s.map(zA).join(` `):" "+zA(s[0]):"as no adapter specified";throw new vi("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:l_};function u_(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new kd(null,t)}function jA(t){return u_(t),t.headers=Ls.from(t.headers),t.data=o_.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),VA.getAdapter(t.adapter||lp.adapter)(t).then(function(n){return u_(t),n.data=o_.call(t,t.transformResponse,n),n.headers=Ls.from(n.headers),n},function(n){return kA(n)||(u_(t),n&&n.response&&(n.response.data=o_.call(t,t.transformResponse,n.response),n.response.headers=Ls.from(n.response.headers))),Promise.reject(n)})}const WA="1.9.0",ty={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{ty[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const qA={};ty.transitional=function(e,i,n){function r(s,o){return"[Axios v"+WA+"] Transitional option '"+s+"'"+o+(n?". "+n:"")}return(s,o,u)=>{if(e===!1)throw new vi(r(o," has been removed"+(i?" in "+i:"")),vi.ERR_DEPRECATED);return i&&!qA[o]&&(qA[o]=!0,console.warn(r(o," has been deprecated since v"+i+" and will be removed in the near future"))),e?e(s,o,u):!0}},ty.spelling=function(e){return(i,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function vz(t,e,i){if(typeof t!="object")throw new vi("options must be an object",vi.ERR_BAD_OPTION_VALUE);const n=Object.keys(t);let r=n.length;for(;r-- >0;){const s=n[r],o=e[s];if(o){const u=t[s],h=u===void 0||o(u,s,t);if(h!==!0)throw new vi("option "+s+" must be "+h,vi.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new vi("Unknown option "+s,vi.ERR_BAD_OPTION)}}const iy={assertOptions:vz,validators:ty},ga=iy.validators;let pc=class{constructor(e){this.defaults=e||{},this.interceptors={request:new CA,response:new CA}}async request(e,i){try{return await this._request(e,i)}catch(n){if(n instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;const s=r.stack?r.stack.replace(/^.+\n/,""):"";try{n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=` `+s):n.stack=s}catch{}}throw n}}_request(e,i){typeof e=="string"?(i=i||{},i.url=e):i=e||{},i=fc(this.defaults,i);const{transitional:n,paramsSerializer:r,headers:s}=i;n!==void 0&&iy.assertOptions(n,{silentJSONParsing:ga.transitional(ga.boolean),forcedJSONParsing:ga.transitional(ga.boolean),clarifyTimeoutError:ga.transitional(ga.boolean)},!1),r!=null&&(Ke.isFunction(r)?i.paramsSerializer={serialize:r}:iy.assertOptions(r,{encode:ga.function,serialize:ga.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),iy.assertOptions(i,{baseUrl:ga.spelling("baseURL"),withXsrfToken:ga.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let o=s&&Ke.merge(s.common,s[i.method]);s&&Ke.forEach(["delete","get","head","post","put","patch","common"],R=>{delete s[R]}),i.headers=Ls.concat(o,s);const u=[];let h=!0;this.interceptors.request.forEach(function(k){typeof k.runWhen=="function"&&k.runWhen(i)===!1||(h=h&&k.synchronous,u.unshift(k.fulfilled,k.rejected))});const p=[];this.interceptors.response.forEach(function(k){p.push(k.fulfilled,k.rejected)});let g,y=0,S;if(!h){const R=[jA.bind(this),void 0];for(R.unshift.apply(R,u),R.push.apply(R,p),S=R.length,g=Promise.resolve(i);y{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](r);n._listeners=null}),this.promise.then=r=>{let s;const o=new Promise(u=>{n.subscribe(u),s=u}).then(r);return o.cancel=function(){n.unsubscribe(s)},o},e(function(s,o,u){n.reason||(n.reason=new kd(s,o,u),i(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const i=this._listeners.indexOf(e);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){const e=new AbortController,i=n=>{e.abort(n)};return this.subscribe(i),e.signal.unsubscribe=()=>this.unsubscribe(i),e.signal}static source(){let e;return{token:new JM(function(r){e=r}),cancel:e}}};function _z(t){return function(i){return t.apply(null,i)}}function wz(t){return Ke.isObject(t)&&t.isAxiosError===!0}const c_={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(c_).forEach(([t,e])=>{c_[e]=t});function GA(t){const e=new pc(t),i=cA(pc.prototype.request,e);return Ke.extend(i,pc.prototype,e,{allOwnKeys:!0}),Ke.extend(i,e,null,{allOwnKeys:!0}),i.create=function(r){return GA(fc(t,r))},i}const Nn=GA(lp);Nn.Axios=pc,Nn.CanceledError=kd,Nn.CancelToken=bz,Nn.isCancel=kA,Nn.VERSION=WA,Nn.toFormData=Zg,Nn.AxiosError=vi,Nn.Cancel=Nn.CanceledError,Nn.all=function(e){return Promise.all(e)},Nn.spread=_z,Nn.isAxiosError=wz,Nn.mergeConfig=fc,Nn.AxiosHeaders=Ls,Nn.formToJSON=t=>DA(Ke.isHTMLForm(t)?new FormData(t):t),Nn.getAdapter=VA.getAdapter,Nn.HttpStatusCode=c_,Nn.default=Nn;const{Axios:Qle,AxiosError:Jle,CanceledError:$le,isCancel:eue,CancelToken:tue,VERSION:iue,all:nue,Cancel:rue,isAxiosError:sue,spread:oue,toFormData:aue,AxiosHeaders:lue,HttpStatusCode:uue,formToJSON:cue,getAdapter:due,mergeConfig:hue}=Nn;class KA{constructor(e,i=null,n=!0){Gr(this,Yp);Gr(this,bh);Gr(this,Pc);Gr(this,kc);Gr(this,Sl);Gr(this,_h);if(Zn(this,bh,n),n){let r="max";i&&(r=`${i},`),Zn(this,Yp,r)}Zn(this,Pc,e),Zn(this,kc,!1)}async load(){if(oi(this,kc))return;let e,i;if(oi(this,bh)){e=`${oi(this,Pc)}/full/${oi(this,Yp)}/0/default.jpg`;const n=`${oi(this,Pc)}/info.json`;i=(await Nn.get(n)).data.width}else e=oi(this,Pc);try{Zn(this,Sl,new Image),oi(this,Sl).crossOrigin="anonymous",oi(this,Sl).src=e,await oi(this,Sl).decode(),oi(this,bh)?Zn(this,_h,oi(this,Sl).width/i):Zn(this,_h,1),Zn(this,kc,!0)}catch(n){console.error(n)}}getImageElement(){return oi(this,Sl)}getRatio(){return oi(this,_h)}hasLoaded(){return oi(this,kc)}}Yp=new WeakMap,bh=new WeakMap,Pc=new WeakMap,kc=new WeakMap,Sl=new WeakMap,_h=new WeakMap;const Tz={name:"TableViewer",components:{TermTagGroup:XC,DataTable:qb,Column:UC},props:{image:{type:String,required:!0},plainImage:{type:Boolean,default:!1},annotations:{type:Array},tableColumns:{type:Array,default:()=>["Title","Description","Links","Tags","Notes","Comments"]},srcImageSize:{type:Number,default:1024}},data(){return{imageElement:null,cropper:null,ratio:1,imageLoader:null}},computed:{annotationImages(){const t={};return this.imageLoader&&this.annotations.forEach(e=>{t[e.id]=JH.cropAnnotationImage(e,Pi(this.imageLoader))}),t}},watch:{image(t,e){t&&t!==e&&this.loadImage(t)}},setup(){return{HtmlUtility:Wg}},created(){this.loadImage(this.image)},methods:{getAnnotationTags(t){var i;const e=[];if(typeof((i=t.fields)==null?void 0:i.Tag)<"u")for(const n in t.fields.Tag)t.fields.Tag[n].forEach(r=>{const s=ds.createTermObject(r);e.push(s)});return e},async loadImage(t){this.imageLoader=null;let e;this.plainImage?e=new KA(t,null,!1):e=new KA(t,this.srcImageSize),await e.load(),this.imageLoader=e},onTablePageChange(){this.$nextTick(()=>{this.$refs.tableTop.scrollIntoView({behavior:"smooth"})})},formatDate(t){return ds.formatDate(t)}}},xz={key:0,class:"w-full h-full bg-gray-900",style:{"overflow-y":"auto"}},Sz={class:"p-4 my-7"},Ez={ref:"tableTop"},Cz=["src"],Az={key:1,class:"pi pi-spin pi-spinner",style:{"font-size":"2rem"}},Dz={class:"mb-2"},Pz={class:"mb-2"},kz={class:"mb-2"},Iz={class:"mb-2"},Rz={class:"mb-2"},Oz={class:"mb-2"},Lz=["href"],Mz={class:"mb-2"},Fz={class:"mb-2"},Nz={class:"mb-2"},Bz={class:"mb-2"},Hz={class:"mb-2"},Uz={class:"mb-2"},zz={class:"mb-2"},Vz={class:"mb-2"},jz={class:"mb-2"},Wz={class:"mb-2"},qz={class:"mb-2"},Gz=["innerHTML"],Kz={key:1,class:"flex flex-column align-items-center justify-content-center w-full h-full bg-gray-900 text-color-secondary"};function Yz(t,e,i,n,r,s){const o=Mt("Column"),u=Mt("TermTagGroup"),h=Mt("DataTable");return i.annotations&&i.annotations.length>0?(X(),se("div",xz,[Se("div",Sz,[Se("div",Ez,null,512),xt(h,{value:i.annotations,tableClass:"w-full",paginator:"",rows:10,onPage:s.onTablePageChange},{default:Vt(()=>[xt(o,{header:t.$t("ui.image")},{body:Vt(p=>[this.annotationImages[p.data.id]?(X(),se("img",{key:0,style:{"max-width":"200px"},src:this.annotationImages[p.data.id]},null,8,Cz)):this.annotationImages[p.data.id]===void 0?(X(),se("i",Az)):Be("",!0)]),_:1},8,["header"]),i.tableColumns.indexOf("Title")>=0?(X(),gt(o,{key:0,header:t.$t("ui.title")},{body:Vt(p=>{var g;return[(g=p.data.fields)!=null&&g.Title?(X(!0),se(ct,{key:0},Kt(p.data.fields.Title,(y,S)=>(X(),se("div",Dz,[(X(!0),se(ct,null,Kt(y,P=>(X(),se("div",Pz,it(P),1))),256))]))),256)):Be("",!0)]}),_:1},8,["header"])):Be("",!0),i.tableColumns.indexOf("Description")>=0?(X(),gt(o,{key:1,header:t.$t("ui.description")},{body:Vt(p=>{var g;return[(g=p.data.fields)!=null&&g.Description?(X(!0),se(ct,{key:0},Kt(p.data.fields.Description,(y,S)=>(X(),se("div",kz,[(X(!0),se(ct,null,Kt(y,P=>(X(),se("div",Iz,it(P),1))),256))]))),256)):Be("",!0)]}),_:1},8,["header"])):Be("",!0),i.tableColumns.indexOf("Links")>=0?(X(),gt(o,{key:2,header:t.$t("ui.links")},{body:Vt(p=>{var g;return[(g=p.data.fields)!=null&&g.Link?(X(!0),se(ct,{key:0},Kt(p.data.fields.Link,(y,S)=>(X(),se("div",Rz,[(X(!0),se(ct,null,Kt(y,P=>(X(),se("div",Oz,[Se("a",{href:P.url,target:"_blank"},it(P.text),9,Lz)]))),256))]))),256)):Be("",!0)]}),_:1},8,["header"])):Be("",!0),i.tableColumns.indexOf("Tags")>=0?(X(),gt(o,{key:3,style:{width:"20%"},header:t.$t("ui.tags")},{body:Vt(p=>{var g;return[(g=p.data.fields)!=null&&g.Tag?(X(),gt(u,{key:0,class:"mb-4",terms:s.getAnnotationTags(p.data),"read-only":""},null,8,["terms"])):Be("",!0)]}),_:1},8,["header"])):Be("",!0),i.tableColumns.indexOf("Notes")>=0?(X(),gt(o,{key:4,header:t.$t("ui.notes")},{body:Vt(p=>{var g;return[(g=p.data.fields)!=null&&g.Note?(X(!0),se(ct,{key:0},Kt(p.data.fields.Note,(y,S)=>(X(),se("div",Mz,[(X(!0),se(ct,null,Kt(y,P=>(X(),se("div",Fz,it(P),1))),256))]))),256)):Be("",!0)]}),_:1},8,["header"])):Be("",!0),i.tableColumns.indexOf("Attribution")>=0?(X(),gt(o,{key:5,header:t.$t("ui.attribution")},{body:Vt(p=>{var g;return[(g=p.data.fields)!=null&&g.Attribution?(X(!0),se(ct,{key:0},Kt(p.data.fields.Attribution,(y,S)=>(X(),se("div",Nz,[(X(!0),se(ct,null,Kt(y,P=>(X(),se("div",Bz,it(P),1))),256))]))),256)):Be("",!0)]}),_:1},8,["header"])):Be("",!0),i.tableColumns.indexOf("Date")>=0?(X(),gt(o,{key:6,header:t.$t("ui.date")},{body:Vt(p=>{var g;return[(g=p.data.fields)!=null&&g.Date?(X(!0),se(ct,{key:0},Kt(p.data.fields.Date,(y,S)=>(X(),se("div",Hz,[(X(!0),se(ct,null,Kt(y,P=>(X(),se("div",Uz,it(s.formatDate(P)),1))),256))]))),256)):Be("",!0)]}),_:1},8,["header"])):Be("",!0),i.tableColumns.indexOf("Line Color")>=0?(X(),gt(o,{key:7,header:t.$t("ui.lineColor")},{body:Vt(p=>{var g;return[(g=p.data.fields)!=null&&g["Line Color"]?(X(!0),se(ct,{key:0},Kt(p.data.fields["Line Color"],(y,S)=>(X(),se("div",zz,[(X(!0),se(ct,null,Kt(y,P=>(X(),se("div",{class:"mb-2",style:Ri(`width:20px;height:20px;background-color:${P};`)},null,4))),256))]))),256)):Be("",!0)]}),_:1},8,["header"])):Be("",!0),i.tableColumns.indexOf("Line Weight")>=0?(X(),gt(o,{key:8,header:t.$t("ui.lineWeight")},{body:Vt(p=>{var g;return[(g=p.data.fields)!=null&&g["Line Weight"]?(X(!0),se(ct,{key:0},Kt(p.data.fields["Line Weight"],(y,S)=>(X(),se("div",Vz,[(X(!0),se(ct,null,Kt(y,P=>(X(),se("div",jz,it(P),1))),256))]))),256)):Be("",!0)]}),_:1},8,["header"])):Be("",!0),i.tableColumns.indexOf("Comments")>=0?(X(),gt(o,{key:9,header:t.$t("ui.comments")},{body:Vt(p=>{var g;return[(g=p.data.fields)!=null&&g.Comment?(X(!0),se(ct,{key:0},Kt(p.data.fields.Comment,(y,S)=>(X(),se("div",Wz,[(X(!0),se(ct,null,Kt(y,P=>(X(),se("div",qz,[P.format==="text/html"?(X(),se("div",{key:0,innerHTML:n.HtmlUtility.sanitizeHtml(P.value)},null,8,Gz)):(X(),se(ct,{key:1},[Vi(it(P.value),1)],64))]))),256))]))),256)):Be("",!0)]}),_:1},8,["header"])):Be("",!0)]),_:1},8,["value","onPage"])])])):(X(),se("div",Kz,[e[0]||(e[0]=Se("div",null,[Se("i",{class:"pi pi-comment",style:{"font-size":"7rem"}})],-1)),Se("div",null,it(t.$t("message.noAnnotations")),1)]))}const Xz=ma(Tz,[["render",Yz],["__scopeId","data-v-7415e6dc"]]);var cp;typeof window<"u"?cp=window:typeof cl<"u"?cp=cl:typeof self<"u"?cp=self:cp={};var ny=cp;const _e=uu(ny),Zz=qC(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var YA=typeof cl<"u"?cl:typeof window<"u"?window:{},Qz=Zz,dp;typeof document<"u"?dp=document:(dp=YA["__GLOBAL_DOCUMENT_CACHE@4"],dp||(dp=YA["__GLOBAL_DOCUMENT_CACHE@4"]=Qz));var XA=dp;const mt=uu(XA);var d_={exports:{}};function Wn(){return Wn=Object.assign?Object.assign.bind():function(t){for(var e=1;e=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nV(t,e){if(t){if(typeof t=="string")return ZA(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);if(i==="Object"&&t.constructor&&(i=t.constructor.name),i==="Map"||i==="Set")return Array.from(t);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return ZA(t,e)}}function ZA(t,e){(e==null||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i=400&&r.statusCode<=599){var o=s;if(i)if(uV.TextDecoder){var u=dV(r.headers&&r.headers["content-type"]);try{o=new TextDecoder(u).decode(s)}catch{}}else o=String.fromCharCode.apply(null,new Uint8Array(s));e({cause:o});return}e(null,s)}};function dV(t){return t===void 0&&(t=""),t.toLowerCase().split(";").reduce(function(e,i){var n=i.split("="),r=n[0],s=n[1];return r.trim()==="charset"?s.trim():e},"utf-8")}var hV=cV,QA=ny,fV=Jz,pV=$z,JA=sV,mV=lV;Jn.httpHandler=hV,Jn.requestInterceptorsStorage=new JA,Jn.responseInterceptorsStorage=new JA,Jn.retryManager=new mV;/** * @license * slighly modified parse-headers 2.0.2 * Copyright (c) 2014 David Björklund * Available under the MIT license * */var gV=function(e){var i={};return e&&e.trim().split(` `).forEach(function(n){var r=n.indexOf(":"),s=n.slice(0,r).trim().toLowerCase(),o=n.slice(r+1).trim();typeof i[s]>"u"?i[s]=o:Array.isArray(i[s])?i[s].push(o):i[s]=[i[s],o]}),i};d_.exports=Jn,d_.exports.default=Jn,Jn.XMLHttpRequest=QA.XMLHttpRequest||_V,Jn.XDomainRequest="withCredentials"in new Jn.XMLHttpRequest?Jn.XMLHttpRequest:QA.XDomainRequest,yV(["get","put","post","patch","head","delete"],function(t){Jn[t==="delete"?"del":t]=function(e,i,n){return i=$A(e,i,n),i.method=t.toUpperCase(),h_(i)}});function yV(t,e){for(var i=0;i"u")throw new Error("callback argument missing");if(t.requestType&&Jn.requestInterceptorsStorage.getIsEnabled()){var e={uri:t.uri||t.url,headers:t.headers||{},body:t.body,metadata:t.metadata||{},retry:t.retry,timeout:t.timeout},i=Jn.requestInterceptorsStorage.execute(t.requestType,e);t.uri=i.uri,t.headers=i.headers,t.body=i.body,t.metadata=i.metadata,t.retry=i.retry,t.timeout=i.timeout}var n=!1,r=function(ae,ye,pe){n||(n=!0,t.callback(ae,ye,pe))};function s(){p.readyState===4&&!Jn.responseInterceptorsStorage.getIsEnabled()&&setTimeout(h,0)}function o(){var J=void 0;if(p.response?J=p.response:J=p.responseText||bV(p),L)try{J=JSON.parse(J)}catch{}return J}function u(J){if(clearTimeout(q),clearTimeout(t.retryTimeout),J instanceof Error||(J=new Error(""+(J||"Unknown XMLHttpRequest Error"))),J.statusCode=0,!y&&Jn.retryManager.getIsEnabled()&&t.retry&&t.retry.shouldRetry()){t.retryTimeout=setTimeout(function(){t.retry.moveToNextAttempt(),t.xhr=p,h_(t)},t.retry.getCurrentFuzzedDelay());return}if(t.requestType&&Jn.responseInterceptorsStorage.getIsEnabled()){var ae={headers:Z.headers||{},body:Z.body,responseUrl:p.responseURL,responseType:p.responseType},ye=Jn.responseInterceptorsStorage.execute(t.requestType,ae);Z.body=ye.body,Z.headers=ye.headers}return r(J,Z)}function h(){if(!y){var J;clearTimeout(q),clearTimeout(t.retryTimeout),t.useXDR&&p.status===void 0?J=200:J=p.status===1223?204:p.status;var ae=Z,ye=null;if(J!==0?(ae={body:o(),statusCode:J,method:P,headers:{},url:S,rawRequest:p},p.getAllResponseHeaders&&(ae.headers=gV(p.getAllResponseHeaders()))):ye=new Error("Internal XMLHttpRequest Error"),t.requestType&&Jn.responseInterceptorsStorage.getIsEnabled()){var pe={headers:ae.headers||{},body:ae.body,responseUrl:p.responseURL,responseType:p.responseType},le=Jn.responseInterceptorsStorage.execute(t.requestType,pe);ae.body=le.body,ae.headers=le.headers}return r(ye,ae,ae.body)}}var p=t.xhr||null;p||(t.cors||t.useXDR?p=new Jn.XDomainRequest:p=new Jn.XMLHttpRequest);var g,y,S=p.url=t.uri||t.url,P=p.method=t.method||"GET",R=t.body||t.data,k=p.headers=t.headers||{},M=!!t.sync,L=!1,q,Z={body:void 0,headers:{},statusCode:0,method:P,url:S,rawRequest:p};if("json"in t&&t.json!==!1&&(L=!0,k.accept||k.Accept||(k.Accept="application/json"),P!=="GET"&&P!=="HEAD"&&(k["content-type"]||k["Content-Type"]||(k["Content-Type"]="application/json"),R=JSON.stringify(t.json===!0?R:t.json))),p.onreadystatechange=s,p.onload=h,p.onerror=u,p.onprogress=function(){},p.onabort=function(){y=!0,clearTimeout(t.retryTimeout)},p.ontimeout=u,p.open(P,S,!M,t.username,t.password),M||(p.withCredentials=!!t.withCredentials),!M&&t.timeout>0&&(q=setTimeout(function(){if(!y){y=!0,p.abort("timeout");var J=new Error("XMLHttpRequest timeout");J.code="ETIMEDOUT",u(J)}},t.timeout)),p.setRequestHeader)for(g in k)k.hasOwnProperty(g)&&p.setRequestHeader(g,k[g]);else if(t.headers&&!vV(t.headers))throw new Error("Headers cannot be set on an XDomainRequest object");return"responseType"in t&&(p.responseType=t.responseType),"beforeSend"in t&&typeof t.beforeSend=="function"&&t.beforeSend(p),p.send(R||null),p}function bV(t){try{if(t.responseType==="document")return t.responseXML;var e=t.responseXML&&t.responseXML.documentElement.nodeName==="parsererror";if(t.responseType===""&&!e)return t.responseXML}catch{}return null}function _V(){}var wV=d_.exports;const e2=uu(wV);var t2={exports:{}},i2=XA,f_=Object.create||function(){function t(){}return function(e){if(arguments.length!==1)throw new Error("Object.create shim only accepts one parameter.");return t.prototype=e,new t}}();function Qs(t,e){this.name="ParsingError",this.code=t.code,this.message=e||t.message}Qs.prototype=f_(Error.prototype),Qs.prototype.constructor=Qs,Qs.Errors={BadSignature:{code:0,message:"Malformed WebVTT signature."},BadTimeStamp:{code:1,message:"Malformed time stamp."}};function p_(t){function e(n,r,s,o){return(n|0)*3600+(r|0)*60+(s|0)+(o|0)/1e3}var i=t.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);return i?i[3]?e(i[1],i[2],i[3].replace(":",""),i[4]):i[1]>59?e(i[1],i[2],0,i[4]):e(0,i[1],i[2],i[4]):null}function hp(){this.values=f_(null)}hp.prototype={set:function(t,e){!this.get(t)&&e!==""&&(this.values[t]=e)},get:function(t,e,i){return i?this.has(t)?this.values[t]:e[i]:this.has(t)?this.values[t]:e},has:function(t){return t in this.values},alt:function(t,e,i){for(var n=0;n=0&&e<=100)?(this.set(t,e),!0):!1}};function fp(t,e,i,n){var r=n?t.split(n):[t];for(var s in r)if(typeof r[s]=="string"){var o=r[s].split(i);if(o.length===2){var u=o[0].trim(),h=o[1].trim();e(u,h)}}}function TV(t,e,i){var n=t;function r(){var u=p_(t);if(u===null)throw new Qs(Qs.Errors.BadTimeStamp,"Malformed timestamp: "+n);return t=t.replace(/^[^\sa-zA-Z-]+/,""),u}function s(u,h){var p=new hp;fp(u,function(g,y){switch(g){case"region":for(var S=i.length-1;S>=0;S--)if(i[S].id===y){p.set(g,i[S].region);break}break;case"vertical":p.alt(g,y,["rl","lr"]);break;case"line":var P=y.split(","),R=P[0];p.integer(g,R),p.percent(g,R)&&p.set("snapToLines",!1),p.alt(g,R,["auto"]),P.length===2&&p.alt("lineAlign",P[1],["start","center","end"]);break;case"position":P=y.split(","),p.percent(g,P[0]),P.length===2&&p.alt("positionAlign",P[1],["start","center","end"]);break;case"size":p.percent(g,y);break;case"align":p.alt(g,y,["start","center","end","left","right"]);break}},/:/,/\s/),h.region=p.get("region",null),h.vertical=p.get("vertical","");try{h.line=p.get("line","auto")}catch{}h.lineAlign=p.get("lineAlign","start"),h.snapToLines=p.get("snapToLines",!0),h.size=p.get("size",100);try{h.align=p.get("align","center")}catch{h.align=p.get("align","middle")}try{h.position=p.get("position","auto")}catch{h.position=p.get("position",{start:0,left:0,center:50,middle:50,end:100,right:100},h.align)}h.positionAlign=p.get("positionAlign",{start:"start",left:"start",center:"center",middle:"center",end:"end",right:"end"},h.align)}function o(){t=t.replace(/^\s+/,"")}if(o(),e.startTime=r(),o(),t.substr(0,3)!=="-->")throw new Qs(Qs.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '-->'): "+n);t=t.substr(3),o(),e.endTime=r(),o(),s(t,e)}var m_=i2.createElement&&i2.createElement("textarea"),xV={c:"span",i:"i",b:"b",u:"u",ruby:"ruby",rt:"rt",v:"span",lang:"span"},n2={white:"rgba(255,255,255,1)",lime:"rgba(0,255,0,1)",cyan:"rgba(0,255,255,1)",red:"rgba(255,0,0,1)",yellow:"rgba(255,255,0,1)",magenta:"rgba(255,0,255,1)",blue:"rgba(0,0,255,1)",black:"rgba(0,0,0,1)"},SV={v:"title",lang:"lang"},r2={rt:"ruby"};function s2(t,e){function i(){if(!e)return null;function R(M){return e=e.substr(M.length),M}var k=e.match(/^([^<]*)(<[^>]*>?)?/);return R(k[1]?k[1]:k[2])}function n(R){return m_.innerHTML=R,R=m_.textContent,m_.textContent="",R}function r(R,k){return!r2[k.localName]||r2[k.localName]===R.localName}function s(R,k){var M=xV[R];if(!M)return null;var L=t.document.createElement(M),q=SV[R];return q&&k&&(L[q]=k.trim()),L}for(var o=t.document.createElement("div"),u=o,h,p=[];(h=i())!==null;){if(h[0]==="<"){if(h[1]==="/"){p.length&&p[p.length-1]===h.substr(2).replace(">","")&&(p.pop(),u=u.parentNode);continue}var g=p_(h.substr(1,h.length-2)),y;if(g){y=t.document.createProcessingInstruction("timestamp",g),u.appendChild(y);continue}var S=h.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);if(!S||(y=s(S[1],S[3]),!y)||!r(u,y))continue;if(S[2]){var P=S[2].split(".");P.forEach(function(R){var k=/^bg_/.test(R),M=k?R.slice(3):R;if(n2.hasOwnProperty(M)){var L=k?"background-color":"color",q=n2[M];y.style[L]=q}}),y.className=P.join(" ")}p.push(S[1]),u.appendChild(y),u=y;continue}u.appendChild(t.document.createTextNode(n(h)))}return o}var o2=[[1470,1470],[1472,1472],[1475,1475],[1478,1478],[1488,1514],[1520,1524],[1544,1544],[1547,1547],[1549,1549],[1563,1563],[1566,1610],[1645,1647],[1649,1749],[1765,1766],[1774,1775],[1786,1805],[1807,1808],[1810,1839],[1869,1957],[1969,1969],[1984,2026],[2036,2037],[2042,2042],[2048,2069],[2074,2074],[2084,2084],[2088,2088],[2096,2110],[2112,2136],[2142,2142],[2208,2208],[2210,2220],[8207,8207],[64285,64285],[64287,64296],[64298,64310],[64312,64316],[64318,64318],[64320,64321],[64323,64324],[64326,64449],[64467,64829],[64848,64911],[64914,64967],[65008,65020],[65136,65140],[65142,65276],[67584,67589],[67592,67592],[67594,67637],[67639,67640],[67644,67644],[67647,67669],[67671,67679],[67840,67867],[67872,67897],[67903,67903],[67968,68023],[68030,68031],[68096,68096],[68112,68115],[68117,68119],[68121,68147],[68160,68167],[68176,68184],[68192,68223],[68352,68405],[68416,68437],[68440,68466],[68472,68479],[68608,68680],[126464,126467],[126469,126495],[126497,126498],[126500,126500],[126503,126503],[126505,126514],[126516,126519],[126521,126521],[126523,126523],[126530,126530],[126535,126535],[126537,126537],[126539,126539],[126541,126543],[126545,126546],[126548,126548],[126551,126551],[126553,126553],[126555,126555],[126557,126557],[126559,126559],[126561,126562],[126564,126564],[126567,126570],[126572,126578],[126580,126583],[126585,126588],[126590,126590],[126592,126601],[126603,126619],[126625,126627],[126629,126633],[126635,126651],[1114109,1114109]];function EV(t){for(var e=0;e=i[0]&&t<=i[1])return!0}return!1}function CV(t){var e=[],i="",n;if(!t||!t.childNodes)return"ltr";function r(u,h){for(var p=h.childNodes.length-1;p>=0;p--)u.push(h.childNodes[p])}function s(u){if(!u||!u.length)return null;var h=u.pop(),p=h.textContent||h.innerText;if(p){var g=p.match(/^.*(\n|\r)/);return g?(u.length=0,g[0]):p}if(h.tagName==="ruby")return s(u);if(h.childNodes)return r(u,h),s(u)}for(r(e,t);i=s(e);)for(var o=0;o=0&&t.line<=100))return t.line;if(!t.track||!t.track.textTrackList||!t.track.textTrackList.mediaElement)return-1;for(var e=t.track,i=e.textTrackList,n=0,r=0;rt.left&&this.topt.top},ms.prototype.overlapsAny=function(t){for(var e=0;e=t.top&&this.bottom<=t.bottom&&this.left>=t.left&&this.right<=t.right},ms.prototype.overlapsOppositeAxis=function(t,e){switch(e){case"+x":return this.leftt.right;case"+y":return this.topt.bottom}},ms.prototype.intersectPercentage=function(t){var e=Math.max(0,Math.min(this.right,t.right)-Math.max(this.left,t.left)),i=Math.max(0,Math.min(this.bottom,t.bottom)-Math.max(this.top,t.top)),n=e*i;return n/(this.height*this.width)},ms.prototype.toCSSCompatValues=function(t){return{top:this.top-t.top,bottom:t.bottom-this.bottom,left:this.left-t.left,right:t.right-this.right,height:this.height,width:this.width}},ms.getSimpleBoxPosition=function(t){var e=t.div?t.div.offsetHeight:t.tagName?t.offsetHeight:0,i=t.div?t.div.offsetWidth:t.tagName?t.offsetWidth:0,n=t.div?t.div.offsetTop:t.tagName?t.offsetTop:0;t=t.div?t.div.getBoundingClientRect():t.tagName?t.getBoundingClientRect():t;var r={left:t.left,right:t.right,top:t.top||n,height:t.height||e,bottom:t.bottom||n+(t.height||e),width:t.width||i};return r};function DV(t,e,i,n){function r(M,L){for(var q,Z=new ms(M),J=1,ae=0;aeye&&(q=new ms(M),J=ye),M=new ms(Z)}return q||Z}var s=new ms(e),o=e.cue,u=AV(o),h=[];if(o.snapToLines){var p;switch(o.vertical){case"":h=["+y","-y"],p="height";break;case"rl":h=["+x","-x"],p="width";break;case"lr":h=["-x","+x"],p="width";break}var g=s.lineHeight,y=g*Math.round(u),S=i[p]+g,P=h[0];Math.abs(y)>S&&(y=y<0?-1:1,y*=Math.ceil(S/g)*g),u<0&&(y+=o.vertical===""?i.height:i.width,h=h.reverse()),s.move(P,y)}else{var R=s.lineHeight/i.height*100;switch(o.lineAlign){case"center":u-=R/2;break;case"end":u-=R;break}switch(o.vertical){case"":e.applyStyles({top:e.formatStyle(u,"%")});break;case"rl":e.applyStyles({left:e.formatStyle(u,"%")});break;case"lr":e.applyStyles({right:e.formatStyle(u,"%")});break}h=["+y","-x","+x","-y"],s=new ms(e)}var k=r(s,h);e.move(k.toCSSCompatValues(i))}function Id(){}Id.StringDecoder=function(){return{decode:function(t){if(!t)return"";if(typeof t!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(t))}}},Id.convertCueToDOMTree=function(t,e){return!t||!e?null:s2(t,e)};var PV=.05,kV="sans-serif",IV="1.5%";Id.processCues=function(t,e,i){if(!t||!e||!i)return null;for(;i.firstChild;)i.removeChild(i.firstChild);var n=t.document.createElement("div");n.style.position="absolute",n.style.left="0",n.style.right="0",n.style.top="0",n.style.bottom="0",n.style.margin=IV,i.appendChild(n);function r(g){for(var y=0;y")===-1){e.cue.id=o;continue}case"CUE":try{TV(o,e.cue,e.regionList)}catch(g){e.reportOrThrowError(g),e.cue=null,e.state="BADCUE";continue}e.state="CUETEXT";continue;case"CUETEXT":var p=o.indexOf("-->")!==-1;if(!o||p&&(h=!0)){e.oncue&&e.oncue(e.cue),e.cue=null,e.state="ID";continue}e.cue.text&&(e.cue.text+=` `),e.cue.text+=o.replace(/\u2028/g,` `).replace(/u2029/g,` `);continue;case"BADCUE":o||(e.state="ID");continue}}}catch(g){e.reportOrThrowError(g),e.state==="CUETEXT"&&e.cue&&e.oncue&&e.oncue(e.cue),e.cue=null,e.state=e.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},flush:function(){var t=this;try{if(t.buffer+=t.decoder.decode(),(t.cue||t.state==="HEADER")&&(t.buffer+=` `,t.parse()),t.state==="INITIAL")throw new Qs(Qs.Errors.BadSignature)}catch(e){t.reportOrThrowError(e)}return t.onflush&&t.onflush(),this}};var RV=Id,OV="auto",LV={"":1,lr:1,rl:1},MV={start:1,center:1,end:1,left:1,right:1,auto:1,"line-left":1,"line-right":1};function FV(t){if(typeof t!="string")return!1;var e=LV[t.toLowerCase()];return e?t.toLowerCase():!1}function g_(t){if(typeof t!="string")return!1;var e=MV[t.toLowerCase()];return e?t.toLowerCase():!1}function a2(t,e,i){this.hasBeenReset=!1;var n="",r=!1,s=t,o=e,u=i,h=null,p="",g=!0,y="auto",S="start",P="auto",R="auto",k=100,M="center";Object.defineProperties(this,{id:{enumerable:!0,get:function(){return n},set:function(L){n=""+L}},pauseOnExit:{enumerable:!0,get:function(){return r},set:function(L){r=!!L}},startTime:{enumerable:!0,get:function(){return s},set:function(L){if(typeof L!="number")throw new TypeError("Start time must be set to a number.");s=L,this.hasBeenReset=!0}},endTime:{enumerable:!0,get:function(){return o},set:function(L){if(typeof L!="number")throw new TypeError("End time must be set to a number.");o=L,this.hasBeenReset=!0}},text:{enumerable:!0,get:function(){return u},set:function(L){u=""+L,this.hasBeenReset=!0}},region:{enumerable:!0,get:function(){return h},set:function(L){h=L,this.hasBeenReset=!0}},vertical:{enumerable:!0,get:function(){return p},set:function(L){var q=FV(L);if(q===!1)throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");p=q,this.hasBeenReset=!0}},snapToLines:{enumerable:!0,get:function(){return g},set:function(L){g=!!L,this.hasBeenReset=!0}},line:{enumerable:!0,get:function(){return y},set:function(L){if(typeof L!="number"&&L!==OV)throw new SyntaxError("Line: an invalid number or illegal string was specified.");y=L,this.hasBeenReset=!0}},lineAlign:{enumerable:!0,get:function(){return S},set:function(L){var q=g_(L);q?(S=q,this.hasBeenReset=!0):console.warn("lineAlign: an invalid or illegal string was specified.")}},position:{enumerable:!0,get:function(){return P},set:function(L){if(L<0||L>100)throw new Error("Position must be between 0 and 100.");P=L,this.hasBeenReset=!0}},positionAlign:{enumerable:!0,get:function(){return R},set:function(L){var q=g_(L);q?(R=q,this.hasBeenReset=!0):console.warn("positionAlign: an invalid or illegal string was specified.")}},size:{enumerable:!0,get:function(){return k},set:function(L){if(L<0||L>100)throw new Error("Size must be between 0 and 100.");k=L,this.hasBeenReset=!0}},align:{enumerable:!0,get:function(){return M},set:function(L){var q=g_(L);if(!q)throw new SyntaxError("align: an invalid or illegal alignment string was specified.");M=q,this.hasBeenReset=!0}}}),this.displayState=void 0}a2.prototype.getCueAsHTML=function(){return WebVTT.convertCueToDOMTree(window,this.text)};var NV=a2,BV={"":!0,up:!0};function HV(t){if(typeof t!="string")return!1;var e=BV[t.toLowerCase()];return e?t.toLowerCase():!1}function pp(t){return typeof t=="number"&&t>=0&&t<=100}function UV(){var t=100,e=3,i=0,n=100,r=0,s=100,o="";Object.defineProperties(this,{width:{enumerable:!0,get:function(){return t},set:function(u){if(!pp(u))throw new Error("Width must be between 0 and 100.");t=u}},lines:{enumerable:!0,get:function(){return e},set:function(u){if(typeof u!="number")throw new TypeError("Lines must be set to a number.");e=u}},regionAnchorY:{enumerable:!0,get:function(){return n},set:function(u){if(!pp(u))throw new Error("RegionAnchorX must be between 0 and 100.");n=u}},regionAnchorX:{enumerable:!0,get:function(){return i},set:function(u){if(!pp(u))throw new Error("RegionAnchorY must be between 0 and 100.");i=u}},viewportAnchorY:{enumerable:!0,get:function(){return s},set:function(u){if(!pp(u))throw new Error("ViewportAnchorY must be between 0 and 100.");s=u}},viewportAnchorX:{enumerable:!0,get:function(){return r},set:function(u){if(!pp(u))throw new Error("ViewportAnchorX must be between 0 and 100.");r=u}},scroll:{enumerable:!0,get:function(){return o},set:function(u){var h=HV(u);h===!1?console.warn("Scroll: an invalid or illegal string was specified."):o=h}}})}var zV=UV,fl=ny,mc=t2.exports={WebVTT:RV,VTTCue:NV,VTTRegion:zV};fl.vttjs=mc,fl.WebVTT=mc.WebVTT;var VV=mc.VTTCue,jV=mc.VTTRegion,WV=fl.VTTCue,qV=fl.VTTRegion;mc.shim=function(){fl.VTTCue=VV,fl.VTTRegion=jV},mc.restore=function(){fl.VTTCue=WV,fl.VTTRegion=qV},fl.VTTCue||mc.shim();var GV=t2.exports;const l2=uu(GV);var u2="https://example.com",oy=function(e,i){if(/^[a-z]+:/i.test(i))return i;/^data:/.test(e)&&(e=_e.location&&_e.location.href||"");var n=/^\/\//.test(e),r=!_e.location&&!/\/\//i.test(e);e=new _e.URL(e,_e.location||u2);var s=new URL(i,e);return r?s.href.slice(u2.length):n?s.href.slice(s.protocol.length):s.href},y_=function(){function t(){this.listeners={}}var e=t.prototype;return e.on=function(n,r){this.listeners[n]||(this.listeners[n]=[]),this.listeners[n].push(r)},e.off=function(n,r){if(!this.listeners[n])return!1;var s=this.listeners[n].indexOf(r);return this.listeners[n]=this.listeners[n].slice(0),this.listeners[n].splice(s,1),s>-1},e.trigger=function(n){var r=this.listeners[n];if(r)if(arguments.length===2)for(var s=r.length,o=0;o-1;i=this.buffer.indexOf(` `))this.trigger("data",this.buffer.substring(0,i)),this.buffer=this.buffer.substring(i+1)}}const XV=" ",v_=function(t){const e=/([0-9.]*)?@?([0-9.]*)?/.exec(t||""),i={};return e[1]&&(i.length=parseInt(e[1],10)),e[2]&&(i.offset=parseInt(e[2],10)),i},ZV=function(){const i="(?:"+"[^=]*"+")=(?:"+'"[^"]*"|[^,]*'+")";return new RegExp("(?:^|,)("+i+")")},gs=function(t){const e={};if(!t)return e;const i=t.split(ZV());let n=i.length,r;for(;n--;)i[n]!==""&&(r=/([^=]*)=(.*)/.exec(i[n]).slice(1),r[0]=r[0].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^\s+|\s+$/g,""),r[1]=r[1].replace(/^['"](.*)['"]$/g,"$1"),e[r[0]]=r[1]);return e},d2=t=>{const e=t.split("x"),i={};return e[0]&&(i.width=parseInt(e[0],10)),e[1]&&(i.height=parseInt(e[1],10)),i};class QV extends y_{constructor(){super(),this.customParsers=[],this.tagMappers=[]}push(e){let i,n;if(e=e.trim(),e.length===0)return;if(e[0]!=="#"){this.trigger("data",{type:"uri",uri:e});return}this.tagMappers.reduce((s,o)=>{const u=o(e);return u===e?s:s.concat([u])},[e]).forEach(s=>{for(let o=0;os),this.customParsers.push(s=>{if(e.exec(s))return this.trigger("data",{type:"custom",data:n(s),customType:i,segment:r}),!0})}addTagMapper({expression:e,map:i}){const n=r=>e.test(r)?i(r):r;this.tagMappers.push(n)}}const JV=t=>t.toLowerCase().replace(/-(\w)/g,e=>e[1].toUpperCase()),cu=function(t){const e={};return Object.keys(t).forEach(function(i){e[JV(i)]=t[i]}),e},b_=function(t){const{serverControl:e,targetDuration:i,partTargetDuration:n}=t;if(!e)return;const r="#EXT-X-SERVER-CONTROL",s="holdBack",o="partHoldBack",u=i&&i*3,h=n&&n*2;i&&!e.hasOwnProperty(s)&&(e[s]=u,this.trigger("info",{message:`${r} defaulting HOLD-BACK to targetDuration * 3 (${u}).`})),u&&e[s]{r.uri||!r.parts&&!r.preloadHints||(!r.map&&s&&(r.map=s),!r.key&&o&&(r.key=o),!r.timeline&&typeof y=="number"&&(r.timeline=y),this.manifest.preloadSegment=r)}),this.parseStream.on("data",function(k){let M,L;if(i.manifest.definitions){for(const q in i.manifest.definitions)if(k.uri&&(k.uri=k.uri.replace(`{$${q}}`,i.manifest.definitions[q])),k.attributes)for(const Z in k.attributes)typeof k.attributes[Z]=="string"&&(k.attributes[Z]=k.attributes[Z].replace(`{$${q}}`,i.manifest.definitions[q]))}({tag(){({version(){k.version&&(this.manifest.version=k.version)},"allow-cache"(){this.manifest.allowCache=k.allowed,"allowed"in k||(this.trigger("info",{message:"defaulting allowCache to YES"}),this.manifest.allowCache=!0)},byterange(){const q={};"length"in k&&(r.byterange=q,q.length=k.length,"offset"in k||(k.offset=S)),"offset"in k&&(r.byterange=q,q.offset=k.offset),S=q.offset+q.length},endlist(){this.manifest.endList=!0},inf(){"mediaSequence"in this.manifest||(this.manifest.mediaSequence=0,this.trigger("info",{message:"defaulting media sequence to zero"})),"discontinuitySequence"in this.manifest||(this.manifest.discontinuitySequence=0,this.trigger("info",{message:"defaulting discontinuity sequence to zero"})),k.title&&(r.title=k.title),k.duration>0&&(r.duration=k.duration),k.duration===0&&(r.duration=.01,this.trigger("info",{message:"updating zero segment duration to a small value"})),this.manifest.segments=n},key(){if(!k.attributes){this.trigger("warn",{message:"ignoring key declaration without attribute list"});return}if(k.attributes.METHOD==="NONE"){o=null;return}if(!k.attributes.URI){this.trigger("warn",{message:"ignoring key declaration without URI"});return}if(k.attributes.KEYFORMAT==="com.apple.streamingkeydelivery"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.apple.fps.1_0"]={attributes:k.attributes};return}if(k.attributes.KEYFORMAT==="com.microsoft.playready"){this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.microsoft.playready"]={uri:k.attributes.URI};return}if(k.attributes.KEYFORMAT===g){if(["SAMPLE-AES","SAMPLE-AES-CTR","SAMPLE-AES-CENC"].indexOf(k.attributes.METHOD)===-1){this.trigger("warn",{message:"invalid key method provided for Widevine"});return}if(k.attributes.METHOD==="SAMPLE-AES-CENC"&&this.trigger("warn",{message:"SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"}),k.attributes.URI.substring(0,23)!=="data:text/plain;base64,"){this.trigger("warn",{message:"invalid key URI provided for Widevine"});return}if(!(k.attributes.KEYID&&k.attributes.KEYID.substring(0,2)==="0x")){this.trigger("warn",{message:"invalid key ID provided for Widevine"});return}this.manifest.contentProtection=this.manifest.contentProtection||{},this.manifest.contentProtection["com.widevine.alpha"]={attributes:{schemeIdUri:k.attributes.KEYFORMAT,keyId:k.attributes.KEYID.substring(2)},pssh:c2(k.attributes.URI.split(",")[1])};return}k.attributes.METHOD||this.trigger("warn",{message:"defaulting key method to AES-128"}),o={method:k.attributes.METHOD||"AES-128",uri:k.attributes.URI},typeof k.attributes.IV<"u"&&(o.iv=k.attributes.IV)},"media-sequence"(){if(!isFinite(k.number)){this.trigger("warn",{message:"ignoring invalid media sequence: "+k.number});return}this.manifest.mediaSequence=k.number},"discontinuity-sequence"(){if(!isFinite(k.number)){this.trigger("warn",{message:"ignoring invalid discontinuity sequence: "+k.number});return}this.manifest.discontinuitySequence=k.number,y=k.number},"playlist-type"(){if(!/VOD|EVENT/.test(k.playlistType)){this.trigger("warn",{message:"ignoring unknown playlist type: "+k.playlist});return}this.manifest.playlistType=k.playlistType},map(){s={},k.uri&&(s.uri=k.uri),k.byterange&&(s.byterange=k.byterange),o&&(s.key=o)},"stream-inf"(){if(this.manifest.playlists=n,this.manifest.mediaGroups=this.manifest.mediaGroups||p,!k.attributes){this.trigger("warn",{message:"ignoring empty stream-inf attributes"});return}r.attributes||(r.attributes={}),Wn(r.attributes,k.attributes)},media(){if(this.manifest.mediaGroups=this.manifest.mediaGroups||p,!(k.attributes&&k.attributes.TYPE&&k.attributes["GROUP-ID"]&&k.attributes.NAME)){this.trigger("warn",{message:"ignoring incomplete or missing media group"});return}const q=this.manifest.mediaGroups[k.attributes.TYPE];q[k.attributes["GROUP-ID"]]=q[k.attributes["GROUP-ID"]]||{},M=q[k.attributes["GROUP-ID"]],L={default:/yes/i.test(k.attributes.DEFAULT)},L.default?L.autoselect=!0:L.autoselect=/yes/i.test(k.attributes.AUTOSELECT),k.attributes.LANGUAGE&&(L.language=k.attributes.LANGUAGE),k.attributes.URI&&(L.uri=k.attributes.URI),k.attributes["INSTREAM-ID"]&&(L.instreamId=k.attributes["INSTREAM-ID"]),k.attributes.CHARACTERISTICS&&(L.characteristics=k.attributes.CHARACTERISTICS),k.attributes.FORCED&&(L.forced=/yes/i.test(k.attributes.FORCED)),M[k.attributes.NAME]=L},discontinuity(){y+=1,r.discontinuity=!0,this.manifest.discontinuityStarts.push(n.length)},"program-date-time"(){typeof this.manifest.dateTimeString>"u"&&(this.manifest.dateTimeString=k.dateTimeString,this.manifest.dateTimeObject=k.dateTimeObject),r.dateTimeString=k.dateTimeString,r.dateTimeObject=k.dateTimeObject;const{lastProgramDateTime:q}=this;this.lastProgramDateTime=new Date(k.dateTimeString).getTime(),q===null&&this.manifest.segments.reduceRight((Z,J)=>(J.programDateTime=Z-J.duration*1e3,J.programDateTime),this.lastProgramDateTime)},targetduration(){if(!isFinite(k.duration)||k.duration<0){this.trigger("warn",{message:"ignoring invalid target duration: "+k.duration});return}this.manifest.targetDuration=k.duration,b_.call(this,this.manifest)},start(){if(!k.attributes||isNaN(k.attributes["TIME-OFFSET"])){this.trigger("warn",{message:"ignoring start declaration without appropriate attribute list"});return}this.manifest.start={timeOffset:k.attributes["TIME-OFFSET"],precise:k.attributes.PRECISE}},"cue-out"(){r.cueOut=k.data},"cue-out-cont"(){r.cueOutCont=k.data},"cue-in"(){r.cueIn=k.data},skip(){this.manifest.skip=cu(k.attributes),this.warnOnMissingAttributes_("#EXT-X-SKIP",k.attributes,["SKIPPED-SEGMENTS"])},part(){u=!0;const q=this.manifest.segments.length,Z=cu(k.attributes);r.parts=r.parts||[],r.parts.push(Z),Z.byterange&&(Z.byterange.hasOwnProperty("offset")||(Z.byterange.offset=P),P=Z.byterange.offset+Z.byterange.length);const J=r.parts.length-1;this.warnOnMissingAttributes_(`#EXT-X-PART #${J} for segment #${q}`,k.attributes,["URI","DURATION"]),this.manifest.renditionReports&&this.manifest.renditionReports.forEach((ae,ye)=>{ae.hasOwnProperty("lastPart")||this.trigger("warn",{message:`#EXT-X-RENDITION-REPORT #${ye} lacks required attribute(s): LAST-PART`})})},"server-control"(){const q=this.manifest.serverControl=cu(k.attributes);q.hasOwnProperty("canBlockReload")||(q.canBlockReload=!1,this.trigger("info",{message:"#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false"})),b_.call(this,this.manifest),q.canSkipDateranges&&!q.hasOwnProperty("canSkipUntil")&&this.trigger("warn",{message:"#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set"})},"preload-hint"(){const q=this.manifest.segments.length,Z=cu(k.attributes),J=Z.type&&Z.type==="PART";r.preloadHints=r.preloadHints||[],r.preloadHints.push(Z),Z.byterange&&(Z.byterange.hasOwnProperty("offset")||(Z.byterange.offset=J?P:0,J&&(P=Z.byterange.offset+Z.byterange.length)));const ae=r.preloadHints.length-1;if(this.warnOnMissingAttributes_(`#EXT-X-PRELOAD-HINT #${ae} for segment #${q}`,k.attributes,["TYPE","URI"]),!!Z.type)for(let ye=0;yeye.id===Z.id);this.manifest.dateRanges[ae]=Wn(this.manifest.dateRanges[ae],Z),R[Z.id]=Wn(R[Z.id],Z),this.manifest.dateRanges.pop()}},"independent-segments"(){this.manifest.independentSegments=!0},"i-frames-only"(){this.manifest.iFramesOnly=!0,this.requiredCompatibilityversion(this.manifest.version,4)},"content-steering"(){this.manifest.contentSteering=cu(k.attributes),this.warnOnMissingAttributes_("#EXT-X-CONTENT-STEERING",k.attributes,["SERVER-URI"])},define(){this.manifest.definitions=this.manifest.definitions||{};const q=(Z,J)=>{if(Z in this.manifest.definitions){this.trigger("error",{message:`EXT-X-DEFINE: Duplicate name ${Z}`});return}this.manifest.definitions[Z]=J};if("QUERYPARAM"in k.attributes){if("NAME"in k.attributes||"IMPORT"in k.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}const Z=this.params.get(k.attributes.QUERYPARAM);if(!Z){this.trigger("error",{message:`EXT-X-DEFINE: No query param ${k.attributes.QUERYPARAM}`});return}q(k.attributes.QUERYPARAM,decodeURIComponent(Z));return}if("NAME"in k.attributes){if("IMPORT"in k.attributes){this.trigger("error",{message:"EXT-X-DEFINE: Invalid attributes"});return}if(!("VALUE"in k.attributes)||typeof k.attributes.VALUE!="string"){this.trigger("error",{message:`EXT-X-DEFINE: No value for ${k.attributes.NAME}`});return}q(k.attributes.NAME,k.attributes.VALUE);return}if("IMPORT"in k.attributes){if(!this.mainDefinitions[k.attributes.IMPORT]){this.trigger("error",{message:`EXT-X-DEFINE: No value ${k.attributes.IMPORT} to import, or IMPORT used on main playlist`});return}q(k.attributes.IMPORT,this.mainDefinitions[k.attributes.IMPORT]);return}this.trigger("error",{message:"EXT-X-DEFINE: No attribute"})},"i-frame-playlist"(){this.manifest.iFramePlaylists.push({attributes:k.attributes,uri:k.uri,timeline:y}),this.warnOnMissingAttributes_("#EXT-X-I-FRAME-STREAM-INF",k.attributes,["BANDWIDTH","URI"])}}[k.tagType]||h).call(i)},uri(){r.uri=k.uri,n.push(r),this.manifest.targetDuration&&!("duration"in r)&&(this.trigger("warn",{message:"defaulting segment duration to the target duration"}),r.duration=this.manifest.targetDuration),o&&(r.key=o),r.timeline=y,s&&(r.map=s),P=0,this.lastProgramDateTime!==null&&(r.programDateTime=this.lastProgramDateTime,this.lastProgramDateTime+=r.duration*1e3),r={}},comment(){},custom(){k.segment?(r.custom=r.custom||{},r.custom[k.customType]=k.data):(this.manifest.custom=this.manifest.custom||{},this.manifest.custom[k.customType]=k.data)}})[k.type].call(i)})}requiredCompatibilityversion(e,i){(ey&&(g-=y,g-=y,g-=Or(2))}return Number(g)},c7=function(e,i){var n={},r=n.le,s=r===void 0?!1:r;(typeof e!="bigint"&&typeof e!="number"||typeof e=="number"&&e!==e)&&(e=0),e=Or(e);for(var o=a7(e),u=new Uint8Array(new ArrayBuffer(o)),h=0;h=i.length&&p.call(i,function(g,y){var S=h[y]?h[y]&e[o+y]:e[o+y];return g===S})},h7=function(e,i,n){i.forEach(function(r){for(var s in e.mediaGroups[r])for(var o in e.mediaGroups[r][s]){var u=e.mediaGroups[r][s][o];n(u,r,s,o)}})},du={},pl={};function f7(t,e,i){if(i===void 0&&(i=Array.prototype),t&&typeof i.find=="function")return i.find.call(t,e);for(var n=0;n=0&&t=0){for(var r=e.length-1;n0},lookupPrefix:function(t){for(var e=this;e;){var i=e._nsMap;if(i){for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)&&i[n]===t)return n}e=e.nodeType==Od?e.ownerDocument:e.parentNode}return null},lookupNamespaceURI:function(t){for(var e=this;e;){var i=e._nsMap;if(i&&Object.prototype.hasOwnProperty.call(i,t))return i[t];e=e.nodeType==Od?e.ownerDocument:e.parentNode}return null},isDefaultNamespace:function(t){var e=this.lookupPrefix(t);return e==null}};function M2(t){return t=="<"&&"<"||t==">"&&">"||t=="&"&&"&"||t=='"'&&"""||"&#"+t.charCodeAt()+";"}yp(Fs,nn),yp(Fs,nn.prototype);function vp(t,e){if(e(t))return!0;if(t=t.firstChild)do if(vp(t,e))return!0;while(t=t.nextSibling)}function bp(){this.ownerDocument=this}function w7(t,e,i){t&&t._inc++;var n=i.namespaceURI;n===gp.XMLNS&&(e._nsMap[i.prefix?i.localName:""]=i.value)}function F2(t,e,i,n){t&&t._inc++;var r=i.namespaceURI;r===gp.XMLNS&&delete e._nsMap[i.prefix?i.localName:""]}function S_(t,e,i){if(t&&t._inc){t._inc++;var n=e.childNodes;if(i)n[n.length++]=i;else{for(var r=e.firstChild,s=0;r;)n[s++]=r,r=r.nextSibling;n.length=s,delete n[n.length]}}}function N2(t,e){var i=e.previousSibling,n=e.nextSibling;return i?i.nextSibling=n:t.firstChild=n,n?n.previousSibling=i:t.lastChild=i,e.parentNode=null,e.previousSibling=null,e.nextSibling=null,S_(t.ownerDocument,t),e}function T7(t){return t&&(t.nodeType===nn.DOCUMENT_NODE||t.nodeType===nn.DOCUMENT_FRAGMENT_NODE||t.nodeType===nn.ELEMENT_NODE)}function x7(t){return t&&(ba(t)||E_(t)||yl(t)||t.nodeType===nn.DOCUMENT_FRAGMENT_NODE||t.nodeType===nn.COMMENT_NODE||t.nodeType===nn.PROCESSING_INSTRUCTION_NODE)}function yl(t){return t&&t.nodeType===nn.DOCUMENT_TYPE_NODE}function ba(t){return t&&t.nodeType===nn.ELEMENT_NODE}function E_(t){return t&&t.nodeType===nn.TEXT_NODE}function B2(t,e){var i=t.childNodes||[];if(va(i,ba)||yl(e))return!1;var n=va(i,yl);return!(e&&n&&i.indexOf(n)>i.indexOf(e))}function H2(t,e){var i=t.childNodes||[];function n(s){return ba(s)&&s!==e}if(va(i,n))return!1;var r=va(i,yl);return!(e&&r&&i.indexOf(r)>i.indexOf(e))}function S7(t,e,i){if(!T7(t))throw new $n(Ns,"Unexpected parent node type "+t.nodeType);if(i&&i.parentNode!==t)throw new $n(P2,"child not in parent");if(!x7(e)||yl(e)&&t.nodeType!==nn.DOCUMENT_NODE)throw new $n(Ns,"Unexpected node type "+e.nodeType+" for parent node type "+t.nodeType)}function E7(t,e,i){var n=t.childNodes||[],r=e.childNodes||[];if(e.nodeType===nn.DOCUMENT_FRAGMENT_NODE){var s=r.filter(ba);if(s.length>1||va(r,E_))throw new $n(Ns,"More than one element or text in fragment");if(s.length===1&&!B2(t,i))throw new $n(Ns,"Element in fragment can not be inserted before doctype")}if(ba(e)&&!B2(t,i))throw new $n(Ns,"Only one element can be added and only after doctype");if(yl(e)){if(va(n,yl))throw new $n(Ns,"Only one doctype is allowed");var o=va(n,ba);if(i&&n.indexOf(o)1||va(r,E_))throw new $n(Ns,"More than one element or text in fragment");if(s.length===1&&!H2(t,i))throw new $n(Ns,"Element in fragment can not be inserted before doctype")}if(ba(e)&&!H2(t,i))throw new $n(Ns,"Only one element can be added and only after doctype");if(yl(e)){if(va(n,function(h){return yl(h)&&h!==i}))throw new $n(Ns,"Only one doctype is allowed");var o=va(n,ba);if(i&&n.indexOf(o)0&&vp(i.documentElement,function(r){if(r!==i&&r.nodeType===zo){var s=r.getAttribute("class");if(s){var o=t===s;if(!o){var u=T2(s);o=e.every(v7(u))}o&&n.push(r)}}}),n})},createElement:function(t){var e=new yc;e.ownerDocument=this,e.nodeName=t,e.tagName=t,e.localName=t,e.childNodes=new gl;var i=e.attributes=new ly;return i._ownerElement=e,e},createDocumentFragment:function(){var t=new hy;return t.ownerDocument=this,t.childNodes=new gl,t},createTextNode:function(t){var e=new C_;return e.ownerDocument=this,e.appendData(t),e},createComment:function(t){var e=new A_;return e.ownerDocument=this,e.appendData(t),e},createCDATASection:function(t){var e=new D_;return e.ownerDocument=this,e.appendData(t),e},createProcessingInstruction:function(t,e){var i=new k_;return i.ownerDocument=this,i.tagName=i.nodeName=i.target=t,i.nodeValue=i.data=e,i},createAttribute:function(t){var e=new cy;return e.ownerDocument=this,e.name=t,e.nodeName=t,e.localName=t,e.specified=!0,e},createEntityReference:function(t){var e=new P_;return e.ownerDocument=this,e.nodeName=t,e},createElementNS:function(t,e){var i=new yc,n=e.split(":"),r=i.attributes=new ly;return i.childNodes=new gl,i.ownerDocument=this,i.nodeName=e,i.tagName=e,i.namespaceURI=t,n.length==2?(i.prefix=n[0],i.localName=n[1]):i.localName=e,r._ownerElement=i,i},createAttributeNS:function(t,e){var i=new cy,n=e.split(":");return i.ownerDocument=this,i.nodeName=e,i.name=e,i.namespaceURI=t,i.specified=!0,n.length==2?(i.prefix=n[0],i.localName=n[1]):i.localName=e,i}},Ms(bp,nn);function yc(){this._nsMap={}}yc.prototype={nodeType:zo,hasAttribute:function(t){return this.getAttributeNode(t)!=null},getAttribute:function(t){var e=this.getAttributeNode(t);return e&&e.value||""},getAttributeNode:function(t){return this.attributes.getNamedItem(t)},setAttribute:function(t,e){var i=this.ownerDocument.createAttribute(t);i.value=i.nodeValue=""+e,this.setAttributeNode(i)},removeAttribute:function(t){var e=this.getAttributeNode(t);e&&this.removeAttributeNode(e)},appendChild:function(t){return t.nodeType===ml?this.insertBefore(t,null):C7(this,t)},setAttributeNode:function(t){return this.attributes.setNamedItem(t)},setAttributeNodeNS:function(t){return this.attributes.setNamedItemNS(t)},removeAttributeNode:function(t){return this.attributes.removeNamedItem(t.nodeName)},removeAttributeNS:function(t,e){var i=this.getAttributeNodeNS(t,e);i&&this.removeAttributeNode(i)},hasAttributeNS:function(t,e){return this.getAttributeNodeNS(t,e)!=null},getAttributeNS:function(t,e){var i=this.getAttributeNodeNS(t,e);return i&&i.value||""},setAttributeNS:function(t,e,i){var n=this.ownerDocument.createAttributeNS(t,e);n.value=n.nodeValue=""+i,this.setAttributeNode(n)},getAttributeNodeNS:function(t,e){return this.attributes.getNamedItemNS(t,e)},getElementsByTagName:function(t){return new Ld(this,function(e){var i=[];return vp(e,function(n){n!==e&&n.nodeType==zo&&(t==="*"||n.tagName==t)&&i.push(n)}),i})},getElementsByTagNameNS:function(t,e){return new Ld(this,function(i){var n=[];return vp(i,function(r){r!==i&&r.nodeType===zo&&(t==="*"||r.namespaceURI===t)&&(e==="*"||r.localName==e)&&n.push(r)}),n})}},bp.prototype.getElementsByTagName=yc.prototype.getElementsByTagName,bp.prototype.getElementsByTagNameNS=yc.prototype.getElementsByTagNameNS,Ms(yc,nn);function cy(){}cy.prototype.nodeType=Od,Ms(cy,nn);function _p(){}_p.prototype={data:"",substringData:function(t,e){return this.data.substring(t,t+e)},appendData:function(t){t=this.data+t,this.nodeValue=this.data=t,this.length=t.length},insertData:function(t,e){this.replaceData(t,0,e)},appendChild:function(t){throw new Error(wr[Ns])},deleteData:function(t,e){this.replaceData(t,e,"")},replaceData:function(t,e,i){var n=this.data.substring(0,t),r=this.data.substring(t+e);i=n+i+r,this.nodeValue=this.data=i,this.length=i.length}},Ms(_p,nn);function C_(){}C_.prototype={nodeName:"#text",nodeType:ay,splitText:function(t){var e=this.data,i=e.substring(t);e=e.substring(0,t),this.data=this.nodeValue=e,this.length=e.length;var n=this.ownerDocument.createTextNode(i);return this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling),n}},Ms(C_,_p);function A_(){}A_.prototype={nodeName:"#comment",nodeType:C2},Ms(A_,_p);function D_(){}D_.prototype={nodeName:"#cdata-section",nodeType:x2},Ms(D_,_p);function dy(){}dy.prototype.nodeType=D2,Ms(dy,nn);function z2(){}z2.prototype.nodeType=_7,Ms(z2,nn);function V2(){}V2.prototype.nodeType=b7,Ms(V2,nn);function P_(){}P_.prototype.nodeType=S2,Ms(P_,nn);function hy(){}hy.prototype.nodeName="#document-fragment",hy.prototype.nodeType=ml,Ms(hy,nn);function k_(){}k_.prototype.nodeType=E2,Ms(k_,nn);function j2(){}j2.prototype.serializeToString=function(t,e,i){return W2.call(t,e,i)},nn.prototype.toString=W2;function W2(t,e){var i=[],n=this.nodeType==9&&this.documentElement||this,r=n.prefix,s=n.namespaceURI;if(s&&r==null){var r=n.lookupPrefix(s);if(r==null)var o=[{namespace:s,prefix:null}]}return Md(this,i,t,e,o),i.join("")}function q2(t,e,i){var n=t.prefix||"",r=t.namespaceURI;if(!r||n==="xml"&&r===gp.XML||r===gp.XMLNS)return!1;for(var s=i.length;s--;){var o=i[s];if(o.prefix===n)return o.namespace!==r}return!0}function I_(t,e,i){t.push(" ",e,'="',i.replace(/[<>&"\t\n\r]/g,M2),'"')}function Md(t,e,i,n,r){if(r||(r=[]),n)if(t=n(t),t){if(typeof t=="string"){e.push(t);return}}else return;switch(t.nodeType){case zo:var s=t.attributes,o=s.length,L=t.firstChild,u=t.tagName;i=gp.isHTML(t.namespaceURI)||i;var h=u;if(!i&&!t.prefix&&t.namespaceURI){for(var p,g=0;g=0;y--){var S=r[y];if(S.prefix===""&&S.namespace===t.namespaceURI){p=S.namespace;break}}if(p!==t.namespaceURI)for(var y=r.length-1;y>=0;y--){var S=r[y];if(S.namespace===t.namespaceURI){S.prefix&&(h=S.prefix+":"+u);break}}}e.push("<",h);for(var P=0;P"),i&&/^script$/i.test(u))for(;L;)L.data?e.push(L.data):Md(L,e,i,n,r.slice()),L=L.nextSibling;else for(;L;)Md(L,e,i,n,r.slice()),L=L.nextSibling;e.push("")}else e.push("/>");return;case A2:case ml:for(var L=t.firstChild;L;)Md(L,e,i,n,r.slice()),L=L.nextSibling;return;case Od:return I_(e,t.name,t.value);case ay:return e.push(t.data.replace(/[<&>]/g,M2));case x2:return e.push("");case C2:return e.push("");case D2:var q=t.publicId,Z=t.systemId;if(e.push("");else if(Z&&Z!=".")e.push(" SYSTEM ",Z,">");else{var J=t.internalSubset;J&&e.push(" [",J,"]"),e.push(">")}return;case E2:return e.push("");case S2:return e.push("&",t.nodeName,";");default:e.push("??",t.nodeName)}}function G2(t,e,i){var n;switch(e.nodeType){case zo:n=e.cloneNode(!1),n.ownerDocument=t;case ml:break;case Od:i=!0;break}if(n||(n=e.cloneNode(!1)),n.ownerDocument=t,n.parentNode=null,i)for(var r=e.firstChild;r;)n.appendChild(G2(t,r,i)),r=r.nextSibling;return n}function R_(t,e,i){var n=new e.constructor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var s=e[r];typeof s!="object"&&s!=n[r]&&(n[r]=s)}switch(e.childNodes&&(n.childNodes=new gl),n.ownerDocument=t,n.nodeType){case zo:var o=e.attributes,u=n.attributes=new ly,h=o.length;u._ownerElement=n;for(var p=0;p",lt:"<",quot:'"'}),t.HTML_ENTITIES=e({Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"⁡",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",AMP:"&",amp:"&",And:"⩓",and:"∧",andand:"⩕",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsd:"∡",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",ap:"≈",apacir:"⩯",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"⁡",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",Barwed:"⌆",barwed:"⌅",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",Because:"∵",because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxDL:"╗",boxDl:"╖",boxdL:"╕",boxdl:"┐",boxDR:"╔",boxDr:"╓",boxdR:"╒",boxdr:"┌",boxH:"═",boxh:"─",boxHD:"╦",boxHd:"╤",boxhD:"╥",boxhd:"┬",boxHU:"╩",boxHu:"╧",boxhU:"╨",boxhu:"┴",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxUL:"╝",boxUl:"╜",boxuL:"╛",boxul:"┘",boxUR:"╚",boxUr:"╙",boxuR:"╘",boxur:"└",boxV:"║",boxv:"│",boxVH:"╬",boxVh:"╫",boxvH:"╪",boxvh:"┼",boxVL:"╣",boxVl:"╢",boxvL:"╡",boxvl:"┤",boxVR:"╠",boxVr:"╟",boxvR:"╞",boxvr:"├",bprime:"‵",Breve:"˘",breve:"˘",brvbar:"¦",Bscr:"ℬ",bscr:"𝒷",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsol:"\\",bsolb:"⧅",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",Cap:"⋒",cap:"∩",capand:"⩄",capbrcup:"⩉",capcap:"⩋",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",CenterDot:"·",centerdot:"·",Cfr:"ℭ",cfr:"𝔠",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",cir:"○",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",Colon:"∷",colon:":",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",Conint:"∯",conint:"∮",ContourIntegral:"∮",Copf:"ℂ",copf:"𝕔",coprod:"∐",Coproduct:"∐",COPY:"©",copy:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",Cross:"⨯",cross:"✗",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",Cup:"⋓",cup:"∪",cupbrcap:"⩈",CupCap:"≍",cupcap:"⩆",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",Dagger:"‡",dagger:"†",daleth:"ℸ",Darr:"↡",dArr:"⇓",darr:"↓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",DD:"ⅅ",dd:"ⅆ",ddagger:"‡",ddarr:"⇊",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",Diamond:"⋄",diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrow:"↓",Downarrow:"⇓",downarrow:"↓",DownArrowBar:"⤓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVector:"↽",DownLeftVectorBar:"⥖",DownRightTeeVector:"⥟",DownRightVector:"⇁",DownRightVectorBar:"⥗",DownTee:"⊤",DownTeeArrow:"↧",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",ecir:"≖",Ecirc:"Ê",ecirc:"ê",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",eDot:"≑",edot:"ė",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp:" ",emsp13:" ",emsp14:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",Escr:"ℰ",escr:"ℯ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",ExponentialE:"ⅇ",exponentiale:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",ForAll:"∀",forall:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",Fscr:"ℱ",fscr:"𝒻",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",gE:"≧",ge:"≥",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",ges:"⩾",gescc:"⪩",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",Gg:"⋙",gg:"≫",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gl:"≷",gla:"⪥",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gnE:"≩",gne:"⪈",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",Gt:"≫",GT:">",gt:">",gtcc:"⪧",gtcir:"⩺",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",hArr:"⇔",harr:"↔",harrcir:"⥈",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",Hfr:"ℌ",hfr:"𝔥",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",Hopf:"ℍ",hopf:"𝕙",horbar:"―",HorizontalLine:"─",Hscr:"ℋ",hscr:"𝒽",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"⁣",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",Ifr:"ℑ",ifr:"𝔦",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Im:"ℑ",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",imof:"⊷",imped:"Ƶ",Implies:"⇒",in:"∈",incare:"℅",infin:"∞",infintie:"⧝",inodot:"ı",Int:"∬",int:"∫",intcal:"⊺",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"⁣",InvisibleTimes:"⁢",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",Iscr:"ℐ",iscr:"𝒾",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"⁢",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",Lang:"⟪",lang:"⟨",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",Larr:"↞",lArr:"⇐",larr:"←",larrb:"⇤",larrbfs:"⤟",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",lat:"⪫",lAtail:"⤛",latail:"⤙",late:"⪭",lates:"⪭︀",lBarr:"⤎",lbarr:"⤌",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",lE:"≦",le:"≤",LeftAngleBracket:"⟨",LeftArrow:"←",Leftarrow:"⇐",leftarrow:"←",LeftArrowBar:"⇤",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVector:"⇃",LeftDownVectorBar:"⥙",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrow:"↔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTee:"⊣",LeftTeeArrow:"↤",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangle:"⊲",LeftTriangleBar:"⧏",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVector:"↿",LeftUpVectorBar:"⥘",LeftVector:"↼",LeftVectorBar:"⥒",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",les:"⩽",lescc:"⪨",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",Ll:"⋘",ll:"≪",llarr:"⇇",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoust:"⎰",lmoustache:"⎰",lnap:"⪉",lnapprox:"⪉",lnE:"≨",lne:"⪇",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftarrow:"⟵",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longleftrightarrow:"⟷",longmapsto:"⟼",LongRightArrow:"⟶",Longrightarrow:"⟹",longrightarrow:"⟶",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"‎",lrtri:"⊿",lsaquo:"‹",Lscr:"ℒ",lscr:"𝓁",Lsh:"↰",lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",Lt:"≪",LT:"<",lt:"<",ltcc:"⪦",ltcir:"⩹",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",mid:"∣",midast:"*",midcir:"⫰",middot:"·",minus:"−",minusb:"⊟",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",Mscr:"ℳ",mscr:"𝓂",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natur:"♮",natural:"♮",naturals:"ℕ",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",ne:"≠",nearhk:"⤤",neArr:"⇗",nearr:"↗",nearrow:"↗",nedot:"≐̸",NegativeMediumSpace:"​",NegativeThickSpace:"​",NegativeThinSpace:"​",NegativeVeryThinSpace:"​",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:` `,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nhArr:"⇎",nharr:"↮",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlArr:"⇍",nlarr:"↚",nldr:"‥",nlE:"≦̸",nle:"≰",nLeftarrow:"⇍",nleftarrow:"↚",nLeftrightarrow:"⇎",nleftrightarrow:"↮",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"⁠",NonBreakingSpace:" ",Nopf:"ℕ",nopf:"𝕟",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangle:"⋪",NotLeftTriangleBar:"⧏̸",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangle:"⋫",NotRightTriangleBar:"⧐̸",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",npar:"∦",nparallel:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",npre:"⪯̸",nprec:"⊀",npreceq:"⪯̸",nrArr:"⇏",nrarr:"↛",nrarrc:"⤳̸",nrarrw:"↝̸",nRightarrow:"⇏",nrightarrow:"↛",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nVDash:"⊯",nVdash:"⊮",nvDash:"⊭",nvdash:"⊬",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwArr:"⇖",nwarr:"↖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",ocir:"⊚",Ocirc:"Ô",ocirc:"ô",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",Or:"⩔",or:"∨",orarr:"↻",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",Otimes:"⨷",otimes:"⊗",otimesas:"⨶",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",par:"∥",para:"¶",parallel:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plus:"+",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",Popf:"ℙ",popf:"𝕡",pound:"£",Pr:"⪻",pr:"≺",prap:"⪷",prcue:"≼",prE:"⪳",pre:"⪯",prec:"≺",precapprox:"⪷",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",precsim:"≾",Prime:"″",prime:"′",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportion:"∷",Proportional:"∝",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",Qopf:"ℚ",qopf:"𝕢",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",QUOT:'"',quot:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",Rang:"⟫",rang:"⟩",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",Rarr:"↠",rArr:"⇒",rarr:"→",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",rAtail:"⤜",ratail:"⤚",ratio:"∶",rationals:"ℚ",RBarr:"⤐",rBarr:"⤏",rbarr:"⤍",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",Re:"ℜ",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",rect:"▭",REG:"®",reg:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",Rfr:"ℜ",rfr:"𝔯",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrow:"→",Rightarrow:"⇒",rightarrow:"→",RightArrowBar:"⇥",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVector:"⇂",RightDownVectorBar:"⥕",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTee:"⊢",RightTeeArrow:"↦",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangle:"⊳",RightTriangleBar:"⧐",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVector:"↾",RightUpVectorBar:"⥔",RightVector:"⇀",RightVectorBar:"⥓",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"‏",rmoust:"⎱",rmoustache:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",Ropf:"ℝ",ropf:"𝕣",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",Rscr:"ℛ",rscr:"𝓇",Rsh:"↱",rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",Sc:"⪼",sc:"≻",scap:"⪸",Scaron:"Š",scaron:"š",sccue:"≽",scE:"⪴",sce:"⪰",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdot:"⋅",sdotb:"⊡",sdote:"⩦",searhk:"⤥",seArr:"⇘",searr:"↘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"­",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",sol:"/",solb:"⧄",solbar:"⌿",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",squ:"□",Square:"□",square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",Sub:"⋐",sub:"⊂",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",Subset:"⋐",subset:"⊂",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succ:"≻",succapprox:"⪸",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",Sum:"∑",sum:"∑",sung:"♪",Sup:"⋑",sup:"⊃",sup1:"¹",sup2:"²",sup3:"³",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",Supset:"⋑",supset:"⊃",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swArr:"⇙",swarr:"↙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",Therefore:"∴",therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:"  ",thinsp:" ",ThinSpace:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",Tilde:"∼",tilde:"˜",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",times:"×",timesb:"⊠",timesbar:"⨱",timesd:"⨰",tint:"∭",toea:"⤨",top:"⊤",topbot:"⌶",topcir:"⫱",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",TRADE:"™",trade:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",Uarr:"↟",uArr:"⇑",uarr:"↑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrow:"↑",Uparrow:"⇑",uparrow:"↑",UpArrowBar:"⤒",UpArrowDownArrow:"⇅",UpDownArrow:"↕",Updownarrow:"⇕",updownarrow:"↕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",Upsi:"ϒ",upsi:"υ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTee:"⊥",UpTeeArrow:"↥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",vArr:"⇕",varr:"↕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",Vbar:"⫫",vBar:"⫨",vBarv:"⫩",Vcy:"В",vcy:"в",VDash:"⊫",Vdash:"⊩",vDash:"⊨",vdash:"⊢",Vdashl:"⫦",Vee:"⋁",vee:"∨",veebar:"⊻",veeeq:"≚",vellip:"⋮",Verbar:"‖",verbar:"|",Vert:"‖",vert:"|",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",Wedge:"⋀",wedge:"∧",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xhArr:"⟺",xharr:"⟷",Xi:"Ξ",xi:"ξ",xlArr:"⟸",xlarr:"⟵",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrArr:"⟹",xrarr:"⟶",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",Yuml:"Ÿ",yuml:"ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"​",Zeta:"Ζ",zeta:"ζ",Zfr:"ℨ",zfr:"𝔷",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",Zopf:"ℤ",zopf:"𝕫",Zscr:"𝒵",zscr:"𝓏",zwj:"‍",zwnj:"‌"}),t.entityMap=t.HTML_ENTITIES})(Y2);var O_={},wp=pl.NAMESPACE,L_=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,X2=new RegExp("[\\-\\.0-9"+L_.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),Z2=new RegExp("^"+L_.source+X2.source+"*(?::"+L_.source+X2.source+"*)?$"),Tp=0,hu=1,Fd=2,xp=3,Nd=4,Bd=5,Sp=6,py=7;function Hd(t,e){this.message=t,this.locator=e,Error.captureStackTrace&&Error.captureStackTrace(this,Hd)}Hd.prototype=new Error,Hd.prototype.name=Hd.name;function Q2(){}Q2.prototype={parse:function(t,e,i){var n=this.domBuilder;n.startDocument(),eD(e,e={}),A7(t,e,i,n,this.errorHandler),n.endDocument()}};function A7(t,e,i,n,r){function s(Ct){if(Ct>65535){Ct-=65536;var Nt=55296+(Ct>>10),Wt=56320+(Ct&1023);return String.fromCharCode(Nt,Wt)}else return String.fromCharCode(Ct)}function o(Ct){var Nt=Ct.slice(1,-1);return Object.hasOwnProperty.call(i,Nt)?i[Nt]:Nt.charAt(0)==="#"?s(parseInt(Nt.substr(1).replace("x","0x"))):(r.error("entity not found:"+Ct),Ct)}function u(Ct){if(Ct>k){var Nt=t.substring(k,Ct).replace(/&#?\w+;/g,o);S&&h(k),n.characters(Nt,0,Ct-k),k=Ct}}function h(Ct,Nt){for(;Ct>=g&&(Nt=y.exec(t));)p=Nt.index,g=p+Nt[0].length,S.lineNumber++;S.columnNumber=Ct-p+1}for(var p=0,g=0,y=/.*(?:\r\n?|\n)|.*$/g,S=n.locator,P=[{currentNSMap:e}],R={},k=0;;){try{var M=t.indexOf("<",k);if(M<0){if(!t.substr(k).match(/^\s*$/)){var L=n.doc,q=L.createTextNode(t.substr(k));L.appendChild(q),n.currentElement=q}return}switch(M>k&&u(M),t.charAt(M+1)){case"/":var ot=t.indexOf(">",M+3),Z=t.substring(M+2,ot).replace(/[ \t\n\r]+$/g,""),J=P.pop();ot<0?(Z=t.substring(M+2).replace(/[\s<].*/,""),r.error("end tag name: "+Z+" is not complete:"+J.tagName),ot=M+1+Z.length):Z.match(/\sk?k=ot:u(Math.max(M,k)+1)}}function J2(t,e){return e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber,e}function D7(t,e,i,n,r,s){function o(S,P,R){i.attributeNames.hasOwnProperty(S)&&s.fatalError("Attribute "+S+" redefined"),i.addValue(S,P.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,r),R)}for(var u,h,p=++e,g=Tp;;){var y=t.charAt(p);switch(y){case"=":if(g===hu)u=t.slice(e,p),g=xp;else if(g===Fd)g=xp;else throw new Error("attribute equal must after attrName");break;case"'":case'"':if(g===xp||g===hu)if(g===hu&&(s.warning('attribute value must after "="'),u=t.slice(e,p)),e=p+1,p=t.indexOf(y,e),p>0)h=t.slice(e,p),o(u,h,e-1),g=Bd;else throw new Error("attribute value no end '"+y+"' match");else if(g==Nd)h=t.slice(e,p),o(u,h,e),s.warning('attribute "'+u+'" missed start quot('+y+")!!"),e=p+1,g=Bd;else throw new Error('attribute value must after "="');break;case"/":switch(g){case Tp:i.setTagName(t.slice(e,p));case Bd:case Sp:case py:g=py,i.closed=!0;case Nd:case hu:break;case Fd:i.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return s.error("unexpected end of input"),g==Tp&&i.setTagName(t.slice(e,p)),p;case">":switch(g){case Tp:i.setTagName(t.slice(e,p));case Bd:case Sp:case py:break;case Nd:case hu:h=t.slice(e,p),h.slice(-1)==="/"&&(i.closed=!0,h=h.slice(0,-1));case Fd:g===Fd&&(h=u),g==Nd?(s.warning('attribute "'+h+'" missed quot(")!'),o(u,h,e)):((!wp.isHTML(n[""])||!h.match(/^(?:disabled|checked|selected)$/i))&&s.warning('attribute "'+h+'" missed value!! "'+h+'" instead!!'),o(h,h,e));break;case xp:throw new Error("attribute value missed!!")}return p;case"€":y=" ";default:if(y<=" ")switch(g){case Tp:i.setTagName(t.slice(e,p)),g=Sp;break;case hu:u=t.slice(e,p),g=Fd;break;case Nd:var h=t.slice(e,p);s.warning('attribute "'+h+'" missed quot(")!!'),o(u,h,e);case Bd:g=Sp;break}else switch(g){case Fd:i.tagName,(!wp.isHTML(n[""])||!u.match(/^(?:disabled|checked|selected)$/i))&&s.warning('attribute "'+u+'" missed value!! "'+u+'" instead2!!'),o(u,u,e),e=p,g=hu;break;case Bd:s.warning('attribute space is required"'+u+'"!!');case Sp:g=hu,e=p;break;case xp:g=Nd,e=p;break;case py:throw new Error("elements closed character '/' and '>' must be connected to")}}p++}}function $2(t,e,i){for(var n=t.tagName,r=null,y=t.length;y--;){var s=t[y],o=s.qName,u=s.value,S=o.indexOf(":");if(S>0)var h=s.prefix=o.slice(0,S),p=o.slice(S+1),g=h==="xmlns"&&p;else p=o,h=null,g=o==="xmlns"&&"";s.localName=p,g!==!1&&(r==null&&(r={},eD(i,i={})),i[g]=r[g]=u,s.uri=wp.XMLNS,e.startPrefixMapping(g,u))}for(var y=t.length;y--;){s=t[y];var h=s.prefix;h&&(h==="xml"&&(s.uri=wp.XML),h!=="xmlns"&&(s.uri=i[h||""]))}var S=n.indexOf(":");S>0?(h=t.prefix=n.slice(0,S),p=t.localName=n.slice(S+1)):(h=null,p=t.localName=n);var P=t.uri=i[h||""];if(e.startElement(P,p,n,t),t.closed){if(e.endElement(P,p,n),r)for(h in r)Object.prototype.hasOwnProperty.call(r,h)&&e.endPrefixMapping(h)}else return t.currentNSMap=i,t.localNSMap=r,!0}function P7(t,e,i,n,r){if(/^(?:script|textarea)$/i.test(i)){var s=t.indexOf("",e),o=t.substring(e+1,s);if(/[&<]/.test(o))return/^script$/i.test(i)?(r.characters(o,0,o.length),s):(o=o.replace(/&#?\w+;/g,n),r.characters(o,0,o.length),s)}return e+1}function k7(t,e,i,n){var r=n[i];return r==null&&(r=t.lastIndexOf(""),r",e+4);return s>e?(i.comment(t,e+4,s-e-4),s+3):(n.error("Unclosed comment"),-1)}else return-1;default:if(t.substr(e+3,6)=="CDATA["){var s=t.indexOf("]]>",e+9);return i.startCDATA(),i.characters(t,e+9,s-e-9),i.endCDATA(),s+3}var o=O7(t,e),u=o.length;if(u>1&&/!doctype/i.test(o[0][0])){var h=o[1][0],p=!1,g=!1;u>3&&(/^public$/i.test(o[2][0])?(p=o[3][0],g=u>4&&o[4][0]):/^system$/i.test(o[2][0])&&(g=o[3][0]));var y=o[u-1];return i.startDTD(h,p,g),i.endDTD(),y.index+y[0].length}}return-1}function R7(t,e,i){var n=t.indexOf("?>",e);if(n){var r=t.substring(e,n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return r?(r[0].length,i.processingInstruction(r[1],r[2]),n+2):-1}return-1}function tD(){this.attributeNames={}}tD.prototype={setTagName:function(t){if(!Z2.test(t))throw new Error("invalid tagName:"+t);this.tagName=t},addValue:function(t,e,i){if(!Z2.test(t))throw new Error("invalid attribute:"+t);this.attributeNames[t]=this.length,this[this.length++]={qName:t,value:e,offset:i}},length:0,getLocalName:function(t){return this[t].localName},getLocator:function(t){return this[t].locator},getQName:function(t){return this[t].qName},getURI:function(t){return this[t].uri},getValue:function(t){return this[t].value}};function O7(t,e){var i,n=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(r.lastIndex=e,r.exec(t);i=r.exec(t);)if(n.push(i),i[1])return n}O_.XMLReader=Q2,O_.ParseError=Hd;var L7=pl,M7=du,iD=Y2,nD=O_,F7=M7.DOMImplementation,rD=L7.NAMESPACE,N7=nD.ParseError,B7=nD.XMLReader;function sD(t){return t.replace(/\r[\n\u0085]/g,` `).replace(/[\r\u0085\u2028]/g,` `)}function oD(t){this.options=t||{locator:{}}}oD.prototype.parseFromString=function(t,e){var i=this.options,n=new B7,r=i.domBuilder||new Ep,s=i.errorHandler,o=i.locator,u=i.xmlns||{},h=/\/x?html?$/.test(e),p=h?iD.HTML_ENTITIES:iD.XML_ENTITIES;o&&r.setDocumentLocator(o),n.errorHandler=H7(s,r,o),n.domBuilder=i.domBuilder||r,h&&(u[""]=rD.HTML),u.xml=u.xml||rD.XML;var g=i.normalizeLineEndings||sD;return t&&typeof t=="string"?n.parse(g(t),u,p):n.errorHandler.error("invalid doc source"),r.doc};function H7(t,e,i){if(!t){if(e instanceof Ep)return e;t=e}var n={},r=t instanceof Function;i=i||{};function s(o){var u=t[o];!u&&r&&(u=t.length==2?function(h){t(o,h)}:t),n[o]=u&&function(h){u("[xmldom "+o+"] "+h+M_(i))}||function(){}}return s("warning"),s("error"),s("fatalError"),n}function Ep(){this.cdata=!1}function Ud(t,e){e.lineNumber=t.lineNumber,e.columnNumber=t.columnNumber}Ep.prototype={startDocument:function(){this.doc=new F7().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(t,e,i,n){var r=this.doc,s=r.createElementNS(t,i||e),o=n.length;my(this,s),this.currentElement=s,this.locator&&Ud(this.locator,s);for(var u=0;u=e+i||e?new java.lang.String(t,e,i)+"":t}"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(t){Ep.prototype[t]=function(){return null}});function my(t,e){t.currentElement?t.currentElement.appendChild(e):t.doc.appendChild(e)}fy.__DOMHandler=Ep,fy.normalizeLineEndings=sD,fy.DOMParser=oD;var U7=fy.DOMParser;/*! @name mpd-parser @version 1.3.1 @license Apache-2.0 */const lD=t=>!!t&&typeof t=="object",Tr=(...t)=>t.reduce((e,i)=>(typeof i!="object"||Object.keys(i).forEach(n=>{Array.isArray(e[n])&&Array.isArray(i[n])?e[n]=e[n].concat(i[n]):lD(e[n])&&lD(i[n])?e[n]=Tr(e[n],i[n]):e[n]=i[n]}),e),{}),uD=t=>Object.keys(t).map(e=>t[e]),z7=(t,e)=>{const i=[];for(let n=t;nt.reduce((e,i)=>e.concat(i),[]),cD=t=>{if(!t.length)return[];const e=[];for(let i=0;it.reduce((i,n,r)=>(n[e]&&i.push(r),i),[]),j7=(t,e)=>uD(t.reduce((i,n)=>(n.forEach(r=>{i[e(r)]=r}),i),{}));var Vd={INVALID_NUMBER_OF_PERIOD:"INVALID_NUMBER_OF_PERIOD",DASH_EMPTY_MANIFEST:"DASH_EMPTY_MANIFEST",DASH_INVALID_XML:"DASH_INVALID_XML",NO_BASE_URL:"NO_BASE_URL",SEGMENT_TIME_UNSPECIFIED:"SEGMENT_TIME_UNSPECIFIED",UNSUPPORTED_UTC_TIMING_SCHEME:"UNSUPPORTED_UTC_TIMING_SCHEME"};const Cp=({baseUrl:t="",source:e="",range:i="",indexRange:n=""})=>{const r={uri:e,resolvedUri:oy(t||"",e)};if(i||n){const o=(i||n).split("-");let u=_e.BigInt?_e.BigInt(o[0]):parseInt(o[0],10),h=_e.BigInt?_e.BigInt(o[1]):parseInt(o[1],10);u{let e;return typeof t.offset=="bigint"||typeof t.length=="bigint"?e=_e.BigInt(t.offset)+_e.BigInt(t.length)-_e.BigInt(1):e=t.offset+t.length-1,`${t.offset}-${e}`},dD=t=>(t&&typeof t!="number"&&(t=parseInt(t,10)),isNaN(t)?null:t),q7={static(t){const{duration:e,timescale:i=1,sourceDuration:n,periodDuration:r}=t,s=dD(t.endNumber),o=e/i;return typeof s=="number"?{start:0,end:s}:typeof r=="number"?{start:0,end:r/o}:{start:0,end:n/o}},dynamic(t){const{NOW:e,clientOffset:i,availabilityStartTime:n,timescale:r=1,duration:s,periodStart:o=0,minimumUpdatePeriod:u=0,timeShiftBufferDepth:h=1/0}=t,p=dD(t.endNumber),g=(e+i)/1e3,y=n+o,P=g+u-y,R=Math.ceil(P*r/s),k=Math.floor((g-y-h)*r/s),M=Math.floor((g-y)*r/s);return{start:Math.max(0,k),end:typeof p=="number"?p:Math.min(R,M)}}},G7=t=>e=>{const{duration:i,timescale:n=1,periodStart:r,startNumber:s=1}=t;return{number:s+e,duration:i/n,timeline:r,time:e*i}},F_=t=>{const{type:e,duration:i,timescale:n=1,periodDuration:r,sourceDuration:s}=t,{start:o,end:u}=q7[e](t),h=z7(o,u).map(G7(t));if(e==="static"){const p=h.length-1,g=typeof r=="number"?r:s;h[p].duration=g-i/n*p}return h},hD=t=>{const{baseUrl:e,initialization:i={},sourceDuration:n,indexRange:r="",periodStart:s,presentationTime:o,number:u=0,duration:h}=t;if(!e)throw new Error(Vd.NO_BASE_URL);const p=Cp({baseUrl:e,source:i.sourceURL,range:i.range}),g=Cp({baseUrl:e,source:e,indexRange:r});if(g.map=p,h){const y=F_(t);y.length&&(g.duration=y[0].duration,g.timeline=y[0].timeline)}else n&&(g.duration=n,g.timeline=s);return g.presentationTime=o||s,g.number=u,[g]},N_=(t,e,i)=>{const n=t.sidx.map?t.sidx.map:null,r=t.sidx.duration,s=t.timeline||0,o=t.sidx.byterange,u=o.offset+o.length,h=e.timescale,p=e.references.filter(M=>M.referenceType!==1),g=[],y=t.endList?"static":"dynamic",S=t.sidx.timeline;let P=S,R=t.mediaSequence||0,k;typeof e.firstOffset=="bigint"?k=_e.BigInt(u)+e.firstOffset:k=u+e.firstOffset;for(let M=0;Mj7(t,({timeline:e})=>e).sort((e,i)=>e.timeline>i.timeline?1:-1),X7=(t,e)=>{for(let i=0;i{let e=[];return h7(t,K7,(i,n,r,s)=>{e=e.concat(i.playlists||[])}),e},mD=({playlist:t,mediaSequence:e})=>{t.mediaSequence=e,t.segments.forEach((i,n)=>{i.number=t.mediaSequence+n})},Z7=({oldPlaylists:t,newPlaylists:e,timelineStarts:i})=>{e.forEach(n=>{n.discontinuitySequence=i.findIndex(function({timeline:h}){return h===n.timeline});const r=X7(t,n.attributes.NAME);if(!r||n.sidx)return;const s=n.segments[0],o=r.segments.findIndex(function(h){return Math.abs(h.presentationTime-s.presentationTime)r.timeline||r.segments.length&&n.timeline>r.segments[r.segments.length-1].timeline)&&n.discontinuitySequence--;return}r.segments[o].discontinuity&&!s.discontinuity&&(s.discontinuity=!0,n.discontinuityStarts.unshift(0),n.discontinuitySequence--),mD({playlist:n,mediaSequence:r.segments[o].number})})},Q7=({oldManifest:t,newManifest:e})=>{const i=t.playlists.concat(pD(t)),n=e.playlists.concat(pD(e));return e.timelineStarts=fD([t.timelineStarts,e.timelineStarts]),Z7({oldPlaylists:i,newPlaylists:n,timelineStarts:e.timelineStarts}),e},gy=t=>t&&t.uri+"-"+W7(t.byterange),B_=t=>{const e=t.reduce(function(n,r){return n[r.attributes.baseUrl]||(n[r.attributes.baseUrl]=[]),n[r.attributes.baseUrl].push(r),n},{});let i=[];return Object.values(e).forEach(n=>{const r=uD(n.reduce((s,o)=>{const u=o.attributes.id+(o.attributes.lang||"");return s[u]?(o.segments&&(o.segments[0]&&(o.segments[0].discontinuity=!0),s[u].segments.push(...o.segments)),o.attributes.contentProtection&&(s[u].attributes.contentProtection=o.attributes.contentProtection)):(s[u]=o,s[u].attributes.timelineStarts=[]),s[u].attributes.timelineStarts.push({start:o.attributes.periodStart,timeline:o.attributes.periodStart}),s},{}));i=i.concat(r)}),i.map(n=>(n.discontinuityStarts=V7(n.segments||[],"discontinuity"),n))},H_=(t,e)=>{const i=gy(t.sidx),n=i&&e[i]&&e[i].sidx;return n&&N_(t,n,t.sidx.resolvedUri),t},J7=(t,e={})=>{if(!Object.keys(e).length)return t;for(const i in t)t[i]=H_(t[i],e);return t},$7=({attributes:t,segments:e,sidx:i,mediaSequence:n,discontinuitySequence:r,discontinuityStarts:s},o)=>{const u={attributes:{NAME:t.id,BANDWIDTH:t.bandwidth,CODECS:t.codecs,"PROGRAM-ID":1},uri:"",endList:t.type==="static",timeline:t.periodStart,resolvedUri:t.baseUrl||"",targetDuration:t.duration,discontinuitySequence:r,discontinuityStarts:s,timelineStarts:t.timelineStarts,mediaSequence:n,segments:e};return t.contentProtection&&(u.contentProtection=t.contentProtection),t.serviceLocation&&(u.attributes.serviceLocation=t.serviceLocation),i&&(u.sidx=i),o&&(u.attributes.AUDIO="audio",u.attributes.SUBTITLES="subs"),u},ej=({attributes:t,segments:e,mediaSequence:i,discontinuityStarts:n,discontinuitySequence:r})=>{typeof e>"u"&&(e=[{uri:t.baseUrl,timeline:t.periodStart,resolvedUri:t.baseUrl||"",duration:t.sourceDuration,number:0}],t.duration=t.sourceDuration);const s={NAME:t.id,BANDWIDTH:t.bandwidth,"PROGRAM-ID":1};t.codecs&&(s.CODECS=t.codecs);const o={attributes:s,uri:"",endList:t.type==="static",timeline:t.periodStart,resolvedUri:t.baseUrl||"",targetDuration:t.duration,timelineStarts:t.timelineStarts,discontinuityStarts:n,discontinuitySequence:r,mediaSequence:i,segments:e};return t.serviceLocation&&(o.attributes.serviceLocation=t.serviceLocation),o},tj=(t,e={},i=!1)=>{let n;const r=t.reduce((s,o)=>{const u=o.attributes.role&&o.attributes.role.value||"",h=o.attributes.lang||"";let p=o.attributes.label||"main";if(h&&!o.attributes.label){const y=u?` (${u})`:"";p=`${o.attributes.lang}${y}`}s[p]||(s[p]={language:h,autoselect:!0,default:u==="main",playlists:[],uri:""});const g=H_($7(o,i),e);return s[p].playlists.push(g),typeof n>"u"&&u==="main"&&(n=o,n.default=!0),s},{});if(!n){const s=Object.keys(r)[0];r[s].default=!0}return r},ij=(t,e={})=>t.reduce((i,n)=>{const r=n.attributes.label||n.attributes.lang||"text",s=n.attributes.lang||"und";return i[r]||(i[r]={language:s,default:!1,autoselect:!1,playlists:[],uri:""}),i[r].playlists.push(H_(ej(n),e)),i},{}),nj=t=>t.reduce((e,i)=>(i&&i.forEach(n=>{const{channel:r,language:s}=n;e[s]={autoselect:!1,default:!1,instreamId:r,language:s},n.hasOwnProperty("aspectRatio")&&(e[s].aspectRatio=n.aspectRatio),n.hasOwnProperty("easyReader")&&(e[s].easyReader=n.easyReader),n.hasOwnProperty("3D")&&(e[s]["3D"]=n["3D"])}),e),{}),rj=({attributes:t,segments:e,sidx:i,discontinuityStarts:n})=>{const r={attributes:{NAME:t.id,AUDIO:"audio",SUBTITLES:"subs",RESOLUTION:{width:t.width,height:t.height},CODECS:t.codecs,BANDWIDTH:t.bandwidth,"PROGRAM-ID":1},uri:"",endList:t.type==="static",timeline:t.periodStart,resolvedUri:t.baseUrl||"",targetDuration:t.duration,discontinuityStarts:n,timelineStarts:t.timelineStarts,segments:e};return t.frameRate&&(r.attributes["FRAME-RATE"]=t.frameRate),t.contentProtection&&(r.contentProtection=t.contentProtection),t.serviceLocation&&(r.attributes.serviceLocation=t.serviceLocation),i&&(r.sidx=i),r},sj=({attributes:t})=>t.mimeType==="video/mp4"||t.mimeType==="video/webm"||t.contentType==="video",oj=({attributes:t})=>t.mimeType==="audio/mp4"||t.mimeType==="audio/webm"||t.contentType==="audio",aj=({attributes:t})=>t.mimeType==="text/vtt"||t.contentType==="text",lj=(t,e)=>{t.forEach(i=>{i.mediaSequence=0,i.discontinuitySequence=e.findIndex(function({timeline:n}){return n===i.timeline}),i.segments&&i.segments.forEach((n,r)=>{n.number=r})})},gD=t=>t?Object.keys(t).reduce((e,i)=>{const n=t[i];return e.concat(n.playlists)},[]):[],uj=({dashPlaylists:t,locations:e,contentSteering:i,sidxMapping:n={},previousManifest:r,eventStream:s})=>{if(!t.length)return{};const{sourceDuration:o,type:u,suggestedPresentationDelay:h,minimumUpdatePeriod:p}=t[0].attributes,g=B_(t.filter(sj)).map(rj),y=B_(t.filter(oj)),S=B_(t.filter(aj)),P=t.map(J=>J.attributes.captionServices).filter(Boolean),R={allowCache:!0,discontinuityStarts:[],segments:[],endList:!0,mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:"",duration:o,playlists:J7(g,n)};p>=0&&(R.minimumUpdatePeriod=p*1e3),e&&(R.locations=e),i&&(R.contentSteering=i),u==="dynamic"&&(R.suggestedPresentationDelay=h),s&&s.length>0&&(R.eventStream=s);const k=R.playlists.length===0,M=y.length?tj(y,n,k):null,L=S.length?ij(S,n):null,q=g.concat(gD(M),gD(L)),Z=q.map(({timelineStarts:J})=>J);return R.timelineStarts=fD(Z),lj(q,R.timelineStarts),M&&(R.mediaGroups.AUDIO.audio=M),L&&(R.mediaGroups.SUBTITLES.subs=L),P.length&&(R.mediaGroups["CLOSED-CAPTIONS"].cc=nj(P)),r?Q7({oldManifest:r,newManifest:R}):R},cj=(t,e,i)=>{const{NOW:n,clientOffset:r,availabilityStartTime:s,timescale:o=1,periodStart:u=0,minimumUpdatePeriod:h=0}=t,p=(n+r)/1e3,g=s+u,S=p+h-g;return Math.ceil((S*o-e)/i)},yD=(t,e)=>{const{type:i,minimumUpdatePeriod:n=0,media:r="",sourceDuration:s,timescale:o=1,startNumber:u=1,periodStart:h}=t,p=[];let g=-1;for(let y=0;yg&&(g=k);let M;if(R<0){const Z=y+1;Z===e.length?i==="dynamic"&&n>0&&r.indexOf("$Number$")>0?M=cj(t,g,P):M=(s*o-g)/P:M=(e[Z].t-g)/P}else M=R+1;const L=u+p.length+M;let q=u+p.length;for(;q(e,i,n,r)=>{if(e==="$$")return"$";if(typeof t[i]>"u")return e;const s=""+t[i];return i==="RepresentationID"||(n?r=parseInt(r,10):r=1,s.length>=r)?s:`${new Array(r-s.length+1).join("0")}${s}`},vD=(t,e)=>t.replace(dj,hj(e)),fj=(t,e)=>!t.duration&&!e?[{number:t.startNumber||1,duration:t.sourceDuration,time:0,timeline:t.periodStart}]:t.duration?F_(t):yD(t,e),pj=(t,e)=>{const i={RepresentationID:t.id,Bandwidth:t.bandwidth||0},{initialization:n={sourceURL:"",range:""}}=t,r=Cp({baseUrl:t.baseUrl,source:vD(n.sourceURL,i),range:n.range});return fj(t,e).map(o=>{i.Number=o.number,i.Time=o.time;const u=vD(t.media||"",i),h=t.timescale||1,p=t.presentationTimeOffset||0,g=t.periodStart+(o.time-p)/h;return{uri:u,timeline:o.timeline,duration:o.duration,resolvedUri:oy(t.baseUrl||"",u),map:r,number:o.number,presentationTime:g}})},mj=(t,e)=>{const{baseUrl:i,initialization:n={}}=t,r=Cp({baseUrl:i,source:n.sourceURL,range:n.range}),s=Cp({baseUrl:i,source:e.media,range:e.mediaRange});return s.map=r,s},gj=(t,e)=>{const{duration:i,segmentUrls:n=[],periodStart:r}=t;if(!i&&!e||i&&e)throw new Error(Vd.SEGMENT_TIME_UNSPECIFIED);const s=n.map(h=>mj(t,h));let o;return i&&(o=F_(t)),e&&(o=yD(t,e)),o.map((h,p)=>{if(s[p]){const g=s[p],y=t.timescale||1,S=t.presentationTimeOffset||0;return g.timeline=h.timeline,g.duration=h.duration,g.number=h.number,g.presentationTime=r+(h.time-S)/y,g}}).filter(h=>h)},yj=({attributes:t,segmentInfo:e})=>{let i,n;e.template?(n=pj,i=Tr(t,e.template)):e.base?(n=hD,i=Tr(t,e.base)):e.list&&(n=gj,i=Tr(t,e.list));const r={attributes:t};if(!n)return r;const s=n(i,e.segmentTimeline);if(i.duration){const{duration:o,timescale:u=1}=i;i.duration=o/u}else s.length?i.duration=s.reduce((o,u)=>Math.max(o,Math.ceil(u.duration)),0):i.duration=0;return r.attributes=i,r.segments=s,e.base&&i.indexRange&&(r.sidx=s[0],r.segments=[]),r},vj=t=>t.map(yj),On=(t,e)=>cD(t.childNodes).filter(({tagName:i})=>i===e),Ap=t=>t.textContent.trim(),bj=t=>parseFloat(t.split("/").reduce((e,i)=>e/i)),jd=t=>{const u=/P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(t);if(!u)return 0;const[h,p,g,y,S,P]=u.slice(1);return parseFloat(h||0)*31536e3+parseFloat(p||0)*2592e3+parseFloat(g||0)*86400+parseFloat(y||0)*3600+parseFloat(S||0)*60+parseFloat(P||0)},_j=t=>(/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(t)&&(t+="Z"),Date.parse(t)),bD={mediaPresentationDuration(t){return jd(t)},availabilityStartTime(t){return _j(t)/1e3},minimumUpdatePeriod(t){return jd(t)},suggestedPresentationDelay(t){return jd(t)},type(t){return t},timeShiftBufferDepth(t){return jd(t)},start(t){return jd(t)},width(t){return parseInt(t,10)},height(t){return parseInt(t,10)},bandwidth(t){return parseInt(t,10)},frameRate(t){return bj(t)},startNumber(t){return parseInt(t,10)},timescale(t){return parseInt(t,10)},presentationTimeOffset(t){return parseInt(t,10)},duration(t){const e=parseInt(t,10);return isNaN(e)?jd(t):e},d(t){return parseInt(t,10)},t(t){return parseInt(t,10)},r(t){return parseInt(t,10)},presentationTime(t){return parseInt(t,10)},DEFAULT(t){return t}},rr=t=>t&&t.attributes?cD(t.attributes).reduce((e,i)=>{const n=bD[i.name]||bD.DEFAULT;return e[i.name]=n(i.value),e},{}):{},wj={"urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b":"org.w3.clearkey","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed":"com.widevine.alpha","urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95":"com.microsoft.playready","urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb":"com.adobe.primetime","urn:mpeg:dash:mp4protection:2011":"mp4protection"},yy=(t,e)=>e.length?zd(t.map(function(i){return e.map(function(n){const r=Ap(n),s=oy(i.baseUrl,r),o=Tr(rr(n),{baseUrl:s});return s!==r&&!o.serviceLocation&&i.serviceLocation&&(o.serviceLocation=i.serviceLocation),o})})):t,U_=t=>{const e=On(t,"SegmentTemplate")[0],i=On(t,"SegmentList")[0],n=i&&On(i,"SegmentURL").map(y=>Tr({tag:"SegmentURL"},rr(y))),r=On(t,"SegmentBase")[0],s=i||e,o=s&&On(s,"SegmentTimeline")[0],u=i||r||e,h=u&&On(u,"Initialization")[0],p=e&&rr(e);p&&h?p.initialization=h&&rr(h):p&&p.initialization&&(p.initialization={sourceURL:p.initialization});const g={template:p,segmentTimeline:o&&On(o,"S").map(y=>rr(y)),list:i&&Tr(rr(i),{segmentUrls:n,initialization:rr(h)}),base:r&&Tr(rr(r),{initialization:rr(h)})};return Object.keys(g).forEach(y=>{g[y]||delete g[y]}),g},Tj=(t,e,i)=>n=>{const r=On(n,"BaseURL"),s=yy(e,r),o=Tr(t,rr(n)),u=U_(n);return s.map(h=>({segmentInfo:Tr(i,u),attributes:Tr(o,h)}))},xj=t=>t.reduce((e,i)=>{const n=rr(i);n.schemeIdUri&&(n.schemeIdUri=n.schemeIdUri.toLowerCase());const r=wj[n.schemeIdUri];if(r){e[r]={attributes:n};const s=On(i,"cenc:pssh")[0];if(s){const o=Ap(s);e[r].pssh=o&&c2(o)}}return e},{}),Sj=t=>{if(t.schemeIdUri==="urn:scte:dash:cc:cea-608:2015")return(typeof t.value!="string"?[]:t.value.split(";")).map(i=>{let n,r;return r=i,/^CC\d=/.test(i)?[n,r]=i.split("="):/^CC\d$/.test(i)&&(n=i),{channel:n,language:r}});if(t.schemeIdUri==="urn:scte:dash:cc:cea-708:2015")return(typeof t.value!="string"?[]:t.value.split(";")).map(i=>{const n={channel:void 0,language:void 0,aspectRatio:1,easyReader:0,"3D":0};if(/=/.test(i)){const[r,s=""]=i.split("=");n.channel=r,n.language=i,s.split(",").forEach(o=>{const[u,h]=o.split(":");u==="lang"?n.language=h:u==="er"?n.easyReader=Number(h):u==="war"?n.aspectRatio=Number(h):u==="3D"&&(n["3D"]=Number(h))})}else n.language=i;return n.channel&&(n.channel="SERVICE"+n.channel),n})},Ej=t=>zd(On(t.node,"EventStream").map(e=>{const i=rr(e),n=i.schemeIdUri;return On(e,"Event").map(r=>{const s=rr(r),o=s.presentationTime||0,u=i.timescale||1,h=s.duration||0,p=o/u+t.attributes.start;return{schemeIdUri:n,value:i.value,id:s.id,start:p,end:p+h/u,messageData:Ap(r)||s.messageData,contentEncoding:i.contentEncoding,presentationTimeOffset:i.presentationTimeOffset||0}})})),Cj=(t,e,i)=>n=>{const r=rr(n),s=yy(e,On(n,"BaseURL")),o=On(n,"Role")[0],u={role:rr(o)};let h=Tr(t,r,u);const p=On(n,"Accessibility")[0],g=Sj(rr(p));g&&(h=Tr(h,{captionServices:g}));const y=On(n,"Label")[0];if(y&&y.childNodes.length){const M=y.childNodes[0].nodeValue.trim();h=Tr(h,{label:M})}const S=xj(On(n,"ContentProtection"));Object.keys(S).length&&(h=Tr(h,{contentProtection:S}));const P=U_(n),R=On(n,"Representation"),k=Tr(i,P);return zd(R.map(Tj(h,s,k)))},Aj=(t,e)=>(i,n)=>{const r=yy(e,On(i.node,"BaseURL")),s=Tr(t,{periodStart:i.attributes.start});typeof i.attributes.duration=="number"&&(s.periodDuration=i.attributes.duration);const o=On(i.node,"AdaptationSet"),u=U_(i.node);return zd(o.map(Cj(s,r,u)))},Dj=(t,e)=>{if(t.length>1&&e({type:"warn",message:"The MPD manifest should contain no more than one ContentSteering tag"}),!t.length)return null;const i=Tr({serverURL:Ap(t[0])},rr(t[0]));return i.queryBeforeStart=i.queryBeforeStart==="true",i},Pj=({attributes:t,priorPeriodAttributes:e,mpdType:i})=>typeof t.start=="number"?t.start:e&&typeof e.start=="number"&&typeof e.duration=="number"?e.start+e.duration:!e&&i==="static"?0:null,kj=(t,e={})=>{const{manifestUri:i="",NOW:n=Date.now(),clientOffset:r=0,eventHandler:s=function(){}}=e,o=On(t,"Period");if(!o.length)throw new Error(Vd.INVALID_NUMBER_OF_PERIOD);const u=On(t,"Location"),h=rr(t),p=yy([{baseUrl:i}],On(t,"BaseURL")),g=On(t,"ContentSteering");h.type=h.type||"static",h.sourceDuration=h.mediaPresentationDuration||0,h.NOW=n,h.clientOffset=r,u.length&&(h.locations=u.map(Ap));const y=[];return o.forEach((S,P)=>{const R=rr(S),k=y[P-1];R.start=Pj({attributes:R,priorPeriodAttributes:k?k.attributes:null,mpdType:h.type}),y.push({node:S,attributes:R})}),{locations:h.locations,contentSteeringInfo:Dj(g,s),representationInfo:zd(y.map(Aj(h,p))),eventStream:zd(y.map(Ej))}},_D=t=>{if(t==="")throw new Error(Vd.DASH_EMPTY_MANIFEST);const e=new U7;let i,n;try{i=e.parseFromString(t,"application/xml"),n=i&&i.documentElement.tagName==="MPD"?i.documentElement:null}catch{}if(!n||n&&n.getElementsByTagName("parsererror").length>0)throw new Error(Vd.DASH_INVALID_XML);return n},Ij=t=>{const e=On(t,"UTCTiming")[0];if(!e)return null;const i=rr(e);switch(i.schemeIdUri){case"urn:mpeg:dash:utc:http-head:2014":case"urn:mpeg:dash:utc:http-head:2012":i.method="HEAD";break;case"urn:mpeg:dash:utc:http-xsdate:2014":case"urn:mpeg:dash:utc:http-iso:2014":case"urn:mpeg:dash:utc:http-xsdate:2012":case"urn:mpeg:dash:utc:http-iso:2012":i.method="GET";break;case"urn:mpeg:dash:utc:direct:2014":case"urn:mpeg:dash:utc:direct:2012":i.method="DIRECT",i.value=Date.parse(i.value);break;case"urn:mpeg:dash:utc:http-ntp:2014":case"urn:mpeg:dash:utc:ntp:2014":case"urn:mpeg:dash:utc:sntp:2014":default:throw new Error(Vd.UNSUPPORTED_UTC_TIMING_SCHEME)}return i},Rj=(t,e={})=>{const i=kj(_D(t),e),n=vj(i.representationInfo);return uj({dashPlaylists:n,locations:i.locations,contentSteering:i.contentSteeringInfo,sidxMapping:e.sidxMapping,previousManifest:e.previousManifest,eventStream:i.eventStream})},Oj=t=>Ij(_D(t));var Lj=Math.pow(2,32),Mj=function(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength),i;return e.getBigUint64?(i=e.getBigUint64(0),i0;n+=12,r--)i.references.push({referenceType:(t[n]&128)>>>7,referencedSize:e.getUint32(n)&2147483647,subsegmentDuration:e.getUint32(n+4),startsWithSap:!!(t[n+8]&128),sapType:(t[n+8]&112)>>>4,sapDeltaTime:e.getUint32(n+8)&268435455});return i},Bj=Nj;const Hj=uu(Bj);var Uj=Qt([73,68,51]),zj=function(e,i){i===void 0&&(i=0),e=Qt(e);var n=e[i+5],r=e[i+6]<<21|e[i+7]<<14|e[i+8]<<7|e[i+9],s=(n&16)>>4;return s?r+20:r+10},Dp=function t(e,i){return i===void 0&&(i=0),e=Qt(e),e.length-i<10||!Rn(e,Uj,{offset:i})?i:(i+=zj(e,i),t(e,i))},TD=function(e){return typeof e=="string"?v2(e):e},Vj=function(e){return Array.isArray(e)?e.map(function(i){return TD(i)}):[TD(e)]},jj=function t(e,i,n){n===void 0&&(n=!1),i=Vj(i),e=Qt(e);var r=[];if(!i.length)return r;for(var s=0;s>>0,u=e.subarray(s+4,s+8);if(o===0)break;var h=s+o;if(h>e.length){if(n)break;h=e.length}var p=e.subarray(s+8,h);Rn(u,i[0])&&(i.length===1?r.push(p):r.push.apply(r,t(p,i.slice(1),n))),s=h}return r},vy={EBML:Qt([26,69,223,163]),DocType:Qt([66,130]),Segment:Qt([24,83,128,103]),SegmentInfo:Qt([21,73,169,102]),Tracks:Qt([22,84,174,107]),Track:Qt([174]),TrackNumber:Qt([215]),DefaultDuration:Qt([35,227,131]),TrackEntry:Qt([174]),TrackType:Qt([131]),FlagDefault:Qt([136]),CodecID:Qt([134]),CodecPrivate:Qt([99,162]),VideoTrack:Qt([224]),AudioTrack:Qt([225]),Cluster:Qt([31,67,182,117]),Timestamp:Qt([231]),TimestampScale:Qt([42,215,177]),BlockGroup:Qt([160]),BlockDuration:Qt([155]),Block:Qt([161]),SimpleBlock:Qt([163])},z_=[128,64,32,16,8,4,2,1],Wj=function(e){for(var i=1,n=0;n=i.length)return i.length;var r=by(i,n,!1);if(Rn(e.bytes,r.bytes))return n;var s=by(i,n+r.length);return t(e,i,n+s.length+s.value+r.length)},SD=function t(e,i){i=qj(i),e=Qt(e);var n=[];if(!i.length)return n;for(var r=0;re.length?e.length:u+o.value,p=e.subarray(u,h);Rn(i[0],s.bytes)&&(i.length===1?n.push(p):n=n.concat(t(p,i.slice(1))));var g=s.length+o.length+p.length;r+=g}return n},Kj=Qt([0,0,0,1]),Yj=Qt([0,0,1]),Xj=Qt([0,0,3]),Zj=function(e){for(var i=[],n=1;n>1&63),n.indexOf(p)!==-1&&(o=s+h),s+=h+(i==="h264"?1:2)}return e.subarray(0,0)},Qj=function(e,i,n){return ED(e,"h264",i,n)},Jj=function(e,i,n){return ED(e,"h265",i,n)},ys={webm:Qt([119,101,98,109]),matroska:Qt([109,97,116,114,111,115,107,97]),flac:Qt([102,76,97,67]),ogg:Qt([79,103,103,83]),ac3:Qt([11,119]),riff:Qt([82,73,70,70]),avi:Qt([65,86,73]),wav:Qt([87,65,86,69]),"3gp":Qt([102,116,121,112,51,103]),mp4:Qt([102,116,121,112]),fmp4:Qt([115,116,121,112]),mov:Qt([102,116,121,112,113,116]),moov:Qt([109,111,111,118]),moof:Qt([109,111,111,102])},Wd={aac:function(e){var i=Dp(e);return Rn(e,[255,16],{offset:i,mask:[255,22]})},mp3:function(e){var i=Dp(e);return Rn(e,[255,2],{offset:i,mask:[255,6]})},webm:function(e){var i=SD(e,[vy.EBML,vy.DocType])[0];return Rn(i,ys.webm)},mkv:function(e){var i=SD(e,[vy.EBML,vy.DocType])[0];return Rn(i,ys.matroska)},mp4:function(e){if(Wd["3gp"](e)||Wd.mov(e))return!1;if(Rn(e,ys.mp4,{offset:4})||Rn(e,ys.fmp4,{offset:4})||Rn(e,ys.moof,{offset:4})||Rn(e,ys.moov,{offset:4}))return!0},mov:function(e){return Rn(e,ys.mov,{offset:4})},"3gp":function(e){return Rn(e,ys["3gp"],{offset:4})},ac3:function(e){var i=Dp(e);return Rn(e,ys.ac3,{offset:i})},ts:function(e){if(e.length<189&&e.length>=1)return e[0]===71;for(var i=0;i+1880},vc={};/** * @license * Video.js 8.22.0 * Copyright Brightcove, Inc. * Available under Apache License Version 2.0 * * * Includes vtt.js * Available under Apache License Version 2.0 * */var W_="8.22.0";const vl={},fu=function(t,e){return vl[t]=vl[t]||[],e&&(vl[t]=vl[t].concat(e)),vl[t]},tW=function(t,e){fu(t,e)},CD=function(t,e){const i=fu(t).indexOf(e);return i<=-1?!1:(vl[t]=vl[t].slice(),vl[t].splice(i,1),!0)},iW=function(t,e){fu(t,[].concat(e).map(i=>{const n=(...r)=>(CD(t,n),i(...r));return n}))},_y={prefixed:!0},wy=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror","fullscreen"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"]],AD=wy[0];let Pp;for(let t=0;t(n,r,s)=>{const o=e.levels[r],u=new RegExp(`^(${o})$`);let h=t;if(n!=="log"&&s.unshift(n.toUpperCase()+":"),i&&(h=`%c${t}`,s.unshift(i)),s.unshift(h+":"),Bs){Bs.push([].concat(s));const g=Bs.length-1e3;Bs.splice(0,g>0?g:0)}if(!_e.console)return;let p=_e.console[n];!p&&n==="debug"&&(p=_e.console.info||_e.console.log),!(!p||!o||!u.test(n))&&p[Array.isArray(s)?"apply":"call"](_e.console,s)};function q_(t,e=":",i=""){let n="info",r;function s(...o){r("log",n,o)}return r=nW(t,s,i),s.createLogger=(o,u,h)=>{const p=u!==void 0?u:e,g=h!==void 0?h:i,y=`${t} ${p} ${o}`;return q_(y,p,g)},s.createNewLogger=(o,u,h)=>q_(o,u,h),s.levels={all:"debug|log|warn|error",off:"",debug:"debug|log|warn|error",info:"log|warn|error",warn:"warn|error",error:"error",DEFAULT:n},s.level=o=>{if(typeof o=="string"){if(!s.levels.hasOwnProperty(o))throw new Error(`"${o}" in not a valid log level`);n=o}return n},s.history=()=>Bs?[].concat(Bs):[],s.history.filter=o=>(Bs||[]).filter(u=>new RegExp(`.*${o}.*`).test(u[0])),s.history.clear=()=>{Bs&&(Bs.length=0)},s.history.disable=()=>{Bs!==null&&(Bs.length=0,Bs=null)},s.history.enable=()=>{Bs===null&&(Bs=[])},s.error=(...o)=>r("error",n,o),s.warn=(...o)=>r("warn",n,o),s.debug=(...o)=>r("debug",n,o),s}const xi=q_("VIDEOJS"),DD=xi.createLogger,rW=Object.prototype.toString,PD=function(t){return _a(t)?Object.keys(t):[]};function qd(t,e){PD(t).forEach(i=>e(t[i],i))}function kD(t,e,i=0){return PD(t).reduce((n,r)=>e(n,t[r],r),i)}function _a(t){return!!t&&typeof t=="object"}function Gd(t){return _a(t)&&rW.call(t)==="[object Object]"&&t.constructor===Object}function ln(...t){const e={};return t.forEach(i=>{i&&qd(i,(n,r)=>{if(!Gd(n)){e[r]=n;return}Gd(e[r])||(e[r]={}),e[r]=ln(e[r],n)})}),e}function ID(t={}){const e=[];for(const i in t)if(t.hasOwnProperty(i)){const n=t[i];e.push(n)}return e}function Ty(t,e,i,n=!0){const r=o=>Object.defineProperty(t,e,{value:o,enumerable:!0,writable:!0}),s={configurable:!0,enumerable:!0,get(){const o=i();return r(o),o}};return n&&(s.set=r),Object.defineProperty(t,e,s)}var sW=Object.freeze({__proto__:null,each:qd,reduce:kD,isObject:_a,isPlain:Gd,merge:ln,values:ID,defineLazyProperty:Ty});let G_=!1,RD=null,Vo=!1,OD,LD=!1,Kd=!1,Yd=!1,wa=!1,K_=null,xy=null;const oW=!!(_e.cast&&_e.cast.framework&&_e.cast.framework.CastReceiverContext);let MD=null,Sy=!1,Ey=!1,Cy=!1,Ay=!1,Dy=!1,Py=!1,ky=!1;const kp=!!(Xd()&&("ontouchstart"in _e||_e.navigator.maxTouchPoints||_e.DocumentTouch&&_e.document instanceof _e.DocumentTouch)),pu=_e.navigator&&_e.navigator.userAgentData;if(pu&&pu.platform&&pu.brands&&(Vo=pu.platform==="Android",Kd=!!pu.brands.find(t=>t.brand==="Microsoft Edge"),Yd=!!pu.brands.find(t=>t.brand==="Chromium"),wa=!Kd&&Yd,K_=xy=(pu.brands.find(t=>t.brand==="Chromium")||{}).version||null,Ey=pu.platform==="Windows"),!Yd){const t=_e.navigator&&_e.navigator.userAgent||"";G_=/iPod/i.test(t),RD=function(){const e=t.match(/OS (\d+)_/i);return e&&e[1]?e[1]:null}(),Vo=/Android/i.test(t),OD=function(){const e=t.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;const i=e[1]&&parseFloat(e[1]),n=e[2]&&parseFloat(e[2]);return i&&n?parseFloat(e[1]+"."+e[2]):i||null}(),LD=/Firefox/i.test(t),Kd=/Edg/i.test(t),Yd=/Chrome/i.test(t)||/CriOS/i.test(t),wa=!Kd&&Yd,K_=xy=function(){const e=t.match(/(Chrome|CriOS)\/(\d+)/);return e&&e[2]?parseFloat(e[2]):null}(),MD=function(){const e=/MSIE\s(\d+)\.\d/.exec(t);let i=e&&parseFloat(e[1]);return!i&&/Trident\/7.0/i.test(t)&&/rv:11.0/.test(t)&&(i=11),i}(),Dy=/Tizen/i.test(t),Py=/Web0S/i.test(t),ky=Dy||Py,Sy=/Safari/i.test(t)&&!wa&&!Vo&&!Kd&&!ky,Ey=/Windows/i.test(t),Cy=/iPad/i.test(t)||Sy&&kp&&!/iPhone/i.test(t),Ay=/iPhone/i.test(t)&&!Cy}const Jr=Ay||Cy||G_,Iy=(Sy||Jr)&&!wa;var FD=Object.freeze({__proto__:null,get IS_IPOD(){return G_},get IOS_VERSION(){return RD},get IS_ANDROID(){return Vo},get ANDROID_VERSION(){return OD},get IS_FIREFOX(){return LD},get IS_EDGE(){return Kd},get IS_CHROMIUM(){return Yd},get IS_CHROME(){return wa},get CHROMIUM_VERSION(){return K_},get CHROME_VERSION(){return xy},IS_CHROMECAST_RECEIVER:oW,get IE_VERSION(){return MD},get IS_SAFARI(){return Sy},get IS_WINDOWS(){return Ey},get IS_IPAD(){return Cy},get IS_IPHONE(){return Ay},get IS_TIZEN(){return Dy},get IS_WEBOS(){return Py},get IS_SMART_TV(){return ky},TOUCH_ENABLED:kp,IS_IOS:Jr,IS_ANY_SAFARI:Iy});function ND(t){return typeof t=="string"&&!!t.trim()}function aW(t){if(t.indexOf(" ")>=0)throw new Error("class has illegal whitespace characters")}function Xd(){return mt===_e.document}function Zd(t){return _a(t)&&t.nodeType===1}function BD(){try{return _e.parent!==_e.self}catch{return!0}}function HD(t){return function(e,i){if(!ND(e))return mt[t](null);ND(i)&&(i=mt.querySelector(i));const n=Zd(i)?i:mt;return n[t]&&n[t](e)}}function $t(t="div",e={},i={},n){const r=mt.createElement(t);return Object.getOwnPropertyNames(e).forEach(function(s){const o=e[s];s==="textContent"?mu(r,o):(r[s]!==o||s==="tabIndex")&&(r[s]=o)}),Object.getOwnPropertyNames(i).forEach(function(s){r.setAttribute(s,i[s])}),n&&X_(r,n),r}function mu(t,e){return typeof t.textContent>"u"?t.innerText=e:t.textContent=e,t}function Y_(t,e){e.firstChild?e.insertBefore(t,e.firstChild):e.appendChild(t)}function Ip(t,e){return aW(e),t.classList.contains(e)}function bc(t,...e){return t.classList.add(...e.reduce((i,n)=>i.concat(n.split(/\s+/)),[])),t}function Ry(t,...e){return t?(t.classList.remove(...e.reduce((i,n)=>i.concat(n.split(/\s+/)),[])),t):(xi.warn("removeClass was called with an element that doesn't exist"),null)}function UD(t,e,i){return typeof i=="function"&&(i=i(t,e)),typeof i!="boolean"&&(i=void 0),e.split(/\s+/).forEach(n=>t.classList.toggle(n,i)),t}function zD(t,e){Object.getOwnPropertyNames(e).forEach(function(i){const n=e[i];n===null||typeof n>"u"||n===!1?t.removeAttribute(i):t.setAttribute(i,n===!0?"":n)})}function gu(t){const e={},i=["autoplay","controls","playsinline","loop","muted","default","defaultMuted"];if(t&&t.attributes&&t.attributes.length>0){const n=t.attributes;for(let r=n.length-1;r>=0;r--){const s=n[r].name;let o=n[r].value;i.includes(s)&&(o=o!==null),e[s]=o}}return e}function VD(t,e){return t.getAttribute(e)}function Qd(t,e,i){t.setAttribute(e,i)}function Oy(t,e){t.removeAttribute(e)}function jD(){mt.body.focus(),mt.onselectstart=function(){return!1}}function WD(){mt.onselectstart=function(){return!0}}function Jd(t){if(t&&t.getBoundingClientRect&&t.parentNode){const e=t.getBoundingClientRect(),i={};return["bottom","height","left","right","top","width"].forEach(n=>{e[n]!==void 0&&(i[n]=e[n])}),i.height||(i.height=parseFloat($d(t,"height"))),i.width||(i.width=parseFloat($d(t,"width"))),i}}function Rp(t){if(!t||t&&!t.offsetParent)return{left:0,top:0,width:0,height:0};const e=t.offsetWidth,i=t.offsetHeight;let n=0,r=0;for(;t.offsetParent&&t!==mt[_y.fullscreenElement];)n+=t.offsetLeft,r+=t.offsetTop,t=t.offsetParent;return{left:n,top:r,width:e,height:i}}function Ly(t,e){const i={x:0,y:0};if(Jr){let g=t;for(;g&&g.nodeName.toLowerCase()!=="html";){const y=$d(g,"transform");if(/^matrix/.test(y)){const S=y.slice(7,-1).split(/,\s/).map(Number);i.x+=S[4],i.y+=S[5]}else if(/^matrix3d/.test(y)){const S=y.slice(9,-1).split(/,\s/).map(Number);i.x+=S[12],i.y+=S[13]}if(g.assignedSlot&&g.assignedSlot.parentElement&&_e.WebKitCSSMatrix){const S=_e.getComputedStyle(g.assignedSlot.parentElement).transform,P=new _e.WebKitCSSMatrix(S);i.x+=P.m41,i.y+=P.m42}g=g.parentNode||g.host}}const n={},r=Rp(e.target),s=Rp(t),o=s.width,u=s.height;let h=e.offsetY-(s.top-r.top),p=e.offsetX-(s.left-r.left);return e.changedTouches&&(p=e.changedTouches[0].pageX-s.left,h=e.changedTouches[0].pageY+s.top,Jr&&(p-=i.x,h-=i.y)),n.y=1-Math.max(0,Math.min(1,h/u)),n.x=Math.max(0,Math.min(1,p/o)),n}function qD(t){return _a(t)&&t.nodeType===3}function My(t){for(;t.firstChild;)t.removeChild(t.firstChild);return t}function GD(t){return typeof t=="function"&&(t=t()),(Array.isArray(t)?t:[t]).map(e=>{if(typeof e=="function"&&(e=e()),Zd(e)||qD(e))return e;if(typeof e=="string"&&/\S/.test(e))return mt.createTextNode(e)}).filter(e=>e)}function X_(t,e){return GD(e).forEach(i=>t.appendChild(i)),t}function KD(t,e){return X_(My(t),e)}function Op(t){return t.button===void 0&&t.buttons===void 0||t.button===0&&t.buttons===void 0||t.type==="mouseup"&&t.button===0&&t.buttons===0||t.type==="mousedown"&&t.button===0&&t.buttons===0?!0:!(t.button!==0||t.buttons!==1)}const yu=HD("querySelector"),YD=HD("querySelectorAll");function $d(t,e){if(!t||!e)return"";if(typeof _e.getComputedStyle=="function"){let i;try{i=_e.getComputedStyle(t)}catch{return""}return i?i.getPropertyValue(e)||i[e]:""}return""}function XD(t){[...mt.styleSheets].forEach(e=>{try{const i=[...e.cssRules].map(r=>r.cssText).join(""),n=mt.createElement("style");n.textContent=i,t.document.head.appendChild(n)}catch{const n=mt.createElement("link");n.rel="stylesheet",n.type=e.type,n.media=e.media.mediaText,n.href=e.href,t.document.head.appendChild(n)}})}var ZD=Object.freeze({__proto__:null,isReal:Xd,isEl:Zd,isInFrame:BD,createEl:$t,textContent:mu,prependTo:Y_,hasClass:Ip,addClass:bc,removeClass:Ry,toggleClass:UD,setAttributes:zD,getAttributes:gu,getAttribute:VD,setAttribute:Qd,removeAttribute:Oy,blockTextSelection:jD,unblockTextSelection:WD,getBoundingClientRect:Jd,findPosition:Rp,getPointerPosition:Ly,isTextNode:qD,emptyEl:My,normalizeContent:GD,appendContent:X_,insertContent:KD,isSingleLeftClick:Op,$:yu,$$:YD,computedStyle:$d,copyStyleSheetsToWindow:XD});let QD=!1,Z_;const lW=function(){if(Z_.options.autoSetup===!1)return;const t=Array.prototype.slice.call(mt.getElementsByTagName("video")),e=Array.prototype.slice.call(mt.getElementsByTagName("audio")),i=Array.prototype.slice.call(mt.getElementsByTagName("video-js")),n=t.concat(e,i);if(n&&n.length>0)for(let r=0,s=n.length;r-1&&(r={passive:!0}),t.addEventListener(e,n.dispatcher,r)}else t.attachEvent&&t.attachEvent("on"+e,n.dispatcher)}function $r(t,e,i){if(!vs.has(t))return;const n=vs.get(t);if(!n.handlers)return;if(Array.isArray(e))return $_($r,t,e,i);const r=function(o,u){n.handlers[u]=[],eP(o,u)};if(e===void 0){for(const o in n.handlers)Object.prototype.hasOwnProperty.call(n.handlers||{},o)&&r(t,o);return}const s=n.handlers[e];if(s){if(!i){r(t,e);return}if(i.guid)for(let o=0;o=e&&(t(...r),i=s)}},tP=function(t,e,i,n=_e){let r;const s=()=>{n.clearTimeout(r),r=null},o=function(){const u=this,h=arguments;let p=function(){r=null,p=null,i||t.apply(u,h)};!r&&i&&t.apply(u,h),n.clearTimeout(r),r=n.setTimeout(p,e)};return o.cancel=s,o};var fW=Object.freeze({__proto__:null,UPDATE_REFRESH_INTERVAL:wo,bind_:bn,throttle:Ta,debounce:tP});let Lp;class $s{on(e,i){const n=this.addEventListener;this.addEventListener=()=>{},Js(this,e,i),this.addEventListener=n}off(e,i){$r(this,e,i)}one(e,i){const n=this.addEventListener;this.addEventListener=()=>{},By(this,e,i),this.addEventListener=n}any(e,i){const n=this.addEventListener;this.addEventListener=()=>{},ew(this,e,i),this.addEventListener=n}trigger(e){const i=e.type||e;typeof e=="string"&&(e={type:i}),e=Fy(e),this.allowedEvents_[i]&&this["on"+i]&&this["on"+i](e),eh(this,e)}queueTrigger(e){Lp||(Lp=new Map);const i=e.type||e;let n=Lp.get(this);n||(n=new Map,Lp.set(this,n));const r=n.get(i);n.delete(i),_e.clearTimeout(r);const s=_e.setTimeout(()=>{n.delete(i),n.size===0&&(n=null,Lp.delete(this)),this.trigger(e)},0);n.set(i,s)}}$s.prototype.allowedEvents_={},$s.prototype.addEventListener=$s.prototype.on,$s.prototype.removeEventListener=$s.prototype.off,$s.prototype.dispatchEvent=$s.prototype.trigger;const Hy=t=>typeof t.name=="function"?t.name():typeof t.name=="string"?t.name:t.name_?t.name_:t.constructor&&t.constructor.name?t.constructor.name:typeof t,bl=t=>t instanceof $s||!!t.eventBusEl_&&["on","one","off","trigger"].every(e=>typeof t[e]=="function"),pW=(t,e)=>{bl(t)?e():(t.eventedCallbacks||(t.eventedCallbacks=[]),t.eventedCallbacks.push(e))},tw=t=>typeof t=="string"&&/\S/.test(t)||Array.isArray(t)&&!!t.length,Uy=(t,e,i)=>{if(!t||!t.nodeName&&!bl(t))throw new Error(`Invalid target for ${Hy(e)}#${i}; must be a DOM node or evented object.`)},iP=(t,e,i)=>{if(!tw(t))throw new Error(`Invalid event type for ${Hy(e)}#${i}; must be a non-empty string or array.`)},nP=(t,e,i)=>{if(typeof t!="function")throw new Error(`Invalid listener for ${Hy(e)}#${i}; must be a function.`)},iw=(t,e,i)=>{const n=e.length<3||e[0]===t||e[0]===t.eventBusEl_;let r,s,o;return n?(r=t.eventBusEl_,e.length>=3&&e.shift(),[s,o]=e):(r=e[0],s=e[1],o=e[2]),Uy(r,t,i),iP(s,t,i),nP(o,t,i),o=bn(t,o),{isTargetingSelf:n,target:r,type:s,listener:o}},_c=(t,e,i,n)=>{Uy(t,t,e),t.nodeName?hW[e](t,i,n):t[e](i,n)},mW={on(...t){const{isTargetingSelf:e,target:i,type:n,listener:r}=iw(this,t,"on");if(_c(i,"on",n,r),!e){const s=()=>this.off(i,n,r);s.guid=r.guid;const o=()=>this.off("dispose",s);o.guid=r.guid,_c(this,"on","dispose",s),_c(i,"on","dispose",o)}},one(...t){const{isTargetingSelf:e,target:i,type:n,listener:r}=iw(this,t,"one");if(e)_c(i,"one",n,r);else{const s=(...o)=>{this.off(i,n,s),r.apply(null,o)};s.guid=r.guid,_c(i,"one",n,s)}},any(...t){const{isTargetingSelf:e,target:i,type:n,listener:r}=iw(this,t,"any");if(e)_c(i,"any",n,r);else{const s=(...o)=>{this.off(i,n,s),r.apply(null,o)};s.guid=r.guid,_c(i,"any",n,s)}},off(t,e,i){if(!t||tw(t))$r(this.eventBusEl_,t,e);else{const n=t,r=e;Uy(n,this,"off"),iP(r,this,"off"),nP(i,this,"off"),i=bn(this,i),this.off("dispose",i),n.nodeName?($r(n,r,i),$r(n,"dispose",i)):bl(n)&&(n.off(r,i),n.off("dispose",i))}},trigger(t,e){Uy(this.eventBusEl_,this,"trigger");const i=t&&typeof t!="string"?t.type:t;if(!tw(i))throw new Error(`Invalid event type for ${Hy(this)}#trigger; must be a non-empty string or object with a type key that has a non-empty value.`);return eh(this.eventBusEl_,t,e)}};function nw(t,e={}){const{eventBusKey:i}=e;if(i){if(!t[i].nodeName)throw new Error(`The eventBusKey "${i}" does not refer to an element.`);t.eventBusEl_=t[i]}else t.eventBusEl_=$t("span",{className:"vjs-event-bus"});return Object.assign(t,mW),t.eventedCallbacks&&t.eventedCallbacks.forEach(n=>{n()}),t.on("dispose",()=>{t.off(),[t,t.el_,t.eventBusEl_].forEach(function(n){n&&vs.has(n)&&vs.delete(n)}),_e.setTimeout(()=>{t.eventBusEl_=null},0)}),t}const gW={state:{},setState(t){typeof t=="function"&&(t=t());let e;return qd(t,(i,n)=>{this.state[n]!==i&&(e=e||{},e[n]={from:this.state[n],to:i}),this.state[n]=i}),e&&bl(this)&&this.trigger({changes:e,type:"statechanged"}),e}};function rP(t,e){return Object.assign(t,gW),t.state=Object.assign({},t.state,e),typeof t.handleStateChanged=="function"&&bl(t)&&t.on("statechanged",t.handleStateChanged),t}const Mp=function(t){return typeof t!="string"?t:t.replace(/./,e=>e.toLowerCase())},qn=function(t){return typeof t!="string"?t:t.replace(/./,e=>e.toUpperCase())},sP=function(t,e){return qn(t)===qn(e)};var yW=Object.freeze({__proto__:null,toLowerCase:Mp,toTitleCase:qn,titleCaseEquals:sP});class Xe{constructor(e,i,n){if(!e&&this.play?this.player_=e=this:this.player_=e,this.isDisposed_=!1,this.parentComponent_=null,this.options_=ln({},this.options_),i=this.options_=ln(this.options_,i),this.id_=i.id||i.el&&i.el.id,!this.id_){const r=e&&e.id&&e.id()||"no_player";this.id_=`${r}_component_${_o()}`}this.name_=i.name||null,i.el?this.el_=i.el:i.createEl!==!1&&(this.el_=this.createEl()),i.className&&this.el_&&i.className.split(" ").forEach(r=>this.addClass(r)),["on","off","one","any","trigger"].forEach(r=>{this[r]=void 0}),i.evented!==!1&&(nw(this,{eventBusKey:this.el_?"el_":null}),this.handleLanguagechange=this.handleLanguagechange.bind(this),this.on(this.player_,"languagechange",this.handleLanguagechange)),rP(this,this.constructor.defaultState),this.children_=[],this.childIndex_={},this.childNameIndex_={},this.setTimeoutIds_=new Set,this.setIntervalIds_=new Set,this.rafIds_=new Set,this.namedRafs_=new Map,this.clearingTimersOnDispose_=!1,i.initChildren!==!1&&this.initChildren(),this.ready(n),i.reportTouchActivity!==!1&&this.enableTouchActivity()}dispose(e={}){if(!this.isDisposed_){if(this.readyQueue_&&(this.readyQueue_.length=0),this.trigger({type:"dispose",bubbles:!1}),this.isDisposed_=!0,this.children_)for(let i=this.children_.length-1;i>=0;i--)this.children_[i].dispose&&this.children_[i].dispose();this.children_=null,this.childIndex_=null,this.childNameIndex_=null,this.parentComponent_=null,this.el_&&(this.el_.parentNode&&(e.restoreEl?this.el_.parentNode.replaceChild(e.restoreEl,this.el_):this.el_.parentNode.removeChild(this.el_)),this.el_=null),this.player_=null}}isDisposed(){return!!this.isDisposed_}player(){return this.player_}options(e){return e?(this.options_=ln(this.options_,e),this.options_):this.options_}el(){return this.el_}createEl(e,i,n){return $t(e,i,n)}localize(e,i,n=e){const r=this.player_.language&&this.player_.language(),s=this.player_.languages&&this.player_.languages(),o=s&&s[r],u=r&&r.split("-")[0],h=s&&s[u];let p=n;return o&&o[e]?p=o[e]:h&&h[e]&&(p=h[e]),i&&(p=p.replace(/\{(\d+)\}/g,function(g,y){const S=i[y-1];let P=S;return typeof S>"u"&&(P=g),P})),p}handleLanguagechange(){}contentEl(){return this.contentEl_||this.el_}id(){return this.id_}name(){return this.name_}children(){return this.children_}getChildById(e){return this.childIndex_[e]}getChild(e){if(e)return this.childNameIndex_[e]}getDescendant(...e){e=e.reduce((n,r)=>n.concat(r),[]);let i=this;for(let n=0;n=0;r--)if(this.children_[r]===e){i=!0,this.children_.splice(r,1);break}if(!i)return;e.parentComponent_=null,this.childIndex_[e.id()]=null,this.childNameIndex_[qn(e.name())]=null,this.childNameIndex_[Mp(e.name())]=null;const n=e.el();n&&n.parentNode===this.contentEl()&&this.contentEl().removeChild(e.el())}initChildren(){const e=this.options_.children;if(e){const i=this.options_,n=o=>{const u=o.name;let h=o.opts;if(i[u]!==void 0&&(h=i[u]),h===!1)return;h===!0&&(h={}),h.playerOptions=this.options_.playerOptions;const p=this.addChild(u,h);p&&(this[u]=p)};let r;const s=Xe.getComponent("Tech");Array.isArray(e)?r=e:r=Object.keys(e),r.concat(Object.keys(this.options_).filter(function(o){return!r.some(function(u){return typeof u=="string"?o===u:o===u.name})})).map(o=>{let u,h;return typeof o=="string"?(u=o,h=e[u]||this.options_[u]||{}):(u=o.name,h=o),{name:u,opts:h}}).filter(o=>{const u=Xe.getComponent(o.opts.componentClass||qn(o.name));return u&&!s.isTech(u)}).forEach(n)}}buildCSSClass(){return""}ready(e,i=!1){if(e){if(!this.isReady_){this.readyQueue_=this.readyQueue_||[],this.readyQueue_.push(e);return}i?e.call(this):this.setTimeout(e,1)}}triggerReady(){this.isReady_=!0,this.setTimeout(function(){const e=this.readyQueue_;this.readyQueue_=[],e&&e.length>0&&e.forEach(function(i){i.call(this)},this),this.trigger("ready")},1)}$(e,i){return yu(e,i||this.contentEl())}$$(e,i){return YD(e,i||this.contentEl())}hasClass(e){return Ip(this.el_,e)}addClass(...e){bc(this.el_,...e)}removeClass(...e){Ry(this.el_,...e)}toggleClass(e,i){UD(this.el_,e,i)}show(){this.removeClass("vjs-hidden")}hide(){this.addClass("vjs-hidden")}lockShowing(){this.addClass("vjs-lock-showing")}unlockShowing(){this.removeClass("vjs-lock-showing")}getAttribute(e){return VD(this.el_,e)}setAttribute(e,i){Qd(this.el_,e,i)}removeAttribute(e){Oy(this.el_,e)}width(e,i){return this.dimension("width",e,i)}height(e,i){return this.dimension("height",e,i)}dimensions(e,i){this.width(e,!0),this.height(i)}dimension(e,i,n){if(i!==void 0){(i===null||i!==i)&&(i=0),(""+i).indexOf("%")!==-1||(""+i).indexOf("px")!==-1?this.el_.style[e]=i:i==="auto"?this.el_.style[e]="":this.el_.style[e]=i+"px",n||this.trigger("componentresize");return}if(!this.el_)return 0;const r=this.el_.style[e],s=r.indexOf("px");return parseInt(s!==-1?r.slice(0,s):this.el_["offset"+qn(e)],10)}currentDimension(e){let i=0;if(e!=="width"&&e!=="height")throw new Error("currentDimension only accepts width or height value");if(i=$d(this.el_,e),i=parseFloat(i),i===0||isNaN(i)){const n=`offset${qn(e)}`;i=this.el_[n]}return i}currentDimensions(){return{width:this.currentDimension("width"),height:this.currentDimension("height")}}currentWidth(){return this.currentDimension("width")}currentHeight(){return this.currentDimension("height")}getPositions(){const e=this.el_.getBoundingClientRect(),i={x:e.x,y:e.y,width:e.width,height:e.height,top:e.top,right:e.right,bottom:e.bottom,left:e.left},n={x:e.left+e.width/2,y:e.top+e.height/2,width:0,height:0,top:e.top+e.height/2,right:e.left+e.width/2,bottom:e.top+e.height/2,left:e.left+e.width/2};return{boundingClientRect:i,center:n}}focus(){this.el_.focus()}blur(){this.el_.blur()}handleKeyDown(e){this.player_&&(e.key!=="Tab"&&!(this.player_.options_.playerOptions.spatialNavigation&&this.player_.options_.playerOptions.spatialNavigation.enabled)&&e.stopPropagation(),this.player_.handleKeyDown(e))}handleKeyPress(e){this.handleKeyDown(e)}emitTapEvents(){let e=0,i=null;const n=10,r=200;let s;this.on("touchstart",function(u){u.touches.length===1&&(i={pageX:u.touches[0].pageX,pageY:u.touches[0].pageY},e=_e.performance.now(),s=!0)}),this.on("touchmove",function(u){if(u.touches.length>1)s=!1;else if(i){const h=u.touches[0].pageX-i.pageX,p=u.touches[0].pageY-i.pageY;Math.sqrt(h*h+p*p)>n&&(s=!1)}});const o=function(){s=!1};this.on("touchleave",o),this.on("touchcancel",o),this.on("touchend",function(u){i=null,s===!0&&_e.performance.now()-e{this.setTimeoutIds_.has(n)&&this.setTimeoutIds_.delete(n),e()},i),this.setTimeoutIds_.add(n),n}clearTimeout(e){return this.setTimeoutIds_.has(e)&&(this.setTimeoutIds_.delete(e),_e.clearTimeout(e)),e}setInterval(e,i){e=bn(this,e),this.clearTimersOnDispose_();const n=_e.setInterval(e,i);return this.setIntervalIds_.add(n),n}clearInterval(e){return this.setIntervalIds_.has(e)&&(this.setIntervalIds_.delete(e),_e.clearInterval(e)),e}requestAnimationFrame(e){this.clearTimersOnDispose_();var i;return e=bn(this,e),i=_e.requestAnimationFrame(()=>{this.rafIds_.has(i)&&this.rafIds_.delete(i),e()}),this.rafIds_.add(i),i}requestNamedAnimationFrame(e,i){this.namedRafs_.has(e)&&this.cancelNamedAnimationFrame(e),this.clearTimersOnDispose_(),i=bn(this,i);const n=this.requestAnimationFrame(()=>{i(),this.namedRafs_.has(e)&&this.namedRafs_.delete(e)});return this.namedRafs_.set(e,n),e}cancelNamedAnimationFrame(e){this.namedRafs_.has(e)&&(this.cancelAnimationFrame(this.namedRafs_.get(e)),this.namedRafs_.delete(e))}cancelAnimationFrame(e){return this.rafIds_.has(e)&&(this.rafIds_.delete(e),_e.cancelAnimationFrame(e)),e}clearTimersOnDispose_(){this.clearingTimersOnDispose_||(this.clearingTimersOnDispose_=!0,this.one("dispose",()=>{[["namedRafs_","cancelNamedAnimationFrame"],["rafIds_","cancelAnimationFrame"],["setTimeoutIds_","clearTimeout"],["setIntervalIds_","clearInterval"]].forEach(([e,i])=>{this[e].forEach((n,r)=>this[i](r))}),this.clearingTimersOnDispose_=!1}))}getIsDisabled(){return!!this.el_.disabled}getIsExpresslyInert(){return this.el_.inert&&!this.el_.ownerDocument.documentElement.inert}getIsFocusable(e){return(e||this.el_).tabIndex>=0&&!(this.getIsDisabled()||this.getIsExpresslyInert())}getIsAvailableToBeFocused(e){function i(s){const o=_e.getComputedStyle(s,null),u=o.getPropertyValue("visibility");return o.getPropertyValue("display")!=="none"&&!["hidden","collapse"].includes(u)}function n(s){return!(!i(s.parentElement)||!i(s)||s.style.opacity==="0"||_e.getComputedStyle(s).height==="0px"||_e.getComputedStyle(s).width==="0px")}function r(s){if(s.offsetWidth+s.offsetHeight+s.getBoundingClientRect().height+s.getBoundingClientRect().width===0)return!1;const o={x:s.getBoundingClientRect().left+s.offsetWidth/2,y:s.getBoundingClientRect().top+s.offsetHeight/2};if(o.x<0||o.x>(mt.documentElement.clientWidth||_e.innerWidth)||o.y<0||o.y>(mt.documentElement.clientHeight||_e.innerHeight))return!1;let u=mt.elementFromPoint(o.x,o.y);for(;u;){if(u===s)return!0;if(u.parentNode)u=u.parentNode;else return!1}}return e||(e=this.el()),!!(r(e)&&n(e)&&(!e.parentElement||e.tabIndex>=0))}static registerComponent(e,i){if(typeof e!="string"||!e)throw new Error(`Illegal component name, "${e}"; must be a non-empty string.`);const n=Xe.getComponent("Tech"),r=n&&n.isTech(i),s=Xe===i||Xe.prototype.isPrototypeOf(i.prototype);if(r||!s){let u;throw r?u="techs must be registered using Tech.registerTech()":u="must be a Component subclass",new Error(`Illegal component, "${e}"; ${u}.`)}e=qn(e),Xe.components_||(Xe.components_={});const o=Xe.getComponent("Player");if(e==="Player"&&o&&o.players){const u=o.players,h=Object.keys(u);if(u&&h.length>0){for(let p=0;pi)throw new Error(`Failed to execute '${t}' on 'TimeRanges': The index provided (${e}) is non-numeric or out of bounds (0-${i}).`)}function oP(t,e,i,n){return vW(t,n,i.length-1),i[n][e]}function rw(t){let e;return t===void 0||t.length===0?e={length:0,start(){throw new Error("This TimeRanges object is empty")},end(){throw new Error("This TimeRanges object is empty")}}:e={length:t.length,start:oP.bind(null,"start",0,t),end:oP.bind(null,"end",1,t)},_e.Symbol&&_e.Symbol.iterator&&(e[_e.Symbol.iterator]=()=>(t||[]).values()),e}function jo(t,e){return Array.isArray(t)?rw(t):t===void 0||e===void 0?rw():rw([[t,e]])}const aP=function(t,e){t=t<0?0:t;let i=Math.floor(t%60),n=Math.floor(t/60%60),r=Math.floor(t/3600);const s=Math.floor(e/60%60),o=Math.floor(e/3600);return(isNaN(t)||t===1/0)&&(r=n=i="-"),r=r>0||o>0?r+":":"",n=((r||s>=10)&&n<10?"0"+n:n)+":",i=i<10?"0"+i:i,r+n+i};let sw=aP;function lP(t){sw=t}function uP(){sw=aP}function wc(t,e=t){return sw(t,e)}var bW=Object.freeze({__proto__:null,createTimeRanges:jo,createTimeRange:jo,setFormatTime:lP,resetFormatTime:uP,formatTime:wc});function cP(t,e){let i=0,n,r;if(!e)return 0;(!t||!t.length)&&(t=jo(0,0));for(let s=0;se&&(r=e),i+=r-n;return i/e}function Bn(t){if(t instanceof Bn)return t;typeof t=="number"?this.code=t:typeof t=="string"?this.message=t:_a(t)&&(typeof t.code=="number"&&(this.code=t.code),Object.assign(this,t)),this.message||(this.message=Bn.defaultMessages[this.code]||"")}Bn.prototype.code=0,Bn.prototype.message="",Bn.prototype.status=null,Bn.prototype.metadata=null,Bn.errorTypes=["MEDIA_ERR_CUSTOM","MEDIA_ERR_ABORTED","MEDIA_ERR_NETWORK","MEDIA_ERR_DECODE","MEDIA_ERR_SRC_NOT_SUPPORTED","MEDIA_ERR_ENCRYPTED"],Bn.defaultMessages={1:"You aborted the media playback",2:"A network error caused the media download to fail part-way.",3:"The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",4:"The media could not be loaded, either because the server or network failed or because the format is not supported.",5:"The media is encrypted and we do not have the keys to decrypt it."},Bn.MEDIA_ERR_CUSTOM=0,Bn.prototype.MEDIA_ERR_CUSTOM=0,Bn.MEDIA_ERR_ABORTED=1,Bn.prototype.MEDIA_ERR_ABORTED=1,Bn.MEDIA_ERR_NETWORK=2,Bn.prototype.MEDIA_ERR_NETWORK=2,Bn.MEDIA_ERR_DECODE=3,Bn.prototype.MEDIA_ERR_DECODE=3,Bn.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Bn.prototype.MEDIA_ERR_SRC_NOT_SUPPORTED=4,Bn.MEDIA_ERR_ENCRYPTED=5,Bn.prototype.MEDIA_ERR_ENCRYPTED=5;function Fp(t){return t!=null&&typeof t.then=="function"}function xa(t){Fp(t)&&t.then(null,e=>{})}const ow=function(t){return["kind","label","language","id","inBandMetadataTrackDispatchType","mode","src"].reduce((i,n,r)=>(t[n]&&(i[n]=t[n]),i),{cues:t.cues&&Array.prototype.map.call(t.cues,function(i){return{startTime:i.startTime,endTime:i.endTime,text:i.text,id:i.id}})})};var dP={textTracksToJson:function(t){const e=t.$$("track"),i=Array.prototype.map.call(e,r=>r.track);return Array.prototype.map.call(e,function(r){const s=ow(r.track);return r.src&&(s.src=r.src),s}).concat(Array.prototype.filter.call(t.textTracks(),function(r){return i.indexOf(r)===-1}).map(ow))},jsonToTextTracks:function(t,e){return t.forEach(function(i){const n=e.addRemoteTextTrack(i).track;!i.src&&i.cues&&i.cues.forEach(r=>n.addCue(r))}),e.textTracks()},trackToJson_:ow};const aw="vjs-modal-dialog";class th extends Xe{constructor(e,i){super(e,i),this.handleKeyDown_=n=>this.handleKeyDown(n),this.close_=n=>this.close(n),this.opened_=this.hasBeenOpened_=this.hasBeenFilled_=!1,this.closeable(!this.options_.uncloseable),this.content(this.options_.content),this.contentEl_=$t("div",{className:`${aw}-content`},{role:"document"}),this.descEl_=$t("p",{className:`${aw}-description vjs-control-text`,id:this.el().getAttribute("aria-describedby")}),mu(this.descEl_,this.description()),this.el_.appendChild(this.descEl_),this.el_.appendChild(this.contentEl_)}createEl(){return super.createEl("div",{className:this.buildCSSClass(),tabIndex:-1},{"aria-describedby":`${this.id()}_description`,"aria-hidden":"true","aria-label":this.label(),role:"dialog","aria-live":"polite"})}dispose(){this.contentEl_=null,this.descEl_=null,this.previouslyActiveEl_=null,super.dispose()}buildCSSClass(){return`${aw} vjs-hidden ${super.buildCSSClass()}`}label(){return this.localize(this.options_.label||"Modal Window")}description(){let e=this.options_.description||this.localize("This is a modal window.");return this.closeable()&&(e+=" "+this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),e}open(){if(this.opened_){this.options_.fillAlways&&this.fill();return}const e=this.player();this.trigger("beforemodalopen"),this.opened_=!0,(this.options_.fillAlways||!this.hasBeenOpened_&&!this.hasBeenFilled_)&&this.fill(),this.wasPlaying_=!e.paused(),this.options_.pauseOnOpen&&this.wasPlaying_&&e.pause(),this.on("keydown",this.handleKeyDown_),this.hadControls_=e.controls(),e.controls(!1),this.show(),this.conditionalFocus_(),this.el().setAttribute("aria-hidden","false"),this.trigger("modalopen"),this.hasBeenOpened_=!0}opened(e){return typeof e=="boolean"&&this[e?"open":"close"](),this.opened_}close(){if(!this.opened_)return;const e=this.player();this.trigger("beforemodalclose"),this.opened_=!1,this.wasPlaying_&&this.options_.pauseOnOpen&&e.play(),this.off("keydown",this.handleKeyDown_),this.hadControls_&&e.controls(!0),this.hide(),this.el().setAttribute("aria-hidden","true"),this.trigger({type:"modalclose",bubbles:!0}),this.conditionalBlur_(),this.options_.temporary&&this.dispose()}closeable(e){if(typeof e=="boolean"){const i=this.closeable_=!!e;let n=this.getChild("closeButton");if(i&&!n){const r=this.contentEl_;this.contentEl_=this.el_,n=this.addChild("closeButton",{controlText:"Close Modal Dialog"}),this.contentEl_=r,this.on(n,"close",this.close_)}!i&&n&&(this.off(n,"close",this.close_),this.removeChild(n),n.dispose())}return this.closeable_}fill(){this.fillWith(this.content())}fillWith(e){const i=this.contentEl(),n=i.parentNode,r=i.nextSibling;this.trigger("beforemodalfill"),this.hasBeenFilled_=!0,n.removeChild(i),this.empty(),KD(i,e),this.trigger("modalfill"),r?n.insertBefore(i,r):n.appendChild(i);const s=this.getChild("closeButton");s&&n.appendChild(s.el_),this.trigger("aftermodalfill")}empty(){this.trigger("beforemodalempty"),My(this.contentEl()),this.trigger("modalempty")}content(e){return typeof e<"u"&&(this.content_=e),this.content_}conditionalFocus_(){const e=mt.activeElement,i=this.player_.el_;this.previouslyActiveEl_=null,(i.contains(e)||i===e)&&(this.previouslyActiveEl_=e,this.focus())}conditionalBlur_(){this.previouslyActiveEl_&&(this.previouslyActiveEl_.focus(),this.previouslyActiveEl_=null)}handleKeyDown(e){if(this.trigger({type:"modalKeydown",originalEvent:e,target:this,bubbles:!0}),e.stopPropagation(),e.key==="Escape"&&this.closeable()){e.preventDefault(),this.close();return}if(e.key!=="Tab")return;const i=this.focusableEls_(),n=this.el_.querySelector(":focus");let r;for(let s=0;s(i instanceof _e.HTMLAnchorElement||i instanceof _e.HTMLAreaElement)&&i.hasAttribute("href")||(i instanceof _e.HTMLInputElement||i instanceof _e.HTMLSelectElement||i instanceof _e.HTMLTextAreaElement||i instanceof _e.HTMLButtonElement)&&!i.hasAttribute("disabled")||i instanceof _e.HTMLIFrameElement||i instanceof _e.HTMLObjectElement||i instanceof _e.HTMLEmbedElement||i.hasAttribute("tabindex")&&i.getAttribute("tabindex")!==-1||i.hasAttribute("contenteditable"))}}th.prototype.options_={pauseOnOpen:!0,temporary:!0},Xe.registerComponent("ModalDialog",th);class ih extends $s{constructor(e=[]){super(),this.tracks_=[],Object.defineProperty(this,"length",{get(){return this.tracks_.length}});for(let i=0;i{this.trigger({track:e,type:"labelchange",target:this})},bl(e)&&e.addEventListener("labelchange",e.labelchange_)}removeTrack(e){let i;for(let n=0,r=this.length;n=0;i--)if(e[i].enabled){lw(e,e[i]);break}super(e),this.changing_=!1}addTrack(e){e.enabled&&lw(this,e),super.addTrack(e),e.addEventListener&&(e.enabledChange_=()=>{this.changing_||(this.changing_=!0,lw(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("enabledchange",e.enabledChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.enabledChange_&&(e.removeEventListener("enabledchange",e.enabledChange_),e.enabledChange_=null)}}const uw=function(t,e){for(let i=0;i=0;i--)if(e[i].selected){uw(e,e[i]);break}super(e),this.changing_=!1,Object.defineProperty(this,"selectedIndex",{get(){for(let i=0;i{this.changing_||(this.changing_=!0,uw(this,e),this.changing_=!1,this.trigger("change"))},e.addEventListener("selectedchange",e.selectedChange_))}removeTrack(e){super.removeTrack(e),e.removeEventListener&&e.selectedChange_&&(e.removeEventListener("selectedchange",e.selectedChange_),e.selectedChange_=null)}}class hP extends ih{addTrack(e){super.addTrack(e),this.queueChange_||(this.queueChange_=()=>this.queueTrigger("change")),this.triggerSelectedlanguagechange||(this.triggerSelectedlanguagechange_=()=>this.trigger("selectedlanguagechange")),e.addEventListener("modechange",this.queueChange_),["metadata","chapters"].indexOf(e.kind)===-1&&e.addEventListener("modechange",this.triggerSelectedlanguagechange_)}removeTrack(e){super.removeTrack(e),e.removeEventListener&&(this.queueChange_&&e.removeEventListener("modechange",this.queueChange_),this.selectedlanguagechange_&&e.removeEventListener("modechange",this.triggerSelectedlanguagechange_))}}class TW{constructor(e=[]){this.trackElements_=[],Object.defineProperty(this,"length",{get(){return this.trackElements_.length}});for(let i=0,n=e.length;i0&&(_e.console&&_e.console.groupCollapsed&&_e.console.groupCollapsed(`Text Track parsing errors for ${e.src}`),n.forEach(r=>xi.error(r)),_e.console&&_e.console.groupEnd&&_e.console.groupEnd()),i.flush()},gP=function(t,e){const i={uri:t},n=Vy(t);n&&(i.cors=n);const r=e.tech_.crossOrigin()==="use-credentials";r&&(i.withCredentials=r),e2(i,bn(this,function(s,o,u){if(s)return xi.error(s,o);e.loaded_=!0,typeof _e.WebVTT!="function"?e.tech_&&e.tech_.any(["vttjsloaded","vttjserror"],h=>{if(h.type==="vttjserror"){xi.error(`vttjs failed to load, stopping trying to process ${e.src}`);return}return mP(u,e)}):mP(u,e)}))};class Np extends cw{constructor(e={}){if(!e.tech)throw new Error("A tech was not provided.");const i=ln(e,{kind:EW[e.kind]||"subtitles",language:e.language||e.srclang||""});let n=fP[i.mode]||"disabled";const r=i.default;(i.kind==="metadata"||i.kind==="chapters")&&(n="hidden"),super(i),this.tech_=i.tech,this.cues_=[],this.activeCues_=[],this.preload_=this.tech_.preloadTextTracks!==!1;const s=new zy(this.cues_),o=new zy(this.activeCues_);let u=!1;this.timeupdateHandler=bn(this,function(p={}){if(!this.tech_.isDisposed()){if(!this.tech_.isReady_){p.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler));return}this.activeCues=this.activeCues,u&&(this.trigger("cuechange"),u=!1),p.type!=="timeupdate"&&(this.rvf_=this.tech_.requestVideoFrameCallback(this.timeupdateHandler))}});const h=()=>{this.stopTracking()};this.tech_.one("dispose",h),n!=="disabled"&&this.startTracking(),Object.defineProperties(this,{default:{get(){return r},set(){}},mode:{get(){return n},set(p){fP[p]&&n!==p&&(n=p,!this.preload_&&n!=="disabled"&&this.cues.length===0&&gP(this.src,this),this.stopTracking(),n!=="disabled"&&this.startTracking(),this.trigger("modechange"))}},cues:{get(){return this.loaded_?s:null},set(){}},activeCues:{get(){if(!this.loaded_)return null;if(this.cues.length===0)return o;const p=this.tech_.currentTime(),g=[];for(let y=0,S=this.cues.length;y=p&&g.push(P)}if(u=!1,g.length!==this.activeCues_.length)u=!0;else for(let y=0;y{i=_l.LOADED,this.trigger({type:"load",target:this})})}}_l.prototype.allowedEvents_={load:"load"},_l.NONE=0,_l.LOADING=1,_l.LOADED=2,_l.ERROR=3;const To={audio:{ListClass:_W,TrackClass:yP,capitalName:"Audio"},video:{ListClass:wW,TrackClass:vP,capitalName:"Video"},text:{ListClass:hP,TrackClass:Np,capitalName:"Text"}};Object.keys(To).forEach(function(t){To[t].getterName=`${t}Tracks`,To[t].privateName=`${t}Tracks_`});const nh={remoteText:{ListClass:hP,TrackClass:Np,capitalName:"RemoteText",getterName:"remoteTextTracks",privateName:"remoteTextTracks_"},remoteTextEl:{ListClass:TW,TrackClass:_l,capitalName:"RemoteTextTrackEls",getterName:"remoteTextTrackEls",privateName:"remoteTextTrackEls_"}},bs=Object.assign({},To,nh);nh.names=Object.keys(nh),To.names=Object.keys(To),bs.names=[].concat(nh.names).concat(To.names);function AW(t,e,i,n,r={}){const s=t.textTracks();r.kind=e,i&&(r.label=i),n&&(r.language=n),r.tech=t;const o=new bs.text.TrackClass(r);return s.addTrack(o),o}class mi extends Xe{constructor(e={},i=function(){}){e.reportTouchActivity=!1,super(null,e,i),this.onDurationChange_=n=>this.onDurationChange(n),this.trackProgress_=n=>this.trackProgress(n),this.trackCurrentTime_=n=>this.trackCurrentTime(n),this.stopTrackingCurrentTime_=n=>this.stopTrackingCurrentTime(n),this.disposeSourceHandler_=n=>this.disposeSourceHandler(n),this.queuedHanders_=new Set,this.hasStarted_=!1,this.on("playing",function(){this.hasStarted_=!0}),this.on("loadstart",function(){this.hasStarted_=!1}),bs.names.forEach(n=>{const r=bs[n];e&&e[r.getterName]&&(this[r.privateName]=e[r.getterName])}),this.featuresProgressEvents||this.manualProgressOn(),this.featuresTimeupdateEvents||this.manualTimeUpdatesOn(),["Text","Audio","Video"].forEach(n=>{e[`native${n}Tracks`]===!1&&(this[`featuresNative${n}Tracks`]=!1)}),e.nativeCaptions===!1||e.nativeTextTracks===!1?this.featuresNativeTextTracks=!1:(e.nativeCaptions===!0||e.nativeTextTracks===!0)&&(this.featuresNativeTextTracks=!0),this.featuresNativeTextTracks||this.emulateTextTracks(),this.preloadTextTracks=e.preloadTextTracks!==!1,this.autoRemoteTextTracks_=new bs.text.ListClass,this.initTrackListeners(),e.nativeControlsForTouch||this.emitTapEvents(),this.constructor&&(this.name_=this.constructor.name||"Unknown Tech")}triggerSourceset(e){this.isReady_||this.one("ready",()=>this.setTimeout(()=>this.triggerSourceset(e),1)),this.trigger({src:e,type:"sourceset"})}manualProgressOn(){this.on("durationchange",this.onDurationChange_),this.manualProgress=!0,this.one("ready",this.trackProgress_)}manualProgressOff(){this.manualProgress=!1,this.stopTrackingProgress(),this.off("durationchange",this.onDurationChange_)}trackProgress(e){this.stopTrackingProgress(),this.progressInterval=this.setInterval(bn(this,function(){const i=this.bufferedPercent();this.bufferedPercent_!==i&&this.trigger("progress"),this.bufferedPercent_=i,i===1&&this.stopTrackingProgress()}),500)}onDurationChange(e){this.duration_=this.duration()}buffered(){return jo(0,0)}bufferedPercent(){return cP(this.buffered(),this.duration_)}stopTrackingProgress(){this.clearInterval(this.progressInterval)}manualTimeUpdatesOn(){this.manualTimeUpdates=!0,this.on("play",this.trackCurrentTime_),this.on("pause",this.stopTrackingCurrentTime_)}manualTimeUpdatesOff(){this.manualTimeUpdates=!1,this.stopTrackingCurrentTime(),this.off("play",this.trackCurrentTime_),this.off("pause",this.stopTrackingCurrentTime_)}trackCurrentTime(){this.currentTimeInterval&&this.stopTrackingCurrentTime(),this.currentTimeInterval=this.setInterval(function(){this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})},250)}stopTrackingCurrentTime(){this.clearInterval(this.currentTimeInterval),this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}dispose(){this.clearTracks(To.names),this.manualProgress&&this.manualProgressOff(),this.manualTimeUpdates&&this.manualTimeUpdatesOff(),super.dispose()}clearTracks(e){e=[].concat(e),e.forEach(i=>{const n=this[`${i}Tracks`]()||[];let r=n.length;for(;r--;){const s=n[r];i==="text"&&this.removeRemoteTextTrack(s),n.removeTrack(s)}})}cleanupAutoTextTracks(){const e=this.autoRemoteTextTracks_||[];let i=e.length;for(;i--;){const n=e[i];this.removeRemoteTextTrack(n)}}reset(){}crossOrigin(){}setCrossOrigin(){}error(e){return e!==void 0&&(this.error_=new Bn(e),this.trigger("error")),this.error_}played(){return this.hasStarted_?jo(0,0):jo()}play(){}setScrubbing(e){}scrubbing(){}setCurrentTime(e){this.manualTimeUpdates&&this.trigger({type:"timeupdate",target:this,manuallyTriggered:!0})}initTrackListeners(){To.names.forEach(e=>{const i=To[e],n=()=>{this.trigger(`${e}trackchange`)},r=this[i.getterName]();r.addEventListener("removetrack",n),r.addEventListener("addtrack",n),this.on("dispose",()=>{r.removeEventListener("removetrack",n),r.removeEventListener("addtrack",n)})})}addWebVttScript_(){if(!_e.WebVTT)if(mt.body.contains(this.el())){if(!this.options_["vtt.js"]&&Gd(l2)&&Object.keys(l2).length>0){this.trigger("vttjsloaded");return}const e=mt.createElement("script");e.src=this.options_["vtt.js"]||"https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",e.onload=()=>{this.trigger("vttjsloaded")},e.onerror=()=>{this.trigger("vttjserror")},this.on("dispose",()=>{e.onload=null,e.onerror=null}),_e.WebVTT=!0,this.el().parentNode.appendChild(e)}else this.ready(this.addWebVttScript_)}emulateTextTracks(){const e=this.textTracks(),i=this.remoteTextTracks(),n=u=>e.addTrack(u.track),r=u=>e.removeTrack(u.track);i.on("addtrack",n),i.on("removetrack",r),this.addWebVttScript_();const s=()=>this.trigger("texttrackchange"),o=()=>{s();for(let u=0;uthis.autoRemoteTextTracks_.addTrack(n.track)),n}removeRemoteTextTrack(e){const i=this.remoteTextTrackEls().getTrackElementByTrack_(e);this.remoteTextTrackEls().removeTrackElement_(i),this.remoteTextTracks().removeTrack(e),this.autoRemoteTextTracks_.removeTrack(e)}getVideoPlaybackQuality(){return{}}requestPictureInPicture(){return Promise.reject()}disablePictureInPicture(){return!0}setDisablePictureInPicture(){}requestVideoFrameCallback(e){const i=_o();return!this.isReady_||this.paused()?(this.queuedHanders_.add(i),this.one("playing",()=>{this.queuedHanders_.has(i)&&(this.queuedHanders_.delete(i),e())})):this.requestNamedAnimationFrame(i,e),i}cancelVideoFrameCallback(e){this.queuedHanders_.has(e)?this.queuedHanders_.delete(e):this.cancelNamedAnimationFrame(e)}setPoster(){}playsinline(){}setPlaysinline(){}overrideNativeAudioTracks(e){}overrideNativeVideoTracks(e){}canPlayType(e){return""}static canPlayType(e){return""}static canPlaySource(e,i){return mi.canPlayType(e.type)}static isTech(e){return e.prototype instanceof mi||e instanceof mi||e===mi}static registerTech(e,i){if(mi.techs_||(mi.techs_={}),!mi.isTech(i))throw new Error(`Tech ${e} must be a Tech`);if(!mi.canPlayType)throw new Error("Techs must have a static canPlayType method on them");if(!mi.canPlaySource)throw new Error("Techs must have a static canPlaySource method on them");return e=qn(e),mi.techs_[e]=i,mi.techs_[Mp(e)]=i,e!=="Tech"&&mi.defaultTechOrder_.push(e),i}static getTech(e){if(e){if(mi.techs_&&mi.techs_[e])return mi.techs_[e];if(e=qn(e),_e&&_e.videojs&&_e.videojs[e])return xi.warn(`The ${e} tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)`),_e.videojs[e]}}}bs.names.forEach(function(t){const e=bs[t];mi.prototype[e.getterName]=function(){return this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName]}}),mi.prototype.featuresVolumeControl=!0,mi.prototype.featuresMuteControl=!0,mi.prototype.featuresFullscreenResize=!1,mi.prototype.featuresPlaybackRate=!1,mi.prototype.featuresProgressEvents=!1,mi.prototype.featuresSourceset=!1,mi.prototype.featuresTimeupdateEvents=!1,mi.prototype.featuresNativeTextTracks=!1,mi.prototype.featuresVideoFrameCallback=!1,mi.withSourceHandlers=function(t){t.registerSourceHandler=function(i,n){let r=t.sourceHandlers;r||(r=t.sourceHandlers=[]),n===void 0&&(n=r.length),r.splice(n,0,i)},t.canPlayType=function(i){const n=t.sourceHandlers||[];let r;for(let s=0;sxc(e,Tc[e.type],i,t),1)}function kW(t,e){t.forEach(i=>i.setTech&&i.setTech(e))}function IW(t,e,i){return t.reduceRight(fw(i),e[i]())}function RW(t,e,i,n){return e[i](t.reduce(fw(i),n))}function bP(t,e,i,n=null){const r="call"+qn(i),s=t.reduce(fw(r),n),o=s===Wy,u=o?null:e[i](s);return MW(t,i,u,o),u}const OW={buffered:1,currentTime:1,duration:1,muted:1,played:1,paused:1,seekable:1,volume:1,ended:1},LW={setCurrentTime:1,setMuted:1,setVolume:1},_P={play:1,pause:1};function fw(t){return(e,i)=>e===Wy?Wy:i[t]?i[t](e):e}function MW(t,e,i,n){for(let r=t.length-1;r>=0;r--){const s=t[r];s[e]&&s[e](n,i)}}function FW(t){jy.hasOwnProperty(t.id())&&delete jy[t.id()]}function NW(t,e){const i=jy[t.id()];let n=null;if(i==null)return n=e(t),jy[t.id()]=[[e,n]],n;for(let r=0;r{if(!e)return"";if(t.cache_.source.src===e&&t.cache_.source.type)return t.cache_.source.type;const i=t.cache_.sources.filter(r=>r.src===e);if(i.length)return i[0].type;const n=t.$$("source");for(let r=0;r `;const xP=Dy?10009:Py?461:8,rh={codes:{play:415,pause:19,ff:417,rw:412,back:xP},names:{415:"play",19:"pause",417:"ff",412:"rw",[xP]:"back"},isEventKey(t,e){return e=e.toLowerCase(),!!(this.names[t.keyCode]&&this.names[t.keyCode]===e)},getEventName(t){if(this.names[t.keyCode])return this.names[t.keyCode];if(this.codes[t.code]){const e=this.codes[t.code];return this.names[e]}return null}},SP=5;class zW extends $s{constructor(e){super(),this.player_=e,this.focusableComponents=[],this.isListening_=!1,this.isPaused_=!1,this.onKeyDown_=this.onKeyDown_.bind(this),this.lastFocusedComponent_=null}start(){this.isListening_||(this.player_.on("keydown",this.onKeyDown_),this.player_.on("modalKeydown",this.onKeyDown_),this.player_.on("loadedmetadata",()=>{this.focus(this.updateFocusableComponents()[0])}),this.player_.on("modalclose",()=>{this.refocusComponent()}),this.player_.on("focusin",this.handlePlayerFocus_.bind(this)),this.player_.on("focusout",this.handlePlayerBlur_.bind(this)),this.isListening_=!0,this.player_.errorDisplay&&this.player_.errorDisplay.on("aftermodalfill",()=>{this.updateFocusableComponents(),this.focusableComponents.length&&(this.focusableComponents.length>1?this.focusableComponents[1].focus():this.focusableComponents[0].focus())}))}stop(){this.player_.off("keydown",this.onKeyDown_),this.isListening_=!1}onKeyDown_(e){const i=e.originalEvent?e.originalEvent:e;if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(i.key)){if(this.isPaused_)return;i.preventDefault();const n=i.key.substring(5).toLowerCase();this.move(n)}else if(rh.isEventKey(i,"play")||rh.isEventKey(i,"pause")||rh.isEventKey(i,"ff")||rh.isEventKey(i,"rw")){i.preventDefault();const n=rh.getEventName(i);this.performMediaAction_(n)}else rh.isEventKey(i,"Back")&&e.target&&typeof e.target.closeable=="function"&&e.target.closeable()&&(i.preventDefault(),e.target.close())}performMediaAction_(e){if(this.player_)switch(e){case"play":this.player_.paused()&&this.player_.play();break;case"pause":this.player_.paused()||this.player_.pause();break;case"ff":this.userSeek_(this.player_.currentTime()+SP);break;case"rw":this.userSeek_(this.player_.currentTime()-SP);break}}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}pause(){this.isPaused_=!0}resume(){this.isPaused_=!1}handlePlayerBlur_(e){const i=e.relatedTarget;let n=null;const r=this.getCurrentComponent(e.target);i&&(n=!!i.closest(".video-js"),i.classList.contains("vjs-text-track-settings")&&!this.isPaused_&&this.searchForTrackSelect_()),(!e.currentTarget.contains(e.relatedTarget)&&!n||!i)&&(r&&r.name()==="CloseButton"?this.refocusComponent():(this.pause(),r&&r.el()&&(this.lastFocusedComponent_=r)))}handlePlayerFocus_(){this.getCurrentComponent()&&this.getCurrentComponent().getIsFocusable()&&this.resume()}updateFocusableComponents(){const e=this.player_,i=[];function n(r){for(const s of r)s.hasOwnProperty("el_")&&s.getIsFocusable()&&s.getIsAvailableToBeFocused(s.el())&&i.push(s),s.hasOwnProperty("children_")&&s.children_.length>0&&n(s.children_)}return e.children_.forEach(r=>{if(r.hasOwnProperty("el_"))if(r.getIsFocusable&&r.getIsAvailableToBeFocused&&r.getIsFocusable()&&r.getIsAvailableToBeFocused(r.el())){i.push(r);return}else r.hasOwnProperty("children_")&&r.children_.length>0?n(r.children_):r.hasOwnProperty("items")&&r.items.length>0?n(r.items):this.findSuitableDOMChild(r)&&i.push(r);if(r.name_==="ErrorDisplay"&&r.opened_){const s=r.el_.querySelector(".vjs-errors-ok-button-container");s&&s.querySelectorAll("button").forEach((u,h)=>{i.push({name:()=>"ModalButton"+(h+1),el:()=>u,getPositions:()=>{const p=u.getBoundingClientRect(),g={x:p.x,y:p.y,width:p.width,height:p.height,top:p.top,right:p.right,bottom:p.bottom,left:p.left},y={x:p.left+p.width/2,y:p.top+p.height/2,width:0,height:0,top:p.top+p.height/2,right:p.left+p.width/2,bottom:p.top+p.height/2,left:p.left+p.width/2};return{boundingClientRect:g,center:y}},getIsAvailableToBeFocused:()=>!0,getIsFocusable:p=>!0,focus:()=>u.focus()})})}}),this.focusableComponents=i,this.focusableComponents}findSuitableDOMChild(e){function i(n){if(e.getIsFocusable(n)&&e.getIsAvailableToBeFocused(n))return n;for(let r=0;r0&&(this.focusableComponents=[],this.trigger({type:"focusableComponentsChanged",focusableComponents:this.focusableComponents}))}move(e){const i=this.getCurrentComponent();if(!i)return;const n=i.getPositions(),r=this.focusableComponents.filter(o=>o!==i&&this.isInDirection_(n.boundingClientRect,o.getPositions().boundingClientRect,e)),s=this.findBestCandidate_(n.center,r,e);s?this.focus(s):this.trigger({type:"endOfFocusableComponents",direction:e,focusedComponent:i})}findBestCandidate_(e,i,n){let r=1/0,s=null;for(const o of i){const u=o.getPositions().center,h=this.calculateDistance_(e,u,n);h=e.right;case"left":return i.right<=e.left;case"down":return i.top>=e.bottom;case"up":return i.bottom<=e.top;default:return!1}}refocusComponent(){if(this.lastFocusedComponent_){this.player_.userActive()||this.player_.userActive(!0),this.updateFocusableComponents();for(let e=0;ethis.handleMouseOver(n),this.handleMouseOut_=n=>this.handleMouseOut(n),this.handleClick_=n=>this.handleClick(n),this.handleKeyDown_=n=>this.handleKeyDown(n),this.emitTapEvents(),this.enable()}createEl(e="div",i={},n={}){i=Object.assign({className:this.buildCSSClass(),tabIndex:0},i),e==="button"&&xi.error(`Creating a ClickableComponent with an HTML element of ${e} is not supported; use a Button instead.`),n=Object.assign({role:"button"},n),this.tabIndex_=i.tabIndex;const r=$t(e,i,n);return this.player_.options_.experimentalSvgIcons||r.appendChild($t("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),this.createControlTextEl(r),r}dispose(){this.controlTextEl_=null,super.dispose()}createControlTextEl(e){return this.controlTextEl_=$t("span",{className:"vjs-control-text"},{"aria-live":"polite"}),e&&e.appendChild(this.controlTextEl_),this.controlText(this.controlText_,e),this.controlTextEl_}controlText(e,i=this.el()){if(e===void 0)return this.controlText_||"Need Text";const n=this.localize(e);this.controlText_=e,mu(this.controlTextEl_,n),!this.nonIconControl&&!this.player_.options_.noUITitleAttributes&&i.setAttribute("title",n)}buildCSSClass(){return`vjs-control vjs-button ${super.buildCSSClass()}`}enable(){this.enabled_||(this.enabled_=!0,this.removeClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","false"),typeof this.tabIndex_<"u"&&this.el_.setAttribute("tabIndex",this.tabIndex_),this.on(["tap","click"],this.handleClick_),this.on("keydown",this.handleKeyDown_))}disable(){this.enabled_=!1,this.addClass("vjs-disabled"),this.el_.setAttribute("aria-disabled","true"),typeof this.tabIndex_<"u"&&this.el_.removeAttribute("tabIndex"),this.off("mouseover",this.handleMouseOver_),this.off("mouseout",this.handleMouseOut_),this.off(["tap","click"],this.handleClick_),this.off("keydown",this.handleKeyDown_)}handleLanguagechange(){this.controlText(this.controlText_)}handleClick(e){this.options_.clickHandler&&this.options_.clickHandler.call(this,arguments)}handleKeyDown(e){e.key===" "||e.key==="Enter"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}Xe.registerComponent("ClickableComponent",Gy);class pw extends Gy{constructor(e,i){super(e,i),this.update(),this.update_=n=>this.update(n),e.on("posterchange",this.update_)}dispose(){this.player().off("posterchange",this.update_),super.dispose()}createEl(){return $t("div",{className:"vjs-poster"})}crossOrigin(e){if(typeof e>"u")return this.$("img")?this.$("img").crossOrigin:this.player_.tech_&&this.player_.tech_.isReady_?this.player_.crossOrigin():this.player_.options_.crossOrigin||this.player_.options_.crossorigin||null;if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){this.player_.log.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.$("img")&&(this.$("img").crossOrigin=e)}update(e){const i=this.player().poster();this.setSrc(i),i?this.show():this.hide()}setSrc(e){if(!e){this.el_.textContent="";return}this.$("img")||this.el_.appendChild($t("picture",{className:"vjs-poster",tabIndex:-1},{},$t("img",{loading:"lazy",crossOrigin:this.crossOrigin()},{alt:""}))),this.$("img").src=e}handleClick(e){this.player_.controls()&&(this.player_.tech(!0)&&this.player_.tech(!0).focus(),this.player_.paused()?xa(this.player_.play()):this.player_.pause())}}pw.prototype.crossorigin=pw.prototype.crossOrigin,Xe.registerComponent("PosterImage",pw);const xo="#222",EP="#ccc",jW={monospace:"monospace",sansSerif:"sans-serif",serif:"serif",monospaceSansSerif:'"Andale Mono", "Lucida Console", monospace',monospaceSerif:'"Courier New", monospace',proportionalSansSerif:"sans-serif",proportionalSerif:"serif",casual:'"Comic Sans MS", Impact, fantasy',script:'"Monotype Corsiva", cursive',smallcaps:'"Andale Mono", "Lucida Console", monospace, sans-serif'};function mw(t,e){let i;if(t.length===4)i=t[1]+t[1]+t[2]+t[2]+t[3]+t[3];else if(t.length===7)i=t.slice(1);else throw new Error("Invalid color code provided, "+t+"; must be formatted as e.g. #f0e or #f604e2.");return"rgba("+parseInt(i.slice(0,2),16)+","+parseInt(i.slice(2,4),16)+","+parseInt(i.slice(4,6),16)+","+e+")"}function Sa(t,e,i){try{t.style[e]=i}catch{return}}function CP(t){return t?`${t}px`:""}class WW extends Xe{constructor(e,i,n){super(e,i,n);const r=o=>this.updateDisplay(o),s=o=>{this.updateDisplayOverlay(),this.updateDisplay(o)};e.on("loadstart",o=>this.toggleDisplay(o)),e.on("texttrackchange",r),e.on("loadedmetadata",o=>{this.updateDisplayOverlay(),this.preselectTrack(o)}),e.ready(bn(this,function(){if(e.tech_&&e.tech_.featuresNativeTextTracks){this.hide();return}e.on("fullscreenchange",s),e.on("playerresize",s);const o=_e.screen.orientation||_e,u=_e.screen.orientation?"change":"orientationchange";o.addEventListener(u,s),e.on("dispose",()=>o.removeEventListener(u,s));const h=this.options_.playerOptions.tracks||[];for(let p=0;p0&&u.forEach(g=>{if(g.style.inset){const y=g.style.inset.split(" ");y.length===3&&Object.assign(g.style,{top:y[0],right:y[1],bottom:y[2],left:"unset"})}})}}updateDisplayOverlay(){if(!this.player_.videoHeight()||!_e.CSS.supports("inset-inline: 10px"))return;const e=this.player_.currentWidth(),i=this.player_.currentHeight(),n=e/i,r=this.player_.videoWidth()/this.player_.videoHeight();let s=0,o=0;Math.abs(n-r)>.1&&(n>r?s=Math.round((e-i*r)/2):o=Math.round((i-e/r)/2)),Sa(this.el_,"insetInline",CP(s)),Sa(this.el_,"insetBlock",CP(o))}updateDisplayState(e){const i=this.player_.textTrackSettings.getValues(),n=e.activeCues;let r=n.length;for(;r--;){const s=n[r];if(!s)continue;const o=s.displayState;if(i.color&&(o.firstChild.style.color=i.color),i.textOpacity&&Sa(o.firstChild,"color",mw(i.color||"#fff",i.textOpacity)),i.backgroundColor&&(o.firstChild.style.backgroundColor=i.backgroundColor),i.backgroundOpacity&&Sa(o.firstChild,"backgroundColor",mw(i.backgroundColor||"#000",i.backgroundOpacity)),i.windowColor&&(i.windowOpacity?Sa(o,"backgroundColor",mw(i.windowColor,i.windowOpacity)):o.style.backgroundColor=i.windowColor),i.edgeStyle&&(i.edgeStyle==="dropshadow"?o.firstChild.style.textShadow=`2px 2px 3px ${xo}, 2px 2px 4px ${xo}, 2px 2px 5px ${xo}`:i.edgeStyle==="raised"?o.firstChild.style.textShadow=`1px 1px ${xo}, 2px 2px ${xo}, 3px 3px ${xo}`:i.edgeStyle==="depressed"?o.firstChild.style.textShadow=`1px 1px ${EP}, 0 1px ${EP}, -1px -1px ${xo}, 0 -1px ${xo}`:i.edgeStyle==="uniform"&&(o.firstChild.style.textShadow=`0 0 4px ${xo}, 0 0 4px ${xo}, 0 0 4px ${xo}, 0 0 4px ${xo}`)),i.fontPercent&&i.fontPercent!==1){const u=_e.parseFloat(o.style.fontSize);o.style.fontSize=u*i.fontPercent+"px",o.style.height="auto",o.style.top="auto"}i.fontFamily&&i.fontFamily!=="default"&&(i.fontFamily==="small-caps"?o.firstChild.style.fontVariant="small-caps":o.firstChild.style.fontFamily=jW[i.fontFamily])}}updateForTrack(e){if(Array.isArray(e)||(e=[e]),typeof _e.WebVTT!="function"||e.every(n=>!n.activeCues))return;const i=[];for(let n=0;nthis.handleMouseDown(n))}buildCSSClass(){return"vjs-big-play-button"}handleClick(e){const i=this.player_.play();if(this.mouseused_&&"clientX"in e&&"clientY"in e){xa(i),this.player_.tech(!0)&&this.player_.tech(!0).focus();return}const n=this.player_.getChild("controlBar"),r=n&&n.getChild("playToggle");if(!r){this.player_.tech(!0).focus();return}const s=()=>r.focus();Fp(i)?i.then(s,()=>{}):this.setTimeout(s,1)}handleKeyDown(e){this.mouseused_=!1,super.handleKeyDown(e)}handleMouseDown(e){this.mouseused_=!0}}AP.prototype.controlText_="Play Video",Xe.registerComponent("BigPlayButton",AP);class GW extends es{constructor(e,i){super(e,i),this.setIcon("cancel"),this.controlText(i&&i.controlText||this.localize("Close"))}buildCSSClass(){return`vjs-close-button ${super.buildCSSClass()}`}handleClick(e){this.trigger({type:"close",bubbles:!1})}handleKeyDown(e){e.key==="Escape"?(e.preventDefault(),e.stopPropagation(),this.trigger("click")):super.handleKeyDown(e)}}Xe.registerComponent("CloseButton",GW);class DP extends es{constructor(e,i={}){super(e,i),i.replay=i.replay===void 0||i.replay,this.setIcon("play"),this.on(e,"play",n=>this.handlePlay(n)),this.on(e,"pause",n=>this.handlePause(n)),i.replay&&this.on(e,"ended",n=>this.handleEnded(n))}buildCSSClass(){return`vjs-play-control ${super.buildCSSClass()}`}handleClick(e){this.player_.paused()?xa(this.player_.play()):this.player_.pause()}handleSeeked(e){this.removeClass("vjs-ended"),this.player_.paused()?this.handlePause(e):this.handlePlay(e)}handlePlay(e){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.setIcon("pause"),this.controlText("Pause")}handlePause(e){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.setIcon("play"),this.controlText("Play")}handleEnded(e){this.removeClass("vjs-playing"),this.addClass("vjs-ended"),this.setIcon("replay"),this.controlText("Replay"),this.one(this.player_,"seeked",i=>this.handleSeeked(i))}}DP.prototype.controlText_="Play",Xe.registerComponent("PlayToggle",DP);class sh extends Xe{constructor(e,i){super(e,i),this.on(e,["timeupdate","ended","seeking"],n=>this.update(n)),this.updateTextNode_()}createEl(){const e=this.buildCSSClass(),i=super.createEl("div",{className:`${e} vjs-time-control vjs-control`}),n=$t("span",{className:"vjs-control-text",textContent:`${this.localize(this.labelText_)} `},{role:"presentation"});return i.appendChild(n),this.contentEl_=$t("span",{className:`${e}-display`},{role:"presentation"}),i.appendChild(this.contentEl_),i}dispose(){this.contentEl_=null,this.textNode_=null,super.dispose()}update(e){!this.player_.options_.enableSmoothSeeking&&e.type==="seeking"||this.updateContent(e)}updateTextNode_(e=0){e=wc(e),this.formattedTime_!==e&&(this.formattedTime_=e,this.requestNamedAnimationFrame("TimeDisplay#updateTextNode_",()=>{if(!this.contentEl_)return;let i=this.textNode_;i&&this.contentEl_.firstChild!==i&&(i=null,xi.warn("TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.")),this.textNode_=mt.createTextNode(this.formattedTime_),this.textNode_&&(i?this.contentEl_.replaceChild(this.textNode_,i):this.contentEl_.appendChild(this.textNode_))}))}updateContent(e){}}sh.prototype.labelText_="Time",sh.prototype.controlText_="Time",Xe.registerComponent("TimeDisplay",sh);class gw extends sh{buildCSSClass(){return"vjs-current-time"}updateContent(e){let i;this.player_.ended()?i=this.player_.duration():i=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime(),this.updateTextNode_(i)}}gw.prototype.labelText_="Current Time",gw.prototype.controlText_="Current Time",Xe.registerComponent("CurrentTimeDisplay",gw);class yw extends sh{constructor(e,i){super(e,i);const n=r=>this.updateContent(r);this.on(e,"durationchange",n),this.on(e,"loadstart",n),this.on(e,"loadedmetadata",n)}buildCSSClass(){return"vjs-duration"}updateContent(e){const i=this.player_.duration();this.updateTextNode_(i)}}yw.prototype.labelText_="Duration",yw.prototype.controlText_="Duration",Xe.registerComponent("DurationDisplay",yw);class KW extends Xe{createEl(){const e=super.createEl("div",{className:"vjs-time-control vjs-time-divider"},{"aria-hidden":!0}),i=super.createEl("div"),n=super.createEl("span",{textContent:"/"});return i.appendChild(n),e.appendChild(i),e}}Xe.registerComponent("TimeDivider",KW);class vw extends sh{constructor(e,i){super(e,i),this.on(e,"durationchange",n=>this.updateContent(n))}buildCSSClass(){return"vjs-remaining-time"}createEl(){const e=super.createEl();return this.options_.displayNegative!==!1&&e.insertBefore($t("span",{},{"aria-hidden":!0},"-"),this.contentEl_),e}updateContent(e){if(typeof this.player_.duration()!="number")return;let i;this.player_.ended()?i=0:this.player_.remainingTimeDisplay?i=this.player_.remainingTimeDisplay():i=this.player_.remainingTime(),this.updateTextNode_(i)}}vw.prototype.labelText_="Remaining Time",vw.prototype.controlText_="Remaining Time",Xe.registerComponent("RemainingTimeDisplay",vw);class YW extends Xe{constructor(e,i){super(e,i),this.updateShowing(),this.on(this.player(),"durationchange",n=>this.updateShowing(n))}createEl(){const e=super.createEl("div",{className:"vjs-live-control vjs-control"});return this.contentEl_=$t("div",{className:"vjs-live-display"},{"aria-live":"off"}),this.contentEl_.appendChild($t("span",{className:"vjs-control-text",textContent:`${this.localize("Stream Type")} `})),this.contentEl_.appendChild(mt.createTextNode(this.localize("LIVE"))),e.appendChild(this.contentEl_),e}dispose(){this.contentEl_=null,super.dispose()}updateShowing(e){this.player().duration()===1/0?this.show():this.hide()}}Xe.registerComponent("LiveDisplay",YW);class PP extends es{constructor(e,i){super(e,i),this.updateLiveEdgeStatus(),this.player_.liveTracker&&(this.updateLiveEdgeStatusHandler_=n=>this.updateLiveEdgeStatus(n),this.on(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_))}createEl(){const e=super.createEl("button",{className:"vjs-seek-to-live-control vjs-control"});return this.setIcon("circle",e),this.textEl_=$t("span",{className:"vjs-seek-to-live-text",textContent:this.localize("LIVE")},{"aria-hidden":"true"}),e.appendChild(this.textEl_),e}updateLiveEdgeStatus(){!this.player_.liveTracker||this.player_.liveTracker.atLiveEdge()?(this.setAttribute("aria-disabled",!0),this.addClass("vjs-at-live-edge"),this.controlText("Seek to live, currently playing live")):(this.setAttribute("aria-disabled",!1),this.removeClass("vjs-at-live-edge"),this.controlText("Seek to live, currently behind live"))}handleClick(){this.player_.liveTracker.seekToLiveEdge()}dispose(){this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.updateLiveEdgeStatusHandler_),this.textEl_=null,super.dispose()}}PP.prototype.controlText_="Seek to live, currently playing live",Xe.registerComponent("SeekToLive",PP);function Bp(t,e,i){return t=Number(t),Math.min(i,Math.max(e,isNaN(t)?e:t))}var XW=Object.freeze({__proto__:null,clamp:Bp});class bw extends Xe{constructor(e,i){super(e,i),this.handleMouseDown_=n=>this.handleMouseDown(n),this.handleMouseUp_=n=>this.handleMouseUp(n),this.handleKeyDown_=n=>this.handleKeyDown(n),this.handleClick_=n=>this.handleClick(n),this.handleMouseMove_=n=>this.handleMouseMove(n),this.update_=n=>this.update(n),this.bar=this.getChild(this.options_.barName),this.vertical(!!this.options_.vertical),this.enable()}enabled(){return this.enabled_}enable(){this.enabled()||(this.on("mousedown",this.handleMouseDown_),this.on("touchstart",this.handleMouseDown_),this.on("keydown",this.handleKeyDown_),this.on("click",this.handleClick_),this.on(this.player_,"controlsvisible",this.update),this.playerEvent&&this.on(this.player_,this.playerEvent,this.update),this.removeClass("disabled"),this.setAttribute("tabindex",0),this.enabled_=!0)}disable(){if(!this.enabled())return;const e=this.bar.el_.ownerDocument;this.off("mousedown",this.handleMouseDown_),this.off("touchstart",this.handleMouseDown_),this.off("keydown",this.handleKeyDown_),this.off("click",this.handleClick_),this.off(this.player_,"controlsvisible",this.update_),this.off(e,"mousemove",this.handleMouseMove_),this.off(e,"mouseup",this.handleMouseUp_),this.off(e,"touchmove",this.handleMouseMove_),this.off(e,"touchend",this.handleMouseUp_),this.removeAttribute("tabindex"),this.addClass("disabled"),this.playerEvent&&this.off(this.player_,this.playerEvent,this.update),this.enabled_=!1}createEl(e,i={},n={}){return i.className=i.className+" vjs-slider",i=Object.assign({tabIndex:0},i),n=Object.assign({role:"slider","aria-valuenow":0,"aria-valuemin":0,"aria-valuemax":100},n),super.createEl(e,i,n)}handleMouseDown(e){const i=this.bar.el_.ownerDocument;e.type==="mousedown"&&e.preventDefault(),e.type==="touchstart"&&!wa&&e.preventDefault(),jD(),this.addClass("vjs-sliding"),this.trigger("slideractive"),this.on(i,"mousemove",this.handleMouseMove_),this.on(i,"mouseup",this.handleMouseUp_),this.on(i,"touchmove",this.handleMouseMove_),this.on(i,"touchend",this.handleMouseUp_),this.handleMouseMove(e,!0)}handleMouseMove(e){}handleMouseUp(e){const i=this.bar.el_.ownerDocument;WD(),this.removeClass("vjs-sliding"),this.trigger("sliderinactive"),this.off(i,"mousemove",this.handleMouseMove_),this.off(i,"mouseup",this.handleMouseUp_),this.off(i,"touchmove",this.handleMouseMove_),this.off(i,"touchend",this.handleMouseUp_),this.update()}update(){if(!this.el_||!this.bar)return;const e=this.getProgress();return e===this.progress_||(this.progress_=e,this.requestNamedAnimationFrame("Slider#update",()=>{const i=this.vertical()?"height":"width";this.bar.el().style[i]=(e*100).toFixed(2)+"%"})),e}getProgress(){return Number(Bp(this.getPercent(),0,1).toFixed(4))}calculateDistance(e){const i=Ly(this.el_,e);return this.vertical()?i.y:i.x}handleKeyDown(e){const i=this.options_.playerOptions.spatialNavigation,n=i&&i.enabled,r=i&&i.horizontalSeek;n?r&&e.key==="ArrowLeft"||!r&&e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):r&&e.key==="ArrowRight"||!r&&e.key==="ArrowUp"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e):e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepBack()):e.key==="ArrowUp"||e.key==="ArrowRight"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):super.handleKeyDown(e)}handleClick(e){e.stopPropagation(),e.preventDefault()}vertical(e){if(e===void 0)return this.vertical_||!1;this.vertical_=!!e,this.vertical_?this.addClass("vjs-slider-vertical"):this.addClass("vjs-slider-horizontal")}}Xe.registerComponent("Slider",bw);const _w=(t,e)=>Bp(t/e*100,0,100).toFixed(2)+"%";class ZW extends Xe{constructor(e,i){super(e,i),this.partEls_=[],this.on(e,"progress",n=>this.update(n))}createEl(){const e=super.createEl("div",{className:"vjs-load-progress"}),i=$t("span",{className:"vjs-control-text"}),n=$t("span",{textContent:this.localize("Loaded")}),r=mt.createTextNode(": ");return this.percentageEl_=$t("span",{className:"vjs-control-text-loaded-percentage",textContent:"0%"}),e.appendChild(i),i.appendChild(n),i.appendChild(r),i.appendChild(this.percentageEl_),e}dispose(){this.partEls_=null,this.percentageEl_=null,super.dispose()}update(e){this.requestNamedAnimationFrame("LoadProgressBar#update",()=>{const i=this.player_.liveTracker,n=this.player_.buffered(),r=i&&i.isLive()?i.seekableEnd():this.player_.duration(),s=this.player_.bufferedEnd(),o=this.partEls_,u=_w(s,r);this.percent_!==u&&(this.el_.style.width=u,mu(this.percentageEl_,u),this.percent_=u);for(let h=0;hn.length;h--)this.el_.removeChild(o[h-1]);o.length=n.length})}}Xe.registerComponent("LoadProgressBar",ZW);class QW extends Xe{constructor(e,i){super(e,i),this.update=Ta(bn(this,this.update),wo)}createEl(){return super.createEl("div",{className:"vjs-time-tooltip"},{"aria-hidden":"true"})}update(e,i,n){const r=Rp(this.el_),s=Jd(this.player_.el()),o=e.width*i;if(!s||!r)return;let u=e.left-s.left+o,h=e.width-o+(s.right-e.right);h||(h=e.width-o,u=o);let p=r.width/2;ur.width&&(p=r.width),p=Math.round(p),this.el_.style.right=`-${p}px`,this.write(n)}write(e){mu(this.el_,e)}updateTime(e,i,n,r){this.requestNamedAnimationFrame("TimeTooltip#updateTime",()=>{let s;const o=this.player_.duration();if(this.player_.liveTracker&&this.player_.liveTracker.isLive()){const u=this.player_.liveTracker.liveWindow(),h=u-i*u;s=(h<1?"":"-")+wc(h,u)}else s=wc(n,o);this.update(e,i,s),r&&r()})}}Xe.registerComponent("TimeTooltip",QW);class ww extends Xe{constructor(e,i){super(e,i),this.setIcon("circle"),this.update=Ta(bn(this,this.update),wo)}createEl(){return super.createEl("div",{className:"vjs-play-progress vjs-slider-bar"},{"aria-hidden":"true"})}update(e,i){const n=this.getChild("timeTooltip");if(!n)return;const r=this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime();n.updateTime(e,i,r)}}ww.prototype.options_={children:[]},!Jr&&!Vo&&ww.prototype.options_.children.push("timeTooltip"),Xe.registerComponent("PlayProgressBar",ww);class kP extends Xe{constructor(e,i){super(e,i),this.update=Ta(bn(this,this.update),wo)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,i){const n=i*this.player_.duration();this.getChild("timeTooltip").updateTime(e,i,n,()=>{this.el_.style.left=`${e.width*i}px`})}}kP.prototype.options_={children:["timeTooltip"]},Xe.registerComponent("MouseTimeDisplay",kP);class Ky extends bw{constructor(e,i){i=ln(Ky.prototype.options_,i),i.children=[...i.children];const n=e.options_.disableSeekWhileScrubbingOnMobile&&(Jr||Vo);(!Jr&&!Vo||n)&&i.children.splice(1,0,"mouseTimeDisplay"),super(e,i),this.shouldDisableSeekWhileScrubbingOnMobile_=n,this.pendingSeekTime_=null,this.setEventHandlers_()}setEventHandlers_(){this.update_=bn(this,this.update),this.update=Ta(this.update_,wo),this.on(this.player_,["durationchange","timeupdate"],this.update),this.on(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.on(this.player_.liveTracker,"liveedgechange",this.update),this.updateInterval=null,this.enableIntervalHandler_=e=>this.enableInterval_(e),this.disableIntervalHandler_=e=>this.disableInterval_(e),this.on(this.player_,["playing"],this.enableIntervalHandler_),this.on(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in mt&&"visibilityState"in mt&&this.on(mt,"visibilitychange",this.toggleVisibility_)}toggleVisibility_(e){mt.visibilityState==="hidden"?(this.cancelNamedAnimationFrame("SeekBar#update"),this.cancelNamedAnimationFrame("Slider#update"),this.disableInterval_(e)):(!this.player_.ended()&&!this.player_.paused()&&this.enableInterval_(),this.update())}enableInterval_(){this.updateInterval||(this.updateInterval=this.setInterval(this.update,wo))}disableInterval_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&e&&e.type!=="ended"||this.updateInterval&&(this.clearInterval(this.updateInterval),this.updateInterval=null)}createEl(){return super.createEl("div",{className:"vjs-progress-holder"},{"aria-label":this.localize("Progress Bar")})}update(e){if(mt.visibilityState==="hidden")return;const i=super.update();return this.requestNamedAnimationFrame("SeekBar#update",()=>{const n=this.player_.ended()?this.player_.duration():this.getCurrentTime_(),r=this.player_.liveTracker;let s=this.player_.duration();r&&r.isLive()&&(s=this.player_.liveTracker.liveCurrentTime()),this.percent_!==i&&(this.el_.setAttribute("aria-valuenow",(i*100).toFixed(2)),this.percent_=i),(this.currentTime_!==n||this.duration_!==s)&&(this.el_.setAttribute("aria-valuetext",this.localize("progress bar timing: currentTime={1} duration={2}",[wc(n,s),wc(s,s)],"{1} of {2}")),this.currentTime_=n,this.duration_=s),this.bar&&this.bar.update(Jd(this.el()),this.getProgress())}),i}userSeek_(e){this.player_.liveTracker&&this.player_.liveTracker.isLive()&&this.player_.liveTracker.nextSeekedFromUser(),this.player_.currentTime(e)}getCurrentTime_(){return this.player_.scrubbing()?this.player_.getCache().currentTime:this.player_.currentTime()}getPercent(){if(this.pendingSeekTime_)return this.pendingSeekTime_/this.player_.duration();const e=this.getCurrentTime_();let i;const n=this.player_.liveTracker;return n&&n.isLive()?(i=(e-n.seekableStart())/n.liveWindow(),n.atLiveEdge()&&(i=1)):i=e/this.player_.duration(),i}handleMouseDown(e){Op(e)&&(e.stopPropagation(),this.videoWasPlaying=!this.player_.paused(),this.shouldDisableSeekWhileScrubbingOnMobile_||this.player_.pause(),super.handleMouseDown(e))}handleMouseMove(e,i=!1){if(!Op(e)||isNaN(this.player_.duration()))return;!i&&!this.player_.scrubbing()&&this.player_.scrubbing(!0);let n;const r=this.calculateDistance(e),s=this.player_.liveTracker;if(!s||!s.isLive())n=r*this.player_.duration(),n===this.player_.duration()&&(n=n-.1);else{if(r>=.99){s.seekToLiveEdge();return}const o=s.seekableStart(),u=s.liveCurrentTime();if(n=o+r*s.liveWindow(),n>=u&&(n=u),n<=o&&(n=o+.1),n===1/0)return}this.shouldDisableSeekWhileScrubbingOnMobile_?this.pendingSeekTime_=n:this.userSeek_(n),this.player_.options_.enableSmoothSeeking&&this.update()}enable(){super.enable();const e=this.getChild("mouseTimeDisplay");e&&e.show()}disable(){super.disable();const e=this.getChild("mouseTimeDisplay");e&&e.hide()}handleMouseUp(e){super.handleMouseUp(e),e&&e.stopPropagation(),this.player_.scrubbing(!1),this.pendingSeekTime_&&(this.userSeek_(this.pendingSeekTime_),this.pendingSeekTime_=null),this.player_.trigger({type:"timeupdate",target:this,manuallyTriggered:!0}),this.videoWasPlaying?xa(this.player_.play()):this.update_()}stepForward(){this.userSeek_(this.player_.currentTime()+this.options().stepSeconds)}stepBack(){this.userSeek_(this.player_.currentTime()-this.options().stepSeconds)}handleAction(e){this.player_.paused()?this.player_.play():this.player_.pause()}handleKeyDown(e){const i=this.player_.liveTracker;if(e.key===" "||e.key==="Enter")e.preventDefault(),e.stopPropagation(),this.handleAction(e);else if(e.key==="Home")e.preventDefault(),e.stopPropagation(),this.userSeek_(0);else if(e.key==="End")e.preventDefault(),e.stopPropagation(),i&&i.isLive()?this.userSeek_(i.liveCurrentTime()):this.userSeek_(this.player_.duration());else if(/^[0-9]$/.test(e.key)){e.preventDefault(),e.stopPropagation();const n=parseInt(e.key,10)*.1;i&&i.isLive()?this.userSeek_(i.seekableStart()+i.liveWindow()*n):this.userSeek_(this.player_.duration()*n)}else e.key==="PageDown"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()-this.options().stepSeconds*this.options().pageMultiplier)):e.key==="PageUp"?(e.preventDefault(),e.stopPropagation(),this.userSeek_(this.player_.currentTime()+this.options().stepSeconds*this.options().pageMultiplier)):super.handleKeyDown(e)}dispose(){this.disableInterval_(),this.off(this.player_,["durationchange","timeupdate"],this.update),this.off(this.player_,["ended"],this.update_),this.player_.liveTracker&&this.off(this.player_.liveTracker,"liveedgechange",this.update),this.off(this.player_,["playing"],this.enableIntervalHandler_),this.off(this.player_,["ended","pause","waiting"],this.disableIntervalHandler_),"hidden"in mt&&"visibilityState"in mt&&this.off(mt,"visibilitychange",this.toggleVisibility_),super.dispose()}}Ky.prototype.options_={children:["loadProgressBar","playProgressBar"],barName:"playProgressBar",stepSeconds:5,pageMultiplier:12},Xe.registerComponent("SeekBar",Ky);class IP extends Xe{constructor(e,i){super(e,i),this.handleMouseMove=Ta(bn(this,this.handleMouseMove),wo),this.throttledHandleMouseSeek=Ta(bn(this,this.handleMouseSeek),wo),this.handleMouseUpHandler_=n=>this.handleMouseUp(n),this.handleMouseDownHandler_=n=>this.handleMouseDown(n),this.enable()}createEl(){return super.createEl("div",{className:"vjs-progress-control vjs-control"})}handleMouseMove(e){const i=this.getChild("seekBar");if(!i)return;const n=i.getChild("playProgressBar"),r=i.getChild("mouseTimeDisplay");if(!n&&!r)return;const s=i.el(),o=Rp(s);let u=Ly(s,e).x;u=Bp(u,0,1),r&&r.update(o,u),n&&n.update(o,i.getProgress())}handleMouseSeek(e){const i=this.getChild("seekBar");i&&i.handleMouseMove(e)}enabled(){return this.enabled_}disable(){if(this.children().forEach(e=>e.disable&&e.disable()),!!this.enabled()&&(this.off(["mousedown","touchstart"],this.handleMouseDownHandler_),this.off(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeListenersAddedOnMousedownAndTouchstart(),this.addClass("disabled"),this.enabled_=!1,this.player_.scrubbing())){const e=this.getChild("seekBar");this.player_.scrubbing(!1),e.videoWasPlaying&&xa(this.player_.play())}}enable(){this.children().forEach(e=>e.enable&&e.enable()),!this.enabled()&&(this.on(["mousedown","touchstart"],this.handleMouseDownHandler_),this.on(this.el_,["mousemove","touchmove"],this.handleMouseMove),this.removeClass("disabled"),this.enabled_=!0)}removeListenersAddedOnMousedownAndTouchstart(){const e=this.el_.ownerDocument;this.off(e,"mousemove",this.throttledHandleMouseSeek),this.off(e,"touchmove",this.throttledHandleMouseSeek),this.off(e,"mouseup",this.handleMouseUpHandler_),this.off(e,"touchend",this.handleMouseUpHandler_)}handleMouseDown(e){const i=this.el_.ownerDocument,n=this.getChild("seekBar");n&&n.handleMouseDown(e),this.on(i,"mousemove",this.throttledHandleMouseSeek),this.on(i,"touchmove",this.throttledHandleMouseSeek),this.on(i,"mouseup",this.handleMouseUpHandler_),this.on(i,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const i=this.getChild("seekBar");i&&i.handleMouseUp(e),this.removeListenersAddedOnMousedownAndTouchstart()}}IP.prototype.options_={children:["seekBar"]},Xe.registerComponent("ProgressControl",IP);class RP extends es{constructor(e,i){super(e,i),this.setIcon("picture-in-picture-enter"),this.on(e,["enterpictureinpicture","leavepictureinpicture"],n=>this.handlePictureInPictureChange(n)),this.on(e,["disablepictureinpicturechanged","loadedmetadata"],n=>this.handlePictureInPictureEnabledChange(n)),this.on(e,["loadedmetadata","audioonlymodechange","audiopostermodechange"],()=>this.handlePictureInPictureAudioModeChange()),this.disable()}buildCSSClass(){return`vjs-picture-in-picture-control vjs-hidden ${super.buildCSSClass()}`}handlePictureInPictureAudioModeChange(){if(!(this.player_.currentType().substring(0,5)==="audio"||this.player_.audioPosterMode()||this.player_.audioOnlyMode())){this.show();return}this.player_.isInPictureInPicture()&&this.player_.exitPictureInPicture(),this.hide()}handlePictureInPictureEnabledChange(){mt.pictureInPictureEnabled&&this.player_.disablePictureInPicture()===!1||this.player_.options_.enableDocumentPictureInPicture&&"documentPictureInPicture"in _e?this.enable():this.disable()}handlePictureInPictureChange(e){this.player_.isInPictureInPicture()?(this.setIcon("picture-in-picture-exit"),this.controlText("Exit Picture-in-Picture")):(this.setIcon("picture-in-picture-enter"),this.controlText("Picture-in-Picture")),this.handlePictureInPictureEnabledChange()}handleClick(e){this.player_.isInPictureInPicture()?this.player_.exitPictureInPicture():this.player_.requestPictureInPicture()}show(){typeof mt.exitPictureInPicture=="function"&&super.show()}}RP.prototype.controlText_="Picture-in-Picture",Xe.registerComponent("PictureInPictureToggle",RP);class OP extends es{constructor(e,i){super(e,i),this.setIcon("fullscreen-enter"),this.on(e,"fullscreenchange",n=>this.handleFullscreenChange(n)),mt[e.fsApi_.fullscreenEnabled]===!1&&this.disable()}buildCSSClass(){return`vjs-fullscreen-control ${super.buildCSSClass()}`}handleFullscreenChange(e){this.player_.isFullscreen()?(this.controlText("Exit Fullscreen"),this.setIcon("fullscreen-exit")):(this.controlText("Fullscreen"),this.setIcon("fullscreen-enter"))}handleClick(e){this.player_.isFullscreen()?this.player_.exitFullscreen():this.player_.requestFullscreen()}}OP.prototype.controlText_="Fullscreen",Xe.registerComponent("FullscreenToggle",OP);const JW=function(t,e){e.tech_&&!e.tech_.featuresVolumeControl&&t.addClass("vjs-hidden"),t.on(e,"loadstart",function(){e.tech_.featuresVolumeControl?t.removeClass("vjs-hidden"):t.addClass("vjs-hidden")})};class $W extends Xe{createEl(){const e=super.createEl("div",{className:"vjs-volume-level"});return this.setIcon("circle",e),e.appendChild(super.createEl("span",{className:"vjs-control-text"})),e}}Xe.registerComponent("VolumeLevel",$W);class eq extends Xe{constructor(e,i){super(e,i),this.update=Ta(bn(this,this.update),wo)}createEl(){return super.createEl("div",{className:"vjs-volume-tooltip"},{"aria-hidden":"true"})}update(e,i,n,r){if(!n){const s=Jd(this.el_),o=Jd(this.player_.el()),u=e.width*i;if(!o||!s)return;const h=e.left-o.left+u,p=e.width-u+(o.right-e.right);let g=s.width/2;hs.width&&(g=s.width),this.el_.style.right=`-${g}px`}this.write(`${r}%`)}write(e){mu(this.el_,e)}updateVolume(e,i,n,r,s){this.requestNamedAnimationFrame("VolumeLevelTooltip#updateVolume",()=>{this.update(e,i,n,r.toFixed(0)),s&&s()})}}Xe.registerComponent("VolumeLevelTooltip",eq);class LP extends Xe{constructor(e,i){super(e,i),this.update=Ta(bn(this,this.update),wo)}createEl(){return super.createEl("div",{className:"vjs-mouse-display"})}update(e,i,n){const r=100*i;this.getChild("volumeLevelTooltip").updateVolume(e,i,n,r,()=>{n?this.el_.style.bottom=`${e.height*i}px`:this.el_.style.left=`${e.width*i}px`})}}LP.prototype.options_={children:["volumeLevelTooltip"]},Xe.registerComponent("MouseVolumeLevelDisplay",LP);class Yy extends bw{constructor(e,i){super(e,i),this.on("slideractive",n=>this.updateLastVolume_(n)),this.on(e,"volumechange",n=>this.updateARIAAttributes(n)),e.ready(()=>this.updateARIAAttributes())}createEl(){return super.createEl("div",{className:"vjs-volume-bar vjs-slider-bar"},{"aria-label":this.localize("Volume Level"),"aria-live":"polite"})}handleMouseDown(e){Op(e)&&super.handleMouseDown(e)}handleMouseMove(e){const i=this.getChild("mouseVolumeLevelDisplay");if(i){const n=this.el(),r=Jd(n),s=this.vertical();let o=Ly(n,e);o=s?o.y:o.x,o=Bp(o,0,1),i.update(r,o,s)}Op(e)&&(this.checkMuted(),this.player_.volume(this.calculateDistance(e)))}checkMuted(){this.player_.muted()&&this.player_.muted(!1)}getPercent(){return this.player_.muted()?0:this.player_.volume()}stepForward(){this.checkMuted(),this.player_.volume(this.player_.volume()+.1)}stepBack(){this.checkMuted(),this.player_.volume(this.player_.volume()-.1)}updateARIAAttributes(e){const i=this.player_.muted()?0:this.volumeAsPercentage_();this.el_.setAttribute("aria-valuenow",i),this.el_.setAttribute("aria-valuetext",i+"%")}volumeAsPercentage_(){return Math.round(this.player_.volume()*100)}updateLastVolume_(){const e=this.player_.volume();this.one("sliderinactive",()=>{this.player_.volume()===0&&this.player_.lastVolume_(e)})}}Yy.prototype.options_={children:["volumeLevel"],barName:"volumeLevel"},!Jr&&!Vo&&Yy.prototype.options_.children.splice(0,0,"mouseVolumeLevelDisplay"),Yy.prototype.playerEvent="volumechange",Xe.registerComponent("VolumeBar",Yy);class MP extends Xe{constructor(e,i={}){i.vertical=i.vertical||!1,(typeof i.volumeBar>"u"||Gd(i.volumeBar))&&(i.volumeBar=i.volumeBar||{},i.volumeBar.vertical=i.vertical),super(e,i),JW(this,e),this.throttledHandleMouseMove=Ta(bn(this,this.handleMouseMove),wo),this.handleMouseUpHandler_=n=>this.handleMouseUp(n),this.on("mousedown",n=>this.handleMouseDown(n)),this.on("touchstart",n=>this.handleMouseDown(n)),this.on("mousemove",n=>this.handleMouseMove(n)),this.on(this.volumeBar,["focus","slideractive"],()=>{this.volumeBar.addClass("vjs-slider-active"),this.addClass("vjs-slider-active"),this.trigger("slideractive")}),this.on(this.volumeBar,["blur","sliderinactive"],()=>{this.volumeBar.removeClass("vjs-slider-active"),this.removeClass("vjs-slider-active"),this.trigger("sliderinactive")})}createEl(){let e="vjs-volume-horizontal";return this.options_.vertical&&(e="vjs-volume-vertical"),super.createEl("div",{className:`vjs-volume-control vjs-control ${e}`})}handleMouseDown(e){const i=this.el_.ownerDocument;this.on(i,"mousemove",this.throttledHandleMouseMove),this.on(i,"touchmove",this.throttledHandleMouseMove),this.on(i,"mouseup",this.handleMouseUpHandler_),this.on(i,"touchend",this.handleMouseUpHandler_)}handleMouseUp(e){const i=this.el_.ownerDocument;this.off(i,"mousemove",this.throttledHandleMouseMove),this.off(i,"touchmove",this.throttledHandleMouseMove),this.off(i,"mouseup",this.handleMouseUpHandler_),this.off(i,"touchend",this.handleMouseUpHandler_)}handleMouseMove(e){this.volumeBar.handleMouseMove(e)}}MP.prototype.options_={children:["volumeBar"]},Xe.registerComponent("VolumeControl",MP);const tq=function(t,e){e.tech_&&!e.tech_.featuresMuteControl&&t.addClass("vjs-hidden"),t.on(e,"loadstart",function(){e.tech_.featuresMuteControl?t.removeClass("vjs-hidden"):t.addClass("vjs-hidden")})};class FP extends es{constructor(e,i){super(e,i),tq(this,e),this.on(e,["loadstart","volumechange"],n=>this.update(n))}buildCSSClass(){return`vjs-mute-control ${super.buildCSSClass()}`}handleClick(e){const i=this.player_.volume(),n=this.player_.lastVolume_();if(i===0){const r=n<.1?.1:n;this.player_.volume(r),this.player_.muted(!1)}else this.player_.muted(!this.player_.muted())}update(e){this.updateIcon_(),this.updateControlText_()}updateIcon_(){const e=this.player_.volume();let i=3;this.setIcon("volume-high"),Jr&&this.player_.tech_&&this.player_.tech_.el_&&this.player_.muted(this.player_.tech_.el_.muted),e===0||this.player_.muted()?(this.setIcon("volume-mute"),i=0):e<.33?(this.setIcon("volume-low"),i=1):e<.67&&(this.setIcon("volume-medium"),i=2),Ry(this.el_,[0,1,2,3].reduce((n,r)=>n+`${r?" ":""}vjs-vol-${r}`,"")),bc(this.el_,`vjs-vol-${i}`)}updateControlText_(){const i=this.player_.muted()||this.player_.volume()===0?"Unmute":"Mute";this.controlText()!==i&&this.controlText(i)}}FP.prototype.controlText_="Mute",Xe.registerComponent("MuteToggle",FP);class NP extends Xe{constructor(e,i={}){typeof i.inline<"u"?i.inline=i.inline:i.inline=!0,(typeof i.volumeControl>"u"||Gd(i.volumeControl))&&(i.volumeControl=i.volumeControl||{},i.volumeControl.vertical=!i.inline),super(e,i),this.handleKeyPressHandler_=n=>this.handleKeyPress(n),this.on(e,["loadstart"],n=>this.volumePanelState_(n)),this.on(this.muteToggle,"keyup",n=>this.handleKeyPress(n)),this.on(this.volumeControl,"keyup",n=>this.handleVolumeControlKeyUp(n)),this.on("keydown",n=>this.handleKeyPress(n)),this.on("mouseover",n=>this.handleMouseOver(n)),this.on("mouseout",n=>this.handleMouseOut(n)),this.on(this.volumeControl,["slideractive"],this.sliderActive_),this.on(this.volumeControl,["sliderinactive"],this.sliderInactive_)}sliderActive_(){this.addClass("vjs-slider-active")}sliderInactive_(){this.removeClass("vjs-slider-active")}volumePanelState_(){this.volumeControl.hasClass("vjs-hidden")&&this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-hidden"),this.volumeControl.hasClass("vjs-hidden")&&!this.muteToggle.hasClass("vjs-hidden")&&this.addClass("vjs-mute-toggle-only")}createEl(){let e="vjs-volume-panel-horizontal";return this.options_.inline||(e="vjs-volume-panel-vertical"),super.createEl("div",{className:`vjs-volume-panel vjs-control ${e}`})}dispose(){this.handleMouseOut(),super.dispose()}handleVolumeControlKeyUp(e){e.key==="Escape"&&this.muteToggle.focus()}handleMouseOver(e){this.addClass("vjs-hover"),Js(mt,"keyup",this.handleKeyPressHandler_)}handleMouseOut(e){this.removeClass("vjs-hover"),$r(mt,"keyup",this.handleKeyPressHandler_)}handleKeyPress(e){e.key==="Escape"&&this.handleMouseOut()}}NP.prototype.options_={children:["muteToggle","volumeControl"]},Xe.registerComponent("VolumePanel",NP);class BP extends es{constructor(e,i){super(e,i),this.validOptions=[5,10,30],this.skipTime=this.getSkipForwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`forward-${this.skipTime}`),this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipForwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.forward}buildCSSClass(){return`vjs-skip-forward-${this.getSkipForwardTime()} ${super.buildCSSClass()}`}handleClick(e){if(isNaN(this.player_.duration()))return;const i=this.player_.currentTime(),n=this.player_.liveTracker,r=n&&n.isLive()?n.seekableEnd():this.player_.duration();let s;i+this.skipTime<=r?s=i+this.skipTime:s=r,this.player_.currentTime(s)}handleLanguagechange(){this.controlText(this.localize("Skip forward {1} seconds",[this.skipTime]))}}BP.prototype.controlText_="Skip Forward",Xe.registerComponent("SkipForward",BP);class HP extends es{constructor(e,i){super(e,i),this.validOptions=[5,10,30],this.skipTime=this.getSkipBackwardTime(),this.skipTime&&this.validOptions.includes(this.skipTime)?(this.setIcon(`replay-${this.skipTime}`),this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime.toLocaleString(e.language())])),this.show()):this.hide()}getSkipBackwardTime(){const e=this.options_.playerOptions;return e.controlBar&&e.controlBar.skipButtons&&e.controlBar.skipButtons.backward}buildCSSClass(){return`vjs-skip-backward-${this.getSkipBackwardTime()} ${super.buildCSSClass()}`}handleClick(e){const i=this.player_.currentTime(),n=this.player_.liveTracker,r=n&&n.isLive()&&n.seekableStart();let s;r&&i-this.skipTime<=r?s=r:i>=this.skipTime?s=i-this.skipTime:s=0,this.player_.currentTime(s)}handleLanguagechange(){this.controlText(this.localize("Skip backward {1} seconds",[this.skipTime]))}}HP.prototype.controlText_="Skip Backward",Xe.registerComponent("SkipBackward",HP);class UP extends Xe{constructor(e,i){super(e,i),i&&(this.menuButton_=i.menuButton),this.focusedChild_=-1,this.on("keydown",n=>this.handleKeyDown(n)),this.boundHandleBlur_=n=>this.handleBlur(n),this.boundHandleTapClick_=n=>this.handleTapClick(n)}addEventListenerForItem(e){e instanceof Xe&&(this.on(e,"blur",this.boundHandleBlur_),this.on(e,["tap","click"],this.boundHandleTapClick_))}removeEventListenerForItem(e){e instanceof Xe&&(this.off(e,"blur",this.boundHandleBlur_),this.off(e,["tap","click"],this.boundHandleTapClick_))}removeChild(e){typeof e=="string"&&(e=this.getChild(e)),this.removeEventListenerForItem(e),super.removeChild(e)}addItem(e){const i=this.addChild(e);i&&this.addEventListenerForItem(i)}createEl(){const e=this.options_.contentElType||"ul";this.contentEl_=$t(e,{className:"vjs-menu-content"}),this.contentEl_.setAttribute("role","menu");const i=super.createEl("div",{append:this.contentEl_,className:"vjs-menu"});return i.appendChild(this.contentEl_),Js(i,"click",function(n){n.preventDefault(),n.stopImmediatePropagation()}),i}dispose(){this.contentEl_=null,this.boundHandleBlur_=null,this.boundHandleTapClick_=null,super.dispose()}handleBlur(e){const i=e.relatedTarget||mt.activeElement;if(!this.children().some(n=>n.el()===i)){const n=this.menuButton_;n&&n.buttonPressed_&&i!==n.el().firstChild&&n.unpressButton()}}handleTapClick(e){if(this.menuButton_){this.menuButton_.unpressButton();const i=this.children();if(!Array.isArray(i))return;const n=i.filter(r=>r.el()===e.target)[0];if(!n)return;n.name()!=="CaptionSettingsMenuItem"&&this.menuButton_.focus()}}handleKeyDown(e){e.key==="ArrowLeft"||e.key==="ArrowDown"?(e.preventDefault(),e.stopPropagation(),this.stepForward()):(e.key==="ArrowRight"||e.key==="ArrowUp")&&(e.preventDefault(),e.stopPropagation(),this.stepBack())}stepForward(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_+1),this.focus(e)}stepBack(){let e=0;this.focusedChild_!==void 0&&(e=this.focusedChild_-1),this.focus(e)}focus(e=0){const i=this.children().slice();i.length&&i[0].hasClass("vjs-menu-title")&&i.shift(),i.length>0&&(e<0?e=0:e>=i.length&&(e=i.length-1),this.focusedChild_=e,i[e].el_.focus())}}Xe.registerComponent("Menu",UP);class Tw extends Xe{constructor(e,i={}){super(e,i),this.menuButton_=new es(e,i),this.menuButton_.controlText(this.controlText_),this.menuButton_.el_.setAttribute("aria-haspopup","true");const n=es.prototype.buildCSSClass();this.menuButton_.el_.className=this.buildCSSClass()+" "+n,this.menuButton_.removeClass("vjs-control"),this.addChild(this.menuButton_),this.update(),this.enabled_=!0;const r=s=>this.handleClick(s);this.handleMenuKeyUp_=s=>this.handleMenuKeyUp(s),this.on(this.menuButton_,"tap",r),this.on(this.menuButton_,"click",r),this.on(this.menuButton_,"keydown",s=>this.handleKeyDown(s)),this.on(this.menuButton_,"mouseenter",()=>{this.addClass("vjs-hover"),this.menu.show(),Js(mt,"keyup",this.handleMenuKeyUp_)}),this.on("mouseleave",s=>this.handleMouseLeave(s)),this.on("keydown",s=>this.handleSubmenuKeyDown(s))}update(){const e=this.createMenu();this.menu&&(this.menu.dispose(),this.removeChild(this.menu)),this.menu=e,this.addChild(e),this.buttonPressed_=!1,this.menuButton_.el_.setAttribute("aria-expanded","false"),this.items&&this.items.length<=this.hideThreshold_?(this.hide(),this.menu.contentEl_.removeAttribute("role")):(this.show(),this.menu.contentEl_.setAttribute("role","menu"))}createMenu(){const e=new UP(this.player_,{menuButton:this});if(this.hideThreshold_=0,this.options_.title){const i=$t("li",{className:"vjs-menu-title",textContent:qn(this.options_.title),tabIndex:-1}),n=new Xe(this.player_,{el:i});e.addItem(n)}if(this.items=this.createItems(),this.items)for(let i=0;i{this.handleTracksChange.apply(this,u)},o=(...u)=>{this.handleSelectedLanguageChange.apply(this,u)};if(e.on(["loadstart","texttrackchange"],s),r.addEventListener("change",s),r.addEventListener("selectedlanguagechange",o),this.on("dispose",function(){e.off(["loadstart","texttrackchange"],s),r.removeEventListener("change",s),r.removeEventListener("selectedlanguagechange",o)}),r.onchange===void 0){let u;this.on(["tap","click"],function(){if(typeof _e.Event!="object")try{u=new _e.Event("change")}catch{}u||(u=mt.createEvent("Event"),u.initEvent("change",!0,!0)),r.dispatchEvent(u)})}this.handleTracksChange()}handleClick(e){const i=this.track,n=this.player_.textTracks();if(super.handleClick(e),!!n)for(let r=0;r-1&&o.mode==="showing"){n=!1;break}}n!==this.isSelected_&&this.selected(n)}handleSelectedLanguageChange(e){const i=this.player().textTracks();let n=!0;for(let r=0,s=i.length;r-1&&o.mode==="showing"){n=!1;break}}n&&(this.player_.cache_.selectedLanguage={enabled:!1})}handleLanguagechange(){this.$(".vjs-menu-item-text").textContent=this.player_.localize(this.options_.label),super.handleLanguagechange()}}Xe.registerComponent("OffTextTrackMenuItem",zP);class oh extends xw{constructor(e,i={}){i.tracks=e.textTracks(),super(e,i)}createItems(e=[],i=Up){let n;this.label_&&(n=`${this.label_} off`),e.push(new zP(this.player_,{kinds:this.kinds_,kind:this.kind_,label:n})),this.hideThreshold_+=1;const r=this.player_.textTracks();Array.isArray(this.kinds_)||(this.kinds_=[this.kind_]);for(let s=0;s-1){const u=new i(this.player_,{track:o,kinds:this.kinds_,kind:this.kind_,selectable:!0,multiSelectable:!1});u.addClass(`vjs-${o.kind}-menu-item`),e.push(u)}}return e}}Xe.registerComponent("TextTrackButton",oh);class VP extends Hp{constructor(e,i){const n=i.track,r=i.cue,s=e.currentTime();i.selectable=!0,i.multiSelectable=!1,i.label=r.text,i.selected=r.startTime<=s&&s{this.items.forEach(r=>{r.selected(this.track_.activeCues[0]===r.cue)})}}buildCSSClass(){return`vjs-chapters-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-chapters-button ${super.buildWrapperCSSClass()}`}update(e){if(e&&e.track&&e.track.kind!=="chapters")return;const i=this.findChaptersTrack();i!==this.track_?(this.setTrack(i),super.update()):(!this.items||i&&i.cues&&i.cues.length!==this.items.length)&&super.update()}setTrack(e){if(this.track_!==e){if(this.updateHandler_||(this.updateHandler_=this.update.bind(this)),this.track_){const i=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);i&&i.removeEventListener("load",this.updateHandler_),this.track_.removeEventListener("cuechange",this.selectCurrentItem_),this.track_=null}if(this.track_=e,this.track_){this.track_.mode="hidden";const i=this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);i&&i.addEventListener("load",this.updateHandler_),this.track_.addEventListener("cuechange",this.selectCurrentItem_)}}}findChaptersTrack(){const e=this.player_.textTracks()||[];for(let i=e.length-1;i>=0;i--){const n=e[i];if(n.kind===this.kind_)return n}}getMenuCaption(){return this.track_&&this.track_.label?this.track_.label:this.localize(qn(this.kind_))}createMenu(){return this.options_.title=this.getMenuCaption(),super.createMenu()}createItems(){const e=[];if(!this.track_)return e;const i=this.track_.cues;if(!i)return e;for(let n=0,r=i.length;n-1&&(this.label_="captions",this.setIcon("captions")),this.menuButton_.controlText(qn(this.label_))}buildCSSClass(){return`vjs-subs-caps-button ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-subs-caps-button ${super.buildWrapperCSSClass()}`}createItems(){let e=[];return!(this.player().tech_&&this.player().tech_.featuresNativeTextTracks)&&this.player().getChild("textTrackSettings")&&(e.push(new Aw(this.player_,{kind:this.label_})),this.hideThreshold_+=1),e=super.createItems(e,jP),e}}Pw.prototype.kinds_=["captions","subtitles"],Pw.prototype.controlText_="Subtitles",Xe.registerComponent("SubsCapsButton",Pw);class WP extends Hp{constructor(e,i){const n=i.track,r=e.audioTracks();i.label=n.label||n.language||"Unknown",i.selected=n.enabled,super(e,i),this.track=n,this.addClass(`vjs-${n.kind}-menu-item`);const s=(...o)=>{this.handleTracksChange.apply(this,o)};r.addEventListener("change",s),this.on("dispose",()=>{r.removeEventListener("change",s)})}createEl(e,i,n){const r=super.createEl(e,i,n),s=r.querySelector(".vjs-menu-item-text");return["main-desc","descriptions"].indexOf(this.options_.track.kind)>=0&&(s.appendChild($t("span",{className:"vjs-icon-placeholder"},{"aria-hidden":!0})),s.appendChild($t("span",{className:"vjs-control-text",textContent:" "+this.localize("Descriptions")}))),r}handleClick(e){if(super.handleClick(e),this.track.enabled=!0,this.player_.tech_.featuresNativeAudioTracks){const i=this.player_.audioTracks();for(let n=0;nthis.update(s))}handleClick(e){super.handleClick(),this.player().playbackRate(this.rate)}update(e){this.selected(this.player().playbackRate()===this.rate)}}kw.prototype.contentElType="button",Xe.registerComponent("PlaybackRateMenuItem",kw);class GP extends Tw{constructor(e,i){super(e,i),this.menuButton_.el_.setAttribute("aria-describedby",this.labelElId_),this.updateVisibility(),this.updateLabel(),this.on(e,"loadstart",n=>this.updateVisibility(n)),this.on(e,"ratechange",n=>this.updateLabel(n)),this.on(e,"playbackrateschange",n=>this.handlePlaybackRateschange(n))}createEl(){const e=super.createEl();return this.labelElId_="vjs-playback-rate-value-label-"+this.id_,this.labelEl_=$t("div",{className:"vjs-playback-rate-value",id:this.labelElId_,textContent:"1x"}),e.appendChild(this.labelEl_),e}dispose(){this.labelEl_=null,super.dispose()}buildCSSClass(){return`vjs-playback-rate ${super.buildCSSClass()}`}buildWrapperCSSClass(){return`vjs-playback-rate ${super.buildWrapperCSSClass()}`}createItems(){const e=this.playbackRates(),i=[];for(let n=e.length-1;n>=0;n--)i.push(new kw(this.player(),{rate:e[n]+"x"}));return i}handlePlaybackRateschange(e){this.update()}playbackRates(){const e=this.player();return e.playbackRates&&e.playbackRates()||[]}playbackRateSupported(){return this.player().tech_&&this.player().tech_.featuresPlaybackRate&&this.playbackRates()&&this.playbackRates().length>0}updateVisibility(e){this.playbackRateSupported()?this.removeClass("vjs-hidden"):this.addClass("vjs-hidden")}updateLabel(e){this.playbackRateSupported()&&(this.labelEl_.textContent=this.player().playbackRate()+"x")}}GP.prototype.controlText_="Playback Rate",Xe.registerComponent("PlaybackRateMenuButton",GP);class KP extends Xe{buildCSSClass(){return`vjs-spacer ${super.buildCSSClass()}`}createEl(e="div",i={},n={}){return i.className||(i.className=this.buildCSSClass()),super.createEl(e,i,n)}}Xe.registerComponent("Spacer",KP);class iq extends KP{buildCSSClass(){return`vjs-custom-control-spacer ${super.buildCSSClass()}`}createEl(){return super.createEl("div",{className:this.buildCSSClass(),textContent:" "})}}Xe.registerComponent("CustomControlSpacer",iq);class YP extends Xe{createEl(){return super.createEl("div",{className:"vjs-control-bar",dir:"ltr"})}}YP.prototype.options_={children:["playToggle","skipBackward","skipForward","volumePanel","currentTimeDisplay","timeDivider","durationDisplay","progressControl","liveDisplay","seekToLive","remainingTimeDisplay","customControlSpacer","playbackRateMenuButton","chaptersButton","descriptionsButton","subsCapsButton","audioTrackButton","pictureInPictureToggle","fullscreenToggle"]},Xe.registerComponent("ControlBar",YP);class XP extends th{constructor(e,i){super(e,i),this.on(e,"error",n=>{this.open(n)})}buildCSSClass(){return`vjs-error-display ${super.buildCSSClass()}`}content(){const e=this.player().error();return e?this.localize(e.message):""}}XP.prototype.options_=Object.assign({},th.prototype.options_,{pauseOnOpen:!1,fillAlways:!0,temporary:!1,uncloseable:!0}),Xe.registerComponent("ErrorDisplay",XP);class ZP extends Xe{constructor(e,i={}){super(e,i),this.el_.setAttribute("aria-labelledby",this.selectLabelledbyIds)}createEl(){return this.selectLabelledbyIds=[this.options_.legendId,this.options_.labelId].join(" ").trim(),$t("select",{id:this.options_.id},{},this.options_.SelectOptions.map(i=>{const n=(this.options_.labelId?this.options_.labelId:`vjs-track-option-${_o()}`)+"-"+i[1].replace(/\W+/g,""),r=$t("option",{id:n,value:this.localize(i[0]),textContent:this.localize(i[1])});return r.setAttribute("aria-labelledby",`${this.selectLabelledbyIds} ${n}`),r}))}}Xe.registerComponent("TextTrackSelect",ZP);class Sc extends Xe{constructor(e,i={}){super(e,i);const n=$t("legend",{textContent:this.localize(this.options_.legendText),id:this.options_.legendId});this.el().appendChild(n);const r=this.options_.selects;for(const s of r){const o=this.options_.selectConfigs[s],u=o.className,h=o.id.replace("%s",this.options_.id_);let p=null;const g=`vjs_select_${_o()}`;if(this.options_.type==="colors"){p=$t("span",{className:u});const S=$t("label",{id:h,className:"vjs-label",textContent:this.localize(o.label)});S.setAttribute("for",g),p.appendChild(S)}const y=new ZP(e,{SelectOptions:o.options,legendId:this.options_.legendId,id:g,labelId:h});this.addChild(y),this.options_.type==="colors"&&(p.appendChild(y.el()),this.el().appendChild(p))}}createEl(){return $t("fieldset",{className:this.options_.className})}}Xe.registerComponent("TextTrackFieldset",Sc);class QP extends Xe{constructor(e,i={}){super(e,i);const n=this.options_.textTrackComponentid,r=new Sc(e,{id_:n,legendId:`captions-text-legend-${n}`,legendText:this.localize("Text"),className:"vjs-fg vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(r);const s=new Sc(e,{id_:n,legendId:`captions-background-${n}`,legendText:this.localize("Text Background"),className:"vjs-bg vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(s);const o=new Sc(e,{id_:n,legendId:`captions-window-${n}`,legendText:this.localize("Caption Area Background"),className:"vjs-window vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"colors"});this.addChild(o)}createEl(){return $t("div",{className:"vjs-track-settings-colors"})}}Xe.registerComponent("TextTrackSettingsColors",QP);class JP extends Xe{constructor(e,i={}){super(e,i);const n=this.options_.textTrackComponentid,r=new Sc(e,{id_:n,legendId:`captions-font-size-${n}`,legendText:"Font Size",className:"vjs-font-percent vjs-track-setting",selects:this.options_.fieldSets[0],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(r);const s=new Sc(e,{id_:n,legendId:`captions-edge-style-${n}`,legendText:this.localize("Text Edge Style"),className:"vjs-edge-style vjs-track-setting",selects:this.options_.fieldSets[1],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(s);const o=new Sc(e,{id_:n,legendId:`captions-font-family-${n}`,legendText:this.localize("Font Family"),className:"vjs-font-family vjs-track-setting",selects:this.options_.fieldSets[2],selectConfigs:this.options_.selectConfigs,type:"font"});this.addChild(o)}createEl(){return $t("div",{className:"vjs-track-settings-font"})}}Xe.registerComponent("TextTrackSettingsFont",JP);class $P extends Xe{constructor(e,i={}){super(e,i);const n=this.localize("restore all settings to the default values"),r=new es(e,{controlText:n,className:"vjs-default-button"});r.el().classList.remove("vjs-control","vjs-button"),r.el().textContent=this.localize("Reset"),this.addChild(r);const s=new es(e,{controlText:n,className:"vjs-done-button"});s.el().classList.remove("vjs-control","vjs-button"),s.el().textContent=this.localize("Done"),this.addChild(s)}createEl(){return $t("div",{className:"vjs-track-settings-controls"})}}Xe.registerComponent("TrackSettingsControls",$P);const Iw="vjs-text-track-settings",ek=["#000","Black"],tk=["#00F","Blue"],ik=["#0FF","Cyan"],nk=["#0F0","Green"],rk=["#F0F","Magenta"],sk=["#F00","Red"],ok=["#FFF","White"],ak=["#FF0","Yellow"],Rw=["1","Opaque"],Ow=["0.5","Semi-Transparent"],lk=["0","Transparent"],vu={backgroundColor:{selector:".vjs-bg-color > select",id:"captions-background-color-%s",label:"Color",options:[ek,ok,sk,nk,tk,ak,rk,ik],className:"vjs-bg-color"},backgroundOpacity:{selector:".vjs-bg-opacity > select",id:"captions-background-opacity-%s",label:"Opacity",options:[Rw,Ow,lk],className:"vjs-bg-opacity vjs-opacity"},color:{selector:".vjs-text-color > select",id:"captions-foreground-color-%s",label:"Color",options:[ok,ek,sk,nk,tk,ak,rk,ik],className:"vjs-text-color"},edgeStyle:{selector:".vjs-edge-style > select",id:"",label:"Text Edge Style",options:[["none","None"],["raised","Raised"],["depressed","Depressed"],["uniform","Uniform"],["dropshadow","Drop shadow"]]},fontFamily:{selector:".vjs-font-family > select",id:"",label:"Font Family",options:[["proportionalSansSerif","Proportional Sans-Serif"],["monospaceSansSerif","Monospace Sans-Serif"],["proportionalSerif","Proportional Serif"],["monospaceSerif","Monospace Serif"],["casual","Casual"],["script","Script"],["small-caps","Small Caps"]]},fontPercent:{selector:".vjs-font-percent > select",id:"",label:"Font Size",options:[["0.50","50%"],["0.75","75%"],["1.00","100%"],["1.25","125%"],["1.50","150%"],["1.75","175%"],["2.00","200%"],["3.00","300%"],["4.00","400%"]],default:2,parser:t=>t==="1.00"?null:Number(t)},textOpacity:{selector:".vjs-text-opacity > select",id:"captions-foreground-opacity-%s",label:"Opacity",options:[Rw,Ow],className:"vjs-text-opacity vjs-opacity"},windowColor:{selector:".vjs-window-color > select",id:"captions-window-color-%s",label:"Color",className:"vjs-window-color"},windowOpacity:{selector:".vjs-window-opacity > select",id:"captions-window-opacity-%s",label:"Opacity",options:[lk,Ow,Rw],className:"vjs-window-opacity vjs-opacity"}};vu.windowColor.options=vu.backgroundColor.options;function uk(t,e){if(e&&(t=e(t)),t&&t!=="none")return t}function nq(t,e){const i=t.options[t.options.selectedIndex].value;return uk(i,e)}function rq(t,e,i){if(e){for(let n=0;n{this.saveSettings(),this.close()}),this.on(this.$(".vjs-default-button"),["click","tap"],()=>{this.setDefaults(),this.updateDisplay()}),qd(vu,e=>{this.on(this.$(e.selector),"change",this.updateDisplay)})}dispose(){this.endDialog=null,super.dispose()}label(){return this.localize("Caption Settings Dialog")}description(){return this.localize("Beginning of dialog window. Escape will cancel and close the window.")}buildCSSClass(){return super.buildCSSClass()+" vjs-text-track-settings"}getValues(){return kD(vu,(e,i,n)=>{const r=nq(this.$(i.selector),i.parser);return r!==void 0&&(e[n]=r),e},{})}setValues(e){qd(vu,(i,n)=>{rq(this.$(i.selector),e[n],i.parser)})}setDefaults(){qd(vu,e=>{const i=e.hasOwnProperty("default")?e.default:0;this.$(e.selector).selectedIndex=i})}restoreSettings(){let e;try{e=JSON.parse(_e.localStorage.getItem(Iw))}catch(i){xi.warn(i)}e&&this.setValues(e)}saveSettings(){if(!this.options_.persistTextTrackSettings)return;const e=this.getValues();try{Object.keys(e).length?_e.localStorage.setItem(Iw,JSON.stringify(e)):_e.localStorage.removeItem(Iw)}catch(i){xi.warn(i)}}updateDisplay(){const e=this.player_.getChild("textTrackDisplay");e&&e.updateDisplay()}handleLanguagechange(){this.fill(),this.renderModalComponents(this.player_),this.bindFunctionsToSelectsAndButtons()}}Xe.registerComponent("TextTrackSettings",sq);class oq extends Xe{constructor(e,i){let n=i.ResizeObserver||_e.ResizeObserver;i.ResizeObserver===null&&(n=!1);const r=ln({createEl:!n,reportTouchActivity:!1},i);super(e,r),this.ResizeObserver=i.ResizeObserver||_e.ResizeObserver,this.loadListener_=null,this.resizeObserver_=null,this.debouncedHandler_=tP(()=>{this.resizeHandler()},100,!1,this),n?(this.resizeObserver_=new this.ResizeObserver(this.debouncedHandler_),this.resizeObserver_.observe(e.el())):(this.loadListener_=()=>{if(!this.el_||!this.el_.contentWindow)return;const s=this.debouncedHandler_;let o=this.unloadListener_=function(){$r(this,"resize",s),$r(this,"unload",o),o=null};Js(this.el_.contentWindow,"unload",o),Js(this.el_.contentWindow,"resize",s)},this.one("load",this.loadListener_))}createEl(){return super.createEl("iframe",{className:"vjs-resize-manager",tabIndex:-1,title:this.localize("No content")},{"aria-hidden":"true"})}resizeHandler(){!this.player_||!this.player_.trigger||this.player_.trigger("playerresize")}dispose(){this.debouncedHandler_&&this.debouncedHandler_.cancel(),this.resizeObserver_&&(this.player_.el()&&this.resizeObserver_.unobserve(this.player_.el()),this.resizeObserver_.disconnect()),this.loadListener_&&this.off("load",this.loadListener_),this.el_&&this.el_.contentWindow&&this.unloadListener_&&this.unloadListener_.call(this.el_.contentWindow),this.ResizeObserver=null,this.resizeObserver=null,this.debouncedHandler_=null,this.loadListener_=null,super.dispose()}}Xe.registerComponent("ResizeManager",oq);const aq={trackingThreshold:20,liveTolerance:15};class lq extends Xe{constructor(e,i){const n=ln(aq,i,{createEl:!1});super(e,n),this.trackLiveHandler_=()=>this.trackLive_(),this.handlePlay_=r=>this.handlePlay(r),this.handleFirstTimeupdate_=r=>this.handleFirstTimeupdate(r),this.handleSeeked_=r=>this.handleSeeked(r),this.seekToLiveEdge_=r=>this.seekToLiveEdge(r),this.reset_(),this.on(this.player_,"durationchange",r=>this.handleDurationchange(r)),this.on(this.player_,"canplay",()=>this.toggleTracking())}trackLive_(){const e=this.player_.seekable();if(!e||!e.length)return;const i=Number(_e.performance.now().toFixed(4)),n=this.lastTime_===-1?0:(i-this.lastTime_)/1e3;this.lastTime_=i,this.pastSeekEnd_=this.pastSeekEnd()+n;const r=this.liveCurrentTime(),s=this.player_.currentTime();let o=this.player_.paused()||this.seekedBehindLive_||Math.abs(r-s)>this.options_.liveTolerance;(!this.timeupdateSeen_||r===1/0)&&(o=!1),o!==this.behindLiveEdge_&&(this.behindLiveEdge_=o,this.trigger("liveedgechange"))}handleDurationchange(){this.toggleTracking()}toggleTracking(){this.player_.duration()===1/0&&this.liveWindow()>=this.options_.trackingThreshold?(this.player_.options_.liveui&&this.player_.addClass("vjs-liveui"),this.startTracking()):(this.player_.removeClass("vjs-liveui"),this.stopTracking())}startTracking(){this.isTracking()||(this.timeupdateSeen_||(this.timeupdateSeen_=this.player_.hasStarted()),this.trackingInterval_=this.setInterval(this.trackLiveHandler_,wo),this.trackLive_(),this.on(this.player_,["play","pause"],this.trackLiveHandler_),this.timeupdateSeen_?this.on(this.player_,"seeked",this.handleSeeked_):(this.one(this.player_,"play",this.handlePlay_),this.one(this.player_,"timeupdate",this.handleFirstTimeupdate_)))}handleFirstTimeupdate(){this.timeupdateSeen_=!0,this.on(this.player_,"seeked",this.handleSeeked_)}handleSeeked(){const e=Math.abs(this.liveCurrentTime()-this.player_.currentTime());this.seekedBehindLive_=this.nextSeekedFromUser_&&e>2,this.nextSeekedFromUser_=!1,this.trackLive_()}handlePlay(){this.one(this.player_,"timeupdate",this.seekToLiveEdge_)}reset_(){this.lastTime_=-1,this.pastSeekEnd_=0,this.lastSeekEnd_=-1,this.behindLiveEdge_=!0,this.timeupdateSeen_=!1,this.seekedBehindLive_=!1,this.nextSeekedFromUser_=!1,this.clearInterval(this.trackingInterval_),this.trackingInterval_=null,this.off(this.player_,["play","pause"],this.trackLiveHandler_),this.off(this.player_,"seeked",this.handleSeeked_),this.off(this.player_,"play",this.handlePlay_),this.off(this.player_,"timeupdate",this.handleFirstTimeupdate_),this.off(this.player_,"timeupdate",this.seekToLiveEdge_)}nextSeekedFromUser(){this.nextSeekedFromUser_=!0}stopTracking(){this.isTracking()&&(this.reset_(),this.trigger("liveedgechange"))}seekableEnd(){const e=this.player_.seekable(),i=[];let n=e?e.length:0;for(;n--;)i.push(e.end(n));return i.length?i.sort()[i.length-1]:1/0}seekableStart(){const e=this.player_.seekable(),i=[];let n=e?e.length:0;for(;n--;)i.push(e.start(n));return i.length?i.sort()[0]:0}liveWindow(){const e=this.liveCurrentTime();return e===1/0?0:e-this.seekableStart()}isLive(){return this.isTracking()}atLiveEdge(){return!this.behindLiveEdge()}liveCurrentTime(){return this.pastSeekEnd()+this.seekableEnd()}pastSeekEnd(){const e=this.seekableEnd();return this.lastSeekEnd_!==-1&&e!==this.lastSeekEnd_&&(this.pastSeekEnd_=0),this.lastSeekEnd_=e,this.pastSeekEnd_}behindLiveEdge(){return this.behindLiveEdge_}isTracking(){return typeof this.trackingInterval_=="number"}seekToLiveEdge(){this.seekedBehindLive_=!1,!this.atLiveEdge()&&(this.nextSeekedFromUser_=!1,this.player_.currentTime(this.liveCurrentTime()))}dispose(){this.stopTracking(),super.dispose()}}Xe.registerComponent("LiveTracker",lq);class uq extends Xe{constructor(e,i){super(e,i),this.on("statechanged",n=>this.updateDom_()),this.updateDom_()}createEl(){return this.els={title:$t("div",{className:"vjs-title-bar-title",id:`vjs-title-bar-title-${_o()}`}),description:$t("div",{className:"vjs-title-bar-description",id:`vjs-title-bar-description-${_o()}`})},$t("div",{className:"vjs-title-bar"},{},ID(this.els))}updateDom_(){const e=this.player_.tech_,i=e&&e.el_,n={title:"aria-labelledby",description:"aria-describedby"};["title","description"].forEach(r=>{const s=this.state[r],o=this.els[r],u=n[r];My(o),s&&mu(o,s),i&&(i.removeAttribute(u),s&&i.setAttribute(u,o.id))}),this.state.title||this.state.description?this.show():this.hide()}update(e){this.setState(e)}dispose(){const e=this.player_.tech_,i=e&&e.el_;i&&(i.removeAttribute("aria-labelledby"),i.removeAttribute("aria-describedby")),super.dispose(),this.els=null}}Xe.registerComponent("TitleBar",uq);const cq={initialDisplay:4e3,position:[],takeFocus:!1};class dq extends es{constructor(e,i){i=ln(cq,i),super(e,i),this.controlText(i.controlText),this.hide(),this.on(this.player_,["useractive","userinactive"],n=>{this.removeClass("force-display")})}buildCSSClass(){return`vjs-transient-button focus-visible ${this.options_.position.map(e=>`vjs-${e}`).join(" ")}`}createEl(){const e=$t("button",{},{type:"button",class:this.buildCSSClass()},$t("span"));return this.controlTextEl_=e.querySelector("span"),e}show(){super.show(),this.addClass("force-display"),this.options_.takeFocus&&this.el().focus({preventScroll:!0}),this.forceDisplayTimeout=this.player_.setTimeout(()=>{this.removeClass("force-display")},this.options_.initialDisplay)}hide(){this.removeClass("force-display"),super.hide()}dispose(){this.player_.clearTimeout(this.forceDisplayTimeout),super.dispose()}}Xe.registerComponent("TransientButton",dq);const Lw=t=>{const e=t.el();if(e.hasAttribute("src"))return t.triggerSourceset(e.src),!0;const i=t.$$("source"),n=[];let r="";if(!i.length)return!1;for(let s=0;s{let i={};for(let n=0;nck([t.el(),_e.HTMLMediaElement.prototype,_e.Element.prototype,hq],"innerHTML"),dk=function(t){const e=t.el();if(e.resetSourceWatch_)return;const i={},n=fq(t),r=s=>(...o)=>{const u=s.apply(e,o);return Lw(t),u};["append","appendChild","insertAdjacentHTML"].forEach(s=>{e[s]&&(i[s]=e[s],e[s]=r(i[s]))}),Object.defineProperty(e,"innerHTML",ln(n,{set:r(n.set)})),e.resetSourceWatch_=()=>{e.resetSourceWatch_=null,Object.keys(i).forEach(s=>{e[s]=i[s]}),Object.defineProperty(e,"innerHTML",n)},t.one("sourceset",e.resetSourceWatch_)},pq=Object.defineProperty({},"src",{get(){return this.hasAttribute("src")?pP(_e.Element.prototype.getAttribute.call(this,"src")):""},set(t){return _e.Element.prototype.setAttribute.call(this,"src",t),t}}),mq=t=>ck([t.el(),_e.HTMLMediaElement.prototype,pq],"src"),gq=function(t){if(!t.featuresSourceset)return;const e=t.el();if(e.resetSourceset_)return;const i=mq(t),n=e.setAttribute,r=e.load;Object.defineProperty(e,"src",ln(i,{set:s=>{const o=i.set.call(e,s);return t.triggerSourceset(e.src),o}})),e.setAttribute=(s,o)=>{const u=n.call(e,s,o);return/src/i.test(s)&&t.triggerSourceset(e.src),u},e.load=()=>{const s=r.call(e);return Lw(t)||(t.triggerSourceset(""),dk(t)),s},e.currentSrc?t.triggerSourceset(e.currentSrc):Lw(t)||dk(t),e.resetSourceset_=()=>{e.resetSourceset_=null,e.load=r,e.setAttribute=n,Object.defineProperty(e,"src",i),e.resetSourceWatch_&&e.resetSourceWatch_()}};class It extends mi{constructor(e,i){super(e,i);const n=e.source;let r=!1;if(this.featuresVideoFrameCallback=this.featuresVideoFrameCallback&&this.el_.tagName==="VIDEO",n&&(this.el_.currentSrc!==n.src||e.tag&&e.tag.initNetworkState_===3)?this.setSource(n):this.handleLateInit_(this.el_),e.enableSourceset&&this.setupSourcesetHandling_(),this.isScrubbing_=!1,this.el_.hasChildNodes()){const s=this.el_.childNodes;let o=s.length;const u=[];for(;o--;){const h=s[o];h.nodeName.toLowerCase()==="track"&&(this.featuresNativeTextTracks?(this.remoteTextTrackEls().addTrackElement_(h),this.remoteTextTracks().addTrack(h.track),this.textTracks().addTrack(h.track),!r&&!this.el_.hasAttribute("crossorigin")&&Vy(h.src)&&(r=!0)):u.push(h))}for(let h=0;h{i=[];for(let s=0;se.removeEventListener("change",n));const r=()=>{for(let s=0;s{e.removeEventListener("change",n),e.removeEventListener("change",r),e.addEventListener("change",r)}),this.on("webkitendfullscreen",()=>{e.removeEventListener("change",n),e.addEventListener("change",n),e.removeEventListener("change",r)})}overrideNative_(e,i){if(i!==this[`featuresNative${e}Tracks`])return;const n=e.toLowerCase();this[`${n}TracksListeners_`]&&Object.keys(this[`${n}TracksListeners_`]).forEach(r=>{this.el()[`${n}Tracks`].removeEventListener(r,this[`${n}TracksListeners_`][r])}),this[`featuresNative${e}Tracks`]=!i,this[`${n}TracksListeners_`]=null,this.proxyNativeTracksForType_(n)}overrideNativeAudioTracks(e){this.overrideNative_("Audio",e)}overrideNativeVideoTracks(e){this.overrideNative_("Video",e)}proxyNativeTracksForType_(e){const i=To[e],n=this.el()[i.getterName],r=this[i.getterName]();if(!this[`featuresNative${i.capitalName}Tracks`]||!n||!n.addEventListener)return;const s={change:u=>{const h={type:"change",target:r,currentTarget:r,srcElement:r};r.trigger(h),e==="text"&&this[nh.remoteText.getterName]().trigger(h)},addtrack(u){r.addTrack(u.track)},removetrack(u){r.removeTrack(u.track)}},o=function(){const u=[];for(let h=0;h{const h=s[u];n.addEventListener(u,h),this.on("dispose",p=>n.removeEventListener(u,h))}),this.on("loadstart",o),this.on("dispose",u=>this.off("loadstart",o))}proxyNativeTracks_(){To.names.forEach(e=>{this.proxyNativeTracksForType_(e)})}createEl(){let e=this.options_.tag;if(!e||!(this.options_.playerElIngest||this.movingMediaElementInDOM)){if(e){const n=e.cloneNode(!0);e.parentNode&&e.parentNode.insertBefore(n,e),It.disposeMediaElement(e),e=n}else{e=mt.createElement("video");const n=this.options_.tag&&gu(this.options_.tag),r=ln({},n);(!kp||this.options_.nativeControlsForTouch!==!0)&&delete r.controls,zD(e,Object.assign(r,{id:this.options_.techId,class:"vjs-tech"}))}e.playerId=this.options_.playerId}typeof this.options_.preload<"u"&&Qd(e,"preload",this.options_.preload),this.options_.disablePictureInPicture!==void 0&&(e.disablePictureInPicture=this.options_.disablePictureInPicture);const i=["loop","muted","playsinline","autoplay"];for(let n=0;n=2&&i.push("loadeddata"),e.readyState>=3&&i.push("canplay"),e.readyState>=4&&i.push("canplaythrough"),this.ready(function(){i.forEach(function(n){this.trigger(n)},this)})}setScrubbing(e){this.isScrubbing_=e}scrubbing(){return this.isScrubbing_}setCurrentTime(e){try{this.isScrubbing_&&this.el_.fastSeek&&Iy?this.el_.fastSeek(e):this.el_.currentTime=e}catch(i){xi(i,"Video is not ready. (Video.js)")}}duration(){if(this.el_.duration===1/0&&Vo&&wa&&this.el_.currentTime===0){const e=()=>{this.el_.currentTime>0&&(this.el_.duration===1/0&&this.trigger("durationchange"),this.off("timeupdate",e))};return this.on("timeupdate",e),NaN}return this.el_.duration||NaN}width(){return this.el_.offsetWidth}height(){return this.el_.offsetHeight}proxyWebkitFullscreen_(){if(!("webkitDisplayingFullscreen"in this.el_))return;const e=function(){this.trigger("fullscreenchange",{isFullscreen:!1}),this.el_.controls&&!this.options_.nativeControlsForTouch&&this.controls()&&(this.el_.controls=!1)},i=function(){"webkitPresentationMode"in this.el_&&this.el_.webkitPresentationMode!=="picture-in-picture"&&(this.one("webkitendfullscreen",e),this.trigger("fullscreenchange",{isFullscreen:!0,nativeIOSFullscreen:!0}))};this.on("webkitbeginfullscreen",i),this.on("dispose",()=>{this.off("webkitbeginfullscreen",i),this.off("webkitendfullscreen",e)})}supportsFullScreen(){return typeof this.el_.webkitEnterFullScreen=="function"}enterFullScreen(){const e=this.el_;if(e.paused&&e.networkState<=e.HAVE_METADATA)xa(this.el_.play()),this.setTimeout(function(){e.pause();try{e.webkitEnterFullScreen()}catch(i){this.trigger("fullscreenerror",i)}},0);else try{e.webkitEnterFullScreen()}catch(i){this.trigger("fullscreenerror",i)}}exitFullScreen(){if(!this.el_.webkitDisplayingFullscreen){this.trigger("fullscreenerror",new Error("The video is not fullscreen"));return}this.el_.webkitExitFullScreen()}requestPictureInPicture(){return this.el_.requestPictureInPicture()}requestVideoFrameCallback(e){return this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.requestVideoFrameCallback(e):super.requestVideoFrameCallback(e)}cancelVideoFrameCallback(e){this.featuresVideoFrameCallback&&!this.el_.webkitKeys?this.el_.cancelVideoFrameCallback(e):super.cancelVideoFrameCallback(e)}src(e){if(e===void 0)return this.el_.src;this.setSrc(e)}addSourceElement(e,i){if(!e)return xi.error("Invalid source URL."),!1;const n={src:e};i&&(n.type=i);const r=$t("source",{},n);return this.el_.appendChild(r),!0}removeSourceElement(e){if(!e)return xi.error("Source URL is required to remove the source element."),!1;const i=this.el_.querySelectorAll("source");for(const n of i)if(n.src===e)return this.el_.removeChild(n),!0;return xi.warn(`No matching source element found with src: ${e}`),!1}reset(){It.resetMediaElement(this.el_)}currentSrc(){return this.currentSource_?this.currentSource_.src:this.el_.currentSrc}setControls(e){this.el_.controls=!!e}addTextTrack(e,i,n){return this.featuresNativeTextTracks?this.el_.addTextTrack(e,i,n):super.addTextTrack(e,i,n)}createRemoteTextTrack(e){if(!this.featuresNativeTextTracks)return super.createRemoteTextTrack(e);const i=mt.createElement("track");return e.kind&&(i.kind=e.kind),e.label&&(i.label=e.label),(e.language||e.srclang)&&(i.srclang=e.language||e.srclang),e.default&&(i.default=e.default),e.id&&(i.id=e.id),e.src&&(i.src=e.src),i}addRemoteTextTrack(e,i){const n=super.addRemoteTextTrack(e,i);return this.featuresNativeTextTracks&&this.el().appendChild(n),n}removeRemoteTextTrack(e){if(super.removeRemoteTextTrack(e),this.featuresNativeTextTracks){const i=this.$$("track");let n=i.length;for(;n--;)(e===i[n]||e===i[n].track)&&this.el().removeChild(i[n])}}getVideoPlaybackQuality(){if(typeof this.el().getVideoPlaybackQuality=="function")return this.el().getVideoPlaybackQuality();const e={};return typeof this.el().webkitDroppedFrameCount<"u"&&typeof this.el().webkitDecodedFrameCount<"u"&&(e.droppedVideoFrames=this.el().webkitDroppedFrameCount,e.totalVideoFrames=this.el().webkitDecodedFrameCount),_e.performance&&(e.creationTime=_e.performance.now()),e}}Ty(It,"TEST_VID",function(){if(!Xd())return;const t=mt.createElement("video"),e=mt.createElement("track");return e.kind="captions",e.srclang="en",e.label="English",t.appendChild(e),t}),It.isSupported=function(){try{It.TEST_VID.volume=.5}catch{return!1}return!!(It.TEST_VID&&It.TEST_VID.canPlayType)},It.canPlayType=function(t){return It.TEST_VID.canPlayType(t)},It.canPlaySource=function(t,e){return It.canPlayType(t.type)},It.canControlVolume=function(){try{const t=It.TEST_VID.volume;It.TEST_VID.volume=t/2+.1;const e=t!==It.TEST_VID.volume;return e&&Jr?(_e.setTimeout(()=>{It&&It.prototype&&(It.prototype.featuresVolumeControl=t!==It.TEST_VID.volume)}),!1):e}catch{return!1}},It.canMuteVolume=function(){try{const t=It.TEST_VID.muted;return It.TEST_VID.muted=!t,It.TEST_VID.muted?Qd(It.TEST_VID,"muted","muted"):Oy(It.TEST_VID,"muted","muted"),t!==It.TEST_VID.muted}catch{return!1}},It.canControlPlaybackRate=function(){if(Vo&&wa&&xy<58)return!1;try{const t=It.TEST_VID.playbackRate;return It.TEST_VID.playbackRate=t/2+.1,t!==It.TEST_VID.playbackRate}catch{return!1}},It.canOverrideAttributes=function(){try{const t=()=>{};Object.defineProperty(mt.createElement("video"),"src",{get:t,set:t}),Object.defineProperty(mt.createElement("audio"),"src",{get:t,set:t}),Object.defineProperty(mt.createElement("video"),"innerHTML",{get:t,set:t}),Object.defineProperty(mt.createElement("audio"),"innerHTML",{get:t,set:t})}catch{return!1}return!0},It.supportsNativeTextTracks=function(){return Iy||Jr&&wa},It.supportsNativeVideoTracks=function(){return!!(It.TEST_VID&&It.TEST_VID.videoTracks)},It.supportsNativeAudioTracks=function(){return!!(It.TEST_VID&&It.TEST_VID.audioTracks)},It.Events=["loadstart","suspend","abort","error","emptied","stalled","loadedmetadata","loadeddata","canplay","canplaythrough","playing","waiting","seeking","seeked","ended","durationchange","timeupdate","progress","play","pause","ratechange","resize","volumechange"],[["featuresMuteControl","canMuteVolume"],["featuresPlaybackRate","canControlPlaybackRate"],["featuresSourceset","canOverrideAttributes"],["featuresNativeTextTracks","supportsNativeTextTracks"],["featuresNativeVideoTracks","supportsNativeVideoTracks"],["featuresNativeAudioTracks","supportsNativeAudioTracks"]].forEach(function([t,e]){Ty(It.prototype,t,()=>It[e](),!0)}),It.prototype.featuresVolumeControl=It.canControlVolume(),It.prototype.movingMediaElementInDOM=!Jr,It.prototype.featuresFullscreenResize=!0,It.prototype.featuresProgressEvents=!0,It.prototype.featuresTimeupdateEvents=!0,It.prototype.featuresVideoFrameCallback=!!(It.TEST_VID&&It.TEST_VID.requestVideoFrameCallback),It.disposeMediaElement=function(t){if(t){for(t.parentNode&&t.parentNode.removeChild(t);t.hasChildNodes();)t.removeChild(t.firstChild);t.removeAttribute("src"),typeof t.load=="function"&&function(){try{t.load()}catch{}}()}},It.resetMediaElement=function(t){if(!t)return;const e=t.querySelectorAll("source");let i=e.length;for(;i--;)t.removeChild(e[i]);t.removeAttribute("src"),typeof t.load=="function"&&function(){try{t.load()}catch{}}()},["muted","defaultMuted","autoplay","controls","loop","playsinline"].forEach(function(t){It.prototype[t]=function(){return this.el_[t]||this.el_.hasAttribute(t)}}),["muted","defaultMuted","autoplay","loop","playsinline"].forEach(function(t){It.prototype["set"+qn(t)]=function(e){this.el_[t]=e,e?this.el_.setAttribute(t,t):this.el_.removeAttribute(t)}}),["paused","currentTime","buffered","volume","poster","preload","error","seeking","seekable","ended","playbackRate","defaultPlaybackRate","disablePictureInPicture","played","networkState","readyState","videoWidth","videoHeight","crossOrigin"].forEach(function(t){It.prototype[t]=function(){return this.el_[t]}}),["volume","src","poster","preload","playbackRate","defaultPlaybackRate","disablePictureInPicture","crossOrigin"].forEach(function(t){It.prototype["set"+qn(t)]=function(e){this.el_[t]=e}}),["pause","load","play"].forEach(function(t){It.prototype[t]=function(){return this.el_[t]()}}),mi.withSourceHandlers(It),It.nativeSourceHandler={},It.nativeSourceHandler.canPlayType=function(t){try{return It.TEST_VID.canPlayType(t)}catch{return""}},It.nativeSourceHandler.canHandleSource=function(t,e){if(t.type)return It.nativeSourceHandler.canPlayType(t.type);if(t.src){const i=hw(t.src);return It.nativeSourceHandler.canPlayType(`video/${i}`)}return""},It.nativeSourceHandler.handleSource=function(t,e,i){e.setSrc(t.src)},It.nativeSourceHandler.dispose=function(){},It.registerSourceHandler(It.nativeSourceHandler),mi.registerTech("Html5",It);const hk=["progress","abort","suspend","emptied","stalled","loadedmetadata","loadeddata","timeupdate","resize","volumechange","texttrackchange"],Mw={canplay:"CanPlay",canplaythrough:"CanPlayThrough",playing:"Playing",seeked:"Seeked"},Fw=["tiny","xsmall","small","medium","large","xlarge","huge"],Xy={};Fw.forEach(t=>{const e=t.charAt(0)==="x"?`x-${t.substring(1)}`:t;Xy[t]=`vjs-layout-${e}`});const yq={tiny:210,xsmall:320,small:425,medium:768,large:1440,xlarge:2560,huge:1/0};class Cn extends Xe{constructor(e,i,n){if(e.id=e.id||i.id||`vjs_video_${_o()}`,i=Object.assign(Cn.getTagSettings(e),i),i.initChildren=!1,i.createEl=!1,i.evented=!1,i.reportTouchActivity=!1,!i.language){const o=e.closest("[lang]");o&&(i.language=o.getAttribute("lang"))}if(super(null,i,n),this.boundDocumentFullscreenChange_=o=>this.documentFullscreenChange_(o),this.boundFullWindowOnEscKey_=o=>this.fullWindowOnEscKey(o),this.boundUpdateStyleEl_=o=>this.updateStyleEl_(o),this.boundApplyInitTime_=o=>this.applyInitTime_(o),this.boundUpdateCurrentBreakpoint_=o=>this.updateCurrentBreakpoint_(o),this.boundHandleTechClick_=o=>this.handleTechClick_(o),this.boundHandleTechDoubleClick_=o=>this.handleTechDoubleClick_(o),this.boundHandleTechTouchStart_=o=>this.handleTechTouchStart_(o),this.boundHandleTechTouchMove_=o=>this.handleTechTouchMove_(o),this.boundHandleTechTouchEnd_=o=>this.handleTechTouchEnd_(o),this.boundHandleTechTap_=o=>this.handleTechTap_(o),this.boundUpdatePlayerHeightOnAudioOnlyMode_=o=>this.updatePlayerHeightOnAudioOnlyMode_(o),this.isFullscreen_=!1,this.log=DD(this.id_),this.fsApi_=_y,this.isPosterFromTech_=!1,this.queuedCallbacks_=[],this.isReady_=!1,this.hasStarted_=!1,this.userActive_=!1,this.debugEnabled_=!1,this.audioOnlyMode_=!1,this.audioPosterMode_=!1,this.audioOnlyCache_={controlBarHeight:null,playerHeight:null,hiddenChildren:[]},!this.options_||!this.options_.techOrder||!this.options_.techOrder.length)throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");if(this.tag=e,this.tagAttributes=e&&gu(e),this.language(this.options_.language),i.languages){const o={};Object.getOwnPropertyNames(i.languages).forEach(function(u){o[u.toLowerCase()]=i.languages[u]}),this.languages_=o}else this.languages_=Cn.prototype.options_.languages;this.resetCache_(),this.poster_=i.poster||"",this.controls_=!!i.controls,e.controls=!1,e.removeAttribute("controls"),this.changingSrc_=!1,this.playCallbacks_=[],this.playTerminatedQueue_=[],e.hasAttribute("autoplay")?this.autoplay(!0):this.autoplay(this.options_.autoplay),i.plugins&&Object.keys(i.plugins).forEach(o=>{if(typeof this[o]!="function")throw new Error(`plugin "${o}" does not exist`)}),this.scrubbing_=!1,this.el_=this.createEl(),nw(this,{eventBusKey:"el_"}),this.fsApi_.requestFullscreen&&(Js(mt,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),this.on(this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_)),this.fluid_&&this.on(["playerreset","resize"],this.boundUpdateStyleEl_);const r=ln(this.options_);if(i.plugins&&Object.keys(i.plugins).forEach(o=>{this[o](i.plugins[o])}),i.debug&&this.debug(!0),this.options_.playerOptions=r,this.middleware_=[],this.playbackRates(i.playbackRates),i.experimentalSvgIcons){const u=new _e.DOMParser().parseFromString(UW,"image/svg+xml");if(u.querySelector("parsererror"))xi.warn("Failed to load SVG Icons. Falling back to Font Icons."),this.options_.experimentalSvgIcons=null;else{const p=u.documentElement;p.style.display="none",this.el_.appendChild(p),this.addClass("vjs-svg-icons-enabled")}}this.initChildren(),this.isAudio(e.nodeName.toLowerCase()==="audio"),this.controls()?this.addClass("vjs-controls-enabled"):this.addClass("vjs-controls-disabled"),this.el_.setAttribute("role","region"),this.isAudio()?this.el_.setAttribute("aria-label",this.localize("Audio Player")):this.el_.setAttribute("aria-label",this.localize("Video Player")),this.isAudio()&&this.addClass("vjs-audio"),i.spatialNavigation&&i.spatialNavigation.enabled&&(this.spatialNavigation=new zW(this),this.addClass("vjs-spatial-navigation-enabled")),kp&&this.addClass("vjs-touch-enabled"),Jr||this.addClass("vjs-workinghover"),Cn.players[this.id_]=this;const s=W_.split(".")[0];this.addClass(`vjs-v${s}`),this.userActive(!0),this.reportUserActivity(),this.one("play",o=>this.listenForUserActivity_(o)),this.on("keydown",o=>this.handleKeyDown(o)),this.on("languagechange",o=>this.handleLanguagechange(o)),this.breakpoints(this.options_.breakpoints),this.responsive(this.options_.responsive),this.on("ready",()=>{this.audioPosterMode(this.options_.audioPosterMode),this.audioOnlyMode(this.options_.audioOnlyMode)})}dispose(){this.trigger("dispose"),this.off("dispose"),$r(mt,this.fsApi_.fullscreenchange,this.boundDocumentFullscreenChange_),$r(mt,"keydown",this.boundFullWindowOnEscKey_),this.styleEl_&&this.styleEl_.parentNode&&(this.styleEl_.parentNode.removeChild(this.styleEl_),this.styleEl_=null),Cn.players[this.id_]=null,this.tag&&this.tag.player&&(this.tag.player=null),this.el_&&this.el_.player&&(this.el_.player=null),this.tech_&&(this.tech_.dispose(),this.isPosterFromTech_=!1,this.poster_=""),this.playerElIngest_&&(this.playerElIngest_=null),this.tag&&(this.tag=null),FW(this),bs.names.forEach(e=>{const i=bs[e],n=this[i.getterName]();n&&n.off&&n.off()}),super.dispose({restoreEl:this.options_.restoreEl})}createEl(){let e=this.tag,i,n=this.playerElIngest_=e.parentNode&&e.parentNode.hasAttribute&&e.parentNode.hasAttribute("data-vjs-player");const r=this.tag.tagName.toLowerCase()==="video-js";n?i=this.el_=e.parentNode:r||(i=this.el_=super.createEl("div"));const s=gu(e);if(r){for(i=this.el_=e,e=this.tag=mt.createElement("video");i.children.length;)e.appendChild(i.firstChild);Ip(i,"video-js")||bc(i,"video-js"),i.appendChild(e),n=this.playerElIngest_=i,Object.keys(i).forEach(h=>{try{e[h]=i[h]}catch{}})}e.setAttribute("tabindex","-1"),s.tabindex="-1",wa&&Ey&&(e.setAttribute("role","application"),s.role="application"),e.removeAttribute("width"),e.removeAttribute("height"),"width"in s&&delete s.width,"height"in s&&delete s.height,Object.getOwnPropertyNames(s).forEach(function(h){r&&h==="class"||i.setAttribute(h,s[h]),r&&e.setAttribute(h,s[h])}),e.playerId=e.id,e.id+="_html5_api",e.className="vjs-tech",e.player=i.player=this,this.addClass("vjs-paused");const o=["IS_SMART_TV","IS_TIZEN","IS_WEBOS","IS_ANDROID","IS_IPAD","IS_IPHONE","IS_CHROMECAST_RECEIVER"].filter(h=>FD[h]).map(h=>"vjs-device-"+h.substring(3).toLowerCase().replace(/\_/g,"-"));if(this.addClass(...o),_e.VIDEOJS_NO_DYNAMIC_STYLE!==!0){this.styleEl_=JD("vjs-styles-dimensions");const h=yu(".vjs-styles-defaults"),p=yu("head");p.insertBefore(this.styleEl_,h?h.nextSibling:p.firstChild)}this.fill_=!1,this.fluid_=!1,this.width(this.options_.width),this.height(this.options_.height),this.fill(this.options_.fill),this.fluid(this.options_.fluid),this.aspectRatio(this.options_.aspectRatio),this.crossOrigin(this.options_.crossOrigin||this.options_.crossorigin);const u=e.getElementsByTagName("a");for(let h=0;h"u")return this.techGet_("crossOrigin");if(e!==null&&e!=="anonymous"&&e!=="use-credentials"){xi.warn(`crossOrigin must be null, "anonymous" or "use-credentials", given "${e}"`);return}this.techCall_("setCrossOrigin",e),this.posterImage&&this.posterImage.crossOrigin(e)}width(e){return this.dimension("width",e)}height(e){return this.dimension("height",e)}dimension(e,i){const n=e+"_";if(i===void 0)return this[n]||0;if(i===""||i==="auto"){this[n]=void 0,this.updateStyleEl_();return}const r=parseFloat(i);if(isNaN(r)){xi.error(`Improper value "${i}" supplied for for ${e}`);return}this[n]=r,this.updateStyleEl_()}fluid(e){if(e===void 0)return!!this.fluid_;this.fluid_=!!e,bl(this)&&this.off(["playerreset","resize"],this.boundUpdateStyleEl_),e?(this.addClass("vjs-fluid"),this.fill(!1),pW(this,()=>{this.on(["playerreset","resize"],this.boundUpdateStyleEl_)})):this.removeClass("vjs-fluid"),this.updateStyleEl_()}fill(e){if(e===void 0)return!!this.fill_;this.fill_=!!e,e?(this.addClass("vjs-fill"),this.fluid(!1)):this.removeClass("vjs-fill")}aspectRatio(e){if(e===void 0)return this.aspectRatio_;if(!/^\d+\:\d+$/.test(e))throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");this.aspectRatio_=e,this.fluid(!0),this.updateStyleEl_()}updateStyleEl_(){if(_e.VIDEOJS_NO_DYNAMIC_STYLE===!0){const u=typeof this.width_=="number"?this.width_:this.options_.width,h=typeof this.height_=="number"?this.height_:this.options_.height,p=this.tech_&&this.tech_.el();p&&(u>=0&&(p.width=u),h>=0&&(p.height=h));return}let e,i,n,r;this.aspectRatio_!==void 0&&this.aspectRatio_!=="auto"?n=this.aspectRatio_:this.videoWidth()>0?n=this.videoWidth()+":"+this.videoHeight():n="16:9";const s=n.split(":"),o=s[1]/s[0];this.width_!==void 0?e=this.width_:this.height_!==void 0?e=this.height_/o:e=this.videoWidth()||300,this.height_!==void 0?i=this.height_:i=e*o,/^[^a-zA-Z]/.test(this.id())?r="dimensions-"+this.id():r=this.id()+"-dimensions",this.addClass(r),$D(this.styleEl_,` .${r} { width: ${e}px; height: ${i}px; } .${r}.vjs-fluid:not(.vjs-audio-only-mode) { padding-top: ${o*100}%; } `)}loadTech_(e,i){this.tech_&&this.unloadTech_();const n=qn(e),r=e.charAt(0).toLowerCase()+e.slice(1);n!=="Html5"&&this.tag&&(mi.getTech("Html5").disposeMediaElement(this.tag),this.tag.player=null,this.tag=null),this.techName_=n,this.isReady_=!1;let s=this.autoplay();(typeof this.autoplay()=="string"||this.autoplay()===!0&&this.options_.normalizeAutoplay)&&(s=!1);const o={source:i,autoplay:s,nativeControlsForTouch:this.options_.nativeControlsForTouch,playerId:this.id(),techId:`${this.id()}_${r}_api`,playsinline:this.options_.playsinline,preload:this.options_.preload,loop:this.options_.loop,disablePictureInPicture:this.options_.disablePictureInPicture,muted:this.options_.muted,poster:this.poster(),language:this.language(),playerElIngest:this.playerElIngest_||!1,"vtt.js":this.options_["vtt.js"],canOverridePoster:!!this.options_.techCanOverridePoster,enableSourceset:this.options_.enableSourceset};bs.names.forEach(h=>{const p=bs[h];o[p.getterName]=this[p.privateName]}),Object.assign(o,this.options_[n]),Object.assign(o,this.options_[r]),Object.assign(o,this.options_[e.toLowerCase()]),this.tag&&(o.tag=this.tag),i&&i.src===this.cache_.src&&this.cache_.currentTime>0&&(o.startTime=this.cache_.currentTime);const u=mi.getTech(e);if(!u)throw new Error(`No Tech named '${n}' exists! '${n}' should be registered using videojs.registerTech()'`);this.tech_=new u(o),this.tech_.ready(bn(this,this.handleTechReady_),!0),dP.jsonToTextTracks(this.textTracksJson_||[],this.tech_),hk.forEach(h=>{this.on(this.tech_,h,p=>this[`handleTech${qn(h)}_`](p))}),Object.keys(Mw).forEach(h=>{this.on(this.tech_,h,p=>{if(this.tech_.playbackRate()===0&&this.tech_.seeking()){this.queuedCallbacks_.push({callback:this[`handleTech${Mw[h]}_`].bind(this),event:p});return}this[`handleTech${Mw[h]}_`](p)})}),this.on(this.tech_,"loadstart",h=>this.handleTechLoadStart_(h)),this.on(this.tech_,"sourceset",h=>this.handleTechSourceset_(h)),this.on(this.tech_,"waiting",h=>this.handleTechWaiting_(h)),this.on(this.tech_,"ended",h=>this.handleTechEnded_(h)),this.on(this.tech_,"seeking",h=>this.handleTechSeeking_(h)),this.on(this.tech_,"play",h=>this.handleTechPlay_(h)),this.on(this.tech_,"pause",h=>this.handleTechPause_(h)),this.on(this.tech_,"durationchange",h=>this.handleTechDurationChange_(h)),this.on(this.tech_,"fullscreenchange",(h,p)=>this.handleTechFullscreenChange_(h,p)),this.on(this.tech_,"fullscreenerror",(h,p)=>this.handleTechFullscreenError_(h,p)),this.on(this.tech_,"enterpictureinpicture",h=>this.handleTechEnterPictureInPicture_(h)),this.on(this.tech_,"leavepictureinpicture",h=>this.handleTechLeavePictureInPicture_(h)),this.on(this.tech_,"error",h=>this.handleTechError_(h)),this.on(this.tech_,"posterchange",h=>this.handleTechPosterChange_(h)),this.on(this.tech_,"textdata",h=>this.handleTechTextData_(h)),this.on(this.tech_,"ratechange",h=>this.handleTechRateChange_(h)),this.on(this.tech_,"loadedmetadata",this.boundUpdateStyleEl_),this.usingNativeControls(this.techGet_("controls")),this.controls()&&!this.usingNativeControls()&&this.addTechControlsListeners_(),this.tech_.el().parentNode!==this.el()&&(n!=="Html5"||!this.tag)&&Y_(this.tech_.el(),this.el()),this.tag&&(this.tag.player=null,this.tag=null)}unloadTech_(){bs.names.forEach(e=>{const i=bs[e];this[i.privateName]=this[i.getterName]()}),this.textTracksJson_=dP.textTracksToJson(this.tech_),this.isReady_=!1,this.tech_.dispose(),this.tech_=!1,this.isPosterFromTech_&&(this.poster_="",this.trigger("posterchange")),this.isPosterFromTech_=!1}tech(e){return e===void 0&&xi.warn(`Using the tech directly can be dangerous. I hope you know what you're doing. See https://github.com/videojs/video.js/issues/2617 for more info. `),this.tech_}version(){return{"video.js":W_}}addTechControlsListeners_(){this.removeTechControlsListeners_(),this.on(this.tech_,"click",this.boundHandleTechClick_),this.on(this.tech_,"dblclick",this.boundHandleTechDoubleClick_),this.on(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.on(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.on(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.on(this.tech_,"tap",this.boundHandleTechTap_)}removeTechControlsListeners_(){this.off(this.tech_,"tap",this.boundHandleTechTap_),this.off(this.tech_,"touchstart",this.boundHandleTechTouchStart_),this.off(this.tech_,"touchmove",this.boundHandleTechTouchMove_),this.off(this.tech_,"touchend",this.boundHandleTechTouchEnd_),this.off(this.tech_,"click",this.boundHandleTechClick_),this.off(this.tech_,"dblclick",this.boundHandleTechDoubleClick_)}handleTechReady_(){this.triggerReady(),this.cache_.volume&&this.techCall_("setVolume",this.cache_.volume),this.handleTechPosterChange_(),this.handleTechDurationChange_()}handleTechLoadStart_(){this.removeClass("vjs-ended","vjs-seeking"),this.error(null),this.handleTechDurationChange_(),this.paused()?(this.hasStarted(!1),this.trigger("loadstart")):this.trigger("loadstart"),this.manualAutoplay_(this.autoplay()===!0&&this.options_.normalizeAutoplay?"play":this.autoplay())}manualAutoplay_(e){if(!this.tech_||typeof e!="string")return;const i=()=>{const r=this.muted();this.muted(!0);const s=()=>{this.muted(r)};this.playTerminatedQueue_.push(s);const o=this.play();if(Fp(o))return o.catch(u=>{throw s(),new Error(`Rejection at manualAutoplay. Restoring muted value. ${u||""}`)})};let n;if(e==="any"&&!this.muted()?(n=this.play(),Fp(n)&&(n=n.catch(i))):e==="muted"&&!this.muted()?n=i():n=this.play(),!!Fp(n))return n.then(()=>{this.trigger({type:"autoplay-success",autoplay:e})}).catch(()=>{this.trigger({type:"autoplay-failure",autoplay:e})})}updateSourceCaches_(e=""){let i=e,n="";typeof i!="string"&&(i=e.src,n=e.type),this.cache_.source=this.cache_.source||{},this.cache_.sources=this.cache_.sources||[],i&&!n&&(n=HW(this,i)),this.cache_.source=ln({},e,{src:i,type:n});const r=this.cache_.sources.filter(h=>h.src&&h.src===i),s=[],o=this.$$("source"),u=[];for(let h=0;hthis.updateSourceCaches_(s);const n=this.currentSource().src,r=e.src;n&&!/^blob:/.test(n)&&/^blob:/.test(r)&&(!this.lastSource_||this.lastSource_.tech!==r&&this.lastSource_.player!==n)&&(i=()=>{}),i(r),e.src||this.tech_.any(["sourceset","loadstart"],s=>{if(s.type==="sourceset")return;const o=this.techGet_("currentSrc");this.lastSource_.tech=o,this.updateSourceCaches_(o)})}this.lastSource_={player:this.currentSource().src,tech:e.src},this.trigger({src:e.src,type:"sourceset"})}hasStarted(e){if(e===void 0)return this.hasStarted_;e!==this.hasStarted_&&(this.hasStarted_=e,this.hasStarted_?this.addClass("vjs-has-started"):this.removeClass("vjs-has-started"))}handleTechPlay_(){this.removeClass("vjs-ended","vjs-paused"),this.addClass("vjs-playing"),this.hasStarted(!0),this.trigger("play")}handleTechRateChange_(){this.tech_.playbackRate()>0&&this.cache_.lastPlaybackRate===0&&(this.queuedCallbacks_.forEach(e=>e.callback(e.event)),this.queuedCallbacks_=[]),this.cache_.lastPlaybackRate=this.tech_.playbackRate(),this.trigger("ratechange")}handleTechWaiting_(){this.addClass("vjs-waiting"),this.trigger("waiting");const e=this.currentTime(),i=()=>{e!==this.currentTime()&&(this.removeClass("vjs-waiting"),this.off("timeupdate",i))};this.on("timeupdate",i)}handleTechCanPlay_(){this.removeClass("vjs-waiting"),this.trigger("canplay")}handleTechCanPlayThrough_(){this.removeClass("vjs-waiting"),this.trigger("canplaythrough")}handleTechPlaying_(){this.removeClass("vjs-waiting"),this.trigger("playing")}handleTechSeeking_(){this.addClass("vjs-seeking"),this.trigger("seeking")}handleTechSeeked_(){this.removeClass("vjs-seeking","vjs-ended"),this.trigger("seeked")}handleTechPause_(){this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.trigger("pause")}handleTechEnded_(){this.addClass("vjs-ended"),this.removeClass("vjs-waiting"),this.options_.loop?(this.currentTime(0),this.play()):this.paused()||this.pause(),this.trigger("ended")}handleTechDurationChange_(){this.duration(this.techGet_("duration"))}handleTechClick_(e){this.controls_&&(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.click===void 0||this.options_.userActions.click!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.click=="function"?this.options_.userActions.click.call(this,e):this.paused()?xa(this.play()):this.pause())}handleTechDoubleClick_(e){if(!this.controls_)return;Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"),n=>n.contains(e.target))||(this.options_===void 0||this.options_.userActions===void 0||this.options_.userActions.doubleClick===void 0||this.options_.userActions.doubleClick!==!1)&&(this.options_!==void 0&&this.options_.userActions!==void 0&&typeof this.options_.userActions.doubleClick=="function"?this.options_.userActions.doubleClick.call(this,e):this.isInPictureInPicture()&&!mt.pictureInPictureElement?this.exitPictureInPicture():this.isFullscreen()?this.exitFullscreen():this.requestFullscreen())}handleTechTap_(){this.userActive(!this.userActive())}handleTechTouchStart_(){this.userWasActive=this.userActive()}handleTechTouchMove_(){this.userWasActive&&this.reportUserActivity()}handleTechTouchEnd_(e){e.cancelable&&e.preventDefault()}toggleFullscreenClass_(){this.isFullscreen()?this.addClass("vjs-fullscreen"):this.removeClass("vjs-fullscreen")}documentFullscreenChange_(e){const i=e.target.player;if(i&&i!==this)return;const n=this.el();let r=mt[this.fsApi_.fullscreenElement]===n;!r&&n.matches&&(r=n.matches(":"+this.fsApi_.fullscreen)),this.isFullscreen(r)}handleTechFullscreenChange_(e,i){i&&(i.nativeIOSFullscreen&&(this.addClass("vjs-ios-native-fs"),this.tech_.one("webkitendfullscreen",()=>{this.removeClass("vjs-ios-native-fs")})),this.isFullscreen(i.isFullscreen))}handleTechFullscreenError_(e,i){this.trigger("fullscreenerror",i)}togglePictureInPictureClass_(){this.isInPictureInPicture()?this.addClass("vjs-picture-in-picture"):this.removeClass("vjs-picture-in-picture")}handleTechEnterPictureInPicture_(e){this.isInPictureInPicture(!0)}handleTechLeavePictureInPicture_(e){this.isInPictureInPicture(!1)}handleTechError_(){const e=this.tech_.error();e&&this.error(e)}handleTechTextData_(){let e=null;arguments.length>1&&(e=arguments[1]),this.trigger("textdata",e)}getCache(){return this.cache_}resetCache_(){this.cache_={currentTime:0,initTime:0,inactivityTimeout:this.options_.inactivityTimeout,duration:NaN,lastVolume:1,lastPlaybackRate:this.defaultPlaybackRate(),media:null,src:"",source:{},sources:[],playbackRates:[],volume:1}}techCall_(e,i){this.ready(function(){if(e in LW)return RW(this.middleware_,this.tech_,e,i);if(e in _P)return bP(this.middleware_,this.tech_,e,i);try{this.tech_&&this.tech_[e](i)}catch(n){throw xi(n),n}},!0)}techGet_(e){if(!(!this.tech_||!this.tech_.isReady_)){if(e in OW)return IW(this.middleware_,this.tech_,e);if(e in _P)return bP(this.middleware_,this.tech_,e);try{return this.tech_[e]()}catch(i){throw this.tech_[e]===void 0?(xi(`Video.js: ${e} method not defined for ${this.techName_} playback technology.`,i),i):i.name==="TypeError"?(xi(`Video.js: ${e} unavailable on ${this.techName_} playback technology element.`,i),this.tech_.isReady_=!1,i):(xi(i),i)}}}play(){return new Promise(e=>{this.play_(e)})}play_(e=xa){this.playCallbacks_.push(e);const i=!!(!this.changingSrc_&&(this.src()||this.currentSrc())),n=!!(Iy||Jr);if(this.waitToPlay_&&(this.off(["ready","loadstart"],this.waitToPlay_),this.waitToPlay_=null),!this.isReady_||!i){this.waitToPlay_=o=>{this.play_()},this.one(["ready","loadstart"],this.waitToPlay_),!i&&n&&this.load();return}const r=this.techGet_("play");n&&this.hasClass("vjs-ended")&&this.resetProgressBar_(),r===null?this.runPlayTerminatedQueue_():this.runPlayCallbacks_(r)}runPlayTerminatedQueue_(){const e=this.playTerminatedQueue_.slice(0);this.playTerminatedQueue_=[],e.forEach(function(i){i()})}runPlayCallbacks_(e){const i=this.playCallbacks_.slice(0);this.playCallbacks_=[],this.playTerminatedQueue_=[],i.forEach(function(n){n(e)})}pause(){this.techCall_("pause")}paused(){return this.techGet_("paused")!==!1}played(){return this.techGet_("played")||jo(0,0)}scrubbing(e){if(typeof e>"u")return this.scrubbing_;this.scrubbing_=!!e,this.techCall_("setScrubbing",this.scrubbing_),e?this.addClass("vjs-scrubbing"):this.removeClass("vjs-scrubbing")}currentTime(e){if(e===void 0)return this.cache_.currentTime=this.techGet_("currentTime")||0,this.cache_.currentTime;if(e<0&&(e=0),!this.isReady_||this.changingSrc_||!this.tech_||!this.tech_.isReady_){this.cache_.initTime=e,this.off("canplay",this.boundApplyInitTime_),this.one("canplay",this.boundApplyInitTime_);return}this.techCall_("setCurrentTime",e),this.cache_.initTime=0,isFinite(e)&&(this.cache_.currentTime=Number(e))}applyInitTime_(){this.currentTime(this.cache_.initTime)}duration(e){if(e===void 0)return this.cache_.duration!==void 0?this.cache_.duration:NaN;e=parseFloat(e),e<0&&(e=1/0),e!==this.cache_.duration&&(this.cache_.duration=e,e===1/0?this.addClass("vjs-live"):this.removeClass("vjs-live"),isNaN(e)||this.trigger("durationchange"))}remainingTime(){return this.duration()-this.currentTime()}remainingTimeDisplay(){return Math.floor(this.duration())-Math.floor(this.currentTime())}buffered(){let e=this.techGet_("buffered");return(!e||!e.length)&&(e=jo(0,0)),e}seekable(){let e=this.techGet_("seekable");return(!e||!e.length)&&(e=jo(0,0)),e}seeking(){return this.techGet_("seeking")}ended(){return this.techGet_("ended")}networkState(){return this.techGet_("networkState")}readyState(){return this.techGet_("readyState")}bufferedPercent(){return cP(this.buffered(),this.duration())}bufferedEnd(){const e=this.buffered(),i=this.duration();let n=e.end(e.length-1);return n>i&&(n=i),n}volume(e){let i;if(e!==void 0){i=Math.max(0,Math.min(1,e)),this.cache_.volume=i,this.techCall_("setVolume",i),i>0&&this.lastVolume_(i);return}return i=parseFloat(this.techGet_("volume")),isNaN(i)?1:i}muted(e){if(e!==void 0){this.techCall_("setMuted",e);return}return this.techGet_("muted")||!1}defaultMuted(e){return e!==void 0&&this.techCall_("setDefaultMuted",e),this.techGet_("defaultMuted")||!1}lastVolume_(e){if(e!==void 0&&e!==0){this.cache_.lastVolume=e;return}return this.cache_.lastVolume}supportsFullScreen(){return this.techGet_("supportsFullScreen")||!1}isFullscreen(e){if(e!==void 0){const i=this.isFullscreen_;this.isFullscreen_=!!e,this.isFullscreen_!==i&&this.fsApi_.prefixed&&this.trigger("fullscreenchange"),this.toggleFullscreenClass_();return}return this.isFullscreen_}requestFullscreen(e){this.isInPictureInPicture()&&this.exitPictureInPicture();const i=this;return new Promise((n,r)=>{function s(){i.off("fullscreenerror",u),i.off("fullscreenchange",o)}function o(){s(),n()}function u(p,g){s(),r(g)}i.one("fullscreenchange",o),i.one("fullscreenerror",u);const h=i.requestFullscreenHelper_(e);h&&(h.then(s,s),h.then(n,r))})}requestFullscreenHelper_(e){let i;if(this.fsApi_.prefixed||(i=this.options_.fullscreen&&this.options_.fullscreen.options||{},e!==void 0&&(i=e)),this.fsApi_.requestFullscreen){const n=this.el_[this.fsApi_.requestFullscreen](i);return n&&n.then(()=>this.isFullscreen(!0),()=>this.isFullscreen(!1)),n}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("enterFullScreen"):this.enterFullWindow()}exitFullscreen(){const e=this;return new Promise((i,n)=>{function r(){e.off("fullscreenerror",o),e.off("fullscreenchange",s)}function s(){r(),i()}function o(h,p){r(),n(p)}e.one("fullscreenchange",s),e.one("fullscreenerror",o);const u=e.exitFullscreenHelper_();u&&(u.then(r,r),u.then(i,n))})}exitFullscreenHelper_(){if(this.fsApi_.requestFullscreen){const e=mt[this.fsApi_.exitFullscreen]();return e&&xa(e.then(()=>this.isFullscreen(!1))),e}else this.tech_.supportsFullScreen()&&!this.options_.preferFullWindow?this.techCall_("exitFullScreen"):this.exitFullWindow()}enterFullWindow(){this.isFullscreen(!0),this.isFullWindow=!0,this.docOrigOverflow=mt.documentElement.style.overflow,Js(mt,"keydown",this.boundFullWindowOnEscKey_),mt.documentElement.style.overflow="hidden",bc(mt.body,"vjs-full-window"),this.trigger("enterFullWindow")}fullWindowOnEscKey(e){e.key==="Escape"&&this.isFullscreen()===!0&&(this.isFullWindow?this.exitFullWindow():this.exitFullscreen())}exitFullWindow(){this.isFullscreen(!1),this.isFullWindow=!1,$r(mt,"keydown",this.boundFullWindowOnEscKey_),mt.documentElement.style.overflow=this.docOrigOverflow,Ry(mt.body,"vjs-full-window"),this.trigger("exitFullWindow")}disablePictureInPicture(e){if(e===void 0)return this.techGet_("disablePictureInPicture");this.techCall_("setDisablePictureInPicture",e),this.options_.disablePictureInPicture=e,this.trigger("disablepictureinpicturechanged")}isInPictureInPicture(e){if(e!==void 0){this.isInPictureInPicture_=!!e,this.togglePictureInPictureClass_();return}return!!this.isInPictureInPicture_}requestPictureInPicture(){if(this.options_.enableDocumentPictureInPicture&&_e.documentPictureInPicture){const e=mt.createElement(this.el().tagName);return e.classList=this.el().classList,e.classList.add("vjs-pip-container"),this.posterImage&&e.appendChild(this.posterImage.el().cloneNode(!0)),this.titleBar&&e.appendChild(this.titleBar.el().cloneNode(!0)),e.appendChild($t("p",{className:"vjs-pip-text"},{},this.localize("Playing in picture-in-picture"))),_e.documentPictureInPicture.requestWindow({width:this.videoWidth(),height:this.videoHeight()}).then(i=>(XD(i),this.el_.parentNode.insertBefore(e,this.el_),i.document.body.appendChild(this.el_),i.document.body.classList.add("vjs-pip-window"),this.player_.isInPictureInPicture(!0),this.player_.trigger({type:"enterpictureinpicture",pipWindow:i}),i.addEventListener("pagehide",n=>{const r=n.target.querySelector(".video-js");e.parentNode.replaceChild(r,e),this.player_.isInPictureInPicture(!1),this.player_.trigger("leavepictureinpicture")}),i))}return"pictureInPictureEnabled"in mt&&this.disablePictureInPicture()===!1?this.techGet_("requestPictureInPicture"):Promise.reject("No PiP mode is available")}exitPictureInPicture(){if(_e.documentPictureInPicture&&_e.documentPictureInPicture.window)return _e.documentPictureInPicture.window.close(),Promise.resolve();if("pictureInPictureEnabled"in mt)return mt.exitPictureInPicture()}handleKeyDown(e){const{userActions:i}=this.options_;!i||!i.hotkeys||(r=>{const s=r.tagName.toLowerCase();if(r.isContentEditable)return!0;const o=["button","checkbox","hidden","radio","reset","submit"];return s==="input"?o.indexOf(r.type)===-1:["textarea"].indexOf(s)!==-1})(this.el_.ownerDocument.activeElement)||(typeof i.hotkeys=="function"?i.hotkeys.call(this,e):this.handleHotkeys(e))}handleHotkeys(e){const i=this.options_.userActions?this.options_.userActions.hotkeys:{},{fullscreenKey:n=o=>e.key.toLowerCase()==="f",muteKey:r=o=>e.key.toLowerCase()==="m",playPauseKey:s=o=>e.key.toLowerCase()==="k"||e.key.toLowerCase()===" "}=i;if(n.call(this,e)){e.preventDefault(),e.stopPropagation();const o=Xe.getComponent("FullscreenToggle");mt[this.fsApi_.fullscreenEnabled]!==!1&&o.prototype.handleClick.call(this,e)}else r.call(this,e)?(e.preventDefault(),e.stopPropagation(),Xe.getComponent("MuteToggle").prototype.handleClick.call(this,e)):s.call(this,e)&&(e.preventDefault(),e.stopPropagation(),Xe.getComponent("PlayToggle").prototype.handleClick.call(this,e))}canPlayType(e){let i;for(let n=0,r=this.options_.techOrder;n[u,mi.getTech(u)]).filter(([u,h])=>h?h.isSupported():(xi.error(`The "${u}" tech is undefined. Skipped browser support check for that tech.`),!1)),n=function(u,h,p){let g;return u.some(y=>h.some(S=>{if(g=p(y,S),g)return!0})),g};let r;const s=u=>(h,p)=>u(p,h),o=([u,h],p)=>{if(h.canPlaySource(p,this.options_[u.toLowerCase()]))return{source:p,tech:u}};return this.options_.sourceOrder?r=n(e,i,s(o)):r=n(i,e,o),r||!1}handleSrc_(e,i){if(typeof e>"u")return this.cache_.src||"";this.resetRetryOnError_&&this.resetRetryOnError_();const n=wP(e);if(!n.length){this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0);return}if(this.changingSrc_=!0,i||(this.cache_.sources=n),this.updateSourceCaches_(n[0]),PW(this,n[0],(r,s)=>{if(this.middleware_=s,i||(this.cache_.sources=n),this.updateSourceCaches_(r),this.src_(r)){if(n.length>1)return this.handleSrc_(n.slice(1));this.changingSrc_=!1,this.setTimeout(function(){this.error({code:4,message:this.options_.notSupportedMessage})},0),this.triggerReady();return}kW(s,this.tech_)}),n.length>1){const r=()=>{this.error(null),this.handleSrc_(n.slice(1),!0)},s=()=>{this.off("error",r)};this.one("error",r),this.one("playing",s),this.resetRetryOnError_=()=>{this.off("error",r),this.off("playing",s)}}}src(e){return this.handleSrc_(e,!1)}src_(e){const i=this.selectSource([e]);return i?sP(i.tech,this.techName_)?(this.ready(function(){this.tech_.constructor.prototype.hasOwnProperty("setSource")?this.techCall_("setSource",e):this.techCall_("src",e.src),this.changingSrc_=!1},!0),!1):(this.changingSrc_=!0,this.loadTech_(i.tech,i.source),this.tech_.ready(()=>{this.changingSrc_=!1}),!1):!0}addSourceElement(e,i){return this.tech_?this.tech_.addSourceElement(e,i):!1}removeSourceElement(e){return this.tech_?this.tech_.removeSourceElement(e):!1}load(){if(this.tech_&&this.tech_.vhs){this.src(this.currentSource());return}this.techCall_("load")}reset(){if(this.paused())this.doReset_();else{const e=this.play();xa(e.then(()=>this.doReset_()))}}doReset_(){this.tech_&&this.tech_.clearTracks("text"),this.removeClass("vjs-playing"),this.addClass("vjs-paused"),this.resetCache_(),this.poster(""),this.loadTech_(this.options_.techOrder[0],null),this.techCall_("reset"),this.resetControlBarUI_(),this.error(null),this.titleBar&&this.titleBar.update({title:void 0,description:void 0}),bl(this)&&this.trigger("playerreset")}resetControlBarUI_(){this.resetProgressBar_(),this.resetPlaybackRate_(),this.resetVolumeBar_()}resetProgressBar_(){this.currentTime(0);const{currentTimeDisplay:e,durationDisplay:i,progressControl:n,remainingTimeDisplay:r}=this.controlBar||{},{seekBar:s}=n||{};e&&e.updateContent(),i&&i.updateContent(),r&&r.updateContent(),s&&(s.update(),s.loadProgressBar&&s.loadProgressBar.update())}resetPlaybackRate_(){this.playbackRate(this.defaultPlaybackRate()),this.handleTechRateChange_()}resetVolumeBar_(){this.volume(1),this.trigger("volumechange")}currentSources(){const e=this.currentSource(),i=[];return Object.keys(e).length!==0&&i.push(e),this.cache_.sources||i}currentSource(){return this.cache_.source||{}}currentSrc(){return this.currentSource()&&this.currentSource().src||""}currentType(){return this.currentSource()&&this.currentSource().type||""}preload(e){if(e!==void 0){this.techCall_("setPreload",e),this.options_.preload=e;return}return this.techGet_("preload")}autoplay(e){if(e===void 0)return this.options_.autoplay||!1;let i;typeof e=="string"&&/(any|play|muted)/.test(e)||e===!0&&this.options_.normalizeAutoplay?(this.options_.autoplay=e,this.manualAutoplay_(typeof e=="string"?e:"play"),i=!1):e?this.options_.autoplay=!0:this.options_.autoplay=!1,i=typeof i>"u"?this.options_.autoplay:i,this.tech_&&this.techCall_("setAutoplay",i)}playsinline(e){return e!==void 0&&(this.techCall_("setPlaysinline",e),this.options_.playsinline=e),this.techGet_("playsinline")}loop(e){if(e!==void 0){this.techCall_("setLoop",e),this.options_.loop=e;return}return this.techGet_("loop")}poster(e){if(e===void 0)return this.poster_;e||(e=""),e!==this.poster_&&(this.poster_=e,this.techCall_("setPoster",e),this.isPosterFromTech_=!1,this.trigger("posterchange"))}handleTechPosterChange_(){if((!this.poster_||this.options_.techCanOverridePoster)&&this.tech_&&this.tech_.poster){const e=this.tech_.poster()||"";e!==this.poster_&&(this.poster_=e,this.isPosterFromTech_=!0,this.trigger("posterchange"))}}controls(e){if(e===void 0)return!!this.controls_;e=!!e,this.controls_!==e&&(this.controls_=e,this.usingNativeControls()&&this.techCall_("setControls",e),this.controls_?(this.removeClass("vjs-controls-disabled"),this.addClass("vjs-controls-enabled"),this.trigger("controlsenabled"),this.usingNativeControls()||this.addTechControlsListeners_()):(this.removeClass("vjs-controls-enabled"),this.addClass("vjs-controls-disabled"),this.trigger("controlsdisabled"),this.usingNativeControls()||this.removeTechControlsListeners_()))}usingNativeControls(e){if(e===void 0)return!!this.usingNativeControls_;e=!!e,this.usingNativeControls_!==e&&(this.usingNativeControls_=e,this.usingNativeControls_?(this.addClass("vjs-using-native-controls"),this.trigger("usingnativecontrols")):(this.removeClass("vjs-using-native-controls"),this.trigger("usingcustomcontrols")))}error(e){if(e===void 0)return this.error_||null;if(fu("beforeerror").forEach(i=>{const n=i(this,e);if(!(_a(n)&&!Array.isArray(n)||typeof n=="string"||typeof n=="number"||n===null)){this.log.error("please return a value that MediaError expects in beforeerror hooks");return}e=n}),this.options_.suppressNotSupportedError&&e&&e.code===4){const i=function(){this.error(e)};this.options_.suppressNotSupportedError=!1,this.any(["click","touchstart"],i),this.one("loadstart",function(){this.off(["click","touchstart"],i)});return}if(e===null){this.error_=null,this.removeClass("vjs-error"),this.errorDisplay&&this.errorDisplay.close();return}this.error_=new Bn(e),this.addClass("vjs-error"),xi.error(`(CODE:${this.error_.code} ${Bn.errorTypes[this.error_.code]})`,this.error_.message,this.error_),this.trigger("error"),fu("error").forEach(i=>i(this,this.error_))}reportUserActivity(e){this.userActivity_=!0}userActive(e){if(e===void 0)return this.userActive_;if(e=!!e,e!==this.userActive_){if(this.userActive_=e,this.userActive_){this.userActivity_=!0,this.removeClass("vjs-user-inactive"),this.addClass("vjs-user-active"),this.trigger("useractive");return}this.tech_&&this.tech_.one("mousemove",function(i){i.stopPropagation(),i.preventDefault()}),this.userActivity_=!1,this.removeClass("vjs-user-active"),this.addClass("vjs-user-inactive"),this.trigger("userinactive")}}listenForUserActivity_(){let e,i,n;const r=bn(this,this.reportUserActivity),s=function(y){(y.screenX!==i||y.screenY!==n)&&(i=y.screenX,n=y.screenY,r())},o=function(){r(),this.clearInterval(e),e=this.setInterval(r,250)},u=function(y){r(),this.clearInterval(e)};this.on("mousedown",o),this.on("mousemove",s),this.on("mouseup",u),this.on("mouseleave",u);const h=this.getChild("controlBar");h&&!Jr&&!Vo&&(h.on("mouseenter",function(y){this.player().options_.inactivityTimeout!==0&&(this.player().cache_.inactivityTimeout=this.player().options_.inactivityTimeout),this.player().options_.inactivityTimeout=0}),h.on("mouseleave",function(y){this.player().options_.inactivityTimeout=this.player().cache_.inactivityTimeout})),this.on("keydown",r),this.on("keyup",r);let p;const g=function(){if(!this.userActivity_)return;this.userActivity_=!1,this.userActive(!0),this.clearTimeout(p);const y=this.options_.inactivityTimeout;y<=0||(p=this.setTimeout(function(){this.userActivity_||this.userActive(!1)},y))};this.setInterval(g,250)}playbackRate(e){if(e!==void 0){this.techCall_("setPlaybackRate",e);return}return this.tech_&&this.tech_.featuresPlaybackRate?this.cache_.lastPlaybackRate||this.techGet_("playbackRate"):1}defaultPlaybackRate(e){return e!==void 0?this.techCall_("setDefaultPlaybackRate",e):this.tech_&&this.tech_.featuresPlaybackRate?this.techGet_("defaultPlaybackRate"):1}isAudio(e){if(e!==void 0){this.isAudio_=!!e;return}return!!this.isAudio_}updatePlayerHeightOnAudioOnlyMode_(){const e=this.getChild("ControlBar");!e||this.audioOnlyCache_.controlBarHeight===e.currentHeight()||(this.audioOnlyCache_.controlBarHeight=e.currentHeight(),this.height(this.audioOnlyCache_.controlBarHeight))}enableAudioOnlyUI_(){this.addClass("vjs-audio-only-mode");const e=this.children(),i=this.getChild("ControlBar"),n=i&&i.currentHeight();e.forEach(r=>{r!==i&&r.el_&&!r.hasClass("vjs-hidden")&&(r.hide(),this.audioOnlyCache_.hiddenChildren.push(r))}),this.audioOnlyCache_.playerHeight=this.currentHeight(),this.audioOnlyCache_.controlBarHeight=n,this.on("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.height(n),this.trigger("audioonlymodechange")}disableAudioOnlyUI_(){this.removeClass("vjs-audio-only-mode"),this.off("playerresize",this.boundUpdatePlayerHeightOnAudioOnlyMode_),this.audioOnlyCache_.hiddenChildren.forEach(e=>e.show()),this.height(this.audioOnlyCache_.playerHeight),this.trigger("audioonlymodechange")}audioOnlyMode(e){if(typeof e!="boolean"||e===this.audioOnlyMode_)return this.audioOnlyMode_;if(this.audioOnlyMode_=e,e){const i=[];return this.isInPictureInPicture()&&i.push(this.exitPictureInPicture()),this.isFullscreen()&&i.push(this.exitFullscreen()),this.audioPosterMode()&&i.push(this.audioPosterMode(!1)),Promise.all(i).then(()=>this.enableAudioOnlyUI_())}return Promise.resolve().then(()=>this.disableAudioOnlyUI_())}enablePosterModeUI_(){(this.tech_&&this.tech_).hide(),this.addClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}disablePosterModeUI_(){(this.tech_&&this.tech_).show(),this.removeClass("vjs-audio-poster-mode"),this.trigger("audiopostermodechange")}audioPosterMode(e){return typeof e!="boolean"||e===this.audioPosterMode_?this.audioPosterMode_:(this.audioPosterMode_=e,e?this.audioOnlyMode()?this.audioOnlyMode(!1).then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.enablePosterModeUI_()}):Promise.resolve().then(()=>{this.disablePosterModeUI_()}))}addTextTrack(e,i,n){if(this.tech_)return this.tech_.addTextTrack(e,i,n)}addRemoteTextTrack(e,i){if(this.tech_)return this.tech_.addRemoteTextTrack(e,i)}removeRemoteTextTrack(e={}){let{track:i}=e;if(i||(i=e),this.tech_)return this.tech_.removeRemoteTextTrack(i)}getVideoPlaybackQuality(){return this.techGet_("getVideoPlaybackQuality")}videoWidth(){return this.tech_&&this.tech_.videoWidth&&this.tech_.videoWidth()||0}videoHeight(){return this.tech_&&this.tech_.videoHeight&&this.tech_.videoHeight()||0}language(e){if(e===void 0)return this.language_;this.language_!==String(e).toLowerCase()&&(this.language_=String(e).toLowerCase(),bl(this)&&this.trigger("languagechange"))}languages(){return ln(Cn.prototype.options_.languages,this.languages_)}toJSON(){const e=ln(this.options_),i=e.tracks;e.tracks=[];for(let n=0;n{this.removeChild(n)}),n.open(),n}updateCurrentBreakpoint_(){if(!this.responsive())return;const e=this.currentBreakpoint(),i=this.currentWidth();for(let n=0;nthis.addRemoteTextTrack(y,!1)),this.titleBar&&this.titleBar.update({title:g,description:o||r||""}),this.ready(i)}getMedia(){if(!this.cache_.media){const e=this.poster(),i=this.currentSources(),n=Array.prototype.map.call(this.remoteTextTracks(),s=>({kind:s.kind,label:s.label,language:s.language,src:s.src})),r={src:i,textTracks:n};return e&&(r.poster=e,r.artwork=[{src:r.poster,type:qy(r.poster)}]),r}return ln(this.cache_.media)}static getTagSettings(e){const i={sources:[],tracks:[]},n=gu(e),r=n["data-setup"];if(Ip(e,"vjs-fill")&&(n.fill=!0),Ip(e,"vjs-fluid")&&(n.fluid=!0),r!==null)try{Object.assign(n,JSON.parse(r||"{}"))}catch(s){xi.error("data-setup",s)}if(Object.assign(i,n),e.hasChildNodes()){const s=e.childNodes;for(let o=0,u=s.length;otypeof i=="number")&&(this.cache_.playbackRates=e,this.trigger("playbackrateschange"))}}bs.names.forEach(function(t){const e=bs[t];Cn.prototype[e.getterName]=function(){return this.tech_?this.tech_[e.getterName]():(this[e.privateName]=this[e.privateName]||new e.ListClass,this[e.privateName])}}),Cn.prototype.crossorigin=Cn.prototype.crossOrigin,Cn.players={};const zp=_e.navigator;Cn.prototype.options_={techOrder:mi.defaultTechOrder_,html5:{},enableSourceset:!0,inactivityTimeout:2e3,playbackRates:[],liveui:!1,children:["mediaLoader","posterImage","titleBar","textTrackDisplay","loadingSpinner","bigPlayButton","liveTracker","controlBar","errorDisplay","textTrackSettings","resizeManager"],language:zp&&(zp.languages&&zp.languages[0]||zp.userLanguage||zp.language)||"en",languages:{},notSupportedMessage:"No compatible source was found for this media.",normalizeAutoplay:!1,fullscreen:{options:{navigationUI:"hide"}},breakpoints:{},responsive:!1,audioOnlyMode:!1,audioPosterMode:!1,spatialNavigation:{enabled:!1,horizontalSeek:!1},enableSmoothSeeking:!1,disableSeekWhileScrubbingOnMobile:!1},hk.forEach(function(t){Cn.prototype[`handleTech${qn(t)}_`]=function(){return this.trigger(t)}}),Xe.registerComponent("Player",Cn);const Zy="plugin",ah="activePlugins_",lh={},Qy=t=>lh.hasOwnProperty(t),Jy=t=>Qy(t)?lh[t]:void 0,fk=(t,e)=>{t[ah]=t[ah]||{},t[ah][e]=!0},$y=(t,e,i)=>{const n=(i?"before":"")+"pluginsetup";t.trigger(n,e),t.trigger(n+":"+e.name,e)},vq=function(t,e){const i=function(){$y(this,{name:t,plugin:e,instance:null},!0);const n=e.apply(this,arguments);return fk(this,t),$y(this,{name:t,plugin:e,instance:n}),n};return Object.keys(e).forEach(function(n){i[n]=e[n]}),i},pk=(t,e)=>(e.prototype.name=t,function(...i){$y(this,{name:t,plugin:e,instance:null},!0);const n=new e(this,...i);return this[t]=()=>n,$y(this,n.getEventHash()),n});class Hs{constructor(e){if(this.constructor===Hs)throw new Error("Plugin must be sub-classed; not directly instantiated.");this.player=e,this.log||(this.log=this.player.log.createLogger(this.name)),nw(this),delete this.trigger,rP(this,this.constructor.defaultState),fk(e,this.name),this.dispose=this.dispose.bind(this),e.on("dispose",this.dispose)}version(){return this.constructor.VERSION}getEventHash(e={}){return e.name=this.name,e.plugin=this.constructor,e.instance=this,e}trigger(e,i={}){return eh(this.eventBusEl_,e,this.getEventHash(i))}handleStateChanged(e){}dispose(){const{name:e,player:i}=this;this.trigger("dispose"),this.off(),i.off("dispose",this.dispose),i[ah][e]=!1,this.player=this.state=null,i[e]=pk(e,lh[e])}static isBasic(e){const i=typeof e=="string"?Jy(e):e;return typeof i=="function"&&!Hs.prototype.isPrototypeOf(i.prototype)}static registerPlugin(e,i){if(typeof e!="string")throw new Error(`Illegal plugin name, "${e}", must be a string, was ${typeof e}.`);if(Qy(e))xi.warn(`A plugin named "${e}" already exists. You may want to avoid re-registering plugins!`);else if(Cn.prototype.hasOwnProperty(e))throw new Error(`Illegal plugin name, "${e}", cannot share a name with an existing player method!`);if(typeof i!="function")throw new Error(`Illegal plugin for "${e}", must be a function, was ${typeof i}.`);return lh[e]=i,e!==Zy&&(Hs.isBasic(i)?Cn.prototype[e]=vq(e,i):Cn.prototype[e]=pk(e,i)),i}static deregisterPlugin(e){if(e===Zy)throw new Error("Cannot de-register base plugin.");Qy(e)&&(delete lh[e],delete Cn.prototype[e])}static getPlugins(e=Object.keys(lh)){let i;return e.forEach(n=>{const r=Jy(n);r&&(i=i||{},i[n]=r)}),i}static getPluginVersion(e){const i=Jy(e);return i&&i.VERSION||""}}Hs.getPlugin=Jy,Hs.BASE_PLUGIN_NAME=Zy,Hs.registerPlugin(Zy,Hs),Cn.prototype.usingPlugin=function(t){return!!this[ah]&&this[ah][t]===!0},Cn.prototype.hasPlugin=function(t){return!!Qy(t)};function bq(t,e){let i=!1;return function(...n){return i||xi.warn(t),i=!0,e.apply(this,n)}}function Wo(t,e,i,n){return bq(`${e} is deprecated and will be removed in ${t}.0; please use ${i} instead.`,n)}var _q={NetworkBadStatus:"networkbadstatus",NetworkRequestFailed:"networkrequestfailed",NetworkRequestAborted:"networkrequestaborted",NetworkRequestTimeout:"networkrequesttimeout",NetworkBodyParserFailed:"networkbodyparserfailed",StreamingHlsPlaylistParserError:"streaminghlsplaylistparsererror",StreamingDashManifestParserError:"streamingdashmanifestparsererror",StreamingContentSteeringParserError:"streamingcontentsteeringparsererror",StreamingVttParserError:"streamingvttparsererror",StreamingFailedToSelectNextSegment:"streamingfailedtoselectnextsegment",StreamingFailedToDecryptSegment:"streamingfailedtodecryptsegment",StreamingFailedToTransmuxSegment:"streamingfailedtotransmuxsegment",StreamingFailedToAppendSegment:"streamingfailedtoappendsegment",StreamingCodecsChangeError:"streamingcodecschangeerror"};const mk=t=>t.indexOf("#")===0?t.slice(1):t;function Ve(t,e,i){let n=Ve.getPlayer(t);if(n)return e&&xi.warn(`Player "${t}" is already initialised. Options will not be applied.`),i&&n.ready(i),n;const r=typeof t=="string"?yu("#"+mk(t)):t;if(!Zd(r))throw new TypeError("The element or ID supplied is not valid. (videojs)");const o=("getRootNode"in r?r.getRootNode()instanceof _e.ShadowRoot:!1)?r.getRootNode():r.ownerDocument.body;(!r.ownerDocument.defaultView||!o.contains(r))&&xi.warn("The element supplied is not included in the DOM"),e=e||{},e.restoreEl===!0&&(e.restoreEl=(r.parentNode&&r.parentNode.hasAttribute&&r.parentNode.hasAttribute("data-vjs-player")?r.parentNode:r).cloneNode(!0)),fu("beforesetup").forEach(h=>{const p=h(r,ln(e));if(!_a(p)||Array.isArray(p)){xi.error("please return an object in beforesetup hooks");return}e=ln(e,p)});const u=Xe.getComponent("Player");return n=new u(r,e,i),fu("setup").forEach(h=>h(n)),n}if(Ve.hooks_=vl,Ve.hooks=fu,Ve.hook=tW,Ve.hookOnce=iW,Ve.removeHook=CD,_e.VIDEOJS_NO_DYNAMIC_STYLE!==!0&&Xd()){let t=yu(".vjs-styles-defaults");if(!t){t=JD("vjs-styles-defaults");const e=yu("head");e&&e.insertBefore(t,e.firstChild),$D(t,` .video-js { width: 300px; height: 150px; } .vjs-fluid:not(.vjs-audio-only-mode) { padding-top: 56.25% } `)}}Q_(1,Ve),Ve.VERSION=W_,Ve.options=Cn.prototype.options_,Ve.getPlayers=()=>Cn.players,Ve.getPlayer=t=>{const e=Cn.players;let i;if(typeof t=="string"){const n=mk(t),r=e[n];if(r)return r;i=yu("#"+n)}else i=t;if(Zd(i)){const{player:n,playerId:r}=i;if(n||e[r])return n||e[r]}},Ve.getAllPlayers=()=>Object.keys(Cn.players).map(t=>Cn.players[t]).filter(Boolean),Ve.players=Cn.players,Ve.getComponent=Xe.getComponent,Ve.registerComponent=(t,e)=>(mi.isTech(e)&&xi.warn(`The ${t} tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)`),Xe.registerComponent.call(Xe,t,e)),Ve.getTech=mi.getTech,Ve.registerTech=mi.registerTech,Ve.use=DW,Object.defineProperty(Ve,"middleware",{value:{},writeable:!1,enumerable:!0}),Object.defineProperty(Ve.middleware,"TERMINATOR",{value:Wy,writeable:!1,enumerable:!0}),Ve.browser=FD,Ve.obj=sW,Ve.mergeOptions=Wo(9,"videojs.mergeOptions","videojs.obj.merge",ln),Ve.defineLazyProperty=Wo(9,"videojs.defineLazyProperty","videojs.obj.defineLazyProperty",Ty),Ve.bind=Wo(9,"videojs.bind","native Function.prototype.bind",bn),Ve.registerPlugin=Hs.registerPlugin,Ve.deregisterPlugin=Hs.deregisterPlugin,Ve.plugin=(t,e)=>(xi.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),Hs.registerPlugin(t,e)),Ve.getPlugins=Hs.getPlugins,Ve.getPlugin=Hs.getPlugin,Ve.getPluginVersion=Hs.getPluginVersion,Ve.addLanguage=function(t,e){return t=(""+t).toLowerCase(),Ve.options.languages=ln(Ve.options.languages,{[t]:e}),Ve.options.languages[t]},Ve.log=xi,Ve.createLogger=DD,Ve.time=bW,Ve.createTimeRange=Wo(9,"videojs.createTimeRange","videojs.time.createTimeRanges",jo),Ve.createTimeRanges=Wo(9,"videojs.createTimeRanges","videojs.time.createTimeRanges",jo),Ve.formatTime=Wo(9,"videojs.formatTime","videojs.time.formatTime",wc),Ve.setFormatTime=Wo(9,"videojs.setFormatTime","videojs.time.setFormatTime",lP),Ve.resetFormatTime=Wo(9,"videojs.resetFormatTime","videojs.time.resetFormatTime",uP),Ve.parseUrl=Wo(9,"videojs.parseUrl","videojs.url.parseUrl",dw),Ve.isCrossOrigin=Wo(9,"videojs.isCrossOrigin","videojs.url.isCrossOrigin",Vy),Ve.EventTarget=$s,Ve.any=ew,Ve.on=Js,Ve.one=By,Ve.off=$r,Ve.trigger=eh,Ve.xhr=e2,Ve.TextTrack=Np,Ve.AudioTrack=yP,Ve.VideoTrack=vP,["isEl","isTextNode","createEl","hasClass","addClass","removeClass","toggleClass","setAttributes","getAttributes","emptyEl","appendContent","insertContent"].forEach(t=>{Ve[t]=function(){return xi.warn(`videojs.${t}() is deprecated; use videojs.dom.${t}() instead`),ZD[t].apply(null,arguments)}}),Ve.computedStyle=Wo(9,"videojs.computedStyle","videojs.dom.computedStyle",$d),Ve.dom=ZD,Ve.fn=fW,Ve.num=XW,Ve.str=yW,Ve.url=CW,Ve.Error=_q;/*! @name videojs-contrib-quality-levels @version 4.1.0 @license Apache-2.0 */class wq{constructor(e){let i=this;return i.id=e.id,i.label=i.id,i.width=e.width,i.height=e.height,i.bitrate=e.bandwidth,i.frameRate=e.frameRate,i.enabled_=e.enabled,Object.defineProperty(i,"enabled",{get(){return i.enabled_()},set(n){i.enabled_(n)}}),i}}class e0 extends Ve.EventTarget{constructor(){super();let e=this;return e.levels_=[],e.selectedIndex_=-1,Object.defineProperty(e,"selectedIndex",{get(){return e.selectedIndex_}}),Object.defineProperty(e,"length",{get(){return e.levels_.length}}),e[Symbol.iterator]=()=>e.levels_.values(),e}addQualityLevel(e){let i=this.getQualityLevelById(e.id);if(i)return i;const n=this.levels_.length;return i=new wq(e),""+n in this||Object.defineProperty(this,n,{get(){return this.levels_[n]}}),this.levels_.push(i),this.trigger({qualityLevel:i,type:"addqualitylevel"}),i}removeQualityLevel(e){let i=null;for(let n=0,r=this.length;nn&&this.selectedIndex_--;break}return i&&this.trigger({qualityLevel:e,type:"removequalitylevel"}),i}getQualityLevelById(e){for(let i=0,n=this.length;in,t.qualityLevels.VERSION=gk,n},yk=function(t){return Tq(this,Ve.obj.merge({},t))};Ve.registerPlugin("qualityLevels",yk),yk.VERSION=gk;/*! @name @videojs/http-streaming @version 3.17.0 @license Apache-2.0 */const Us=oy,t0=(t,e)=>e&&e.responseURL&&t!==e.responseURL?e.responseURL:t,So=t=>Ve.log.debug?Ve.log.debug.bind(Ve,"VHS:",`${t} >`):function(){};function Ji(...t){const e=Ve.obj||Ve;return(e.merge||e.mergeOptions).apply(e,t)}function xr(...t){const e=Ve.time||Ve;return(e.createTimeRanges||e.createTimeRanges).apply(e,t)}function xq(t){if(t.length===0)return"Buffered Ranges are empty";let e=`Buffered Ranges: `;for(let i=0;i ${r}. Duration (${r-n}) `}return e}const Ea=1/30,Ca=Ea*3,vk=function(t,e){const i=[];let n;if(t&&t.length)for(n=0;n=e})},i0=function(t,e){return vk(t,function(i){return i-Ea>=e})},Sq=function(t){if(t.length<2)return xr();const e=[];for(let i=1;i{const e=[];if(!t||!t.length)return"";for(let i=0;i "+t.end(i));return e.join(", ")},Cq=function(t,e,i=1){return((t.length?t.end(t.length-1):0)-e)/i},Ec=t=>{const e=[];for(let i=0;is)){if(e>r&&e<=s){i+=s-e;continue}i+=s-r}}return i},Hw=(t,e)=>{if(!e.preload)return e.duration;let i=0;return(e.parts||[]).forEach(function(n){i+=n.duration}),(e.preloadHints||[]).forEach(function(n){n.type==="PART"&&(i+=t.partTargetDuration)}),i},Uw=t=>(t.segments||[]).reduce((e,i,n)=>(i.parts?i.parts.forEach(function(r,s){e.push({duration:r.duration,segmentIndex:n,partIndex:s,part:r,segment:i})}):e.push({duration:i.duration,segmentIndex:n,partIndex:null,segment:i,part:null}),e),[]),_k=t=>{const e=t.segments&&t.segments.length&&t.segments[t.segments.length-1];return e&&e.parts||[]},wk=({preloadSegment:t})=>{if(!t)return;const{parts:e,preloadHints:i}=t;let n=(i||[]).reduce((r,s)=>r+(s.type==="PART"?1:0),0);return n+=e&&e.length?e.length:0,n},Tk=(t,e)=>{if(e.endList)return 0;if(t&&t.suggestedPresentationDelay)return t.suggestedPresentationDelay;const i=_k(e).length>0;return i&&e.serverControl&&e.serverControl.partHoldBack?e.serverControl.partHoldBack:i&&e.partTargetDuration?e.partTargetDuration*3:e.serverControl&&e.serverControl.holdBack?e.serverControl.holdBack:e.targetDuration?e.targetDuration*3:0},Dq=function(t,e){let i=0,n=e-t.mediaSequence,r=t.segments[n];if(r){if(typeof r.start<"u")return{result:r.start,precise:!0};if(typeof r.end<"u")return{result:r.end-r.duration,precise:!0}}for(;n--;){if(r=t.segments[n],typeof r.end<"u")return{result:i+r.end,precise:!0};if(i+=Hw(t,r),typeof r.start<"u")return{result:i+r.start,precise:!0}}return{result:i,precise:!1}},Pq=function(t,e){let i=0,n,r=e-t.mediaSequence;for(;r"u"&&(e=t.mediaSequence+t.segments.length),e"u"){if(t.totalDuration)return t.totalDuration;if(!t.endList)return _e.Infinity}return xk(t,e,i)},Vp=function({defaultDuration:t,durationList:e,startIndex:i,endIndex:n}){let r=0;if(i>n&&([i,n]=[n,i]),i<0){for(let s=i;s0)for(let p=h-1;p>=0;p--){const g=u[p];if(o+=g.duration,s){if(o<0)continue}else if(o+Ea<=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:r-Vp({defaultDuration:t.targetDuration,durationList:u,startIndex:h,endIndex:p})}}return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:e}}if(h<0){for(let p=h;p<0;p++)if(o-=t.targetDuration,o<0)return{partIndex:u[0]&&u[0].partIndex||null,segmentIndex:u[0]&&u[0].segmentIndex||0,startTime:e};h=0}for(let p=h;pEa,S=o===0,P=y&&o+Ea>=0;if(!((S||P)&&p!==u.length-1)){if(s){if(o>0)continue}else if(o-Ea>=0)continue;return{partIndex:g.partIndex,segmentIndex:g.segmentIndex,startTime:r+Vp({defaultDuration:t.targetDuration,durationList:u,startIndex:h,endIndex:p})}}}return{segmentIndex:u[u.length-1].segmentIndex,partIndex:u[u.length-1].partIndex,startTime:e}},Ck=function(t){return t.excludeUntil&&t.excludeUntil>Date.now()},zw=function(t){return t.excludeUntil&&t.excludeUntil===1/0},n0=function(t){const e=Ck(t);return!t.disabled&&!e},Rq=function(t){return t.disabled},Oq=function(t){for(let e=0;e{if(t.playlists.length===1)return!0;const i=e.attributes.BANDWIDTH||Number.MAX_VALUE;return t.playlists.filter(n=>n0(n)?(n.attributes.BANDWIDTH||0)!t&&!e||!t&&e||t&&!e?!1:!!(t===e||t.id&&e.id&&t.id===e.id||t.resolvedUri&&e.resolvedUri&&t.resolvedUri===e.resolvedUri||t.uri&&e.uri&&t.uri===e.uri),Dk=function(t,e){const i=t&&t.mediaGroups&&t.mediaGroups.AUDIO||{};let n=!1;for(const r in i){for(const s in i[r])if(n=e(i[r][s]),n)break;if(n)break}return!!n},jp=t=>{if(!t||!t.playlists||!t.playlists.length)return Dk(t,i=>i.playlists&&i.playlists.length||i.uri);for(let e=0;ep2(s))||Dk(t,s=>jw(i,s))))return!1}return!0};var zs={liveEdgeDelay:Tk,duration:Sk,seekable:kq,getMediaInfoForTime:Iq,isEnabled:n0,isDisabled:Rq,isExcluded:Ck,isIncompatible:zw,playlistEnd:Ek,isAes:Oq,hasAttribute:Ak,estimateSegmentRequestTime:Lq,isLowestEnabledRendition:Vw,isAudioOnly:jp,playlistMatch:jw,segmentDurationWithParts:Hw};const{log:Pk}=Ve,ch=(t,e)=>`${t}-${e}`,kk=(t,e,i)=>`placeholder-uri-${t}-${e}-${i}`,Mq=({onwarn:t,oninfo:e,manifestString:i,customTagParsers:n=[],customTagMappers:r=[],llhls:s})=>{const o=new $V;t&&o.on("warn",t),e&&o.on("info",e),n.forEach(p=>o.addParser(p)),r.forEach(p=>o.addTagMapper(p)),o.push(i),o.end();const u=o.manifest;if(s||(["preloadSegment","skip","serverControl","renditionReports","partInf","partTargetDuration"].forEach(function(p){u.hasOwnProperty(p)&&delete u[p]}),u.segments&&u.segments.forEach(function(p){["parts","preloadHints"].forEach(function(g){p.hasOwnProperty(g)&&delete p[g]})})),!u.targetDuration){let p=10;u.segments&&u.segments.length&&(p=u.segments.reduce((g,y)=>Math.max(g,y.duration),0)),t&&t({message:`manifest has no targetDuration defaulting to ${p}`}),u.targetDuration=p}const h=_k(u);if(h.length&&!u.partTargetDuration){const p=h.reduce((g,y)=>Math.max(g,y.duration),0);t&&(t({message:`manifest has no partTargetDuration defaulting to ${p}`}),Pk.error("LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.")),u.partTargetDuration=p}return u},dh=(t,e)=>{t.mediaGroups&&["AUDIO","SUBTITLES"].forEach(i=>{if(t.mediaGroups[i])for(const n in t.mediaGroups[i])for(const r in t.mediaGroups[i][n]){const s=t.mediaGroups[i][n][r];e(s,i,n,r)}})},Ik=({playlist:t,uri:e,id:i})=>{t.id=i,t.playlistErrors_=0,e&&(t.uri=e),t.attributes=t.attributes||{}},Fq=t=>{let e=t.playlists.length;for(;e--;){const i=t.playlists[e];Ik({playlist:i,id:ch(e,i.uri)}),i.resolvedUri=Us(t.uri,i.uri),t.playlists[i.id]=i,t.playlists[i.uri]=i,i.attributes.BANDWIDTH||Pk.warn("Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.")}},Nq=t=>{dh(t,e=>{e.uri&&(e.resolvedUri=Us(t.uri,e.uri))})},Bq=(t,e)=>{const i=ch(0,e),n={mediaGroups:{AUDIO:{},VIDEO:{},"CLOSED-CAPTIONS":{},SUBTITLES:{}},uri:_e.location.href,resolvedUri:_e.location.href,playlists:[{uri:e,id:i,resolvedUri:e,attributes:{}}]};return n.playlists[i]=n.playlists[0],n.playlists[e]=n.playlists[0],n},Rk=(t,e,i=kk)=>{t.uri=e;for(let r=0;r{if(!r.playlists||!r.playlists.length){if(n&&s==="AUDIO"&&!r.uri)for(let h=0;h(r.set(s.id,s),r),new Map)}processDateRange(e){this.pendingDateRanges_.delete(e.id),this.processedDateRanges_.set(e.id,e)}getDateRangesToProcess(){if(this.offset_===null)return[];const e={},i=[];this.pendingDateRanges_.forEach((n,r)=>{if(!this.processedDateRanges_.has(r)&&(n.startTime=n.startDate.getTime()/1e3-this.offset_,n.processDateRange=()=>this.processDateRange(n),i.push(n),!!n.class))if(e[n.class]){const s=e[n.class].push(n);n.classListIndex=s-1}else e[n.class]=[n],n.classListIndex=0});for(const n of i){const r=e[n.class]||[];n.endDate?n.endTime=n.endDate.getTime()/1e3-this.offset_:n.endOnNext&&r[n.classListIndex+1]?n.endTime=r[n.classListIndex+1].startTime:n.duration?n.endTime=n.startTime+n.duration:n.plannedDuration?n.endTime=n.startTime+n.plannedDuration:n.endTime=n.startTime}return i}trimProcessedDateRanges_(e){new Map(this.processedDateRanges_).forEach((n,r)=>{n.startDate.getTime(){const r=e.status<200||e.status>299,s=e.status>=400&&e.status<=499,o={uri:e.uri,requestType:t},u=r&&!s||n;if(i&&s)o.error=Wn({},i),o.errorType=Ve.Error.NetworkRequestFailed;else if(e.aborted)o.errorType=Ve.Error.NetworkRequestAborted;else if(e.timedout)o.erroType=Ve.Error.NetworkRequestTimeout;else if(u){const h=n?Ve.Error.NetworkBodyParserFailed:Ve.Error.NetworkBadStatus;o.errorType=h,o.status=e.status,o.headers=e.headers}return o},Hq=So("CodecUtils"),Mk=function(t){const e=t.attributes||{};if(e.CODECS)return ya(e.CODECS)},Fk=(t,e)=>{const i=e.attributes||{};return t&&t.mediaGroups&&t.mediaGroups.AUDIO&&i.AUDIO&&t.mediaGroups.AUDIO[i.AUDIO]},Uq=(t,e)=>{if(!Fk(t,e))return!0;const i=e.attributes||{},n=t.mediaGroups.AUDIO[i.AUDIO];for(const r in n)if(!n[r].uri&&!n[r].playlists)return!0;return!1},Wp=function(t){const e={};return t.forEach(({mediaType:i,type:n,details:r})=>{e[i]=e[i]||[],e[i].push(f2(`${n}${r}`))}),Object.keys(e).forEach(function(i){if(e[i].length>1){Hq(`multiple ${i} codecs found as attributes: ${e[i].join(", ")}. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.`),e[i]=null;return}e[i]=e[i][0]}),e},Nk=function(t){let e=0;return t.audio&&e++,t.video&&e++,e},qp=function(t,e){const i=e.attributes||{},n=Wp(Mk(e)||[]);if(Fk(t,e)&&!n.audio&&!Uq(t,e)){const r=Wp(t7(t,i.AUDIO)||[]);r.audio&&(n.audio=r.audio)}return n},{EventTarget:zq}=Ve,Vq=(t,e)=>{if(e.endList||!e.serverControl)return t;const i={};if(e.serverControl.canBlockReload){const{preloadSegment:n}=e;let r=e.mediaSequence+e.segments.length;if(n){const s=n.parts||[],o=wk(e)-1;o>-1&&o!==s.length-1&&(i._HLS_part=o),(o>-1||s.length)&&r--}i._HLS_msn=r}if(e.serverControl&&e.serverControl.canSkipUntil&&(i._HLS_skip=e.serverControl.canSkipDateranges?"v2":"YES"),Object.keys(i).length){const n=new _e.URL(t);["_HLS_skip","_HLS_msn","_HLS_part"].forEach(function(r){i.hasOwnProperty(r)&&n.searchParams.set(r,i[r])}),t=n.toString()}return t},jq=(t,e)=>{if(!t)return e;const i=Ji(t,e);if(t.preloadHints&&!e.preloadHints&&delete i.preloadHints,t.parts&&!e.parts)delete i.parts;else if(t.parts&&e.parts)for(let n=0;n{const n=t.slice(),r=e.slice();i=i||0;const s=[];let o;for(let u=0;u{!t.resolvedUri&&t.uri&&(t.resolvedUri=Us(e,t.uri)),t.key&&!t.key.resolvedUri&&(t.key.resolvedUri=Us(e,t.key.uri)),t.map&&!t.map.resolvedUri&&(t.map.resolvedUri=Us(e,t.map.uri)),t.map&&t.map.key&&!t.map.key.resolvedUri&&(t.map.key.resolvedUri=Us(e,t.map.key.uri)),t.parts&&t.parts.length&&t.parts.forEach(i=>{i.resolvedUri||(i.resolvedUri=Us(e,i.uri))}),t.preloadHints&&t.preloadHints.length&&t.preloadHints.forEach(i=>{i.resolvedUri||(i.resolvedUri=Us(e,i.uri))})},Hk=function(t){const e=t.segments||[],i=t.preloadSegment;if(i&&i.parts&&i.parts.length){if(i.preloadHints){for(let n=0;nt===e||t.segments&&e.segments&&t.segments.length===e.segments.length&&t.endList===e.endList&&t.mediaSequence===e.mediaSequence&&t.preloadSegment===e.preloadSegment,Ww=(t,e,i=Uk)=>{const n=Ji(t,{}),r=n.playlists[e.id];if(!r||i(r,e))return null;e.segments=Hk(e);const s=Ji(r,e);if(s.preloadSegment&&!e.preloadSegment&&delete s.preloadSegment,r.segments){if(e.skip){e.segments=e.segments||[];for(let o=0;o{Bk(o,s.resolvedUri)});for(let o=0;o{if(o.playlists)for(let g=0;g{const i=t.segments||[],n=i[i.length-1],r=n&&n.parts&&n.parts[n.parts.length-1],s=r&&r.duration||n&&n.duration;return e&&s?s*1e3:(t.partTargetDuration||t.targetDuration||10)*500},zk=(t,e,i)=>{if(!t)return;const n=[];return t.forEach(r=>{if(!r.attributes)return;const{BANDWIDTH:s,RESOLUTION:o,CODECS:u}=r.attributes;n.push({id:r.id,bandwidth:s,resolution:o,codecs:u})}),{type:e,isLive:i,renditions:n}};class hh extends zq{constructor(e,i,n={}){if(super(),!e)throw new Error("A non-empty playlist URL or object is required");this.logger_=So("PlaylistLoader");const{withCredentials:r=!1}=n;this.src=e,this.vhs_=i,this.withCredentials=r,this.addDateRangesToTextTrack_=n.addDateRangesToTextTrack;const s=i.options_;this.customTagParsers=s&&s.customTagParsers||[],this.customTagMappers=s&&s.customTagMappers||[],this.llhls=s&&s.llhls,this.dateRangesStorage_=new Ok,this.state="HAVE_NOTHING",this.handleMediaupdatetimeout_=this.handleMediaupdatetimeout_.bind(this),this.on("mediaupdatetimeout",this.handleMediaupdatetimeout_),this.on("loadedplaylist",this.handleLoadedPlaylist_.bind(this))}handleLoadedPlaylist_(){const e=this.media();if(!e)return;this.dateRangesStorage_.setOffset(e.segments),this.dateRangesStorage_.setPendingDateRanges(e.dateRanges);const i=this.dateRangesStorage_.getDateRangesToProcess();!i.length||!this.addDateRangesToTextTrack_||this.addDateRangesToTextTrack_(i)}handleMediaupdatetimeout_(){if(this.state!=="HAVE_METADATA")return;const e=this.media();let i=Us(this.main.uri,e.uri);this.llhls&&(i=Vq(i,e)),this.state="HAVE_CURRENT_METADATA",this.request=this.vhs_.xhr({uri:i,withCredentials:this.withCredentials,requestType:"hls-playlist"},(n,r)=>{if(this.request){if(n)return this.playlistRequestError(this.request,this.media(),"HAVE_METADATA");this.haveMetadata({playlistString:this.request.responseText,url:this.media().uri,id:this.media().id})}})}playlistRequestError(e,i,n){const{uri:r,id:s}=i;this.request=null,n&&(this.state=n),this.error={playlist:this.main.playlists[s],status:e.status,message:`HLS playlist request error at URL: ${r}.`,responseText:e.responseText,code:e.status>=500?4:2,metadata:Cc({requestType:e.requestType,request:e,error:e.error})},this.trigger("error")}parseManifest_({url:e,manifestString:i}){try{const n=Mq({onwarn:({message:r})=>this.logger_(`m3u8-parser warn for ${e}: ${r}`),oninfo:({message:r})=>this.logger_(`m3u8-parser info for ${e}: ${r}`),manifestString:i,customTagParsers:this.customTagParsers,customTagMappers:this.customTagMappers,llhls:this.llhls});return!n.playlists||!n.playlists.length||this.excludeAudioOnlyVariants(n.playlists),n}catch(n){this.error=n,this.error.metadata={errorType:Ve.Error.StreamingHlsPlaylistParserError,error:n}}}excludeAudioOnlyVariants(e){const i=n=>{const r=n.attributes||{},{width:s,height:o}=r.RESOLUTION||{};if(s&&o)return!0;const u=Mk(n)||[];return!!Wp(u).video};e.some(i)&&e.forEach(n=>{i(n)||(n.excludeUntil=1/0)})}haveMetadata({playlistString:e,playlistObject:i,url:n,id:r}){this.request=null,this.state="HAVE_METADATA";const s={playlistInfo:{type:"media",uri:n}};this.trigger({type:"playlistparsestart",metadata:s});const o=i||this.parseManifest_({url:n,manifestString:e});o.lastRequest=Date.now(),Ik({playlist:o,uri:n,id:r});const u=Ww(this.main,o);this.targetDuration=o.partTargetDuration||o.targetDuration,this.pendingMedia_=null,u?(this.main=u,this.media_=this.main.playlists[r]):this.trigger("playlistunchanged"),this.updateMediaUpdateTimeout_(qw(this.media(),!!u)),s.parsedPlaylist=zk(this.main.playlists,s.playlistInfo.type,!this.media_.endList),this.trigger({type:"playlistparsecomplete",metadata:s}),this.trigger("loadedplaylist")}dispose(){this.trigger("dispose"),this.stopRequest(),_e.clearTimeout(this.mediaUpdateTimeout),_e.clearTimeout(this.finalRenditionTimeout),this.dateRangesStorage_=new Ok,this.off()}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e,i){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);if(typeof e=="string"){if(!this.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.main.playlists[e]}if(_e.clearTimeout(this.finalRenditionTimeout),i){const u=(e.partTargetDuration||e.targetDuration)/2*1e3||5e3;this.finalRenditionTimeout=_e.setTimeout(this.media.bind(this,e,!1),u);return}const n=this.state,r=!this.media_||e.id!==this.media_.id,s=this.main.playlists[e.id];if(s&&s.endList||e.endList&&e.segments.length){this.request&&(this.request.onreadystatechange=null,this.request.abort(),this.request=null),this.state="HAVE_METADATA",this.media_=e,r&&(this.trigger("mediachanging"),n==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange"));return}if(this.updateMediaUpdateTimeout_(qw(e,!0)),!r)return;if(this.state="SWITCHING_MEDIA",this.request){if(e.resolvedUri===this.request.url)return;this.request.onreadystatechange=null,this.request.abort(),this.request=null}this.media_&&this.trigger("mediachanging"),this.pendingMedia_=e;const o={playlistInfo:{type:"media",uri:e.uri}};this.trigger({type:"playlistrequeststart",metadata:o}),this.request=this.vhs_.xhr({uri:e.resolvedUri,withCredentials:this.withCredentials,requestType:"hls-playlist"},(u,h)=>{if(this.request){if(e.lastRequest=Date.now(),e.resolvedUri=t0(e.resolvedUri,h),u)return this.playlistRequestError(this.request,e,n);this.trigger({type:"playlistrequestcomplete",metadata:o}),this.haveMetadata({playlistString:h.responseText,url:e.uri,id:e.id}),n==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}})}pause(){this.mediaUpdateTimeout&&(_e.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),this.stopRequest(),this.state==="HAVE_NOTHING"&&(this.started=!1),this.state==="SWITCHING_MEDIA"?this.media_?this.state="HAVE_METADATA":this.state="HAVE_MAIN_MANIFEST":this.state==="HAVE_CURRENT_METADATA"&&(this.state="HAVE_METADATA")}load(e){this.mediaUpdateTimeout&&(_e.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null);const i=this.media();if(e){const n=i?(i.partTargetDuration||i.targetDuration)/2*1e3:5e3;this.mediaUpdateTimeout=_e.setTimeout(()=>{this.mediaUpdateTimeout=null,this.load()},n);return}if(!this.started){this.start();return}i&&!i.endList?this.trigger("mediaupdatetimeout"):this.trigger("loadedplaylist")}updateMediaUpdateTimeout_(e){this.mediaUpdateTimeout&&(_e.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null),!(!this.media()||this.media().endList)&&(this.mediaUpdateTimeout=_e.setTimeout(()=>{this.mediaUpdateTimeout=null,this.trigger("mediaupdatetimeout"),this.updateMediaUpdateTimeout_(e)},e))}start(){if(this.started=!0,typeof this.src=="object"){this.src.uri||(this.src.uri=_e.location.href),this.src.resolvedUri=this.src.uri,setTimeout(()=>{this.setupInitialPlaylist(this.src)},0);return}const e={playlistInfo:{type:"multivariant",uri:this.src}};this.trigger({type:"playlistrequeststart",metadata:e}),this.request=this.vhs_.xhr({uri:this.src,withCredentials:this.withCredentials,requestType:"hls-playlist"},(i,n)=>{if(!this.request)return;if(this.request=null,i)return this.error={status:n.status,message:`HLS playlist request error at URL: ${this.src}.`,responseText:n.responseText,code:2,metadata:Cc({requestType:n.requestType,request:n,error:i})},this.state==="HAVE_NOTHING"&&(this.started=!1),this.trigger("error");this.trigger({type:"playlistrequestcomplete",metadata:e}),this.src=t0(this.src,n),this.trigger({type:"playlistparsestart",metadata:e});const r=this.parseManifest_({manifestString:n.responseText,url:this.src});e.parsedPlaylist=zk(r.playlists,e.playlistInfo.type,!1),this.trigger({type:"playlistparsecomplete",metadata:e}),this.setupInitialPlaylist(r)})}srcUri(){return typeof this.src=="string"?this.src:this.src.uri}setupInitialPlaylist(e){if(this.state="HAVE_MAIN_MANIFEST",e.playlists){this.main=e,Rk(this.main,this.srcUri()),e.playlists.forEach(n=>{n.segments=Hk(n),n.segments.forEach(r=>{Bk(r,n.resolvedUri)})}),this.trigger("loadedplaylist"),this.request||this.media(this.main.playlists[0]);return}const i=this.srcUri()||_e.location.href;this.main=Bq(e,i),this.haveMetadata({playlistObject:e,url:i,id:this.main.playlists[0].id}),this.trigger("loadedmetadata")}updateOrDeleteClone(e,i){const n=this.main,r=e.ID;let s=n.playlists.length;for(;s--;){const o=n.playlists[s];if(o.attributes["PATHWAY-ID"]===r){const u=o.resolvedUri,h=o.id;if(i){const p=this.createCloneURI_(o.resolvedUri,e),g=ch(r,p),y=this.createCloneAttributes_(r,o.attributes),S=this.createClonePlaylist_(o,g,e,y);n.playlists[s]=S,n.playlists[g]=S,n.playlists[p]=S}else n.playlists.splice(s,1);delete n.playlists[h],delete n.playlists[u]}}this.updateOrDeleteCloneMedia(e,i)}updateOrDeleteCloneMedia(e,i){const n=this.main,r=e.ID;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(s=>{if(!(!n.mediaGroups[s]||!n.mediaGroups[s][r])){for(const o in n.mediaGroups[s])if(o===r){for(const u in n.mediaGroups[s][o])n.mediaGroups[s][o][u].playlists.forEach((p,g)=>{const y=n.playlists[p.id],S=y.id,P=y.resolvedUri;delete n.playlists[S],delete n.playlists[P]});delete n.mediaGroups[s][o]}}}),i&&this.createClonedMediaGroups_(e)}addClonePathway(e,i={}){const n=this.main,r=n.playlists.length,s=this.createCloneURI_(i.resolvedUri,e),o=ch(e.ID,s),u=this.createCloneAttributes_(e.ID,i.attributes),h=this.createClonePlaylist_(i,o,e,u);n.playlists[r]=h,n.playlists[o]=h,n.playlists[s]=h,this.createClonedMediaGroups_(e)}createClonedMediaGroups_(e){const i=e.ID,n=e["BASE-ID"],r=this.main;["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(s=>{if(!(!r.mediaGroups[s]||r.mediaGroups[s][i]))for(const o in r.mediaGroups[s]){if(o===n)r.mediaGroups[s][i]={};else continue;for(const u in r.mediaGroups[s][o]){const h=r.mediaGroups[s][o][u];r.mediaGroups[s][i][u]=Wn({},h);const p=r.mediaGroups[s][i][u],g=this.createCloneURI_(h.resolvedUri,e);p.resolvedUri=g,p.uri=g,p.playlists=[],h.playlists.forEach((y,S)=>{const P=r.playlists[y.id],R=kk(s,i,u),k=ch(i,R);if(P&&!r.playlists[k]){const M=this.createClonePlaylist_(P,k,e),L=M.resolvedUri;r.playlists[k]=M,r.playlists[L]=M}p.playlists[S]=this.createClonePlaylist_(y,k,e)})}}})}createClonePlaylist_(e,i,n,r){const s=this.createCloneURI_(e.resolvedUri,n),o={resolvedUri:s,uri:s,id:i};return e.segments&&(o.segments=[]),r&&(o.attributes=r),Ji(e,o)}createCloneURI_(e,i){const n=new URL(e);n.hostname=i["URI-REPLACEMENT"].HOST;const r=i["URI-REPLACEMENT"].PARAMS;for(const s of Object.keys(r))n.searchParams.set(s,r[s]);return n.href}createCloneAttributes_(e,i){const n={"PATHWAY-ID":e};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(r=>{i[r]&&(n[r]=e)}),n}getKeyIdSet(e){if(e.contentProtection){const i=new Set;for(const n in e.contentProtection){const r=e.contentProtection[n].attributes.keyId;r&&i.add(r.toLowerCase())}return i}}}const Gw=function(t,e,i,n){const r=t.responseType==="arraybuffer"?t.response:t.responseText;!e&&r&&(t.responseTime=Date.now(),t.roundTripTime=t.responseTime-t.requestTime,t.bytesReceived=r.byteLength||r.length,t.bandwidth||(t.bandwidth=Math.floor(t.bytesReceived/t.roundTripTime*8*1e3))),i.headers&&(t.responseHeaders=i.headers),e&&e.code==="ETIMEDOUT"&&(t.timedout=!0),!e&&!t.aborted&&i.statusCode!==200&&i.statusCode!==206&&i.statusCode!==0&&(e=new Error("XHR Failed with a response of: "+(t&&(r||t.responseText)))),n(e,t)},qq=(t,e)=>{if(!t||!t.size)return;let i=e;return t.forEach(n=>{i=n(i)}),i},Gq=(t,e,i,n)=>{!t||!t.size||t.forEach(r=>{r(e,i,n)})},Vk=function(){const t=function e(i,n){i=Ji({timeout:45e3},i);const r=e.beforeRequest||Ve.Vhs.xhr.beforeRequest,s=e._requestCallbackSet||Ve.Vhs.xhr._requestCallbackSet||new Set,o=e._responseCallbackSet||Ve.Vhs.xhr._responseCallbackSet;r&&typeof r=="function"&&(Ve.log.warn("beforeRequest is deprecated, use onRequest instead."),s.add(r));const u=Ve.Vhs.xhr.original===!0?Ve.xhr:Ve.Vhs.xhr,h=qq(s,i);s.delete(r);const p=u(h||i,function(y,S){return Gq(o,p,y,S),Gw(p,y,S,n)}),g=p.abort;return p.abort=function(){return p.aborted=!0,g.apply(p,arguments)},p.uri=i.uri,p.requestType=i.requestType,p.requestTime=Date.now(),p};return t.original=!0,t},Kq=function(t){let e;const i=t.offset;return typeof t.offset=="bigint"||typeof t.length=="bigint"?e=_e.BigInt(t.offset)+_e.BigInt(t.length)-_e.BigInt(1):e=t.offset+t.length-1,"bytes="+i+"-"+e},Kw=function(t){const e={};return t.byterange&&(e.Range=Kq(t.byterange)),e},Yq=function(t,e){return t.start(e)+"-"+t.end(e)},Xq=function(t,e){const i=t.toString(16);return"00".substring(0,2-i.length)+i+(e%2?" ":"")},Zq=function(t){return t>=32&&t<126?String.fromCharCode(t):"."},jk=function(t){const e={};return Object.keys(t).forEach(i=>{const n=t[i];y2(n)?e[i]={bytes:n.buffer,byteOffset:n.byteOffset,byteLength:n.byteLength}:e[i]=n}),e},r0=function(t){const e=t.byterange||{length:1/0,offset:0};return[e.length,e.offset,t.resolvedUri].join(",")},Wk=function(t){return t.resolvedUri},qk=t=>{const e=Array.prototype.slice.call(t),i=16;let n="",r,s;for(let o=0;oqk(t),textRanges:t=>{let e="",i;for(i=0;i{if(!e.dateTimeObject)return null;const i=e.videoTimingInfo.transmuxerPrependedSeconds,r=e.videoTimingInfo.transmuxedPresentationStart+i,s=t-r;return new Date(e.dateTimeObject.getTime()+s*1e3)},$q=t=>t.transmuxedPresentationEnd-t.transmuxedPresentationStart-t.transmuxerPrependedSeconds,eG=(t,e)=>{let i;try{i=new Date(t)}catch{return null}if(!e||!e.segments||e.segments.length===0)return null;let n=e.segments[0];if(iu?null:(i>new Date(s)&&(n=r),{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:zs.duration(e,e.mediaSequence+e.segments.indexOf(n)),type:n.videoTimingInfo?"accurate":"estimate"})},tG=(t,e)=>{if(!e||!e.segments||e.segments.length===0)return null;let i=0,n;for(let s=0;si){if(t>i+r.duration*Gk)return null;n=r}return{segment:n,estimatedStart:n.videoTimingInfo?n.videoTimingInfo.transmuxedPresentationStart:i-n.duration,type:n.videoTimingInfo?"accurate":"estimate"}},iG=(t,e)=>{let i,n;try{i=new Date(t),n=new Date(e)}catch{}const r=i.getTime();return(n.getTime()-r)/1e3},nG=t=>{if(!t.segments||t.segments.length===0)return!1;for(let e=0;e{if(!i)throw new Error("getProgramTime: callback must be provided");if(!t||e===void 0)return i({message:"getProgramTime: playlist and time must be provided"});const n=tG(e,t);if(!n)return i({message:"valid programTime was not found"});if(n.type==="estimate")return i({message:"Accurate programTime could not be determined. Please seek to e.seekTime and try again",seekTime:n.estimatedStart});const r={mediaSeconds:e},s=Jq(e,n.segment);return s&&(r.programDateTime=s.toISOString()),i(null,r)},Kk=({programTime:t,playlist:e,retryCount:i=2,seekTo:n,pauseAfterSeek:r=!0,tech:s,callback:o})=>{if(!o)throw new Error("seekToProgramTime: callback must be provided");if(typeof t>"u"||!e||!n)return o({message:"seekToProgramTime: programTime, seekTo and playlist must be provided"});if(!e.endList&&!s.hasStarted_)return o({message:"player must be playing a live stream to start buffering"});if(!nG(e))return o({message:"programDateTime tags must be provided in the manifest "+e.resolvedUri});const u=eG(t,e);if(!u)return o({message:`${t} was not found in the stream`});const h=u.segment,p=iG(h.dateTimeObject,t);if(u.type==="estimate"){if(i===0)return o({message:`${t} is not buffered yet. Try again`});n(u.estimatedStart+p),s.one("seeked",()=>{Kk({programTime:t,playlist:e,retryCount:i-1,seekTo:n,pauseAfterSeek:r,tech:s,callback:o})});return}const g=h.start+p,y=()=>o(null,s.currentTime());s.one("seeked",y),r&&s.pause(),n(g)},Yw=(t,e)=>{if(t.readyState===4)return e()},sG=(t,e,i,n)=>{let r=[],s,o=!1;const u=function(y,S,P,R){return S.abort(),o=!0,i(y,S,P,R)},h=function(y,S){if(o)return;if(y)return y.metadata=Cc({requestType:n,request:S,error:y}),u(y,S,"",r);const P=S.responseText.substring(r&&r.byteLength||0,S.responseText.length);if(r=d7(r,v2(P,!0)),s=s||Dp(r),r.length<10||s&&r.lengthu(y,S,"",r));const R=j_(r);return R==="ts"&&r.length<188?Yw(S,()=>u(y,S,"",r)):!R&&r.length<376?Yw(S,()=>u(y,S,"",r)):u(null,S,R,r)},g=e({uri:t,beforeSend(y){y.overrideMimeType("text/plain; charset=x-user-defined"),y.addEventListener("progress",function({total:S,loaded:P}){return Gw(y,null,{statusCode:y.status},h)})}},function(y,S){return Gw(g,y,S,h)});return g},{EventTarget:oG}=Ve,Yk=function(t,e){if(!Uk(t,e)||t.sidx&&e.sidx&&(t.sidx.offset!==e.sidx.offset||t.sidx.length!==e.sidx.length))return!1;if(!t.sidx&&e.sidx||t.sidx&&!e.sidx||t.segments&&!e.segments||!t.segments&&e.segments)return!1;if(!t.segments&&!e.segments)return!0;for(let i=0;i{const r=n.attributes.NAME||i;return`placeholder-uri-${t}-${e}-${r}`},lG=({mainXml:t,srcUrl:e,clientOffset:i,sidxMapping:n,previousManifest:r})=>{const s=Rj(t,{manifestUri:e,clientOffset:i,sidxMapping:n,previousManifest:r});return Rk(s,e,aG),s},uG=(t,e)=>{dh(t,(i,n,r,s)=>{(!e.mediaGroups[n][r]||!(s in e.mediaGroups[n][r]))&&delete t.mediaGroups[n][r][s]})},cG=(t,e,i)=>{let n=!0,r=Ji(t,{duration:e.duration,minimumUpdatePeriod:e.minimumUpdatePeriod,timelineStarts:e.timelineStarts});for(let s=0;s{if(s.playlists&&s.playlists.length){const p=s.playlists[0].id,g=Ww(r,s.playlists[0],Yk);g&&(r=g,h in r.mediaGroups[o][u]||(r.mediaGroups[o][u][h]=s),r.mediaGroups[o][u][h].playlists[0]=r.playlists[p],n=!1)}}),uG(r,e),e.minimumUpdatePeriod!==t.minimumUpdatePeriod&&(n=!1),n?null:r},dG=(t,e)=>(!t.map&&!e.map||!!(t.map&&e.map&&t.map.byterange.offset===e.map.byterange.offset&&t.map.byterange.length===e.map.byterange.length))&&t.uri===e.uri&&t.byterange.offset===e.byterange.offset&&t.byterange.length===e.byterange.length,Xk=(t,e)=>{const i={};for(const n in t){const s=t[n].sidx;if(s){const o=gy(s);if(!e[o])break;const u=e[o].sidxInfo;dG(u,s)&&(i[o]=e[o])}}return i},hG=(t,e)=>{let n=Xk(t.playlists,e);return dh(t,(r,s,o,u)=>{if(r.playlists&&r.playlists.length){const h=r.playlists;n=Ji(n,Xk(h,e))}}),n};class Xw extends oG{constructor(e,i,n={},r){super(),this.isPaused_=!0,this.mainPlaylistLoader_=r||this,r||(this.isMain_=!0);const{withCredentials:s=!1}=n;if(this.vhs_=i,this.withCredentials=s,this.addMetadataToTextTrack=n.addMetadataToTextTrack,!e)throw new Error("A non-empty playlist URL or object is required");this.on("minimumUpdatePeriod",()=>{this.refreshXml_()}),this.on("mediaupdatetimeout",()=>{this.refreshMedia_(this.media().id)}),this.state="HAVE_NOTHING",this.loadedPlaylists_={},this.logger_=So("DashPlaylistLoader"),this.isMain_?(this.mainPlaylistLoader_.srcUrl=e,this.mainPlaylistLoader_.sidxMapping_={}):this.childPlaylist_=e}get isPaused(){return this.isPaused_}requestErrored_(e,i,n){if(!this.request)return!0;if(this.request=null,e)return this.error=typeof e=="object"&&!(e instanceof Error)?e:{status:i.status,message:"DASH request error at URL: "+i.uri,response:i.response,code:2,metadata:e.metadata},n&&(this.state=n),this.trigger("error"),!0}addSidxSegments_(e,i,n){const r=e.sidx&&gy(e.sidx);if(!e.sidx||!r||this.mainPlaylistLoader_.sidxMapping_[r]){_e.clearTimeout(this.mediaRequest_),this.mediaRequest_=_e.setTimeout(()=>n(!1),0);return}const s=t0(e.sidx.resolvedUri),o=(h,p)=>{if(this.requestErrored_(h,p,i))return;const g=this.mainPlaylistLoader_.sidxMapping_,{requestType:y}=p;let S;try{S=Hj(Qt(p.response).subarray(8))}catch(P){P.metadata=Cc({requestType:y,request:p,parseFailure:!0}),this.requestErrored_(P,p,i);return}return g[r]={sidxInfo:e.sidx,sidx:S},N_(e,S,e.sidx.resolvedUri),n(!0)},u="dash-sidx";this.request=sG(s,this.vhs_.xhr,(h,p,g,y)=>{if(h)return o(h,p);if(!g||g!=="mp4"){const R=g||"unknown";return o({status:p.status,message:`Unsupported ${R} container type for sidx segment at URL: ${s}`,response:"",playlist:e,internal:!0,playlistExclusionDuration:1/0,code:2},p)}const{offset:S,length:P}=e.sidx.byterange;if(y.length>=P+S)return o(h,{response:y.subarray(S,S+P),status:p.status,uri:p.uri});this.request=this.vhs_.xhr({uri:s,responseType:"arraybuffer",requestType:"dash-sidx",headers:Kw({byterange:e.sidx.byterange})},o)},u)}dispose(){this.isPaused_=!0,this.trigger("dispose"),this.stopRequest(),this.loadedPlaylists_={},_e.clearTimeout(this.minimumUpdatePeriodTimeout_),_e.clearTimeout(this.mediaRequest_),_e.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.mediaRequest_=null,this.minimumUpdatePeriodTimeout_=null,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.off()}hasPendingRequest(){return this.request||this.mediaRequest_}stopRequest(){if(this.request){const e=this.request;this.request=null,e.onreadystatechange=null,e.abort()}}media(e){if(!e)return this.media_;if(this.state==="HAVE_NOTHING")throw new Error("Cannot switch media playlist from "+this.state);const i=this.state;if(typeof e=="string"){if(!this.mainPlaylistLoader_.main.playlists[e])throw new Error("Unknown playlist URI: "+e);e=this.mainPlaylistLoader_.main.playlists[e]}const n=!this.media_||e.id!==this.media_.id;if(n&&this.loadedPlaylists_[e.id]&&this.loadedPlaylists_[e.id].endList){this.state="HAVE_METADATA",this.media_=e,n&&(this.trigger("mediachanging"),this.trigger("mediachange"));return}n&&(this.media_&&this.trigger("mediachanging"),this.addSidxSegments_(e,i,r=>{this.haveMetadata({startingState:i,playlist:e})}))}haveMetadata({startingState:e,playlist:i}){this.state="HAVE_METADATA",this.loadedPlaylists_[i.id]=i,_e.clearTimeout(this.mediaRequest_),this.mediaRequest_=null,this.refreshMedia_(i.id),e==="HAVE_MAIN_MANIFEST"?this.trigger("loadedmetadata"):this.trigger("mediachange")}pause(){this.isPaused_=!0,this.mainPlaylistLoader_.createMupOnMedia_&&(this.off("loadedmetadata",this.mainPlaylistLoader_.createMupOnMedia_),this.mainPlaylistLoader_.createMupOnMedia_=null),this.stopRequest(),_e.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null,this.isMain_&&(_e.clearTimeout(this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_),this.mainPlaylistLoader_.minimumUpdatePeriodTimeout_=null),this.state==="HAVE_NOTHING"&&(this.started=!1)}load(e){this.isPaused_=!1,_e.clearTimeout(this.mediaUpdateTimeout),this.mediaUpdateTimeout=null;const i=this.media();if(e){const n=i?i.targetDuration/2*1e3:5e3;this.mediaUpdateTimeout=_e.setTimeout(()=>this.load(),n);return}if(!this.started){this.start();return}i&&!i.endList?(this.isMain_&&!this.minimumUpdatePeriodTimeout_&&(this.trigger("minimumUpdatePeriod"),this.updateMinimumUpdatePeriodTimeout_()),this.trigger("mediaupdatetimeout")):this.trigger("loadedplaylist")}start(){if(this.started=!0,!this.isMain_){_e.clearTimeout(this.mediaRequest_),this.mediaRequest_=_e.setTimeout(()=>this.haveMain_(),0);return}this.requestMain_((e,i)=>{this.haveMain_(),!this.hasPendingRequest()&&!this.media_&&this.media(this.mainPlaylistLoader_.main.playlists[0])})}requestMain_(e){const i={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestrequeststart",metadata:i}),this.request=this.vhs_.xhr({uri:this.mainPlaylistLoader_.srcUrl,withCredentials:this.withCredentials,requestType:"dash-manifest"},(n,r)=>{if(n){const{requestType:o}=r;n.metadata=Cc({requestType:o,request:r,error:n})}if(this.requestErrored_(n,r)){this.state==="HAVE_NOTHING"&&(this.started=!1);return}this.trigger({type:"manifestrequestcomplete",metadata:i});const s=r.responseText!==this.mainPlaylistLoader_.mainXml_;if(this.mainPlaylistLoader_.mainXml_=r.responseText,r.responseHeaders&&r.responseHeaders.date?this.mainLoaded_=Date.parse(r.responseHeaders.date):this.mainLoaded_=Date.now(),this.mainPlaylistLoader_.srcUrl=t0(this.mainPlaylistLoader_.srcUrl,r),s){this.handleMain_(),this.syncClientServerClock_(()=>e(r,s));return}return e(r,s)})}syncClientServerClock_(e){const i=Oj(this.mainPlaylistLoader_.mainXml_);if(i===null)return this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e();if(i.method==="DIRECT")return this.mainPlaylistLoader_.clientOffset_=i.value-Date.now(),e();this.request=this.vhs_.xhr({uri:Us(this.mainPlaylistLoader_.srcUrl,i.value),method:i.method,withCredentials:this.withCredentials,requestType:"dash-clock-sync"},(n,r)=>{if(!this.request)return;if(n){const{requestType:o}=r;return this.error.metadata=Cc({requestType:o,request:r,error:n}),this.mainPlaylistLoader_.clientOffset_=this.mainLoaded_-Date.now(),e()}let s;i.method==="HEAD"?!r.responseHeaders||!r.responseHeaders.date?s=this.mainLoaded_:s=Date.parse(r.responseHeaders.date):s=Date.parse(r.responseText),this.mainPlaylistLoader_.clientOffset_=s-Date.now(),e()})}haveMain_(){this.state="HAVE_MAIN_MANIFEST",this.isMain_?this.trigger("loadedplaylist"):this.media_||this.media(this.childPlaylist_)}handleMain_(){_e.clearTimeout(this.mediaRequest_),this.mediaRequest_=null;const e=this.mainPlaylistLoader_.main,i={manifestInfo:{uri:this.mainPlaylistLoader_.srcUrl}};this.trigger({type:"manifestparsestart",metadata:i});let n;try{n=lG({mainXml:this.mainPlaylistLoader_.mainXml_,srcUrl:this.mainPlaylistLoader_.srcUrl,clientOffset:this.mainPlaylistLoader_.clientOffset_,sidxMapping:this.mainPlaylistLoader_.sidxMapping_,previousManifest:e})}catch(s){this.error=s,this.error.metadata={errorType:Ve.Error.StreamingDashManifestParserError,error:s},this.trigger("error")}e&&(n=cG(e,n,this.mainPlaylistLoader_.sidxMapping_)),this.mainPlaylistLoader_.main=n||e;const r=this.mainPlaylistLoader_.main.locations&&this.mainPlaylistLoader_.main.locations[0];if(r&&r!==this.mainPlaylistLoader_.srcUrl&&(this.mainPlaylistLoader_.srcUrl=r),(!e||n&&n.minimumUpdatePeriod!==e.minimumUpdatePeriod)&&this.updateMinimumUpdatePeriodTimeout_(),this.addEventStreamToMetadataTrack_(n),n){const{duration:s,endList:o}=n,u=[];n.playlists.forEach(p=>{u.push({id:p.id,bandwidth:p.attributes.BANDWIDTH,resolution:p.attributes.RESOLUTION,codecs:p.attributes.CODECS})});const h={duration:s,isLive:!o,renditions:u};i.parsedManifest=h,this.trigger({type:"manifestparsecomplete",metadata:i})}return!!n}updateMinimumUpdatePeriodTimeout_(){const e=this.mainPlaylistLoader_;e.createMupOnMedia_&&(e.off("loadedmetadata",e.createMupOnMedia_),e.createMupOnMedia_=null),e.minimumUpdatePeriodTimeout_&&(_e.clearTimeout(e.minimumUpdatePeriodTimeout_),e.minimumUpdatePeriodTimeout_=null);let i=e.main&&e.main.minimumUpdatePeriod;if(i===0&&(e.media()?i=e.media().targetDuration*1e3:(e.createMupOnMedia_=e.updateMinimumUpdatePeriodTimeout_,e.one("loadedmetadata",e.createMupOnMedia_))),typeof i!="number"||i<=0){i<0&&this.logger_(`found invalid minimumUpdatePeriod of ${i}, not setting a timeout`);return}this.createMUPTimeout_(i)}createMUPTimeout_(e){const i=this.mainPlaylistLoader_;i.minimumUpdatePeriodTimeout_=_e.setTimeout(()=>{i.minimumUpdatePeriodTimeout_=null,i.trigger("minimumUpdatePeriod"),i.createMUPTimeout_(e)},e)}refreshXml_(){this.requestMain_((e,i)=>{i&&(this.media_&&(this.media_=this.mainPlaylistLoader_.main.playlists[this.media_.id]),this.mainPlaylistLoader_.sidxMapping_=hG(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.sidxMapping_),this.addSidxSegments_(this.media(),this.state,n=>{this.refreshMedia_(this.media().id)}))})}refreshMedia_(e){if(!e)throw new Error("refreshMedia_ must take a media id");this.media_&&this.isMain_&&this.handleMain_();const i=this.mainPlaylistLoader_.main.playlists,n=!this.media_||this.media_!==i[e];if(n?this.media_=i[e]:this.trigger("playlistunchanged"),!this.mediaUpdateTimeout){const r=()=>{this.media().endList||(this.mediaUpdateTimeout=_e.setTimeout(()=>{this.trigger("mediaupdatetimeout"),r()},qw(this.media(),!!n)))};r()}this.trigger("loadedplaylist")}addEventStreamToMetadataTrack_(e){if(e&&this.mainPlaylistLoader_.main.eventStream){const i=this.mainPlaylistLoader_.main.eventStream.map(n=>({cueTime:n.start,frames:[{data:n.messageData}]}));this.addMetadataToTextTrack("EventStream",i,this.mainPlaylistLoader_.main.duration)}}getKeyIdSet(e){if(e.contentProtection){const i=new Set;for(const n in e.contentProtection){const r=e.contentProtection[n].attributes["cenc:default_KID"];r&&i.add(r.replace(/-/g,"").toLowerCase())}return i}}}var Sr={GOAL_BUFFER_LENGTH:30,MAX_GOAL_BUFFER_LENGTH:60,BACK_BUFFER_LENGTH:30,GOAL_BUFFER_LENGTH_RATE:1,INITIAL_BANDWIDTH:4194304,BANDWIDTH_VARIANCE:1.2,BUFFER_LOW_WATER_LINE:0,MAX_BUFFER_LOW_WATER_LINE:30,EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:16,BUFFER_LOW_WATER_LINE_RATE:1,BUFFER_HIGH_WATER_LINE:30};const fG=t=>{const e=new Uint8Array(new ArrayBuffer(t.length));for(let i=0;i-1):!1},this.trigger=function(A){var I,D,F,z;if(I=T[A],!!I)if(arguments.length===2)for(F=I.length,D=0;D"u")){for(T in at)at.hasOwnProperty(T)&&(at[T]=[T.charCodeAt(0),T.charCodeAt(1),T.charCodeAt(2),T.charCodeAt(3)]);Pt=new Uint8Array([105,115,111,109]),Ct=new Uint8Array([97,118,99,49]),ci=new Uint8Array([0,0,0,1]),Nt=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]),Wt=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]),wi={video:Nt,audio:Wt},Ii=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),ii=new Uint8Array([0,0,0,0,0,0,0,0]),bi=new Uint8Array([0,0,0,0,0,0,0,0]),hn=bi,dt=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),un=bi,Et=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0])}})(),u=function(T){var A=[],I=0,D,F,z;for(D=1;D>>1,T.samplingfrequencyindex<<7|T.channelcount<<3,6,1,2]))},g=function(){return u(at.ftyp,Pt,ci,Pt,Ct)},ye=function(T){return u(at.hdlr,wi[T])},y=function(T){return u(at.mdat,T)},ae=function(T){var A=new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,0,1,95,144,T.duration>>>24&255,T.duration>>>16&255,T.duration>>>8&255,T.duration&255,85,196,0,0]);return T.samplerate&&(A[12]=T.samplerate>>>24&255,A[13]=T.samplerate>>>16&255,A[14]=T.samplerate>>>8&255,A[15]=T.samplerate&255),u(at.mdhd,A)},J=function(T){return u(at.mdia,ae(T),ye(T.type),P(T))},S=function(T){return u(at.mfhd,new Uint8Array([0,0,0,0,(T&4278190080)>>24,(T&16711680)>>16,(T&65280)>>8,T&255]))},P=function(T){return u(at.minf,T.type==="video"?u(at.vmhd,Et):u(at.smhd,ii),h(),le(T))},R=function(T,A){for(var I=[],D=A.length;D--;)I[D]=tt(A[D]);return u.apply(null,[at.moof,S(T)].concat(I))},k=function(T){for(var A=T.length,I=[];A--;)I[A]=q(T[A]);return u.apply(null,[at.moov,L(4294967295)].concat(I).concat(M(T)))},M=function(T){for(var A=T.length,I=[];A--;)I[A]=ot(T[A]);return u.apply(null,[at.mvex].concat(I))},L=function(T){var A=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,0,1,95,144,(T&4278190080)>>24,(T&16711680)>>16,(T&65280)>>8,T&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(at.mvhd,A)},pe=function(T){var A=T.samples||[],I=new Uint8Array(4+A.length),D,F;for(F=0;F>>8),z.push(D[fe].byteLength&255),z=z.concat(Array.prototype.slice.call(D[fe]));for(fe=0;fe>>8),ue.push(F[fe].byteLength&255),ue=ue.concat(Array.prototype.slice.call(F[fe]));if(ve=[at.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,(I.width&65280)>>8,I.width&255,(I.height&65280)>>8,I.height&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,19,118,105,100,101,111,106,115,45,99,111,110,116,114,105,98,45,104,108,115,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),u(at.avcC,new Uint8Array([1,I.profileIdc,I.profileCompatibility,I.levelIdc,255].concat([D.length],z,[F.length],ue))),u(at.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192]))],I.sarRatio){var we=I.sarRatio[0],Me=I.sarRatio[1];ve.push(u(at.pasp,new Uint8Array([(we&4278190080)>>24,(we&16711680)>>16,(we&65280)>>8,we&255,(Me&4278190080)>>24,(Me&16711680)>>16,(Me&65280)>>8,Me&255])))}return u.apply(null,ve)},A=function(I){return u(at.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,(I.channelcount&65280)>>8,I.channelcount&255,(I.samplesize&65280)>>8,I.samplesize&255,0,0,0,0,(I.samplerate&65280)>>8,I.samplerate&255,0,0]),p(I))}}(),Z=function(T){var A=new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,(T.id&4278190080)>>24,(T.id&16711680)>>16,(T.id&65280)>>8,T.id&255,0,0,0,0,(T.duration&4278190080)>>24,(T.duration&16711680)>>16,(T.duration&65280)>>8,T.duration&255,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,(T.width&65280)>>8,T.width&255,0,0,(T.height&65280)>>8,T.height&255,0,0]);return u(at.tkhd,A)},tt=function(T){var A,I,D,F,z,ue,fe;return A=u(at.tfhd,new Uint8Array([0,0,0,58,(T.id&4278190080)>>24,(T.id&16711680)>>16,(T.id&65280)>>8,T.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0])),ue=Math.floor(T.baseMediaDecodeTime/o),fe=Math.floor(T.baseMediaDecodeTime%o),I=u(at.tfdt,new Uint8Array([1,0,0,0,ue>>>24&255,ue>>>16&255,ue>>>8&255,ue&255,fe>>>24&255,fe>>>16&255,fe>>>8&255,fe&255])),z=92,T.type==="audio"?(D=qe(T,z),u(at.traf,A,I,D)):(F=pe(T),D=qe(T,F.length+z),u(at.traf,A,I,D,F))},q=function(T){return T.duration=T.duration||4294967295,u(at.trak,Z(T),J(T))},ot=function(T){var A=new Uint8Array([0,0,0,0,(T.id&4278190080)>>24,(T.id&16711680)>>16,(T.id&65280)>>8,T.id&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]);return T.type!=="video"&&(A[A.length-1]=0),u(at.trex,A)},function(){var T,A,I;I=function(D,F){var z=0,ue=0,fe=0,ve=0;return D.length&&(D[0].duration!==void 0&&(z=1),D[0].size!==void 0&&(ue=2),D[0].flags!==void 0&&(fe=4),D[0].compositionTimeOffset!==void 0&&(ve=8)),[0,0,z|ue|fe|ve,1,(D.length&4278190080)>>>24,(D.length&16711680)>>>16,(D.length&65280)>>>8,D.length&255,(F&4278190080)>>>24,(F&16711680)>>>16,(F&65280)>>>8,F&255]},A=function(D,F){var z,ue,fe,ve,we,Me;for(ve=D.samples||[],F+=20+16*ve.length,fe=I(ve,F),ue=new Uint8Array(fe.length+ve.length*16),ue.set(fe),z=fe.length,Me=0;Me>>24,ue[z++]=(we.duration&16711680)>>>16,ue[z++]=(we.duration&65280)>>>8,ue[z++]=we.duration&255,ue[z++]=(we.size&4278190080)>>>24,ue[z++]=(we.size&16711680)>>>16,ue[z++]=(we.size&65280)>>>8,ue[z++]=we.size&255,ue[z++]=we.flags.isLeading<<2|we.flags.dependsOn,ue[z++]=we.flags.isDependedOn<<6|we.flags.hasRedundancy<<4|we.flags.paddingValue<<1|we.flags.isNonSyncSample,ue[z++]=we.flags.degradationPriority&61440,ue[z++]=we.flags.degradationPriority&15,ue[z++]=(we.compositionTimeOffset&4278190080)>>>24,ue[z++]=(we.compositionTimeOffset&16711680)>>>16,ue[z++]=(we.compositionTimeOffset&65280)>>>8,ue[z++]=we.compositionTimeOffset&255;return u(at.trun,ue)},T=function(D,F){var z,ue,fe,ve,we,Me;for(ve=D.samples||[],F+=20+8*ve.length,fe=I(ve,F),z=new Uint8Array(fe.length+ve.length*8),z.set(fe),ue=fe.length,Me=0;Me>>24,z[ue++]=(we.duration&16711680)>>>16,z[ue++]=(we.duration&65280)>>>8,z[ue++]=we.duration&255,z[ue++]=(we.size&4278190080)>>>24,z[ue++]=(we.size&16711680)>>>16,z[ue++]=(we.size&65280)>>>8,z[ue++]=we.size&255;return u(at.trun,z)},qe=function(D,F){return D.type==="audio"?T(D,F):A(D,F)}}();var Un={ftyp:g,mdat:y,moof:R,moov:k,initSegment:function(T){var A=g(),I=k(T),D;return D=new Uint8Array(A.byteLength+I.byteLength),D.set(A),D.set(I,A.byteLength),D}},rn=function(T){var A,I,D=[],F=[];for(F.byteLength=0,F.nalCount=0,F.duration=0,D.byteLength=0,A=0;A1&&(A=T.shift(),T.byteLength-=A.byteLength,T.nalCount-=A.nalCount,T[0][0].dts=A.dts,T[0][0].pts=A.pts,T[0][0].duration+=A.duration),T},mr=function(){return{size:0,flags:{isLeading:0,dependsOn:1,isDependedOn:0,hasRedundancy:0,degradationPriority:0,isNonSyncSample:1}}},Ce=function(T,A){var I=mr();return I.dataOffset=A,I.compositionTimeOffset=T.pts-T.dts,I.duration=T.duration,I.size=4*T.length,I.size+=T.byteLength,T.keyFrame&&(I.flags.dependsOn=2,I.flags.isNonSyncSample=0),I},Ie=function(T,A){var I,D,F,z,ue,fe=A||0,ve=[];for(I=0;Ist.ONE_SECOND_IN_TS/2))){for(we=We()[T.samplerate],we||(we=A[0].data),Me=0;Me=I?T:(A.minSegmentDts=1/0,T.filter(function(D){return D.dts>=I?(A.minSegmentDts=Math.min(A.minSegmentDts,D.dts),A.minSegmentPts=A.minSegmentDts,!0):!1}))},zn=function(T){var A,I,D=[];for(A=0;A=this.virtualRowCount&&typeof this.beforeRowOverflow=="function"&&this.beforeRowOverflow(T),this.rows.length>0&&(this.rows.push(""),this.rowIdx++);this.rows.length>this.virtualRowCount;)this.rows.shift(),this.rowIdx--},_i.prototype.isEmpty=function(){return this.rows.length===0?!0:this.rows.length===1?this.rows[0]==="":!1},_i.prototype.addText=function(T){this.rows[this.rowIdx]+=T},_i.prototype.backspace=function(){if(!this.isEmpty()){var T=this.rows[this.rowIdx];this.rows[this.rowIdx]=T.substr(0,T.length-1)}};var Kn=function(T,A,I){this.serviceNum=T,this.text="",this.currentWindow=new _i(-1),this.windows=[],this.stream=I,typeof A=="string"&&this.createTextDecoder(A)};Kn.prototype.init=function(T,A){this.startPts=T;for(var I=0;I<8;I++)this.windows[I]=new _i(I),typeof A=="function"&&(this.windows[I].beforeRowOverflow=A)},Kn.prototype.setCurrentWindow=function(T){this.currentWindow=this.windows[T]},Kn.prototype.createTextDecoder=function(T){if(typeof TextDecoder>"u")this.stream.trigger("log",{level:"warn",message:"The `encoding` option is unsupported without TextDecoder support"});else try{this.textDecoder_=new TextDecoder(T)}catch(A){this.stream.trigger("log",{level:"warn",message:"TextDecoder could not be created with "+T+" encoding. "+A})}};var gi=function(T){T=T||{},gi.prototype.init.call(this);var A=this,I=T.captionServices||{},D={},F;Object.keys(I).forEach(z=>{F=I[z],/^SERVICE/.test(z)&&(D[z]=F.encoding)}),this.serviceEncodings=D,this.current708Packet=null,this.services={},this.push=function(z){z.type===3?(A.new708Packet(),A.add708Bytes(z)):(A.current708Packet===null&&A.new708Packet(),A.add708Bytes(z))}};gi.prototype=new Gn,gi.prototype.new708Packet=function(){this.current708Packet!==null&&this.push708Packet(),this.current708Packet={data:[],ptsVals:[]}},gi.prototype.add708Bytes=function(T){var A=T.ccData,I=A>>>8,D=A&255;this.current708Packet.ptsVals.push(T.pts),this.current708Packet.data.push(I),this.current708Packet.data.push(D)},gi.prototype.push708Packet=function(){var T=this.current708Packet,A=T.data,I=null,D=null,F=0,z=A[F++];for(T.seq=z>>6,T.sizeCode=z&63;F>5,D=z&31,I===7&&D>0&&(z=A[F++],I=z),this.pushServiceBlock(I,F,D),D>0&&(F+=D-1)},gi.prototype.pushServiceBlock=function(T,A,I){var D,F=A,z=this.current708Packet.data,ue=this.services[T];for(ue||(ue=this.initService(T,F));F("0"+(jt&255).toString(16)).slice(-2)).join("")}if(F?(Ge=[fe,ve],T++):Ge=[fe],A.textDecoder_&&!D)Me=A.textDecoder_.decode(new Uint8Array(Ge));else if(F){const et=wt(Ge);Me=String.fromCharCode(parseInt(et,16))}else Me=Mr(ue|fe);return we.pendingNewLine&&!we.isEmpty()&&we.newLine(this.getPts(T)),we.pendingNewLine=!1,we.addText(Me),T},gi.prototype.multiByteCharacter=function(T,A){var I=this.current708Packet.data,D=I[T+1],F=I[T+2];return or(D)&&or(F)&&(T=this.handleText(++T,A,{isMultiByte:!0})),T},gi.prototype.setCurrentWindow=function(T,A){var I=this.current708Packet.data,D=I[T],F=D&7;return A.setCurrentWindow(F),T},gi.prototype.defineWindow=function(T,A){var I=this.current708Packet.data,D=I[T],F=D&7;A.setCurrentWindow(F);var z=A.currentWindow;return D=I[++T],z.visible=(D&32)>>5,z.rowLock=(D&16)>>4,z.columnLock=(D&8)>>3,z.priority=D&7,D=I[++T],z.relativePositioning=(D&128)>>7,z.anchorVertical=D&127,D=I[++T],z.anchorHorizontal=D,D=I[++T],z.anchorPoint=(D&240)>>4,z.rowCount=D&15,D=I[++T],z.columnCount=D&63,D=I[++T],z.windowStyle=(D&56)>>3,z.penStyle=D&7,z.virtualRowCount=z.rowCount+1,T},gi.prototype.setWindowAttributes=function(T,A){var I=this.current708Packet.data,D=I[T],F=A.currentWindow.winAttr;return D=I[++T],F.fillOpacity=(D&192)>>6,F.fillRed=(D&48)>>4,F.fillGreen=(D&12)>>2,F.fillBlue=D&3,D=I[++T],F.borderType=(D&192)>>6,F.borderRed=(D&48)>>4,F.borderGreen=(D&12)>>2,F.borderBlue=D&3,D=I[++T],F.borderType+=(D&128)>>5,F.wordWrap=(D&64)>>6,F.printDirection=(D&48)>>4,F.scrollDirection=(D&12)>>2,F.justify=D&3,D=I[++T],F.effectSpeed=(D&240)>>4,F.effectDirection=(D&12)>>2,F.displayEffect=D&3,T},gi.prototype.flushDisplayed=function(T,A){for(var I=[],D=0;D<8;D++)A.windows[D].visible&&!A.windows[D].isEmpty()&&I.push(A.windows[D].getText());A.endPts=T,A.text=I.join(` `),this.pushCaption(A),A.startPts=T},gi.prototype.pushCaption=function(T){T.text!==""&&(this.trigger("data",{startPts:T.startPts,endPts:T.endPts,text:T.text,stream:"cc708_"+T.serviceNum}),T.text="",T.startPts=T.endPts)},gi.prototype.displayWindows=function(T,A){var I=this.current708Packet.data,D=I[++T],F=this.getPts(T);this.flushDisplayed(F,A);for(var z=0;z<8;z++)D&1<>4,F.offset=(D&12)>>2,F.penSize=D&3,D=I[++T],F.italics=(D&128)>>7,F.underline=(D&64)>>6,F.edgeType=(D&56)>>3,F.fontStyle=D&7,T},gi.prototype.setPenColor=function(T,A){var I=this.current708Packet.data,D=I[T],F=A.currentWindow.penColor;return D=I[++T],F.fgOpacity=(D&192)>>6,F.fgRed=(D&48)>>4,F.fgGreen=(D&12)>>2,F.fgBlue=D&3,D=I[++T],F.bgOpacity=(D&192)>>6,F.bgRed=(D&48)>>4,F.bgGreen=(D&12)>>2,F.bgBlue=D&3,D=I[++T],F.edgeRed=(D&48)>>4,F.edgeGreen=(D&12)>>2,F.edgeBlue=D&3,T},gi.prototype.setPenLocation=function(T,A){var I=this.current708Packet.data,D=I[T],F=A.currentWindow.penLoc;return A.currentWindow.pendingNewLine=!0,D=I[++T],F.row=D&15,D=I[++T],F.column=D&63,T},gi.prototype.reset=function(T,A){var I=this.getPts(T);return this.flushDisplayed(I,A),this.initService(A.serviceNum,T)};var xs={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,304:174,305:176,306:189,307:191,308:8482,309:162,310:163,311:9834,312:224,313:160,314:232,315:226,316:234,317:238,318:244,319:251,544:193,545:201,546:211,547:218,548:220,549:252,550:8216,551:161,552:42,553:39,554:8212,555:169,556:8480,557:8226,558:8220,559:8221,560:192,561:194,562:199,563:200,564:202,565:203,566:235,567:206,568:207,569:239,570:212,571:217,572:249,573:219,574:171,575:187,800:195,801:227,802:205,803:204,804:236,805:210,806:242,807:213,808:245,809:123,810:125,811:92,812:94,813:95,814:124,815:126,816:196,817:228,818:214,819:246,820:223,821:165,822:164,823:9474,824:197,825:229,826:216,827:248,828:9484,829:9488,830:9492,831:9496},Go=function(T){return T===null?"":(T=xs[T]||T,String.fromCharCode(T))},Ra=14,Ht=[4352,4384,4608,4640,5376,5408,5632,5664,5888,5920,4096,4864,4896,5120,5152],Re=function(){for(var T=[],A=Ra+1;A--;)T.push({text:"",indent:0,offset:0});return T},rt=function(T,A){rt.prototype.init.call(this),this.field_=T||0,this.dataChannel_=A||0,this.name_="CC"+((this.field_<<1|this.dataChannel_)+1),this.setConstants(),this.reset(),this.push=function(I){var D,F,z,ue,fe;if(D=I.ccData&32639,D===this.lastControlCode_){this.lastControlCode_=null;return}if((D&61440)===4096?this.lastControlCode_=D:D!==this.PADDING_&&(this.lastControlCode_=null),z=D>>>8,ue=D&255,D!==this.PADDING_)if(D===this.RESUME_CAPTION_LOADING_)this.mode_="popOn";else if(D===this.END_OF_CAPTION_)this.mode_="popOn",this.clearFormatting(I.pts),this.flushDisplayed(I.pts),F=this.displayed_,this.displayed_=this.nonDisplayed_,this.nonDisplayed_=F,this.startPts_=I.pts;else if(D===this.ROLL_UP_2_ROWS_)this.rollUpRows_=2,this.setRollUp(I.pts);else if(D===this.ROLL_UP_3_ROWS_)this.rollUpRows_=3,this.setRollUp(I.pts);else if(D===this.ROLL_UP_4_ROWS_)this.rollUpRows_=4,this.setRollUp(I.pts);else if(D===this.CARRIAGE_RETURN_)this.clearFormatting(I.pts),this.flushDisplayed(I.pts),this.shiftRowsUp_(),this.startPts_=I.pts;else if(D===this.BACKSPACE_)this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1);else if(D===this.ERASE_DISPLAYED_MEMORY_)this.flushDisplayed(I.pts),this.displayed_=Re();else if(D===this.ERASE_NON_DISPLAYED_MEMORY_)this.nonDisplayed_=Re();else if(D===this.RESUME_DIRECT_CAPTIONING_)this.mode_!=="paintOn"&&(this.flushDisplayed(I.pts),this.displayed_=Re()),this.mode_="paintOn",this.startPts_=I.pts;else if(this.isSpecialCharacter(z,ue))z=(z&3)<<8,fe=Go(z|ue),this[this.mode_](I.pts,fe),this.column_++;else if(this.isExtCharacter(z,ue))this.mode_==="popOn"?this.nonDisplayed_[this.row_].text=this.nonDisplayed_[this.row_].text.slice(0,-1):this.displayed_[this.row_].text=this.displayed_[this.row_].text.slice(0,-1),z=(z&3)<<8,fe=Go(z|ue),this[this.mode_](I.pts,fe),this.column_++;else if(this.isMidRowCode(z,ue))this.clearFormatting(I.pts),this[this.mode_](I.pts," "),this.column_++,(ue&14)===14&&this.addFormatting(I.pts,["i"]),(ue&1)===1&&this.addFormatting(I.pts,["u"]);else if(this.isOffsetControlCode(z,ue)){const we=ue&3;this.nonDisplayed_[this.row_].offset=we,this.column_+=we}else if(this.isPAC(z,ue)){var ve=Ht.indexOf(D&7968);if(this.mode_==="rollUp"&&(ve-this.rollUpRows_+1<0&&(ve=this.rollUpRows_-1),this.setRollUp(I.pts,ve)),ve!==this.row_&&ve>=0&&ve<=14&&(this.clearFormatting(I.pts),this.row_=ve),ue&1&&this.formatting_.indexOf("u")===-1&&this.addFormatting(I.pts,["u"]),(D&16)===16){const we=(D&14)>>1;this.column_=we*4,this.nonDisplayed_[this.row_].indent+=we}this.isColorPAC(ue)&&(ue&14)===14&&this.addFormatting(I.pts,["i"])}else this.isNormalChar(z)&&(ue===0&&(ue=null),fe=Go(z),fe+=Go(ue),this[this.mode_](I.pts,fe),this.column_+=fe.length)}};rt.prototype=new Gn,rt.prototype.flushDisplayed=function(T){const A=D=>{this.trigger("log",{level:"warn",message:"Skipping a malformed 608 caption at index "+D+"."})},I=[];this.displayed_.forEach((D,F)=>{if(D&&D.text&&D.text.length){try{D.text=D.text.trim()}catch{A(F)}D.text.length&&I.push({text:D.text,line:F+1,position:10+Math.min(70,D.indent*10)+D.offset*2.5})}else D==null&&A(F)}),I.length&&this.trigger("data",{startPts:this.startPts_,endPts:T,content:I,stream:this.name_})},rt.prototype.reset=function(){this.mode_="popOn",this.topRow_=0,this.startPts_=0,this.displayed_=Re(),this.nonDisplayed_=Re(),this.lastControlCode_=null,this.column_=0,this.row_=Ra,this.rollUpRows_=2,this.formatting_=[]},rt.prototype.setConstants=function(){this.dataChannel_===0?(this.BASE_=16,this.EXT_=17,this.CONTROL_=(20|this.field_)<<8,this.OFFSET_=23):this.dataChannel_===1&&(this.BASE_=24,this.EXT_=25,this.CONTROL_=(28|this.field_)<<8,this.OFFSET_=31),this.PADDING_=0,this.RESUME_CAPTION_LOADING_=this.CONTROL_|32,this.END_OF_CAPTION_=this.CONTROL_|47,this.ROLL_UP_2_ROWS_=this.CONTROL_|37,this.ROLL_UP_3_ROWS_=this.CONTROL_|38,this.ROLL_UP_4_ROWS_=this.CONTROL_|39,this.CARRIAGE_RETURN_=this.CONTROL_|45,this.RESUME_DIRECT_CAPTIONING_=this.CONTROL_|41,this.BACKSPACE_=this.CONTROL_|33,this.ERASE_DISPLAYED_MEMORY_=this.CONTROL_|44,this.ERASE_NON_DISPLAYED_MEMORY_=this.CONTROL_|46},rt.prototype.isSpecialCharacter=function(T,A){return T===this.EXT_&&A>=48&&A<=63},rt.prototype.isExtCharacter=function(T,A){return(T===this.EXT_+1||T===this.EXT_+2)&&A>=32&&A<=63},rt.prototype.isMidRowCode=function(T,A){return T===this.EXT_&&A>=32&&A<=47},rt.prototype.isOffsetControlCode=function(T,A){return T===this.OFFSET_&&A>=33&&A<=35},rt.prototype.isPAC=function(T,A){return T>=this.BASE_&&T=64&&A<=127},rt.prototype.isColorPAC=function(T){return T>=64&&T<=79||T>=96&&T<=127},rt.prototype.isNormalChar=function(T){return T>=32&&T<=127},rt.prototype.setRollUp=function(T,A){if(this.mode_!=="rollUp"&&(this.row_=Ra,this.mode_="rollUp",this.flushDisplayed(T),this.nonDisplayed_=Re(),this.displayed_=Re()),A!==void 0&&A!==this.row_)for(var I=0;I"},"");this[this.mode_](T,I)},rt.prototype.clearFormatting=function(T){if(this.formatting_.length){var A=this.formatting_.reverse().reduce(function(I,D){return I+""},"");this.formatting_=[],this[this.mode_](T,A)}},rt.prototype.popOn=function(T,A){var I=this.nonDisplayed_[this.row_].text;I+=A,this.nonDisplayed_[this.row_].text=I},rt.prototype.rollUp=function(T,A){var I=this.displayed_[this.row_].text;I+=A,this.displayed_[this.row_].text=I},rt.prototype.shiftRowsUp_=function(){var T;for(T=0;TA&&(I=-1);Math.abs(A-T)>tr;)T+=I*An;return T},js=function(T){var A,I;js.prototype.init.call(this),this.type_=T||Cr,this.push=function(D){if(D.type==="metadata"){this.trigger("data",D);return}this.type_!==Cr&&D.type!==this.type_||(I===void 0&&(I=D.dts),D.dts=Bi(D.dts,I),D.pts=Bi(D.pts,I),A=D.dts,this.trigger("data",D))},this.flush=function(){I=A,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")},this.discontinuity=function(){I=void 0,A=void 0},this.reset=function(){this.discontinuity(),this.trigger("reset")}};js.prototype=new Mn;var Fn={TimestampRolloverStream:js,handleRollover:Bi},Oa=(T,A,I)=>{if(!T)return-1;for(var D=I;D";T.data[0]===Je.Utf8&&(I=Eu(T.data,0,A),!(I<0)&&(T.mimeType=El(T.data,A,I),A=I+1,T.pictureType=T.data[A],A++,D=Eu(T.data,0,A),!(D<0)&&(T.description=Fr(T.data,A,D),A=D+1,T.mimeType===F?T.url=El(T.data,A,T.data.length):T.pictureData=T.data.subarray(A,T.data.length))))},"T*":function(T){T.data[0]===Je.Utf8&&(T.value=Fr(T.data,1,T.data.length).replace(/\0*$/,""),T.values=T.value.split("\0"))},TXXX:function(T){var A;T.data[0]===Je.Utf8&&(A=Eu(T.data,0,1),A!==-1&&(T.description=Fr(T.data,1,A),T.value=Fr(T.data,A+1,T.data.length).replace(/\0*$/,""),T.data=T.value))},"W*":function(T){T.url=El(T.data,0,T.data.length).replace(/\0.*$/,"")},WXXX:function(T){var A;T.data[0]===Je.Utf8&&(A=Eu(T.data,0,1),A!==-1&&(T.description=Fr(T.data,1,A),T.url=El(T.data,A+1,T.data.length).replace(/\0.*$/,"")))},PRIV:function(T){var A;for(A=0;A>>2;jt*=4,jt+=et[7]&3,Me.timeStamp=jt,fe.pts===void 0&&fe.dts===void 0&&(fe.pts=Me.timeStamp,fe.dts=Me.timeStamp),this.trigger("timestamp",Me)}fe.frames.push(Me),ve+=10,ve+=we}while(ve>>4>1&&(ue+=F[ue]+1),z.pid===0)z.type="pat",T(F.subarray(ue),z),this.trigger("data",z);else if(z.pid===this.pmtPid)for(z.type="pmt",T(F.subarray(ue),z),this.trigger("data",z);this.packetsWaitingForPmt.length;)this.processPes_.apply(this,this.packetsWaitingForPmt.shift());else this.programMapTable===void 0?this.packetsWaitingForPmt.push([F,ue,z]):this.processPes_(F,ue,z)},this.processPes_=function(F,z,ue){ue.pid===this.programMapTable.video?ue.streamType=ar.H264_STREAM_TYPE:ue.pid===this.programMapTable.audio?ue.streamType=ar.ADTS_STREAM_TYPE:ue.streamType=this.programMapTable["timed-metadata"][ue.pid],ue.type="pes",ue.data=F.subarray(z),this.trigger("data",ue)}},Fa.prototype=new Ma,Fa.STREAM_TYPES={h264:27,adts:15},Dl=function(){var T=this,A=!1,I={data:[],size:0},D={data:[],size:0},F={data:[],size:0},z,ue=function(ve,we){var Me;const Ge=ve[0]<<16|ve[1]<<8|ve[2];we.data=new Uint8Array,Ge===1&&(we.packetLength=6+(ve[4]<<8|ve[5]),we.dataAlignmentIndicator=(ve[6]&4)!==0,Me=ve[7],Me&192&&(we.pts=(ve[9]&14)<<27|(ve[10]&255)<<20|(ve[11]&254)<<12|(ve[12]&255)<<5|(ve[13]&254)>>>3,we.pts*=4,we.pts+=(ve[13]&6)>>>1,we.dts=we.pts,Me&64&&(we.dts=(ve[14]&14)<<27|(ve[15]&255)<<20|(ve[16]&254)<<12|(ve[17]&255)<<5|(ve[18]&254)>>>3,we.dts*=4,we.dts+=(ve[18]&6)>>>1)),we.data=ve.subarray(9+ve[8]))},fe=function(ve,we,Me){var Ge=new Uint8Array(ve.size),wt={type:we},et=0,jt=0,ai=!1,Yn;if(!(!ve.data.length||ve.size<9)){for(wt.trackId=ve.data[0].pid,et=0;et>5,ve=((A[F+6]&3)+1)*1024,we=ve*Zp/Eh[(A[F+2]&60)>>>2],A.byteLength-F>>6&3)+1,channelcount:(A[F+2]&1)<<2|(A[F+3]&192)>>>6,samplerate:Eh[(A[F+2]&60)>>>2],samplingfrequencyindex:(A[F+2]&60)>>>2,samplesize:16,data:A.subarray(F+7+ue,F+z)}),I++,F+=z}typeof Me=="number"&&(this.skipWarn_(Me,F),Me=null),A=A.subarray(F)}},this.flush=function(){I=0,this.trigger("done")},this.reset=function(){A=void 0,this.trigger("reset")},this.endTimeline=function(){A=void 0,this.trigger("endedtimeline")}},Pl.prototype=new Oc;var Yo=Pl,Iu;Iu=function(T){var A=T.byteLength,I=0,D=0;this.length=function(){return 8*A},this.bitsAvailable=function(){return 8*A+D},this.loadWord=function(){var F=T.byteLength-A,z=new Uint8Array(4),ue=Math.min(4,A);if(ue===0)throw new Error("no bytes available");z.set(T.subarray(F,F+ue)),I=new DataView(z.buffer).getUint32(0),D=ue*8,A-=ue},this.skipBits=function(F){var z;D>F?(I<<=F,D-=F):(F-=D,z=Math.floor(F/8),F-=z*8,A-=z,this.loadWord(),I<<=F,D-=F)},this.readBits=function(F){var z=Math.min(D,F),ue=I>>>32-z;return D-=z,D>0?I<<=z:A>0&&this.loadWord(),z=F-z,z>0?ue<>>F)return I<<=F,D-=F,F;return this.loadWord(),F+this.skipLeadingZeros()},this.skipUnsignedExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.skipExpGolomb=function(){this.skipBits(1+this.skipLeadingZeros())},this.readUnsignedExpGolomb=function(){var F=this.skipLeadingZeros();return this.readBits(F+1)-1},this.readExpGolomb=function(){var F=this.readUnsignedExpGolomb();return 1&F?1+F>>>1:-1*(F>>>1)},this.readBoolean=function(){return this.readBits(1)===1},this.readUnsignedByte=function(){return this.readBits(8)},this.loadWord()};var Ch=Iu,Lc=i,Qp=Ch,Ru,lr,Mc;lr=function(){var T=0,A,I;lr.prototype.init.call(this),this.push=function(D){var F;I?(F=new Uint8Array(I.byteLength+D.data.byteLength),F.set(I),F.set(D.data,I.byteLength),I=F):I=D.data;for(var z=I.byteLength;T3&&this.trigger("data",I.subarray(T+3)),I=null,T=0,this.trigger("done")},this.endTimeline=function(){this.flush(),this.trigger("endedtimeline")}},lr.prototype=new Lc,Mc={100:!0,110:!0,122:!0,244:!0,44:!0,83:!0,86:!0,118:!0,128:!0,138:!0,139:!0,134:!0},Ru=function(){var T=new lr,A,I,D,F,z,ue,fe;Ru.prototype.init.call(this),A=this,this.push=function(ve){ve.type==="video"&&(I=ve.trackId,D=ve.pts,F=ve.dts,T.push(ve))},T.on("data",function(ve){var we={trackId:I,pts:D,dts:F,data:ve,nalUnitTypeCode:ve[0]&31};switch(we.nalUnitTypeCode){case 5:we.nalUnitType="slice_layer_without_partitioning_rbsp_idr";break;case 6:we.nalUnitType="sei_rbsp",we.escapedRBSP=z(ve.subarray(1));break;case 7:we.nalUnitType="seq_parameter_set_rbsp",we.escapedRBSP=z(ve.subarray(1)),we.config=ue(we.escapedRBSP);break;case 8:we.nalUnitType="pic_parameter_set_rbsp";break;case 9:we.nalUnitType="access_unit_delimiter_rbsp";break}A.trigger("data",we)}),T.on("done",function(){A.trigger("done")}),T.on("partialdone",function(){A.trigger("partialdone")}),T.on("reset",function(){A.trigger("reset")}),T.on("endedtimeline",function(){A.trigger("endedtimeline")}),this.flush=function(){T.flush()},this.partialFlush=function(){T.partialFlush()},this.reset=function(){T.reset()},this.endTimeline=function(){T.endTimeline()},fe=function(ve,we){var Me=8,Ge=8,wt,et;for(wt=0;wt>4;return I=I>=0?I:0,F?I+20:I+10},Fc=function(T,A){return T.length-A<10||T[A]!==73||T[A+1]!==68||T[A+2]!==51?A:(A+=kl(T,A),Fc(T,A))},$p=function(T){var A=Fc(T,0);return T.length>=A+2&&(T[A]&255)===255&&(T[A+1]&240)===240&&(T[A+1]&22)===16},Dh=function(T){return T[0]<<21|T[1]<<14|T[2]<<7|T[3]},Nc=function(T,A,I){var D,F="";for(D=A;D>5,D=T[A+4]<<3,F=T[A+3]&6144;return F|D|I},Ph=function(T,A){return T[A]===73&&T[A+1]===68&&T[A+2]===51?"timed-metadata":T[A]&!0&&(T[A+1]&240)===240?"audio":null},kh=function(T){for(var A=0;A+5>>2]}return null},tm=function(T){var A,I,D,F;A=10,T[5]&64&&(A+=4,A+=Dh(T.subarray(10,14)));do{if(I=Dh(T.subarray(A+4,A+8)),I<1)return null;if(F=String.fromCharCode(T[A],T[A+1],T[A+2],T[A+3]),F==="PRIV"){D=T.subarray(A+10,A+I+10);for(var z=0;z>>2;return ve*=4,ve+=fe[7]&3,ve}break}}A+=10,A+=I}while(A=3;){if(T[F]===73&&T[F+1]===68&&T[F+2]===51){if(T.length-F<10||(D=Ou.parseId3TagSize(T,F),F+D>T.length))break;ue={type:"timed-metadata",data:T.subarray(F,F+D)},this.trigger("data",ue),F+=D;continue}else if((T[F]&255)===255&&(T[F+1]&240)===240){if(T.length-F<7||(D=Ou.parseAdtsSize(T,F),F+D>T.length))break;fe={type:"audio",data:T.subarray(F,F+D),pts:A,dts:A},this.trigger("data",fe),F+=D;continue}F++}z=T.length-F,z>0?T=T.subarray(F):T=new Uint8Array},this.reset=function(){T=new Uint8Array,this.trigger("reset")},this.endTimeline=function(){T=new Uint8Array,this.trigger("endedtimeline")}},Il.prototype=new im;var cn=Il,Rl=["audioobjecttype","channelcount","samplerate","samplingfrequencyindex","samplesize"],Ol=Rl,Ih=["width","height","profileIdc","levelIdc","profileCompatibility","sarRatio"],Uc=Ih,Nr=i,ir=Un,Br=Oe,Ss=Er,Hr=yt,ro=Xp,is=re,Rh=Yo,zc=Ah.H264Stream,nm=cn,rm=Hc.isLikelyAacData,Vc=re.ONE_SECOND_IN_TS,Do=Ol,Xo=Uc,Lu,Zo,nr,Po,ur=function(T,A){A.stream=T,this.trigger("log",A)},so=function(T,A){for(var I=Object.keys(A),D=0;D=-1e4&&Me<=ve&&(!Ge||we>Me)&&(Ge=et,we=Me)));return Ge?Ge.gop:null},this.alignGopsAtStart_=function(fe){var ve,we,Me,Ge,wt,et,jt,ai;for(wt=fe.byteLength,et=fe.nalCount,jt=fe.duration,ve=we=0;veMe.pts){ve++;continue}we++,wt-=Ge.byteLength,et-=Ge.nalCount,jt-=Ge.duration}return we===0?fe:we===fe.length?null:(ai=fe.slice(we),ai.byteLength=wt,ai.duration=jt,ai.nalCount=et,ai.pts=ai[0].pts,ai.dts=ai[0].dts,ai)},this.alignGopsAtEnd_=function(fe){var ve,we,Me,Ge,wt,et;for(ve=F.length-1,we=fe.length-1,wt=null,et=!1;ve>=0&&we>=0;){if(Me=F[ve],Ge=fe[we],Me.pts===Ge.pts){et=!0;break}if(Me.pts>Ge.pts){ve--;continue}ve===F.length-1&&(wt=we),we--}if(!et&&wt===null)return null;var jt;if(et?jt=we:jt=wt,jt===0)return fe;var ai=fe.slice(jt),Yn=ai.reduce(function(yr,zr){return yr.byteLength+=zr.byteLength,yr.duration+=zr.duration,yr.nalCount+=zr.nalCount,yr},{byteLength:0,duration:0,nalCount:0});return ai.byteLength=Yn.byteLength,ai.duration=Yn.duration,ai.nalCount=Yn.nalCount,ai.pts=ai[0].pts,ai.dts=ai[0].dts,ai},this.alignGopsWith=function(fe){F=fe}},Lu.prototype=new Nr,Po=function(T,A){this.numberOfTracks=0,this.metadataStream=A,T=T||{},typeof T.remux<"u"?this.remuxTracks=!!T.remux:this.remuxTracks=!0,typeof T.keepOriginalTimestamps=="boolean"?this.keepOriginalTimestamps=T.keepOriginalTimestamps:this.keepOriginalTimestamps=!1,this.pendingTracks=[],this.videoTrack=null,this.pendingBoxes=[],this.pendingCaptions=[],this.pendingMetadata=[],this.pendingBytes=0,this.emittedTracks=0,Po.prototype.init.call(this),this.push=function(I){if(I.content||I.text)return this.pendingCaptions.push(I);if(I.frames)return this.pendingMetadata.push(I);this.pendingTracks.push(I.track),this.pendingBytes+=I.boxes.byteLength,I.track.type==="video"&&(this.videoTrack=I.track,this.pendingBoxes.push(I.boxes)),I.track.type==="audio"&&(this.audioTrack=I.track,this.pendingBoxes.unshift(I.boxes))}},Po.prototype=new Nr,Po.prototype.flush=function(T){var A=0,I={captions:[],captionStreams:{},metadata:[],info:{}},D,F,z,ue=0,fe;if(this.pendingTracks.length=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0);return}}if(this.videoTrack?(ue=this.videoTrack.timelineStartInfo.pts,Xo.forEach(function(ve){I.info[ve]=this.videoTrack[ve]},this)):this.audioTrack&&(ue=this.audioTrack.timelineStartInfo.pts,Do.forEach(function(ve){I.info[ve]=this.audioTrack[ve]},this)),this.videoTrack||this.audioTrack){for(this.pendingTracks.length===1?I.type=this.pendingTracks[0].type:I.type="combined",this.emittedTracks+=this.pendingTracks.length,z=ir.initSegment(this.pendingTracks),I.initSegment=new Uint8Array(z.byteLength),I.initSegment.set(z),I.data=new Uint8Array(this.pendingBytes),fe=0;fe=this.numberOfTracks&&(this.trigger("done"),this.emittedTracks=0)},Po.prototype.setRemux=function(T){this.remuxTracks=T},nr=function(T){var A=this,I=!0,D,F;nr.prototype.init.call(this),T=T||{},this.baseMediaDecodeTime=T.baseMediaDecodeTime||0,this.transmuxPipeline_={},this.setupAacPipeline=function(){var z={};this.transmuxPipeline_=z,z.type="aac",z.metadataStream=new ro.MetadataStream,z.aacStream=new nm,z.audioTimestampRolloverStream=new ro.TimestampRolloverStream("audio"),z.timedMetadataTimestampRolloverStream=new ro.TimestampRolloverStream("timed-metadata"),z.adtsStream=new Rh,z.coalesceStream=new Po(T,z.metadataStream),z.headOfPipeline=z.aacStream,z.aacStream.pipe(z.audioTimestampRolloverStream).pipe(z.adtsStream),z.aacStream.pipe(z.timedMetadataTimestampRolloverStream).pipe(z.metadataStream).pipe(z.coalesceStream),z.metadataStream.on("timestamp",function(ue){z.aacStream.setTimestamp(ue.timeStamp)}),z.aacStream.on("data",function(ue){ue.type!=="timed-metadata"&&ue.type!=="audio"||z.audioSegmentStream||(F=F||{timelineStartInfo:{baseMediaDecodeTime:A.baseMediaDecodeTime},codec:"adts",type:"audio"},z.coalesceStream.numberOfTracks++,z.audioSegmentStream=new Zo(F,T),z.audioSegmentStream.on("log",A.getLogTrigger_("audioSegmentStream")),z.audioSegmentStream.on("timingInfo",A.trigger.bind(A,"audioTimingInfo")),z.adtsStream.pipe(z.audioSegmentStream).pipe(z.coalesceStream),A.trigger("trackinfo",{hasAudio:!!F,hasVideo:!!D}))}),z.coalesceStream.on("data",this.trigger.bind(this,"data")),z.coalesceStream.on("done",this.trigger.bind(this,"done")),so(this,z)},this.setupTsPipeline=function(){var z={};this.transmuxPipeline_=z,z.type="ts",z.metadataStream=new ro.MetadataStream,z.packetStream=new ro.TransportPacketStream,z.parseStream=new ro.TransportParseStream,z.elementaryStream=new ro.ElementaryStream,z.timestampRolloverStream=new ro.TimestampRolloverStream,z.adtsStream=new Rh,z.h264Stream=new zc,z.captionStream=new ro.CaptionStream(T),z.coalesceStream=new Po(T,z.metadataStream),z.headOfPipeline=z.packetStream,z.packetStream.pipe(z.parseStream).pipe(z.elementaryStream).pipe(z.timestampRolloverStream),z.timestampRolloverStream.pipe(z.h264Stream),z.timestampRolloverStream.pipe(z.adtsStream),z.timestampRolloverStream.pipe(z.metadataStream).pipe(z.coalesceStream),z.h264Stream.pipe(z.captionStream).pipe(z.coalesceStream),z.elementaryStream.on("data",function(ue){var fe;if(ue.type==="metadata"){for(fe=ue.tracks.length;fe--;)!D&&ue.tracks[fe].type==="video"?(D=ue.tracks[fe],D.timelineStartInfo.baseMediaDecodeTime=A.baseMediaDecodeTime):!F&&ue.tracks[fe].type==="audio"&&(F=ue.tracks[fe],F.timelineStartInfo.baseMediaDecodeTime=A.baseMediaDecodeTime);D&&!z.videoSegmentStream&&(z.coalesceStream.numberOfTracks++,z.videoSegmentStream=new Lu(D,T),z.videoSegmentStream.on("log",A.getLogTrigger_("videoSegmentStream")),z.videoSegmentStream.on("timelineStartInfo",function(ve){F&&!T.keepOriginalTimestamps&&(F.timelineStartInfo=ve,z.audioSegmentStream.setEarliestDts(ve.dts-A.baseMediaDecodeTime))}),z.videoSegmentStream.on("processedGopsInfo",A.trigger.bind(A,"gopInfo")),z.videoSegmentStream.on("segmentTimingInfo",A.trigger.bind(A,"videoSegmentTimingInfo")),z.videoSegmentStream.on("baseMediaDecodeTime",function(ve){F&&z.audioSegmentStream.setVideoBaseMediaDecodeTime(ve)}),z.videoSegmentStream.on("timingInfo",A.trigger.bind(A,"videoTimingInfo")),z.h264Stream.pipe(z.videoSegmentStream).pipe(z.coalesceStream)),F&&!z.audioSegmentStream&&(z.coalesceStream.numberOfTracks++,z.audioSegmentStream=new Zo(F,T),z.audioSegmentStream.on("log",A.getLogTrigger_("audioSegmentStream")),z.audioSegmentStream.on("timingInfo",A.trigger.bind(A,"audioTimingInfo")),z.audioSegmentStream.on("segmentTimingInfo",A.trigger.bind(A,"audioSegmentTimingInfo")),z.adtsStream.pipe(z.audioSegmentStream).pipe(z.coalesceStream)),A.trigger("trackinfo",{hasAudio:!!F,hasVideo:!!D})}}),z.coalesceStream.on("data",this.trigger.bind(this,"data")),z.coalesceStream.on("id3Frame",function(ue){ue.dispatchType=z.metadataStream.dispatchType,A.trigger("id3Frame",ue)}),z.coalesceStream.on("caption",this.trigger.bind(this,"caption")),z.coalesceStream.on("done",this.trigger.bind(this,"done")),so(this,z)},this.setBaseMediaDecodeTime=function(z){var ue=this.transmuxPipeline_;T.keepOriginalTimestamps||(this.baseMediaDecodeTime=z),F&&(F.timelineStartInfo.dts=void 0,F.timelineStartInfo.pts=void 0,Hr.clearDtsInfo(F),ue.audioTimestampRolloverStream&&ue.audioTimestampRolloverStream.discontinuity()),D&&(ue.videoSegmentStream&&(ue.videoSegmentStream.gopCache_=[]),D.timelineStartInfo.dts=void 0,D.timelineStartInfo.pts=void 0,Hr.clearDtsInfo(D),ue.captionStream.reset()),ue.timestampRolloverStream&&ue.timestampRolloverStream.discontinuity()},this.setAudioAppendStart=function(z){F&&this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(z)},this.setRemux=function(z){var ue=this.transmuxPipeline_;T.remux=z,ue&&ue.coalesceStream&&ue.coalesceStream.setRemux(z)},this.alignGopsWith=function(z){D&&this.transmuxPipeline_.videoSegmentStream&&this.transmuxPipeline_.videoSegmentStream.alignGopsWith(z)},this.getLogTrigger_=function(z){var ue=this;return function(fe){fe.stream=z,ue.trigger("log",fe)}},this.push=function(z){if(I){var ue=rm(z);ue&&this.transmuxPipeline_.type!=="aac"?this.setupAacPipeline():!ue&&this.transmuxPipeline_.type!=="ts"&&this.setupTsPipeline(),I=!1}this.transmuxPipeline_.headOfPipeline.push(z)},this.flush=function(){I=!0,this.transmuxPipeline_.headOfPipeline.flush()},this.endTimeline=function(){this.transmuxPipeline_.headOfPipeline.endTimeline()},this.reset=function(){this.transmuxPipeline_.headOfPipeline&&this.transmuxPipeline_.headOfPipeline.reset()},this.resetCaptions=function(){this.transmuxPipeline_.captionStream&&this.transmuxPipeline_.captionStream.reset()}},nr.prototype=new Nr;var jc={Transmuxer:nr},Wc=function(T){return T>>>0},sm=function(T){return("00"+T.toString(16)).slice(-2)},mn={toUnsigned:Wc,toHexString:sm},om=function(T){var A="";return A+=String.fromCharCode(T[0]),A+=String.fromCharCode(T[1]),A+=String.fromCharCode(T[2]),A+=String.fromCharCode(T[3]),A},Fu=om,Es=mn.toUnsigned,qs=Fu,Ll=function(T,A){var I=[],D,F,z,ue,fe;if(!A.length)return null;for(D=0;D1?D+F:T.byteLength,z===A[0]&&(A.length===1?I.push(T.subarray(D+8,ue)):(fe=Ll(T.subarray(D+8,ue),A.slice(1)),fe.length&&(I=I.concat(fe)))),D=ue;return I},Nu=Ll,am=mn.toUnsigned,lm=s.getUint64,Oh=function(T){var A={version:T[0],flags:new Uint8Array(T.subarray(1,4))};return A.version===1?A.baseMediaDecodeTime=lm(T.subarray(4)):A.baseMediaDecodeTime=am(T[4]<<24|T[5]<<16|T[6]<<8|T[7]),A},qc=Oh,Lh=function(T){var A=new DataView(T.buffer,T.byteOffset,T.byteLength),I={version:T[0],flags:new Uint8Array(T.subarray(1,4)),trackId:A.getUint32(4)},D=I.flags[2]&1,F=I.flags[2]&2,z=I.flags[2]&8,ue=I.flags[2]&16,fe=I.flags[2]&32,ve=I.flags[0]&65536,we=I.flags[0]&131072,Me;return Me=8,D&&(Me+=4,I.baseDataOffset=A.getUint32(12),Me+=4),F&&(I.sampleDescriptionIndex=A.getUint32(Me),Me+=4),z&&(I.defaultSampleDuration=A.getUint32(Me),Me+=4),ue&&(I.defaultSampleSize=A.getUint32(Me),Me+=4),fe&&(I.defaultSampleFlags=A.getUint32(Me)),ve&&(I.durationIsEmpty=!0),!D&&we&&(I.baseDataOffsetIsMoof=!0),I},$i=Lh,Gc=function(T){return{isLeading:(T[0]&12)>>>2,dependsOn:T[0]&3,isDependedOn:(T[1]&192)>>>6,hasRedundancy:(T[1]&48)>>>4,paddingValue:(T[1]&14)>>>1,isNonSyncSample:T[1]&1,degradationPriority:T[2]<<8|T[3]}},gn=Gc,Bu=gn,Qo=function(T){var A={version:T[0],flags:new Uint8Array(T.subarray(1,4)),samples:[]},I=new DataView(T.buffer,T.byteOffset,T.byteLength),D=A.flags[2]&1,F=A.flags[2]&4,z=A.flags[1]&1,ue=A.flags[1]&2,fe=A.flags[1]&4,ve=A.flags[1]&8,we=I.getUint32(4),Me=8,Ge;for(D&&(A.dataOffset=I.getInt32(Me),Me+=4),F&&we&&(Ge={flags:Bu(T.subarray(Me,Me+4))},Me+=4,z&&(Ge.duration=I.getUint32(Me),Me+=4),ue&&(Ge.size=I.getUint32(Me),Me+=4),ve&&(A.version===1?Ge.compositionTimeOffset=I.getInt32(Me):Ge.compositionTimeOffset=I.getUint32(Me),Me+=4),A.samples.push(Ge),we--);we--;)Ge={},z&&(Ge.duration=I.getUint32(Me),Me+=4),ue&&(Ge.size=I.getUint32(Me),Me+=4),fe&&(Ge.flags=Bu(T.subarray(Me,Me+4)),Me+=4),ve&&(A.version===1?Ge.compositionTimeOffset=I.getInt32(Me):Ge.compositionTimeOffset=I.getUint32(Me),Me+=4),A.samples.push(Ge);return A},Kc=Qo,Yc={tfdt:qc,trun:Kc},Jo={parseTfdt:Yc.tfdt,parseTrun:Yc.trun},um=function(T){for(var A=0,I=String.fromCharCode(T[A]),D="";I!=="\0";)D+=I,A++,I=String.fromCharCode(T[A]);return D+=I,D},cm={uint8ToCString:um},Ml=cm.uint8ToCString,Hu=s.getUint64,Uu=function(T){var A=4,I=T[0],D,F,z,ue,fe,ve,we,Me;if(I===0){D=Ml(T.subarray(A)),A+=D.length,F=Ml(T.subarray(A)),A+=F.length;var Ge=new DataView(T.buffer);z=Ge.getUint32(A),A+=4,fe=Ge.getUint32(A),A+=4,ve=Ge.getUint32(A),A+=4,we=Ge.getUint32(A),A+=4}else if(I===1){var Ge=new DataView(T.buffer);z=Ge.getUint32(A),A+=4,ue=Hu(T.subarray(A)),A+=8,ve=Ge.getUint32(A),A+=4,we=Ge.getUint32(A),A+=4,D=Ml(T.subarray(A)),A+=D.length,F=Ml(T.subarray(A)),A+=F.length}Me=new Uint8Array(T.subarray(A,T.byteLength));var wt={scheme_id_uri:D,value:F,timescale:z||1,presentation_time:ue,presentation_time_delta:fe,event_duration:ve,id:we,message_data:Me};return Xc(I,wt)?wt:void 0},zu=function(T,A,I,D){return T||T===0?T/A:D+I/A},Xc=function(T,A){var I=A.scheme_id_uri!=="\0",D=T===0&&Fl(A.presentation_time_delta)&&I,F=T===1&&Fl(A.presentation_time)&&I;return!(T>1)&&D||F},Fl=function(T){return T!==void 0||T!==null},Mh={parseEmsgBox:Uu,scaleTime:zu},ko;typeof window<"u"?ko=window:typeof t<"u"?ko=t:typeof self<"u"?ko=self:ko={};var Vu=ko,Ha=mn.toUnsigned,$o=mn.toHexString,Dn=Nu,Ua=Fu,Zc=Mh,dm=$i,Fh=Kc,Nh=qc,Bh=s.getUint64,Nl,Qc,Jc,$c,Hh,Ur,Cs,za=Vu,hm=Cl.parseId3Frames;Nl=function(T){var A={},I=Dn(T,["moov","trak"]);return I.reduce(function(D,F){var z,ue,fe,ve,we;return z=Dn(F,["tkhd"])[0],!z||(ue=z[0],fe=ue===0?12:20,ve=Ha(z[fe]<<24|z[fe+1]<<16|z[fe+2]<<8|z[fe+3]),we=Dn(F,["mdia","mdhd"])[0],!we)?null:(ue=we[0],fe=ue===0?12:20,D[ve]=Ha(we[fe]<<24|we[fe+1]<<16|we[fe+2]<<8|we[fe+3]),D)},A)},Qc=function(T,A){var I;I=Dn(A,["moof","traf"]);var D=I.reduce(function(F,z){var ue=Dn(z,["tfhd"])[0],fe=Ha(ue[4]<<24|ue[5]<<16|ue[6]<<8|ue[7]),ve=T[fe]||9e4,we=Dn(z,["tfdt"])[0],Me=new DataView(we.buffer,we.byteOffset,we.byteLength),Ge;we[0]===1?Ge=Bh(we.subarray(4,12)):Ge=Me.getUint32(4);let wt;return typeof Ge=="bigint"?wt=Ge/za.BigInt(ve):typeof Ge=="number"&&!isNaN(Ge)&&(wt=Ge/ve),wt11?(F.codec+=".",F.codec+=$o(et[9]),F.codec+=$o(et[10]),F.codec+=$o(et[11])):F.codec="avc1.4d400d"):/^mp4[a,v]$/i.test(F.codec)?(et=wt.subarray(28),jt=Ua(et.subarray(4,8)),jt==="esds"&&et.length>20&&et[19]!==0?(F.codec+="."+$o(et[19]),F.codec+="."+$o(et[20]>>>2&63).replace(/^0/,"")):F.codec="mp4a.40.2"):F.codec=F.codec.toLowerCase())}var ai=Dn(D,["mdia","mdhd"])[0];ai&&(F.timescale=Ur(ai)),I.push(F)}),I},Cs=function(T,A=0){var I=Dn(T,["emsg"]);return I.map(D=>{var F=Zc.parseEmsgBox(new Uint8Array(D)),z=hm(F.message_data);return{cueTime:Zc.scaleTime(F.presentation_time,F.timescale,F.presentation_time_delta,A),duration:Zc.scaleTime(F.event_duration,F.timescale),frames:z}})};var Va={findBox:Dn,parseType:Ua,timescale:Nl,startTime:Qc,compositionStartTime:Jc,videoTrackIds:$c,tracks:Hh,getTimescaleFromMediaHeader:Ur,getEmsgID3:Cs};const{parseTrun:Uh}=Jo,{findBox:zh}=Va;var Vh=Vu,jh=function(T){var A=zh(T,["moof","traf"]),I=zh(T,["mdat"]),D=[];return I.forEach(function(F,z){var ue=A[z];D.push({mdat:F,traf:ue})}),D},Wh=function(T,A,I){var D=A,F=I.defaultSampleDuration||0,z=I.defaultSampleSize||0,ue=I.trackId,fe=[];return T.forEach(function(ve){var we=Uh(ve),Me=we.samples;Me.forEach(function(Ge){Ge.duration===void 0&&(Ge.duration=F),Ge.size===void 0&&(Ge.size=z),Ge.trackId=ue,Ge.dts=D,Ge.compositionTimeOffset===void 0&&(Ge.compositionTimeOffset=0),typeof D=="bigint"?(Ge.pts=D+Vh.BigInt(Ge.compositionTimeOffset),D+=Vh.BigInt(Ge.duration)):(Ge.pts=D+Ge.compositionTimeOffset,D+=Ge.duration)}),fe=fe.concat(Me)}),fe},Bl={getMdatTrafPairs:jh,parseSamples:Wh},qh=Li.discardEmulationPreventionBytes,fm=Dt.CaptionStream,ju=Nu,Gh=qc,pm=$i,{getMdatTrafPairs:Kh,parseSamples:Yh}=Bl,mm=function(T,A){for(var I=T,D=0;D0?Gh(Me[0]).baseMediaDecodeTime:0,wt=ju(ue,["trun"]),et,jt;A===we&&wt.length>0&&(et=Yh(wt,Ge,ve),jt=gm(z,et,we),I[we]||(I[we]={seiNals:[],logs:[]}),I[we].seiNals=I[we].seiNals.concat(jt.seiNals),I[we].logs=I[we].logs.concat(jt.logs))}),I},vm=function(T,A,I){var D;if(A===null)return null;D=ym(T,A);var F=D[A]||{};return{seiNals:F.seiNals,logs:F.logs,timescale:I}},bm=function(){var T=!1,A,I,D,F,z,ue;this.isInitialized=function(){return T},this.init=function(fe){A=new fm,T=!0,ue=fe?fe.isPartial:!1,A.on("data",function(ve){ve.startTime=ve.startPts/F,ve.endTime=ve.endPts/F,z.captions.push(ve),z.captionStreams[ve.stream]=!0}),A.on("log",function(ve){z.logs.push(ve)})},this.isNewInit=function(fe,ve){return fe&&fe.length===0||ve&&typeof ve=="object"&&Object.keys(ve).length===0?!1:D!==fe[0]||F!==ve[D]},this.parse=function(fe,ve,we){var Me;if(this.isInitialized()){if(!ve||!we)return null;if(this.isNewInit(ve,we))D=ve[0],F=we[D];else if(D===null||!F)return I.push(fe),null}else return null;for(;I.length>0;){var Ge=I.shift();this.parse(Ge,ve,we)}return Me=vm(fe,D,F),Me&&Me.logs&&(z.logs=z.logs.concat(Me.logs)),Me===null||!Me.seiNals?z.logs.length?{logs:z.logs,captions:[],captionStreams:[]}:null:(this.pushNals(Me.seiNals),this.flushStream(),z)},this.pushNals=function(fe){if(!this.isInitialized()||!fe||fe.length===0)return null;fe.forEach(function(ve){A.push(ve)})},this.flushStream=function(){if(!this.isInitialized())return null;ue?A.partialFlush():A.flush()},this.clearParsedCaptions=function(){z.captions=[],z.captionStreams={},z.logs=[]},this.resetCaptionStream=function(){if(!this.isInitialized())return null;A.reset()},this.clearAllCaptions=function(){this.clearParsedCaptions(),this.resetCaptionStream()},this.reset=function(){I=[],D=null,F=null,z?this.clearParsedCaptions():z={captions:[],captionStreams:{},logs:[]},this.resetCaptionStream()},this.reset()},Wu=bm;const{parseTfdt:Xh}=Jo,Io=Nu,{getTimescaleFromMediaHeader:_m}=Va,{parseSamples:wm,getMdatTrafPairs:Tm}=Bl;var Zh=function(){let T=9e4;this.init=function(A){const I=Io(A,["moov","trak","mdia","mdhd"])[0];I&&(T=_m(I))},this.parseSegment=function(A){const I=[],D=Tm(A);let F=0;return D.forEach(function(z){const ue=z.mdat,fe=z.traf,ve=Io(fe,["tfdt"])[0],we=Io(fe,["tfhd"])[0],Me=Io(fe,["trun"]);if(ve&&(F=Xh(ve).baseMediaDecodeTime),Me.length&&we){const Ge=wm(Me,F,we);let wt=0;Ge.forEach(function(et){const jt="utf-8",ai=new TextDecoder(jt),Yn=ue.slice(wt,wt+et.size);if(Io(Yn,["vtte"])[0]){wt+=et.size;return}Io(Yn,["vttc"]).forEach(function(lo){const qa=Io(lo,["payl"])[0],Ro=Io(lo,["sttg"])[0],Ga=et.pts/T,Yu=(et.pts+et.duration)/T;let Di,Ks;if(qa)try{Di=ai.decode(qa)}catch(As){console.error(As)}if(Ro)try{Ks=ai.decode(Ro)}catch(As){console.error(As)}et.duration&&Di&&I.push({cueText:Di,start:Ga,end:Yu,settings:Ks})}),wt+=et.size})}}),I}},td=Ci,id=function(T){var A=T[1]&31;return A<<=8,A|=T[2],A},Hl=function(T){return!!(T[1]&64)},yi=function(T){var A=0;return(T[3]&48)>>>4>1&&(A+=T[4]+1),A},oo=function(T,A){var I=id(T);return I===0?"pat":I===A?"pmt":A?"pes":null},ea=function(T){var A=Hl(T),I=4+yi(T);return A&&(I+=T[I]+1),(T[I+10]&31)<<8|T[I+11]},ao=function(T){var A={},I=Hl(T),D=4+yi(T);if(I&&(D+=T[D]+1),!!(T[D+5]&1)){var F,z,ue;F=(T[D+1]&15)<<8|T[D+2],z=3+F-4,ue=(T[D+10]&15)<<8|T[D+11];for(var fe=12+ue;fe=T.byteLength)return null;var D=null,F;return F=T[I+7],F&192&&(D={},D.pts=(T[I+9]&14)<<27|(T[I+10]&255)<<20|(T[I+11]&254)<<12|(T[I+12]&255)<<5|(T[I+13]&254)>>>3,D.pts*=4,D.pts+=(T[I+13]&6)>>>1,D.dts=D.pts,F&64&&(D.dts=(T[I+14]&14)<<27|(T[I+15]&255)<<20|(T[I+16]&254)<<12|(T[I+17]&255)<<5|(T[I+18]&254)>>>3,D.dts*=4,D.dts+=(T[I+18]&6)>>>1)),D},ja=function(T){switch(T){case 5:return"slice_layer_without_partitioning_rbsp_idr";case 6:return"sei_rbsp";case 7:return"seq_parameter_set_rbsp";case 8:return"pic_parameter_set_rbsp";case 9:return"access_unit_delimiter_rbsp";default:return null}},Qh=function(T){for(var A=4+yi(T),I=T.subarray(A),D=0,F=0,z=!1,ue;F3&&(ue=ja(I[F+3]&31),ue==="slice_layer_without_partitioning_rbsp_idr"&&(z=!0)),z},Wa={parseType:oo,parsePat:ea,parsePmt:ao,parsePayloadUnitStartIndicator:Hl,parsePesType:qu,parsePesTime:ns,videoPacketContainsKeyFrame:Qh},Jh=Ci,yn=Fn.handleRollover,Ai={};Ai.ts=Wa,Ai.aac=Hc;var ta=re.ONE_SECOND_IN_TS,Pn=188,Gs=71,xm=function(T,A){for(var I=0,D=Pn,F,z;D=0;){if(T[D]===Gs&&(T[F]===Gs||F===T.byteLength)){switch(z=T.subarray(D,F),ue=Ai.ts.parseType(z,A.pid),ue){case"pes":fe=Ai.ts.parsePesType(z,A.table),ve=Ai.ts.parsePayloadUnitStartIndicator(z),fe==="audio"&&ve&&(we=Ai.ts.parsePesTime(z),we&&(we.type="audio",I.audio.push(we),Me=!0));break}if(Me)break;D-=Pn,F-=Pn;continue}D--,F--}},Ul=function(T,A,I){for(var D=0,F=Pn,z,ue,fe,ve,we,Me,Ge,wt,et=!1,jt={data:[],size:0};F=0;){if(T[D]===Gs&&T[F]===Gs){switch(z=T.subarray(D,F),ue=Ai.ts.parseType(z,A.pid),ue){case"pes":fe=Ai.ts.parsePesType(z,A.table),ve=Ai.ts.parsePayloadUnitStartIndicator(z),fe==="video"&&ve&&(we=Ai.ts.parsePesTime(z),we&&(we.type="video",I.video.push(we),et=!0));break}if(et)break;D-=Pn,F-=Pn;continue}D--,F--}},Gu=function(T,A){if(T.audio&&T.audio.length){var I=A;(typeof I>"u"||isNaN(I))&&(I=T.audio[0].dts),T.audio.forEach(function(z){z.dts=yn(z.dts,I),z.pts=yn(z.pts,I),z.dtsTime=z.dts/ta,z.ptsTime=z.pts/ta})}if(T.video&&T.video.length){var D=A;if((typeof D>"u"||isNaN(D))&&(D=T.video[0].dts),T.video.forEach(function(z){z.dts=yn(z.dts,D),z.pts=yn(z.pts,D),z.dtsTime=z.dts/ta,z.ptsTime=z.pts/ta}),T.firstKeyFrame){var F=T.firstKeyFrame;F.dts=yn(F.dts,D),F.pts=yn(F.pts,D),F.dtsTime=F.dts/ta,F.ptsTime=F.pts/ta}}},Sm=function(T){for(var A=!1,I=0,D=null,F=null,z=0,ue=0,fe;T.length-ue>=3;){var ve=Ai.aac.parseType(T,ue);switch(ve){case"timed-metadata":if(T.length-ue<10){A=!0;break}if(z=Ai.aac.parseId3TagSize(T,ue),z>T.length){A=!0;break}F===null&&(fe=T.subarray(ue,ue+z),F=Ai.aac.parseAacTimestamp(fe)),ue+=z;break;case"audio":if(T.length-ue<7){A=!0;break}if(z=Ai.aac.parseAdtsSize(T,ue),z>T.length){A=!0;break}D===null&&(fe=T.subarray(ue,ue+z),D=Ai.aac.parseSampleRate(fe)),I++,ue+=z;break;default:ue++;break}if(A)return null}if(D===null||F===null)return null;var we=ta/D,Me={audio:[{type:"audio",dts:F,pts:F},{type:"audio",dts:F+I*1024*we,pts:F+I*1024*we}]};return Me},Em=function(T){var A={pid:null,table:null},I={};xm(T,A);for(var D in A.table)if(A.table.hasOwnProperty(D)){var F=A.table[D];switch(F){case Jh.H264_STREAM_TYPE:I.video=[],Ul(T,A,I),I.video.length===0&&delete I.video;break;case Jh.ADTS_STREAM_TYPE:I.audio=[],nd(T,A,I),I.audio.length===0&&delete I.audio;break}}return I},$h=function(T,A){var I=Ai.aac.isLikelyAacData(T),D;return I?D=Sm(T):D=Em(T),!D||!D.audio&&!D.video?null:(Gu(D,A),D)},Ku={inspect:$h,parseAudioPes_:nd};const Cm=function(T,A){A.on("data",function(I){const D=I.initSegment;I.initSegment={data:D.buffer,byteOffset:D.byteOffset,byteLength:D.byteLength};const F=I.data;I.data=F.buffer,T.postMessage({action:"data",segment:I,byteOffset:F.byteOffset,byteLength:F.byteLength},[I.data])}),A.on("done",function(I){T.postMessage({action:"done"})}),A.on("gopInfo",function(I){T.postMessage({action:"gopInfo",gopInfo:I})}),A.on("videoSegmentTimingInfo",function(I){const D={start:{decode:re.videoTsToSeconds(I.start.dts),presentation:re.videoTsToSeconds(I.start.pts)},end:{decode:re.videoTsToSeconds(I.end.dts),presentation:re.videoTsToSeconds(I.end.pts)},baseMediaDecodeTime:re.videoTsToSeconds(I.baseMediaDecodeTime)};I.prependedContentDuration&&(D.prependedContentDuration=re.videoTsToSeconds(I.prependedContentDuration)),T.postMessage({action:"videoSegmentTimingInfo",videoSegmentTimingInfo:D})}),A.on("audioSegmentTimingInfo",function(I){const D={start:{decode:re.videoTsToSeconds(I.start.dts),presentation:re.videoTsToSeconds(I.start.pts)},end:{decode:re.videoTsToSeconds(I.end.dts),presentation:re.videoTsToSeconds(I.end.pts)},baseMediaDecodeTime:re.videoTsToSeconds(I.baseMediaDecodeTime)};I.prependedContentDuration&&(D.prependedContentDuration=re.videoTsToSeconds(I.prependedContentDuration)),T.postMessage({action:"audioSegmentTimingInfo",audioSegmentTimingInfo:D})}),A.on("id3Frame",function(I){T.postMessage({action:"id3Frame",id3Frame:I})}),A.on("caption",function(I){T.postMessage({action:"caption",caption:I})}),A.on("trackinfo",function(I){T.postMessage({action:"trackinfo",trackInfo:I})}),A.on("audioTimingInfo",function(I){T.postMessage({action:"audioTimingInfo",audioTimingInfo:{start:re.videoTsToSeconds(I.start),end:re.videoTsToSeconds(I.end)}})}),A.on("videoTimingInfo",function(I){T.postMessage({action:"videoTimingInfo",videoTimingInfo:{start:re.videoTsToSeconds(I.start),end:re.videoTsToSeconds(I.end)}})}),A.on("log",function(I){T.postMessage({action:"log",log:I})})};class ef{constructor(A,I){this.options=I||{},this.self=A,this.init()}init(){this.transmuxer&&this.transmuxer.dispose(),this.transmuxer=new jc.Transmuxer(this.options),Cm(this.self,this.transmuxer)}pushMp4Captions(A){this.captionParser||(this.captionParser=new Wu,this.captionParser.init());const I=new Uint8Array(A.data,A.byteOffset,A.byteLength),D=this.captionParser.parse(I,A.trackIds,A.timescales);this.self.postMessage({action:"mp4Captions",captions:D&&D.captions||[],logs:D&&D.logs||[],data:I.buffer},[I.buffer])}initMp4WebVttParser(A){this.webVttParser||(this.webVttParser=new Zh);const I=new Uint8Array(A.data,A.byteOffset,A.byteLength);this.webVttParser.init(I)}getMp4WebVttText(A){this.webVttParser||(this.webVttParser=new Zh);const I=new Uint8Array(A.data,A.byteOffset,A.byteLength),D=this.webVttParser.parseSegment(I);this.self.postMessage({action:"getMp4WebVttText",mp4VttCues:D||[],data:I.buffer},[I.buffer])}probeMp4StartTime({timescales:A,data:I}){const D=Va.startTime(A,I);this.self.postMessage({action:"probeMp4StartTime",startTime:D,data:I},[I.buffer])}probeMp4Tracks({data:A}){const I=Va.tracks(A);this.self.postMessage({action:"probeMp4Tracks",tracks:I,data:A},[A.buffer])}probeEmsgID3({data:A,offset:I}){const D=Va.getEmsgID3(A,I);this.self.postMessage({action:"probeEmsgID3",id3Frames:D,emsgData:A},[A.buffer])}probeTs({data:A,baseStartTime:I}){const D=typeof I=="number"&&!isNaN(I)?I*re.ONE_SECOND_IN_TS:void 0,F=Ku.inspect(A,D);let z=null;F&&(z={hasVideo:F.video&&F.video.length===2||!1,hasAudio:F.audio&&F.audio.length===2||!1},z.hasVideo&&(z.videoStart=F.video[0].ptsTime),z.hasAudio&&(z.audioStart=F.audio[0].ptsTime)),this.self.postMessage({action:"probeTs",result:z,data:A},[A.buffer])}clearAllMp4Captions(){this.captionParser&&this.captionParser.clearAllCaptions()}clearParsedMp4Captions(){this.captionParser&&this.captionParser.clearParsedCaptions()}push(A){const I=new Uint8Array(A.data,A.byteOffset,A.byteLength);this.transmuxer.push(I)}reset(){this.transmuxer.reset()}setTimestampOffset(A){const I=A.timestampOffset||0;this.transmuxer.setBaseMediaDecodeTime(Math.round(re.secondsToVideoTs(I)))}setAudioAppendStart(A){this.transmuxer.setAudioAppendStart(Math.ceil(re.secondsToVideoTs(A.appendStart)))}setRemux(A){this.transmuxer.setRemux(A.remux)}flush(A){this.transmuxer.flush(),self.postMessage({action:"done",type:"transmuxed"})}endTimeline(){this.transmuxer.endTimeline(),self.postMessage({action:"endedtimeline",type:"transmuxed"})}alignGopsWith(A){this.transmuxer.alignGopsWith(A.gopsToAlignWith.slice())}}self.onmessage=function(T){if(T.data.action==="init"&&T.data.options){this.messageHandlers=new ef(self,T.data.options);return}this.messageHandlers||(this.messageHandlers=new ef(self)),T.data&&T.data.action&&T.data.action!=="init"&&this.messageHandlers[T.data.action]&&this.messageHandlers[T.data.action](T.data)}}));var gG=Qk(mG);const yG=(t,e,i)=>{const{type:n,initSegment:r,captions:s,captionStreams:o,metadata:u,videoFrameDtsTime:h,videoFramePtsTime:p}=t.data.segment;e.buffer.push({captions:s,captionStreams:o,metadata:u});const g=t.data.segment.boxes||{data:t.data.segment.data},y={type:n,data:new Uint8Array(g.data,g.data.byteOffset,g.data.byteLength),initSegment:new Uint8Array(r.data,r.byteOffset,r.byteLength)};typeof h<"u"&&(y.videoFrameDtsTime=h),typeof p<"u"&&(y.videoFramePtsTime=p),i(y)},vG=({transmuxedData:t,callback:e})=>{t.buffer=[],e(t)},bG=(t,e)=>{e.gopInfo=t.data.gopInfo},eI=t=>{const{transmuxer:e,bytes:i,audioAppendStart:n,gopsToAlignWith:r,remux:s,onData:o,onTrackInfo:u,onAudioTimingInfo:h,onVideoTimingInfo:p,onVideoSegmentTimingInfo:g,onAudioSegmentTimingInfo:y,onId3:S,onCaptions:P,onDone:R,onEndedTimeline:k,onTransmuxerLog:M,isEndOfTimeline:L,segment:q,triggerSegmentEventFn:Z}=t,J={buffer:[]};let ae=L;const ye=le=>{e.currentTransmux===t&&(le.data.action==="data"&&yG(le,J,o),le.data.action==="trackinfo"&&u(le.data.trackInfo),le.data.action==="gopInfo"&&bG(le,J),le.data.action==="audioTimingInfo"&&h(le.data.audioTimingInfo),le.data.action==="videoTimingInfo"&&p(le.data.videoTimingInfo),le.data.action==="videoSegmentTimingInfo"&&g(le.data.videoSegmentTimingInfo),le.data.action==="audioSegmentTimingInfo"&&y(le.data.audioSegmentTimingInfo),le.data.action==="id3Frame"&&S([le.data.id3Frame],le.data.id3Frame.dispatchType),le.data.action==="caption"&&P(le.data.caption),le.data.action==="endedtimeline"&&(ae=!1,k()),le.data.action==="log"&&M(le.data.log),le.data.type==="transmuxed"&&(ae||(e.onmessage=null,vG({transmuxedData:J,callback:R}),tI(e))))},pe=()=>{const le={message:"Received an error message from the transmuxer worker",metadata:{errorType:Ve.Error.StreamingFailedToTransmuxSegment,segmentInfo:Ac({segment:q})}};R(null,le)};if(e.onmessage=ye,e.onerror=pe,n&&e.postMessage({action:"setAudioAppendStart",appendStart:n}),Array.isArray(r)&&e.postMessage({action:"alignGopsWith",gopsToAlignWith:r}),typeof s<"u"&&e.postMessage({action:"setRemux",remux:s}),i.byteLength){const le=i instanceof ArrayBuffer?i:i.buffer,ze=i instanceof ArrayBuffer?0:i.byteOffset;Z({type:"segmenttransmuxingstart",segment:q}),e.postMessage({action:"push",data:le,byteOffset:ze,byteLength:i.byteLength},[le])}L&&e.postMessage({action:"endTimeline"}),e.postMessage({action:"flush"})},tI=t=>{t.currentTransmux=null,t.transmuxQueue.length&&(t.currentTransmux=t.transmuxQueue.shift(),typeof t.currentTransmux=="function"?t.currentTransmux():eI(t.currentTransmux))},iI=(t,e)=>{t.postMessage({action:e}),tI(t)},nI=(t,e)=>{if(!e.currentTransmux){e.currentTransmux=t,iI(e,t);return}e.transmuxQueue.push(iI.bind(null,e,t))},_G=t=>{nI("reset",t)},wG=t=>{nI("endTimeline",t)},rI=t=>{if(!t.transmuxer.currentTransmux){t.transmuxer.currentTransmux=t,eI(t);return}t.transmuxer.transmuxQueue.push(t)};var Zw={reset:_G,endTimeline:wG,transmux:rI,createTransmuxer:t=>{const e=new gG;e.currentTransmux=null,e.transmuxQueue=[];const i=e.terminate;return e.terminate=()=>(e.currentTransmux=null,e.transmuxQueue.length=0,i.call(e)),e.postMessage({action:"init",options:t}),e}};const fh=function(t){const e=t.transmuxer,i=t.endAction||t.action,n=t.callback,r=Wn({},t,{endAction:null,transmuxer:null,callback:null}),s=o=>{o.data.action===i&&(e.removeEventListener("message",s),o.data.data&&(o.data.data=new Uint8Array(o.data.data,t.byteOffset||0,t.byteLength||o.data.data.byteLength),t.data&&(t.data=o.data.data)),n(o.data))};if(e.addEventListener("message",s),t.data){const o=t.data instanceof ArrayBuffer;r.byteOffset=o?0:t.data.byteOffset,r.byteLength=t.data.byteLength;const u=[o?t.data:t.data.buffer];e.postMessage(r,u)}else e.postMessage(r)},Aa={FAILURE:2,TIMEOUT:-101,ABORTED:-102},sI="wvtt",Qw=t=>{t.forEach(e=>{e.abort()})},TG=t=>({bandwidth:t.bandwidth,bytesReceived:t.bytesReceived||0,roundTripTime:t.roundTripTime||0}),xG=t=>{const e=t.target,n={bandwidth:1/0,bytesReceived:0,roundTripTime:Date.now()-e.requestTime||0};return n.bytesReceived=t.loaded,n.bandwidth=Math.floor(n.bytesReceived/n.roundTripTime*8*1e3),n},Jw=(t,e)=>{const{requestType:i}=e,n=Cc({requestType:i,request:e,error:t});return e.timedout?{status:e.status,message:"HLS request timed-out at URL: "+e.uri,code:Aa.TIMEOUT,xhr:e,metadata:n}:e.aborted?{status:e.status,message:"HLS request aborted at URL: "+e.uri,code:Aa.ABORTED,xhr:e,metadata:n}:t?{status:e.status,message:"HLS request errored at URL: "+e.uri,code:Aa.FAILURE,xhr:e,metadata:n}:e.responseType==="arraybuffer"&&e.response.byteLength===0?{status:e.status,message:"Empty HLS response at URL: "+e.uri,code:Aa.FAILURE,xhr:e,metadata:n}:null},oI=(t,e,i,n)=>(r,s)=>{const o=s.response,u=Jw(r,s);if(u)return i(u,t);if(o.byteLength!==16)return i({status:s.status,message:"Invalid HLS key at URL: "+s.uri,code:Aa.FAILURE,xhr:s},t);const h=new DataView(o),p=new Uint32Array([h.getUint32(0),h.getUint32(4),h.getUint32(8),h.getUint32(12)]);for(let y=0;y{e===sI&&t.transmuxer.postMessage({action:"initMp4WebVttParser",data:t.map.bytes})},EG=(t,e,i)=>{e===sI&&fh({action:"getMp4WebVttText",data:t.bytes,transmuxer:t.transmuxer,callback:({data:n,mp4VttCues:r})=>{t.bytes=n,i(null,t,{mp4VttCues:r})}})},aI=(t,e)=>{const i=j_(t.map.bytes);if(i!=="mp4"){const n=t.map.resolvedUri||t.map.uri,r=i||"unknown";return e({internal:!0,message:`Found unsupported ${r} container for initialization segment at URL: ${n}`,code:Aa.FAILURE,metadata:{mediaType:r}})}fh({action:"probeMp4Tracks",data:t.map.bytes,transmuxer:t.transmuxer,callback:({tracks:n,data:r})=>(t.map.bytes=r,n.forEach(function(s){t.map.tracks=t.map.tracks||{},!t.map.tracks[s.type]&&(t.map.tracks[s.type]=s,typeof s.id=="number"&&s.timescale&&(t.map.timescales=t.map.timescales||{},t.map.timescales[s.id]=s.timescale),s.type==="text"&&SG(t,s.codec))}),e(null))})},CG=({segment:t,finishProcessingFn:e,triggerSegmentEventFn:i})=>(n,r)=>{const s=Jw(n,r);if(s)return e(s,t);const o=new Uint8Array(r.response);if(i({type:"segmentloaded",segment:t}),t.map.key)return t.map.encryptedBytes=o,e(null,t);t.map.bytes=o,aI(t,function(u){if(u)return u.xhr=r,u.status=r.status,e(u,t);e(null,t)})},AG=({segment:t,finishProcessingFn:e,responseType:i,triggerSegmentEventFn:n})=>(r,s)=>{const o=Jw(r,s);if(o)return e(o,t);n({type:"segmentloaded",segment:t});const u=i==="arraybuffer"||!s.responseText?s.response:fG(s.responseText.substring(t.lastReachedChar||0));return t.stats=TG(s),t.key?t.encryptedBytes=new Uint8Array(u):t.bytes=new Uint8Array(u),e(null,t)},DG=({segment:t,bytes:e,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:S,triggerSegmentEventFn:P})=>{const R=t.map&&t.map.tracks||{},k=!!(R.audio&&R.video);let M=n.bind(null,t,"audio","start");const L=n.bind(null,t,"audio","end");let q=n.bind(null,t,"video","start");const Z=n.bind(null,t,"video","end"),J=()=>rI({bytes:e,transmuxer:t.transmuxer,audioAppendStart:t.audioAppendStart,gopsToAlignWith:t.gopsToAlignWith,remux:k,onData:ae=>{ae.type=ae.type==="combined"?"video":ae.type,g(t,ae)},onTrackInfo:ae=>{i&&(k&&(ae.isMuxed=!0),i(t,ae))},onAudioTimingInfo:ae=>{M&&typeof ae.start<"u"&&(M(ae.start),M=null),L&&typeof ae.end<"u"&&L(ae.end)},onVideoTimingInfo:ae=>{q&&typeof ae.start<"u"&&(q(ae.start),q=null),Z&&typeof ae.end<"u"&&Z(ae.end)},onVideoSegmentTimingInfo:ae=>{const ye={pts:{start:ae.start.presentation,end:ae.end.presentation},dts:{start:ae.start.decode,end:ae.end.decode}};P({type:"segmenttransmuxingtiminginfoavailable",segment:t,timingInfo:ye}),r(ae)},onAudioSegmentTimingInfo:ae=>{const ye={pts:{start:ae.start.pts,end:ae.end.pts},dts:{start:ae.start.dts,end:ae.end.dts}};P({type:"segmenttransmuxingtiminginfoavailable",segment:t,timingInfo:ye}),s(ae)},onId3:(ae,ye)=>{o(t,ae,ye)},onCaptions:ae=>{u(t,[ae])},isEndOfTimeline:h,onEndedTimeline:()=>{p()},onTransmuxerLog:S,onDone:(ae,ye)=>{y&&(ae.type=ae.type==="combined"?"video":ae.type,P({type:"segmenttransmuxingcomplete",segment:t}),y(ye,t,ae))},segment:t,triggerSegmentEventFn:P});fh({action:"probeTs",transmuxer:t.transmuxer,data:e,baseStartTime:t.baseStartTime,callback:ae=>{t.bytes=e=ae.data;const ye=ae.result;ye&&(i(t,{hasAudio:ye.hasAudio,hasVideo:ye.hasVideo,isMuxed:k}),i=null),J()}})},lI=({segment:t,bytes:e,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:S,triggerSegmentEventFn:P})=>{let R=new Uint8Array(e);if(eW(R)){t.isFmp4=!0;const{tracks:k}=t.map;if(k.text&&(!k.audio||!k.video)){g(t,{data:R,type:"text"}),EG(t,k.text.codec,y);return}const L={isFmp4:!0,hasVideo:!!k.video,hasAudio:!!k.audio};k.audio&&k.audio.codec&&k.audio.codec!=="enca"&&(L.audioCodec=k.audio.codec),k.video&&k.video.codec&&k.video.codec!=="encv"&&(L.videoCodec=k.video.codec),k.video&&k.audio&&(L.isMuxed=!0),i(t,L);const q=(Z,J)=>{g(t,{data:R,type:L.hasAudio&&!L.isMuxed?"audio":"video"}),J&&J.length&&o(t,J),Z&&Z.length&&u(t,Z),y(null,t,{})};fh({action:"probeMp4StartTime",timescales:t.map.timescales,data:R,transmuxer:t.transmuxer,callback:({data:Z,startTime:J})=>{e=Z.buffer,t.bytes=R=Z,L.hasAudio&&!L.isMuxed&&n(t,"audio","start",J),L.hasVideo&&n(t,"video","start",J),fh({action:"probeEmsgID3",data:R,transmuxer:t.transmuxer,offset:J,callback:({emsgData:ae,id3Frames:ye})=>{if(e=ae.buffer,t.bytes=R=ae,!k.video||!ae.byteLength||!t.transmuxer){q(void 0,ye);return}fh({action:"pushMp4Captions",endAction:"mp4Captions",transmuxer:t.transmuxer,data:R,timescales:t.map.timescales,trackIds:[k.video.id],callback:pe=>{e=pe.data.buffer,t.bytes=R=pe.data,pe.logs.forEach(function(le){S(Ji(le,{stream:"mp4CaptionParser"}))}),q(pe.captions,ye)}})}})}});return}if(!t.transmuxer){y(null,t,{});return}if(typeof t.container>"u"&&(t.container=j_(R)),t.container!=="ts"&&t.container!=="aac"){i(t,{hasAudio:!1,hasVideo:!1}),y(null,t,{});return}DG({segment:t,bytes:e,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:S,triggerSegmentEventFn:P})},uI=function({id:t,key:e,encryptedBytes:i,decryptionWorker:n,segment:r,doneFn:s},o){const u=p=>{if(p.data.source===t){n.removeEventListener("message",u);const g=p.data.decrypted;o(new Uint8Array(g.bytes,g.byteOffset,g.byteLength))}};n.onerror=()=>{const p="An error occurred in the decryption worker",g=Ac({segment:r}),y={message:p,metadata:{error:new Error(p),errorType:Ve.Error.StreamingFailedToDecryptSegment,segmentInfo:g,keyInfo:{uri:r.key.resolvedUri||r.map.key.resolvedUri}}};s(y,r)},n.addEventListener("message",u);let h;e.bytes.slice?h=e.bytes.slice():h=new Uint32Array(Array.prototype.slice.call(e.bytes)),n.postMessage(jk({source:t,encrypted:i,key:h,iv:e.iv}),[i.buffer,h.buffer])},PG=({decryptionWorker:t,segment:e,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:S,triggerSegmentEventFn:P})=>{P({type:"segmentdecryptionstart"}),uI({id:e.requestId,key:e.key,encryptedBytes:e.encryptedBytes,decryptionWorker:t,segment:e,doneFn:y},R=>{e.bytes=R,P({type:"segmentdecryptioncomplete",segment:e}),lI({segment:e,bytes:e.bytes,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:S,triggerSegmentEventFn:P})})},kG=({activeXhrs:t,decryptionWorker:e,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:S,triggerSegmentEventFn:P})=>{let R=0,k=!1;return(M,L)=>{if(!k){if(M)return k=!0,Qw(t),y(M,L);if(R+=1,R===t.length){const q=function(){if(L.encryptedBytes)return PG({decryptionWorker:e,segment:L,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:S,triggerSegmentEventFn:P});lI({segment:L,bytes:L.bytes,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g,doneFn:y,onTransmuxerLog:S,triggerSegmentEventFn:P})};if(L.endOfAllRequests=Date.now(),L.map&&L.map.encryptedBytes&&!L.map.bytes)return P({type:"segmentdecryptionstart",segment:L}),uI({decryptionWorker:e,id:L.requestId+"-init",encryptedBytes:L.map.encryptedBytes,key:L.map.key,segment:L,doneFn:y},Z=>{L.map.bytes=Z,P({type:"segmentdecryptioncomplete",segment:L}),aI(L,J=>{if(J)return Qw(t),y(J,L);q()})});q()}}}},IG=({loadendState:t,abortFn:e})=>i=>{i.target.aborted&&e&&!t.calledAbortFn&&(e(),t.calledAbortFn=!0)},RG=({segment:t,progressFn:e,trackInfoFn:i,timingInfoFn:n,videoSegmentTimingInfoFn:r,audioSegmentTimingInfoFn:s,id3Fn:o,captionsFn:u,isEndOfTimeline:h,endedTimelineFn:p,dataFn:g})=>y=>{if(!y.target.aborted)return t.stats=Ji(t.stats,xG(y)),!t.stats.firstBytesReceivedAt&&t.stats.bytesReceived&&(t.stats.firstBytesReceivedAt=Date.now()),e(y,t)},OG=({xhr:t,xhrOptions:e,decryptionWorker:i,segment:n,abortFn:r,progressFn:s,trackInfoFn:o,timingInfoFn:u,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:p,id3Fn:g,captionsFn:y,isEndOfTimeline:S,endedTimelineFn:P,dataFn:R,doneFn:k,onTransmuxerLog:M,triggerSegmentEventFn:L})=>{const q=[],Z=kG({activeXhrs:q,decryptionWorker:i,trackInfoFn:o,timingInfoFn:u,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:p,id3Fn:g,captionsFn:y,isEndOfTimeline:S,endedTimelineFn:P,dataFn:R,doneFn:k,onTransmuxerLog:M,triggerSegmentEventFn:L});if(n.key&&!n.key.bytes){const le=[n.key];n.map&&!n.map.bytes&&n.map.key&&n.map.key.resolvedUri===n.key.resolvedUri&&le.push(n.map.key);const ze=Ji(e,{uri:n.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),tt=oI(n,le,Z,L),ot={uri:n.key.resolvedUri};L({type:"segmentkeyloadstart",segment:n,keyInfo:ot});const qe=t(ze,tt);q.push(qe)}if(n.map&&!n.map.bytes){if(n.map.key&&(!n.key||n.key.resolvedUri!==n.map.key.resolvedUri)){const qe=Ji(e,{uri:n.map.key.resolvedUri,responseType:"arraybuffer",requestType:"segment-key"}),at=oI(n,[n.map.key],Z,L),Pt={uri:n.map.key.resolvedUri};L({type:"segmentkeyloadstart",segment:n,keyInfo:Pt});const ci=t(qe,at);q.push(ci)}const ze=Ji(e,{uri:n.map.resolvedUri,responseType:"arraybuffer",headers:Kw(n.map),requestType:"segment-media-initialization"}),tt=CG({segment:n,finishProcessingFn:Z,triggerSegmentEventFn:L});L({type:"segmentloadstart",segment:n});const ot=t(ze,tt);q.push(ot)}const J=Ji(e,{uri:n.part&&n.part.resolvedUri||n.resolvedUri,responseType:"arraybuffer",headers:Kw(n),requestType:"segment"}),ae=AG({segment:n,finishProcessingFn:Z,responseType:J.responseType,triggerSegmentEventFn:L});L({type:"segmentloadstart",segment:n});const ye=t(J,ae);ye.addEventListener("progress",RG({segment:n,progressFn:s,trackInfoFn:o,timingInfoFn:u,videoSegmentTimingInfoFn:h,audioSegmentTimingInfoFn:p,id3Fn:g,captionsFn:y,isEndOfTimeline:S,endedTimelineFn:P,dataFn:R})),q.push(ye);const pe={};return q.forEach(le=>{le.addEventListener("loadend",IG({loadendState:pe,abortFn:r}))}),()=>Qw(q)},s0=So("PlaylistSelector"),cI=function(t){if(!t||!t.playlist)return;const e=t.playlist;return JSON.stringify({id:e.id,bandwidth:t.bandwidth,width:t.width,height:t.height,codecs:e.attributes&&e.attributes.CODECS||""})},ph=function(t,e){if(!t)return"";const i=_e.getComputedStyle(t);return i?i[e]:""},mh=function(t,e){const i=t.slice();t.sort(function(n,r){const s=e(n,r);return s===0?i.indexOf(n)-i.indexOf(r):s})},$w=function(t,e){let i,n;return t.attributes.BANDWIDTH&&(i=t.attributes.BANDWIDTH),i=i||_e.Number.MAX_VALUE,e.attributes.BANDWIDTH&&(n=e.attributes.BANDWIDTH),n=n||_e.Number.MAX_VALUE,i-n},LG=function(t,e){let i,n;return t.attributes.RESOLUTION&&t.attributes.RESOLUTION.width&&(i=t.attributes.RESOLUTION.width),i=i||_e.Number.MAX_VALUE,e.attributes.RESOLUTION&&e.attributes.RESOLUTION.width&&(n=e.attributes.RESOLUTION.width),n=n||_e.Number.MAX_VALUE,i===n&&t.attributes.BANDWIDTH&&e.attributes.BANDWIDTH?t.attributes.BANDWIDTH-e.attributes.BANDWIDTH:i-n};let dI=function(t){const{main:e,bandwidth:i,playerWidth:n,playerHeight:r,playerObjectFit:s,limitRenditionByPlayerDimensions:o,playlistController:u}=t;if(!e)return;const h={bandwidth:i,width:n,height:r,limitRenditionByPlayerDimensions:o};let p=e.playlists;zs.isAudioOnly(e)&&(p=u.getAudioTrackPlaylists_(),h.audioOnly=!0);let g=p.map(pe=>{let le;const ze=pe.attributes&&pe.attributes.RESOLUTION&&pe.attributes.RESOLUTION.width,tt=pe.attributes&&pe.attributes.RESOLUTION&&pe.attributes.RESOLUTION.height;return le=pe.attributes&&pe.attributes.BANDWIDTH,le=le||_e.Number.MAX_VALUE,{bandwidth:le,width:ze,height:tt,playlist:pe}});mh(g,(pe,le)=>pe.bandwidth-le.bandwidth),g=g.filter(pe=>!zs.isIncompatible(pe.playlist));let y=g.filter(pe=>zs.isEnabled(pe.playlist));y.length||(y=g.filter(pe=>!zs.isDisabled(pe.playlist)));const S=y.filter(pe=>pe.bandwidth*Sr.BANDWIDTH_VARIANCEpe.bandwidth===P.bandwidth)[0];if(o===!1){const pe=R||y[0]||g[0];if(pe&&pe.playlist){let le="sortedPlaylistReps";return R&&(le="bandwidthBestRep"),y[0]&&(le="enabledPlaylistReps"),s0(`choosing ${cI(pe)} using ${le} with options`,h),pe.playlist}return s0("could not choose a playlist with options",h),null}const k=S.filter(pe=>pe.width&&pe.height);mh(k,(pe,le)=>pe.width-le.width);const M=k.filter(pe=>pe.width===n&&pe.height===r);P=M[M.length-1];const L=M.filter(pe=>pe.bandwidth===P.bandwidth)[0];let q,Z,J;L||(q=k.filter(pe=>s==="cover"?pe.width>n&&pe.height>r:pe.width>n||pe.height>r),Z=q.filter(pe=>pe.width===q[0].width&&pe.height===q[0].height),P=Z[Z.length-1],J=Z.filter(pe=>pe.bandwidth===P.bandwidth)[0]);let ae;if(u.leastPixelDiffSelector){const pe=k.map(le=>(le.pixelDiff=Math.abs(le.width-n)+Math.abs(le.height-r),le));mh(pe,(le,ze)=>le.pixelDiff===ze.pixelDiff?ze.bandwidth-le.bandwidth:le.pixelDiff-ze.pixelDiff),ae=pe[0]}const ye=ae||J||L||R||y[0]||g[0];if(ye&&ye.playlist){let pe="sortedPlaylistReps";return ae?pe="leastPixelDiffRep":J?pe="resolutionPlusOneRep":L?pe="resolutionBestRep":R?pe="bandwidthBestRep":y[0]&&(pe="enabledPlaylistReps"),s0(`choosing ${cI(ye)} using ${pe} with options`,h),ye.playlist}return s0("could not choose a playlist with options",h),null};const hI=function(){let t=this.useDevicePixelRatio&&_e.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(t=this.customPixelRatio),dI({main:this.playlists.main,bandwidth:this.systemBandwidth,playerWidth:parseInt(ph(this.tech_.el(),"width"),10)*t,playerHeight:parseInt(ph(this.tech_.el(),"height"),10)*t,playerObjectFit:this.usePlayerObjectFit?ph(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})},MG=function(t){let e=-1,i=-1;if(t<0||t>1)throw new Error("Moving average bandwidth decay must be between 0 and 1.");return function(){let n=this.useDevicePixelRatio&&_e.devicePixelRatio||1;return isNaN(this.customPixelRatio)||(n=this.customPixelRatio),e<0&&(e=this.systemBandwidth,i=this.systemBandwidth),this.systemBandwidth>0&&this.systemBandwidth!==i&&(e=t*this.systemBandwidth+(1-t)*e,i=this.systemBandwidth),dI({main:this.playlists.main,bandwidth:e,playerWidth:parseInt(ph(this.tech_.el(),"width"),10)*n,playerHeight:parseInt(ph(this.tech_.el(),"height"),10)*n,playerObjectFit:this.usePlayerObjectFit?ph(this.tech_.el(),"objectFit"):"",limitRenditionByPlayerDimensions:this.limitRenditionByPlayerDimensions,playlistController:this.playlistController_})}},FG=function(t){const{main:e,currentTime:i,bandwidth:n,duration:r,segmentDuration:s,timeUntilRebuffer:o,currentTimeline:u,syncController:h}=t,p=e.playlists.filter(R=>!zs.isIncompatible(R));let g=p.filter(zs.isEnabled);g.length||(g=p.filter(R=>!zs.isDisabled(R)));const S=g.filter(zs.hasAttribute.bind(null,"BANDWIDTH")).map(R=>{const M=h.getSyncPoint(R,r,u,i)?1:2,q=zs.estimateSegmentRequestTime(s,n,R)*M-o;return{playlist:R,rebufferingImpact:q}}),P=S.filter(R=>R.rebufferingImpact<=0);return mh(P,(R,k)=>$w(k.playlist,R.playlist)),P.length?P[0]:(mh(S,(R,k)=>R.rebufferingImpact-k.rebufferingImpact),S[0]||null)},NG=function(){const t=this.playlists.main.playlists.filter(zs.isEnabled);return mh(t,(i,n)=>$w(i,n)),t.filter(i=>!!qp(this.playlists.main,i).video)[0]||null},BG=t=>{let e=0,i;return t.bytes&&(i=new Uint8Array(t.bytes),t.segments.forEach(n=>{i.set(n,e),e+=n.byteLength})),i};function fI(t){try{return new URL(t).pathname.split("/").slice(-2).join("/")}catch{return""}}const HG=function(t,e,i){if(!t[i]){e.trigger({type:"usage",name:"vhs-608"});let n=i;/^cc708_/.test(i)&&(n="SERVICE"+i.split("_")[1]);const r=e.textTracks().getTrackById(n);if(r)t[i]=r;else{const s=e.options_.vhs&&e.options_.vhs.captionServices||{};let o=i,u=i,h=!1;const p=s[n];p&&(o=p.label,u=p.language,h=p.default),t[i]=e.addRemoteTextTrack({kind:"captions",id:n,default:h,label:o,language:u},!1).track}}},UG=function({inbandTextTracks:t,captionArray:e,timestampOffset:i}){if(!e)return;const n=_e.WebKitDataCue||_e.VTTCue;e.forEach(r=>{const s=r.stream;r.content?r.content.forEach(o=>{const u=new n(r.startTime+i,r.endTime+i,o.text);u.line=o.line,u.align="left",u.position=o.position,u.positionAlign="line-left",t[s].addCue(u)}):t[s].addCue(new n(r.startTime+i,r.endTime+i,r.text))})},zG=function(t){Object.defineProperties(t.frame,{id:{get(){return Ve.log.warn("cue.frame.id is deprecated. Use cue.value.key instead."),t.value.key}},value:{get(){return Ve.log.warn("cue.frame.value is deprecated. Use cue.value.data instead."),t.value.data}},privateData:{get(){return Ve.log.warn("cue.frame.privateData is deprecated. Use cue.value.data instead."),t.value.data}}})},VG=({inbandTextTracks:t,metadataArray:e,timestampOffset:i,videoDuration:n})=>{if(!e)return;const r=_e.WebKitDataCue||_e.VTTCue,s=t.metadataTrack_;if(!s||(e.forEach(g=>{const y=g.cueTime+i;typeof y!="number"||_e.isNaN(y)||y<0||!(y<1/0)||!g.frames||!g.frames.length||g.frames.forEach(S=>{const P=new r(y,y,S.value||S.url||S.data||"");P.frame=S,P.value=S,zG(P),s.addCue(P)})}),!s.cues||!s.cues.length))return;const o=s.cues,u=[];for(let g=0;g{const S=g[y.startTime]||[];return S.push(y),g[y.startTime]=S,g},{}),p=Object.keys(h).sort((g,y)=>Number(g)-Number(y));p.forEach((g,y)=>{const S=h[g],P=isFinite(n)?n:g,R=Number(p[y+1])||P;S.forEach(k=>{k.endTime=R})})},jG={id:"ID",class:"CLASS",startDate:"START-DATE",duration:"DURATION",endDate:"END-DATE",endOnNext:"END-ON-NEXT",plannedDuration:"PLANNED-DURATION",scte35Out:"SCTE35-OUT",scte35In:"SCTE35-IN"},WG=new Set(["id","class","startDate","duration","endDate","endOnNext","startTime","endTime","processDateRange"]),qG=({inbandTextTracks:t,dateRanges:e})=>{const i=t.metadataTrack_;if(!i)return;const n=_e.WebKitDataCue||_e.VTTCue;e.forEach(r=>{for(const s of Object.keys(r)){if(WG.has(s))continue;const o=new n(r.startTime,r.endTime,"");o.id=r.id,o.type="com.apple.quicktime.HLS",o.value={key:jG[s],data:r[s]},(s==="scte35Out"||s==="scte35In")&&(o.value.data=new Uint8Array(o.value.data.match(/[\da-f]{2}/gi)).buffer),i.addCue(o)}r.processDateRange()})},pI=(t,e,i)=>{t.metadataTrack_||(t.metadataTrack_=i.addRemoteTextTrack({kind:"metadata",label:"Timed Metadata"},!1).track,Ve.browser.IS_ANY_SAFARI||(t.metadataTrack_.inBandMetadataTrackDispatchType=e))},Gp=function(t,e,i){let n,r;if(i&&i.cues)for(n=i.cues.length;n--;)r=i.cues[n],r.startTime>=t&&r.endTime<=e&&i.removeCue(r)},GG=function(t){const e=t.cues;if(!e)return;const i={};for(let n=e.length-1;n>=0;n--){const r=e[n],s=`${r.startTime}-${r.endTime}-${r.text}`;i[s]?t.removeCue(r):i[s]=r}},KG=(t,e,i)=>{if(typeof e>"u"||e===null||!t.length)return[];const n=Math.ceil((e-i+3)*vc.ONE_SECOND_IN_TS);let r;for(r=0;rn);r++);return t.slice(r)},YG=(t,e,i)=>{if(!e.length)return t;if(i)return e.slice();const n=e[0].pts;let r=0;for(r;r=n);r++);return t.slice(0,r).concat(e)},XG=(t,e,i,n)=>{const r=Math.ceil((e-n)*vc.ONE_SECOND_IN_TS),s=Math.ceil((i-n)*vc.ONE_SECOND_IN_TS),o=t.slice();let u=t.length;for(;u--&&!(t[u].pts<=s););if(u===-1)return o;let h=u+1;for(;h--&&!(t[h].pts<=r););return h=Math.max(h,0),o.splice(h,u-h+1),o},ZG=function(t,e){if(!t&&!e||!t&&e||t&&!e)return!1;if(t===e)return!0;const i=Object.keys(t).sort(),n=Object.keys(e).sort();if(i.length!==n.length)return!1;for(let r=0;ri))return s}return n.length===0?0:n[n.length-1]},Kp=1,JG=500,mI=t=>typeof t=="number"&&isFinite(t),o0=1/60,$G=(t,e,i)=>t!=="main"||!e||!i?null:!i.hasAudio&&!i.hasVideo?"Neither audio nor video found in segment.":e.hasVideo&&!i.hasVideo?"Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest.":!e.hasVideo&&i.hasVideo?"Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest.":null,eK=(t,e,i)=>{let n=e-Sr.BACK_BUFFER_LENGTH;t.length&&(n=Math.max(n,t.start(0)));const r=e-i;return Math.min(r,n)},gh=t=>{const{startOfSegment:e,duration:i,segment:n,part:r,playlist:{mediaSequence:s,id:o,segments:u=[]},mediaIndex:h,partIndex:p,timeline:g}=t,y=u.length-1;let S="mediaIndex/partIndex increment";t.getMediaInfoForTime?S=`getMediaInfoForTime (${t.getMediaInfoForTime})`:t.isSyncRequest&&(S="getSyncSegmentCandidate (isSyncRequest)"),t.independent&&(S+=` with independent ${t.independent}`);const P=typeof p=="number",R=t.segment.uri?"segment":"pre-segment",k=P?wk({preloadSegment:n})-1:0;return`${R} [${s+h}/${s+y}]`+(P?` part [${p}/${k}]`:"")+` segment start/end [${n.start} => ${n.end}]`+(P?` part start/end [${r.start} => ${r.end}]`:"")+` startOfSegment [${e}] duration [${i}] timeline [${g}] selected by [${S}] playlist [${o}]`},gI=t=>`${t}TimingInfo`,tK=({segmentTimeline:t,currentTimeline:e,startOfSegment:i,buffered:n,overrideCheck:r})=>!r&&t===e?null:t{if(e===i)return!1;if(n==="audio"){const s=t.lastTimelineChange({type:"main"});return!s||s.to!==i}if(n==="main"&&r){const s=t.pendingTimelineChange({type:"audio"});return!(s&&s.to===i)}return!1},iK=t=>{if(!t)return!1;const e=t.pendingTimelineChange({type:"audio"}),i=t.pendingTimelineChange({type:"main"}),n=e&&i,r=n&&e.to!==i.to;return!!(n&&e.from!==-1&&i.from!==-1&&r)},nK=t=>{const e=t.timelineChangeController_.pendingTimelineChange({type:"audio"}),i=t.timelineChangeController_.pendingTimelineChange({type:"main"});return e&&i&&e.to{const e=t.pendingSegment_;if(!e)return;if(eT({timelineChangeController:t.timelineChangeController_,currentTimeline:t.currentTimeline_,segmentTimeline:e.timeline,loaderType:t.loaderType_,audioDisabled:t.audioDisabled_})&&iK(t.timelineChangeController_)){if(nK(t)){t.timelineChangeController_.trigger("audioTimelineBehind");return}t.timelineChangeController_.trigger("fixBadTimelineChange")}},rK=t=>{let e=0;return["video","audio"].forEach(function(i){const n=t[`${i}TimingInfo`];if(!n)return;const{start:r,end:s}=n;let o;typeof r=="bigint"||typeof s=="bigint"?o=_e.BigInt(s)-_e.BigInt(r):typeof r=="number"&&typeof s=="number"&&(o=s-r),typeof o<"u"&&o>e&&(e=o)}),typeof e=="bigint"&&et?Math.round(t)>e+Ea:!1,sK=(t,e)=>{if(e!=="hls")return null;const i=rK({audioTimingInfo:t.audioTimingInfo,videoTimingInfo:t.videoTimingInfo});if(!i)return null;const n=t.playlist.targetDuration,r=yI({segmentDuration:i,maxDuration:n*2}),s=yI({segmentDuration:i,maxDuration:n}),o=`Segment with index ${t.mediaIndex} from playlist ${t.playlist.id} has a duration of ${i} when the reported duration is ${t.duration} and the target duration is ${n}. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1`;return r||s?{severity:r?"warn":"info",message:o}:null},Ac=({type:t,segment:e})=>{if(!e)return;const i=!!(e.key||e.map&&e.map.ke),n=!!(e.map&&!e.map.bytes),r=e.startOfSegment===void 0?e.start:e.startOfSegment;return{type:t||e.type,uri:e.resolvedUri||e.uri,start:r,duration:e.duration,isEncrypted:i,isMediaInitialization:n}};class tT extends Ve.EventTarget{constructor(e,i={}){if(super(),!e)throw new TypeError("Initialization settings are required");if(typeof e.currentTime!="function")throw new TypeError("No currentTime getter specified");if(!e.mediaSource)throw new TypeError("No MediaSource specified");this.bandwidth=e.bandwidth,this.throughput={rate:0,count:0},this.roundTrip=NaN,this.resetStats_(),this.mediaIndex=null,this.partIndex=null,this.hasPlayed_=e.hasPlayed,this.currentTime_=e.currentTime,this.seekable_=e.seekable,this.seeking_=e.seeking,this.duration_=e.duration,this.mediaSource_=e.mediaSource,this.vhs_=e.vhs,this.loaderType_=e.loaderType,this.currentMediaInfo_=void 0,this.startingMediaInfo_=void 0,this.segmentMetadataTrack_=e.segmentMetadataTrack,this.goalBufferLength_=e.goalBufferLength,this.sourceType_=e.sourceType,this.sourceUpdater_=e.sourceUpdater,this.inbandTextTracks_=e.inbandTextTracks,this.state_="INIT",this.timelineChangeController_=e.timelineChangeController,this.shouldSaveSegmentTimingInfo_=!0,this.parse708captions_=e.parse708captions,this.useDtsForTimestampOffset_=e.useDtsForTimestampOffset,this.captionServices_=e.captionServices,this.exactManifestTimings=e.exactManifestTimings,this.addMetadataToTextTrack=e.addMetadataToTextTrack,this.checkBufferTimeout_=null,this.error_=void 0,this.currentTimeline_=-1,this.shouldForceTimestampOffsetAfterResync_=!1,this.pendingSegment_=null,this.xhrOptions_=null,this.pendingSegments_=[],this.audioDisabled_=!1,this.isPendingTimestampOffset_=!1,this.gopBuffer_=[],this.timeMapping_=0,this.safeAppend_=!1,this.appendInitSegment_={audio:!0,video:!0},this.playlistOfLastInitSegment_={audio:null,video:null},this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_={id3:[],caption:[]},this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=null,this.activeInitSegmentId_=null,this.initSegments_={},this.cacheEncryptionKeys_=e.cacheEncryptionKeys,this.keyCache_={},this.decrypter_=e.decrypter,this.syncController_=e.syncController,this.syncPoint_={segmentIndex:0,time:0},this.transmuxer_=this.createTransmuxer_(),this.triggerSyncInfoUpdate_=()=>this.trigger("syncinfoupdate"),this.syncController_.on("syncinfoupdate",this.triggerSyncInfoUpdate_),this.mediaSource_.addEventListener("sourceopen",()=>{this.isEndOfStream_()||(this.ended_=!1)}),this.fetchAtBuffer_=!1,this.logger_=So(`SegmentLoader[${this.loaderType_}]`),Object.defineProperty(this,"state",{get(){return this.state_},set(n){n!==this.state_&&(this.logger_(`${this.state_} -> ${n}`),this.state_=n,this.trigger("statechange"))}}),this.sourceUpdater_.on("ready",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():bu(this)}),this.sourceUpdater_.on("codecschange",n=>{this.trigger(Wn({type:"codecschange"},n))}),this.loaderType_==="main"&&this.timelineChangeController_.on("pendingtimelinechange",()=>{this.hasEnoughInfoToAppend_()?this.processCallQueue_():bu(this)}),this.loaderType_==="audio"&&this.timelineChangeController_.on("timelinechange",n=>{this.trigger(Wn({type:"timelinechange"},n)),this.hasEnoughInfoToLoad_()?this.processLoadQueue_():bu(this),this.hasEnoughInfoToAppend_()?this.processCallQueue_():bu(this)})}get mediaSequenceSync_(){return this.syncController_.getMediaSequenceSync(this.loaderType_)}createTransmuxer_(){return Zw.createTransmuxer({remux:!1,alignGopsAtEnd:this.safeAppend_,keepOriginalTimestamps:!0,parse708captions:this.parse708captions_,captionServices:this.captionServices_})}resetStats_(){this.mediaBytesTransferred=0,this.mediaRequests=0,this.mediaRequestsAborted=0,this.mediaRequestsTimedout=0,this.mediaRequestsErrored=0,this.mediaTransferDuration=0,this.mediaSecondsLoaded=0,this.mediaAppends=0}dispose(){this.trigger("dispose"),this.state="DISPOSED",this.pause(),this.abort_(),this.transmuxer_&&this.transmuxer_.terminate(),this.resetStats_(),this.checkBufferTimeout_&&_e.clearTimeout(this.checkBufferTimeout_),this.syncController_&&this.triggerSyncInfoUpdate_&&this.syncController_.off("syncinfoupdate",this.triggerSyncInfoUpdate_),this.off()}setAudio(e){this.audioDisabled_=!e,e?this.appendInitSegment_.audio=!0:this.sourceUpdater_.removeAudio(0,this.duration_())}abort(){if(this.state!=="WAITING"){this.pendingSegment_&&(this.pendingSegment_=null),this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_);return}this.abort_(),this.state="READY",this.paused()||this.monitorBuffer_()}abort_(){this.pendingSegment_&&this.pendingSegment_.abortRequests&&this.pendingSegment_.abortRequests(),this.pendingSegment_=null,this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),this.waitingOnRemove_=!1,_e.clearTimeout(this.quotaExceededErrorRetryTimeout_),this.quotaExceededErrorRetryTimeout_=null}checkForAbort_(e){return this.state==="APPENDING"&&!this.pendingSegment_?(this.state="READY",!0):!this.pendingSegment_||this.pendingSegment_.requestId!==e}error(e){return typeof e<"u"&&(this.logger_("error occurred:",e),this.error_=e),this.pendingSegment_=null,this.error_}endOfStream(){this.ended_=!0,this.transmuxer_&&Zw.reset(this.transmuxer_),this.gopBuffer_.length=0,this.pause(),this.trigger("ended")}buffered_(){const e=this.getMediaInfo_();if(!this.sourceUpdater_||!e)return xr();if(this.loaderType_==="main"){const{hasAudio:i,hasVideo:n,isMuxed:r}=e;if(n&&i&&!this.audioDisabled_&&!r)return this.sourceUpdater_.buffered();if(n)return this.sourceUpdater_.videoBuffered()}return this.sourceUpdater_.audioBuffered()}initSegmentForMap(e,i=!1){if(!e)return null;const n=r0(e);let r=this.initSegments_[n];return i&&!r&&e.bytes&&(this.initSegments_[n]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:e.bytes,tracks:e.tracks,timescales:e.timescales}),r||e}segmentKey(e,i=!1){if(!e)return null;const n=Wk(e);let r=this.keyCache_[n];this.cacheEncryptionKeys_&&i&&!r&&e.bytes&&(this.keyCache_[n]=r={resolvedUri:e.resolvedUri,bytes:e.bytes});const s={resolvedUri:(r||e).resolvedUri};return r&&(s.bytes=r.bytes),s}couldBeginLoading_(){return this.playlist_&&!this.paused()}load(){if(this.monitorBuffer_(),!!this.playlist_){if(this.state==="INIT"&&this.couldBeginLoading_())return this.init_();!this.couldBeginLoading_()||this.state!=="READY"&&this.state!=="INIT"||(this.state="READY")}}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}playlist(e,i={}){if(!e||this.playlist_&&this.playlist_.endList&&e.endList&&this.playlist_.uri===e.uri)return;const n=this.playlist_,r=this.pendingSegment_;this.playlist_=e,this.xhrOptions_=i,this.state==="INIT"&&(e.syncInfo={mediaSequence:e.mediaSequence,time:0},this.loaderType_==="main"&&this.syncController_.setDateTimeMappingForStart(e));let s=null;if(n&&(n.id?s=n.id:n.uri&&(s=n.uri)),this.logger_(`playlist update [${s} => ${e.id||e.uri}]`),this.mediaSequenceSync_&&(this.mediaSequenceSync_.update(e,this.currentTime_()),this.logger_(`Playlist update: currentTime: ${this.currentTime_()} bufferedEnd: ${Nw(this.buffered_())} `,this.mediaSequenceSync_.diagnostics)),this.trigger("syncinfoupdate"),this.state==="INIT"&&this.couldBeginLoading_())return this.init_();if(!n||n.uri!==e.uri){this.mediaIndex!==null&&(!e.endList&&typeof e.partTargetDuration=="number"?this.resetLoader():this.resyncLoader()),this.currentMediaInfo_=void 0,this.trigger("playlistupdate");return}const o=e.mediaSequence-n.mediaSequence;if(this.logger_(`live window shift [${o}]`),this.mediaIndex!==null)if(this.mediaIndex-=o,this.mediaIndex<0)this.mediaIndex=null,this.partIndex=null;else{const u=this.playlist_.segments[this.mediaIndex];if(this.partIndex&&(!u.parts||!u.parts.length||!u.parts[this.partIndex])){const h=this.mediaIndex;this.logger_(`currently processing part (index ${this.partIndex}) no longer exists.`),this.resetLoader(),this.mediaIndex=h}}r&&(r.mediaIndex-=o,r.mediaIndex<0?(r.mediaIndex=null,r.partIndex=null):(r.mediaIndex>=0&&(r.segment=e.segments[r.mediaIndex]),r.partIndex>=0&&r.segment.parts&&(r.part=r.segment.parts[r.partIndex]))),this.syncController_.saveExpiredSegmentInfo(n,e)}pause(){this.checkBufferTimeout_&&(_e.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=null)}paused(){return this.checkBufferTimeout_===null}resetEverything(e){this.ended_=!1,this.activeInitSegmentId_=null,this.appendInitSegment_={audio:!0,video:!0},this.resetLoader(),this.remove(0,1/0,e),this.transmuxer_&&(this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),this.transmuxer_.postMessage({action:"reset"}))}resetLoader(){this.fetchAtBuffer_=!1,this.mediaSequenceSync_&&this.mediaSequenceSync_.resetAppendedStatus(),this.resyncLoader()}resyncLoader(){this.transmuxer_&&Zw.reset(this.transmuxer_),this.mediaIndex=null,this.partIndex=null,this.syncPoint_=null,this.isPendingTimestampOffset_=!1;const e=this.currentMediaInfo_&&this.currentMediaInfo_.isFmp4;this.sourceType_==="hls"&&!e&&(this.shouldForceTimestampOffsetAfterResync_=!0),this.callQueue_=[],this.loadQueue_=[],this.metadataQueue_.id3=[],this.metadataQueue_.caption=[],this.abort(),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}remove(e,i,n=()=>{},r=!1){if(i===1/0&&(i=this.duration_()),i<=e){this.logger_("skipping remove because end ${end} is <= start ${start}");return}if(!this.sourceUpdater_||!this.getMediaInfo_()){this.logger_("skipping remove because no source updater or starting media info");return}let s=1;const o=()=>{s--,s===0&&n()};(r||!this.audioDisabled_)&&(s++,this.sourceUpdater_.removeAudio(e,i,o)),(r||this.loaderType_==="main")&&(this.gopBuffer_=XG(this.gopBuffer_,e,i,this.timeMapping_),s++,this.sourceUpdater_.removeVideo(e,i,o));for(const u in this.inbandTextTracks_)Gp(e,i,this.inbandTextTracks_[u]);Gp(e,i,this.segmentMetadataTrack_),o()}monitorBuffer_(){this.checkBufferTimeout_&&_e.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=_e.setTimeout(this.monitorBufferTick_.bind(this),1)}monitorBufferTick_(){this.state==="READY"&&this.fillBuffer_(),this.checkBufferTimeout_&&_e.clearTimeout(this.checkBufferTimeout_),this.checkBufferTimeout_=_e.setTimeout(this.monitorBufferTick_.bind(this),JG)}fillBuffer_(){if(this.sourceUpdater_.updating())return;const e=this.chooseNextRequest_();if(!e)return;const i={segmentInfo:Ac({type:this.loaderType_,segment:e})};this.trigger({type:"segmentselected",metadata:i}),typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!1,this.timelineChangeController_.pendingTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline})),this.loadSegment_(e)}isEndOfStream_(e=this.mediaIndex,i=this.playlist_,n=this.partIndex){if(!i||!this.mediaSource_)return!1;const r=typeof e=="number"&&i.segments[e],s=e+1===i.segments.length,o=!r||!r.parts||n+1===r.parts.length;return i.endList&&this.mediaSource_.readyState==="open"&&s&&o}chooseNextRequest_(){const e=this.buffered_(),i=Nw(e)||0,n=Bw(e,this.currentTime_()),r=!this.hasPlayed_()&&n>=1,s=n>=this.goalBufferLength_(),o=this.playlist_.segments;if(!o.length||r||s)return null;this.syncPoint_=this.syncPoint_||this.syncController_.getSyncPoint(this.playlist_,this.duration_(),this.currentTimeline_,this.currentTime_(),this.loaderType_);const u={partIndex:null,mediaIndex:null,startOfSegment:null,playlist:this.playlist_,isSyncRequest:!this.syncPoint_};if(u.isSyncRequest)u.mediaIndex=QG(this.currentTimeline_,o,i),this.logger_(`choose next request. Can not find sync point. Fallback to media Index: ${u.mediaIndex}`);else if(this.mediaIndex!==null){const S=o[this.mediaIndex],P=typeof this.partIndex=="number"?this.partIndex:-1;u.startOfSegment=S.end?S.end:i,S.parts&&S.parts[P+1]?(u.mediaIndex=this.mediaIndex,u.partIndex=P+1):u.mediaIndex=this.mediaIndex+1}else{let S,P,R;const k=this.fetchAtBuffer_?i:this.currentTime_();if(this.mediaSequenceSync_&&this.logger_(`chooseNextRequest_ request after Quality Switch: For TargetTime: ${k}. CurrentTime: ${this.currentTime_()} BufferedEnd: ${i} Fetch At Buffer: ${this.fetchAtBuffer_} `,this.mediaSequenceSync_.diagnostics),this.mediaSequenceSync_&&this.mediaSequenceSync_.isReliable){const M=this.getSyncInfoFromMediaSequenceSync_(k);if(!M){const L="No sync info found while using media sequence sync";return this.error({message:L,metadata:{errorType:Ve.Error.StreamingFailedToSelectNextSegment,error:new Error(L)}}),this.logger_("chooseNextRequest_ - no sync info found using media sequence sync"),null}this.logger_(`chooseNextRequest_ mediaSequence syncInfo (${M.start} --> ${M.end})`),S=M.segmentIndex,P=M.partIndex,R=M.start}else{this.logger_("chooseNextRequest_ - fallback to a regular segment selection algorithm, based on a syncPoint.");const M=zs.getMediaInfoForTime({exactManifestTimings:this.exactManifestTimings,playlist:this.playlist_,currentTime:k,startingPartIndex:this.syncPoint_.partIndex,startingSegmentIndex:this.syncPoint_.segmentIndex,startTime:this.syncPoint_.time});S=M.segmentIndex,P=M.partIndex,R=M.startTime}u.getMediaInfoForTime=this.fetchAtBuffer_?`bufferedEnd ${k}`:`currentTime ${k}`,u.mediaIndex=S,u.startOfSegment=R,u.partIndex=P,this.logger_(`choose next request. Playlist switched and we have a sync point. Media Index: ${u.mediaIndex} `)}const h=o[u.mediaIndex];let p=h&&typeof u.partIndex=="number"&&h.parts&&h.parts[u.partIndex];if(!h||typeof u.partIndex=="number"&&!p)return null;typeof u.partIndex!="number"&&h.parts&&(u.partIndex=0,p=h.parts[0]);const g=this.vhs_.playlists&&this.vhs_.playlists.main&&this.vhs_.playlists.main.independentSegments||this.playlist_.independentSegments;if(!n&&p&&!g&&!p.independent)if(u.partIndex===0){const S=o[u.mediaIndex-1],P=S.parts&&S.parts.length&&S.parts[S.parts.length-1];P&&P.independent&&(u.mediaIndex-=1,u.partIndex=S.parts.length-1,u.independent="previous segment")}else h.parts[u.partIndex-1].independent&&(u.partIndex-=1,u.independent="previous part");const y=this.mediaSource_&&this.mediaSource_.readyState==="ended";return u.mediaIndex>=o.length-1&&y&&!this.seeking_()?null:(this.shouldForceTimestampOffsetAfterResync_&&(this.shouldForceTimestampOffsetAfterResync_=!1,u.forceTimestampOffset=!0,this.logger_("choose next request. Force timestamp offset after loader resync")),this.generateSegmentInfo_(u))}getSyncInfoFromMediaSequenceSync_(e){if(!this.mediaSequenceSync_)return null;const i=Math.max(e,this.mediaSequenceSync_.start);e!==i&&this.logger_(`getSyncInfoFromMediaSequenceSync_. Pulled target time from ${e} to ${i}`);const n=this.mediaSequenceSync_.getSyncInfoForTime(i);if(!n)return null;if(!n.isAppended)return n;const r=this.mediaSequenceSync_.getSyncInfoForTime(n.end);return r?(r.isAppended&&this.logger_("getSyncInfoFromMediaSequenceSync_: We encounter unexpected scenario where next media sequence sync info is also appended!"),r):null}generateSegmentInfo_(e){const{independent:i,playlist:n,mediaIndex:r,startOfSegment:s,isSyncRequest:o,partIndex:u,forceTimestampOffset:h,getMediaInfoForTime:p}=e,g=n.segments[r],y=typeof u=="number"&&g.parts[u],S={requestId:"segment-loader-"+Math.random(),uri:y&&y.resolvedUri||g.resolvedUri,mediaIndex:r,partIndex:y?u:null,isSyncRequest:o,startOfSegment:s,playlist:n,bytes:null,encryptedBytes:null,timestampOffset:null,timeline:g.timeline,duration:y&&y.duration||g.duration,segment:g,part:y,byteLength:0,transmuxer:this.transmuxer_,getMediaInfoForTime:p,independent:i},P=typeof h<"u"?h:this.isPendingTimestampOffset_;S.timestampOffset=this.timestampOffsetForSegment_({segmentTimeline:g.timeline,currentTimeline:this.currentTimeline_,startOfSegment:s,buffered:this.buffered_(),overrideCheck:P});const R=Nw(this.sourceUpdater_.audioBuffered());return typeof R=="number"&&(S.audioAppendStart=R-this.sourceUpdater_.audioTimestampOffset()),this.sourceUpdater_.videoBuffered().length&&(S.gopsToAlignWith=KG(this.gopBuffer_,this.currentTime_()-this.sourceUpdater_.videoTimestampOffset(),this.timeMapping_)),S}timestampOffsetForSegment_(e){return tK(e)}earlyAbortWhenNeeded_(e){if(this.vhs_.tech_.paused()||!this.xhrOptions_.timeout||!this.playlist_.attributes.BANDWIDTH||Date.now()-(e.firstBytesReceivedAt||Date.now())<1e3)return;const i=this.currentTime_(),n=e.bandwidth,r=this.pendingSegment_.duration,s=zs.estimateSegmentRequestTime(r,n,this.playlist_,e.bytesReceived),o=Cq(this.buffered_(),i,this.vhs_.tech_.playbackRate())-1;if(s<=o)return;const u=FG({main:this.vhs_.playlists.main,currentTime:i,bandwidth:n,duration:this.duration_(),segmentDuration:r,timeUntilRebuffer:o,currentTimeline:this.currentTimeline_,syncController:this.syncController_});if(!u)return;const p=s-o-u.rebufferingImpact;let g=.5;o<=Ea&&(g=1),!(!u.playlist||u.playlist.uri===this.playlist_.uri||p{s[o.stream]=s[o.stream]||{startTime:1/0,captions:[],endTime:0};const u=s[o.stream];u.startTime=Math.min(u.startTime,o.startTime+r),u.endTime=Math.max(u.endTime,o.endTime+r),u.captions.push(o)}),Object.keys(s).forEach(o=>{const{startTime:u,endTime:h,captions:p}=s[o],g=this.inbandTextTracks_;this.logger_(`adding cues from ${u} -> ${h} for ${o}`),HG(g,this.vhs_.tech_,o),Gp(u,h,g[o]),UG({captionArray:p,inbandTextTracks:g,timestampOffset:r})}),this.transmuxer_&&this.transmuxer_.postMessage({action:"clearParsedMp4Captions"})}handleId3_(e,i,n){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(!this.pendingSegment_.hasAppendedData_){this.metadataQueue_.id3.push(this.handleId3_.bind(this,e,i,n));return}this.addMetadataToTextTrack(n,i,this.duration_())}processMetadataQueue_(){this.metadataQueue_.id3.forEach(e=>e()),this.metadataQueue_.caption.forEach(e=>e()),this.metadataQueue_.id3=[],this.metadataQueue_.caption=[]}processCallQueue_(){const e=this.callQueue_;this.callQueue_=[],e.forEach(i=>i())}processLoadQueue_(){const e=this.loadQueue_;this.loadQueue_=[],e.forEach(i=>i())}hasEnoughInfoToLoad_(){if(this.loaderType_!=="audio")return!0;const e=this.pendingSegment_;return e?this.getCurrentMediaInfo_()?!eT({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}):!0:!1}getCurrentMediaInfo_(e=this.pendingSegment_){return e&&e.trackInfo||this.currentMediaInfo_}getMediaInfo_(e=this.pendingSegment_){return this.getCurrentMediaInfo_(e)||this.startingMediaInfo_}getPendingSegmentPlaylist(){return this.pendingSegment_?this.pendingSegment_.playlist:null}hasEnoughInfoToAppend_(){if(!this.sourceUpdater_.ready()||this.waitingOnRemove_||this.quotaExceededErrorRetryTimeout_)return!1;const e=this.pendingSegment_,i=this.getCurrentMediaInfo_();if(!e||!i)return!1;const{hasAudio:n,hasVideo:r,isMuxed:s}=i;return!(r&&!e.videoTimingInfo||n&&!this.audioDisabled_&&!s&&!e.audioTimingInfo||eT({timelineChangeController:this.timelineChangeController_,currentTimeline:this.currentTimeline_,segmentTimeline:e.timeline,loaderType:this.loaderType_,audioDisabled:this.audioDisabled_}))}handleData_(e,i){if(this.earlyAbortWhenNeeded_(e.stats),this.checkForAbort_(e.requestId))return;if(this.callQueue_.length||!this.hasEnoughInfoToAppend_()){bu(this),this.callQueue_.push(this.handleData_.bind(this,e,i));return}const n=this.pendingSegment_;if(this.setTimeMapping_(n.timeline),this.updateMediaSecondsLoaded_(n.part||n.segment),this.mediaSource_.readyState!=="closed"){if(e.map&&(e.map=this.initSegmentForMap(e.map,!0),n.segment.map=e.map),e.key&&this.segmentKey(e.key,!0),n.isFmp4=e.isFmp4,n.timingInfo=n.timingInfo||{},n.isFmp4)this.trigger("fmp4"),n.timingInfo.start=n[gI(i.type)].start;else{const r=this.getCurrentMediaInfo_(),s=this.loaderType_==="main"&&r&&r.hasVideo;let o;s&&(o=n.videoTimingInfo.start),n.timingInfo.start=this.trueSegmentStart_({currentStart:n.timingInfo.start,playlist:n.playlist,mediaIndex:n.mediaIndex,currentVideoTimestampOffset:this.sourceUpdater_.videoTimestampOffset(),useVideoTimingInfo:s,firstVideoFrameTimeForData:o,videoTimingInfo:n.videoTimingInfo,audioTimingInfo:n.audioTimingInfo})}if(this.updateAppendInitSegmentStatus(n,i.type),this.updateSourceBufferTimestampOffset_(n),n.isSyncRequest){this.updateTimingInfoEnd_(n),this.syncController_.saveSegmentTimingInfo({segmentInfo:n,shouldSaveTimelineMapping:this.loaderType_==="main"});const r=this.chooseNextRequest_();if(r.mediaIndex!==n.mediaIndex||r.partIndex!==n.partIndex){this.logger_("sync segment was incorrect, not appending");return}this.logger_("sync segment was correct, appending")}n.hasAppendedData_=!0,this.processMetadataQueue_(),this.appendData_(n,i)}}updateAppendInitSegmentStatus(e,i){this.loaderType_==="main"&&typeof e.timestampOffset=="number"&&!e.changedTimestampOffset&&(this.appendInitSegment_={audio:!0,video:!0}),this.playlistOfLastInitSegment_[i]!==e.playlist&&(this.appendInitSegment_[i]=!0)}getInitSegmentAndUpdateState_({type:e,initSegment:i,map:n,playlist:r}){if(n){const s=r0(n);if(this.activeInitSegmentId_===s)return null;i=this.initSegmentForMap(n,!0).bytes,this.activeInitSegmentId_=s}return i&&this.appendInitSegment_[e]?(this.playlistOfLastInitSegment_[e]=r,this.appendInitSegment_[e]=!1,this.activeInitSegmentId_=null,i):null}handleQuotaExceededError_({segmentInfo:e,type:i,bytes:n},r){const s=this.sourceUpdater_.audioBuffered(),o=this.sourceUpdater_.videoBuffered();s.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: "+Ec(s).join(", ")),o.length>1&&this.logger_("On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: "+Ec(o).join(", "));const u=s.length?s.start(0):0,h=s.length?s.end(s.length-1):0,p=o.length?o.start(0):0,g=o.length?o.end(o.length-1):0;if(h-u<=Kp&&g-p<=Kp){this.logger_(`On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ${n.byteLength}, audio buffer: ${Ec(s).join(", ")}, video buffer: ${Ec(o).join(", ")}, `),this.error({message:"Quota exceeded error with append of a single segment of content",excludeUntil:1/0}),this.trigger("error");return}this.waitingOnRemove_=!0,this.callQueue_.push(this.appendToSourceBuffer_.bind(this,{segmentInfo:e,type:i,bytes:n}));const S=this.currentTime_()-Kp;this.logger_(`On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ${S}`),this.remove(0,S,()=>{this.logger_(`On QUOTA_EXCEEDED_ERR, retrying append in ${Kp}s`),this.waitingOnRemove_=!1,this.quotaExceededErrorRetryTimeout_=_e.setTimeout(()=>{this.logger_("On QUOTA_EXCEEDED_ERR, re-processing call queue"),this.quotaExceededErrorRetryTimeout_=null,this.processCallQueue_()},Kp*1e3)},!0)}handleAppendError_({segmentInfo:e,type:i,bytes:n},r){if(r){if(r.code===Lk){this.handleQuotaExceededError_({segmentInfo:e,type:i,bytes:n});return}this.logger_("Received non QUOTA_EXCEEDED_ERR on append",r),this.error({message:`${i} append of ${n.length}b failed for segment #${e.mediaIndex} in playlist ${e.playlist.id}`,metadata:{errorType:Ve.Error.StreamingFailedToAppendSegment}}),this.trigger("appenderror")}}appendToSourceBuffer_({segmentInfo:e,type:i,initSegment:n,data:r,bytes:s}){if(!s){const u=[r];let h=r.byteLength;n&&(u.unshift(n),h+=n.byteLength),s=BG({bytes:h,segments:u})}const o={segmentInfo:Ac({type:this.loaderType_,segment:e})};this.trigger({type:"segmentappendstart",metadata:o}),this.sourceUpdater_.appendBuffer({segmentInfo:e,type:i,bytes:s},this.handleAppendError_.bind(this,{segmentInfo:e,type:i,bytes:s}))}handleSegmentTimingInfo_(e,i,n){if(!this.pendingSegment_||i!==this.pendingSegment_.requestId)return;const r=this.pendingSegment_.segment,s=`${e}TimingInfo`;r[s]||(r[s]={}),r[s].transmuxerPrependedSeconds=n.prependedContentDuration||0,r[s].transmuxedPresentationStart=n.start.presentation,r[s].transmuxedDecodeStart=n.start.decode,r[s].transmuxedPresentationEnd=n.end.presentation,r[s].transmuxedDecodeEnd=n.end.decode,r[s].baseMediaDecodeTime=n.baseMediaDecodeTime}appendData_(e,i){const{type:n,data:r}=i;if(!r||!r.byteLength||n==="audio"&&this.audioDisabled_)return;const s=this.getInitSegmentAndUpdateState_({type:n,initSegment:i.initSegment,playlist:e.playlist,map:e.isFmp4?e.segment.map:null});this.appendToSourceBuffer_({segmentInfo:e,type:n,initSegment:s,data:r})}loadSegment_(e){if(this.state="WAITING",this.pendingSegment_=e,this.trimBackBuffer_(e),typeof e.timestampOffset=="number"&&this.transmuxer_&&this.transmuxer_.postMessage({action:"clearAllMp4Captions"}),!this.hasEnoughInfoToLoad_()){bu(this),this.loadQueue_.push(()=>{const i=Wn({},e,{forceTimestampOffset:!0});Wn(e,this.generateSegmentInfo_(i)),this.isPendingTimestampOffset_=!1,this.updateTransmuxerAndRequestSegment_(e)});return}this.updateTransmuxerAndRequestSegment_(e)}updateTransmuxerAndRequestSegment_(e){this.shouldUpdateTransmuxerTimestampOffset_(e.timestampOffset)&&(this.gopBuffer_.length=0,e.gopsToAlignWith=[],this.timeMapping_=0,this.transmuxer_.postMessage({action:"reset"}),this.transmuxer_.postMessage({action:"setTimestampOffset",timestampOffset:e.timestampOffset}));const i=this.createSimplifiedSegmentObj_(e),n=this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex),r=this.mediaIndex!==null,s=e.timeline!==this.currentTimeline_&&e.timeline>0,o=n||r&&s;this.logger_(`Requesting ${fI(e.uri)} ${gh(e)}`),i.map&&!i.map.bytes&&(this.logger_("going to request init segment."),this.appendInitSegment_={video:!0,audio:!0}),e.abortRequests=OG({xhr:this.vhs_.xhr,xhrOptions:this.xhrOptions_,decryptionWorker:this.decrypter_,segment:i,abortFn:this.handleAbort_.bind(this,e),progressFn:this.handleProgress_.bind(this),trackInfoFn:this.handleTrackInfo_.bind(this),timingInfoFn:this.handleTimingInfo_.bind(this),videoSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"video",e.requestId),audioSegmentTimingInfoFn:this.handleSegmentTimingInfo_.bind(this,"audio",e.requestId),captionsFn:this.handleCaptions_.bind(this),isEndOfTimeline:o,endedTimelineFn:()=>{this.logger_("received endedtimeline callback")},id3Fn:this.handleId3_.bind(this),dataFn:this.handleData_.bind(this),doneFn:this.segmentRequestFinished_.bind(this),onTransmuxerLog:({message:u,level:h,stream:p})=>{this.logger_(`${gh(e)} logged from transmuxer stream ${p} as a ${h}: ${u}`)},triggerSegmentEventFn:({type:u,segment:h,keyInfo:p,trackInfo:g,timingInfo:y})=>{const P={segmentInfo:Ac({segment:h})};p&&(P.keyInfo=p),g&&(P.trackInfo=g),y&&(P.timingInfo=y),this.trigger({type:u,metadata:P})}})}trimBackBuffer_(e){const i=eK(this.seekable_(),this.currentTime_(),this.playlist_.targetDuration||10);i>0&&this.remove(0,i)}createSimplifiedSegmentObj_(e){const i=e.segment,n=e.part,r=e.segment.key||e.segment.map&&e.segment.map.key,s=e.segment.map&&!e.segment.map.bytes,o={resolvedUri:n?n.resolvedUri:i.resolvedUri,byterange:n?n.byterange:i.byterange,requestId:e.requestId,transmuxer:e.transmuxer,audioAppendStart:e.audioAppendStart,gopsToAlignWith:e.gopsToAlignWith,part:e.part,type:this.loaderType_,start:e.startOfSegment,duration:e.duration,isEncrypted:r,isMediaInitialization:s},u=e.playlist.segments[e.mediaIndex-1];if(u&&u.timeline===i.timeline&&(u.videoTimingInfo?o.baseStartTime=u.videoTimingInfo.transmuxedDecodeEnd:u.audioTimingInfo&&(o.baseStartTime=u.audioTimingInfo.transmuxedDecodeEnd)),i.key){const h=i.key.iv||new Uint32Array([0,0,0,e.mediaIndex+e.playlist.mediaSequence]);o.key=this.segmentKey(i.key),o.key.iv=h}return i.map&&(o.map=this.initSegmentForMap(i.map)),o}saveTransferStats_(e){this.mediaRequests+=1,e&&(this.mediaBytesTransferred+=e.bytesReceived,this.mediaTransferDuration+=e.roundTripTime)}saveBandwidthRelatedStats_(e,i){if(this.pendingSegment_.byteLength=i.bytesReceived,e"u"||p.end!==r+s?r:u.start}waitForAppendsToComplete_(e){const i=this.getCurrentMediaInfo_(e);if(!i){this.error({message:"No starting media returned, likely due to an unsupported media format.",playlistExclusionDuration:1/0}),this.trigger("error");return}const{hasAudio:n,hasVideo:r,isMuxed:s}=i,o=this.loaderType_==="main"&&r,u=!this.audioDisabled_&&n&&!s;if(e.waitingOnAppends=0,!e.hasAppendedData_){!e.timingInfo&&typeof e.timestampOffset=="number"&&(this.isPendingTimestampOffset_=!0),e.timingInfo={start:0},e.waitingOnAppends++,this.isPendingTimestampOffset_||(this.updateSourceBufferTimestampOffset_(e),this.processMetadataQueue_()),this.checkAppendsDone_(e);return}o&&e.waitingOnAppends++,u&&e.waitingOnAppends++,o&&this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this,e)),u&&this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this,e))}checkAppendsDone_(e){this.checkForAbort_(e.requestId)||(e.waitingOnAppends--,e.waitingOnAppends===0&&this.handleAppendsDone_())}checkForIllegalMediaSwitch(e){const i=$G(this.loaderType_,this.getCurrentMediaInfo_(),e);return i?(this.error({message:i,playlistExclusionDuration:1/0}),this.trigger("error"),!0):!1}updateSourceBufferTimestampOffset_(e){if(e.timestampOffset===null||typeof e.timingInfo.start!="number"||e.changedTimestampOffset||this.loaderType_!=="main")return;let i=!1;e.timestampOffset-=this.getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e.segment.videoTimingInfo,audioTimingInfo:e.segment.audioTimingInfo,timingInfo:e.timingInfo}),e.changedTimestampOffset=!0,e.timestampOffset!==this.sourceUpdater_.videoTimestampOffset()&&(this.sourceUpdater_.videoTimestampOffset(e.timestampOffset),i=!0),e.timestampOffset!==this.sourceUpdater_.audioTimestampOffset()&&(this.sourceUpdater_.audioTimestampOffset(e.timestampOffset),i=!0),i&&this.trigger("timestampoffset")}getSegmentStartTimeForTimestampOffsetCalculation_({videoTimingInfo:e,audioTimingInfo:i,timingInfo:n}){return this.useDtsForTimestampOffset_?e&&typeof e.transmuxedDecodeStart=="number"?e.transmuxedDecodeStart:i&&typeof i.transmuxedDecodeStart=="number"?i.transmuxedDecodeStart:n.start:n.start}updateTimingInfoEnd_(e){e.timingInfo=e.timingInfo||{};const i=this.getMediaInfo_(),r=this.loaderType_==="main"&&i&&i.hasVideo&&e.videoTimingInfo?e.videoTimingInfo:e.audioTimingInfo;r&&(e.timingInfo.end=typeof r.end=="number"?r.end:r.start+e.duration)}handleAppendsDone_(){if(this.pendingSegment_){const h={segmentInfo:Ac({type:this.loaderType_,segment:this.pendingSegment_})};this.trigger({type:"appendsdone",metadata:h})}if(!this.pendingSegment_){this.state="READY",this.paused()||this.monitorBuffer_();return}const e=this.pendingSegment_;e.part&&e.part.syncInfo?e.part.syncInfo.markAppended():e.segment.syncInfo&&e.segment.syncInfo.markAppended(),this.updateTimingInfoEnd_(e),this.shouldSaveSegmentTimingInfo_&&this.syncController_.saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:this.loaderType_==="main"});const i=sK(e,this.sourceType_);if(i&&(i.severity==="warn"?Ve.log.warn(i.message):this.logger_(i.message)),this.recordThroughput_(e),this.pendingSegment_=null,this.state="READY",e.isSyncRequest&&(this.trigger("syncinfoupdate"),!e.hasAppendedData_)){this.logger_(`Throwing away un-appended sync request ${gh(e)}`);return}this.logger_(`Appended ${gh(e)}`),this.addSegmentMetadataCue_(e),this.fetchAtBuffer_=!0,this.currentTimeline_!==e.timeline&&(this.timelineChangeController_.lastTimelineChange({type:this.loaderType_,from:this.currentTimeline_,to:e.timeline}),this.loaderType_==="main"&&!this.audioDisabled_&&this.timelineChangeController_.lastTimelineChange({type:"audio",from:this.currentTimeline_,to:e.timeline})),this.currentTimeline_=e.timeline,this.trigger("syncinfoupdate");const n=e.segment,r=e.part,s=n.end&&this.currentTime_()-n.end>e.playlist.targetDuration*3,o=r&&r.end&&this.currentTime_()-r.end>e.playlist.partTargetDuration*3;if(s||o){this.logger_(`bad ${s?"segment":"part"} ${gh(e)}`),this.resetEverything();return}this.mediaIndex!==null&&this.trigger("bandwidthupdate"),this.trigger("progress"),this.mediaIndex=e.mediaIndex,this.partIndex=e.partIndex,this.isEndOfStream_(e.mediaIndex,e.playlist,e.partIndex)&&this.endOfStream(),this.trigger("appended"),e.hasAppendedData_&&this.mediaAppends++,this.paused()||this.monitorBuffer_()}recordThroughput_(e){if(e.duratione.toUpperCase())},oK=["video","audio"],iT=(t,e)=>{const i=e[`${t}Buffer`];return i&&i.updating||e.queuePending[t]},aK=(t,e)=>{for(let i=0;i{if(e.queue.length===0)return;let i=0,n=e.queue[i];if(n.type==="mediaSource"){!e.updating()&&e.mediaSource.readyState!=="closed"&&(e.queue.shift(),n.action(e),n.doneFn&&n.doneFn(),yh("audio",e),yh("video",e));return}if(t!=="mediaSource"&&!(!e.ready()||e.mediaSource.readyState==="closed"||iT(t,e))){if(n.type!==t){if(i=aK(t,e.queue),i===null)return;n=e.queue[i]}if(e.queue.splice(i,1),e.queuePending[t]=n,n.action(t,e),!n.doneFn){e.queuePending[t]=null,yh(t,e);return}}},bI=(t,e)=>{const i=e[`${t}Buffer`],n=vI(t);i&&(i.removeEventListener("updateend",e[`on${n}UpdateEnd_`]),i.removeEventListener("error",e[`on${n}Error_`]),e.codecs[t]=null,e[`${t}Buffer`]=null)},Da=(t,e)=>t&&e&&Array.prototype.indexOf.call(t.sourceBuffers,e)!==-1,eo={appendBuffer:(t,e,i)=>(n,r)=>{const s=r[`${n}Buffer`];if(Da(r.mediaSource,s)){r.logger_(`Appending segment ${e.mediaIndex}'s ${t.length} bytes to ${n}Buffer`);try{s.appendBuffer(t)}catch(o){r.logger_(`Error with code ${o.code} `+(o.code===Lk?"(QUOTA_EXCEEDED_ERR) ":"")+`when appending segment ${e.mediaIndex} to ${n}Buffer`),r.queuePending[n]=null,i(o)}}},remove:(t,e)=>(i,n)=>{const r=n[`${i}Buffer`];if(Da(n.mediaSource,r)){n.logger_(`Removing ${t} to ${e} from ${i}Buffer`);try{r.remove(t,e)}catch{n.logger_(`Remove ${t} to ${e} from ${i}Buffer failed`)}}},timestampOffset:t=>(e,i)=>{const n=i[`${e}Buffer`];Da(i.mediaSource,n)&&(i.logger_(`Setting ${e}timestampOffset to ${t}`),n.timestampOffset=t)},callback:t=>(e,i)=>{t()},endOfStream:t=>e=>{if(e.mediaSource.readyState==="open"){e.logger_(`Calling mediaSource endOfStream(${t||""})`);try{e.mediaSource.endOfStream(t)}catch(i){Ve.log.warn("Failed to call media source endOfStream",i)}}},duration:t=>e=>{e.logger_(`Setting mediaSource duration to ${t}`);try{e.mediaSource.duration=t}catch(i){Ve.log.warn("Failed to set media source duration",i)}},abort:()=>(t,e)=>{if(e.mediaSource.readyState!=="open")return;const i=e[`${t}Buffer`];if(Da(e.mediaSource,i)){e.logger_(`calling abort on ${t}Buffer`);try{i.abort()}catch(n){Ve.log.warn(`Failed to abort on ${t}Buffer`,n)}}},addSourceBuffer:(t,e)=>i=>{const n=vI(t),r=Rd(e);i.logger_(`Adding ${t}Buffer with codec ${e} to mediaSource`);const s=i.mediaSource.addSourceBuffer(r);s.addEventListener("updateend",i[`on${n}UpdateEnd_`]),s.addEventListener("error",i[`on${n}Error_`]),i.codecs[t]=e,i[`${t}Buffer`]=s},removeSourceBuffer:t=>e=>{const i=e[`${t}Buffer`];if(bI(t,e),!!Da(e.mediaSource,i)){e.logger_(`Removing ${t}Buffer with codec ${e.codecs[t]} from mediaSource`);try{e.mediaSource.removeSourceBuffer(i)}catch(n){Ve.log.warn(`Failed to removeSourceBuffer ${t}Buffer`,n)}}},changeType:t=>(e,i)=>{const n=i[`${e}Buffer`],r=Rd(t);if(!Da(i.mediaSource,n))return;const s=t.substring(0,t.indexOf(".")),o=i.codecs[e];if(o.substring(0,o.indexOf("."))===s)return;const h={codecsChangeInfo:{from:o,to:t}};i.trigger({type:"codecschange",metadata:h}),i.logger_(`changing ${e}Buffer codec from ${o} to ${t}`);try{n.changeType(r),i.codecs[e]=t}catch(p){h.errorType=Ve.Error.StreamingCodecsChangeError,h.error=p,p.metadata=h,i.error_=p,i.trigger("error"),Ve.log.warn(`Failed to changeType on ${e}Buffer`,p)}}},to=({type:t,sourceUpdater:e,action:i,doneFn:n,name:r})=>{e.queue.push({type:t,action:i,doneFn:n,name:r}),yh(t,e)},_I=(t,e)=>i=>{const n=e[`${t}Buffered`](),r=xq(n);if(e.logger_(`received "updateend" event for ${t} Source Buffer: `,r),e.queuePending[t]){const s=e.queuePending[t].doneFn;e.queuePending[t]=null,s&&s(e[`${t}Error_`])}yh(t,e)};class wI extends Ve.EventTarget{constructor(e){super(),this.mediaSource=e,this.sourceopenListener_=()=>yh("mediaSource",this),this.mediaSource.addEventListener("sourceopen",this.sourceopenListener_),this.logger_=So("SourceUpdater"),this.audioTimestampOffset_=0,this.videoTimestampOffset_=0,this.queue=[],this.queuePending={audio:null,video:null},this.delayedAudioAppendQueue_=[],this.videoAppendQueued_=!1,this.codecs={},this.onVideoUpdateEnd_=_I("video",this),this.onAudioUpdateEnd_=_I("audio",this),this.onVideoError_=i=>{this.videoError_=i},this.onAudioError_=i=>{this.audioError_=i},this.createdSourceBuffers_=!1,this.initializedEme_=!1,this.triggeredReady_=!1}initializedEme(){this.initializedEme_=!0,this.triggerReady()}hasCreatedSourceBuffers(){return this.createdSourceBuffers_}hasInitializedAnyEme(){return this.initializedEme_}ready(){return this.hasCreatedSourceBuffers()&&this.hasInitializedAnyEme()}createSourceBuffers(e){this.hasCreatedSourceBuffers()||(this.addOrChangeSourceBuffers(e),this.createdSourceBuffers_=!0,this.trigger("createdsourcebuffers"),this.triggerReady())}triggerReady(){this.ready()&&!this.triggeredReady_&&(this.triggeredReady_=!0,this.trigger("ready"))}addSourceBuffer(e,i){to({type:"mediaSource",sourceUpdater:this,action:eo.addSourceBuffer(e,i),name:"addSourceBuffer"})}abort(e){to({type:e,sourceUpdater:this,action:eo.abort(e),name:"abort"})}removeSourceBuffer(e){if(!this.canRemoveSourceBuffer()){Ve.log.error("removeSourceBuffer is not supported!");return}to({type:"mediaSource",sourceUpdater:this,action:eo.removeSourceBuffer(e),name:"removeSourceBuffer"})}canRemoveSourceBuffer(){return!Ve.browser.IS_FIREFOX&&_e.MediaSource&&_e.MediaSource.prototype&&typeof _e.MediaSource.prototype.removeSourceBuffer=="function"}static canChangeType(){return _e.SourceBuffer&&_e.SourceBuffer.prototype&&typeof _e.SourceBuffer.prototype.changeType=="function"}canChangeType(){return this.constructor.canChangeType()}changeType(e,i){if(!this.canChangeType()){Ve.log.error("changeType is not supported!");return}to({type:e,sourceUpdater:this,action:eo.changeType(i),name:"changeType"})}addOrChangeSourceBuffers(e){if(!e||typeof e!="object"||Object.keys(e).length===0)throw new Error("Cannot addOrChangeSourceBuffers to undefined codecs");Object.keys(e).forEach(i=>{const n=e[i];if(!this.hasCreatedSourceBuffers())return this.addSourceBuffer(i,n);this.canChangeType()&&this.changeType(i,n)})}appendBuffer(e,i){const{segmentInfo:n,type:r,bytes:s}=e;if(this.processedAppend_=!0,r==="audio"&&this.videoBuffer&&!this.videoAppendQueued_){this.delayedAudioAppendQueue_.push([e,i]),this.logger_(`delayed audio append of ${s.length} until video append`);return}const o=i;if(to({type:r,sourceUpdater:this,action:eo.appendBuffer(s,n||{mediaIndex:-1},o),doneFn:i,name:"appendBuffer"}),r==="video"){if(this.videoAppendQueued_=!0,!this.delayedAudioAppendQueue_.length)return;const u=this.delayedAudioAppendQueue_.slice();this.logger_(`queuing delayed audio ${u.length} appendBuffers`),this.delayedAudioAppendQueue_.length=0,u.forEach(h=>{this.appendBuffer.apply(this,h)})}}audioBuffered(){return Da(this.mediaSource,this.audioBuffer)&&this.audioBuffer.buffered?this.audioBuffer.buffered:xr()}videoBuffered(){return Da(this.mediaSource,this.videoBuffer)&&this.videoBuffer.buffered?this.videoBuffer.buffered:xr()}buffered(){const e=Da(this.mediaSource,this.videoBuffer)?this.videoBuffer:null,i=Da(this.mediaSource,this.audioBuffer)?this.audioBuffer:null;return i&&!e?this.audioBuffered():e&&!i?this.videoBuffered():Eq(this.audioBuffered(),this.videoBuffered())}setDuration(e,i=wl){to({type:"mediaSource",sourceUpdater:this,action:eo.duration(e),name:"duration",doneFn:i})}endOfStream(e=null,i=wl){typeof e!="string"&&(e=void 0),to({type:"mediaSource",sourceUpdater:this,action:eo.endOfStream(e),name:"endOfStream",doneFn:i})}removeAudio(e,i,n=wl){if(!this.audioBuffered().length||this.audioBuffered().end(0)===0){n();return}to({type:"audio",sourceUpdater:this,action:eo.remove(e,i),doneFn:n,name:"remove"})}removeVideo(e,i,n=wl){if(!this.videoBuffered().length||this.videoBuffered().end(0)===0){n();return}to({type:"video",sourceUpdater:this,action:eo.remove(e,i),doneFn:n,name:"remove"})}updating(){return!!(iT("audio",this)||iT("video",this))}audioTimestampOffset(e){return typeof e<"u"&&this.audioBuffer&&this.audioTimestampOffset_!==e&&(to({type:"audio",sourceUpdater:this,action:eo.timestampOffset(e),name:"timestampOffset"}),this.audioTimestampOffset_=e),this.audioTimestampOffset_}videoTimestampOffset(e){return typeof e<"u"&&this.videoBuffer&&this.videoTimestampOffset_!==e&&(to({type:"video",sourceUpdater:this,action:eo.timestampOffset(e),name:"timestampOffset"}),this.videoTimestampOffset_=e),this.videoTimestampOffset_}audioQueueCallback(e){this.audioBuffer&&to({type:"audio",sourceUpdater:this,action:eo.callback(e),name:"callback"})}videoQueueCallback(e){this.videoBuffer&&to({type:"video",sourceUpdater:this,action:eo.callback(e),name:"callback"})}dispose(){this.trigger("dispose"),oK.forEach(e=>{this.abort(e),this.canRemoveSourceBuffer()?this.removeSourceBuffer(e):this[`${e}QueueCallback`](()=>bI(e,this))}),this.videoAppendQueued_=!1,this.delayedAudioAppendQueue_.length=0,this.sourceopenListener_&&this.mediaSource.removeEventListener("sourceopen",this.sourceopenListener_),this.off()}}const TI=t=>decodeURIComponent(escape(String.fromCharCode.apply(null,t))),lK=t=>{const e=new Uint8Array(t);return Array.from(e).map(i=>i.toString(16).padStart(2,"0")).join("")},xI=new Uint8Array(` `.split("").map(t=>t.charCodeAt(0)));class uK extends Error{constructor(){super("Trying to parse received VTT cues, but there is no WebVTT. Make sure vtt.js is loaded.")}}class cK extends tT{constructor(e,i={}){super(e,i),this.mediaSource_=null,this.subtitlesTrack_=null,this.featuresNativeTextTracks_=e.featuresNativeTextTracks,this.loadVttJs=e.loadVttJs,this.shouldSaveSegmentTimingInfo_=!1}buffered_(){if(!this.subtitlesTrack_||!this.subtitlesTrack_.cues||!this.subtitlesTrack_.cues.length)return xr();const e=this.subtitlesTrack_.cues,i=e[0].startTime,n=e[e.length-1].startTime;return xr([[i,n]])}initSegmentForMap(e,i=!1){if(!e)return null;const n=r0(e);let r=this.initSegments_[n];if(i&&!r&&e.bytes){const s=xI.byteLength+e.bytes.byteLength,o=new Uint8Array(s);o.set(e.bytes),o.set(xI,e.bytes.byteLength),this.initSegments_[n]=r={resolvedUri:e.resolvedUri,byterange:e.byterange,bytes:o}}return r||e}couldBeginLoading_(){return this.playlist_&&this.subtitlesTrack_&&!this.paused()}init_(){return this.state="READY",this.resetEverything(),this.monitorBuffer_()}track(e){return typeof e>"u"?this.subtitlesTrack_:(this.subtitlesTrack_=e,this.state==="INIT"&&this.couldBeginLoading_()&&this.init_(),this.subtitlesTrack_)}remove(e,i){Gp(e,i,this.subtitlesTrack_)}fillBuffer_(){const e=this.chooseNextRequest_();if(e){if(this.syncController_.timestampOffsetForTimeline(e.timeline)===null){const i=()=>{this.state="READY",this.paused()||this.monitorBuffer_()};this.syncController_.one("timestampoffset",i),this.state="WAITING_ON_TIMELINE";return}this.loadSegment_(e)}}timestampOffsetForSegment_(){return null}chooseNextRequest_(){return this.skipEmptySegments_(super.chooseNextRequest_())}skipEmptySegments_(e){for(;e&&e.segment.empty;){if(e.mediaIndex+1>=e.playlist.segments.length){e=null;break}e=this.generateSegmentInfo_({playlist:e.playlist,mediaIndex:e.mediaIndex+1,startOfSegment:e.startOfSegment+e.duration,isSyncRequest:e.isSyncRequest})}return e}stopForError(e){this.error(e),this.state="READY",this.pause(),this.trigger("error")}segmentRequestFinished_(e,i,n){if(!this.subtitlesTrack_){this.state="READY";return}if(this.saveTransferStats_(i.stats),!this.pendingSegment_){this.state="READY",this.mediaRequestsAborted+=1;return}if(e){e.code===Aa.TIMEOUT&&this.handleTimeout_(),e.code===Aa.ABORTED?this.mediaRequestsAborted+=1:this.mediaRequestsErrored+=1,this.stopForError(e);return}const r=this.pendingSegment_,s=n.mp4VttCues&&n.mp4VttCues.length;s&&(r.mp4VttCues=n.mp4VttCues),this.saveBandwidthRelatedStats_(r.duration,i.stats),i.key&&this.segmentKey(i.key,!0),this.state="APPENDING",this.trigger("appending");const o=r.segment;if(o.map&&(o.map.bytes=i.map.bytes),r.bytes=i.bytes,typeof _e.WebVTT!="function"&&typeof this.loadVttJs=="function"){this.state="WAITING_ON_VTTJS",this.loadVttJs().then(()=>this.segmentRequestFinished_(e,i,n),()=>this.stopForError({message:"Error loading vtt.js"}));return}o.requested=!0;try{this.parseVTTCues_(r)}catch(u){this.stopForError({message:u.message,metadata:{errorType:Ve.Error.StreamingVttParserError,error:u}});return}if(s||this.updateTimeMapping_(r,this.syncController_.timelines[r.timeline],this.playlist_),r.cues.length?r.timingInfo={start:r.cues[0].startTime,end:r.cues[r.cues.length-1].endTime}:r.timingInfo={start:r.startOfSegment,end:r.startOfSegment+r.duration},r.isSyncRequest){this.trigger("syncinfoupdate"),this.pendingSegment_=null,this.state="READY";return}r.byteLength=r.bytes.byteLength,this.mediaSecondsLoaded+=o.duration,r.cues.forEach(u=>{this.subtitlesTrack_.addCue(this.featuresNativeTextTracks_?new _e.VTTCue(u.startTime,u.endTime,u.text):u)}),GG(this.subtitlesTrack_),this.handleAppendsDone_()}handleData_(e,i){const n=e&&e.type==="vtt",r=i&&i.type==="text";n&&r&&super.handleData_(e,i)}updateTimingInfoEnd_(){}parseMp4VttCues_(e){const i=this.sourceUpdater_.videoTimestampOffset()===null?this.sourceUpdater_.audioTimestampOffset():this.sourceUpdater_.videoTimestampOffset();e.mp4VttCues.forEach(n=>{const r=n.start+i,s=n.end+i,o=new _e.VTTCue(r,s,n.cueText);n.settings&&n.settings.split(" ").forEach(u=>{const h=u.split(":"),p=h[0],g=h[1];o[p]=isNaN(g)?g:Number(g)}),e.cues.push(o)})}parseVTTCues_(e){let i,n=!1;if(typeof _e.WebVTT!="function")throw new uK;if(e.cues=[],e.timestampmap={MPEGTS:0,LOCAL:0},e.mp4VttCues){this.parseMp4VttCues_(e);return}typeof _e.TextDecoder=="function"?i=new _e.TextDecoder("utf8"):(i=_e.WebVTT.StringDecoder(),n=!0);const r=new _e.WebVTT.Parser(_e,_e.vttjs,i);if(r.oncue=e.cues.push.bind(e.cues),r.ontimestampmap=o=>{e.timestampmap=o},r.onparsingerror=o=>{Ve.log.warn("Error encountered when parsing cues: "+o.message)},e.segment.map){let o=e.segment.map.bytes;n&&(o=TI(o)),r.parse(o)}let s=e.bytes;n&&(s=TI(s)),r.parse(s),r.flush()}updateTimeMapping_(e,i,n){const r=e.segment;if(!i)return;if(!e.cues.length){r.empty=!0;return}const{MPEGTS:s,LOCAL:o}=e.timestampmap,h=s/vc.ONE_SECOND_IN_TS-o+i.mapping;if(e.cues.forEach(p=>{const g=p.endTime-p.startTime,y=this.handleRollover_(p.startTime+h,i.time);p.startTime=Math.max(y,0),p.endTime=Math.max(y+g,0)}),!n.syncInfo){const p=e.cues[0].startTime,g=e.cues[e.cues.length-1].startTime;n.syncInfo={mediaSequence:n.mediaSequence+e.mediaIndex,time:Math.min(p,g-r.duration)}}}handleRollover_(e,i){if(i===null)return e;let n=e*vc.ONE_SECOND_IN_TS;const r=i*vc.ONE_SECOND_IN_TS;let s;for(r4294967296;)n+=s;return n/vc.ONE_SECOND_IN_TS}}const dK=function(t,e){const i=t.cues;for(let n=0;n=r.adStartTime&&e<=r.adEndTime)return r}return null},hK=function(t,e,i=0){if(!t.segments)return;let n=i,r;for(let s=0;s=this.start&&e0}resetAppendStatus(){this.segmentSyncInfo_.resetAppendedStatus(),this.partsSyncInfo_.forEach(e=>e.resetAppendedStatus())}}class EI{constructor(){this.storage_=new Map,this.diagnostics_="",this.isReliable_=!1,this.start_=-1/0,this.end_=1/0}get start(){return this.start_}get end(){return this.end_}get diagnostics(){return this.diagnostics_}get isReliable(){return this.isReliable_}resetAppendedStatus(){this.storage_.forEach(e=>e.resetAppendStatus())}update(e,i){const{mediaSequence:n,segments:r}=e;if(this.isReliable_=this.isReliablePlaylist_(n,r),!!this.isReliable_)return this.updateStorage_(r,n,this.calculateBaseTime_(n,r,i))}getSyncInfoForTime(e){for(const{segmentSyncInfo:i,partsSyncInfo:n}of this.storage_.values())if(n.length){for(const r of n)if(r.isInRange(e))return r}else if(i.isInRange(e))return i;return null}getSyncInfoForMediaSequence(e){return this.storage_.get(e)}updateStorage_(e,i,n){const r=new Map;let s=` `,o=n,u=i;this.start_=o,e.forEach((h,p)=>{const g=this.storage_.get(u),y=o,S=y+h.duration,P=!!(g&&g.segmentSyncInfo&&g.segmentSyncInfo.isAppended),R=new SI({start:y,end:S,appended:P,segmentIndex:p});h.syncInfo=R;let k=o;const M=(h.parts||[]).map((L,q)=>{const Z=k,J=k+L.duration,ae=!!(g&&g.partsSyncInfo&&g.partsSyncInfo[q]&&g.partsSyncInfo[q].isAppended),ye=new SI({start:Z,end:J,appended:ae,segmentIndex:p,partIndex:q});return k=J,s+=`Media Sequence: ${u}.${q} | Range: ${Z} --> ${J} | Appended: ${ae} `,L.syncInfo=ye,ye});r.set(u,new fK(R,M)),s+=`${fI(h.resolvedUri)} | Media Sequence: ${u} | Range: ${y} --> ${S} | Appended: ${P} `,u++,o=S}),this.end_=o,this.storage_=r,this.diagnostics_=s}calculateBaseTime_(e,i,n){if(!this.storage_.size)return 0;if(this.storage_.has(e))return this.storage_.get(e).segmentSyncInfo.start;const r=Math.min(...this.storage_.keys());if(ei!==1/0?{time:0,segmentIndex:0,partIndex:null}:null},{name:"MediaSequence",run:(t,e,i,n,r,s)=>{const o=t.getMediaSequenceSync(s);if(!o||!o.isReliable)return null;const u=o.getSyncInfoForTime(r);return u?{time:u.start,partIndex:u.partIndex,segmentIndex:u.segmentIndex}:null}},{name:"ProgramDateTime",run:(t,e,i,n,r)=>{if(!Object.keys(t.timelineToDatetimeMappings).length)return null;let s=null,o=null;const u=Uw(e);r=r||0;for(let h=0;h{let s=null,o=null;r=r||0;const u=Uw(e);for(let h=0;h=P)&&(o=P,s={time:S,segmentIndex:g.segmentIndex,partIndex:g.partIndex})}}return s}},{name:"Discontinuity",run:(t,e,i,n,r)=>{let s=null;if(r=r||0,e.discontinuityStarts&&e.discontinuityStarts.length){let o=null;for(let u=0;u=y)&&(o=y,s={time:g.time,segmentIndex:h,partIndex:null})}}}return s}},{name:"Playlist",run:(t,e,i,n,r)=>e.syncInfo?{time:e.syncInfo.time,segmentIndex:e.syncInfo.mediaSequence-e.mediaSequence,partIndex:null}:null}];class mK extends Ve.EventTarget{constructor(e={}){super(),this.timelines=[],this.discontinuities=[],this.timelineToDatetimeMappings={};const i=new EI,n=new CI(i),r=new CI(i);this.mediaSequenceStorage_={main:i,audio:n,vtt:r},this.logger_=So("SyncController")}getMediaSequenceSync(e){return this.mediaSequenceStorage_[e]||null}getSyncPoint(e,i,n,r,s){if(i!==1/0)return nT.find(({name:h})=>h==="VOD").run(this,e,i);const o=this.runStrategies_(e,i,n,r,s);if(!o.length)return null;for(const u of o){const{syncPoint:h,strategy:p}=u,{segmentIndex:g,time:y}=h;if(g<0)continue;const S=e.segments[g],P=y,R=P+S.duration;if(this.logger_(`Strategy: ${p}. Current time: ${r}. selected segment: ${g}. Time: [${P} -> ${R}]}`),r>=P&&r0&&(r.time*=-1),Math.abs(r.time+Vp({defaultDuration:e.targetDuration,durationList:e.segments,startIndex:r.segmentIndex,endIndex:0}))}runStrategies_(e,i,n,r,s){const o=[];for(let u=0;upK){Ve.log.warn(`Not saving expired segment info. Media sequence gap ${n} is too large.`);return}for(let r=n-1;r>=0;r--){const s=e.segments[r];if(s&&typeof s.start<"u"){i.syncInfo={mediaSequence:e.mediaSequence+r,time:s.start},this.logger_(`playlist refresh sync: [time:${i.syncInfo.time}, mediaSequence: ${i.syncInfo.mediaSequence}]`),this.trigger("syncinfoupdate");break}}}setDateTimeMappingForStart(e){if(this.timelineToDatetimeMappings={},e.segments&&e.segments.length&&e.segments[0].dateTimeObject){const i=e.segments[0],n=i.dateTimeObject.getTime()/1e3;this.timelineToDatetimeMappings[i.timeline]=-n}}saveSegmentTimingInfo({segmentInfo:e,shouldSaveTimelineMapping:i}){const n=this.calculateSegmentTimeMapping_(e,e.timingInfo,i),r=e.segment;n&&(this.saveDiscontinuitySyncInfo_(e),e.playlist.syncInfo||(e.playlist.syncInfo={mediaSequence:e.playlist.mediaSequence+e.mediaIndex,time:r.start}));const s=r.dateTimeObject;r.discontinuity&&i&&s&&(this.timelineToDatetimeMappings[r.timeline]=-(s.getTime()/1e3))}timestampOffsetForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].time}mappingForTimeline(e){return typeof this.timelines[e]>"u"?null:this.timelines[e].mapping}calculateSegmentTimeMapping_(e,i,n){const r=e.segment,s=e.part;let o=this.timelines[e.timeline],u,h;if(typeof e.timestampOffset=="number")o={time:e.startOfSegment,mapping:e.startOfSegment-i.start},n&&(this.timelines[e.timeline]=o,this.trigger("timestampoffset"),this.logger_(`time mapping for timeline ${e.timeline}: [time: ${o.time}] [mapping: ${o.mapping}]`)),u=e.startOfSegment,h=i.end+o.mapping;else if(o)u=i.start+o.mapping,h=i.end+o.mapping;else return!1;return s&&(s.start=u,s.end=h),(!r.start||uh){let p;u<0?p=n.start-Vp({defaultDuration:i.targetDuration,durationList:i.segments,startIndex:e.mediaIndex,endIndex:s}):p=n.end+Vp({defaultDuration:i.targetDuration,durationList:i.segments,startIndex:e.mediaIndex+1,endIndex:s}),this.discontinuities[o]={time:p,accuracy:h}}}}dispose(){this.trigger("dispose"),this.off()}}class gK extends Ve.EventTarget{constructor(){super(),this.pendingTimelineChanges_={},this.lastTimelineChanges_={}}clearPendingTimelineChange(e){this.pendingTimelineChanges_[e]=null,this.trigger("pendingtimelinechange")}pendingTimelineChange({type:e,from:i,to:n}){return typeof i=="number"&&typeof n=="number"&&(this.pendingTimelineChanges_[e]={type:e,from:i,to:n},this.trigger("pendingtimelinechange")),this.pendingTimelineChanges_[e]}lastTimelineChange({type:e,from:i,to:n}){if(typeof i=="number"&&typeof n=="number"){this.lastTimelineChanges_[e]={type:e,from:i,to:n},delete this.pendingTimelineChanges_[e];const r={timelineChangeInfo:{from:i,to:n}};this.trigger({type:"timelinechange",metadata:r})}return this.lastTimelineChanges_[e]}dispose(){this.trigger("dispose"),this.pendingTimelineChanges_={},this.lastTimelineChanges_={},this.off()}}const yK=Jk($k(function(){var t=function(){function k(){this.listeners={}}var M=k.prototype;return M.on=function(q,Z){this.listeners[q]||(this.listeners[q]=[]),this.listeners[q].push(Z)},M.off=function(q,Z){if(!this.listeners[q])return!1;var J=this.listeners[q].indexOf(Z);return this.listeners[q]=this.listeners[q].slice(0),this.listeners[q].splice(J,1),J>-1},M.trigger=function(q){var Z=this.listeners[q];if(Z)if(arguments.length===2)for(var J=Z.length,ae=0;ae>7)*283)^J]=J;for(ae=ye=0;!q[ae];ae^=ze||1,ye=le[ye]||1)for(qe=ye^ye<<1^ye<<2^ye<<3^ye<<4,qe=qe>>8^qe&255^99,q[ae]=qe,Z[qe]=ae,ot=pe[tt=pe[ze=pe[ae]]],Pt=ot*16843009^tt*65537^ze*257^ae*16843008,at=pe[qe]*257^qe*16843008,J=0;J<4;J++)M[J][ae]=at=at<<24^at>>>8,L[J][qe]=Pt=Pt<<24^Pt>>>8;for(J=0;J<5;J++)M[J]=M[J].slice(0),L[J]=L[J].slice(0);return k};let n=null;class r{constructor(M){n||(n=i()),this._tables=[[n[0][0].slice(),n[0][1].slice(),n[0][2].slice(),n[0][3].slice(),n[0][4].slice()],[n[1][0].slice(),n[1][1].slice(),n[1][2].slice(),n[1][3].slice(),n[1][4].slice()]];let L,q,Z;const J=this._tables[0][4],ae=this._tables[1],ye=M.length;let pe=1;if(ye!==4&&ye!==6&&ye!==8)throw new Error("Invalid aes key size");const le=M.slice(0),ze=[];for(this._key=[le,ze],L=ye;L<4*ye+28;L++)Z=le[L-1],(L%ye===0||ye===8&&L%ye===4)&&(Z=J[Z>>>24]<<24^J[Z>>16&255]<<16^J[Z>>8&255]<<8^J[Z&255],L%ye===0&&(Z=Z<<8^Z>>>24^pe<<24,pe=pe<<1^(pe>>7)*283)),le[L]=le[L-ye]^Z;for(q=0;L;q++,L--)Z=le[q&3?L:L-4],L<=4||q<4?ze[q]=Z:ze[q]=ae[0][J[Z>>>24]]^ae[1][J[Z>>16&255]]^ae[2][J[Z>>8&255]]^ae[3][J[Z&255]]}decrypt(M,L,q,Z,J,ae){const ye=this._key[1];let pe=M^ye[0],le=Z^ye[1],ze=q^ye[2],tt=L^ye[3],ot,qe,at;const Pt=ye.length/4-2;let ci,Ct=4;const Nt=this._tables[1],Wt=Nt[0],wi=Nt[1],Et=Nt[2],ii=Nt[3],Ii=Nt[4];for(ci=0;ci>>24]^wi[le>>16&255]^Et[ze>>8&255]^ii[tt&255]^ye[Ct],qe=Wt[le>>>24]^wi[ze>>16&255]^Et[tt>>8&255]^ii[pe&255]^ye[Ct+1],at=Wt[ze>>>24]^wi[tt>>16&255]^Et[pe>>8&255]^ii[le&255]^ye[Ct+2],tt=Wt[tt>>>24]^wi[pe>>16&255]^Et[le>>8&255]^ii[ze&255]^ye[Ct+3],Ct+=4,pe=ot,le=qe,ze=at;for(ci=0;ci<4;ci++)J[(3&-ci)+ae]=Ii[pe>>>24]<<24^Ii[le>>16&255]<<16^Ii[ze>>8&255]<<8^Ii[tt&255]^ye[Ct++],ot=pe,pe=le,le=ze,ze=tt,tt=ot}}class s extends t{constructor(){super(t),this.jobs=[],this.delay=1,this.timeout_=null}processJob_(){this.jobs.shift()(),this.jobs.length?this.timeout_=setTimeout(this.processJob_.bind(this),this.delay):this.timeout_=null}push(M){this.jobs.push(M),this.timeout_||(this.timeout_=setTimeout(this.processJob_.bind(this),this.delay))}}const o=function(k){return k<<24|(k&65280)<<8|(k&16711680)>>8|k>>>24},u=function(k,M,L){const q=new Int32Array(k.buffer,k.byteOffset,k.byteLength>>2),Z=new r(Array.prototype.slice.call(M)),J=new Uint8Array(k.byteLength),ae=new Int32Array(J.buffer);let ye,pe,le,ze,tt,ot,qe,at,Pt;for(ye=L[0],pe=L[1],le=L[2],ze=L[3],Pt=0;Pt{const q=k[L];S(q)?M[L]={bytes:q.buffer,byteOffset:q.byteOffset,byteLength:q.byteLength}:M[L]=q}),M};self.onmessage=function(k){const M=k.data,L=new Uint8Array(M.encrypted.bytes,M.encrypted.byteOffset,M.encrypted.byteLength),q=new Uint32Array(M.key.bytes,M.key.byteOffset,M.key.byteLength/4),Z=new Uint32Array(M.iv.bytes,M.iv.byteOffset,M.iv.byteLength/4);new h(L,q,Z,function(J,ae){self.postMessage(R({source:M.source,decrypted:ae}),[ae.buffer])})}}));var vK=Qk(yK);const bK=t=>{let e=t.default?"main":"alternative";return t.characteristics&&t.characteristics.indexOf("public.accessibility.describes-video")>=0&&(e="main-desc"),e},AI=(t,e)=>{t.abort(),t.pause(),e&&e.activePlaylistLoader&&(e.activePlaylistLoader.pause(),e.activePlaylistLoader=null)},rT=(t,e)=>{e.activePlaylistLoader=t,t.load()},_K=(t,e)=>()=>{const{segmentLoaders:{[t]:i,main:n},mediaTypes:{[t]:r}}=e,s=r.activeTrack(),o=r.getActiveGroup(),u=r.activePlaylistLoader,h=r.lastGroup_;if(!(o&&h&&o.id===h.id)&&(r.lastGroup_=o,r.lastTrack_=s,AI(i,r),!(!o||o.isMainPlaylist))){if(!o.playlistLoader){u&&n.resetEverything();return}i.resyncLoader(),rT(o.playlistLoader,r)}},wK=(t,e)=>()=>{const{segmentLoaders:{[t]:i},mediaTypes:{[t]:n}}=e;n.lastGroup_=null,i.abort(),i.pause()},TK=(t,e)=>()=>{const{mainPlaylistLoader:i,segmentLoaders:{[t]:n,main:r},mediaTypes:{[t]:s}}=e,o=s.activeTrack(),u=s.getActiveGroup(),h=s.activePlaylistLoader,p=s.lastTrack_;if(!(p&&o&&p.id===o.id)&&(s.lastGroup_=u,s.lastTrack_=o,AI(n,s),!!u)){if(u.isMainPlaylist){if(!o||!p||o.id===p.id)return;const g=e.vhs.playlistController_,y=g.selectPlaylist();if(g.media()===y)return;s.logger_(`track change. Switching main audio from ${p.id} to ${o.id}`),i.pause(),r.resetEverything(),g.fastQualityChange_(y);return}if(t==="AUDIO"){if(!u.playlistLoader){r.setAudio(!0),r.resetEverything();return}n.setAudio(!0),r.setAudio(!1)}if(h===u.playlistLoader){rT(u.playlistLoader,s);return}n.track&&n.track(o),n.resetEverything(),rT(u.playlistLoader,s)}},a0={AUDIO:(t,e)=>()=>{const{mediaTypes:{[t]:i},excludePlaylist:n}=e,r=i.activeTrack(),s=i.activeGroup(),o=(s.filter(h=>h.default)[0]||s[0]).id,u=i.tracks[o];if(r===u){n({error:{message:"Problem encountered loading the default audio track."}});return}Ve.log.warn("Problem encountered loading the alternate audio track.Switching back to default.");for(const h in i.tracks)i.tracks[h].enabled=i.tracks[h]===u;i.onTrackChanged()},SUBTITLES:(t,e)=>()=>{const{mediaTypes:{[t]:i}}=e;Ve.log.warn("Problem encountered loading the subtitle track.Disabling subtitle track.");const n=i.activeTrack();n&&(n.mode="disabled"),i.onTrackChanged()}},DI={AUDIO:(t,e,i)=>{if(!e)return;const{tech:n,requestOptions:r,segmentLoaders:{[t]:s}}=i;e.on("loadedmetadata",()=>{const o=e.media();s.playlist(o,r),(!n.paused()||o.endList&&n.preload()!=="none")&&s.load()}),e.on("loadedplaylist",()=>{s.playlist(e.media(),r),n.paused()||s.load()}),e.on("error",a0[t](t,i))},SUBTITLES:(t,e,i)=>{const{tech:n,requestOptions:r,segmentLoaders:{[t]:s},mediaTypes:{[t]:o}}=i;e.on("loadedmetadata",()=>{const u=e.media();s.playlist(u,r),s.track(o.activeTrack()),(!n.paused()||u.endList&&n.preload()!=="none")&&s.load()}),e.on("loadedplaylist",()=>{s.playlist(e.media(),r),n.paused()||s.load()}),e.on("error",a0[t](t,i))}},xK={AUDIO:(t,e)=>{const{vhs:i,sourceType:n,segmentLoaders:{[t]:r},requestOptions:s,main:{mediaGroups:o},mediaTypes:{[t]:{groups:u,tracks:h,logger_:p}},mainPlaylistLoader:g}=e,y=jp(g.main);(!o[t]||Object.keys(o[t]).length===0)&&(o[t]={main:{default:{default:!0}}},y&&(o[t].main.default.playlists=g.main.playlists));for(const S in o[t]){u[S]||(u[S]=[]);for(const P in o[t][S]){let R=o[t][S][P],k;if(y?(p(`AUDIO group '${S}' label '${P}' is a main playlist`),R.isMainPlaylist=!0,k=null):n==="vhs-json"&&R.playlists?k=new hh(R.playlists[0],i,s):R.resolvedUri?k=new hh(R.resolvedUri,i,s):R.playlists&&n==="dash"?k=new Xw(R.playlists[0],i,s,g):k=null,R=Ji({id:P,playlistLoader:k},R),DI[t](t,R.playlistLoader,e),u[S].push(R),typeof h[P]>"u"){const M=new Ve.AudioTrack({id:P,kind:bK(R),enabled:!1,language:R.language,default:R.default,label:P});h[P]=M}}}r.on("error",a0[t](t,e))},SUBTITLES:(t,e)=>{const{tech:i,vhs:n,sourceType:r,segmentLoaders:{[t]:s},requestOptions:o,main:{mediaGroups:u},mediaTypes:{[t]:{groups:h,tracks:p}},mainPlaylistLoader:g}=e;for(const y in u[t]){h[y]||(h[y]=[]);for(const S in u[t][y]){if(!n.options_.useForcedSubtitles&&u[t][y][S].forced)continue;let P=u[t][y][S],R;if(r==="hls")R=new hh(P.resolvedUri,n,o);else if(r==="dash"){if(!P.playlists.filter(M=>M.excludeUntil!==1/0).length)return;R=new Xw(P.playlists[0],n,o,g)}else r==="vhs-json"&&(R=new hh(P.playlists?P.playlists[0]:P.resolvedUri,n,o));if(P=Ji({id:S,playlistLoader:R},P),DI[t](t,P.playlistLoader,e),h[y].push(P),typeof p[S]>"u"){const k=i.addRemoteTextTrack({id:S,kind:"subtitles",default:P.default&&P.autoselect,language:P.language,label:S},!1).track;p[S]=k}}}s.on("error",a0[t](t,e))},"CLOSED-CAPTIONS":(t,e)=>{const{tech:i,main:{mediaGroups:n},mediaTypes:{[t]:{groups:r,tracks:s}}}=e;for(const o in n[t]){r[o]||(r[o]=[]);for(const u in n[t][o]){const h=n[t][o][u];if(!/^(?:CC|SERVICE)/.test(h.instreamId))continue;const p=i.options_.vhs&&i.options_.vhs.captionServices||{};let g={label:u,language:h.language,instreamId:h.instreamId,default:h.default&&h.autoselect};if(p[g.instreamId]&&(g=Ji(g,p[g.instreamId])),g.default===void 0&&delete g.default,r[o].push(Ji({id:u},h)),typeof s[u]>"u"){const y=i.addRemoteTextTrack({id:g.instreamId,kind:"captions",default:g.default,language:g.language,label:g.label},!1).track;s[u]=y}}}}},PI=(t,e)=>{for(let i=0;ii=>{const{mainPlaylistLoader:n,mediaTypes:{[t]:{groups:r}}}=e,s=n.media();if(!s)return null;let o=null;s.attributes[t]&&(o=r[s.attributes[t]]);const u=Object.keys(r);if(!o)if(t==="AUDIO"&&u.length>1&&jp(e.main))for(let h=0;h"u"?o:i===null||!o?null:o.filter(h=>h.id===i.id)[0]||null},EK={AUDIO:(t,e)=>()=>{const{mediaTypes:{[t]:{tracks:i}}}=e;for(const n in i)if(i[n].enabled)return i[n];return null},SUBTITLES:(t,e)=>()=>{const{mediaTypes:{[t]:{tracks:i}}}=e;for(const n in i)if(i[n].mode==="showing"||i[n].mode==="hidden")return i[n];return null}},CK=(t,{mediaTypes:e})=>()=>{const i=e[t].activeTrack();return i?e[t].activeGroup(i):null},AK=t=>{["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(p=>{xK[p](p,t)});const{mediaTypes:e,mainPlaylistLoader:i,tech:n,vhs:r,segmentLoaders:{["AUDIO"]:s,main:o}}=t;["AUDIO","SUBTITLES"].forEach(p=>{e[p].activeGroup=SK(p,t),e[p].activeTrack=EK[p](p,t),e[p].onGroupChanged=_K(p,t),e[p].onGroupChanging=wK(p,t),e[p].onTrackChanged=TK(p,t),e[p].getActiveGroup=CK(p,t)});const u=e.AUDIO.activeGroup();if(u){const p=(u.filter(y=>y.default)[0]||u[0]).id;e.AUDIO.tracks[p].enabled=!0,e.AUDIO.onGroupChanged(),e.AUDIO.onTrackChanged(),e.AUDIO.getActiveGroup().playlistLoader?(o.setAudio(!1),s.setAudio(!0)):o.setAudio(!0)}i.on("mediachange",()=>{["AUDIO","SUBTITLES"].forEach(p=>e[p].onGroupChanged())}),i.on("mediachanging",()=>{["AUDIO","SUBTITLES"].forEach(p=>e[p].onGroupChanging())});const h=()=>{e.AUDIO.onTrackChanged(),n.trigger({type:"usage",name:"vhs-audio-change"})};n.audioTracks().addEventListener("change",h),n.remoteTextTracks().addEventListener("change",e.SUBTITLES.onTrackChanged),r.on("dispose",()=>{n.audioTracks().removeEventListener("change",h),n.remoteTextTracks().removeEventListener("change",e.SUBTITLES.onTrackChanged)}),n.clearTracks("audio");for(const p in e.AUDIO.tracks)n.audioTracks().addTrack(e.AUDIO.tracks[p])},DK=()=>{const t={};return["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{t[e]={groups:{},tracks:{},activePlaylistLoader:null,activeGroup:wl,activeTrack:wl,getActiveGroup:wl,onGroupChanged:wl,onTrackChanged:wl,lastTrack_:null,logger_:So(`MediaGroups[${e}]`)}}),t};class kI{constructor(){this.priority_=[],this.pathwayClones_=new Map}set version(e){e===1&&(this.version_=e)}set ttl(e){this.ttl_=e||300}set reloadUri(e){e&&(this.reloadUri_=Us(this.reloadUri_,e))}set priority(e){e&&e.length&&(this.priority_=e)}set pathwayClones(e){e&&e.length&&(this.pathwayClones_=new Map(e.map(i=>[i.ID,i])))}get version(){return this.version_}get ttl(){return this.ttl_}get reloadUri(){return this.reloadUri_}get priority(){return this.priority_}get pathwayClones(){return this.pathwayClones_}}class PK extends Ve.EventTarget{constructor(e,i){super(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=!1,this.availablePathways_=new Set,this.steeringManifest=new kI,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.currentPathwayClones=new Map,this.nextPathwayClones=new Map,this.excludedSteeringManifestURLs=new Set,this.logger_=So("Content Steering"),this.xhr_=e,this.getBandwidth_=i}assignTagProperties(e,i){this.manifestType_=i.serverUri?"HLS":"DASH";const n=i.serverUri||i.serverURL;if(!n){this.logger_(`steering manifest URL is ${n}, cannot request steering manifest.`),this.trigger("error");return}if(n.startsWith("data:")){this.decodeDataUriManifest_(n.substring(n.indexOf(",")+1));return}this.steeringManifest.reloadUri=Us(e,n),this.defaultPathway=i.pathwayId||i.defaultServiceLocation,this.queryBeforeStart=i.queryBeforeStart,this.proxyServerUrl_=i.proxyServerURL,this.defaultPathway&&!this.queryBeforeStart&&this.trigger("content-steering")}requestSteeringManifest(e){const i=this.steeringManifest.reloadUri;if(!i)return;const n=e?i:this.getRequestURI(i);if(!n){this.logger_("No valid content steering manifest URIs. Stopping content steering."),this.trigger("error"),this.dispose();return}const r={contentSteeringInfo:{uri:n}};this.trigger({type:"contentsteeringloadstart",metadata:r}),this.request_=this.xhr_({uri:n,requestType:"content-steering-manifest"},(s,o)=>{if(s){if(o.status===410){this.logger_(`manifest request 410 ${s}.`),this.logger_(`There will be no more content steering requests to ${n} this session.`),this.excludedSteeringManifestURLs.add(n);return}if(o.status===429){const p=o.responseHeaders["retry-after"];this.logger_(`manifest request 429 ${s}.`),this.logger_(`content steering will retry in ${p} seconds.`),this.startTTLTimeout_(parseInt(p,10));return}this.logger_(`manifest failed to load ${s}.`),this.startTTLTimeout_();return}this.trigger({type:"contentsteeringloadcomplete",metadata:r});let u;try{u=JSON.parse(this.request_.responseText)}catch(p){const g={errorType:Ve.Error.StreamingContentSteeringParserError,error:p};this.trigger({type:"error",metadata:g})}this.assignSteeringProperties_(u);const h={contentSteeringInfo:r.contentSteeringInfo,contentSteeringManifest:{version:this.steeringManifest.version,reloadUri:this.steeringManifest.reloadUri,priority:this.steeringManifest.priority}};this.trigger({type:"contentsteeringparsed",metadata:h}),this.startTTLTimeout_()})}setProxyServerUrl_(e){const i=new _e.URL(e),n=new _e.URL(this.proxyServerUrl_);return n.searchParams.set("url",encodeURI(i.toString())),this.setSteeringParams_(n.toString())}decodeDataUriManifest_(e){const i=JSON.parse(_e.atob(e));this.assignSteeringProperties_(i)}setSteeringParams_(e){const i=new _e.URL(e),n=this.getPathway(),r=this.getBandwidth_();if(n){const s=`_${this.manifestType_}_pathway`;i.searchParams.set(s,n)}if(r){const s=`_${this.manifestType_}_throughput`;i.searchParams.set(s,r)}return i.toString()}assignSteeringProperties_(e){if(this.steeringManifest.version=e.VERSION,!this.steeringManifest.version){this.logger_(`manifest version is ${e.VERSION}, which is not supported.`),this.trigger("error");return}this.steeringManifest.ttl=e.TTL,this.steeringManifest.reloadUri=e["RELOAD-URI"],this.steeringManifest.priority=e["PATHWAY-PRIORITY"]||e["SERVICE-LOCATION-PRIORITY"],this.steeringManifest.pathwayClones=e["PATHWAY-CLONES"],this.nextPathwayClones=this.steeringManifest.pathwayClones,this.availablePathways_.size||(this.logger_("There are no available pathways for content steering. Ending content steering."),this.trigger("error"),this.dispose());const n=(r=>{for(const s of r)if(this.availablePathways_.has(s))return s;return[...this.availablePathways_][0]})(this.steeringManifest.priority);this.currentPathway!==n&&(this.currentPathway=n,this.trigger("content-steering"))}getPathway(){return this.currentPathway||this.defaultPathway}getRequestURI(e){if(!e)return null;const i=r=>this.excludedSteeringManifestURLs.has(r);if(this.proxyServerUrl_){const r=this.setProxyServerUrl_(e);if(!i(r))return r}const n=this.setSteeringParams_(e);return i(n)?null:n}startTTLTimeout_(e=this.steeringManifest.ttl){const i=e*1e3;this.ttlTimeout_=_e.setTimeout(()=>{this.requestSteeringManifest()},i)}clearTTLTimeout_(){_e.clearTimeout(this.ttlTimeout_),this.ttlTimeout_=null}abort(){this.request_&&this.request_.abort(),this.request_=null}dispose(){this.off("content-steering"),this.off("error"),this.abort(),this.clearTTLTimeout_(),this.currentPathway=null,this.defaultPathway=null,this.queryBeforeStart=null,this.proxyServerUrl_=null,this.manifestType_=null,this.ttlTimeout_=null,this.request_=null,this.excludedSteeringManifestURLs=new Set,this.availablePathways_=new Set,this.steeringManifest=new kI}addAvailablePathway(e){e&&this.availablePathways_.add(e)}clearAvailablePathways(){this.availablePathways_.clear()}excludePathway(e){return this.availablePathways_.delete(e)}didDASHTagChange(e,i){return!i&&this.steeringManifest.reloadUri||i&&(Us(e,i.serverURL)!==this.steeringManifest.reloadUri||i.defaultServiceLocation!==this.defaultPathway||i.queryBeforeStart!==this.queryBeforeStart||i.proxyServerURL!==this.proxyServerUrl_)}getAvailablePathways(){return this.availablePathways_}}const kK=(t,e)=>{let i=null;return(...n)=>{clearTimeout(i),i=setTimeout(()=>{t.apply(null,n)},e)}},IK=10;let _u;const RK=["mediaRequests","mediaRequestsAborted","mediaRequestsTimedout","mediaRequestsErrored","mediaTransferDuration","mediaBytesTransferred","mediaAppends"],OK=function(t){return this.audioSegmentLoader_[t]+this.mainSegmentLoader_[t]},LK=function({currentPlaylist:t,buffered:e,currentTime:i,nextPlaylist:n,bufferLowWaterLine:r,bufferHighWaterLine:s,duration:o,bufferBasedABR:u,log:h}){if(!n)return Ve.log.warn("We received no playlist to switch to. Please check your stream."),!1;const p=`allowing switch ${t&&t.id||"null"} -> ${n.id}`;if(!t)return h(`${p} as current playlist is not set`),!0;if(n.id===t.id)return!1;const g=!!uh(e,i).length;if(!t.endList)return!g&&typeof t.partTargetDuration=="number"?(h(`not ${p} as current playlist is live llhls, but currentTime isn't in buffered.`),!1):(h(`${p} as current playlist is live`),!0);const y=Bw(e,i),S=u?Sr.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE:Sr.MAX_BUFFER_LOW_WATER_LINE;if(oR)&&y>=r){let k=`${p} as forwardBuffer >= bufferLowWaterLine (${y} >= ${r})`;return u&&(k+=` and next bandwidth > current bandwidth (${P} > ${R})`),h(k),!0}return h(`not ${p} as no switching criteria met`),!1};class MK extends Ve.EventTarget{constructor(e){super(),this.fastQualityChange_=kK(this.fastQualityChange_.bind(this),100);const{src:i,withCredentials:n,tech:r,bandwidth:s,externVhs:o,useCueTags:u,playlistExclusionDuration:h,enableLowInitialPlaylist:p,sourceType:g,cacheEncryptionKeys:y,bufferBasedABR:S,leastPixelDiffSelector:P,captionServices:R,experimentalUseMMS:k}=e;if(!i)throw new Error("A non-empty playlist URL or JSON manifest string is required");let{maxPlaylistRetries:M}=e;(M===null||typeof M>"u")&&(M=1/0),_u=o,this.bufferBasedABR=!!S,this.leastPixelDiffSelector=!!P,this.withCredentials=n,this.tech_=r,this.vhs_=r.vhs,this.player_=e.player_,this.sourceType_=g,this.useCueTags_=u,this.playlistExclusionDuration=h,this.maxPlaylistRetries=M,this.enableLowInitialPlaylist=p,this.usingManagedMediaSource_=!1,this.useCueTags_&&(this.cueTagsTrack_=this.tech_.addTextTrack("metadata","ad-cues"),this.cueTagsTrack_.inBandMetadataTrackDispatchType=""),this.requestOptions_={withCredentials:n,maxPlaylistRetries:M,timeout:null},this.on("error",this.pauseLoading),this.mediaTypes_=DK(),k&&_e.ManagedMediaSource?(this.tech_.el_.disableRemotePlayback=!0,this.mediaSource=new _e.ManagedMediaSource,this.usingManagedMediaSource_=!0,Ve.log("Using ManagedMediaSource")):_e.MediaSource&&(this.mediaSource=new _e.MediaSource),this.handleDurationChange_=this.handleDurationChange_.bind(this),this.handleSourceOpen_=this.handleSourceOpen_.bind(this),this.handleSourceEnded_=this.handleSourceEnded_.bind(this),this.load=this.load.bind(this),this.pause=this.pause.bind(this),this.mediaSource.addEventListener("durationchange",this.handleDurationChange_),this.mediaSource.addEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.addEventListener("sourceended",this.handleSourceEnded_),this.mediaSource.addEventListener("startstreaming",this.load),this.mediaSource.addEventListener("endstreaming",this.pause),this.seekable_=xr(),this.hasPlayed_=!1,this.syncController_=new mK(e),this.segmentMetadataTrack_=r.addRemoteTextTrack({kind:"metadata",label:"segment-metadata"},!1).track,this.segmentMetadataTrack_.mode="hidden",this.decrypter_=new vK,this.sourceUpdater_=new wI(this.mediaSource),this.inbandTextTracks_={},this.timelineChangeController_=new gK,this.keyStatusMap_=new Map;const L={vhs:this.vhs_,parse708captions:e.parse708captions,useDtsForTimestampOffset:e.useDtsForTimestampOffset,captionServices:R,mediaSource:this.mediaSource,currentTime:this.tech_.currentTime.bind(this.tech_),seekable:()=>this.seekable(),seeking:()=>this.tech_.seeking(),duration:()=>this.duration(),hasPlayed:()=>this.hasPlayed_,goalBufferLength:()=>this.goalBufferLength(),bandwidth:s,syncController:this.syncController_,decrypter:this.decrypter_,sourceType:this.sourceType_,inbandTextTracks:this.inbandTextTracks_,cacheEncryptionKeys:y,sourceUpdater:this.sourceUpdater_,timelineChangeController:this.timelineChangeController_,exactManifestTimings:e.exactManifestTimings,addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)};this.mainPlaylistLoader_=this.sourceType_==="dash"?new Xw(i,this.vhs_,Ji(this.requestOptions_,{addMetadataToTextTrack:this.addMetadataToTextTrack.bind(this)})):new hh(i,this.vhs_,Ji(this.requestOptions_,{addDateRangesToTextTrack:this.addDateRangesToTextTrack_.bind(this)})),this.setupMainPlaylistLoaderListeners_(),this.mainSegmentLoader_=new tT(Ji(L,{segmentMetadataTrack:this.segmentMetadataTrack_,loaderType:"main"}),e),this.audioSegmentLoader_=new tT(Ji(L,{loaderType:"audio"}),e),this.subtitleSegmentLoader_=new cK(Ji(L,{loaderType:"vtt",featuresNativeTextTracks:this.tech_.featuresNativeTextTracks,loadVttJs:()=>new Promise((J,ae)=>{function ye(){r.off("vttjserror",pe),J()}function pe(){r.off("vttjsloaded",ye),ae()}r.one("vttjsloaded",ye),r.one("vttjserror",pe),r.addWebVttScript_()})}),e);const q=()=>this.mainSegmentLoader_.bandwidth;this.contentSteeringController_=new PK(this.vhs_.xhr,q),this.setupSegmentLoaderListeners_(),this.bufferBasedABR&&(this.mainPlaylistLoader_.one("loadedplaylist",()=>this.startABRTimer_()),this.tech_.on("pause",()=>this.stopABRTimer_()),this.tech_.on("play",()=>this.startABRTimer_())),RK.forEach(J=>{this[J+"_"]=OK.bind(this,J)}),this.logger_=So("pc"),this.triggeredFmp4Usage=!1,this.tech_.preload()==="none"?(this.loadOnPlay_=()=>{this.loadOnPlay_=null,this.mainPlaylistLoader_.load()},this.tech_.one("play",this.loadOnPlay_)):this.mainPlaylistLoader_.load(),this.timeToLoadedData__=-1,this.mainAppendsToLoadedData__=-1,this.audioAppendsToLoadedData__=-1;const Z=this.tech_.preload()==="none"?"play":"loadstart";this.tech_.one(Z,()=>{const J=Date.now();this.tech_.one("loadeddata",()=>{this.timeToLoadedData__=Date.now()-J,this.mainAppendsToLoadedData__=this.mainSegmentLoader_.mediaAppends,this.audioAppendsToLoadedData__=this.audioSegmentLoader_.mediaAppends})})}mainAppendsToLoadedData_(){return this.mainAppendsToLoadedData__}audioAppendsToLoadedData_(){return this.audioAppendsToLoadedData__}appendsToLoadedData_(){const e=this.mainAppendsToLoadedData_(),i=this.audioAppendsToLoadedData_();return e===-1||i===-1?-1:e+i}timeToLoadedData_(){return this.timeToLoadedData__}checkABR_(e="abr"){const i=this.selectPlaylist();i&&this.shouldSwitchToMedia_(i)&&this.switchMedia_(i,e)}switchMedia_(e,i,n){const r=this.media(),s=r&&(r.id||r.uri),o=e&&(e.id||e.uri);if(s&&s!==o){this.logger_(`switch media ${s} -> ${o} from ${i}`);const u={renditionInfo:{id:o,bandwidth:e.attributes.BANDWIDTH,resolution:e.attributes.RESOLUTION,codecs:e.attributes.CODECS},cause:i};this.trigger({type:"renditionselected",metadata:u}),this.tech_.trigger({type:"usage",name:`vhs-rendition-change-${i}`})}this.mainPlaylistLoader_.media(e,n)}switchMediaForDASHContentSteering_(){["AUDIO","SUBTITLES","CLOSED-CAPTIONS"].forEach(e=>{const i=this.mediaTypes_[e],n=i?i.activeGroup():null,r=this.contentSteeringController_.getPathway();if(n&&r){const o=(n.length?n[0].playlists:n.playlists).filter(u=>u.attributes.serviceLocation===r);o.length&&this.mediaTypes_[e].activePlaylistLoader.media(o[0])}})}startABRTimer_(){this.stopABRTimer_(),this.abrTimer_=_e.setInterval(()=>this.checkABR_(),250)}stopABRTimer_(){this.tech_.scrubbing&&this.tech_.scrubbing()||(_e.clearInterval(this.abrTimer_),this.abrTimer_=null)}getAudioTrackPlaylists_(){const e=this.main(),i=e&&e.playlists||[];if(!e||!e.mediaGroups||!e.mediaGroups.AUDIO)return i;const n=e.mediaGroups.AUDIO,r=Object.keys(n);let s;if(Object.keys(this.mediaTypes_.AUDIO.groups).length)s=this.mediaTypes_.AUDIO.activeTrack();else{const u=n.main||r.length&&n[r[0]];for(const h in u)if(u[h].default){s={label:h};break}}if(!s)return i;const o=[];for(const u in n)if(n[u][s.label]){const h=n[u][s.label];if(h.playlists&&h.playlists.length)o.push.apply(o,h.playlists);else if(h.uri)o.push(h);else if(e.playlists.length)for(let p=0;p{const i=this.mainPlaylistLoader_.media(),n=i.targetDuration*1.5*1e3;Vw(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=n,i.endList&&this.tech_.preload()!=="none"&&(this.mainSegmentLoader_.playlist(i,this.requestOptions_),this.mainSegmentLoader_.load()),AK({sourceType:this.sourceType_,segmentLoaders:{AUDIO:this.audioSegmentLoader_,SUBTITLES:this.subtitleSegmentLoader_,main:this.mainSegmentLoader_},tech:this.tech_,requestOptions:this.requestOptions_,mainPlaylistLoader:this.mainPlaylistLoader_,vhs:this.vhs_,main:this.main(),mediaTypes:this.mediaTypes_,excludePlaylist:this.excludePlaylist.bind(this)}),this.triggerPresenceUsage_(this.main(),i),this.setupFirstPlay(),!this.mediaTypes_.AUDIO.activePlaylistLoader||this.mediaTypes_.AUDIO.activePlaylistLoader.media()?this.trigger("selectedinitialmedia"):this.mediaTypes_.AUDIO.activePlaylistLoader.one("loadedmetadata",()=>{this.trigger("selectedinitialmedia")})}),this.mainPlaylistLoader_.on("loadedplaylist",()=>{this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_);let i=this.mainPlaylistLoader_.media();if(!i){this.attachContentSteeringListeners_(),this.initContentSteeringController_(),this.excludeUnsupportedVariants_();let n;if(this.enableLowInitialPlaylist&&(n=this.selectInitialPlaylist()),n||(n=this.selectPlaylist()),!n||!this.shouldSwitchToMedia_(n)||(this.initialMedia_=n,this.switchMedia_(this.initialMedia_,"initial"),!(this.sourceType_==="vhs-json"&&this.initialMedia_.segments)))return;i=this.initialMedia_}this.handleUpdatedMediaPlaylist(i)}),this.mainPlaylistLoader_.on("error",()=>{const i=this.mainPlaylistLoader_.error;this.excludePlaylist({playlistToExclude:i.playlist,error:i})}),this.mainPlaylistLoader_.on("mediachanging",()=>{this.mainSegmentLoader_.abort(),this.mainSegmentLoader_.pause()}),this.mainPlaylistLoader_.on("mediachange",()=>{const i=this.mainPlaylistLoader_.media(),n=i.targetDuration*1.5*1e3;Vw(this.mainPlaylistLoader_.main,this.mainPlaylistLoader_.media())?this.requestOptions_.timeout=0:this.requestOptions_.timeout=n,this.sourceType_==="dash"&&this.mainPlaylistLoader_.isPaused&&this.mainPlaylistLoader_.load(),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(i,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_?this.runFastQualitySwitch_():this.mainSegmentLoader_.load(),this.tech_.trigger({type:"mediachange",bubbles:!0})}),this.mainPlaylistLoader_.on("playlistunchanged",()=>{const i=this.mainPlaylistLoader_.media();if(i.lastExcludeReason_==="playlist-unchanged")return;this.stuckAtPlaylistEnd_(i)&&(this.excludePlaylist({error:{message:"Playlist no longer updating.",reason:"playlist-unchanged"}}),this.tech_.trigger("playliststuck"))}),this.mainPlaylistLoader_.on("renditiondisabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-disabled"})}),this.mainPlaylistLoader_.on("renditionenabled",()=>{this.tech_.trigger({type:"usage",name:"vhs-rendition-enabled"})}),["manifestrequeststart","manifestrequestcomplete","manifestparsestart","manifestparsecomplete","playlistrequeststart","playlistrequestcomplete","playlistparsestart","playlistparsecomplete","renditiondisabled","renditionenabled"].forEach(i=>{this.mainPlaylistLoader_.on(i,n=>{this.player_.trigger(Wn({},n))})})}handleUpdatedMediaPlaylist(e){this.useCueTags_&&this.updateAdCues_(e),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.playlist(e,this.requestOptions_),this.waitingForFastQualityPlaylistReceived_&&this.runFastQualitySwitch_(),this.updateDuration(!e.endList),this.tech_.paused()||(this.mainSegmentLoader_.load(),this.audioSegmentLoader_&&this.audioSegmentLoader_.load())}triggerPresenceUsage_(e,i){const n=e.mediaGroups||{};let r=!0;const s=Object.keys(n.AUDIO);for(const o in n.AUDIO)for(const u in n.AUDIO[o])n.AUDIO[o][u].uri||(r=!1);r&&this.tech_.trigger({type:"usage",name:"vhs-demuxed"}),Object.keys(n.SUBTITLES).length&&this.tech_.trigger({type:"usage",name:"vhs-webvtt"}),_u.Playlist.isAes(i)&&this.tech_.trigger({type:"usage",name:"vhs-aes"}),s.length&&Object.keys(n.AUDIO[s[0]]).length>1&&this.tech_.trigger({type:"usage",name:"vhs-alternate-audio"}),this.useCueTags_&&this.tech_.trigger({type:"usage",name:"vhs-playlist-cue-tags"})}shouldSwitchToMedia_(e){const i=this.mainPlaylistLoader_.media()||this.mainPlaylistLoader_.pendingMedia_,n=this.tech_.currentTime(),r=this.bufferLowWaterLine(),s=this.bufferHighWaterLine(),o=this.tech_.buffered();return LK({buffered:o,currentTime:n,currentPlaylist:i,nextPlaylist:e,bufferLowWaterLine:r,bufferHighWaterLine:s,duration:this.duration(),bufferBasedABR:this.bufferBasedABR,log:this.logger_})}setupSegmentLoaderListeners_(){this.mainSegmentLoader_.on("bandwidthupdate",()=>{this.checkABR_("bandwidthupdate"),this.tech_.trigger("bandwidthupdate")}),this.mainSegmentLoader_.on("timeout",()=>{this.bufferBasedABR&&this.mainSegmentLoader_.load()}),this.bufferBasedABR||this.mainSegmentLoader_.on("progress",()=>{this.trigger("progress")}),this.mainSegmentLoader_.on("error",()=>{const n=this.mainSegmentLoader_.error();this.excludePlaylist({playlistToExclude:n.playlist,error:n})}),this.mainSegmentLoader_.on("appenderror",()=>{this.error=this.mainSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.mainSegmentLoader_.on("timestampoffset",()=>{this.tech_.trigger({type:"usage",name:"vhs-timestamp-offset"})}),this.audioSegmentLoader_.on("syncinfoupdate",()=>{this.onSyncInfoUpdate_()}),this.audioSegmentLoader_.on("appenderror",()=>{this.error=this.audioSegmentLoader_.error_,this.trigger("error")}),this.mainSegmentLoader_.on("ended",()=>{this.logger_("main segment loader ended"),this.onEndOfStream()}),this.timelineChangeController_.on("audioTimelineBehind",()=>{const n=this.audioSegmentLoader_.pendingSegment_;if(!n||!n.segment||!n.segment.syncInfo)return;const r=n.segment.syncInfo.end+.01;this.tech_.setCurrentTime(r)}),this.timelineChangeController_.on("fixBadTimelineChange",()=>{this.logger_("Fix bad timeline change. Restarting al segment loaders..."),this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}),this.mainSegmentLoader_.on("earlyabort",n=>{this.bufferBasedABR||(this.delegateLoaders_("all",["abort"]),this.excludePlaylist({error:{message:"Aborted early because there isn't enough bandwidth to complete the request without rebuffering."},playlistExclusionDuration:IK}))});const e=()=>{if(!this.sourceUpdater_.hasCreatedSourceBuffers())return this.tryToCreateSourceBuffers_();const n=this.getCodecsOrExclude_();n&&this.sourceUpdater_.addOrChangeSourceBuffers(n)};this.mainSegmentLoader_.on("trackinfo",e),this.audioSegmentLoader_.on("trackinfo",e),this.mainSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("fmp4",()=>{this.triggeredFmp4Usage||(this.tech_.trigger({type:"usage",name:"vhs-fmp4"}),this.triggeredFmp4Usage=!0)}),this.audioSegmentLoader_.on("ended",()=>{this.logger_("audioSegmentLoader ended"),this.onEndOfStream()}),["segmentselected","segmentloadstart","segmentloaded","segmentkeyloadstart","segmentkeyloadcomplete","segmentdecryptionstart","segmentdecryptioncomplete","segmenttransmuxingstart","segmenttransmuxingcomplete","segmenttransmuxingtrackinfoavailable","segmenttransmuxingtiminginfoavailable","segmentappendstart","appendsdone","bandwidthupdated","timelinechange","codecschange"].forEach(n=>{this.mainSegmentLoader_.on(n,r=>{this.player_.trigger(Wn({},r))}),this.audioSegmentLoader_.on(n,r=>{this.player_.trigger(Wn({},r))}),this.subtitleSegmentLoader_.on(n,r=>{this.player_.trigger(Wn({},r))})})}mediaSecondsLoaded_(){return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded+this.mainSegmentLoader_.mediaSecondsLoaded)}load(){this.mainSegmentLoader_.load(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.load(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.load()}pause(){this.mainSegmentLoader_.pause(),this.mediaTypes_.AUDIO.activePlaylistLoader&&this.audioSegmentLoader_.pause(),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&this.subtitleSegmentLoader_.pause()}fastQualityChange_(e=this.selectPlaylist()){if(e&&e===this.mainPlaylistLoader_.media()){this.logger_("skipping fastQualityChange because new media is same as old");return}this.switchMedia_(e,"fast-quality"),this.waitingForFastQualityPlaylistReceived_=!0}runFastQualitySwitch_(){this.waitingForFastQualityPlaylistReceived_=!1,this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}play(){if(this.setupFirstPlay())return;this.tech_.ended()&&this.tech_.setCurrentTime(0),this.hasPlayed_&&this.load();const e=this.tech_.seekable();if(this.tech_.duration()===1/0&&this.tech_.currentTime(){})}this.trigger("sourceopen")}handleSourceEnded_(){if(!this.inbandTextTracks_.metadataTrack_)return;const e=this.inbandTextTracks_.metadataTrack_.cues;if(!e||!e.length)return;const i=this.duration();e[e.length-1].endTime=isNaN(i)||Math.abs(i)===1/0?Number.MAX_VALUE:i}handleDurationChange_(){this.tech_.trigger("durationchange")}onEndOfStream(){let e=this.mainSegmentLoader_.ended_;if(this.mediaTypes_.AUDIO.activePlaylistLoader){const i=this.mainSegmentLoader_.getCurrentMediaInfo_();!i||i.hasVideo?e=e&&this.audioSegmentLoader_.ended_:e=this.audioSegmentLoader_.ended_}e&&(this.stopABRTimer_(),this.sourceUpdater_.endOfStream())}stuckAtPlaylistEnd_(e){if(!this.seekable().length)return!1;const n=this.syncController_.getExpiredTime(e,this.duration());if(n===null)return!1;const r=_u.Playlist.playlistEnd(e,n),s=this.tech_.currentTime(),o=this.tech_.buffered();if(!o.length)return r-s<=Ca;const u=o.end(o.length-1);return u-s<=Ca&&r-u<=Ca}excludePlaylist({playlistToExclude:e=this.mainPlaylistLoader_.media(),error:i={},playlistExclusionDuration:n}){if(e=e||this.mainPlaylistLoader_.media(),n=n||i.playlistExclusionDuration||this.playlistExclusionDuration,!e){this.error=i,this.mediaSource.readyState!=="open"?this.trigger("error"):this.sourceUpdater_.endOfStream("network");return}e.playlistErrors_++;const r=this.mainPlaylistLoader_.main.playlists,s=r.filter(n0),o=s.length===1&&s[0]===e;if(r.length===1&&n!==1/0)return Ve.log.warn(`Problem encountered with playlist ${e.id}. Trying again since it is the only playlist.`),this.tech_.trigger("retryplaylist"),this.mainPlaylistLoader_.load(o);if(o){if(this.main().contentSteering){const R=this.pathwayAttribute_(e),k=this.contentSteeringController_.steeringManifest.ttl*1e3;this.contentSteeringController_.excludePathway(R),this.excludeThenChangePathway_(),setTimeout(()=>{this.contentSteeringController_.addAvailablePathway(R)},k);return}let P=!1;r.forEach(R=>{if(R===e)return;const k=R.excludeUntil;typeof k<"u"&&k!==1/0&&(P=!0,delete R.excludeUntil)}),P&&(Ve.log.warn("Removing other playlists from the exclusion list because the last rendition is about to be excluded."),this.tech_.trigger("retryplaylist"))}let u;e.playlistErrors_>this.maxPlaylistRetries?u=1/0:u=Date.now()+n*1e3,e.excludeUntil=u,i.reason&&(e.lastExcludeReason_=i.reason),this.tech_.trigger("excludeplaylist"),this.tech_.trigger({type:"usage",name:"vhs-rendition-excluded"});const h=this.selectPlaylist();if(!h){this.error="Playback cannot continue. No available working or supported playlists.",this.trigger("error");return}const p=i.internal?this.logger_:Ve.log.warn,g=i.message?" "+i.message:"";p(`${i.internal?"Internal problem":"Problem"} encountered with playlist ${e.id}.${g} Switching to playlist ${h.id}.`),h.attributes.AUDIO!==e.attributes.AUDIO&&this.delegateLoaders_("audio",["abort","pause"]),h.attributes.SUBTITLES!==e.attributes.SUBTITLES&&this.delegateLoaders_("subtitle",["abort","pause"]),this.delegateLoaders_("main",["abort","pause"]);const y=h.targetDuration/2*1e3||5*1e3,S=typeof h.lastRequest=="number"&&Date.now()-h.lastRequest<=y;return this.switchMedia_(h,"exclude",o||S)}pauseLoading(){this.delegateLoaders_("all",["abort","pause"]),this.stopABRTimer_()}delegateLoaders_(e,i){const n=[],r=e==="all";(r||e==="main")&&n.push(this.mainPlaylistLoader_);const s=[];(r||e==="audio")&&s.push("AUDIO"),(r||e==="subtitle")&&(s.push("CLOSED-CAPTIONS"),s.push("SUBTITLES")),s.forEach(o=>{const u=this.mediaTypes_[o]&&this.mediaTypes_[o].activePlaylistLoader;u&&n.push(u)}),["main","audio","subtitle"].forEach(o=>{const u=this[`${o}SegmentLoader_`];u&&(e===o||e==="all")&&n.push(u)}),n.forEach(o=>i.forEach(u=>{typeof o[u]=="function"&&o[u]()}))}setCurrentTime(e){const i=uh(this.tech_.buffered(),e);if(!(this.mainPlaylistLoader_&&this.mainPlaylistLoader_.media())||!this.mainPlaylistLoader_.media().segments)return 0;if(i&&i.length)return e;this.mainSegmentLoader_.pause(),this.mainSegmentLoader_.resetEverything(),this.mediaTypes_.AUDIO.activePlaylistLoader&&(this.audioSegmentLoader_.pause(),this.audioSegmentLoader_.resetEverything()),this.mediaTypes_.SUBTITLES.activePlaylistLoader&&(this.subtitleSegmentLoader_.pause(),this.subtitleSegmentLoader_.resetEverything()),this.load()}duration(){if(!this.mainPlaylistLoader_)return 0;const e=this.mainPlaylistLoader_.media();return e?e.endList?this.mediaSource?this.mediaSource.duration:_u.Playlist.duration(e):1/0:0}seekable(){return this.seekable_}getSeekableRange_(e,i){const n=e.media();if(!n)return null;const r=this.syncController_.getMediaSequenceSync(i);if(r&&r.isReliable){const u=r.start,h=r.end;if(!isFinite(u)||!isFinite(h))return null;const p=_u.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,n),g=Math.max(u,h-p);return xr([[u,g]])}const s=this.syncController_.getExpiredTime(n,this.duration());if(s===null)return null;const o=_u.Playlist.seekable(n,s,_u.Playlist.liveEdgeDelay(this.mainPlaylistLoader_.main,n));return o.length?o:null}computeFinalSeekable_(e,i){if(!i)return e;const n=e.start(0),r=e.end(0),s=i.start(0),o=i.end(0);return s>r||n>o?e:xr([[Math.max(n,s),Math.min(r,o)]])}onSyncInfoUpdate_(){if(!this.mainPlaylistLoader_)return;const e=this.getSeekableRange_(this.mainPlaylistLoader_,"main");if(!e)return;let i;if(this.mediaTypes_.AUDIO.activePlaylistLoader&&(i=this.getSeekableRange_(this.mediaTypes_.AUDIO.activePlaylistLoader,"audio"),!i))return;const n=this.seekable_;if(this.seekable_=this.computeFinalSeekable_(e,i),!this.seekable_||n&&n.length&&this.seekable_.length&&n.start(0)===this.seekable_.start(0)&&n.end(0)===this.seekable_.end(0))return;this.logger_(`seekable updated [${bk(this.seekable_)}]`);const r={seekableRanges:this.seekable_};this.trigger({type:"seekablerangeschanged",metadata:r}),this.tech_.trigger("seekablechanged")}updateDuration(e){if(this.updateDuration_&&(this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.updateDuration_=null),this.mediaSource.readyState!=="open"){this.updateDuration_=this.updateDuration.bind(this,e),this.mediaSource.addEventListener("sourceopen",this.updateDuration_);return}if(e){const r=this.seekable();if(!r.length)return;(isNaN(this.mediaSource.duration)||this.mediaSource.duration0&&(n=Math.max(n,i.end(i.length-1))),this.mediaSource.duration!==n&&this.sourceUpdater_.setDuration(n)}dispose(){this.trigger("dispose"),this.decrypter_.terminate(),this.mainPlaylistLoader_.dispose(),this.mainSegmentLoader_.dispose(),this.contentSteeringController_.dispose(),this.keyStatusMap_.clear(),this.loadOnPlay_&&this.tech_.off("play",this.loadOnPlay_),["AUDIO","SUBTITLES"].forEach(e=>{const i=this.mediaTypes_[e].groups;for(const n in i)i[n].forEach(r=>{r.playlistLoader&&r.playlistLoader.dispose()})}),this.audioSegmentLoader_.dispose(),this.subtitleSegmentLoader_.dispose(),this.sourceUpdater_.dispose(),this.timelineChangeController_.dispose(),this.stopABRTimer_(),this.updateDuration_&&this.mediaSource.removeEventListener("sourceopen",this.updateDuration_),this.mediaSource.removeEventListener("durationchange",this.handleDurationChange_),this.mediaSource.removeEventListener("sourceopen",this.handleSourceOpen_),this.mediaSource.removeEventListener("sourceended",this.handleSourceEnded_),this.off()}main(){return this.mainPlaylistLoader_.main}media(){return this.mainPlaylistLoader_.media()||this.initialMedia_}areMediaTypesKnown_(){const e=!!this.mediaTypes_.AUDIO.activePlaylistLoader,i=!!this.mainSegmentLoader_.getCurrentMediaInfo_(),n=e?!!this.audioSegmentLoader_.getCurrentMediaInfo_():!0;return!(!i||!n)}getCodecsOrExclude_(){const e={main:this.mainSegmentLoader_.getCurrentMediaInfo_()||{},audio:this.audioSegmentLoader_.getCurrentMediaInfo_()||{}},i=this.mainSegmentLoader_.getPendingSegmentPlaylist()||this.media();e.video=e.main;const n=qp(this.main(),i),r={},s=!!this.mediaTypes_.AUDIO.activePlaylistLoader;if(e.main.hasVideo&&(r.video=n.video||e.main.videoCodec||n7),e.main.isMuxed&&(r.video+=`,${n.audio||e.main.audioCodec||m2}`),(e.main.hasAudio&&!e.main.isMuxed||e.audio.hasAudio||s)&&(r.audio=n.audio||e.main.audioCodec||e.audio.audioCodec||m2,e.audio.isFmp4=e.main.hasAudio&&!e.main.isMuxed?e.main.isFmp4:e.audio.isFmp4),!r.audio&&!r.video){this.excludePlaylist({playlistToExclude:i,error:{message:"Could not determine codecs for playlist."},playlistExclusionDuration:1/0});return}const o=(p,g)=>p?mp(g,this.usingManagedMediaSource_):__(g),u={};let h;if(["video","audio"].forEach(function(p){if(r.hasOwnProperty(p)&&!o(e[p].isFmp4,r[p])){const g=e[p].isFmp4?"browser":"muxer";u[g]=u[g]||[],u[g].push(r[p]),p==="audio"&&(h=g)}}),s&&h&&i.attributes.AUDIO){const p=i.attributes.AUDIO;this.main().playlists.forEach(g=>{(g.attributes&&g.attributes.AUDIO)===p&&g!==i&&(g.excludeUntil=1/0)}),this.logger_(`excluding audio group ${p} as ${h} does not support codec(s): "${r.audio}"`)}if(Object.keys(u).length){const p=Object.keys(u).reduce((g,y)=>(g&&(g+=", "),g+=`${y} does not support codec(s): "${u[y].join(",")}"`,g),"")+".";this.excludePlaylist({playlistToExclude:i,error:{internal:!0,message:p},playlistExclusionDuration:1/0});return}if(this.sourceUpdater_.hasCreatedSourceBuffers()&&!this.sourceUpdater_.canChangeType()){const p=[];if(["video","audio"].forEach(g=>{const y=(ya(this.sourceUpdater_.codecs[g]||"")[0]||{}).type,S=(ya(r[g]||"")[0]||{}).type;y&&S&&y.toLowerCase()!==S.toLowerCase()&&p.push(`"${this.sourceUpdater_.codecs[g]}" -> "${r[g]}"`)}),p.length){this.excludePlaylist({playlistToExclude:i,error:{message:`Codec switching not supported: ${p.join(", ")}.`,internal:!0},playlistExclusionDuration:1/0});return}}return r}tryToCreateSourceBuffers_(){if(this.mediaSource.readyState!=="open"||this.sourceUpdater_.hasCreatedSourceBuffers()||!this.areMediaTypesKnown_())return;const e=this.getCodecsOrExclude_();if(!e)return;this.sourceUpdater_.createSourceBuffers(e);const i=[e.video,e.audio].filter(Boolean).join(",");this.excludeIncompatibleVariants_(i)}excludeUnsupportedVariants_(){const e=this.main().playlists,i=[];Object.keys(e).forEach(n=>{const r=e[n];if(i.indexOf(r.id)!==-1)return;i.push(r.id);const s=qp(this.main,r),o=[];s.audio&&!__(s.audio)&&!mp(s.audio,this.usingManagedMediaSource_)&&o.push(`audio codec ${s.audio}`),s.video&&!__(s.video)&&!mp(s.video,this.usingManagedMediaSource_)&&o.push(`video codec ${s.video}`),s.text&&s.text==="stpp.ttml.im1t"&&o.push(`text codec ${s.text}`),o.length&&(r.excludeUntil=1/0,this.logger_(`excluding ${r.id} for unsupported: ${o.join(", ")}`))})}excludeIncompatibleVariants_(e){const i=[],n=this.main().playlists,r=Wp(ya(e)),s=Nk(r),o=r.video&&ya(r.video)[0]||null,u=r.audio&&ya(r.audio)[0]||null;Object.keys(n).forEach(h=>{const p=n[h];if(i.indexOf(p.id)!==-1||p.excludeUntil===1/0)return;i.push(p.id);const g=[],y=qp(this.mainPlaylistLoader_.main,p),S=Nk(y);if(!(!y.audio&&!y.video)){if(S!==s&&g.push(`codec count "${S}" !== "${s}"`),!this.sourceUpdater_.canChangeType()){const P=y.video&&ya(y.video)[0]||null,R=y.audio&&ya(y.audio)[0]||null;P&&o&&P.type.toLowerCase()!==o.type.toLowerCase()&&g.push(`video codec "${P.type}" !== "${o.type}"`),R&&u&&R.type.toLowerCase()!==u.type.toLowerCase()&&g.push(`audio codec "${R.type}" !== "${u.type}"`)}g.length&&(p.excludeUntil=1/0,this.logger_(`excluding ${p.id}: ${g.join(" && ")}`))}})}updateAdCues_(e){let i=0;const n=this.seekable();n.length&&(i=n.start(0)),hK(e,this.cueTagsTrack_,i)}goalBufferLength(){const e=this.tech_.currentTime(),i=Sr.GOAL_BUFFER_LENGTH,n=Sr.GOAL_BUFFER_LENGTH_RATE,r=Math.max(i,Sr.MAX_GOAL_BUFFER_LENGTH);return Math.min(i+e*n,r)}bufferLowWaterLine(){const e=this.tech_.currentTime(),i=Sr.BUFFER_LOW_WATER_LINE,n=Sr.BUFFER_LOW_WATER_LINE_RATE,r=Math.max(i,Sr.MAX_BUFFER_LOW_WATER_LINE),s=Math.max(i,Sr.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE);return Math.min(i+e*n,this.bufferBasedABR?s:r)}bufferHighWaterLine(){return Sr.BUFFER_HIGH_WATER_LINE}addDateRangesToTextTrack_(e){pI(this.inbandTextTracks_,"com.apple.streaming",this.tech_),qG({inbandTextTracks:this.inbandTextTracks_,dateRanges:e})}addMetadataToTextTrack(e,i,n){const r=this.sourceUpdater_.videoBuffer?this.sourceUpdater_.videoTimestampOffset():this.sourceUpdater_.audioTimestampOffset();pI(this.inbandTextTracks_,e,this.tech_),VG({inbandTextTracks:this.inbandTextTracks_,metadataArray:i,timestampOffset:r,videoDuration:n})}pathwayAttribute_(e){return e.attributes["PATHWAY-ID"]||e.attributes.serviceLocation}initContentSteeringController_(){const e=this.main();if(e.contentSteering){for(const i of e.playlists)this.contentSteeringController_.addAvailablePathway(this.pathwayAttribute_(i));if(this.contentSteeringController_.assignTagProperties(e.uri,e.contentSteering),this.contentSteeringController_.queryBeforeStart){this.contentSteeringController_.requestSteeringManifest(!0);return}this.tech_.one("canplay",()=>{this.contentSteeringController_.requestSteeringManifest()})}}resetContentSteeringController_(){this.contentSteeringController_.clearAvailablePathways(),this.contentSteeringController_.dispose(),this.initContentSteeringController_()}attachContentSteeringListeners_(){this.contentSteeringController_.on("content-steering",this.excludeThenChangePathway_.bind(this)),["contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"].forEach(i=>{this.contentSteeringController_.on(i,n=>{this.trigger(Wn({},n))})}),this.sourceType_==="dash"&&this.mainPlaylistLoader_.on("loadedplaylist",()=>{const i=this.main();(this.contentSteeringController_.didDASHTagChange(i.uri,i.contentSteering)||(()=>{const s=this.contentSteeringController_.getAvailablePathways(),o=[];for(const u of i.playlists){const h=u.attributes.serviceLocation;if(h&&(o.push(h),!s.has(h)))return!0}return!!(!o.length&&s.size)})())&&this.resetContentSteeringController_()})}excludeThenChangePathway_(){const e=this.contentSteeringController_.getPathway();if(!e)return;this.handlePathwayClones_();const n=this.main().playlists,r=new Set;let s=!1;Object.keys(n).forEach(o=>{const u=n[o],h=this.pathwayAttribute_(u),p=h&&e!==h;u.excludeUntil===1/0&&u.lastExcludeReason_==="content-steering"&&!p&&(delete u.excludeUntil,delete u.lastExcludeReason_,s=!0);const y=!u.excludeUntil&&u.excludeUntil!==1/0;!r.has(u.id)&&p&&y&&(r.add(u.id),u.excludeUntil=1/0,u.lastExcludeReason_="content-steering",this.logger_(`excluding ${u.id} for ${u.lastExcludeReason_}`))}),this.contentSteeringController_.manifestType_==="DASH"&&Object.keys(this.mediaTypes_).forEach(o=>{const u=this.mediaTypes_[o];if(u.activePlaylistLoader){const h=u.activePlaylistLoader.media_;h&&h.attributes.serviceLocation!==e&&(s=!0)}}),s&&this.changeSegmentPathway_()}handlePathwayClones_(){const i=this.main().playlists,n=this.contentSteeringController_.currentPathwayClones,r=this.contentSteeringController_.nextPathwayClones;if(n&&n.size||r&&r.size){for(const[o,u]of n.entries())r.get(o)||(this.mainPlaylistLoader_.updateOrDeleteClone(u),this.contentSteeringController_.excludePathway(o));for(const[o,u]of r.entries()){const h=n.get(o);if(!h){i.filter(g=>g.attributes["PATHWAY-ID"]===u["BASE-ID"]).forEach(g=>{this.mainPlaylistLoader_.addClonePathway(u,g)}),this.contentSteeringController_.addAvailablePathway(o);continue}this.equalPathwayClones_(h,u)||(this.mainPlaylistLoader_.updateOrDeleteClone(u,!0),this.contentSteeringController_.addAvailablePathway(o))}this.contentSteeringController_.currentPathwayClones=new Map(JSON.parse(JSON.stringify([...r])))}}equalPathwayClones_(e,i){if(e["BASE-ID"]!==i["BASE-ID"]||e.ID!==i.ID||e["URI-REPLACEMENT"].HOST!==i["URI-REPLACEMENT"].HOST)return!1;const n=e["URI-REPLACEMENT"].PARAMS,r=i["URI-REPLACEMENT"].PARAMS;for(const s in n)if(n[s]!==r[s])return!1;for(const s in r)if(n[s]!==r[s])return!1;return!0}changeSegmentPathway_(){const e=this.selectPlaylist();this.pauseLoading(),this.contentSteeringController_.manifestType_==="DASH"&&this.switchMediaForDASHContentSteering_(),this.switchMedia_(e,"content-steering")}excludeNonUsablePlaylistsByKeyId_(){if(!this.mainPlaylistLoader_||!this.mainPlaylistLoader_.main)return;let e=0;const i="non-usable";this.mainPlaylistLoader_.main.playlists.forEach(n=>{const r=this.mainPlaylistLoader_.getKeyIdSet(n);!r||!r.size||r.forEach(s=>{const o="usable",u=this.keyStatusMap_.has(s)&&this.keyStatusMap_.get(s)===o,h=n.lastExcludeReason_===i&&n.excludeUntil===1/0;u?u&&h&&(delete n.excludeUntil,delete n.lastExcludeReason_,this.logger_(`enabling playlist ${n.id} because key ID ${s} is ${o}`)):(n.excludeUntil!==1/0&&n.lastExcludeReason_!==i&&(n.excludeUntil=1/0,n.lastExcludeReason_=i,this.logger_(`excluding playlist ${n.id} because the key ID ${s} doesn't exist in the keyStatusMap or is not ${o}`)),e++)})}),e>=this.mainPlaylistLoader_.main.playlists.length&&this.mainPlaylistLoader_.main.playlists.forEach(n=>{const r=n&&n.attributes&&n.attributes.RESOLUTION&&n.attributes.RESOLUTION.height<720,s=n.excludeUntil===1/0&&n.lastExcludeReason_===i;r&&s&&(delete n.excludeUntil,Ve.log.warn(`enabling non-HD playlist ${n.id} because all playlists were excluded due to ${i} key IDs`))})}addKeyStatus_(e,i){const s=(typeof e=="string"?e:lK(e)).slice(0,32).toLowerCase();this.logger_(`KeyStatus '${i}' with key ID ${s} added to the keyStatusMap`),this.keyStatusMap_.set(s,i)}updatePlaylistByKeyStatus(e,i){this.addKeyStatus_(e,i),this.waitingForFastQualityPlaylistReceived_||this.excludeNonUsableThenChangePlaylist_(),this.mainPlaylistLoader_.off("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this)),this.mainPlaylistLoader_.on("loadedplaylist",this.excludeNonUsableThenChangePlaylist_.bind(this))}excludeNonUsableThenChangePlaylist_(){this.excludeNonUsablePlaylistsByKeyId_(),this.fastQualityChange_()}}const FK=(t,e,i)=>n=>{const r=t.main.playlists[e],s=zw(r),o=n0(r);if(typeof n>"u")return o;n?delete r.disabled:r.disabled=!0;const u={renditionInfo:{id:e,bandwidth:r.attributes.BANDWIDTH,resolution:r.attributes.RESOLUTION,codecs:r.attributes.CODECS},cause:"fast-quality"};return n!==o&&!s&&(n?(i(r),t.trigger({type:"renditionenabled",metadata:u})):t.trigger({type:"renditiondisabled",metadata:u})),n};class NK{constructor(e,i,n){const{playlistController_:r}=e,s=r.fastQualityChange_.bind(r);if(i.attributes){const o=i.attributes.RESOLUTION;this.width=o&&o.width,this.height=o&&o.height,this.bandwidth=i.attributes.BANDWIDTH,this.frameRate=i.attributes["FRAME-RATE"]}this.codecs=qp(r.main(),i),this.playlist=i,this.id=n,this.enabled=FK(e.playlists,i.id,s)}}const BK=function(t){t.representations=()=>{const e=t.playlistController_.main(),i=jp(e)?t.playlistController_.getAudioTrackPlaylists_():e.playlists;return i?i.filter(n=>!zw(n)).map((n,r)=>new NK(t,n,n.id)):[]}},II=["seeking","seeked","pause","playing","error"];class HK extends Ve.EventTarget{constructor(e){super(),this.playlistController_=e.playlistController,this.tech_=e.tech,this.seekable=e.seekable,this.allowSeeksWithinUnsafeLiveWindow=e.allowSeeksWithinUnsafeLiveWindow,this.liveRangeSafeTimeDelta=e.liveRangeSafeTimeDelta,this.media=e.media,this.playedRanges_=[],this.consecutiveUpdates=0,this.lastRecordedTime=null,this.checkCurrentTimeTimeout_=null,this.logger_=So("PlaybackWatcher"),this.logger_("initialize");const i=()=>this.monitorCurrentTime_(),n=()=>this.monitorCurrentTime_(),r=()=>this.techWaiting_(),s=()=>this.resetTimeUpdate_(),o=this.playlistController_,u=["main","subtitle","audio"],h={};u.forEach(g=>{h[g]={reset:()=>this.resetSegmentDownloads_(g),updateend:()=>this.checkSegmentDownloads_(g)},o[`${g}SegmentLoader_`].on("appendsdone",h[g].updateend),o[`${g}SegmentLoader_`].on("playlistupdate",h[g].reset),this.tech_.on(["seeked","seeking"],h[g].reset)});const p=g=>{["main","audio"].forEach(y=>{o[`${y}SegmentLoader_`][g]("appended",this.seekingAppendCheck_)})};this.seekingAppendCheck_=()=>{this.fixesBadSeeks_()&&(this.consecutiveUpdates=0,this.lastRecordedTime=this.tech_.currentTime(),p("off"))},this.clearSeekingAppendCheck_=()=>p("off"),this.watchForBadSeeking_=()=>{this.clearSeekingAppendCheck_(),p("on")},this.tech_.on("seeked",this.clearSeekingAppendCheck_),this.tech_.on("seeking",this.watchForBadSeeking_),this.tech_.on("waiting",r),this.tech_.on(II,s),this.tech_.on("canplay",n),this.tech_.one("play",i),this.dispose=()=>{this.clearSeekingAppendCheck_(),this.logger_("dispose"),this.tech_.off("waiting",r),this.tech_.off(II,s),this.tech_.off("canplay",n),this.tech_.off("play",i),this.tech_.off("seeking",this.watchForBadSeeking_),this.tech_.off("seeked",this.clearSeekingAppendCheck_),u.forEach(g=>{o[`${g}SegmentLoader_`].off("appendsdone",h[g].updateend),o[`${g}SegmentLoader_`].off("playlistupdate",h[g].reset),this.tech_.off(["seeked","seeking"],h[g].reset)}),this.checkCurrentTimeTimeout_&&_e.clearTimeout(this.checkCurrentTimeTimeout_),this.resetTimeUpdate_()}}monitorCurrentTime_(){this.checkCurrentTime_(),this.checkCurrentTimeTimeout_&&_e.clearTimeout(this.checkCurrentTimeTimeout_),this.checkCurrentTimeTimeout_=_e.setTimeout(this.monitorCurrentTime_.bind(this),250)}resetSegmentDownloads_(e){const i=this.playlistController_[`${e}SegmentLoader_`];this[`${e}StalledDownloads_`]>0&&this.logger_(`resetting possible stalled download count for ${e} loader`),this[`${e}StalledDownloads_`]=0,this[`${e}Buffered_`]=i.buffered_()}checkSegmentDownloads_(e){const i=this.playlistController_,n=i[`${e}SegmentLoader_`],r=n.buffered_(),s=Aq(this[`${e}Buffered_`],r);if(this[`${e}Buffered_`]=r,s){const o={bufferedRanges:r};i.trigger({type:"bufferedrangeschanged",metadata:o}),this.resetSegmentDownloads_(e);return}this[`${e}StalledDownloads_`]++,this.logger_(`found #${this[`${e}StalledDownloads_`]} ${e} appends that did not increase buffer (possible stalled download)`,{playlistId:n.playlist_&&n.playlist_.id,buffered:Ec(r)}),!(this[`${e}StalledDownloads_`]<10)&&(this.logger_(`${e} loader stalled download exclusion`),this.resetSegmentDownloads_(e),this.tech_.trigger({type:"usage",name:`vhs-${e}-download-exclusion`}),e!=="subtitle"&&i.excludePlaylist({error:{message:`Excessive ${e} segment downloading detected.`},playlistExclusionDuration:1/0}))}checkCurrentTime_(){if(this.tech_.paused()||this.tech_.seeking())return;const e=this.tech_.currentTime(),i=this.tech_.buffered();if(this.lastRecordedTime===e&&(!i.length||e+Ca>=i.end(i.length-1)))return this.techWaiting_();if(this.consecutiveUpdates>=5&&e===this.lastRecordedTime)this.consecutiveUpdates++,this.waiting_();else if(e===this.lastRecordedTime)this.consecutiveUpdates++;else{this.playedRanges_.push(xr([this.lastRecordedTime,e]));const n={playedRanges:this.playedRanges_};this.playlistController_.trigger({type:"playedrangeschanged",metadata:n}),this.consecutiveUpdates=0,this.lastRecordedTime=e}}resetTimeUpdate_(){this.consecutiveUpdates=0}fixesBadSeeks_(){if(!this.tech_.seeking())return!1;const i=this.seekable(),n=this.tech_.currentTime(),r=this.afterSeekableWindow_(i,n,this.media(),this.allowSeeksWithinUnsafeLiveWindow);let s;if(r&&(s=i.end(i.length-1)),this.beforeSeekableWindow_(i,n)){const R=i.start(0);s=R+(R===i.end(0)?0:Ca)}if(typeof s<"u")return this.logger_(`Trying to seek outside of seekable at time ${n} with seekable range ${bk(i)}. Seeking to ${s}.`),this.tech_.setCurrentTime(s),!0;const o=this.playlistController_.sourceUpdater_,u=this.tech_.buffered(),h=o.audioBuffer?o.audioBuffered():null,p=o.videoBuffer?o.videoBuffered():null,g=this.media(),y=g.partTargetDuration?g.partTargetDuration:(g.targetDuration-Ea)*2,S=[h,p];for(let R=0;R ${n.end(0)}]. Attempting to resume playback by seeking to the current time.`),this.tech_.trigger({type:"usage",name:"vhs-unknown-waiting"});return}}techWaiting_(){const e=this.seekable(),i=this.tech_.currentTime();if(this.tech_.seeking())return!0;if(this.beforeSeekableWindow_(e,i)){const u=e.end(e.length-1);return this.logger_(`Fell out of live window at time ${i}. Seeking to live point (seekable end) ${u}`),this.resetTimeUpdate_(),this.tech_.setCurrentTime(u),this.tech_.trigger({type:"usage",name:"vhs-live-resync"}),!0}const n=this.tech_.vhs.playlistController_.sourceUpdater_,r=this.tech_.buffered();if(this.videoUnderflow_({audioBuffered:n.audioBuffered(),videoBuffered:n.videoBuffered(),currentTime:i}))return this.resetTimeUpdate_(),this.tech_.setCurrentTime(i),this.tech_.trigger({type:"usage",name:"vhs-video-underflow"}),!0;const o=i0(r,i);return o.length>0?(this.logger_(`Stopped at ${i} and seeking to ${o.start(0)}`),this.resetTimeUpdate_(),this.skipTheGap_(i),!0):!1}afterSeekableWindow_(e,i,n,r=!1){if(!e.length)return!1;let s=e.end(e.length-1)+Ca;const o=!n.endList,u=typeof n.partTargetDuration=="number";return o&&(u||r)&&(s=e.end(e.length-1)+n.targetDuration*3),i>s}beforeSeekableWindow_(e,i){return!!(e.length&&e.start(0)>0&&i2)return{start:s,end:o}}return null}}const UK={errorInterval:30,getSource(t){const i=this.tech({IWillNotUseThisInPlugins:!0}).currentSource_||this.currentSource();return t(i)}},RI=function(t,e){let i=0,n=0;const r=Ji(UK,e);t.ready(()=>{t.trigger({type:"usage",name:"vhs-error-reload-initialized"})});const s=function(){n&&t.currentTime(n)},o=function(g){g!=null&&(n=t.duration()!==1/0&&t.currentTime()||0,t.one("loadedmetadata",s),t.src(g),t.trigger({type:"usage",name:"vhs-error-reload"}),t.play())},u=function(){if(Date.now()-i{Object.defineProperty(Hn,t,{get(){return Ve.log.warn(`using Vhs.${t} is UNSAFE be sure you know what you are doing`),Sr[t]},set(e){if(Ve.log.warn(`using Vhs.${t} is UNSAFE be sure you know what you are doing`),typeof e!="number"||e<0){Ve.log.warn(`value of Vhs.${t} must be greater than or equal to 0`);return}Sr[t]=e}})});const LI="videojs-vhs",MI=function(t,e){const i=e.media();let n=-1;for(let r=0;r{t.addQualityLevel(i)}),MI(t,e.playlists)};Hn.canPlaySource=function(){return Ve.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")};const KK=(t,e,i)=>{if(!t)return t;let n={};e&&e.attributes&&e.attributes.CODECS&&(n=Wp(ya(e.attributes.CODECS))),i&&i.attributes&&i.attributes.CODECS&&(n.audio=i.attributes.CODECS);const r=Rd(n.video),s=Rd(n.audio),o={};for(const u in t)o[u]={},s&&(o[u].audioContentType=s),r&&(o[u].videoContentType=r),e.contentProtection&&e.contentProtection[u]&&e.contentProtection[u].pssh&&(o[u].pssh=e.contentProtection[u].pssh),typeof t[u]=="string"&&(o[u].url=t[u]);return Ji(t,o)},YK=(t,e)=>t.reduce((i,n)=>{if(!n.contentProtection)return i;const r=e.reduce((s,o)=>{const u=n.contentProtection[o];return u&&u.pssh&&(s[o]={pssh:u.pssh}),s},{});return Object.keys(r).length&&i.push(r),i},[]),XK=({player:t,sourceKeySystems:e,audioMedia:i,mainPlaylists:n})=>{if(!t.eme.initializeMediaKeys)return Promise.resolve();const r=i?n.concat([i]):n,s=YK(r,Object.keys(e)),o=[],u=[];return s.forEach(h=>{u.push(new Promise((p,g)=>{t.tech_.one("keysessioncreated",p)})),o.push(new Promise((p,g)=>{t.eme.initializeMediaKeys({keySystems:h},y=>{if(y){g(y);return}p()})}))}),Promise.race([Promise.all(o),Promise.race(u)])},ZK=({player:t,sourceKeySystems:e,media:i,audioMedia:n})=>{const r=KK(e,i,n);return r?(t.currentSource().keySystems=r,r&&!t.eme?(Ve.log.warn("DRM encrypted source cannot be decrypted without a DRM plugin"),!1):!0):!1},FI=()=>{if(!_e.localStorage)return null;const t=_e.localStorage.getItem(LI);if(!t)return null;try{return JSON.parse(t)}catch{return null}},QK=t=>{if(!_e.localStorage)return!1;let e=FI();e=e?Ji(e,t):t;try{_e.localStorage.setItem(LI,JSON.stringify(e))}catch{return!1}return e},JK=t=>t.toLowerCase().indexOf("data:application/vnd.videojs.vhs+json,")===0?JSON.parse(t.substring(t.indexOf(",")+1)):t,NI=(t,e)=>{t._requestCallbackSet||(t._requestCallbackSet=new Set),t._requestCallbackSet.add(e)},BI=(t,e)=>{t._responseCallbackSet||(t._responseCallbackSet=new Set),t._responseCallbackSet.add(e)},HI=(t,e)=>{t._requestCallbackSet&&(t._requestCallbackSet.delete(e),t._requestCallbackSet.size||delete t._requestCallbackSet)},UI=(t,e)=>{t._responseCallbackSet&&(t._responseCallbackSet.delete(e),t._responseCallbackSet.size||delete t._responseCallbackSet)};Hn.supportsNativeHls=function(){if(!mt||!mt.createElement)return!1;const t=mt.createElement("video");return Ve.getTech("Html5").isSupported()?["application/vnd.apple.mpegurl","audio/mpegurl","audio/x-mpegurl","application/x-mpegurl","video/x-mpegurl","video/mpegurl","application/mpegurl"].some(function(i){return/maybe|probably/i.test(t.canPlayType(i))}):!1}(),Hn.supportsNativeDash=function(){return!mt||!mt.createElement||!Ve.getTech("Html5").isSupported()?!1:/maybe|probably/i.test(mt.createElement("video").canPlayType("application/dash+xml"))}(),Hn.supportsTypeNatively=t=>t==="hls"?Hn.supportsNativeHls:t==="dash"?Hn.supportsNativeDash:!1,Hn.isSupported=function(){return Ve.log.warn("VHS is no longer a tech. Please remove it from your player's techOrder.")},Hn.xhr.onRequest=function(t){NI(Hn.xhr,t)},Hn.xhr.onResponse=function(t){BI(Hn.xhr,t)},Hn.xhr.offRequest=function(t){HI(Hn.xhr,t)},Hn.xhr.offResponse=function(t){UI(Hn.xhr,t)};const $K=Ve.getComponent("Component");class zI extends $K{constructor(e,i,n){if(super(i,n.vhs),typeof n.initialBandwidth=="number"&&(this.options_.bandwidth=n.initialBandwidth),this.logger_=So("VhsHandler"),i.options_&&i.options_.playerId){const r=Ve.getPlayer(i.options_.playerId);this.player_=r}if(this.tech_=i,this.source_=e,this.stats={},this.ignoreNextSeekingEvent_=!1,this.setOptions_(),this.options_.overrideNative&&i.overrideNativeAudioTracks&&i.overrideNativeVideoTracks)i.overrideNativeAudioTracks(!0),i.overrideNativeVideoTracks(!0);else if(this.options_.overrideNative&&(i.featuresNativeVideoTracks||i.featuresNativeAudioTracks))throw new Error("Overriding native VHS requires emulated tracks. See https://git.io/vMpjB");this.on(mt,["fullscreenchange","webkitfullscreenchange","mozfullscreenchange","MSFullscreenChange"],r=>{const s=mt.fullscreenElement||mt.webkitFullscreenElement||mt.mozFullScreenElement||mt.msFullscreenElement;s&&s.contains(this.tech_.el())?this.playlistController_.fastQualityChange_():this.playlistController_.checkABR_()}),this.on(this.tech_,"seeking",function(){if(this.ignoreNextSeekingEvent_){this.ignoreNextSeekingEvent_=!1;return}this.setCurrentTime(this.tech_.currentTime())}),this.on(this.tech_,"error",function(){this.tech_.error()&&this.playlistController_&&this.playlistController_.pauseLoading()}),this.on(this.tech_,"play",this.play)}setOptions_(e={}){if(this.options_=Ji(this.options_,e),this.options_.withCredentials=this.options_.withCredentials||!1,this.options_.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions!==!1,this.options_.useDevicePixelRatio=this.options_.useDevicePixelRatio||!1,this.options_.usePlayerObjectFit=this.options_.usePlayerObjectFit||!1,this.options_.useBandwidthFromLocalStorage=typeof this.source_.useBandwidthFromLocalStorage<"u"?this.source_.useBandwidthFromLocalStorage:this.options_.useBandwidthFromLocalStorage||!1,this.options_.useForcedSubtitles=this.options_.useForcedSubtitles||!1,this.options_.useNetworkInformationApi=typeof this.options_.useNetworkInformationApi<"u"?this.options_.useNetworkInformationApi:!0,this.options_.useDtsForTimestampOffset=this.options_.useDtsForTimestampOffset||!1,this.options_.customTagParsers=this.options_.customTagParsers||[],this.options_.customTagMappers=this.options_.customTagMappers||[],this.options_.cacheEncryptionKeys=this.options_.cacheEncryptionKeys||!1,this.options_.llhls=this.options_.llhls!==!1,this.options_.bufferBasedABR=this.options_.bufferBasedABR||!1,typeof this.options_.playlistExclusionDuration!="number"&&(this.options_.playlistExclusionDuration=60),typeof this.options_.bandwidth!="number"&&this.options_.useBandwidthFromLocalStorage){const n=FI();n&&n.bandwidth&&(this.options_.bandwidth=n.bandwidth,this.tech_.trigger({type:"usage",name:"vhs-bandwidth-from-local-storage"})),n&&n.throughput&&(this.options_.throughput=n.throughput,this.tech_.trigger({type:"usage",name:"vhs-throughput-from-local-storage"}))}typeof this.options_.bandwidth!="number"&&(this.options_.bandwidth=Sr.INITIAL_BANDWIDTH),this.options_.enableLowInitialPlaylist=this.options_.enableLowInitialPlaylist&&this.options_.bandwidth===Sr.INITIAL_BANDWIDTH,["withCredentials","useDevicePixelRatio","usePlayerObjectFit","customPixelRatio","limitRenditionByPlayerDimensions","bandwidth","customTagParsers","customTagMappers","cacheEncryptionKeys","playlistSelector","initialPlaylistSelector","bufferBasedABR","liveRangeSafeTimeDelta","llhls","useForcedSubtitles","useNetworkInformationApi","useDtsForTimestampOffset","exactManifestTimings","leastPixelDiffSelector"].forEach(n=>{typeof this.source_[n]<"u"&&(this.options_[n]=this.source_[n])}),this.limitRenditionByPlayerDimensions=this.options_.limitRenditionByPlayerDimensions,this.useDevicePixelRatio=this.options_.useDevicePixelRatio,this.usePlayerObjectFit=this.options_.usePlayerObjectFit;const i=this.options_.customPixelRatio;typeof i=="number"&&i>=0&&(this.customPixelRatio=i)}setOptions(e={}){this.setOptions_(e)}src(e,i){if(!e)return;this.setOptions_(),this.options_.src=JK(this.source_.src),this.options_.tech=this.tech_,this.options_.externVhs=Hn,this.options_.sourceType=g2(i),this.options_.seekTo=s=>{this.tech_.setCurrentTime(s)},this.options_.player_=this.player_,this.playlistController_=new MK(this.options_);const n=Ji({liveRangeSafeTimeDelta:Ca},this.options_,{seekable:()=>this.seekable(),media:()=>this.playlistController_.media(),playlistController:this.playlistController_});this.playbackWatcher_=new HK(n),this.attachStreamingEventListeners_(),this.playlistController_.on("error",()=>{const s=Ve.players[this.tech_.options_.playerId];let o=this.playlistController_.error;typeof o=="object"&&!o.code?o.code=3:typeof o=="string"&&(o={message:o,code:3}),s.error(o)});const r=this.options_.bufferBasedABR?Hn.movingAverageBandwidthSelector(.55):Hn.STANDARD_PLAYLIST_SELECTOR;this.playlistController_.selectPlaylist=this.selectPlaylist?this.selectPlaylist.bind(this):r.bind(this),this.playlistController_.selectInitialPlaylist=Hn.INITIAL_PLAYLIST_SELECTOR.bind(this),this.playlists=this.playlistController_.mainPlaylistLoader_,this.mediaSource=this.playlistController_.mediaSource,Object.defineProperties(this,{selectPlaylist:{get(){return this.playlistController_.selectPlaylist},set(s){this.playlistController_.selectPlaylist=s.bind(this)}},throughput:{get(){return this.playlistController_.mainSegmentLoader_.throughput.rate},set(s){this.playlistController_.mainSegmentLoader_.throughput.rate=s,this.playlistController_.mainSegmentLoader_.throughput.count=1}},bandwidth:{get(){let s=this.playlistController_.mainSegmentLoader_.bandwidth;const o=_e.navigator.connection||_e.navigator.mozConnection||_e.navigator.webkitConnection,u=1e7;if(this.options_.useNetworkInformationApi&&o){const h=o.downlink*1e3*1e3;h>=u&&s>=u?s=Math.max(s,h):s=h}return s},set(s){this.playlistController_.mainSegmentLoader_.bandwidth=s,this.playlistController_.mainSegmentLoader_.throughput={rate:0,count:0}}},systemBandwidth:{get(){const s=1/(this.bandwidth||1);let o;return this.throughput>0?o=1/this.throughput:o=0,Math.floor(1/(s+o))},set(){Ve.log.error('The "systemBandwidth" property is read-only')}}}),this.options_.bandwidth&&(this.bandwidth=this.options_.bandwidth),this.options_.throughput&&(this.throughput=this.options_.throughput),Object.defineProperties(this.stats,{bandwidth:{get:()=>this.bandwidth||0,enumerable:!0},mediaRequests:{get:()=>this.playlistController_.mediaRequests_()||0,enumerable:!0},mediaRequestsAborted:{get:()=>this.playlistController_.mediaRequestsAborted_()||0,enumerable:!0},mediaRequestsTimedout:{get:()=>this.playlistController_.mediaRequestsTimedout_()||0,enumerable:!0},mediaRequestsErrored:{get:()=>this.playlistController_.mediaRequestsErrored_()||0,enumerable:!0},mediaTransferDuration:{get:()=>this.playlistController_.mediaTransferDuration_()||0,enumerable:!0},mediaBytesTransferred:{get:()=>this.playlistController_.mediaBytesTransferred_()||0,enumerable:!0},mediaSecondsLoaded:{get:()=>this.playlistController_.mediaSecondsLoaded_()||0,enumerable:!0},mediaAppends:{get:()=>this.playlistController_.mediaAppends_()||0,enumerable:!0},mainAppendsToLoadedData:{get:()=>this.playlistController_.mainAppendsToLoadedData_()||0,enumerable:!0},audioAppendsToLoadedData:{get:()=>this.playlistController_.audioAppendsToLoadedData_()||0,enumerable:!0},appendsToLoadedData:{get:()=>this.playlistController_.appendsToLoadedData_()||0,enumerable:!0},timeToLoadedData:{get:()=>this.playlistController_.timeToLoadedData_()||0,enumerable:!0},buffered:{get:()=>Ec(this.tech_.buffered()),enumerable:!0},currentTime:{get:()=>this.tech_.currentTime(),enumerable:!0},currentSource:{get:()=>this.tech_.currentSource_,enumerable:!0},currentTech:{get:()=>this.tech_.name_,enumerable:!0},duration:{get:()=>this.tech_.duration(),enumerable:!0},main:{get:()=>this.playlists.main,enumerable:!0},playerDimensions:{get:()=>this.tech_.currentDimensions(),enumerable:!0},seekable:{get:()=>Ec(this.tech_.seekable()),enumerable:!0},timestamp:{get:()=>Date.now(),enumerable:!0},videoPlaybackQuality:{get:()=>this.tech_.getVideoPlaybackQuality(),enumerable:!0}}),this.tech_.one("canplay",this.playlistController_.setupFirstPlay.bind(this.playlistController_)),this.tech_.on("bandwidthupdate",()=>{this.options_.useBandwidthFromLocalStorage&&QK({bandwidth:this.bandwidth,throughput:Math.round(this.throughput)})}),this.playlistController_.on("selectedinitialmedia",()=>{BK(this)}),this.playlistController_.sourceUpdater_.on("createdsourcebuffers",()=>{this.setupEme_()}),this.on(this.playlistController_,"progress",function(){this.tech_.trigger("progress")}),this.on(this.playlistController_,"firstplay",function(){this.ignoreNextSeekingEvent_=!0}),this.setupQualityLevels_(),this.tech_.el()&&(this.mediaSourceUrl_=_e.URL.createObjectURL(this.playlistController_.mediaSource),(Ve.browser.IS_ANY_SAFARI||Ve.browser.IS_IOS)&&this.options_.overrideNative&&this.options_.sourceType==="hls"&&typeof this.tech_.addSourceElement=="function"?(this.tech_.addSourceElement(this.mediaSourceUrl_),this.tech_.addSourceElement(this.source_.src)):this.tech_.src(this.mediaSourceUrl_))}createKeySessions_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader;this.logger_("waiting for EME key session creation"),XK({player:this.player_,sourceKeySystems:this.source_.keySystems,audioMedia:e&&e.media(),mainPlaylists:this.playlists.main.playlists}).then(()=>{this.logger_("created EME key session"),this.playlistController_.sourceUpdater_.initializedEme()}).catch(i=>{this.logger_("error while creating EME key session",i),this.player_.error({message:"Failed to initialize media keys for EME",code:3})})}handleWaitingForKey_(){this.logger_("waitingforkey fired, attempting to create any new key sessions"),this.createKeySessions_()}setupEme_(){const e=this.playlistController_.mediaTypes_.AUDIO.activePlaylistLoader,i=ZK({player:this.player_,sourceKeySystems:this.source_.keySystems,media:this.playlists.media(),audioMedia:e&&e.media()});if(this.player_.tech_.on("keystatuschange",n=>{this.playlistController_.updatePlaylistByKeyStatus(n.keyId,n.status)}),this.handleWaitingForKey_=this.handleWaitingForKey_.bind(this),this.player_.tech_.on("waitingforkey",this.handleWaitingForKey_),!i){this.playlistController_.sourceUpdater_.initializedEme();return}this.createKeySessions_()}setupQualityLevels_(){const e=Ve.players[this.tech_.options_.playerId];!e||!e.qualityLevels||this.qualityLevels_||(this.qualityLevels_=e.qualityLevels(),this.playlistController_.on("selectedinitialmedia",()=>{GK(this.qualityLevels_,this)}),this.playlists.on("mediachange",()=>{MI(this.qualityLevels_,this.playlists)}))}static version(){return{"@videojs/http-streaming":OI,"mux.js":VK,"mpd-parser":jK,"m3u8-parser":WK,"aes-decrypter":qK}}version(){return this.constructor.version()}canChangeType(){return wI.canChangeType()}play(){this.playlistController_.play()}setCurrentTime(e){this.playlistController_.setCurrentTime(e)}duration(){return this.playlistController_.duration()}seekable(){return this.playlistController_.seekable()}dispose(){this.playbackWatcher_&&this.playbackWatcher_.dispose(),this.playlistController_&&this.playlistController_.dispose(),this.qualityLevels_&&this.qualityLevels_.dispose(),this.tech_&&this.tech_.vhs&&delete this.tech_.vhs,this.mediaSourceUrl_&&_e.URL.revokeObjectURL&&(_e.URL.revokeObjectURL(this.mediaSourceUrl_),this.mediaSourceUrl_=null),this.tech_&&this.tech_.off("waitingforkey",this.handleWaitingForKey_),super.dispose()}convertToProgramTime(e,i){return rG({playlist:this.playlistController_.media(),time:e,callback:i})}seekToProgramTime(e,i,n=!0,r=2){return Kk({programTime:e,playlist:this.playlistController_.media(),retryCount:r,pauseAfterSeek:n,seekTo:this.options_.seekTo,tech:this.options_.tech,callback:i})}setupXhrHooks_(){this.xhr.onRequest=e=>{NI(this.xhr,e)},this.xhr.onResponse=e=>{BI(this.xhr,e)},this.xhr.offRequest=e=>{HI(this.xhr,e)},this.xhr.offResponse=e=>{UI(this.xhr,e)},this.player_.trigger("xhr-hooks-ready")}attachStreamingEventListeners_(){const e=["seekablerangeschanged","bufferedrangeschanged","contentsteeringloadstart","contentsteeringloadcomplete","contentsteeringparsed"],i=["gapjumped","playedrangeschanged"];e.forEach(n=>{this.playlistController_.on(n,r=>{this.player_.trigger(Wn({},r))})}),i.forEach(n=>{this.playbackWatcher_.on(n,r=>{this.player_.trigger(Wn({},r))})})}}const l0={name:"videojs-http-streaming",VERSION:OI,canHandleSource(t,e={}){const i=Ji(Ve.options,e);return!i.vhs.experimentalUseMMS&&!mp("avc1.4d400d,mp4a.40.2",!1)?!1:l0.canPlayType(t.type,i)},handleSource(t,e,i={}){const n=Ji(Ve.options,i);return e.vhs=new zI(t,e,n),e.vhs.xhr=Vk(),e.vhs.setupXhrHooks_(),e.vhs.src(t.src,t.type),e.vhs},canPlayType(t,e){const i=g2(t);if(!i)return"";const n=l0.getOverrideNative(e);return!Hn.supportsTypeNatively(i)||n?"maybe":""},getOverrideNative(t={}){const{vhs:e={}}=t,i=!(Ve.browser.IS_ANY_SAFARI||Ve.browser.IS_IOS),{overrideNative:n=i}=e;return n}};mp("avc1.4d400d,mp4a.40.2",!0)&&Ve.getTech("Html5").registerSourceHandler(l0,0),Ve.VhsHandler=zI,Ve.VhsSourceHandler=l0,Ve.Vhs=Hn,Ve.use||Ve.registerComponent("Vhs",Hn),Ve.options.vhs=Ve.options.vhs||{},(!Ve.getPlugin||!Ve.getPlugin("reloadSourceOnError"))&&Ve.registerPlugin("reloadSourceOnError",zK);const eY={name:"VideoPlayer",props:{options:{type:Object,default(){return{}}},fitHeight:{type:Boolean,default:!1}},data(){return{player:null}},mounted(){this.player=Ve(this.$refs.videoPlayer,this.options)},beforeDestroy(){this.player&&this.player.dispose()}};function tY(t,e,i,n,r,s){return X(),se("div",{class:Tt({"h-full":i.fitHeight})},[Se("video",{ref:"videoPlayer",class:Tt(["video-js w-full text-xl",{"h-full":i.fitHeight}])},null,2)],2)}const VI=ma(eY,[["render",tY]]),iY={name:"AudioViewer",components:{VideoPlayer:VI},props:{source:{type:String,required:!0},format:{type:String,required:!0}}},nY={class:"w-full h-full bg-gray-900 flex flex-column justify-content-end",style:{"overflow-y":"auto"}},rY={class:"p-3"};function sY(t,e,i,n,r,s){const o=Mt("VideoPlayer");return X(),se("div",nY,[e[0]||(e[0]=Se("div",{class:"flex-grow-1 text-color-secondary flex flex-column justify-content-center align-items-center"},[Se("i",{class:"pi pi-volume-up",style:{"font-size":"7rem"}})],-1)),Se("div",rY,[xt(o,{options:{controls:!0,audioOnlyMode:!0,sources:[{src:i.source,type:i.format}]}},null,8,["options"])])])}const oY=ma(iY,[["render",sY]]),aY={name:"VideoViewer",components:{VideoPlayer:VI},props:{source:{type:String,required:!0},format:{type:String,required:!0}}},lY={class:"w-full h-full bg-gray-900 flex flex-column justify-content-end",style:{"overflow-y":"auto"}},uY={class:"p-3 flex-grow-1"};function cY(t,e,i,n,r,s){const o=Mt("VideoPlayer");return X(),se("div",lY,[Se("div",uY,[xt(o,{"fit-height":!0,options:{controls:!0,responsive:!0,sources:[{src:i.source,type:i.format}]}},null,8,["options"])])])}const dY=ma(aY,[["render",cY]]);var sT={name:"Panel",emits:["update:collapsed","toggle"],props:{header:String,toggleable:Boolean,collapsed:Boolean,toggleButtonProps:{type:null,default:null}},data(){return{d_collapsed:this.collapsed}},watch:{collapsed(t){this.d_collapsed=t}},methods:{toggle(t){this.d_collapsed=!this.d_collapsed,this.$emit("update:collapsed",this.d_collapsed),this.$emit("toggle",{originalEvent:t,value:this.d_collapsed})},onKeyDown(t){(t.code==="Enter"||t.code==="Space")&&(this.toggle(t),t.preventDefault())}},computed:{ariaId(){return ks()},containerClass(){return["p-panel p-component",{"p-panel-toggleable":this.toggleable}]},buttonAriaLabel(){return this.toggleButtonProps&&this.toggleButtonProps["aria-label"]?this.toggleButtonProps["aria-label"]:this.header}},directives:{ripple:Rs}};const hY={class:"p-panel-header"},fY=["id"],pY={class:"p-panel-icons"},mY=["id","aria-label","aria-controls","aria-expanded"],gY=["id","aria-labelledby"],yY={class:"p-panel-content"};function vY(t,e,i,n,r,s){const o=Yr("ripple");return X(),se("div",{class:Tt(s.containerClass)},[Se("div",hY,[pi(t.$slots,"header",{},()=>[i.header?(X(),se("span",{key:0,id:s.ariaId+"_header",class:"p-panel-title"},it(i.header),9,fY)):Be("",!0)]),Se("div",pY,[pi(t.$slots,"icons"),i.toggleable?dn((X(),se("button",Qi({key:0,id:s.ariaId+"_header",type:"button",role:"button",class:"p-panel-header-icon p-panel-toggler p-link","aria-label":s.buttonAriaLabel,"aria-controls":s.ariaId+"_content","aria-expanded":!r.d_collapsed,onClick:e[0]||(e[0]=(...u)=>s.toggle&&s.toggle(...u)),onKeydown:e[1]||(e[1]=(...u)=>s.onKeyDown&&s.onKeyDown(...u))},i.toggleButtonProps),[Se("span",{class:Tt({"pi pi-minus":!r.d_collapsed,"pi pi-plus":r.d_collapsed})},null,2)],16,mY)),[[o]]):Be("",!0)])]),xt(sl,{name:"p-toggleable-content"},{default:Vt(()=>[dn(Se("div",{id:s.ariaId+"_content",class:"p-toggleable-content",role:"region","aria-labelledby":s.ariaId+"_header"},[Se("div",yY,[pi(t.$slots,"default")])],8,gY),[[hb,!r.d_collapsed]])]),_:3})],2)}function bY(t,e){e===void 0&&(e={});var i=e.insertAt;if(!(typeof document>"u")){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",i==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}}var _Y=` .p-panel-header { display: flex; justify-content: space-between; align-items: center; } .p-panel-title { line-height: 1; } .p-panel-header-icon { display: inline-flex; justify-content: center; align-items: center; cursor: pointer; text-decoration: none; overflow: hidden; position: relative; } `;bY(_Y),sT.render=vY;const ka=class ka{constructor(e){Gr(this,wh);_v(this,"data");this.data=e}getID(){return this.data.id?this.data.id:null}getType(){return this.data.type?this.data.type:null}getPrefLabel(e=null){return this.data.label?ka.displayLangPropertyAuto(this.data.label,e):null}getSummary(e=null){return this.data.summary?ka.displayLangPropertyAuto(this.data.summary,e):null}getRequiredStatement(e=null){return this.data.requiredStatement&&this.data.requiredStatement.label&&this.data.requiredStatement.value?{label:ka.displayLangPropertyAuto(this.data.requiredStatement.label,e),value:ka.displayLangPropertyAuto(this.data.requiredStatement.value,e)}:null}getRights(){return this.data.rights?this.data.rights:null}getMetadata(e=null){const i=[];if(this.data.metadata)for(const n of this.data.metadata){const r=ka.displayLangPropertyAuto(n.label,e),s=ka.displayLangPropertyAuto(n.value,e);i.push({label:r,value:s})}return i.length>0?i:null}getMetadataValue(e,i=!0){if(this.data.metadata)for(const n of this.data.metadata){const r=n.label;let s=null;for(const o in r)if(r[o].indexOf(e)>=0){s=o;break}if(s)if(i){if(n.value[s])return n.value[s].join("; ")}else return ka.displayLangPropertyCombined(n.value)}return null}getThumbnail(e=80){return this.getImagePropertyValue("thumbnail",e)}getImagePropertyValue(e,i=80){if(this.data[e])for(const n of this.data[e]){const r=Eo.create(n);if(r instanceof oT)return r.isIIIF()?`${r.getIIIFUrl()}/full/${i},/0/default.jpg`:r.getUrl()}return null}getRendering(e=null){return dr(this,wh,wv).call(this,"rendering","Alternative Representation",e)}getHomePage(e=null){return dr(this,wh,wv).call(this,"homepage","Homepage",e)}getSeeAlsoLinks(e=null){return dr(this,wh,wv).call(this,"seeAlso","See Also",e)}getProvider(){return this.data.provider?this.data.provider:null}getLanguages(){const e=[];if(this.data.label&&e.push(Object.keys(this.data.label)),this.data.summary&&e.push(Object.keys(this.data.summary)),this.data.requiredStatement&&(this.data.requiredStatement.label&&e.push(Object.keys(this.data.requiredStatement.label)),this.data.requiredStatement.value&&e.push(Object.keys(this.data.requiredStatement.value))),this.data.metadata)for(const r of this.data.metadata)r.label&&e.push(Object.keys(r.label)),r.value&&e.push(Object.keys(r.value));if(this.data.rendering)for(const r of this.data.rendering)r.label&&e.push(Object.keys(r.label));if(this.data.homepage)for(const r of this.data.homepage)r.label&&e.push(Object.keys(r.label));if(this.data.seeAlso)for(const r of this.data.seeAlso)r.label&&e.push(Object.keys(r.label));const i=[...new Set([].concat(...e))],n=[];for(const r of i){let s=dl.getLanguageName(r);s&&n.push({code:r,name:s})}return n}getData(){return this.data}static displayLangProperty(e,i){return e[i]?e[i].join("; "):null}static displayLangPropertyCombined(e,i=!0){const n=[];for(const r in e){let s=dl.getLanguageName(r);s||(s="Unknown Language");let o=i?`(${s}) `:"";o+=e[r].join("; "),n.push(o)}return n}static displayLangPropertyAuto(e,i=null){const n=[];i&&n.push(i),n.indexOf("en")<0&&n.push("en"),n.indexOf("none")<0&&n.push("none");for(const r of n){const s=this.displayLangProperty(e,r);if(s)return s}return this.displayLangProperty(e,Object.keys(e)[0])}};wh=new WeakSet,wv=function(e,i,n=null){if(this.data[e]){const r=[];for(const s of this.data[e]){let o=null;s.label&&(o=ka.displayLangPropertyAuto(s.label,n));const u={label:o??i,value:s.id};s.format&&(u.format=s.format),s.type&&(u.type=s.type),r.push(u)}return r}return null};let io=ka;class oT extends io{getUrl(){return this.getID()}getFormat(){return this.data.format?this.data.format:null}getWidth(){return this.data.width?this.data.width:null}getHeight(){return this.data.height?this.data.height:null}getService(){return this.data.service?this.data.service:null}getIIIFUrl(){if(this.getService()){const e=this.getService()[0];if(e["@context"]==="http://iiif.io/api/image/2/context.json"||e["@context"]==="https://iiif.io/api/image/2/context.json"||e.type==="ImageService2"||e["@type"]==="ImageService2"||e.type==="ImageService3"||e["@type"]==="ImageService3"){if(typeof e.id<"u")return e.id;if(typeof e["@id"]<"u")return e["@id"]}}return null}getServiceType(){if(this.getService()){const e=this.getService()[0];return e.type?e.type:e["@type"]}return null}getServiceProfile(){if(this.getService()){const e=this.getService()[0];return e.profile?e.profile:null}return null}isLevel0(){return this.getServiceProfile()==="http://iiif.io/api/image/2/level0.json"||this.getServiceProfile()==="level0"}isIIIF(){return!!this.getIIIFUrl()}}class aT extends io{getUrl(){return this.getID()}getFormat(){return this.data.format?this.data.format:null}getDuration(){return this.data.duration?this.data.duration:null}}class jI extends aT{getWidth(){return this.data.width?this.data.width:null}getHeight(){return this.data.height?this.data.height:null}}class wY extends io{constructor(){super(...arguments);Gr(this,Tu)}getCanvases(i=null){const n=[];return Array.isArray(this.data.items)&&this.data.items.forEach(r=>{if(r.type==="Canvas"){const s=Eo.create(r),o={id:r.id,parser:s};typeof r.label<"u"&&(o.label=io.displayLangPropertyAuto(r.label,i)),typeof r.summary<"u"&&(o.description=io.displayLangPropertyAuto(r.summary,i));const u=this.getCanvasImage(r);u&&(u.type==="audio"?o.audio=u:u.type==="video"?o.video=u:o.image=u);const h=this.getCanvasThumbnail(r);h&&(o.thumbnail=h);const p=this.getCanvasAnnotations(r);p.length>0&&(o.annotations=p),n.push(o)}}),n}getCanvasImage(i){let n=null;return Array.isArray(i.items)&&i.items.forEach(r=>{r.type==="AnnotationPage"&&Array.isArray(r.items)&&r.items.forEach(s=>{if(s.type==="Annotation"&&s.motivation.toLowerCase()==="painting"&&typeof s.body<"u"){const o=Eo.create(s.body);if(o instanceof oT)o.isIIIF()?n={type:"iiif",isLevel0:o.isLevel0(),url:decodeURI(o.getIIIFUrl())}:n={type:"image",url:decodeURI(s.body.id)};else if(o instanceof jI)n={type:"video",format:o.getFormat(),url:decodeURI(o.getUrl()),width:o.getWidth(),height:o.getHeight()};else if(o instanceof aT)n={type:"audio",format:o.getFormat(),url:decodeURI(o.getUrl())};else if(o instanceof WI){const u=o.getSource();if(u&&u.type==="Image"){const h=Eo.create(u);let p=h.getIIIFUrl(),g;if(p){g=p;const y={region:"full",size:"max",rotation:0,quality:"default",format:"jpg"},S=o.getSelector();if(S&&S.type==="iiif:ImageApiSelector")for(const P in y)typeof S[P]<"u"&&(y[P]=S[P]);g+=`/${y.region}/${y.size}/${y.rotation}/${y.quality}.${y.format}`}else g=h.getUrl();n={type:"image",url:decodeURI(g)}}}}})}),n}getCanvasThumbnail(i){const r=Eo.create(i).getThumbnail();if(r)return decodeURI(r);const s=this.getCanvasImage(i);if(s!==null){if(s.type==="iiif")return s.isLevel0?`${decodeURI(s.url)}/full/max/0/default.jpg`:`${decodeURI(s.url)}/full/80,/0/default.jpg`;if(s.type==="image")return decodeURI(s.url)}return null}getCanvasAnnotations(i){const n=[];if(Array.isArray(i.annotations)){for(const r of i.annotations)if(r.type==="AnnotationPage"){const o=Eo.create(r).getMetadataValue("Identifier");if(Array.isArray(r.items)){for(const u of r.items)if(u.type==="Annotation"){const h={id:u.id,target:this.getAnnotationTarget(u),group:o||r.id,data:u};u.body&&(h.fields=this.createAnnotationFieldsData(u.body,u.motivation)),n.push(h)}}}}return n}getAnnotationTarget(i){var n;if(i.target){const r=i.target;if(r.type==="SpecificResource"){if(r.selector){const s=r.selector;if(s.type==="PointSelector")return{source:r.source,selector:{type:"FragmentSelector",conformsTo:"http://www.w3.org/TR/media-frags/",value:`xywh=pixel:${s.x},${s.y},0,0`},renderedVia:{name:"point"}};if(s.type==="FragmentSelector")return s.value.startsWith("xywh=")&&!s.value.startsWith("xywh=pixel:")&&(s.value=s.value.replace(/^xywh=/,"xywh=pixel:")),s.conformsTo="http://www.w3.org/TR/media-frags/",r}}else if(typeof r=="string"){const s=/#xywh=(\d+,\d+,\d+,\d+)$/i,o=r.match(s);return o?{source:r.replace(s,""),selector:{type:"FragmentSelector",conformsTo:"http://www.w3.org/TR/media-frags/",value:`xywh=pixel:${o[1]}`}}:{source:r}}return((n=r.selector)==null?void 0:n.type)==="SvgSelector"&&(r.selector.value=r.selector.value.replace(/<\/?g[^>]*>/g,""),r.selector.value=r.selector.value.replace(/]*>/g,""),r.selector.value=r.selector.value.replace(/(]+d=['"])([^>]+)(['"])/g,(s,o,u,h)=>o+u.replace(/,/g," ")+h)),r}return null}createAnnotationFieldsData(i,n=null){typeof i=="object"&&!Array.isArray(i)&&(i=[i]);const r={};let s=null;for(const o of i)if(o.type==="TextualBody"){let u=n;o.purpose&&(u=o.purpose);const h=dr(this,Tu,$M).call(this,o.value,u),p=o.language||"none";h.label==="Comment"&&(h.value={value:h.value},o.format&&(h.value.format=o.format)),typeof r[h.label]>"u"&&(r[h.label]={}),typeof r[h.label][p]>"u"&&(r[h.label][p]=[]),r[h.label][p].push(h.value)}else if(o.type==="Image"){typeof r.Comment>"u"&&(r.Comment={}),typeof r.Comment.none>"u"&&(r.Comment.none=[]);const u=Eo.create(o);r.Comment.none.push({value:`Annotation Image`,format:"text/html"})}else o.type==="SpecificResource"&&n.toLowerCase()==="tagging"&&o.source&&ds.isURL(o.source)&&(s=o.source);if(s&&r.Tag)for(const o in r.Tag)for(const u of r.Tag[o])u.data||(u.data={}),u.data.link=s;return r}getAnnotationSets(i=null){const n=[];return Array.isArray(this.data.items)&&this.data.items.forEach(r=>{r.type==="Canvas"&&Array.isArray(r.annotations)&&r.annotations.forEach(s=>{if(s.type==="AnnotationPage"){const o=Eo.create(s),u={},h=o.getMetadataValue("Identifier");if(u.id=h||s.id,n.find(y=>y.id===u.id))return;typeof s.label<"u"&&(u.label=io.displayLangPropertyAuto(s.label,i)),typeof s.summary<"u"&&(u.description=io.displayLangPropertyAuto(s.summary,i));const g=o.getMetadataValue("Creator");g&&(u.creator=g),n.push(u)}})}),n}getStartCanvas(){if(this.data.start){if(this.data.start.type==="Canvas")return this.data.start.id;if(this.data.start.type==="SpecificResource"&&this.data.start.source)return this.data.start.source}return null}getStructures(){return this.data.structures?this.data.structures:null}getLanguages(){const i=[super.getLanguages()];this.getCanvases().forEach(s=>{i.push(s.parser.getLanguages()),s.annotations&&s.annotations.forEach(o=>{if(o.fields)for(const u in o.fields){const h=Object.keys(o.fields[u]),p=[];for(const g of h){let y=dl.getLanguageName(g);y&&p.push({code:g,name:y})}i.push(p)}})});const n=this.getStructures();if(n){const s=[];dR.structureTraverse(n,o=>{o.label&&Object.keys(o.label).forEach(h=>{let p=dl.getLanguageName(h);p&&s.push({code:h,name:p})})}),i.push(s)}const r={};return i.forEach(s=>{s.forEach(o=>{r[o.code]=o})}),Object.values(r)}}Tu=new WeakSet,$M=function(i,n=null){const r={label:"Comment",value:i},s=i.match(/^([^:]+):(.*)$/s);if(s){const o=s[1].trim();if(o==="Title"||o==="Description"||o==="Note"||o==="Attribution"||o==="Date"||o==="Line Color"||o==="Line Weight")r.label=o,r.value=s[2].trim();else if(o==="Link")r.label=o,r.value=dr(this,Tu,Tv).call(this,s[2].trim());else if(o==="Tag"){r.label=o;const u={},h=i.split(` `);for(const p of h){const g=p.match(/^([^:]+):(.*)$/);if(g){const y=g[1].trim(),S=g[2].trim();if(y==="Tag"){const P=dr(this,Tu,Tv).call(this,S);u.term_id=P.url,u.term_label=P.text}else if(y==="Vocabulary"){const P=dr(this,Tu,Tv).call(this,S);u.vocabulary_id=P.url,u.vocabulary_name=P.text}else y==="Data"&&(u.data=JSON.parse(S))}}r.value=u}}else n==="tagging"&&(r.label="Tag",r.value={term_id:ds.generateUUID(),term_label:i});return r},Tv=function(i){const n=i.match(/^\[(.*)\]\((.*)\)$/);return n?{text:n[1],url:n[2]}:{text:i,url:i}};class WI extends io{getSource(){return this.data.source?this.data.source:null}getSelector(){return this.data.selector?this.data.selector:null}}class TY extends io{getLogo(e=80){return this.getImagePropertyValue("logo",e)}}class qI extends io{getItems(){return this.data.items?this.data.items:null}}class Eo{static create(e){switch(e.type){case"Manifest":return new wY(e);case"Image":return new oT(e);case"Sound":return new aT(e);case"Video":return new jI(e);case"SpecificResource":return new WI(e);case"Agent":return new TY(e);case"Collection":return new qI(e);default:return new io(e)}}}var xY="http://library.stanford.edu/iiif/image-api/compliance.html#level0",SY="http://library.stanford.edu/iiif/image-api/compliance.html#level1",GI="http://library.stanford.edu/iiif/image-api/compliance.html#level2",EY="http://library.stanford.edu/iiif/image-api/conformance.html#level0",CY="http://library.stanford.edu/iiif/image-api/conformance.html#level1",KI="http://library.stanford.edu/iiif/image-api/conformance.html#level2",AY="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",DY="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",YI="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",PY="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",kY="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",XI="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",IY="http://iiif.io/api/image/1/level0.json",RY="http://iiif.io/api/image/1/profiles/level0.json",OY="http://iiif.io/api/image/1/level1.json",LY="http://iiif.io/api/image/1/profiles/level1.json",ZI="http://iiif.io/api/image/1/level2.json",QI="http://iiif.io/api/image/1/profiles/level2.json",MY="http://iiif.io/api/image/2/level0.json",FY="http://iiif.io/api/image/2/profiles/level0.json",NY="http://iiif.io/api/image/2/level1.json",BY="http://iiif.io/api/image/2/profiles/level1.json",JI="http://iiif.io/api/image/2/level2.json",$I="http://iiif.io/api/image/2/profiles/level2.json",HY="level0",UY="level1",eR="level2",zY="http://iiif.io/api/image/2/level0",VY="http://iiif.io/api/image/2/level1",tR="http://iiif.io/api/image/2/level2",jY=[tR,GI,KI,YI,XI,ZI,QI,JI,$I,eR],WY=[zY,VY,tR,xY,SY,GI,EY,CY,KI,AY,DY,YI,PY,kY,XI,IY,RY,OY,LY,ZI,QI,MY,FY,NY,BY,JI,$I,HY,UY,eR],qY=WY;function Pa(t){for(let e in t)(typeof t[e]>"u"||t[e]===null)&&delete t[e];return t}function GY(t){return Array.isArray(t)?t:t?[t]:[]}var KY=Object.defineProperty,YY=(t,e,i)=>e in t?KY(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,iR=(t,e,i)=>(YY(t,typeof e!="symbol"?e+"":e,i),i),nR=["sc:Collection","sc:Manifest","sc:Canvas","sc:AnnotationList","oa:Annotation","sc:Range","sc:Layer","sc:Sequence","oa:Choice","Service","ContentResource"];function XY(t){if(typeof t>"u"||t===null)throw new Error("Null or undefined is not a valid entity.");if(Array.isArray(t))throw new Error("Array is not a valid entity");if(typeof t!="object")throw new Error(`${typeof t} is not a valid entity`);if(typeof t["@type"]=="string"){let e=nR.indexOf(t["@type"]);if(e!==-1)return nR[e]}if(t.profile)return"Service";if(t.format||t["@type"])return"ContentResource";throw new Error("Resource type is not known")}var ZY=class eF{constructor(e,i={}){iR(this,"traversals"),iR(this,"options"),this.traversals={collection:[],manifest:[],canvas:[],annotationList:[],sequence:[],annotation:[],contentResource:[],choice:[],range:[],service:[],layer:[],...e},this.options={convertPropsToArray:!0,mergeMemberProperties:!0,allowUndefinedReturn:!1,...i}}static all(e){return new eF({collection:[e],manifest:[e],canvas:[e],annotationList:[e],sequence:[e],annotation:[e],contentResource:[e],choice:[e],range:[e],service:[e],layer:[e]})}traverseCollection(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCollectionItems(e))),this.traversals.collection)}traverseCollectionItems(e){if(this.options.mergeMemberProperties){let i=[...(e.manifests||[]).map(n=>typeof n=="string"?{"@id":n,"@type":"sc:Manifest"}:n),...(e.collections||[]).map(n=>typeof n=="string"?{"@id":n,"@type":"sc:Collection"}:n),...e.members||[]];delete e.collections,delete e.manifests,e.members=i}return e.manifests&&(e.manifests=e.manifests.map(i=>this.traverseManifest(typeof i=="string"?{"@id":i,"@type":"sc:Manifest"}:i))),e.collections&&(e.collections=e.collections.map(i=>this.traverseCollection(typeof i=="string"?{"@id":i,"@type":"sc:Collection"}:i))),e.members&&(e.members=e.members.map(i=>typeof i=="string"?i:this.traverseUnknown(i))),e}traverseManifest(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseManifestItems(e))),this.traversals.manifest)}traverseManifestItems(e){return e.sequences&&(e.sequences=e.sequences.map(i=>this.traverseSequence(i))),e.structures&&(e.structures=e.structures.map(i=>this.traverseRange(i))),e}traverseSequence(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseSequenceItems(e))),this.traversals.sequence)}traverseSequenceItems(e){return e.canvases&&(e.canvases=e.canvases.map(i=>this.traverseCanvas(i))),e}traverseCanvas(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCanvasItems(e))),this.traversals.canvas)}traverseCanvasItems(e){return e.images&&(e.images=e.images.map(i=>this.traverseAnnotation(i))),e.otherContent&&(e.otherContent=e.otherContent.map(i=>this.traverseAnnotationList(i))),e}traverseRange(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseRangeItems(e))),this.traversals.range)}traverseRangeItems(e){if(this.options.mergeMemberProperties){let i=[...(e.ranges||[]).map(n=>typeof n=="string"?{"@id":n,"@type":"sc:Range"}:n),...(e.canvases||[]).map(n=>typeof n=="string"?{"@id":n,"@type":"sc:Canvas"}:n),...e.members||[]];delete e.ranges,delete e.canvases,e.members=i.length?i.map(n=>this.traverseUnknown(n)):void 0}return e}traverseAnnotationList(e){let i=typeof e=="string"?{"@id":e,"@type":"sc:AnnotationList"}:e;return this.traverseType(this.traverseDescriptive(this.traverseAnnotationListItems(i)),this.traversals.annotationList)}traverseAnnotationListItems(e){return e.resources&&(e.resources=e.resources.map(i=>this.traverseAnnotation(i))),e}traverseAnnotation(e){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseAnnotationItems(e))),this.traversals.annotation)}traverseAnnotationItems(e){return e.resource&&(Array.isArray(e.resource)?e.resource=e.resource.map(i=>this.traverseContentResource(i)):e.resource=this.traverseContentResource(e.resource)),e.on,e}traverseLayer(e){return this.traverseType(this.traverseLinking(this.traverseLayerItems(e)),this.traversals.layer)}traverseLayerItems(e){return e.otherContent&&(e.otherContent=e.otherContent.map(i=>this.traverseAnnotationList(i))),e}traverseChoice(e){return this.traverseType(this.traverseChoiceItems(e),this.traversals.choice)}traverseChoiceItems(e){return e.default&&e.default!=="rdf:nil"&&(e.default=this.traverseContentResource(e.default)),e.item&&e.item!=="rdf:nil"&&(e.item=e.item.map(i=>this.traverseContentResource(i))),e}traverseService(e){return this.traverseType(this.traverseLinking(e),this.traversals.service)}traverseContentResource(e){return e["@type"]==="oa:Choice"?this.traverseChoice(e):this.traverseType(this.traverseDescriptive(this.traverseLinking(e)),this.traversals.contentResource)}traverseUnknown(e){if(!e["@type"]||typeof e=="string")return e;switch(XY(e)){case"sc:Collection":return this.traverseCollection(e);case"sc:Manifest":return this.traverseManifest(e);case"sc:Canvas":return this.traverseCanvas(e);case"sc:Sequence":return this.traverseSequence(e);case"sc:Range":return this.traverseRange(e);case"oa:Annotation":return this.traverseAnnotation(e);case"sc:AnnotationList":return this.traverseAnnotationList(e);case"sc:Layer":return this.traverseLayer(e);case"Service":return this.traverseService(e);case"oa:Choice":return this.traverseChoice(e);case"ContentResource":return this.traverseContentResource(e)}return e.profile?this.traverseService(e):e}traverseImageResource(e){let i=Array.isArray(e),n=Array.isArray(e)?e:[e],r=[];for(let s of n)typeof s=="string"?r.push(this.traverseContentResource({"@id":s,"@type":"dctypes:Image"})):r.push(this.traverseContentResource(s));return!i&&!this.options.convertPropsToArray?r[0]:r}traverseDescriptive(e){return e.thumbnail&&(e.thumbnail=this.traverseImageResource(e.thumbnail)),e.logo&&(e.logo=this.traverseImageResource(e.logo)),e}traverseOneOrMoreServices(e){let i=Array.isArray(e),n=Array.isArray(e)?e:[e],r=[];for(let s of n)r.push(this.traverseService(s));return!i&&!this.options.convertPropsToArray?r[0]:r}traverseLinking(e){return e.related&&(e.related=this.traverseOneOrManyType(e.related,this.traversals.contentResource)),e.rendering&&(e.rendering=this.traverseOneOrManyType(e.rendering,this.traversals.contentResource)),e.service&&(e.service=this.traverseOneOrMoreServices(e.service)),e.seeAlso&&(e.seeAlso=this.traverseOneOrManyType(e.seeAlso,this.traversals.contentResource)),e.within&&(typeof e.within=="string"||(e.within=this.traverseOneOrManyType(e.within,this.traversals.contentResource))),e.startCanvas&&(typeof e.startCanvas=="string"?e.startCanvas=this.traverseType({"@id":e.startCanvas,"@type":"sc:Canvas"},this.traversals.canvas):e.startCanvas&&this.traverseType(e.startCanvas,this.traversals.canvas)),e.contentLayer&&(typeof e.contentLayer=="string"?e.contentLayer=this.traverseLayer({"@id":e.contentLayer,"@type":"sc:Layer"}):e.contentLayer=this.traverseLayer(e.contentLayer)),e}traverseOneOrManyType(e,i){if(!Array.isArray(e))if(this.options.convertPropsToArray)e=[e];else return this.traverseType(e,i);return e.map(n=>this.traverseType(n,i))}traverseType(e,i){return i.reduce((n,r)=>{let s=r(n);return typeof s>"u"&&!this.options.allowUndefinedReturn?n:s},e)}},QY="http://library.stanford.edu/iiif/image-api/compliance.html#level1",JY="http://library.stanford.edu/iiif/image-api/compliance.html#level2",$Y="http://library.stanford.edu/iiif/image-api/conformance.html#level1",eX="http://library.stanford.edu/iiif/image-api/conformance.html#level2",tX="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",iX="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",nX="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",rX="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",sX="http://iiif.io/api/image/1/level1.json",oX="http://iiif.io/api/image/1/profiles/level1.json",aX="http://iiif.io/api/image/1/level2.json",lX="http://iiif.io/api/image/1/profiles/level2.json",uX="http://iiif.io/api/image/2/level1.json",cX="http://iiif.io/api/image/2/profiles/level1.json",dX="http://iiif.io/api/image/2/level2.json",hX="http://iiif.io/api/image/2/profiles/level2.json",fX="level1",pX="level2",mX="http://iiif.io/api/image/2/level1",gX="http://iiif.io/api/image/2/level2",yX=[mX,gX,QY,JY,$Y,eX,tX,iX,nX,rX,sX,oX,aX,lX,uX,cX,dX,hX,fX,pX],lT={attributionLabel:"Attribution",providerId:"http://example.org/provider",providerName:"Unknown"};function vX(t){if(typeof t=="string")return[t];if(!t)return[];let e=Array.isArray(t)?t:[t],i=[];for(let n of e){if(typeof n=="string"){i.push(n);continue}i.push({"@language":n["@language"]||n.language,"@value":n["@value"]||n.value})}return i}function Dc(t,e="none"){if(!t)return{none:[""]};let i=vX(t),n={};for(let r of i){if(typeof r=="string"){n[e]=n[e]?n[e]:[],n[e].push(r||"");continue}if(!r["@language"]){n[e]=n[e]?n[e]:[],n[e].push(r["@value"]||"");continue}let s=r["@language"];n[s]=n[s]?n[s]:[],n[s].push(r["@value"]||"")}return Object.keys(n).length===0?{none:[""]}:n}function rR(t){if(Array.isArray(t))return rR(t.find(e=>typeof e=="string"));if(jY.indexOf(t)!==-1)return"level2";if(yX.indexOf(t)!==-1)return"level1";if(qY.indexOf(t)!==-1)return"level0";if(typeof t=="string")return t}function bX(t){let e=Array.isArray(t)?t:[t];for(let i of e)switch(i){case"http://iiif.io/api/image/2/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2":return"ImageService2";case"http://iiif.io/api/image/1/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/context.json":return"ImageService1";case"http://iiif.io/api/annex/openannotation/context.json":return"ImageApiSelector"}}function _X(t){switch(t){case"http://iiif.io/api/image/2/level0.json":case"http://iiif.io/api/image/2/level1.json":case"http://iiif.io/api/image/2/level2.json":return"ImageService2";case"http://iiif.io/api/auth/1/kiosk":case"http://iiif.io/api/auth/1/login":case"http://iiif.io/api/auth/1/clickthrough":case"http://iiif.io/api/auth/1/external":case"http://iiif.io/api/auth/0/kiosk":case"http://iiif.io/api/auth/0/login":case"http://iiif.io/api/auth/0/clickthrough":case"http://iiif.io/api/auth/0/external":return"AuthCookieService1";case"http://iiif.io/api/auth/1/token":case"http://iiif.io/api/auth/0/token":return"AuthTokenService1";case"http://iiif.io/api/auth/1/logout":case"http://iiif.io/api/auth/0/logout":return"AuthLogoutService1";case"http://iiif.io/api/search/1/search":case"http://iiif.io/api/search/0/search":return"SearchService1";case"http://iiif.io/api/search/1/autocomplete":case"http://iiif.io/api/search/0/autocomplete":return"AutoCompleteService1"}}function sR(t){for(let e of["sc","oa","dcterms","dctypes","iiif"])if(t.startsWith(`${e}:`))return t.slice(e.length+1);return t}var wX=["Collection","Manifest","Annotation","AnnotationPage","Range","Service"];function uT(t){let e=t["@id"]||t.id,i=t["@type"]||t.type,n=t.profile||void 0,r=t["@context"]||void 0;if(n){let s=_X(n);if(s)return s}if(r){let s=bX(r);if(s)return s}if(i){if(Array.isArray(i)){if(i.indexOf("oa:CssStylesheet")!==-1)return"CssStylesheet";if(i.indexOf("cnt:ContentAsText")!==-1)return"TextualBody";i=i[0]}for(let s of["sc","oa","dcterms","dctypes","iiif"])if(i.startsWith(`${s}:`)){i=i.slice(s.length+1);break}switch(i){case"Layer":return"AnnotationCollection";case"AnnotationList":return"AnnotationPage";case"cnt:ContentAsText":return"TextualBody"}}if(i&&wX.indexOf(i)!==-1)return i;if(t.format){if(t.format.startsWith("image/"))return"Image";if(t.format.startsWith("text/")||t.format==="application/pdf")return"Text";if(t.format.startsWith("application/"))return"Dataset"}return e&&(e.endsWith(".jpg")||e.endsWith(".png")||e.endsWith(".jpeg"))?"Image":i||"unknown"}var TX=/http(s)?:\/\/(creativecommons.org|rightsstatements.org)[^"'\\<\n]+/gm;function xX(t){let e=t.match(TX);return e?e[0]:t}function SX(t,e="Rights/License",i="none"){let n=null,r=[],s=Array.isArray(t)?t:[t];for(let o of s){let u=o?xX(o):void 0;if(u&&(u.indexOf("creativecommons.org")!==-1||u.indexOf("rightsstatements.org")!==-1)){u.startsWith("https://")?n=`http://${u.slice(8)}`:n=u;continue}u&&r.push({label:{[i]:[e]},value:{[i]:[u]}})}return[n,r]}var EX=["http://iiif.io/api/presentation/2/context.json","http://iiif.io/api/image/2/context.json","http://iiif.io/api/image/1/context.json","http://library.stanford.edu/iiif/image-api/1.1/context.json","http://iiif.io/api/search/1/context.json","http://iiif.io/api/search/0/context.json","http://iiif.io/api/auth/1/context.json","http://iiif.io/api/auth/0/context.json","http://iiif.io/api/annex/openannotation/context.json"];function CX(t){if(t){let e=Array.isArray(t)?t:[t],i=[];for(let n of e)n==="http://iiif.io/api/presentation/2/context.json"&&i.push("http://iiif.io/api/presentation/3/context.json"),EX.indexOf(n)===-1&&i.push(n);if(e.length)return i.length===1?i[0]:i}}function AX(t){return t?t.map(e=>({label:Dc(e.label),value:Dc(e.value)})):[]}var oR=0;function aR(t,e){let i=encodeURI(t.id||t["@id"]||"").trim();return i&&e?`${i}/${e}`:i||(oR++,`http://example.org/${t["@type"]}${e?`/${e}`:""}/${oR}`)}function Tl(t){let e=[...t.behavior||[]];t.viewingHint&&e.push(t.viewingHint);let i;return Array.isArray(t.motivation)?i=t.motivation.map(sR):t.motivation&&(i=sR(t.motivation)),{"@context":t["@context"]?CX(t["@context"]):void 0,id:(t["@id"]||aR(t)).trim(),type:uT(t),behavior:e.length?e:void 0,height:t.height?t.height:void 0,width:t.width?t.width:void 0,motivation:i,viewingDirection:t.viewingDirection,profile:t.profile,format:t.format?t.format:void 0,duration:void 0,timeMode:void 0}}function xl(t){let[e,i]=SX(t.license),n=[...t.metadata?AX(t.metadata):[],...i];return{rights:e,metadata:n.length?n:void 0,label:t.label?Dc(t.label):void 0,requiredStatement:t.attribution?{label:Dc(lT.attributionLabel),value:Dc(t.attribution)}:void 0,navDate:t.navDate,summary:t.description?Dc(t.description):void 0,thumbnail:DX(t.thumbnail)}}function DX(t){return t&&(Array.isArray(t)?t:[t]).map(e=>typeof e=="string"?{id:e,type:"Image"}:(e.type==="unknown"&&(e.type="Image"),e))}function PX(t){if(!t.within)return;let e=Array.isArray(t.within)?t.within:[t.within],i=[];for(let n of e)if(typeof n=="string"){if(n)switch(t["@type"]){case"sc:Manifest":i.push({id:n,type:"Collection"});break}}else n["@id"]&&i.push({id:n["@id"],type:uT(n)});return i.length?i:void 0}function wu(t){let e=t.related?Array.isArray(t.related)?t.related:[t.related]:[],i=t.contentLayer;return{provider:t.logo||e.length?[{id:lT.providerId,type:"Agent",homepage:e.length?[e[0]]:void 0,logo:t.logo?Array.isArray(t.logo)?t.logo:[t.logo]:void 0,label:Dc(lT.providerName)}]:void 0,partOf:PX(t),rendering:t.rendering,seeAlso:t.seeAlso,start:t.startCanvas,service:t.service?GY(t.service):void 0,supplementary:i?[i]:void 0}}function kX(t){return{chars:t.chars,format:t.format?t.format:void 0,language:t.language}}function IX(t){return Pa({...Tl(t),...xl(t),...wu(t),items:t.members})}function RX(t){let e=[],i=[],n,r;for(let o of t.sequences||[])console.log(o),o.canvases.length&&e.push(...o.canvases),o.behavior&&i.push(...o.behavior),o.viewingDirection&&(r=o.viewingDirection),o.startCanvas&&(n=o.startCanvas);let s=Tl(t);return i.length&&(s.behavior?s.behavior.push(...i):s.behavior=i),Pa({...s,...xl(t),...wu(t),viewingDirection:r,start:n,items:e,structures:OX(t.structures)})}function OX(t){if(!t)return t;let e=new Map;for(let n of t)e.set(n.id,n);let i=[];for(let n of t)if(n.items){let r=n.items.map(s=>typeof s=="string"?(i.push(s),e.get(s)||s):s&&s.id?(i.push(s.id),e.get(s.id)||s):s);n.items=r}return t.filter(n=>i.indexOf(n.id)===-1)}function LX(t){return Pa({...Tl(t),...xl(t),...wu(t),annotations:t.otherContent&&t.otherContent.length?t.otherContent:void 0,items:t.images&&t.images.length?[{id:aR(t,"annotation-page"),type:"AnnotationPage",items:t.images}]:void 0})}function MX(t){return Pa({...Tl(t),...xl(t),...wu(t),items:t.resources&&t.resources.length?t.resources:void 0})}function FX(t){return!t.canvases||t.canvases.length===0?{canvases:[],behavior:[]}:{canvases:t.canvases,behavior:t.viewingHint?[t.viewingHint]:[],viewingDirection:t.viewingDirection,startCanvas:t.startCanvas}}function NX(t){function e(i){if(Array.isArray(i)){if(i.length>1)return{type:"List",items:i.map(e)};i=i[0]}if(typeof i=="string")return encodeURI(i).trim();if("@type"in i){let n;if(typeof i.full=="string")n=i.full;else if(i.full["@type"]==="dctypes:Image")n={id:i.full["@id"],type:"Image"};else if(i.full["@type"]==="sc:Canvas")n={id:i.full["@id"],type:"Canvas"};else throw new Error(`Unsupported source type on annotation: ${i.full["@type"]}`);return{type:"SpecificResource",source:n,selector:cT(i.selector)}}else return encodeURI(i["@id"]).trim()}return Pa({...Tl(t),...xl(t),...wu(t),target:e(t.on),body:Array.isArray(t.resource)?t.resource.map(lR):lR(t.resource)})}function lR(t){return t.type==="Choice"?t:uR(t)}function uR(t){let e=t;return Pa({...Tl(e),...xl(e),...wu(e),...kX(e)})}function BX(t){let e=[];return t.default&&t.default!=="rdf:nil"&&e.push(t.default),t.item&&t.item!=="rdf:nil"&&e.push(...t.item),Pa({...Tl(t),...xl(t),items:e})}function HX(t){return Pa({...Tl(t),...xl(t),...wu(t),items:t.members})}function UX(t){let{"@id":e,"@type":i,"@context":n,profile:r,...s}=t,o={};return e&&(o["@id"]=e),o["@type"]=uT(t),o["@type"]==="unknown"&&(n&&n.length&&(o["@context"]=n),o["@type"]="Service"),r&&(o.profile=rR(r)),Pa({...o,...s})}function zX(t){return Pa({...Tl(t),...xl(t),...wu(t)})}var VX=new ZY({collection:[IX],manifest:[RX],canvas:[LX],annotationList:[MX],sequence:[FX],annotation:[NX],contentResource:[uR],choice:[BX],range:[HX],service:[UX],layer:[zX]});function cR(t){return t&&t["@context"]&&(t["@context"]==="http://iiif.io/api/presentation/2/context.json"||t["@context"].indexOf("http://iiif.io/api/presentation/2/context.json")!==-1||t["@context"]==="http://www.shared-canvas.org/ns/context.json")||t["@context"]==="http://iiif.io/api/image/2/context.json"?VX.traverseUnknown(t):t}function cT(t){if((Array.isArray(t["@type"])&&t["@type"].includes("oa:SvgSelector")||t["@type"]=="oa:SvgSelector")&&("chars"in t||"value"in t))return{type:"SvgSelector",value:"chars"in t?t.chars:t.value};if(t["@type"]==="oa:FragmentSelector")return{type:"FragmentSelector",value:t.value};if(t["@type"]==="oa:Choice")return[cT(t.default),...(Array.isArray(t.item)?t.item:[t.item]).map(cT)];if(t["@type"]=="iiif:ImageApiSelector")return{type:"ImageApiSelector",region:"region"in t?t.region:void 0,rotation:"rotation"in t?t.rotation:void 0};throw new Error(`Unsupported selector type: ${t["@type"]}`)}class jX{constructor(e){Gr(this,Lr);Gr(this,xu);Gr(this,Ic);Gr(this,_n);Gr(this,Th);Gr(this,xh);Gr(this,Ia);Zn(this,xu,e),Zn(this,_n,null),Zn(this,Th,null),Zn(this,xh,[]),Zn(this,Ia,"initial")}async load(){if(Zn(this,Ia,"loading"),typeof oi(this,xu)=="string")try{const e=await Nn.get(oi(this,xu),{withCredentials:!1,headers:{Accept:"application/json"}});Zn(this,_n,e.data)}catch{dr(this,Lr,Yl).call(this,"Failed to load manifest from its URL")}else typeof oi(this,xu)=="object"?Zn(this,_n,oi(this,xu)):dr(this,Lr,Yl).call(this,"Invalid manifest data");this.hasErrors()||dr(this,Lr,tF).call(this),this.hasErrors()||(await dr(this,Lr,iF).call(this),dr(this,Lr,nF).call(this),Zn(this,Th,Eo.create(oi(this,_n))),Zn(this,Ia,"loaded"))}hasErrors(){return oi(this,Ia)==="error"}hasLoaded(){return oi(this,Ia)==="loaded"}isLoading(){return oi(this,Ia)==="loading"}getData(){return oi(this,_n)}getParser(){return oi(this,Th)}getVersion(){return oi(this,Ic)}getErrors(){return oi(this,xh)}isCollection(){return oi(this,_n)&&oi(this,_n).type==="Collection"}}xu=new WeakMap,Ic=new WeakMap,_n=new WeakMap,Th=new WeakMap,xh=new WeakMap,Ia=new WeakMap,Lr=new WeakSet,tF=function(){if(oi(this,_n)){if(!oi(this,_n)["@context"]){dr(this,Lr,Yl).call(this,"Invalid manifest: missing context");return}const e=dR.detectPresentationApiVersion(oi(this,_n));if(e)Zn(this,Ic,e);else{dr(this,Lr,Yl).call(this,"Invalid manifest: unsupported version");return}if(e==="2.0")try{Zn(this,_n,cR(oi(this,_n)))}catch{dr(this,Lr,Yl).call(this,"Invalid manifest: failed to parse the legacy v2 format");return}if(oi(this,_n).type!=="Manifest"&&oi(this,_n).type!=="Collection"){dr(this,Lr,Yl).call(this,`Invalid manifest: invalid type ${oi(this,_n).type}`);return}if(oi(this,_n).type==="Collection"&&(!oi(this,_n).items||oi(this,_n).items.length===0)){dr(this,Lr,Yl).call(this,"Invalid manifest: the collection is empty");return}}else dr(this,Lr,Yl).call(this,"Manifest is empty")},iF=async function(){if(oi(this,_n).items){for(const e of oi(this,_n).items)if(e.annotations)for(let i=0;i{e.annotations&&e.annotations.forEach(i=>{i.type==="AnnotationPage"&&i.items&&i.items.forEach(n=>{n.type==="Annotation"&&(n.motivation&&Array.isArray(n.motivation)&&(n.motivation=n.motivation[0]),n.body&&n.body.forEach(r=>{r.type==="Text"&&r.chars&&(r.type="TextualBody",r.value=r.chars)}))})})})},Yl=function(e){oi(this,xh).push(e),Zn(this,Ia,"error")};class dR{static detectPresentationApiVersion(e){if(e["@context"]){let i=e["@context"];if(Array.isArray(i)&&(i=i[i.length-1]),i==="http://iiif.io/api/presentation/2/context.json")return"2.0";if(i==="http://iiif.io/api/presentation/3/context.json")return"3.0"}return null}static structureTraverse(e,i){for(const n of e)i(n),n.items&&this.structureTraverse(n.items,i)}}const WX={name:"AgentCard",components:{Panel:sT},props:{agent:{type:Object,required:!0}},data(){return{label:null,homepage:null,logo:null,seeAlso:null}},mounted(){this.loadAgentInfo()},methods:{loadAgentInfo(){const t=Eo.create(Pi(this.agent));this.label=t.getPrefLabel(),this.homepage=t.getHomePage(),this.logo=t.getLogo(300),this.seeAlso=t.getSeeAlsoLinks()}}},qX=["src","alt"],GX={key:1},KX={class:"mb-2"},YX=["href"],XX={key:2},ZX={class:"mb-2"},QX=["href"];function JX(t,e,i,n,r,s){const o=Mt("Panel");return r.label?(X(),gt(o,{key:0,header:r.label,toggleable:"",collapsed:""},{default:Vt(()=>[r.logo?(X(),se("img",{key:0,class:"max-w-full mb-3",src:r.logo,alt:r.label},null,8,qX)):Be("",!0),r.homepage?(X(),se("div",GX,[(X(!0),se(ct,null,Kt(r.homepage,u=>(X(),se("div",KX,[Se("a",{href:u.value,target:"_blank"},it(u.label),9,YX)]))),256))])):Be("",!0),r.seeAlso?(X(),se("div",XX,[(X(!0),se(ct,null,Kt(r.seeAlso,u=>(X(),se("div",ZX,[Se("a",{href:u.value,target:"_blank"},it(u.label),9,QX)]))),256))])):Be("",!0)]),_:1},8,["header"])):Be("",!0)}const $X={name:"ResourceInfoDetails",components:{AgentCard:ma(WX,[["render",JX]])},props:{resourceInfo:{type:Object,required:!0}},setup(){return{HtmlUtility:Wg,Helper:ds}}},eZ={key:0,class:"gv-field"},tZ={class:"gv-field-label"},iZ={class:"gv-field-value"},nZ=["href"],rZ={key:1,class:"gv-field"},sZ={class:"gv-field-label"},oZ={class:"gv-field-value"},aZ=["innerHTML"],lZ={key:2,class:"gv-field"},uZ={class:"gv-field-label"},cZ={class:"gv-field-value"},dZ=["innerHTML"],hZ={key:3,class:"gv-field"},fZ={class:"gv-field-label"},pZ={class:"gv-field-value"},mZ=["href"],gZ={class:"gv-field"},yZ={class:"gv-field-label"},vZ={class:"gv-field-value"},bZ=["innerHTML"],_Z={key:5,class:"gv-field"},wZ={class:"gv-field-label"},TZ={class:"gv-field-value"},xZ=["href"],SZ={key:6,class:"gv-field"},EZ={class:"gv-field-label"},CZ={class:"gv-field-value"},AZ=["href"],DZ={key:7,class:"gv-field"},PZ={class:"gv-field-label"},kZ={class:"gv-field-value"},IZ=["href"],RZ={key:8,class:"gv-field"},OZ={class:"gv-field-label mb-1"},LZ={class:"gv-field-value"},MZ={class:"mb-3"};function FZ(t,e,i,n,r,s){const o=Mt("AgentCard");return X(),se(ct,null,[i.resourceInfo.link?(X(),se("div",eZ,[Se("div",tZ,it(i.resourceInfo.link.text),1),Se("div",iZ,[Se("a",{target:"_blank",href:i.resourceInfo.link.url},it(i.resourceInfo.link.url),9,nZ)])])):Be("",!0),i.resourceInfo.summary?(X(),se("div",rZ,[Se("div",sZ,it(t.$t("ui.summary")),1),Se("div",oZ,[n.HtmlUtility.detectHtml(i.resourceInfo.summary)?(X(),se("div",{key:0,innerHTML:n.HtmlUtility.sanitizeHtml(i.resourceInfo.summary)},null,8,aZ)):(X(),se(ct,{key:1},[Vi(it(i.resourceInfo.summary),1)],64))])])):Be("",!0),i.resourceInfo.requiredStatement?(X(),se("div",lZ,[Se("div",uZ,it(i.resourceInfo.requiredStatement.label),1),Se("div",cZ,[n.HtmlUtility.detectHtml(i.resourceInfo.requiredStatement.value)?(X(),se("div",{key:0,innerHTML:n.HtmlUtility.sanitizeHtml(i.resourceInfo.requiredStatement.value)},null,8,dZ)):(X(),se(ct,{key:1},[Vi(it(i.resourceInfo.requiredStatement.value),1)],64))])])):Be("",!0),i.resourceInfo.rights?(X(),se("div",hZ,[Se("div",fZ,it(t.$t("ui.rights")),1),Se("div",pZ,[n.Helper.isURL(i.resourceInfo.rights)?(X(),se("a",{key:0,href:i.resourceInfo.rights},it(i.resourceInfo.rights),9,mZ)):(X(),se(ct,{key:1},[Vi(it(i.resourceInfo.rights),1)],64))])])):Be("",!0),i.resourceInfo.metadata?(X(!0),se(ct,{key:4},Kt(i.resourceInfo.metadata,u=>(X(),se("div",gZ,[Se("div",yZ,it(u.label),1),Se("div",vZ,[n.HtmlUtility.detectHtml(u.value)?(X(),se("div",{key:0,innerHTML:n.HtmlUtility.sanitizeHtml(u.value)},null,8,bZ)):(X(),se(ct,{key:1},[Vi(it(u.value),1)],64))])]))),256)):Be("",!0),i.resourceInfo.rendering?(X(),se("div",_Z,[Se("div",wZ,it(t.$t("ui.altRepresentation")),1),Se("div",TZ,[(X(!0),se(ct,null,Kt(i.resourceInfo.rendering,u=>(X(),se("div",null,[Se("a",{target:"_blank",href:u.value},it(u.label),9,xZ)]))),256))])])):Be("",!0),i.resourceInfo.homepage?(X(),se("div",SZ,[Se("div",EZ,it(t.$t("ui.homepage")),1),Se("div",CZ,[(X(!0),se(ct,null,Kt(i.resourceInfo.homepage,u=>(X(),se("div",null,[Se("a",{target:"_blank",href:u.value},it(u.label),9,AZ)]))),256))])])):Be("",!0),i.resourceInfo.seeAlso?(X(),se("div",DZ,[Se("div",PZ,it(t.$t("ui.seeAlso")),1),Se("div",kZ,[(X(!0),se(ct,null,Kt(i.resourceInfo.seeAlso,u=>(X(),se("div",null,[Se("a",{target:"_blank",href:u.value},it(u.label),9,IZ)]))),256))])])):Be("",!0),i.resourceInfo.provider?(X(),se("div",RZ,[Se("div",OZ,it(t.$t("ui.provider")),1),Se("div",LZ,[(X(!0),se(ct,null,Kt(i.resourceInfo.provider,u=>(X(),se("div",MZ,[xt(o,{class:"w-full",agent:u},null,8,["agent"])]))),256))])])):Be("",!0)],64)}const NZ={name:"ResourceInfoCard",components:{Panel:sT,ResourceInfoDetails:ma($X,[["render",FZ]])},props:{resourceInfo:{type:Object,required:!0},cardTitle:{type:String},titleIcon:{type:String,default:"info-circle"},toggleable:{type:Boolean,default:!1},collapsed:{type:Boolean,default:!1}}},BZ={class:"w-full mb-6"},HZ={key:0},UZ={key:1};function zZ(t,e,i,n,r,s){const o=Mt("ResourceInfoDetails"),u=Mt("Panel");return X(),se("div",BZ,[i.cardTitle?(X(),se("h3",HZ,[Se("i",{class:Tt(`pi pi-${i.titleIcon}`)},null,2),Vi(" "+it(i.cardTitle),1)])):Be("",!0),i.resourceInfo.label?(X(),se("h4",UZ,it(i.resourceInfo.label),1)):Be("",!0),i.toggleable?(X(),gt(u,{key:2,header:t.$t("ui.details"),toggleable:i.toggleable,collapsed:i.collapsed},{default:Vt(()=>[xt(o,{"resource-info":i.resourceInfo},null,8,["resource-info"])]),_:1},8,["header","toggleable","collapsed"])):(X(),gt(o,{key:3,"resource-info":i.resourceInfo},null,8,["resource-info"]))])}const VZ={name:"GlycerineViewer",components:{AudioViewer:oY,VideoViewer:dY,TableViewer:Xz,ImageViewer:ZH,ResourceInfoCard:ma(NZ,[["render",zZ]]),Button:ep,Dropdown:Dd,InputSwitch:mC,Checkbox:pC,Message:gC,Listbox:yC,Chip:vC,TabView:Ub,TabPanel:zb,DataTable:qb,Column:UC,InputText:Vb,Tree:VC,Slider:jC},props:{manifest:{type:[Object,String],required:!0},defaultInfoPanel:{type:Boolean,default:!0},showFullScreenButton:{type:Boolean,default:!0},showIndexButton:{type:Boolean,default:!0},showAnnotationViewButton:{type:Boolean,default:!0},showAboutPaneButton:{type:Boolean,default:!0},showSettingPaneButton:{type:Boolean,default:!0},showCollectionPaneButton:{type:Boolean,default:!0},showManifestUrl:{type:Boolean,default:!0},displayAnnotations:{type:Boolean,default:!0},enableDropManifest:{type:Boolean,default:!0},toggleIndexPanel:{type:Boolean,default:!1},toggleAboutPanel:{type:Boolean,default:!1}},emits:["osdInitialized","manifestLoaded","canvasLoaded","canvasAnnotationsLoaded","mouseEnterAnnotation","mouseLeaveAnnotation","annotationPopupOpened","annotationPopupClosed","viewModeChanged","indexPanelClosed","aboutPanelClosed"],data(){return{currentManifest:this.manifest,manifestStatus:"initial",manifestErrors:[],viewMode:"image",highlightedAnnotationId:null,showAboutPanel:!1,showIndexPanel:!1,showCollectionPanel:!1,showSettingsPanel:!1,settings:{language:{default:null,options:[]},filters:{set:"all",language:"all",line:"all",weight:"all"},light:100,showInfoPanel:this.defaultInfoPanel,tableColumns:{Title:!0,Description:!0,Links:!0,Tags:!0,Notes:!0,Attribution:!1,Date:!1,"Line Color":!1,"Line Weight":!1,Comments:!1}},isInFullscreen:!1,hasAddedFullscreenListener:!1,collectionActiveManifest:null,navigation:{activeIndex:0,maxVisibleItems:0,styles:{thumbnailWidth:110,gap:15}},index:{searchFilter:{global:{value:null,matchMode:Vn.CONTAINS}},rowsPerPage:10},collectionTableOptions:{searchFilter:{global:{value:null,matchMode:Vn.CONTAINS}},rowsPerPage:10},showDropZone:!1,userAnnotationFilter:null}},computed:{manifestIsLoading(){return this.manifestStatus==="loading"},manifestHasLoaded(){return this.manifestStatus==="loaded"},manifestHadErrors(){return this.manifestStatus==="error"},canvases(){let t=[];return this.manifestHasLoaded&&(t=this.manifestLoader.getParser().getCanvases()),t},manifestInfo(){const t={};if(this.manifestHasLoaded){if(this.showManifestUrl){let i=null;typeof this.currentManifest=="string"&&(i=this.currentManifest),typeof this.currentManifest=="object"&&this.currentManifest.id&&(i=this.currentManifest.id),i&&(t.link={text:"IIIF Manifest",url:i})}const e=this.manifestLoader.getParser();t.label=e.getPrefLabel(this.settings.language.default),t.summary=e.getSummary(this.settings.language.default),t.requiredStatement=e.getRequiredStatement(this.settings.language.default),t.rights=e.getRights(),t.metadata=e.getMetadata(this.settings.language.default),t.rendering=e.getRendering(this.settings.language.default),t.homepage=e.getHomePage(this.settings.language.default),t.seeAlso=e.getSeeAlsoLinks(this.settings.language.default),t.thumbnail=e.getThumbnail(),t.provider=e.getProvider()}return t},currentCanvasInfo(){if(this.manifestHasLoaded){const t=Pi(this.canvases[this.navigation.activeIndex].parser),e={label:t.getPrefLabel(this.settings.language.default),summary:t.getSummary(this.settings.language.default),requiredStatement:t.getRequiredStatement(this.settings.language.default),rights:t.getRights(),metadata:t.getMetadata(this.settings.language.default),rendering:t.getRendering(this.settings.language.default),homepage:t.getHomePage(this.settings.language.default),seeAlso:t.getSeeAlsoLinks(this.settings.language.default),provider:t.getProvider()};let i=!1;for(const n in e)if(e[n]){i=!0;break}if(i)return e}return null},collectionInfo(){if(this.manifestHasLoaded&&this.collectionLoader){const t=this.collectionLoader.getParser(),e={label:t.getPrefLabel(this.settings.language.default),summary:t.getSummary(this.settings.language.default),requiredStatement:t.getRequiredStatement(this.settings.language.default),rights:t.getRights(),metadata:t.getMetadata(this.settings.language.default),rendering:t.getRendering(this.settings.language.default),homepage:t.getHomePage(this.settings.language.default),seeAlso:t.getSeeAlsoLinks(this.settings.language.default),provider:t.getProvider()};this.showManifestUrl&&(e.link={text:"IIIF Manifest",url:t.getID()}),e.items=[];const i=t.getItems();for(const n of i){const r=Eo.create(n);e.items.push({id:r.getID(),label:r.getPrefLabel(this.settings.language.default),type:r.getType(),thumbnail:r.getThumbnail()})}return e}return null},collectionTableActiveItem(){return this.collectionActiveManifest?this.collectionInfo.items.find(t=>t.id===this.collectionActiveManifest):null},collectionTableFirstIndex(){if(this.collectionInfo&&this.collectionInfo.items){const t=this.collectionInfo.items.findIndex(e=>e.id===this.collectionActiveManifest);return Math.floor(t/this.collectionTableOptions.rowsPerPage)*this.collectionTableOptions.rowsPerPage}return 0},tableColumns(){return Object.keys(this.settings.tableColumns).filter(t=>this.settings.tableColumns[t])},annotations(){const t={};return this.canvases.length>0&&this.canvases.forEach(e=>{t[e.id]=[],e.annotations&&e.annotations.length>0&&e.annotations.forEach(i=>{var n,r,s,o;this.settings.filters.set==="none"||this.settings.filters.set!=="all"&&i.group!==this.settings.filters.set||this.settings.filters.language!=="all"&&this.getAnnotationLanguageCodes(i).indexOf(this.settings.filters.language)<0||this.settings.filters.line!=="all"&&((r=(n=i.fields["Line Color"])==null?void 0:n.en)==null?void 0:r[0])!==this.settings.filters.line||this.settings.filters.weight!=="all"&&((o=(s=i.fields["Line Weight"])==null?void 0:s.en)==null?void 0:o[0])!==this.settings.filters.weight||this.userAnnotationFilter!==null&&this.userAnnotationFilter.indexOf(i.id)<0||t[e.id].push(i)})}),t},hasAnnotation(){let t=!1;return this.canvases.length>0&&this.canvases.forEach(e=>{e.annotations&&e.annotations.length>0&&(t=!0)}),t},filterSetOptions(){const t=[{label:this.$t("ui.allAnnotations"),value:"all"}];if(this.manifestHasLoaded){const e=this.manifestLoader.getParser().getAnnotationSets();for(const i of e){let n=i.label??"Untitled";i.creator&&(n=i.creator+" - "+n),t.push({label:n,value:i.id})}}return t.push({label:this.$t("ui.noAnnotations"),value:"none"}),t},filterLanguageOptions(){const t=[{label:this.$t("ui.allLanguages"),value:"all"},{label:"English",value:"en"}];if(this.canvases.length>0){const e=[];this.canvases.forEach(i=>{i.annotations&&i.annotations.length>0&&i.annotations.forEach(n=>{this.getAnnotationLanguageCodes(n).forEach(s=>{s!=="en"&&e.indexOf(s)<0&&e.push(s)})})}),e.forEach(i=>{const n=dl.getLanguageName(i);n&&t.push({label:n,value:i})})}return t},filterLineOptions(){const t=[{label:this.$t("ui.allLineColors"),value:"all"}];if(this.canvases.length>0){const e=[];this.canvases.forEach(i=>{i.annotations&&i.annotations.length>0&&i.annotations.forEach(n=>{if(n.fields){for(const r in n.fields)if(r==="Line Color"&&n.fields[r].en){const s=n.fields[r].en[0];e.indexOf(s)<0&&e.push(s)}}})}),e.forEach(i=>{t.push({label:i,value:i})})}return t},filterWeightOptions(){const t=[{label:this.$t("ui.allLineWeights"),value:"all"}];if(this.canvases.length>0){const e=[];this.canvases.forEach(i=>{i.annotations&&i.annotations.length>0&&i.annotations.forEach(n=>{if(n.fields){for(const r in n.fields)if(r==="Line Weight"&&n.fields[r].en){const s=n.fields[r].en[0];e.indexOf(s)<0&&e.push(s)}}})}),e.forEach(i=>{t.push({label:i,value:i})})}return t},infoPanelVisibility(){return this.manifestHasLoaded&&this.settings.showInfoPanel&&this.viewMode==="image"},annotationDefaultLanguage(){return this.settings.filters.language!=="all"?this.settings.filters.language:this.settings.language.default},navThumbnails(){const t=[];if(this.canvases.length>0&&this.navigation.maxVisibleItems>0){let e=Math.max(0,this.navigation.activeIndex-Math.floor(this.navigation.maxVisibleItems/2)),i=Math.min(this.canvases.length,e+this.navigation.maxVisibleItems);i-e0)for(let e=0;es.id),i=s=>{const o=[];for(const u of s){let h=Eo.create(u);if(h.getType()==="Range"){const p=h.getPrefLabel(this.settings.language.default);if(p){const g={key:h.getID(),label:p,data:{id:h.getID(),type:h.getType(),label:p}};if(u.items){const y=[];for(const S of u.items)if(S.type==="Range")y.push(S);else if(S.type==="Canvas"){const P=S.id,R=e.indexOf(P);R>-1&&(g.data.canvasIndices?g.data.canvasIndices.push(R):g.data.canvasIndices=[R])}y.length>0&&(g.children=i(y))}o.push(g)}}}return o},r=this.manifestLoader.getParser().getStructures();r&&(t=i(r))}return t},selectedStructureNodes(){const t={};if(this.structureNodes.length>0){const e=i=>{for(const n of i)n.data.canvasIndices&&n.data.canvasIndices.indexOf(this.navigation.activeIndex)>-1&&(t[n.key]=!0),n.children&&e(n.children)};e(this.structureNodes)}return t},expandedStructureNodes(){const t={};if(this.structureNodes.length>0){const e=i=>{let n=!1;for(const r of i)r.data.canvasIndices&&r.data.canvasIndices.indexOf(this.navigation.activeIndex)>-1&&(n=!0),r.children&&e(r.children)&&(n=!0,t[r.key]=!0);return n};e(this.structureNodes)}return t}},setup(){return{version:"1.4.0",logoPath:r5,HtmlUtility:Wg,Helper:ds,manifestLoader:null,collectionLoader:null}},mounted(){this.loadManifest()},watch:{manifest(){this.collectionLoader=null,this.reset()},manifestHasLoaded:{handler(t,e){t&&this.canvases&&this.canvases.length>1&&this.initNavigation()},flush:"post"},toggleAboutPanel(t){this.showAboutPanel=t},toggleIndexPanel(t){this.showIndexPanel=t},showAboutPanel(t,e){e===!0&&t===!1&&this.$emit("aboutPanelClosed")},showIndexPanel(t,e){t===!1&&e===!0&&this.$emit("indexPanelClosed")}},methods:{async reset(t=null){this.currentManifest=t??this.manifest,this.manifestStatus="initial",this.manifestErrors=[],this.viewMode="image",this.highlightedAnnotationId=null,this.showAboutPanel=!1,this.showCollectionPanel=!1,this.showSettingsPanel=!1,this.showIndexPanel=!1,this.settings={language:{default:null,options:[]},filters:{set:"all",language:"all",line:"all",weight:"all"},light:100,showInfoPanel:this.defaultInfoPanel,tableColumns:{Title:!0,Description:!0,Links:!0,Tags:!0,Notes:!0,Attribution:!1,Date:!1,"Line Color":!1,"Line Weight":!1,Comments:!1}},this.isInFullscreen=!1,this.hasAddedFullscreenListener=!1,this.collectionActiveManifest=null,this.navigation={activeIndex:0,maxVisibleItems:0,styles:{thumbnailWidth:110,gap:15}},this.index={searchFilter:{global:{value:null,matchMode:Vn.CONTAINS}},rowsPerPage:10},this.collectionTableOptions={searchFilter:{global:{value:null,matchMode:Vn.CONTAINS}},rowsPerPage:10},this.userAnnotationFilter=null,await this.loadManifest()},async loadManifest(){const t=new jX(this.currentManifest);if(this.manifestStatus="loading",await t.load(),t.hasErrors())this.manifestStatus="error",this.manifestErrors=t.getErrors();else if(t.hasLoaded())if(t.getParser()instanceof qI){this.collectionLoader=t;const e=this.collectionLoader.getParser().getItems();e&&e.length>0&&(this.currentManifest=e[0].id,await this.loadManifest())}else{this.manifestLoader=t,this.manifestStatus="loaded",this.$emit("manifestLoaded",this.manifestLoader.getData()),this.loadTableColumnVisibility();const e=dl.uiLanguages,i=e.map(s=>s.code),n=this.manifestLoader.getParser().getLanguages();for(const s of n)i.indexOf(s.code)<0&&e.push(s);this.settings.language.options=e.map(s=>({label:s.name,value:s.code})),this.settings.language.default=this.$i18n.locale;const r=this.manifestLoader.getParser().getStartCanvas();r&&this.manifestLoader.getParser().getCanvases().forEach((s,o)=>{s.id===r&&(this.navigation.activeIndex=o)}),this.collectionLoader&&(this.collectionActiveManifest=this.manifestLoader.getParser().getID())}},loadTableColumnVisibility(){const t=[],e=["Attribution","Date","Line Color","Line Weight"];this.canvases.length>0&&this.canvases.forEach(i=>{i.annotations&&i.annotations.length>0&&i.annotations.forEach(n=>{if(n.fields)for(const r in n.fields){let s=r;r==="Comment"?s="Comments":r==="Note"?s="Notes":r==="Link"?s="Links":r==="Tag"&&(s="Tags"),t.indexOf(s)<0&&t.push(s)}})});for(const i in this.settings.tableColumns)this.settings.tableColumns[i]=t.indexOf(i)>-1&&e.indexOf(i)<0},activate(t){this.navigation.activeIndex=t},toggleViewMode(){this.viewMode=this.viewMode==="image"?"table":"image",this.$emit("viewModeChanged",this.viewMode)},getAnnotationLanguageCodes(t){const e=[];if(t.fields)for(const i in t.fields)for(const n in t.fields[i])e.indexOf(n)<0&&e.push(n);return e},toggleFullscreen(){const t=this.$refs.gViewer;this.isInFullscreen?document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen():t.requestFullscreen?t.requestFullscreen():t.mozRequestFullScreen?t.mozRequestFullScreen():t.webkitRequestFullscreen?t.webkitRequestFullscreen():t.msRequestFullscreen&&t.msRequestFullscreen(),this.hasAddedFullscreenListener||(t.addEventListener("fullscreenchange",()=>{this.isInFullscreen=document.fullscreenElement!==null}),this.hasAddedFullscreenListener=!0)},initNavigation(){const e=this.$refs.navContainer.offsetWidth;let i=Math.floor(e/(this.navigation.styles.thumbnailWidth+this.navigation.styles.gap));i>1&&i%2===0&&(i-=1),this.navigation.maxVisibleItems=i},openIndexPanel(){this.index.searchFilter.global.value=null,this.showIndexPanel=!0},indexPanelScrollTop(){this.$nextTick(()=>{this.$refs.indexPanelTop.scrollIntoView({behavior:"smooth"})})},onIndexRowSelect(t){const e=t.data;for(let i=0;i0&&this.activate(t.data.canvasIndices[0])},onManifestDrop(t){t.preventDefault();const e=t.dataTransfer.getData("text/plain");this.openManifest(e),this.showDropZone=!1},onManifestDragOver(t){t.preventDefault(),this.enableDropManifest&&(this.showDropZone=!0)},onManifestDragLeave(t){t.preventDefault(),this.showDropZone=!1},onPrefLanguageChange(t){this.settings.language.default=t.value,localStorage.setItem("prefLang",t.value)},onCollectionItemRowSelect(t){const e=t.data;e&&this.reset(e.id)},collectionTableScrollTop(){this.$nextTick(()=>{this.$refs.collectionTableTop.scrollIntoView({behavior:"smooth"})})},async openManifest(t){ds.isURL(t)&&(this.collectionLoader=null,await this.reset(t))},activateCanvas(t){const e=this.canvases.findIndex(i=>i.id===t);e>=0&&this.activate(e)},highlightAnnotation(t){this.highlightedAnnotationId=t},clearHighlight(){this.highlightedAnnotationId=null},setUserAnnotationFilter(t=null){this.userAnnotationFilter=t}}},jZ={class:"gv-gallery flex flex-column justify-content-end h-full"},WZ={class:"gv-gallery-views w-full flex-grow-1",style:{"min-height":"0"}},qZ={key:0,class:"h-full"},GZ={key:3,class:"flex flex-column align-items-center justify-content-center w-full h-full bg-gray-900 text-color-secondary"},KZ={key:0,class:"anno-gallery-nav flex align-items-center justify-content-between gap-3 w-full bg-black-alpha-90 p-3"},YZ={class:"thumbnail-container bg-gray-900"},XZ=["onClick"],ZZ=["src","alt"],QZ={key:1,class:"pi pi-volume-up text-color-secondary",style:{"font-size":"3rem"}},JZ={key:2,class:"pi pi-video text-color-secondary",style:{"font-size":"3rem"}},$Z={key:3,class:"pi pi-image text-color-secondary",style:{"font-size":"3rem"}},eQ={key:0,class:"gv-info-pane"},tQ={class:"gv-info-header"},iQ={class:"gv-info-tools"},nQ={class:"flex justify-content-between align-items-center w-full gap-2"},rQ={key:0,class:"gv-info-thumbnail flex-shrink-0"},sQ=["src","alt"],oQ={class:"gv-info-title"},aQ={key:0,class:"mt-2"},lQ={class:"gv-info-body"},uQ={class:"gv-field"},cQ={class:"gv-field-label"},dQ={key:0,class:"gv-field-value"},hQ={key:0,class:"gv-field"},fQ={class:"gv-field-label"},pQ={class:"gv-field-value"},mQ=["innerHTML"],gQ={class:"absolute",style:{top:"1rem",right:"1rem"}},yQ={key:0,class:"gv-sidebar"},vQ={class:"text-right"},bQ={class:"p-fluid formgrid grid"},_Q={class:"w-full mb-2"},wQ={class:"pl-2"},TQ={class:"field col-12"},xQ={for:"filterLang"},SQ={key:0,class:"w-full mb-2"},EQ={class:"pl-2"},CQ={class:"field col-12"},AQ={for:"filterSet"},DQ={class:"field col-12"},PQ={for:"filterLang"},kQ={class:"field col-12"},IQ={for:"filterLine"},RQ={key:0,class:"flex align-items-center gap-2"},OQ={key:0},LQ={key:1},MQ={class:"flex align-items-center gap-2"},FQ={key:0},NQ={class:"field col-12"},BQ={for:"filterLang"},HQ={class:"w-full"},UQ={class:"pl-2"},zQ={key:0,class:"field col-12 flex align-items-center gap-4"},VQ={key:1,class:"field col-12 flex align-items-center gap-4"},jQ={key:2,class:"field col-12"},WQ={class:"mb-2"},qQ={class:"mb-1"},GQ={for:"tcTitle"},KQ={class:"mb-1"},YQ={for:"tcDescription"},XQ={class:"mb-1"},ZQ={for:"tcLinks"},QQ={class:"mb-1"},JQ={for:"tcTags"},$Q={class:"mb-1"},eJ={for:"tcNotes"},tJ={class:"mb-1"},iJ={for:"tcAttribution"},nJ={class:"mb-1"},rJ={for:"tcDate"},sJ={class:"mb-1"},oJ={for:"tcLineColor"},aJ={class:"mb-1"},lJ={for:"tcLineWeight"},uJ={class:"mb-1"},cJ={for:"tcComments"},dJ={key:0,class:"gv-sidebar"},hJ={class:"text-right"},fJ={class:"text-center mt-8 gv-powered-by"},pJ={class:"mr-2"},mJ={key:0,class:"gv-sidebar"},gJ={class:"text-right"},yJ={key:0},vJ={ref:"collectionTableTop"},bJ={class:"flex justify-content-end"},_J={class:"p-input-icon-left w-full"},wJ=["src"],TJ={key:1,class:"thumbnail-container surface-50"},xJ={key:2,class:"thumbnail-container surface-50"},SJ={key:0},EJ={key:1},CJ={key:0,class:"gv-sidebar"},AJ={ref:"indexPanelTop"},DJ={class:"text-right"},PJ={class:"flex justify-content-end"},kJ={class:"p-input-icon-left w-full"},IJ=["src"],RJ={key:1,class:"thumbnail-container surface-50"},OJ={key:2,class:"thumbnail-container surface-50"},LJ={key:0},MJ={key:1},FJ={key:1,class:"w-full h-full bg-gray-900 overflow-hidden flex flex-column align-items-center justify-content-center gap-4"},NJ=["src"],BJ={key:0};function HJ(t,e,i,n,r,s){var pe;const o=Mt("TableViewer"),u=Mt("ImageViewer"),h=Mt("AudioViewer"),p=Mt("VideoViewer"),g=Mt("Button"),y=Mt("Dropdown"),S=Mt("Slider"),P=Mt("InputSwitch"),R=Mt("Checkbox"),k=Mt("ResourceInfoCard"),M=Mt("InputText"),L=Mt("Column"),q=Mt("DataTable"),Z=Mt("TabPanel"),J=Mt("Tree"),ae=Mt("TabView"),ye=Mt("Message");return X(),se("div",{class:"gv-container w-full h-full relative overflow-hidden",onDragover:e[38]||(e[38]=le=>s.onManifestDragOver(le))},[s.manifestHasLoaded?(X(),se("div",Qi({key:0,ref:"gViewer"},t.$attrs,{class:"w-full h-full relative overflow-hidden"}),[Se("div",jZ,[Se("div",WZ,[(X(!0),se(ct,null,Kt(s.canvases,(le,ze)=>(X(),se(ct,null,[r.navigation.activeIndex===ze?(X(),se("div",qZ,[le.image?(X(),se(ct,{key:0},[r.viewMode==="table"?(X(),gt(o,{key:0,image:le.image.url,"plain-image":le.image.type==="image",annotations:s.annotations[le.id],"table-columns":s.tableColumns},null,8,["image","plain-image","annotations","table-columns"])):(X(),gt(u,{key:1,image:le.image.url,"plain-image":le.image.type==="image",annotations:s.annotations[le.id],light:r.settings.light,"default-language":s.annotationDefaultLanguage,displayAnnotations:i.displayAnnotations,highlightedAnnotationId:r.highlightedAnnotationId,onOsdInitialized:tt=>{t.$emit("osdInitialized",tt,le)},onCanvasLoaded:()=>{t.$emit("canvasLoaded",le.id)},onAnnotationsLoaded:tt=>{t.$emit("canvasAnnotationsLoaded",tt,le.id)},onMouseEnterAnnotation:e[0]||(e[0]=tt=>{t.$emit("mouseEnterAnnotation",tt)}),onMouseLeaveAnnotation:e[1]||(e[1]=tt=>{t.$emit("mouseLeaveAnnotation",tt)}),onAnnotationPopupOpened:e[2]||(e[2]=tt=>{t.$emit("annotationPopupOpened",tt)}),onAnnotationPopupClosed:e[3]||(e[3]=tt=>{t.$emit("annotationPopupClosed",tt)})},null,8,["image","plain-image","annotations","light","default-language","displayAnnotations","highlightedAnnotationId","onOsdInitialized","onCanvasLoaded","onAnnotationsLoaded"]))],64)):le.audio?(X(),gt(h,{key:1,source:le.audio.url,format:le.audio.format},null,8,["source","format"])):le.video?(X(),gt(p,{key:2,source:le.video.url,format:le.video.format},null,8,["source","format"])):(X(),se("div",GZ,[e[39]||(e[39]=Se("div",null,[Se("i",{class:"pi pi-image",style:{"font-size":"7rem"}})],-1)),Se("div",null,it(t.$t("message.invalidImage")),1)]))])):Be("",!0)],64))),256))]),s.canvases.length>1?(X(),se("div",KZ,[Se("div",null,[xt(g,{class:"text-white",type:"button",text:"",rounded:"",icon:"pi pi-chevron-left",onClick:e[4]||(e[4]=le=>s.activate(r.navigation.activeIndex-1)),disabled:r.navigation.activeIndex===0},null,8,["disabled"])]),Se("div",{ref:"navContainer",class:"anno-gallery-nav-items flex align-items-center justify-content-center flex-no-wrap w-full overflow-hidden",style:Ri({gap:r.navigation.styles.gap+"px"})},[xt(xB,{name:"rolling"},{default:Vt(()=>[(X(!0),se(ct,null,Kt(s.navThumbnails,le=>(X(),se("div",{class:"anno-gallery-nav-item flex-shrink-0",style:Ri({width:r.navigation.styles.thumbnailWidth+"px"}),key:le.id},[Se("div",YZ,[Se("a",{class:Tt(["thumbnail-item",{"thumbnail-item-active":r.navigation.activeIndex===le.index}]),href:"#",onClick:Kf(ze=>s.activate(le.index),["prevent"])},[le.image?(X(),se("img",{key:0,src:le.image,alt:le.label},null,8,ZZ)):le.type==="Audio"?(X(),se("i",QZ)):le.type==="Video"?(X(),se("i",JZ)):(X(),se("i",$Z))],10,XZ)])],4))),128))]),_:1})],4),Se("div",null,[xt(g,{class:"text-white",type:"button",text:"",rounded:"",icon:"pi pi-chevron-right",onClick:e[5]||(e[5]=le=>s.activate(r.navigation.activeIndex+1)),disabled:r.navigation.activeIndex===s.canvases.length-1},null,8,["disabled"])])])):Be("",!0)]),s.infoPanelVisibility?(X(),se("div",eQ,[Se("div",tQ,[Se("div",iQ,[Se("span",{onClick:e[6]||(e[6]=le=>this.settings.showInfoPanel=!1)},e[40]||(e[40]=[Se("i",{class:"pi pi-times-circle"},null,-1)]))]),Se("div",nQ,[s.manifestInfo.thumbnail?(X(),se("div",rQ,[Se("img",{src:s.manifestInfo.thumbnail,alt:s.manifestInfo.label},null,8,sQ)])):Be("",!0),Se("div",null,[Se("div",oQ,it(s.manifestInfo.label),1),s.collectionInfo?(X(),se("div",aQ,[Vi(it(t.$t("ui.collection"))+": ",1),Se("a",{onClick:e[7]||(e[7]=Kf(le=>r.showCollectionPanel=!0,["prevent"])),href:"#"},it(s.collectionInfo.label),1)])):Be("",!0)])])]),Se("div",lQ,[Se("div",uQ,[Se("div",cQ,[Vi(it(t.$t("ui.currentlyViewing"))+" ",1),Se("span",null,"("+it(r.navigation.activeIndex+1)+" of "+it(s.canvases.length)+")",1)]),(pe=s.currentCanvasInfo)!=null&&pe.label?(X(),se("div",dQ,it(s.currentCanvasInfo.label),1)):Be("",!0)]),s.manifestInfo.requiredStatement?(X(),se("div",hQ,[Se("div",fQ,it(s.manifestInfo.requiredStatement.label),1),Se("div",pQ,[n.HtmlUtility.detectHtml(s.manifestInfo.requiredStatement.value)?(X(),se("div",{key:0,innerHTML:n.HtmlUtility.sanitizeHtml(s.manifestInfo.requiredStatement.value)},null,8,mQ)):(X(),se(ct,{key:1},[Vi(it(s.manifestInfo.requiredStatement.value),1)],64))])])):Be("",!0)])])):Be("",!0),Se("div",gQ,[i.showFullScreenButton?(X(),se(ct,{key:0},[r.isInFullscreen?(X(),gt(g,{key:1,rounded:"",icon:"pi pi-window-minimize",class:"mr-2",title:t.$t("ui.exitFullscreen"),onClick:s.toggleFullscreen},null,8,["title","onClick"])):(X(),gt(g,{key:0,rounded:"",icon:"pi pi-window-maximize",class:"mr-2",title:t.$t("ui.fullscreen"),onClick:s.toggleFullscreen},null,8,["title","onClick"]))],64)):Be("",!0),i.showCollectionPaneButton?(X(),se(ct,{key:1},[s.collectionInfo?(X(),gt(g,{key:0,rounded:"",icon:"pi pi-book",class:"mr-2",title:t.$t("ui.collection"),onClick:e[8]||(e[8]=le=>r.showCollectionPanel=!0)},null,8,["title"])):Be("",!0)],64)):Be("",!0),i.showIndexButton?(X(),gt(g,{key:2,rounded:"",icon:"pi pi-list",class:"mr-2",title:t.$t("ui.index"),onClick:s.openIndexPanel},null,8,["title","onClick"])):Be("",!0),i.showAnnotationViewButton&&i.displayAnnotations?(X(),se(ct,{key:3},[s.hasAnnotation?(X(),gt(g,{key:0,rounded:"",class:"mr-2",icon:r.viewMode==="table"?"pi pi-image":"pi pi-comment",title:r.viewMode==="table"?t.$t("ui.images"):t.$t("ui.annotations"),onClick:s.toggleViewMode},null,8,["icon","title","onClick"])):Be("",!0)],64)):Be("",!0),i.showAboutPaneButton?(X(),gt(g,{key:4,rounded:"",icon:"pi pi-info-circle",class:"mr-2",title:t.$t("ui.about"),onClick:e[9]||(e[9]=le=>r.showAboutPanel=!0)},null,8,["title"])):Be("",!0),i.showSettingPaneButton?(X(),gt(g,{key:5,rounded:"",icon:"pi pi-cog",title:t.$t("ui.settings"),onClick:e[10]||(e[10]=le=>r.showSettingsPanel=!0)},null,8,["title"])):Be("",!0)]),xt(sl,{name:"slide"},{default:Vt(()=>[r.showSettingsPanel?(X(),se("div",yQ,[Se("div",vQ,[xt(g,{icon:"pi pi-times",severity:"secondary",text:"",rounded:"","aria-label":"Close",onClick:e[11]||(e[11]=le=>r.showSettingsPanel=!1)})]),Se("h3",null,[e[41]||(e[41]=Se("i",{class:"pi pi-cog"},null,-1)),Vi(" "+it(t.$t("ui.settings")),1)]),Se("div",bQ,[Se("div",_Q,[Se("h4",wQ,it(t.$t("ui.preference")),1),Se("div",TQ,[Se("label",xQ,it(t.$t("ui.language")),1),xt(y,{id:"filterLang",modelValue:t.$i18n.locale,"onUpdate:modelValue":e[12]||(e[12]=le=>t.$i18n.locale=le),options:r.settings.language.options,"option-label":"label","option-value":"value","append-to":"self",onChange:s.onPrefLanguageChange},null,8,["modelValue","options","onChange"])])]),i.displayAnnotations&&s.hasAnnotation?(X(),se("div",SQ,[Se("h4",EQ,it(t.$t("ui.annotationFilters")),1),Se("div",CQ,[Se("label",AQ,it(t.$t("ui.show")),1),xt(y,{id:"filterSet",modelValue:r.settings.filters.set,"onUpdate:modelValue":e[13]||(e[13]=le=>r.settings.filters.set=le),options:s.filterSetOptions,"option-label":"label","option-value":"value","append-to":"self"},null,8,["modelValue","options"])]),Se("div",DQ,[Se("label",PQ,it(t.$t("ui.language")),1),xt(y,{id:"filterLang",modelValue:r.settings.filters.language,"onUpdate:modelValue":e[14]||(e[14]=le=>r.settings.filters.language=le),options:s.filterLanguageOptions,"option-label":"label","option-value":"value","append-to":"self"},null,8,["modelValue","options"])]),Se("div",kQ,[Se("label",IQ,it(t.$t("ui.lineColor")),1),xt(y,{id:"filterLine",modelValue:r.settings.filters.line,"onUpdate:modelValue":e[15]||(e[15]=le=>r.settings.filters.line=le),options:s.filterLineOptions,"option-label":"label","option-value":"value","append-to":"self"},{value:Vt(le=>[le.value?(X(),se("div",RQ,[le.value==="all"?(X(),se("div",OQ,it(t.$t("ui.allLineColors")),1)):(X(),se("div",{key:1,style:Ri(`width:100%;height:20px;background-color:${le.value}`)},null,4))])):(X(),se("span",LQ,it(le.placeholder),1))]),option:Vt(le=>[Se("div",MQ,[le.option.value==="all"?(X(),se("div",FQ,it(le.option.label),1)):Be("",!0),Se("div",{style:Ri(`width:100%;height:20px;background-color:${le.option.value}`)},null,4)])]),_:1},8,["modelValue","options"])]),Se("div",NQ,[Se("label",BQ,it(t.$t("ui.lineWeight")),1),xt(y,{id:"filterLang",modelValue:r.settings.filters.weight,"onUpdate:modelValue":e[16]||(e[16]=le=>r.settings.filters.weight=le),options:s.filterWeightOptions,"option-label":"label","option-value":"value","append-to":"self"},null,8,["modelValue","options"])])])):Be("",!0),Se("div",HQ,[Se("h4",UQ,it(t.$t("ui.display")),1),i.displayAnnotations&&r.viewMode==="image"?(X(),se("div",zQ,[Se("div",null,[e[42]||(e[42]=Se("i",{class:"pi pi-sun"},null,-1)),Vi(" "+it(t.$t("ui.light")),1)]),xt(S,{modelValue:r.settings.light,"onUpdate:modelValue":e[17]||(e[17]=le=>r.settings.light=le),class:"w-10rem"},null,8,["modelValue"]),Se("span",null,it(r.settings.light)+"%",1)])):Be("",!0),r.viewMode==="image"?(X(),se("div",VQ,[Se("div",null,[e[43]||(e[43]=Se("i",{class:"pi pi-info-circle"},null,-1)),Vi(" "+it(t.$t("ui.informationPanel")),1)]),xt(P,{modelValue:r.settings.showInfoPanel,"onUpdate:modelValue":e[18]||(e[18]=le=>r.settings.showInfoPanel=le)},null,8,["modelValue"])])):Be("",!0),i.displayAnnotations&&r.viewMode==="table"&&s.hasAnnotation?(X(),se("div",jQ,[Se("div",WQ,it(t.$t("ui.tableColumns")),1),Se("div",qQ,[xt(R,{class:"mr-2",modelValue:r.settings.tableColumns.Title,"onUpdate:modelValue":e[19]||(e[19]=le=>r.settings.tableColumns.Title=le),"input-id":"tcTitle",binary:!0},null,8,["modelValue"]),Se("label",GQ,it(t.$t("ui.title")),1)]),Se("div",KQ,[xt(R,{class:"mr-2",modelValue:r.settings.tableColumns.Description,"onUpdate:modelValue":e[20]||(e[20]=le=>r.settings.tableColumns.Description=le),"input-id":"tcDescription",binary:!0},null,8,["modelValue"]),Se("label",YQ,it(t.$t("ui.description")),1)]),Se("div",XQ,[xt(R,{class:"mr-2",modelValue:r.settings.tableColumns.Links,"onUpdate:modelValue":e[21]||(e[21]=le=>r.settings.tableColumns.Links=le),"input-id":"tcLinks",binary:!0},null,8,["modelValue"]),Se("label",ZQ,it(t.$t("ui.links")),1)]),Se("div",QQ,[xt(R,{class:"mr-2",modelValue:r.settings.tableColumns.Tags,"onUpdate:modelValue":e[22]||(e[22]=le=>r.settings.tableColumns.Tags=le),"input-id":"tcTags",binary:!0},null,8,["modelValue"]),Se("label",JQ,it(t.$t("ui.tags")),1)]),Se("div",$Q,[xt(R,{class:"mr-2",modelValue:r.settings.tableColumns.Notes,"onUpdate:modelValue":e[23]||(e[23]=le=>r.settings.tableColumns.Notes=le),"input-id":"tcNotes",binary:!0},null,8,["modelValue"]),Se("label",eJ,it(t.$t("ui.notes")),1)]),Se("div",tJ,[xt(R,{class:"mr-2",modelValue:r.settings.tableColumns.Attribution,"onUpdate:modelValue":e[24]||(e[24]=le=>r.settings.tableColumns.Attribution=le),"input-id":"tcAttribution",binary:!0},null,8,["modelValue"]),Se("label",iJ,it(t.$t("ui.attribution")),1)]),Se("div",nJ,[xt(R,{class:"mr-2",modelValue:r.settings.tableColumns.Date,"onUpdate:modelValue":e[25]||(e[25]=le=>r.settings.tableColumns.Date=le),"input-id":"tcDate",binary:!0},null,8,["modelValue"]),Se("label",rJ,it(t.$t("ui.date")),1)]),Se("div",sJ,[xt(R,{class:"mr-2",modelValue:r.settings.tableColumns["Line Color"],"onUpdate:modelValue":e[26]||(e[26]=le=>r.settings.tableColumns["Line Color"]=le),"input-id":"tcLineColor",binary:!0},null,8,["modelValue"]),Se("label",oJ,it(t.$t("ui.lineColor")),1)]),Se("div",aJ,[xt(R,{class:"mr-2",modelValue:r.settings.tableColumns["Line Weight"],"onUpdate:modelValue":e[27]||(e[27]=le=>r.settings.tableColumns["Line Weight"]=le),"input-id":"tcLineWeight",binary:!0},null,8,["modelValue"]),Se("label",lJ,it(t.$t("ui.lineWeight")),1)]),Se("div",uJ,[xt(R,{class:"mr-2",modelValue:r.settings.tableColumns.Comments,"onUpdate:modelValue":e[28]||(e[28]=le=>r.settings.tableColumns.Comments=le),"input-id":"tcComments",binary:!0},null,8,["modelValue"]),Se("label",cJ,it(t.$t("ui.comments")),1)])])):Be("",!0)])])])):Be("",!0)]),_:1}),xt(sl,{name:"slide"},{default:Vt(()=>[r.showAboutPanel?(X(),se("div",dJ,[Se("div",hJ,[xt(g,{icon:"pi pi-times",severity:"secondary",text:"",rounded:"","aria-label":"Close",onClick:e[29]||(e[29]=le=>r.showAboutPanel=!1)})]),xt(k,{"resource-info":s.manifestInfo,"card-title":t.$t("ui.about")},null,8,["resource-info","card-title"]),s.currentCanvasInfo?(X(),gt(k,{key:0,"resource-info":s.currentCanvasInfo,"card-title":t.$t("ui.canvasInformation")},null,8,["resource-info","card-title"])):Be("",!0),Se("div",fJ,[Se("span",pJ,"Powered by Glycerine Viewer (v"+it(n.version)+")",1),e[44]||(e[44]=Se("a",{target:"_blank",class:"mr-2",title:"Website",href:"https://glycerine.io/viewer/"},[Se("i",{class:"pi pi-globe"})],-1)),e[45]||(e[45]=Se("a",{target:"_blank",title:"GitHub",href:"https://github.com/Systemik-Solutions/glycerine-viewer"},[Se("i",{class:"pi pi-github"})],-1))])])):Be("",!0)]),_:1}),xt(sl,{name:"slide"},{default:Vt(()=>[r.showCollectionPanel?(X(),se("div",mJ,[Se("div",gJ,[xt(g,{icon:"pi pi-times",severity:"secondary",text:"",rounded:"","aria-label":"Close",onClick:e[30]||(e[30]=le=>r.showCollectionPanel=!1)})]),xt(k,{"resource-info":s.collectionInfo,"card-title":t.$t("ui.collection"),"title-icon":"book",toggleable:!0,collapsed:!0},null,8,["resource-info","card-title"]),s.collectionInfo.items.length>0?(X(),se("div",yJ,[Se("div",vJ,null,512),xt(q,{value:s.collectionInfo.items,tableClass:"w-full",paginator:"",rows:r.collectionTableOptions.rowsPerPage,selectionMode:"single",dataKey:"id",paginatorTemplate:"PrevPageLink JumpToPageDropdown NextPageLink",filters:r.collectionTableOptions.searchFilter,"onUpdate:filters":e[32]||(e[32]=le=>r.collectionTableOptions.searchFilter=le),globalFilterFields:["label"],onPage:s.collectionTableScrollTop,selection:s.collectionTableActiveItem,onRowSelect:s.onCollectionItemRowSelect,first:s.collectionTableFirstIndex},{header:Vt(()=>[Se("div",bJ,[Se("div",_J,[e[46]||(e[46]=Se("i",{class:"pi pi-search"},null,-1)),xt(M,{modelValue:r.collectionTableOptions.searchFilter.global.value,"onUpdate:modelValue":e[31]||(e[31]=le=>r.collectionTableOptions.searchFilter.global.value=le),placeholder:t.$t("ui.search"),class:"w-full"},null,8,["modelValue","placeholder"])])])]),empty:Vt(()=>[Vi(it(t.$t("message.noResults")),1)]),default:Vt(()=>[xt(L,{style:{width:"20%"},field:"thumbnail",header:t.$t("ui.thumbnail")},{body:Vt(le=>[le.data.thumbnail?(X(),se("img",{key:0,class:"w-full",src:le.data.thumbnail,alt:""},null,8,wJ)):le.data.type==="Collection"?(X(),se("div",TJ,e[47]||(e[47]=[Se("i",{class:"pi pi-book text-color-secondary",style:{"font-size":"1rem"}},null,-1)]))):(X(),se("div",xJ,e[48]||(e[48]=[Se("i",{class:"pi pi-file text-color-secondary",style:{"font-size":"1rem"}},null,-1)])))]),_:1},8,["header"]),xt(L,{style:{width:"80%"},field:"label",header:t.$t("ui.label")},{body:Vt(le=>[le.data.label?(X(),se("span",SJ,it(le.data.label),1)):(X(),se("span",EJ,"NA"))]),_:1},8,["header"])]),_:1},8,["value","rows","filters","onPage","selection","onRowSelect","first"])])):Be("",!0)])):Be("",!0)]),_:1}),xt(sl,{name:"slide"},{default:Vt(()=>[r.showIndexPanel?(X(),se("div",CJ,[Se("div",AJ,null,512),Se("div",DJ,[xt(g,{icon:"pi pi-times",severity:"secondary",text:"",rounded:"","aria-label":"Close",onClick:e[33]||(e[33]=le=>r.showIndexPanel=!1)})]),Se("h3",null,[e[49]||(e[49]=Se("i",{class:"pi pi-list"},null,-1)),Vi(" "+it(t.$t("ui.index")),1)]),xt(ae,{class:"gv-index-tabs"},{default:Vt(()=>[xt(Z,{header:t.$t("ui.items")},{default:Vt(()=>[xt(q,{value:s.indexItems,tableClass:"w-full",paginator:"",rows:r.index.rowsPerPage,selectionMode:"single",dataKey:"id",paginatorTemplate:"PrevPageLink JumpToPageDropdown NextPageLink",filters:r.index.searchFilter,"onUpdate:filters":e[35]||(e[35]=le=>r.index.searchFilter=le),globalFilterFields:["label"],onPage:s.indexPanelScrollTop,selection:s.activeIndexItem,onRowSelect:s.onIndexRowSelect,first:s.indexTableFirstIndex},{header:Vt(()=>[Se("div",PJ,[Se("div",kJ,[e[50]||(e[50]=Se("i",{class:"pi pi-search"},null,-1)),xt(M,{modelValue:r.index.searchFilter.global.value,"onUpdate:modelValue":e[34]||(e[34]=le=>r.index.searchFilter.global.value=le),placeholder:t.$t("ui.search"),class:"w-full"},null,8,["modelValue","placeholder"])])])]),empty:Vt(()=>[Vi(it(t.$t("message.noResults")),1)]),default:Vt(()=>[xt(L,{style:{width:"20%"},field:"thumbnail",header:t.$t("ui.thumbnail")},{body:Vt(le=>[le.data.thumbnail?(X(),se("img",{key:0,class:"w-full",src:le.data.thumbnail,alt:""},null,8,IJ)):le.data.type==="Audio"?(X(),se("div",RJ,e[51]||(e[51]=[Se("i",{class:"pi pi-volume-up text-color-secondary",style:{"font-size":"1rem"}},null,-1)]))):le.data.type==="Video"?(X(),se("div",OJ,e[52]||(e[52]=[Se("i",{class:"pi pi-video text-color-secondary",style:{"font-size":"1rem"}},null,-1)]))):Be("",!0)]),_:1},8,["header"]),xt(L,{style:{width:"80%"},field:"label",header:t.$t("ui.label")},{body:Vt(le=>[le.data.label?(X(),se("span",LJ,it(le.data.label),1)):(X(),se("span",MJ,"NA"))]),_:1},8,["header"])]),_:1},8,["value","rows","filters","onPage","selection","onRowSelect","first"])]),_:1},8,["header"]),s.structureNodes.length>0?(X(),gt(Z,{key:0,header:t.$t("ui.structures")},{default:Vt(()=>[xt(J,{value:s.structureNodes,class:"w-full",selectionMode:"single",selectionKeys:s.selectedStructureNodes,expandedKeys:s.expandedStructureNodes,onNodeSelect:s.onStructureNodeSelect},null,8,["value","selectionKeys","expandedKeys","onNodeSelect"])]),_:1},8,["header"])):Be("",!0)]),_:1})])):Be("",!0)]),_:1})],16)):(X(),se("div",FJ,[Se("img",{class:Tt({"gv-start-logo":!0,animation:s.manifestIsLoading}),src:n.logoPath,alt:"Glycerine"},null,10,NJ),s.manifestHadErrors?(X(),se("div",BJ,[(X(!0),se(ct,null,Kt(r.manifestErrors,le=>(X(),gt(ye,{style:{"max-width":"400px"},severity:"error",closable:!1},{default:Vt(()=>[Vi(it(le),1)]),_:2},1024))),256))])):Be("",!0)])),r.showDropZone?(X(),se("div",{key:2,class:"drop-zone w-full h-full overflow-hidden flex flex-column align-items-center justify-content-center gap-2",onDragleave:e[36]||(e[36]=le=>s.onManifestDragLeave(le)),onDrop:e[37]||(e[37]=le=>s.onManifestDrop(le))},[e[53]||(e[53]=Se("div",null,[Se("i",{class:"pi pi-file",style:{"font-size":"5rem"}})],-1)),Se("div",null,it(t.$t("ui.dropManifests")),1)],32)):Be("",!0)],32)}const hR=ma(VZ,[["render",HJ],["__scopeId","data-v-f7325bf7"]]),UJ={install(t,e){t.use(zB,{ripple:!0}),t.use(n5),t.component("GlycerineViewer",hR)}};class zJ{constructor(e,i={}){Gr(this,u0);this.element=e,this.options=i,this.rootProps=If(dr(this,u0,rF).call(this)),this.app=LB(hR,this.rootProps),this.app.use(UJ),this.rootComponent=null}init(){this.options.width?this.element.style.width=this.options.width:this.element.style.width="100%",this.options.height?this.element.style.height=this.options.height:this.element.style.height="600px",this.rootComponent=this.app.mount(this.element)}async openManifest(e){await this.rootComponent.openManifest(e)}activateCanvas(e){this.rootComponent.activateCanvas(e)}highlightAnnotation(e){this.rootComponent.highlightAnnotation(e)}clearHighlight(){this.rootComponent.clearHighlight()}setAnnotationIdFilter(e=null){this.rootComponent.setUserAnnotationFilter(e)}destroy(){this.app&&(this.app.unmount(),this.app=null)}}return u0=new WeakSet,rF=function(){return{manifest:this.options.manifest,defaultInfoPanel:this.options.defaultInfoPanel,showFullScreenButton:this.options.showFullScreenButton,showIndexButton:this.options.showIndexButton,showAnnotationViewButton:this.options.showAnnotationViewButton,showAboutPaneButton:this.options.showAboutPaneButton,showSettingPaneButton:this.options.showSettingPaneButton,showCollectionPaneButton:this.options.showCollectionPaneButton,showManifestUrl:this.options.showManifestUrl,displayAnnotations:this.options.displayAnnotations,enableDropManifest:this.options.enableDropManifest,toggleIndexPanel:this.options.toggleIndexPanel,toggleAboutPanel:this.options.toggleAboutPanel,onOsdInitialized:this.options.onOsdInitialized,onManifestLoaded:this.options.onManifestLoaded,onCanvasLoaded:this.options.onCanvasLoaded,onCanvasAnnotationsLoaded:this.options.onCanvasAnnotationsLoaded,onMouseEnterAnnotation:this.options.onMouseEnterAnnotation,onMouseLeaveAnnotation:this.options.onMouseLeaveAnnotation,onAnnotationPopupOpened:this.options.onAnnotationPopupOpened,onAnnotationPopupClosed:this.options.onAnnotationPopupClosed,onViewModeChanged:this.options.onViewModeChanged,onIndexPanelClosed:this.options.onIndexPanelClosed,onAboutPanelClosed:this.options.onAboutPanelClosed}},zJ});