System.register(["src/client/preferences.js"], function (_export, _context) {
  "use strict";

  var Preferences;
  _export("default", function ({
    types: t,
    template
  }) {
    const counter = template(`globalThis.systemActivity[FILE_NAME]++;`);
    return {
      name: "system-activity-tracer",
      visitor: {
        BlockStatement(path, state) {
          if (Preferences.get('DisableSystemActivityTracing')) {
            return;
          }
          const filename = state.file.opts.filename + '';
          globalThis.systemActivity[filename] = 0;
          const tracking = counter({
            FILE_NAME: t.stringLiteral(filename)
          });
          path.unshiftContainer('body', tracking);
        }
      }
    };
  });
  return {
    setters: [function (_srcClientPreferencesJs) {
      Preferences = _srcClientPreferencesJs.default;
    }],
    execute: function () {
      /* globals globalThis */

      globalThis.systemActivity = globalThis.systemActivity || {};
    }
  };
});