(function(L){function xb(){var n=navigator.userAgent.toLowerCase();if(n.indexOf("micromessenger")!==-1||typeof wx!=="undefined"&&wx.miniProgram||L.WeixinJSBridge||document.getElementById("wechat-browser"))return!0;n.indexOf("wxwork");return!1}function ib(n){var J=document.documentElement;J.exitFullscreen?J.exitFullscreen():J.mozCancelFullScreen?J.mozCancelFullScreen():J.webkitCancelFullScreen?J.webkitCancelFullScreen():document.exitFullscreen?document.exitFullscreen():document.webkitCancelFullScreen?
document.webkitCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.oRequestFullscreen?document.oCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():(J=document.body,document.documentElement.style.cssText="",J.style.cssText="",n.style.cssText="",document.IsFullScreen=!1)}function ab(){return document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||
!1}function yb(n,J,v){var z=new Date;z.setTime(z.getTime()+v*24*60*60*1E3);v="expires="+z.toGMTString();document.cookie=n+"="+J+"; "+v}function Ha(n,J,v){if(n){var z=parseInt(n.style.opacity)||1;z*=100;J=parseInt(J/50);J===0&&(J=1);var M=z/J;M<5&&(M=5);var P=setInterval(function(){z>0?(z-=M,z<0&&(z=0),n.style.opacity=z/100):(clearInterval(P),typeof v=="function"&&v(n))},50);return P}return null}function jb(n,J,v){if(n){var z=n.style.opacity;z*=100;J=parseInt(J/50);J===0&&(J=1);var M=(100-z)/J;M<5&&
(M=5);var P=null;return P=setInterval(function(){z<100?(z+=M,z>100&&(z=100),n.style.opacity=z/100):(clearInterval(P),typeof v=="function"&&v(n))},50)}return null}function kb(n,J){if(!n)return!1;if(n==J)return!0;var v=n.indexOf(J);if(v<0)return!1;if(v>0){if(n.charAt(v-1)==" "&&(n.length-v==J.length||n.charAt(v+J.length)==" "))return!0}else if(n.charAt(J.length)==" ")return!0;return!1}function lb(n,J,v){var z=new XMLHttpRequest;z.onreadystatechange=function(){z.readyState===4&&(z.status>=200&&z.status<
300||z.status===304?J(z.response):typeof v==="function"&&v(z))};z.open("GET",n,!0);z.send(null)}function zb(n){const J=function(P,D,Q){for(var U=Q.length,W=0;W<U;W++)P.setUint8(D+W,Q.charCodeAt(W))};var v=function(){var P=new ArrayBuffer(364);let D=new DataView(P);J(D,0,"RIFF");D.setUint32(4,204,!0);J(D,8,"WAVE");J(D,12,"fmt ");D.setUint32(16,16,!0);D.setUint16(20,1,!0);D.setUint16(22,1,!0);D.setUint32(24,16E3,!0);D.setUint32(28,32E3,!0);D.setUint16(32,4,!0);D.setUint16(34,16,!0);J(D,36,"data");D.setUint32(40,
320,!0);let Q=44;for(let U=0;U<160;U++)D.setInt16(Q,15,!0),Q+=2;P=new Uint8Array(P);return"data:audio/x-wav;base64,"+btoa(String.fromCharCode.apply(null,P))}(),z=new Audio(v),M=L.setTimeout(function(){M=0;typeof n==="function"&&n(!1)},500);z.play().then(function(){M&&L.clearTimeout(M);z.pause();n(!0)}).catch(function(P){M&&L.clearTimeout(M);typeof n==="function"&&n(!1)})}async function Ab(n){navigator.clipboard&&navigator.clipboard.write([new ClipboardItem({[n.type]:n})]).then(()=>{}).catch(J=>{})}
function Bb(){var n=new Date,J=n.getMonth()+1;J<10&&(J="0"+J);var v=n.getDate();v<10&&(v="0"+v);var z=n.getHours();z<10&&(z="0"+z);var M=n.getMinutes();M<10&&(M="0"+M);var P=n.getSeconds();P<10&&(P="0"+P);var D=n.getMilliseconds();D<10?D="00"+D:D<100&&(D="0"+D);return""+n.getFullYear()+J+v+z+M+P+D}function Cb(n){var J={font_size:.4,font_color:"#FFFFFF",background_alpha:.5,background_color:"#9C27B0",Stroke:"none",body:[]},v=function(D){D=D.split(":");if(D.length!==3)return 0;var Q=parseInt(D[0],10)*
3600,U=parseInt(D[1],10)*60,W=parseInt(D[2],10),ea=D[2].indexOf(","),aa=0;ea>0&&(aa=parseInt(D[2].substr(ea+1))/1E3);return Q+U+W+aa};n=n.replace(/\r/g,"");n=n.split("\n");for(var z=0;z<n.length-2;){var M={},P=n[z].trim();if(P){M.id=parseInt(P);P=n[z+1].split(" --\x3e ");if(P.length!==2)break;M.from=v(P[0].trim());M.to=v(P[1].trim());M.location=2;M.content=n[z+2].trim();J.body.push(M);z+=3}else z++}return J}function mb(n){var J={font_size:.4,font_color:"#FFFFFF",background_alpha:.5,background_color:"#9C27B0",
Stroke:"none",body:[]},v=function(D){D=D.split(":");var Q=0,U=0;if(D.length===3){Q=parseInt(D[0],10)*3600;U=parseInt(D[1],10)*60;var W=parseInt(D[2],10)}else if(D.length===2)U=parseInt(D[0],10)*60,W=parseInt(D[1],10);else if(D.length===1)W=parseInt(D[0],10);else return 0;var ea=D.length-1,aa=D[ea].indexOf("."),X=0;aa>0&&(X=parseInt(D[ea].substr(aa+1))/1E3);return Q+U+W+X};n=n.replace(/\r/g,"");n=n.split("\n");if(n.length<2||n[0].substr(0,6)!=="WEBVTT"||n[1].trim().length!==0)return null;for(var z=
2;z<=n.length-2;){var M={};if(!n[z].startsWith("NOTE")&&n[z].trim()!==""){var P=n[z].split(" --\x3e ");if(P.length!==2&&(P=n[z].trim(),M.id=parseInt(P),z++,P=n[z].split(" --\x3e "),P.length!==2)){z++;continue}M.from=v(P[0].trim());M.to=v(P[1].trim());M.location=2;z++;M.content=n[z].trim();for(z++;z<n.length;){P=n[z].trim();if(!P)break;M.content+="<br/>"+P;z++}J.body.push(M)}z++}return J}function nb(n){return!(!n.width()&&!n.height())&&n.css("display")!=="none"}function Db(n,J){var v="smilesFaces-view",
z=Za.path+"widgets/smiles/p",M=$$(n);if(!M.hasClass("disabled")){v=M.attr("data-viewid");if(!M.attr("data-viewinit")&&$$("#"+v).length<=0){var P=M.closest(".zwp-barrage_form");n='<div id="'+v+'" style="position:absolute;display:none;z-index:1138;" class="zwp-smileview"><table border="0" cellspacing="0" cellpadding="0"><tr>';for(var D=1;D<=40;D++){var Q="[sm-"+D+"]";n+='<td><img src="'+z+D+'.png" onclick="insertSmile(this,\''+Q+"');\" /></td>";D%8==0&&(n+="</tr><tr>")}P.append(n+"</tr></table></div>");
M.attr("data-viewinit","1");$$(document).click(function(){$$("#"+v).hide()});$$(L).on("resize",function(){var ea=$$("#"+v);nb(ea)&&(M.offset(),ea.outerHeight(!1),M.outerWidth(!1),ea.outerWidth(!1))})}var U=$$("#"+v);if(nb(U))U.hide();else{M.offset();U[0].style.opacity=0;U[0].style.display="block";U.outerHeight(!1);M.outerWidth(!1);U.outerWidth(!1);z=M.parent().children("DIV.zwp-barrage_inp").children(".barrage_inp_text");U.get(0).inputbox=z.get(0);U.css({bottom:"36px",right:"26px"}).show();var W=
function(){var ea=parseFloat(U[0].style.opacity);ea<=1&&(ea+=.1,ea>1&&(ea=1),U[0].style.opacity=ea,setTimeout(W,50))};setTimeout(W,50)}if(J=J||L.event)J.preventDefault?(J.preventDefault(),J.stopPropagation()):(L.event.cancelBubble=!0,L.event.returnValue=!1)}}function Eb(n){var J=$$;n.find("a.barrage-tab-link").each(function(v){var z=J(this);v===0?z.html(H("danmuSendSettings","Send Settings")+'<i class="bottom-line"></i>'):v===1?z.html(H("danmuViewSettings","View Settings")+'<i class="bottom-line"></i>'):
v===2&&z.html(H("danmuBlockSettings","Block Settings")+'<i class="bottom-line"></i>')});n.find(".set-label").each(function(){var v=J(this),z=v.text();z==="\u6587\u5b57\u989c\u8272"?v.text(H("danmuTextColor","Text Color")):z==="\u6587\u5b57\u8fb9\u6846"?v.text(H("danmuTextBorder","Border")):z==="\u4e0d\u900f\u660e\u5ea6"?v.text(H("danmuOpacity","Opacity")):z==="\u6587\u5b57\u5927\u5c0f"?v.text(H("danmuFontSize","Font Size")):z==="\u6eda\u52a8\u901f\u5ea6"?v.text(H("danmuScrollSpeed","Scroll Speed")):
z==="\u6392\u5217\u5bc6\u5ea6"&&v.text(H("danmuDensity","Density"))});n.find(".set-rol-left").each(function(){var v=J(this),z=v.text();z==="\u4e0d\u900f\u660e\u5ea6"?v.text(H("danmuOpacity","Opacity")):z==="\u6587\u5b57\u5927\u5c0f"?v.text(H("danmuFontSize","Font Size")):z==="\u6eda\u52a8\u901f\u5ea6"?v.text(H("danmuScrollSpeed","Scroll Speed")):z==="\u6392\u5217\u5bc6\u5ea6"&&v.text(H("danmuDensity","Density"))});n.find(".pb-title").each(function(){var v=J(this),z=v.text();z==="\u5e95\u90e8\u533a\u57df"?
v.text(H("danmuBottomArea","Bottom Area")):z==="\u5f69\u8272\u6587\u5b57"?v.text(H("colorfulText","Color")):z==="\u56fe\u7247\u8868\u60c5"&&v.text(H("imageEmoji","Emoji"))});n.find("a.barrage-set-rest").each(function(){var v=J(this);v.text()==="\u91cd\u7f6e"&&v.text(H("reset","Reset"))})}function Fb(n,J){if(n.dragableWinInited)typeof n.zwpDragable==="object"&&("oldX"in n.zwpDragable&&(n.style.left=n.zwpDragable.oldX+"px"),"oldY"in n.zwpDragable&&(n.style.top=n.zwpDragable.oldY+"px"),"oldWidth"in n.zwpDragable&&
(n.style.width=n.zwpDragable.oldWidth+"px"),"oldHeight"in n.zwpDragable&&(n.style.height=n.zwpDragable.oldHeight+"px"));else{var v='<div class="zwp-captionbar"><button class="closeBtn" title="'+(H("closeSmallWindow","Close small window")+'"><i class="xicon xicon-close"></i></button></div><div class="zwp-gripper-right"></div><div class="zwp-gripper-bottom"></div><div class="zwp-gripper-bottom-right"></div>');n.insertAdjacentHTML("beforeend",v);var z=function(W){W.stopPropagation();W.preventDefault();
var ea=parseInt(n.offsetLeft),aa=parseInt(n.offsetTop),X=W.pageX,ma=W.pageY,ta=L.innerWidth-n.offsetWidth-20,ua=L.innerHeight-n.offsetHeight-20,ja=function(wa){var Fa=ea+wa.pageX-X;wa=aa+wa.pageY-ma;Fa<0&&(Fa=0);wa<0&&(wa=0);Fa>ta&&(Fa=ta);wa>ua&&(wa=ua);n.style.left=Fa+"px";n.style.top=wa+"px";typeof n.zwpDragable==="object"&&(n.zwpDragable.oldX=Fa,n.zwpDragable.oldY=wa)},ya=function(wa){document.removeEventListener("mousemove",ja);document.removeEventListener("mouseup",ya)};document.addEventListener("mousemove",
ja);document.addEventListener("mouseup",ya)};v=function(W){W.stopPropagation();W.preventDefault();var ea=n.offsetWidth,aa=W.pageX,X=function(ta){ta=ea+ta.pageX-aa;ta<200&&(ta=200);n.style.width=ta+"px";typeof n.zwpDragable==="object"&&(n.zwpDragable.oldWidth=ta)},ma=function(ta){document.removeEventListener("mousemove",X);document.removeEventListener("mouseup",ma)};document.addEventListener("mousemove",X);document.addEventListener("mouseup",ma)};var M=function(W){W.stopPropagation();W.preventDefault();
var ea=n.offsetHeight,aa=W.pageY,X=function(ta){ta=ea+ta.pageY-aa;ta<180&&(ta=180);n.style.height=ta+"px";typeof n.zwpDragable==="object"&&(n.zwpDragable.oldHeight=ta)},ma=function(ta){document.removeEventListener("mousemove",X);document.removeEventListener("mouseup",ma)};document.addEventListener("mousemove",X);document.addEventListener("mouseup",ma)},P=function(W){W.stopPropagation();W.preventDefault();var ea=n.offsetWidth,aa=n.offsetHeight,X=W.pageX,ma=W.pageY,ta=function(ja){var ya=ea+ja.pageX-
X;ya<200&&(ya=200);ja=aa+ja.pageY-ma;ja<180&&(ja=180);n.style.width=ya+"px";n.style.height=ja+"px";typeof n.zwpDragable==="object"&&(n.zwpDragable.oldWidth=ya,n.zwpDragable.oldHeight=ja)},ua=function(ja){document.removeEventListener("mousemove",ta);document.removeEventListener("mouseup",ua)};document.addEventListener("mousemove",ta);document.addEventListener("mouseup",ua)};n.zwpDragable={};var D=n.querySelector(".zwp-captionbar");if(D){var Q=D.querySelector(".closeBtn");if(Q){var U=J||function(){};
Q.addEventListener("click",function(W){W.preventDefault();W.stopPropagation();U(n)})}D.addEventListener("mousedown",z);n.zwpDragable.doc_mousedown=z}J=n.querySelector(".zwp-gripper-right");z=n.querySelector(".zwp-gripper-bottom");D=n.querySelector(".zwp-gripper-bottom-right");J&&(J.addEventListener("mousedown",v),n.zwpDragable.gripperR_mousedown=v);z&&(z.addEventListener("mousedown",M),n.zwpDragable.gripperB_mousedown=M);D&&(D.addEventListener("mousedown",P),n.zwpDragable.gripperBR_mousedown=P);n.dragableWinInited=
!0}}(function(n){var J=!1,v=!1,z=0,M=2E3,P=0,D=document,Q=n(L),U=[],W=L.requestAnimationFrame||L.webkitRequestAnimationFrame||L.mozRequestAnimationFrame||!1,ea=L.cancelAnimationFrame||L.webkitCancelAnimationFrame||L.mozCancelAnimationFrame||!1;if(W)L.cancelAnimationFrame||(ea=function(ba){});else{var aa=0;W=function(ba,I){var y=(new Date).getTime(),E=Math.max(0,16-(y-aa));I=L.setTimeout(function(){ba(y+E)},E);aa=y+E;return I};ea=function(ba){L.clearTimeout(ba)}}var X=L.MutationObserver||L.WebKitMutationObserver||
!1,ma=Date.now||function(){return(new Date).getTime()},ta={zindex:"auto",cursoropacitymin:0,cursoropacitymax:1,cursorcolor:"#424242",cursorwidth:"6px",cursorborder:"1px solid #fff",cursorborderradius:"5px",scrollspeed:40,mousescrollstep:27,touchbehavior:!1,emulatetouch:!1,hwacceleration:!0,usetransition:!0,boxzoom:!1,dblclickzoom:!0,gesturezoom:!0,grabcursorenabled:!0,autohidemode:!0,background:"",iframeautoresize:!0,cursorminheight:32,preservenativescrolling:!0,railoffset:!1,railhoffset:!1,bouncescroll:!0,
spacebarenabled:!0,railpadding:{top:0,right:0,left:0,bottom:0},disableoutline:!0,horizrailenabled:!0,rightdock:0,railalign:"right",railvalign:"bottom",enabletranslate3d:!0,enablemousewheel:!0,enablekeyboard:!0,smoothscroll:!0,sensitiverail:!0,enablemouselockapi:!0,cursorfixedheight:!1,directionlockdeadzone:6,hidecursordelay:400,nativeparentscrolling:!0,enablescrollonselection:!0,overflowx:!0,overflowy:!0,cursordragspeed:.3,rtlmode:"auto",cursordragontouch:!1,oneaxismousemode:"auto",scriptpath:function(){var ba;
(ba=D.currentScript)||(ba=D.getElementsByTagName("script"),ba=ba.length?ba[ba.length-1]:!1);ba=ba?ba.src.split("?")[0]:"";return ba.split("/").length>0?ba.split("/").slice(0,-1).join("/")+"/":""}(),preventmultitouchscrolling:!0,disablemutationobserver:!1,enableobserver:!0,scrollbarid:!1,scrollCLass:!1},ua=!1,ja=function(){if(ua)return ua;var ba=D.createElement("DIV"),I=ba.style,y=navigator.userAgent,E=navigator.platform,A={};A.haspointerlock="pointerLockElement"in D||"webkitPointerLockElement"in D||
"mozPointerLockElement"in D;A.isopera="opera"in L;A.isopera12=A.isopera&&"getUserMedia"in navigator;A.isoperamini=Object.prototype.toString.call(L.operamini)==="[object OperaMini]";A.isie="all"in D&&"attachEvent"in ba&&!A.isopera;A.isieold=A.isie&&!("msInterpolationMode"in I);A.isie7=A.isie&&!A.isieold&&(!("documentMode"in D)||D.documentMode===7);A.isie8=A.isie&&"documentMode"in D&&D.documentMode===8;A.isie9=A.isie&&"performance"in L&&D.documentMode===9;A.isie10=A.isie&&"performance"in L&&D.documentMode===
10;A.isie11="msRequestFullscreen"in ba&&D.documentMode>=11;A.ismsedge="msCredentials"in L;A.ismozilla="MozAppearance"in I;A.iswebkit=!A.ismsedge&&"WebkitAppearance"in I;A.ischrome=A.iswebkit&&"chrome"in L;A.ischrome38=A.ischrome&&"touchAction"in I;A.ischrome22=!A.ischrome38&&A.ischrome&&A.haspointerlock;A.ischrome26=!A.ischrome38&&A.ischrome&&"transition"in I;A.cantouch="ontouchstart"in D.documentElement||"ontouchstart"in L;A.hasw3ctouch=(L.PointerEvent||!1)&&(navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>
0);A.hasmstouch=!A.hasw3ctouch&&(L.MSPointerEvent||!1);A.ismac=/^mac$/i.test(E);A.isios=A.cantouch&&/iphone|ipad|ipod/i.test(E);A.isios4=A.isios&&!("seal"in Object);A.isios7=A.isios&&"webkitHidden"in D;A.isios8=A.isios&&"hidden"in D;A.isios10=A.isios&&L.Proxy;A.isandroid=/android/i.test(y);A.haseventlistener="addEventListener"in ba;A.trstyle=!1;A.hastransform=!1;A.hastranslate3d=!1;A.transitionstyle=!1;A.hastransition=!1;A.transitionend=!1;A.trstyle="transform";A.hastransform="transform"in I||function(){for(var V=
["msTransform","webkitTransform","MozTransform","OTransform"],f=0,x=V.length;f<x;f++)if(I[V[f]]!==void 0){A.trstyle=V[f];break}A.hastransform=!!A.trstyle}();A.hastransform&&(I[A.trstyle]="translate3d(1px,2px,3px)",A.hastranslate3d=/translate3d/.test(I[A.trstyle]));A.transitionstyle="transition";A.prefixstyle="";A.transitionend="transitionend";A.hastransition="transition"in I||function(){A.transitionend=!1;for(var V="webkitTransition msTransition MozTransition OTransition OTransition KhtmlTransition".split(" "),
f="-webkit- -ms- -moz- -o- -o -khtml-".split(" "),x="webkitTransitionEnd msTransitionEnd transitionend otransitionend oTransitionEnd KhtmlTransitionEnd".split(" "),b=0,r=V.length;b<r;b++)if(V[b]in I){A.transitionstyle=V[b];A.prefixstyle=f[b];A.transitionend=x[b];break}A.ischrome26&&(A.prefixstyle=f[1]);A.hastransition=A.transitionstyle}();A.cursorgrabvalue=function(){var V=["grab","-webkit-grab","-moz-grab"];if(A.ischrome&&!A.ischrome38||A.isie)V=[];for(var f=0,x=V.length;f<x;f++){var b=V[f];I.cursor=
b;if(I.cursor==b)return b}return"url("+(ta.scriptpath+"css/openhand.cur),n-resize")}();A.hasmousecapture="setCapture"in ba;A.hasMutationObserver=X!==!1;ba=null;return ua=A},ya=function(ba,I){function y(){var p=b.doc.css(t.trstyle);return p&&p.substr(0,6)=="matrix"?p.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/):!1}function E(){var p=b.win;if("zIndex"in p)return p.zIndex();for(;p.length>0&&p[0].nodeType!=9;){var B=p.css("zIndex");if(!isNaN(B)&&B!==0)return parseInt(B);p=p.parent()}return!1}
function A(p,B,C){B=p.css(B);p=parseFloat(B);return isNaN(p)?(p=Y[B]||0,C=p==3?C?b.win.outerHeight()-b.win.innerHeight():b.win.outerWidth()-b.win.innerWidth():1,b.isie8&&p&&(p+=1),C?p:0):p}function V(p,B,C,l){b._bind(p,B,function(w){w=w||L.event;var F={original:w,target:w.target||w.srcElement,type:"wheel",deltaMode:w.type=="MozMousePixelScroll"?0:1,deltaX:0,deltaZ:0,preventDefault:function(){w.preventDefault?w.preventDefault():w.returnValue=!1;return!1},stopImmediatePropagation:function(){w.stopImmediatePropagation?
w.stopImmediatePropagation():w.cancelBubble=!0}};B=="mousewheel"?(w.wheelDeltaX&&(F.deltaX=-.025*w.wheelDeltaX),w.wheelDeltaY&&(F.deltaY=-.025*w.wheelDeltaY),F.deltaY||F.deltaX||(F.deltaY=-.025*w.wheelDelta)):F.deltaY=w.detail;return C.call(p,F)},l)}function f(p,B,C,l){b.scrollrunning||(b.newscrolly=b.getScrollTop(),b.newscrollx=b.getScrollLeft(),va=ma());var w=ma()-va;va=ma();ka=w>350?1:ka+(2-ka)/10;p=p*ka|0;B=B*ka|0;if(p){if(l)if(p<0){if(b.getScrollLeft()>=b.page.maxw)return!0}else if(b.getScrollLeft()<=
0)return!0;l=p>0?1:-1;Ka!==l&&(b.scrollmom&&b.scrollmom.stop(),b.newscrollx=b.getScrollLeft(),Ka=l);b.lastdeltax-=p}if(B){if(function(){var F=b.getScrollTop();if(B<0){if(F>=b.page.maxh)return!0}else if(F<=0)return!0}()){if(q.nativeparentscrolling&&C&&!b.ispage&&!b.zoomactive)return!0;C=b.view.h>>1;b.newscrolly<-C?(b.newscrolly=-C,B=-1):b.newscrolly>b.page.maxh+C?(b.newscrolly=b.page.maxh+C,B=1):B=0}C=B>0?1:-1;e!==C&&(b.scrollmom&&b.scrollmom.stop(),b.newscrolly=b.getScrollTop(),e=C);b.lastdeltay-=
B}(B||p)&&b.synched("relativexy",function(){var F=b.lastdeltay+b.newscrolly;b.lastdeltay=0;var T=b.lastdeltax+b.newscrollx;b.lastdeltax=0;b.rail.drag||b.doScrollPos(T,F)})}function x(p,B,C){if(!C&&Da)return!0;if(p.deltaMode===0){var l=-(q.mousescrollstep/54*p.deltaX)|0;var w=-(q.mousescrollstep/54*p.deltaY)|0}else p.deltaMode===1&&(l=-(p.deltaX*q.mousescrollstep*50/80)|0,w=-(p.deltaY*q.mousescrollstep*50/80)|0);B&&q.oneaxismousemode&&l===0&&w&&(l=w,w=0,C&&(l<0?b.getScrollLeft()>=b.page.maxw:b.getScrollLeft()<=
0)&&(w=l,l=0));b.isrtlmode&&(l=-l);if(f(l,w,C,!0))C&&(Da=!0);else return Da=!1,p.stopImmediatePropagation(),p.preventDefault()}var b=this;this.version="3.7.6";this.name="nicescroll";this.me=I;var r=n("body"),q=this.opt={doc:r,win:!1};n.extend(q,ta);q.snapbackspeed=80;if(ba)for(var S in q)ba[S]!==void 0&&(q[S]=ba[S]);q.disablemutationobserver&&(X=!1);this.iddoc=(this.doc=q.doc)&&this.doc[0]?this.doc[0].id||"":"";this.ispage=/^BODY|HTML/.test(q.win?q.win[0].nodeName:this.doc[0].nodeName);this.haswrapper=
q.win!==!1;this.win=q.win||(this.ispage?Q:this.doc);this.docscroll=this.ispage&&!this.haswrapper?Q:this.win;this.body=r;this.iframe=this.isfixed=this.viewport=!1;this.isiframe=this.doc[0].nodeName=="IFRAME"&&this.win[0].nodeName=="IFRAME";this.istextarea=this.win[0].nodeName=="TEXTAREA";this.forcescreen=!1;this.canshowonmouseevent=q.autohidemode!="scroll";this.page=this.view=this.onzoomout=this.onzoomin=this.onscrollcancel=this.onscrollend=this.onscrollstart=this.onclick=this.ongesturezoom=this.onkeypress=
this.onmousewheel=this.onmousemove=this.onmouseup=this.onmousedown=!1;this.scroll={x:0,y:0};this.scrollratio={x:0,y:0};this.cursorheight=20;this.scrollvaluemax=0;q.rtlmode=="auto"?(ba=this.win[0]==L?this.body:this.win,I=ba.css("writing-mode")||ba.css("-webkit-writing-mode")||ba.css("-ms-writing-mode")||ba.css("-moz-writing-mode"),I=="horizontal-tb"||I=="lr-tb"||I===""?(this.isrtlmode=ba.css("direction")=="rtl",this.isvertical=!1):(this.isrtlmode=I=="vertical-rl"||I=="tb"||I=="tb-rl"||I=="rl-tb",this.isvertical=
I=="vertical-rl"||I=="tb"||I=="tb-rl")):(this.isrtlmode=q.rtlmode===!0,this.isvertical=!1);this.observerbody=this.observerremover=this.observer=this.scrollmom=this.scrollrunning=!1;if(q.scrollbarid!==!1)this.id=q.scrollbarid;else{do this.id="ascrail"+M++;while(D.getElementById(this.id))}this.hidden=this.locked=this.railslocked=this.hasmousefocus=this.hasfocus=this.zoomactive=this.zoom=this.selectiondrag=this.cursorfreezed=this.cursor=this.rail=!1;this.cursoractive=!0;this.wheelprevented=!1;this.overflowx=
q.overflowx;this.overflowy=q.overflowy;this.nativescrollingarea=!1;this.checkarea=0;this.events=[];this.saved={};this.delaylist={};this.synclist={};this.lastdeltay=this.lastdeltax=0;this.detected=ja();var t=n.extend({},this.detected);this.ishwscroll=(this.canhwscroll=t.hastransform&&q.hwacceleration)&&b.haswrapper;this.hasreversehr=this.isrtlmode?this.isvertical?!(t.iswebkit||t.isie||t.isie11):!(t.iswebkit||t.isie&&!t.isie10&&!t.isie11):!1;this.istouchcapable=!1;t.cantouch||!t.hasw3ctouch&&!t.hasmstouch?
!t.cantouch||t.isios||t.isandroid||!t.iswebkit&&!t.ismozilla||(this.istouchcapable=!0):this.istouchcapable=!0;q.enablemouselockapi||(t.hasmousecapture=!1,t.haspointerlock=!1);this.debounced=function(p,B,C){b&&(b.delaylist[p]||(b.delaylist[p]={h:W(function(){b.delaylist[p].fn.call(b);b.delaylist[p]=!1},C)},B.call(b)),b.delaylist[p].fn=B)};this.synched=function(p,B){b.synclist[p]?b.synclist[p]=B:(b.synclist[p]=B,W(function(){b&&(b.synclist[p]&&b.synclist[p].call(b),b.synclist[p]=null)}))};this.unsynched=
function(p){b.synclist[p]&&(b.synclist[p]=!1)};this.css=function(p,B){for(var C in B)b.saved.css.push([p,C,p.css(C)]),p.css(C,B[C])};this.scrollTop=function(p){return p===void 0?b.getScrollTop():b.setScrollTop(p)};this.scrollLeft=function(p){return p===void 0?b.getScrollLeft():b.setScrollLeft(p)};var R=function(p,B,C,l,w,F,T){this.st=p;this.ed=B;this.spd=C;this.p1=l||0;this.p2=w||1;this.p3=F||0;this.p4=T||1;this.ts=ma();this.df=B-p};R.prototype={B2:function(p){return 3*(1-p)*(1-p)*p},B3:function(p){return 3*
(1-p)*p*p},B4:function(p){return p*p*p},getPos:function(){return(ma()-this.ts)/this.spd},getNow:function(){var p=(ma()-this.ts)/this.spd,B=this.B2(p)+this.B3(p)+this.B4(p);return p>=1?this.ed:this.st+this.df*B|0},update:function(p,B){this.st=this.getNow();this.ed=p;this.spd=B;this.ts=ma();this.df=this.ed-this.st;return this}};if(this.ishwscroll){this.doc.translate={x:0,y:0,tx:"0px",ty:"0px"};t.hastranslate3d&&t.isios&&this.doc.css("-webkit-backface-visibility","hidden");this.getScrollTop=function(p){if(!p){if(p=
y())return p.length==16?-p[13]:-p[5];if(b.timerscroll&&b.timerscroll.bz)return b.timerscroll.bz.getNow()}return b.doc.translate.y};this.getScrollLeft=function(p){if(!p){if(p=y())return p.length==16?-p[12]:-p[4];if(b.timerscroll&&b.timerscroll.bh)return b.timerscroll.bh.getNow()}return b.doc.translate.x};this.notifyScrollEvent=function(p){var B=D.createEvent("UIEvents");B.initUIEvent("scroll",!1,!1,L,1);B.niceevent=!0;p.dispatchEvent(B)};var ca=this.isrtlmode?1:-1;t.hastranslate3d&&q.enabletranslate3d?
(this.setScrollTop=function(p,B){b.doc.translate.y=p;b.doc.translate.ty=p*-1+"px";b.doc.css(t.trstyle,"translate3d("+b.doc.translate.tx+","+b.doc.translate.ty+",0)");B||b.notifyScrollEvent(b.win[0])},this.setScrollLeft=function(p,B){b.doc.translate.x=p;b.doc.translate.tx=p*ca+"px";b.doc.css(t.trstyle,"translate3d("+b.doc.translate.tx+","+b.doc.translate.ty+",0)");B||b.notifyScrollEvent(b.win[0])}):(this.setScrollTop=function(p,B){b.doc.translate.y=p;b.doc.translate.ty=p*-1+"px";b.doc.css(t.trstyle,
"translate("+b.doc.translate.tx+","+b.doc.translate.ty+")");B||b.notifyScrollEvent(b.win[0])},this.setScrollLeft=function(p,B){b.doc.translate.x=p;b.doc.translate.tx=p*ca+"px";b.doc.css(t.trstyle,"translate("+b.doc.translate.tx+","+b.doc.translate.ty+")");B||b.notifyScrollEvent(b.win[0])})}else this.getScrollTop=function(){return b.docscroll.scrollTop()},this.setScrollTop=function(p){b.docscroll.scrollTop(p)},this.getScrollLeft=function(){return b.hasreversehr?b.detected.ismozilla?b.page.maxw-Math.abs(b.docscroll.scrollLeft()):
b.page.maxw-b.docscroll.scrollLeft():b.docscroll.scrollLeft()},this.setScrollLeft=function(p){return setTimeout(function(){if(b)return b.hasreversehr&&(p=b.detected.ismozilla?-(b.page.maxw-p):b.page.maxw-p),b.docscroll.scrollLeft(p)},1)};this.getTarget=function(p){return p?p.target?p.target:p.srcElement?p.srcElement:!1:!1};this.hasParent=function(p,B){if(!p)return!1;for(p=p.target||p.srcElement||p||!1;p&&p.id!=B;)p=p.parentNode||!1;return p!==!1};var Y={thin:1,medium:3,thick:5};this.getDocumentScrollOffset=
function(){return{top:L.pageYOffset||D.documentElement.scrollTop,left:L.pageXOffset||D.documentElement.scrollLeft}};this.getOffset=function(){if(b.isfixed){var p=b.win.offset(),B=b.getDocumentScrollOffset();p.top-=B.top;p.left-=B.left;return p}p=b.win.offset();if(!b.viewport)return p;B=b.viewport.offset();return{top:p.top-B.top,left:p.left-B.left}};this.updateScrollBar=function(p){var B;if(b.ishwscroll)b.rail.css({height:b.win.innerHeight()-(q.railpadding.top+q.railpadding.bottom)}),b.railh&&b.railh.css({width:b.win.innerWidth()-
(q.railpadding.left+q.railpadding.right)});else{var C=b.getOffset();var l=C.top;var w=C.left-(q.railpadding.left+q.railpadding.right);l+=A(b.win,"border-top-width",!0);w+=b.rail.align?b.win.outerWidth()-A(b.win,"border-right-width")-b.rail.width:A(b.win,"border-left-width");if(B=q.railoffset)B.top&&(l+=B.top),B.left&&(w+=B.left);p=(p?p.h:b.win.innerHeight())-(q.railpadding.top+q.railpadding.bottom);B="left";var F=w;typeof q.rightdock==="number"&&(B="right",F=q.rightdock);b.railslocked||b.rail.css({top:l,
[B]:F,height:p});b.zoom&&b.zoom.css({top:l+1,left:b.rail.align==1?w-20:w+b.rail.width+4});if(b.railh&&!b.railslocked){l=C.top;w=C.left;if(B=q.railhoffset)B.top&&(l+=B.top),B.left&&(w+=B.left);l=b.railh.align?l+A(b.win,"border-top-width",!0)+b.win.innerHeight()-b.railh.height:l+A(b.win,"border-top-width",!0);w+=A(b.win,"border-left-width");b.railh.css({top:l-(q.railpadding.top+q.railpadding.bottom),left:w,width:b.railh.width})}}};this.doRailClick=function(p,B,C){if(!b.railslocked)if(b.cancelEvent(p),
"pageY"in p||(p.pageX=p.clientX+D.documentElement.scrollLeft,p.pageY=p.clientY+D.documentElement.scrollTop),B){B=C?b.doScrollLeft:b.doScrollTop;var l=C?(p.pageX-b.railh.offset().left-b.cursorwidth/2)*b.scrollratio.x:(p.pageY-b.rail.offset().top-b.cursorheight/2)*b.scrollratio.y;b.unsynched("relativexy");B(l|0)}else B=C?b.doScrollLeftBy:b.doScrollBy,l=C?b.scroll.x:b.scroll.y,p=C?p.pageX-b.railh.offset().left:p.pageY-b.rail.offset().top,C=C?b.view.w:b.view.h,B(l>=p?C:-C)};b.newscrolly=b.newscrollx=
0;b.hasanimationframe="requestAnimationFrame"in L;b.hascancelanimationframe="cancelAnimationFrame"in L;b.hasborderbox=!1;this.init=function(){b.saved.css=[];if(t.isoperamini||t.isandroid&&!("hidden"in D))return!0;q.emulatetouch=q.emulatetouch||q.touchbehavior;b.hasborderbox=L.getComputedStyle&&L.getComputedStyle(D.body)["box-sizing"]==="border-box";var p={"overflow-y":"hidden"};if(t.isie11||t.isie10)p["-ms-overflow-style"]="none";b.ishwscroll&&(this.doc.css(t.transitionstyle,t.prefixstyle+"transform 0ms ease-out"),
t.transitionend&&b.bind(b.doc,t.transitionend,b.onScrollTransitionEnd,!1));b.zindex="auto";b.zindex=b.ispage||q.zindex!="auto"?q.zindex:E()||"auto";!b.ispage&&b.zindex!="auto"&&b.zindex>P&&(P=b.zindex);b.isie&&b.zindex===0&&q.zindex=="auto"&&(b.zindex="auto");if(!b.ispage||!t.isieold){var B=b.docscroll;b.ispage&&(B=b.haswrapper?b.win:b.doc);b.css(B,p);b.ispage&&(t.isie11||t.isie)&&b.css(n("html"),p);!t.isios||b.ispage||b.haswrapper||b.css(r,{"-webkit-overflow-scrolling":"touch"});var C=n(D.createElement("div"));
C.css({position:"relative",top:0,"float":"right",width:q.cursorwidth,height:0,"background-color":q.cursorcolor,border:q.cursorborder,"background-clip":"padding-box","-webkit-border-radius":q.cursorborderradius,"-moz-border-radius":q.cursorborderradius,"border-radius":q.cursorborderradius});C.addClass("nicescroll-cursors");b.cursor=C;var l=n(D.createElement("div"));l.attr("id",b.id);l.addClass("nicescroll-rails nicescroll-rails-vr");q.scrollCLass&&l.addClass(q.scrollCLass);var w,F=["left","right",
"top","bottom"],T;for(T in F){var ra=F[T];(w=q.railpadding[ra]||0)&&l.css("padding-"+ra,w+"px")}l.append(C);l.width=Math.max(parseFloat(q.cursorwidth),C.outerWidth());l.css({width:l.width+"px",zIndex:b.zindex,background:q.background,cursor:"default"});l.visibility=!0;l.scrollable=!0;l.align=q.railalign=="left"?0:1;b.rail=l;C=b.rail.drag=!1;!q.boxzoom||b.ispage||t.isieold||(C=D.createElement("div"),b.bind(C,"click",b.doZoom),b.bind(C,"mouseenter",function(){b.zoom.css("opacity",q.cursoropacitymax)}),
b.bind(C,"mouseleave",function(){b.zoom.css("opacity",q.cursoropacitymin)}),b.zoom=n(C),b.zoom.css({cursor:"pointer",zIndex:b.zindex,backgroundImage:"url("+q.scriptpath+"zoomico.png)",height:18,width:18,backgroundPosition:"0 0"}),q.dblclickzoom&&b.bind(b.win,"dblclick",b.doZoom),t.cantouch&&q.gesturezoom&&(b.ongesturezoom=function(h){h.scale>1.5&&b.doZoomIn(h);h.scale<.8&&b.doZoomOut(h);return b.cancelEvent(h)},b.bind(b.win,"gestureend",b.ongesturezoom)));b.railh=!1;if(q.horizrailenabled){b.css(B,
{overflowX:"hidden"});C=n(D.createElement("div"));C.css({position:"absolute",top:0,height:q.cursorwidth,width:0,backgroundColor:q.cursorcolor,border:q.cursorborder,backgroundClip:"padding-box","-webkit-border-radius":q.cursorborderradius,"-moz-border-radius":q.cursorborderradius,"border-radius":q.cursorborderradius});t.isieold&&C.css("overflow","hidden");C.addClass("nicescroll-cursors");b.cursorh=C;var pa=n(D.createElement("div"));pa.attr("id",b.id+"-hr");pa.addClass("nicescroll-rails nicescroll-rails-hr");
q.scrollCLass&&pa.addClass(q.scrollCLass);pa.height=Math.max(parseFloat(q.cursorwidth),C.outerHeight());pa.css({height:pa.height+"px",zIndex:b.zindex,background:q.background});pa.append(C);pa.visibility=!0;pa.scrollable=!0;pa.align=q.railvalign=="top"?0:1;b.railh=pa;b.railh.drag=!1}b.ispage?(l.css({position:"fixed",top:0,height:"100%"}),l.css(l.align?{right:0}:{left:0}),b.body.append(l),b.railh&&(pa.css({position:"fixed",left:0,width:"100%"}),pa.css(pa.align?{bottom:0}:{top:0}),b.body.append(pa))):
(b.ishwscroll?(b.win.css("position")=="static"&&b.css(b.win,{position:"relative"}),B=b.win[0].nodeName=="HTML"?b.body:b.win,n(B).scrollTop(0).scrollLeft(0),b.zoom&&(b.zoom.css({position:"absolute",top:1,right:0,"margin-right":l.width+4}),B.append(b.zoom)),l.css({position:"absolute",top:0}),l.css(l.align?{right:0}:{left:0}),B.append(l),pa&&(pa.css({position:"absolute",left:0,bottom:0}),pa.css(pa.align?{bottom:0}:{top:0}),B.append(pa))):(b.isfixed=b.win.css("position")=="fixed",B=b.isfixed?"fixed":
"absolute",b.isfixed||(b.viewport=b.getViewport(b.win[0])),b.viewport&&(b.body=b.viewport,/fixed|absolute/.test(b.viewport.css("position"))||b.css(b.viewport,{position:"relative"})),l.css({position:B}),b.zoom&&b.zoom.css({position:B}),b.updateScrollBar(),b.body.append(l),b.zoom&&b.body.append(b.zoom),b.railh&&(pa.css({position:B}),b.body.append(pa))),t.isios&&b.css(b.win,{"-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none"}),q.disableoutline&&(t.isie&&b.win.attr("hideFocus",
"true"),t.iswebkit&&b.win.css("outline","none")));q.autohidemode===!1?(b.autohidedom=!1,b.rail.css({opacity:q.cursoropacitymax}),b.railh&&b.railh.css({opacity:q.cursoropacitymax})):q.autohidemode===!0||q.autohidemode==="leave"?(b.autohidedom=n().add(b.rail),t.isie8&&(b.autohidedom=b.autohidedom.add(b.cursor)),b.railh&&(b.autohidedom=b.autohidedom.add(b.railh)),b.railh&&t.isie8&&(b.autohidedom=b.autohidedom.add(b.cursorh))):q.autohidemode=="scroll"?(b.autohidedom=n().add(b.rail),b.railh&&(b.autohidedom=
b.autohidedom.add(b.railh))):q.autohidemode=="cursor"?(b.autohidedom=n().add(b.cursor),b.railh&&(b.autohidedom=b.autohidedom.add(b.cursorh))):q.autohidemode=="hidden"&&(b.autohidedom=!1,b.hide(),b.railslocked=!1);if(t.cantouch||b.istouchcapable||q.emulatetouch||t.hasmstouch){b.scrollmom=new wa(b);b.ontouchstart=function(h){if(b.locked||h.pointerType&&(h.pointerType==="mouse"||h.pointerType===h.MSPOINTER_TYPE_MOUSE))return!1;b.hasmoving=!1;b.scrollmom.timer&&(b.triggerScrollEnd(),b.scrollmom.stop());
if(!b.railslocked){var u=b.getTarget(h);if(u&&/INPUT/i.test(u.nodeName)&&/range/i.test(u.type))return b.stopPropagation(h);var G=h.type==="mousedown";!("clientX"in h)&&"changedTouches"in h&&(h.clientX=h.changedTouches[0].clientX,h.clientY=h.changedTouches[0].clientY);if(b.forcescreen){var O=h;h={original:h.original?h.original:h};h.clientX=O.screenX;h.clientY=O.screenY}b.rail.drag={x:h.clientX,y:h.clientY,sx:b.scroll.x,sy:b.scroll.y,st:b.getScrollTop(),sl:b.getScrollLeft(),pt:2,dl:!1,tg:u};if(b.ispage||
!q.directionlockdeadzone)b.rail.drag.dl="f";else{O=Q.width();var N=Q.height(),K=b.getContentSize();N=K.h-N;O=K.w-O;b.rail.drag.ck=b.rail.scrollable&&!b.railh.scrollable?N>0?"v":!1:!b.rail.scrollable&&b.railh.scrollable?O>0?"h":!1:!1}q.emulatetouch&&b.isiframe&&t.isie&&(O=b.win.position(),b.rail.drag.x+=O.left,b.rail.drag.y+=O.top);b.hasmoving=!1;b.lastmouseup=!1;b.scrollmom.reset(h.clientX,h.clientY);if(u&&G){if(!/INPUT|SELECT|BUTTON|TEXTAREA/i.test(u.nodeName))return t.hasmousecapture&&u.setCapture(),
q.emulatetouch?(u.onclick&&!u._onclick&&(u._onclick=u.onclick,u.onclick=function(Z){if(b.hasmoving)return!1;u._onclick.call(this,Z)}),b.cancelEvent(h)):b.stopPropagation(h);/SUBMIT|CANCEL|BUTTON/i.test(n(u).attr("type"))&&(b.preventclick={tg:u,click:!1})}}};b.ontouchend=function(h){if(!b||!b.rail.drag)return!0;if(b.rail.drag.pt==2){if(h.pointerType&&(h.pointerType==="mouse"||h.pointerType===h.MSPOINTER_TYPE_MOUSE))return!1;b.rail.drag=!1;var u=h.type==="mouseup";if(b.hasmoving&&(b.scrollmom.doMomentum(),
b.lastmouseup=!0,b.hideCursor(),t.hasmousecapture&&D.releaseCapture(),u))return b.cancelEvent(h)}else if(b.rail.drag.pt==1)return b.onmouseup(h)};var Ga=q.emulatetouch&&b.isiframe&&!t.hasmousecapture,Ja=q.directionlockdeadzone*.3|0;b.ontouchmove=function(h,u){if(!b||!b.rail.drag||h.targetTouches&&q.preventmultitouchscrolling&&h.targetTouches.length>1||h.pointerType&&(h.pointerType==="mouse"||h.pointerType===h.MSPOINTER_TYPE_MOUSE))return!0;if(b.rail.drag.pt==2){"changedTouches"in h&&(h.clientX=h.changedTouches[0].clientX,
h.clientY=h.changedTouches[0].clientY);var G;var O=G=0;Ga&&!u&&(u=b.win.position(),O=-u.left,G=-u.top);var N=h.clientY+G;u=N-b.rail.drag.y;var K=h.clientX+O;G=K-b.rail.drag.x;var Z=b.rail.drag.st-u;if(b.ishwscroll&&q.bouncescroll)Z<0?Z=Math.round(Z/2):Z>b.page.maxh&&(Z=b.page.maxh+Math.round((Z-b.page.maxh)/2));else if(Z<0?N=Z=0:Z>b.page.maxh&&(Z=b.page.maxh,N=0),N===0&&!b.hasmoving)return b.ispage||(b.rail.drag=!1),!0;var fa=b.getScrollLeft();b.railh&&b.railh.scrollable&&(fa=b.isrtlmode?G-b.rail.drag.sl:
b.rail.drag.sl-G,b.ishwscroll&&q.bouncescroll?fa<0?fa=Math.round(fa/2):fa>b.page.maxw&&(fa=b.page.maxw+Math.round((fa-b.page.maxw)/2)):(fa<0&&(K=fa=0),fa>b.page.maxw&&(fa=b.page.maxw,K=0)));if(!b.hasmoving){if(b.rail.drag.y===h.clientY&&b.rail.drag.x===h.clientX)return b.cancelEvent(h);O=Math.abs(u);u=Math.abs(G);G=q.directionlockdeadzone;b.rail.drag.ck?b.rail.drag.ck=="v"?u>G&&O<=Ja?b.rail.drag=!1:O>G&&(b.rail.drag.dl="v"):b.rail.drag.ck=="h"&&(O>G&&u<=Ja?b.rail.drag=!1:u>G&&(b.rail.drag.dl="h")):
O>G&&u>G?b.rail.drag.dl="f":O>G?b.rail.drag.dl=u>Ja?"f":"v":u>G&&(b.rail.drag.dl=O>Ja?"f":"h");if(!b.rail.drag.dl)return b.cancelEvent(h);b.triggerScrollStart(h.clientX,h.clientY,0,0,0);b.hasmoving=!0}b.preventclick&&!b.preventclick.click&&(b.preventclick.click=b.preventclick.tg.onclick||!1,b.preventclick.tg.onclick=b.onpreventclick);b.rail.drag.dl&&(b.rail.drag.dl=="v"?fa=b.rail.drag.sl:b.rail.drag.dl=="h"&&(Z=b.rail.drag.st));b.synched("touchmove",function(){b.rail.drag&&b.rail.drag.pt==2&&(b.prepareTransition&&
b.resetTransition(),b.rail.scrollable&&b.setScrollTop(Z),b.scrollmom.update(K,N),b.railh&&b.railh.scrollable?(b.setScrollLeft(fa),b.showCursor(Z,fa)):b.showCursor(Z),t.isie10&&D.selection.clear())});return b.cancelEvent(h)}if(b.rail.drag.pt==1)return b.onmousemove(h)};b.ontouchstartCursor=function(h,u){if(!b.rail.drag||b.rail.drag.pt==3){if(b.locked)return b.cancelEvent(h);b.cancelScroll();b.rail.drag={x:h.touches[0].clientX,y:h.touches[0].clientY,sx:b.scroll.x,sy:b.scroll.y,pt:3,hr:!!u};u=b.getTarget(h);
!b.ispage&&t.hasmousecapture&&u.setCapture();b.isiframe&&!t.hasmousecapture&&(b.saved.csspointerevents=b.doc.css("pointer-events"),b.css(b.doc,{"pointer-events":"none"}));return b.cancelEvent(h)}};b.ontouchendCursor=function(h){if(b.rail.drag&&(t.hasmousecapture&&D.releaseCapture(),b.isiframe&&!t.hasmousecapture&&b.doc.css("pointer-events",b.saved.csspointerevents),b.rail.drag.pt==3))return b.rail.drag=!1,b.cancelEvent(h)};b.ontouchmoveCursor=function(h){if(b.rail.drag&&b.rail.drag.pt==3){b.cursorfreezed=
!0;if(b.rail.drag.hr){b.scroll.x=b.rail.drag.sx+(h.touches[0].clientX-b.rail.drag.x);b.scroll.x<0&&(b.scroll.x=0);var u=b.scrollvaluemaxw;b.scroll.x>u&&(b.scroll.x=u)}else b.scroll.y=b.rail.drag.sy+(h.touches[0].clientY-b.rail.drag.y),b.scroll.y<0&&(b.scroll.y=0),u=b.scrollvaluemax,b.scroll.y>u&&(b.scroll.y=u);b.synched("touchmove",function(){b.rail.drag&&b.rail.drag.pt==3&&(b.showCursor(),b.rail.drag.hr?b.doScrollLeft(Math.round(b.scroll.x*b.scrollratio.x),q.cursordragspeed):b.doScrollTop(Math.round(b.scroll.y*
b.scrollratio.y),q.cursordragspeed))});return b.cancelEvent(h)}}}b.onmousedown=function(h,u){if(!b.rail.drag||b.rail.drag.pt==1){if(b.railslocked)return b.cancelEvent(h);b.cancelScroll();b.rail.drag={x:h.clientX,y:h.clientY,sx:b.scroll.x,sy:b.scroll.y,pt:1,hr:u||!1};u=b.getTarget(h);t.hasmousecapture&&u.setCapture();b.isiframe&&!t.hasmousecapture&&(b.saved.csspointerevents=b.doc.css("pointer-events"),b.css(b.doc,{"pointer-events":"none"}));b.hasmoving=!1;return b.cancelEvent(h)}};b.onmouseup=function(h){if(b.rail.drag){if(b.rail.drag.pt!=
1)return!0;t.hasmousecapture&&D.releaseCapture();b.isiframe&&!t.hasmousecapture&&b.doc.css("pointer-events",b.saved.csspointerevents);b.rail.drag=!1;b.cursorfreezed=!1;b.hasmoving&&b.triggerScrollEnd();return b.cancelEvent(h)}};b.onmousemove=function(h){if(b.rail.drag){if(b.rail.drag.pt===1){if(t.ischrome&&h.which===0)return b.onmouseup(h);b.cursorfreezed=!0;b.hasmoving||b.triggerScrollStart(h.clientX,h.clientY,0,0,0);b.hasmoving=!0;if(b.rail.drag.hr){b.scroll.x=b.rail.drag.sx+(h.clientX-b.rail.drag.x);
b.scroll.x<0&&(b.scroll.x=0);var u=b.scrollvaluemaxw;b.scroll.x>u&&(b.scroll.x=u)}else b.scroll.y=b.rail.drag.sy+(h.clientY-b.rail.drag.y),b.scroll.y<0&&(b.scroll.y=0),u=b.scrollvaluemax,b.scroll.y>u&&(b.scroll.y=u);b.synched("mousemove",function(){b.cursorfreezed&&(b.showCursor(),b.rail.drag.hr?b.scrollLeft(Math.round(b.scroll.x*b.scrollratio.x)):b.scrollTop(Math.round(b.scroll.y*b.scrollratio.y)))});return b.cancelEvent(h)}}else b.checkarea=0};if(t.cantouch||q.emulatetouch)b.onpreventclick=function(h){if(b.preventclick)return b.preventclick.tg.onclick=
b.preventclick.click,b.preventclick=!1,b.cancelEvent(h)},b.onclick=t.isios?!1:function(h){return b.lastmouseup?(b.lastmouseup=!1,b.cancelEvent(h)):!0},q.grabcursorenabled&&t.cursorgrabvalue&&(b.css(b.ispage?b.doc:b.win,{cursor:t.cursorgrabvalue}),b.css(b.rail,{cursor:t.cursorgrabvalue}));else{var c=function(h){if(b.selectiondrag){if(h){var u=b.win.outerHeight();h=h.pageY-b.selectiondrag.top;h>0&&h<u&&(h=0);h>=u&&(h-=u);b.selectiondrag.df=h}b.selectiondrag.df!==0&&(b.doScrollBy(-(b.selectiondrag.df*
2/6)|0),b.debounced("doselectionscroll",function(){c()},50))}};b.hasTextSelected="getSelection"in D?function(){return D.getSelection().rangeCount>0}:"selection"in D?function(){return D.selection.type!="None"}:function(){return!1};b.onselectionstart=function(h){b.ispage||(b.selectiondrag=b.win.offset())};b.onselectionend=function(h){b.selectiondrag=!1};b.onselectiondrag=function(h){b.selectiondrag&&b.hasTextSelected()&&b.debounced("selectionscroll",function(){c(h)},250)}}t.hasw3ctouch?(b.css(b.ispage?
n("html"):b.win,{"touch-action":"none"}),b.css(b.rail,{"touch-action":"none"}),b.css(b.cursor,{"touch-action":"none"}),b.bind(b.win,"pointerdown",b.ontouchstart),b.bind(D,"pointerup",b.ontouchend),b.delegate(D,"pointermove",b.ontouchmove)):t.hasmstouch?(b.css(b.ispage?n("html"):b.win,{"-ms-touch-action":"none"}),b.css(b.rail,{"-ms-touch-action":"none"}),b.css(b.cursor,{"-ms-touch-action":"none"}),b.bind(b.win,"MSPointerDown",b.ontouchstart),b.bind(D,"MSPointerUp",b.ontouchend),b.delegate(D,"MSPointerMove",
b.ontouchmove),b.bind(b.cursor,"MSGestureHold",function(h){h.preventDefault()}),b.bind(b.cursor,"contextmenu",function(h){h.preventDefault()})):t.cantouch&&(b.bind(b.win,"touchstart",b.ontouchstart,!1,!0),b.bind(D,"touchend",b.ontouchend,!1,!0),b.bind(D,"touchcancel",b.ontouchend,!1,!0),b.delegate(D,"touchmove",b.ontouchmove,!1,!0));q.emulatetouch&&(b.bind(b.win,"mousedown",b.ontouchstart,!1,!0),b.bind(D,"mouseup",b.ontouchend,!1,!0),b.bind(D,"mousemove",b.ontouchmove,!1,!0));if(q.cursordragontouch||
!t.cantouch&&!q.emulatetouch)b.rail.css({cursor:"default"}),b.railh&&b.railh.css({cursor:"default"}),b.jqbind(b.rail,"mouseenter",function(){if(!b.ispage&&!b.win.is(":visible"))return!1;b.canshowonmouseevent&&b.showCursor();b.rail.active=!0}),b.jqbind(b.rail,"mouseleave",function(){b.rail.active=!1;b.rail.drag||b.hideCursor()}),q.sensitiverail&&(b.bind(b.rail,"click",function(h){b.doRailClick(h,!1,!1)}),b.bind(b.rail,"dblclick",function(h){b.doRailClick(h,!0,!1)}),b.bind(b.cursor,"click",function(h){b.cancelEvent(h)}),
b.bind(b.cursor,"dblclick",function(h){b.cancelEvent(h)})),b.railh&&(b.jqbind(b.railh,"mouseenter",function(){if(!b.ispage&&!b.win.is(":visible"))return!1;b.canshowonmouseevent&&b.showCursor();b.rail.active=!0}),b.jqbind(b.railh,"mouseleave",function(){b.rail.active=!1;b.rail.drag||b.hideCursor()}),q.sensitiverail&&(b.bind(b.railh,"click",function(h){b.doRailClick(h,!1,!0)}),b.bind(b.railh,"dblclick",function(h){b.doRailClick(h,!0,!0)}),b.bind(b.cursorh,"click",function(h){b.cancelEvent(h)}),b.bind(b.cursorh,
"dblclick",function(h){b.cancelEvent(h)})));q.cursordragontouch&&(this.istouchcapable||t.cantouch)&&(b.bind(b.cursor,"touchstart",b.ontouchstartCursor),b.bind(b.cursor,"touchmove",b.ontouchmoveCursor),b.bind(b.cursor,"touchend",b.ontouchendCursor),b.cursorh&&b.bind(b.cursorh,"touchstart",function(h){b.ontouchstartCursor(h,!0)}),b.cursorh&&b.bind(b.cursorh,"touchmove",b.ontouchmoveCursor),b.cursorh&&b.bind(b.cursorh,"touchend",b.ontouchendCursor));q.emulatetouch||t.isandroid||t.isios?(b.bind(t.hasmousecapture?
b.win:D,"mouseup",b.ontouchend),b.onclick&&b.bind(D,"click",b.onclick),q.cursordragontouch?(b.bind(b.cursor,"mousedown",b.onmousedown),b.bind(b.cursor,"mouseup",b.onmouseup),b.cursorh&&b.bind(b.cursorh,"mousedown",function(h){b.onmousedown(h,!0)}),b.cursorh&&b.bind(b.cursorh,"mouseup",b.onmouseup)):(b.bind(b.rail,"mousedown",function(h){h.preventDefault()}),b.railh&&b.bind(b.railh,"mousedown",function(h){h.preventDefault()}))):(b.bind(t.hasmousecapture?b.win:D,"mouseup",b.onmouseup),b.bind(D,"mousemove",
b.onmousemove),b.onclick&&b.bind(D,"click",b.onclick),b.bind(b.cursor,"mousedown",b.onmousedown),b.bind(b.cursor,"mouseup",b.onmouseup),b.railh&&(b.bind(b.cursorh,"mousedown",function(h){b.onmousedown(h,!0)}),b.bind(b.cursorh,"mouseup",b.onmouseup)),!b.ispage&&q.enablescrollonselection&&(b.bind(b.win[0],"mousedown",b.onselectionstart),b.bind(D,"mouseup",b.onselectionend),b.bind(b.cursor,"mouseup",b.onselectionend),b.cursorh&&b.bind(b.cursorh,"mouseup",b.onselectionend),b.bind(D,"mousemove",b.onselectiondrag)),
b.zoom&&(b.jqbind(b.zoom,"mouseenter",function(){b.canshowonmouseevent&&b.showCursor();b.rail.active=!0}),b.jqbind(b.zoom,"mouseleave",function(){b.rail.active=!1;b.rail.drag||b.hideCursor()})));q.enablemousewheel&&(b.isiframe||b.mousewheel(t.isie&&b.ispage?D:b.win,b.onmousewheel),b.mousewheel(b.rail,b.onmousewheel),b.railh&&b.mousewheel(b.railh,b.onmousewheelhr));b.ispage||t.cantouch||/HTML|^BODY/.test(b.win[0].nodeName)||(b.win.attr("tabindex")||b.win.attr({tabindex:++z}),b.bind(b.win,"focus",function(h){J=
b.getTarget(h).id||b.getTarget(h)||!1;b.hasfocus=!0;b.canshowonmouseevent&&b.noticeCursor()}),b.bind(b.win,"blur",function(h){J=!1;b.hasfocus=!1}),b.bind(b.win,"mouseenter",function(h){v=b.getTarget(h).id||b.getTarget(h)||!1;b.hasmousefocus=!0;b.canshowonmouseevent&&b.noticeCursor()}),b.bind(b.win,"mouseleave",function(h){v=!1;b.hasmousefocus=!1;b.rail.drag||b.hideCursor()}));b.onkeypress=function(h){if(b.railslocked&&b.page.maxh===0)return!0;h=h||L.event;var u=b.getTarget(h);if(u&&/INPUT|TEXTAREA|SELECT|OPTION/.test(u.nodeName)&&
(!u.getAttribute("type")&&!u.type||!/submit|button|cancel/i.tp)||n(u).attr("contenteditable"))return!0;if(b.hasfocus||b.hasmousefocus&&!J||b.ispage&&!J&&!v){u=h.keyCode;if(b.railslocked&&u!=27)return b.cancelEvent(h);var G=h.ctrlKey||!1,O=h.shiftKey||!1,N=!1;switch(u){case 38:case 63233:b.doScrollBy(72);N=!0;break;case 40:case 63235:b.doScrollBy(-72);N=!0;break;case 37:case 63232:b.railh&&(G?b.doScrollLeft(0):b.doScrollLeftBy(72),N=!0);break;case 39:case 63234:b.railh&&(G?b.doScrollLeft(b.page.maxw):
b.doScrollLeftBy(-72),N=!0);break;case 33:case 63276:b.doScrollBy(b.view.h);N=!0;break;case 34:case 63277:b.doScrollBy(-b.view.h);N=!0;break;case 36:case 63273:b.railh&&G?b.doScrollPos(0,0):b.doScrollTo(0);N=!0;break;case 35:case 63275:b.railh&&G?b.doScrollPos(b.page.maxw,b.page.maxh):b.doScrollTo(b.page.maxh);N=!0;break;case 32:q.spacebarenabled&&(O?b.doScrollBy(b.view.h):b.doScrollBy(-b.view.h),N=!0);break;case 27:b.zoomactive&&(b.doZoom(),N=!0)}if(N)return b.cancelEvent(h)}};l=b.body[0];q.enablekeyboard&&
b.bind(l,t.isopera&&!t.isopera12?"keypress":"keydown",b.onkeypress);b.bind(D,"keydown",function(h){h.ctrlKey&&(b.wheelprevented=!0)});b.bind(D,"keyup",function(h){h.ctrlKey||(b.wheelprevented=!1)});b.bind(L,"blur",function(h){b.wheelprevented=!1});b.bind(L,"resize",b.onscreenresize);b.bind(L,"orientationchange",b.onscreenresize);b.bind(L,"load",b.lazyResize);if(t.ischrome&&!b.ispage&&!b.haswrapper){var d=b.win.attr("style");l=parseFloat(b.win.css("width"))+1;b.win.css("width",l);b.synched("chromefix",
function(){b.win.attr("style",d)})}b.onAttributeChange=function(h){b.lazyResize(b.isieold?250:30)};if(q.enableobserver&&(b.isie11||X===!1||(b.observerbody=new X(function(h){h.forEach(function(u){if(u.type=="attributes")return r.hasClass("modal-open")&&r.hasClass("modal-dialog")&&!n.contains(n(".modal-dialog")[0],b.doc[0])?b.hide():b.show()});if(b.me.clientWidth!=b.page.width||b.me.clientHeight!=b.page.height)return b.lazyResize(30)}),b.observerbody.observe(D.body,{childList:!0,subtree:!0,characterData:!1,
attributes:!0,attributeFilter:["class"]})),!b.ispage&&!b.haswrapper)){var g=b.win[0];X!==!1?(b.observer=new X(function(h){h.forEach(b.onAttributeChange)}),b.observer.observe(g,{childList:!0,characterData:!1,attributes:!0,subtree:!1}),b.observerremover=new X(function(h){h.forEach(function(u){if(u.removedNodes.length>0)for(var G in u.removedNodes)if(b&&u.removedNodes[G]===g)return b.remove()})}),b.observerremover.observe(g.parentNode,{childList:!0,characterData:!1,attributes:!1,subtree:!1})):(b.bind(g,
t.isie&&!t.isie9?"propertychange":"DOMAttrModified",b.onAttributeChange),t.isie9&&g.attachEvent("onpropertychange",b.onAttributeChange),b.bind(g,"DOMNodeRemoved",function(h){h.target===g&&b.remove()}))}!b.ispage&&q.boxzoom&&b.bind(L,"resize",b.resizeZoom);b.istextarea&&(b.bind(b.win,"keydown",b.lazyResize),b.bind(b.win,"mouseup",b.lazyResize));b.lazyResize(30)}if(this.doc[0].nodeName=="IFRAME"){var m=function(){b.iframexd=!1;try{var h="contentDocument"in this?this.contentDocument:this.contentWindow._doc}catch(G){b.iframexd=
!0,h=!1}if(b.iframexd)return!0;b.forcescreen=!0;b.isiframe&&(b.iframe={doc:n(h),html:b.doc.contents().find("html")[0],body:b.doc.contents().find("body")[0]},b.getContentSize=function(){return{w:Math.max(b.iframe.html.scrollWidth,b.iframe.body.scrollWidth),h:Math.max(b.iframe.html.scrollHeight,b.iframe.body.scrollHeight)}},b.docscroll=n(b.iframe.body));if(!t.isios&&q.iframeautoresize&&!b.isiframe){b.win.scrollTop(0);b.doc.height("");var u=Math.max(h.getElementsByTagName("html")[0].scrollHeight,h.body.scrollHeight);
b.doc.height(u)}b.lazyResize(30);b.css(n(b.iframe.body),p);t.isios&&b.haswrapper&&b.css(n(h.body),{"-webkit-transform":"translate3d(0,0,0)"});"contentWindow"in this?b.bind(this.contentWindow,"scroll",b.onscroll):b.bind(h,"scroll",b.onscroll);q.enablemousewheel&&b.mousewheel(h,b.onmousewheel);q.enablekeyboard&&b.bind(h,t.isopera?"keypress":"keydown",b.onkeypress);t.cantouch?(b.bind(h,"touchstart",b.ontouchstart),b.bind(h,"touchmove",b.ontouchmove)):q.emulatetouch&&(b.bind(h,"mousedown",b.ontouchstart),
b.bind(h,"mousemove",function(G){return b.ontouchmove(G,!0)}),q.grabcursorenabled&&t.cursorgrabvalue&&b.css(n(h.body),{cursor:t.cursorgrabvalue}));b.bind(h,"mouseup",b.ontouchend);b.zoom&&(q.dblclickzoom&&b.bind(h,"dblclick",b.doZoom),b.ongesturezoom&&b.bind(h,"gestureend",b.ongesturezoom))};this.doc[0].readyState&&this.doc[0].readyState==="complete"&&setTimeout(function(){m.call(b.doc[0],!1)},500);b.bind(this.doc,"load",m)}};this.showCursor=function(p,B){b.cursortimeout&&(clearTimeout(b.cursortimeout),
b.cursortimeout=0);b.rail&&(b.autohidedom&&(b.autohidedom.stop().css({opacity:q.cursoropacitymax}),b.cursoractive=!0),b.rail.drag&&b.rail.drag.pt==1||(p!==void 0&&p!==!1&&(b.scroll.y=p/b.scrollratio.y|0),B!==void 0&&(b.scroll.x=B/b.scrollratio.x|0)),b.cursor.css({height:b.cursorheight,top:b.scroll.y}),b.cursorh&&(p=b.hasreversehr?b.scrollvaluemaxw-b.scroll.x:b.scroll.x,b.cursorh.css({width:b.cursorwidth,left:!b.rail.align&&b.rail.visibility?p+b.rail.width:p}),b.cursoractive=!0),b.zoom&&b.zoom.stop().css({opacity:q.cursoropacitymax}))};
this.hideCursor=function(p){b.cursortimeout||!b.rail||!b.autohidedom||b.hasmousefocus&&q.autohidemode==="leave"||(b.cursortimeout=setTimeout(function(){b.rail.active&&b.showonmouseevent||(b.autohidedom.stop().animate({opacity:q.cursoropacitymin}),b.zoom&&b.zoom.stop().animate({opacity:q.cursoropacitymin}),b.cursoractive=!1);b.cursortimeout=0},p||q.hidecursordelay))};this.noticeCursor=function(p,B,C){b.showCursor(B,C);b.rail.active||b.hideCursor(p)};this.getContentSize=b.ispage?function(){return{w:Math.max(D.body.scrollWidth,
D.documentElement.scrollWidth),h:Math.max(D.body.scrollHeight,D.documentElement.scrollHeight)}}:b.haswrapper?function(){return{w:b.doc[0].offsetWidth,h:b.doc[0].offsetHeight}}:function(){return{w:b.docscroll[0].scrollWidth,h:b.docscroll[0].scrollHeight}};this.onResize=function(p,B){if(!b||!b.win)return!1;p=b.page.maxh;var C=b.page.maxw,l=b.view.h,w=b.view.w;b.view={w:b.ispage?b.win.width():b.win[0].clientWidth,h:b.ispage?b.win.height():b.win[0].clientHeight};b.page=B?B:b.getContentSize();b.page.maxh=
Math.max(0,b.page.h-b.view.h);b.page.maxw=Math.max(0,b.page.w-b.view.w);if(b.page.maxh==p&&b.page.maxw==C&&b.view.w==w&&b.view.h==l){if(b.ispage)return b;B=b.win.offset();if(b.lastposition&&(p=b.lastposition,p.top==B.top&&p.left==B.left))return b;b.lastposition=B}b.page.maxh===0?(b.hideRail(),b.scrollvaluemax=0,b.scroll.y=0,b.scrollratio.y=0,b.cursorheight=0,b.setScrollTop(0),b.rail&&(b.rail.scrollable=!1)):(b.page.maxh-=q.railpadding.top+q.railpadding.bottom,b.rail.scrollable=!0);b.page.maxw===0?
(b.hideRailHr(),b.scrollvaluemaxw=0,b.scroll.x=0,b.scrollratio.x=0,b.cursorwidth=0,b.setScrollLeft(0),b.railh&&(b.railh.scrollable=!1)):(b.page.maxw-=q.railpadding.left+q.railpadding.right,b.railh&&(b.railh.scrollable=q.horizrailenabled));b.railslocked=b.locked||b.page.maxh===0&&b.page.maxw===0;if(b.railslocked)return b.ispage||b.updateScrollBar(b.view),!1;b.hidden||(b.rail.visibility||b.showRail(),b.railh&&!b.railh.visibility&&b.showRailHr());b.istextarea&&b.win.css("resize")&&b.win.css("resize")!=
"none"&&(b.view.h-=20);b.cursorheight=Math.min(b.view.h,Math.round(b.view.h/b.page.h*b.view.h));b.cursorheight=q.cursorfixedheight?q.cursorfixedheight:Math.max(q.cursorminheight,b.cursorheight);b.cursorwidth=Math.min(b.view.w,Math.round(b.view.w/b.page.w*b.view.w));b.cursorwidth=q.cursorfixedheight?q.cursorfixedheight:Math.max(q.cursorminheight,b.cursorwidth);b.scrollvaluemax=b.view.h-b.cursorheight-(q.railpadding.top+q.railpadding.bottom);b.hasborderbox||(b.scrollvaluemax-=b.cursor[0].offsetHeight-
b.cursor[0].clientHeight);b.railh&&(b.railh.width=b.page.maxh>0?b.view.w-b.rail.width:b.view.w,b.scrollvaluemaxw=b.railh.width-b.cursorwidth-(q.railpadding.left+q.railpadding.right));b.ispage||b.updateScrollBar(b.view);b.scrollratio={x:b.page.maxw/b.scrollvaluemaxw,y:b.page.maxh/b.scrollvaluemax};b.getScrollTop()>b.page.maxh?b.doScrollTop(b.page.maxh):(b.scroll.y=b.getScrollTop()/b.scrollratio.y|0,b.scroll.x=b.getScrollLeft()/b.scrollratio.x|0,b.cursoractive&&b.noticeCursor());b.scroll.y&&b.getScrollTop()===
0&&b.doScrollTo(b.scroll.y*b.scrollratio.y|0);return b};this.resize=b.onResize;var ia=0;this.onscreenresize=function(p){clearTimeout(ia);var B=!b.ispage&&!b.haswrapper;B&&b.hideRails();ia=setTimeout(function(){b&&(B&&b.showRails(),b.resize());ia=0},120)};this.lazyResize=function(p){clearTimeout(ia);p=isNaN(p)?240:p;ia=setTimeout(function(){b&&b.resize();ia=0},p);return b};this.jqbind=function(p,B,C){b.events.push({e:p,n:B,f:C,q:!0});n(p).on(B,C)};this.mousewheel=function(p,B,C){p="jquery"in p?p[0]:
p;if("onwheel"in D.createElement("div"))b._bind(p,"wheel",B,C||!1);else{var l=D.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll";V(p,l,B,C||!1);l=="DOMMouseScroll"&&V(p,"MozMousePixelScroll",B,C||!1)}};var oa=!1;if(t.haseventlistener){try{var xa=Object.defineProperty({},"passive",{get:function(){oa=!0}});L.addEventListener("test",null,xa)}catch(p){}this.stopPropagation=function(p){if(!p)return!1;p=p.original?p.original:p;p.stopPropagation();return!1};this.cancelEvent=function(p){p.cancelable&&
p.preventDefault();p.stopImmediatePropagation();p.preventManipulation&&p.preventManipulation();return!1}}else Event.prototype.preventDefault=function(){this.returnValue=!1},Event.prototype.stopPropagation=function(){this.cancelBubble=!0},L.constructor.prototype.addEventListener=D.constructor.prototype.addEventListener=Element.prototype.addEventListener=function(p,B,C){this.attachEvent("on"+p,B)},L.constructor.prototype.removeEventListener=D.constructor.prototype.removeEventListener=Element.prototype.removeEventListener=
function(p,B,C){this.detachEvent("on"+p,B)},this.cancelEvent=function(p){if(p=p||L.event)p.cancelBubble=!0,p.cancel=!0,p.returnValue=!1;return!1},this.stopPropagation=function(p){if(p=p||L.event)p.cancelBubble=!0;return!1};this.delegate=function(p,B,C,l,w){var F=U[B]||!1;F?b.events.push({e:p,n:B,f:C,b:l,q:!1}):(F={a:[],l:[],f:function(T){for(var ra=F.l,pa=!1,Ga=ra.length-1;Ga>=0;Ga--)if(pa=ra[Ga].call(T.target,T),pa===!1)return!1;return pa}},b.bind(p,B,F.f,l,w),U[B]=F);b.ispage?(F.a=[b.id].concat(F.a),
F.l=[C].concat(F.l)):(F.a.push(b.id),F.l.push(C))};this.undelegate=function(p,B,C,l,w){if((C=U[B]||!1)&&C.l)for(l=0,w=C.l.length;l<w;l++)C.a[l]===b.id&&(C.a.splice(l),C.l.splice(l),C.a.length===0&&(b._unbind(p,B,C.l.f),U[B]=null))};this.bind=function(p,B,C,l,w){b._bind("jquery"in p?p[0]:p,B,C,l||!1,w||!1)};this._bind=function(p,B,C,l,w){b.events.push({e:p,n:B,f:C,b:l,q:!1});oa&&(w||p==L.document||p==L.document.body||p==L)?p.addEventListener(B,C,{passive:!1,capture:l}):p.addEventListener(B,C,l||!1)};
this._unbind=function(p,B,C,l){U[B]?b.undelegate(p,B,C,l):p.removeEventListener(B,C,l)};this.unbindAll=function(){for(var p=0;p<b.events.length;p++){var B=b.events[p];B.q?B.e.unbind(B.n,B.f):b._unbind(B.e,B.n,B.f,B.b)}};this.showRails=function(){return b.showRail().showRailHr()};this.showRail=function(){b.page.maxh===0||!b.ispage&&b.win.css("display")=="none"||(b.rail.visibility=!0,b.rail.css("display","block"));return b};this.showRailHr=function(){b.railh&&b.page.maxw!==0&&(b.ispage||b.win.css("display")!=
"none")&&(b.railh.visibility=!0,b.railh.css("display","block"));return b};this.hideRails=function(){return b.hideRail().hideRailHr()};this.hideRail=function(){b.rail.visibility=!1;b.rail.css("display","none");return b};this.hideRailHr=function(){b.railh&&(b.railh.visibility=!1,b.railh.css("display","none"));return b};this.show=function(){b.hidden=!1;b.railslocked=!1;return b.showRails()};this.hide=function(){b.hidden=!0;b.railslocked=!0;return b.hideRails()};this.toggle=function(){return b.hidden?
b.show():b.hide()};this.remove=function(){b.stop();b.cursortimeout&&clearTimeout(b.cursortimeout);for(var p in b.delaylist)b.delaylist[p]&&ea(b.delaylist[p].h);b.doZoomOut();t.hasw3ctouch?b.undelegate(D,"pointermove",b.ontouchmove):t.hasmstouch?b.undelegate(D,"MSPointerMove",b.ontouchmove):t.cantouch&&b.undelegate(D,"touchmove",b.ontouchmove,!1,!0);b.unbindAll();t.isie9&&b.win[0].detachEvent("onpropertychange",b.onAttributeChange);b.observer!==!1&&b.observer.disconnect();b.observerremover!==!1&&b.observerremover.disconnect();
b.observerbody!==!1&&b.observerbody.disconnect();b.events=null;b.cursor&&b.cursor.remove();b.cursorh&&b.cursorh.remove();b.rail&&b.rail.remove();b.railh&&b.railh.remove();b.zoom&&b.zoom.remove();for(p=0;p<b.saved.css.length;p++){var B=b.saved.css[p];B[0].css(B[1],B[2]===void 0?"":B[2])}b.saved=!1;b.me.data("__nicescroll","");var C=n.nicescroll;C.each(function(w){if(this&&this.id===b.id){delete C[w];for(var F=++w;F<C.length;F++,w++)C[w]=C[F];C.length--;C.length&&delete C[C.length]}});for(var l in b)b[l]=
null,delete b[l];b=null};this.scrollstart=function(p){this.onscrollstart=p;return b};this.scrollend=function(p){this.onscrollend=p;return b};this.scrollcancel=function(p){this.onscrollcancel=p;return b};this.zoomin=function(p){this.onzoomin=p;return b};this.zoomout=function(p){this.onzoomout=p;return b};this.isScrollable=function(p){p=p.target?p.target:p;if(p.nodeName=="OPTION")return!0;for(;p&&p.nodeType==1&&p!==this.me[0]&&!/^BODY|HTML/.test(p.nodeName);){var B=n(p);B=B.css("overflowY")||B.css("overflowX")||
B.css("overflow")||"";if(/scroll|auto/.test(B))return p.clientHeight!=p.scrollHeight;p=p.parentNode?p.parentNode:!1}return!1};this.getViewport=function(p){for(p=p&&p.parentNode?p.parentNode:!1;p&&p.nodeType==1&&!/^BODY|HTML/.test(p.nodeName);){var B=n(p);if(/fixed|absolute/.test(B.css("position")))return B;var C=B.css("overflowY")||B.css("overflowX")||B.css("overflow")||"";if(/scroll|auto/.test(C)&&p.clientHeight!=p.scrollHeight||B.getNiceScroll().length>0)return B;p=p.parentNode?p.parentNode:!1}return!1};
this.triggerScrollStart=function(p,B,C,l,w){b.onscrollstart&&b.onscrollstart.call(b,{type:"scrollstart",current:{x:p,y:B},request:{x:C,y:l},end:{x:b.newscrollx,y:b.newscrolly},speed:w})};this.triggerScrollEnd=function(){if(b.onscrollend){var p=b.getScrollLeft(),B=b.getScrollTop();b.onscrollend.call(b,{type:"scrollend",current:{x:p,y:B},end:{x:p,y:B}})}};var e=0,Ka=0,va=0,ka=1,Da=!1;this.onmousewheel=function(p){if(b.wheelprevented||b.locked)return!1;if(b.railslocked)return b.debounced("checkunlock",
b.resize,250),!1;if(b.rail.drag)return b.cancelEvent(p);q.oneaxismousemode==="auto"&&p.deltaX!==0&&(q.oneaxismousemode=!1);if(q.oneaxismousemode&&p.deltaX===0&&!b.rail.scrollable)return b.railh&&b.railh.scrollable?b.onmousewheelhr(p):!0;var B=ma(),C=!1;q.preservenativescrolling&&b.checkarea+600<B&&(b.nativescrollingarea=b.isScrollable(p),C=!0);b.checkarea=B;if(b.nativescrollingarea)return!0;if(p=x(p,!1,C))b.checkarea=0;return p};this.onmousewheelhr=function(p){if(!b.wheelprevented){if(b.railslocked||
!b.railh.scrollable)return!0;if(b.rail.drag)return b.cancelEvent(p);var B=ma(),C=!1;q.preservenativescrolling&&b.checkarea+600<B&&(b.nativescrollingarea=b.isScrollable(p),C=!0);b.checkarea=B;return b.nativescrollingarea?!0:b.railslocked?b.cancelEvent(p):x(p,!0,C)}};this.stop=function(){b.cancelScroll();b.scrollmon&&b.scrollmon.stop();b.cursorfreezed=!1;b.scroll.y=Math.round(b.getScrollTop()*(1/b.scrollratio.y));b.noticeCursor();return b};this.getTransitionSpeed=function(p){return 80+p/72*q.scrollspeed|
0};if(q.smoothscroll)if(b.ishwscroll&&t.hastransition&&q.usetransition&&q.smoothscroll){var Qa="";this.resetTransition=function(){Qa="";b.doc.css(t.prefixstyle+"transition-duration","0ms")};this.prepareTransition=function(p,B){p=B?p:b.getTransitionSpeed(p);B=p+"ms";Qa!==B&&(Qa=B,b.doc.css(t.prefixstyle+"transition-duration",B));return p};this.doScrollLeft=function(p,B){var C=b.scrollrunning?b.newscrolly:b.getScrollTop();b.doScrollPos(p,C,B)};this.doScrollTop=function(p,B){var C=b.scrollrunning?b.newscrollx:
b.getScrollLeft();b.doScrollPos(C,p,B)};this.cursorupdate={running:!1,start:function(){var p=this;if(!p.running){p.running=!0;var B=function(){p.running&&W(B);b.showCursor(b.getScrollTop(),b.getScrollLeft());b.notifyScrollEvent(b.win[0])};W(B)}},stop:function(){this.running=!1}};this.doScrollPos=function(p,B,C){C=b.getScrollTop();var l=b.getScrollLeft();((b.newscrolly-C)*(B-C)<0||(b.newscrollx-l)*(p-l)<0)&&b.cancelScroll();q.bouncescroll?(B<0?B=B/2|0:B>b.page.maxh&&(B=b.page.maxh+(B-b.page.maxh)/
2|0),p<0?p=p/2|0:p>b.page.maxw&&(p=b.page.maxw+(p-b.page.maxw)/2|0)):(B<0?B=0:B>b.page.maxh&&(B=b.page.maxh),p<0?p=0:p>b.page.maxw&&(p=b.page.maxw));if(b.scrollrunning&&p==b.newscrollx&&B==b.newscrolly)return!1;b.newscrolly=B;b.newscrollx=p;C=b.getScrollTop();l=b.getScrollLeft();var w=p-l;var F=B-C;w=b.prepareTransition(Math.sqrt(w*w+F*F)|0);b.scrollrunning||(b.scrollrunning=!0,b.triggerScrollStart(l,C,p,B,w),b.cursorupdate.start());b.scrollendtrapped=!0;t.transitionend||(b.scrollendtrapped&&clearTimeout(b.scrollendtrapped),
b.scrollendtrapped=setTimeout(b.onScrollTransitionEnd,w));b.setScrollTop(b.newscrolly);b.setScrollLeft(b.newscrollx)};this.cancelScroll=function(){if(!b.scrollendtrapped)return!0;var p=b.getScrollTop(),B=b.getScrollLeft();b.scrollrunning=!1;t.transitionend||clearTimeout(t.transitionend);b.scrollendtrapped=!1;b.resetTransition();b.setScrollTop(p);b.railh&&b.setScrollLeft(B);b.timerscroll&&b.timerscroll.tm&&clearInterval(b.timerscroll.tm);b.timerscroll=!1;b.cursorfreezed=!1;b.cursorupdate.stop();b.showCursor(p,
B);return b};this.onScrollTransitionEnd=function(){if(b.scrollendtrapped){var p=b.getScrollTop(),B=b.getScrollLeft();p<0?p=0:p>b.page.maxh&&(p=b.page.maxh);B<0?B=0:B>b.page.maxw&&(B=b.page.maxw);if(p!=b.newscrolly||B!=b.newscrollx)return b.doScrollPos(B,p,q.snapbackspeed);b.scrollrunning&&b.triggerScrollEnd();b.scrollrunning=!1;b.scrollendtrapped=!1;b.resetTransition();b.timerscroll=!1;b.setScrollTop(p);b.railh&&b.setScrollLeft(B);b.cursorupdate.stop();b.noticeCursor(!1,p,B);b.cursorfreezed=!1}}}else this.doScrollLeft=
function(p,B){var C=b.scrollrunning?b.newscrolly:b.getScrollTop();b.doScrollPos(p,C,B)},this.doScrollTop=function(p,B){var C=b.scrollrunning?b.newscrollx:b.getScrollLeft();b.doScrollPos(C,p,B)},this.doScrollPos=function(p,B,C){C=b.getScrollTop();var l=b.getScrollLeft();((b.newscrolly-C)*(B-C)<0||(b.newscrollx-l)*(p-l)<0)&&b.cancelScroll();var w=!1;b.bouncescroll&&b.rail.visibility||(B<0?(B=0,w=!0):B>b.page.maxh&&(B=b.page.maxh,w=!0));b.bouncescroll&&b.railh.visibility||(p<0?(p=0,w=!0):p>b.page.maxw&&
(p=b.page.maxw,w=!0));if(b.scrollrunning&&b.newscrolly===B&&b.newscrollx===p)return!0;b.newscrolly=B;b.newscrollx=p;b.dst={};b.dst.x=p-l;b.dst.y=B-C;b.dst.px=l;b.dst.py=C;var F=b.getTransitionSpeed(Math.sqrt(b.dst.x*b.dst.x+b.dst.y*b.dst.y)|0);b.bzscroll={};w=w?1:.58;b.bzscroll.x=new R(l,b.newscrollx,F,0,0,w,1);b.bzscroll.y=new R(C,b.newscrolly,F,0,0,w,1);ma();var T=function(){if(b.scrollrunning){var ra=b.bzscroll.y.getPos();b.setScrollLeft(b.bzscroll.x.getNow());b.setScrollTop(b.bzscroll.y.getNow());
ra<=1?b.timer=W(T):(b.scrollrunning=!1,b.timer=0,b.triggerScrollEnd())}};b.scrollrunning||(b.triggerScrollStart(l,C,p,B,F),b.scrollrunning=!0,b.timer=W(T))},this.cancelScroll=function(){b.timer&&ea(b.timer);b.timer=0;b.bzscroll=!1;b.scrollrunning=!1;return b};else this.doScrollLeft=function(p,B){var C=b.getScrollTop();b.doScrollPos(p,C,B)},this.doScrollTop=function(p,B){var C=b.getScrollLeft();b.doScrollPos(C,p,B)},this.doScrollPos=function(p,B,C){var l=p>b.page.maxw?b.page.maxw:p;l<0&&(l=0);var w=
B>b.page.maxh?b.page.maxh:B;w<0&&(w=0);b.synched("scroll",function(){b.setScrollTop(w);b.setScrollLeft(l)})},this.cancelScroll=function(){};this.doScrollBy=function(p,B){f(0,p)};this.doScrollLeftBy=function(p,B){f(p,0)};this.doScrollTo=function(p,B){b.cursorfreezed=!1;b.doScrollTop(p)};this.checkContentSize=function(){var p=b.getContentSize();p.h==b.page.h&&p.w==b.page.w||b.resize(!1,p)};b.onscroll=function(p){b.rail.drag||b.cursorfreezed||b.synched("scroll",function(){b.scroll.y=Math.round(b.getScrollTop()/
b.scrollratio.y);b.railh&&(b.scroll.x=Math.round(b.getScrollLeft()/b.scrollratio.x));b.noticeCursor()})};b.bind(b.docscroll,"scroll",b.onscroll);this.doZoomIn=function(p){if(!b.zoomactive){b.zoomactive=!0;b.zoomrestore={style:{}};var B="position top left zIndex backgroundColor marginTop marginBottom marginLeft marginRight".split(" "),C=b.win[0].style,l;for(l in B){var w=B[l];b.zoomrestore.style[w]=C[w]!==void 0?C[w]:""}b.zoomrestore.style.width=b.win.css("width");b.zoomrestore.style.height=b.win.css("height");
b.zoomrestore.padding={w:b.win.outerWidth()-b.win.width(),h:b.win.outerHeight()-b.win.height()};t.isios4&&(b.zoomrestore.scrollTop=Q.scrollTop(),Q.scrollTop(0));b.win.css({position:t.isios4?"absolute":"fixed",top:0,left:0,zIndex:P+100,margin:0});B=b.win.css("backgroundColor");(""===B||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(B))&&b.win.css("backgroundColor","#fff");b.rail.css({zIndex:P+101});b.zoom.css({zIndex:P+102});b.zoom.css("backgroundPosition","0 -18px");b.resizeZoom();b.onzoomin&&
b.onzoomin.call(b);return b.cancelEvent(p)}};this.doZoomOut=function(p){if(b.zoomactive)return b.zoomactive=!1,b.win.css("margin",""),b.win.css(b.zoomrestore.style),t.isios4&&Q.scrollTop(b.zoomrestore.scrollTop),b.rail.css({"z-index":b.zindex}),b.zoom.css({"z-index":b.zindex}),b.zoomrestore=!1,b.zoom.css("backgroundPosition","0 0"),b.onResize(),b.onzoomout&&b.onzoomout.call(b),b.cancelEvent(p)};this.doZoom=function(p){return b.zoomactive?b.doZoomOut(p):b.doZoomIn(p)};this.resizeZoom=function(){if(b.zoomactive){var p=
b.getScrollTop();b.win.css({width:Q.width()-b.zoomrestore.padding.w+"px",height:Q.height()-b.zoomrestore.padding.h+"px"});b.onResize();b.setScrollTop(Math.min(b.page.maxh,p))}};this.init();n.nicescroll.push(this)},wa=function(ba){var I=this;this.nc=ba;this.steptime=this.lasttime=this.speedy=this.speedx=this.lasty=this.lastx=0;this.snapy=this.snapx=!1;this.demuly=this.demulx=0;this.lastscrolly=this.lastscrollx=-1;this.timer=this.chky=this.chkx=0;this.reset=function(y,E){I.stop();I.steptime=0;I.lasttime=
ma();I.speedx=0;I.speedy=0;I.lastx=y;I.lasty=E;I.lastscrollx=-1;I.lastscrolly=-1};this.update=function(y,E){var A=ma();I.steptime=A-I.lasttime;I.lasttime=A;A=E-I.lasty;var V=y-I.lastx,f=I.nc.getScrollTop(),x=I.nc.getScrollLeft();f+=A;x+=V;I.snapx=x<0||x>I.nc.page.maxw;I.snapy=f<0||f>I.nc.page.maxh;I.speedx=V;I.speedy=A;I.lastx=y;I.lasty=E};this.stop=function(){I.nc.unsynched("domomentum2d");I.timer&&clearTimeout(I.timer);I.timer=0;I.lastscrollx=-1;I.lastscrolly=-1};this.doSnapy=function(y,E){var A=
!1;E<0?(E=0,A=!0):E>I.nc.page.maxh&&(E=I.nc.page.maxh,A=!0);y<0?(y=0,A=!0):y>I.nc.page.maxw&&(y=I.nc.page.maxw,A=!0);A?I.nc.doScrollPos(y,E,I.nc.opt.snapbackspeed):I.nc.triggerScrollEnd()};this.doMomentum=function(y){var E=ma(),A=y?E+y:I.lasttime;y=I.nc.getScrollLeft();var V=I.nc.getScrollTop(),f=I.nc.page.maxh,x=I.nc.page.maxw;I.speedx=x>0?Math.min(60,I.speedx):0;I.speedy=f>0?Math.min(60,I.speedy):0;A=A&&E-A<=60;if(V<0||V>f||y<0||y>x)A=!1;y=I.speedx&&A?I.speedx:!1;if(I.speedy&&A&&I.speedy||y){var b=
Math.max(16,I.steptime);b>50&&(y=b/50,I.speedx*=y,I.speedy*=y,b=50);I.demulxy=0;I.lastscrollx=I.nc.getScrollLeft();I.chkx=I.lastscrollx;I.lastscrolly=I.nc.getScrollTop();I.chky=I.lastscrolly;var r=I.lastscrollx,q=I.lastscrolly,S=function(){var t=ma()-E>600?.04:.02;I.speedx&&(r=Math.floor(I.lastscrollx-I.speedx*(1-I.demulxy)),I.lastscrollx=r,r<0||r>x)&&(t=.1);I.speedy&&(q=Math.floor(I.lastscrolly-I.speedy*(1-I.demulxy)),I.lastscrolly=q,q<0||q>f)&&(t=.1);I.demulxy=Math.min(1,I.demulxy+t);I.nc.synched("domomentum2d",
function(){I.speedx&&(I.nc.getScrollLeft(),I.chkx=r,I.nc.setScrollLeft(r));I.speedy&&(I.nc.getScrollTop(),I.chky=q,I.nc.setScrollTop(q));I.timer||(I.nc.hideCursor(),I.doSnapy(r,q))});I.demulxy<1?I.timer=setTimeout(S,b):(I.stop(),I.nc.hideCursor(),I.doSnapy(r,q))};S()}else I.doSnapy(I.nc.getScrollLeft(),I.nc.getScrollTop())}},Fa=n.fn.scrollTop;typeof n.cssHooks==="object"&&(n.cssHooks.pageYOffset={get:function(ba,I,y){return(I=n.data(ba,"__nicescroll")||!1)&&I.ishwscroll?I.getScrollTop():Fa.call(ba)},
set:function(ba,I){var y=n.data(ba,"__nicescroll")||!1;y&&y.ishwscroll?y.setScrollTop(parseInt(I)):Fa.call(ba,I);return this}});n.fn.scrollTop=function(ba){if(ba===void 0){var I=this[0]?n.data(this[0],"__nicescroll")||!1:!1;return I&&I.ishwscroll?I.getScrollTop():Fa.call(this)}return this.each(function(){var y=n.data(this,"__nicescroll")||!1;y&&y.ishwscroll?y.setScrollTop(parseInt(ba)):Fa.call(n(this),ba)})};var sa=n.fn.scrollLeft;typeof n.cssHooks==="object"&&(n.cssHooks.pageXOffset={get:function(ba,
I,y){return(I=n.data(ba,"__nicescroll")||!1)&&I.ishwscroll?I.getScrollLeft():sa.call(ba)},set:function(ba,I){var y=n.data(ba,"__nicescroll")||!1;y&&y.ishwscroll?y.setScrollLeft(parseInt(I)):sa.call(ba,I);return this}});n.fn.scrollLeft=function(ba){if(ba===void 0){var I=this[0]?n.data(this[0],"__nicescroll")||!1:!1;return I&&I.ishwscroll?I.getScrollLeft():sa.call(this)}return this.each(function(){var y=n.data(this,"__nicescroll")||!1;y&&y.ishwscroll?y.setScrollLeft(parseInt(ba)):sa.call(n(this),ba)})};
var la=function(ba){var I=this;this.length=0;this.name="nicescrollarray";this.each=function(A){n.each(I,A);return I};this.push=function(A){I[I.length]=A;I.length++};this.eq=function(A){return I[A]};if(ba)for(var y=0;y<ba.length;y++){var E=n.data(ba[y],"__nicescroll")||!1;E&&(this[this.length]=E,this.length++)}return this};(function(ba,I,y){for(var E=0,A=I.length;E<A;E++)y(ba,I[E])})(la.prototype,"show hide toggle onResize resize remove stop doScrollPos".split(" "),function(ba,I){ba[I]=function(){var y=
arguments;return this.each(function(){this[I].apply(this,y)})}});n.fn.getNiceScroll=function(ba){return ba===void 0?new la(this):this[ba]&&n.data(this[ba],"__nicescroll")||!1};if(typeof n.expr==="object"){var Ca=n.expr.pseudos||n.expr[":"];Ca&&(Ca.nicescroll=function(ba){return n.data(ba,"__nicescroll")!==void 0})}n.fn.niceScroll=function(ba,I){I!==void 0||typeof ba!="object"||"jquery"in ba||(I=ba,ba=!1);var y=new la;this.each(function(){var E=n(this),A=n.extend({},I);if(ba){var V=n(ba);A.doc=V.length>
1?n(ba,E):V;A.win=E}"doc"in A&&!("win"in A)&&(A.win=E);V=E.data("__nicescroll")||!1;V||(A.doc=A.doc||E,V=new ya(A,E),E.data("__nicescroll",V));y.push(V)});return y.length===1?y[0]:y};L.NiceScroll={getjQuery:function(){return n}};n.nicescroll||(n.nicescroll=new la,n.nicescroll.options=ta)})(function(n){var J=function(){function v(l){return l==null?String(l):e[Ka.call(l)]||"object"}function z(l){return v(l)=="function"}function M(l){return l!=null&&l==l.window}function P(l){return v(l)=="object"}function D(l){return P(l)&&
!M(l)&&Object.getPrototypeOf(l)==Object.prototype}function Q(l){var w=!!l&&"length"in l&&l.length,F=C.type(l);return"function"!=F&&!M(l)&&("array"==F||w===0||typeof w=="number"&&w>0&&w-1 in l)}function U(l){return y.call(l,function(w){return w!=null})}function W(l){return l.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function ea(l){return l in f?f[l]:f[l]=new RegExp("(^|\\s)"+l+"(\\s|$)")}function aa(l,w){return typeof w!=
"number"||x[W(l)]?w:w+"px"}function X(l){return"children"in l?E.call(l.children):C.map(l.childNodes,function(w){if(w.nodeType==1)return w})}function ma(l,w){var F,T=l?l.length:0;for(F=0;F<T;F++)this[F]=l[F];this.length=T;this.selector=w||""}function ta(l,w,F){for(la in w)F&&(D(w[la])||Qa(w[la]))?(D(w[la])&&!D(l[la])&&(l[la]={}),Qa(w[la])&&!Qa(l[la])&&(l[la]=[]),ta(l[la],w[la],F)):w[la]!==sa&&(l[la]=w[la])}function ua(l,w){return w==null?C(l):C(l).filter(w)}function ja(l,w,F,T){return z(w)?w.call(l,
F,T):w}function ya(l,w){var F=l.className||"",T=F&&F.baseVal!==sa;if(w===sa)return T?F.baseVal:F;T?F.baseVal=w:l.className=w}function wa(l){try{return l?l=="true"||(l=="false"?!1:l=="null"?null:+l+""==l?+l:/^[\[\{]/.test(l)?C.parseJSON(l):l):l}catch(w){return l}}function Fa(l,w){w(l);for(var F=0,T=l.childNodes.length;F<T;F++)Fa(l.childNodes[F],w)}var sa,la,Ca,ba=[],I=ba.concat,y=ba.filter,E=ba.slice,A=n.document,V={},f={},x={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,
zoom:1},b=/^\s*<(\w+|!)[^>]*>/,r=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,q=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,S=/^(?:body|html)$/i,t=/([A-Z])/g,R="val css html text data width height offset".split(" "),ca=A.createElement("table"),Y=A.createElement("tr"),ia={tr:A.createElement("tbody"),tbody:ca,thead:ca,tfoot:ca,td:Y,th:Y,"*":A.createElement("div")},oa=/complete|loaded|interactive/,xa=/^[\w-]*$/,e={},Ka=e.toString,va={},ka=A.createElement("div"),Da={tabindex:"tabIndex",
readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},Qa=Array.isArray||function(l){return l instanceof Array};va.matches=function(l,w){if(!w||!l||l.nodeType!==1)return!1;var F=l.matches||l.webkitMatchesSelector||l.mozMatchesSelector||l.oMatchesSelector||l.matchesSelector;if(F)return F.call(l,w);var T=l.parentNode;
(F=!T)&&(T=ka).appendChild(l);w=~va.qsa(T,w).indexOf(l);F&&ka.removeChild(l);return w};var p=function(l){return l.replace(/-+(.)?/g,function(w,F){return F?F.toUpperCase():""})};var B=function(l){return y.call(l,function(w,F){return l.indexOf(w)==F})};va.fragment=function(l,w,F){var T;r.test(l)&&(T=C(A.createElement(RegExp.$1)));if(!T){l.replace&&(l=l.replace(q,"<$1></$2>"));w===sa&&(w=b.test(l)&&RegExp.$1);w in ia||(w="*");var ra=ia[w];ra.innerHTML=""+l;T=C.each(E.call(ra.childNodes),function(){ra.removeChild(this)})}if(D(F)){var pa=
C(T);C.each(F,function(Ga,Ja){if(R.indexOf(Ga)>-1)pa[Ga](Ja);else pa.attr(Ga,Ja)})}return T};va.Z=function(l,w){return new ma(l,w)};va.isZ=function(l){return l instanceof va.Z};va.init=function(l,w){if(l)if(typeof l=="string")if(l=l.trim(),l[0]=="<"&&b.test(l))w=va.fragment(l,RegExp.$1,w),l=null;else{if(w!==sa)return C(w).find(l);w=va.qsa(A,l)}else{if(z(l))return C(A).ready(l);if(va.isZ(l))return l;if(Qa(l))w=U(l);else if(P(l))w=[l],l=null;else if(b.test(l))w=va.fragment(l.trim(),RegExp.$1,w),l=null;
else{if(w!==sa)return C(w).find(l);w=va.qsa(A,l)}}else return va.Z();return va.Z(w,l)};var C=function(l,w){return va.init(l,w)};C.extend=function(l){var w=E.call(arguments,1);if(typeof l=="boolean"){var F=l;l=w.shift()}w.forEach(function(T){ta(l,T,F)});return l};va.qsa=function(l,w){var F,T=w[0]=="#",ra=!T&&w[0]==".",pa=T||ra?w.slice(1):w,Ga=xa.test(pa);return l.getElementById&&Ga&&T?(F=l.getElementById(pa))?[F]:[]:l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11?[]:E.call(Ga&&!T&&l.getElementsByClassName?
ra?l.getElementsByClassName(pa):l.getElementsByTagName(w):l.querySelectorAll(w))};C.contains=A.documentElement.contains?function(l,w){return l!==w&&l.contains(w)}:function(l,w){for(;w&&=w.parentNode;)if(w===l)return!0;return!1};C.type=v;C.isFunction=z;C.isWindow=M;C.isArray=Qa;C.isPlainObject=D;C.isEmptyObject=function(l){for(var w in l)return!1;return!0};C.isNumeric=function(l){var w=Number(l),F=typeof l;return l!=null&&F!="boolean"&&(F!="string"||l.length)&&!isNaN(w)&&isFinite(w)||!1};C.inArray=
function(l,w,F){return ba.indexOf.call(w,l,F)};C.camelCase=p;C.trim=function(l){return l==null?"":String.prototype.trim.call(l)};C.uuid=0;C.support={};C.expr={};C.noop=function(){};C.map=function(l,w){var F=[],T;if(Q(l))for(T=0;T<l.length;T++){var ra=w(l[T],T);ra!=null&&F.push(ra)}else for(T in l)ra=w(l[T],T),ra!=null&&F.push(ra);return F.length>0?C.fn.concat.apply([],F):F};C.each=function(l,w){var F;if(Q(l))for(F=0;F<l.length&&w.call(l[F],F,l[F])!==!1;F++);else for(F in l)if(w.call(l[F],F,l[F])===
!1)break;return l};C.grep=function(l,w){return y.call(l,w)};n.JSON&&(C.parseJSON=JSON.parse);C.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(l,w){e["[object "+w+"]"]=w.toLowerCase()});C.data=function(l,w,F){if(F===sa)return typeof l[w]!=="undefined"?l[w]:sa;F===null?delete l[w]:l[w]=F};C.fn={jquery:"1.2.0",constructor:va.Z,length:0,forEach:ba.forEach,reduce:ba.reduce,push:ba.push,sort:ba.sort,splice:ba.splice,indexOf:ba.indexOf,concat:function(){var l,w=
[];for(l=0;l<arguments.length;l++){var F=arguments[l];w[l]=va.isZ(F)?F.toArray():F}return I.apply(va.isZ(this)?this.toArray():this,w)},map:function(l){return C(C.map(this,function(w,F){return l.call(w,F,w)}))},slice:function(){return C(E.apply(this,arguments))},ready:function(l){oa.test(A.readyState)&&A.body?l(C):A.addEventListener("DOMContentLoaded",function(){l(C)},!1);return this},get:function(l){return l===sa?E.call(this):this[l>=0?l:l+this.length]},toArray:function(){return this.get()},size:function(){return this.length},
remove:function(){return this.each(function(){this.parentNode!=null&&this.parentNode.removeChild(this)})},each:function(l){ba.every.call(this,function(w,F){return l.call(w,F,w)!==!1});return this},filter:function(l){return z(l)?this.not(this.not(l)):C(y.call(this,function(w){return va.matches(w,l)}))},add:function(l,w){return C(B(this.concat(C(l,w))))},is:function(l){return l===":visible"?this.length>0?this.css("display")!=="none":!1:P(l)?this[0]===l?!0:!1:this.length>0&&va.matches(this[0],l)},not:function(l){var w=
[];if(z(l)&&l.call!==sa)this.each(function(T){l.call(this,T)||w.push(this)});else{var F=typeof l=="string"?this.filter(l):Q(l)&&z(l.item)?E.call(l):C(l);this.forEach(function(T){F.indexOf(T)<0&&w.push(T)})}return C(w)},has:function(l){return this.filter(function(){return P(l)?C.contains(this,l):C(this).find(l).size()})},eq:function(l){return l===-1?this.slice(l):this.slice(l,+l+1)},first:function(){var l=this[0];return l&&!P(l)?l:C(l)},last:function(){var l=this[this.length-1];return l&&!P(l)?l:C(l)},
find:function(l){var w=this;return l?typeof l=="object"?C(l).filter(function(){var F=this;return ba.some.call(w,function(T){return C.contains(T,F)})}):this.length==1?C(va.qsa(this[0],l)):this.map(function(){return va.qsa(this,l)}):C()},closest:function(l,w){var F=[],T=typeof l=="object"&&C(l);this.each(function(ra,pa){for(;pa&&!(T?T.indexOf(pa)>=0:va.matches(pa,l));)pa=pa!==w&&!(pa!=null&&pa.nodeType==pa.DOCUMENT_NODE)&&pa.parentNode;pa&&F.indexOf(pa)<0&&F.push(pa)});return C(F)},parents:function(l){for(var w=
[],F=this;F.length>0;)F=C.map(F,function(T){if((T=T.parentNode)&&(T==null||T.nodeType!=T.DOCUMENT_NODE)&&w.indexOf(T)<0)return w.push(T),T});return ua(w,l)},parent:function(l){return ua(B(this.pluck("parentNode")),l)},children:function(l){return ua(this.map(function(){return X(this)}),l)},contents:function(){return this.map(function(){return this.contentDocument||E.call(this.childNodes)})},siblings:function(l){return ua(this.map(function(w,F){return y.call(X(F.parentNode),function(T){return T!==F})}),
l)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(l){return C.map(this,function(w){return w[l]})},show:function(){return this.each(function(){this.style.display=="none"&&(this.style.display="");if(getComputedStyle(this,"").getPropertyValue("display")=="none"){var l=this.style,w=this.nodeName;if(!V[w]){var F=A.createElement(w);A.body.appendChild(F);var T=getComputedStyle(F,"").getPropertyValue("display");F.parentNode.removeChild(F);T=="none"&&(T="block");V[w]=T}l.display=
V[w]}})},replaceWith:function(l){return this.before(l).remove()},wrap:function(l){var w=z(l);if(this[0]&&!w)var F=C(l).get(0),T=F.parentNode||this.length>1;return this.each(function(ra){C(this).wrapAll(w?l.call(this,ra):T?F.cloneNode(!0):F)})},wrapAll:function(l){if(this[0]){C(this[0]).before(l=C(l));for(var w;(w=l.children()).length;)l=w.first();C(l).append(this)}return this},wrapInner:function(l){var w=z(l);return this.each(function(F){var T=C(this),ra=T.contents();F=w?l.call(this,F):l;ra.length?
ra.wrapAll(F):T.append(F)})},unwrap:function(){this.parent().each(function(){C(this).replaceWith(C(this).children())});return this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(l){return this.each(function(){var w=C(this);(l===sa?w.css("display")=="none":l)?w.show():w.hide()})},prev:function(l){return C(this.pluck("previousElementSibling")).filter(l||"*")},next:function(l){return C(this.pluck("nextElementSibling")).filter(l||
"*")},html:function(l){return 0 in arguments?this.each(function(w){var F=this.innerHTML;C(this).empty().append(ja(this,l,w,F))}):0 in this?this[0].innerHTML:null},text:function(l){return 0 in arguments?this.each(function(w){w=ja(this,l,w,this.textContent);this.textContent=w==null?"":""+w}):0 in this?this.pluck("textContent").join(""):null},attr:function(l,w){var F;return typeof l!="string"||1 in arguments?this.each(function(T){if(this.nodeType===1)if(P(l))for(la in l){var ra=la;T=l[la];T==null?this.removeAttribute(ra):
this.setAttribute(ra,T)}else ra=l,T=ja(this,w,T,this.getAttribute(l)),T==null?this.removeAttribute(ra):this.setAttribute(ra,T)}):0 in this&&this[0].nodeType==1&&(F=this[0].getAttribute(l))!=null?F:sa},removeAttr:function(l){return this.each(function(){this.nodeType===1&&l.split(" ").forEach(function(w){this.removeAttribute(w)},this)})},prop:function(l,w){l=Da[l]||l;return 1 in arguments?this.each(function(F){this[l]=ja(this,w,F,this[l])}):this[0]&&this[0][l]},removeProp:function(l){l=Da[l]||l;return this.each(function(){delete this[l]})},
data:function(l,w){if(typeof w==="object")this.length&&(this[0][l]=w);else{if(typeof w==="undefined"){if(this.length&&typeof this[0][l]!=="undefined")return this[0][l]}else this.length&&(typeof this[0][l]!=="undefined"&&delete this[0][l],w&&(this[0][l]=w));var F="data-"+l.replace(t,"-$1").toLowerCase();F=1 in arguments?this.attr(F,w):this.attr(F);return F!==null?wa(F):sa}},val:function(l){return 0 in arguments?(l==null&&(l=""),this.each(function(w){this.value=ja(this,l,w,this.value)})):this[0]&&(this[0].multiple?
C(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value)},offset:function(l){if(l)return this.each(function(F){var T=C(this);F=ja(this,l,F,T.offset());var ra=T.offsetParent().offset();F={top:F.top-ra.top,left:F.left-ra.left};T.css("position")=="static"&&(F.position="relative");T.css(F)});if(!this.length)return null;if(A.documentElement!==this[0]&&!C.contains(A.documentElement,this[0]))return{top:0,left:0};var w=this[0].getBoundingClientRect();return{left:w.left+
n.pageXOffset,top:w.top+n.pageYOffset,width:Math.round(w.width),height:Math.round(w.height)}},css:function(l,w){if(arguments.length<2){var F=this[0];if(typeof l=="string")return F?F.style[p(l)]||getComputedStyle(F,"").getPropertyValue(l):void 0;if(Qa(l)){if(!F)return;var T={},ra=getComputedStyle(F,"");C.each(l,function(Ga,Ja){T[Ja]=F.style[p(Ja)]||ra.getPropertyValue(Ja)});return T}}var pa="";if(v(l)=="string")w||w===0?pa=W(l)+":"+aa(l,w):this.each(function(){this.style.removeProperty(W(l))});else for(la in l)l[la]||
l[la]===0?pa+=W(la)+":"+aa(la,l[la])+";":this.each(function(){this.style.removeProperty(W(la))});return this.each(function(){this.style.cssText+=";"+pa})},index:function(l){return l?this.indexOf(C(l)[0]):this.parent().children().indexOf(this[0])},hasClass:function(l){return l?ba.some.call(this,function(w){return this.test(ya(w))},ea(l)):!1},addClass:function(l){return l?this.each(function(w){if("className"in this){Ca=[];var F=ya(this);ja(this,l,w,F).split(/\s+/g).forEach(function(T){C(this).hasClass(T)||
Ca.push(T)},this);Ca.length&&ya(this,F+(F?" ":"")+Ca.join(" "))}}):this},removeClass:function(l){return this.each(function(w){if("className"in this){if(l===sa)return ya(this,"");Ca=ya(this);ja(this,l,w,Ca).split(/\s+/g).forEach(function(F){Ca=Ca.replace(ea(F)," ")});ya(this,Ca.trim())}})},toggleClass:function(l,w){return l?this.each(function(F){var T=C(this);ja(this,l,F,ya(this)).split(/\s+/g).forEach(function(ra){(w===sa?!T.hasClass(ra):w)?T.addClass(ra):T.removeClass(ra)})}):this},scrollTop:function(l){if(this.length){var w=
"scrollTop"in this[0];return l===sa?w?this[0].scrollTop:this[0].pageYOffset:this.each(w?function(){this.scrollTop=l}:function(){this.scrollTo(this.scrollX,l)})}},scrollLeft:function(l){if(this.length){var w="scrollLeft"in this[0];return l===sa?w?this[0].scrollLeft:this[0].pageXOffset:this.each(w?function(){this.scrollLeft=l}:function(){this.scrollTo(l,this.scrollY)})}},position:function(){if(this.length){var l=this[0],w=this.offsetParent(),F=this.offset(),T=S.test(w[0].nodeName)?{top:0,left:0}:w.offset();
F.top-=parseFloat(C(l).css("margin-top"))||0;F.left-=parseFloat(C(l).css("margin-left"))||0;T.top+=parseFloat(C(w[0]).css("border-top-width"))||0;T.left+=parseFloat(C(w[0]).css("border-left-width"))||0;return{top:F.top-T.top,left:F.left-T.left}}},offsetParent:function(){return this.map(function(){for(var l=this.offsetParent||A.body;l&&!S.test(l.nodeName)&&C(l).css("position")=="static";)l=l.offsetParent;return l})}};C.fn.detach=C.fn.remove;["width","height"].forEach(function(l){var w=l.replace(/./,
function(F){return F[0].toUpperCase()});C.fn[l]=function(F){var T,ra=this[0];return F===sa?M(ra)?ra["inner"+w]:ra!=null&&ra.nodeType==ra.DOCUMENT_NODE?ra.documentElement["scroll"+w]:(T=this.offset())&&T[l]:this.each(function(pa){ra=C(this);ra.css(l,ja(this,F,pa,ra[l]()))})}});C.fn.innerWidth=function(){return this.width()};C.fn.innerHeight=function(){return this.height()};["after","prepend","before","append"].forEach(function(l,w){var F=w%2;C.fn[l]=function(){var T,ra=C.map(arguments,function(Ja){var c=
[];T=v(Ja);return T=="array"?(Ja.forEach(function(d){if(d.nodeType!==sa)return c.push(d);if(C.zepto.isZ(d))return c=c.concat(d.get());c=c.concat(va.fragment(d))}),c):T=="object"||Ja==null?Ja:va.fragment(Ja)}),pa,Ga=this.length>1;return ra.length<1?this:this.each(function(Ja,c){pa=F?c:c.parentNode;c=w==0?c.nextSibling:w==1?c.firstChild:w==2?c:null;var d=C.contains(A.documentElement,pa);ra.forEach(function(g){if(Ga)g=g.cloneNode(!0);else if(!pa)return C(g).remove();pa.insertBefore(g,c);d&&Fa(g,function(m){if(!(m.nodeName==
null||m.nodeName.toUpperCase()!=="SCRIPT"||m.type&&m.type!=="text/javascript"||m.src)){var h=m.ownerDocument?m.ownerDocument.defaultView:n;h.eval.call(h,m.innerHTML)}})})})};C.fn[F?l+"To":"insert"+(w?"Before":"After")]=function(T){C(T)[l](this);return this}});va.Z.prototype=ma.prototype=C.fn;va.uniq=B;va.deserializeValue=wa;C.zepto=va;return C}();n.mQuery=J;n.$$===void 0&&(n.$$=J);(function(v){function z(y){return y._zid||(y._zid=aa++)}function M(y,E,A,V){E=P(E);if(E.ns)var f=new RegExp("(?:^| )"+
E.ns.replace(" "," .* ?")+"(?: |$)");return(ja[z(y)]||[]).filter(function(x){return x&&(!E.e||x.e==E.e)&&(!E.ns||f.test(x.ns))&&(!A||z(x.fn)===z(A))&&(!V||x.sel==V)})}function P(y){y=(""+y).split(".");return{e:y[0],ns:y.slice(1).sort().join(" ")}}function D(y){return sa[y]||wa&&Fa[y]||y}function Q(y,E,A,V,f,x,b){var r=z(y),q=ja[r]||(ja[r]=[]);E.split(/\s/).forEach(function(S){if(S=="ready")return v(document).ready(A);var t=P(S);t.fn=A;t.sel=f;t.e in sa&&(A=function(ca){var Y=ca.relatedTarget;if(!Y||
Y!==this&&!v.contains(this,Y))return t.fn.apply(this,arguments)});var R=(t.del=x)||A;t.proxy=function(ca){ca=W(ca);if(!ca.isImmediatePropagationStopped()){ca.data=V;var Y=R.apply(y,ca._args==X?[ca]:[ca].concat(ca._args));Y===!1&&(ca.preventDefault(),ca.stopPropagation());return Y}};t.i=q.length;q.push(t);"addEventListener"in y&&y.addEventListener(D(t.e),t.proxy,t.del&&!wa&&t.e in Fa||!!b)})}function U(y,E,A,V,f){var x=z(y);(E||"").split(/\s/).forEach(function(b){M(y,b,A,V).forEach(function(r){delete ja[x][r.i];
"removeEventListener"in y&&y.removeEventListener(D(r.e),r.proxy,r.del&&!wa&&r.e in Fa||!!f)})})}function W(y,E){if(E||!y.isDefaultPrevented)if(E||=y,v.each(I,function(A,V){var f=E[A];y[A]=function(){this[V]=la;return f&&f.apply(E,arguments)};y[V]=Ca}),y.timeStamp||(y.timeStamp=Date.now()),E.defaultPrevented!==X?E.defaultPrevented:"returnValue"in E?E.returnValue===!1:E.getPreventDefault&&E.getPreventDefault())y.isDefaultPrevented=la;return y}function ea(y){var E,A={originalEvent:y};for(E in y)ba.test(E)||
y[E]===X||(A[E]=y[E]);return W(A,y)}var aa=1,X,ma=Array.prototype.slice,ta=v.isFunction,ua=function(y){return typeof y=="string"},ja={},ya={},wa="onfocusin"in n,Fa={focus:"focusin",blur:"focusout"},sa={mouseenter:"mouseover",mouseleave:"mouseout"};ya.click=ya.mousedown=ya.mouseup=ya.mousemove="MouseEvents";v.event={add:Q,remove:U};v.proxy=function(y,E){var A=2 in arguments&&ma.call(arguments,2);if(ta(y)){var V=function(){return y.apply(E,A?A.concat(ma.call(arguments)):arguments)};V._zid=z(y);return V}if(ua(E))return A?
(A.unshift(y[E],y),v.proxy.apply(null,A)):v.proxy(y[E],y);throw new TypeError("expected function");};v.fn.bind=function(y,E,A){return this.on(y,E,A)};v.fn.unbind=function(y,E){return this.off(y,E)};v.fn.one=function(y,E,A,V){return this.on(y,E,A,V,1)};var la=function(){return!0},Ca=function(){return!1},ba=/^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/,I={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};v.fn.delegate=
function(y,E,A){return this.on(E,y,A)};v.fn.undelegate=function(y,E,A){return this.off(E,y,A)};v.fn.live=function(y,E){v(document.body).delegate(this.selector,y,E);return this};v.fn.die=function(y,E){v(document.body).undelegate(this.selector,y,E);return this};v.fn.on=function(y,E,A,V,f){var x,b,r=this;if(y&&!ua(y))return v.each(y,function(q,S){r.on(q,E,A,S,f)}),r;ua(E)||ta(V)||V===!1||(V=A,A=E,E=X);if(V===X||A===!1)V=A,A=X;V===!1&&(V=Ca);return r.each(function(q,S){f&&(x=function(t){U(S,t.type,V);
return V.apply(this,arguments)});E&&(b=function(t){var R=v(t.target).closest(E,S).get(0);if(R&&R!==S){var ca=v.extend(ea(t),{currentTarget:R,liveFired:S});return(x||V).apply(R,[ca].concat(ma.call(arguments,1)))}});Q(S,y,V,A,E,b||x)})};v.fn.off=function(y,E,A){var V=this;if(y&&!ua(y))return v.each(y,function(f,x){V.off(f,E,x)}),V;ua(E)||ta(A)||A===!1||(A=E,E=X);A===!1&&(A=Ca);return V.each(function(){U(this,y,A,E)})};v.fn.trigger=function(y,E){y=ua(y)||v.isPlainObject(y)?v.Event(y):W(y);y._args=E;
return this.each(function(){if(y.type in Fa&&typeof this[y.type]=="function")this[y.type]();else"dispatchEvent"in this?this.dispatchEvent(y):v(this).triggerHandler(y,E)})};v.fn.triggerHandler=function(y,E){var A,V;this.each(function(f,x){A=ea(ua(y)?v.Event(y):y);A._args=E;A.target=x;v.each(M(x,y.type||y),function(b,r){V=r.proxy(A);if(A.isImmediatePropagationStopped())return!1})});return V};"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(y){v.fn[y]=
function(E){return 0 in arguments?this.bind(y,E):this.trigger(y)}});v.Event=function(y,E){ua(y)||(E=y,y=E.type);var A=document.createEvent(ya[y]||"Events"),V=!0;if(E)for(var f in E)f=="bubbles"?V=!!E[f]:A[f]=E[f];A.initEvent(y,V,!0);return W(A)}})(J);(function(v){["width","height"].forEach(function(z){var M=z.replace(/./,function(P){return P[0].toUpperCase()});v.fn["outer"+M]=function(P){var D=this;if(D){var Q=D[z]();({width:["left","right"],height:["top","bottom"]})[z].forEach(function(U){P&&(Q+=
parseInt(D.css("margin-"+U),10))});return Q}return null}})})(J);(function(v){function z(y,E,A,V){if(y.global)return y=E||ja,A=v.Event(A),v(y).trigger(A,V),!A.isDefaultPrevented()}function M(y){y.global&&v.active++===0&&z(y,null,"ajaxStart")}function P(y,E){var A=E.context;if(E.beforeSend.call(A,y,E)===!1||z(E,A,"ajaxBeforeSend",[y,E])===!1)return!1;z(E,A,"ajaxSend",[y,E])}function D(y,E,A,V){var f=A.context;A.success.call(f,y,"success",E);V&&V.resolveWith(f,[y,"success",E]);z(A,f,"ajaxSuccess",[E,
A,y]);U("success",E,A)}function Q(y,E,A,V,f){var x=V.context;V.error.call(x,A,E,y);f&&f.rejectWith(x,[A,E,y]);z(V,x,"ajaxError",[A,V,y||E]);U(E,A,V)}function U(y,E,A){var V=A.context;A.complete.call(V,E,y);z(A,V,"ajaxComplete",[E,A]);A.global&&!--v.active&&z(A,null,"ajaxStop")}function W(){}function ea(y){y&&=y.split(";",2)[0];return y&&(y=="text/html"?"html":y=="application/json"?"json":sa.test(y)?"script":la.test(y)&&"xml")||"text"}function aa(y,E){return E==""?y:(y+"&"+E).replace(/[&?]{1,2}/,"?")}
function X(y){y.processData&&y.data&&v.type(y.data)!="string"&&(y.data=v.param(y.data,y.traditional));!y.data||y.type&&y.type.toUpperCase()!="GET"&&"jsonp"!=y.dataType||(y.url=aa(y.url,y.data),y.data=void 0)}function ma(y,E,A,V){v.isFunction(E)&&(V=A,A=E,E=void 0);v.isFunction(A)||(V=A,A=void 0);return{url:y,data:E,success:A,dataType:V}}function ta(y,E,A,V){var f,x=v.isArray(E),b=v.isPlainObject(E);v.each(E,function(r,q){f=v.type(q);V&&(r=A?V:V+"["+(b||f=="object"||f=="array"?r:"")+"]");!V&&x?y.add(q.name,
q.value):f=="array"||!A&&f=="object"?ta(y,q,A,r):y.add(r,q)})}var ua=+new Date,ja=n.document,ya,wa,Fa=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,sa=/^(?:text|application)\/javascript/i,la=/^(?:text|application)\/xml/i,Ca=/^\s*$/,ba=ja.createElement("a");ba.href=n.location.href;v.active=0;v.ajaxJSONP=function(y,E){if(!("type"in y))return v.ajax(y);var A=y.jsonpCallback,V=(v.isFunction(A)?A():A)||"Zepto"+ua++,f=ja.createElement("script"),x=n[V],b,r=function(t){v(f).triggerHandler("error",
t||"abort")},q={abort:r},S;E&&E.promise(q);v(f).on("load error",function(t,R){clearTimeout(S);v(f).off().remove();t.type!="error"&&b?D(b[0],q,y,E):Q(null,R||"error",q,y,E);n[V]=x;b&&v.isFunction(x)&&x(b[0]);x=b=void 0});if(P(q,y)===!1)return r("abort"),q;n[V]=function(){b=arguments};f.src=y.url.replace(/\?(.+)=\?/,"?$1="+V);ja.head.appendChild(f);y.timeout>0&&(S=setTimeout(function(){r("timeout")},y.timeout));return q};v.ajaxSettings={type:"GET",beforeSend:W,success:W,error:W,complete:W,context:null,
global:!0,xhr:function(){return new n.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:"application/json",xml:"application/xml, text/xml",html:"text/html",text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0,dataFilter:W};v.ajax=function(y){var E=v.extend({},y||{}),A=v.Deferred&&v.Deferred();for(ya in v.ajaxSettings)E[ya]===void 0&&(E[ya]=v.ajaxSettings[ya]);M(E);if(!E.crossDomain){var V=ja.createElement("a");V.href=E.url;V.href=
V.href;E.crossDomain=ba.protocol+"//"+ba.host!==V.protocol+"//"+V.host}E.url||(E.url=n.location.toString());(V=E.url.indexOf("#"))>-1&&(E.url=E.url.slice(0,V));X(E);var f=E.dataType;(V=/\?.+=\?/.test(E.url))&&(f="jsonp");E.cache!==!1&&(y&&y.cache===!0||"script"!=f&&"jsonp"!=f)||(E.url=aa(E.url,"_="+Date.now()));if("jsonp"==f)return V||(E.url=aa(E.url,E.jsonp?E.jsonp+"=?":E.jsonp===!1?"":"callback=?")),v.ajaxJSONP(E,A);y=E.accepts[f];var x={};V=function(t,R){x[t.toLowerCase()]=[t,R]};var b=/^([\w-]+:)\/\//.test(E.url)?
RegExp.$1:n.location.protocol,r=E.xhr(),q=r.setRequestHeader,S;A&&A.promise(r);E.crossDomain||V("X-Requested-With","XMLHttpRequest");V("Accept",y||"*/*");if(y=E.mimeType||y)y.indexOf(",")>-1&&(y=y.split(",",2)[0]),r.overrideMimeType&&r.overrideMimeType(y);(E.contentType||E.contentType!==!1&&E.data&&E.type.toUpperCase()!="GET")&&V("Content-Type",E.contentType||"application/x-www-form-urlencoded");if(E.headers)for(wa in E.headers)V(wa,E.headers[wa]);r.setRequestHeader=V;r.onreadystatechange=function(){if(r.readyState==
4){r.onreadystatechange=W;clearTimeout(S);var t=!1;if(r.status>=200&&r.status<300||r.status==304||r.status==0&&b=="file:"){f=f||ea(E.mimeType||r.getResponseHeader("content-type"));if(r.responseType=="arraybuffer"||r.responseType=="blob")var R=r.response;else{R=r.responseText;try{R=E.dataFilter==W?R:E.dataFilter.call(E.context,R,f),f=="script"?(0,eval)(R):f=="xml"?R=r.responseXML:f=="json"&&(R=Ca.test(R)?null:v.parseJSON(R))}catch(ca){t=ca}if(t)return Q(t,"parsererror",r,E,A)}D(R,r,E,A)}else Q(r.statusText||
null,r.status?"error":"abort",r,E,A)}};if(P(r,E)===!1)return r.abort(),Q(null,"abort",r,E,A),r;r.open(E.type,E.url,"async"in E?E.async:!0,E.username,E.password);if(E.xhrFields)for(wa in E.xhrFields)r[wa]=E.xhrFields[wa];for(wa in x)q.apply(r,x[wa]);E.timeout>0&&(S=setTimeout(function(){r.onreadystatechange=W;r.abort();Q(null,"timeout",r,E,A)},E.timeout));r.send(E.data?E.data:null);return r};v.get=function(){return v.ajax(ma.apply(null,arguments))};v.post=function(){var y=ma.apply(null,arguments);
y.type="POST";return v.ajax(y)};v.getJSON=function(){var y=ma.apply(null,arguments);y.dataType="json";return v.ajax(y)};v.fn.load=function(y,E,A){if(!this.length)return this;var V=this,f=y.split(/\s/);y=ma(y,E,A);var x=y.success;if(f.length>1){y.url=f[0];var b=f[1]}y.success=function(r){V.html(b?v("<div>").html(r.replace(Fa,"")).find(b):r);x&&x.apply(V,arguments)};v.ajax(y);return this};var I=encodeURIComponent;v.param=function(y,E){var A=[];A.add=function(V,f){v.isFunction(f)&&(f=f());f==null&&(f=
"");this.push(I(V)+"="+I(f))};ta(A,y,E);return A.join("&").replace(/%20/g,"+")}})(J);(function(v){v.fn.serializeArray=function(){var z,M,P=[],D=function(Q){if(Q.forEach)return Q.forEach(D);P.push({name:z,value:Q})};this[0]&&v.each(this[0].elements,function(Q,U){M=U.type;(z=U.name)&&U.nodeName.toLowerCase()!="fieldset"&&!U.disabled&&M!="submit"&&M!="reset"&&M!="button"&&M!="file"&&(M!="radio"&&M!="checkbox"||U.checked)&&D(v(U).val())});return P};v.fn.serialize=function(){var z=[];this.serializeArray().forEach(function(M){z.push(encodeURIComponent(M.name)+
"="+encodeURIComponent(M.value))});return z.join("&")};v.fn.submit=function(z){if(0 in arguments)this.bind("submit",z);else if(this.length){var M=v.Event("submit");this.eq(0).trigger(M);M.isDefaultPrevented()||this.get(0).submit()}return this}})(J);(function(v,z){function M(sa){return D?D+sa:sa.toLowerCase()}var P="",D,Q={Webkit:"webkit",Moz:"",O:"o"},U=document.createElement("div"),W=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i,ea,aa,X,ma,ta,ua,ja,ya,wa={};U.style.transform===
z&&v.each(Q,function(sa,la){if(U.style[sa+"TransitionProperty"]!==z)return P="-"+sa.toLowerCase()+"-",D=la,!1});var Fa=P+"transform";wa[ea=P+"transition-property"]=wa[aa=P+"transition-duration"]=wa[ma=P+"transition-delay"]=wa[X=P+"transition-timing-function"]=wa[ta=P+"animation-name"]=wa[ua=P+"animation-duration"]=wa[ya=P+"animation-delay"]=wa[ja=P+"animation-timing-function"]="";v.fx={off:D===z&&U.style.transitionProperty===z,speeds:{_default:400,fast:200,slow:600},cssPrefix:P,transitionEnd:M("TransitionEnd"),
animationEnd:M("AnimationEnd")};v.fn.animate=function(sa,la,Ca,ba,I){v.isFunction(la)&&(ba=la,la=Ca=z);v.isFunction(Ca)&&(ba=Ca,Ca=z);v.isPlainObject(la)&&(Ca=la.easing,ba=la.complete,I=la.delay,la=la.duration);la&&=(typeof la=="number"?la:v.fx.speeds[la]||v.fx.speeds._default)/1E3;I&&=parseFloat(I)/1E3;return this.anim(sa,la,Ca,ba,I)};v.fn.anim=function(sa,la,Ca,ba,I){var y,E={},A="",V=this,f=v.fx.transitionEnd,x=!1;la===z&&(la=v.fx.speeds._default/1E3);I===z&&(I=0);v.fx.off&&(la=0);if(typeof sa==
"string")E[ta]=sa,E[ua]=la+"s",E[ya]=I+"s",E[ja]=Ca||"linear",f=v.fx.animationEnd;else{var b=[];for(y in sa)W.test(y)?A+=y+"("+sa[y]+") ":(E[y]=sa[y],b.push(y.replace(/([A-Z])/g,"-$1").toLowerCase()));A&&(E[Fa]=A,b.push(Fa));la>0&&typeof sa==="object"&&(E[ea]=b.join(", "),E[aa]=la+"s",E[ma]=I+"s",E[X]=Ca||"linear")}var r=function(q){if(typeof q!=="undefined"){if(q.target!==q.currentTarget)return;v(q.target).unbind(f,r)}else v(this).unbind(f,r);x=!0;v(this).css(wa);ba&&ba.call(this)};la>0&&(this.bind(f,
r),setTimeout(function(){x||r.call(V)},(la+I)*1E3+25));this.size()&&this.get(0).clientLeft;this.css(E);la<=0&&setTimeout(function(){V.each(function(){r.call(this)})},0);return this};v.fn.stop=function(sa,la){return this};U=null})(J);(function(){try{getComputedStyle(void 0)}catch(z){var v=getComputedStyle;n.getComputedStyle=function(M,P){try{return v(M,P)}catch(D){return null}}}})();return J}(L));var Za=function(){if(document.currentScript)var n=document.currentScript.src;else{n=document.scripts;for(var J=
n.length-1,v,z=J;z>0;z--)if(n[z].readyState==="interactive"){v=n[z].src;break}n=v||n[J].src}J=n.indexOf("v=");J=J>0?n.substr(J+2):2023;n=n.substring(0,n.lastIndexOf("/")+1);n.endsWith("zwplayer/")||(n+="js/");return{path:n,v:J}}(),cb=Za.path+"plugins/",db=function(n,J,v){var z=document.getElementsByTagName("head");if(z.length==0){z=document.createElement("head");var M=document.getElementsByTagName("body");if(M.length>0)M=M[0],document.insertBefore(z,M);else return alert("Invalid html document: no HEAD tag"),
!1}else{z=z[0];M=z.childNodes;for(var P=0;P<M.length;P++){var D=M[P];if(D.nodeName.toUpperCase()==="SCRIPT"&&D.id&&D.id==n){if(D.getAttribute("loadstate")!="true"){var Q=function(){D.getAttribute("loadstate")!="true"?setTimeout(Q,50):typeof v=="function"&&v(n)};setTimeout(Q,50);return!1}typeof v=="function"&&v(n);return!0}}}var U=document.createElement("script");U.type="text/javascript";U.readyState?U.onreadystatechange=function(){if(U.readyState=="loaded"||U.readyState=="complete")U.onreadystatechange=
null,U.setAttribute("loadstate","true"),typeof v=="function"&&v(n)}:U.onload=function(){U.setAttribute("loadstate","true");typeof v=="function"&&v(n)};U.id=n;U.src=J;z.appendChild(U);return!1};(function(n,J,v){var z=document.getElementsByTagName("head");if(z.length==0){z=document.createElement("head");var M=document.getElementsByTagName("body");if(M.length>0)M=M[0],document.insertBefore(z,M);else return alert("Invalid html document: no HEAD tag found"),!1}else{z=z[0];M=z.childNodes;for(var P=0;P<
M.length;P++){var D=M[P];if(D.nodeName.toUpperCase()==="link"&&D.id&&D.id==n){if(D.getAttribute("loadstate")!=="true"){var Q=function(){D.getAttribute("loadstate")!=="true"?setTimeout(Q,50):typeof v==="function"&&v(n)};setTimeout(Q,50);return!1}typeof v==="function"&&v(n);return!0}}}var U=document.createElement("link");U.type="text/css";U.setAttribute("rel","stylesheet");U.readyState?U.onreadystatechange=function(){if(U.readyState=="loaded"||U.readyState=="complete")U.onreadystatechange=null,U.setAttribute("loadstate",
"true"),typeof v=="function"&&v(n)}:U.onload=function(){U.setAttribute("loadstate","true");typeof v=="function"&&v(n)};U.id=n;U.href=J;z.appendChild(U);return!1})("zwplayer-css",Za.path+"css/zwplayer.css?v="+Za.v,function(n){});var ob=function(n){return typeof HTMLElement==="object"?n instanceof HTMLElement:!(!n||typeof n!=="object"||n.nodeType!==1&&n.nodeType!==9||typeof n.nodeName!=="string")};Array.isArray||(Array.isArray=function(n){return Object.prototype.toString.call(n)==="[object Array]"});
var pb=/iPhone|iPad|iPod/.test(navigator.userAgent);(function(n){n+="=";for(var J=document.cookie.split(";"),v=0;v<J.length;v++){var z=J[v].trim();if(z.indexOf(n)==0)return z.substring(n.length,z.length)}return""})("ZWPlayer")||yb("ZWPlayer","V1.0",365);var Gb=function(n){for(var J=navigator.languages&&navigator.languages.length?navigator.languages:[navigator.language],v=0;v<n.length;v++)for(var z=0;z<J.length;z++)if(n[v].lang&&J[z]&&J[z].indexOf(n[v].lang)>-1)return n[v].text;return n.length===1?
n[0].text:null};HUAYI={};HUAYI.Danmu=function(){var n={playerObj:null,opacity:70,onInit:null,onClose:null,onResize:null};return{create:function(J){var v={};for(k in n)v[k]=n[k];for(k in J)v[k]=J[k];typeof v.playerId=="undefined"&&(v.playerId="video-body");return new function(z){z=z.playerId;this.rows=[];this.timerId=this.rowCount=0;this.frameDuration=40;this.Danmulayer=null;this.danmuMargin=50;this.speedX=100;this.hasTransition=!0;this.rowHeight=28;this.topMargin=10;this.layerHeight=this.layerWidth=
0;this.fontSize="25px";if(typeof z=="string")this.vPlayer=document.getElementById(z);else if(typeof z=="object")this.vPlayer=z;else return;this.vPlayer||(this.vPlayer=document.getElementById("video-body"));if(this.vPlayer&&(z=this.vPlayer.childNodes,z.length>0))for(var M=0;M<z.length;M++){var P=z[M];if(P.nodeName=="DIV"&&kb(P.className,"danmuplayer")){this.wrapObj=P;break}}if(this.wrapObj){if(z=this.wrapObj.childNodes,z.length>0)for(M=0;M<z.length;M++)if(P=z[M],P.nodeName=="DIV"&&kb(P.className,"danmu-layer")){this.Danmulayer=
P;break}}else this.wrapObj=document.createElement("div"),this.wrapObj.className="danmuplayer",this.vPlayer.appendChild(this.wrapObj),this.Danmulayer=document.createElement("div"),this.Danmulayer.className="danmu-layer",this.wrapObj.appendChild(this.Danmulayer),eb.ie&&eb.ver<9&&(this.wrapObj.style.height=this.vPlayer.offsetHeight-45+"px");if(this.Danmulayer){this.hasTransition=typeof this.Danmulayer.style.transition!="undefined";this.rowCount=Math.floor(Math.floor((this.Danmulayer.offsetHeight-this.topMargin)*
2/3)/this.rowHeight);if(this.rowCount>0)for(M=0;M<this.rowCount;M++)this.rows.push({top:this.topMargin+this.rowHeight*M,count:0,last:null,idx:M});this.layerWidth=this.Danmulayer.offsetWidth;this.layerHeight=this.Danmulayer.offsetHeight;Ta.addElement(this.Danmulayer);this.Danmulayer.addEventListener("resize",function(D){this.reCalcLayout()}.bind(this))}this.start=function(D){this.timerId&&(clearInterval(this.timerId),this.timerId=0);if(!this.hasTransition){var Q=this;this.timerId=setInterval(function(){var U=
Q.Danmulayer,W=U.childNodes;if(W.length>0){for(var ea=[],aa=0;aa<W.length;aa++){var X=W[aa];if(X.tagName=="DIV"){var ma=parseFloat(X.style.left);ma+X.offsetWidth<0?ea.push(X):X.style.left=ma-4.5+"px"}}if(ea.length>0){for(aa=0;aa<ea.length;aa++)W=ea[aa],W.rowIdx&&(Q.rows[W.rowIdx].last==this&&(Q.rows[W.rowIdx].last=null),Q.rows[W.rowIdx].count--),U.removeChild(ea[aa]);ea.splice(0,ea.length)}}},this.frameDuration)}};this.stop=function(){this.timerId&&(clearInterval(this.timerId),this.timerId=0);var D=
this.Danmulayer.childNodes;if(D.length>0)for(var Q=0;Q<D.length;Q++)D[Q].style.display="none";this.Danmulayer.style.display="none"};this.destroy=function(){this.Danmulayer&&(Ta.removeElement(this.Danmulayer),delete this.Danmulayer);this.timerId&&(clearInterval(this.timerId),this.timerId=0);this.wrapObj&&this.vPlayer&&this.vPlayer.removeChild(this.wrapObj)};this.addDanmu=function(D,Q){Q||={};var U=document.createElement("div");U.className="danmu";typeof D.color=="undefined"||Q.isFilterColorFont||(U.style.color=
D.color);typeof D.border!="undefined"&&(U.style.border="1px solid #666");U.style.fontSize=Q.forcedFontSizeValue?parseInt(25*Q.forcedFontSizeValue/100)+"px":"25px";this.fontSize!=U.style.fontSize&&(this.rowHeight=parseInt(U.style.fontSize)+3,this.layerHeight=0,this.reCalcLayout(),this.fontSize=U.style.fontSize);D.outlineColor&&(U.style.outlineStyle="solid",U.style.outlineWidth="2px",U.style.outlineColor=D.outlineColor);U.style.opacity=Q.opacityValue?Q.opacityValue/100:"0.9";U.innerHTML=typeof L.replaceSmileDanmu==
"function"?L.replaceSmileDanmu(D.text,this.rowHeight,Q):D.text;var W=D=0,ea=999999;this.rowCount>this.rows.length&&(this.rowCount=this.rows.length);for(;D<this.rowCount;D++)if(this.rows[D].count==0){W=D;ea=this.layerWidth;break}else if(this.rows[D].last){var aa=this.rows[D].last;aa=aa.getBoundingClientRect().left+aa.offsetWidth+this.danmuMargin;if(aa<ea&&(W=D,ea=aa,ea<this.layerWidth))break}ea<this.layerWidth&&(ea=this.layerWidth);U.style.fontFamily='SimHei, "Microsoft JhengHei", Arial, Helvetica, sans-serif';
U.style.textShadow="rgb(0, 0, 0) 1px 0px 1px, rgb(0, 0, 0) 0px 1px 1px, rgb(0, 0, 0) 0px -1px 1px, rgb(0, 0, 0) -1px 0px 1px";U.style.cursor="pointer";U.style.left=ea+"px";U.style.top=this.rows[W].top+"px";U.rowIdx=W;this.rows[W].last=U;this.rows[W].count++;this.Danmulayer.appendChild(U);var X=this;U.onmouseover=function(ma){this.pause||(this.pause=!0)};U.onmouseout=function(ma){this.pause&&(this.pause=!1)};this.hasTransition&&(U.addEventListener("transitionend",function(){typeof this.rowIdx=="number"&&
(X.rows[this.rowIdx].last==this&&(X.rows[this.rowIdx].last=null),X.rows[this.rowIdx].count--);X.Danmulayer.removeChild(this)}),D=ea+U.offsetWidth,Q.speedValue?(Q=parseInt(this.speedX*parseFloat(Q.speedValue)),Q==0&&(Q=1),Q=D/Q+4*Math.random()):Q=D/this.speedX+4*Math.random(),U.style.transition="transform "+Q+"s linear",U.style.transform="translateX(-"+D+"px)")};this.reCalcLayout=function(){if(this.Danmulayer){eb.ie&&eb.ver<9&&(this.wrapObj.style.height=this.vPlayer.offsetHeight-45+"px");var D=this.Danmulayer.offsetHeight;
if(D!=this.layerHeight){this.rowCount=Math.floor(Math.floor((D-this.topMargin)*2/3)/this.rowHeight);if(this.rowCount>0)if(this.rowCount>this.rows.length)for(var Q=this.rows.length;Q<this.rowCount;Q++)this.rows.push({top:this.topMargin+this.rowHeight*Q,count:0,last:null,idx:Q});else for(Q=0;Q<this.rowCount;Q++)this.rows[Q].top=this.topMargin+this.rowHeight*Q;this.layerHeight=D}if(this.Danmulayer.offsetWidth!=this.layerWidth){D=this.Danmulayer.childNodes;if(D.length>0)for(Q=0;Q<D.length;Q++);this.layerWidth=
this.Danmulayer.offsetWidth}}};this.hasTransition||this.start()}(v)}}}();var Ta={_onResize:function(n){var J=n.target||n.srcElement;if(J=J.__resizeTrigger__?J.__resizeTrigger__:J){var v=J.__z_resizeListeners;if(v)for(var z=v.length,M=0;M<z;M++){var P=v[M],D=P.handler;(P=P.context)||(P=J);if(D)D.apply(P,[n]);else if(n.type==="resize"||Object.prototype.toString.call(n)==="[object ResizeObserverEntry]")D=document.createEvent("Event"),D.initEvent("resize",!1,!1),J.dispatchEvent(D)}}},addElement:function(n,
J,v){var z=n.__z_resizeListeners;if(!z)if(z=[],n.__z_resizeListeners=z,typeof L.ResizeObserver==="function")this.resizeObserver||(this.resizeObserver=new ResizeObserver(function(P){for(var D=0;D<P.length;D++)this._onResize(P[D])}.bind(this))),this.resizeObserver.observe(n);else{getComputedStyle(n,null).position==="static"&&(n.style.position="relative");var M=document.createElement("object");M.resizer=this;M.__resizeElement__=n;M.setAttribute("style","display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; opacity: 0; pointer-events: none; z-index: -9999;");
M.type="text/html";M.data="about:blank";M.onload=function(P){this.contentDocument.defaultView.__resizeTrigger__=this.__resizeElement__;this.contentDocument.defaultView.addEventListener("resize",this.resizer._onResize)};n.appendChild(M);n.__resizeDetector__=M}z.push({handler:J,context:v})},removeElement:function(n,J,v){var z=n.__z_resizeListeners;if(z){for(var M=z.length,P=0;P<M;P++){var D=z[P];if(D.handler===J&&D.context===v){z.splice(P,1);break}}if(z.length===0){if(J=n.__resizeDetector__)J.contentDocument.defaultView.removeEventListener("resize",
this._onResize),n.removeChild(J),delete n.__resizeDetector__;delete n.__z_resizeListeners;this.resizeObserver&&this.resizeObserver.unobserve(n)}}}},eb=function(){var n,J,v,z,M,P,D=navigator.userAgent.toLowerCase(),Q;(Q=D.match(/chrome\/([\d.]+)/),Q)?n=Q[1]:(Q=D.match(/firefox\/([\d.]+)/),Q)?J=Q[1]:(Q=D.match(/edge\/([\d.]+)/),Q)?v=Q[1]:(Q=D.match(/rv:([\d.]+)\) like gecko/),Q)?z=Q[1]:(Q=D.match(/msie ([\d.]+)/),Q)?z=Q[1]:(Q=D.match(/opera.([\d.]+)/),Q)?M=Q[1]:(Q=D.match(/version\/([\d.]+).*safari/),
Q)?P=Q[1]:P=!1;return n?{broswer:"Chrome",version:n,chrome:!0,ver:parseInt(n)}:J?{broswer:"Firefox",version:J,firefox:!0,ver:parseInt(J)}:P?{broswer:"Safari",version:P,ver:parseInt(P)}:v?{broswer:"Edge",version:v,edge:!0,ver:parseInt(v)}:z?{broswer:"IE",version:z,ie:!0,ver:parseInt(z)}:M?{broswer:"Opera",version:M,opera:!0,ver:parseInt(M)}:{broswer:"",version:"0",ver:0}}(),qb={about:"\u5173\u4e8e",current:"\u5f53\u524d","qs-auto":"\u81ea\u52a8\u5207\u6362",enterFullScreen:"\u8fdb\u5165\u5168\u5c4f",
exitFullScreen:"\u9000\u51fa\u5168\u5c4f",subtitleOff:"\u5b57\u5e55\u5173\u95ed",allSubtitle:"\u5b57\u5e55\u603b\u5f00\u5173",closeSmallWindow:"\u5173\u95ed\u5c0f\u7a97\u53e3\u6a21\u5f0f",mainSubtitle:"\u7b2c\u4e00\u5b57\u5e55",secondSubtitle:"\u7b2c\u4e8c\u5b57\u5e55",speed:"\u500d\u901f",muted:"\u9759\u97f3",unmuted:"\u53d6\u6d88\u9759\u97f3",danmuEnabled:"\u5f00\u542f\u5f39\u5e55",danmuDisabled:"\u5173\u95ed\u5f39\u5e55",playbackSpeed1x:"1.0x\u64ad\u653e",playbackSpeed2x:"2.0x\u64ad\u653e",level:"\u7ea7\u522b",
"media-prop":"\u5a92\u4f53\u6d41\u5c5e\u6027","player-help":"\u4f7f\u7528\u8bf4\u660e","version-update":"\u7248\u672c\u66f4\u65b0",waitStreamToReady:"\u6b63\u5728\u7b49\u5f85\u8282\u76ee...",externalSubtitle:"\u5916\u6302\u5b57\u5e55",qualitySelection:"\u6e05\u6670\u5ea6\u9009\u62e9",danmuSettings:"\u5f39\u5e55\u8bbe\u7f6e",selectEmotion:"\u9009\u62e9\u8868\u60c5",loginToSendDanmu:"\u767b\u5f55\u540e\u624d\u53ef\u4ee5\u53d1\u9001\u5f39\u5e55\u54e6",send:"\u53d1\u9001",settings:"\u8bbe\u7f6e",recordVideo:"\u5b8c\u6574\u5f55\u5236",
recordAudio:"\u4ec5\u5f55\u97f3\u9891",shortcutRecord:"\u5f00\u59cb / \u505c\u6b62\u5f55\u5236",webFullscreen:"\u7f51\u9875\u5168\u5c4f",snapshot:"\u6293\u53d6\u56fe\u50cf",selectLocalVideo:"\u9009\u62e9\u672c\u5730\u89c6\u97f3\u9891\u6587\u4ef6",pictureInPicture:"\u753b\u4e2d\u753b\u6a21\u5f0f",chapters:"\u7ae0\u8282",chapterList:"\u7ae0\u8282\u5217\u8868",danmu:"\u5f39\u5e55",login:"\u767b\u5f55",loginToParticipate:"\u767b\u5f55\u540e\u53ef\u4ee5\u53c2\u4e0e\u5f39\u5e55",brightness:"\u4eae\u5ea6",
contrast:"\u5bf9\u6bd4\u5ea6",saturation:"\u9971\u548c\u5ea6",hue:"\u8272\u8c03",reset:"\u91cd\u7f6e",colorfulText:"\u5f69\u8272\u6587\u5b57",imageEmoji:"\u56fe\u7247\u8868\u60c5",mirrorHorizontal:"\u5de6\u53f3\u7ffb\u8f6c",mirrorVertical:"\u4e0a\u4e0b\u7ffb\u8f6c",rotate90Clockwise:"\u987a90\u5ea6\u7ffb\u8f6c",rotate90Counterclockwise:"\u900690\u5ea6\u7ffb\u8f6c",loopPlayback:"\u5faa\u73af\u64ad\u653e",recordingSettings:"\u5f55\u5236\u8bbe\u7f6e...",recordingSettingsTitle:"\u5f55\u5236\u8bbe\u7f6e",
recordingOptionAsk:"\u6bcf\u6b21\u8be2\u95ee",recordingOptionVideo:"\u5b8c\u6574\u5f55\u5236",recordingOptionAudio:"\u4ec5\u63d0\u53d6\u97f3\u9891",recordingNote:"\u6ce8\u610f\uff1a\u5982\u679c\u6ca1\u6709\u97f3\u9891\uff0c\u5219\u76f4\u63a5\u5f55\u5236\u89c6\u9891",audioVolumeBoost:"\u97f3\u6548\u8c03\u8282...",videoColorTuning:"\u89c6\u9891\u8272\u5ea6\u8c03\u8282...",videoColorAdjustment:"\u89c6\u9891\u8272\u5ea6\u8c03\u8282",audioEffectAdjustment:"\u97f3\u6548\u8c03\u8282",volumeBoost:"\u97f3\u91cf\u589e\u5f3a",
selectOrDropVideo:"\u70b9\u51fb\u6216\u62d6\u62fd\u6587\u4ef6\u5230\u6b64\u5904\u64ad\u653e",supportedFormats:"\ud83c\udfac \u89c6\u9891 \u00b7 \ud83d\udcac \u5b57\u5e55 \u00b7 \ud83d\udcd6 \u7ae0\u8282",dragDropToPlay:"\u62d6\u62fd\u6587\u4ef6\u5230\u6b64\u5904\uff08\u89c6\u9891/\u97f3\u9891/\u5b57\u5e55/\u7ae0\u8282\uff09",pipModePlaying:"\u6b63\u5728\u300c\u753b\u4e2d\u753b\u300d\u6a21\u5f0f\u4e0b\u64ad\u653e",exitPictureInPicture:"\u9000\u51fa\u753b\u4e2d\u753b",close:"\u5173\u95ed\u63d0\u793a",
unsupportedChapterFormat:"\u4e0d\u652f\u6301\u7684\u7ae0\u8282\u683c\u5f0f",invalidChapterFormat:"\u7ae0\u8282\u6587\u4ef6\u683c\u5f0f\u65e0\u6548",failedToReadChapter:"\u8bfb\u53d6\u7ae0\u8282\u6587\u4ef6\u5931\u8d25",chapterValidationFailed:"\u7ae0\u8282\u6587\u4ef6\u9a8c\u8bc1\u5931\u8d25",unsupportedSubtitleFormat:"\u4e0d\u652f\u6301\u7684\u5b57\u5e55\u683c\u5f0f",invalidSubtitleFormat:"\u5b57\u5e55\u6587\u4ef6\u683c\u5f0f\u65e0\u6548",failedToReadSubtitle:"\u8bfb\u53d6\u5b57\u5e55\u6587\u4ef6\u5931\u8d25",
subtitleValidationFailed:"\u5b57\u5e55\u6587\u4ef6\u9a8c\u8bc1\u5931\u8d25",subtitleSearch:"\u5b57\u5e55\u641c\u7d22...",subtitleSearchTitle:"\u5b57\u5e55\u641c\u7d22",searchMainSubtitle:"\u7b2c\u4e00\u5b57\u5e55",searchSecondSubtitle:"\u7b2c\u4e8c\u5b57\u5e55",search:"\u641c\u7d22",inputSearchKeyword:"\u8bf7\u8f93\u5165\u641c\u7d22\u5173\u952e\u8bcd",noSearchResults:"\u672a\u627e\u5230\u5339\u914d\u7684\u5b57\u5e55",noSubtitlesLoaded:"\u672a\u52a0\u8f7d\u5b57\u5e55",chapterSearch:"\u7ae0\u8282\u641c\u7d22...",
chapterSearchTitle:"\u7ae0\u8282\u641c\u7d22",noChaptersLoaded:"\u672a\u52a0\u8f7d\u7ae0\u8282",noChapterSearchResults:"\u672a\u627e\u5230\u5339\u914d\u7684\u7ae0\u8282",localFileDisabled:"\u672c\u5730\u6587\u4ef6\u64ad\u653e\u529f\u80fd\u5df2\u7981\u7528",unsupportedFormat:"\u4e0d\u652f\u6301\u7684\u683c\u5f0f",invalidInput:"\u65e0\u6548\u8f93\u5165",unsupportedOperation:"\u4e0d\u652f\u6301\u7684\u64cd\u4f5c",playingFile:"\u6b63\u5728\u64ad\u653e",switchedToQuality:"\u5df2\u7ecf\u4e3a\u60a8\u5207\u6362\u5230",
quality:"\u753b\u8d28",mutedAutoplayMessagePre:"\u56e0",mutedAutoplayMessagePost:"\uff0c\u5df2\u9759\u97f3\u64ad\u653e\uff0c\u8bf7\u70b9\u51fb",browserLimits:"\u6d4f\u89c8\u5668\u9650\u5236",openAudio:"\u6253\u5f00\u58f0\u97f3",browserRestrictionsInfo:"\u5f53\u60a8\u8bbf\u95ee\u672c\u7f51\u7ad9\u7684\u6b21\u6570\u8f83\u5c11\uff0c\u6216\u7ecf\u5e38\u9759\u97f3\u64ad\u653e\u65f6\uff0c\u6d4f\u89c8\u5668\u53ef\u80fd\u4f1a\u9650\u5236\u7f51\u7ad9\u97f3\u91cf\uff0c\u5bfc\u81f4\u7f51\u7ad9\u65e0\u6cd5\u8fdb\u884c\u6709\u58f0\u81ea\u52a8\u64ad\u653e\u3002",
iUnderstand:"\u6211\u77e5\u9053\u4e86",danmuItems:"items",danmuDensityDefault:"30 items",danmuSendSettings:"\u53d1\u9001\u8bbe\u7f6e",danmuViewSettings:"\u89c2\u770b\u8bbe\u7f6e",danmuBlockSettings:"\u5c4f\u853d\u8bbe\u7f6e",danmuTextColor:"\u6587\u5b57\u989c\u8272",danmuTextBorder:"\u6587\u5b57\u8fb9\u6846",danmuOpacity:"\u4e0d\u900f\u660e\u5ea6",danmuFontSize:"\u6587\u5b57\u5927\u5c0f",danmuScrollSpeed:"\u6eda\u52a8\u901f\u5ea6",danmuDensity:"\u6392\u5217\u5bc6\u5ea6",danmuBottomArea:"\u5e95\u90e8\u533a\u57df",
keyboardShortcuts:"\u5feb\u6377\u952e\u8bf4\u660e",shortcutPlayPause:"\u64ad\u653e/\u6682\u505c",shortcutSeekRight:"\u5355\u6b21\u5feb\u8fdb5s\uff0c\u957f\u6309\u500d\u901f\u64ad\u653e",shortcutSeekLeft:"\u5feb\u90005s\uff0c\u957f\u6309\u8fde\u7eed\u64cd\u4f5c",shortcutVolume:"\u97f3\u91cf\u589e\u52a0/\u964d\u4f4e 5%",shortcutMute:"\u9759\u97f3 / \u5173\u95ed\u9759\u97f3",shortcutDanmu:"\u5f00\u542f / \u5173\u95ed\u5f39\u5e55",shortcutSendDanmu:"\u53d1\u9001\u5f39\u5e55",shortcutSpeed1x:"\u4e00\u500d\u901f (\u6b63\u5e38\u500d\u6570)",
shortcutSpeed2x:"\u4e8c\u500d\u901f",shortcutExit:"\u5173\u95ed\u83dc\u5355 / \u9000\u51fa\u5168\u5c4f",shortcutFullscreen:"\u5168\u5c4f / \u9000\u51fa\u5168\u5c4f",autoplayBlocked:"\u6d4f\u89c8\u5668\u963b\u6b62\u4e86\u81ea\u52a8\u64ad\u653e",playbackFailed:"\u64ad\u653e\u5931\u8d25",shortcutRestart:"\u91cd\u64ad",lightOn:"\u706f\u5149\u5f00\u542f",lightOff:"\u706f\u5149\u5173\u95ed",shortcutLight:"\u5f00/\u5173\u706f\u5149",segmentSelect:"\u9009\u62e9\u7247\u6bb5",record:"\u5f55\u5236",zoom:"\u653e\u5927\u955c",
disableZoom:"\u5173\u95ed\u653e\u5927\u955c",zoomLevel:"\u653e\u5927\u500d\u6570",failedToQueryTrtc:"\u67e5\u8be2TRTC\u4fe1\u4ee4\u670d\u52a1\u5668\u5931\u8d25",rtspNotSupported:"\u672a\u8bbe\u7f6eXMC\u65f6\uff0c\u4e0d\u652f\u6301RTSP\u534f\u8bae",cannotPlayHls:"\u64ad\u653e\u5668\u65e0\u6cd5\u64ad\u653eHLS\u5a92\u4f53",webcdnNotSupported:"\u672a\u8bbe\u7f6eCDN\u670d\u52a1\u5668\u5730\u5740\u65f6\uff0c\u4e0d\u652f\u6301WCDN\u534f\u8bae",invalidWcdnUrl:"\u65e0\u6548\u7684WCDN\u7f51\u5740\uff1a",streamError:"\u6d41\u9519\u8bef",
unknownError:"\u672a\u77e5\u9519\u8bef",serverClosed:"\u670d\u52a1\u5668\u5df2\u5173\u95ed\uff0c\u64ad\u653e\u5668\u505c\u6b62",wcdnConnectionClosed:"WCDN\u8fde\u63a5\u5df2\u88ab\u88ab\u52a8\u5173\u95ed",loadFailed:"\u52a0\u8f7d\u5931\u8d25",cannotPlayMediaAddress:"\u62b1\u6b49\uff0c\u64ad\u653e\u5668\u65e0\u6cd5\u64ad\u653e\u6b64\u5a92\u4f53\u5730\u5740",unableToObtainAddress:"\u62b1\u6b49\uff0c\u65e0\u6cd5\u83b7\u53d6\u6b64\u623f\u95f4\u7684\u6709\u6548\u5730\u5740",missingValidAddress:"\u62b1\u6b49\uff0c\u7f3a\u5c11\u6b64\u623f\u95f4\u7684\u6709\u6548\u5730\u5740",
failedToGetAddress:"\u62b1\u6b49\uff0c\u56e0\u7f51\u7edc\u539f\u56e0\u83b7\u53d6\u5730\u5740\u5931\u8d25\uff01",subtitleLoaded:"\u5b57\u5e55\u5df2\u52a0\u8f7d",chapterLoaded:"\u7ae0\u8282\u5df2\u52a0\u8f7d"},rb={},sb={about:"About",current:"Current","qs-auto":"Auto",enterFullScreen:"Enter Fullscreen",exitFullScreen:"Exit Fullscreen",subtitleOff:"Subtitles Off",allSubtitle:"All Subtitles",closeSmallWindow:"Close Small Window",mainSubtitle:"First Subtitle",secondSubtitle:"Second Subtitle",speed:"Rate",
muted:"Muted",unmuted:"Unmuted",danmuEnabled:"Danmu Enabled",danmuDisabled:"Danmu Disabled",playbackSpeed1x:"Speed: 1x",playbackSpeed2x:"Speed: 2x",level:"Level","media-prop":"Media Properties","player-help":"User Guide","version-update":"Version Update",waitStreamToReady:"Waiting for stream to be ready...",externalSubtitle:"External Subtitles",qualitySelection:"Quality Selection",danmuSettings:"Danmu Settings",selectEmotion:"Select Emotion",loginToSendDanmu:"Login required to send danmu",send:"Send",
settings:"settings",recordVideo:"Full Recording",recordAudio:"Audio Only",shortcutRecord:"Start / Stop Recording",webFullscreen:"Web Fullscreen",snapshot:"Snapshot",selectLocalVideo:"Select Local Video File",pictureInPicture:"Picture-in-Picture",chapters:"Chapters",chapterList:"Chapter List",danmu:"Danmu",login:"Login",loginToParticipate:"Login to participate in danmu",videoColorAdjustment:"Video Color Adjustment",brightness:"Brightness",contrast:"Contrast",saturation:"Saturation",hue:"Hue",reset:"Reset",
colorfulText:"Color",imageEmoji:"Emoji",mirrorHorizontal:"H-Mirror",mirrorVertical:"V-Mirror",rotate90Clockwise:"90 CW",rotate90Counterclockwise:"90 CCW",loopPlayback:"Loop",recordingSettings:"Recording Settings...",recordingSettingsTitle:"Recording Settings",recordingOptionAsk:"Ask Every Time",recordingOptionVideo:"Full Recording",recordingOptionAudio:"Audio Only",recordingNote:"Note: If no audio is present, video will be recorded directly",audioVolumeBoost:"Audio Effects...",videoColorTuning:"Color Tuning...",
audioEffectAdjustment:"Audio Effects",volumeBoost:"Gain",selectOrDropVideo:"Click or drag file here to play",supportedFormats:"\ud83c\udfac Video \u00b7 \ud83d\udcac Subtitle \u00b7 \ud83d\udcd6 Chapter",dragDropToPlay:"Drag files here (video/audio/subtitles/chapters)",pipModePlaying:"Playing in Picture-in-Picture mode",exitPictureInPicture:"Exit Picture-in-Picture",close:"Close",unsupportedChapterFormat:"Unsupported chapter format",invalidChapterFormat:"Invalid chapter file format",failedToReadChapter:"Failed to read chapter file",
chapterValidationFailed:"Chapter file validation failed",unsupportedSubtitleFormat:"Unsupported subtitle format",invalidSubtitleFormat:"Invalid subtitle file format",failedToReadSubtitle:"Failed to read subtitle file",subtitleValidationFailed:"Subtitle file validation failed",subtitleSearch:"Subtitle Search...",subtitleSearchTitle:"Subtitle Search",searchMainSubtitle:"First",searchSecondSubtitle:"Second",search:"Search",inputSearchKeyword:"Enter search keyword",noSearchResults:"No matching subtitles found",
noSubtitlesLoaded:"No subtitles loaded",chapterSearch:"Chapter Search...",chapterSearchTitle:"Chapter Search",noChaptersLoaded:"No chapters loaded",noChapterSearchResults:"No matching chapters found",localFileDisabled:"Local file playback is disabled",unsupportedFormat:"Unsupported format",invalidInput:"Invalid input",unsupportedOperation:"Unsupported operation",playingFile:"playing",switchedToQuality:"Switched to",quality:"quality",mutedAutoplayMessagePre:"Muted due to ",mutedAutoplayMessagePost:". Click to ",
openAudio:"Enable",browserRestrictionsInfo:"Browsers may limit audio volume when you visit this site infrequently or often play muted content, preventing automatic audio playback.",iUnderstand:"OK",browserLimits:"Browser Restrictions",danmuItems:"items",danmuDensityDefault:"30 items",danmuSendSettings:"Send",danmuViewSettings:"View",danmuBlockSettings:"Block",danmuTextColor:"Text Color",danmuTextBorder:"Border",danmuOpacity:"Opacity",danmuFontSize:"Font Size",danmuScrollSpeed:"Speed",danmuDensity:"Density",
danmuBottomArea:"Bottom Area",keyboardShortcuts:"Keyboard Shortcuts",shortcutPlayPause:"Play / Pause",shortcutSeekRight:"Single press: forward 5s, hold: speed playback",shortcutSeekLeft:"Rewind 5s (hold for continuous operation)",shortcutVolume:"Increase / decrease volume by 5%",shortcutMute:"Mute / Unmute",shortcutDanmu:"Enable / Disable Danmu",shortcutSendDanmu:"Send Danmu",shortcutSpeed1x:"1x Speed (Normal)",shortcutSpeed2x:"2x Speed",shortcutExit:"Close menu / Exit fullscreen",shortcutFullscreen:"Fullscreen / Exit fullscreen",
autoplayBlocked:"Autoplay blocked by browser",playbackFailed:"Playback failed",shortcutRestart:"Restart",lightOn:"Light On",lightOff:"Light Off",shortcutLight:"Light Toggle",segmentSelect:"Select Segment",record:"Record",zoom:"Zoom",disableZoom:"Disable Zoom",zoomLevel:"Zoom Level",failedToQueryTrtc:"Failed to query TRTC signal server",rtspNotSupported:"The RTSP protocol is not supported without setting XMC",cannotPlayHls:"Player cannot play HLS media",webcdnNotSupported:"The WCDN protocol is not supported without setting CDN server address",
invalidWcdnUrl:"Invalid WCDN URL: ",streamError:"Stream error",unknownError:"Unknown error",serverClosed:"Server is closed, player is stopped",wcdnConnectionClosed:"The WCDN connection has been passively closed",loadFailed:"Load failed",cannotPlayMediaAddress:"Sorry, the player cannot play this media address",unableToObtainAddress:"Sorry, unable to obtain a valid address for this room",missingValidAddress:"Sorry, missing valid address for this room",failedToGetAddress:"Sorry, failed to get address due to network",
subtitleLoaded:"Subtitle loaded",chapterLoaded:"Chapters loaded"},Xa="en",Ua={"zh-CN":qb,zh:qb,"zh-HK":rb,"zh-TW":rb,"en-US":sb,en:sb};let tb="en";Xa=tb=L.navigator&&(navigator.languages&&navigator.languages.length&&navigator.languages[0].toLowerCase().startsWith("zh")||navigator.language&&navigator.language.toLowerCase().startsWith("zh")||navigator.browserLanguage&&navigator.browserLanguage.toLowerCase().startsWith("zh")||navigator.systemLanguage&&navigator.systemLanguage.toLowerCase().startsWith("zh")||
navigator.userLanguage&&navigator.userLanguage.toLowerCase().startsWith("zh"))?"zh":"en";var H=function(n,J,v){v=v||Xa;var z=Ua[v];if(z){if(z[n])return z[n];if(v!=="en"&&Ua.en&&Ua.en[n])return Ua.en[n];if(v!=="zh-CN"&&Ua["zh-CN"]&&Ua["zh-CN"][n])return Ua["zh-CN"][n]}return J||n},Hb=function(){for(var n='<div class="zwp-button zwp-speedButton"><button class="zwpbtn zwp-speedBtn" data-action="showSpeedMenu" data-name="speedbtn">'+H("speed","Rate")+'</button><ul class="zwp-speedMenu">',J="2.0x 1.5x 1.25x 1.0x 0.75x 0.5x 0.25x".split(" "),
v="",z=0;z<J.length;z++)v=z===3?v+('<li class="zwp-speed-item active">'+J[z]+"</li>"):v+('<li class="zwp-speed-item">'+J[z]+"</li>");return n+v+"</ul></div>"},ub=function(){var n='<div class="zwp-option-item main"><label class="zwp-option-item-label">'+H("allSubtitle","All subtitle")+'</label><div class="zwp-option-item-value">'+Ya("","subtitleOn")+"</div></div>";n+='<div class="zwp-option-item sub1" style="display: none;"><label class="zwp-option-item-label">'+H("mainSubtitle","Main subtitle")+'</label><div class="zwp-option-item-value">'+
Ya("","subtitleDefault")+"</div></div>";n+='<div class="zwp-option-item sub2" style="display: none;"><label class="zwp-option-item-label">'+H("secondSubtitle","Second subtitle")+'</label><div class="zwp-option-item-value">'+Ya("","subtitleSecond")+"</div></div>";n+='<div class="zwp-option-item zwp-lefticon"><span class="zwp-liteicon"><i class="xicon xicon-subtitle-search"></i></span> <button class="zwp-option-button action-item" data-action="showSubtitleSearchPanel">'+H("subtitleSearch","Subtitle Search...")+
"</button></div>";return n+='<div class="zwp-option-item zwp-search-range"><div class="zwp-search-range-options"><label class="zwp-checkbox-label zwp-search-subtitle1" style="display: none;"><input type="checkbox" value="1" checked data-action="toggleSearchSubtitle1"> '+H("searchMainSubtitle","1")+'</label><label class="zwp-checkbox-label zwp-search-subtitle2" style="display: none;"><input type="checkbox" value="2" checked data-action="toggleSearchSubtitle2"> '+H("searchSecondSubtitle","2")+"</label></div></div>"},
Ib=function(n){var J='<li class="zwp-subtitles-item" data-id="-1">'+H("subtitleOff","Captions off")+"</li>";for(var v=0;v<n.length;v++){var z=_player.truncateFilename(n[v].name);J=v===0?J+('<li class="zwp-subtitles-item active" data-id="'+n[v].id+'" title="'+n[v].name+'">'+z+"</li>"):J+('<li class="zwp-subtitles-item" data-id="'+n[v].id+'" title="'+n[v].name+'">'+z+"</li>")}return'<ul class="zwp-subtitlesMenu">'+J+"</ul>"},Jb=function(){var n="",J=(new Date).getTime();n=n+'<div class="zwp-toolbox-ground-right zwp-dmform zwp_danmu-controlbar"> <div class="zwp_switch_group">   <div class="zwp_switch_text">'+
(H("danmu","Danmu")+"</div>");n=n+('   <div class="zwp_switch" id="danmuSwitch-'+J+'"><i class="switch_inner"></i></div> </div> <div class="zwp_dmconfig zwp_dmicon" id="danmu-config-btn-')+(J+'" title="'+H("danmuSettings","Danmu Settings")+'"><i class="xicon xicon-subtitles"></i></div>');n=n+(' <div class="zwp-barrage_form" id="barrage_form-'+J+'">   <div class="zwp-barrage_inp logined">    <input id="barrage_inp_text-')+(J+'" type="text" class="barrage_inp_text" maxlength="40" disabled="disabled" readonly="readonly">    <div class="barrage_login" href="#login"><span class="barrage_text">')+
(H("login","Login")+"</span>"+H("loginToParticipate"," to participate in danmu")+"</div>");n+="   </div>";n+='   <a class="btn_bubble disabled" href="javascript:void(0);" title="'+H("selectEmotion","Select Emotion")+'" data-viewid="smilesFaces-view-'+J+'"><i class="xicon xicon-smile"></i></a>';n+='   <button type="submit" class="btn_submit vtb_disabled" title="'+H("loginToSendDanmu","Login required to send danmu")+'" disabled="disabled">'+H("send","Send")+"</button>";n+=" </div>";n+=' <div class="zwp-barrage-set hidden" data-barrage-panel="panel" data-render="0"></div>';
return n+="</div>"},$a=function(n){if(typeof n==="number")return n;n=n.split(":");return n.length===2?parseInt(n[0])*60+parseInt(n[1]):n.length===3?parseInt(n[0])*3600+parseInt(n[1])*60+parseInt(n[2]):n.length===1?parseFloat(n[0]):n.length>3?9.999999999999999E8:0},Kb=function(n,J){var v="";if(!J||!Array.isArray(J))return"";for(var z=0;z<J.length;z++){var M=J[z],P=$a(M.time);if(!(P>=n)){var D=P*100/n+"%",Q=M.title||M.text||M.time+"";if(typeof M.duration!=="undefined"){var U="red";M.style&&typeof M.style.background!==
"undefined"&&(U=M.style.background);var W=$a(M.duration);P+W>n&&(W=n-P);v+='<span class="zwp__chapter_dot zwp_bar" style="left: '+D+"; width: "+(W*100/n+"%; border-radius: 3px; background-color: ")+U+';" title="'+Q+'" data-time="'+M.time+'" data-desc="'+M.desc+'">&nbsp;</span>'}else v+='<span class="zwp__chapter_dot" style="left: '+D+'" title="'+Q+'" data-time="'+M.time+'" data-desc="'+M.desc+'">&nbsp;</span>'}}return v},Lb=function(n){return n&&Array.isArray(n)&&n.length!==0?{html:'<div class="zwp-button zwp-chapterButton"><button class="zwpbtn zwp-chapterBtn" data-action="showChapterListview" data-name="chapterbtn">'+
H("chapters","Chapters")+"</button></div>",titleWidth:0}:null};L.insertSmile=function(n,J){n=$$(n).closest("div.zwp-smileview");if(n.length>0&&(n=n.get(0).inputbox))if(n.createTextRange&&(n.caretPos=document.selection.createRange().duplicate()),document.all)n.createTextRange&&n.caretPos?(n=n.caretPos,n.text=n.text.charAt(n.text.length-1)==" "?J+" ":J):n.value=J;else if(n.setSelectionRange){var v=n.selectionEnd,z=n.value.substring(0,n.selectionStart);v=n.value.substring(v);n.value=z+J+v}else alert("This version of Mozilla based browser does not support setSelectionRange")};
L.replaceSmileDanmu=function(n,J,v){if(typeof n!="string")return"";n.indexOf("<")>=0&&(n=n.replace(/</g,"&lt;").replace(/>/g,"&gt;"));var z=n.indexOf("[sm-");if(z<0)return n;var M=Za.path+"widgets/smiles/p",P="",D=n.substring(0,z);for(D!=""&&(P+=D);z>=0;){D=n.indexOf("]",z+4);if(D<0){D=n.substring(z);D!=""&&(P+=D);break}z=n.substring(z+4,D);z!=""&&(v.isFilterImage||(P+='<img style="opacity: 1;" src="'+M+z+'.png" height="'+J+'">'));z=n.indexOf("[sm-",D+1);z<0?(D=n.substring(D+1),D!=""&&(P+=D)):z>D+
1&&(P+=n.substring(D+1,z))}return P};var gb=function(n){hasClass(n,"switch_on")?removeClass(n,"switch_on"):addClass(n,"switch_on")},Mb=function(n,J){var v=$$;n=v(J).closest("div.zwp-dmform").children(".zwp-barrage-set");if(n.length!=0){if(n.attr("data-render")!="1"){var z=J.zwplayer,M=n.get(0);v.get(Za.path+"widgets/danmu_setting.html?v="+Za.v,{},function(Q){var U=v(M);U.html(Q);Eb(U);U.find("a.barrage-tab-link").click(function(W){W.preventDefault();W=v(this).parent();W.hasClass("selected")||(W.addClass("selected").siblings().removeClass("selected"),
W=v(W.attr("data-tab")),W.hasClass("hidden")&&(W.removeClass("hidden"),W.siblings().addClass("hidden")))});Q=v("#fsBox_tab");Q.find("div.color-box").children("a").click(function(W){W.preventDefault();W=v(this);W.hasClass("selected")||(W.siblings().removeClass("selected"),W.addClass("selected"),z&&(z.danmuSetting.color=W.attr("data-color")))});Q.find("div.other-box").children("a.checkbox-wrap").click(function(W){W.preventDefault();var ea=v(this);ea.toggleClass("selected");W=ea.attr("data-content");
ea=ea.hasClass("selected");z&&(z.danmuSetting[W]=ea)});v("#bfBox_tab").find("a.zwp-barrage-icons").mousedown(function(W){if(W.button==0){this.isMousePressed=!0;var ea=v(this).position().left,aa=W.clientX-ea,X=this,ma=function(ua){var ja=ua.clientX-aa;ja<0?ja=0:ja>134&&(ja=134);v(X).css({left:ja+"px"});ua=v(X).siblings("div.bar-t");ua.length>0&&ua.width(ja+3);X.valuePanel||(X.valuePanel=v(X).parent().siblings("div.set-rol-right").get(0));if(typeof X.valuePanel=="object"){ua=v(X.valuePanel);var ya=
ua.attr("data-barrage-content");ya=="opacityValue"?(ja=parseInt(ja*100/138),z&&(z.danmuSetting.opacityValue=ja),ua.html(ja+"%")):ya=="forcedFontSizeValue"?(ja=50+parseInt(ja*150/138),z&&(z.danmuSetting.forcedFontSizeValue=ja),ua.html(ja+"%")):ya=="speedValue"?(ja=(.5+parseFloat(ja/69)).toFixed(1),z&&(z.danmuSetting.speedValue=ja),ua.html(ja+"x")):ya=="densityValue"&&(ja=parseInt(ja*100/46),z&&(z.danmuSetting.densityValue=ja),ja=ja+" "+H("danmuItems","items"),ua.html(ja))}return!1},ta=function(ua){v(document).unbind("mousemove",
ma).unbind("mouseup",ta)};v(document).bind("mousemove",ma).bind("mouseup",ta)}return!1});v("#pbBox_tab").find("a.pb-link").click(function(W){W.preventDefault();var ea=v(this).parent();ea.toggleClass("selected");W=v(this).attr("data-content");ea=ea.hasClass("selected");z&&(z.danmuSetting[W]=ea)});v("#barrage-set-bot").children("a").click(function(W){W.preventDefault();if(v(this).attr("data-content")=="reset"){if(z)for(a in z.danmuSetting)delete z.danmuSetting[a];v("#fsBox_tab").find(".color-box a").removeClass("selected").eq(0).addClass("selected");
v("#fsBox_tab").find(".other-box a").removeClass("selected");var ea={opacityTrigger:[128,124,"90%"],forcedFontSizeTrigger:[50,46,"100%"],speedTrigger:[39,35,"1.0x"],densityTrigger:[18,14,H("danmuDensityDefault","30 items")]};v("#bfBox_tab").find("a.zwp-barrage-icons").each(function(aa,X){aa=v(X).attr("data-barrage-content");if(ea[aa]){var ma=ea[aa];aa=ma[1];var ta=ma[0];ma=ma[2];X=v(X);X.css({left:aa+"px"});X.siblings(".bar-t").width(ta+"px");X.parent().siblings(".set-rol-right").text(ma)}});v("#pbBox_tab").find("li.selected").removeClass("selected")}})},
"html");n.attr("data-render","1")}if(n.hasClass("hidden")){M=n.get(0);var P=this,D=function(Q){var U=v(M);if(Q.target==P)P=null;else if(hasClass(Q.target,"xicon-close")||!U.is(Q.target)&&U.has(Q.target).length===0)U.addClass("hidden"),v(document).off("click",D),delete J.zwplayer};n.removeClass("hidden");v(document).on("click",D)}}},vb=function(n){L.ctrlInitId||(L.ctrlInitId=(new Date).getTime());var J=L.ctrlInitId++;return n+J},Ya=function(n,J){return'<div class="zwp_switch action-item" id="'+(n||
vb("switch-"))+'" data-action="'+(J||"none")+'"><i class="switch_inner"></i></div>'},fb=function(n){var J=n.parentNode;if(J&&(J=J.querySelector(".zwp-slider-value"))){var v=n.getAttribute("data-action");n=n.value;v==="volumeBoost"?(n=parseFloat(n),n=(n>=0?"+":"")+n.toFixed(1)+"dB",J.innerHTML=n):J.innerHTML=n}},bb=function(n,J,v,z,M,P){n=n||vb("zwp_slider-");v=v!==void 0?v:-100;z=z!==void 0?z:100;var D=v<0&&z>0?0:v,Q="";P&&(Q+='<span class="zwp-slider-min-label">'+v+"dB</span>");Q+='<input type="range" id="'+
n+'" name="slider'+n+'" data-action="'+J+'" class="zwp-slider" value="'+D+'" min="'+v+'" max="'+z+'" step="'+(M!==void 0?M:1)+'"/><span class="zwp-slider-value">'+(J==="volumeBoost"?"+0.0dB":D)+"</span>";P&&(Q+='<span class="zwp-slider-max-label">'+z+"dB</span>");return Q},wb=function(n){var J="";n.infoButton&&(J='<div class="zwp-button zwp-infoButton"><button class="zwpbtn zwp-infoBtn" data-action="showMediainfo" data-name="infobtn"><i class="xicon xicon-info"></i></button></div>');var v="",z="",
M="",P="",D="",Q="",U="",W="",ea="",aa="",X="",ma=n.defVolume||61.25;n.speedButton&&!n.isLive&&(v="");n.optionButton&&(M='<div class="zwp-optionPanel"><div class="zwp-option-item"><label class="zwp-option-item-label">'+H("mirrorHorizontal","Mirror Horizontal")+'</label><div class="zwp-option-item-value">'+Ya("","mirror")+'</div></div><div class="zwp-option-item"><label class="zwp-option-item-label">'+H("mirrorVertical","Mirror Vertical")+'</label><div class="zwp-option-item-value">'+Ya("","flip")+
'</div></div><div class="zwp-option-item"><label class="zwp-option-item-label">'+H("rotate90Clockwise","Rotate 90\u00b0 CW")+'</label><div class="zwp-option-item-value">'+Ya("","rotated90")+'</div></div><div class="zwp-option-item"><label class="zwp-option-item-label">'+H("rotate90Counterclockwise","Rotate 90\u00b0 CCW")+'</label><div class="zwp-option-item-value">'+Ya("","rotated270")+'</div></div><div class="zwp-option-h-separator"><hr/></div><div class="zwp-option-item"><label class="zwp-option-item-label">'+
H("loopPlayback","Loop Playback")+'</label><div class="zwp-option-item-value">'+Ya("","loop")+"</div></div>",n.recordButton&&(M+='<div class="zwp-option-item zwp-lefticon"><span class="zwp-liteicon"><i class="xicon xicon-record"></i></span> <button class="zwp-option-button action-item" data-action="showRecordingConfig">'+H("recordingSettings","Recording Settings...")+"</button></div>"),M+='<div class="zwp-option-item zwp-lefticon"><span class="zwp-liteicon"><i class="xicon xicon-audio-effect"></i></span> <button class="zwp-option-button action-item" data-action="showVolumeBoostConfig">'+
H("audioVolumeBoost","Volume Boost...")+'</button></div><div class="zwp-option-item zwp-lefticon"><span class="zwp-liteicon"><i class="xicon xicon-hue"></i></span> <button class="zwp-option-button action-item" data-action="showColorConfig">'+H("videoColorTuning","Video Color Tuning...")+"</button></div></div>",M='<div class="zwp-button zwp-optionButton"><button class="zwpbtn zwp-optionBtn" data-action="showConfigPanel" data-name="optionbtn" title="'+H("settings","Settings")+'"><i class="xicon xicon-config"></i></button>'+
M+"</div>");n.disableVolumeControl||(U='<div class="zwp-button zwp-volume-docker"><button class="zwpbtn zwp-muteBtn" data-action="mute"  data-name="mutebtn"><i class="xicon xicon-speaker"></i></button><div class="zwp-volume-slider"><div class="zwp-volume-total"><div class="zwp-volume-current" style="bottom: 0px; height: '+ma+'%;"></div><div class="zwp-volume-handle" style="bottom: '+ma+'%; margin-bottom: -7px;"></div></div></div></div>');n.disableFullscreenWin||(P='<div class="zwp-button zwp-fullscrWinButton"><button class="zwpbtn zwp-fullscrWinBtn" data-action="enterfullscreenWin" data-name="fullscrWinbtn" title="'+
H("webFullscreen","Web Fullscreen")+'"><i class="xicon xicon-fullScreen-win"></i></button></div>');n.snapshotButton&&(D='<div class="zwp-button zwp-snapshotButton"><button class="zwpbtn zwp-snapshotBtn" data-action="snapshot" data-name="snapshotbtn" title="'+H("snapshot","Snapshot")+'"><i class="xicon xicon-camera"></i></button></div>');n.zoomButton&&(X='<div class="zwp-button zwp-zoomButton"><button class="zwpbtn zwp-zoomBtn" data-action="toggleZoom" data-name="zoombtn" title="'+H("zoom","Zoom")+
'"><i class="xicon xicon-zoom"></i></button></div>');n.localPlayback&&(W='<div class="zwp-button zwp-localPlaybackButton"><button class="zwpbtn zwp-localPlaybackBtn" data-action="selectLocalFile" data-name="localPlaybackbtn" title="'+H("selectLocalVideo","Select Local Video File")+'"><i class="xicon xicon-open-file"></i></button></div>');n.isLive||n.segmentButton!==!0||(ea='<div class="zwp-button zwp-segmentButton"><button class="zwpbtn zwp-segmentBtn" data-action="toggleSegment" data-name="segmentbtn" title="'+
H("segmentSelect","Segment Select")+'"><i class="xicon xicon-zone"></i></button></div>');n.recordButton&&(aa='<div class="zwp-button zwp-recordButton"><button class="zwpbtn zwp-recordBtn" data-action="record" data-name="recordbtn" title="'+H("record","Record")+'"><i class="xicon xicon-record"></i></button><div class="zwp-recordOptionsMenu"><div class="zwp-recording-option" data-action="recordVideo"><span class="zwp-recording-dot zwp-recording-dot-red"></span><span class="zwp-option-item-label">'+
H("recordVideo","Full Recording")+'</span></div><div class="zwp-recording-option" data-action="recordAudio"><span class="zwp-recording-dot zwp-recording-dot-green"></span><span class="zwp-option-item-label">'+H("recordAudio","Audio Only")+"</span></div></div></div>");n.disablePicInPic||document.pictureInPictureEnabled&&(Q='<div class="zwp-button zwp-picInPicButton"><button class="zwpbtn zwp-picInPicBtn" data-action="pictureInPicture" data-name="picInPicbtn" title="'+H("pictureInPicture","Picture-in-Picture")+
'"><i class="xicon xicon-pic-in-pic"></i></button></div>');n.isLive||(z='<div class="zwp__time-rail"></div>');n='<div class="zwp-button zwp-subtitleButton" style="display: none;"><button class="zwpbtn zwp-subtitleBtn" data-action="showSubtitleMenu" data-name="subtitlebtn" title="'+H("externalSubtitle","External Subtitles")+'"><i class="xicon xicon-cc"></i></button><div class="zwp-subtitleMenu">'+ub()+"</div></div>";ma='<div class="zwp-button zwp-qualityButton" style="display: none;"><button class="zwpbtn zwp-qualityBtn" data-action="showQualityMenu" data-name="qualitybtn" title="'+
H("qualitySelection","Quality Selection")+'"><i class="xicon xicon-hd"></i></button><ul class="zwp-qualityMenu">';for(var ta=["1920","1280","720","480"],ua="",ja=0;ja<ta.length;ja++)ua=ja===3?ua+('<li class="zwp-quality-item active">'+ta[ja]+"</li>"):ua+('<li class="zwp-quality-item">'+ta[ja]+"</li>");return'<div class="zwp-button zwp_playbtn"><button class="zwpbtn zwp-playbtn" data-action="play" data-name="playbtn"><i class="xicon xicon-play"></i></button></div><div class="zwp__time zwp__currenttime-container" role="timer" aria-live="on"><span class="zwp__currenttime">00:00</span></div><div class="zwp__time zwp__duration-container" style="display: none;"><span class="zwp__time_divider">/</span> <span class="zwp__duration">0:00:00</span></div><div class="zwp__time-info "></div>'+
J+W+X+D+ea+aa+n+(ma+ua+"</ul></div>")+v+M+U+Q+P+'<div class="zwp-button"><button class="zwpbtn zwp-fullscrBtn" data-action="enterfullscreen" data-name="fullscrbtn" title="'+H("enterFullScreen","Enter Fullscreen")+'"><i class="xicon xicon-fullScreen"></i></button></div>'+z},Nb='<div class="zwp__overlay zwp__layer zwp__overlay-play" style="width: 100%; height: 100%; display: none;"><div class="zwp-local-playback-hint" style="display: none;" role="button" tabindex="0" aria-label="'+H("selectLocalVideo",
"Select Local Video File")+'" data-action="selectLocalFile"><div class="zwp-local-playback-text">'+H("selectOrDropVideo","Select or drag video/audio files")+'</div><div class="zwp-local-playback-subtitle">'+H("supportedFormats","Supports MP4, WebM, MOV, MKV, M4V, OGG, FLAC, WAV, M4A, MP3, OPUS and other formats")+'</div></div><div class="zwp__overlay-button" role="button" tabindex="0" aria-label="play" aria-pressed="false" data-action="play"><svg class="icon" width="96px" height="96px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#c2c2c2" d="M512.61025 48.820024a463.790226 463.790226 0 1 0 463.790227 463.790226A463.790226 463.790226 0 0 0 512.61025 48.820024z m0 854.350417a390.560191 390.560191 0 1 1 390.560191-390.560191 390.560191 390.560191 0 0 1-390.560191 390.560191z m166.720382-414.970203l-120.341359-70.300834-127.908463-74.694636a22.945411 22.945411 0 0 0-32.465315 24.410011v288.526341a22.945411 22.945411 0 0 0 32.465315 24.410012l127.908463-74.694636 120.341359-70.056734a28.559714 28.559714 0 0 0 0-47.599524z" /></svg></div></div>',
Ob='<div class="zwp-pipPlaceHolder">\t<div class="zwp-pipControl">\t\t<div class="zwp-pipTiptext">'+H("pipModePlaying","Playing in Picture-in-Picture mode")+'</div>\t\t<div class="zwp-pipExitButton">'+H("exitPictureInPicture","Exit Picture-in-Picture")+"</div>\t</div></div>";(function(n,J){typeof L.define==="function"&&L.define.amd?L.define([],J):typeof exports==="object"?module.exports=J():n.ZWPlayer=J()})(L,function(){async function n(f,x){return new Promise(function(b,r){Q(f,JSON.stringify(x),
function(q){b(q)},function(q){r(q)})})}function J(f){f=f.getBoundingClientRect();return{top:f.top+(L.pageYOffset||document.documentElement.scrollTop),left:f.left+(L.pageXOffset||document.documentElement.scrollLeft)}}function v(f){var x=f.offsetTop;for(f=f.offsetParent;f!==null;)x+=f.offsetTop,f=f.offsetParent;return x}function z(f,x){if(document.createEvent){const b=document.createEvent("HTMLEvents");b.initEvent(x,!0,!1);f.dispatchEvent(b)}else document.createEventObject&&f.fireEvent(x)}function M(){var f=
navigator.userAgent||navigator.vendor||L.opera;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(f)||/Macintosh/i.test(f)&&navigator.maxTouchPoints>0?!0:!1}var P=function(){return(new Date).getTime()};typeof performance!="undefined"&&performance.now&&(P=function(){return performance.now()});P();var D=function(f){var x="",b="",r="";if(f.startsWith("webrtc://"))f.indexOf("txSecret=")>0?(x="/webrtc/v1/pullstream",b="trtc",r=f.replace("trtc://","webrtc://")):x="/rtc/v1/play/";
else if(f.startsWith("brtc://"))x="/brtc/v3/pullstream",b="brtc",r=f.replace("brtc://","webrtc://");else if(f.startsWith("trtc://"))x="/webrtc/v1/pullstream",b="trtc",r=f.replace("trtc://","webrtc://");else if(f.startsWith("artc://"))b="artc",r=f;else if(f.indexOf("/whep/")>0||f.indexOf("/whep?")>0||f.indexOf("/whip-play/")>0)return{apiUrl:f,provider:"whep",schema:"whep",urlObject:{schema:"whep"}};var q=f.indexOf("://");if(q==-1)return!1;var S="";if(f.indexOf("?")>=0){var t=f.indexOf("?");S=f.substr(t+
1);f=f.substr(0,t)}var R=f.indexOf("/",q+3);t=f.substr(0,q);q=f.substring(q+3,R);R=f.substring(R);var ca=R.lastIndexOf("/"),Y="",ia=q.indexOf(":");ia>0&&(Y=q.substring(ia+1),q=q.substring(0,ia));ia=R.substring(1,ca);ca=R.substring(ca+1);var oa=ca.lastIndexOf(".");oa>0&&(ca=ca.substring(0,oa));oa="";S.indexOf("vhost=")>0&&(oa=S.substr(S.indexOf("vhost=")+6),oa.indexOf("&")>0&&(oa=oa.substr(0,oa.indexOf("&"))));q===oa&&/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/.test(q)&&(oa="_default_vhost_");f={url:f,schema:t,
server:q,port:Y,vhost:oa,app:ia,stream:ca};f.user_query={};if(S.length!==0){S.indexOf("?")>=0&&(S=S.split("?")[1]);S=S.split("&");for(Y=0;Y<S.length;Y++)oa=S[Y].split("="),f[oa[0]]=oa[1],f.user_query[oa[0]]=oa[1];f.domain&&(f.vhost=f.domain)}t==="webrtc"||t==="rtc"?(t="",f.port||(f.user_query.schema==="https"?(f.port=443,t=f.user_query.schema||"https"):L.location.href.indexOf("https://")===0?(f.port=443,t=f.user_query.schema||"https"):f.port=1985)):b==="brtc"?L.location.href.indexOf("https://")===
0?(t="https",f.port=f.port||443):(t="http",f.port=f.port||80):b==="artc"&&(t="https",f.port=f.port||443,x=R);r||="rtmp://"+q+"/"+ia+"/"+ca;t=t?t+":":L.location.protocol;(Y=f.port)||(Y=t==="https:"?Y||443:Y||1985);x=x||"/live/webrtc/play/";q=t+"//"+f.server+":"+Y+x;for(var xa in f.user_query)xa!=="api"&&xa!=="play"&&(q+="&"+xa+"="+f.user_query[xa]);q=q.replace(x+"&",x+"?");b={apiUrl:q,streamUrl:r,schema:t,urlObject:f,port:Y,provider:b};b.tid=Number(parseInt((new Date).getTime()*Math.random()*100)).toString(16).slice(0,
7);return b},Q=function(f,x,b,r,q){let S=null;S=L.XMLHttpRequest?new L.XMLHttpRequest:new L.ActiveXObject("Microsoft.XMLHTTP");S.addEventListener("error",function(t){r&&r("REQUEST:"+t.type)});S.onreadystatechange=function(){if(S.readyState===4)if(S.status===200||S.status===201)if(S.responseText.startsWith("{")){var t=JSON.parse(S.responseText);b&&b(t,S)}else b&&b(S.responseText,S);else r&&r("STATUS:"+S.status+":"+S.statusText)};S.open("POST",f,!0);q||="application/json";S.setRequestHeader("Content-Type",
q);S.send(x);return S},U=function(f){var x=new XMLHttpRequest;x.open("DELETE",f,!0);x.onload=function(){};x.onerror=function(){};x.send()},W=function(f){var x=f.lastIndexOf("/"),b=f.indexOf("?"),r=f.indexOf("#");x=f.indexOf(".",x+1);var q="";if(f.substr(0,5)==="blob:"&&r>0){r=f.substring(r);var S=r.lastIndexOf(".");if(S>0)return q=r.substring(S).toLowerCase()}x>0&&(b>0?x>b||(q=f.substring(x,b).toLowerCase()):q=f.substring(x).toLowerCase(),x=q.lastIndexOf("."),x>0&&(q=q.substring(x)));return q},ea=
void 0,aa=void 0,X=void 0;"classList"in document.documentElement?(ea=function(f,x){return f.classList!==void 0&&f.classList.contains(x)},aa=function(f,x){return f.classList.add(x)},X=function(f,x){return f.classList.remove(x)}):(ea=function(f,x){return(new RegExp("\\b"+x+"\\b")).test(f.className)},aa=function(f,x){ea(f,x)||(f.className+=" "+x)},X=function(f,x){f.className=f.className.replace(new RegExp("\\b"+x+"\\b","g"),"")});L.hasClass=ea;L.addClass=aa;L.removeClass=X;/MSIE 8\.0/.test(navigator.userAgent);
var ma=function(f){f=parseInt(f);var x=parseInt(f/3600),b=parseInt(f%3600/60);f=parseInt(f%60);var r="";x>0&&(r+=x+":");r=b>=10?r+(b+":"):b>0?r+("0"+b+":"):r+"00:";return f>=10?r+f:r+("0"+f)},ta=function(f){if(typeof f!=="number"||isNaN(f))return"00:00.000";var x=Math.floor(f/3600),b=Math.floor(f%3600/60),r=Math.floor(f%60);f=Math.round(f%1*1E3);var q="";x>0&&(q+=x+":");q=b>=10?q+(b+":"):q+("0"+b+":");q=r>=10?q+(r+"."):q+("0"+r+".");return f>=100?q+f:f>=10?q+("0"+f):q+("00"+f)},ua=function(f){if(typeof f.ratio===
"number")return f.ratio*100;if(typeof f.ratio==="string"){if(f=f.ratio.split(":"),f.length===2){var x=parseFloat(f[0]);f=parseFloat(f[1]);x===0&&(x=1);return f*100/x}}else if(typeof f.width==="number"&&typeof f.height==="number")return x=f.width,x===0&&(x=1),f.height*100/x;return 56.25},ja=function(f){if(f&&f._config&&f._config.fluid&&f.isMobile&&f.isMobile()){var x=f.playerElm;if(x){aa(x,"zwp-fluid");x.style.maxWidth="100%";x.style.width="100%";var b=L.matchMedia?L.matchMedia("(orientation: landscape)").matches:
L.innerWidth>L.innerHeight;b?(x.style.height="100dvh",x.style.paddingTop="0",x.style.maxHeight="100dvh"):(x.style.height="0",x.style.maxHeight="",f=ua(f._config),x.style.paddingTop=f+"%")}}},ya=function(f){function x(c,d,g){var m=c.recording,h=c._config&&c._config.isLive,u=g==="audio"?"\u97f3\u9891":"\u89c6\u9891";m.isLive=h;if(!m.isRecording){m.isRecording=!0;m.startTime=Date.now();m.recordedChunks=[];m.duration=0;m.recordType=g;m.finalized=!1;if(d){var G=d.closest?d.closest(".zwp-recordButton"):
null;G&&(X(G,"is-active"),aa(G,"is-recording"))}if(!m.indicator){G=document.createElement("div");G.className="zwp-live-recording-indicator";G.title="\u6b63\u5728\u5f55\u5236";if(d){var O=d.closest(".zwp-recordButton");O?(O.style.position=O.style.position||"relative",O.appendChild(G)):(d.style.position=d.style.position||"relative",d.appendChild(G))}m.indicator=G}m.indicator&&(m.indicator.className="zwp-live-recording-indicator recording "+(g==="audio"?"audio-recording":""));d&&(d.title="\u505c\u6b62"+
u+"\u5f55\u5236");h?(m=0,u=Infinity):c.segment&&c.segment.isActive?(m=c.videoEl.currentTime=c.segment.startTime,u=c.segment.endTime):(m=c.videoEl.currentTime,u=c.videoEl.duration||Infinity);b(c,d,g,m,u,h)}}function b(c,d,g,m,h,u){var G=c.recording;G.isLive=u;try{var O=ca(c);if(g==="audio"){var N=O.getAudioTracks();if(N.length===0)throw Error("\u6ca1\u6709\u627e\u5230\u97f3\u9891\u8f68\u9053\uff0c\u65e0\u6cd5\u8fdb\u884c\u97f3\u9891\u5f55\u5236");N.forEach(function(fa){fa.enabled=!0});O=new MediaStream(N)}G.format=
S(g);var K={mimeType:G.format.mimeType};g==="video"?(K.videoBitsPerSecond=25E5,O.getAudioTracks().length>0&&(K.audioBitsPerSecond=192E3)):K.audioBitsPerSecond=128E3;G.mediaRecorder=new MediaRecorder(O,K);G.mediaRecorder.ondataavailable=function(fa){fa.data.size>0&&G.recordedChunks.push(fa.data)};G.mediaRecorder.onstop=function(){var fa=c.recording;u!==fa.isLive&&(fa.isLive=u);if(fa.recordedChunks.length!==0){var Ba=new Blob(fa.recordedChunks,{type:fa.format.mimeType}),Pa=u?"live_recording":"vod_recording",
Ea=new Date;Ea=Ea.getFullYear()+String(Ea.getMonth()+1).padStart(2,"0")+String(Ea.getDate()).padStart(2,"0")+"_"+String(Ea.getHours()).padStart(2,"0")+String(Ea.getMinutes()).padStart(2,"0")+String(Ea.getSeconds()).padStart(2,"0");Pa=Pa+"_"+Ea+fa.format.fileExtension;Ba=URL.createObjectURL(Ba);Ea=document.createElement("a");Ea.href=Ba;Ea.download=Pa;Ea.style.display="none";document.body.appendChild(Ea);Ea.click();document.body.removeChild(Ea);URL.revokeObjectURL(Ba);fa.recordedChunks=[];fa.isRecording=
!1;fa.finalized=!0;fa.duration=0;fa.startTime=0;fa.recordType=null}};G.mediaRecorder.onstart=function(){};G.mediaRecorder.onerror=function(fa){G.isRecording=!1;G.indicator&&(G.indicator.className="zwp-live-recording-indicator");d&&(d.title="\u5f55\u5236")};G.mediaRecorder.start(g==="audio"?100:200);ia(c,d);if(!u&&h!==Infinity)setTimeout(function(){G.isRecording&&r(c,d)},(h-m)*1E3);else if(!u&&h===Infinity){var Z=function(){G.isRecording&&r(c,d);c.videoEl.removeEventListener("ended",Z)};c.videoEl.addEventListener("ended",
Z)}}catch(fa){G.isRecording=!1,G.indicator&&(G.indicator.className="zwp-live-recording-indicator"),d&&(d.title="\u5f55\u5236")}}function r(c,d){c=c.recording;if(c.isRecording||c.mediaRecorder){c.timer&&(clearInterval(c.timer),c.timer=null);c.streamCheckInterval&&(clearInterval(c.streamCheckInterval),c.streamCheckInterval=null);if(c.mediaRecorder&&c.mediaRecorder.state!=="inactive")try{c.mediaRecorder.stop()}catch(g){}c.indicator&&(c.indicator.className="zwp-live-recording-indicator");d&&(d.title=
"\u5f55\u5236",(d=d.closest?d.closest(".zwp-recordButton"):null)&&X(d,"is-recording"));c.isRecording=!1}}function q(c,d){try{if(c.videoEl)if(c.streamContentCache)d({hasVideo:c.streamContentCache.hasVideo,hasAudio:c.streamContentCache.hasAudio});else{var g=c.videoEl,m={hasVideo:!1,hasAudio:!1};if(g.captureStream||g.mozCaptureStream)try{var h=(g.captureStream||g.mozCaptureStream).call(g),u=h.getVideoTracks();m.hasVideo=u.length>0;var G=h.getAudioTracks();m.hasAudio=G.length>0;c.streamContentCache={hasVideo:m.hasVideo,
hasAudio:m.hasAudio};d(m);return}catch(O){}g.videoWidth>0&&g.videoHeight>0&&(m.hasVideo=!0);if(g.webkitAudioDecodedByteCount>0||g.getAudioTracks&&g.getAudioTracks().length>0)m.hasAudio=!0;m.hasVideo||m.hasAudio||(m.hasVideo=!0,m.hasAudio=!0);c.streamContentCache={hasVideo:m.hasVideo,hasAudio:m.hasAudio};d(m)}else d({hasVideo:!1,hasAudio:!1})}catch(O){g={hasVideo:!0,hasAudio:!0},c.streamContentCache=g,d(g)}}function S(c){if((c||"video")==="audio"){c="audio/mp4;codecs=mp4a.40.2 audio/mp4 audio/webm;codecs=opus audio/webm;codecs=vorbis audio/webm audio/ogg;codecs=opus audio/ogg;codecs=vorbis".split(" ");
for(var d=0;d<c.length;d++)if(MediaRecorder.isTypeSupported(c[d])){var g=c[d].includes("mp4");return{mimeType:c[d],isMP4:g,fileExtension:g?".m4a":".webm"}}return{mimeType:"audio/webm",isMP4:!1,fileExtension:".webm"}}c="video/mp4;codecs=avc1.42E01E,mp4a.40.2 video/mp4;codecs=avc1.42E01E video/mp4;codecs=h264 video/webm;codecs=vp8,opus video/webm;codecs=vp8,vorbis video/webm;codecs=vp9 video/webm;codecs=vp8 video/webm".split(" ");for(d=0;d<c.length;d++)if(MediaRecorder.isTypeSupported(c[d]))return{mimeType:c[d],
isMP4:c[d].includes("mp4"),fileExtension:c[d].includes("mp4")?".mp4":".webm"};return{mimeType:"video/webm",isMP4:!1,fileExtension:".webm"}}function t(c){var d=c.videoEl;if(d.captureStream||d.mozCaptureStream)try{var g=(d.captureStream||d.mozCaptureStream).call(d).getAudioTracks();if(g.length>0)return new MediaStream(g)}catch(m){}return R(c)}function R(c){c=c.videoEl;if(c.captureStream)try{var d=c.captureStream(),g=d.getAudioTracks();if(g.length>0){var m=new MediaStream(g);return m}}catch(N){}if(c.mozCaptureStream)try{if(d=
c.mozCaptureStream(),g=d.getAudioTracks(),g.length>0)return m=new MediaStream(g)}catch(N){}try{var h=new (L.AudioContext||L.webkitAudioContext),u=document.createElement("audio");u.src=c.src;u.crossOrigin=c.crossOrigin||"anonymous";u.muted=!1;u.volume=1;var G=h.createMediaStreamDestination(),O=h.createMediaElementSource(u);O.connect(G);O.connect(h.destination);d=G.stream;u.muted=!0;u.play().catch(function(N){});return d}catch(N){}return new MediaStream}function ca(c){var d=c.videoEl;if(d.captureStream||
d.mozCaptureStream)try{var g=(d.captureStream||d.mozCaptureStream).call(d),m=g.getVideoTracks(),h=g.getAudioTracks();if(m.length>0){if(h.length>0)return g;var u=t(c).getAudioTracks();u.length>0&&u.forEach(function(G){g.addTrack(G)});return g}}catch(G){}return Y(c)}function Y(c){function d(){if(c.recording&&c.recording.isRecording){try{if(g&&g.videoWidth>0&&g.videoHeight>0){var Z=g.currentTime;Math.abs(Z-N)>.016&&(h.drawImage(g,0,0,m.width,m.height),N=Z,K++)}else h.fillStyle="black",h.fillRect(0,0,
m.width,m.height)}catch(fa){}requestAnimationFrame(d)}}var g=c.videoEl,m=document.createElement("canvas"),h=m.getContext("2d");m.width=g?g.videoWidth||1280:1280;m.height=g?g.videoHeight||720:720;var u=m.captureStream(60),G=R(c),O=new MediaStream;u.getVideoTracks().forEach(function(Z){O.addTrack(Z)});G.getAudioTracks().forEach(function(Z){O.addTrack(Z)});var N=0,K=0;d();return O}function ia(c,d){var g=c.recording;g.timer=setInterval(function(){g.duration=Math.floor((Date.now()-g.startTime)/1E3);if(g.duration>=
g.maxDuration)r(c,d);else{var m=g.duration;var h=Math.floor(m/3600);var u=Math.floor(m%3600/60);m%=60;h=h>0?h+":"+String(u).padStart(2,"0")+":"+String(m).padStart(2,"0"):u+":"+String(m).padStart(2,"0");d&&(d.title="\u505c\u6b62\u5f55\u5236 ("+h+")")}},1E3)}var oa=!1,xa=!1,e=this;e instanceof ya||(e=Object.create(ya.prototype));e._config=f||{};Xa=e._config.lang?e._config.lang:e._config.lang=tb;e._config.recordButton&&M()&&(e._config.recordButton=!1);e.peer_conn=null;e.danmuSetting={};e.segment={isActive:!1,
startTime:0,endTime:0,isDragging:!1,dragTarget:null};e.resetPlaybackState=function(){this.segment.isActive=!1;this.segment.startTime=0;this.segment.endTime=0;this.segment.isDragging=!1;this.segment.dragTarget=null;var c=this.controlbar?this.controlbar.querySelector("#segmentLayer"):null,d=this.controlbar?this.controlbar.querySelector(".zwp-segmentBtn"):null;c&&(c.classList.remove("active"),(c=c.closest(".zwp__time-rail"))&&c.classList.remove("segment-active"));d&&d.closest(".zwp-segmentButton").classList.remove("active");
this.streamContentCache=null};e._closePanel=function(c){var d=this[c];if(d){var g=d.querySelector(".closeBtn");g?g.click():(d.remove(),delete this[c])}};typeof e._config.controlbar==="undefined"&&(e._config.controlbar=!0);e._config.hideControlbarTimeout||(e._config.hideControlbarTimeout=1E4);typeof e._config.defVolume==="undefined"&&(e._config.defVolume=61.25);e.setRtcstream=function(c){this.videoEl&&(this.videoEl.srcObject=c,this.videoEl.play(),this.setplaystate(!0),this.startHideControlbar(this))};
e.onfullscrchange=function(c){var d=this;ab()?(d.isFullscr=!0,d.setupFullscrBtn&&d.setupFullscrBtn.setAttribute("title",H("exitFullScreen","Exit full screen")),(c=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)||(c=d.videoEl||d.playerElm||d.playerContainer),c&&(d.fullscreenContextMenuHandler&&c.removeEventListener("contextmenu",d.fullscreenContextMenuHandler),d.fullscreenContextMenuHandler=function(g){g.preventDefault();g.stopPropagation();
pb||d.showContextMenu(g)},c.addEventListener("contextmenu",d.fullscreenContextMenuHandler))):(d.setupFullscrBtn&&(X(d.playerElm,"zwp-fullscreen"),d.setupFullscrBtn.setAttribute("data-action","enterfullscreen"),d.setupFullscrBtn.setAttribute("title",H("enterFullScreen","Enter full screen"))),d.isFullscr=!1,d.fullscreenContextMenuHandler&&((c=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)&&d.fullscreenContextMenuHandler&&c.removeEventListener("contextmenu",
d.fullscreenContextMenuHandler),delete d.fullscreenContextMenuHandler),d._config.fluid&&(d.isMobile&&d.isMobile()?ja(d):(aa(d.playerElm,"zwp-fluid"),d.playerElm.style.height="0",c=d.videoEl,c.videoHeight&&c.videoWidth?(c=ua(d._config),d.playerElm.style.paddingTop=c+"%"):d.playerElm.style.paddingTop=d._config.keepAudioWindow?"264px":"64px")));d.isFullscrWin||d.reposDanmuToolbar(d.isFullscr)}.bind(e);e.on_btnclick=function(c){if(c.currentTarget&&this.btnBindZwp){c=c.currentTarget;var d=c.getAttribute("data-action");
if(d==="play")this._config.disablePlayBtn||(this.isPlaying?this.videoEl&&(this.videoEl.paused||this.videoEl.ended)&&(this.isMobile()||this.initAudioContext(),this.videoEl.play(),this.setplaystate(!0)):this._config.url&&this.play(this._config.url));else if(d==="pause")this._config.disablePlayBtn||!this.videoEl||this.videoEl.paused||this.videoEl.ended||(this.videoEl.pause(),this.setplaystate(!1));else if(d==="mute")this.videoEl&&(this.videoEl.muted||this.setMuted(!0));else if(d==="unmute")this.videoEl&&
this.videoEl.muted&&this.setMuted(!1);else if(d==="enterfullscreen")this.setFullscreen(!0,c);else if(d==="exitfullscreen")this.setFullscreen(!1,c);else if(d==="enterfullscreenWin")this.setFullscreenWin(!0,c);else if(d==="exitfullscreenWin")this.setFullscreenWin(!1,c);else if(d==="showMediainfo")this.showMediainfo();else if(d==="snapshot")this.doSnapshot();else if(d==="pictureInPicture")this.togglePictureInPicture();else if(d==="selectLocalFile")this.selectLocalFile();else if(d==="toggleSegment")this.toggleSegment();
else if(d==="record")this.recordVideo();else if(d==="recordVideo")this.recordVideo("video");else if(d==="recordAudio")this.recordVideo("audio");else if(d==="toggleZoom")this.toggleZoom();else if(d==="showChapterSearchPanel"){var g=this.overlay_layers.querySelector(":scope > .zwp-chapterSearchPanel");if(g)Ha(g,500,function(){g.remove()}),delete this.chapterSearchPanel;else if(this.closeAllActivePanels(),g=this.createChapterSearchPanel())g.style.display="block",(c=g.querySelector(".zwp-search-input"))&&
!this.isMobile()&&c.focus()}}}.bind(e);e.setFullscreen=function(c,d){if(c){if(!ab()&&this.playerElm){this._config.fluid&&(X(this.playerElm,"zwp-fluid"),this.playerElm.style.height=null,this.playerElm.style.paddingTop=null);c=this.playerElm;var g=this.videoEl;c.requestFullscreen?c.requestFullscreen():c.webkitRequestFullscreen?c.webkitRequestFullScreen():c.mozRequestFullScreen?c.mozRequestFullScreen():c.msRequestFullscreen?c.msRequestFullscreen():c.oRequestFullscreen?c.oRequestFullscreen():g.webkitEnterFullScreen?
g.webkitEnterFullScreen():(g=document.documentElement,g.requestFullscreen?g.requestFullscreen():g.mozRequestFullScreen?g.mozRequestFullScreen():g.webkitRequestFullScreen?g.webkitRequestFullScreen():(g=document.body,document.documentElement.style.cssText="width:100%;height:100%;overflow:hidden;",g.style.cssText="width:100%;height:100%;overflow:hidden;",c.style.cssText="width:100%;height:100%;overflow:hidden;;margin:0px;padding:0px;",document.IsFullScreen=!0));aa(this.playerElm,"zwp-fullscreen");d.setAttribute("data-action",
"exitfullscreen");if(!this.setupFullscrBtn){c=this.onfullscrchange;g=this.videoEl;var m=document.webkitExitFullscreen||document.webkitCancelFullScreen?"webkitfullscreenchange":document.mozCancelFullScreen?"mozfullscreenchange":document.msExitFullscreen?"MSFullscreenChange":"webkitfullscreenchange";document.addEventListener("fullscreenchange",c,!1);m&&document.addEventListener(m,c,!1);g&&pb&&(g.addEventListener("webkitbeginfullscreen",c),g.addEventListener("webkitendfullscreen",c));this.setupFullscrBtn=
d}}}else ab()&&this.playerElm&&(this._config.fluid&&(this.isMobile&&this.isMobile()?ja(this):(aa(this.playerElm,"zwp-fluid"),this.playerElm.style.height="0",c=this.videoEl,c.videoHeight&&c.videoWidth?(c=ua(this._config),this.playerElm.style.paddingTop=c+"%"):this.playerElm.style.paddingTop="64px")),ib(this.playerElm),X(this.playerElm,"zwp-fullscreen"),d.setAttribute("data-action","enterfullscreen"),d.setAttribute("title",H("enterFullScreen","Enter full screen")))}.bind(e);e.setFullscreenWin=function(c,
d){this.playerElm&&(c?this.isFullscrWin||(aa(this.playerElm,"zwp-fullscreen-win"),d.setAttribute("data-action","exitfullscreenWin"),this.isFullscrWin=!0,this.reposDanmuToolbar(!0),(c=this.playerElm.parentNode)&&c.tagName!=="BODY"&&(this.oldWrapZIndex=c.style.zIndex,c.style.zIndex=99999999)):this.isFullscrWin&&(typeof this.oldWrapZIndex!=="undefined"&&(c=this.playerElm.parentNode,c.style.zIndex=this.oldWrapZIndex,delete this.oldWrapZIndex),X(this.playerElm,"zwp-fullscreen-win"),d.setAttribute("data-action",
"enterfullscreenWin"),delete this.isFullscrWin,this.reposDanmuToolbar(!1)))}.bind(e);e.setMuted=function(c){this.videoEl&&(this.videoEl.muted=c)&&(this.oldVolume=this.videoEl.volume);c?(aa(this.playerElm,"zwp-muted"),this.muteBtn&&this.muteBtn.setAttribute("data-action","unmute")):(this.oldVolume&&(this.videoEl.volume=this.oldVolume,delete this.oldVolume),X(this.playerElm,"zwp-muted"),this.muteBtn&&this.muteBtn.setAttribute("data-action","mute"));this.mutedTipBox&&(this.popup_layers.removeChild(this.mutedTipBox),
this.popup_layers.style.display=null,delete this.mutedTipBox)}.bind(e);e.setVolume=function(c){this.videoEl&&(this.lastVolume=c,this.videoEl.volume=c,this.audioVolumeNode&&(this.audioVolumeNode.gain.value=c))}.bind(e);e.isMobile=function(){return typeof this._isMobile!=="undefined"?this._isMobile:this._isMobile=M()}.bind(e);e.removeVolumeBoostButton=function(){if(this.controlbar){var c=this.controlbar.querySelector('button[data-action="showVolumeBoostConfig"]');c&&(c=c.closest(".zwp-option-item"))&&
c.remove()}}.bind(e);e.initAudioContext=function(){if(this.videoEl&&!this.audioContext&&!this.isMobile())try{this.audioContext=new (L.AudioContext||L.webkitAudioContext),this.audioSource=this.audioContext.createMediaElementSource(this.videoEl),this.audioGainNode=this.audioContext.createGain(),this.audioGainNode.gain.value=1,this.audioVolumeNode=this.audioContext.createGain(),this.audioVolumeNode.gain.value=this.lastVolume||this.videoEl.volume,this.audioSource.connect(this.audioVolumeNode),this.audioVolumeNode.connect(this.audioGainNode),
this.audioGainNode.connect(this.audioContext.destination)}catch(c){}};e.toggleSegment=function(){if(this.videoEl&&this.videoEl.duration){this.segment.isActive=!this.segment.isActive;var c=this.controlbar?this.controlbar.querySelector("#segmentLayer"):null,d=this.controlbar?this.controlbar.querySelector(".zwp-segmentBtn"):null;if(this.segment.isActive){if(c&&(c.classList.add("active"),(c=c.closest(".zwp__time-rail"))&&c.classList.add("segment-active")),d&&d.closest(".zwp-segmentButton").classList.add("active"),
d=this.videoEl.duration||100,c=this.videoEl.currentTime||0,this.segment.startTime=c,this.segment.endTime=Math.min(c+d*.1,d),this.updateSegmentUI(),this.setupSegmentHandlers(),this.videoEl.currentTime<this.segment.startTime||this.videoEl.currentTime>this.segment.endTime)this.videoEl.currentTime=this.segment.startTime}else c&&(c.classList.remove("active"),(c=c.closest(".zwp__time-rail"))&&c.classList.remove("segment-active")),d&&d.closest(".zwp-segmentButton").classList.remove("active"),this.removeSegmentHandlers()}};
e.updateSegmentUI=function(){if(this.videoEl&&this.videoEl.duration){var c=this.controlbar?this.controlbar.querySelector("#segmentLayer"):null;if(c){var d=c.querySelector("#segmentHandleStart"),g=c.querySelector("#segmentHandleEnd");c=c.querySelector("#segmentSelection");if(d&&g&&c){var m=this.segment.startTime/this.videoEl.duration*100,h=this.segment.endTime/this.videoEl.duration*100;d.style.left=m+"%";g.style.left=h+"%";c.style.left=m+"%";c.style.width=h-m+"%"}}}};e.setupSegmentHandlers=function(){var c=
this;if(!c.segmentHandlersSetup){var d=c.controlbar?c.controlbar.querySelector("#segmentLayer"):null;if(d){var g=d.querySelector("#segmentHandleStart"),m=d.querySelector("#segmentHandleEnd"),h=c.controlbar?c.controlbar.querySelector(".zwp__time-rail"):null;if(g&&m&&h){var u=function(N){return function(K){K.preventDefault();c.segment.isDragging=!0;c.segment.dragTarget=N;if(K=d.querySelector("#segmentTooltip")){K.classList.remove("start-handle","end-handle");if(N==="start"){K.classList.add("start-handle");
var Z=d.querySelector("#segmentHandleStart");if(Z){Z=Z.getBoundingClientRect();var fa=h.getBoundingClientRect();Z=Z.left+Z.width/2-fa.left;K.style.left=Z+"px";K.textContent=ta(c.segment.startTime)}}else if(K.classList.add("end-handle"),Z=d.querySelector("#segmentHandleEnd"))Z=Z.getBoundingClientRect(),fa=h.getBoundingClientRect(),Z=Z.left+Z.width/2-fa.left,K.style.left=Z+"px",K.textContent=ta(c.segment.endTime);K.style.transform="translateX(-50%) translateY(-100%)";K.style.display="block"}document.addEventListener("mousemove",
G);document.addEventListener("mouseup",O);document.addEventListener("touchmove",G,{passive:!1});document.addEventListener("touchend",O)}},G=function(N){if(c.segment.isDragging&&c.videoEl&&c.videoEl.duration){var K=h.getBoundingClientRect();N=(N.clientX||(N.touches?N.touches[0].clientX:0))-K.left;N<0&&(N=0);N>K.width&&(N=K.width);K=N/K.width*c.videoEl.duration;var Z=d.querySelector("#segmentTooltip");c.segment.dragTarget==="start"?(K>c.segment.endTime-1&&(K=c.segment.endTime-1),c.segment.startTime=
K):(K<c.segment.startTime+1&&(K=c.segment.startTime+1),c.segment.endTime=K);c.videoEl.currentTime=K;Z&&(Z.textContent=ta(K),Z.style.left=N+"px",Z.style.transform="translateX(-50%) translateY(-100%)");c.updateSegmentUI()}},O=function(){c.segment.isDragging=!1;c.segment.dragTarget=null;var N=d.querySelector("#segmentTooltip");N&&(N.style.display="none",N.classList.remove("start-handle","end-handle"));c.videoEl.currentTime=c.segment.startTime;document.removeEventListener("mousemove",G);document.removeEventListener("mouseup",
O);document.removeEventListener("touchmove",G);document.removeEventListener("touchend",O)};g.addEventListener("mousedown",u("start"));g.addEventListener("touchstart",u("start"),{passive:!1});m.addEventListener("mousedown",u("end"));m.addEventListener("touchstart",u("end"),{passive:!1});c.segmentHandlersSetup=!0}}}};e.removeSegmentHandlers=function(){this.segmentHandlersSetup=!1};e.recordingSettings={mode:"ask"};e.recording={isRecording:!1,startTime:null,mediaRecorder:null,recordedChunks:[],timer:null,
duration:0,maxDuration:14400,format:null,indicator:null,isLive:!1};e.streamContentCache=null;e.recordVideo=function(c){var d=this;if(d.videoEl&&(d.videoEl.src||d.videoEl.srcObject)){var g=d.recording,m=null;m=d.container?d.container.querySelector(".zwp-recordBtn"):d.element?d.element.querySelector(".zwp-recordBtn"):d.playerElm?d.playerElm.querySelector(".zwp-recordBtn"):document.querySelector(".zwp-recordBtn");g.isRecording?r(d,m):c==="video"?x(d,m,"video"):c==="audio"?x(d,m,"audio"):d.makeRecordingDecision(m,
function(h,u){switch(h){case "show_options":if(h=m?m.closest(".zwp-recordButton"):null)d.closeAllMenus&&d.closeAllMenus(),aa(h,"is-active");break;case "record_video":x(d,m,"video");break;case "record_audio":x(d,m,"audio")}})}};e.updateRecordingMenuVisibility=function(){var c=this.recordingSettings?this.recordingSettings.mode:"ask",d=this.controlbar?this.controlbar.querySelector(".zwp-recordOptionsMenu"):null;d&&(d.style.display=c==="ask"?"":"none")};e.makeRecordingDecision=function(c,d){var g=this.recordingSettings?
this.recordingSettings.mode:"ask";q(this,function(m){g==="ask"?m.hasVideo&&m.hasAudio?d("show_options",m):m.hasAudio?d("record_audio",m):d("record_video",m):g==="audio"&&m.hasAudio?d("record_audio",m):g==="video"&&m.hasAudio&&!m.hasVideo?d("record_audio",m):d("record_video",m)})};e.startHideControlbar=function(c){c.controlbar&&!c._config.fixedControlbar&&(c.hideControlbarTime=(new Date).getTime()+c._config.hideControlbarTimeout,c.hideControlbarTimer||(c.hideControlbarTimer=L.setInterval(function(){(new Date).getTime()>=
c.hideControlbarTime&&(L.clearInterval(c.hideControlbarTimer),delete c.hideControlbarTimer,Ha(c.controlbar,1E3,function(d){d.style.display="none";aa(c.playerElm,"hide-cursor");c.isControlbarhidden=!0;typeof c._config.onhideControlbar=="function"&&c._config.onhideControlbar.call(c)}))},1E3)))}.bind(e);e.buildProgressBar=function(){var c=this,d={};if(c.controlbar){var g=c.controlbar;d.rail=g.querySelector(".zwp__time-rail");d.timeInfo=g.querySelector(".zwp__time-info");if(c._config.isLive)d.rail&&(X(d.rail,
"has-duration"),aa(d.rail,"zwp-hidden")),c.progressBar&&c.progressBar.streamtype||(d.timeInfo&&(d.timeInfo.innerHTML='<div class="zwp-streamtype zwp-label">Live</div>',d.streamtype=g.querySelector(".zwp-streamtype")),c.progressBar=d);else if(d.timeInfo&&(c.progressBar&&c.progressBar.streamtype?c.progressBar.streamtype.innerHTML="VOD":(d.timeInfo.innerHTML='<div class="zwp-streamtype zwp-label">VOD</div>',d.streamtype=g.querySelector(".zwp-streamtype"),c.updateResponsiveControlbar&&c.updateResponsiveControlbar())),
d.rail||(g.insertAdjacentHTML("beforeend",'<div class="zwp__time-rail"></div>'),d.rail=g.querySelector(".zwp__time-rail")),X(d.rail,"zwp-hidden"),aa(d.rail,"has-duration"),c._config.disableSeek&&aa(d.rail,"zwp_disabled"),c.progressBar&&c.progressBar.total)c.progressBar.rail&&c._config.useProgressTooltip&&(g=c.progressBar.rail.querySelector(".zwp__time-float"))&&(m=g.querySelector(".zwp__time-thumbnail"),m||(g.insertAdjacentHTML("afterbegin",'<div class="zwp__time-thumbnail"></div>'),m=g.querySelector(".zwp__time-thumbnail"),
c.progressBar.thumbnails=m),c._config.thumbnails?(O=c._config.thumbnails,m&&(O.rowsize=typeof O.row=="number"?O.row:Math.ceil(Math.sqrt(O.total)),m.style.width=O.width+"px",m.style.height=O.height+"px",m.style.backgroundImage="url("+O.url+")"),g.style.width=4+O.width+"px",g.style.height=4+O.height+"px",aa(g,"zwp__thumbnail")):(g.style.width=null,g.style.height=null,m&&(m.style.width="0px",m.style.height="0px",m.style.backgroundImage=null),X(g,"zwp__thumbnail")));else{var m='<span class="zwp__time-total zwp__time-slider"><span class="zwp__bar zwp__time-buffering"></span><span class="zwp__bar zwp__time-loaded"></span><span class="zwp__bar zwp__time-current"></span><span class="zwp__time-chapter"></span><span class="zwp__time-hovered no-hover"></span><span class="zwp__time-thumb"><span class="zwp__time-thumb-content"></span></span>';
if(c._config.useProgressTooltip){var h="",u="",G="";if(typeof c._config.thumbnails==="object"&&c._config.thumbnails!=null){var O=c._config.thumbnails;typeof O.width=="number"&&typeof O.height=="number"&&typeof O.total=="number"&&(O.rowsize=typeof O.row=="number"?O.row:Math.ceil(Math.sqrt(O.total)),G=' style="width: '+(4+O.width)+"px; height: "+(4+O.height)+'px;"',u=" zwp__thumbnail",h='<div class="zwp__time-thumbnail" style="width: '+O.width+"px;height: "+O.height+"px; background-image: url("+O.url+
');"></div>')}m+='<div class="zwp__time-float'+u+'"'+G+">"+h+'<span class="zwp__time-float-current">0:00</span><span class="zwp__time-float-corner corner_external"></span><span class="zwp__time-float-corner corner_internal"></span></div>'}d.rail.innerHTML=m+'</span><div class="zwp-segment-layer" id="segmentLayer"><div class="zwp-segment-selection" id="segmentSelection"></div><div class="zwp-segment-handle zwp-segment-handle-start" id="segmentHandleStart"></div><div class="zwp-segment-handle zwp-segment-handle-end" id="segmentHandleEnd"></div><div class="zwp-segment-tooltip" id="segmentTooltip" style="display: none;"></div></div>';
d.buffering=g.querySelector(".zwp__time-buffering");d.total=g.querySelector(".zwp__time-total");d.loaded=g.querySelector(".zwp__time-loaded");d.current=g.querySelector(".zwp__time-current");d.thumb=g.querySelector(".zwp__time-thumb");d.timefloat=g.querySelector(".zwp__time-float");d.timefloatcurrent=g.querySelector(".zwp__time-float-current");d.thumbnails=g.querySelector(".zwp__time-thumbnail");d.slider=g.querySelector(".zwp__time-slider");d.hovered=g.querySelector(".zwp__time-hovered");d.chapters=
g.querySelector(".zwp__time-chapter");d.newTime=0;d.forcedHandlePause=!1;d.buffering.style.display="none";d.slider.addEventListener("dragstart",function(){return!1});c.progressBar=d;c.showTimefloat=function(ha){if(this._config.useProgressTooltip){var na=ha.originalEvent&&ha.originalEvent.changedTouches?ha.originalEvent.changedTouches[0].pageX:ha.changedTouches?ha.changedTouches[0].pageX:ha.pageX;ha=this.progressBar;var qa=this.videoEl.duration;var Aa=J(ha.total);var Ia=ha.total.offsetWidth;na<Aa.left?
na=Aa.left:na>Ia+Aa.left&&(na=Ia+Aa.left);na-=Aa.left;Aa=na/Ia;ha=this.progressBar;ha.timefloatcurrent.innerHTML=ma(qa*Aa);ha.thumbnails&&this._config.thumbnails?(qa=this._config.thumbnails,Aa=Math.floor(Aa*qa.total),Aa>=qa.total&&(Aa=qa.total-1),qa.rowsize!=0&&(ha.thumbnails.style.backgroundPosition="-"+Aa%qa.rowsize*qa.width+"px -"+qa.height*Math.floor(Aa/qa.rowsize)+"px")):(qa=7*ha.timefloatcurrent.innerHTML.length+10,qa<40&&(qa=40),ha.timefloat.style.width=qa+"px");qa=ha.timefloat.offsetWidth/
2;ha.timefloat.style.left=(na<qa?qa:na>Ia-qa?Ia-qa:na)+"px";ha.timefloat.style.display="block"}}.bind(c);d.slider.addEventListener("mouseenter",function(ha){var na=this;if(na.videoEl){var qa=na.videoEl.duration;isNaN(qa)||qa===Infinity||ha.target!==d.slider||(d.bindMouseMoveEvent||(d.slider.addEventListener("mousemove",function(Aa){var Ia=Aa.target;(Ia===d.slider||Ia.closest(".zwp__time-slider"))&&na.showTimefloat(Aa)}),d.bindMouseMoveEvent=!0),d.timefloat&&(d.timefloat.style.display="block"))}}.bind(c));
d.slider.addEventListener("mouseleave",function(){if(this.videoEl){var ha=this.videoEl.duration;isNaN(ha)||ha===Infinity||oa||!d.timefloat||(d.timefloat.style.display="none")}}.bind(c));var N=function(ha,na){var qa=this,Aa=d.slider.offsetWidth,Ia=J(d.slider);Ia=(ha.touches&&ha.touches.length>0?ha.touches[0].pageX:ha.pageX)-Ia.left;Ia<0?Ia=0:Ia>Aa&&(Ia=Aa);Aa=(Ia*100/Aa).toFixed(4);d.thumb.style.left=Aa+"%";na?(qa.seekTimeProgress(Aa),qa.lastSeekProgress=Aa):typeof qa.lastSeekProgress!="undefined"&&
Math.abs(Aa-qa.lastSeekProgress)>1&&(qa.lastSeekProgress=Aa,qa.seekTimer||(qa.seekTimer=setTimeout(function(){qa.seekTimeProgress(qa.lastSeekProgress);delete qa.seekTimer},1E3)));ha.preventDefault();ha.stopPropagation()}.bind(c),K=function(ha,na){if(na===ha)return!0;for(;na.parentNode;){if(na.parentNode===ha)return!0;na=na.parentNode}return!1};c.on_progressbar_mousemove=function(ha){var na=ha.target;oa&&K(d.slider,na)&&N(ha)}.bind(c);c.on_progressbar_mouseup=function(ha){if(oa){document.removeEventListener("mousemove",
this.on_progressbar_mousemove);document.removeEventListener("mouseup",this.on_progressbar_mouseup);oa=!1;delete this.isTrackingProgress;this.seekTimer&&(clearTimeout(this.seekTimer),delete this.seekTimer);if(ha.target&&(ha.target.parentNode==d.thumb||ha.target==d.thumb)){var na=d.slider.offsetWidth,qa=J(d.slider);ha=(ha.touches&&ha.touches.length>0?ha.touches[0].pageX:ha.pageX)-qa.left;ha<0?ha=0:ha>na&&(ha=na);na=(ha*100/na).toFixed(4);typeof this.lastSeekProgress!="undefined"?Math.abs(na-this.lastSeekProgress)>
1&&this.seekTimeProgress(na):this.seekTimeProgress(na)}delete this.lastSeekProgress}}.bind(c);c.on_progressbar_mousedown=function(ha){oa||this._config.disableSeek||(e.isTrackingProgress=!0,N(ha,!0),document.addEventListener("mousemove",this.on_progressbar_mousemove),document.addEventListener("mouseup",this.on_progressbar_mouseup),oa=!0,ha.preventDefault(),ha.stopPropagation())}.bind(c);d.slider.addEventListener("mousedown",c.on_progressbar_mousedown);if(c.isMobile()){var Z=!1,fa=null,Ba=null,Pa=!1,
Ea=!!c.showTimefloat,La=function(ha,na){var qa=na.offsetWidth;na=J(na);ha=ha.pageX-na.left;ha<0?ha=0:ha>qa&&(ha=qa);return parseFloat((ha*100/qa).toFixed(4))};c.on_progressbar_touchmove=function(ha){var na=ha.target;Z&&K(d.slider,na)&&(N(ha,!1),Ea&&c.showTimefloat(ha),ha=La(ha.touches[0],d.slider),na=!1,Ba===null?na=!0:Math.abs(ha-Ba)>1&&(na=!0),na&&(Ba=ha,fa&&clearTimeout(fa),fa=setTimeout(function(){Z&&Ba!==null&&c.seekTimeProgress(Ba)},300)))}.bind(c);c.on_progressbar_touchend=function(ha){var na=
this;if(Z){document.removeEventListener("touchmove",na.on_progressbar_touchmove);document.removeEventListener("touchend",na.on_progressbar_touchend);document.removeEventListener("touchcancel",na.on_progressbar_touchcancel);Z=!1;delete na.isTrackingProgress;fa&&(clearTimeout(fa),fa=null);var qa=Ba;qa===null&&ha.changedTouches&&ha.changedTouches.length>0&&(qa=La(ha.changedTouches[0],d.slider));qa!==null&&(na.seekTimeProgress(qa),Pa&&na.videoEl&&na.videoEl.paused&&na.videoEl.play().then(function(){na.setplaystate(!0)}).catch(function(Aa){}));
Ba=null;Pa=!1;d.timefloat&&(d.timefloat.style.display="none")}}.bind(c);c.on_progressbar_touchstart=function(ha){Z||this._config.disableSeek||(e.isTrackingProgress=!0,Ba=null,fa&&(clearTimeout(fa),fa=null),Pa=this.videoEl?this.videoEl.paused:!0,N(ha,!1),Ea&&this.showTimefloat(ha),document.addEventListener("touchmove",this.on_progressbar_touchmove,{passive:!1}),document.addEventListener("touchend",this.on_progressbar_touchend),document.addEventListener("touchcancel",this.on_progressbar_touchcancel),
Z=!0,ha.preventDefault(),ha.stopPropagation())}.bind(c);c.on_progressbar_touchcancel=function(ha){c.on_progressbar_touchend(ha)}.bind(c);d.slider.addEventListener("touchstart",c.on_progressbar_touchstart,{passive:!1})}}}}.bind(e);e.updateProgressBarType=function(){if(this.controlbar){var c=this.controlbar.querySelector(".zwp__time-rail");this._config.isLive?(c&&(X(c,"has-duration"),aa(c,"zwp-hidden")),this.progressBar&&this.progressBar.streamtype&&(this.progressBar.streamtype.innerHTML="Live",this.progressBar.streamtype.style.display=
"block")):(c&&(X(c,"zwp-hidden"),aa(c,"has-duration"),this._config.disableSeek&&aa(c,"zwp_disabled")),this.progressBar&&this.progressBar.streamtype&&(this.progressBar.streamtype.innerHTML="VOD",this.progressBar.streamtype.style.display="block"));this.updateResponsiveControlbar&&this.updateResponsiveControlbar()}}.bind(e);e.updateDuration=function(c){if(c.controlbar){var d=c.controlbar.querySelector(".zwp__duration-container"),g=c.videoEl.duration;if(isNaN(g)||g===Infinity)d.style.display="none",c._config.isLive=
!0;else{d.style.display="block";d=d.querySelector(".zwp__duration");var m=parseInt(g/3600),h=parseInt(g%3600/60);g=parseInt(g%60);var u="";m>0&&(u+=m+":");u=h>=10?u+(h+":"):h>0?u+("0"+h+":"):u+"00:";d.innerHTML=g>=10?u+g:u+("0"+g);c.chapters&&setTimeout(function(){this.loadChapters()}.bind(c),1E3)}c.updateProgressBarType();c.syncUI()}}.bind(e);e.setProgressRail=function(c){var d=c!==void 0?c.target||c.detail.target:this.videoEl,g=null;d&&d.buffered&&d.buffered.length>0&&d.buffered.end&&this.videoEl.duration?
g=d.buffered.end(d.buffered.length-1)/this.videoEl.duration:d&&d.bytesTotal!==void 0&&d.bytesTotal>0&&d.bufferedBytes!==void 0?g=d.bufferedBytes/d.bytesTotal:c&&c.lengthComputable&&c.total!==0&&(g=c.loaded/c.total);g!==null&&(g=Math.min(1,Math.max(0,g)),this.progressBar&&this.progressBar.loaded&&(this.progressBar.loaded.style.width=g*100+"%"))}.bind(e);e.updateProgress=function(c){if(!this.isTrackingProgress&&this.progressBar&&this.progressBar.thumb){var d=this.videoEl.duration;!isNaN(d)&&d!==Infinity&&
d>0&&(c+.3>=d&&(c=d),c=c/d*100,this.progressBar.thumb.style.left=c+"%",this.progressBar.current&&(this.progressBar.current.style.width=c/100*100+"%"))}}.bind(e);e.seekTimeProgress=function(c){if(this.videoEl){var d=this.videoEl.duration;isNaN(d)||d===Infinity||(this.videoEl.currentTime=d*c/100,this.progressBar.current&&(this.progressBar.current.style.width=c+"%"))}}.bind(e);e.seekTimeProgressByTime=function(c){if(this.videoEl){var d=this.videoEl.duration;isNaN(d)||d===Infinity||(this.videoEl.currentTime=
c,this.progressBar.current&&(this.progressBar.current.style.width=c/d*100+"%"))}}.bind(e);e.on_speedItemclick=function(c){c.stopPropagation();c=c.currentTarget;if(!ea(c,"active")){var d=parseFloat(c.innerText),g=c.parentNode.querySelector(".active");g&&X(g,"active");aa(c,"active");this.videoEl&&(this.videoEl.playbackRate=d);if(g=this.controlbar.querySelector(".zwp-speedBtn"))g.innerHTML=d==1?H("speed","Rate"):c.innerText}(c=this.controlbar.querySelector(".zwp-speedButton"))&&X(c,"is-active")}.bind(e);
e.resetSpeedMenu=function(){if(this.controlbar){var c=this.controlbar.querySelector(".zwp-speed-item.active");if(c&&c.innerText!=="1.0x"){var d=this.controlbar.querySelector(".zwp-speedBtn");d&&(d.innerHTML=H("speed","Rate"));X(c,"active");c=c.parentNode.querySelectorAll("li.zwp-speed-item");if(c.length>0)for(d=0;d<c.length;d++)if(c[d].innerText==="1.0x"){aa(c[d],"active");break}}}}.bind(e);e.syncUI=function(){var c=this;if(c._config.isLive){var d=c.controlbar.querySelector(".zwp-speedButton");d&&
c.controlbar.removeChild(d);X(c.controlbar,"zwp-vodplayer")}else{if(c._config.speedButton&&(d=c.controlbar.querySelector(".zwp-speedButton"),!d)){var g=c.controlbar.querySelector(".zwp-infoButton")||c.controlbar.querySelector(".zwp-optionButton")||c.controlbar.querySelector(".zwp-volume-docker");if(g){var m=Hb();d=document.createElement("div");c.controlbar.insertBefore(d,g);d.outerHTML=m;if(d=c.controlbar.querySelector(".zwp-speedButton"))d.addEventListener("click",function(h){h.stopPropagation();
c.updateSpeedMenuMaxHeight&&c.updateSpeedMenuMaxHeight();ea(d,"is-active")?X(d,"is-active"):(c.closeAllMenus&&c.closeAllMenus(),aa(d,"is-active"))}),c.updateSpeedMenuMaxHeight&&c.updateSpeedMenuMaxHeight();g=c.controlbar.querySelectorAll(".zwp-speedMenu>li.zwp-speed-item");g.length>0&&g.forEach(function(h){h.addEventListener("click",e.on_speedItemclick)})}}aa(c.controlbar,"zwp-vodplayer")}}.bind(e);e.keyState={leftPressed:!1,rightPressed:!1,leftTimer:null,rightTimer:null,leftPressTime:0,rightPressTime:0,
originalPlaybackRate:1,isFastForward:!1,leftRewindInterval:null,wasPlayingBeforeRewind:!1,frozenFrameTime:0,rewindStartTime:0,isRewinding:!1,rewindCompleted:!1};e.onKeydown=function(c){if(c){var d=this,g=document.activeElement;if(!g||!g.classList.contains("barrage_inp_text")&&g.tagName!=="INPUT"&&g.tagName!=="TEXTAREA"&&g.contentEditable!=="true"||c.keyCode===27)if(c.keyCode===27){var m=!1;d.contextMenu?(d.hideContextMenu(),m=!0):d.volumeBoostPanel?((m=d.volumeBoostPanel.querySelector(".closeBtn"))?
m.click():(Ha(d.volumeBoostPanel,500,function(){d.volumeBoostPanel.remove()}),delete d.volumeBoostPanel),m=!0):d.colorSettingPanel?((m=d.colorSettingPanel.querySelector(".closeBtn"))?m.click():(Ha(d.colorSettingPanel,500,function(){d.colorSettingPanel.remove()}),delete d.colorSettingPanel),m=!0):d.recordingSettingsPanel?((m=d.recordingSettingsPanel.querySelector(".closeBtn"))?m.click():(Ha(d.recordingSettingsPanel,500,function(){d.recordingSettingsPanel.remove()}),delete d.recordingSettingsPanel),
m=!0):d.shortcutHelpPanel?((m=d.shortcutHelpPanel.querySelector(".closeBtn"))?m.click():(Ha(d.shortcutHelpPanel,500,function(){d.shortcutHelpPanel.remove()}),delete d.shortcutHelpPanel),m=!0):d.infoViewer?((m=d.infoViewer.querySelector(".closeBtn"))?m.click():(Ha(d.infoViewer,500,function(){d.infoViewer.remove();var h=function(u){u.preventDefault();u.stopPropagation();Ha(d.infoViewer,500,function(){d.infoViewer.remove()});d.overlay_layers.removeEventListener("click",h);delete d.infoViewer};d.overlay_layers.addEventListener("click",
h)}),delete d.infoViewer),m=!0):d.subtitleSearchPanel?((m=d.subtitleSearchPanel.querySelector(".closeBtn"))?m.click():(Ha(d.subtitleSearchPanel,500,function(){d.subtitleSearchPanel.remove()}),delete d.subtitleSearchPanel),m=!0):d.chapterSearchPanel&&((m=d.chapterSearchPanel.querySelector(".closeBtn"))?m.click():(Ha(d.chapterSearchPanel,500,function(){d.chapterSearchPanel.remove()}),delete d.chapterSearchPanel),m=!0);if(d.zoomEnabled&&d._config.zoomButton){d.zoomEnabled=!1;d.disableZoom();if(m=d.playerElm.querySelector(".zwp-zoomBtn"))X(m,
"zwp-active"),m.setAttribute("title",H("zoom","Zoom"));m=!0}if(m)c.stopPropagation(),c.preventDefault();else if(d.isFullscrWin&&d.controlbar){if(m=d.controlbar.querySelector(".zwp-fullscrWinBtn"))d.setFullscreenWin(!1,m),c.stopPropagation(),c.preventDefault()}else ab()&&(c.stopPropagation(),c.preventDefault(),d.playerElm&&ib(d.playerElm))}else if(c.keyCode===13)d.danmuToolbar&&(m=d.danmuToolbar.querySelector(".zwp_switch"))&&ea(m,"switch_on")&&(m=d.danmuToolbar.querySelector(".barrage_inp_text"))&&
(g=document.activeElement,g===m?(c=m.value.trim())&&d.sendDanmu(c)&&(m.value=""):(c.preventDefault(),m.focus()));else if(c.keyCode===38)c.preventDefault(),d.videoEl&&(c=d.videoEl.volume,c+=.05,c>1&&(c=1),d.setVolume(c),d.setMuted(!1),m=parseInt(c*100)+"%",m={icon:"speaker",text:m},d.toast(m,1200,!1),d.positionVolumeThumb&&d.positionVolumeThumb(c));else if(c.keyCode===40)c.preventDefault(),d.videoEl&&(c=d.videoEl.volume,c-=.05,c<0&&(c=0),d.setVolume(c),d.setMuted(c===0),m=parseInt(c*100)+"%",c===0&&
(m=H("muted","Muted")),m={icon:"speaker",text:m},d.toast(m,1200,!1),d.positionVolumeThumb&&d.positionVolumeThumb(c));else if(c.keyCode===32||c.keyCode===179)c.preventDefault(),d._config.disablePlayBtn||(d.playbtn?d.playbtn.click():d.controlbar&&(d.playbtn=d.controlbar.querySelector(".zwp-playbtn"),d.playbtn&&d.playbtn.click()));else if(c.keyCode===77||c.keyCode===109)d.videoEl&&(d.videoEl.muted?(d.toast(H("unmuted","Unmuted"),1E3,!1,!0),d.setMuted(!1)):(d.toast(H("muted","Muted"),1E3,!1,!0),d.setMuted(!0)));
else if(c.keyCode===68||c.keyCode===100){if(c.preventDefault(),d.danmuToolbar&&(m=d.danmuToolbar.querySelector(".zwp_switch")))m.click(),ea(m,"switch_on")?d.toast(H("danmuEnabled","Danmu Enabled"),1E3,!1,!0):d.toast(H("danmuDisabled","Danmu Disabled"),1E3,!1,!0)}else if(c.shiftKey&&c.keyCode===49)c.preventDefault(),d.videoEl&&(d.videoEl.playbackRate=1,d.toast(H("playbackSpeed1x","Playback Speed: 1x"),1E3,!1,!0));else if(c.shiftKey&&c.keyCode===50)c.preventDefault(),d.videoEl&&(d.videoEl.playbackRate=
2,d.toast(H("playbackSpeed2x","Playback Speed: 2x"),1E3,!1,!0));else if(c.keyCode===76||c.keyCode===108)c.preventDefault(),d.playerElm&&(ea(d.playerElm,"zwp-state-light-off")?d.lightOn():d.lightOff());else if(c.keyCode===48)c.preventDefault(),d._config.isLive||d._config.disablePlayBtn||!d.videoEl||d.videoEl.readyState<2||(d.videoEl.currentTime=d.segment&&d.segment.isActive&&d.segment.startTime!==void 0?d.segment.startTime:0,d.videoEl.play().then(function(){d.setplaystate(!0)}).catch(function(h){h.name===
"NotAllowedError"?d.toast(H("autoplayBlocked","Autoplay blocked by browser"),2E3,!1,!0):d.toast(H("playbackFailed","Playback failed")+": "+h.message,2E3,!1,!0)}));else if(c.keyCode===37)c.preventDefault(),!d.videoEl||d._config.isLive||d.videoEl.readyState<2||d.keyState.leftPressed||(c=0,d.segment&&d.segment.isActive&&d.segment.startTime!==void 0&&(c=d.segment.startTime),d.videoEl.currentTime<=c||(d.keyState.leftPressed=!0,d.keyState.leftPressTime=Date.now(),d.keyState.wasPlayingBeforeRewind=!0,d.seekVideo(-5),
d.keyState.leftTimer=setTimeout(function(){if(d.keyState.leftPressed){d.keyState.isRewinding=!0;d.keyState.frozenFrameTime=d.videoEl.currentTime;d.keyState.rewindStartTime=Date.now();d.videoEl.paused||d.videoEl.pause();d.bigPlayOverlay&&(d.bigPlayOverlay.style.display="none");var h=d.videoEl.duration||1;h=h>=3600?20:h>=1800?25:h>=600?30:80;d.timeSpan||(d.timeSpan=d.controlbar?d.controlbar.querySelector(".zwp__currenttime"):null);d.keyState.leftRewindInterval=setInterval(function(){if(d.keyState.leftPressed&&
d.videoEl){var u=d.videoEl.currentTime-5,G=0;d.segment&&d.segment.isActive&&d.segment.startTime!==void 0&&(G=d.segment.startTime);u<=G?(d.videoEl.currentTime=G,clearInterval(d.keyState.leftRewindInterval),clearTimeout(d.keyState.leftTimer),d.keyState.leftRewindInterval=null,d.keyState.leftTimer=null,d.videoEl.play().then(function(){d.setplaystate(!0)}).catch(function(O){}),d.keyState.frozenFrameTime=0,d.keyState.isRewinding=!1,d.keyState.rewindCompleted=!0):(d.videoEl.currentTime=u,d.updateProgress&&
d.updateProgress(u),d.timeSpan&&(d.timeSpan.innerHTML=ma(u)))}},h)}},300)));else if(c.keyCode===39)c.preventDefault(),!d.videoEl||d._config.isLive||d.videoEl.readyState<2||d.keyState.rightPressed||(c=d.videoEl.duration,d.segment&&d.segment.isActive&&d.segment.endTime!==void 0&&(c=d.segment.endTime),d.videoEl.currentTime>=c||(d.keyState.rightPressed=!0,d.keyState.rightPressTime=Date.now(),d.keyState.originalPlaybackRate=d.videoEl.playbackRate||1,d.keyState.maxBoundary=c,d.videoEl.paused&&(d.videoEl.play(),
d.setplaystate(!0)),d.keyState.rightTimer=setTimeout(function(){d.keyState.rightPressed&&(d.videoEl.playbackRate=3,d.keyState.isFastForward=!0)},300)));else if(c.keyCode===70||c.keyCode===102)c.preventDefault(),d.controlbar&&(c=d.controlbar.querySelector('[data-action="enterfullscreen"], [data-action="exitfullscreen"]'))&&c.click();else if(c.keyCode===82||c.keyCode===114)c.preventDefault(),d._config.recordButton&&(c=d.controlbar?d.controlbar.querySelector(".zwp-recordBtn"):null)&&c.click();else if(c.keyCode===
90||c.keyCode===122)c.preventDefault(),d._config.zoomButton&&(m=d.controlbar?d.controlbar.querySelector(".zwp-zoomBtn"):null)&&m.click()}}.bind(e);e.onKeyup=function(c){if(c){var d=this;if(c.keyCode===37)c.preventDefault(),d.keyState.leftPressed&&(d.keyState.leftPressed=!1,d.keyState.leftTimer&&(clearTimeout(d.keyState.leftTimer),d.keyState.leftTimer=null),d.keyState.leftRewindInterval&&(clearInterval(d.keyState.leftRewindInterval),d.keyState.leftRewindInterval=null),d.videoEl&&d.videoEl.play().then(function(){d.setplaystate(!0)}).catch(function(m){}),
d.keyState.frozenFrameTime=0,d.keyState.isRewinding=!1,d.keyState.rewindCompleted=!1);else if(c.keyCode===39&&(c.preventDefault(),d.keyState.rightPressed)){d.keyState.rightPressed=!1;d.keyState.rightTimer&&(clearTimeout(d.keyState.rightTimer),d.keyState.rightTimer=null);if(Date.now()-d.keyState.rightPressTime<300){c=d.videoEl.duration;d.segment&&d.segment.isActive&&d.segment.endTime!==void 0&&(c=d.segment.endTime);var g=d.videoEl.currentTime+5;if(g>c)g=c;else{d.seekVideo(5);return}d.videoEl.currentTime=
g;d.updateProgress&&d.updateProgress(g);d.timeSpan&&(d.timeSpan.innerHTML=ma(g))}d.keyState.isFastForward&&d.videoEl&&(d.videoEl.playbackRate=d.keyState.originalPlaybackRate,d.keyState.isFastForward=!1)}}}.bind(e);e.on_volumeBoostSliderChange=function(c){var d=c.currentTarget;c=d.getAttribute("data-action");this.volumeBoostConfig||(this.volumeBoostConfig={volumeBoost:0});fb(d);typeof this.volumeBoostConfig[c]!=="undefined"&&(d=parseFloat(d.value),this.volumeBoostConfig[c]=d,this.audioContext||this.initAudioContext(),
this.audioGainNode&&(this.audioGainNode.gain.value=Math.pow(10,d/20)))}.bind(e);e.on_colorSliderChange=function(c){var d=c.currentTarget;c=d.getAttribute("data-action");this.colors||(this.colors={brightness:0,contrast:0,saturation:0,hue:0});fb(d);if(typeof this.colors[c]!=="undefined"&&(d=parseInt(d.value),c==="hue"?this.colors.hue=parseInt(d*180/100):this.colors[c]=d,this.videoEl)){c=null;d=this.colors;d.brightness&&(c="brightness("+(100+d.brightness)+"%)");if(d.contrast){var g=100+d.contrast;c=
(c?c+" ":"")+("contrast("+g+"%)")}d.saturation&&(g=100+d.saturation,c=(c?c+" ":"")+("saturate("+g+"%)"));d.hue&&(d=d.hue,c=(c?c+" ":"")+("hue-rotate("+d+"deg)"));this.videoEl.style.filter=c}}.bind(e);e.createVolumeBoostPanel=function(){var c=this,d='<div class="zwp-volumeBoostPanel zwp-popupwindow"><button class="closeBtn"><i class="xicon xicon-close"></i></button><div class="form-row form-title">'+H("audioEffectAdjustment","Audio Effects")+'</div><div class="form-row"><label class="row-label">'+
H("volumeBoost","Volume Boost")+'</label><div class="row-content">'+bb("","volumeBoost",-12,12,.1,!0)+'</div></div><div class="form-row form-bottombar"><button class="zwp-form-button action-item" data-action="resetVolumeBoost">'+H("reset","Reset")+"</button></div></div>";c.overlay_layers.insertAdjacentHTML("beforeend",d);d=c.overlay_layers.querySelector(":scope > .zwp-volumeBoostPanel");var g=d.querySelector(".closeBtn");g&&g.addEventListener("click",function(m){m.stopPropagation();var h=m.currentTarget.closest(".zwp-volumeBoostPanel");
Ha(h,500,function(){h.remove()});delete c.volumeBoostPanel;c._lastClosedParentMenu&&(c._lastClosedParentMenu.style.display="",delete c._lastClosedParentMenu)});g=d.querySelectorAll('input[type="range"]');g.length>0&&g.forEach(function(m){m.addEventListener("input",e.on_volumeBoostSliderChange);if(c.volumeBoostConfig){var h=m.getAttribute("data-action");typeof c.volumeBoostConfig[h]!=="undefined"&&(m.value=c.volumeBoostConfig[h],fb(m))}});d.addEventListener("mousedown",function(m){m.stopPropagation()});
d.addEventListener("dblclick",function(m){m.stopPropagation()});d.addEventListener("click",function(m){m.stopPropagation()});(g=d.querySelector(".zwp-form-button"))&&g.addEventListener("click",function(m){m.preventDefault();m.stopPropagation();m=m.currentTarget.closest(".zwp-volumeBoostPanel").querySelectorAll('input[type="range"]');m.length>0&&m.forEach(function(h){parseFloat(h.value)!==0&&(h.value=0,z(h,"input"))});c.audioGainNode&&(c.audioGainNode.gain.value=1)});return c.volumeBoostPanel=d}.bind(e);
e.createColorSettingPanel=function(){var c=this,d='<div class="zwp-colorSettingPanel zwp-popupwindow"><button class="closeBtn"><i class="xicon xicon-close"></i></button><div class="form-row form-title">'+H("videoColorAdjustment","Video Color Adjustment")+'</div><div class="form-row"><label class="row-label">'+H("brightness","Brightness")+'</label><div class="row-content">'+bb("","brightness")+'</div></div><div class="form-row"><label class="row-label">'+H("contrast","Contrast")+'</label><div class="row-content">'+
bb("","contrast")+'</div></div><div class="form-row"><label class="row-label">'+H("saturation","Saturation")+'</label><div class="row-content">'+bb("","saturation")+'</div></div><div class="form-row"><label class="row-label">'+H("hue","Hue")+'</label><div class="row-content">'+bb("","hue")+'</div></div><div class="form-row form-bottombar"><button class="zwp-form-button action-item" data-action="resetcolors">'+H("reset","Reset")+"</button></div></div>";c.overlay_layers.insertAdjacentHTML("beforeend",
d);d=c.overlay_layers.querySelector(":scope > .zwp-colorSettingPanel");var g=d.querySelector(".closeBtn");g&&g.addEventListener("click",function(m){m.stopPropagation();var h=m.currentTarget.closest(".zwp-colorSettingPanel");Ha(h,500,function(){h.remove()});delete c.colorSettingPanel;c._lastClosedParentMenu&&(c._lastClosedParentMenu.style.display="",delete c._lastClosedParentMenu)});g=d.querySelectorAll('input[type="range"]');g.length>0&&g.forEach(function(m){m.addEventListener("input",e.on_colorSliderChange);
if(c.colors){var h=m.getAttribute("data-action");typeof c.colors[h]!=="undefined"&&(m.value=c.colors[h],fb(m))}});d.addEventListener("mousedown",function(m){m.stopPropagation()});d.addEventListener("dblclick",function(m){m.stopPropagation()});d.addEventListener("click",function(m){m.stopPropagation()});(g=d.querySelector(".zwp-form-button"))&&g.addEventListener("click",function(m){m.preventDefault();m.stopPropagation();m=m.currentTarget.closest(".zwp-colorSettingPanel").querySelectorAll('input[type="range"]');
m.length>0&&m.forEach(function(h){parseInt(h.value)!==0&&(h.value=0,z(h,"input"))})});return c.colorSettingPanel=d}.bind(e);e.createRecordingSettingsPanel=function(){var c=this,d='<div class="zwp-recordingSettingsPanel zwp-popupwindow"><button class="closeBtn"><i class="xicon xicon-close"></i></button><div class="form-row form-title">'+H("recordingSettingsTitle","Recording Settings")+'</div><div class="form-row"><div class="zwp-radio-group"><label class="zwp-radio-item"><input type="radio" name="recordingOption" value="ask" checked><span class="zwp-radio-label">'+
H("recordingOptionAsk","Ask Every Time")+'</span></label><label class="zwp-radio-item"><input type="radio" name="recordingOption" value="video"><span class="zwp-radio-label">'+H("recordingOptionVideo","Record Video Directly")+'</span></label><label class="zwp-radio-item"><input type="radio" name="recordingOption" value="audio"><span class="zwp-radio-label">'+H("recordingOptionAudio","Record Audio Directly")+'</span></label></div></div><div class="form-row recording-note"><div class="zwp-note-text">'+
H("recordingNote","Note: If no audio is present, video will be recorded directly")+"</div></div></div>";c.overlay_layers.insertAdjacentHTML("beforeend",d);d=c.overlay_layers.querySelector(":scope > .zwp-recordingSettingsPanel");var g=d.querySelector(".closeBtn");g&&g.addEventListener("click",function(m){m.stopPropagation();var h=m.currentTarget.closest(".zwp-recordingSettingsPanel");Ha(h,500,function(){h.remove()});delete c.recordingSettingsPanel;c._lastClosedParentMenu&&(c._lastClosedParentMenu.style.display=
"",delete c._lastClosedParentMenu)});if(g=d.querySelector('input[name="recordingOption"][value="'+(c.recordingSettings.mode||"ask")+'"]'))g.checked=!0;g=d.querySelectorAll('input[name="recordingOption"]');g.length>0&&g.forEach(function(m){m.addEventListener("change",function(h){c.recordingSettings.mode=h.target.value;c.updateRecordingMenuVisibility&&c.updateRecordingMenuVisibility()});m.value===c.recordingSettings.mode&&(m.checked=!0)});d.addEventListener("mousedown",function(m){m.stopPropagation()});
d.addEventListener("dblclick",function(m){m.stopPropagation()});d.addEventListener("click",function(m){m.stopPropagation()});return c.recordingSettingsPanel=d}.bind(e);e.createShortcutHelpPanel=function(){var c=this,d='<div class="zwp-shortcutHelpPanel zwp-popupwindow"><button class="closeBtn"><i class="xicon xicon-close"></i></button><div class="form-row form-title">'+H("keyboardShortcuts","Keyboard Shortcuts")+'</div><div class="zwp-list-inner"><div class="shortcut-item"><div class="shortcut-key">Space/MediaKey </div><div class="shortcut-desc">'+
H("shortcutPlayPause","Play / Pause")+'</div></div><div class="shortcut-item"><div class="shortcut-key">\u2192</div><div class="shortcut-desc">'+H("shortcutSeekRight","Single press: forward 5s, hold: speed playback")+'</div></div><div class="shortcut-item"><div class="shortcut-key">\u2190</div><div class="shortcut-desc">'+H("shortcutSeekLeft","Rewind 5s (hold for continuous operation)")+'</div></div><div class="shortcut-item"><div class="shortcut-key">\u2191 / \u2193</div><div class="shortcut-desc">'+
H("shortcutVolume","Increase / decrease volume by 5%")+'</div></div><div class="shortcut-item"><div class="shortcut-key">Esc</div><div class="shortcut-desc">'+H("shortcutExit","Close menu / Exit fullscreen")+'</div></div><div class="shortcut-item"><div class="shortcut-key">F</div><div class="shortcut-desc">'+H("shortcutFullscreen","Fullscreen / Exit fullscreen")+'</div></div><div class="shortcut-item"><div class="shortcut-key">Enter</div><div class="shortcut-desc">'+H("shortcutSendDanmu","Send Danmu")+
'</div></div><div class="shortcut-item"><div class="shortcut-key">D</div><div class="shortcut-desc">'+H("shortcutDanmu","Enable / Disable Danmu")+'</div></div><div class="shortcut-item"><div class="shortcut-key">M</div><div class="shortcut-desc">'+H("shortcutMute","Mute / Unmute")+'</div></div><div class="shortcut-item"><div class="shortcut-key">0</div><div class="shortcut-desc">'+H("shortcutRestart","Restart")+'</div></div><div class="shortcut-item"><div class="shortcut-key">R</div><div class="shortcut-desc">'+
H("shortcutRecord","Start / Stop Recording")+'</div></div><div class="shortcut-item"><div class="shortcut-key">L</div><div class="shortcut-desc">'+H("shortcutLight","Light Toggle")+'</div></div><div class="shortcut-item"><div class="shortcut-key">Shift + 1</div><div class="shortcut-desc">'+H("shortcutSpeed1x","1x Speed (Normal)")+'</div></div><div class="shortcut-item"><div class="shortcut-key">Shift + 2</div><div class="shortcut-desc">'+H("shortcutSpeed2x","2x Speed")+"</div></div></div></div>";
c.overlay_layers.insertAdjacentHTML("beforeend",d);d=c.overlay_layers.querySelector(":scope > .zwp-shortcutHelpPanel");var g=d.querySelector(".closeBtn");g&&g.addEventListener("click",function(h){h.stopPropagation();var u=h.currentTarget.closest(".zwp-shortcutHelpPanel");Ha(u,500,function(){u.remove()});delete c.shortcutHelpPanel});d.addEventListener("mousedown",function(h){h.stopPropagation()});d.addEventListener("dblclick",function(h){h.stopPropagation()});d.addEventListener("click",function(h){h.stopPropagation()});
g=d.querySelector(".zwp-list-inner");var m=$$(g);m.niceScroll({cursorborder:"",cursorcolor:"rgb(179 178 178 / 67%)",boxzoom:!1,rightdock:4});e.closeAllActivePanels();d.style.display="block";c.shortcutHelpPanel=d;m.focus();g.addEventListener("mouseenter",function(h){h.stopPropagation();this.focus()});return d}.bind(e);var Ka=function(c,d){if(c=c.querySelector(".zwp-optionPanel"))c=c.querySelectorAll(".zwp_switch"),c.length>0&&c.forEach(function(g){var m=g.getAttribute("data-action");d.indexOf(m)!==
-1&&ea(g,"switch_on")&&X(g,"switch_on")})};e.on_optionItemclick=function(c){c.stopPropagation();c=c.currentTarget;ea(c,"zwp_switch")&&gb(c);var d=c.getAttribute("data-action");if(d==="mirror")this.videoEl&&(c=ea(c,"switch_on"),this._config.video_mirror=c,this.flipMirrorVideo(),c&&(this._config.video_rotated=0,Ka(this.controlbar,["rotated270","rotated90"])));else if(d==="flip")this.videoEl&&(c=ea(c,"switch_on"),this._config.video_flip=c,this.flipMirrorVideo(),c&&(this._config.video_rotated=0,Ka(this.controlbar,
["rotated270","rotated90"])));else if(d==="rotated90")this.videoEl&&(c=ea(c,"switch_on"),this._config.video_rotated=c?90:0,this.rotateVideo(),c&&(this._config.video_mirror=!1,this._config.video_flip=!1,Ka(this.controlbar,["mirror","flip","rotated270"])));else if(d==="rotated270")this.videoEl&&(c=ea(c,"switch_on"),this._config.video_rotated=c?270:0,this.rotateVideo(),c&&(this._config.video_mirror=!1,this._config.video_flip=!1,Ka(this.controlbar,["mirror","flip","rotated90"])));else if(d==="loop")c=
ea(c,"switch_on"),this._config.loop=c;else if(d==="showRecordingConfig"){if(c=c.closest(".zwp-optionPanel"))if(d=c.closest(".zwp-optionButton")){var g=this.overlay_layers.querySelector(":scope > .zwp-recordingSettingsPanel");if(!g&&(g=this.createRecordingSettingsPanel(),!g))return;this.closeAllActivePanels();g.style.display="block";c.style.display="none";this._lastClosedParentMenu=c;X(d,"is-active")}}else if(d==="showVolumeBoostConfig"){if(!this.isMobile()&&(c=c.closest(".zwp-optionPanel"))&&(d=c.closest(".zwp-optionButton"))){g=
this.overlay_layers.querySelector(":scope > .zwp-volumeBoostPanel");if(!g&&(g=this.createVolumeBoostPanel(),!g))return;this.closeAllActivePanels();g.style.display="block";c.style.display="none";this._lastClosedParentMenu=c;X(d,"is-active")}}else if(d==="showColorConfig"&&(c=c.closest(".zwp-optionPanel"))&&(d=c.closest(".zwp-optionButton"))){g=this.overlay_layers.querySelector(":scope > .zwp-colorSettingPanel");if(!g&&(g=this.createColorSettingPanel(),!g))return;this.closeAllActivePanels();g.style.display=
"block";c.style.display="none";this._lastClosedParentMenu=c;X(d,"is-active")}}.bind(e);e.flipMirrorVideo=function(){var c=null;this._config.video_flip&&(c="rotateX(180.00deg)");this._config.video_mirror&&(c=c?c+" rotateY(180.00deg)":" rotateY(180.00deg)");this.videoEl.style.width="100%";this.videoEl.style.height="100%";this.videoEl.style.transform=c}.bind(e);e.rotateVideo=function(){var c=null,d=this.videoEl.parentNode;if(d&&d===this.videoWrapper)if(this._config.video_rotated){var g=d.offsetHeight;
d=d.offsetWidth;var m=this.videoEl.videoHeight;this.videoEl.videoWidth&&m&&(this.videoEl.style.width=g+"px",this.videoEl.style.height=d+"px",this.videoEl.style.transformOrigin="center center",m=(d-g)/2,g=(g-d)/2,this._config.video_rotated===90?c="translate("+m+"px, "+g+"px) rotate(0.25turn)":this._config.video_rotated===270&&(c="translate("+m+"px, "+g+"px) rotate(0.75turn)"),this.videoEl.style.transform=c)}else this.videoEl.style.transform&&(this.videoEl.style.transform=null,this.videoEl.style.width=
"100%",this.videoEl.style.height="100%")}.bind(e);e.setupEventsHandler=function(){var c=this,d=function(u){c.loadingOverlay&&(c.loadingOverlay.style.display="none");c.videoEl.play();c.setplaystate(!0);c.updateDuration(c);c._config.isLive&&c.controlbar&&(c.controlbar.querySelector(".zwp__duration-container").style.display="none");c._config.fluid&&(c.isMobile&&c.isMobile()?ja(c):(u=c.videoEl,aa(c.playerElm,"zwp-fluid"),c.playerElm.style.maxWidth="100%",c.playerElm.style.width="100%",c.playerElm.style.height=
"0",u.videoHeight&&u.videoWidth?(u=ua(c._config),c.playerElm.style.paddingTop=u+"%"):c.playerElm.style.paddingTop=c._config.keepAudioWindow?"264px":"64px"));c.buildProgressBar()};c.videoEl.addEventListener("loadedmetadata",d);var g=c.videoEl,m=function(u){var G=!0;u.type==="ended"?!c._config.isLive&&c._config.loop?(L.setTimeout(function(){c.videoEl.currentTime=0;c.videoEl.play()},1E3),G=!1):(c.isEnded=!0,c.setplaystate(!1),c._config.isLive&&c._config.reconnect&&c.mpegtsPlayer&&(setTimeout(function(){c.lastDecodedFrames=
0;c.closecall(c);c.openMpegts()},1E3),G=!1)):u.type==="play"?(delete c.isEnded,typeof c.postSeekTime!=="undefined"&&(c.seekTimeProgressByTime(c.postSeekTime),delete c.postSeekTime)):u.type==="pause"?c.setplaystate(!1):u.type==="playing"&&c.setplaystate(!0);c.progressBar&&c.progressBar.buffering&&("play playing pause seeked ended error".split(" ").includes(u.type)?c.progressBar.buffering.style.display="none":["seeking","waiting","loadeddata"].includes(u.type)&&(c.progressBar.buffering.style.display=
""));G&&typeof c._config.onmediaevent==="function"&&c._config.onmediaevent.call(c,u)},h=function(u){var G=this.currentTime;typeof c.postSeekTime!=="undefined"&&(G=c.postSeekTime);c.segment.isActive&&!c.segment.isDragging&&G>=c.segment.endTime&&(c.keyState&&c.keyState.isFastForward?(this.currentTime=c.segment.endTime,c.videoEl.playbackRate=c.keyState.originalPlaybackRate||1,c.keyState.isFastForward=!1,c.keyState.rightPressed=!1):this.currentTime=c.segment.startTime);if(typeof c._config.ontimeupdate===
"function")c._config.ontimeupdate(G);!c.timeSpan&&c.controlbar&&(c.timeSpan=c.controlbar.querySelector(".zwp__currenttime"));c.timeSpan&&(c.timeSpan.innerHTML=ma(G));c.updateProgress(G);c.setProgressRail(u);c.renderSubtitles(G)};g.addEventListener("play",m);g.addEventListener("playing",m);g.addEventListener("pause",m);g.addEventListener("seeked",m);g.addEventListener("ended",m);g.addEventListener("error",m);g.addEventListener("seeking",m);g.addEventListener("waiting",m);g.addEventListener("timeupdate",
h);c.keyboardEventsInitialized?c._config.localPlayback&&(document.removeEventListener("keydown",c.onKeydown),document.removeEventListener("keyup",c.onKeyup),document.addEventListener("keydown",c.onKeydown),document.addEventListener("keyup",c.onKeyup)):(document.addEventListener("keydown",c.onKeydown),document.addEventListener("keyup",c.onKeyup),c.keyboardEventsInitialized=!0);e.videoEventsSetuped=!0;e.removeVideoEventHandlers=function(){if(this.videoEventsSetuped){var u=this.videoEl;u.removeEventListener("loadedmetadata",
d);u.removeEventListener("play",m);u.removeEventListener("playing",m);u.removeEventListener("pause",m);u.removeEventListener("seeked",m);u.removeEventListener("ended",m);u.removeEventListener("error",m);u.removeEventListener("seeking",m);u.removeEventListener("waiting",m);u.removeEventListener("timeupdate",h);document.removeEventListener("keydown",this.onKeydown);document.removeEventListener("keyup",this.onKeyup);this.keyState&&(this.keyState.leftTimer&&clearTimeout(this.keyState.leftTimer),this.keyState.rightTimer&&
clearTimeout(this.keyState.rightTimer),this.keyState.leftRewindInterval&&clearInterval(this.keyState.leftRewindInterval));delete this.videoEventsSetuped}}}.bind(e);e.showMediainfo=function(c){var d=this;if(d.overlay_layers){d.closeAllActivePanels();var g=d.overlay_layers.querySelector(".zwp__mediainfo-viewer");if(g){if(!c){c=g.querySelector(".closeBtn");var m=document.createEvent("Event");m.initEvent("click",!0,!0);c.dispatchEvent(m)}}else{c='<button class="closeBtn"><i class="xicon xicon-close"></i></button><div class="form-row form-title">'+
(H("media-prop","Media properties")+"</div>");d.mediaInfo?(m=d.mediaInfo,m.hasVideo&&(c+='<div class="info-item"><span class="info-label">Video</span><span class="info-value">'+m.vCodec+"</span></div>",c+='<div class="info-item"><span class="info-label">Width</span><span class="info-value">'+m.width+"</span></div>",c+='<div class="info-item"><span class="info-label">Height</span><span class="info-value">'+m.height+"</span></div>",c+='<div class="info-item"><span class="info-label">FPS</span><span class="info-value">'+
m.fps+"</span></div>",c+='<div class="info-item"><span class="info-label">Profile</span><span class="info-value">'+m.profile+"</span></div>",c+='<div class="info-item"><span class="info-label">Level</span><span class="info-value">'+m.level+"</span></div>"),m.hasAudio&&(c+='<div class="info-item"><span class="info-label">Audio</span><span class="info-value">'+m.aCodec+"</span></div>",c+='<div class="info-item"><span class="info-label">SampRate</span><span class="info-value">'+m.sampleRate+"</span></div>",
c+='<div class="info-item"><span class="info-label">Channel</span><span class="info-value">'+m.channels+"</span></div>")):d.videoEl?(m=d.videoEl,m.videoWidth&&(c+='<div class="info-item"><span class="info-label">Width</span><span class="info-value">'+m.videoWidth+"</span></div>",c+='<div class="info-item"><span class="info-label">Height</span><span class="info-value">'+m.videoHeight+"</span></div>"),m.duration&&(c+='<div class="info-item"><span class="info-label">Duration</span><span class="info-value">'+
ma(m.duration)+"</span></div>")):c+='<div class="info-item"><div class="row-text">No More Media Info</div></div>';g=document.createElement("div");g.setAttribute("class","zwp__mediainfo-viewer zwp-popupwindow");g.innerHTML=c;d.overlay_layers.appendChild(g);g.addEventListener("click",function(u){u.stopPropagation()});var h=function(u){u.preventDefault();u.stopPropagation();Ha(g,500,function(){g.remove()});d.overlay_layers.removeEventListener("click",h);delete d.infoViewer};c=g.querySelector(".closeBtn");
c.addEventListener("click",h);d.infoViewer=g}}}.bind(e);e.createSubtitleSearchPanel=function(){function c(){var da=Z.value.trim(),za=O.searchSubtitles(da);g(za,da)}function d(da,za){if(!za)return m(da);za=za.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");za=new RegExp("("+za+")","gi");return m(da).replace(za,'<span class="search-highlight">$1</span>')}function g(da,za){var Ra=document.createDocumentFragment();da.length===0?(da=document.createElement("div"),da.className="zwp-no-results",da.textContent=za?H("noSearchResults",
"No matching subtitles found"):H("noSubtitlesLoaded","No subtitles loaded"),Ra.appendChild(da)):da.forEach(function(Na){var Oa=document.createElement("div");Oa.className="zwp-search-result-item";var Sa=document.createElement("div");Sa.className="result-time";Sa.textContent=ma(Na.from)+" \u2192 "+ma(Na.to);var Va=document.createElement("div");Va.className="result-text";Va.innerHTML=d(Na.content,za);Oa.appendChild(Sa);Oa.appendChild(Va);(function(hb){Oa.addEventListener("click",function(Ma){Ma.stopPropagation();
Ma=hb.from;typeof O.seekTimeProgressByTime==="function"?O.seekTimeProgressByTime(Ma):O.videoEl&&(O.videoEl.currentTime=Ma,O.updateProgress&&O.updateProgress(Ma),O.timeSpan&&(O.timeSpan.innerHTML=ma(Ma)))})})(Na);Ra.appendChild(Oa)});Ba.innerHTML="";Ba.appendChild(Ra);da=K.querySelector(".zwp-list-inner");(da=$$(da).getNiceScroll())&&da.length>0&&da[0].resize()}function m(da){var za=document.createElement("div");za.textContent=da;return za.innerHTML}function h(da){da.type==="touchstart"?(na=da.touches[0].clientX-
Aa,qa=da.touches[0].clientY-Ia):(na=da.clientX-Aa,qa=da.clientY-Ia);if(da.target===Wa||Wa.contains(da.target))Ea=!0,aa(K,"dragging")}function u(da){na=La;qa=ha;Ea=!1;X(K,"dragging")}function G(da){Ea&&(da.preventDefault(),da.type==="touchmove"?(La=da.touches[0].clientX-na,ha=da.touches[0].clientY-qa):(La=da.clientX-na,ha=da.clientY-qa),Aa=La,Ia=ha,K.style.transform=`translate(calc(-50% + ${La}px), calc(-50% + ${ha}px))`)}var O=this,N='<div class="zwp-subtitleSearchPanel zwp-popupwindow"><button class="closeBtn"><i class="xicon xicon-close"></i></button><div class="form-row form-title">'+
H("subtitleSearchTitle","Subtitle Search")+'</div><div class="form-row"><div class="zwp-search-input-wrapper"><input type="text" class="zwp-search-input" placeholder="'+H("inputSearchKeyword","Enter search keyword")+'" /><button class="zwp-search-clear-btn">\u00d7</button></div></div><div class="form-row"><div class="zwp-list-inner"><div class="zwp-search-results-list"></div></div></div></div>';O.overlay_layers.insertAdjacentHTML("beforeend",N);var K=O.overlay_layers.querySelector(":scope > .zwp-subtitleSearchPanel");
N=O.playerElm.offsetHeight;K.style.maxWidth=O.playerElm.offsetWidth-80+"px";N=Math.min(.8*N-60,1.2*N-104);N=Math.min(N,500);N=Math.max(N,140);K.style.maxHeight=N+"px";K.querySelector(".closeBtn").addEventListener("click",function(da){da.stopPropagation();var za=da.currentTarget.closest(".zwp-subtitleSearchPanel");Ha(za,500,function(){za.remove()});delete O.subtitleSearchPanel;O._lastClosedParentMenu&&(O._lastClosedParentMenu.style.display="",delete O._lastClosedParentMenu)});var Z=K.querySelector(".zwp-search-input"),
fa=K.querySelector(".zwp-search-clear-btn"),Ba=K.querySelector(".zwp-search-results-list"),Pa=function(da,za){var Ra;return function(){var Na=this,Oa=arguments;clearTimeout(Ra);Ra=setTimeout(function(){da.apply(Na,Oa)},za)}}(c,100);Z.addEventListener("input",Pa);Z.addEventListener("keypress",function(da){da.key==="Enter"&&c()});fa.addEventListener("click",function(da){da.stopPropagation();Z.value="";Z.focus();c()});c();K.addEventListener("mousedown",function(da){da.stopPropagation()});K.addEventListener("dblclick",
function(da){da.stopPropagation()});K.addEventListener("click",function(da){da.stopPropagation()});var Ea=!1,La,ha,na,qa,Aa=0,Ia=0,Wa=K.querySelector(".form-row.form-title");Wa.addEventListener("mousedown",h);document.addEventListener("mouseup",u);document.addEventListener("mousemove",G);Wa.addEventListener("touchstart",h,{passive:!1});document.addEventListener("touchend",u);document.addEventListener("touchmove",G,{passive:!1});fa=K.querySelector(".zwp-list-inner");fa.style.maxHeight=Math.max(N-84,
60)+"px";N=$$(fa);N.niceScroll({cursorborder:"",cursorcolor:"rgb(179 178 178 / 67%)",boxzoom:!1,rightdock:4});N.focus();fa.addEventListener("mouseenter",function(da){da.stopPropagation();this.focus()});return O.subtitleSearchPanel=K}.bind(e);e.searchSubtitles=function(c){var d=[];if(!this.subtitles)return d;var g=!0,m=!0,h=this.controlbar?this.controlbar.querySelector(".zwp-subtitleMenu"):null;if(h){var u=h.querySelector('[data-action="toggleSearchSubtitle1"]');h=h.querySelector('[data-action="toggleSearchSubtitle2"]');
u&&(g=u.checked);h&&(m=h.checked)}g&&this.subtitles[1]&&this.subtitles[1].body&&this.subtitles[1].body.forEach(function(G){(!c||G.content&&G.content.toLowerCase().indexOf(c.toLowerCase())!==-1)&&d.push({content:G.content,from:G.from,to:G.to,position:"1"})});m&&this.subtitles[2]&&this.subtitles[2].body&&this.subtitles[2].body.forEach(function(G){(!c||G.content&&G.content.toLowerCase().indexOf(c.toLowerCase())!==-1)&&d.push({content:G.content,from:G.from,to:G.to,position:"2"})});d.sort(function(G,O){return G.from-
O.from});return d}.bind(e);e.searchChapters=function(c){var d=[];if(!this.chapters||!Array.isArray(this.chapters)||this.chapters.length===0)return d;this.chapters.forEach(function(g){var m=g.title||g.text||"",h=g.desc||"",u=c?c.toLowerCase():"";(!c||m&&m.toLowerCase().indexOf(u)!==-1||h&&h.toLowerCase().indexOf(u)!==-1)&&d.push({title:m,desc:h,time:g.time})});d.sort(function(g,m){g=typeof g.time==="string"?$a(g.time):g.time;m=typeof m.time==="string"?$a(m.time):m.time;return g-m});return d}.bind(e);
e.createChapterSearchPanel=function(){function c(){var da=Z.value.trim(),za=O.searchChapters(da);g(za,da)}function d(da,za){if(!za)return m(da);za=za.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");za=new RegExp("("+za+")","gi");return m(da).replace(za,'<span class="search-highlight">$1</span>')}function g(da,za){var Ra=document.createDocumentFragment();da.length===0?(da=document.createElement("div"),da.className="zwp-no-results",da.textContent=za?H("noChapterSearchResults","No matching chapters found"):H("noChaptersLoaded",
"No chapters loaded"),Ra.appendChild(da)):da.forEach(function(Na){var Oa=document.createElement("div");Oa.className="zwp-search-result-item";var Sa=document.createElement("div");Sa.className="result-time";var Va=typeof Na.time==="string"?$a(Na.time):Na.time;Sa.textContent=ma(Va);Va=document.createElement("div");Va.className="result-text";Va.innerHTML=d(Na.title,za);Oa.appendChild(Sa);Oa.appendChild(Va);Na.desc&&(Sa=document.createElement("div"),Sa.className="result-desc",Sa.innerHTML=d(Na.desc,za),
Oa.appendChild(Sa));(function(hb){Oa.addEventListener("click",function(Ma){Ma.stopPropagation();Ma=hb.time;Ma=typeof Ma==="string"?$a(Ma):Ma;typeof O.seekTimeProgressByTime==="function"?O.seekTimeProgressByTime(Ma):O.videoEl&&(O.videoEl.currentTime=Ma,O.updateProgress&&O.updateProgress(Ma),O.timeSpan&&(O.timeSpan.innerHTML=ma(Ma)))})})(Na);Ra.appendChild(Oa)});Ba.innerHTML="";Ba.appendChild(Ra);da=K.querySelector(".zwp-list-inner");(da=$$(da).getNiceScroll())&&da.length>0&&da[0].resize()}function m(da){var za=
document.createElement("div");za.textContent=da;return za.innerHTML}function h(da){da.type==="touchstart"?(na=da.touches[0].clientX-Aa,qa=da.touches[0].clientY-Ia):(na=da.clientX-Aa,qa=da.clientY-Ia);if(da.target===Wa||Wa.contains(da.target))Ea=!0,aa(K,"dragging")}function u(da){na=La;qa=ha;Ea=!1;X(K,"dragging")}function G(da){Ea&&(da.preventDefault(),da.type==="touchmove"?(La=da.touches[0].clientX-na,ha=da.touches[0].clientY-qa):(La=da.clientX-na,ha=da.clientY-qa),Aa=La,Ia=ha,K.style.transform=`translate(calc(-50% + ${La}px), calc(-50% + ${ha}px))`)}
var O=this,N='<div class="zwp-chapterSearchPanel zwp-popupwindow"><button class="closeBtn"><i class="xicon xicon-close"></i></button><div class="form-row form-title">'+H("chapterSearchTitle","Chapter Search")+'</div><div class="form-row"><div class="zwp-search-input-wrapper"><input type="text" class="zwp-search-input" placeholder="'+H("inputSearchKeyword","Enter search keyword")+'" /><button class="zwp-search-clear-btn">\u00d7</button></div></div><div class="form-row"><div class="zwp-list-inner"><div class="zwp-search-results-list"></div></div></div></div>';
O.overlay_layers.insertAdjacentHTML("beforeend",N);var K=O.overlay_layers.querySelector(":scope > .zwp-chapterSearchPanel");N=O.playerElm.offsetHeight;K.style.maxWidth=O.playerElm.offsetWidth-80+"px";N=Math.min(.8*N-40,1.2*N-104);N=Math.min(N,500);N=Math.max(N,140);K.style.maxHeight=N+"px";K.querySelector(".closeBtn").addEventListener("click",function(da){da.stopPropagation();var za=da.currentTarget.closest(".zwp-chapterSearchPanel");Ha(za,500,function(){za.remove()});delete O.chapterSearchPanel});
var Z=K.querySelector(".zwp-search-input"),fa=K.querySelector(".zwp-search-clear-btn"),Ba=K.querySelector(".zwp-search-results-list"),Pa=function(da,za){var Ra;return function(){var Na=this,Oa=arguments;clearTimeout(Ra);Ra=setTimeout(function(){da.apply(Na,Oa)},za)}}(c,100);Z.addEventListener("input",Pa);Z.addEventListener("keypress",function(da){da.key==="Enter"&&c()});fa.addEventListener("click",function(da){da.stopPropagation();Z.value="";Z.focus();c()});c();K.addEventListener("mousedown",function(da){da.stopPropagation()});
K.addEventListener("dblclick",function(da){da.stopPropagation()});K.addEventListener("click",function(da){da.stopPropagation()});var Ea=!1,La,ha,na,qa,Aa=0,Ia=0,Wa=K.querySelector(".form-row.form-title");Wa.addEventListener("mousedown",h);document.addEventListener("mouseup",u);document.addEventListener("mousemove",G);Wa.addEventListener("touchstart",h,{passive:!1});document.addEventListener("touchend",u);document.addEventListener("touchmove",G,{passive:!1});fa=K.querySelector(".zwp-list-inner");fa.style.maxHeight=
Math.max(N-84,60)+"px";N=$$(fa);N.niceScroll({cursorborder:"",cursorcolor:"rgb(179 178 178 / 67%)",boxzoom:!1,rightdock:4});N.focus();fa.addEventListener("mouseenter",function(da){da.stopPropagation();this.focus()});return O.chapterSearchPanel=K}.bind(e);e.setMediainfo=function(c,d){c={engine:c,hasVideo:d.hasVideo,hasAudio:d.hasAudio};if(d.hasVideo){var g=d.videoCodec;g=g.indexOf("avc1")>=0?"H264/AVC":g.indexOf("hvc")>=0?"H265/HEVC":"Unknown";c.vCodec=g;c.width=d.width;c.height=d.height;c.fps=d.fps;
typeof c.fps==="number"&&(c.fps=c.fps.toFixed(2));c.profile=d.profile;c.level=d.level}d.hasAudio&&(g=d.audioCodec,g=g.indexOf("mp4a.40.2")>=0?"AAC-LC":g.indexOf("mp4a.40.5")>=0?"HE-AAC":g.indexOf("mp3")>=0?"MP3":"Unknown",c.aCodec=g,c.sampleRate=d.audioSampleRate,c.channels=d.audioChannelCount);this.mediaInfo=c}.bind(e);e.processChapterContent=function(c,d){d=d||{};var g=null,m=e.detectContentFormat(c);if(m==="vtt"){if(c=mb(c)){g=[];for(var h=0;h<c.body.length;h++){var u=c.body[h];g.push({title:u.content,
time:ma(u.from),desc:"no desc",image:null})}}}else if(m==="json")try{g=JSON.parse(c)}catch(G){g=null}if(!g||!Array.isArray(g))return typeof this._config.onChapterError==="function"&&this._config.onChapterError.call(this,{title:d.title||"Unknown",url:d.url||"",error:"Invalid chapter file format",errorCode:"INVALID_FORMAT",source:d.source||"unknown",timestamp:(new Date).toISOString()}),d.source==="local"&&this.toast(H("invalidChapterFormat","Invalid chapter file format"),3E3,!0),!1;typeof this._config.onChapterLoaded===
"function"&&this._config.onChapterLoaded.call(this,{url:d.url||"",title:d.title||"",format:m});this.chapters=g;this.loadChapters();return!0};e.loadChapters=function(){var c=this;if(c.chapters)if(typeof c.chapters==="object"&&c.chapters instanceof File)c.detectMimeType(c.chapters).then(function(h){return c.isValidChapterFile(c.chapters,h).then(function(u){return u?!0:(c.toast(H("unsupportedChapterFormat","Unsupported chapter format")+": "+h,3E3,!0),!1)})}).then(function(h){h&&(h=new FileReader,h.onload=
function(u){c.processChapterContent(u.target.result,{url:URL.createObjectURL(c.chapters),title:c.chapters.name,source:"local"})},h.onerror=function(){var u={fileName:c.chapters.name,error:"Failed to read chapter file",errorCode:"READ_ERROR",source:"local",timestamp:(new Date).toISOString()};typeof c._config.onChapterError==="function"&&c._config.onChapterError.call(c,u);c.toast(H("failedToReadChapter","Failed to read chapter file"),3E3,!0)},h.readAsText(c.chapters))}).catch(function(h){h={fileName:c.chapters.name,
error:"Chapter file validation failed",errorCode:"VALIDATION_FAILED",details:h.message||h,source:"local",timestamp:(new Date).toISOString()};typeof c._config.onChapterError==="function"&&c._config.onChapterError.call(c,h);c.toast(H("chapterValidationFailed","Chapter file validation failed"),3E3,!0)});else if(typeof c.chapters==="string")c.chapters.substr(0,4)==="http"||c.chapters.substr(0,5)==="blob:"?lb(c.chapters,function(h){c.processChapterContent(h,{url:c.chapters,title:c.chapters,source:c.chapters.substr(0,
4)==="http"?"http":"blob"})},function(h){typeof c._config.onChapterError==="function"&&c._config.onChapterError.call(c,{title:c.chapters,url:c.chapters,error:"Failed to fetch chapter file",errorCode:"FETCH_ERROR",source:c.chapters.substr(0,4)==="http"?"http":"blob",timestamp:(new Date).toISOString(),xhr:h})}):c.detectContentFormat(c.chapters)!=="unknown"?c.processChapterContent(c.chapters,{url:"",title:"Direct Chapter Content",source:"direct"}):delete c.chapters;else if(Array.isArray(c.chapters)){var d=
c.videoEl.duration;if(!isNaN(d)&&d!==Infinity){if(d=Kb(d,c.chapters)){var g=c.controlbar.querySelector(".zwp__time-chapter");g&&(g.innerHTML=d,d=g.querySelectorAll(".zwp__chapter_dot"),d.length>0&&d.forEach(function(h){h.addEventListener("mousedown",function(u){u.stopPropagation();u=$a(this.getAttribute("data-time"));c.seekTimeProgressByTime(u)})}))}if(c._config.chapterButton&&(d=c.controlbar.querySelector(".zwp__time-info"))&&((g=d.querySelector(".zwp-chapterButton"))&&g.remove(),g=Lb(c.chapters))){var m=
d.querySelector(".zwp_danmuBarDock");m?m.insertAdjacentHTML("beforebegin",g.html):d.insertAdjacentHTML("beforeend",g.html);g=d.querySelector(".zwp-chapterButton");g.querySelector(".zwp-chapterBtn").addEventListener("click",function(h){h.stopPropagation();var u=c.overlay_layers.querySelector(":scope > .zwp-chapterSearchPanel");if(u)Ha(u,500,function(){u.remove()}),delete c.chapterSearchPanel;else if(c.closeAllActivePanels(),u=c.createChapterSearchPanel())u.style.display="block",(h=u.querySelector(".zwp-search-input"))&&
!c.isMobile()&&h.focus()})}}}}.bind(e);e.removeChapters=function(){if(this.chapters){if(this.controlbar){var c=this.controlbar.querySelector(".zwp__time-chapter");c&&(c.innerHTML="")}(c=this.controlbar.querySelector(".zwp__time-info"))&&(c=c.querySelector(".zwp-chapterButton"))&&c.remove();this._closePanel("chapterSearchPanel");delete this.chapters}}.bind(e);e.doSnapshot=function(){if(this.videoEl&&this.videoEl.videoWidth){if(!this.snapCanvas&&(this.snapCanvas=document.createElement("canvas"),!this.snapCanvas))return;
var c=this.videoEl,d=this.snapCanvas;d.width=this.videoEl.videoWidth;d.height=this.videoEl.videoHeight;var g=d.getContext("2d");g.fillStyle="#000000";g.beginPath();g.fillRect(0,0,c.videoWidth,c.videoHeight);g.closePath();g.drawImage(c,0,0,c.videoWidth,c.videoHeight);if(typeof d.toBlob=="function"){var m="SNAP-"+Bb();try{d.toBlob(function(h){const u=document.createElement("a");u.download=`${m}.jpg`;u.href=URL.createObjectURL(h);u.click();Ab(h)},"image/jpg",.99)}catch(h){}}}}.bind(e);e.togglePictureInPicture=
function(){var c=this;if(c.videoEl)if(document.pictureInPictureElement)document.exitPictureInPicture();else{var d=c.videoEl;c.smallWindowMode||(d.bindPicInPicEvent||(d.addEventListener("enterpictureinpicture",function(g){aa(c.playerElm,"zwp-picInPic");c.overlay_layers.insertAdjacentHTML("beforeEnd",Ob);(g=c.overlay_layers.querySelector(".zwp-pipExitButton"))&&g.addEventListener("click",function(m){m.stopPropagation();document.pictureInPictureElement&&document.exitPictureInPicture()});c.isInPicInPic=
!0}),d.addEventListener("leavepictureinpicture",function(){X(c.playerElm,"zwp-picInPic");var g=c.overlay_layers.querySelector(".zwp-pipPlaceHolder");g&&c.overlay_layers.removeChild(g);setTimeout(function(){},500);delete c.isInPicInPic}),d.bindPicInPicEvent=!0),d.requestPictureInPicture())}}.bind(e);e.zoomEnabled=!1;e.zoomLens=null;e.zoomCanvas=null;e.zoomCtx=null;e.zoomSize=200;e.zoomLevel=2;e.zoomRafId=null;e.zoomRenderLoopId=null;e.zoomRenderLoopRunning=!1;e.zoomCurrentMouseEvent=null;e.zoomLastMouseX=
null;e.zoomLastMouseY=null;e.zoomGlobalMouseHandler=function(c){this.zoomLastMouseX=c.clientX;this.zoomLastMouseY=c.clientY}.bind(e);document.addEventListener("mousemove",e.zoomGlobalMouseHandler);e.toggleZoom=function(){if(this.videoEl){(this.zoomEnabled=!this.zoomEnabled)?this.enableZoom():this.disableZoom();var c=this.playerElm.querySelector(".zwp-zoomBtn");c&&(this.zoomEnabled?(aa(c,"zwp-active"),c.setAttribute("title",H("disableZoom","Disable Zoom"))):(X(c,"zwp-active"),c.setAttribute("title",
H("zoom","Zoom"))))}}.bind(e);e.enableZoom=function(){var c=this;c.zoomLens||(c.zoomLens=document.createElement("div"),c.zoomLens.className="zwp-zoom-lens",c.zoomLens.style.display="none",c.playerElm.appendChild(c.zoomLens),c.zoomCanvas=document.createElement("canvas"),c.zoomCanvas.width=c.zoomSize,c.zoomCanvas.height=c.zoomSize,c.zoomCtx=c.zoomCanvas.getContext("2d"),c.zoomLens.appendChild(c.zoomCanvas));c.zoomCurrentMouseEvent=null;c.zoomMousemoveHandler=function(u){c.zoomEnabled&&(c.zoomCurrentMouseEvent=
u,c.updateZoom(u))}.bind(c);c.zoomMouseenterHandler=function(u){c.zoomEnabled&&c.zoomLens&&(c.zoomLens.style.display="block",c.zoomCurrentMouseEvent=u,c.startZoomRenderLoop())}.bind(c);c.zoomMouseleaveHandler=function(){c.zoomLens&&(c.zoomLens.style.display="none");c.zoomCurrentMouseEvent=null;c.stopZoomRenderLoop()}.bind(c);c.zoomWheelHandler=function(u){if(c.zoomEnabled){u.preventDefault();u.stopPropagation();var G=[1.5,2,2.5,3,3.5,4],O=c.zoomLevel,N=G.indexOf(O);N===-1&&(N=G.reduce(function(K,
Z,fa,Ba){return Math.abs(Z-O)<Math.abs(Ba[K]-O)?fa:K},0));u.deltaY<0?N<G.length-1&&(c.zoomLevel=G[N+1]):N>0&&(c.zoomLevel=G[N-1]);c.showToast(H("zoomLevel","Zoom Level")+": "+c.zoomLevel+"x",2E3)}}.bind(c);var d=c.playerElm.querySelector(".zwp__video-wrapper")||c.playerElm;d.addEventListener("mousemove",c.zoomMousemoveHandler);d.addEventListener("mouseenter",c.zoomMouseenterHandler);d.addEventListener("mouseleave",c.zoomMouseleaveHandler);d.addEventListener("wheel",c.zoomWheelHandler,{passive:!1});
var g=d.getBoundingClientRect();if(c.zoomLastMouseX&&c.zoomLastMouseY&&c.zoomLastMouseX>=g.left&&c.zoomLastMouseX<=g.right&&c.zoomLastMouseY>=g.top&&c.zoomLastMouseY<=g.bottom&&c.zoomLens){c.zoomLens.style.display="block";c.zoomCurrentMouseEvent={clientX:c.zoomLastMouseX,clientY:c.zoomLastMouseY,target:d,currentTarget:d};d=c.zoomLastMouseX-c.zoomSize/2;g=c.zoomLastMouseY-c.zoomSize/2;var m=L.innerWidth,h=L.innerHeight;d<0&&(d=0);g<0&&(g=0);d+c.zoomSize>m&&(d=m-c.zoomSize);g+c.zoomSize>h&&(g=h-c.zoomSize);
c.zoomLens.style.left=d+"px";c.zoomLens.style.top=g+"px";c.startZoomRenderLoop()}}.bind(e);e.disableZoom=function(){this.stopZoomRenderLoop();var c=this.playerElm.querySelector(".zwp__video-wrapper")||this.playerElm;this.zoomMousemoveHandler&&(c.removeEventListener("mousemove",this.zoomMousemoveHandler),this.zoomMousemoveHandler=null);this.zoomMouseenterHandler&&(c.removeEventListener("mouseenter",this.zoomMouseenterHandler),this.zoomMouseenterHandler=null);this.zoomMouseleaveHandler&&(c.removeEventListener("mouseleave",
this.zoomMouseleaveHandler),this.zoomMouseleaveHandler=null);this.zoomWheelHandler&&(c.removeEventListener("wheel",this.zoomWheelHandler),this.zoomWheelHandler=null);this.zoomRafId&&(cancelAnimationFrame(this.zoomRafId),this.zoomRafId=null);this.zoomLens&&(this.zoomLens.style.display="none")}.bind(e);e.startZoomRenderLoop=function(){function c(){d.zoomEnabled&&d.zoomCurrentMouseEvent?(d.zoomCurrentMouseEvent&&d.zoomCtx&&d.zoomLens&&d.drawZoom(d.zoomCurrentMouseEvent),d.zoomRenderLoopId=requestAnimationFrame(c)):
d.zoomRenderLoopRunning=!1}var d=this;d.zoomRenderLoopRunning||(d.zoomRenderLoopRunning=!0,d.zoomRenderLoopId=requestAnimationFrame(c))}.bind(e);e.stopZoomRenderLoop=function(){this.zoomRenderLoopId&&(cancelAnimationFrame(this.zoomRenderLoopId),this.zoomRenderLoopId=null);this.zoomRenderLoopRunning=!1}.bind(e);e.updateZoom=function(c){var d=this;d.zoomRafId||(d.zoomRafId=requestAnimationFrame(function(){d.drawZoom(c);d.zoomRafId=null}))}.bind(e);e.drawZoom=function(c){if(this.videoEl&&this.zoomCtx&&
this.zoomLens){var d=this.videoEl.getBoundingClientRect(),g=c.clientX-d.left,m=c.clientY-d.top,h=c.clientX-this.zoomSize/2;c=c.clientY-this.zoomSize/2;var u=L.innerWidth,G=L.innerHeight;h<0&&(h=0);c<0&&(c=0);h+this.zoomSize>u&&(h=u-this.zoomSize);c+this.zoomSize>G&&(c=G-this.zoomSize);this.zoomLens.style.left=h+"px";this.zoomLens.style.top=c+"px";h=this.videoEl.videoWidth;c=this.videoEl.videoHeight;G=d.width;var O=d.height;d=this.zoomSize/this.zoomLevel/(G/h);u=this.zoomSize/this.zoomLevel/(O/c);
g=g/G*h-d/2;m=m/O*c-u/2;g<0&&(g=0);m<0&&(m=0);g+d>h&&(g=h-d);m+u>c&&(m=c-u);this.zoomCtx.fillStyle="#000";this.zoomCtx.fillRect(0,0,this.zoomSize,this.zoomSize);try{this.zoomCtx.drawImage(this.videoEl,g,m,d,u,0,0,this.zoomSize,this.zoomSize)}catch(N){}}}.bind(e);e.showSubtitle=function(c){var d=this;if(d.overlay_layers){var g=d.overlay_layers.querySelector(".zwp-subtitles-show");if(g){if(c?g.style.display!=="block"&&(g.style.opacity=0,g.style.display="block",jb(g,500,function(){})):Ha(g,500,function(){Ta.removeElement(g);
g.remove();delete d.subtitleShow;delete d.subtitle1;delete d.subtitle2}),d.controlbar){var m=d.controlbar.querySelector(".zwp-subtitleButton");m&&(m.style.display=c?"block":"none")}}else if(c){g=document.createElement("div");g.setAttribute("class","zwp-subtitles-show");g.innerHTML='<div class="zwp-subtitles-viever"><div class="zwp-subtitle subtitle-1"><span class="subtitle-text"></span></div><div class="zwp-subtitle subtitle-2"><span class="subtitle-text"></span></div></div>';d.overlay_layers.appendChild(g);
g.addEventListener("click",function(K){K.preventDefault();K.stopPropagation()});Ta.addElement(g);g.addEventListener("resize",function(K){this.updateSubtitlePosition()}.bind(d));d.subtitleShow=g;d.subtitle1=g.querySelector(".subtitle-1 > .subtitle-text");d.subtitle2=g.querySelector(".subtitle-2 > .subtitle-text");d.subtitle2.style.display="none";var h=g.querySelector(".zwp-subtitles-viever"),u=!1,G=0,O=0;c="onpointerout"in document;var N="ontouchstart"in document.documentElement||"ontouchstart"in L;
d.on_subtitle_mousemove=function(K){var Z=K.target;if(u&&(Z===this.subtitle1||Z===this.subtitle2)){Z=K.pageY;var fa=!0;K.type=="touchmove"&&(K.changedTouches&&(Z=K.changedTouches[0].pageY),fa=!1);fa&&K.preventDefault();K.stopPropagation();K=G-Z;h.offsetTop<=54&&K>0||(K=O+K,K<54&&(K=54),h.style.bottom=K+"px")}}.bind(d);d.on_subtitle_mouseup=function(K){u&&("onpointerout"in document?(document.removeEventListener("pointermove",this.on_subtitle_mousemove),document.removeEventListener("pointerup",this.on_subtitle_mouseup)):
N?(document.removeEventListener("touchmove",this.on_subtitle_mousemove),document.removeEventListener("touchend",this.on_subtitle_mouseup)):(document.removeEventListener("mousemove",this.on_subtitle_mousemove),document.removeEventListener("mouseup",this.on_subtitle_mouseup)),u=!1)}.bind(d);d.on_subtitle_mousedown=function(K){"onpointerout"in document?(document.addEventListener("pointermove",this.on_subtitle_mousemove),document.addEventListener("pointerup",this.on_subtitle_mouseup)):N?(document.addEventListener("touchmove",
this.on_subtitle_mousemove),document.addEventListener("touchend",this.on_subtitle_mouseup)):(document.addEventListener("mousemove",this.on_subtitle_mousemove),document.addEventListener("mouseup",this.on_subtitle_mouseup));u=!0;G=K.pageY;var Z=parseInt(h.offsetTop+h.offsetHeight);O=this.subtitleShow.offsetHeight-Z;K.stopPropagation();K.preventDefault()}.bind(d);d.on_subtitleItemclick=function(K){K.stopPropagation();K=K.currentTarget;ea(K,"zwp_switch")&&gb(K);var Z=K.getAttribute("data-action"),fa=
ea(K,"switch_on");if(Z==="subtitleOn")this.subtitleShow&&(this.subtitleShow.style.display=fa?"block":"none");else if(Z==="subtitleDefault")this.subtitles["1"]&&(fa?this.subtitles["1"].hidden&&(delete this.subtitles["1"].hidden,this.subtitle1.style.display="block"):(this.subtitles["1"].hidden=!0,this.subtitle1.style.display="none"));else if(Z==="subtitleSecond")this.subtitles["2"]&&(fa?this.subtitles["2"].hidden&&(delete this.subtitles["2"].hidden,this.subtitle2.style.display="block"):(this.subtitles["2"].hidden=
!0,this.subtitle2.style.display="none"));else if(Z==="showSubtitleSearchPanel"){var Ba=this.overlay_layers.querySelector(":scope > .zwp-subtitleSearchPanel");if(Ba)Ha(Ba,500,function(){Ba.remove()}),delete this.subtitleSearchPanel;else if(this.closeAllActivePanels(),Ba=this.createSubtitleSearchPanel()){Ba.style.display="block";(Z=Ba.querySelector(".zwp-search-input"))&&!this.isMobile()&&Z.focus();if(K=K.closest(".zwp-subtitleMenu"))K.style.display="none",this._lastClosedParentMenu=K;(K=this.controlbar.querySelector(".zwp-subtitleButton"))&&
X(K,"is-active")}}}.bind(d);c?h.addEventListener("pointerdown",d.on_subtitle_mousedown):canTouch?h.addEventListener("touchstart",d.on_subtitle_mousedown):h.addEventListener("mousedown",d.on_subtitle_mousedown);if(d.controlbar){if(m=d.controlbar.querySelector(".zwp-subtitleButton"))m.style.display="block";(c=p.querySelector(".zwp-subtitleMenu"))&&!c.bindSwitchEvent&&(m=c.querySelectorAll(".action-item"),m.length>0&&m.forEach(function(K){K.addEventListener("click",d.on_subtitleItemclick);var Z=K.getAttribute("data-action");
Z!=="subtitleOn"&&Z!=="subtitleDefault"||aa(K,"switch_on")}),c.querySelectorAll('[data-action^="toggleSearchSubtitle"]').forEach(function(K){K.addEventListener("change",function(){if(d.subtitleSearchPanel){var Z=d.subtitleSearchPanel.querySelector(".zwp-search-input");if(Z){Z=Z.value;var fa=d.searchSubtitles(Z),Ba=d.subtitleSearchPanel.querySelector(".zwp-search-results-list");if(Ba){var Pa=document.createDocumentFragment();fa.length===0?(fa=document.createElement("div"),fa.className="zwp-no-results",
fa.textContent=Z?H("noSearchResults","No matching subtitles found"):H("noSubtitlesLoaded","No subtitles loaded"),Pa.appendChild(fa)):fa.forEach(function(Ea){var La=document.createElement("div");La.className="zwp-search-result-item";var ha=document.createElement("div");ha.className="result-time";ha.textContent=ma(Ea.from)+" \u2192 "+ma(Ea.to);var na=document.createElement("div");na.className="result-text";na.textContent=Ea.content;La.appendChild(ha);La.appendChild(na);(function(qa){La.addEventListener("click",
function(Aa){Aa.stopPropagation();typeof d.seekTimeProgressByTime==="function"?d.seekTimeProgressByTime(qa.from):d.videoEl&&(d.videoEl.currentTime=qa.from)})})(Ea);Pa.appendChild(La)});Ba.innerHTML="";Ba.appendChild(Pa);(Z=d.subtitleSearchPanel.querySelector(".zwp-list-inner"))&&(Z=$$(Z).getNiceScroll())&&Z.length>0&&Z[0].resize()}}}})}),c.bindSwitchEvent=!0)}}}}.bind(e);e.getSimpleSubtitleRenderer=function(){if(!this.overlay_layers)return null;var c=this.overlay_layers.querySelector(".zwp-subtitles-show");
if(c){var d=c.querySelector(".zwp-simple-subtitles-viever");d||(c.innerHTML='<div class="zwp-simple-subtitles-viever"></div>',d=c.querySelector(".zwp-simple-subtitles-viever"));return d}c=document.createElement("div");c.setAttribute("class","zwp-subtitles-show");c.innerHTML='<div class="zwp-simple-subtitles-viever"></div>';this.overlay_layers.appendChild(c);c.addEventListener("click",function(g){g.preventDefault();g.stopPropagation()});Ta.addElement(c);c.addEventListener("resize",function(g){this.updateSubtitlePosition()}.bind(this));
this.subtitleShow=c;return c.querySelector(".zwp-simple-subtitles-viever")}.bind(e);e.detectContentFormat=function(c){return c.substr(0,6)==="WEBVTT"?"vtt":c.charAt(0)==="["||c.charAt(0)==="{"?"json":/^\d+\s*\n/.test(c)||c.includes("--\x3e")?"srt":"unknown"};e.processSubtitleContent=function(c,d){d=d||{};var g=null,m=e.detectContentFormat(c);if(m==="vtt")g=mb(c);else if(m==="srt")g=Cb(c);else if(m==="json"||m==="bcc")try{g=JSON.parse(c)}catch(h){g=null}if(!g)return typeof this._config.onSubtitleError===
"function"&&this._config.onSubtitleError.call(this,{title:d.title||"Unknown",url:d.url||"",trackId:d.pos||"1",error:"Invalid subtitle file format",errorCode:"INVALID_FORMAT",source:d.source||"unknown",timestamp:(new Date).toISOString()}),d.source==="local"&&this.toast(H("invalidSubtitleFormat","Invalid subtitle file format"),3E3,!0),!1;typeof this._config.onSubtitleLoaded==="function"&&this._config.onSubtitleLoaded.call(this,{url:d.url||"",title:d.title||"",format:m,trackId:d.pos||"1"});this.processLoadedSubtitle(g,
d.pos||"1",d.title||"",d.showSubtitle);return!0};e.loadSubtitle=function(c,d,g,m){var h=this;if(d==="1"||d==="2")typeof c==="object"&&c instanceof File?h.detectMimeType(c).then(function(u){return h.isValidSubtitleFile(c,u).then(function(G){return G?!0:(h.toast(H("unsupportedSubtitleFormat","Unsupported subtitle format")+": "+u,3E3,!0),!1)})}).then(function(u){u&&(u=new FileReader,u.onload=function(G){h.processSubtitleContent(G.target.result,{url:URL.createObjectURL(c),title:g||c.name,pos:d,source:"local",
showSubtitle:m})},u.onerror=function(){var G={fileName:c.name,title:g||c.name,trackId:d,error:"Failed to read subtitle file",errorCode:"READ_ERROR",source:"local",timestamp:(new Date).toISOString()};typeof h._config.onSubtitleError==="function"&&h._config.onSubtitleError.call(h,G);h.toast(H("failedToReadSubtitle","Failed to read subtitle file"),3E3,!0)},u.readAsText(c))}).catch(function(u){u={fileName:c.name,title:g||c.name,trackId:d,error:"Subtitle file validation failed",errorCode:"VALIDATION_FAILED",
details:u.message||u,source:"local",timestamp:(new Date).toISOString()};typeof h._config.onSubtitleError==="function"&&h._config.onSubtitleError.call(h,u);h.toast(H("subtitleValidationFailed","Subtitle file validation failed"),3E3,!0)}):typeof c==="string"&&(h.detectContentFormat(c)!=="unknown"?h.processSubtitleContent(c,{url:"",title:g||"Direct Subtitle Content",pos:d,source:"direct",showSubtitle:m}):lb(c,function(u){var G=h.getBaseFilename(c);G=h.truncateFilename(G);h.processSubtitleContent(u,{url:c,
title:g||G,pos:d,source:"http",showSubtitle:m})},function(u){typeof h._config.onSubtitleError==="function"&&h._config.onSubtitleError.call(h,{title:g||c,url:c,trackId:d,error:"Failed to fetch subtitle file",errorCode:"FETCH_ERROR",source:"http",timestamp:(new Date).toISOString(),xhr:u})}))}.bind(e);e.clearAllSubtitles=function(){this.subtitles&&(delete this.subtitles["1"],delete this.subtitles["2"]);this.subtitleShow&&(this.subtitleShow.parentNode&&(Ta.removeElement(this.subtitleShow),this.subtitleShow.parentNode.removeChild(this.subtitleShow)),
delete this.subtitleShow,delete this.subtitle1,delete this.subtitle2);this.showSubtitleTimer&&(clearTimeout(this.showSubtitleTimer),delete this.showSubtitleTimer);this._closePanel("subtitleSearchPanel");if(this.controlbar){var c=this.controlbar.querySelector(".zwp-subtitleButton");c&&(c.style.display="none");var d=this.controlbar.querySelector(".zwp-subtitleMenu");if(d){c=d.querySelector(".main");var g=d.querySelector(".sub1");d=d.querySelector(".sub2");g&&(g.style.display="none");d&&(d.style.display=
"none");c&&(c=c.querySelector(".zwp_switch"))&&X(c,"switch_on")}}};e.processLoadedSubtitle=function(c,d,g,m){this.subtitles||(this.subtitles={});g&&(c.title=g);m===!1?c.hidden=!0:d==="2"&&this._config.secondSubtitleHidden&&(c.hidden=!0);if(this.controlbar&&(m=this.controlbar.querySelector(".zwp-subtitleMenu"))){var h=m.querySelector(".main");h||(m.innerHTML=ub(),X(m,"zwp-autosize"));if(d==="1"){if(h=m.querySelector(".sub1")){g||=H("mainSubtitle","Main subtitle");var u=h.querySelector(".zwp-option-item-label");
if(u){var G=e.truncateFilename(g);u.innerHTML=G;u.setAttribute("title",g)}h.style.display="block"}(h=m.querySelector(".main"))&&(u=h.querySelector(".zwp_switch"))&&aa(u,"switch_on");if(h=m.querySelector(".zwp-search-subtitle1"))if(h.style.display="inline-flex",h=h.querySelector('input[type="checkbox"]'))h.checked=!0}if(d==="2"){if(h=m.querySelector(".sub2")){g||=H("secondSubtitle","Second subtitle");if(u=h.querySelector(".zwp-option-item-label"))G=e.truncateFilename(g),u.innerHTML=G,u.setAttribute("title",
g);c.hidden||(u=h.querySelector(".zwp_switch"))&&aa(u,"switch_on");h.style.display="block"}if(g=m.querySelector(".zwp-search-subtitle2"))if(g.style.display="inline-flex",g=g.querySelector('input[type="checkbox"]'))g.checked=!0}}this.subtitles[d]=c;this.showSubtitleTimer&&(clearTimeout(this.showSubtitleTimer),delete this.showSubtitleTimer);this.showSubtitleTimer=setTimeout(function(){this.showSubtitle(!0);delete this.showSubtitleTimer}.bind(this),100)}.bind(e);e.renderSubtitles=function(c){if(this.subtitleShow&&
this.subtitles&&this.subtitleShow.style.display!=="none")for(var d=["1","2"],g=0;g<d.length;g++){var m=d[g];if(this.subtitles[m]){var h="subtitle"+m;m=this.subtitles[m];var u=!1;if(!m.hidden&&m.body&&Array.isArray(m.body)){if(m.current){if(c<m.current.from)u=!0;else if(c<m.current.to)continue;this[h]&&(this[h].innerHTML="",this[h].style.display="none");m.current=null}var G=m.nextSubtitleIdx||0,O=!0;if(u){var N=G-4;N<0&&(N=0);for(var K=G-2;K>=N;K--)if(u=m.body[K],c<=u.to){if(c>=u.from){m.current=u;
m.nextSubtitleIdx=K+1;O=!1;break}}else{m.nextSubtitleIdx=G;O=!1;break}if(O&&N>0){G=0;for(K=N-1;G<=K;){N=parseInt((G+K)/2);if(!m.body||!Array.isArray(m.body)||N>=m.body.length)break;u=m.body[N];if(c<u.from)K=N-1;else if(c>u.to)G=N+1;else{m.current=u;m.nextSubtitleIdx=N+1;O=!1;break}}O&&(m.nextSubtitleIdx=G)}}else{if(!m.body||!Array.isArray(m.body))break;N=G+2;N>m.body.length&&(N=m.body.length);for(K=G;K<N;K++)if(u=m.body[K],c>=u.from){if(c<=u.to){m.current=u;m.nextSubtitleIdx=K+1;O=!1;break}}else{m.nextSubtitleIdx=
G;O=!1;break}if(O){G=N;K=m.body.length-1;for(N>=m.body.length?c<m.body[m.body.length-1].from&&(G=0):c<m.body[N].from&&(G=0);G<=K;)if(N=parseInt((G+K)/2),u=m.body[N],c<u.from)K=N-1;else if(c>u.to)G=N+1;else{m.current=u;m.nextSubtitleIdx=N+1;O=!1;break}O&&(m.nextSubtitleIdx=G)}}m.current&&this[h]&&(this[h].innerHTML=m.current.content,this[h].style.display="block")}}}}.bind(e);e.updateSubtitlePosition=function(){if(this.subtitleShow&&this.subtitles){var c=["1","2"],d=this.subtitleShow.offsetWidth,g=
this.subtitleShow.offsetHeight;if(d&&g)for(d/=1024,g/=576,g=32*(d>g?g:d),d=0;d<c.length;d++){var m=c[d];this.subtitles[m]&&(m="subtitle"+m,this[m]&&(this[m].style.fontSize=g.toFixed(2)+"px"))}}}.bind(e);e.resetQualitiesMenu=function(){if(this&&!this.multiStreams&&this.controlbar){var c=this.controlbar.querySelector(".zwp-qualityButton");if(c){var d=c.querySelector(".zwp-qualityMenu");d&&(d.innerHTML='<li class="zwp-quality-item zwp-disabled" data-index="-1">No quality</li>');c.style.display="none"}}}.bind(e);
e.createQualitiesMenu=function(c,d=!0){var g=this;if(c.length<=1)g.resetQualitiesMenu();else{var m=g.controlbar.querySelector(".zwp-qualityButton");if(m){var h="",u=H("level","Level")+" ";d&&(h+='<li class="zwp-quality-item active" data-idx="-1">'+H("qs-auto","AUTO SWITCH")+"</li>");for(d=0;d<c.length;d++){var G="";G=typeof c[d].name==="undefined"?c[d].width&&c[d].height?c[d].width+"x"+c[d].height:u+(d+1):c[d].name;typeof c[d].bitrate!=="undefined"&&(G+=" ("+parseInt(c[d].bitrate/1E3)+"kbps)");h+=
'<li class="zwp-quality-item" data-br="'+c[d].bitrate+'" data-idx="'+c[d].qualityIndex+'" data-vh="'+c[d].height+'">'+G+"</li>"}if(c=m.querySelector(".zwp-qualityMenu"))c.innerHTML=h,L.mQuery(c).find(".zwp-quality-item").click(function(O){O.preventDefault();O.stopPropagation();O=L.mQuery(this);O.hasClass("active")||(O.siblings().removeClass("active"),O.addClass("active"),O=this.getAttribute("data-idx"),typeof g.switchQualityLevel==="function"&&g.switchQualityLevel(O))});m.style.display="block"}}}.bind(e);
e.updateQualityLevel=function(c,d){if(this&&this.controlbar){var g=this.controlbar.querySelector(".zwp-qualityButton");g&&(g=g.querySelector(".zwp-qualityMenu"))&&L.mQuery(g).children(".zwp-quality-item").each(function(m,h){m=parseInt(h.getAttribute("data-idx"));h=L.mQuery(h);m===-1?d&&!h.hasClass("active")&&(h.siblings(".active").removeClass("active"),h.addClass("active")):c===m?(d||h.hasClass("active")||(h.siblings(".active").removeClass("active"),h.addClass("active")),h.hasClass("current")||(h.siblings(".current").removeClass("current"),
h.addClass("current"))):h.hasClass("current")&&h.removeClass("current")})}}.bind(e);e.buildStreamSelector=function(){var c=this;if(c.multiStreams&&c.controlbar){var d=c.controlbar.querySelector(".zwp-qualityButton");if(d){var g="",m=c.multiStreams.murls;if(!Array.isArray(m)||m.length!==1){for(var h in m){var u=m[h];u=typeof u==="object"?u.name:h;g+='<li class="zwp-quality-item" data-stream="'+u+'">'+H(u,u)+"</li>"}if(m=d.querySelector(".zwp-qualityMenu"))m.innerHTML=g,g=L.mQuery(m).find(".zwp-quality-item"),
g.click(function(G){G.preventDefault();G.stopPropagation();G=this.getAttribute("data-stream");if(c.multiStreams.curStream!==G){var O=c.multiStreams.murls;if(Array.isArray(O))for(var N in O){var K=O[N];if(K.name===G){var Z=K.url;break}}else Z=O[G];c.__switchStream(Z);c.multiStreams.curStream=G;Z=L.mQuery(this);Z.hasClass("active")||(Z.siblings(".active").removeClass("active"),Z.addClass("active"));G=H(G,G);c.toast(H("switchedToQuality","Switched to")+" "+G+" "+H("quality","quality"))}}),g.each(function(G,
O){G=this.getAttribute("data-stream");if(c.multiStreams.curStream===G&&(G=L.mQuery(this),!G.hasClass("active")))return G.siblings(".active").removeClass("active"),G.addClass("active"),!1});d.style.display="block"}}}}.bind(e);e.createSubtitlesMenu=function(c,d){var g=this;g.controlbar&&(d=g.controlbar.querySelector(".zwp-subtitleMenu"),c=Ib(c),d.innerHTML=c,delete d.bindSwitchEvent,aa(d,"zwp-autosize"),L.mQuery(d).find(".zwp-subtitles-item").click(function(m){m.preventDefault();m.stopPropagation();
m=L.mQuery(this);m.hasClass("active")||(m.siblings().removeClass("active"),m.addClass("active"),m=this.getAttribute("data-id"),typeof g.switchSubtitleTrack==="function"&&g.switchSubtitleTrack(m))}),c=g.controlbar.querySelector(".zwp-subtitleButton"))&&(c.style.display="block")}.bind(e);e.updateSubtitleTrack=function(c){}.bind(e);e.resetSubtitleMenu=function(){if(this.controlbar){var c=this.controlbar.querySelector(".zwp-subtitleButton");c&&(c.style.display="none")}}.bind(e);e.__getDanmuBarDock=function(){var c=
this.progressBar.timeInfo.querySelector(".zwp_danmuBarDock");c||(c=document.createElement("DIV"),c.setAttribute("class","zwp_danmuBarDock"),this.progressBar.timeInfo.appendChild(c),Ta.addElement(c),c.addEventListener("resize",function(d){var g=this;g.resizeTimer||(g.resizeTimer=L.setTimeout(function(){c.clientWidth<350?aa(c,"zwp-mini"):X(c,"zwp-mini");delete g.resizeTimer},50))}.bind(this)));return c}.bind(e);e.buildDanmuToolbar=function(c,d){var g=this,m;if(!g.danmuToolbar){c&&(m=document.querySelector("#"+
c));if(!m){if(!g.overlay_layers)return;d=null;m=g.progressBar&&g.progressBar.timeInfo?g.__getDanmuBarDock():g.overlay_layers}c=Jb();m.insertAdjacentHTML("beforeend",c);g.danmuToolbar=m.querySelector(".zwp_danmu-controlbar");d&&aa(g.danmuToolbar,d);m.appendChild(g.danmuToolbar);(d=g.danmuToolbar.querySelector(".zwp_switch"))&&d.addEventListener("click",function(h){h.stopPropagation();h=h.currentTarget;if(ea(h,"zwp_switch")){gb(h);var u=ea(h,"switch_on");h=L.$$(this.danmuToolbar);if(u){var G=h.find("button.btn_submit");
G.removeClass("vtb_disabled").removeAttr("disabled");this.setEnableDanmu(!0);u=h.find(".barrage_inp_text");u.removeAttr("readonly").removeAttr("disabled").removeClass("disabled");u.attr("keydown")!="on"&&(u.keydown(function(O){O.which==13&&G.length>0&&G.trigger("click")}),u.attr("keydown","on"));h.find(".zwp-barrage_form").css("background-color","#28303db3").children("a.btn_bubble").toggleClass("disabled")}else h.find("button.btn_submit").addClass("vtb_disabled").attr({disabled:"disabled"}),this.setEnableDanmu(!1),
h.find(".barrage_inp_text").attr("readonly","readonly").attr("disabled","disabled").addClass("disabled"),h.find(".zwp-barrage_form").css("background-color","#202020b3").children("a.btn_bubble").toggleClass("disabled")}}.bind(g));(d=g.danmuToolbar.querySelector(".barrage_login"))&&d.addEventListener("click",function(h){h.preventDefault();h.stopPropagation();alert("login")});(d=g.danmuToolbar.querySelector(".zwp_dmconfig"))&&d.addEventListener("click",function(h){h.preventDefault();h.stopPropagation();
this.zwplayer=g;Mb(h,this)});(d=g.danmuToolbar.querySelector(".btn_bubble"))&&d.addEventListener("click",function(h){h.preventDefault();h.stopPropagation();Db(this,h)});(d=g.danmuToolbar.querySelector(".btn_submit"))&&d.addEventListener("click",function(h){h.preventDefault();h.stopPropagation();a:{if(!this.inpbox){$inpbox=$$(this).parent().children("DIV.zwp-barrage_inp").children(".barrage_inp_text");if(!$inpbox)break a;this.inpbox=$inpbox}if(g){h=this.inpbox.val();if(h=="")break a;h.indexOf("&")!=
-1&&(h=h.replace(/&/g,"&amp;"));h.indexOf("<")!=-1&&(h=h.replace(/</g,"&lt;"));h.indexOf(">")!=-1&&(h=h.replace(/>/g,"&gt;"));h.indexOf('"')!=-1&&(h=h.replace(/"/g,"&quot;"));h.indexOf("'")!=-1&&(h=h.replace(/'/g,"&#039;"));if(!g.sendDanmu(h))break a}this.inpbox.val("")}})}}.bind(e);e.reposDanmuToolbar=function(c){if(this.danmuToolbar&&this.progressBar&&this.progressBar.timeInfo){var d=this.__getDanmuBarDock(),g=this.danmuToolbar.parentNode;g&&(c?g!==d&&(g.removeChild(this.danmuToolbar),d.appendChild(this.danmuToolbar),
this.oldDanmuParentNode=g):this.oldDanmuParentNode&&(d.removeChild(this.danmuToolbar),this.oldDanmuParentNode.appendChild(this.danmuToolbar),delete this.oldDanmuParentNode))}}.bind(e);e.sendDanmu=function(c){if(typeof this._config.sendDanmu==="function"){var d="";this.danmuSetting.border&&(d+=',"border":"1"');this.danmuSetting.color&&(d+=',"color":"#'+this.danmuSetting.color+'"');this._config.sendDanmu('{"type":"danmu","text":"'+c+'"'+d+"}");return!0}alert("No danmu send function is setup");return!1}.bind(e);
e.showContextMenu=function(c){var d=this;if(c.offsetX!==void 0&&c.offsetY!==void 0){var g=c.offsetX;c=c.offsetY}else{var m=d.playerContainer.getBoundingClientRect();g=c.clientX-m.left;c=c.clientY-m.top}m=d.playerContainer.getBoundingClientRect();var h=m.width;m=m.height;var u="left",G="top",O=g,N=c;g+180>h&&(u="right",O=h-g);c+148>m&&(G="bottom",N=m-c);if(d.contextMenu)d.contextMenu.style[u==="left"?"right":"left"]=null,d.contextMenu.style[G==="top"?"bottom":"top"]=null,d.contextMenu.style[u]=O+"px",
d.contextMenu.style[G]=N+"px";else{g='<div class="zwp-popupmenu" style="'+u+": "+O+"px; "+G+":"+N+'px;"><a class="zwp-menuitem" data-action="shortcutHelp" href="javascript:void(0)"><span class="zwp-menucaption">'+(H("keyboardShortcuts","Keyboard Shortcuts")+"</span></a>");g=g+'<span class="zwp-menuseperator" action="shortcutHelp"></span><a class="zwp-menuitem" data-action="document" href="https://www.zwplayer.cn/docs/support.html" target="zwplayer-doc"><span class="zwp-menucaption">'+(H("player-help",
"Help and document")+"</span></a>");g+='<a class="zwp-menuitem" data-action="version" href="https://www.zwplayer.cn/pages/company/changelog.html?v=3.2.1" title="Build: 20260124" target="zwplayer-version"><span class="zwp-menucaption">'+H("version-update","Version update")+' (<span class="zwp-version">'+H("current")+": v3.2.1</span>) </span></a>";g=g+'<span class="zwp-menuseperator" action="version"></span><a class="zwp-menuitem" data-action="about" href="https://www.zwplayer.cn/pages/company/about.html"><span class="zwp-menucaption">'+
(H("about","About")+" zwplayer</span></a>");g+="</div>";c=d.playerContainer;ab()&&(h=document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement)&&(c=h);c.insertAdjacentHTML("beforeEnd",g);d.contextMenu=c.querySelector(".zwp-popupmenu");var K=function(Z){Z.stopPropagation();Z.preventDefault();var fa=this.getAttribute("data-action");this.getAttribute("target");var Ba=this.getAttribute("href");d.hideContextMenu();setTimeout(function(){fa===
"about"?L.open(Ba,"zwplayer-about"):fa==="version"?L.open(Ba,"zwplayer-version"):fa==="document"?L.open(Ba,"zwplayer-doc"):fa==="shortcutHelp"&&d.createShortcutHelpPanel()},10)};d.contextMenu.querySelectorAll("a.zwp-menuitem").forEach(function(Z){Z.addEventListener("click",K,!1)});document.addEventListener("click",d.hideContextMenu)}}.bind(e);e.hideContextMenu=function(){if(this.contextMenu){var c=this.contextMenu.parentNode;c&&c.removeChild(this.contextMenu);delete this.contextMenu;document.removeEventListener("click",
this.hideContextMenu)}}.bind(e);e.toast=function(c,d,g,m){var h=this;d=d||2E3;h.toastTimerId&&(clearTimeout(h.toastTimerId),h.toastBox&&(h.overlay_layers.removeChild(h.toastBox),delete h.toastBox));if(c!=="closetoast"){if(typeof c==="object"){if("icon"in c)var u=c.icon;c=c.text}var G=document.createElement("div"),O="",N="zwp-toast zwp-center";u&&(N+=" zwp-toast-icon",O='<i class="xicon xicon-'+u+'"></i>');g&&(O+='<a href="javascript:void(0)" class="zwp-toast-closebtn"><i class="xicon xicon-close"></i></a>',
N+=" zwp-use-close");m&&(N+=" zwp-lite");O+='<span class="zwp-toast-text">'+c+"</span>";G.setAttribute("class",N);G.innerHTML=O;h.overlay_layers.appendChild(G);h.toastBox=G;var K=function(Z){if(h.toastBox){var fa=h.toastBox.querySelector(".zwp-toast-closebtn");fa&&fa.removeEventListener("click",K);h.overlay_layers.removeChild(h.toastBox);delete h.toastBox}h.toastTimerId&&(Z&&Z.type==="click"&&clearTimeout(h.toastTimerId),delete h.toastTimerId)};h.toastTimerId=L.setTimeout(K,d);g&&(g=G.querySelector(".zwp-toast-closebtn"))&&
g.addEventListener("click",K)}}.bind(e);e.mutedConfirmBox=function(){var c=this;c.popup_layers||(c.popup_layers=document.createElement("div"),c.popup_layers.setAttribute("class","zwp__popup_layers"),c.playerContainer.appendChild(c.popup_layers));var d=document.createElement("div"),g='<span class="zwp-toast-text">'+H("mutedAutoplayMessagePre","Muted due to ")+' <a href="#mutemore" class="mutemore">'+H("browserLimits","Browser Restrictions")+"</a>"+H("mutedAutoplayMessagePost",". Click to ")+'<a href="#openaudio" class="openaudio">'+
H("openAudio","Enable")+'</a><button class="closeBtn" title="'+H("close","Close")+'"><i class="xicon xicon-close"></i></button></span>';d.setAttribute("class","zwp-toast zwp-confirm zwp-center");d.innerHTML=g;c.popup_layers.appendChild(d);c.mutedTipBox=d;(g=d.querySelector(".closeBtn"))&&g.addEventListener("click",function(m){m.preventDefault();c.mutedTipBox&&(c.popup_layers.removeChild(c.mutedTipBox),c.popup_layers.style.display=null,delete c.mutedTipBox);L.allowAutoAudioPlay=!0});(g=d.querySelector(".openaudio"))&&
g.addEventListener("click",function(m){m.preventDefault();m.stopPropagation();c.mutedTipBox&&(c.popup_layers.removeChild(c.mutedTipBox),c.popup_layers.style.display=null,delete c.mutedTipBox);c.setMuted(!1);L.allowAutoAudioPlay=!0});(g=d.querySelector(".mutemore"))&&g.addEventListener("click",function(m){m.preventDefault();m.stopPropagation();var h=d.querySelector(".moreInfoBox");h||(m='<div class="moreInfoBox"><div class="info-text">'+H("browserRestrictionsInfo","When you visit this site infrequently or often play muted content, browsers may limit audio volume, preventing automatic audio playback.")+
'</div><div class="info-control"><button class="info-btn">'+H("iUnderstand","OK")+"</button></div></div>",d.insertAdjacentHTML("beforeend",m),h=d.querySelector(".moreInfoBox"),h.querySelector(".info-btn").addEventListener("click",function(u){u.preventDefault();u.stopPropagation();h.style.display="none"}));h&&(h.style.display="block");L.allowAutoAudioPlay=!0});c.popup_layers.style.display="block"}.bind(e);typeof e._config.playerElm=="string"?(f=e._config.playerElm,f.charAt(0)!="#"&&(f="#"+f),e.playerElm=
document.querySelector(f)):ob(e._config.playerElm)&&(e.playerElm=e._config.playerElm);e.playerElm?ea(e.playerElm,"zwp-wrap")||(e.playerElmOldClass=e.playerElm.getAttribute("class"),aa(e.playerElm,"zwp-wrap"),e.doRemovePlayerClass=!0):(f="",typeof e._config.playerElm=="string"?(f=e._config.playerElm,f.charAt(0)=="#"&&(f=f.substr(1))):f="ZWP-"+(new Date).getTime(),e.playerElm=document.createElement("DIV"),e.playerElm.id=f,e.playerElm.style.position="absolute",e.playerElm.style.left=0,e.playerElm.style.top=
0,e.playerElm.style.width="640px",e.playerElm.style.height="360px",document.body.appendChild(e.playerElm),e.playerElm.setAttribute("class","zwp-wrap"),e.doDeletePlayerElm=!0);e.playerContainer=document.createElement("DIV");e.playerContainer.setAttribute("class","zwp-container");e.playerElm.appendChild(e.playerContainer);typeof e._config.videoElm=="string"?(f=e._config.videoElm,f.charAt(0)!="#"&&(f="#"+f),e.videoEl=document.querySelector(f)):ob(e._config.videoElm)&&(e.videoEl=e._config.videoElm);if(!e.videoEl){var va=
document.createElement("DIV");va.setAttribute("class","zwp-videoWrapper");e.playerContainer.appendChild(va);Ta.addElement(va);va.addEventListener("resize",function(c){this._config.video_rotated&&this.rotateVideo()}.bind(e));e.videoWrapper=va;e.videoEl=document.createElement("VIDEO");typeof e._config.videostyle=="string"&&e.videoEl.setAttribute("style",e._config.videostyle);typeof e._config.videoclass=="string"&&e.videoEl.setAttribute("class",e._config.videoclass);e._config.videostyle||e._config.videoclass||
e.videoEl.setAttribute("style","width:100%;height:100%;");typeof e._config.videoElm=="string"&&(f=e._config.videoElm,f.charAt(0)=="#"&&(f=f.substr(1)),e.videoEl.id=f);e.videoEl.setAttribute("playsinline","");e.videoEl.setAttribute("webkit-playsinline","");e.videoEl.setAttribute("autoplay","");va.appendChild(e.videoEl);e.videoRemoveWhenClose=!0}f=e._config.defVolume/100;e.lastVolume=f;e.videoEl.volume=f;e._config.poster&&e.videoEl.setAttribute("poster",e._config.poster);if(!e._config.disableOverlayLayer&&
(f=document.createElement("div"),f.setAttribute("class","zwp__layers"),f.innerHTML='<div class="zwp__overlay zwp__layer zwp_loadingicon" style="width: 100%; height: 100%; display: none;"><div class="zwp__overlay-loading"><span class="zwp__overlay-loading-bg-img"><svg width="80px" height="80px" viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg" stroke="#fff"><g fill="none" fill-rule="evenodd"><g transform="translate(1 1)" stroke-width="2"><circle stroke-opacity=".5" cx="18" cy="18" r="18"/><path d="M36 18c0-9.94-8.06-18-18-18"><animateTransform attributeName="transform" type="rotate" from="0 18 18" to="360 18 18" dur="1s" repeatCount="indefinite"/></path></g></g></svg></span></div></div>'+
Nb,e.playerContainer.appendChild(f),e.overlay_layers=f,e.bigPlayOverlay=f.querySelector(".zwp__overlay-play"),e.bigPlayBtn=e.bigPlayOverlay.querySelector(".zwp__overlay-button"),e.localPlaybackHint=e.bigPlayOverlay.querySelector(".zwp-local-playback-hint"),e.loadingOverlay=f.querySelector(".zwp_loadingicon"),e.updateLocalPlaybackHint=function(c){if(e.localPlaybackHint){var d=e._config.url||e.murl;c?(e.localPlaybackHint.style.setProperty("display","none","important"),e.bigPlayBtn&&e.bigPlayBtn.style.setProperty("display",
"flex","important"),e.bigPlayOverlay&&e.bigPlayOverlay.style.setProperty("display","flex","important")):e._config.localPlayback&&!d?(e.localPlaybackHint.style.setProperty("display","flex","important"),e.bigPlayBtn&&e.bigPlayBtn.style.setProperty("display","none","important"),e.bigPlayOverlay&&e.bigPlayOverlay.style.setProperty("display","flex","important")):d&&(e.localPlaybackHint.style.setProperty("display","none","important"),e.bigPlayBtn&&e.bigPlayBtn.style.setProperty("display","flex","important"),
e.bigPlayOverlay&&e.bigPlayOverlay.style.setProperty("display","flex","important"))}},e._config.disablePlayBtn?aa(e.bigPlayBtn,"zwp_disabled"):e.bigPlayBtn.addEventListener("click",function(c){c.preventDefault();c.stopPropagation();this.on_btnclick(c)}.bind(e)),e.localPlaybackHint&&(e.localPlaybackHint.addEventListener("click",function(c){c.preventDefault();c.stopPropagation();this.on_btnclick(c)}.bind(e)),e._config.localPlayback&&e.updateLocalPlaybackHint()),e._config.enableDanmu&&(e.danmuPlayer=
HUAYI.Danmu.create({playerId:f})),f.addEventListener("contextmenu",function(c){c.preventDefault();c.stopPropagation();e.isMobile()||this.showContextMenu(c)}.bind(e)),f.addEventListener("click",function(c){var d=this;c=function(g){g=g.querySelector(".closeBtn");var m=document.createEvent("Event");m.initEvent("click",!0,!0);g.dispatchEvent(m)};d.infoViewer?c(d.infoViewer):d.colorSettingPanel?c(d.colorSettingPanel):d.recordingSettingsPanel?c(d.recordingSettingsPanel):d.volumeBoostPanel?c(d.volumeBoostPanel):
d.shortcutHelpPanel?c(d.shortcutHelpPanel):d.contextMenu?d.hideContextMenu():d._config.disableClickPause||d._config.disablePlayBtn||d._config.isLive||(d.overlayLayerClickTimer&&(L.clearTimeout(d.overlayLayerClickTimer),delete d.overlayLayerClickTimer),d.playbtn&&(d.overlayLayerClickTimer=L.setTimeout(function(){d.playbtn.click();delete d.overlayLayerClickTimer},300)))}.bind(e)),e._config.logo)){if(typeof e._config.logo==="object"){if(typeof e._config.logo.icon==="string")var ka=e._config.logo.icon}else typeof e._config.logo===
"string"&&(ka=e._config.logo);if(ka){va='<div class="zwp-logo"';if(typeof e._config.logo==="object"){var Da="";"dock"in e._config.logo?Da+=(e._config.logo.dock==="left"?"left":"right")+": "+(e._config.logo.x||"5%")+";":"x"in e._config.logo&&(Da+="right: "+e._config.logo.x+";");"y"in e._config.logo&&(Da+="top: "+e._config.logo.y+";");"width"in e._config.logo&&(Da+="width: "+e._config.logo.width+";");if("opacity"in e._config.logo){var Qa=e._config.logo.opacity/100;Qa>1&&(Qa=1);Da+="opacity: "+Qa+";"}Da&&
(va+=' style="'+Da+'"')}f.insertAdjacentHTML("afterbegin",va+('><img src="'+ka+'"></div>'))}}if(e._config.nativecontrols)e.videoEl.setAttribute("controls","controls"),e.overlay_layers&&(e.overlay_layers.style.bottom="70px"),e.videoEl.addEventListener("fullscreenchange",function(c){return!1}.bind(e));else if(e._config.controlbar){var p=document.createElement("div");p.setAttribute("class","zwp-controlbar");e._config.isLive||aa(p,"zwp-vodplayer");p.innerHTML=wb(e._config);e.playerContainer.appendChild(p);
e.controlbar=p;e.updateRecordingMenuVisibility&&e.updateRecordingMenuVisibility();e.isMobile()&&e.removeVolumeBoostButton();(function(){var c=null,d=[".zwp-infoButton",".zwp-fullscrWinButton",".zwp-zoomButton"],g=[".zwp-snapshotButton",".zwp-segmentButton",".zwp-recordButton"],m=[".zwp-localPlaybackButton",".zwp-optionButton"];e.updateResponsiveControlbar=function(){var h=e.playerContainer.getBoundingClientRect().width||e.playerContainer.offsetWidth,u=h<790;d.forEach(function(fa){(fa=e.controlbar.querySelector(fa))&&
(u?aa(fa,"zwp-hidden"):X(fa,"zwp-hidden"))});var G=h<670;g.forEach(function(fa){(fa=e.controlbar.querySelector(fa))&&(G?aa(fa,"zwp-hidden"):X(fa,"zwp-hidden"))});var O=h<550;m.forEach(function(fa){(fa=e.controlbar.querySelector(fa))&&(O?aa(fa,"zwp-hidden"):X(fa,"zwp-hidden"))});var N=e.controlbar.querySelector(".zwp-streamtype");N&&(!e._config.isLive&&h<550?(aa(N,"zwp-hidden"),N.style.display="none"):(X(N,"zwp-hidden"),N.style.display="block"));var K=e.playerContainer.querySelector(".zwp__overlay-button");
N=96;K&&(N=h<670?64:h<790?80:96,K.style.width=N+"px",K.style.height=N+"px",K=K.querySelector("svg"))&&(K.setAttribute("width",N+"px"),K.setAttribute("height",N+"px"));K=e.playerContainer.querySelector(".zwp__overlay-loading");var Z=e.playerContainer.querySelector(".zwp__overlay-loading-bg-img");N=80;K&&(N=h<670?56:h<790?68:80,K.style.width=N+"px",K.style.height=N+"px",Z&&(Z.style.width=N+"px",Z.style.height=N+"px",h=Z.querySelector("svg")))&&(h.setAttribute("width",N+"px"),h.setAttribute("height",
N+"px"))};e.responsiveControlbarObserver=new ResizeObserver(function(h){c&&clearTimeout(c);c=setTimeout(function(){e.updateResponsiveControlbar()},150)});e.responsiveControlbarObserver.observe(e.playerContainer)})();requestAnimationFrame(function(){e.updateResponsiveControlbar&&e.updateResponsiveControlbar()});e.longPressState={isPressed:!1,isFastPlaying:!1,originalPlaybackRate:1,pressTimer:null,startX:0,startY:0,enabled:e._config.longPress2xSpeed!==!1};e.playbtn=p.querySelector(".zwp-playbtn");if(e.controlbar){p.addEventListener("dblclick",
function(c){c.stopPropagation()});ka=p.querySelectorAll("button.zwpbtn");ka.length>0&&(e.btnBindZwp=!0,ka.forEach(function(c){c.addEventListener("click",e.on_btnclick)}));ka=p.querySelectorAll(".zwp-recording-option");ka.length>0&&ka.forEach(function(c){c.addEventListener("click",e.on_btnclick)});e._config.disablePlayBtn&&(ka=p.querySelector(".zwp_playbtn"),aa(ka,"zwp_disabled"),ka.setAttribute("disabled","disabled"));ka=p.querySelectorAll(".zwp-speedMenu>li.zwp-speed-item");ka.length>0&&ka.forEach(function(c){c.addEventListener("click",
e.on_speedItemclick)});e.updateSpeedMenuMaxHeight=function(){var c=e.controlbar?e.controlbar.querySelector(".zwp-speedMenu"):null;c&&e.playerContainer&&(c.style.maxHeight=e.playerContainer.offsetHeight-50+"px")};e.panels=".zwp-chapterSearchPanel .zwp-shortcutHelpPanel .zwp-recordingSettingsPanel .zwp-volumeBoostPanel .zwp-colorSettingPanel .zwp-subtitleSearchPanel .zwp__mediainfo-viewer".split(" ");e.closeAllActivePanels=function(){var c=e;c.panels.forEach(function(d){var g=null;g=c.overlay_layers?
c.overlay_layers.querySelector(d):null;d===".zwp__mediainfo-viewer"&&g&&c.infoViewer?(d=g.querySelector(".closeBtn"))?d.click():typeof Ha==="function"&&(Ha(g,500,function(){g.remove()}),delete c.infoViewer):g&&g.style.display==="block"&&((d=g.querySelector(".closeBtn"))?d.click():typeof Ha==="function"?Ha(g,300,function(){g.style.display="none"}):g.style.display="none")});c._lastClosedParentMenu&&(c._lastClosedParentMenu.style.display="",delete c._lastClosedParentMenu)};e.closeAllMenus=function(){if(e.controlbar){var c=
e.controlbar.querySelectorAll(".is-active");c.length>0&&c.forEach(function(d){X(d,"is-active")})}};ka=function(c){if(e.controlbar){var d=e.controlbar.querySelectorAll(".is-active");if(d.length!==0){for(var g=!1,m=0;m<d.length;m++)if(d[m].contains(c.target)){g=!0;break}g||e.closeAllMenus()}}};e._closeMenusHandlerBound||(document.addEventListener("click",ka),e._closeMenusHandlerBound=!0);var B=p.querySelector(".zwp-speedButton");B&&(B.addEventListener("mouseenter",function(){e.updateSpeedMenuMaxHeight()}),
B.addEventListener("click",function(c){c.stopPropagation();e.updateSpeedMenuMaxHeight();ea(B,"is-active")?X(B,"is-active"):(e.closeAllMenus(),aa(B,"is-active"))}),e.updateSpeedMenuMaxHeight());var C=p.querySelector(".zwp-optionButton");C&&(C.addEventListener("mouseenter",function(c){e.closeAllMenus();e._lastClosedParentMenu&&(e._lastClosedParentMenu.style.display="",delete e._lastClosedParentMenu)}),C.addEventListener("click",function(c){c.stopPropagation();ea(C,"is-active")?X(C,"is-active"):(e.closeAllMenus(),
aa(C,"is-active"))}));var l=p.querySelector(".zwp-subtitleButton");l&&(l.addEventListener("mouseenter",function(c){e.closeAllMenus();e._lastClosedParentMenu&&(e._lastClosedParentMenu.style.display="",delete e._lastClosedParentMenu)}),l.addEventListener("click",function(c){c.stopPropagation();ea(l,"is-active")?X(l,"is-active"):(e.closeAllMenus(),aa(l,"is-active"))}));var w=p.querySelector(".zwp-qualityButton");w&&(w.addEventListener("mouseenter",function(c){e.closeAllMenus()}),w.addEventListener("click",
function(c){c.stopPropagation();ea(w,"is-active")?X(w,"is-active"):(e.closeAllMenus(),aa(w,"is-active"))}));var F=p.querySelector(".zwp-recordButton");F&&(F.addEventListener("mouseenter",function(c){e.closeAllMenus()}),F.addEventListener("click",function(c){c.stopPropagation();c.target===F&&ea(F,"is-active")&&X(F,"is-active")}));e.playerContainer&&(Ta.addElement(e.playerContainer),e.playerContainer.addEventListener("resize",function(c){this.updateSpeedMenuMaxHeight&&this.updateSpeedMenuMaxHeight()}.bind(e)));
var T=p.querySelector(".zwp-volume-docker");if(T){e.muteBtn=T.querySelector("button.zwp-muteBtn");e.volslider=T.querySelector(".zwp-volume-slider");e.voltotal=T.querySelector(".zwp-volume-total");e.volcurrent=e.volslider.querySelector(".zwp-volume-current");e.volthumb=e.volslider.querySelector(".zwp-volume-handle");var ra=function(c){if(c!==null&&!isNaN(c)&&c!==void 0){var d=H("unmuted","Unmuted"),g=H("muted","Muted");c=Math.max(0,c);c=Math.min(c,1);c===0?(X(T,"zwp__mute"),aa(T,"zwp__unmute"),g=e.muteBtn,
g.setAttribute("title",d),g.setAttribute("aria-label",d)):(X(T,"zwp__unmute"),aa(T,"zwp__mute"),d=e.muteBtn,d.setAttribute("title",g),d.setAttribute("aria-label",g));d=e.volthumb;g=e.volcurrent;c=c*100+"%";var m=getComputedStyle(d);g.style.bottom=0;g.style.height=c;d.style.bottom=c;d.style.marginBottom=-parseFloat(m.height)/2+"px"}},pa=function(c){var d=J(e.voltotal),g=getComputedStyle(e.voltotal),m=!0;c.type=="touchmove"&&(c.changedTouches&&(m=c.changedTouches[0],c.pageX=m.pageX,c.pageY=m.pageY),
m=!1);g=parseFloat(g.height);g=(g-(c.pageY-d.top))/g;d.top!==0&&d.left!==0&&(g=Math.max(0,g),g=Math.min(g,1),ra(g),d=e,d.setMuted(g===0),d.setVolume(g),m&&c.preventDefault(),c.stopPropagation())};e.positionVolumeThumb=ra;e.on_volthumb_mousemove=function(c){var d=c.target;oa&&(d===e.volslider||d.closest(".zwp-volume-slider"))&&pa(c)}.bind(e);e.on_volthumb_mouseup=function(c){oa&&("onpointerout"in document?(document.removeEventListener("pointermove",e.on_volthumb_mousemove),document.removeEventListener("pointerup",
e.on_volthumb_mouseup),document.removeEventListener("touchmove",e.on_volthumb_mousemove),document.removeEventListener("touchend",e.on_volthumb_mouseup)):(document.removeEventListener("mousemove",e.on_volthumb_mousemove),document.removeEventListener("mouseup",e.on_volthumb_mouseup)),oa=!1);xa||(e.volslider.style.display="none")}.bind(e);e.on_volthumb_mousedown=function(c){pa(c);"onpointerout"in document?(document.addEventListener("pointermove",e.on_volthumb_mousemove),document.addEventListener("pointerup",
e.on_volthumb_mouseup),document.addEventListener("touchmove",e.on_volthumb_mousemove),document.addEventListener("touchend",e.on_volthumb_mouseup)):(document.addEventListener("mousemove",e.on_volthumb_mousemove),document.addEventListener("mouseup",e.on_volthumb_mouseup));oa=!0;c.preventDefault();c.stopPropagation()}.bind(e);var Ga=e.volslider;T.addEventListener("mouseenter",function(c){c.target===T&&(Ga.style.display="block",xa=!0,c.preventDefault(),c.stopPropagation())});T.addEventListener("focusin",
function(){Ga.style.display="block";xa=!0});T.addEventListener("focusout",function(c){if(!c.relatedTarget||c.relatedTarget&&!c.relatedTarget.matches(".zwp-volume-slider"))Ga.style.display="none"});T.addEventListener("mouseleave",function(){xa=!1;oa||(Ga.style.display="none")});T.addEventListener("focusout",function(){xa=!1});T.addEventListener("keydown",function(c){var d=c.which||c.keyCode||0;c.preventDefault();c.stopPropagation();d==32&&(e.videoEl.muted?e.setMuted(!1):e.setMuted(!0))});Ga.addEventListener("dragstart",
function(){return!1});Ga.addEventListener("mouseover",function(){xa=!0});Ga.addEventListener("focusin",function(){Ga.style.display="block";xa=!0});Ga.addEventListener("focusout",function(){xa=!1;oa||(Ga.style.display="none")});Ga.addEventListener("mousedown",e.on_volthumb_mousedown)}if(ka=p.querySelector(".zwp-optionPanel"))ka=ka.querySelectorAll(".action-item"),ka.length>0&&ka.forEach(function(c){c.addEventListener("click",e.on_optionItemclick)})}}e._config.autoSmallWindow&&!e.windowScrollHandler&&
(e.windowScrollHandler=function(c){if(!this.isFullscr&&!this.isFullscrWin&&this.videoEl&&this.playerElm&&this.isPlaying&&!this.isInPicInPic)if(c=v(this.playerElm),(document.documentElement.scrollTop||document.body.scrollTop)>=c+this.playerElm.offsetHeight-100){if(!this.smallWindowMode){var d=this.playerContainer;Fb(d,function(){X(d,"zwp-smallwindow");d.style.left=null;d.style.top=null;d.style.width=null;d.style.height=null});aa(d,"zwp-smallwindow");c=L.innerWidth;c<496&&(d.style.width=c-20+"px",d.style.right=
"10px");this.smallWindowMode=!0}}else this.smallWindowMode&&(d=this.playerContainer,X(d,"zwp-smallwindow"),d.style.left=null,d.style.top=null,d.style.width=null,d.style.height=null,delete this.smallWindowMode)}.bind(e),L.addEventListener("scroll",e.windowScrollHandler));e._config.clientip||(e._config.clientip="");e.videoEl&&(e._config.muted?e.setMuted(!0):typeof L.allowAutoAudioPlay==="undefined"?(e.setMuted(!0),zb(function(c){c?e.setMuted(!1):e._config.disableMutedConfirm||e.mutedConfirmBox();L.allowAutoAudioPlay=
c})):L.allowAutoAudioPlay||(e.setMuted(!0),e._config.disableMutedConfirm||e.mutedConfirmBox()),e.videoEl.setAttribute("crossorigin","Anonymous"),e.isMobile()||e.audioContext||e.initAudioContext());e.handleLongPressStart=function(c){var d=this;!("ontouchstart"in document.documentElement||/iphone|ipad|ipod|android/i.test(navigator.userAgent))||!d.longPressState.enabled||d.playerContainer&&d.playerContainer.classList.contains("zwp-smallwindow")||c.touches&&c.touches.length>1||c.target.closest(".zwp-controlbar")||
(c=c.touches[0],d.longPressState.startX=c.clientX,d.longPressState.startY=c.clientY,d.longPressState.isPressed=!0,d.videoEl&&(d.longPressState.originalPlaybackRate=d.videoEl.playbackRate||1),d.longPressState.pressTimer=setTimeout(function(){d.longPressState.isPressed&&!d.longPressState.isFastPlaying&&d.activateLongPressSpeed()},300))};e.handleLongPressEnd=function(c){this.longPressState.pressTimer&&(clearTimeout(this.longPressState.pressTimer),this.longPressState.pressTimer=null);this.longPressState.isFastPlaying&&
this.deactivateLongPressSpeed();this.longPressState.isPressed=!1;this.longPressState.startX=0;this.longPressState.startY=0};e.handleLongPressMove=function(c){if(this.longPressState.isPressed){var d=c.touches[0],g=Math.abs(d.clientY-this.longPressState.startY);(Math.abs(d.clientX-this.longPressState.startX)>10||g>10)&&this.handleLongPressEnd(c)}};e.activateLongPressSpeed=function(){if(this.videoEl&&!this.videoEl.ended){this.videoEl.paused&&this.videoEl.play().catch(function(d){});this.videoEl.playbackRate=
2;this.longPressState.isFastPlaying=!0;var c=this.controlbar?this.controlbar.querySelector(".zwp-speedBtn"):null;c&&(c.innerHTML="2.0x")}};e.deactivateLongPressSpeed=function(){if(this.videoEl){this.videoEl.playbackRate=this.longPressState.originalPlaybackRate;this.longPressState.isFastPlaying=!1;var c=this.controlbar?this.controlbar.querySelector(".zwp-speedBtn"):null;if(c){var d=this.longPressState.originalPlaybackRate;c.innerHTML=d==1?H("speed","Rate"):d.toFixed(1)+"x"}}};ka=function(c){var d=
this;d.controlbar&&(d.isControlbarhidden?(d.controlbar.style.display="flex",X(d.playerElm,"hide-cursor"),jb(d.controlbar,500,function(g){g&&d.startHideControlbar(d)}),d.isControlbarhidden=!1):d.startHideControlbar(d))}.bind(e);e.playerElm.addEventListener("mousemove",ka);e.playerElm.addEventListener("touchmove",ka,{passive:!0});e.playerElm.addEventListener("touchstart",function(c){e.handleLongPressStart(c)},{passive:!1});e.playerElm.addEventListener("touchend",function(c){e.handleLongPressEnd(c)});
e.playerElm.addEventListener("touchcancel",function(c){e.handleLongPressEnd(c)});e.playerElm.addEventListener("touchmove",function(c){e.handleLongPressMove(c)},{passive:!0});e.playerElm.addEventListener("dblclick",function(c){this.overlayLayerClickTimer&&(L.clearTimeout(this.overlayLayerClickTimer),delete this.overlayLayerClickTimer);if(this.controlbar&&(c={},c.currentTarget=this.controlbar.querySelector(".zwp-fullscrBtn"),c.currentTarget))this.on_btnclick(c)}.bind(e));xb()?e._config.autoplay=!1:
typeof e._config.autoplay=="undefined"&&(e._config.autoplay=!0);e._config.url&&e._config.autoplay&&e.play(e._config.url);typeof e._config.onready=="function"&&e._config.onready.call(e);e._config.chapters&&(e.chapters=e._config.chapters);e._config.lostFocusPause&&typeof document.visibilityState!=="undefined"&&document.addEventListener("visibilitychange",function(){this._config.isLive||this.isInPicInPic||(document.visibilityState==="visible"?this.focusPaused&&this.videoEl.paused&&!this.videoEl.ended&&
(this.videoEl.play(),this.setplaystate(!0),delete this.focusPaused):this.focusPaused||this.videoEl.paused||this.videoEl.ended||(this.videoEl.pause(),this.setplaystate(!1),this.focusPaused=!0))}.bind(e));e._config.fluid?e._config.autoplay||(ja(e),e.isMobile&&e.isMobile()||(aa(e.playerElm,"zwp-fluid"),e.playerElm.style.maxWidth="100%",e.playerElm.style.width="100%",e.playerElm.style.height="0",ka=ua(e._config),e.playerElm.style.paddingTop=ka+"%"),e.isMobile&&e.isMobile()&&L.matchMedia&&(ka=function(){var c=
null;return function(){c&&clearTimeout(c);c=setTimeout(function(){ja(e);c=null},200)}}(),f=L.matchMedia("(orientation: landscape)"),f.addEventListener&&(f.addEventListener("change",ka),e._orientationQuery=f,e._orientationHandler=ka),L.addEventListener("resize",ka),e._resizeHandler=ka)):e._config.width&&e._config.height&&(e.playerElm.style.width=typeof e._config.width==="number"?e._config.width+"px":e._config.width,e.playerElm.style.height=typeof e._config.height==="number"?e._config.height+"px":e._config.height);
e.initializeDragDrop=function(){if(e._config.localPlayback){var c=e.playerContainer||e.playerElm;c&&(["dragenter","dragover","dragleave","drop"].forEach(function(d){c.addEventListener(d,e.preventDefaults,!1);document.body.addEventListener(d,e.preventDefaults,!1)}),["dragenter","dragover"].forEach(function(d){c.addEventListener(d,e.highlight,!1)}),["dragleave","drop"].forEach(function(d){c.addEventListener(d,e.unhighlight,!1)}),c.addEventListener("drop",e.handleDrop,!1))}};e.preventDefaults=function(c){c.preventDefault();
c.stopPropagation()};e.highlight=function(c){e._config.localPlayback&&(c=e.playerContainer||e.playerElm,aa(c,"zwp-drag-over"),e.localPlaybackHint&&e.localPlaybackHint.style.display!=="none"&&aa(c,"zwp-drag-over-no-prompt"))};e.unhighlight=function(c){c=e.playerContainer||e.playerElm;X(c,"zwp-drag-over");X(c,"zwp-drag-over-no-prompt")};e.handleDrop=function(c){e._config.localPlayback&&(c=c.dataTransfer.files,c.length>0&&e.handleFiles(c))};e.handleFiles=function(c){c=Array.prototype.slice.call(c);var d=
0,g=0,m=0,h=[],u=[],G=[],O=e.murl||e._config.url;c=c.map(function(N){return e.detectFileType(N).then(function(K){K==="video"?d<1&&(d++,h.push({file:N,type:K})):K==="subtitle"?g<2&&(g++,u.push({file:N,type:K})):K==="chapter"&&m<1&&(m++,G.push({file:N,type:K}))}).catch(function(K){e.toast(H("unsupportedFormat","Unsupported format")+": "+N.name,3E3,!0)})});Promise.all(c).then(function(){h.length>0&&e.uploadFile(h[0].file);setTimeout(function(){u.length>0&&(e._closePanel("subtitleSearchPanel"),u.forEach(function(K,
Z){K=K.file;Z=(Z+1).toString();var fa=e.getBaseFilename(K.name)||K.name;e.loadSubtitle(K,Z,fa);u.length===1&&e.toast(H("subtitleLoaded","Subtitle loaded: ")+K.name,2E3,!1)}),u.length>1&&e.toast(H("multipleSubtitlesLoaded","Loaded ")+u.length+H("multipleSubtitlesLoaded2"," subtitle files"),2E3,!1));if(G.length>0&&(e._closePanel("chapterSearchPanel"),e._config.chapterButton!==!1)){var N=G[0].file;e.chapters=N;e._config.chapterButton=!0;e.loadChapters();e.toast(H("chapterLoaded","Chapter loaded: ")+
N.name,2E3,!1)}h.length===0&&u.length+G.length>0&&(O?(u.length>0&&e.toast(H("subtitleLoaded","Subtitle loaded"),2E3,!1),G.length>0&&e.toast(H("chapterLoaded","Chapter loaded"),2E3,!1)):e.toast(H("subtitleChapterNoVideo","Selected subtitle/chapter files have no video to attach to, ignored"),3E3,!0))},h.length>0?500:0)}).catch(function(N){e.toast(H("loadFailed","Load failed"),3E3,!0)})};e.uploadFile=async function(c){if(e._config.localPlayback){var d={file:c,name:c.name,size:c.size,lastModified:c.lastModified,
type:c.type,timestamp:(new Date).toISOString()};typeof e._config.onFileSelected==="function"&&e._config.onFileSelected.call(e,d);var g=await e.detectMimeType(c);d.detectedMime=g;await e.isValidVideoFile(c,g)?(g=URL.createObjectURL(c),d.url=g,e.loadingOverlay&&(e.loadingOverlay.style.display="block"),e.playLocalFile(g,c.name,d),typeof e._config.onFileLoaded==="function"&&e._config.onFileLoaded.call(e,d)):(d.error=H("unsupportedFormat","Unsupported format"),d.errorCode="UNSUPPORTED_FORMAT",typeof e._config.onFileError===
"function"&&e._config.onFileError.call(e,d),e.toast(H("unsupportedFormat","Unsupported format")+": "+g,3E3,!0))}else e.toast(H("localFileDisabled","Local file playback is disabled"),3E3,!0)};e._mimeCache=new Map;e.detectMimeType=async function(c){var d=c.name+"_"+c.size+"_"+c.lastModified;if(e._mimeCache.has(d))return e._mimeCache.get(d);var g;try{var m=await e.readFileHeader(c,16),h=e.detectMimeTypeFromHeader(m);h&&(g=h)}catch(u){}!g&&c.type&&c.type!==""&&(g=c.type);g||(c=e.getFileExtension(c.name),
g=e.getMimeFromExtension(c)||"application/octet-stream");e._mimeCache.set(d,g);return g};e.readFileHeader=function(c,d){return new Promise(function(g,m){var h=new FileReader;h.onload=function(u){g(u.target.result)};h.onerror=m;h.readAsArrayBuffer(c.slice(0,d))})};e.detectMimeTypeFromHeader=function(c){if(!c||c.byteLength===0)return null;c=new Uint8Array(c);return c.length>=8&&c[4]===102&&c[5]===116&&c[6]===121&&c[7]===112?"video/mp4":c.length>=4&&c[0]===26&&c[1]===69&&c[2]===223&&c[3]===163?"video/webm":
c.length>=12&&c[0]===82&&c[1]===73&&c[2]===70&&c[3]===70&&c[8]===65&&c[9]===86&&c[10]===73&&c[11]===32?"video/x-msvideo":c.length>=8&&(c[4]===109&&c[5]===111&&c[6]===111&&c[7]===118||c[4]===102&&c[5]===114&&c[6]===101&&c[7]===101)?"video/quicktime":c.length>=4&&c[0]===70&&c[1]===76&&c[2]===86&&c[3]===1?"video/x-flv":c.length>=4&&c[0]===26&&c[1]===69&&c[2]===223&&c[3]===163?"video/x-matroska":c.length>=16&&c[0]===48&&c[1]===38&&c[2]===178&&c[3]===117&&c[8]===6&&c[9]===230?"video/x-ms-wmv":c.length>=
4&&(c[0]===71&&c[1]===64||c[0]===71&&(c[1]&240)===64)?"video/mp2t":null};e.getFileExtension=function(c){var d=c.lastIndexOf(".");return d!==-1?c.substring(d).toLowerCase():""};e.getBaseFilename=function(c){if(!c)return"";var d=c,g=Math.max(c.lastIndexOf("/"),c.lastIndexOf("\\"));g!==-1&&(d=c.substring(g+1));c=d.lastIndexOf(".");c!==-1&&(d=d.substring(0,c));return d};e.getMimeFromExtension=function(c){return{".mp4":"video/mp4",".webm":"video/webm",".ogg":"video/ogg",".ogv":"video/ogg",".mov":"video/quicktime",
".avi":"video/x-msvideo",".wmv":"video/x-ms-wmv",".flv":"video/x-flv",".mkv":"video/x-matroska",".3gp":"video/3gpp",".3g2":"video/3gpp2",".m4v":"video/x-m4v",".ts":"video/mp2t",".m4a":"audio/mp4",".mp3":"audio/mpeg",".wav":"audio/wav",".flac":"audio/flac",".opus":"audio/opus",".m3u8":"application/x-mpegURL",".dash":"application/dash+xml",".srt":"text/plain",".vtt":"text/vtt",".webvtt":"text/vtt",".ass":"text/plain",".ssa":"text/plain",".sub":"text/plain",".sbv":"text/plain",".txt":"text/plain",".bcc":"application/json",
".json":"application/json"}[c]||null};e.isValidVideoFile=async function(c,d){var g=".mp4 .webm .ogg .ogv .mov .mkv .m4v .flac .wav .m4a .mp3 .opus".split(" ");c=c.name.toLowerCase();for(var m=".srt .vtt .webvtt .ass .ssa .sub .sbv .txt .bcc".split(" "),h=0;h<m.length;h++)if(c.endsWith(m[h]))return!1;if("video/mp4 video/webm video/ogg video/ogv video/quicktime video/x-matroska video/x-m4v video/H264 video/h264 audio/wav audio/x-wav audio/flac audio/opus audio/mp4 audio/mpeg audio/ogg".split(" ").indexOf(d)!==
-1)return!0;if("video/mp2t video/3gpp video/avi video/x-ms-wmv video/x-flv video/x-msvideo video/MP2T application/vnd.apple.mpegurl application/x-mpegURL application/dash+xml".split(" ").indexOf(d)!==-1||d&&d.startsWith("text/"))return!1;if(d&&(d.startsWith("video/")||d.startsWith("audio/")))return!0;for(h=0;h<g.length;h++)if(c.endsWith(g[h]))return!0;return!1};e.readContentFromSource=async function(c){if(typeof c==="object"&&c instanceof File)return await e.readFileContent(c);if(typeof c==="string")try{return await (await fetch(c)).text()}catch(d){throw d;
}throw Error("Unsupported source type");};e.validateJsonContent=async function(c,d){try{var g=await e.readContentFromSource(c),m=JSON.parse(g);if(d==="subtitle"){if(m.hasOwnProperty("body")&&Array.isArray(m.body))return!0}else if(d==="chapter"&&Array.isArray(m)&&m.length>0){var h=m[0];if(h.hasOwnProperty("title")&&h.hasOwnProperty("time"))return!0}return!1}catch(u){return!1}};e.isValidSubtitleFile=async function(c,d){for(var g=[".srt",".vtt",".webvtt",".bcc"],m=c.name.toLowerCase(),h=0;h<g.length;h++)if(m.endsWith(g[h]))return!0;
return["text/plain","text/srt","text/vtt","text/webvtt"].indexOf(d)!==-1?!0:m.endsWith(".json")||d==="application/json"?await e.validateJsonContent(c,"subtitle"):!1};e.isValidChapterFile=async function(c,d){for(var g=[".vtt",".webvtt"],m=c.name.toLowerCase(),h=0;h<g.length;h++)if(m.endsWith(g[h]))return!0;return["text/plain","text/vtt","text/webvtt","application/x-chapters"].indexOf(d)!==-1||d&&d.startsWith("text/")?!0:m.endsWith(".json")||d==="application/json"?await e.validateJsonContent(c,"chapter"):
!1};e.readFileContent=function(c){return new Promise(function(d,g){var m=new FileReader;m.onload=function(h){d(h.target.result)};m.onerror=function(){g(Error("Failed to read file: "+c.name))};m.readAsText(c)})};e.truncateFilename=function(c){if(!c)return c;for(var d=0,g=0,m=0;m<c.length;m++)if(d=c.charAt(m).match(/[\u4e00-\u9fff]/)?d+2:d+1,d<=12)g=m+1;else break;return d<=12?c:c.substring(0,g)+"..."};e.detectFileType=async function(c){var d=c.name.toLowerCase();d=e.getFileExtension(d);var g=await e.detectMimeType(c);
return[".srt",".vtt",".webvtt",".bcc",".json"].indexOf(d)!==-1&&await e.isValidSubtitleFile(c,g)?"subtitle":[".vtt",".webvtt",".json"].indexOf(d)!==-1&&await e.isValidChapterFile(c,g)?"chapter":await e.isValidVideoFile(c,g)?"video":"unknown"};e.playLocalFile=function(c,d,g){(e.murl||e._config.url)&&e.stop();e._config.url=c;e.murl=c;e.currentFileName=d;e.isPlaying=!0;e.force_stopped=!1;e.loadingOverlay&&(e.loadingOverlay.style.display="flex");var m=y(e);if(m){e.setupEventsHandler();e.startHideControlbar(e);
e.toast(H("playingFile","playing")+": "+d,2E3,!1);var h={fileName:d,fileURL:c,timestamp:(new Date).toISOString(),source:"local"};g&&Object.assign(h,g);typeof e._config.onLocalFilePlaybackStart==="function"&&e._config.onLocalFilePlaybackStart.call(e,h);e.updateLocalPlaybackHint&&e.updateLocalPlaybackHint();e.localFileUrls||(e.localFileUrls=[]);e.localFileUrls.push(c);e.videoEl.addEventListener("loadeddata",function(){e.setplaystate(!0);var u={fileName:d,fileURL:c,duration:e.videoEl.duration,videoWidth:e.videoEl.videoWidth,
videoHeight:e.videoEl.videoHeight,currentTime:e.videoEl.currentTime,playbackRate:e.videoEl.playbackRate};g&&Object.assign(u,g);typeof e._config.onLocalFileMetadataReady==="function"&&e._config.onLocalFileMetadataReady.call(e,u)},{once:!0});e.videoEl.readyState>=2&&(e.setplaystate(!0),h={fileName:d,fileURL:c,duration:e.videoEl.duration,videoWidth:e.videoEl.videoWidth,videoHeight:e.videoEl.videoHeight,currentTime:e.videoEl.currentTime,playbackRate:e.videoEl.playbackRate},g&&Object.assign(h,g),typeof e._config.onLocalFileMetadataReady===
"function"&&e._config.onLocalFileMetadataReady.call(e,h))}else h={fileName:d,fileURL:c,error:H("unsupportedFormat","Unsupported format"),errorCode:"PLAYBACK_FAILED",timestamp:(new Date).toISOString()},g&&Object.assign(h,g),typeof e._config.onLocalFilePlaybackError==="function"&&e._config.onLocalFilePlaybackError.call(e,h),e.toast(H("unsupportedFormat","Unsupported format"),3E3,!0),e.loadingOverlay&&(e.loadingOverlay.style.display="none"),e.isPlaying=!1,e._config.url=null,e.murl=null;return m};e.cleanupLocalFiles=
function(){this.localFileUrls&&(this.localFileUrls.forEach(function(c){URL.revokeObjectURL(c)}),this.localFileUrls=[])};e.selectLocalFile=function(){if(e._config.localPlayback){var c=document.createElement("input");c.type="file";c.accept="video/*,.mp4,.webm,.ogg,.ogv,.mov,.mkv,.m4v,audio/*,.flac,.wav,.m4a,.mp3,.opus,.vtt,.webvtt,.srt,.json,.bcc";c.multiple=!0;c.onchange=function(d){d=d.target.files;d.length>0&&e.handleFiles(d)};c.click()}else e.toast(H("localFileDisabled","Local file playback is disabled"),
3E3,!0)};if(e.playerContainer)e.initializeDragDrop();else{var Ja=function(){e.playerContainer?e.initializeDragDrop():setTimeout(Ja,100)};setTimeout(Ja,100)}e._config.localPlayback&&(e.updateLocalPlaybackHint(),e.localPlaybackHint&&(ka=e.localPlaybackHint.querySelector(".zwp-local-playback-text"),f=e.localPlaybackHint.querySelector(".zwp-local-playback-subtitle"),ka&&(ka.textContent=H("selectOrDropVideo","Select or drag video/audio files")),f&&(f.textContent=H("supportedFormats","Supports MP4, WebM, MOV, MKV, M4V, OGG, FLAC, WAV, M4A, MP3, OPUS and other formats")),
e.localPlaybackHint.setAttribute("aria-label",H("selectLocalVideo","Select Local Video File"))),e.updateDragDropText=function(){var c=document.getElementById("zwp-dragdrop-text-style");c&&c.remove();c=document.createElement("style");c.id="zwp-dragdrop-text-style";c.textContent='.zwp-drag-over::before { content: "'+H("dragDropToPlay","Drag and drop video/audio files here to play")+'" !important; }';document.head.appendChild(c)},e.updateDragDropText());e.initKeyboardEvents=function(){!this.keyboardEventsInitialized&&
this.onKeydown&&this.onKeyup&&(document.addEventListener("keydown",this.onKeydown),document.addEventListener("keyup",this.onKeyup),this.keyboardEventsInitialized=!0)};e.initKeyboardEvents();return e},wa=async function(f){if(typeof L.RTCPeerConnection=="undefined")return alert("This browser does not support the stream.\r\nPlease play this stream in chrome!"),!1;var x=D(f.murl);if(!x)return f.toast(H("invalidInput","Invalid input")),!1;f.peer_conn=new RTCPeerConnection(typeof RTCPeerConnection.prototype.addTransceiver==
"function"?{iceServers:[],iceTransportPolicy:"all",bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan"}:null);f.mediaStream=new MediaStream;f.peer_conn.ontrack=function(t){this.hasTracks||(this.setRtcstream(f.mediaStream),P());this.hasTracks++;this.mediaStream.addTrack(t.track);f.baseTrack&&t.track.kind!="video"||(f.baseTrack=t.track);f.rtcstatsTimerId||(f.packetsReceived=0,f.framesDecoded=0,f.emptyCount=0,f.rtcstatsTimerId=L.setInterval(function(){f.baseTrack&&f.peer_conn.getStats(f.baseTrack).then(R=>
{R.forEach(ca=>{ca.type=="inbound-rtp"&&ca.kind=="video"&&(ca.framesDecoded!=f.framesDecoded?(f.framesDecoded=ca.framesDecoded,f.packetsReceived=ca.packetsReceived,f.emptyCount=0):f.framesDecoded>0&&(f.emptyCount++,f.emptyCount>3&&(f.closecall(f),wa(f))))})})},1E3))}.bind(f);f.hasTracks=0;if(typeof f.peer_conn.addTransceiver=="function"){(typeof f._config.hasAudio==="undefined"||f._config.hasAudio)&&await f.peer_conn.addTransceiver("audio",{direction:"recvonly"});await f.peer_conn.addTransceiver("video",
{direction:"recvonly"});var b=await f.peer_conn.createOffer()}else b=await f.peer_conn.createOffer({offerToReceiveAudio:typeof f._config.hasAudio==="undefined"||f._config.hasAudio,offerToReceiveVideo:!0});await f.peer_conn.setLocalDescription(b);var r=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((R,ca)=>R+((ca&=63)<36?ca.toString(36):ca<62?(ca-26).toString(36).toUpperCase():ca>62?"-":"_"),"");if(x.provider==="trtc"){var q=x.urlObject.server,S="https://".concat("webrtc-signal-scheduler.tlivesource.com",
"/signal_query");q={domain:q,requestid:r(16),client_type:"Web",client_info:L.navigator.userAgent};if((S=await n(S,q))&&S.errcode===0)x.apiUrl="https://"+S.data.signal_domain+"/webrtc/v1/pullstream",x.trtc_signal_domain=S.data.signal_domain;else return f.toast(H("failedToQueryTrtc","Failed to query TRTC signal server")),!1;f.trtc_createBitratesMenu=function(t){var R=t.indexOf("tabr_bitrates=");if(R>0){R+=14;var ca=t.indexOf("&",R);if(ca===-1)ca=t.length;else if(R=t.substring(R,ca)){var Y=R.split(",",
4);if(Y.length>1){var ia=[];ca=void 0;for(R=0;R<Y.length;R++)ia.push({mediaType:"video",bitrate:void 0,height:0,width:0,qualityIndex:R,name:Y[R]}),ca===void 0&&(ca=R);this.switchQualityLevel=function(oa){var xa=this,e=parseInt(oa);e>ia.length||(e=Y[e],xa.trtc_svrsig&&Q("https://"+xa.trtc_signal_domain+"/webrtc/v1/tabrctl",JSON.stringify({svrsig:xa.trtc_svrsig,seq:f.trtc_quality_seq,bitrate_name:e}),function(Ka){Ka.errcode===0&&(xa.trtc_quality_seq++,xa.updateQualityLevel(oa,!1))},function(Ka){}))}.bind(this);
this.createQualitiesMenu(ia,!1);R=t.indexOf("tabr_start_bitrate=");R>0&&(R+=19,ca=t.indexOf("&",R),ca===-1&&(ca=t.length),t=t.substring(R,ca),ca=Y.indexOf(t));this.updateQualityLevel(ca,!1)}}}else this.resetQualitiesMenu()}.bind(f)}S=new Promise(function(t,R){var ca=null;if(x.provider==="brtc")var Y={streamurl:x.streamUrl,sdp:b.sdp};else x.provider==="trtc"?(Y=x.streamUrl,Y.indexOf("tabr_bitrates=")>0&&(Y+="&webrtc_tabr_level=client_control"),Y={clientinfo:"Windows NT 10.0;Chrome 142.0.0.0",localsdp:{type:"offer",
sdp:b.sdp},sessionid:r(),streamurl:Y}):x.provider==="artc"?Y={version:2,sdk_version:"0.0.1",mode:"live",pull_streams:[{url:x.streamUrl,amsid:["rts audio"],vmsid:["rts video"]}],jsep:{type:"offer",sdp:b.sdp}}:x.provider==="whep"?(Y=b.sdp,ca="application/sdp"):Y={api:x.apiUrl,rtcstream:x.streamUrl,clientip:null,sdp:b.sdp};x.urlObject.schema==="webrtc"&&(delete Y.rtcstream,Y.streamurl=x.streamUrl);typeof Y!=="string"&&(Y=JSON.stringify(Y));Q(x.apiUrl,Y,function(ia,oa){if(x.provider==="trtc"){if(ia.errcode){R(ia);
return}oa=ia.svrsig||"";ia=ia.remotesdp;ia.svrsig=oa;ia.signal_domain=x.trtc_signal_domain}else if(x.provider==="artc")ia.sdp=ia.jsep.sdp,ia.type="answer";else{if(x.provider==="whep"){ia={sdp:ia,type:"answer"};if(oa=oa.getResponseHeader("Location"))x.resourceUrl=(new URL(oa,x.apiUrl)).href;t(ia);return}if(ia.code){R(ia);return}}t(ia)},function(ia){R(ia)},ca)});f.closecall=function(t){t.rtcstatsTimerId&&(L.clearInterval(t.rtcstatsTimerId),delete t.rtcstatsTimerId);t.tryStartPlayTimer&&(L.clearTimeout(t.tryStartPlayTimer),
delete t.tryStartPlayTimer);typeof t.baseTrack!=="undefined"&&delete t.baseTrack;x.resourceUrl&&(U(x.resourceUrl),delete x.resourceUrl);typeof t.trtc_svrsig!=="undefined"&&(delete t.trtc_svrsig,delete t.trtc_quality_seq,delete t.trtc_signal_domain);typeof t.trtc_createBitratesMenu!=="undefined"&&delete t.trtc_createBitratesMenu;t.switchQualityLevel&&delete t.switchQualityLevel;t.peer_conn&&(t.videoEl&&(t.videoEl.srcObject=null),t.mediaStream&&delete t.mediaStream,t.peer_conn.close(),t.peer_conn=null)};
S.then(t=>{f.peer_conn.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:t.sdp}));x.provider==="trtc"&&(t.svrsig&&(f.trtc_svrsig=t.svrsig,f.trtc_quality_seq=1,f.trtc_signal_domain=t.signal_domain),f.trtc_createBitratesMenu(x.streamUrl))}).catch(t=>{"REQUEST:error"==t?f.tryStartPlayTimer=L.setTimeout(function(){delete f.tryStartPlayTimer;f.closecall(f);wa(f)},1E3):(f.peer_conn.close(),f.peer_conn=null)});return!0},Fa=async function(f){var x=f._config.xmc_url||L.xmc_url;if(!x)return f.toast(H("rtspNotSupported",
"The RTSP protocol is not supported without setting XMC")),!1;x+="play";f.wsclient&&(f.wsclient.close(),delete f.wsclient);x=x.replace("http","ws");var b=new WebSocket(x);b.onopen=function(){var r=typeof f._config.rtspOverTcp==="undefined"?1:f._config.rtspOverTcp,q=typeof f._config.rtsp_bypass==="boolean"?f._config.rtsp_bypass:0,S=typeof f._config.use_audio==="undefined"?0:f._config.use_audio,t="MediaSource"in L&&L.MediaSource.isTypeSupported("video/mp4;codecs=hvc1.1.1.L93.B0")?1:0;r=JSON.stringify({msgtype:"playurl",
data:{sourceurl:f.murl,rtsp_over_tcp:r,has_audio:S,has_hevc:t,rtsp_bypass:q}});b.send(r)};b.onmessage=function(r){r=JSON.parse(r.data);if(typeof r=="object"&&r.type==="onresult"&&r.event==="playurl"&&typeof r.streaminfo==="object")if(f.closecall2=function(S){S.waitSignTimer&&(L.clearTimeout(S.waitSignTimer),delete S.waitSignTimer);S.wsclient&&(S.wsclient.close(),S.wsclient=null,delete S.wsclient)},r.snapshot&&f.videoEl&&f.videoEl.setAttribute("poster",r.snapshot),f._config.useFlv||typeof r.streaminfo.rtc_playurl!==
"string")typeof r.streaminfo.http_playurl==="string"?(q=r.streaminfo.http_playurl+r.streaminfo.stream+".flv",f.murl=q,la(f)):f.closecall2(f);else{var q=r.streaminfo.rtc_playurl+r.streaminfo.stream+".rtc";r.first?f.waitSignTimer=setTimeout(function(){f.murl=q;wa(f);delete f.waitSignTimer},1E3):(f.murl=q,wa(f))}};b.onclose=function(){f.wsclient&&delete f.wsclient};b.onerror=function(){};f.wsclient=b;return!0},sa=function(f){db("flv_js",cb+"flv.min.js",function(x){var b=L.flvjs;if(!b.isSupported())return!1;
x=!1;typeof f._config.isLive==="boolean"&&(x=f._config.isLive);var r={type:"flv",isLive:x,url:f.murl};var q={enableWorker:!1,enableStashBuffer:!1,stashInitialSize:0,lazyLoad:!1,autoCleanupSourceBuffer:!0,lazyLoadMaxDuration:0,isLive:!0};f.openFlv=function(){var S=b.createPlayer(r,q);S.on(b.Events.METADATA_ARRIVED,function(t){f.loadingOverlay&&(f.loadingOverlay.style.display="none")});S.on(b.Events.ERROR,function(t){});S.attachMediaElement(f.videoEl);f.videoEl.playbackRate=1;f.onFlvStaticInfo=function(t){this.videoEl.paused||
(this.lastDecodedFrames?this.lastDecodedFrames!=t.decodedFrames?this.lastDecodedFrames=t.decodedFrames:(this.lastDecodedFrames=0,this.flvPlayer&&(this.closecall(this),this.openFlv(),this.setplaystate(!0))):this.lastDecodedFrames=t.decodedFrames)}.bind(f);f.onFlvError=function(t){t!=="NetworkError"||f.reconnectTimer||(f.reconnectTimer=L.setTimeout(function(){f.flvPlayer&&(f.closecall(f),f.openFlv(),f.setplaystate(!0));delete f.reconnectTimer},1E3))}.bind(f);f.onMediainfoCb=function(t){t&&this.setMediainfo("flvjs",
t)}.bind(f);S.on(b.Events.ERROR,f.onFlvError);S.on(b.Events.STATISTICS_INFO,f.onFlvStaticInfo);S.on(b.Events.MEDIA_INFO,f.onMediainfoCb);f.delayCheckTimerId=L.setInterval(function(){if(this.flvPlayer&&!this.videoEl.paused){var t=this.flvPlayer;if(t.buffered.length){let R=t.buffered.end(0)-t.currentTime;R>=6?t.currentTime=t.buffered.end(0)-.2:R>3&&(f.videoEl.playbackRate=1.5,f.fastForwardTimerId=setTimeout(function(){f.videoEl.playbackRate=1;delete f.fastForwardTimerId},R*2E3))}}}.bind(f),2E3);S.load();
S.play();f.flvPlayer=S;f.closecall=function(t){if(t.flvPlayer){var R=t.flvPlayer;R.off(b.Events.ERROR,t.onFlvError);R.off(b.Events.STATISTICS_INFO,t.onFlvStaticInfo);R.off(b.Events.MEDIA_INFO,t.onMediainfoCb);delete t.onFlvError;delete t.onFlvStaticInfo;delete t.onMediainfoCb;t.delayCheckTimerId&&(L.clearInterval(t.delayCheckTimerId),delete t.delayCheckTimerId);t.fastForwardTimerId&&(L.clearTimeout(t.fastForwardTimerId),delete t.fastForwardTimerId);t.reconnectTimer&&(L.clearTimeout(t.reconnectTimer),
delete t.reconnectTimer);R.pause();R.unload();R.detachMediaElement();R.destroy();delete t.flvPlayer}}};f.openFlv();f.setplaystate(!0)});return!0},la=function(f){db("mpeg_js",cb+"mpeg.min.js?v=2.1",function(x){x=mpegts.getFeatureList();if(!mpegts.isSupported()||!x.mseLivePlayback)return!1;f.openMpegts=function(){var b=f.videoEl,r={autoCleanupSourceBuffer:!0,stashInitialSize:128,autoCleanupMaxBackwardDuration:20,autoCleanupMinBackwardDuration:10,enableWorker:!0,enableStashBuffer:!1},q=void 0,S=void 0,
t=!1,R=!1,ca={type:"mse",url:f.murl};typeof f._config.hasAudio==="boolean"&&(q=f._config.hasAudio);typeof f._config.hasVideo==="boolean"&&(S=f._config.hasVideo);typeof f._config.isLive==="boolean"&&(t=f._config.isLive);ca.hasAudio=q;ca.hasVideo=S;if(ca.isLive=t)f._config.useCustomLiveSync?R=!0:(r.liveSync=typeof f._config.useLiveChasing==="boolean"?f._config.useLiveChasing:!0,r.liveSync&&(typeof f._config.liveSyncMaxLatency!=="undefined"&&(r.liveSyncMaxLatency=f._config.liveSyncMaxLatency),typeof f._config.liveSyncPlaybackRate!==
"undefined"&&(r.liveSyncPlaybackRate=f._config.liveSyncPlaybackRate)));r=mpegts.createPlayer(ca,r);f.onErrorCb=function(Y){var ia=this;Y!==mpegts.ErrorTypes.NETWORK_ERROR||ia.reconnectTimer||(ia.reconnectTimer=L.setTimeout(function(){ia.mpegtsPlayer&&(ia.closecall(ia),ia.openMpegts());delete ia.reconnectTimer},1E3))}.bind(f);f.onEventCb=function(Y){}.bind(f);f.onMetadataCb=function(Y){}.bind(f);f.onMediaInfoCb=function(Y){Y&&this.setMediainfo("mpegts",Y)}.bind(f);f.onStatisCb=function(Y){this.videoEl.paused||
(this.lastDecodedFrames?this.lastDecodedFrames!=Y.decodedFrames?(this.lastDecodedFrames=Y.decodedFrames,delete this.waitDecodedFrames):(typeof this.waitDecodedFrames==="undefined"?this.waitDecodedFrames=0:this.waitDecodedFrames++,this._config.reconnectByWaitFrames&&this.waitDecodedFrames>10&&(this.lastDecodedFrames=0,delete this.waitDecodedFrames,this.mpegtsPlayer&&(this.closecall(this),this.openMpegts()))):this.lastDecodedFrames=Y.decodedFrames)}.bind(f);f.closecall=function(Y){Y.checkDelayTimerId&&
(L.clearInterval(Y.checkDelayTimerId),delete Y.checkDelayTimerId);Y.reconnectTimer||(L.clearTimeout(Y.reconnectTimer),delete Y.reconnectTimer);Y.fastForwardTimerId&&(L.clearTimeout(Y.fastForwardTimerId),delete Y.fastForwardTimerId);if(Y.mpegtsPlayer){var ia=Y.mpegtsPlayer;ia.pause();ia.off(mpegts.Events.ERROR,Y.onErrorCb);ia.off(mpegts.Events.MEDIA_INFO,Y.onMediaInfoCb);ia.off(mpegts.Events.METADATA_ARRIVED,Y.onMetadataCb);ia.off(mpegts.Events.STATISTICS_INFO,Y.onStatisCb);ia.unload();ia.detachMediaElement();
ia.destroy();delete Y.onErrorCb;delete Y.onMediaInfoCb;delete Y.onMetadataCb;delete Y.onStatisCb;delete Y.onEventCb;delete Y.mpegtsPlayer}};R&&(f.checkDelayTimerId=L.setInterval(function(){var Y=this;if(Y.mpegtsPlayer&&!Y.videoEl.paused&&typeof Y.fastForwardTimerId==="undefined"&&Y.mpegtsPlayer.buffered.length){var ia=Y.mpegtsPlayer.buffered;ia=ia.end(ia.length-1)-Y.mpegtsPlayer.currentTime;var oa=1.2;if(ia>=6)oa=1.5;else if(ia<2)return;Y.videoEl.playbackRate=oa;Y.fastForwardTimerId=setTimeout(function(){Y.videoEl.playbackRate=
1;delete Y.fastForwardTimerId},ia/oa*1E3)}}.bind(f),2E3));r.on(mpegts.Events.ERROR,f.onErrorCb);r.on(mpegts.Events.MEDIA_INFO,f.onMediaInfoCb);r.on(mpegts.Events.METADATA_ARRIVED,f.onMetadataCb);r.on(mpegts.Events.STATISTICS_INFO,f.onStatisCb);r.attachMediaElement(b);r.load();r.play();f.mpegtsPlayer=r};f.openMpegts()});return!0},Ca=function(f){db("hls_js",cb+"hls.min.js",function(x){var b=L.Hls;if(b.isSupported()){var r=f,q=new b;q.on(b.Events.MEDIA_ATTACHED,function(){q.loadSource(f.murl);q.on(b.Events.MANIFEST_PARSED,
function(R,ca){r.loadingOverlay&&(r.loadingOverlay.style.display="none");r.videoEl.play();r.setplaystate(!0)})});q.on(b.Events.ERROR,function(R,ca){if(ca.fatal)switch(ca.type){case b.ErrorTypes.NETWORK_ERROR:q.startLoad();break;case b.ErrorTypes.MEDIA_ERROR:q.recoverMediaError();break;default:q.destroy(),delete f.hlsPlayer,r.setplaystate(!1)}});r.onHlsManifestParsed=function(R,ca){var Y=this;if(ca.levels.length>1){var ia=[];for(R=0;R<ca.levels.length;R++){var oa={mediaType:"video",bitrate:ca.levels[R].bitrate,
height:ca.levels[R].height,width:ca.levels[R].width,qualityIndex:R,name:ca.levels[R].name||void 0};ia.push(oa)}Y.switchQualityLevel=function(xa){q.nextLevel=parseInt(xa)}.bind(Y);Y.createQualitiesMenu(ia,q.autoLevelEnabled);q.on(b.Events.LEVEL_SWITCHED,function(xa,e){Y.updateQualityLevel(q.currentLevel,q.autoLevelEnabled)},Y)}else Y.resetQualitiesMenu();if(ca.subtitleTracks&&ca.subtitleTracks.length>0){ia=[];for(R=0;R<ca.subtitleTracks.length;R++)oa=ca.subtitleTracks[R],oa.forced||(oa={"default":oa.default,
id:oa.id,lang:oa.lang,name:oa.name,url:oa.url},ia.push(oa));Y.switchSubtitleTrack=function(xa){xa=parseInt(xa);xa===-1?q.subtitleDisplay=!1:(q.subtitleDisplay=!0,q.subtitleTrack=xa)};Y.createSubtitlesMenu(ia);q.on(b.Events.SUBTITLE_TRACK_SWITCH,function(xa,e){Y.updateSubtitleTrack(e.id)})}}.bind(r);r.onHlsManifestLoaded=function(R,ca){}.bind(r);q.on(b.Events.MANIFEST_PARSED,r.onHlsManifestParsed);q.on(b.Events.MANIFEST_LOADED,r.onHlsManifestLoaded);r.hlsPlayer=q;q.attachMedia(f.videoEl);r.closecall=
function(R){R.hlsPlayer&&(R.hlsPlayer.off(b.Events.MANIFEST_PARSED,R.onHlsManifestParsed),R.hlsPlayer.off(b.Events.MANIFEST_LOADED,R.onHlsManifestLoaded),R.hlsPlayer.detachMedia(),R.hlsPlayer.destroy(),delete R.hlsPlayer,delete R.onHlsManifestParsed,delete R.onHlsManifestLoaded)}}else if(f.videoEl.canPlayType("application/vnd.apple.mpegurl")){r=f;f.videoEl.zwplayer=f;var S=function(){typeof this.zwplayer=="object"&&(this.play(),this.zwplayer.setplaystate(!0))},t=function(){};r.videoEl.addEventListener("loadedmetadata",
S);r.videoEl.addEventListener("error",t);r.closecall=function(R){typeof R.videoEl==="object"&&(R.videoEl.pause(),R.videoEl.src="",R.videoEl.removeEventListener("loadedmetadata",S),R.videoEl.removeEventListener("error",t),typeof R.videoEl.zwplayer=="object"&&delete R.videoEl.zwplayer)};r.videoEl.src=r.murl}else return f.toast(H("cannotPlayHls","Player cannot play HLS media")),!1});return!0},ba=function(f){db("dash_js",cb+"dash.all.min.js",function(x){var b=L.dashjs,r=b.MediaPlayer().create();r.initialize(f.videoEl,
f.murl,!0);x=f.getSimpleSubtitleRenderer();r.attachTTMLRenderingDiv(x);f.dashTextTrackList={};f.onDashMetadata=function(q){this.loadingOverlay&&(this.loadingOverlay.style.display="none");this.videoEl.play();this.setplaystate(!0)}.bind(f);f.onDashQualityChanged=function(q){q=r.getQualityFor("video");var S=r.getSettings().streaming.abr.autoSwitchBitrate.video||!1;f.updateQualityLevel(q,S)}.bind(f);f.onDashStreamInitialized=function(q){r.getBitrateInfoListFor("audio");q=r.getBitrateInfoListFor("video")||
[];q.length>1?(this.switchQualityLevel=function(S){S=parseInt(S);var t={streaming:{abr:{autoSwitchBitrate:{}}}};S>=0?(t.streaming.abr.autoSwitchBitrate.video=!1,r.updateSettings(t),r.setQualityFor("video",S,!1)):(t.streaming.abr.autoSwitchBitrate.video=!0,r.updateSettings(t))}.bind(this),this.createQualitiesMenu(q),r.on(b.MediaPlayer.events.QUALITY_CHANGE_RENDERED,this.onDashQualityChanged,this)):this.resetQualitiesMenu()}.bind(f);f.onDashTracksAdded=function(q){var S=this.dashTextTrackList;S[q.streamId]||
(S[q.streamId]=[]);S[q.streamId]=S[q.streamId].concat(q.tracks)};f.onDashStreamDeactivated=function(q){var S=this.dashTextTrackList;q.streamInfo&&S[q.streamInfo.id]&&delete S[q.streamInfo.id]}.bind(f);f.onDashStreamActivated=function(q){q=q.streamInfo.id||"none";var S=this.dashTextTrackList;if(S[q]&&(q=S[q],!(q.length<1))){S=[];for(var t=0;t<q.length;t++){var R=q[t],ca=Gb(R.labels);ca?ca+=" : "+R.type:(ca=R.label||R.lang,ca+=" : "+R.kind);S.push({"default":R.defaultTrack,id:t,lang:R.lang,name:ca,
url:R.url||""})}this.switchSubtitleTrack=function(Y){var ia=this.dashPlayer||null;ia&&(parseInt(Y),ia.setTextTrack(Y))}.bind(this);this.createSubtitlesMenu(S)}}.bind(f);r.on(b.MediaPlayer.events.PLAYBACK_METADATA_LOADED,f.onDashMetadata,f);r.on(b.MediaPlayer.events.STREAM_INITIALIZED,f.onDashStreamInitialized,f);r.on(b.MediaPlayer.events.STREAM_ACTIVATED,f.onDashStreamActivated,f);r.on(b.MediaPlayer.events.STREAM_DEACTIVATED,f.onDashStreamDeactivated,f);r.on(b.MediaPlayer.events.TEXT_TRACKS_ADDED,
f.onDashTracksAdded,f);f.dashPlayer=r;f.closecall=function(q){q.dashPlayer&&(q.dashPlayer.pause(),q.dashPlayer.off(b.MediaPlayer.events.PLAYBACK_METADATA_LOADED,q.onDashMetadata,q),q.dashPlayer.off(b.MediaPlayer.events.STREAM_INITIALIZED,q.onDashStreamInitialized,q),q.dashPlayer.off(b.MediaPlayer.events.STREAM_ACTIVATED,q.onDashStreamActivated,q),q.dashPlayer.off(b.MediaPlayer.events.STREAM_DEACTIVATED,q.onDashStreamDeactivated,q),q.dashPlayer.on(b.MediaPlayer.events.TEXT_TRACKS_ADDED,f.onDashTracksAdded,
f),q.switchQualityLevel&&(q.dashPlayer.off(b.MediaPlayer.events.QUALITY_CHANGE_RENDERED,q.onDashQualityChanged,q),delete q.switchQualityLevel),q.dashPlayer.destroy(),delete q.dashPlayer,delete q.onDashMetadata,delete q.onDashStreamInitialized,delete q.onDashStreamActivated,delete q.onDashStreamDeactivated,delete q.onDashTracksAdded,delete q.switchSubtitleTrack)}});return!0},I=function(f,x){var b=f._config.cdn_addr||L.cdn_addr;if(!b)return f.toast(H("webcdnNotSupported","The WCDN protocol is not supported without setting CDN server address")),
!1;b.endsWith("/")||(b+="/");b+="cdnplay";f.wcdnClient&&(f.wcdnClient.close(),delete f.wcdnClient);b=b.replace("http","ws");L.location.protocol=="https:"&&(b=b.replace("ws:","wss:"));var r=x.indexOf("://");if(r<0)return f.toast(H("invalidWcdnUrl","Invalid WCDN URL: ")+x),!1;x=x.substr(r+3);(r=f._config.userInfo||L.userInfo)||(r={userid:"0",username:"Visitor",nickname:"Visitor"});var q={msgtype:"startplay",data:{userid:r.userid||"0",username:r.username||"Visitor",nickname:r.nickname||"Visitor",avatar:r.avatar||
"",streamurl:x}},S=function(t){var R=new WebSocket(b);R.onopen=function(ca){ca=JSON.stringify(q);R.send(ca)};R.onmessage=function(ca){if(typeof ca.data==="string")try{var Y=JSON.parse(ca.data),ia=Y.msgtype||"none",oa=Y.event||"none";if(ia==="onresult")if(oa==="startplay"){var xa=Y.data||null;if(xa&&typeof xa==="object"){ca=void 0;typeof t.closecall2==="function"&&(ca=t.closecall2,t.closecall2=null);Y={msgtype:"playstatus",data:{status:"playing"}};t.play(xa,!0)||(Y.data.status="error");var e=JSON.stringify(Y);
R.send(e);typeof ca==="function"&&(t.closecall2=ca)}else{var Ka=Y.msg||"Unknown error";Ka==="StreamNotExist"?(t.toast(H("waitStreamToReady","Waiting for stream")),t.errorHandleTimerId=L.setTimeout(function(){delete t.errorHandleTimerId;t.toast("closetoast");var va=JSON.stringify(q);R.send(va)},3E3)):(t.toast(H("streamError","Stream error")+": "+oa+" - "+Ka),t.errorHandleTimerId=L.setTimeout(function(){delete t.errorHandleTimerId;t.stop()},2E3))}}else oa==="endplay"&&t.stop();else ia==="error"?t.toast(H("streamError",
"Stream error")+": "+oa+" - "+(Y.msg||H("unknownError","Unknown error"))):ia==="command"&&(Y.action||"none")==="stopplay"&&(t.toast(H("serverClosed","Server is closed, player is stopped")),t.errorHandleTimerId=L.setTimeout(function(){delete t.errorHandleTimerId;t.stop()},100),t.wcdnClient&&(t.wcdnClient.ws.close(),t.wcdnClient=null))}catch(va){}};R.onerror=function(ca){};R.onclose=function(ca){this.wsVersionId===t.wsVersionId&&t.wcdnClient&&!t.cdnReconnectTimerId&&t.wcdnClient===this&&(t.cdnReconnectTimerId=
setTimeout(function(){S(t)},1E3),delete t.wcdnClient)};R.wsVersionId=(new Date).getTime();t.wcdnClient=R;t.wsVersionId=R.wsVersionId;typeof t.cdnReconnectTimerId!=="undefined"&&delete t.cdnReconnectTimerId};f.closecall2=function(t){f.cdnReconnectTimerId&&(clearTimeout(f.cdnReconnectTimerId),delete f.cdnReconnectTimerId);f.errorHandleTimerId&&(clearTimeout(f.errorHandleTimerId),delete f.errorHandleTimerId);f.wcdnClient?(t=f.wcdnClient,delete f.wcdnClient,t.close()):f.toast(H("wcdnConnectionClosed",
"The WCDN connection has been passively closed"))};S(f);return!0},y=function(f){var x=f.videoEl;f.closecall=function(b){if(b.isPlayVideo){var r=b.videoEl;r.paused||r.pause();r.src="";delete b.isPlayVideo}};f.isPlayVideo=!0;x.src=f.murl;f.resetPlaybackState();return!0},E=function(f){var x=f.videoEl;f.closecall=function(b){if(b.isPlayAudio){var r=b.videoEl;r.paused||r.pause();r.src="";delete b.isPlayAudio}};f.isPlayAudio=!0;x.src=f.murl;f.resetPlaybackState();return!0},A=function(f){var x=f.murl;if((x.type||
"")==="dvr"&&x.http)return f.murl=x.http,y(f);if(L.MediaSource&&L.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')){var b=L.RTCPeerConnection||L.webkitRTCPeerConnection||L.mozRTCPeerConnection||L.RTCIceGatherer;if(x.rtc&&b)return f.murl=x.rtc,wa(f);if(x["httpflv-n"])return f.murl=x["httpflv-n"],f._config.useOldFlv?sa(f):la(f);if(x.httpflv)return f.murl=x.httpflv,f._config.useOldFlv?sa(f):la(f);if(x["wsflv-n"])return f.murl=x["wsflv-n"],f._config.useOldFlv?sa(f):la(f);if(x.wsflv)return f.murl=
x.wsflv,f._config.useOldFlv?sa(f):la(f);if(x.hls)return f.murl=x.hls,Ca(f);if(x.dash)return f.murl=x.dash,ba(f);if(x.ts)return f.murl=x.ts,la(f)}else if(f.murl.hls)return f.murl=f.murl.hls,Ca(f);return!1},V=function(f){var x=[];var b=String.fromCharCode(107)+"u"+String.fromCharCode(97)+"ishou";var r=String.fromCharCode(46)+"co"+String.fromCharCode(109)+"/",q=String.fromCharCode(100)+"ou"+String.fromCharCode(121)+"i"+String.fromCharCode(110);x.push("https://live."+b+r+"u/");x.push("https://live."+
q+r);if(typeof f==="string"&&f.length>23)for(r=0;r<x.length;r++)if(b=x[r],f.indexOf(b)===0)return!0;return!1};ya.prototype={play:function(f,x,b){var r=this;if(f){r.murl&&r.stop();if(typeof f==="object"&&f instanceof File)try{var q=f;r.detectMimeType(q).then(function(ka){return r.isValidVideoFile(q,ka).then(function(Da){if(!Da)return r.toast(H("unsupportedFormat","Unsupported format")+": "+ka,3E3,!0),r.stop(),!1;Da=URL.createObjectURL(q);f=r._currentBlobUrl=Da;r._currentFile=q;Da=r.getFileExtension(q.name);
if(!Da||Da===".")if(ka.includes("mp4"))Da=".mp4";else if(ka.includes("webm"))Da=".webm";else if(ka.includes("ogg"))Da=".ogv";else if(ka.includes("avi"))Da=".avi";else if(ka.includes("mov"))Da=".mov";else if(ka.includes("flv"))Da=".flv";else if(ka.includes("m3u8"))Da=".m3u8";else if(ka.includes("mpd"))Da=".mpd";else if(ka.includes("mp2t")||ka.includes("ts"))Da=".ts";else if(ka.includes("matroska")||ka.includes("webm"))Da=".mkv";r._detectedFileExt=Da;r._detectedMimeType=ka})}).catch(function(ka){ka=
"."+q.name.split(".").pop().toLowerCase();r._detectedFileExt=ka;ka=URL.createObjectURL(q);r._currentFile=q;f=r._currentBlobUrl=ka})}catch(ka){return r.toast(H("loadFailed","Load failed"),3E3,!0),!1}if(typeof f==="string"&&(f.startsWith("wcdn://")||f.startsWith("wcdns://")))return x=I(r,f);if(typeof f==="object"){typeof f.thumbnails==="object"&&(r._config.thumbnails=JSON.parse(JSON.stringify(f.thumbnails)));if(typeof f.murls==="object"){r.multiStreams=JSON.parse(JSON.stringify(f));var S=f.murls}else Array.isArray(f)?
(r.multiStreams={},S=f):(r.multiStreams={},S=[f]),r.multiStreams.murls=S;var t=!0,R="",ca=[],Y;for(Y in S){var ia=S[Y];if(typeof ia==="object")if(Array.isArray(ia)){var oa="";var xa=ia[0];if(ia.length>2){var e=ia[2];oa=ia[1]}else e=ia.length>1?ia[1]:Y;ca.push({url:xa,name:e,mime:oa});t&&(f=xa,R=e,t=!1)}else{if(xa=!1,"default"in ia&&ia["default"]&&(xa=ia["default"]),t||xa)"url"in ia&&(f=ia.url),R=t="name"in ia?ia.name:Y,t=!1}else typeof ia==="string"&&t&&(t=Y,f=ia,R=t,t=!1)}ca.length>0&&(r.multiStreams.murls=
ca);r.multiStreams.curStream=R}r.murl=f}if(!r.murl)return!1;r.force_stopped=!1;r.isPlaying=!0;r.loadingOverlay&&(r.loadingOverlay.style.display="flex");typeof x!="undefined"&&(x?r._config.isLive=x:delete r._config.isLive);typeof b!="undefined"&&(b?r._config.useOldFlv=b:delete r._config.useOldFlv);x=!1;if(typeof r.murl=="object")x=A(r);else if(typeof r.murl=="string"){x=W(r.murl);!x&&r._detectedFileExt&&(x=r._detectedFileExt);!x&&(S=r.murl.indexOf("mime_type="),S>0&&(S+=10,ca=r.murl.indexOf("&",S),
ca<0&&(ca=r.murl.length),S=r.murl.substring(S,ca),S==="video_mp4"?x=".mp4":S==="video_flv"?x=".flv":S==="video_hls"?x=".m3u8":S==="video_rtc"?x=".rtc":S==="video_dash"&&(x=".mpd")),r.murl.indexOf("/whip-play/")>0||r.murl.indexOf("/whep/")>0||r.murl.indexOf("/whep?")>0)&&(x=".rtc");if(!x&&(typeof r._config.streamtype==="string"&&(r._config.streamtype==="httpflv"?x=".flv":r._config.streamtype==="hls"?x=".m3u8":r._config.streamtype==="dash"?x=".mpd":r._config.streamtype==="mpegts"?x=".ts":r._config.streamtype===
"webrtc"&&(x=".rtc")),!x&&V(r.murl))){var Ka=function(){setTimeout(function(){r.loadingOverlay&&(r.loadingOverlay.style.display="none")},1E3)};if(!r._config.url_proxy)return r.toast(H("cannotPlayMediaAddress","Sorry, the player cannot play this media address"),5E3,!0),Ka(),!1;var va=va;Q(r._config.url_proxy,JSON.stringify({roomUrl:r.murl,token:r._config.proxy_token||"12345678"}),function(ka){if(typeof ka==="object"&&ka.result){ka={murls:ka.flvStreams||ka.hlsStreams,multistream:1};if(!ka.murls)return r.toast(H("missingValidAddress",
"Sorry, missing valid address for this room"),5E3,!0),Ka(),!1;r.play(ka,va,b)}else r.toast(H("unableToObtainAddress","Sorry, unable to obtain a valid address for this room"),5E3,!0),Ka()},function(ka){r.toast(H("failedToGetAddress","Sorry, failed to get address due to network"),5E3,!0);Ka()});return!1}x=r.murl.indexOf("rtsp")===0?Fa(r):x===".rtc"||r.murl.startsWith("webrtc://")||r.murl.startsWith("brtc://")||r.murl.startsWith("trtc://")||r.murl.startsWith("artc://")?wa(r):x===".flv"?r._config.useOldFlv?
sa(r):la(r):x===".m3u8"?Ca(r):x===".mpd"?ba(r):x===".mp4"?y(r):x===".mp3"||x===".m4a"||x===".aac"||x===".mp4a"||x===".ogg"?E(r):x===".ts"?la(r):y(r)}x?(r.setupEventsHandler(),r.startHideControlbar(r),r.multiStreams&&L.setTimeout(function(){r.buildStreamSelector()},1E3)):(r.isPlaying=!1,r.loadingOverlay&&(r.loadingOverlay.style.display="none"),r.toast(H("unsupportedFormat","Unsupported format"),5E3,!0));return x},__switchStream:function(f){if(typeof f!=="string")this.toast(H("unsupportedOperation",
"Unsupported operation: ")+"switch stream");else{this.murl=f;f=W(this.murl);if(!f){var x=this.murl.indexOf("mime_type=");if(x>0){x+=10;var b=this.murl.indexOf("&",x);b<0&&(b=this.murl.length);x=this.murl.substring(x,b);x==="video_mp4"?f=".mp4":x==="video_flv"?f=".flv":x==="video_hls"?f=".m3u8":x==="video_rtc"?f=".rtc":x==="video_dash"&&(f=".mpd")}}f||typeof this._config.streamtype==="string"&&(this._config.streamtype==="httpflv"?f=".flv":this._config.streamtype==="hls"?f=".m3u8":this._config.streamtype===
"dash"?f=".mpd":this._config.streamtype==="mpegts"?f=".ts":this._config.streamtype==="webrtc"&&(f=".rtc"));!this._config.isLive&&this.videoEl&&(this.postSeekTime=this.videoEl.currentTime);this.closecall&&(this.closecall(this),delete this.closecall);this.closecall2&&(this.closecall2(this),delete this.closecall2);this.videoEl&&(this.videoEl.removeAttribute("src"),this.videoEl.load());(this.murl.indexOf("rtsp")===0?Fa(this):f===".rtc"||this.murl.startsWith("webrtc://")||this.murl.startsWith("brtc://")||
this.murl.startsWith("trtc://")||this.murl.startsWith("artc://")?wa(this):f===".flv"?this._config.useOldFlv?sa(this):la(this):f===".m3u8"?Ca(this):f===".mpd"?ba(this):f===".mp4"?y(this):f===".mp3"||f===".m4a"||f===".aac"||f===".mp4a"||f===".ogg"?E(this):f===".ts"?la(this):y(this))||this.toast(H("unsupportedFormat","Unsupported format"))}},stop:function(){this.closeAllActivePanels&&this.closeAllActivePanels();this.closeAllMenus&&this.closeAllMenus();this.closecall&&(this.closecall(this),this.removeVideoEventHandlers(),
delete this.closecall);this.closecall2&&(this.closecall2(this),delete this.closecall2);this.videoEl&&(this.videoEl.removeAttribute("src"),this.videoEl.load());if(this._currentBlobUrl){try{URL.revokeObjectURL(this._currentBlobUrl)}catch(f){}this._detectedFileExt=this._currentFile=this._currentBlobUrl=null}this.isPlaying=!1;this.setplaystate(!1);this.updateProgress(0);this.timeSpan&&(this.timeSpan.innerHTML="");this.controlbar&&(this.controlbar.querySelector(".zwp__duration-container").style.display=
"none");this.progressBar&&this.progressBar.streamtype&&(this.progressBar.streamtype.style.display="none");this.progressBar&&this.progressBar.chapters&&(this.progressBar.chapters.innerHTML="");this.clearAllSubtitles&&this.clearAllSubtitles();this.toastTimerId&&(clearTimeout(this.toastTimerId),delete this.toastTimerId,this.toastBox&&(this.overlay_layers.removeChild(this.toastBox),delete this.toastBox));this.mutedTipBox&&(this.popup_layers.removeChild(this.mutedTipBox),this.popup_layers.style.display=
null,delete this.mutedTipBox);this.overlayLayerClickTimer&&(L.clearTimeout(this.overlayLayerClickTimer),delete this.overlayLayerClickTimer);delete this.multiStreams;this.resetSpeedMenu();this.resetQualitiesMenu();this.removeChapters()},pause:function(){this.isPlaying&&this.videoEl&&!this.videoEl.paused&&!this.videoEl.ended&&(this.videoEl.pause(),this.setplaystate(!1))},resume:function(){this.isPlaying?this.videoEl&&(this.videoEl.paused||this.videoEl.ended)&&(this.videoEl.play(),this.setplaystate(!0)):
this._config.url&&this.play(this._config.url)},seekTime:function(f){if(this.isPlaying&&this.videoEl&&!(f<0)){var x=this.videoEl.duration;isNaN(x)||x===Infinity||(f>x&&(f=x),this.videoEl.currentTime=f)}},getDuration:function(){if(this.isPlaying&&this.videoEl)return this.videoEl.duration},destroy:function(){this.cleanupLocalFiles&&this.cleanupLocalFiles();this.closecall&&(this.closecall(this),this.removeVideoEventHandlers(),delete this.closecall);this.closecall2&&(this.closecall2(this),delete this.closecall2);
this.videoRemoveWhenClose&&(this.videoEl&&this.videoWrapper&&(this.videoWrapper.removeChild(this.videoEl),this.playerContainer.removeChild(this.videoWrapper),delete this.videoWrapper),delete this.videoRemoveWhenClose);this.audioContext&&(this.audioContext.state!=="closed"&&this.audioContext.close(),this.audioContext=null,delete this.audioContext);this.audioGainNode&&(this.audioGainNode=null,delete this.audioGainNode);this.audioVolumeNode&&(this.audioVolumeNode=null,delete this.audioVolumeNode);this.audioSource&&
(this.audioSource=null,delete this.audioSource);this.videoEl&&(this.videoEl.removeAttribute("src"),this.videoEl.load(),this.videoEl=null,delete this.videoEl);this.snapCanvas&&delete this.snapCanvas;this.controlbar&&(this.progressBar&&this.progressBar.chapters&&(this.progressBar.chapters.innerHTML=""),this.playerContainer.removeChild(this.controlbar),delete this.controlbar);this.danmuToolbar&&(this.danmuToolbar.remove(),delete this.danmuToolbar);this.subtitles&&delete this.subtitles;this.toastTimerId&&
(clearTimeout(this.toastTimerId),delete this.toastTimerId,this.toastBox&&(this.overlay_layers.removeChild(this.toastBox),delete this.toastBox));this.overlayLayerClickTimer&&(L.clearTimeout(this.overlayLayerClickTimer),delete this.overlayLayerClickTimer);this.overlay_layers&&(this.subtitle1&&delete this.subtitle1,this.subtitle2&&delete this.subtitle2,this.subtitleShow&&(Ta.removeElement(this.subtitleShow),delete this.subtitleShow),this.danmuPlayer&&(this.danmuPlayer.destroy(),delete this.danmuPlayer),
this.playerContainer.removeChild(this.overlay_layers),delete this.overlay_layers);this.popup_layers&&(this.playerContainer.removeChild(this.popup_layers),delete this.popup_layers);this.playerElm&&(delete this.playerContainer.zwpDragable,this.playerElm.removeChild(this.playerContainer),delete this.playerContainer,this.doDeletePlayerElm?(document.removeChild(this.playerElm),delete this.playerElm):this.doRemovePlayerClass&&(X(this.playerElm,"zwp-wrap"),this.playerElm.setAttribute("class",this.playerElmOldClass)));
this.windowScrollHandler&&(L.removeEventListener("scroll",this.windowScrollHandler),delete this.windowScrollHandler);this._orientationQuery&&this._orientationHandler&&(this._orientationQuery.removeEventListener&&this._orientationQuery.removeEventListener("change",this._orientationHandler),delete this._orientationQuery,delete this._orientationHandler);this._resizeHandler&&(L.removeEventListener("resize",this._resizeHandler),delete this._resizeHandler);this.updateLocalPlaybackHint&&this.updateLocalPlaybackHint()},
seekVideo:function(f){if(this.videoEl){var x=this.videoEl.duration||0;f=this.videoEl.currentTime+f;f<0?f=0:f>x&&(f=x);this.videoEl.currentTime=f}},setplaystate:function(f){if(this.controlbar){this.playbtn||(this.playbtn=this.controlbar.querySelector(".zwp-playbtn"));if(this.playbtn)if(f)this.playbtn.setAttribute("data-action","pause"),this.bigPlayOverlay&&(this.bigPlayOverlay.style.display="none");else{if(this.keyState&&this.keyState.isRewinding)return;this.playbtn.setAttribute("data-action","play");
this.updateLocalPlaybackHint?this.updateLocalPlaybackHint(!0):this.bigPlayOverlay&&(this.bigPlayOverlay.style.display="flex")}this.playerElm&&(f?(X(this.playerElm,"zwp-pause"),aa(this.playerElm,"zwp-playing")):(X(this.playerElm,"zwp-playing"),aa(this.playerElm,"zwp-pause")));this.loadingOverlay&&(this.loadingOverlay.style.display="none")}},setEnableDanmu:function(f){f?this.overlay_layers&&!this.danmuPlayer&&(this.danmuPlayer=HUAYI.Danmu.create({playerId:this.overlay_layers})):this.danmuPlayer&&(this.danmuPlayer.destroy(),
delete this.danmuPlayer)},appendDanmu:function(f,x){this.danmuPlayer&&(x||(x=this.danmuSetting),this.danmuPlayer.addDanmu(f,x))},setChapters:function(f){this._config.chapterButton!==!1&&(f===null?this.removeChapters():(this.chapters=f,this._config.chapterButton=!0,this.videoEl&&setTimeout(function(){this.loadChapters()}.bind(this),1E3)))},addSubtitle:function(f,x,b,r){typeof r==="undefined"&&(r=!0);this.loadSubtitle(f,x,b,r)},removeSubtitle:function(){this.showSubtitle(!1)},buildDanmuControlbar:function(f,
x){this.buildDanmuToolbar(f,x)},notifyResize:function(f,x){this.playerElm&&(typeof f!=="undefined"&&(typeof f==="number"&&(f+="px"),this.playerElm.style.width=f),typeof x!=="undefined"&&(typeof x==="number"&&(x+="px"),this.playerElm.style.height=x))},lightOff:function(){this.playerElm&&aa(this.playerElm,"zwp-state-light-off")},lightOn:function(){this.playerElm&&X(this.playerElm,"zwp-state-light-off")},get CurrentTime(){return this.isPlaying&&this.videoEl?this.videoEl.currentTime:-1},set CurrentTime(f){if(this.isPlaying&&
this.videoEl&&!(f<0)){var x=this.videoEl.duration;isNaN(x)||x===Infinity||(f>x&&(f=x),this.videoEl.currentTime=f)}},setLanguage:function(f,x){if(!f||!Ua[f])return!1;var b=Xa;if(f&&Ua[f]){var r=Xa;Xa=f;x&&typeof L!=="undefined"&&L.dispatchEvent&&(r=new CustomEvent("zwplayerLanguageChanged",{detail:{oldLang:r,newLang:f}}),L.dispatchEvent(r));r=!0}else r=!1;if(r){this._config.language=f;x&&this.controlbar&&this.refreshControlbar();if(this._config.onLanguageChange)this._config.onLanguageChange(b,f);return!0}return!1},
getLanguage:function(){return this._config.language||Xa},getText:function(f,x){var b=this.getLanguage();return H(f,x,b)},refreshControlbar:function(){if(this.controlbar&&this._config.controlbar!==!1){var f=this.isPlaying,x=this.videoEl?this.videoEl.currentTime:0;this.controlbar.innerHTML=wb(this._config);this.updateRecordingMenuVisibility&&this.updateRecordingMenuVisibility();this.isMobile()&&this.removeVolumeBoostButton();f&&this.videoEl&&(this.videoEl.currentTime=x)}this.localPlaybackHint&&this._config.localPlayback&&
(f=this.localPlaybackHint.querySelector(".zwp-local-playback-text"),x=this.localPlaybackHint.querySelector(".zwp-local-playback-subtitle"),f&&(f.textContent=H("selectOrDropVideo","Select or drag video/audio files")),x&&(x.textContent=H("supportedFormats","Supports MP4, WebM, MOV, MKV, M4V, OGG, FLAC, WAV, M4A, MP3, OPUS and other formats")),this.localPlaybackHint.setAttribute("aria-label",H("selectLocalVideo","Select Local Video File")));this.updateDragDropText&&this.updateDragDropText()}};return ya})})(window);
