(function(K){function Na(){return document.fullscreenElement||document.msFullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||!1}function bb(n,z,w){var y=new Date;y.setTime(y.getTime()+w*24*60*60*1E3);w="expires="+y.toGMTString();document.cookie=n+"="+z+"; "+w}function Ga(n,z,w){if(n){var y=parseInt(n.style.opacity)||1;y*=100;z=parseInt(z/50);z===0&&(z=1);var F=y/z;F<5&&(F=5);var J=setInterval(function(){y>0?(y-=F,y<0&&(y=0),n.style.opacity=y/100):(clearInterval(J),
typeof w=="function"&&w(n))},50);return J}return null}function Pa(n,z,w){if(n){var y=n.style.opacity;y*=100;z=parseInt(z/50);z===0&&(z=1);var F=(100-y)/z;F<5&&(F=5);var J=null;return J=setInterval(function(){y<100?(y+=F,y>100&&(y=100),n.style.opacity=y/100):(clearInterval(J),typeof w=="function"&&w(n))},50)}return null}function Qa(n,z){if(!n)return!1;if(n==z)return!0;var w=n.indexOf(z);if(w<0)return!1;if(w>0){if(n.charAt(w-1)==" "&&(n.length-w==z.length||n.charAt(w+z.length)==" "))return!0}else if(n.charAt(z.length)==
" ")return!0;return!1}function Ra(n,z,w){var y=new XMLHttpRequest;y.onreadystatechange=function(){y.readyState===4&&(y.status>=200&&y.status<300||y.status===304?z(y.response):typeof w==="function"&&w(y))};y.open("GET",n,!0);y.send(null)}function cb(n){const z=function(J,x,I){for(var L=I.length,N=0;N<L;N++)J.setUint8(x+N,I.charCodeAt(N))};var w=function(){var J=new ArrayBuffer(364);let x=new DataView(J);z(x,0,"RIFF");x.setUint32(4,204,!0);z(x,8,"WAVE");z(x,12,"fmt ");x.setUint32(16,16,!0);x.setUint16(20,
1,!0);x.setUint16(22,1,!0);x.setUint32(24,16E3,!0);x.setUint32(28,32E3,!0);x.setUint16(32,4,!0);x.setUint16(34,16,!0);z(x,36,"data");x.setUint32(40,320,!0);let I=44;for(let L=0;L<160;L++)x.setInt16(I,15,!0),I+=2;J=new Uint8Array(J);return"data:audio/x-wav;base64,"+btoa(String.fromCharCode.apply(null,J))}(),y=new Audio(w),F=K.setTimeout(function(){F=0;typeof n==="function"&&n(!1)},500);y.play().then(function(){F&&K.clearTimeout(F);y.pause();n(!0)}).catch(function(J){F&&K.clearTimeout(F);typeof n===
"function"&&n(!1)})}async function db(n){navigator.clipboard&&navigator.clipboard.write([new ClipboardItem({[n.type]:n})]).then(()=>{console.info("[setClipboard] clipboard suc")}).catch(z=>{console.error("[setClipboard] clipboard err",z)})}function eb(){var n=new Date,z=n.getMonth()+1;z<10&&(z="0"+z);var w=n.getDate();w<10&&(w="0"+w);var y=n.getHours();y<10&&(y="0"+y);var F=n.getMinutes();F<10&&(F="0"+F);var J=n.getSeconds();J<10&&(J="0"+J);var x=n.getMilliseconds();x<10?x="00"+x:x<100&&(x="0"+x);
return""+n.getFullYear()+z+w+y+F+J+x}function fb(n){var z={font_size:.4,font_color:"#FFFFFF",background_alpha:.5,background_color:"#9C27B0",Stroke:"none",body:[]},w=function(x){x=x.split(":");if(x.length!==3)return 0;var I=parseInt(x[0],10)*3600,L=parseInt(x[1],10)*60,N=parseInt(x[2],10),Q=x[2].indexOf(","),Z=0;Q>0&&(Z=parseInt(x[2].substr(Q+1))/1E3);return I+L+N+Z};n=n.replace(/\r/g,"");n=n.split("\n");for(var y=0;y<n.length-2;){var F={},J=n[y].trim();if(J){F.id=parseInt(J);J=n[y+1].split(" --\x3e ");
if(J.length!==2)break;F.from=w(J[0].trim());F.to=w(J[1].trim());F.location=2;F.content=n[y+2].trim();z.body.push(F);y+=3}else y++}return z}function Sa(n){var z={font_size:.4,font_color:"#FFFFFF",background_alpha:.5,background_color:"#9C27B0",Stroke:"none",body:[]},w=function(x){x=x.split(":");var I=0,L=0;if(x.length===3){I=parseInt(x[0],10)*3600;L=parseInt(x[1],10)*60;var N=parseInt(x[2],10)}else if(x.length===2)L=parseInt(x[0],10)*60,N=parseInt(x[1],10);else if(x.length===1)N=parseInt(x[0],10);else return 0;
var Q=x.length-1,Z=x[Q].indexOf("."),ca=0;Z>0&&(ca=parseInt(x[Q].substr(Z+1))/1E3);return I+L+N+ca};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 y=2;y<=n.length-2;){var F={};if(!n[y].startsWith("NOTE")&&n[y].trim()!==""){var J=n[y].split(" --\x3e ");if(J.length!==2&&(J=n[y].trim(),F.id=parseInt(J),y++,J=n[y].split(" --\x3e "),J.length!==2)){y++;continue}F.from=w(J[0].trim());F.to=w(J[1].trim());F.location=2;y++;F.content=
n[y].trim();for(y++;y<n.length;){J=n[y].trim();if(!J)break;F.content+="<br/>"+J;y++}z.body.push(F)}y++}return z}function Ta(n){return!(!n.width()&&!n.height())&&n.css("display")!=="none"}function gb(n,z){var w="smilesFaces-view",y=Da.path+"widgets/smiles/p",F=$$(n);if(!F.hasClass("disabled")){w=F.attr("data-viewid");if(!F.attr("data-viewinit")&&$$("#"+w).length<=0){var J=F.closest(".zwp-barrage_form");n='<div id="'+w+'" style="position:absolute;display:none;z-index:1138;" class="zwp-smileview"><table border="0" cellspacing="0" cellpadding="0"><tr>';
for(var x=1;x<=40;x++){var I="[sm-"+x+"]";n+='<td><img src="'+y+x+'.png" onclick="insertSmile(this,\''+I+"');\" /></td>";x%8==0&&(n+="</tr><tr>")}J.append(n+"</tr></table></div>");F.attr("data-viewinit","1");$$(document).click(function(){$$("#"+w).hide()});$$(K).on("resize",function(){var Q=$$("#"+w);Ta(Q)&&(F.offset(),Q.outerHeight(!1),F.outerWidth(!1),Q.outerWidth(!1))})}var L=$$("#"+w);if(Ta(L))L.hide();else{F.offset();L[0].style.opacity=0;L[0].style.display="block";L.outerHeight(!1);F.outerWidth(!1);
L.outerWidth(!1);y=F.parent().children("DIV.zwp-barrage_inp").children(".barrage_inp_text");L.get(0).inputbox=y.get(0);L.css({bottom:"36px",right:"26px"}).show();var N=function(){var Q=parseFloat(L[0].style.opacity);Q<=1&&(Q+=.1,Q>1&&(Q=1),L[0].style.opacity=Q,setTimeout(N,50))};setTimeout(N,50)}if(z=z||K.event)z.preventDefault?(z.preventDefault(),z.stopPropagation()):(K.event.cancelBubble=!0,K.event.returnValue=!1)}}function hb(n,z){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 w='<div class="zwp-captionbar"><button class="closeBtn" title="'+(pa("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",w);var y=function(N){N.stopPropagation();N.preventDefault();var Q=parseInt(n.offsetLeft),Z=parseInt(n.offsetTop),ca=N.pageX,aa=N.pageY,ia=K.innerWidth-n.offsetWidth-20,ma=K.innerHeight-n.offsetHeight-20,X=function(ja){var qa=Q+ja.pageX-ca;ja=Z+ja.pageY-aa;qa<0&&(qa=0);ja<0&&(ja=0);qa>ia&&(qa=ia);ja>ma&&(ja=ma);n.style.left=qa+"px";n.style.top=ja+"px";typeof n.zwpDragable==="object"&&(n.zwpDragable.oldX=qa,n.zwpDragable.oldY=ja)},ka=function(ja){document.removeEventListener("mousemove",
X);document.removeEventListener("mouseup",ka)};document.addEventListener("mousemove",X);document.addEventListener("mouseup",ka)};w=function(N){N.stopPropagation();N.preventDefault();var Q=n.offsetWidth,Z=N.pageX,ca=function(ia){ia=Q+ia.pageX-Z;ia<200&&(ia=200);n.style.width=ia+"px";typeof n.zwpDragable==="object"&&(n.zwpDragable.oldWidth=ia)},aa=function(ia){document.removeEventListener("mousemove",ca);document.removeEventListener("mouseup",aa)};document.addEventListener("mousemove",ca);document.addEventListener("mouseup",
aa)};var F=function(N){N.stopPropagation();N.preventDefault();var Q=n.offsetHeight,Z=N.pageY,ca=function(ia){ia=Q+ia.pageY-Z;ia<180&&(ia=180);n.style.height=ia+"px";typeof n.zwpDragable==="object"&&(n.zwpDragable.oldHeight=ia)},aa=function(ia){document.removeEventListener("mousemove",ca);document.removeEventListener("mouseup",aa)};document.addEventListener("mousemove",ca);document.addEventListener("mouseup",aa)},J=function(N){N.stopPropagation();N.preventDefault();var Q=n.offsetWidth,Z=n.offsetHeight,
ca=N.pageX,aa=N.pageY,ia=function(X){var ka=Q+X.pageX-ca;ka<200&&(ka=200);X=Z+X.pageY-aa;X<180&&(X=180);n.style.width=ka+"px";n.style.height=X+"px";typeof n.zwpDragable==="object"&&(n.zwpDragable.oldWidth=ka,n.zwpDragable.oldHeight=X)},ma=function(X){document.removeEventListener("mousemove",ia);document.removeEventListener("mouseup",ma)};document.addEventListener("mousemove",ia);document.addEventListener("mouseup",ma)};n.zwpDragable={};var x=n.querySelector(".zwp-captionbar");if(x){var I=x.querySelector(".closeBtn");
if(I){var L=z||function(){};I.addEventListener("click",function(N){N.preventDefault();N.stopPropagation();L(n)})}x.addEventListener("mousedown",y);n.zwpDragable.doc_mousedown=y}z=n.querySelector(".zwp-gripper-right");y=n.querySelector(".zwp-gripper-bottom");x=n.querySelector(".zwp-gripper-bottom-right");z&&(z.addEventListener("mousedown",w),n.zwpDragable.gripperR_mousedown=w);y&&(y.addEventListener("mousedown",F),n.zwpDragable.gripperB_mousedown=F);x&&(x.addEventListener("mousedown",J),n.zwpDragable.gripperBR_mousedown=
J);n.dragableWinInited=!0}}(function(n){var z=!1,w=!1,y=0,F=2E3,J=0,x=document,I=n(K),L=[],N=K.requestAnimationFrame||K.webkitRequestAnimationFrame||K.mozRequestAnimationFrame||!1,Q=K.cancelAnimationFrame||K.webkitCancelAnimationFrame||K.mozCancelAnimationFrame||!1;if(N)K.cancelAnimationFrame||(Q=function(T){});else{var Z=0;N=function(T,e){var h=(new Date).getTime(),m=Math.max(0,16-(h-Z));e=K.setTimeout(function(){T(h+m)},m);Z=h+m;return e};Q=function(T){K.clearTimeout(T)}}var ca=K.MutationObserver||
K.WebKitMutationObserver||!1,aa=Date.now||function(){return(new Date).getTime()},ia={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 T;(T=x.currentScript)||(T=x.getElementsByTagName("script"),T=T.length?T[T.length-1]:!1);T=T?T.src.split("?")[0]:"";return T.split("/").length>0?T.split("/").slice(0,-1).join("/")+"/":""}(),preventmultitouchscrolling:!0,disablemutationobserver:!1,enableobserver:!0,scrollbarid:!1,scrollCLass:!1},ma=!1,X=function(){if(ma)return ma;var T=x.createElement("DIV"),e=T.style,h=navigator.userAgent,m=navigator.platform,c={};c.haspointerlock="pointerLockElement"in x||"webkitPointerLockElement"in
x||"mozPointerLockElement"in x;c.isopera="opera"in K;c.isopera12=c.isopera&&"getUserMedia"in navigator;c.isoperamini=Object.prototype.toString.call(K.operamini)==="[object OperaMini]";c.isie="all"in x&&"attachEvent"in T&&!c.isopera;c.isieold=c.isie&&!("msInterpolationMode"in e);c.isie7=c.isie&&!c.isieold&&(!("documentMode"in x)||x.documentMode===7);c.isie8=c.isie&&"documentMode"in x&&x.documentMode===8;c.isie9=c.isie&&"performance"in K&&x.documentMode===9;c.isie10=c.isie&&"performance"in K&&x.documentMode===
10;c.isie11="msRequestFullscreen"in T&&x.documentMode>=11;c.ismsedge="msCredentials"in K;c.ismozilla="MozAppearance"in e;c.iswebkit=!c.ismsedge&&"WebkitAppearance"in e;c.ischrome=c.iswebkit&&"chrome"in K;c.ischrome38=c.ischrome&&"touchAction"in e;c.ischrome22=!c.ischrome38&&c.ischrome&&c.haspointerlock;c.ischrome26=!c.ischrome38&&c.ischrome&&"transition"in e;c.cantouch="ontouchstart"in x.documentElement||"ontouchstart"in K;c.hasw3ctouch=(K.PointerEvent||!1)&&(navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>
0);c.hasmstouch=!c.hasw3ctouch&&(K.MSPointerEvent||!1);c.ismac=/^mac$/i.test(m);c.isios=c.cantouch&&/iphone|ipad|ipod/i.test(m);c.isios4=c.isios&&!("seal"in Object);c.isios7=c.isios&&"webkitHidden"in x;c.isios8=c.isios&&"hidden"in x;c.isios10=c.isios&&K.Proxy;c.isandroid=/android/i.test(h);c.haseventlistener="addEventListener"in T;c.trstyle=!1;c.hastransform=!1;c.hastranslate3d=!1;c.transitionstyle=!1;c.hastransition=!1;c.transitionend=!1;c.trstyle="transform";c.hastransform="transform"in e||function(){for(var v=
["msTransform","webkitTransform","MozTransform","OTransform"],E=0,A=v.length;E<A;E++)if(e[v[E]]!==void 0){c.trstyle=v[E];break}c.hastransform=!!c.trstyle}();c.hastransform&&(e[c.trstyle]="translate3d(1px,2px,3px)",c.hastranslate3d=/translate3d/.test(e[c.trstyle]));c.transitionstyle="transition";c.prefixstyle="";c.transitionend="transitionend";c.hastransition="transition"in e||function(){c.transitionend=!1;for(var v="webkitTransition msTransition MozTransition OTransition OTransition KhtmlTransition".split(" "),
E="-webkit- -ms- -moz- -o- -o -khtml-".split(" "),A="webkitTransitionEnd msTransitionEnd transitionend otransitionend oTransitionEnd KhtmlTransitionEnd".split(" "),b=0,M=v.length;b<M;b++)if(v[b]in e){c.transitionstyle=v[b];c.prefixstyle=E[b];c.transitionend=A[b];break}c.ischrome26&&(c.prefixstyle=E[1]);c.hastransition=c.transitionstyle}();c.cursorgrabvalue=function(){var v=["grab","-webkit-grab","-moz-grab"];if(c.ischrome&&!c.ischrome38||c.isie)v=[];for(var E=0,A=v.length;E<A;E++){var b=v[E];e.cursor=
b;if(e.cursor==b)return b}return"url("+(ia.scriptpath+"css/openhand.cur),n-resize")}();c.hasmousecapture="setCapture"in T;c.hasMutationObserver=ca!==!1;T=null;return ma=c},ka=function(T,e){function h(){var g=b.doc.css(G.trstyle);return g&&g.substr(0,6)=="matrix"?g.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/):!1}function m(){var g=b.win;if("zIndex"in g)return g.zIndex();for(;g.length>0&&g[0].nodeType!=9;){var t=g.css("zIndex");if(!isNaN(t)&&t!==0)return parseInt(t);g=g.parent()}return!1}
function c(g,t,u){t=g.css(t);g=parseFloat(t);return isNaN(g)?(g=d[t]||0,u=g==3?u?b.win.outerHeight()-b.win.innerHeight():b.win.outerWidth()-b.win.innerWidth():1,b.isie8&&g&&(g+=1),u?g:0):g}function v(g,t,u,f){b._bind(g,t,function(q){q=q||K.event;var C={original:q,target:q.target||q.srcElement,type:"wheel",deltaMode:q.type=="MozMousePixelScroll"?0:1,deltaX:0,deltaZ:0,preventDefault:function(){q.preventDefault?q.preventDefault():q.returnValue=!1;return!1},stopImmediatePropagation:function(){q.stopImmediatePropagation?
q.stopImmediatePropagation():q.cancelBubble=!0}};t=="mousewheel"?(q.wheelDeltaX&&(C.deltaX=-.025*q.wheelDeltaX),q.wheelDeltaY&&(C.deltaY=-.025*q.wheelDeltaY),C.deltaY||C.deltaX||(C.deltaY=-.025*q.wheelDelta)):C.deltaY=q.detail;return u.call(g,C)},f)}function E(g,t,u,f){b.scrollrunning||(b.newscrolly=b.getScrollTop(),b.newscrollx=b.getScrollLeft(),O=aa());var q=aa()-O;O=aa();W=q>350?1:W+(2-W)/10;g=g*W|0;t=t*W|0;if(g){if(f)if(g<0){if(b.getScrollLeft()>=b.page.maxw)return!0}else if(b.getScrollLeft()<=
0)return!0;f=g>0?1:-1;P!==f&&(b.scrollmom&&b.scrollmom.stop(),b.newscrollx=b.getScrollLeft(),P=f);b.lastdeltax-=g}if(t){if(function(){var C=b.getScrollTop();if(t<0){if(C>=b.page.maxh)return!0}else if(C<=0)return!0}()){if(p.nativeparentscrolling&&u&&!b.ispage&&!b.zoomactive)return!0;u=b.view.h>>1;b.newscrolly<-u?(b.newscrolly=-u,t=-1):b.newscrolly>b.page.maxh+u?(b.newscrolly=b.page.maxh+u,t=1):t=0}u=t>0?1:-1;H!==u&&(b.scrollmom&&b.scrollmom.stop(),b.newscrolly=b.getScrollTop(),H=u);b.lastdeltay-=t}(t||
g)&&b.synched("relativexy",function(){var C=b.lastdeltay+b.newscrolly;b.lastdeltay=0;var R=b.lastdeltax+b.newscrollx;b.lastdeltax=0;b.rail.drag||b.doScrollPos(R,C)})}function A(g,t,u){if(!u&&S)return!0;if(g.deltaMode===0){var f=-(p.mousescrollstep/54*g.deltaX)|0;var q=-(p.mousescrollstep/54*g.deltaY)|0}else g.deltaMode===1&&(f=-(g.deltaX*p.mousescrollstep*50/80)|0,q=-(g.deltaY*p.mousescrollstep*50/80)|0);t&&p.oneaxismousemode&&f===0&&q&&(f=q,q=0,u&&(f<0?b.getScrollLeft()>=b.page.maxw:b.getScrollLeft()<=
0)&&(q=f,f=0));b.isrtlmode&&(f=-f);if(E(f,q,u,!0))u&&(S=!0);else return S=!1,g.stopImmediatePropagation(),g.preventDefault()}var b=this;this.version="3.7.6";this.name="nicescroll";this.me=e;var M=n("body"),p=this.opt={doc:M,win:!1};n.extend(p,ia);p.snapbackspeed=80;if(T)for(var V in p)T[V]!==void 0&&(p[V]=T[V]);p.disablemutationobserver&&(ca=!1);this.iddoc=(this.doc=p.doc)&&this.doc[0]?this.doc[0].id||"":"";this.ispage=/^BODY|HTML/.test(p.win?p.win[0].nodeName:this.doc[0].nodeName);this.haswrapper=
p.win!==!1;this.win=p.win||(this.ispage?I:this.doc);this.docscroll=this.ispage&&!this.haswrapper?I:this.win;this.body=M;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=p.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;p.rtlmode=="auto"?(T=this.win[0]==K?this.body:this.win,e=T.css("writing-mode")||T.css("-webkit-writing-mode")||T.css("-ms-writing-mode")||T.css("-moz-writing-mode"),e=="horizontal-tb"||e=="lr-tb"||e===""?(this.isrtlmode=T.css("direction")=="rtl",this.isvertical=!1):(this.isrtlmode=e=="vertical-rl"||e=="tb"||e=="tb-rl"||e=="rl-tb",this.isvertical=
e=="vertical-rl"||e=="tb"||e=="tb-rl")):(this.isrtlmode=p.rtlmode===!0,this.isvertical=!1);this.observerbody=this.observerremover=this.observer=this.scrollmom=this.scrollrunning=!1;if(p.scrollbarid!==!1)this.id=p.scrollbarid;else{do this.id="ascrail"+F++;while(x.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=
p.overflowx;this.overflowy=p.overflowy;this.nativescrollingarea=!1;this.checkarea=0;this.events=[];this.saved={};this.delaylist={};this.synclist={};this.lastdeltay=this.lastdeltax=0;this.detected=X();var G=n.extend({},this.detected);this.ishwscroll=(this.canhwscroll=G.hastransform&&p.hwacceleration)&&b.haswrapper;this.hasreversehr=this.isrtlmode?this.isvertical?!(G.iswebkit||G.isie||G.isie11):!(G.iswebkit||G.isie&&!G.isie10&&!G.isie11):!1;this.istouchcapable=!1;G.cantouch||!G.hasw3ctouch&&!G.hasmstouch?
!G.cantouch||G.isios||G.isandroid||!G.iswebkit&&!G.ismozilla||(this.istouchcapable=!0):this.istouchcapable=!0;p.enablemouselockapi||(G.hasmousecapture=!1,G.haspointerlock=!1);this.debounced=function(g,t,u){b&&(b.delaylist[g]||(b.delaylist[g]={h:N(function(){b.delaylist[g].fn.call(b);b.delaylist[g]=!1},u)},t.call(b)),b.delaylist[g].fn=t)};this.synched=function(g,t){b.synclist[g]?b.synclist[g]=t:(b.synclist[g]=t,N(function(){b&&(b.synclist[g]&&b.synclist[g].call(b),b.synclist[g]=null)}))};this.unsynched=
function(g){b.synclist[g]&&(b.synclist[g]=!1)};this.css=function(g,t){for(var u in t)b.saved.css.push([g,u,g.css(u)]),g.css(u,t[u])};this.scrollTop=function(g){return g===void 0?b.getScrollTop():b.setScrollTop(g)};this.scrollLeft=function(g){return g===void 0?b.getScrollLeft():b.setScrollLeft(g)};var fa=function(g,t,u,f,q,C,R){this.st=g;this.ed=t;this.spd=u;this.p1=f||0;this.p2=q||1;this.p3=C||0;this.p4=R||1;this.ts=aa();this.df=t-g};fa.prototype={B2:function(g){return 3*(1-g)*(1-g)*g},B3:function(g){return 3*
(1-g)*g*g},B4:function(g){return g*g*g},getPos:function(){return(aa()-this.ts)/this.spd},getNow:function(){var g=(aa()-this.ts)/this.spd,t=this.B2(g)+this.B3(g)+this.B4(g);return g>=1?this.ed:this.st+this.df*t|0},update:function(g,t){this.st=this.getNow();this.ed=g;this.spd=t;this.ts=aa();this.df=this.ed-this.st;return this}};if(this.ishwscroll){this.doc.translate={x:0,y:0,tx:"0px",ty:"0px"};G.hastranslate3d&&G.isios&&this.doc.css("-webkit-backface-visibility","hidden");this.getScrollTop=function(g){if(!g){if(g=
h())return g.length==16?-g[13]:-g[5];if(b.timerscroll&&b.timerscroll.bz)return b.timerscroll.bz.getNow()}return b.doc.translate.y};this.getScrollLeft=function(g){if(!g){if(g=h())return g.length==16?-g[12]:-g[4];if(b.timerscroll&&b.timerscroll.bh)return b.timerscroll.bh.getNow()}return b.doc.translate.x};this.notifyScrollEvent=function(g){var t=x.createEvent("UIEvents");t.initUIEvent("scroll",!1,!1,K,1);t.niceevent=!0;g.dispatchEvent(t)};var la=this.isrtlmode?1:-1;G.hastranslate3d&&p.enabletranslate3d?
(this.setScrollTop=function(g,t){b.doc.translate.y=g;b.doc.translate.ty=g*-1+"px";b.doc.css(G.trstyle,"translate3d("+b.doc.translate.tx+","+b.doc.translate.ty+",0)");t||b.notifyScrollEvent(b.win[0])},this.setScrollLeft=function(g,t){b.doc.translate.x=g;b.doc.translate.tx=g*la+"px";b.doc.css(G.trstyle,"translate3d("+b.doc.translate.tx+","+b.doc.translate.ty+",0)");t||b.notifyScrollEvent(b.win[0])}):(this.setScrollTop=function(g,t){b.doc.translate.y=g;b.doc.translate.ty=g*-1+"px";b.doc.css(G.trstyle,
"translate("+b.doc.translate.tx+","+b.doc.translate.ty+")");t||b.notifyScrollEvent(b.win[0])},this.setScrollLeft=function(g,t){b.doc.translate.x=g;b.doc.translate.tx=g*la+"px";b.doc.css(G.trstyle,"translate("+b.doc.translate.tx+","+b.doc.translate.ty+")");t||b.notifyScrollEvent(b.win[0])})}else this.getScrollTop=function(){return b.docscroll.scrollTop()},this.setScrollTop=function(g){b.docscroll.scrollTop(g)},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(g){return setTimeout(function(){if(b)return b.hasreversehr&&(g=b.detected.ismozilla?-(b.page.maxw-g):b.page.maxw-g),b.docscroll.scrollLeft(g)},1)};this.getTarget=function(g){return g?g.target?g.target:g.srcElement?g.srcElement:!1:!1};this.hasParent=function(g,t){if(!g)return!1;for(g=g.target||g.srcElement||g||!1;g&&g.id!=t;)g=g.parentNode||!1;return g!==!1};var d={thin:1,medium:3,thick:5};this.getDocumentScrollOffset=
function(){return{top:K.pageYOffset||x.documentElement.scrollTop,left:K.pageXOffset||x.documentElement.scrollLeft}};this.getOffset=function(){if(b.isfixed){var g=b.win.offset(),t=b.getDocumentScrollOffset();g.top-=t.top;g.left-=t.left;return g}g=b.win.offset();if(!b.viewport)return g;t=b.viewport.offset();return{top:g.top-t.top,left:g.left-t.left}};this.updateScrollBar=function(g){var t;if(b.ishwscroll)b.rail.css({height:b.win.innerHeight()-(p.railpadding.top+p.railpadding.bottom)}),b.railh&&b.railh.css({width:b.win.innerWidth()-
(p.railpadding.left+p.railpadding.right)});else{var u=b.getOffset();var f=u.top;var q=u.left-(p.railpadding.left+p.railpadding.right);f+=c(b.win,"border-top-width",!0);q+=b.rail.align?b.win.outerWidth()-c(b.win,"border-right-width")-b.rail.width:c(b.win,"border-left-width");if(t=p.railoffset)t.top&&(f+=t.top),t.left&&(q+=t.left);g=(g?g.h:b.win.innerHeight())-(p.railpadding.top+p.railpadding.bottom);t="left";var C=q;typeof p.rightdock==="number"&&(t="right",C=p.rightdock);b.railslocked||b.rail.css({top:f,
[t]:C,height:g});b.zoom&&b.zoom.css({top:f+1,left:b.rail.align==1?q-20:q+b.rail.width+4});if(b.railh&&!b.railslocked){f=u.top;q=u.left;if(t=p.railhoffset)t.top&&(f+=t.top),t.left&&(q+=t.left);f=b.railh.align?f+c(b.win,"border-top-width",!0)+b.win.innerHeight()-b.railh.height:f+c(b.win,"border-top-width",!0);q+=c(b.win,"border-left-width");b.railh.css({top:f-(p.railpadding.top+p.railpadding.bottom),left:q,width:b.railh.width})}}};this.doRailClick=function(g,t,u){if(!b.railslocked)if(b.cancelEvent(g),
"pageY"in g||(g.pageX=g.clientX+x.documentElement.scrollLeft,g.pageY=g.clientY+x.documentElement.scrollTop),t){t=u?b.doScrollLeft:b.doScrollTop;var f=u?(g.pageX-b.railh.offset().left-b.cursorwidth/2)*b.scrollratio.x:(g.pageY-b.rail.offset().top-b.cursorheight/2)*b.scrollratio.y;b.unsynched("relativexy");t(f|0)}else t=u?b.doScrollLeftBy:b.doScrollBy,f=u?b.scroll.x:b.scroll.y,g=u?g.pageX-b.railh.offset().left:g.pageY-b.rail.offset().top,u=u?b.view.w:b.view.h,t(f>=g?u:-u)};b.newscrolly=b.newscrollx=
0;b.hasanimationframe="requestAnimationFrame"in K;b.hascancelanimationframe="cancelAnimationFrame"in K;b.hasborderbox=!1;this.init=function(){b.saved.css=[];if(G.isoperamini||G.isandroid&&!("hidden"in x))return!0;p.emulatetouch=p.emulatetouch||p.touchbehavior;b.hasborderbox=K.getComputedStyle&&K.getComputedStyle(x.body)["box-sizing"]==="border-box";var g={"overflow-y":"hidden"};if(G.isie11||G.isie10)g["-ms-overflow-style"]="none";b.ishwscroll&&(this.doc.css(G.transitionstyle,G.prefixstyle+"transform 0ms ease-out"),
G.transitionend&&b.bind(b.doc,G.transitionend,b.onScrollTransitionEnd,!1));b.zindex="auto";b.zindex=b.ispage||p.zindex!="auto"?p.zindex:m()||"auto";!b.ispage&&b.zindex!="auto"&&b.zindex>J&&(J=b.zindex);b.isie&&b.zindex===0&&p.zindex=="auto"&&(b.zindex="auto");if(!b.ispage||!G.isieold){var t=b.docscroll;b.ispage&&(t=b.haswrapper?b.win:b.doc);b.css(t,g);b.ispage&&(G.isie11||G.isie)&&b.css(n("html"),g);!G.isios||b.ispage||b.haswrapper||b.css(M,{"-webkit-overflow-scrolling":"touch"});var u=n(x.createElement("div"));
u.css({position:"relative",top:0,"float":"right",width:p.cursorwidth,height:0,"background-color":p.cursorcolor,border:p.cursorborder,"background-clip":"padding-box","-webkit-border-radius":p.cursorborderradius,"-moz-border-radius":p.cursorborderradius,"border-radius":p.cursorborderradius});u.addClass("nicescroll-cursors");b.cursor=u;var f=n(x.createElement("div"));f.attr("id",b.id);f.addClass("nicescroll-rails nicescroll-rails-vr");p.scrollCLass&&f.addClass(p.scrollCLass);var q,C=["left","right",
"top","bottom"],R;for(R in C){var ea=C[R];(q=p.railpadding[ea]||0)&&f.css("padding-"+ea,q+"px")}f.append(u);f.width=Math.max(parseFloat(p.cursorwidth),u.outerWidth());f.css({width:f.width+"px",zIndex:b.zindex,background:p.background,cursor:"default"});f.visibility=!0;f.scrollable=!0;f.align=p.railalign=="left"?0:1;b.rail=f;u=b.rail.drag=!1;!p.boxzoom||b.ispage||G.isieold||(u=x.createElement("div"),b.bind(u,"click",b.doZoom),b.bind(u,"mouseenter",function(){b.zoom.css("opacity",p.cursoropacitymax)}),
b.bind(u,"mouseleave",function(){b.zoom.css("opacity",p.cursoropacitymin)}),b.zoom=n(u),b.zoom.css({cursor:"pointer",zIndex:b.zindex,backgroundImage:"url("+p.scriptpath+"zoomico.png)",height:18,width:18,backgroundPosition:"0 0"}),p.dblclickzoom&&b.bind(b.win,"dblclick",b.doZoom),G.cantouch&&p.gesturezoom&&(b.ongesturezoom=function(D){D.scale>1.5&&b.doZoomIn(D);D.scale<.8&&b.doZoomOut(D);return b.cancelEvent(D)},b.bind(b.win,"gestureend",b.ongesturezoom)));b.railh=!1;if(p.horizrailenabled){b.css(t,
{overflowX:"hidden"});u=n(x.createElement("div"));u.css({position:"absolute",top:0,height:p.cursorwidth,width:0,backgroundColor:p.cursorcolor,border:p.cursorborder,backgroundClip:"padding-box","-webkit-border-radius":p.cursorborderradius,"-moz-border-radius":p.cursorborderradius,"border-radius":p.cursorborderradius});G.isieold&&u.css("overflow","hidden");u.addClass("nicescroll-cursors");b.cursorh=u;var da=n(x.createElement("div"));da.attr("id",b.id+"-hr");da.addClass("nicescroll-rails nicescroll-rails-hr");
p.scrollCLass&&da.addClass(p.scrollCLass);da.height=Math.max(parseFloat(p.cursorwidth),u.outerHeight());da.css({height:da.height+"px",zIndex:b.zindex,background:p.background});da.append(u);da.visibility=!0;da.scrollable=!0;da.align=p.railvalign=="top"?0:1;b.railh=da;b.railh.drag=!1}b.ispage?(f.css({position:"fixed",top:0,height:"100%"}),f.css(f.align?{right:0}:{left:0}),b.body.append(f),b.railh&&(da.css({position:"fixed",left:0,width:"100%"}),da.css(da.align?{bottom:0}:{top:0}),b.body.append(da))):
(b.ishwscroll?(b.win.css("position")=="static"&&b.css(b.win,{position:"relative"}),t=b.win[0].nodeName=="HTML"?b.body:b.win,n(t).scrollTop(0).scrollLeft(0),b.zoom&&(b.zoom.css({position:"absolute",top:1,right:0,"margin-right":f.width+4}),t.append(b.zoom)),f.css({position:"absolute",top:0}),f.css(f.align?{right:0}:{left:0}),t.append(f),da&&(da.css({position:"absolute",left:0,bottom:0}),da.css(da.align?{bottom:0}:{top:0}),t.append(da))):(b.isfixed=b.win.css("position")=="fixed",t=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"})),f.css({position:t}),b.zoom&&b.zoom.css({position:t}),b.updateScrollBar(),b.body.append(f),b.zoom&&b.body.append(b.zoom),b.railh&&(da.css({position:t}),b.body.append(da))),G.isios&&b.css(b.win,{"-webkit-tap-highlight-color":"rgba(0,0,0,0)","-webkit-touch-callout":"none"}),p.disableoutline&&(G.isie&&b.win.attr("hideFocus",
"true"),G.iswebkit&&b.win.css("outline","none")));p.autohidemode===!1?(b.autohidedom=!1,b.rail.css({opacity:p.cursoropacitymax}),b.railh&&b.railh.css({opacity:p.cursoropacitymax})):p.autohidemode===!0||p.autohidemode==="leave"?(b.autohidedom=n().add(b.rail),G.isie8&&(b.autohidedom=b.autohidedom.add(b.cursor)),b.railh&&(b.autohidedom=b.autohidedom.add(b.railh)),b.railh&&G.isie8&&(b.autohidedom=b.autohidedom.add(b.cursorh))):p.autohidemode=="scroll"?(b.autohidedom=n().add(b.rail),b.railh&&(b.autohidedom=
b.autohidedom.add(b.railh))):p.autohidemode=="cursor"?(b.autohidedom=n().add(b.cursor),b.railh&&(b.autohidedom=b.autohidedom.add(b.cursorh))):p.autohidemode=="hidden"&&(b.autohidedom=!1,b.hide(),b.railslocked=!1);if(G.cantouch||b.istouchcapable||p.emulatetouch||G.hasmstouch){b.scrollmom=new ja(b);b.ontouchstart=function(D){if(b.locked||D.pointerType&&(D.pointerType==="mouse"||D.pointerType===D.MSPOINTER_TYPE_MOUSE))return!1;b.hasmoving=!1;b.scrollmom.timer&&(b.triggerScrollEnd(),b.scrollmom.stop());
if(!b.railslocked){var Y=b.getTarget(D);if(Y&&/INPUT/i.test(Y.nodeName)&&/range/i.test(Y.type))return b.stopPropagation(D);var oa=D.type==="mousedown";!("clientX"in D)&&"changedTouches"in D&&(D.clientX=D.changedTouches[0].clientX,D.clientY=D.changedTouches[0].clientY);if(b.forcescreen){var ra=D;D={original:D.original?D.original:D};D.clientX=ra.screenX;D.clientY=ra.screenY}b.rail.drag={x:D.clientX,y:D.clientY,sx:b.scroll.x,sy:b.scroll.y,st:b.getScrollTop(),sl:b.getScrollLeft(),pt:2,dl:!1,tg:Y};if(b.ispage||
!p.directionlockdeadzone)b.rail.drag.dl="f";else{ra=I.width();var sa=I.height(),Ea=b.getContentSize();sa=Ea.h-sa;ra=Ea.w-ra;b.rail.drag.ck=b.rail.scrollable&&!b.railh.scrollable?sa>0?"v":!1:!b.rail.scrollable&&b.railh.scrollable?ra>0?"h":!1:!1}p.emulatetouch&&b.isiframe&&G.isie&&(ra=b.win.position(),b.rail.drag.x+=ra.left,b.rail.drag.y+=ra.top);b.hasmoving=!1;b.lastmouseup=!1;b.scrollmom.reset(D.clientX,D.clientY);if(Y&&oa){if(!/INPUT|SELECT|BUTTON|TEXTAREA/i.test(Y.nodeName))return G.hasmousecapture&&
Y.setCapture(),p.emulatetouch?(Y.onclick&&!Y._onclick&&(Y._onclick=Y.onclick,Y.onclick=function(va){if(b.hasmoving)return!1;Y._onclick.call(this,va)}),b.cancelEvent(D)):b.stopPropagation(D);/SUBMIT|CANCEL|BUTTON/i.test(n(Y).attr("type"))&&(b.preventclick={tg:Y,click:!1})}}};b.ontouchend=function(D){if(!b||!b.rail.drag)return!0;if(b.rail.drag.pt==2){if(D.pointerType&&(D.pointerType==="mouse"||D.pointerType===D.MSPOINTER_TYPE_MOUSE))return!1;b.rail.drag=!1;var Y=D.type==="mouseup";if(b.hasmoving&&(b.scrollmom.doMomentum(),
b.lastmouseup=!0,b.hideCursor(),G.hasmousecapture&&x.releaseCapture(),Y))return b.cancelEvent(D)}else if(b.rail.drag.pt==1)return b.onmouseup(D)};var wa=p.emulatetouch&&b.isiframe&&!G.hasmousecapture,ta=p.directionlockdeadzone*.3|0;b.ontouchmove=function(D,Y){if(!b||!b.rail.drag||D.targetTouches&&p.preventmultitouchscrolling&&D.targetTouches.length>1||D.pointerType&&(D.pointerType==="mouse"||D.pointerType===D.MSPOINTER_TYPE_MOUSE))return!0;if(b.rail.drag.pt==2){"changedTouches"in D&&(D.clientX=D.changedTouches[0].clientX,
D.clientY=D.changedTouches[0].clientY);var oa;var ra=oa=0;wa&&!Y&&(Y=b.win.position(),ra=-Y.left,oa=-Y.top);var sa=D.clientY+oa;Y=sa-b.rail.drag.y;var Ea=D.clientX+ra;oa=Ea-b.rail.drag.x;var va=b.rail.drag.st-Y;if(b.ishwscroll&&p.bouncescroll)va<0?va=Math.round(va/2):va>b.page.maxh&&(va=b.page.maxh+Math.round((va-b.page.maxh)/2));else if(va<0?sa=va=0:va>b.page.maxh&&(va=b.page.maxh,sa=0),sa===0&&!b.hasmoving)return b.ispage||(b.rail.drag=!1),!0;var xa=b.getScrollLeft();b.railh&&b.railh.scrollable&&
(xa=b.isrtlmode?oa-b.rail.drag.sl:b.rail.drag.sl-oa,b.ishwscroll&&p.bouncescroll?xa<0?xa=Math.round(xa/2):xa>b.page.maxw&&(xa=b.page.maxw+Math.round((xa-b.page.maxw)/2)):(xa<0&&(Ea=xa=0),xa>b.page.maxw&&(xa=b.page.maxw,Ea=0)));if(!b.hasmoving){if(b.rail.drag.y===D.clientY&&b.rail.drag.x===D.clientX)return b.cancelEvent(D);ra=Math.abs(Y);Y=Math.abs(oa);oa=p.directionlockdeadzone;b.rail.drag.ck?b.rail.drag.ck=="v"?Y>oa&&ra<=ta?b.rail.drag=!1:ra>oa&&(b.rail.drag.dl="v"):b.rail.drag.ck=="h"&&(ra>oa&&
Y<=ta?b.rail.drag=!1:Y>oa&&(b.rail.drag.dl="h")):ra>oa&&Y>oa?b.rail.drag.dl="f":ra>oa?b.rail.drag.dl=Y>ta?"f":"v":Y>oa&&(b.rail.drag.dl=ra>ta?"f":"h");if(!b.rail.drag.dl)return b.cancelEvent(D);b.triggerScrollStart(D.clientX,D.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"?xa=b.rail.drag.sl:b.rail.drag.dl=="h"&&(va=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(va),b.scrollmom.update(Ea,sa),b.railh&&b.railh.scrollable?(b.setScrollLeft(xa),b.showCursor(va,xa)):b.showCursor(va),G.isie10&&x.selection.clear())});return b.cancelEvent(D)}if(b.rail.drag.pt==1)return b.onmousemove(D)};b.ontouchstartCursor=function(D,Y){if(!b.rail.drag||b.rail.drag.pt==3){if(b.locked)return b.cancelEvent(D);b.cancelScroll();b.rail.drag={x:D.touches[0].clientX,y:D.touches[0].clientY,
sx:b.scroll.x,sy:b.scroll.y,pt:3,hr:!!Y};Y=b.getTarget(D);!b.ispage&&G.hasmousecapture&&Y.setCapture();b.isiframe&&!G.hasmousecapture&&(b.saved.csspointerevents=b.doc.css("pointer-events"),b.css(b.doc,{"pointer-events":"none"}));return b.cancelEvent(D)}};b.ontouchendCursor=function(D){if(b.rail.drag&&(G.hasmousecapture&&x.releaseCapture(),b.isiframe&&!G.hasmousecapture&&b.doc.css("pointer-events",b.saved.csspointerevents),b.rail.drag.pt==3))return b.rail.drag=!1,b.cancelEvent(D)};b.ontouchmoveCursor=
function(D){if(b.rail.drag&&b.rail.drag.pt==3){b.cursorfreezed=!0;if(b.rail.drag.hr){b.scroll.x=b.rail.drag.sx+(D.touches[0].clientX-b.rail.drag.x);b.scroll.x<0&&(b.scroll.x=0);var Y=b.scrollvaluemaxw;b.scroll.x>Y&&(b.scroll.x=Y)}else b.scroll.y=b.rail.drag.sy+(D.touches[0].clientY-b.rail.drag.y),b.scroll.y<0&&(b.scroll.y=0),Y=b.scrollvaluemax,b.scroll.y>Y&&(b.scroll.y=Y);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),p.cursordragspeed):b.doScrollTop(Math.round(b.scroll.y*b.scrollratio.y),p.cursordragspeed))});return b.cancelEvent(D)}}}b.onmousedown=function(D,Y){if(!b.rail.drag||b.rail.drag.pt==1){if(b.railslocked)return b.cancelEvent(D);b.cancelScroll();b.rail.drag={x:D.clientX,y:D.clientY,sx:b.scroll.x,sy:b.scroll.y,pt:1,hr:Y||!1};Y=b.getTarget(D);G.hasmousecapture&&Y.setCapture();b.isiframe&&!G.hasmousecapture&&(b.saved.csspointerevents=b.doc.css("pointer-events"),b.css(b.doc,{"pointer-events":"none"}));
b.hasmoving=!1;return b.cancelEvent(D)}};b.onmouseup=function(D){if(b.rail.drag){if(b.rail.drag.pt!=1)return!0;G.hasmousecapture&&x.releaseCapture();b.isiframe&&!G.hasmousecapture&&b.doc.css("pointer-events",b.saved.csspointerevents);b.rail.drag=!1;b.cursorfreezed=!1;b.hasmoving&&b.triggerScrollEnd();return b.cancelEvent(D)}};b.onmousemove=function(D){if(b.rail.drag){if(b.rail.drag.pt===1){if(G.ischrome&&D.which===0)return b.onmouseup(D);b.cursorfreezed=!0;b.hasmoving||b.triggerScrollStart(D.clientX,
D.clientY,0,0,0);b.hasmoving=!0;if(b.rail.drag.hr){b.scroll.x=b.rail.drag.sx+(D.clientX-b.rail.drag.x);b.scroll.x<0&&(b.scroll.x=0);var Y=b.scrollvaluemaxw;b.scroll.x>Y&&(b.scroll.x=Y)}else b.scroll.y=b.rail.drag.sy+(D.clientY-b.rail.drag.y),b.scroll.y<0&&(b.scroll.y=0),Y=b.scrollvaluemax,b.scroll.y>Y&&(b.scroll.y=Y);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(D)}}else b.checkarea=0};if(G.cantouch||p.emulatetouch)b.onpreventclick=function(D){if(b.preventclick)return b.preventclick.tg.onclick=b.preventclick.click,b.preventclick=!1,b.cancelEvent(D)},b.onclick=G.isios?!1:function(D){return b.lastmouseup?(b.lastmouseup=!1,b.cancelEvent(D)):!0},p.grabcursorenabled&&G.cursorgrabvalue&&(b.css(b.ispage?b.doc:b.win,{cursor:G.cursorgrabvalue}),b.css(b.rail,{cursor:G.cursorgrabvalue}));else{var ua=function(D){if(b.selectiondrag){if(D){var Y=b.win.outerHeight();
D=D.pageY-b.selectiondrag.top;D>0&&D<Y&&(D=0);D>=Y&&(D-=Y);b.selectiondrag.df=D}b.selectiondrag.df!==0&&(b.doScrollBy(-(b.selectiondrag.df*2/6)|0),b.debounced("doselectionscroll",function(){ua()},50))}};b.hasTextSelected="getSelection"in x?function(){return x.getSelection().rangeCount>0}:"selection"in x?function(){return x.selection.type!="None"}:function(){return!1};b.onselectionstart=function(D){b.ispage||(b.selectiondrag=b.win.offset())};b.onselectionend=function(D){b.selectiondrag=!1};b.onselectiondrag=
function(D){b.selectiondrag&&b.hasTextSelected()&&b.debounced("selectionscroll",function(){ua(D)},250)}}G.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(x,"pointerup",b.ontouchend),b.delegate(x,"pointermove",b.ontouchmove)):G.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(x,"MSPointerUp",b.ontouchend),b.delegate(x,"MSPointerMove",b.ontouchmove),b.bind(b.cursor,"MSGestureHold",function(D){D.preventDefault()}),b.bind(b.cursor,"contextmenu",function(D){D.preventDefault()})):G.cantouch&&(b.bind(b.win,"touchstart",b.ontouchstart,!1,!0),b.bind(x,"touchend",b.ontouchend,!1,!0),b.bind(x,"touchcancel",b.ontouchend,!1,!0),b.delegate(x,"touchmove",b.ontouchmove,!1,!0));p.emulatetouch&&(b.bind(b.win,
"mousedown",b.ontouchstart,!1,!0),b.bind(x,"mouseup",b.ontouchend,!1,!0),b.bind(x,"mousemove",b.ontouchmove,!1,!0));if(p.cursordragontouch||!G.cantouch&&!p.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()}),p.sensitiverail&&(b.bind(b.rail,
"click",function(D){b.doRailClick(D,!1,!1)}),b.bind(b.rail,"dblclick",function(D){b.doRailClick(D,!0,!1)}),b.bind(b.cursor,"click",function(D){b.cancelEvent(D)}),b.bind(b.cursor,"dblclick",function(D){b.cancelEvent(D)})),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()}),p.sensitiverail&&(b.bind(b.railh,"click",
function(D){b.doRailClick(D,!1,!0)}),b.bind(b.railh,"dblclick",function(D){b.doRailClick(D,!0,!0)}),b.bind(b.cursorh,"click",function(D){b.cancelEvent(D)}),b.bind(b.cursorh,"dblclick",function(D){b.cancelEvent(D)})));p.cursordragontouch&&(this.istouchcapable||G.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(D){b.ontouchstartCursor(D,!0)}),
b.cursorh&&b.bind(b.cursorh,"touchmove",b.ontouchmoveCursor),b.cursorh&&b.bind(b.cursorh,"touchend",b.ontouchendCursor));p.emulatetouch||G.isandroid||G.isios?(b.bind(G.hasmousecapture?b.win:x,"mouseup",b.ontouchend),b.onclick&&b.bind(x,"click",b.onclick),p.cursordragontouch?(b.bind(b.cursor,"mousedown",b.onmousedown),b.bind(b.cursor,"mouseup",b.onmouseup),b.cursorh&&b.bind(b.cursorh,"mousedown",function(D){b.onmousedown(D,!0)}),b.cursorh&&b.bind(b.cursorh,"mouseup",b.onmouseup)):(b.bind(b.rail,"mousedown",
function(D){D.preventDefault()}),b.railh&&b.bind(b.railh,"mousedown",function(D){D.preventDefault()}))):(b.bind(G.hasmousecapture?b.win:x,"mouseup",b.onmouseup),b.bind(x,"mousemove",b.onmousemove),b.onclick&&b.bind(x,"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(D){b.onmousedown(D,!0)}),b.bind(b.cursorh,"mouseup",b.onmouseup)),!b.ispage&&p.enablescrollonselection&&(b.bind(b.win[0],"mousedown",b.onselectionstart),
b.bind(x,"mouseup",b.onselectionend),b.bind(b.cursor,"mouseup",b.onselectionend),b.cursorh&&b.bind(b.cursorh,"mouseup",b.onselectionend),b.bind(x,"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()})));p.enablemousewheel&&(b.isiframe||b.mousewheel(G.isie&&b.ispage?x:b.win,b.onmousewheel),b.mousewheel(b.rail,b.onmousewheel),b.railh&&
b.mousewheel(b.railh,b.onmousewheelhr));b.ispage||G.cantouch||/HTML|^BODY/.test(b.win[0].nodeName)||(b.win.attr("tabindex")||b.win.attr({tabindex:++y}),b.bind(b.win,"focus",function(D){z=b.getTarget(D).id||b.getTarget(D)||!1;b.hasfocus=!0;b.canshowonmouseevent&&b.noticeCursor()}),b.bind(b.win,"blur",function(D){z=!1;b.hasfocus=!1}),b.bind(b.win,"mouseenter",function(D){w=b.getTarget(D).id||b.getTarget(D)||!1;b.hasmousefocus=!0;b.canshowonmouseevent&&b.noticeCursor()}),b.bind(b.win,"mouseleave",function(D){w=
!1;b.hasmousefocus=!1;b.rail.drag||b.hideCursor()}));b.onkeypress=function(D){if(b.railslocked&&b.page.maxh===0)return!0;D=D||K.event;var Y=b.getTarget(D);if(Y&&/INPUT|TEXTAREA|SELECT|OPTION/.test(Y.nodeName)&&(!Y.getAttribute("type")&&!Y.type||!/submit|button|cancel/i.tp)||n(Y).attr("contenteditable"))return!0;if(b.hasfocus||b.hasmousefocus&&!z||b.ispage&&!z&&!w){Y=D.keyCode;if(b.railslocked&&Y!=27)return b.cancelEvent(D);var oa=D.ctrlKey||!1,ra=D.shiftKey||!1,sa=!1;switch(Y){case 38:case 63233:b.doScrollBy(72);
sa=!0;break;case 40:case 63235:b.doScrollBy(-72);sa=!0;break;case 37:case 63232:b.railh&&(oa?b.doScrollLeft(0):b.doScrollLeftBy(72),sa=!0);break;case 39:case 63234:b.railh&&(oa?b.doScrollLeft(b.page.maxw):b.doScrollLeftBy(-72),sa=!0);break;case 33:case 63276:b.doScrollBy(b.view.h);sa=!0;break;case 34:case 63277:b.doScrollBy(-b.view.h);sa=!0;break;case 36:case 63273:b.railh&&oa?b.doScrollPos(0,0):b.doScrollTo(0);sa=!0;break;case 35:case 63275:b.railh&&oa?b.doScrollPos(b.page.maxw,b.page.maxh):b.doScrollTo(b.page.maxh);
sa=!0;break;case 32:p.spacebarenabled&&(ra?b.doScrollBy(b.view.h):b.doScrollBy(-b.view.h),sa=!0);break;case 27:b.zoomactive&&(b.doZoom(),sa=!0)}if(sa)return b.cancelEvent(D)}};p.enablekeyboard&&b.bind(x,G.isopera&&!G.isopera12?"keypress":"keydown",b.onkeypress);b.bind(x,"keydown",function(D){D.ctrlKey&&(b.wheelprevented=!0)});b.bind(x,"keyup",function(D){D.ctrlKey||(b.wheelprevented=!1)});b.bind(K,"blur",function(D){b.wheelprevented=!1});b.bind(K,"resize",b.onscreenresize);b.bind(K,"orientationchange",
b.onscreenresize);b.bind(K,"load",b.lazyResize);if(G.ischrome&&!b.ispage&&!b.haswrapper){var Aa=b.win.attr("style");f=parseFloat(b.win.css("width"))+1;b.win.css("width",f);b.synched("chromefix",function(){b.win.attr("style",Aa)})}b.onAttributeChange=function(D){b.lazyResize(b.isieold?250:30)};if(p.enableobserver&&(b.isie11||ca===!1||(b.observerbody=new ca(function(D){D.forEach(function(Y){if(Y.type=="attributes")return M.hasClass("modal-open")&&M.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(x.body,{childList:!0,subtree:!0,characterData:!1,attributes:!0,attributeFilter:["class"]})),!b.ispage&&!b.haswrapper)){var ya=b.win[0];ca!==!1?(b.observer=new ca(function(D){D.forEach(b.onAttributeChange)}),b.observer.observe(ya,{childList:!0,characterData:!1,attributes:!0,subtree:!1}),b.observerremover=new ca(function(D){D.forEach(function(Y){if(Y.removedNodes.length>
0)for(var oa in Y.removedNodes)if(b&&Y.removedNodes[oa]===ya)return b.remove()})}),b.observerremover.observe(ya.parentNode,{childList:!0,characterData:!1,attributes:!1,subtree:!1})):(b.bind(ya,G.isie&&!G.isie9?"propertychange":"DOMAttrModified",b.onAttributeChange),G.isie9&&ya.attachEvent("onpropertychange",b.onAttributeChange),b.bind(ya,"DOMNodeRemoved",function(D){D.target===ya&&b.remove()}))}!b.ispage&&p.boxzoom&&b.bind(K,"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 za=function(){b.iframexd=!1;try{var D="contentDocument"in this?this.contentDocument:this.contentWindow._doc}catch(oa){b.iframexd=!0,D=!1}if(b.iframexd)return"console"in K&&console.log("NiceScroll error: policy restriced iframe"),!0;b.forcescreen=!0;b.isiframe&&(b.iframe={doc:n(D),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(!G.isios&&p.iframeautoresize&&!b.isiframe){b.win.scrollTop(0);b.doc.height("");var Y=Math.max(D.getElementsByTagName("html")[0].scrollHeight,D.body.scrollHeight);b.doc.height(Y)}b.lazyResize(30);b.css(n(b.iframe.body),g);G.isios&&b.haswrapper&&b.css(n(D.body),{"-webkit-transform":"translate3d(0,0,0)"});"contentWindow"in this?b.bind(this.contentWindow,"scroll",b.onscroll):
b.bind(D,"scroll",b.onscroll);p.enablemousewheel&&b.mousewheel(D,b.onmousewheel);p.enablekeyboard&&b.bind(D,G.isopera?"keypress":"keydown",b.onkeypress);G.cantouch?(b.bind(D,"touchstart",b.ontouchstart),b.bind(D,"touchmove",b.ontouchmove)):p.emulatetouch&&(b.bind(D,"mousedown",b.ontouchstart),b.bind(D,"mousemove",function(oa){return b.ontouchmove(oa,!0)}),p.grabcursorenabled&&G.cursorgrabvalue&&b.css(n(D.body),{cursor:G.cursorgrabvalue}));b.bind(D,"mouseup",b.ontouchend);b.zoom&&(p.dblclickzoom&&
b.bind(D,"dblclick",b.doZoom),b.ongesturezoom&&b.bind(D,"gestureend",b.ongesturezoom))};this.doc[0].readyState&&this.doc[0].readyState==="complete"&&setTimeout(function(){za.call(b.doc[0],!1)},500);b.bind(this.doc,"load",za)}};this.showCursor=function(g,t){b.cursortimeout&&(clearTimeout(b.cursortimeout),b.cursortimeout=0);b.rail&&(b.autohidedom&&(b.autohidedom.stop().css({opacity:p.cursoropacitymax}),b.cursoractive=!0),b.rail.drag&&b.rail.drag.pt==1||(g!==void 0&&g!==!1&&(b.scroll.y=g/b.scrollratio.y|
0),t!==void 0&&(b.scroll.x=t/b.scrollratio.x|0)),b.cursor.css({height:b.cursorheight,top:b.scroll.y}),b.cursorh&&(g=b.hasreversehr?b.scrollvaluemaxw-b.scroll.x:b.scroll.x,b.cursorh.css({width:b.cursorwidth,left:!b.rail.align&&b.rail.visibility?g+b.rail.width:g}),b.cursoractive=!0),b.zoom&&b.zoom.stop().css({opacity:p.cursoropacitymax}))};this.hideCursor=function(g){b.cursortimeout||!b.rail||!b.autohidedom||b.hasmousefocus&&p.autohidemode==="leave"||(b.cursortimeout=setTimeout(function(){b.rail.active&&
b.showonmouseevent||(b.autohidedom.stop().animate({opacity:p.cursoropacitymin}),b.zoom&&b.zoom.stop().animate({opacity:p.cursoropacitymin}),b.cursoractive=!1);b.cursortimeout=0},g||p.hidecursordelay))};this.noticeCursor=function(g,t,u){b.showCursor(t,u);b.rail.active||b.hideCursor(g)};this.getContentSize=b.ispage?function(){return{w:Math.max(x.body.scrollWidth,x.documentElement.scrollWidth),h:Math.max(x.body.scrollHeight,x.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(g,t){if(!b||!b.win)return!1;g=b.page.maxh;var u=b.page.maxw,f=b.view.h,q=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=t?t: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==g&&b.page.maxw==u&&b.view.w==q&&b.view.h==f){if(b.ispage)return b;
t=b.win.offset();if(b.lastposition&&(g=b.lastposition,g.top==t.top&&g.left==t.left))return b;b.lastposition=t}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-=p.railpadding.top+p.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-=p.railpadding.left+
p.railpadding.right,b.railh&&(b.railh.scrollable=p.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=p.cursorfixedheight?p.cursorfixedheight:Math.max(p.cursorminheight,
b.cursorheight);b.cursorwidth=Math.min(b.view.w,Math.round(b.view.w/b.page.w*b.view.w));b.cursorwidth=p.cursorfixedheight?p.cursorfixedheight:Math.max(p.cursorminheight,b.cursorwidth);b.scrollvaluemax=b.view.h-b.cursorheight-(p.railpadding.top+p.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-(p.railpadding.left+p.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 l=0;this.onscreenresize=function(g){clearTimeout(l);var t=!b.ispage&&!b.haswrapper;t&&b.hideRails();
l=setTimeout(function(){b&&(t&&b.showRails(),b.resize());l=0},120)};this.lazyResize=function(g){clearTimeout(l);g=isNaN(g)?240:g;l=setTimeout(function(){b&&b.resize();l=0},g);return b};this.jqbind=function(g,t,u){b.events.push({e:g,n:t,f:u,q:!0});n(g).on(t,u)};this.mousewheel=function(g,t,u){g="jquery"in g?g[0]:g;if("onwheel"in x.createElement("div"))b._bind(g,"wheel",t,u||!1);else{var f=x.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll";v(g,f,t,u||!1);f=="DOMMouseScroll"&&v(g,"MozMousePixelScroll",
t,u||!1)}};var r=!1;if(G.haseventlistener){try{var B=Object.defineProperty({},"passive",{get:function(){r=!0}});K.addEventListener("test",null,B)}catch(g){}this.stopPropagation=function(g){if(!g)return!1;g=g.original?g.original:g;g.stopPropagation();return!1};this.cancelEvent=function(g){g.cancelable&&g.preventDefault();g.stopImmediatePropagation();g.preventManipulation&&g.preventManipulation();return!1}}else Event.prototype.preventDefault=function(){this.returnValue=!1},Event.prototype.stopPropagation=
function(){this.cancelBubble=!0},K.constructor.prototype.addEventListener=x.constructor.prototype.addEventListener=Element.prototype.addEventListener=function(g,t,u){this.attachEvent("on"+g,t)},K.constructor.prototype.removeEventListener=x.constructor.prototype.removeEventListener=Element.prototype.removeEventListener=function(g,t,u){this.detachEvent("on"+g,t)},this.cancelEvent=function(g){if(g=g||K.event)g.cancelBubble=!0,g.cancel=!0,g.returnValue=!1;return!1},this.stopPropagation=function(g){if(g=
g||K.event)g.cancelBubble=!0;return!1};this.delegate=function(g,t,u,f,q){var C=L[t]||!1;C?b.events.push({e:g,n:t,f:u,b:f,q:!1}):(C={a:[],l:[],f:function(R){for(var ea=C.l,da=!1,wa=ea.length-1;wa>=0;wa--)if(da=ea[wa].call(R.target,R),da===!1)return!1;return da}},b.bind(g,t,C.f,f,q),L[t]=C);b.ispage?(C.a=[b.id].concat(C.a),C.l=[u].concat(C.l)):(C.a.push(b.id),C.l.push(u))};this.undelegate=function(g,t,u,f,q){if((u=L[t]||!1)&&u.l)for(f=0,q=u.l.length;f<q;f++)u.a[f]===b.id&&(u.a.splice(f),u.l.splice(f),
u.a.length===0&&(b._unbind(g,t,u.l.f),L[t]=null))};this.bind=function(g,t,u,f,q){b._bind("jquery"in g?g[0]:g,t,u,f||!1,q||!1)};this._bind=function(g,t,u,f,q){b.events.push({e:g,n:t,f:u,b:f,q:!1});r&&(q||g==K.document||g==K.document.body||g==K)?g.addEventListener(t,u,{passive:!1,capture:f}):g.addEventListener(t,u,f||!1)};this._unbind=function(g,t,u,f){L[t]?b.undelegate(g,t,u,f):g.removeEventListener(t,u,f)};this.unbindAll=function(){for(var g=0;g<b.events.length;g++){var t=b.events[g];t.q?t.e.unbind(t.n,
t.f):b._unbind(t.e,t.n,t.f,t.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 g in b.delaylist)b.delaylist[g]&&Q(b.delaylist[g].h);b.doZoomOut();G.hasw3ctouch?
b.undelegate(x,"pointermove",b.ontouchmove):G.hasmstouch?b.undelegate(x,"MSPointerMove",b.ontouchmove):G.cantouch&&b.undelegate(x,"touchmove",b.ontouchmove,!1,!0);b.unbindAll();G.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(g=0;g<b.saved.css.length;g++){var t=b.saved.css[g];t[0].css(t[1],t[2]===void 0?"":t[2])}b.saved=!1;b.me.data("__nicescroll","");var u=n.nicescroll;u.each(function(q){if(this&&this.id===b.id){delete u[q];for(var C=++q;C<u.length;C++,q++)u[q]=u[C];u.length--;u.length&&delete u[u.length]}});for(var f in b)b[f]=null,delete b[f];b=null};this.scrollstart=function(g){this.onscrollstart=g;return b};this.scrollend=function(g){this.onscrollend=g;return b};this.scrollcancel=function(g){this.onscrollcancel=
g;return b};this.zoomin=function(g){this.onzoomin=g;return b};this.zoomout=function(g){this.onzoomout=g;return b};this.isScrollable=function(g){g=g.target?g.target:g;if(g.nodeName=="OPTION")return!0;for(;g&&g.nodeType==1&&g!==this.me[0]&&!/^BODY|HTML/.test(g.nodeName);){var t=n(g);t=t.css("overflowY")||t.css("overflowX")||t.css("overflow")||"";if(/scroll|auto/.test(t))return g.clientHeight!=g.scrollHeight;g=g.parentNode?g.parentNode:!1}return!1};this.getViewport=function(g){for(g=g&&g.parentNode?
g.parentNode:!1;g&&g.nodeType==1&&!/^BODY|HTML/.test(g.nodeName);){var t=n(g);if(/fixed|absolute/.test(t.css("position")))return t;var u=t.css("overflowY")||t.css("overflowX")||t.css("overflow")||"";if(/scroll|auto/.test(u)&&g.clientHeight!=g.scrollHeight||t.getNiceScroll().length>0)return t;g=g.parentNode?g.parentNode:!1}return!1};this.triggerScrollStart=function(g,t,u,f,q){b.onscrollstart&&b.onscrollstart.call(b,{type:"scrollstart",current:{x:g,y:t},request:{x:u,y:f},end:{x:b.newscrollx,y:b.newscrolly},
speed:q})};this.triggerScrollEnd=function(){if(b.onscrollend){var g=b.getScrollLeft(),t=b.getScrollTop();b.onscrollend.call(b,{type:"scrollend",current:{x:g,y:t},end:{x:g,y:t}})}};var H=0,P=0,O=0,W=1,S=!1;this.onmousewheel=function(g){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(g);p.oneaxismousemode==="auto"&&g.deltaX!==0&&(p.oneaxismousemode=!1);if(p.oneaxismousemode&&g.deltaX===0&&!b.rail.scrollable)return b.railh&&
b.railh.scrollable?b.onmousewheelhr(g):!0;var t=aa(),u=!1;p.preservenativescrolling&&b.checkarea+600<t&&(b.nativescrollingarea=b.isScrollable(g),u=!0);b.checkarea=t;if(b.nativescrollingarea)return!0;if(g=A(g,!1,u))b.checkarea=0;return g};this.onmousewheelhr=function(g){if(!b.wheelprevented){if(b.railslocked||!b.railh.scrollable)return!0;if(b.rail.drag)return b.cancelEvent(g);var t=aa(),u=!1;p.preservenativescrolling&&b.checkarea+600<t&&(b.nativescrollingarea=b.isScrollable(g),u=!0);b.checkarea=t;
return b.nativescrollingarea?!0:b.railslocked?b.cancelEvent(g):A(g,!0,u)}};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(g){return 80+g/72*p.scrollspeed|0};if(p.smoothscroll)if(b.ishwscroll&&G.hastransition&&p.usetransition&&p.smoothscroll){var U="";this.resetTransition=function(){U="";b.doc.css(G.prefixstyle+"transition-duration","0ms")};
this.prepareTransition=function(g,t){g=t?g:b.getTransitionSpeed(g);t=g+"ms";U!==t&&(U=t,b.doc.css(G.prefixstyle+"transition-duration",t));return g};this.doScrollLeft=function(g,t){var u=b.scrollrunning?b.newscrolly:b.getScrollTop();b.doScrollPos(g,u,t)};this.doScrollTop=function(g,t){var u=b.scrollrunning?b.newscrollx:b.getScrollLeft();b.doScrollPos(u,g,t)};this.cursorupdate={running:!1,start:function(){var g=this;if(!g.running){g.running=!0;var t=function(){g.running&&N(t);b.showCursor(b.getScrollTop(),
b.getScrollLeft());b.notifyScrollEvent(b.win[0])};N(t)}},stop:function(){this.running=!1}};this.doScrollPos=function(g,t,u){u=b.getScrollTop();var f=b.getScrollLeft();((b.newscrolly-u)*(t-u)<0||(b.newscrollx-f)*(g-f)<0)&&b.cancelScroll();p.bouncescroll?(t<0?t=t/2|0:t>b.page.maxh&&(t=b.page.maxh+(t-b.page.maxh)/2|0),g<0?g=g/2|0:g>b.page.maxw&&(g=b.page.maxw+(g-b.page.maxw)/2|0)):(t<0?t=0:t>b.page.maxh&&(t=b.page.maxh),g<0?g=0:g>b.page.maxw&&(g=b.page.maxw));if(b.scrollrunning&&g==b.newscrollx&&t==
b.newscrolly)return!1;b.newscrolly=t;b.newscrollx=g;u=b.getScrollTop();f=b.getScrollLeft();var q=g-f;var C=t-u;q=b.prepareTransition(Math.sqrt(q*q+C*C)|0);b.scrollrunning||(b.scrollrunning=!0,b.triggerScrollStart(f,u,g,t,q),b.cursorupdate.start());b.scrollendtrapped=!0;G.transitionend||(b.scrollendtrapped&&clearTimeout(b.scrollendtrapped),b.scrollendtrapped=setTimeout(b.onScrollTransitionEnd,q));b.setScrollTop(b.newscrolly);b.setScrollLeft(b.newscrollx)};this.cancelScroll=function(){if(!b.scrollendtrapped)return!0;
var g=b.getScrollTop(),t=b.getScrollLeft();b.scrollrunning=!1;G.transitionend||clearTimeout(G.transitionend);b.scrollendtrapped=!1;b.resetTransition();b.setScrollTop(g);b.railh&&b.setScrollLeft(t);b.timerscroll&&b.timerscroll.tm&&clearInterval(b.timerscroll.tm);b.timerscroll=!1;b.cursorfreezed=!1;b.cursorupdate.stop();b.showCursor(g,t);return b};this.onScrollTransitionEnd=function(){if(b.scrollendtrapped){var g=b.getScrollTop(),t=b.getScrollLeft();g<0?g=0:g>b.page.maxh&&(g=b.page.maxh);t<0?t=0:t>
b.page.maxw&&(t=b.page.maxw);if(g!=b.newscrolly||t!=b.newscrollx)return b.doScrollPos(t,g,p.snapbackspeed);b.scrollrunning&&b.triggerScrollEnd();b.scrollrunning=!1;b.scrollendtrapped=!1;b.resetTransition();b.timerscroll=!1;b.setScrollTop(g);b.railh&&b.setScrollLeft(t);b.cursorupdate.stop();b.noticeCursor(!1,g,t);b.cursorfreezed=!1}}}else this.doScrollLeft=function(g,t){var u=b.scrollrunning?b.newscrolly:b.getScrollTop();b.doScrollPos(g,u,t)},this.doScrollTop=function(g,t){var u=b.scrollrunning?b.newscrollx:
b.getScrollLeft();b.doScrollPos(u,g,t)},this.doScrollPos=function(g,t,u){u=b.getScrollTop();var f=b.getScrollLeft();((b.newscrolly-u)*(t-u)<0||(b.newscrollx-f)*(g-f)<0)&&b.cancelScroll();var q=!1;b.bouncescroll&&b.rail.visibility||(t<0?(t=0,q=!0):t>b.page.maxh&&(t=b.page.maxh,q=!0));b.bouncescroll&&b.railh.visibility||(g<0?(g=0,q=!0):g>b.page.maxw&&(g=b.page.maxw,q=!0));if(b.scrollrunning&&b.newscrolly===t&&b.newscrollx===g)return!0;b.newscrolly=t;b.newscrollx=g;b.dst={};b.dst.x=g-f;b.dst.y=t-u;b.dst.px=
f;b.dst.py=u;var C=b.getTransitionSpeed(Math.sqrt(b.dst.x*b.dst.x+b.dst.y*b.dst.y)|0);b.bzscroll={};q=q?1:.58;b.bzscroll.x=new fa(f,b.newscrollx,C,0,0,q,1);b.bzscroll.y=new fa(u,b.newscrolly,C,0,0,q,1);aa();var R=function(){if(b.scrollrunning){var ea=b.bzscroll.y.getPos();b.setScrollLeft(b.bzscroll.x.getNow());b.setScrollTop(b.bzscroll.y.getNow());ea<=1?b.timer=N(R):(b.scrollrunning=!1,b.timer=0,b.triggerScrollEnd())}};b.scrollrunning||(b.triggerScrollStart(f,u,g,t,C),b.scrollrunning=!0,b.timer=N(R))},
this.cancelScroll=function(){b.timer&&Q(b.timer);b.timer=0;b.bzscroll=!1;b.scrollrunning=!1;return b};else this.doScrollLeft=function(g,t){var u=b.getScrollTop();b.doScrollPos(g,u,t)},this.doScrollTop=function(g,t){var u=b.getScrollLeft();b.doScrollPos(u,g,t)},this.doScrollPos=function(g,t,u){var f=g>b.page.maxw?b.page.maxw:g;f<0&&(f=0);var q=t>b.page.maxh?b.page.maxh:t;q<0&&(q=0);b.synched("scroll",function(){b.setScrollTop(q);b.setScrollLeft(f)})},this.cancelScroll=function(){};this.doScrollBy=
function(g,t){E(0,g)};this.doScrollLeftBy=function(g,t){E(g,0)};this.doScrollTo=function(g,t){b.cursorfreezed=!1;b.doScrollTop(g)};this.checkContentSize=function(){var g=b.getContentSize();g.h==b.page.h&&g.w==b.page.w||b.resize(!1,g)};b.onscroll=function(g){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(g){if(!b.zoomactive){b.zoomactive=!0;b.zoomrestore={style:{}};var t="position top left zIndex backgroundColor marginTop marginBottom marginLeft marginRight".split(" "),u=b.win[0].style,f;for(f in t){var q=t[f];b.zoomrestore.style[q]=u[q]!==void 0?u[q]:""}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()};G.isios4&&(b.zoomrestore.scrollTop=
I.scrollTop(),I.scrollTop(0));b.win.css({position:G.isios4?"absolute":"fixed",top:0,left:0,zIndex:J+100,margin:0});t=b.win.css("backgroundColor");(""===t||/transparent|rgba\(0, 0, 0, 0\)|rgba\(0,0,0,0\)/.test(t))&&b.win.css("backgroundColor","#fff");b.rail.css({zIndex:J+101});b.zoom.css({zIndex:J+102});b.zoom.css("backgroundPosition","0 -18px");b.resizeZoom();b.onzoomin&&b.onzoomin.call(b);return b.cancelEvent(g)}};this.doZoomOut=function(g){if(b.zoomactive)return b.zoomactive=!1,b.win.css("margin",
""),b.win.css(b.zoomrestore.style),G.isios4&&I.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(g)};this.doZoom=function(g){return b.zoomactive?b.doZoomOut(g):b.doZoomIn(g)};this.resizeZoom=function(){if(b.zoomactive){var g=b.getScrollTop();b.win.css({width:I.width()-b.zoomrestore.padding.w+"px",height:I.height()-b.zoomrestore.padding.h+
"px"});b.onResize();b.setScrollTop(Math.min(b.page.maxh,g))}};this.init();n.nicescroll.push(this)},ja=function(T){var e=this;this.nc=T;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(h,m){e.stop();e.steptime=0;e.lasttime=aa();e.speedx=0;e.speedy=0;e.lastx=h;e.lasty=m;e.lastscrollx=-1;e.lastscrolly=-1};this.update=function(h,m){var c=
aa();e.steptime=c-e.lasttime;e.lasttime=c;c=m-e.lasty;var v=h-e.lastx,E=e.nc.getScrollTop(),A=e.nc.getScrollLeft();E+=c;A+=v;e.snapx=A<0||A>e.nc.page.maxw;e.snapy=E<0||E>e.nc.page.maxh;e.speedx=v;e.speedy=c;e.lastx=h;e.lasty=m};this.stop=function(){e.nc.unsynched("domomentum2d");e.timer&&clearTimeout(e.timer);e.timer=0;e.lastscrollx=-1;e.lastscrolly=-1};this.doSnapy=function(h,m){var c=!1;m<0?(m=0,c=!0):m>e.nc.page.maxh&&(m=e.nc.page.maxh,c=!0);h<0?(h=0,c=!0):h>e.nc.page.maxw&&(h=e.nc.page.maxw,c=
!0);c?e.nc.doScrollPos(h,m,e.nc.opt.snapbackspeed):e.nc.triggerScrollEnd()};this.doMomentum=function(h){var m=aa(),c=h?m+h:e.lasttime;h=e.nc.getScrollLeft();var v=e.nc.getScrollTop(),E=e.nc.page.maxh,A=e.nc.page.maxw;e.speedx=A>0?Math.min(60,e.speedx):0;e.speedy=E>0?Math.min(60,e.speedy):0;c=c&&m-c<=60;if(v<0||v>E||h<0||h>A)c=!1;h=e.speedx&&c?e.speedx:!1;if(e.speedy&&c&&e.speedy||h){var b=Math.max(16,e.steptime);b>50&&(h=b/50,e.speedx*=h,e.speedy*=h,b=50);e.demulxy=0;e.lastscrollx=e.nc.getScrollLeft();
e.chkx=e.lastscrollx;e.lastscrolly=e.nc.getScrollTop();e.chky=e.lastscrolly;var M=e.lastscrollx,p=e.lastscrolly,V=function(){var G=aa()-m>600?.04:.02;e.speedx&&(M=Math.floor(e.lastscrollx-e.speedx*(1-e.demulxy)),e.lastscrollx=M,M<0||M>A)&&(G=.1);e.speedy&&(p=Math.floor(e.lastscrolly-e.speedy*(1-e.demulxy)),e.lastscrolly=p,p<0||p>E)&&(G=.1);e.demulxy=Math.min(1,e.demulxy+G);e.nc.synched("domomentum2d",function(){e.speedx&&(e.nc.getScrollLeft(),e.chkx=M,e.nc.setScrollLeft(M));e.speedy&&(e.nc.getScrollTop(),
e.chky=p,e.nc.setScrollTop(p));e.timer||(e.nc.hideCursor(),e.doSnapy(M,p))});e.demulxy<1?e.timer=setTimeout(V,b):(e.stop(),e.nc.hideCursor(),e.doSnapy(M,p))};V()}else e.doSnapy(e.nc.getScrollLeft(),e.nc.getScrollTop())}},qa=n.fn.scrollTop;typeof n.cssHooks==="object"&&(n.cssHooks.pageYOffset={get:function(T,e,h){return(e=n.data(T,"__nicescroll")||!1)&&e.ishwscroll?e.getScrollTop():qa.call(T)},set:function(T,e){var h=n.data(T,"__nicescroll")||!1;h&&h.ishwscroll?h.setScrollTop(parseInt(e)):qa.call(T,
e);return this}});n.fn.scrollTop=function(T){if(T===void 0){var e=this[0]?n.data(this[0],"__nicescroll")||!1:!1;return e&&e.ishwscroll?e.getScrollTop():qa.call(this)}return this.each(function(){var h=n.data(this,"__nicescroll")||!1;h&&h.ishwscroll?h.setScrollTop(parseInt(T)):qa.call(n(this),T)})};var ha=n.fn.scrollLeft;typeof n.cssHooks==="object"&&(n.cssHooks.pageXOffset={get:function(T,e,h){return(e=n.data(T,"__nicescroll")||!1)&&e.ishwscroll?e.getScrollLeft():ha.call(T)},set:function(T,e){var h=
n.data(T,"__nicescroll")||!1;h&&h.ishwscroll?h.setScrollLeft(parseInt(e)):ha.call(T,e);return this}});n.fn.scrollLeft=function(T){if(T===void 0){var e=this[0]?n.data(this[0],"__nicescroll")||!1:!1;return e&&e.ishwscroll?e.getScrollLeft():ha.call(this)}return this.each(function(){var h=n.data(this,"__nicescroll")||!1;h&&h.ishwscroll?h.setScrollLeft(parseInt(T)):ha.call(n(this),T)})};var ba=function(T){var e=this;this.length=0;this.name="nicescrollarray";this.each=function(c){n.each(e,c);return e};
this.push=function(c){e[e.length]=c;e.length++};this.eq=function(c){return e[c]};if(T)for(var h=0;h<T.length;h++){var m=n.data(T[h],"__nicescroll")||!1;m&&(this[this.length]=m,this.length++)}return this};(function(T,e,h){for(var m=0,c=e.length;m<c;m++)h(T,e[m])})(ba.prototype,"show hide toggle onResize resize remove stop doScrollPos".split(" "),function(T,e){T[e]=function(){var h=arguments;return this.each(function(){this[e].apply(this,h)})}});n.fn.getNiceScroll=function(T){return T===void 0?new ba(this):
this[T]&&n.data(this[T],"__nicescroll")||!1};if(typeof n.expr==="object"){var na=n.expr.pseudos||n.expr[":"];na&&(na.nicescroll=function(T){return n.data(T,"__nicescroll")!==void 0})}n.fn.niceScroll=function(T,e){e!==void 0||typeof T!="object"||"jquery"in T||(e=T,T=!1);var h=new ba;this.each(function(){var m=n(this),c=n.extend({},e);if(T){var v=n(T);c.doc=v.length>1?n(T,m):v;c.win=m}"doc"in c&&!("win"in c)&&(c.win=m);v=m.data("__nicescroll")||!1;v||(c.doc=c.doc||m,v=new ka(c,m),m.data("__nicescroll",
v));h.push(v)});return h.length===1?h[0]:h};K.NiceScroll={getjQuery:function(){return n}};n.nicescroll||(n.nicescroll=new ba,n.nicescroll.options=ia)})(function(n){var z=function(){function w(f){return f==null?String(f):H[P.call(f)]||"object"}function y(f){return w(f)=="function"}function F(f){return f!=null&&f==f.window}function J(f){return w(f)=="object"}function x(f){return J(f)&&!F(f)&&Object.getPrototypeOf(f)==Object.prototype}function I(f){var q=!!f&&"length"in f&&f.length,C=u.type(f);return"function"!=
C&&!F(f)&&("array"==C||q===0||typeof q=="number"&&q>0&&q-1 in f)}function L(f){return h.call(f,function(q){return q!=null})}function N(f){return f.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 Q(f){return f in E?E[f]:E[f]=new RegExp("(^|\\s)"+f+"(\\s|$)")}function Z(f,q){return typeof q!="number"||A[N(f)]?q:q+"px"}function ca(f){return"children"in f?m.call(f.children):u.map(f.childNodes,function(q){if(q.nodeType==
1)return q})}function aa(f,q){var C,R=f?f.length:0;for(C=0;C<R;C++)this[C]=f[C];this.length=R;this.selector=q||""}function ia(f,q,C){for(ba in q)C&&(x(q[ba])||U(q[ba]))?(x(q[ba])&&!x(f[ba])&&(f[ba]={}),U(q[ba])&&!U(f[ba])&&(f[ba]=[]),ia(f[ba],q[ba],C)):q[ba]!==ha&&(f[ba]=q[ba])}function ma(f,q){return q==null?u(f):u(f).filter(q)}function X(f,q,C,R){return y(q)?q.call(f,C,R):q}function ka(f,q){var C=f.className||"",R=C&&C.baseVal!==ha;if(q===ha)return R?C.baseVal:C;R?C.baseVal=q:f.className=q}function ja(f){try{return f?
f=="true"||(f=="false"?!1:f=="null"?null:+f+""==f?+f:/^[\[\{]/.test(f)?u.parseJSON(f):f):f}catch(q){return f}}function qa(f,q){q(f);for(var C=0,R=f.childNodes.length;C<R;C++)qa(f.childNodes[C],q)}var ha,ba,na,T=[],e=T.concat,h=T.filter,m=T.slice,c=n.document,v={},E={},A={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},b=/^\s*<(\w+|!)[^>]*>/,M=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,p=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,V=/^(?:body|html)$/i,
G=/([A-Z])/g,fa="val css html text data width height offset".split(" "),la=c.createElement("table"),d=c.createElement("tr"),l={tr:c.createElement("tbody"),tbody:la,thead:la,tfoot:la,td:d,th:d,"*":c.createElement("div")},r=/complete|loaded|interactive/,B=/^[\w-]*$/,H={},P=H.toString,O={},W=c.createElement("div"),S={tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",
usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},U=Array.isArray||function(f){return f instanceof Array};O.matches=function(f,q){if(!q||!f||f.nodeType!==1)return!1;var C=f.matches||f.webkitMatchesSelector||f.mozMatchesSelector||f.oMatchesSelector||f.matchesSelector;if(C)return C.call(f,q);var R=f.parentNode;(C=!R)&&(R=W).appendChild(f);q=~O.qsa(R,q).indexOf(f);C&&W.removeChild(f);return q};var g=function(f){return f.replace(/-+(.)?/g,function(q,C){return C?C.toUpperCase():
""})};var t=function(f){return h.call(f,function(q,C){return f.indexOf(q)==C})};O.fragment=function(f,q,C){var R;M.test(f)&&(R=u(c.createElement(RegExp.$1)));if(!R){f.replace&&(f=f.replace(p,"<$1></$2>"));q===ha&&(q=b.test(f)&&RegExp.$1);q in l||(q="*");var ea=l[q];ea.innerHTML=""+f;R=u.each(m.call(ea.childNodes),function(){ea.removeChild(this)})}if(x(C)){var da=u(R);u.each(C,function(wa,ta){if(fa.indexOf(wa)>-1)da[wa](ta);else da.attr(wa,ta)})}return R};O.Z=function(f,q){return new aa(f,q)};O.isZ=
function(f){return f instanceof O.Z};O.init=function(f,q){if(f)if(typeof f=="string")if(f=f.trim(),f[0]=="<"&&b.test(f))q=O.fragment(f,RegExp.$1,q),f=null;else{if(q!==ha)return u(q).find(f);q=O.qsa(c,f)}else{if(y(f))return u(c).ready(f);if(O.isZ(f))return f;if(U(f))q=L(f);else if(J(f))q=[f],f=null;else if(b.test(f))q=O.fragment(f.trim(),RegExp.$1,q),f=null;else{if(q!==ha)return u(q).find(f);q=O.qsa(c,f)}}else return O.Z();return O.Z(q,f)};var u=function(f,q){return O.init(f,q)};u.extend=function(f){var q=
m.call(arguments,1);if(typeof f=="boolean"){var C=f;f=q.shift()}q.forEach(function(R){ia(f,R,C)});return f};O.qsa=function(f,q){var C,R=q[0]=="#",ea=!R&&q[0]==".",da=R||ea?q.slice(1):q,wa=B.test(da);return f.getElementById&&wa&&R?(C=f.getElementById(da))?[C]:[]:f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11?[]:m.call(wa&&!R&&f.getElementsByClassName?ea?f.getElementsByClassName(da):f.getElementsByTagName(q):f.querySelectorAll(q))};u.contains=c.documentElement.contains?function(f,q){return f!==q&&
f.contains(q)}:function(f,q){for(;q&&=q.parentNode;)if(q===f)return!0;return!1};u.type=w;u.isFunction=y;u.isWindow=F;u.isArray=U;u.isPlainObject=x;u.isEmptyObject=function(f){for(var q in f)return!1;return!0};u.isNumeric=function(f){var q=Number(f),C=typeof f;return f!=null&&C!="boolean"&&(C!="string"||f.length)&&!isNaN(q)&&isFinite(q)||!1};u.inArray=function(f,q,C){return T.indexOf.call(q,f,C)};u.camelCase=g;u.trim=function(f){return f==null?"":String.prototype.trim.call(f)};u.uuid=0;u.support={};
u.expr={};u.noop=function(){};u.map=function(f,q){var C=[],R;if(I(f))for(R=0;R<f.length;R++){var ea=q(f[R],R);ea!=null&&C.push(ea)}else for(R in f)ea=q(f[R],R),ea!=null&&C.push(ea);return C.length>0?u.fn.concat.apply([],C):C};u.each=function(f,q){var C;if(I(f))for(C=0;C<f.length&&q.call(f[C],C,f[C])!==!1;C++);else for(C in f)if(q.call(f[C],C,f[C])===!1)break;return f};u.grep=function(f,q){return h.call(f,q)};n.JSON&&(u.parseJSON=JSON.parse);u.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),
function(f,q){H["[object "+q+"]"]=q.toLowerCase()});u.data=function(f,q,C){if(C===ha)return typeof f[q]!=="undefined"?f[q]:ha;C===null?delete f[q]:f[q]=C};u.fn={jquery:"1.2.0",constructor:O.Z,length:0,forEach:T.forEach,reduce:T.reduce,push:T.push,sort:T.sort,splice:T.splice,indexOf:T.indexOf,concat:function(){var f,q=[];for(f=0;f<arguments.length;f++){var C=arguments[f];q[f]=O.isZ(C)?C.toArray():C}return e.apply(O.isZ(this)?this.toArray():this,q)},map:function(f){return u(u.map(this,function(q,C){return f.call(q,
C,q)}))},slice:function(){return u(m.apply(this,arguments))},ready:function(f){r.test(c.readyState)&&c.body?f(u):c.addEventListener("DOMContentLoaded",function(){f(u)},!1);return this},get:function(f){return f===ha?m.call(this):this[f>=0?f:f+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(f){T.every.call(this,function(q,C){return f.call(q,
C,q)!==!1});return this},filter:function(f){return y(f)?this.not(this.not(f)):u(h.call(this,function(q){return O.matches(q,f)}))},add:function(f,q){return u(t(this.concat(u(f,q))))},is:function(f){return f===":visible"?this.length>0?this.css("display")!=="none":!1:J(f)?this[0]===f?!0:!1:this.length>0&&O.matches(this[0],f)},not:function(f){var q=[];if(y(f)&&f.call!==ha)this.each(function(R){f.call(this,R)||q.push(this)});else{var C=typeof f=="string"?this.filter(f):I(f)&&y(f.item)?m.call(f):u(f);this.forEach(function(R){C.indexOf(R)<
0&&q.push(R)})}return u(q)},has:function(f){return this.filter(function(){return J(f)?u.contains(this,f):u(this).find(f).size()})},eq:function(f){return f===-1?this.slice(f):this.slice(f,+f+1)},first:function(){var f=this[0];return f&&!J(f)?f:u(f)},last:function(){var f=this[this.length-1];return f&&!J(f)?f:u(f)},find:function(f){var q=this;return f?typeof f=="object"?u(f).filter(function(){var C=this;return T.some.call(q,function(R){return u.contains(R,C)})}):this.length==1?u(O.qsa(this[0],f)):this.map(function(){return O.qsa(this,
f)}):u()},closest:function(f,q){var C=[],R=typeof f=="object"&&u(f);this.each(function(ea,da){for(;da&&!(R?R.indexOf(da)>=0:O.matches(da,f));)da=da!==q&&!(da!=null&&da.nodeType==da.DOCUMENT_NODE)&&da.parentNode;da&&C.indexOf(da)<0&&C.push(da)});return u(C)},parents:function(f){for(var q=[],C=this;C.length>0;)C=u.map(C,function(R){if((R=R.parentNode)&&(R==null||R.nodeType!=R.DOCUMENT_NODE)&&q.indexOf(R)<0)return q.push(R),R});return ma(q,f)},parent:function(f){return ma(t(this.pluck("parentNode")),
f)},children:function(f){return ma(this.map(function(){return ca(this)}),f)},contents:function(){return this.map(function(){return this.contentDocument||m.call(this.childNodes)})},siblings:function(f){return ma(this.map(function(q,C){return h.call(ca(C.parentNode),function(R){return R!==C})}),f)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(f){return u.map(this,function(q){return q[f]})},show:function(){return this.each(function(){this.style.display=="none"&&(this.style.display=
"");if(getComputedStyle(this,"").getPropertyValue("display")=="none"){var f=this.style,q=this.nodeName;if(!v[q]){var C=c.createElement(q);c.body.appendChild(C);var R=getComputedStyle(C,"").getPropertyValue("display");C.parentNode.removeChild(C);R=="none"&&(R="block");v[q]=R}f.display=v[q]}})},replaceWith:function(f){return this.before(f).remove()},wrap:function(f){var q=y(f);if(this[0]&&!q)var C=u(f).get(0),R=C.parentNode||this.length>1;return this.each(function(ea){u(this).wrapAll(q?f.call(this,
ea):R?C.cloneNode(!0):C)})},wrapAll:function(f){if(this[0]){u(this[0]).before(f=u(f));for(var q;(q=f.children()).length;)f=q.first();u(f).append(this)}return this},wrapInner:function(f){var q=y(f);return this.each(function(C){var R=u(this),ea=R.contents();C=q?f.call(this,C):f;ea.length?ea.wrapAll(C):R.append(C)})},unwrap:function(){this.parent().each(function(){u(this).replaceWith(u(this).children())});return this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display",
"none")},toggle:function(f){return this.each(function(){var q=u(this);(f===ha?q.css("display")=="none":f)?q.show():q.hide()})},prev:function(f){return u(this.pluck("previousElementSibling")).filter(f||"*")},next:function(f){return u(this.pluck("nextElementSibling")).filter(f||"*")},html:function(f){return 0 in arguments?this.each(function(q){var C=this.innerHTML;u(this).empty().append(X(this,f,q,C))}):0 in this?this[0].innerHTML:null},text:function(f){return 0 in arguments?this.each(function(q){q=
X(this,f,q,this.textContent);this.textContent=q==null?"":""+q}):0 in this?this.pluck("textContent").join(""):null},attr:function(f,q){var C;return typeof f!="string"||1 in arguments?this.each(function(R){if(this.nodeType===1)if(J(f))for(ba in f){var ea=ba;R=f[ba];R==null?this.removeAttribute(ea):this.setAttribute(ea,R)}else ea=f,R=X(this,q,R,this.getAttribute(f)),R==null?this.removeAttribute(ea):this.setAttribute(ea,R)}):0 in this&&this[0].nodeType==1&&(C=this[0].getAttribute(f))!=null?C:ha},removeAttr:function(f){return this.each(function(){this.nodeType===
1&&f.split(" ").forEach(function(q){this.removeAttribute(q)},this)})},prop:function(f,q){f=S[f]||f;return 1 in arguments?this.each(function(C){this[f]=X(this,q,C,this[f])}):this[0]&&this[0][f]},removeProp:function(f){f=S[f]||f;return this.each(function(){delete this[f]})},data:function(f,q){if(typeof q==="object")this.length&&(this[0][f]=q);else{if(typeof q==="undefined"){if(this.length&&typeof this[0][f]!=="undefined")return this[0][f]}else this.length&&(typeof this[0][f]!=="undefined"&&delete this[0][f],
q&&(this[0][f]=q));var C="data-"+f.replace(G,"-$1").toLowerCase();C=1 in arguments?this.attr(C,q):this.attr(C);return C!==null?ja(C):ha}},val:function(f){return 0 in arguments?(f==null&&(f=""),this.each(function(q){this.value=X(this,f,q,this.value)})):this[0]&&(this[0].multiple?u(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value)},offset:function(f){if(f)return this.each(function(C){var R=u(this);C=X(this,f,C,R.offset());var ea=R.offsetParent().offset();
C={top:C.top-ea.top,left:C.left-ea.left};R.css("position")=="static"&&(C.position="relative");R.css(C)});if(!this.length)return null;if(c.documentElement!==this[0]&&!u.contains(c.documentElement,this[0]))return{top:0,left:0};var q=this[0].getBoundingClientRect();return{left:q.left+n.pageXOffset,top:q.top+n.pageYOffset,width:Math.round(q.width),height:Math.round(q.height)}},css:function(f,q){if(arguments.length<2){var C=this[0];if(typeof f=="string")return C?C.style[g(f)]||getComputedStyle(C,"").getPropertyValue(f):
void 0;if(U(f)){if(!C)return;var R={},ea=getComputedStyle(C,"");u.each(f,function(wa,ta){R[ta]=C.style[g(ta)]||ea.getPropertyValue(ta)});return R}}var da="";if(w(f)=="string")q||q===0?da=N(f)+":"+Z(f,q):this.each(function(){this.style.removeProperty(N(f))});else for(ba in f)f[ba]||f[ba]===0?da+=N(ba)+":"+Z(ba,f[ba])+";":this.each(function(){this.style.removeProperty(N(ba))});return this.each(function(){this.style.cssText+=";"+da})},index:function(f){return f?this.indexOf(u(f)[0]):this.parent().children().indexOf(this[0])},
hasClass:function(f){return f?T.some.call(this,function(q){return this.test(ka(q))},Q(f)):!1},addClass:function(f){return f?this.each(function(q){if("className"in this){na=[];var C=ka(this);X(this,f,q,C).split(/\s+/g).forEach(function(R){u(this).hasClass(R)||na.push(R)},this);na.length&&ka(this,C+(C?" ":"")+na.join(" "))}}):this},removeClass:function(f){return this.each(function(q){if("className"in this){if(f===ha)return ka(this,"");na=ka(this);X(this,f,q,na).split(/\s+/g).forEach(function(C){na=
na.replace(Q(C)," ")});ka(this,na.trim())}})},toggleClass:function(f,q){return f?this.each(function(C){var R=u(this);X(this,f,C,ka(this)).split(/\s+/g).forEach(function(ea){(q===ha?!R.hasClass(ea):q)?R.addClass(ea):R.removeClass(ea)})}):this},scrollTop:function(f){if(this.length){var q="scrollTop"in this[0];return f===ha?q?this[0].scrollTop:this[0].pageYOffset:this.each(q?function(){this.scrollTop=f}:function(){this.scrollTo(this.scrollX,f)})}},scrollLeft:function(f){if(this.length){var q="scrollLeft"in
this[0];return f===ha?q?this[0].scrollLeft:this[0].pageXOffset:this.each(q?function(){this.scrollLeft=f}:function(){this.scrollTo(f,this.scrollY)})}},position:function(){if(this.length){var f=this[0],q=this.offsetParent(),C=this.offset(),R=V.test(q[0].nodeName)?{top:0,left:0}:q.offset();C.top-=parseFloat(u(f).css("margin-top"))||0;C.left-=parseFloat(u(f).css("margin-left"))||0;R.top+=parseFloat(u(q[0]).css("border-top-width"))||0;R.left+=parseFloat(u(q[0]).css("border-left-width"))||0;return{top:C.top-
R.top,left:C.left-R.left}}},offsetParent:function(){return this.map(function(){for(var f=this.offsetParent||c.body;f&&!V.test(f.nodeName)&&u(f).css("position")=="static";)f=f.offsetParent;return f})}};u.fn.detach=u.fn.remove;["width","height"].forEach(function(f){var q=f.replace(/./,function(C){return C[0].toUpperCase()});u.fn[f]=function(C){var R,ea=this[0];return C===ha?F(ea)?ea["inner"+q]:ea!=null&&ea.nodeType==ea.DOCUMENT_NODE?ea.documentElement["scroll"+q]:(R=this.offset())&&R[f]:this.each(function(da){ea=
u(this);ea.css(f,X(this,C,da,ea[f]()))})}});u.fn.innerWidth=function(){return this.width()};u.fn.innerHeight=function(){return this.height()};["after","prepend","before","append"].forEach(function(f,q){var C=q%2;u.fn[f]=function(){var R,ea=u.map(arguments,function(ta){var ua=[];R=w(ta);return R=="array"?(ta.forEach(function(Aa){if(Aa.nodeType!==ha)return ua.push(Aa);if(u.zepto.isZ(Aa))return ua=ua.concat(Aa.get());ua=ua.concat(O.fragment(Aa))}),ua):R=="object"||ta==null?ta:O.fragment(ta)}),da,wa=
this.length>1;return ea.length<1?this:this.each(function(ta,ua){da=C?ua:ua.parentNode;ua=q==0?ua.nextSibling:q==1?ua.firstChild:q==2?ua:null;var Aa=u.contains(c.documentElement,da);ea.forEach(function(ya){if(wa)ya=ya.cloneNode(!0);else if(!da)return u(ya).remove();da.insertBefore(ya,ua);Aa&&qa(ya,function(za){if(!(za.nodeName==null||za.nodeName.toUpperCase()!=="SCRIPT"||za.type&&za.type!=="text/javascript"||za.src)){var D=za.ownerDocument?za.ownerDocument.defaultView:n;D.eval.call(D,za.innerHTML)}})})})};
u.fn[C?f+"To":"insert"+(q?"Before":"After")]=function(R){u(R)[f](this);return this}});O.Z.prototype=aa.prototype=u.fn;O.uniq=t;O.deserializeValue=ja;u.zepto=O;return u}();n.mQuery=z;n.$$===void 0&&(n.$$=z);(function(w){function y(h){return h._zid||(h._zid=Z++)}function F(h,m,c,v){m=J(m);if(m.ns)var E=new RegExp("(?:^| )"+m.ns.replace(" "," .* ?")+"(?: |$)");return(X[y(h)]||[]).filter(function(A){return A&&(!m.e||A.e==m.e)&&(!m.ns||E.test(A.ns))&&(!c||y(A.fn)===y(c))&&(!v||A.sel==v)})}function J(h){h=
(""+h).split(".");return{e:h[0],ns:h.slice(1).sort().join(" ")}}function x(h){return ha[h]||ja&&qa[h]||h}function I(h,m,c,v,E,A,b){var M=y(h),p=X[M]||(X[M]=[]);m.split(/\s/).forEach(function(V){if(V=="ready")return w(document).ready(c);var G=J(V);G.fn=c;G.sel=E;G.e in ha&&(c=function(la){var d=la.relatedTarget;if(!d||d!==this&&!w.contains(this,d))return G.fn.apply(this,arguments)});var fa=(G.del=A)||c;G.proxy=function(la){la=N(la);if(!la.isImmediatePropagationStopped()){la.data=v;var d=fa.apply(h,
la._args==ca?[la]:[la].concat(la._args));d===!1&&(la.preventDefault(),la.stopPropagation());return d}};G.i=p.length;p.push(G);"addEventListener"in h&&h.addEventListener(x(G.e),G.proxy,G.del&&!ja&&G.e in qa||!!b)})}function L(h,m,c,v,E){var A=y(h);(m||"").split(/\s/).forEach(function(b){F(h,b,c,v).forEach(function(M){delete X[A][M.i];"removeEventListener"in h&&h.removeEventListener(x(M.e),M.proxy,M.del&&!ja&&M.e in qa||!!E)})})}function N(h,m){if(m||!h.isDefaultPrevented)if(m||=h,w.each(e,function(c,
v){var E=m[c];h[c]=function(){this[v]=ba;return E&&E.apply(m,arguments)};h[v]=na}),h.timeStamp||(h.timeStamp=Date.now()),m.defaultPrevented!==ca?m.defaultPrevented:"returnValue"in m?m.returnValue===!1:m.getPreventDefault&&m.getPreventDefault())h.isDefaultPrevented=ba;return h}function Q(h){var m,c={originalEvent:h};for(m in h)T.test(m)||h[m]===ca||(c[m]=h[m]);return N(c,h)}var Z=1,ca,aa=Array.prototype.slice,ia=w.isFunction,ma=function(h){return typeof h=="string"},X={},ka={},ja="onfocusin"in n,qa=
{focus:"focusin",blur:"focusout"},ha={mouseenter:"mouseover",mouseleave:"mouseout"};ka.click=ka.mousedown=ka.mouseup=ka.mousemove="MouseEvents";w.event={add:I,remove:L};w.proxy=function(h,m){var c=2 in arguments&&aa.call(arguments,2);if(ia(h)){var v=function(){return h.apply(m,c?c.concat(aa.call(arguments)):arguments)};v._zid=y(h);return v}if(ma(m))return c?(c.unshift(h[m],h),w.proxy.apply(null,c)):w.proxy(h[m],h);throw new TypeError("expected function");};w.fn.bind=function(h,m,c){return this.on(h,
m,c)};w.fn.unbind=function(h,m){return this.off(h,m)};w.fn.one=function(h,m,c,v){return this.on(h,m,c,v,1)};var ba=function(){return!0},na=function(){return!1},T=/^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/,e={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};w.fn.delegate=function(h,m,c){return this.on(m,h,c)};w.fn.undelegate=function(h,m,c){return this.off(m,h,c)};w.fn.live=function(h,m){w(document.body).delegate(this.selector,
h,m);return this};w.fn.die=function(h,m){w(document.body).undelegate(this.selector,h,m);return this};w.fn.on=function(h,m,c,v,E){var A,b,M=this;if(h&&!ma(h))return w.each(h,function(p,V){M.on(p,m,c,V,E)}),M;ma(m)||ia(v)||v===!1||(v=c,c=m,m=ca);if(v===ca||c===!1)v=c,c=ca;v===!1&&(v=na);return M.each(function(p,V){E&&(A=function(G){L(V,G.type,v);return v.apply(this,arguments)});m&&(b=function(G){var fa=w(G.target).closest(m,V).get(0);if(fa&&fa!==V){var la=w.extend(Q(G),{currentTarget:fa,liveFired:V});
return(A||v).apply(fa,[la].concat(aa.call(arguments,1)))}});I(V,h,v,c,m,b||A)})};w.fn.off=function(h,m,c){var v=this;if(h&&!ma(h))return w.each(h,function(E,A){v.off(E,m,A)}),v;ma(m)||ia(c)||c===!1||(c=m,m=ca);c===!1&&(c=na);return v.each(function(){L(this,h,c,m)})};w.fn.trigger=function(h,m){h=ma(h)||w.isPlainObject(h)?w.Event(h):N(h);h._args=m;return this.each(function(){if(h.type in qa&&typeof this[h.type]=="function")this[h.type]();else"dispatchEvent"in this?this.dispatchEvent(h):w(this).triggerHandler(h,
m)})};w.fn.triggerHandler=function(h,m){var c,v;this.each(function(E,A){c=Q(ma(h)?w.Event(h):h);c._args=m;c.target=A;w.each(F(A,h.type||h),function(b,M){v=M.proxy(c);if(c.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(h){w.fn[h]=function(m){return 0 in arguments?this.bind(h,m):this.trigger(h)}});
w.Event=function(h,m){ma(h)||(m=h,h=m.type);var c=document.createEvent(ka[h]||"Events"),v=!0;if(m)for(var E in m)E=="bubbles"?v=!!m[E]:c[E]=m[E];c.initEvent(h,v,!0);return N(c)}})(z);(function(w){["width","height"].forEach(function(y){var F=y.replace(/./,function(J){return J[0].toUpperCase()});w.fn["outer"+F]=function(J){var x=this;if(x){var I=x[y]();({width:["left","right"],height:["top","bottom"]})[y].forEach(function(L){J&&(I+=parseInt(x.css("margin-"+L),10))});return I}return null}})})(z);(function(w){function y(h,
m,c,v){if(h.global)return h=m||X,c=w.Event(c),w(h).trigger(c,v),!c.isDefaultPrevented()}function F(h){h.global&&w.active++===0&&y(h,null,"ajaxStart")}function J(h,m){var c=m.context;if(m.beforeSend.call(c,h,m)===!1||y(m,c,"ajaxBeforeSend",[h,m])===!1)return!1;y(m,c,"ajaxSend",[h,m])}function x(h,m,c,v){var E=c.context;c.success.call(E,h,"success",m);v&&v.resolveWith(E,[h,"success",m]);y(c,E,"ajaxSuccess",[m,c,h]);L("success",m,c)}function I(h,m,c,v,E){var A=v.context;v.error.call(A,c,m,h);E&&E.rejectWith(A,
[c,m,h]);y(v,A,"ajaxError",[c,v,h||m]);L(m,c,v)}function L(h,m,c){var v=c.context;c.complete.call(v,m,h);y(c,v,"ajaxComplete",[m,c]);c.global&&!--w.active&&y(c,null,"ajaxStop")}function N(){}function Q(h){h&&=h.split(";",2)[0];return h&&(h=="text/html"?"html":h=="application/json"?"json":ha.test(h)?"script":ba.test(h)&&"xml")||"text"}function Z(h,m){return m==""?h:(h+"&"+m).replace(/[&?]{1,2}/,"?")}function ca(h){h.processData&&h.data&&w.type(h.data)!="string"&&(h.data=w.param(h.data,h.traditional));
!h.data||h.type&&h.type.toUpperCase()!="GET"&&"jsonp"!=h.dataType||(h.url=Z(h.url,h.data),h.data=void 0)}function aa(h,m,c,v){w.isFunction(m)&&(v=c,c=m,m=void 0);w.isFunction(c)||(v=c,c=void 0);return{url:h,data:m,success:c,dataType:v}}function ia(h,m,c,v){var E,A=w.isArray(m),b=w.isPlainObject(m);w.each(m,function(M,p){E=w.type(p);v&&(M=c?v:v+"["+(b||E=="object"||E=="array"?M:"")+"]");!v&&A?h.add(p.name,p.value):E=="array"||!c&&E=="object"?ia(h,p,c,M):h.add(M,p)})}var ma=+new Date,X=n.document,ka,
ja,qa=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,ha=/^(?:text|application)\/javascript/i,ba=/^(?:text|application)\/xml/i,na=/^\s*$/,T=X.createElement("a");T.href=n.location.href;w.active=0;w.ajaxJSONP=function(h,m){if(!("type"in h))return w.ajax(h);var c=h.jsonpCallback,v=(w.isFunction(c)?c():c)||"Zepto"+ma++,E=X.createElement("script"),A=n[v],b,M=function(G){w(E).triggerHandler("error",G||"abort")},p={abort:M},V;m&&m.promise(p);w(E).on("load error",function(G,fa){clearTimeout(V);w(E).off().remove();
G.type!="error"&&b?x(b[0],p,h,m):I(null,fa||"error",p,h,m);n[v]=A;b&&w.isFunction(A)&&A(b[0]);A=b=void 0});if(J(p,h)===!1)return M("abort"),p;n[v]=function(){b=arguments};E.src=h.url.replace(/\?(.+)=\?/,"?$1="+v);X.head.appendChild(E);h.timeout>0&&(V=setTimeout(function(){M("timeout")},h.timeout));return p};w.ajaxSettings={type:"GET",beforeSend:N,success:N,error:N,complete:N,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:N};w.ajax=function(h){var m=w.extend({},h||{}),c=w.Deferred&&w.Deferred();for(ka in w.ajaxSettings)m[ka]===void 0&&(m[ka]=w.ajaxSettings[ka]);F(m);if(!m.crossDomain){var v=X.createElement("a");v.href=m.url;v.href=v.href;m.crossDomain=T.protocol+"//"+T.host!==v.protocol+"//"+v.host}m.url||(m.url=n.location.toString());(v=m.url.indexOf("#"))>-1&&(m.url=
m.url.slice(0,v));ca(m);var E=m.dataType;(v=/\?.+=\?/.test(m.url))&&(E="jsonp");m.cache!==!1&&(h&&h.cache===!0||"script"!=E&&"jsonp"!=E)||(m.url=Z(m.url,"_="+Date.now()));if("jsonp"==E)return v||(m.url=Z(m.url,m.jsonp?m.jsonp+"=?":m.jsonp===!1?"":"callback=?")),w.ajaxJSONP(m,c);h=m.accepts[E];var A={};v=function(G,fa){A[G.toLowerCase()]=[G,fa]};var b=/^([\w-]+:)\/\//.test(m.url)?RegExp.$1:n.location.protocol,M=m.xhr(),p=M.setRequestHeader,V;c&&c.promise(M);m.crossDomain||v("X-Requested-With","XMLHttpRequest");
v("Accept",h||"*/*");if(h=m.mimeType||h)h.indexOf(",")>-1&&(h=h.split(",",2)[0]),M.overrideMimeType&&M.overrideMimeType(h);(m.contentType||m.contentType!==!1&&m.data&&m.type.toUpperCase()!="GET")&&v("Content-Type",m.contentType||"application/x-www-form-urlencoded");if(m.headers)for(ja in m.headers)v(ja,m.headers[ja]);M.setRequestHeader=v;M.onreadystatechange=function(){if(M.readyState==4){M.onreadystatechange=N;clearTimeout(V);var G=!1;if(M.status>=200&&M.status<300||M.status==304||M.status==0&&b==
"file:"){E=E||Q(m.mimeType||M.getResponseHeader("content-type"));if(M.responseType=="arraybuffer"||M.responseType=="blob")var fa=M.response;else{fa=M.responseText;try{fa=m.dataFilter==N?fa:m.dataFilter.call(m.context,fa,E),E=="script"?(0,eval)(fa):E=="xml"?fa=M.responseXML:E=="json"&&(fa=na.test(fa)?null:w.parseJSON(fa))}catch(la){G=la}if(G)return I(G,"parsererror",M,m,c)}x(fa,M,m,c)}else I(M.statusText||null,M.status?"error":"abort",M,m,c)}};if(J(M,m)===!1)return M.abort(),I(null,"abort",M,m,c),
M;M.open(m.type,m.url,"async"in m?m.async:!0,m.username,m.password);if(m.xhrFields)for(ja in m.xhrFields)M[ja]=m.xhrFields[ja];for(ja in A)p.apply(M,A[ja]);m.timeout>0&&(V=setTimeout(function(){M.onreadystatechange=N;M.abort();I(null,"timeout",M,m,c)},m.timeout));M.send(m.data?m.data:null);return M};w.get=function(){return w.ajax(aa.apply(null,arguments))};w.post=function(){var h=aa.apply(null,arguments);h.type="POST";return w.ajax(h)};w.getJSON=function(){var h=aa.apply(null,arguments);h.dataType=
"json";return w.ajax(h)};w.fn.load=function(h,m,c){if(!this.length)return this;var v=this,E=h.split(/\s/);h=aa(h,m,c);var A=h.success;if(E.length>1){h.url=E[0];var b=E[1]}h.success=function(M){v.html(b?w("<div>").html(M.replace(qa,"")).find(b):M);A&&A.apply(v,arguments)};w.ajax(h);return this};var e=encodeURIComponent;w.param=function(h,m){var c=[];c.add=function(v,E){w.isFunction(E)&&(E=E());E==null&&(E="");this.push(e(v)+"="+e(E))};ia(c,h,m);return c.join("&").replace(/%20/g,"+")}})(z);(function(w){w.fn.serializeArray=
function(){var y,F,J=[],x=function(I){if(I.forEach)return I.forEach(x);J.push({name:y,value:I})};this[0]&&w.each(this[0].elements,function(I,L){F=L.type;(y=L.name)&&L.nodeName.toLowerCase()!="fieldset"&&!L.disabled&&F!="submit"&&F!="reset"&&F!="button"&&F!="file"&&(F!="radio"&&F!="checkbox"||L.checked)&&x(w(L).val())});return J};w.fn.serialize=function(){var y=[];this.serializeArray().forEach(function(F){y.push(encodeURIComponent(F.name)+"="+encodeURIComponent(F.value))});return y.join("&")};w.fn.submit=
function(y){if(0 in arguments)this.bind("submit",y);else if(this.length){var F=w.Event("submit");this.eq(0).trigger(F);F.isDefaultPrevented()||this.get(0).submit()}return this}})(z);(function(w,y){function F(ha){return x?x+ha:ha.toLowerCase()}var J="",x,I={Webkit:"webkit",Moz:"",O:"o"},L=document.createElement("div"),N=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i,Q,Z,ca,aa,ia,ma,X,ka,ja={};L.style.transform===y&&w.each(I,function(ha,ba){if(L.style[ha+"TransitionProperty"]!==
y)return J="-"+ha.toLowerCase()+"-",x=ba,!1});var qa=J+"transform";ja[Q=J+"transition-property"]=ja[Z=J+"transition-duration"]=ja[aa=J+"transition-delay"]=ja[ca=J+"transition-timing-function"]=ja[ia=J+"animation-name"]=ja[ma=J+"animation-duration"]=ja[ka=J+"animation-delay"]=ja[X=J+"animation-timing-function"]="";w.fx={off:x===y&&L.style.transitionProperty===y,speeds:{_default:400,fast:200,slow:600},cssPrefix:J,transitionEnd:F("TransitionEnd"),animationEnd:F("AnimationEnd")};w.fn.animate=function(ha,
ba,na,T,e){w.isFunction(ba)&&(T=ba,ba=na=y);w.isFunction(na)&&(T=na,na=y);w.isPlainObject(ba)&&(na=ba.easing,T=ba.complete,e=ba.delay,ba=ba.duration);ba&&=(typeof ba=="number"?ba:w.fx.speeds[ba]||w.fx.speeds._default)/1E3;e&&=parseFloat(e)/1E3;return this.anim(ha,ba,na,T,e)};w.fn.anim=function(ha,ba,na,T,e){var h,m={},c="",v=this,E=w.fx.transitionEnd,A=!1;ba===y&&(ba=w.fx.speeds._default/1E3);e===y&&(e=0);w.fx.off&&(ba=0);if(typeof ha=="string")m[ia]=ha,m[ma]=ba+"s",m[ka]=e+"s",m[X]=na||"linear",
E=w.fx.animationEnd;else{var b=[];for(h in ha)N.test(h)?c+=h+"("+ha[h]+") ":(m[h]=ha[h],b.push(h.replace(/([A-Z])/g,"-$1").toLowerCase()));c&&(m[qa]=c,b.push(qa));ba>0&&typeof ha==="object"&&(m[Q]=b.join(", "),m[Z]=ba+"s",m[aa]=e+"s",m[ca]=na||"linear")}var M=function(p){if(typeof p!=="undefined"){if(p.target!==p.currentTarget)return;w(p.target).unbind(E,M)}else w(this).unbind(E,M);A=!0;w(this).css(ja);T&&T.call(this)};ba>0&&(this.bind(E,M),setTimeout(function(){A||M.call(v)},(ba+e)*1E3+25));this.size()&&
this.get(0).clientLeft;this.css(m);ba<=0&&setTimeout(function(){v.each(function(){M.call(this)})},0);return this};w.fn.stop=function(ha,ba){return this};L=null})(z);(function(){try{getComputedStyle(void 0)}catch(y){var w=getComputedStyle;n.getComputedStyle=function(F,J){try{return w(F,J)}catch(x){return null}}}})();return z}(K));var Da=function(){if(document.currentScript)var n=document.currentScript.src;else{n=document.scripts;for(var z=n.length-1,w,y=z;y>0;y--)if(n[y].readyState==="interactive"){w=
n[y].src;break}n=w||n[z].src}z=n.indexOf("v=");z=z>0?n.substr(z+2):2023;n=n.substring(0,n.lastIndexOf("/")+1);n.endsWith("zwplayer/")||(n+="js/");return{path:n,v:z}}(),Ia=Da.path+"plugins/",Ja=function(n,z,w){var y=document.getElementsByTagName("head");if(y.length==0){y=document.createElement("head");var F=document.getElementsByTagName("body");if(F.length>0)F=F[0],document.insertBefore(y,F);else return alert("Invalid html document: no HEAD tag"),!1}else{y=y[0];F=y.childNodes;for(var J=0;J<F.length;J++){var x=
F[J];if(x.nodeName.toUpperCase()==="SCRIPT"&&x.id&&x.id==n){if(x.getAttribute("loadstate")!="true"){var I=function(){x.getAttribute("loadstate")!="true"?setTimeout(I,50):typeof w=="function"&&w(n)};setTimeout(I,50);return!1}typeof w=="function"&&w(n);return!0}}}var L=document.createElement("script");L.type="text/javascript";L.readyState?L.onreadystatechange=function(){if(L.readyState=="loaded"||L.readyState=="complete")L.onreadystatechange=null,L.setAttribute("loadstate","true"),typeof w=="function"&&
w(n)}:L.onload=function(){L.setAttribute("loadstate","true");typeof w=="function"&&w(n)};L.id=n;L.src=z;y.appendChild(L);return!1};(function(n,z,w){var y=document.getElementsByTagName("head");if(y.length==0){y=document.createElement("head");var F=document.getElementsByTagName("body");if(F.length>0)F=F[0],document.insertBefore(y,F);else return alert("Invalid html document: no HEAD tag found"),!1}else{y=y[0];F=y.childNodes;for(var J=0;J<F.length;J++){var x=F[J];if(x.nodeName.toUpperCase()==="link"&&
x.id&&x.id==n){if(x.getAttribute("loadstate")!=="true"){var I=function(){x.getAttribute("loadstate")!=="true"?setTimeout(I,50):typeof w==="function"&&w(n)};setTimeout(I,50);return!1}typeof w==="function"&&w(n);return!0}}}var L=document.createElement("link");L.type="text/css";L.setAttribute("rel","stylesheet");L.readyState?L.onreadystatechange=function(){if(L.readyState=="loaded"||L.readyState=="complete")L.onreadystatechange=null,L.setAttribute("loadstate","true"),typeof w=="function"&&w(n)}:L.onload=
function(){L.setAttribute("loadstate","true");typeof w=="function"&&w(n)};L.id=n;L.href=z;y.appendChild(L);return!1})("zwplayer-css",Da.path+"css/zwplayer.css?v="+Da.v,function(n){console.log("zwplayer.css["+n+"] is loaded")});var Ua=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 Va=/iPhone|iPad|iPod/.test(navigator.userAgent);(function(n){n+="=";for(var z=document.cookie.split(";"),w=0;w<z.length;w++){var y=z[w].trim();if(y.indexOf(n)==0)return y.substring(n.length,y.length)}return""})("ZWPlayer")||bb("ZWPlayer","V1.0",365);var ib=function(n){for(var z=navigator.languages&&navigator.languages.length?navigator.languages:[navigator.language],w=0;w<n.length;w++)for(var y=0;y<z.length;y++)if(n[w].lang&&z[y]&&z[y].indexOf(n[w].lang)>-1)return n[w].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(z){var w={};for(k in n)w[k]=n[k];for(k in z)w[k]=z[k];typeof w.playerId=="undefined"&&(w.playerId="video-body");return new function(y){y=y.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 y=="string")this.vPlayer=document.getElementById(y);else if(typeof y=="object")this.vPlayer=y;else return;this.vPlayer||(this.vPlayer=document.getElementById("video-body"));if(this.vPlayer&&(y=this.vPlayer.childNodes,y.length>0))for(var F=0;F<y.length;F++){var J=y[F];if(J.nodeName=="DIV"&&Qa(J.className,"danmuplayer")){this.wrapObj=J;break}}if(this.wrapObj){if(y=this.wrapObj.childNodes,y.length>0)for(F=0;F<y.length;F++)if(J=y[F],J.nodeName=="DIV"&&Qa(J.className,"danmu-layer")){this.Danmulayer=
J;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),Ka.ie&&Ka.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(F=0;F<this.rowCount;F++)this.rows.push({top:this.topMargin+this.rowHeight*F,count:0,last:null,idx:F});this.layerWidth=this.Danmulayer.offsetWidth;this.layerHeight=this.Danmulayer.offsetHeight;Ba.addElement(this.Danmulayer);this.Danmulayer.addEventListener("resize",function(x){this.reCalcLayout()}.bind(this))}this.start=function(x){this.timerId&&(clearInterval(this.timerId),this.timerId=0);if(!this.hasTransition){var I=this;this.timerId=setInterval(function(){var L=
I.Danmulayer,N=L.childNodes;if(N.length>0){for(var Q=[],Z=0;Z<N.length;Z++){var ca=N[Z];if(ca.tagName=="DIV"){var aa=parseFloat(ca.style.left);aa+ca.offsetWidth<0?Q.push(ca):ca.style.left=aa-4.5+"px"}}if(Q.length>0){for(Z=0;Z<Q.length;Z++)N=Q[Z],N.rowIdx&&(I.rows[N.rowIdx].last==this&&(I.rows[N.rowIdx].last=null),I.rows[N.rowIdx].count--),L.removeChild(Q[Z]);Q.splice(0,Q.length)}}},this.frameDuration)}};this.stop=function(){this.timerId&&(clearInterval(this.timerId),this.timerId=0);var x=this.Danmulayer.childNodes;
if(x.length>0)for(var I=0;I<x.length;I++)x[I].style.display="none";this.Danmulayer.style.display="none"};this.destroy=function(){this.Danmulayer&&(Ba.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(x,I){I||={};var L=document.createElement("div");L.className="danmu";typeof x.color=="undefined"||I.isFilterColorFont||(L.style.color=x.color);typeof x.border!=
"undefined"&&(L.style.border="1px solid #666");L.style.fontSize=I.forcedFontSizeValue?parseInt(25*I.forcedFontSizeValue/100)+"px":"25px";this.fontSize!=L.style.fontSize&&(this.rowHeight=parseInt(L.style.fontSize)+3,this.layerHeight=0,this.reCalcLayout(),this.fontSize=L.style.fontSize);x.outlineColor&&(L.style.outlineStyle="solid",L.style.outlineWidth="2px",L.style.outlineColor=x.outlineColor);L.style.opacity=I.opacityValue?I.opacityValue/100:"0.9";L.innerHTML=typeof K.replaceSmileDanmu=="function"?
K.replaceSmileDanmu(x.text,this.rowHeight,I):x.text;var N=x=0,Q=999999;this.rowCount>this.rows.length&&(this.rowCount=this.rows.length);for(;x<this.rowCount;x++)if(this.rows[x].count==0){N=x;Q=this.layerWidth;break}else if(this.rows[x].last){var Z=this.rows[x].last;Z=Z.getBoundingClientRect().left+Z.offsetWidth+this.danmuMargin;if(Z<Q&&(N=x,Q=Z,Q<this.layerWidth))break}Q<this.layerWidth&&(Q=this.layerWidth);L.style.fontFamily='SimHei, "Microsoft JhengHei", Arial, Helvetica, sans-serif';L.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";L.style.cursor="pointer";L.style.left=Q+"px";L.style.top=this.rows[N].top+"px";L.rowIdx=N;this.rows[N].last=L;this.rows[N].count++;this.Danmulayer.appendChild(L);var ca=this;L.onmouseover=function(aa){this.pause||(this.pause=!0)};L.onmouseout=function(aa){this.pause&&(this.pause=!1)};this.hasTransition&&(L.addEventListener("transitionend",function(){typeof this.rowIdx=="number"&&(ca.rows[this.rowIdx].last==
this&&(ca.rows[this.rowIdx].last=null),ca.rows[this.rowIdx].count--);ca.Danmulayer.removeChild(this)}),x=Q+L.offsetWidth,I.speedValue?(I=parseInt(this.speedX*parseFloat(I.speedValue)),I==0&&(I=1),I=x/I+4*Math.random()):I=x/this.speedX+4*Math.random(),L.style.transition="transform "+I+"s linear",L.style.transform="translateX(-"+x+"px)")};this.reCalcLayout=function(){if(this.Danmulayer){Ka.ie&&Ka.ver<9&&(this.wrapObj.style.height=this.vPlayer.offsetHeight-45+"px");var x=this.Danmulayer.offsetHeight;
if(x!=this.layerHeight){this.rowCount=Math.floor(Math.floor((x-this.topMargin)*2/3)/this.rowHeight);if(this.rowCount>0)if(this.rowCount>this.rows.length)for(var I=this.rows.length;I<this.rowCount;I++)this.rows.push({top:this.topMargin+this.rowHeight*I,count:0,last:null,idx:I});else for(I=0;I<this.rowCount;I++)this.rows[I].top=this.topMargin+this.rowHeight*I;this.layerHeight=x}if(this.Danmulayer.offsetWidth!=this.layerWidth){x=this.Danmulayer.childNodes;if(x.length>0)for(I=0;I<x.length;I++);this.layerWidth=
this.Danmulayer.offsetWidth}}};this.hasTransition||this.start()}(w)}}}();var Ba={_onResize:function(n){var z=n.target||n.srcElement;if(z=z.__resizeTrigger__?z.__resizeTrigger__:z){var w=z.__z_resizeListeners;if(w)for(var y=w.length,F=0;F<y;F++){var J=w[F],x=J.handler;(J=J.context)||(J=z);if(x)x.apply(J,[n]);else if(n.type==="resize"||Object.prototype.toString.call(n)==="[object ResizeObserverEntry]")x=document.createEvent("Event"),x.initEvent("resize",!1,!1),z.dispatchEvent(x)}}},addElement:function(n,
z,w){var y=n.__z_resizeListeners;if(!y)if(y=[],n.__z_resizeListeners=y,typeof K.ResizeObserver==="function")this.resizeObserver||(this.resizeObserver=new ResizeObserver(function(J){for(var x=0;x<J.length;x++)this._onResize(J[x])}.bind(this))),this.resizeObserver.observe(n);else{getComputedStyle(n,null).position==="static"&&(n.style.position="relative");var F=document.createElement("object");F.resizer=this;F.__resizeElement__=n;F.setAttribute("style","display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; opacity: 0; pointer-events: none; z-index: -9999;");
F.type="text/html";F.data="about:blank";F.onload=function(J){this.contentDocument.defaultView.__resizeTrigger__=this.__resizeElement__;this.contentDocument.defaultView.addEventListener("resize",this.resizer._onResize)};n.appendChild(F);n.__resizeDetector__=F}y.push({handler:z,context:w})},removeElement:function(n,z,w){var y=n.__z_resizeListeners;if(y){for(var F=y.length,J=0;J<F;J++){var x=y[J];if(x.handler===z&&x.context===w){y.splice(J,1);break}}if(y.length===0){if(z=n.__resizeDetector__)z.contentDocument.defaultView.removeEventListener("resize",
this._onResize),n.removeChild(z),delete n.__resizeDetector__;delete n.__z_resizeListeners;this.resizeObserver&&this.resizeObserver.unobserve(n)}}}},Ka=function(){var n,z,w,y,F,J,x=navigator.userAgent.toLowerCase(),I;(I=x.match(/chrome\/([\d.]+)/),I)?n=I[1]:(I=x.match(/firefox\/([\d.]+)/),I)?z=I[1]:(I=x.match(/edge\/([\d.]+)/),I)?w=I[1]:(I=x.match(/rv:([\d.]+)\) like gecko/),I)?y=I[1]:(I=x.match(/msie ([\d.]+)/),I)?y=I[1]:(I=x.match(/opera.([\d.]+)/),I)?F=I[1]:(I=x.match(/version\/([\d.]+).*safari/),
I)?J=I[1]:J=!1;return n?{broswer:"Chrome",version:n,chrome:!0,ver:parseInt(n)}:z?{broswer:"Firefox",version:z,firefox:!0,ver:parseInt(z)}:J?{broswer:"Safari",version:J,ver:parseInt(J)}:w?{broswer:"Edge",version:w,edge:!0,ver:parseInt(w)}:y?{broswer:"IE",version:y,ie:!0,ver:parseInt(y)}:F?{broswer:"Opera",version:F,opera:!0,ver:parseInt(F)}:{broswer:"",version:"0",ver:0}}(),Fa={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",FULL_HD1:"\u539f\u753b",allSubtitle:"\u5b57\u5e55\u603b\u5f00\u5173",closeSmallWindow:"\u5173\u95ed\u5c0f\u7a97\u53e3\u6a21\u5f0f",mainSubtitle:"\u9ed8\u8ba4\u5b57\u5e55",secondSubtitle:"\u7b2c\u4e8c\u5b57\u5e55",speed:"\u500d\u901f",muted:"\u9759\u97f3",unmuted:"\u53d6\u6d88\u9759\u97f3",level:"\u7ea7\u522b","media-prop":"\u5a92\u4f53\u6d41\u5c5e\u6027","player-help":"\u4f7f\u7528\u8bf4\u660e","version-update":"\u7248\u672c\u66f4\u65b0",
HD1:"\u8d85\u6e05",SD1:"\u9ad8\u6e05",SD2:"\u6807\u6e05",HD:"\u9ad8\u6e05",FHD:"\u5168\u9ad8\u6e05",BD:"\u84dd\u5149","BD 4M":"\u84dd\u51494M","BD 8M":"\u84dd\u51498M",waitStreamToReady:"\u6b63\u5728\u7b49\u5f85\u8282\u76ee..."},Ha={},Wa={FULL_HD1:"RAW",HD1:"FHD",SD1:"HD",SD2:"SD"},Xa="en",jb={"zh-CN":Fa,zh:Fa,"zh-HK":Ha,"zh-TW":Ha,"en-US":Wa,en:Wa};Fa="en";K.navigator&&(Ha=(K.navigator.language||K.navigator.browserLanguage).toLowerCase(),Ha.indexOf("zh")!=-1?Fa="zh-CN":Ha.indexOf("zh-tw")!=-1&&(Fa=
"zh-Hant"));Xa=Fa;var pa=function(n,z){var w=jb[Xa]||z;return w?w[n]||z:z},kb=function(){for(var n='<div class="zwp-button zwp-speedButton"><button class="zwpbtn zwp-speedBtn" data-action="showSpeedMenu" data-name="speedbtn">'+pa("speed","Speed")+'</button><ul class="zwp-speedMenu">',z="2.0x 1.5x 1.25x 1.0x 0.75x 0.5x 0.25x".split(" "),w="",y=0;y<z.length;y++)w=y===3?w+('<li class="zwp-speed-item active">'+z[y]+"</li>"):w+('<li class="zwp-speed-item">'+z[y]+"</li>");return n+w+"</ul></div>"},Ya=function(){var n=
'<div class="zwp-option-item main"><label class="zwp-option-item-label">'+pa("allSubtitle","All subtitle")+'</label><div class="zwp-option-item-value">'+Ca("","subtitleOn")+"</div></div>";n+='<div class="zwp-option-item sub1" style="display: none;"><label class="zwp-option-item-label">'+pa("mainSubtitle","Main subtitle")+'</label><div class="zwp-option-item-value">'+Ca("","subtitleDefault")+"</div></div>";return n+='<div class="zwp-option-item sub2" style="display: none;"><label class="zwp-option-item-label">'+
pa("secondSubtitle","Second subtitle")+'</label><div class="zwp-option-item-value">'+Ca("","subtitleSecond")+"</div></div>"},lb=function(n){var z='<li class="zwp-subtitles-item" data-id="-1">'+pa("subtitleOff","Captions off")+"</li>";for(var w=0;w<n.length;w++)z=w===0?z+('<li class="zwp-subtitles-item active" data-id="'+n[w].id+'">'+n[w].name+"</li>"):z+('<li class="zwp-subtitles-item" data-id="'+n[w].id+'">'+n[w].name+"</li>");return'<ul class="zwp-subtitlesMenu">'+z+"</ul>"},mb=function(){var n=
"",z=(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">\u5f39\u5e55</div>   <div class="zwp_switch" id="danmuSwitch-'+(z+'"><i class="switch_inner"></i></div> </div> <div class="zwp_dmconfig zwp_dmicon" id="danmu-config-btn-')+(z+'" title="\u5f39\u5e55\u8bbe\u7f6e"><i class="xicon xicon-subtitles"></i></div> <div class="zwp-barrage_form" id="barrage_form-')+(z+'">   <div class="zwp-barrage_inp logined">    <input id="barrage_inp_text-')+
(z+'" type="text" class="barrage_inp_text" maxlength="40" disabled="disabled" readonly="readonly">    <div class="barrage_login" href="#login"><span class="barrage_text">\u767b\u5f55</span>\u540e\u53ef\u4ee5\u53c2\u4e0e\u5f39\u5e55</div>   </div>');n+='   <a class="btn_bubble disabled" href="javascript:void(0);" title="\u9009\u62e9\u8868\u60c5" data-viewid="smilesFaces-view-'+z+'"><i class="xicon xicon-smile"></i></a>   <button type="submit" class="btn_submit vtb_disabled" title="\u767b\u5f55\u540e\u624d\u53ef\u4ee5\u53d1\u9001\u5f39\u5e55\u54e6" disabled="disabled">\u53d1\u9001</button> </div>';
n+=' <div class="zwp-barrage-set hidden" data-barrage-panel="panel" data-render="0"></div>';return n+="</div>"},La=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},nb=function y(z,w){var F=(y.canvas||(y.canvas=document.createElement("canvas"))).getContext("2d");F.font=w;return F.measureText(z).width},ob=function(z,
w){var y="";if(!w||!Array.isArray(w))return"";for(var F=0;F<w.length;F++){var J=w[F],x=La(J.time);if(!(x>=z)){var I=x*100/z+"%",L=J.title||J.text||J.time+"";if(typeof J.duration!=="undefined"){var N="red";J.style&&typeof J.style.background!=="undefined"&&(N=J.style.background);var Q=La(J.duration);x+Q>z&&(Q=z-x);y+='<span class="zwp__chapter_dot zwp_bar" style="left: '+I+"; width: "+(Q*100/z+"%; border-radius: 3px; background-color: ")+N+';" title="'+L+'" data-time="'+J.time+'" data-desc="'+J.desc+
'">&nbsp;</span>'}else y+='<span class="zwp__chapter_dot" style="left: '+I+'" title="'+L+'" data-time="'+J.time+'" data-desc="'+J.desc+'">&nbsp;</span>'}}return y},Za=function(z){return z.replace(/[<>&"]/g,function(w){return{"<":"&lt;",">":"&gt;","&":"&amp;",'"':"&quot;"}[w]})},pb=function(z){if(!z||!Array.isArray(z)||z.length===0)return null;var w='<div class="zwp-button zwp-chapterButton"><button class="zwpbtn zwp-chapterBtn" data-action="showChapterListview" data-name="chapterbtn"><i class="xicon xicon-chapter"></i> \u7ae0\u8282</button><div class="zwp-chapterPanel zwp-popupwindow"><button class="closeBtn"><i class="xicon xicon-close"></i></button><div class="form-row form-title">\u7ae0\u8282\u5217\u8868</div><div class="zwp-list-inner"><ul class="zwp-chapterlist">';
for(var y=0,F=0;F<z.length;F++){var J=z[F],x=J.title||J.text||J.time+"";x=Za(x);a:{var I=J.time;if(typeof I==="string"){if(I.indexOf(":")>=0){var L=I;break a}I=parseInt(I)}L=parseInt(I/3600);var N=parseInt(I%3600/60);I=parseInt(I%60);var Q="";L>0&&(Q+=L+":");N>=0?(N>10||L>0&&(Q+="0"),Q+=N+":"):Q+="0:";L=Q=I>=10?Q+I:Q+("0"+I)}N='<li class="chapter-item" data-time="'+J.time+'">';N+='<div class="item-title"><span class="item-time">'+L+"</span>";N+='<span class="title" title="'+x+'">'+x+"</span></div>";
J.desc&&(N+='<div class="item-content"><span class="desc">'+Za(J.desc)+"</span></div>");N+="</li>";w+=N;J=nb(x,'bold 16px "Microsoft YaHei", "Segoe UI","PingFang SC","Hiragino Sans GB","Helvetica Neue",Helvetica,Arial,sans-serif,-apple-system,BlinkMacSystemFont');J>y&&(y=J)}return{html:w+"</ul></div></div></div>",titleWidth:y}};K.insertSmile=function(z,w){z=$$(z).closest("div.zwp-smileview");if(z.length>0&&(z=z.get(0).inputbox))if(z.createTextRange&&(z.caretPos=document.selection.createRange().duplicate()),
document.all)z.createTextRange&&z.caretPos?(z=z.caretPos,z.text=z.text.charAt(z.text.length-1)==" "?w+" ":w):z.value=w;else if(z.setSelectionRange){var y=z.selectionEnd,F=z.value.substring(0,z.selectionStart);y=z.value.substring(y);z.value=F+w+y}else alert("This version of Mozilla based browser does not support setSelectionRange")};K.replaceSmileDanmu=function(z,w,y){if(typeof z!="string")return"";z.indexOf("<")>=0&&(z=z.replace(/</g,"&lt;").replace(/>/g,"&gt;"));var F=z.indexOf("[sm-");if(F<0)return z;
var J=Da.path+"widgets/smiles/p",x="",I=z.substring(0,F);for(I!=""&&(x+=I);F>=0;){I=z.indexOf("]",F+4);if(I<0){I=z.substring(F);I!=""&&(x+=I);break}F=z.substring(F+4,I);F!=""&&(y.isFilterImage||(x+='<img style="opacity: 1;" src="'+J+F+'.png" height="'+w+'">'));F=z.indexOf("[sm-",I+1);F<0?(I=z.substring(I+1),I!=""&&(x+=I)):F>I+1&&(x+=z.substring(I+1,F))}return x};var Oa=function(z){hasClass(z,"switch_on")?removeClass(z,"switch_on"):addClass(z,"switch_on")},qb=function(z,w){var y=$$;z=y(w).closest("div.zwp-dmform").children(".zwp-barrage-set");
if(z.length!=0){if(z.attr("data-render")!="1"){var F=w.zwplayer,J=z.get(0);y.get(Da.path+"widgets/danmu_setting.html?v="+Da.v,{},function(L){var N=y(J);N.html(L);N.find("a.barrage-tab-link").click(function(Q){Q.preventDefault();Q=y(this).parent();Q.hasClass("selected")||(Q.addClass("selected").siblings().removeClass("selected"),Q=y(Q.attr("data-tab")),Q.hasClass("hidden")&&(Q.removeClass("hidden"),Q.siblings().addClass("hidden")))});L=y("#fsBox_tab");L.find("div.color-box").children("a").click(function(Q){Q.preventDefault();
Q=y(this);Q.hasClass("selected")||(Q.siblings().removeClass("selected"),Q.addClass("selected"),F&&(F.danmuSetting.color=Q.attr("data-color")))});L.find("div.other-box").children("a.checkbox-wrap").click(function(Q){Q.preventDefault();var Z=y(this);Z.toggleClass("selected");Q=Z.attr("data-content");Z=Z.hasClass("selected");F&&(F.danmuSetting[Q]=Z)});y("#bfBox_tab").find("a.zwp-barrage-icons").mousedown(function(Q){if(Q.button==0){this.isMousePressed=!0;var Z=y(this).position().left,ca=Q.clientX-Z,
aa=this,ia=function(X){X=X.clientX-ca;X<0?X=0:X>134&&(X=134);y(aa).css({left:X+"px"});var ka=y(aa).siblings("div.bar-t");ka.length>0&&ka.width(X+3);aa.valuePanel||(aa.valuePanel=y(aa).parent().siblings("div.set-rol-right").get(0));if(typeof aa.valuePanel=="object"){ka=y(aa.valuePanel);var ja=ka.attr("data-barrage-content");ja=="opacityValue"?(X=parseInt(X*100/138),F&&(F.danmuSetting.opacityValue=X),ka.html(X+"%")):ja=="forcedFontSizeValue"?(X=50+parseInt(X*150/138),F&&(F.danmuSetting.forcedFontSizeValue=
X),ka.html(X+"%")):ja=="speedValue"?(X=(.5+parseFloat(X/69)).toFixed(1),F&&(F.danmuSetting.speedValue=X),ka.html(X+"x")):ja=="densityValue"&&(X=parseInt(X*100/46),F&&(F.danmuSetting.densityValue=X),ka.html(X+"\u6761"))}return!1},ma=function(X){y(document).unbind("mousemove",ia).unbind("mouseup",ma)};y(document).bind("mousemove",ia).bind("mouseup",ma)}return!1});y("#pbBox_tab").find("a.pb-link").click(function(Q){Q.preventDefault();var Z=y(this).parent();Z.toggleClass("selected");Q=y(this).attr("data-content");
Z=Z.hasClass("selected");F&&(F.danmuSetting[Q]=Z)});y("#barrage-set-bot").children("a").click(function(Q){Q.preventDefault();if(y(this).attr("data-content")=="reset"){if(F)for(a in F.danmuSetting)delete F.danmuSetting[a];y("#fsBox_tab").find(".color-box a").removeClass("selected").eq(0).addClass("selected");y("#fsBox_tab").find(".other-box a").removeClass("selected");var Z={opacityTrigger:[128,124,"90%"],forcedFontSizeTrigger:[50,46,"100%"],speedTrigger:[39,35,"1.0x"],densityTrigger:[18,14,"30\u6761"]};
y("#bfBox_tab").find("a.zwp-barrage-icons").each(function(ca,aa){ca=y(aa).attr("data-barrage-content");if(Z[ca]){var ia=Z[ca];ca=ia[1];var ma=ia[0];ia=ia[2];aa=y(aa);aa.css({left:ca+"px"});aa.siblings(".bar-t").width(ma+"px");aa.parent().siblings(".set-rol-right").text(ia)}});y("#pbBox_tab").find("li.selected").removeClass("selected")}})},"html");z.attr("data-render","1")}if(z.hasClass("hidden")){J=z.get(0);var x=this,I=function(L){var N=y(J);if(L.target==x)x=null;else if(hasClass(L.target,"xicon-close")||
!N.is(L.target)&&N.has(L.target).length===0)N.addClass("hidden"),y(document).off("click",I),delete w.zwplayer};z.removeClass("hidden");y(document).on("click",I)}}},$a=function(z){K.ctrlInitId||(K.ctrlInitId=(new Date).getTime());var w=K.ctrlInitId++;return z+w},Ca=function(z,w){return'<div class="zwp_switch action-item" id="'+(z||$a("switch-"))+'" data-action="'+(w||"none")+'"><i class="switch_inner"></i></div>'},ab=function(z){var w=z.parentNode;w&&(w=w.querySelector(".zwp-slider-value"))&&(w.innerHTML=
z.value)},Ma=function(z,w){z=z||$a("zwp_slider-");return'<input type="range" id="'+z+'" name="slider'+z+'" data-action="'+w+'" class="zwp-slider" value="0" min="-100" max="100"/><span class="zwp-slider-value">0</span>'},rb=function(z){var w="";z.infoButton&&(w='<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 y="",F="",J="",x="",I="",L="",N="",Q=z.defVolume||61.25;z.speedButton&&
!z.isLive&&(y="");z.optionButton&&(J='<div class="zwp-button zwp-optionButton"><button class="zwpbtn zwp-optionBtn" data-action="showConfigPanel" data-name="optionbtn" title="\u8bbe\u7f6e"><i class="xicon xicon-config"></i></button><div class="zwp-optionPanel"><div class="zwp-option-item"><label class="zwp-option-item-label">\u5de6\u53f3\u7ffb\u8f6c</label><div class="zwp-option-item-value">'+(Ca("","mirror")+'</div></div><div class="zwp-option-item"><label class="zwp-option-item-label">\u4e0a\u4e0b\u7ffb\u8f6c</label><div class="zwp-option-item-value">'+
Ca("","flip")+'</div></div><div class="zwp-option-item"><label class="zwp-option-item-label">\u987a90\u5ea6\u7ffb\u8f6c</label><div class="zwp-option-item-value">'+Ca("","rotated90")+'</div></div><div class="zwp-option-item"><label class="zwp-option-item-label">\u900690\u5ea6\u7ffb\u8f6c</label><div class="zwp-option-item-value">'+Ca("","rotated270")+'</div></div><div class="zwp-option-h-separator"><hr/></div><div class="zwp-option-item"><label class="zwp-option-item-label">\u5faa\u73af\u64ad\u653e</label><div class="zwp-option-item-value">'+
Ca("","loop")+'</div></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">\u89c6\u9891\u8272\u5ea6\u8c03\u8282...</button></div></div></div>'));z.disableVolumeControl||(N='<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: '+
Q+'%;"></div><div class="zwp-volume-handle" style="bottom: '+Q+'%; margin-bottom: -7px;"></div></div></div></div>');z.disableFullscreenWin||(x='<div class="zwp-button zwp-fullscrWinButton"><button class="zwpbtn zwp-fullscrWinBtn" data-action="enterfullscreenWin" data-name="fullscrWinbtn" title="\u7f51\u9875\u5168\u5c4f"><i class="xicon xicon-fullScreen-win"></i></button></div>');z.snapshotButton&&(I='<div class="zwp-button zwp-snapshotButton"><button class="zwpbtn zwp-snapshotBtn" data-action="snapshot" data-name="snapshotbtn" title="\u6293\u53d6\u56fe\u50cf"><i class="xicon xicon-camera"></i></button></div>');
z.disablePicInPic||document.pictureInPictureEnabled&&(L='<div class="zwp-button zwp-picInPicButton"><button class="zwpbtn zwp-picInPicBtn" data-action="pictureInPicture" data-name="picInPicbtn" title="\u753b\u4e2d\u753b\u6a21\u5f0f"><i class="xicon xicon-pic-in-pic"></i></button></div>');z.isLive||(F='<div class="zwp__time-rail"></div>');z='<div class="zwp-button zwp-subtitleButton" style="display: none;"><button class="zwpbtn zwp-subtitleBtn" data-action="showSubtitleMenu" data-name="subtitlebtn" title="\u5916\u6302\u5b57\u5e55"><i class="xicon xicon-cc"></i></button><div class="zwp-subtitleMenu">'+
Ya()+"</div></div>";Q=["1920","1280","720","480"];for(var Z="",ca=0;ca<Q.length;ca++)Z=ca===3?Z+('<li class="zwp-quality-item active">'+Q[ca]+"</li>"):Z+('<li class="zwp-quality-item">'+Q[ca]+"</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>'+
I+z+('<div class="zwp-button zwp-qualityButton" style="display: none;"><button class="zwpbtn zwp-qualityBtn" data-action="showQualityMenu" data-name="qualitybtn" title="\u6e05\u6670\u5ea6\u9009\u62e9"><i class="xicon xicon-hd"></i></button><ul class="zwp-qualityMenu">'+Z+"</ul></div>")+y+w+J+N+L+x+'<div class="zwp-button"><button class="zwpbtn zwp-fullscrBtn" data-action="enterfullscreen" data-name="fullscrbtn" title="'+pa("enterFullScreen","\u8fdb\u5165\u5168\u5c4f")+'"><i class="xicon xicon-fullScreen"></i></button></div>'+
F};(function(z,w){typeof K.define==="function"&&K.define.amd?K.define([],w):typeof exports==="object"?module.exports=w():z.ZWPlayer=w()})(K,function(){function z(e){e=e.getBoundingClientRect();return{top:e.top+(K.pageYOffset||document.documentElement.scrollTop),left:e.left+(K.pageXOffset||document.documentElement.scrollLeft)}}function w(e){var h=e.offsetTop;for(e=e.offsetParent;e!==null;)h+=e.offsetTop,e=e.offsetParent;return h}var y=function(){return(new Date).getTime()};typeof performance!="undefined"&&
performance.now&&(y=function(){return performance.now()});var F=y(),J=function(e){var h="",m=!1,c="";e.startsWith("webrtc://")?h="/rtc/v1/play/":e.startsWith("brtc://")&&(h="/brtc/v3/pullstream",m=!0,c=e.replace("brtc://","webrtc://"));var v=e.indexOf("://");if(v==-1)return!1;var E="";if(e.indexOf("?")>=0){var A=e.indexOf("?");E=e.substr(A+1);e=e.substr(0,A)}var b=e.indexOf("/",v+3);A=e.substr(0,v);v=e.substring(v+3,b);var M=e.substring(b),p=M.lastIndexOf("/"),V="";b=v.indexOf(":");b>0&&(V=v.substring(b+
1),v=v.substring(0,b));b=M.substring(1,p);M=M.substring(p+1);p=M.lastIndexOf(".");p>0&&(M=M.substring(0,p));p="";E.indexOf("vhost=")>0&&(p=E.substr(E.indexOf("vhost=")+6),p.indexOf("&")>0&&(p=p.substr(0,p.indexOf("&"))));v===p&&/^(\d+)\.(\d+)\.(\d+)\.(\d+)$/.test(v)&&(p="_default_vhost_");e={url:e,schema:A,server:v,port:V,vhost:p,app:b,stream:M};e.user_query={};if(E.length!==0){E.indexOf("?")>=0&&(E=E.split("?")[1]);E=E.split("&");for(V=0;V<E.length;V++)p=E[V].split("="),e[p[0]]=p[1],e.user_query[p[0]]=
p[1];e.domain&&(e.vhost=e.domain)}A==="webrtc"||A==="rtc"?(A="",e.port||(e.user_query.schema==="https"?(e.port=443,A=e.user_query.schema||"https"):K.location.href.indexOf("https://")===0?(e.port=443,A=e.user_query.schema||"https"):e.port=1985)):m&&(K.location.href.indexOf("https://")===0?(A="https",e.port=e.por||443):(A="http",e.port=e.por||80));c||="rtmp://"+v+"/"+b+"/"+M;A=A?A+":":K.location.protocol;(V=e.port)||(V=A==="https:"?V||443:V||1985);h=h||"/live/webrtc/play/";v=A+"//"+e.server+":"+V+h;
for(var G in e.user_query)G!=="api"&&G!=="play"&&(v+="&"+G+"="+e.user_query[G]);v=v.replace(h+"&",h+"?");m={apiUrl:v,streamUrl:c,schema:A,urlObject:e,port:V,is_brtc:m};m.tid=Number(parseInt((new Date).getTime()*Math.random()*100)).toString(16).slice(0,7);return m},x=function(e,h,m,c){let v=null;v=K.XMLHttpRequest?new K.XMLHttpRequest:new K.ActiveXObject("Microsoft.XMLHTTP");v.addEventListener("error",function(E){c&&c("REQUEST:"+E.type)});v.onreadystatechange=function(){if(v.readyState===4)if(v.status===
200){var E=JSON.parse(v.responseText);m&&m(E)}else c&&c("STATUS:"+v.status+":"+v.statusText)};v.open("POST",e,!0);v.setRequestHeader("Content-Type","application/json");v.send(h);return v},I=function(e){var h=e.lastIndexOf("/"),m=e.indexOf("?");h=e.indexOf(".",h+1);var c="";h>0&&(m>0?h>m||(c=e.substring(h,m).toLowerCase()):c=e.substring(h).toLowerCase(),h=c.lastIndexOf("."),h>0&&(c=c.substring(h)));return c},L=void 0,N=void 0,Q=void 0;"classList"in document.documentElement?(L=function(e,h){return e.classList!==
void 0&&e.classList.contains(h)},N=function(e,h){return e.classList.add(h)},Q=function(e,h){return e.classList.remove(h)}):(L=function(e,h){return(new RegExp("\\b"+h+"\\b")).test(e.className)},N=function(e,h){L(e,h)||(e.className+=" "+h)},Q=function(e,h){e.className=e.className.replace(new RegExp("\\b"+h+"\\b","g"),"")});K.hasClass=L;K.addClass=N;K.removeClass=Q;/MSIE 8\.0/.test(navigator.userAgent);var Z=function(e){e=parseInt(e);var h=parseInt(e/3600),m=parseInt(e%3600/60);e=parseInt(e%60);var c=
"";h>0&&(c+=h+":");c=m>=10?c+(m+":"):m>0?c+("0"+m+":"):c+"00:";return e>=10?c+e:c+("0"+e)},ca=function(e){var h=!1,m=!1,c=this;c._config=e||{};c.peer_conn=null;c.danmuSetting={};typeof c._config.controlbar==="undefined"&&(c._config.controlbar=!0);c._config.hideControlbarTimeout||(c._config.hideControlbarTimeout=1E4);typeof c._config.defVolume==="undefined"&&(c._config.defVolume=61.25);c.setRtcstream=function(d){this.videoEl&&(this.videoEl.srcObject=d,this.videoEl.play(),this.setplaystate(!0),this.startHideControlbar(this))};
c.onfullscrchange=function(d){Na()?(this.isFullscr=!0,this.setupFullscrBtn&&this.setupFullscrBtn.setAttribute("title",pa("exitFullScreen","Exit full screen"))):(this.setupFullscrBtn&&(Q(this.playerElm,"zwp-fullscreen"),this.setupFullscrBtn.setAttribute("data-action","enterfullscreen"),this.setupFullscrBtn.setAttribute("title",pa("enterFullScreen","Enter full screen"))),this.isFullscr=!1);this.isFullscrWin||this.reposDanmuToolbar(this.isFullscr);console.log("fullscrchange:"+d.type)}.bind(c);c.on_btnclick=
function(d){if(d.currentTarget&&this.btnBindZwp){d=d.currentTarget;var l=d.getAttribute("data-action");l==="play"?this._config.disablePlayBtn||(this.isPlaying?this.videoEl&&(this.videoEl.paused||this.videoEl.ended)&&(this.videoEl.play(),this.setplaystate(!0)):this._config.url&&this.play(this._config.url)):l==="pause"?this._config.disablePlayBtn||!this.videoEl||this.videoEl.paused||this.videoEl.ended||(this.videoEl.pause(),this.setplaystate(!1)):l==="mute"?this.videoEl&&(this.videoEl.muted||this.setMuted(!0)):
l==="unmute"?this.videoEl&&this.videoEl.muted&&this.setMuted(!1):l==="enterfullscreen"?this.setFullscreen(!0,d):l==="exitfullscreen"?this.setFullscreen(!1,d):l==="enterfullscreenWin"?this.setFullscreenWin(!0,d):l==="exitfullscreenWin"?this.setFullscreenWin(!1,d):l==="showMediainfo"?this.showMediainfo():l==="snapshot"?this.doSnapshot():l==="pictureInPicture"&&this.togglePictureInPicture()}}.bind(c);c.setFullscreen=function(d,l){if(d){if(!Na()&&this.playerElm){d=this.playerElm;var r=this.videoEl;d.requestFullscreen?
d.requestFullscreen():d.webkitRequestFullscreen?d.webkitRequestFullScreen():d.mozRequestFullScreen?d.mozRequestFullScreen():d.msRequestFullscreen?d.msRequestFullscreen():d.oRequestFullscreen?d.oRequestFullscreen():r.webkitEnterFullScreen?r.webkitEnterFullScreen():(r=document.documentElement,r.requestFullscreen?r.requestFullscreen():r.mozRequestFullScreen?r.mozRequestFullScreen():r.webkitRequestFullScreen?r.webkitRequestFullScreen():(r=document.body,document.documentElement.style.cssText="width:100%;height:100%;overflow:hidden;",
r.style.cssText="width:100%;height:100%;overflow:hidden;",d.style.cssText="width:100%;height:100%;overflow:hidden;;margin:0px;padding:0px;",document.IsFullScreen=!0));N(this.playerElm,"zwp-fullscreen");l.setAttribute("data-action","exitfullscreen");if(!this.setupFullscrBtn){d=this.onfullscrchange;r=this.videoEl;var B=document.webkitExitFullscreen||document.webkitCancelFullScreen?"webkitfullscreenchange":document.mozCancelFullScreen?"mozfullscreenchange":document.msExitFullscreen?"MSFullscreenChange":
"webkitfullscreenchange";document.addEventListener("fullscreenchange",d,!1);B&&document.addEventListener(B,d,!1);r&&Va&&(r.addEventListener("webkitbeginfullscreen",d),r.addEventListener("webkitendfullscreen",d));this.setupFullscrBtn=l}}}else Na()&&this.playerElm&&(d=this.playerElm,r=document.documentElement,r.exitFullscreen?r.exitFullscreen():r.mozCancelFullScreen?r.mozCancelFullScreen():r.webkitCancelFullScreen?r.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():(r=document.body,document.documentElement.style.cssText="",r.style.cssText="",d.style.cssText="",document.IsFullScreen=!1),Q(this.playerElm,"zwp-fullscreen"),l.setAttribute("data-action","enterfullscreen"))}.bind(c);c.setFullscreenWin=
function(d,l){this.playerElm&&(d?this.isFullscrWin||(N(this.playerElm,"zwp-fullscreen-win"),l.setAttribute("data-action","exitfullscreenWin"),this.isFullscrWin=!0,this.reposDanmuToolbar(!0),(d=this.playerElm.parentNode)&&d.tagName!=="BODY"&&(this.oldWrapZIndex=d.style.zIndex,d.style.zIndex=99999999)):this.isFullscrWin&&(typeof this.oldWrapZIndex!=="undefined"&&(d=this.playerElm.parentNode,d.style.zIndex=this.oldWrapZIndex,delete this.oldWrapZIndex),Q(this.playerElm,"zwp-fullscreen-win"),l.setAttribute("data-action",
"enterfullscreenWin"),delete this.isFullscrWin,this.reposDanmuToolbar(!1)))}.bind(c);c.setMuted=function(d){this.videoEl&&(this.videoEl.muted=d)&&(this.oldVolume=this.videoEl.volume);d?(N(this.playerElm,"zwp-muted"),this.muteBtn&&this.muteBtn.setAttribute("data-action","unmute")):(this.oldVolume&&(this.videoEl.volume=this.oldVolume,delete this.oldVolume),Q(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(c);c.setVolume=function(d){this.videoEl&&(this.videoEl.volume=d)}.bind(c);c.startHideControlbar=function(d){d.controlbar&&!d._config.fixedControlbar&&(d.hideControlbarTime=(new Date).getTime()+d._config.hideControlbarTimeout,d.hideControlbarTimer||(d.hideControlbarTimer=K.setInterval(function(){(new Date).getTime()>=d.hideControlbarTime&&(K.clearInterval(d.hideControlbarTimer),delete d.hideControlbarTimer,Ga(d.controlbar,1E3,function(l){l.style.display=
"none";N(d.playerElm,"hide-cursor");d.isControlbarhidden=!0;typeof d._config.onhideControlbar=="function"&&d._config.onhideControlbar.call(d)}))},1E3)))}.bind(c);c.buildProgressBar=function(){var d={};if(this.controlbar){var l=this.controlbar;d.rail=l.querySelector(".zwp__time-rail");d.timeInfo=l.querySelector(".zwp__time-info");if(this._config.isLive)d.rail&&(Q(d.rail,"has-duration"),N(d.rail,"zwp-hidden")),this.progressBar&&this.progressBar.streamtype||(d.timeInfo&&(d.timeInfo.innerHTML='<div class="zwp-streamtype zwp-label">Live</div>',
d.streamtype=l.querySelector(".zwp-streamtype")),this.progressBar=d);else if(d.timeInfo&&(this.progressBar&&this.progressBar.streamtype?this.progressBar.streamtype.innerHTML="VOD":(d.timeInfo.innerHTML='<div class="zwp-streamtype zwp-label">VOD</div>',d.streamtype=l.querySelector(".zwp-streamtype"))),d.rail||(l.insertAdjacentHTML("beforeend",'<div class="zwp__time-rail"></div>'),d.rail=l.querySelector(".zwp__time-rail")),Q(d.rail,"zwp-hidden"),N(d.rail,"has-duration"),this._config.disableSeek&&N(d.rail,
"zwp_disabled"),this.progressBar&&this.progressBar.total)this.progressBar.rail&&this._config.useProgressTooltip&&(l=this.progressBar.rail.querySelector(".zwp__time-float"))&&(r=l.querySelector(".zwp__time-thumbnail"),r||(l.insertAdjacentHTML("afterbegin",'<div class="zwp__time-thumbnail"></div>'),r=l.querySelector(".zwp__time-thumbnail"),this.progressBar.thumbnails=r),this._config.thumbnails?(O=this._config.thumbnails,r&&(O.rowsize=typeof O.row=="number"?O.row:Math.ceil(Math.sqrt(O.total)),r.style.width=
O.width+"px",r.style.height=O.height+"px",r.style.backgroundImage="url("+O.url+")"),l.style.width=4+O.width+"px",l.style.height=4+O.height+"px",N(l,"zwp__thumbnail")):(l.style.width=null,l.style.height=null,r&&(r.style.width="0px",r.style.height="0px",r.style.backgroundImage=null),Q(l,"zwp__thumbnail")));else{var r='<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(this._config.useProgressTooltip){var B="",H="",P="";if(typeof this._config.thumbnails==="object"&&this._config.thumbnails!=null){var O=this._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)),P=' style="width: '+(4+O.width)+"px; height: "+(4+O.height)+'px;"',H=" zwp__thumbnail",B='<div class="zwp__time-thumbnail" style="width: '+O.width+"px;height: "+O.height+"px; background-image: url("+
O.url+');"></div>')}r+='<div class="zwp__time-float'+H+'"'+P+">"+B+'<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=r+"</span>";d.buffering=l.querySelector(".zwp__time-buffering");d.total=l.querySelector(".zwp__time-total");d.loaded=l.querySelector(".zwp__time-loaded");d.current=l.querySelector(".zwp__time-current");d.thumb=l.querySelector(".zwp__time-thumb");
d.timefloat=l.querySelector(".zwp__time-float");d.timefloatcurrent=l.querySelector(".zwp__time-float-current");d.thumbnails=l.querySelector(".zwp__time-thumbnail");d.slider=l.querySelector(".zwp__time-slider");d.hovered=l.querySelector(".zwp__time-hovered");d.chapters=l.querySelector(".zwp__time-chapter");d.newTime=0;d.forcedHandlePause=!1;d.buffering.style.display="none";d.slider.addEventListener("dragstart",function(){return!1});this.progressBar=d;this.showTimefloat=function(S){if(this._config.useProgressTooltip){var U=
S.originalEvent&&S.originalEvent.changedTouches?S.originalEvent.changedTouches[0].pageX:S.changedTouches?S.changedTouches[0].pageX:S.pageX;S=this.progressBar;var g=this.videoEl.duration;var t=z(S.total);var u=S.total.offsetWidth;U<t.left?U=t.left:U>u+t.left&&(U=u+t.left);U-=t.left;t=U/u;S=this.progressBar;S.timefloatcurrent.innerHTML=Z(g*t);S.thumbnails&&this._config.thumbnails?(g=this._config.thumbnails,t=Math.floor(t*g.total),t>=g.total&&(t=g.total-1),g.rowsize!=0&&(S.thumbnails.style.backgroundPosition=
"-"+t%g.rowsize*g.width+"px -"+g.height*Math.floor(t/g.rowsize)+"px")):(g=7*S.timefloatcurrent.innerHTML.length+10,g<40&&(g=40),S.timefloat.style.width=g+"px");g=S.timefloat.offsetWidth/2;S.timefloat.style.left=(U<g?g:U>u-g?u-g:U)+"px";S.timefloat.style.display="block"}}.bind(this);d.slider.addEventListener("mouseenter",function(S){var U=this;if(U.videoEl){var g=U.videoEl.duration;isNaN(g)||g===Infinity||S.target!==d.slider||(d.bindMouseMoveEvent||(d.slider.addEventListener("mousemove",function(t){var u=
t.target;(u===d.slider||u.closest(".zwp__time-slider"))&&U.showTimefloat(t)}),d.bindMouseMoveEvent=!0),d.timefloat&&(d.timefloat.style.display="block"))}}.bind(this));d.slider.addEventListener("mouseleave",function(){if(this.videoEl){var S=this.videoEl.duration;isNaN(S)||S===Infinity||h||!d.timefloat||(d.timefloat.style.display="none")}}.bind(this));var W=function(S,U){var g=this,t=d.slider.offsetWidth,u=z(d.slider);u=S.pageX-u.left;u<0?u=0:u>t&&(u=t);t=(u*100/t).toFixed(4);d.thumb.style.left=t+"%";
U?(g.seekTimeProgress(t),g.lastSeekProgress=t):typeof g.lastSeekProgress!="undefined"&&Math.abs(t-g.lastSeekProgress)>1&&(g.lastSeekProgress=t,g.seekTimer||(g.seekTimer=setTimeout(function(){g.seekTimeProgress(g.lastSeekProgress);delete g.seekTimer},1E3)));S.preventDefault();S.stopPropagation()}.bind(this);this.on_progressbar_mousemove=function(S){var U=S.target,g;if(g=h)a:if(g=d.slider,U===g)g=!0;else{for(;U.parentNode;){if(U.parentNode===g){g=!0;break a}U=U.parentNode}g=!1}g&&W(S)}.bind(this);this.on_progressbar_mouseup=
function(S){if(h){document.removeEventListener("mousemove",this.on_progressbar_mousemove);document.removeEventListener("mouseup",this.on_progressbar_mouseup);h=!1;delete this.isTrackingProgress;this.seekTimer&&(clearTimeout(this.seekTimer),delete this.seekTimer);if(S.target&&(S.target.parentNode==d.thumb||S.target==d.thumb)){var U=d.slider.offsetWidth,g=z(d.slider);S=S.pageX-g.left;S<0?S=0:S>U&&(S=U);U=(S*100/U).toFixed(4);typeof this.lastSeekProgress!="undefined"?Math.abs(U-this.lastSeekProgress)>
1&&this.seekTimeProgress(U):this.seekTimeProgress(U)}delete this.lastSeekProgress}}.bind(this);this.on_progressbar_mousedown=function(S){h||this._config.disableSeek||(c.isTrackingProgress=!0,W(S,!0),document.addEventListener("mousemove",this.on_progressbar_mousemove),document.addEventListener("mouseup",this.on_progressbar_mouseup),h=!0,S.preventDefault(),S.stopPropagation())}.bind(this);d.slider.addEventListener("mousedown",this.on_progressbar_mousedown)}}}.bind(c);c.updateProgressBarType=function(){if(this.controlbar){var d=
this.controlbar.querySelector(".zwp__time-rail");this._config.isLive?(d&&(Q(d,"has-duration"),N(d,"zwp-hidden")),this.progressBar&&this.progressBar.streamtype&&(this.progressBar.streamtype.innerHTML="Live",this.progressBar.streamtype.style.display="block")):(d&&(Q(d,"zwp-hidden"),N(d,"has-duration"),this._config.disableSeek&&N(d,"zwp_disabled")),this.progressBar&&this.progressBar.streamtype&&(this.progressBar.streamtype.innerHTML="VOD",this.progressBar.streamtype.style.display="block"))}}.bind(c);
c.updateDuration=function(d){if(d.controlbar){var l=d.controlbar.querySelector(".zwp__duration-container"),r=d.videoEl.duration;if(isNaN(r)||r===Infinity)l.style.display="none",d._config.isLive=!0;else{l.style.display="block";l=l.querySelector(".zwp__duration");var B=parseInt(r/3600),H=parseInt(r%3600/60);r=parseInt(r%60);var P="";B>0&&(P+=B+":");P=H>=10?P+(H+":"):H>0?P+("0"+H+":"):P+"00:";l.innerHTML=r>=10?P+r:P+("0"+r);d.chapters&&setTimeout(function(){this.loadChapters()}.bind(d),1E3)}d.updateProgressBarType();
d.syncUI()}}.bind(c);c.setProgressRail=function(d){var l=d!==void 0?d.target||d.detail.target:this.videoEl,r=null;l&&l.buffered&&l.buffered.length>0&&l.buffered.end&&this.videoEl.duration?r=l.buffered.end(l.buffered.length-1)/this.videoEl.duration:l&&l.bytesTotal!==void 0&&l.bytesTotal>0&&l.bufferedBytes!==void 0?r=l.bufferedBytes/l.bytesTotal:d&&d.lengthComputable&&d.total!==0&&(r=d.loaded/d.total);r!==null&&(r=Math.min(1,Math.max(0,r)),this.progressBar&&this.progressBar.loaded&&(this.progressBar.loaded.style.width=
r*100+"%"))}.bind(c);c.updateProgress=function(d){if(!this.isTrackingProgress&&this.progressBar&&this.progressBar.thumb){var l=this.videoEl.duration;!isNaN(l)&&l!==Infinity&&l>0&&(d+.3>=l&&(d=l),d=d/l*100,this.progressBar.thumb.style.left=d+"%",this.progressBar.current&&(this.progressBar.current.style.width=d/100*100+"%"))}}.bind(c);c.seekTimeProgress=function(d){if(this.videoEl){var l=this.videoEl.duration;isNaN(l)||l===Infinity||(this.videoEl.currentTime=l*d/100,this.progressBar.current&&(this.progressBar.current.style.width=
d+"%"))}}.bind(c);c.seekTimeProgressByTime=function(d){if(this.videoEl){var l=this.videoEl.duration;isNaN(l)||l===Infinity||(this.videoEl.currentTime=d,this.progressBar.current&&(this.progressBar.current.style.width=d/l*100+"%"))}}.bind(c);c.on_speedItemclick=function(d){d.stopPropagation();d=d.currentTarget;if(!L(d,"active")){var l=parseFloat(d.innerText),r=d.parentNode.querySelector(".active");r&&Q(r,"active");N(d,"active");this.videoEl&&(this.videoEl.playbackRate=l);if(r=this.controlbar.querySelector(".zwp-speedBtn"))r.innerHTML=
l==1?pa("speed","Speed"):d.innerText}var B=d.parentNode;B.style.display="none";setTimeout(function(){B.style.display=null},1E3)}.bind(c);c.resetSpeedMenu=function(){if(this.controlbar){var d=this.controlbar.querySelector(".zwp-speed-item.active");if(d&&d.innerText!=="1.0x"){var l=this.controlbar.querySelector(".zwp-speedBtn");l&&(l.innerHTML=pa("speed","Speed"));Q(d,"active");d=d.parentNode.querySelectorAll("li.zwp-speed-item");if(d.length>0)for(l=0;l<d.length;l++)if(d[l].innerText==="1.0x"){N(d[l],
"active");break}}}}.bind(c);c.syncUI=function(){if(this._config.isLive){var d=this.controlbar.querySelector(".zwp-speedButton");d&&this.controlbar.removeChild(d);Q(this.controlbar,"zwp-vodplayer")}else{if(this._config.speedButton&&(d=this.controlbar.querySelector(".zwp-speedButton"),!d)){var l=this.controlbar.querySelector(".zwp-infoButton")||this.controlbar.querySelector(".zwp-optionButton")||this.controlbar.querySelector(".zwp-volume-docker");if(l){var r=kb();d=document.createElement("div");this.controlbar.insertBefore(d,
l);d.outerHTML=r;d=this.controlbar.querySelectorAll(".zwp-speedMenu>li.zwp-speed-item");d.length>0&&d.forEach(function(B){B.addEventListener("click",c.on_speedItemclick)})}}N(this.controlbar,"zwp-vodplayer")}}.bind(c);c.onKeydown=function(d){if(d)if(d.keyCode===27)if(this.contextMenu)this.hideContextMenu(),d.stopPropagation(),d.preventDefault();else{if(this.isFullscrWin&&this.controlbar){var l=this.controlbar.querySelector(".zwp-fullscrWinBtn");l&&(this.setFullscreenWin(!1,l),d.stopPropagation(),
d.preventDefault())}}else d.keyCode!==13&&(d.keyCode===38?(d.preventDefault(),this.videoEl&&(d=this.videoEl.volume,d+=.05,d>1&&(d=1),this.setVolume(d),this.setMuted(!1),l=parseInt(d*100)+"%",l={icon:"speaker",text:l},this.toast(l,1200,!1),this.positionVolumeThumb&&this.positionVolumeThumb(d))):d.keyCode===40?(d.preventDefault(),this.videoEl&&(d=this.videoEl.volume,d-=.05,d<0&&(d=0),this.setVolume(d),this.setMuted(d===0),l=parseInt(d*100)+"%",d===0&&(l=pa("muted","Muted")),l={icon:"speaker",text:l},
this.toast(l,1200,!1),this.positionVolumeThumb&&this.positionVolumeThumb(d))):d.keyCode===32?(d.preventDefault(),this._config.isLive||this._config.disablePlayBtn||!this.videoEl||(this.videoEl.paused||this.videoEl.ended?(this.videoEl.play(),this.setplaystate(!0)):(this.videoEl.pause(),this.setplaystate(!1)))):d.keyCode!==77&&d.keyCode!==109||!this.videoEl||(this.videoEl.muted?(this.toast(pa("unmuted","Unmuted"),1E3,!1,!0),this.setMuted(!1)):(this.toast(pa("muted","Muted"),1E3,!1,!0),this.setMuted(!0))))}.bind(c);
c.on_colorSliderChange=function(d){var l=d.currentTarget;d=l.getAttribute("data-action");this.colors||(this.colors={brightness:0,contrast:0,saturation:0,hue:0});ab(l);if(typeof this.colors[d]!=="undefined"&&(l=parseInt(l.value),d==="hue"?this.colors.hue=parseInt(l*180/100):this.colors[d]=l,this.videoEl)){d=null;l=this.colors;l.brightness&&(d="brightness("+(100+l.brightness)+"%)");if(l.contrast){var r=100+l.contrast;d=(d?d+" ":"")+("contrast("+r+"%)")}l.saturation&&(r=100+l.saturation,d=(d?d+" ":"")+
("saturate("+r+"%)"));l.hue&&(l=l.hue,d=(d?d+" ":"")+("hue-rotate("+l+"deg)"));this.videoEl.style.filter=d}}.bind(c);c.createColorSettingPanel=function(){var d=this,l='<div class="zwp-colorSettingPanel zwp-popupwindow"><button class="closeBtn"><i class="xicon xicon-close"></i></button><div class="form-row form-title">\u89c6\u9891\u8272\u5f69\u8c03\u6574</div><div class="form-row"><label class="row-label">\u4eae\u5ea6</label><div class="row-content">'+Ma("","brightness")+'</div></div><div class="form-row"><label class="row-label">\u5bf9\u6bd4\u5ea6</label><div class="row-content">'+
Ma("","contrast")+'</div></div><div class="form-row"><label class="row-label">\u9971\u548c\u5ea6</label><div class="row-content">'+Ma("","saturation")+'</div></div><div class="form-row"><label class="row-label">\u8272\u8c03</label><div class="row-content">'+Ma("","hue")+'</div></div><div class="form-row form-bottombar"><button class="zwp-form-button action-item" data-action="resetcolors">\u91cd\u7f6e</button></div></div>';d.overlay_layers.insertAdjacentHTML("beforeend",l);l=d.overlay_layers.querySelector(":scope > .zwp-colorSettingPanel");
var r=l.querySelector(".closeBtn");r&&r.addEventListener("click",function(B){B.stopPropagation();var H=B.currentTarget.closest(".zwp-colorSettingPanel");Ga(H,500,function(){H.remove()});delete d.colorSettingPanel});r=l.querySelectorAll('input[type="range"]');r.length>0&&r.forEach(function(B){B.addEventListener("input",c.on_colorSliderChange);if(d.colors){var H=B.getAttribute("data-action");typeof d.colors[H]!=="undefined"&&(B.value=d.colors[H],ab(B))}});l.addEventListener("mousedown",function(B){B.stopPropagation()});
l.addEventListener("dblclick",function(B){B.stopPropagation()});l.addEventListener("click",function(B){B.stopPropagation()});(r=l.querySelector(".zwp-form-button"))&&r.addEventListener("click",function(B){B.preventDefault();B.stopPropagation();B=B.currentTarget.closest(".zwp-colorSettingPanel").querySelectorAll('input[type="range"]');B.length>0&&B.forEach(function(H){if(parseInt(H.value)!==0)if(H.value=0,document.createEvent){const P=document.createEvent("HTMLEvents");P.initEvent("input",!0,!1);H.dispatchEvent(P)}else document.createEventObject&&
H.fireEvent("input")})});return d.colorSettingPanel=l}.bind(c);var v=function(d,l){if(d=d.querySelector(".zwp-optionPanel"))d=d.querySelectorAll(".zwp_switch"),d.length>0&&d.forEach(function(r){var B=r.getAttribute("data-action");l.indexOf(B)!==-1&&L(r,"switch_on")&&Q(r,"switch_on")})};c.on_optionItemclick=function(d){d.stopPropagation();d=d.currentTarget;L(d,"zwp_switch")&&Oa(d);var l=d.getAttribute("data-action");if(l==="mirror")this.videoEl&&(d=L(d,"switch_on"),this._config.video_mirror=d,this.flipMirrorVideo(),
d&&(this._config.video_rotated=0,v(this.controlbar,["rotated270","rotated90"])));else if(l==="flip")this.videoEl&&(d=L(d,"switch_on"),this._config.video_flip=d,this.flipMirrorVideo(),d&&(this._config.video_rotated=0,v(this.controlbar,["rotated270","rotated90"])));else if(l==="rotated90")this.videoEl&&(d=L(d,"switch_on"),this._config.video_rotated=d?90:0,this.rotateVideo(),d&&(this._config.video_mirror=!1,this._config.video_flip=!1,v(this.controlbar,["mirror","flip","rotated270"])));else if(l==="rotated270")this.videoEl&&
(d=L(d,"switch_on"),this._config.video_rotated=d?270:0,this.rotateVideo(),d&&(this._config.video_mirror=!1,this._config.video_flip=!1,v(this.controlbar,["mirror","flip","rotated90"])));else if(l==="loop")d=L(d,"switch_on"),this._config.loop=d;else if(l==="showColorConfig"){var r=d.closest(".zwp-optionPanel");if(r&&r.closest(".zwp-optionButton")){d=this.overlay_layers.querySelector(":scope > .zwp-colorSettingPanel");if(!d&&(d=this.createColorSettingPanel(),!d))return;d.style.display="block";r.style.display=
"none";setTimeout(function(){r.style.display=null},1E3)}}}.bind(c);c.flipMirrorVideo=function(){var d=null;this._config.video_flip&&(d="rotateX(180.00deg)");this._config.video_mirror&&(d=d?d+" rotateY(180.00deg)":" rotateY(180.00deg)");this.videoEl.style.width="100%";this.videoEl.style.height="100%";this.videoEl.style.transform=d}.bind(c);c.rotateVideo=function(){var d=null,l=this.videoEl.parentNode;if(l&&l===this.videoWrapper)if(this._config.video_rotated){var r=l.offsetHeight;l=l.offsetWidth;var B=
this.videoEl.videoHeight;this.videoEl.videoWidth&&B&&(this.videoEl.style.width=r+"px",this.videoEl.style.height=l+"px",this.videoEl.style.transformOrigin="center center",B=(l-r)/2,r=(r-l)/2,this._config.video_rotated===90?d="translate("+B+"px, "+r+"px) rotate(0.25turn)":this._config.video_rotated===270&&(d="translate("+B+"px, "+r+"px) rotate(0.75turn)"),this.videoEl.style.transform=d)}else this.videoEl.style.transform&&(this.videoEl.style.transform=null,this.videoEl.style.width="100%",this.videoEl.style.height=
"100%")}.bind(c);c.setupEventsHandler=function(){var d=this,l=function(P){d.loadingOverlay&&(d.loadingOverlay.style.display="none");d.videoEl.play();d.setplaystate(!0);d.updateDuration(d);d._config.isLive&&d.controlbar&&(d.controlbar.querySelector(".zwp__duration-container").style.display="none");d._config.fluid&&(P=d.videoEl,N(d.playerElm,"zwp-fluid"),d.playerElm.style.maxWidth="100%",d.playerElm.style.width="100%",d.playerElm.style.height="0",d.playerElm.style.paddingTop=P.videoHeight&&P.videoWidth?
P.videoHeight*100/P.videoWidth+"%":"64px");d.buildProgressBar()};d.videoEl.addEventListener("loadedmetadata",l);var r=d.videoEl,B=function(P){var O=!0;P.type==="ended"?!d._config.isLive&&d._config.loop?(K.setTimeout(function(){d.videoEl.currentTime=0;d.videoEl.play()},1E3),O=!1):(d.isEnded=!0,d.setplaystate(!1),d._config.isLive&&d._config.reconnect&&d.mpegtsPlayer&&(setTimeout(function(){d.lastDecodedFrames=0;d.closecall(d);d.openMpegts()},1E3),O=!1)):P.type==="play"?(delete d.isEnded,typeof d.postSeekTime!==
"undefined"&&(d.seekTimeProgressByTime(d.postSeekTime),delete d.postSeekTime)):P.type==="pause"?d.setplaystate(!1):P.type==="playing"&&d.setplaystate(!0);d.progressBar&&d.progressBar.buffering&&("play playing pause seeked ended error".split(" ").includes(P.type)?d.progressBar.buffering.style.display="none":["seeking","waiting","loadeddata"].includes(P.type)&&(d.progressBar.buffering.style.display=""));O&&typeof d._config.onmediaevent==="function"&&d._config.onmediaevent.call(d,P)},H=function(P){var O=
this.currentTime;typeof d.postSeekTime!=="undefined"&&(O=d.postSeekTime);if(typeof d._config.ontimeupdate==="function")d._config.ontimeupdate(O);!d.timeSpan&&d.controlbar&&(d.timeSpan=d.controlbar.querySelector(".zwp__currenttime"));d.timeSpan&&(d.timeSpan.innerHTML=Z(O));d.updateProgress(O);d.setProgressRail(P);d.renderSubtitles(O)};r.addEventListener("play",B);r.addEventListener("playing",B);r.addEventListener("pause",B);r.addEventListener("seeked",B);r.addEventListener("ended",B);r.addEventListener("error",
B);r.addEventListener("seeking",B);r.addEventListener("waiting",B);r.addEventListener("timeupdate",H);document.addEventListener("keydown",d.onKeydown);c.videoEventsSetuped=!0;c.removeVideoEventHandlers=function(){if(this.videoEventsSetuped){var P=this.videoEl;P.removeEventListener("loadedmetadata",l);P.removeEventListener("play",B);P.removeEventListener("playing",B);P.removeEventListener("pause",B);P.removeEventListener("seeked",B);P.removeEventListener("ended",B);P.removeEventListener("error",B);
P.removeEventListener("seeking",B);P.removeEventListener("waiting",B);P.removeEventListener("timeupdate",H);document.removeEventListener("keydown",this.onKeydown);delete this.videoEventsSetuped}}}.bind(c);c.showMediainfo=function(d){var l=this;if(l.overlay_layers){var r=l.overlay_layers.querySelector(".zwp__mediainfo-viewer");if(r){if(!d){d=r.querySelector(".closeBtn");var B=document.createEvent("Event");B.initEvent("click",!0,!0);d.dispatchEvent(B)}}else{d='<button class="closeBtn"><i class="xicon xicon-close"></i></button><div class="form-row form-title">'+
(pa("media-prop","Media properties")+"</div>");l.mediaInfo?(B=l.mediaInfo,B.hasVideo&&(d+='<div class="info-item"><span class="info-label">Video</span><span class="info-value">'+B.vCodec+"</span></div>",d+='<div class="info-item"><span class="info-label">Width</span><span class="info-value">'+B.width+"</span></div>",d+='<div class="info-item"><span class="info-label">Height</span><span class="info-value">'+B.height+"</span></div>",d+='<div class="info-item"><span class="info-label">FPS</span><span class="info-value">'+
B.fps+"</span></div>",d+='<div class="info-item"><span class="info-label">Profile</span><span class="info-value">'+B.profile+"</span></div>",d+='<div class="info-item"><span class="info-label">Level</span><span class="info-value">'+B.level+"</span></div>"),B.hasAudio&&(d+='<div class="info-item"><span class="info-label">Audio</span><span class="info-value">'+B.aCodec+"</span></div>",d+='<div class="info-item"><span class="info-label">SampRate</span><span class="info-value">'+B.sampleRate+"</span></div>",
d+='<div class="info-item"><span class="info-label">Channel</span><span class="info-value">'+B.channels+"</span></div>")):l.videoEl?(B=l.videoEl,B.videoWidth&&(d+='<div class="info-item"><span class="info-label">Width</span><span class="info-value">'+B.videoWidth+"</span></div>",d+='<div class="info-item"><span class="info-label">Height</span><span class="info-value">'+B.videoHeight+"</span></div>"),B.duration&&(d+='<div class="info-item"><span class="info-label">Duration</span><span class="info-value">'+
Z(B.duration)+"</span></div>")):d+='<div class="info-item"><div class="row-text">No More Media Info</div></div>';r=document.createElement("div");r.setAttribute("class","zwp__mediainfo-viewer zwp-popupwindow");r.innerHTML=d;l.overlay_layers.appendChild(r);r.addEventListener("click",function(P){P.stopPropagation()});var H=function(P){P.preventDefault();P.stopPropagation();Ga(r,500,function(){r.remove()});l.overlay_layers.removeEventListener("click",H);delete l.infoViewer};d=r.querySelector(".closeBtn");
d.addEventListener("click",H);l.infoViewer=r}}}.bind(c);c.setMediainfo=function(d,l){d={engine:d,hasVideo:l.hasVideo,hasAudio:l.hasAudio};if(l.hasVideo){var r=l.videoCodec;r=r.indexOf("avc1")>=0?"H264/AVC":r.indexOf("hvc")>=0?"H265/HEVC":"Unknown";d.vCodec=r;d.width=l.width;d.height=l.height;d.fps=l.fps;typeof d.fps==="number"&&(d.fps=d.fps.toFixed(2));d.profile=l.profile;d.level=l.level}l.hasAudio&&(r=l.audioCodec,r=r.indexOf("mp4a.40.2")>=0?"AAC-LC":r.indexOf("mp4a.40.5")>=0?"HE-AAC":r.indexOf("mp3")>=
0?"MP3":"Unknown",d.aCodec=r,d.sampleRate=l.audioSampleRate,d.channels=l.audioChannelCount);this.mediaInfo=d}.bind(c);c.loadChapters=function(){var d=this;if(d.chapters){if(typeof d.chapters==="string")if(d.chapters.charAt(0)==="[")d.chapters=JSON.parse(d.chapters);else{if(d.chapters.substr(0,4)==="http")Ra(d.chapters,function(W){if(W.substr(0,6)==="WEBVTT")d.chapters=W,d.loadChapters();else if(W=JSON.parse(W))d.chapters=W,d.loadChapters()},function(W){console.warn("get chapter list from "+d.chapters+
" failed!")});else if(d.chapters.substr(0,6)==="WEBVTT"){var l=Sa(d.chapters);if(l){for(var r=[],B=0;B<l.body.length;B++){var H=l.body[B];r.push({title:H.content,time:Z(H.from),desc:"no desc",image:null})}d.chapters=r;d.loadChapters()}else delete d.chapters}else delete d.chapters;return}else if(!Array.isArray(d.chapters))return;l=d.videoEl.duration;if(!isNaN(l)&&l!==Infinity){if(l=ob(l,d.chapters))if(r=d.controlbar.querySelector(".zwp__time-chapter"))r.innerHTML=l,l=r.querySelectorAll(".zwp__chapter_dot"),
l.length>0&&l.forEach(function(W){W.addEventListener("mousedown",function(S){S.stopPropagation();S=La(this.getAttribute("data-time"));d.seekTimeProgressByTime(S)})});if(d._config.chapterButton&&(l=d.controlbar.querySelector(".zwp__time-info"))){var P=l.querySelector(".zwp-chapterButton");P&&P.remove();var O=pb(d.chapters);O&&((r=l.querySelector(".zwp_danmuBarDock"))?r.insertAdjacentHTML("beforebegin",O.html):l.insertAdjacentHTML("beforeend",O.html),P=l.querySelector(".zwp-chapterButton"),l=P.querySelector(".zwp-chapterlist"),
r=l.querySelectorAll(".chapter-item"),r.length>0&&r.forEach(function(W){W.addEventListener("click",function(S){S.stopPropagation();S=La(this.getAttribute("data-time"));d.seekTimeProgressByTime(S)})}),l.addEventListener("mousedown",function(W){W.stopPropagation()}),l.addEventListener("dblclick",function(W){W.stopPropagation()}),P.querySelector(".zwp-chapterBtn").addEventListener("click",function(W){W.stopPropagation();if(W=P.querySelector(".zwp-chapterPanel")){var S=d.overlay_layers.offsetHeight;if(!(S<
100)){S-=100;S>400&&(S=400);var U=O.titleWidth;U>200&&(U=200);W.style.height=S+"px";W.style.width=80+U+10+"px";W.style.display!=="block"?(S=W.querySelector(".zwp-list-inner"),$$(S).niceScroll({cursorborder:"",cursorcolor:"rgb(179 178 178 / 67%)",boxzoom:!1,rightdock:4}),W.style.opacity=1,W.style.display="block"):W.style.display="none"}}}),(l=P.querySelector(".closeBtn"))&&l.addEventListener("click",function(W){W.stopPropagation();var S=W.currentTarget.closest(".zwp-chapterPanel");Ga(S,500,function(){S.style.display=
"none"})}))}}}}.bind(c);c.removeChapters=function(){if(this.chapters){if(this.controlbar){var d=this.controlbar.querySelector(".zwp__time-chapter");d&&(d.innerHTML="")}(d=this.controlbar.querySelector(".zwp__time-info"))&&(d=d.querySelector(".zwp-chapterButton"))&&d.remove();delete this.chapters}}.bind(c);c.doSnapshot=function(){if(this.videoEl&&this.videoEl.videoWidth){if(!this.snapCanvas&&(this.snapCanvas=document.createElement("canvas"),!this.snapCanvas))return;var d=this.videoEl,l=this.snapCanvas;
l.width=this.videoEl.videoWidth;l.height=this.videoEl.videoHeight;var r=l.getContext("2d");r.fillStyle="#000000";r.beginPath();r.fillRect(0,0,d.videoWidth,d.videoHeight);r.closePath();r.drawImage(d,0,0,d.videoWidth,d.videoHeight);if(typeof l.toBlob=="function"){var B="SNAP-"+eb();try{l.toBlob(function(H){const P=document.createElement("a");P.download=`${B}.jpg`;P.href=URL.createObjectURL(H);P.click();db(H)},"image/jpg",.99)}catch(H){console.error("\u89c6\u9891\u6e90\u53d7CORS\u6807\u8bc6\u9650\u5236\uff0c\u65e0\u6cd5\u76f4\u63a5\u4e0b\u8f7d\u622a\u56fe\uff0c\u89c1\uff1a\n https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS")}}else console.error("\u6d4f\u89c8\u5668\u529f\u80fd\u9650\u5236\uff0c\u65e0\u6cd5\u622a\u53d6\u56fe\u50cf")}}.bind(c);
c.togglePictureInPicture=function(){var d=this;if(d.videoEl)if(document.pictureInPictureElement)document.exitPictureInPicture();else{var l=d.videoEl;d.smallWindowMode||(l.bindPicInPicEvent||(l.addEventListener("enterpictureinpicture",function(r){console.log(r.width,r.height);N(d.playerElm,"zwp-picInPic");d.overlay_layers.insertAdjacentHTML("beforeEnd",'<div class="zwp-pipPlaceHolder">\t<div class="zwp-pipControl">\t\t<div class="zwp-pipTiptext">\u6b63\u5728\u300c\u753b\u4e2d\u753b\u300d\u6a21\u5f0f\u4e0b\u64ad\u653e</div>\t\t<div class="zwp-pipExitButton">\u9000\u51fa\u753b\u4e2d\u753b</div>\t</div></div>');
(r=d.overlay_layers.querySelector(".zwp-pipExitButton"))&&r.addEventListener("click",function(B){B.stopPropagation();document.pictureInPictureElement&&document.exitPictureInPicture()});d.isInPicInPic=!0}),l.addEventListener("leavepictureinpicture",function(){Q(d.playerElm,"zwp-picInPic");var r=d.overlay_layers.querySelector(".zwp-pipPlaceHolder");r&&d.overlay_layers.removeChild(r);setTimeout(function(){},500);delete d.isInPicInPic}),l.bindPicInPicEvent=!0),l.requestPictureInPicture())}}.bind(c);c.showSubtitle=
function(d){var l=this;if(l.overlay_layers){var r=l.overlay_layers.querySelector(".zwp-subtitles-show");if(r){if(d?r.style.display!=="block"&&(r.style.opacity=0,r.style.display="block",Pa(r,500,function(){})):Ga(r,500,function(){Ba.removeElement(r);r.remove();delete l.subtitleShow;delete l.subtitle1;delete l.subtitle2}),l.controlbar){var B=l.controlbar.querySelector(".zwp-subtitleButton");B&&(B.style.display=d?"block":"none")}}else if(d){r=document.createElement("div");r.setAttribute("class","zwp-subtitles-show");
r.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>';l.overlay_layers.appendChild(r);r.addEventListener("click",function(U){U.preventDefault();U.stopPropagation()});Ba.addElement(r);r.addEventListener("resize",function(U){this.updateSubtitlePosition()}.bind(l));l.subtitleShow=r;l.subtitle1=r.querySelector(".subtitle-1 > .subtitle-text");l.subtitle2=
r.querySelector(".subtitle-2 > .subtitle-text");l.subtitle2.style.display="none";var H=r.querySelector(".zwp-subtitles-viever"),P=!1,O=0,W=0;d="onpointerout"in document;var S="ontouchstart"in document.documentElement||"ontouchstart"in K;l.on_subtitle_mousemove=function(U){var g=U.target;if(!P||g!==this.subtitle1&&g!==this.subtitle2)console.log("out subtitle");else{g=U.pageY;var t=!0;U.type=="touchmove"&&(U.changedTouches&&(g=U.changedTouches[0].pageY),t=!1);t&&U.preventDefault();U.stopPropagation();
U=O-g;H.offsetTop<=54&&U>0||(U=W+U,U<54&&(console.log("mouse move 0"),U=54),H.style.bottom=U+"px",console.log("move x: ",U))}}.bind(l);l.on_subtitle_mouseup=function(U){P&&("onpointerout"in document?(document.removeEventListener("pointermove",this.on_subtitle_mousemove),document.removeEventListener("pointerup",this.on_subtitle_mouseup)):S?(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)),P=!1)}.bind(l);l.on_subtitle_mousedown=function(U){"onpointerout"in document?(document.addEventListener("pointermove",this.on_subtitle_mousemove),document.addEventListener("pointerup",this.on_subtitle_mouseup)):S?(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));P=!0;O=U.pageY;var g=parseInt(H.offsetTop+H.offsetHeight);W=this.subtitleShow.offsetHeight-g;U.stopPropagation();U.preventDefault()}.bind(l);l.on_subtitleItemclick=function(U){U.stopPropagation();var g=U.currentTarget;L(g,"zwp_switch")&&Oa(g);U=g.getAttribute("data-action");g=L(g,"switch_on");U==="subtitleOn"?this.subtitleShow&&(this.subtitleShow.style.display=g?"block":"none"):U==="subtitleDefault"?this.subtitles["1"]&&(g?this.subtitles["1"].hidden&&
(delete this.subtitles["1"].hidden,this.subtitle1.style.display="block"):(this.subtitles["1"].hidden=!0,this.subtitle1.style.display="none")):U==="subtitleSecond"&&this.subtitles["2"]&&(g?this.subtitles["2"].hidden&&(delete this.subtitles["2"].hidden,this.subtitle2.style.display="block"):(this.subtitles["2"].hidden=!0,this.subtitle2.style.display="none"))}.bind(l);d?H.addEventListener("pointerdown",l.on_subtitle_mousedown):canTouch?H.addEventListener("touchstart",l.on_subtitle_mousedown):H.addEventListener("mousedown",
l.on_subtitle_mousedown);if(l.controlbar){if(B=l.controlbar.querySelector(".zwp-subtitleButton"))B.style.display="block";(d=p.querySelector(".zwp-subtitleMenu"))&&!d.bindSwitchEvent&&(B=d.querySelectorAll(".action-item"),B.length>0&&B.forEach(function(U){U.addEventListener("click",l.on_subtitleItemclick);var g=U.getAttribute("data-action");g!=="subtitleOn"&&g!=="subtitleDefault"||N(U,"switch_on")}),d.bindSwitchEvent=!0)}}}}.bind(c);c.getSimpleSubtitleRenderer=function(){if(!this.overlay_layers)return null;
var d=this.overlay_layers.querySelector(".zwp-subtitles-show");if(d){var l=d.querySelector(".zwp-simple-subtitles-viever");l||(d.innerHTML='<div class="zwp-simple-subtitles-viever"></div>',l=d.querySelector(".zwp-simple-subtitles-viever"));return l}d=document.createElement("div");d.setAttribute("class","zwp-subtitles-show");d.innerHTML='<div class="zwp-simple-subtitles-viever"></div>';this.overlay_layers.appendChild(d);d.addEventListener("click",function(r){r.preventDefault();r.stopPropagation()});
Ba.addElement(d);d.addEventListener("resize",function(r){this.updateSubtitlePosition()}.bind(this));this.subtitleShow=d;return d.querySelector(".zwp-simple-subtitles-viever")}.bind(c);c.loadSubtitle=function(d,l,r){var B=this;l!=="1"&&l!=="2"||Ra(d,function(H){var P=I(d);if(P===".srt")var O=fb(H);else if(P===".vtt")O=Sa(H);else if(P===".json"||P===".bcc")O=JSON.parse(H);if(O){B.subtitles||(B.subtitles={});r&&(O.title=r);l==="2"&&B._config.secondSubtitleHidden&&(O.hidden=!0);if(B.controlbar&&(P=B.controlbar.querySelector(".zwp-subtitleMenu"))){P.querySelector(".main")||
(P.innerHTML=Ya(),Q(P,"zwp-autosize"));if(l==="1"&&(H=P.querySelector(".sub1"))){r||=pa("mainSubtitle","Main subtitle");var W=H.querySelector(".zwp-option-item-label");W&&(W.innerHTML=r);H.style.display="block"}if(l==="2"&&(H=P.querySelector(".sub2"))){r||=pa("secondSubtitle","Second subtitle");if(W=H.querySelector(".zwp-option-item-label"))W.innerHTML=r;O.hidden||(P=H.querySelector(".zwp_switch"))&&N(P,"switch_on");H.style.display="block"}}B.subtitles[l]=O;B.showSubtitleTimer||(B.showSubtitleTimer=
setTimeout(function(){this.showSubtitle(!0);delete this.showSubtitleTimer}.bind(B),300))}else console.warn("Invalid subtitle file from "+d)},function(H){console.warn("get subtitle from "+d+" failed!")})}.bind(c);c.renderSubtitles=function(d){if(this.subtitleShow&&this.subtitles&&this.subtitleShow.style.display!=="none")for(var l=["1","2"],r=0;r<l.length;r++){var B=l[r];if(this.subtitles[B]){var H="subtitle"+B;B=this.subtitles[B];var P=!1;if(!B.hidden){if(B.current){if(d<B.current.from)P=!0;else if(d<
B.current.to)continue;this[H]&&(this[H].innerHTML="",this[H].style.display="none");B.current=null}var O=B.nextSubtitleIdx||0,W=!0;if(P){var S=O-4;S<0&&(S=0);for(var U=O-2;U>=S;U--)if(P=B.body[U],d<=P.to){if(d>=P.from){B.current=P;B.nextSubtitleIdx=U+1;W=!1;break}}else{B.nextSubtitleIdx=O;W=!1;break}if(W&&S>0){O=0;for(U=S-1;O<=U;)if(S=parseInt((O+U)/2),P=B.body[S],d<P.from)U=S-1;else if(d>P.to)O=S+1;else{B.current=P;B.nextSubtitleIdx=S+1;W=!1;break}W&&(B.nextSubtitleIdx=O)}}else{S=O+2;S>B.body.length&&
(S=B.body.length);for(U=O;U<S;U++)if(P=B.body[U],d>=P.from){if(d<=P.to){B.current=P;B.nextSubtitleIdx=U+1;W=!1;break}}else{B.nextSubtitleIdx=O;W=!1;break}if(W){O=S;U=B.body.length-1;for(S>=B.body.length?d<B.body[B.body.length-1].from&&(O=0):d<B.body[S].from&&(O=0);O<=U;)if(S=parseInt((O+U)/2),P=B.body[S],d<P.from)U=S-1;else if(d>P.to)O=S+1;else{B.current=P;B.nextSubtitleIdx=S+1;W=!1;break}W&&(B.nextSubtitleIdx=O)}}B.current&&this[H]&&(this[H].innerHTML=B.current.content,this[H].style.display="block")}}}}.bind(c);
c.updateSubtitlePosition=function(){if(this.subtitleShow&&this.subtitles){var d=["1","2"],l=this.subtitleShow.offsetWidth,r=this.subtitleShow.offsetHeight;if(l&&r)for(l/=1024,r/=576,r=32*(l>r?r:l),l=0;l<d.length;l++){var B=d[l];this.subtitles[B]&&(B="subtitle"+B,this[B]&&(this[B].style.fontSize=r.toFixed(2)+"px"))}}}.bind(c);c.resetQualitiesMenu=function(){if(this&&!this.multiStreams&&this.controlbar){var d=this.controlbar.querySelector(".zwp-qualityButton");if(d){var l=d.querySelector(".zwp-qualityMenu");
l&&(l.innerHTML='<li class="zwp-quality-item zwp-disabled" data-index="-1">No quality</li>');d.style.display="none"}}}.bind(c);c.createQualitiesMenu=function(d){var l=this;if(d.length<=1)l.resetQualitiesMenu();else{var r=l.controlbar.querySelector(".zwp-qualityButton");if(r){var B="",H=pa("level","Level")+" ";B+='<li class="zwp-quality-item active" data-idx="-1">'+pa("qs-auto","AUTO SWITCH")+"</li>";for(var P=0;P<d.length;P++){var O="";typeof d[P]!=="undefined"&&(O=d[P].width&&d[P].height?d[P].width+
"x"+d[P].height:H+(P+1));typeof d[P].bitrate!=="undefined"&&(O+=" ("+parseInt(d[P].bitrate/1E3)+"kbps)");B+='<li class="zwp-quality-item" data-br="'+d[P].bitrate+'" data-idx="'+d[P].qualityIndex+'" data-vh="'+d[P].height+'">'+O+"</li>"}if(d=r.querySelector(".zwp-qualityMenu"))d.innerHTML=B,K.mQuery(d).find(".zwp-quality-item").click(function(W){W.preventDefault();W.stopPropagation();W=K.mQuery(this);W.hasClass("active")||(W.siblings().removeClass("active"),W.addClass("active"),W=this.getAttribute("data-idx"),
typeof l.switchQualityLevel==="function"&&l.switchQualityLevel(W))});r.style.display="block"}}}.bind(c);c.updateQualityLevel=function(d,l){if(this&&this.controlbar){var r=this.controlbar.querySelector(".zwp-qualityButton");r&&(r=r.querySelector(".zwp-qualityMenu"))&&K.mQuery(r).children(".zwp-quality-item").each(function(B,H){B=parseInt(H.getAttribute("data-idx"));H=K.mQuery(H);B===-1?l&&!H.hasClass("active")&&(H.siblings(".active").removeClass("active"),H.addClass("active")):d===B?(l||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(c);c.buildStreamSelector=function(){var d=this;if(d.multiStreams&&d.controlbar){var l=d.controlbar.querySelector(".zwp-qualityButton");if(l){var r="",B=d.multiStreams.murls;if(!Array.isArray(B)||B.length!==1){for(var H in B){var P=B[H];P=typeof P==="object"?P.name:H;r+='<li class="zwp-quality-item" data-stream="'+
P+'">'+pa(P,P)+"</li>"}if(B=l.querySelector(".zwp-qualityMenu"))B.innerHTML=r,r=K.mQuery(B).find(".zwp-quality-item"),r.click(function(O){O.preventDefault();O.stopPropagation();O=this.getAttribute("data-stream");if(d.multiStreams.curStream!==O){var W=d.multiStreams.murls;if(Array.isArray(W))for(var S in W){var U=W[S];if(U.name===O){var g=U.url;break}}else g=W[O];d.__switchStream(g);d.multiStreams.curStream=O;g=K.mQuery(this);g.hasClass("active")||(g.siblings(".active").removeClass("active"),g.addClass("active"));
O=pa(O,O);d.toast("\u5df2\u7ecf\u4e3a\u60a8\u5207\u6362\u5230"+O+"\u753b\u8d28")}}),r.each(function(O,W){O=this.getAttribute("data-stream");if(d.multiStreams.curStream===O&&(O=K.mQuery(this),!O.hasClass("active")))return O.siblings(".active").removeClass("active"),O.addClass("active"),!1});l.style.display="block"}}}}.bind(c);c.createSubtitlesMenu=function(d,l){var r=this;r.controlbar&&(l=r.controlbar.querySelector(".zwp-subtitleMenu"),d=lb(d),l.innerHTML=d,delete l.bindSwitchEvent,N(l,"zwp-autosize"),
K.mQuery(l).find(".zwp-subtitles-item").click(function(B){B.preventDefault();B.stopPropagation();B=K.mQuery(this);B.hasClass("active")||(B.siblings().removeClass("active"),B.addClass("active"),B=this.getAttribute("data-id"),typeof r.switchSubtitleTrack==="function"&&r.switchSubtitleTrack(B))}),d=r.controlbar.querySelector(".zwp-subtitleButton"))&&(d.style.display="block")}.bind(c);c.updateSubtitleTrack=function(d){}.bind(c);c.resetSubtitleMenu=function(){if(this.controlbar){var d=this.controlbar.querySelector(".zwp-subtitleButton");
d&&(d.style.display="none")}}.bind(c);c.__getDanmuBarDock=function(){var d=this.progressBar.timeInfo.querySelector(".zwp_danmuBarDock");d||(d=document.createElement("DIV"),d.setAttribute("class","zwp_danmuBarDock"),this.progressBar.timeInfo.appendChild(d),Ba.addElement(d),d.addEventListener("resize",function(l){var r=this;r.resizeTimer||(r.resizeTimer=K.setTimeout(function(){console.log("danmuBarDock resize");d.clientWidth<350?N(d,"zwp-mini"):Q(d,"zwp-mini");delete r.resizeTimer},50))}.bind(this)));
return d}.bind(c);c.buildDanmuToolbar=function(d,l){var r=this,B;if(!r.danmuToolbar){d&&(B=document.querySelector("#"+d));if(!B){if(!r.overlay_layers)return;l=null;B=r.progressBar&&r.progressBar.timeInfo?r.__getDanmuBarDock():r.overlay_layers}d=mb();B.insertAdjacentHTML("beforeend",d);r.danmuToolbar=B.querySelector(".zwp_danmu-controlbar");l&&N(r.danmuToolbar,l);B.appendChild(r.danmuToolbar);(l=r.danmuToolbar.querySelector(".zwp_switch"))&&l.addEventListener("click",function(H){H.stopPropagation();
H=H.currentTarget;if(L(H,"zwp_switch")){Oa(H);var P=L(H,"switch_on");H=K.$$(this.danmuToolbar);if(P){var O=H.find("button.btn_submit");O.removeClass("vtb_disabled").removeAttr("disabled");this.setEnableDanmu(!0);P=H.find(".barrage_inp_text");P.removeAttr("readonly").removeAttr("disabled").removeClass("disabled");P.attr("keydown")!="on"&&(P.keydown(function(W){W.which==13&&O.length>0&&O.trigger("click")}),P.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(r));(l=r.danmuToolbar.querySelector(".barrage_login"))&&l.addEventListener("click",function(H){H.preventDefault();H.stopPropagation();alert("login")});(l=r.danmuToolbar.querySelector(".zwp_dmconfig"))&&l.addEventListener("click",function(H){H.preventDefault();
H.stopPropagation();this.zwplayer=r;qb(H,this)});(l=r.danmuToolbar.querySelector(".btn_bubble"))&&l.addEventListener("click",function(H){H.preventDefault();H.stopPropagation();gb(this,H)});(l=r.danmuToolbar.querySelector(".btn_submit"))&&l.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(r){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(!r.sendDanmu(H))break a}this.inpbox.val("")}})}}.bind(c);c.reposDanmuToolbar=function(d){if(this.danmuToolbar&&this.progressBar&&this.progressBar.timeInfo){var l=this.__getDanmuBarDock(),r=this.danmuToolbar.parentNode;r&&(d?r!==l&&(r.removeChild(this.danmuToolbar),
l.appendChild(this.danmuToolbar),this.oldDanmuParentNode=r):this.oldDanmuParentNode&&(l.removeChild(this.danmuToolbar),this.oldDanmuParentNode.appendChild(this.danmuToolbar),delete this.oldDanmuParentNode))}}.bind(c);c.sendDanmu=function(d){if(typeof this._config.sendDanmu==="function"){var l="";this.danmuSetting.border&&(l+=',"border":"1"');this.danmuSetting.color&&(l+=',"color":"#'+this.danmuSetting.color+'"');this._config.sendDanmu('{"type":"danmu","text":"'+d+'"'+l+"}");return!0}alert("No danmu send function is setup");
return!1}.bind(c);c.showContextMenu=function(d){var l=this,r=d.offsetX;d=d.offsetY;var B=l.playerContainer.getBoundingClientRect(),H=B.width;B=B.height;var P="left",O="top",W=r,S=d;r+180>H&&(P="right",W=H-r);d+148>B&&(O="bottom",S=B-d);if(l.contextMenu)l.contextMenu.style[P==="left"?"right":"left"]=null,l.contextMenu.style[O==="top"?"bottom":"top"]=null,l.contextMenu.style[P]=W+"px",l.contextMenu.style[O]=S+"px";else{r='<div class="zwp-popupmenu" style="'+P+": "+W+"px; "+O+":"+S+'px;"><a class="zwp-menuitem" data-action="document" href="https://www.zwplayer.com/docment" target="zwplayer-doc"><span class="zwp-menucaption">'+
(pa("player-help","Help and document")+"</span></a>");r+='<a class="zwp-menuitem" data-action="version" href="https://www.zwplayer.com/version?v=3.1.4" title="Build: 20250911" target="zwplayer-version"><span class="zwp-menucaption">'+pa("version-update","Version update")+' (<span class="zwp-version">'+pa("current")+": v3.1.4</span>) </span></a>";r=r+'<span class="zwp-menuseperator" action="version"></span><a class="zwp-menuitem" data-action="about" href="https://www.zwplayer.com/about"><span class="zwp-menucaption">'+
(pa("about","About")+" zwplayer</span></a>");l.playerContainer.insertAdjacentHTML("beforeEnd",r+"</div>");l.contextMenu=l.playerContainer.querySelector(".zwp-popupmenu");var U=function(g){g.stopPropagation();g.preventDefault();var t=this.getAttribute("data-action");this.getAttribute("target");var u=this.getAttribute("href");l.hideContextMenu();setTimeout(function(){t==="about"?K.open(u,"zwplayer-about"):t==="version"?K.open(u,"zwplayer-version"):t==="document"&&K.open(u,"zwplayer-doc")},10)};l.contextMenu.querySelectorAll("a.zwp-menuitem").forEach(function(g){g.addEventListener("click",
U,!1)});document.addEventListener("click",l.hideContextMenu)}}.bind(c);c.hideContextMenu=function(){this.contextMenu&&(this.playerContainer.removeChild(this.contextMenu),delete this.contextMenu,document.removeEventListener("click",this.hideContextMenu))}.bind(c);c.toast=function(d,l,r,B){var H=this;l=l||2E3;H.toastTimerId&&(clearTimeout(H.toastTimerId),H.toastBox&&(H.overlay_layers.removeChild(H.toastBox),delete H.toastBox));if(d!=="closetoast"){if(typeof d==="object"){if("icon"in d)var P=d.icon;
d=d.text}var O=document.createElement("div"),W="",S="zwp-toast zwp-center";P&&(S+=" zwp-toast-icon",W='<i class="xicon xicon-'+P+'"></i>');r&&(W+='<a href="javascript:void(0)" class="zwp-toast-closebtn"><i class="xicon xicon-close"></i></a>',S+=" zwp-use-close");B&&(S+=" zwp-lite");W+='<span class="zwp-toast-text">'+d+"</span>";O.setAttribute("class",S);O.innerHTML=W;H.overlay_layers.appendChild(O);H.toastBox=O;var U=function(g){if(H.toastBox){var t=H.toastBox.querySelector(".zwp-toast-closebtn");
t&&t.removeEventListener("click",U);H.overlay_layers.removeChild(H.toastBox);delete H.toastBox}H.toastTimerId&&(g&&g.type==="click"&&clearTimeout(H.toastTimerId),delete H.toastTimerId)};H.toastTimerId=K.setTimeout(U,l);r&&(r=O.querySelector(".zwp-toast-closebtn"))&&r.addEventListener("click",U)}}.bind(c);c.mutedConfirmBox=function(){var d=this;d.popup_layers||(d.popup_layers=document.createElement("div"),d.popup_layers.setAttribute("class","zwp__popup_layers"),d.playerContainer.appendChild(d.popup_layers));
var l=document.createElement("div");l.setAttribute("class","zwp-toast zwp-confirm zwp-center");l.innerHTML='<span class="zwp-toast-text">\u56e0<a href="#mutemore" class="mutemore">\u6d4f\u89c8\u5668\u9650\u5236</a>\uff0c\u9700\u8981\u70b9\u51fb<a href="#openaudio" class="openaudio">\u6253\u5f00\u58f0\u97f3</a><button class="closeBtn" title="\u5173\u95ed\u63d0\u793a"><i class="xicon xicon-close"></i></button></span>';d.popup_layers.appendChild(l);d.mutedTipBox=l;var r=l.querySelector(".closeBtn");
r&&r.addEventListener("click",function(B){B.preventDefault();d.mutedTipBox&&(d.popup_layers.removeChild(d.mutedTipBox),d.popup_layers.style.display=null,delete d.mutedTipBox);K.allowAutoAudioPlay=!0});(r=l.querySelector(".openaudio"))&&r.addEventListener("click",function(B){B.preventDefault();B.stopPropagation();d.mutedTipBox&&(d.popup_layers.removeChild(d.mutedTipBox),d.popup_layers.style.display=null,delete d.mutedTipBox);d.setMuted(!1);K.allowAutoAudioPlay=!0});(r=l.querySelector(".mutemore"))&&
r.addEventListener("click",function(B){B.preventDefault();B.stopPropagation();var H=l.querySelector(".moreInfoBox");H||(l.insertAdjacentHTML("beforeend",'<div class="moreInfoBox"><div class="info-text">\u5f53\u4f60\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\u4f7f\u7f51\u7ad9\u65e0\u6cd5\u81ea\u52a8\u6267\u884c\u6709\u58f0\u64ad\u653e</div><div class="info-control"><button class="info-btn">\u6211\u77e5\u9053\u4e86</button></div></div>'),
H=l.querySelector(".moreInfoBox"),H.querySelector(".info-btn").addEventListener("click",function(P){P.preventDefault();P.stopPropagation();H.style.display="none"}));H&&(H.style.display="block");K.allowAutoAudioPlay=!0});d.popup_layers.style.display="block"}.bind(c);typeof c._config.playerElm=="string"?(e=c._config.playerElm,e.charAt(0)!="#"&&(e="#"+e),c.playerElm=document.querySelector(e)):Ua(c._config.playerElm)&&(c.playerElm=c._config.playerElm);c.playerElm?L(c.playerElm,"zwp-wrap")||(c.playerElmOldClass=
c.playerElm.getAttribute("class"),N(c.playerElm,"zwp-wrap"),c.doRemovePlayerClass=!0):(e="",typeof c._config.playerElm=="string"?(e=c._config.playerElm,e.charAt(0)=="#"&&(e=e.substr(1))):e="ZWP-"+(new Date).getTime(),c.playerElm=document.createElement("DIV"),c.playerElm.id=e,c.playerElm.style.position="absolute",c.playerElm.style.left=0,c.playerElm.style.top=0,c.playerElm.style.width="640px",c.playerElm.style.height="360px",document.body.appendChild(c.playerElm),c.playerElm.setAttribute("class","zwp-wrap"),
c.doDeletePlayerElm=!0);c.playerContainer=document.createElement("DIV");c.playerContainer.setAttribute("class","zwp-container");c.playerElm.appendChild(c.playerContainer);typeof c._config.videoElm=="string"?(e=c._config.videoElm,e.charAt(0)!="#"&&(e="#"+e),c.videoEl=document.querySelector(e)):Ua(c._config.videoElm)&&(c.videoEl=c._config.videoElm);if(!c.videoEl){var E=document.createElement("DIV");E.setAttribute("class","zwp-videoWrapper");c.playerContainer.appendChild(E);Ba.addElement(E);E.addEventListener("resize",
function(d){this._config.video_rotated&&this.rotateVideo()}.bind(c));c.videoWrapper=E;c.videoEl=document.createElement("VIDEO");typeof c._config.videostyle=="string"&&c.videoEl.setAttribute("style",c._config.videostyle);typeof c._config.videoclass=="string"&&c.videoEl.setAttribute("class",c._config.videoclass);c._config.videostyle||c._config.videoclass||c.videoEl.setAttribute("style","width:100%;height:100%;");typeof c._config.videoElm=="string"&&(e=c._config.videoElm,e.charAt(0)=="#"&&(e=e.substr(1)),
c.videoEl.id=e);c.videoEl.setAttribute("playsinline","");c.videoEl.setAttribute("webkit-playsinline","");c.videoEl.setAttribute("autoplay","");E.appendChild(c.videoEl);c.videoRemoveWhenClose=!0}c.videoEl.volume=c._config.defVolume/100;c._config.poster&&c.videoEl.setAttribute("poster",c._config.poster);if(!c._config.disableOverlayLayer&&(e=document.createElement("div"),e.setAttribute("class","zwp__layers"),e.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><div class="zwp__overlay zwp__layer zwp__overlay-play" style="width: 100%; height: 100%; display: none;"><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>',
c.playerContainer.appendChild(e),c.overlay_layers=e,c.bigPlayOverlay=e.querySelector(".zwp__overlay-play"),c.bigPlayBtn=c.bigPlayOverlay.querySelector(".zwp__overlay-button"),c.loadingOverlay=e.querySelector(".zwp_loadingicon"),c._config.disablePlayBtn?N(c.bigPlayBtn,"zwp_disabled"):c.bigPlayBtn.addEventListener("click",function(d){d.preventDefault();d.stopPropagation();this.on_btnclick(d)}.bind(c)),c._config.enableDanmu&&(c.danmuPlayer=HUAYI.Danmu.create({playerId:e})),e.addEventListener("contextmenu",
function(d){d.preventDefault();d.stopPropagation();Va||this.showContextMenu(d)}.bind(c)),e.addEventListener("click",function(d){var l=this;d=function(r){r=r.querySelector(".closeBtn");var B=document.createEvent("Event");B.initEvent("click",!0,!0);r.dispatchEvent(B)};l.infoViewer?d(l.infoViewer):l.colorSettingPanel?d(l.colorSettingPanel):l.contextMenu?l.hideContextMenu():l._config.disableClickPause||l._config.disablePlayBtn||l._config.isLive||(l.overlayLayerClickTimer&&(K.clearTimeout(l.overlayLayerClickTimer),
delete l.overlayLayerClickTimer),l.videoEl&&(l.overlayLayerClickTimer=K.setTimeout(function(){l.videoEl.paused||l.videoEl.ended?(l.videoEl.play(),l.setplaystate(!0)):(l.videoEl.pause(),l.setplaystate(!1));delete l.overlayLayerClickTimer},300)))}.bind(c)),c._config.logo)){if(typeof c._config.logo==="object"){if(typeof c._config.logo.icon==="string")var A=c._config.logo.icon}else typeof c._config.logo==="string"&&(A=c._config.logo);if(A){E='<div class="zwp-logo"';if(typeof c._config.logo==="object"){var b=
"";"dock"in c._config.logo?b+=(c._config.logo.dock==="left"?"left":"right")+": "+(c._config.logo.x||"5%")+";":"x"in c._config.logo&&(b+="right: "+c._config.logo.x+";");"y"in c._config.logo&&(b+="top: "+c._config.logo.y+";");"width"in c._config.logo&&(b+="width: "+c._config.logo.width+";");if("opacity"in c._config.logo){var M=c._config.logo.opacity/100;M>1&&(M=1);b+="opacity: "+M+";"}b&&(E+=' style="'+b+'"')}e.insertAdjacentHTML("afterbegin",E+('><img src="'+A+'"></div>'))}}if(c._config.nativecontrols)c.videoEl.setAttribute("controls",
"controls"),c.overlay_layers&&(c.overlay_layers.style.bottom="70px"),c.videoEl.addEventListener("fullscreenchange",function(d){return!1}.bind(c));else if(c._config.controlbar){var p=document.createElement("div");p.setAttribute("class","zwp-controlbar");c._config.isLive||N(p,"zwp-vodplayer");p.innerHTML=rb(c._config);c.playerContainer.appendChild(p);c.controlbar=p;if(c.controlbar){p.addEventListener("dblclick",function(d){d.stopPropagation()});A=p.querySelectorAll("button.zwpbtn");A.length>0&&(c.btnBindZwp=
!0,A.forEach(function(d){d.addEventListener("click",c.on_btnclick)}));c._config.disablePlayBtn&&(A=p.querySelector(".zwp_playbtn"),N(A,"zwp_disabled"),A.setAttribute("disabled","disabled"));A=p.querySelectorAll(".zwp-speedMenu>li.zwp-speed-item");A.length>0&&A.forEach(function(d){d.addEventListener("click",c.on_speedItemclick)});var V=p.querySelector(".zwp-volume-docker");if(V){c.muteBtn=V.querySelector("button.zwp-muteBtn");c.volslider=V.querySelector(".zwp-volume-slider");c.voltotal=V.querySelector(".zwp-volume-total");
c.volcurrent=c.volslider.querySelector(".zwp-volume-current");c.volthumb=c.volslider.querySelector(".zwp-volume-handle");var G=function(d){if(d!==null&&!isNaN(d)&&d!==void 0){d=Math.max(0,d);d=Math.min(d,1);if(d===0){Q(V,"zwp__mute");N(V,"zwp__unmute");var l=c.muteBtn;l.setAttribute("title","unmute");l.setAttribute("aria-label","unmute")}else Q(V,"zwp__unmute"),N(V,"zwp__mute"),l=c.muteBtn,l.setAttribute("title","muted"),l.setAttribute("aria-label","muted");l=c.volthumb;var r=c.volcurrent;d=d*100+
"%";var B=getComputedStyle(l);r.style.bottom=0;r.style.height=d;l.style.bottom=d;l.style.marginBottom=-parseFloat(B.height)/2+"px"}},fa=function(d){var l=z(c.voltotal),r=getComputedStyle(c.voltotal),B=!0;d.type=="touchmove"&&(d.changedTouches&&(B=d.changedTouches[0],d.pageX=B.pageX,d.pageY=B.pageY),B=!1);r=parseFloat(r.height);r=(r-(d.pageY-l.top))/r;l.top!==0&&l.left!==0&&(r=Math.max(0,r),r=Math.min(r,1),G(r),c.setMuted(r===0),c.setVolume(r),B&&d.preventDefault(),d.stopPropagation())};c.positionVolumeThumb=
G;c.on_volthumb_mousemove=function(d){var l=d.target;h&&(l===c.volslider||l.closest(".zwp-volume-slider"))&&fa(d)}.bind(c);c.on_volthumb_mouseup=function(d){h&&("onpointerout"in document?(document.removeEventListener("pointermove",c.on_volthumb_mousemove),document.removeEventListener("pointerup",c.on_volthumb_mouseup),document.removeEventListener("touchmove",c.on_volthumb_mousemove),document.removeEventListener("touchend",c.on_volthumb_mouseup)):(document.removeEventListener("mousemove",c.on_volthumb_mousemove),
document.removeEventListener("mouseup",c.on_volthumb_mouseup)),h=!1);m||(c.volslider.style.display="none");console.log("volthumb_mouseup:"+d.type)}.bind(c);c.on_volthumb_mousedown=function(d){fa(d);"onpointerout"in document?(document.addEventListener("pointermove",c.on_volthumb_mousemove),document.addEventListener("pointerup",c.on_volthumb_mouseup),document.addEventListener("touchmove",c.on_volthumb_mousemove),document.addEventListener("touchend",c.on_volthumb_mouseup)):(document.addEventListener("mousemove",
c.on_volthumb_mousemove),document.addEventListener("mouseup",c.on_volthumb_mouseup));h=!0;d.preventDefault();d.stopPropagation()}.bind(c);var la=c.volslider;V.addEventListener("mouseenter",function(d){d.target===V&&(la.style.display="block",m=!0,d.preventDefault(),d.stopPropagation())});V.addEventListener("focusin",function(){la.style.display="block";m=!0});V.addEventListener("focusout",function(d){if(!d.relatedTarget||d.relatedTarget&&!d.relatedTarget.matches(".zwp-volume-slider"))la.style.display=
"none"});V.addEventListener("mouseleave",function(){m=!1;h||(la.style.display="none")});V.addEventListener("focusout",function(){m=!1});V.addEventListener("keydown",function(d){var l=d.which||d.keyCode||0;d.preventDefault();d.stopPropagation();l==32&&(c.videoEl.muted?c.setMuted(!1):c.setMuted(!0))});la.addEventListener("dragstart",function(){return!1});la.addEventListener("mouseover",function(){m=!0});la.addEventListener("focusin",function(){la.style.display="block";m=!0});la.addEventListener("focusout",
function(){m=!1;h||(la.style.display="none")});la.addEventListener("mousedown",c.on_volthumb_mousedown)}if(A=p.querySelector(".zwp-optionPanel"))A=A.querySelectorAll(".action-item"),A.length>0&&A.forEach(function(d){d.addEventListener("click",c.on_optionItemclick)})}}c._config.autoSmallWindow&&!c.windowScrollHandler&&(c.windowScrollHandler=function(d){if(!this.isFullscr&&!this.isFullscrWin&&this.videoEl&&this.playerElm&&this.isPlaying&&!this.isInPicInPic)if(d=w(this.playerElm),(document.documentElement.scrollTop||
document.body.scrollTop)>=d+this.playerElm.offsetHeight-100){if(!this.smallWindowMode){var l=this.playerContainer;hb(l,function(){Q(l,"zwp-smallwindow");l.style.left=null;l.style.top=null;l.style.width=null;l.style.height=null});N(l,"zwp-smallwindow");this.smallWindowMode=!0}}else this.smallWindowMode&&(l=this.playerContainer,Q(l,"zwp-smallwindow"),l.style.left=null,l.style.top=null,l.style.width=null,l.style.height=null,delete this.smallWindowMode)}.bind(c),K.addEventListener("scroll",c.windowScrollHandler));
c._config.clientip||(c._config.clientip="");c.videoEl&&(c._config.muted?c.setMuted(!0):typeof K.allowAutoAudioPlay==="undefined"?(c.setMuted(!0),cb(function(d){d?c.setMuted(!1):c.mutedConfirmBox();K.allowAutoAudioPlay=d})):K.allowAutoAudioPlay||(c.setMuted(!0),c.mutedConfirmBox()),(c._config.snapshotButton||c._config.allowSnapshot)&&c.videoEl.setAttribute("crossorigin","Anonymous"));A=function(d){var l=this;if(l.controlbar)if(l.isControlbarhidden){l.controlbar.style.display="flex";Q(l.playerElm,"hide-cursor");
d=d||K.event;if(d.srcElement!=l.controlbar&&l.overlay_layers){var r=l.overlay_layers.offsetHeight,B=0;typeof d.offsetY!=="undefined"?B=r-d.offsetY:typeof d.layerY!=="undefined"&&(B=r-d.layerY);if(B>80)return}Pa(l.controlbar,500,function(H){H&&l.startHideControlbar(l)});l.isControlbarhidden=!1}else l.startHideControlbar(l)}.bind(c);c.playerElm.addEventListener("mousemove",A);c.playerElm.addEventListener("touchmove",A);c.playerElm.addEventListener("dblclick",function(d){this.overlayLayerClickTimer&&
(K.clearTimeout(this.overlayLayerClickTimer),delete this.overlayLayerClickTimer);if(this.controlbar&&(d={},d.currentTarget=this.controlbar.querySelector(".zwp-fullscrBtn"),d.currentTarget))this.on_btnclick(d)}.bind(c));typeof c._config.autoplay=="undefined"&&(c._config.autoplay=!0);c._config.url&&c._config.autoplay&&c.play(c._config.url);typeof c._config.onready=="function"&&c._config.onready.call(c);c._config.chapters&&(c.chapters=c._config.chapters);c._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(c));c._config.fluid?c._config.autoplay||(N(c.playerElm,"zwp-fluid"),c.playerElm.style.maxWidth=
"100%",c.playerElm.style.width="100%",c.playerElm.style.height="0",e=56.25,typeof c._config.ratio==="number"?e=c._config.ratio*100:typeof c._config.ratio==="string"?(A=c._config.ratio.split(":"),A.length===2&&(e=parseFloat(A[0]),A=parseFloat(A[1]),e===0&&(e=1),e=A*100/e)):typeof c._config.width==="number"&&typeof c._config.height==="number"&&(e=c._config.width,e===0&&(e=1),e=c._config.height*100/e),c.playerElm.style.paddingTop=e+"%"):c._config.width&&c._config.height&&(c.playerElm.style.width=typeof c._config.width===
"number"?c._config.width+"px":c._config.width,c.playerElm.style.height=typeof c._config.height==="number"?c._config.height+"px":c._config.height)},aa=async function(e){if(typeof K.RTCPeerConnection=="undefined")return alert("This browser does not support the stream.\r\nPlease play this stream in chrome!"),!1;var h=J(e.murl);if(!h)return e.toast("Invalid url"),!1;e.peer_conn=new RTCPeerConnection(typeof RTCPeerConnection.prototype.addTransceiver=="function"?{iceServers:[],iceTransportPolicy:"all",
bundlePolicy:"max-bundle",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan"}:null);e.mediaStream=new MediaStream;e.peer_conn.ontrack=function(c){if(!this.hasTracks){this.setRtcstream(e.mediaStream);var v=y();console.log("start usetime:"+(F-v))}this.hasTracks++;this.mediaStream.addTrack(c.track);e.baseTrack&&c.track.kind!="video"||(e.baseTrack=c.track);e.rtcstatsTimerId||(e.packetsReceived=0,e.framesDecoded=0,e.emptyCount=0,e.rtcstatsTimerId=K.setInterval(function(){e.baseTrack&&e.peer_conn.getStats(e.baseTrack).then(E=>
{E.forEach(A=>{A.type=="inbound-rtp"&&A.kind=="video"&&(A.framesDecoded!=e.framesDecoded?(e.framesDecoded=A.framesDecoded,e.packetsReceived=A.packetsReceived,e.emptyCount=0):e.framesDecoded>0&&(e.emptyCount++,e.emptyCount>3&&(console.warn("Rtp Data break for "+e.emptyCount),e.closecall(e),aa(e))))})})},1E3))}.bind(e);e.hasTracks=0;if(typeof e.peer_conn.addTransceiver=="function"){(typeof e._config.hasAudio==="undefined"||e._config.hasAudio)&&await e.peer_conn.addTransceiver("audio",{direction:"recvonly"});
await e.peer_conn.addTransceiver("video",{direction:"recvonly"});var m=await e.peer_conn.createOffer()}else m=await e.peer_conn.createOffer({offerToReceiveAudio:typeof e._config.hasAudio==="undefined"||e._config.hasAudio,offerToReceiveVideo:!0});await e.peer_conn.setLocalDescription(m);(new Promise(function(c,v){var E=h.is_brtc?{streamurl:h.streamUrl,sdp:m.sdp}:{api:h.apiUrl,rtcstream:h.streamUrl,clientip:null,sdp:m.sdp};h.urlObject.schema==="webrtc"&&(delete E.rtcstream,E.streamurl=h.streamUrl);
console.log("Generated offer: ",E);x(h.apiUrl,JSON.stringify(E),function(A){console.log("Got answer: ",A);A.code?v(A):c(A)},function(A){"REQUEST:error"==A&&(e.tryStartPlayTimer=K.setTimeout(function(){delete e.tryStartPlayTimer;e.closecall(e);aa(e)},1E3));v(A)})})).then(c=>{e.peer_conn.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:c.sdp}))}).catch(c=>{console.log(c);e.peer_conn.close();e.peer_conn=null});e.closecall=function(c){c.rtcstatsTimerId&&(K.clearInterval(c.rtcstatsTimerId),
delete c.rtcstatsTimerId);c.tryStartPlayTimer&&(K.clearTimeout(c.tryStartPlayTimer),delete c.tryStartPlayTimer);typeof c.baseTrack!="undefined"&&delete c.baseTrack;c.peer_conn&&(c.videoEl&&(c.videoEl.srcObject=null),c.mediaStream&&delete c.mediaStream,c.peer_conn.close(),c.peer_conn=null)};return!0},ia=async function(e){var h=e._config.xmc_url||K.xmc_url;if(!h)return e.toast("The rtsp protocol is not supported without setting XMC."),!1;h+="play";e.wsclient&&(e.wsclient.close(),delete e.wsclient);
h=h.replace("http","ws");var m=new WebSocket(h);m.onopen=function(){var c=typeof e._config.rtspOverTcp==="undefined"?1:e._config.rtspOverTcp,v=typeof e._config.rtsp_bypass==="boolean"?e._config.rtsp_bypass:0,E=typeof e._config.use_audio==="undefined"?0:e._config.use_audio,A="MediaSource"in K&&K.MediaSource.isTypeSupported("video/mp4;codecs=hvc1.1.1.L93.B0")?1:0;c=JSON.stringify({msgtype:"playurl",data:{sourceurl:e.murl,rtsp_over_tcp:c,has_audio:E,has_hevc:A,rtsp_bypass:v}});m.send(c)};m.onmessage=
function(c){console.log(c.data);c=JSON.parse(c.data);if(typeof c=="object"&&c.type==="onresult"&&c.event==="playurl"&&typeof c.streaminfo==="object")if(e.closecall2=function(E){E.waitSignTimer&&(K.clearTimeout(E.waitSignTimer),delete E.waitSignTimer);E.wsclient&&(E.wsclient.close(),E.wsclient=null,delete E.wsclient)},c.snapshot&&e.videoEl&&e.videoEl.setAttribute("poster",c.snapshot),e._config.useFlv||typeof c.streaminfo.rtc_playurl!=="string")typeof c.streaminfo.http_playurl==="string"?(v=c.streaminfo.http_playurl+
c.streaminfo.stream+".flv",e.murl=v,X(e)):e.closecall2(e);else{var v=c.streaminfo.rtc_playurl+c.streaminfo.stream+".rtc";c.first?e.waitSignTimer=setTimeout(function(){e.murl=v;aa(e);delete e.waitSignTimer},1E3):(e.murl=v,aa(e))}};m.onclose=function(){e.wsclient&&delete e.wsclient};m.onerror=function(){};e.wsclient=m;return!0},ma=function(e){Ja("flv_js",Ia+"flv.min.js",function(h){console.log("js:"+h+" is load!");var m=K.flvjs;if(!m.isSupported())return!1;h=!1;typeof e._config.isLive==="boolean"&&
(h=e._config.isLive);var c={type:"flv",isLive:h,url:e.murl};var v={enableWorker:!1,enableStashBuffer:!1,stashInitialSize:0,lazyLoad:!1,autoCleanupSourceBuffer:!0,lazyLoadMaxDuration:0,isLive:!0};e.openFlv=function(){var E=m.createPlayer(c,v);E.on(m.Events.METADATA_ARRIVED,function(A){e.loadingOverlay&&(e.loadingOverlay.style.display="none");typeof A=="object"&&console.log("flvplayer:"+A.type)});E.on(m.Events.ERROR,function(A){typeof A=="object"?console.log("flvplayer:"+A.type):console.log("flvplayer:"+
A)});E.attachMediaElement(e.videoEl);e.videoEl.playbackRate=1;e.onFlvStaticInfo=function(A){this.videoEl.paused||(this.lastDecodedFrames?this.lastDecodedFrames!=A.decodedFrames?this.lastDecodedFrames=A.decodedFrames:(this.lastDecodedFrames=0,this.flvPlayer&&(this.closecall(this),this.openFlv(),this.setplaystate(!0))):this.lastDecodedFrames=A.decodedFrames)}.bind(e);e.onFlvError=function(A){A!=="NetworkError"||e.reconnectTimer||(e.reconnectTimer=K.setTimeout(function(){e.flvPlayer&&(e.closecall(e),
e.openFlv(),e.setplaystate(!0));delete e.reconnectTimer},1E3))}.bind(e);e.onMediainfoCb=function(A){A&&this.setMediainfo("flvjs",A)}.bind(e);E.on(m.Events.ERROR,e.onFlvError);E.on(m.Events.STATISTICS_INFO,e.onFlvStaticInfo);E.on(m.Events.MEDIA_INFO,e.onMediainfoCb);e.delayCheckTimerId=K.setInterval(function(){if(this.flvPlayer&&!this.videoEl.paused){var A=this.flvPlayer;if(A.buffered.length){let b=A.buffered.end(0)-A.currentTime;b>=6?A.currentTime=A.buffered.end(0)-.2:b>3&&(e.videoEl.playbackRate=
1.5,e.fastForwardTimerId=setTimeout(function(){e.videoEl.playbackRate=1;delete e.fastForwardTimerId},b*2E3))}}}.bind(e),2E3);E.load();E.play();e.flvPlayer=E;e.closecall=function(A){if(A.flvPlayer){var b=A.flvPlayer;b.off(m.Events.ERROR,A.onFlvError);b.off(m.Events.STATISTICS_INFO,A.onFlvStaticInfo);b.off(m.Events.MEDIA_INFO,A.onMediainfoCb);delete A.onFlvError;delete A.onFlvStaticInfo;delete A.onMediainfoCb;A.delayCheckTimerId&&(K.clearInterval(A.delayCheckTimerId),delete A.delayCheckTimerId);A.fastForwardTimerId&&
(K.clearTimeout(A.fastForwardTimerId),delete A.fastForwardTimerId);A.reconnectTimer&&(K.clearTimeout(A.reconnectTimer),delete A.reconnectTimer);b.pause();b.unload();b.detachMediaElement();b.destroy();delete A.flvPlayer}}};e.openFlv();e.setplaystate(!0)});return!0},X=function(e){Ja("mpeg_js",Ia+"mpeg.min.js?v=2.1",function(h){console.log("js:"+h+" is load!");h=mpegts.getFeatureList();if(!mpegts.isSupported()||!h.mseLivePlayback)return!1;e.openMpegts=function(){var m=e.videoEl,c={autoCleanupSourceBuffer:!0,
stashInitialSize:128,autoCleanupMaxBackwardDuration:20,autoCleanupMinBackwardDuration:10,enableWorker:!0,enableStashBuffer:!1},v=void 0,E=void 0,A=!1,b=!1,M={type:"mse",url:e.murl};typeof e._config.hasAudio==="boolean"&&(v=e._config.hasAudio);typeof e._config.hasVideo==="boolean"&&(E=e._config.hasVideo);typeof e._config.isLive==="boolean"&&(A=e._config.isLive);M.hasAudio=v;M.hasVideo=E;if(M.isLive=A)e._config.useCustomLiveSync?b=!0:(c.liveSync=typeof e._config.useLiveChasing==="boolean"?e._config.useLiveChasing:
!0,c.liveSync&&(typeof e._config.liveSyncMaxLatency!=="undefined"&&(c.liveSyncMaxLatency=e._config.liveSyncMaxLatency),typeof e._config.liveSyncPlaybackRate!=="undefined"&&(c.liveSyncPlaybackRate=e._config.liveSyncPlaybackRate)));c=mpegts.createPlayer(M,c);e.onErrorCb=function(p){var V=this;p!==mpegts.ErrorTypes.NETWORK_ERROR||V.reconnectTimer||(V.reconnectTimer=K.setTimeout(function(){V.mpegtsPlayer&&(V.closecall(V),V.openMpegts());delete V.reconnectTimer},1E3))}.bind(e);e.onEventCb=function(p){console.log(p)}.bind(e);
e.onMetadataCb=function(p){console.log(p)}.bind(e);e.onMediaInfoCb=function(p){p&&this.setMediainfo("mpegts",p)}.bind(e);e.onStatisCb=function(p){this.videoEl.paused||(this.lastDecodedFrames?this.lastDecodedFrames!=p.decodedFrames?(this.lastDecodedFrames=p.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=p.decodedFrames)}.bind(e);e.closecall=function(p){p.checkDelayTimerId&&(K.clearInterval(p.checkDelayTimerId),delete p.checkDelayTimerId);p.reconnectTimer||(K.clearTimeout(p.reconnectTimer),delete p.reconnectTimer);p.fastForwardTimerId&&(K.clearTimeout(p.fastForwardTimerId),delete p.fastForwardTimerId);if(p.mpegtsPlayer){var V=p.mpegtsPlayer;V.pause();V.off(mpegts.Events.ERROR,p.onErrorCb);V.off(mpegts.Events.MEDIA_INFO,
p.onMediaInfoCb);V.off(mpegts.Events.METADATA_ARRIVED,p.onMetadataCb);V.off(mpegts.Events.STATISTICS_INFO,p.onStatisCb);V.unload();V.detachMediaElement();V.destroy();delete p.onErrorCb;delete p.onMediaInfoCb;delete p.onMetadataCb;delete p.onStatisCb;delete p.onEventCb;delete p.mpegtsPlayer}};b&&(e.checkDelayTimerId=K.setInterval(function(){var p=this;if(p.mpegtsPlayer&&!p.videoEl.paused&&typeof p.fastForwardTimerId==="undefined"&&p.mpegtsPlayer.buffered.length){var V=p.mpegtsPlayer.buffered;V=V.end(V.length-
1)-p.mpegtsPlayer.currentTime;var G=1.2;if(V>=6)G=1.5;else if(V<2)return;var fa=V/G*1E3;console.log("Custom chasing start ...chasingDuration:",fa);p.videoEl.playbackRate=G;p.fastForwardTimerId=setTimeout(function(){p.videoEl.playbackRate=1;delete p.fastForwardTimerId;console.log("Custom chasing end ...chasingDuration:",fa)},fa)}}.bind(e),2E3));c.on(mpegts.Events.ERROR,e.onErrorCb);c.on(mpegts.Events.MEDIA_INFO,e.onMediaInfoCb);c.on(mpegts.Events.METADATA_ARRIVED,e.onMetadataCb);c.on(mpegts.Events.STATISTICS_INFO,
e.onStatisCb);c.attachMediaElement(m);c.load();c.play();e.mpegtsPlayer=c};e.openMpegts()});return!0},ka=function(e){Ja("hls_js",Ia+"hls.min.js",function(h){console.log("js:"+h+" is load!");var m=K.Hls;if(m.isSupported()){var c=e,v=new m;v.attachMedia(e.videoEl);v.on(m.Events.MEDIA_ATTACHED,function(){console.log("video and hlsPlayer are now bound together !");v.loadSource(e.murl);v.on(m.Events.MANIFEST_PARSED,function(b,M){console.log("HLSPlayer manifest loaded, found "+M.levels.length+" quality level");
c.loadingOverlay&&(c.loadingOverlay.style.display="none");c.videoEl.play();c.setplaystate(!0)})});v.on(m.Events.ERROR,function(b,M){if(M.fatal)switch(M.type){case m.ErrorTypes.NETWORK_ERROR:console.log("fatal network error encountered, try to recover");v.startLoad();break;case m.ErrorTypes.MEDIA_ERROR:console.log("fatal media error encountered, try to recover");v.recoverMediaError();break;default:v.destroy(),delete e.hlsPlayer,c.setplaystate(!1)}});c.onHlsManifestParsed=function(b,M){var p=this;if(M.levels.length>
1){var V=[];for(b=0;b<M.levels.length;b++){var G={mediaType:"video",bitrate:M.levels[b].bitrate,height:M.levels[b].height,width:M.levels[b].width,qualityIndex:b,name:M.levels[b].name||"q"+b};V.push(G)}p.switchQualityLevel=function(fa){v.nextLevel=parseInt(fa)}.bind(p);p.createQualitiesMenu(V);v.on(m.Events.LEVEL_SWITCHED,function(fa,la){p.updateQualityLevel(v.currentLevel,v.autoLevelEnabled)},p)}else p.resetQualitiesMenu();if(M.subtitleTracks&&M.subtitleTracks.length>0){V=[];for(b=0;b<M.subtitleTracks.length;b++)G=
M.subtitleTracks[b],G.forced||(G={"default":G.default,id:G.id,lang:G.lang,name:G.name,url:G.url},V.push(G));p.switchSubtitleTrack=function(fa){fa=parseInt(fa);fa===-1?v.subtitleDisplay=!1:(v.subtitleDisplay=!0,v.subtitleTrack=fa)};p.createSubtitlesMenu(V);v.on(m.Events.SUBTITLE_TRACK_SWITCH,function(fa,la){p.updateSubtitleTrack(la.id)})}}.bind(c);c.onHlsManifestLoaded=function(b,M){console.log("hls on event MANIFEST_LOADED")}.bind(c);v.on(m.Events.MANIFEST_PARSED,c.onHlsManifestParsed);v.on(m.Events.MANIFEST_LOADED,
c.onHlsManifestLoaded);c.hlsPlayer=v;c.closecall=function(b){b.hlsPlayer&&(b.hlsPlayer.off(m.Events.MANIFEST_PARSED,b.onHlsManifestParsed),b.hlsPlayer.off(m.Events.MANIFEST_LOADED,b.onHlsManifestLoaded),b.hlsPlayer.detachMedia(),b.hlsPlayer.destroy(),delete b.hlsPlayer,delete b.onHlsManifestParsed,delete b.onHlsManifestLoaded)}}else if(e.videoEl.canPlayType("application/vnd.apple.mpegurl")){c=e;e.videoEl.zwplayer=e;var E=function(){typeof this.zwplayer=="object"&&(this.play(),this.zwplayer.setplaystate(!0))},
A=function(){typeof this.zwplayer=="object"&&console.log("HLS fatal media error encountered, try to recover")};c.videoEl.addEventListener("loadedmetadata",E);c.videoEl.addEventListener("error",A);c.closecall=function(b){typeof b.videoEl==="object"&&(b.videoEl.pause(),b.videoEl.src="",b.videoEl.removeEventListener("loadedmetadata",E),b.videoEl.removeEventListener("error",A),typeof b.videoEl.zwplayer=="object"&&delete b.videoEl.zwplayer)};c.videoEl.src=c.murl}else return e.toast("player cannot play hls media"),
!1});return!0},ja=function(e){Ja("dash_js",Ia+"dash.all.min.js",function(h){console.log("js:"+h+" is load!");var m=K.dashjs,c=m.MediaPlayer().create();c.initialize(e.videoEl,e.murl,!0);h=e.getSimpleSubtitleRenderer();c.attachTTMLRenderingDiv(h);e.dashTextTrackList={};e.onDashMetadata=function(v){v&&console.log(v);this.loadingOverlay&&(this.loadingOverlay.style.display="none");this.videoEl.play();this.setplaystate(!0)}.bind(e);e.onDashQualityChanged=function(v){v=c.getQualityFor("video");var E=c.getSettings().streaming.abr.autoSwitchBitrate.video||
!1;e.updateQualityLevel(v,E)}.bind(e);e.onDashStreamInitialized=function(v){c.getBitrateInfoListFor("audio");v=c.getBitrateInfoListFor("video")||[];v.length>1?(this.switchQualityLevel=function(E){E=parseInt(E);var A={streaming:{abr:{autoSwitchBitrate:{}}}};E>=0?(A.streaming.abr.autoSwitchBitrate.video=!1,c.updateSettings(A),c.setQualityFor("video",E,!1)):(A.streaming.abr.autoSwitchBitrate.video=!0,c.updateSettings(A))}.bind(this),this.createQualitiesMenu(v),c.on(m.MediaPlayer.events.QUALITY_CHANGE_RENDERED,
this.onDashQualityChanged,this)):this.resetQualitiesMenu()}.bind(e);e.onDashTracksAdded=function(v){var E=this.dashTextTrackList;E[v.streamId]||(E[v.streamId]=[]);E[v.streamId]=E[v.streamId].concat(v.tracks)};e.onDashStreamDeactivated=function(v){var E=this.dashTextTrackList;v.streamInfo&&E[v.streamInfo.id]&&delete E[v.streamInfo.id]}.bind(e);e.onDashStreamActivated=function(v){v=v.streamInfo.id||"none";var E=this.dashTextTrackList;if(E[v]&&(v=E[v],!(v.length<1))){E=[];for(var A=0;A<v.length;A++){var b=
v[A],M=ib(b.labels);M?M+=" : "+b.type:(M=b.label||b.lang,M+=" : "+b.kind);E.push({"default":b.defaultTrack,id:A,lang:b.lang,name:M,url:b.url||""})}this.switchSubtitleTrack=function(p){var V=this.dashPlayer||null;V&&(parseInt(p),V.setTextTrack(p))}.bind(this);this.createSubtitlesMenu(E)}}.bind(e);c.on(m.MediaPlayer.events.PLAYBACK_METADATA_LOADED,e.onDashMetadata,e);c.on(m.MediaPlayer.events.STREAM_INITIALIZED,e.onDashStreamInitialized,e);c.on(m.MediaPlayer.events.STREAM_ACTIVATED,e.onDashStreamActivated,
e);c.on(m.MediaPlayer.events.STREAM_DEACTIVATED,e.onDashStreamDeactivated,e);c.on(m.MediaPlayer.events.TEXT_TRACKS_ADDED,e.onDashTracksAdded,e);e.dashPlayer=c;e.closecall=function(v){v.dashPlayer&&(v.dashPlayer.pause(),v.dashPlayer.off(m.MediaPlayer.events.PLAYBACK_METADATA_LOADED,v.onDashMetadata,v),v.dashPlayer.off(m.MediaPlayer.events.STREAM_INITIALIZED,v.onDashStreamInitialized,v),v.dashPlayer.off(m.MediaPlayer.events.STREAM_ACTIVATED,v.onDashStreamActivated,v),v.dashPlayer.off(m.MediaPlayer.events.STREAM_DEACTIVATED,
v.onDashStreamDeactivated,v),v.dashPlayer.on(m.MediaPlayer.events.TEXT_TRACKS_ADDED,e.onDashTracksAdded,e),v.switchQualityLevel&&(v.dashPlayer.off(m.MediaPlayer.events.QUALITY_CHANGE_RENDERED,v.onDashQualityChanged,v),delete v.switchQualityLevel),v.dashPlayer.destroy(),delete v.dashPlayer,delete v.onDashMetadata,delete v.onDashStreamInitialized,delete v.onDashStreamActivated,delete v.onDashStreamDeactivated,delete v.onDashTracksAdded,delete v.switchSubtitleTrack)}});return!0},qa=function(e,h){var m=
e._config.cdn_addr||K.cdn_addr;if(!m)return e.toast("The webcdn protocol is not supported due without setting cdn server address url."),!1;m.endsWith("/")||(m+="/");m+="cdnplay";e.wcdnClient&&(e.wcdnClient.close(),delete e.wcdnClient);m=m.replace("http","ws");K.location.protocol=="https:"&&(m=m.replace("ws:","wss:"));var c=h.indexOf("://");if(c<0)return e.toast("Invalid wcdn url:"+h),!1;h=h.substr(c+3);(c=e._config.userInfo||K.userInfo)||(c={userid:"0",username:"Visitor",nickname:"Visitor"});var v=
{msgtype:"startplay",data:{userid:c.userid||"0",username:c.username||"Visitor",nickname:c.nickname||"Visitor",avatar:c.avatar||"",streamurl:h}},E=function(A){var b=new WebSocket(m);b.onopen=function(M){M=JSON.stringify(v);b.send(M)};b.onmessage=function(M){if(typeof M.data==="string")try{var p=JSON.parse(M.data),V=p.msgtype||"none",G=p.event||"none";if(V==="onresult")if(G==="startplay"){var fa=p.data||null;if(fa&&typeof fa==="object"){M=void 0;typeof A.closecall2==="function"&&(M=A.closecall2,A.closecall2=
null);p={msgtype:"playstatus",data:{status:"playing"}};A.play(fa,!0)||(p.data.status="error");var la=JSON.stringify(p);b.send(la);typeof M==="function"&&(A.closecall2=M)}else{var d=p.msg||"Unknown error";d==="StreamNotExist"?(A.toast(pa("waitStreamToReady","Waiting for stream")),A.errorHandleTimerId=K.setTimeout(function(){delete A.errorHandleTimerId;A.toast("closetoast");var l=JSON.stringify(v);b.send(l)},3E3)):(A.toast(G+" error:"+d),A.errorHandleTimerId=K.setTimeout(function(){delete A.errorHandleTimerId;
A.stop()},2E3))}}else G==="endplay"&&(console.log("Receive endplay result"),A.stop());else V==="error"?A.toast(G+" error:"+p.msg||"Unknown error"):V==="command"&&(p.action||"none")==="stopplay"&&(A.toast("Server is close, player is stop."),A.errorHandleTimerId=K.setTimeout(function(){delete A.errorHandleTimerId;A.stop()},100),A.wcdnClient&&(A.wcdnClient.ws.close(),A.wcdnClient=null))}catch(l){console.warn("JSON.parse failed:",l)}};b.onerror=function(M){console.error("Web CDN websocket Error:",M)};
b.onclose=function(M){this.wsVersionId===A.wsVersionId&&A.wcdnClient&&!A.cdnReconnectTimerId&&A.wcdnClient===this&&(A.cdnReconnectTimerId=setTimeout(function(){E(A)},1E3),delete A.wcdnClient)};b.wsVersionId=(new Date).getTime();A.wcdnClient=b;A.wsVersionId=b.wsVersionId;typeof A.cdnReconnectTimerId!=="undefined"&&delete A.cdnReconnectTimerId};e.closecall2=function(A){e.cdnReconnectTimerId&&(clearTimeout(e.cdnReconnectTimerId),delete e.cdnReconnectTimerId);e.errorHandleTimerId&&(clearTimeout(e.errorHandleTimerId),
delete e.errorHandleTimerId);e.wcdnClient?(A=e.wcdnClient,delete e.wcdnClient,A.close()):(e.toast("The wcdn connection has been passively closed."),console.log("Websocket connection is abnormally closed."))};E(e);return!0},ha=function(e){var h=e.videoEl;e.closecall=function(m){if(m.isPlayVideo){var c=m.videoEl;c.paused||c.pause();c.src="";delete m.isPlayVideo}};e.isPlayVideo=!0;h.src=e.murl;return!0},ba=function(e){var h=e.videoEl;e.closecall=function(m){if(m.isPlayAudio){var c=m.videoEl;c.paused||
c.pause();c.src="";delete m.isPlayAudio}};e.isPlayAudio=!0;h.src=e.murl;return!0},na=function(e){var h=e.murl;if((h.type||"")==="dvr"&&h.http)return e.murl=h.http,ha(e);if(K.MediaSource&&K.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')){var m=K.RTCPeerConnection||K.webkitRTCPeerConnection||K.mozRTCPeerConnection||K.RTCIceGatherer;if(h.rtc&&m)return e.murl=h.rtc,aa(e);if(h["httpflv-n"])return e.murl=h["httpflv-n"],e._config.useOldFlv?ma(e):X(e);if(h.httpflv)return e.murl=
h.httpflv,e._config.useOldFlv?ma(e):X(e);if(h["wsflv-n"])return e.murl=h["wsflv-n"],e._config.useOldFlv?ma(e):X(e);if(h.wsflv)return e.murl=h.wsflv,e._config.useOldFlv?ma(e):X(e);if(h.hls)return e.murl=h.hls,ka(e);if(h.dash)return e.murl=h.dash,ja(e);if(h.ts)return e.murl=h.ts,X(e)}else if(e.murl.hls)return e.murl=e.murl.hls,ka(e);return!1},T=function(e){var h=[];var m=String.fromCharCode(107)+"u"+String.fromCharCode(97)+"ishou";var c=String.fromCharCode(46)+"co"+String.fromCharCode(109)+"/",v=String.fromCharCode(100)+
"ou"+String.fromCharCode(121)+"i"+String.fromCharCode(110);h.push("https://live."+m+c+"u/");h.push("https://live."+v+c);if(typeof e==="string"&&e.length>23)for(c=0;c<h.length;c++)if(m=h[c],e.indexOf(m)===0)return!0;return!1};ca.prototype={play:function(e,h,m){var c=this;if(e){c.murl&&c.stop();if(typeof e==="string"&&(e.startsWith("wcdn://")||e.startsWith("wcdns://")))return e=qa(c,e);if(typeof e==="object"){typeof e.thumbnails==="object"&&(c._config.thumbnails=JSON.parse(JSON.stringify(e.thumbnails)));
if(typeof e.murls==="object"){c.multiStreams=JSON.parse(JSON.stringify(e));var v=e.murls}else Array.isArray(e)?(c.multiStreams={},v=e):(c.multiStreams={},v=[e]),c.multiStreams.murls=v;var E=!0,A="",b=[],M;for(M in v){var p=v[M];if(typeof p==="object")if(Array.isArray(p)){var V="";var G=p[0];if(p.length>2){var fa=p[2];V=p[1]}else fa=p.length>1?p[1]:M;b.push({url:G,name:fa,mime:V});E&&(e=G,A=fa,E=!1)}else{if(G=!1,"default"in p&&p["default"]&&(G=p["default"]),E||G)"url"in p&&(e=p.url),A=E="name"in p?
p.name:M,E=!1}else typeof p==="string"&&E&&(E=M,e=p,A=E,E=!1)}b.length>0&&(c.multiStreams.murls=b);c.multiStreams.curStream=A;console.log(e)}c.murl=e}if(!c.murl)return!1;c.force_stopped=!1;c.isPlaying=!0;c.loadingOverlay&&(c.loadingOverlay.style.display="flex");typeof h!="undefined"&&(h?c._config.isLive=h:delete c._config.isLive);typeof m!="undefined"&&(m?c._config.useOldFlv=m:delete c._config.useOldFlv);e=!1;if(typeof c.murl=="object")e=na(c);else if(typeof c.murl=="string"){e=I(c.murl);e||(h=c.murl.indexOf("mime_type="),
h>0&&(h+=10,v=c.murl.indexOf("&",h),v<0&&(v=c.murl.length),h=c.murl.substring(h,v),h==="video_mp4"?e=".mp4":h==="video_flv"?e=".flv":h==="video_hls"?e=".m3u8":h==="video_rtc"?e=".rtc":h==="video_dash"&&(e=".mpd")));if(!e&&(typeof c._config.streamtype==="string"&&(c._config.streamtype==="httpflv"?e=".flv":c._config.streamtype==="hls"?e=".m3u8":c._config.streamtype==="dash"?e=".mpd":c._config.streamtype==="mpegts"?e=".ts":c._config.streamtype==="webrtc"&&(e=".rtc")),!e&&T(c.murl))){var la=function(){setTimeout(function(){c.loadingOverlay&&
(c.loadingOverlay.style.display="none")},1E3)};if(!c._config.url_proxy)return c.toast("Sorry, the player cannot play this media address",5E3,!0),la(),!1;var d=d;x(c._config.url_proxy,JSON.stringify({roomUrl:c.murl,token:c._config.proxy_token||"12345678"}),function(l){if(typeof l==="object"&&l.result){l={murls:l.flvStreams||l.hlsStreams,multistream:1};if(!l.murls)return c.toast("Sorry, missing valid address for this room.",5E3,!0),la(),!1;c.play(l,d,m)}else c.toast("Sorry, unable to obtain a valid address for this room.",
5E3,!0),la()},function(l){c.toast("Sorry, failed to get address due to network!",5E3,!0);la()});return!1}e=c.murl.indexOf("rtsp")===0?ia(c):e===".rtc"||c.murl.startsWith("webrtc://")||c.murl.startsWith("brtc://")?aa(c):e===".flv"?c._config.useOldFlv?ma(c):X(c):e===".m3u8"?ka(c):e===".mpd"?ja(c):e===".mp4"?ha(c):e===".mp3"||e===".m4a"||e===".aac"||e===".mp4a"||e===".ogg"?ba(c):e===".ts"?X(c):ha(c)}e?(c.setupEventsHandler(),c.startHideControlbar(c),c.multiStreams&&K.setTimeout(function(){c.buildStreamSelector()},
1E3)):(c.isPlaying=!1,c.loadingOverlay&&(c.loadingOverlay.style.display="none"),c.toast("Play media failed, unsupported media type",5E3,!0));return e},__switchStream:function(e){if(typeof e!=="string")this.toast("Switch stream methon does not support "+e);else{this.murl=e;e=I(this.murl);if(!e){var h=this.murl.indexOf("mime_type=");if(h>0){h+=10;var m=this.murl.indexOf("&",h);m<0&&(m=this.murl.length);h=this.murl.substring(h,m);h==="video_mp4"?e=".mp4":h==="video_flv"?e=".flv":h==="video_hls"?e=".m3u8":
h==="video_rtc"?e=".rtc":h==="video_dash"&&(e=".mpd")}}e||typeof this._config.streamtype==="string"&&(this._config.streamtype==="httpflv"?e=".flv":this._config.streamtype==="hls"?e=".m3u8":this._config.streamtype==="dash"?e=".mpd":this._config.streamtype==="mpegts"?e=".ts":this._config.streamtype==="webrtc"&&(e=".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?ia(this):e===".rtc"||this.murl.startsWith("webrtc://")||this.murl.startsWith("brtc://")?aa(this):e===".flv"?this._config.useOldFlv?ma(this):X(this):e===".m3u8"?ka(this):e===".mpd"?ja(this):e===".mp4"?ha(this):e===".mp3"||e===".m4a"||e===".aac"||e===".mp4a"||e===".ogg"?ba(this):e===".ts"?X(this):ha(this))||this.toast("Switch stream failed, unsupported media type")}},stop:function(){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());this.isPlaying=!1;this.setplaystate(!1);this.bigPlayOverlay&&(this.bigPlayOverlay.style.display="none");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.subtitles&&delete this.subtitles;this.subtitleShow&&(this.subtitleShow.style.display="none");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&&(K.clearTimeout(this.overlayLayerClickTimer),delete this.overlayLayerClickTimer);delete this.multiStreams;this.resetSpeedMenu();this.resetQualitiesMenu();this.removeChapters();this.resetSubtitleMenu()},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(e){if(this.isPlaying&&this.videoEl&&!(e<0)){var h=this.videoEl.duration;isNaN(h)||h===Infinity||(e>h&&(e=h),this.videoEl.currentTime=e)}},getDuration:function(){if(this.isPlaying&&this.videoEl)return this.videoEl.duration},destroy:function(){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.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&&(K.clearTimeout(this.overlayLayerClickTimer),delete this.overlayLayerClickTimer);this.overlay_layers&&(this.subtitle1&&delete this.subtitle1,this.subtitle2&&delete this.subtitle2,this.subtitleShow&&
(Ba.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&&(Q(this.playerElm,"zwp-wrap"),this.playerElm.setAttribute("class",this.playerElmOldClass)));this.windowScrollHandler&&(K.removeEventListener("scroll",this.windowScrollHandler),delete this.windowScrollHandler)},setplaystate:function(e){this.controlbar&&(this.playbtn||(this.playbtn=this.controlbar.querySelector(".zwp-playbtn")),this.playbtn&&(e?(this.playbtn.setAttribute("data-action","pause"),this.bigPlayOverlay&&(this.bigPlayOverlay.style.display="none")):
(this.playbtn.setAttribute("data-action","play"),this.bigPlayOverlay&&(this.bigPlayOverlay.style.display="flex"))),this.playerElm&&(e?(Q(this.playerElm,"zwp-pause"),N(this.playerElm,"zwp-playing")):(Q(this.playerElm,"zwp-playing"),N(this.playerElm,"zwp-pause"))),this.loadingOverlay&&(this.loadingOverlay.style.display="none"))},setEnableDanmu:function(e){e?this.overlay_layers&&!this.danmuPlayer&&(this.danmuPlayer=HUAYI.Danmu.create({playerId:this.overlay_layers})):this.danmuPlayer&&(this.danmuPlayer.destroy(),
delete this.danmuPlayer)},appendDanmu:function(e,h){this.danmuPlayer&&(h||(h=this.danmuSetting),this.danmuPlayer.addDanmu(e,h))},setChapters:function(e){e===null?this.removeChapters():(this.chapters=e,this.videoEl&&setTimeout(function(){this.loadChapters()}.bind(this),1E3))},addSubtitle:function(e,h,m){this.loadSubtitle(e,h,m)},removeSubtitle:function(){this.showSubtitle(!1)},buildDanmuControlbar:function(e,h){this.buildDanmuToolbar(e,h)},notifyResize:function(e,h){this.playerElm&&(typeof e!=="undefined"&&
(typeof e==="number"&&(e+="px"),this.playerElm.style.width=e),typeof h!=="undefined"&&(typeof h==="number"&&(h+="px"),this.playerElm.style.height=h))},lightOff:function(){this.playerElm&&N(this.playerElm,"zwp-state-light-off")},lightOn:function(){this.playerElm&&Q(this.playerElm,"zwp-state-light-off")},get CurrentTime(){return this.isPlaying&&this.videoEl?this.videoEl.currentTime:-1},set CurrentTime(e){if(this.isPlaying&&this.videoEl&&!(e<0)){var h=this.videoEl.duration;isNaN(h)||h===Infinity||(e>
h&&(e=h),this.videoEl.currentTime=e)}}};return ca})})(window);
