"use strict";function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function _classCallCheck(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,e){for(var i=0;i3&&void 0!==arguments[3]?arguments[3]:[];_classCallCheck(this,t),this.x=e,this.y=i,this.canvas=r,this.startTime=Date.now(),this.duration=500,this.imageUrl=o.length>0?o[Math.floor(Math.random()*o.length)]:"../../../assets/thumb.png",this.image=null,this.imageLoaded=!1,this.loadImage(),this.startScale=.5,this.endScale=1.5,this.startRotation=20*(Math.random()-.5),this.offsetY=-60}return _createClass(t,[{key:"loadImage",value:function(){var t=this;if(this.canvas){var e=this.canvas.createImage();e.onload=function(){t.imageLoaded=!0,t.image=e},e.onerror=function(){console.error("Failed to load like animation image:",t.imageUrl)},e.src=this.imageUrl}}},{key:"update",value:function(){var t=Date.now()-this.startTime,e=Math.min(t/this.duration,1);return!(e>=1||(this.progress=e,0))}},{key:"draw",value:function(t){if(this.imageLoaded&&this.image){var e,i,r,o=this.progress||0,a=this.y+this.offsetY*o;e=o<.25?this.startScale+(1-this.startScale)*(o/.25):o<.75?1:1+(this.endScale-1)*((o-.75)/.25),i=o<.25?o/.25:o<.75?1:1-(o-.75)/.25,r=o<.25?this.startRotation:o<.5?this.startRotation*(1-(o-.25)/.25):0,t.save(),t.globalAlpha=i,t.translate(this.x,a),t.rotate(r*Math.PI/180),t.scale(e,e),t.drawImage(this.image,-15,-15,30,30),t.restore()}}}]),t}();exports.LikeAnimation=LikeAnimation;