/** * jQuery asPieProgress v0.4.6 * https://github.com/amazingSurge/jquery-asPieProgress * * Copyright (c) amazingSurge * Released under the LGPL-3.0 license */ !function(t,e){if("function"==typeof define&&define.amd)define(["jquery"],e);else if("undefined"!=typeof exports)e(require("jquery"));else{var i={exports:{}};e(t.jQuery),t.jqueryAsPieProgressEs=i.exports}}(this,function(t){"use strict";function e(t){return t&&t.__esModule?t:{default:t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n=e(t),s="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},r=function(){function t(t,e){for(var i=0;i').append(this.svg).appendTo(this.$element))}},{key:"buildTrack",value:function(){var t=this.size,e=this.size,i=e/2,n=t/2,s=this.options.barsize,r=new a("ellipse",{rx:i-s/2,ry:n-s/2,cx:i,cy:n,stroke:this.options.trackcolor,fill:this.options.fillcolor,"stroke-width":s});this.svg.appendChild(r)}},{key:"buildBar",value:function(){if(c){var t=new a("path",{fill:"none","stroke-width":this.options.barsize,stroke:this.options.barcolor});this.bar=t,this.svg.appendChild(t),this._drawBar(this.first),this._updateBar()}}},{key:"_drawBar",value:function(t){if(c){this.barGoal=t;var e=this.size,i=this.size,n=i/2,s=e/2,r=0,a=this.options.barsize,o=Math.min(n,s)-a/2;this.r=o;var u=this.getPercentage(t);100===u&&(u-=1e-4);var h=r+u*Math.PI*2/100,l=n+o*Math.sin(r),f=n+o*Math.sin(h),m=s-o*Math.cos(r),d=s-o*Math.cos(h),p=0;h-r>Math.PI&&(p=1);var g="M"+l+","+m+" A"+o+","+o+" 0 "+p+" 1 "+f+","+d;this.bar.setAttribute("d",g)}}},{key:"_updateBar",value:function(){if(c){var t=this.getPercentage(this.now),e=this.bar.getTotalLength(),i=e*(1-t/this.getPercentage(this.barGoal));this.bar.style.strokeDasharray=e+" "+e,this.bar.style.strokeDashoffset=i}}},{key:"_trigger",value:function(t){for(var e=arguments.length,i=Array(e>1?e-1:0),n=1;nthis.max?t=this.max:ts)o=t;else{var u=(a-n)/e.options.speed;o=Math.round(e.easing.fn(u/100)*(e.max-e.min)),t>i?(o=i+o,o>t&&(o=t)):(o=i-o,o0&&"function"==typeof this.options.numberCallback&&this.$number.html(this.options.numberCallback.call(this,[this.now])),this.$content.length>0&&"function"==typeof this.options.contentCallback&&this.$content.html(this.options.contentCallback.call(this,[this.now])),this._trigger("update",t)}},{key:"_clear",value:function(){this._frameId&&(window.cancelAnimationFrame(this._frameId),this._frameId=null)}},{key:"get",value:function(){return this.now}},{key:"start",value:function(){this._clear(),this._trigger("start"),this.go(this.goal)}},{key:"reset",value:function(){this._clear(),this._drawBar(this.first),this._update(this.first),this._trigger("reset")}},{key:"stop",value:function(){this._clear(),this._trigger("stop")}},{key:"finish",value:function(){this._clear(),this._update(this.goal),this._trigger("finish")}},{key:"destroy",value:function(){this.$element.data(g,null),this._trigger("destroy")}}],[{key:"registerEasing",value:function(t){for(var e=arguments.length,i=Array(e>1?e-1:0),n=1;n1?i-1:0),a=1;a