import{__awaiter as n,__generator as t}from"tslib";import i from"@tweenjs/tween.js";import o from"../core/Instance";var r=function(){function r(){var n=this;this.t=new WeakMap,this.i=!1,this.o=new Map,o.u().then((function(t){t.s("tick",n.v)}))}return r.prototype.v=function(n){i.update(n)},r.prototype.h=function(i){return n(this,void 0,void 0,(function(){return t(this,(function(n){return[2,new Promise((function(n){setTimeout(n,i)}))]}))}))},r.prototype.m=function(i,o,r,u){return void 0===r&&(r=200),void 0===u&&(u=null),n(this,void 0,void 0,(function(){return t(this,(function(n){return[2]}))}))},r.prototype.l=function(o,r,u,e){return void 0===u&&(u=200),void 0===e&&(e=null),n(this,void 0,void 0,(function(){var n=this;return t(this,(function(t){return[2,new Promise((function(t,c){var f,s=n.t;(f=s.get(o))&&f.stop(),(f=s.get(o)||s.set(o,new i.F(o)).get(o)).P(r,u).M(i.W.T.I).k((function(n){e&&e instanceof Function&&e(n)})).j((function(){s.delete(o),t()})).p((function(){s.delete(o),c()})),f.start()}))]}))}))},r}();export default r;