import { getDefaultExportFromCjs } from '../../../../../../../../_virtual/_commonjsHelpers.mjs';
import '../../../../../../../../_virtual/mixin-base.mjs';
import '../../../../../../../../_virtual/preprocessor-mixin.mjs';
import '../../../../../../../../_virtual/mixin.mjs';
import { m as mixinBase } from './mixin-base.mjs';
import { p as preprocessorMixin$1 } from '../position-tracking/preprocessor-mixin.mjs';
import { m as mixin } from '../../utils/mixin.mjs';

'use strict';

const ErrorReportingMixinBase = mixinBase;
const PositionTrackingPreprocessorMixin = preprocessorMixin$1;
const Mixin = mixin;

class ErrorReportingPreprocessorMixin extends ErrorReportingMixinBase {
    constructor(preprocessor, opts) {
        super(preprocessor, opts);

        this.posTracker = Mixin.install(preprocessor, PositionTrackingPreprocessorMixin);
        this.lastErrOffset = -1;
    }

    _reportError(code) {
        //NOTE: avoid reporting error twice on advance/retreat
        if (this.lastErrOffset !== this.posTracker.offset) {
            this.lastErrOffset = this.posTracker.offset;
            super._reportError(code);
        }
    }
}

var preprocessorMixin = ErrorReportingPreprocessorMixin;

var preprocessorMixin_default = /*@__PURE__*/getDefaultExportFromCjs(preprocessorMixin);

export { preprocessorMixin_default as default, preprocessorMixin as p };
//# sourceMappingURL=preprocessor-mixin.mjs.map
