/* AYSA local Chart.js fallback stub.
 * Keeps pages functional when Chart.js is not bundled yet.
 */
(function (global) {
  if (typeof global.Chart !== "undefined") {
    return;
  }

  function ChartStub(ctx, config) {
    this.ctx = ctx || null;
    this.config = config || {};
    this.data = (config && config.data) || {};
    this.options = (config && config.options) || {};
  }

  ChartStub.prototype.destroy = function () {};
  ChartStub.prototype.update = function () {};
  ChartStub.prototype.resize = function () {};

  ChartStub.defaults = {};
  ChartStub.register = function () {};
  ChartStub.unregister = function () {};

  global.Chart = ChartStub;
})(window);
