<commit_before>import * as React from 'react';
import { Attachment } from './BotConnection';
import { AttachmentView } from './Attachment';
import { FormatOptions } from './Chat';
import { Strings } from './Strings';

interface Props {
    options: FormatOptions,
    strings: Strings,
    attachments: Attachment[],
    onClickButton: (type: string, value: string) => void,    
    onImageLoad: ()=> void
}

interface State {
    previousButtonEnabled: boolean;
    nextButtonEnabled: boolean;
}

export class Carousel extends React.Component<Props, State> {

    private itemWidth: number;
    private ul: HTMLUListElement
    private scrollDiv: HTMLDivElement;
    private scrollStartTimer: number;
    private scrollSyncTimer: number;
    private scrollDurationTimer: number;
    private animateDiv: HTMLDivElement;
    private resizeListener = () => this.resize();
    private scrollEventListener: () => void;
    private scrollAllowInterrupt = true;

    constructor(props: Props) {
        super(props);

        this.state = {
            previousButtonEnabled: false,
            nextButtonEnabled: false
        };

        this.scrollEventListener = () => this.onScroll();
    }

    private clearScrollTimers() {
        clearInterval(this.scrollStartTimer);
        clearInterval(this.scrollSyncTimer);
        clearTimeout(this.scrollDurationTimer);

        document.body.removeChild(this.animateDiv);

        this.animateDiv = null;
        this.scrollStartTimer = null;
        this.scrollSyncTimer = null;<commit_msg>cleanup<commit_after>import * as React from 'react';
import { Attachment } from './BotConnection';
import { AttachmentView } from './Attachment';
import { FormatOptions } from './Chat';
import { Strings } from './Strings';

interface Props {
    options: FormatOptions,
    strings: Strings,
    attachments: Attachment[],
    onClickButton: (type: string, value: string) => void,    
    onImageLoad: ()=> void
}

interface State {
    previousButtonEnabled: boolean;
    nextButtonEnabled: boolean;
}

export class Carousel extends React.Component<Props, State> {

    private itemWidth: number;
    private ul: HTMLUListElement
    private scrollDiv: HTMLDivElement;
    private scrollStartTimer: number;
    private scrollSyncTimer: number;
    private scrollDurationTimer: number;
    private animateDiv: HTMLDivElement;
    private resizeListener = () => this.resize();
    private scrollEventListener =() => this.onScroll();
    private scrollAllowInterrupt = true;

    constructor(props: Props) {
        super(props);

        this.state = {
            previousButtonEnabled: false,
            nextButtonEnabled: false
        };
    }

    private clearScrollTimers() {
        clearInterval(this.scrollStartTimer);
        clearInterval(this.scrollSyncTimer);
        clearTimeout(this.scrollDurationTimer);

        document.body.removeChild(this.animateDiv);

        this.animateDiv = null;
        this.scrollStartTimer = null;
        this.scrollSyncTimer = null;
{'fraction_non_alphanumeric': 0.10106030483764082, 'fraction_numerical': 0.0, 'mean_word_length': 3.252112676056338, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5127655', 'n_tokens_mistral': 797, 'n_tokens_neox': 782, 'n_words': 199}