define(["jquery","angular"],(function(t,n){t.fn.replaceClass=function(n,e){this.length<1||angular.forEach(this,(function(i){var a=this.getAttribute("class");a.length<1?t(this).addClass(e):a=a.replace(n,e),this.setAttribute("class",a)}))},t.fn.cssSelect=function(n){return t(this.length<1?document:this).find(n)},t.fn.offset=function(t){var n=this[0],e=0,i=0;do{n&&(e+=n.offsetTop||0,i+=n.offsetLeft||0,n=n.offsetParent),t&&n==t&&(n=!1)}while(n);return{top:Math.round(e),left:Math.round(i)}},t.fn.getStyle=function(n,e){var i=this[0],a=t(i).css(n);return e?parseFloat(a):a},t.fn.contentSize=function(){var t=this[0],n=getComputedStyle(t),e=t.clientHeight,i=t.clientWidth;return e-=parseFloat(n.paddingTop)+parseFloat(n.paddingBottom),{width:i-=parseFloat(n.paddingLeft)+parseFloat(n.paddingRight),height:e}};var e=new Date(1,1,2e3,12,0,0),i=!1;function a(){new Date-e<200?setTimeout(a,200):(i=!1,angular.element(window).triggerHandler("resizeEnd"))}angular.element(window).on("resize",(function(){e=new Date,!1===i&&(i=!0,setTimeout(a,200))})),function(t,n){var e,i,a,o,r,s,l,u,f,c,d="",h=document.createElement("div"),m=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i,p={};function g(t){return e?e+t:t.toLowerCase()}t.each({Webkit:"webkit",Moz:"",O:"o"},(function(t,i){if(h.style[t+"TransitionProperty"]!==n)return d="-"+t.toLowerCase()+"-",e=i,!1})),i=d+"transform",p[a=d+"transition-property"]=p[o=d+"transition-duration"]=p[s=d+"transition-delay"]=p[r=d+"transition-timing-function"]=p[l=d+"animation-name"]=p[u=d+"animation-duration"]=p[c=d+"animation-delay"]=p[f=d+"animation-timing-function"]="",t.fxz={off:e===n&&h.style.transitionProperty===n,speeds:{_default:400,fast:200,slow:600},cssPrefix:d,transitionEnd:g("TransitionEnd"),animationEnd:g("AnimationEnd")},t.fn.animate3=function(e,i,a,o,r){return t.isFunction(i)&&(o=i,a=n,i=n),t.isFunction(a)&&(o=a,a=n),t.isPlainObject(i)&&(a=i.easing,o=i.complete,r=i.delay,i=i.duration),i&&(i=("number"==typeof i?i:t.fxz.speeds[i]||t.fxz.speeds._default)/1e3),r&&(r=parseFloat(r)/1e3),this.anim3(e,i,a,o,r)},t.fn.anim3=function(e,d,h,g,v){var w,y,T,E={},z="",b=this,x=t.fxz.transitionEnd,L=!1;if(d===n&&(d=t.fxz.speeds._default/1e3),v===n&&(v=0),t.fxz.off&&(d=0),"string"==typeof e)E[l]=e,E[u]=d+"s",E[c]=v+"s",E[f]=h||"linear",x=t.fxz.animationEnd;else{for(w in y=[],e)m.test(w)?z+=w+"("+e[w]+") ":(E[w]=e[w],y.push(w.replace(/([a-z])([A-Z])/,"$1-$2").toLowerCase()));z&&(E[i]=z,y.push(i)),d>0&&"object"==typeof e&&(E[a]=y.join(", "),E[o]=d+"s",E[s]=v+"s",E[r]=h||"linear")}return T=function(n){if(void 0!==n){if(n.target!==n.currentTarget)return;t(n.target).unbind(x,T)}else t(this).unbind(x,T);L=!0,t(this).css(p),g&&g.call(this)},d>0&&(this.bind(x,T),setTimeout((function(){L||T.call(b)}),1e3*(d+v)+25)),this.length&&this.get(0).clientLeft,this.css(E),d<=0&&setTimeout((function(){b.each((function(){T.call(this)}))}),0),this},h=null}(t);var o,r=(o=null,function(){if(null!==o)return o;o=!1;try{var t=Object.defineProperty({},"passive",{get:function(){o=!0}});window.addEventListener("test",null,t)}catch(t){}return o});t.fn.scrollEnd=function(){var n=t(this),e=function(){n.data("scrollTimeout")&&clearTimeout(n.data("scrollTimeout")),n.data("scrollTimeout",setTimeout((function(){n.trigger("scrollend")}),250))};return n.data("hasScrollEnd",!0),n[0].addEventListener("scroll",e,!!r()&&{passive:!0}),{destroy:function(){n[0].removeEventListener("scroll",e),n.data("hasScrollEnd",!1),clearTimeout(n.data("scrollTimeout"))}}}}));