"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"===("undefined"==typeof module?"undefined":_typeof(module))&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){return a.fn.tilt=function(q){var x=function(){this.ticking||(requestAnimationFrame(m.bind(this)),this.ticking=!0)},k=function(){var c=this;a(this).on("mousemove",v),a(this).on("mouseenter",b),this.settings.reset&&a(this).on("mouseleave",t),this.settings.glare&&a(window).on("resize",j.bind(c))},u=function(){var c=this;void 0!==this.timeout&&clearTimeout(this.timeout),a(this).css({transition:this.settings.speed+"ms "+this.settings.easing}),this.settings.glare&&this.glareElement.css({transition:"opacity "+this.settings.speed+"ms "+this.settings.easing}),this.timeout=setTimeout(function(){a(c).css({transition:""}),c.settings.glare&&c.glareElement.css({transition:""})},this.settings.speed)},b=function(c){this.ticking=!1,a(this).css({"will-change":"transform"}),u.call(this),a(this).trigger("tilt.mouseEnter")},w=function(c){return"undefined"==typeof c&&(c={pageX:a(this).offset().left+a(this).outerWidth()/2,pageY:a(this).offset().top+a(this).outerHeight()/2}),{x:c.pageX,y:c.pageY}},v=function(c){this.mousePositions=w(c),x.call(this)},t=function(){u.call(this),this.reset=!0,x.call(this),a(this).trigger("tilt.mouseLeave")},p=function(){var y=a(this).outerWidth(),D=a(this).outerHeight(),d=a(this).offset().left,A=a(this).offset().top,c=(this.mousePositions.x-d)/y,C=(this.mousePositions.y-A)/D,B=(this.settings.maxTilt/2-c*this.settings.maxTilt).toFixed(2),z=(C*this.settings.maxTilt-this.settings.maxTilt/2).toFixed(2),g=Math.atan2(this.mousePositions.x-(d+y/2),-(this.mousePositions.y-(A+D/2)))*(180/Math.PI);return{tiltX:B,tiltY:z,percentageX:100*c,percentageY:100*C,angle:g}},m=function(){return this.transforms=p.call(this),this.reset?(this.reset=!1,a(this).css("transform","perspective("+this.settings.perspective+"px) rotateX(0deg) rotateY(0deg)"),void (this.settings.glare&&(this.glareElement.css("transform","rotate(180deg) translate(-50%, -50%)"),this.glareElement.css("opacity","0")))):(a(this).css("transform","perspective("+this.settings.perspective+"px) rotateX("+("x"===this.settings.disableAxis?0:this.transforms.tiltY)+"deg) rotateY("+("y"===this.settings.disableAxis?0:this.transforms.tiltX)+"deg) scale3d("+this.settings.scale+","+this.settings.scale+","+this.settings.scale+")"),this.settings.glare&&(this.glareElement.css("transform","rotate("+this.transforms.angle+"deg) translate(-50%, -50%)"),this.glareElement.css("opacity",""+this.transforms.percentageY*this.settings.maxGlare/100)),a(this).trigger("change",[this.transforms]),void (this.ticking=!1))},f=function(){var c=this.settings.glarePrerender;if(c||a(this).append('
'),this.glareElementWrapper=a(this).find(".js-tilt-glare"),this.glareElement=a(this).find(".js-tilt-glare-inner"),!c){var d={position:"absolute",top:"0",left:"0",width:"100%",height:"100%"};this.glareElementWrapper.css(d).css({overflow:"hidden","pointer-events":"none"}),this.glareElement.css({position:"absolute",top:"50%",left:"50%","background-image":"linear-gradient(0deg, rgba(255,255,255,0) 0%, rgba(255,255,255,1) 100%)",width:""+2*a(this).outerWidth(),height:""+2*a(this).outerWidth(),transform:"rotate(180deg) translate(-50%, -50%)","transform-origin":"0% 0%",opacity:"0"})}},j=function(){this.glareElement.css({width:""+2*a(this).outerWidth(),height:""+2*a(this).outerWidth()})};return a.fn.tilt.destroy=function(){a(this).each(function(){a(this).find(".js-tilt-glare").remove(),a(this).css({"will-change":"",transform:""}),a(this).off("mousemove mouseenter mouseleave")})},a.fn.tilt.getValues=function(){var c=[];return a(this).each(function(){this.mousePositions=w.call(this),c.push(p.call(this))}),c},a.fn.tilt.reset=function(){a(this).each(function(){var c=this;this.mousePositions=w.call(this),this.settings=a(this).data("settings"),t.call(this),setTimeout(function(){c.reset=!1},this.settings.transition)})},this.each(function(){var c=this;this.settings=a.extend({maxTilt:a(this).is("[data-tilt-max]")?a(this).data("tilt-max"):20,perspective:a(this).is("[data-tilt-perspective]")?a(this).data("tilt-perspective"):300,easing:a(this).is("[data-tilt-easing]")?a(this).data("tilt-easing"):"cubic-bezier(.03,.98,.52,.99)",scale:a(this).is("[data-tilt-scale]")?a(this).data("tilt-scale"):"1",speed:a(this).is("[data-tilt-speed]")?a(this).data("tilt-speed"):"400",transition:!a(this).is("[data-tilt-transition]")||a(this).data("tilt-transition"),disableAxis:a(this).is("[data-tilt-disable-axis]")?a(this).data("tilt-disable-axis"):null,axis:a(this).is("[data-tilt-axis]")?a(this).data("tilt-axis"):null,reset:!a(this).is("[data-tilt-reset]")||a(this).data("tilt-reset"),glare:!!a(this).is("[data-tilt-glare]")&&a(this).data("tilt-glare"),maxGlare:a(this).is("[data-tilt-maxglare]")?a(this).data("tilt-maxglare"):1},q),null!==this.settings.axis&&(console.warn("Tilt.js: the axis setting has been renamed to disableAxis. See https://github.com/gijsroge/tilt.js/pull/26 for more information"),this.settings.disableAxis=this.settings.axis),this.init=function(){a(c).data("settings",c.settings),c.settings.glare&&f.call(c),k.call(c)},this.init()})},a("[data-tilt]").tilt(),!0});