function Scrubber(e){function L(){O(),g=e||{},g.scrubberOn=g.scrubberOn!==undefined?g.scrubberOn:!0,g.scrubberOn&&n.removeClass(S),r=n.width(),v.push(n.on(vdown,function(e){if(y)return;b=!0})),v.push($(document).on(vmove,function(e){if(!b)return;var t=p.offset().left,n=(A(e)-t)/p.width();isNaN(n)||(w=n),M(n),q()})),v.push($(document).on(vup,function(e){if(!b)return;b=!1;var t=p.offset().left,n=(A(e)-t)/p.width();isNaN(n)&&(n=w),D(n)}))}function A(e){if(e.type==="mouseup"||e.type==="mousemove"||e.type==="mousedown")return e.pageX;if(e.type==="touchend"||e.type==="touchmove"||e.type==="touchstart")return e.originalEvent.changedTouches[0].pageX;throw new Error("attempting to get coordinate from event that's not supported. event type: "+e.type)}function O(){n=$("#scrubber_point_hit_box"),r=null,i=$("#scrubber_progress"),s=$("#total_time"),o=null,u=!0,a=$("#total_time_wrapper"),f=$("#current_time"),l=null,c=$("#current_time_wrapper"),h=$("#scrubber_wrapper"),p=$("#scrubber_container"),d=[],v=[],m=!1,g=null,y=!1,b=!1}function D(e){e>1&&(e=1),e<0&&(e=0),l=o*e,F(),V()}function P(e){if(e<0)throw new Error("Can't set negative total time");if(e===o)return;u=!0,o=e,q()}function H(){return o}function B(e){if(m)return;if(e<0)throw new Error("Can't set negative time");if(o&&e>o)throw new Error("current time can't be past totalTime");l=e,q()}function j(){return l}function F(){G(!1),y=!0,h.addClass(E)}function I(){G(!0),y=!1,h.removeClass(E),m=!1,q()}function R(e,t){e=Math.floor(e);var n=Math.floor(e/3600),r=Math.floor(e%3600/60),i=e%60,s=[];return t>=3600?(s.push(n+""),s.push(r<=9?"0"+r:r)):s.push(r+""),s.push(i<=9?"0"+i:i),s.join(":")}function U(e){d.push(e)}function z(){d=[]}function W(){v.forEach(function(e){e.off()})}function X(){h.hide(),z(),W()}function V(){d.map(function(e){e({currentTime:l,totalTime:o})})}function J(){n.removeClass(S)}function K(){n.addClass(S)}function Q(){return t}function G(e){t=e}var t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E="desynced",S="disp_off",x="active",T=60,N=100,C=75,k="--:--";this.setTotalTime=P,this.registerCallback=U,this.removeAllCallbacks=z,this.removeListeners=W,this.destroy=X,this.onTimeChanged=V,this.getCurrentTime=j,this.disable=F,this.enable=I,this.getTotalTime=H,this.setCurrentTime=B,this.enablePoint=J,this.disablePoint=K,this.getScrubberEnabled=Q;var M=_.throttle(function(e){m=!0,e>1&&(e=1),e<0&&(e=0),n.css({marginLeft:e*100+"%"}),l=o*e},1e3/T),q=_.throttle(function(){l!==null?f.text(R(l,o)):f.text(k),o!==null?u&&(s.text(R(o,o)),u=!1):s.text(k);if(o<0||o===null)return;var e=l/o;e>1&&(e=1),e<0&&(e=0),m||n.css({marginLeft:e*100+"%"}),i.css({transform:"scaleX("+e+")"})},1e3/T);L()};