define(["require","css!./emby-progressring"],function(require){"use strict";function onInit(){var instance;this.hasInit||(this.hasInit=!0,this.classList.add("progressring"),instance=this,require(["text!./emby-progressring.template.html"],function(template){instance.innerHTML=template,instance.setProgress(parseFloat(instance.getAttribute("data-progress")||"0"))}))}var EmbyProgressRing=function(_HTMLDivElement){babelHelpers.inherits(EmbyProgressRing,_HTMLDivElement);var _super=_createSuper(EmbyProgressRing);function EmbyProgressRing(){var _this;babelHelpers.classCallCheck(this,EmbyProgressRing);var self=_this=_super.call(this);return onInit.call(self),babelHelpers.possibleConstructorReturn(_this,self)}return babelHelpers.createClass(EmbyProgressRing,[{key:"connectedCallback",value:function(){onInit.call(this)}},{key:"disconnectedCallback",value:function(){var observer=this.observer;observer&&(observer.disconnect(),this.observer=null)}},{key:"setProgress",value:function(progress){var angle;(progress=Math.floor(progress))<25?(angle=progress/100*360-90,this.querySelector(".animate-0-25-b").style.transform="rotate("+angle+"deg)",this.querySelector(".animate-25-50-b").style.transform="rotate(-90deg)",this.querySelector(".animate-50-75-b").style.transform="rotate(-90deg)",this.querySelector(".animate-75-100-b").style.transform="rotate(-90deg)"):25<=progress&&progress<50?(angle=(progress-25)/100*360-90,this.querySelector(".animate-0-25-b").style.transform="none",this.querySelector(".animate-25-50-b").style.transform="rotate("+angle+"deg)",this.querySelector(".animate-50-75-b").style.transform="rotate(-90deg)",this.querySelector(".animate-75-100-b").style.transform="rotate(-90deg)"):50<=progress&&progress<75?(angle=(progress-50)/100*360-90,this.querySelector(".animate-0-25-b").style.transform="none",this.querySelector(".animate-25-50-b").style.transform="none",this.querySelector(".animate-50-75-b").style.transform="rotate("+angle+"deg)",this.querySelector(".animate-75-100-b").style.transform="rotate(-90deg)"):75<=progress&&progress<=100&&(angle=(progress-75)/100*360-90,this.querySelector(".animate-0-25-b").style.transform="none",this.querySelector(".animate-25-50-b").style.transform="none",this.querySelector(".animate-50-75-b").style.transform="none",this.querySelector(".animate-75-100-b").style.transform="rotate("+angle+"deg)"),this.querySelector(".progressring-text").innerHTML=progress+"%"}}]),EmbyProgressRing}(babelHelpers.wrapNativeSuper(HTMLDivElement));return customElements.define("emby-progressring",EmbyProgressRing,{extends:"div"}),EmbyProgressRing});