{"version":3,"file":"ValueAnimation.mjs","sources":["../../../../src/util/animation/ValueAnimation.ts"],"sourcesContent":["import { AnimationBase } from './AnimationBase';\nimport type { ValueAnimationOptions } from './types';\n\nexport class ValueAnimation extends AnimationBase<number> {\n  constructor({\n    startValue = 0,\n    endValue = 100,\n    ...otherOptions\n  }: ValueAnimationOptions) {\n    super({\n      ...otherOptions,\n      startValue,\n      byValue: endValue - startValue,\n    });\n  }\n\n  protected calculate(timeElapsed: number) {\n    const value = this.easing(\n      timeElapsed,\n      this.startValue,\n      this.byValue,\n      this.duration\n    );\n    return {\n      value,\n      valueProgress: Math.abs((value - this.startValue) / this.byValue),\n    };\n  }\n}\n"],"names":["ValueAnimation","AnimationBase","constructor","_ref","startValue","endValue","otherOptions","_objectWithoutProperties","_excluded","_objectSpread","byValue","calculate","timeElapsed","value","easing","duration","valueProgress","Math","abs"],"mappings":";;;;AAGO,MAAMA,cAAc,SAASC,aAAa,CAAS;EACxDC,WAAWA,CAAAC,IAAA,EAIe;IAAA,IAJd;AACVC,QAAAA,UAAU,GAAG,CAAC;AACdC,QAAAA,QAAQ,GAAG,GAAA;AAEU,OAAC,GAAAF,IAAA;AADnBG,MAAAA,YAAY,GAAAC,wBAAA,CAAAJ,IAAA,EAAAK,SAAA,CAAA,CAAA;AAEf,IAAA,KAAK,CAAAC,cAAA,CAAAA,cAAA,KACAH,YAAY,CAAA,EAAA,EAAA,EAAA;MACfF,UAAU;MACVM,OAAO,EAAEL,QAAQ,GAAGD,UAAAA;AAAU,KAAA,CAC/B,CAAC,CAAA;AACJ,GAAA;EAEUO,SAASA,CAACC,WAAmB,EAAE;AACvC,IAAA,MAAMC,KAAK,GAAG,IAAI,CAACC,MAAM,CACvBF,WAAW,EACX,IAAI,CAACR,UAAU,EACf,IAAI,CAACM,OAAO,EACZ,IAAI,CAACK,QACP,CAAC,CAAA;IACD,OAAO;MACLF,KAAK;AACLG,MAAAA,aAAa,EAAEC,IAAI,CAACC,GAAG,CAAC,CAACL,KAAK,GAAG,IAAI,CAACT,UAAU,IAAI,IAAI,CAACM,OAAO,CAAA;KACjE,CAAA;AACH,GAAA;AACF;;;;"}