<commit_before>
import util from './util.js';

let macos = process.platform === 'darwin';
const HEADER_HEIGHT = macos === true ? 22 : 36;
const FOOTER_HEIGHT = 20;
const SPLITTER_COLOR = [255, 20, 147];
const SPLITTER_WIDTH = 4;
const TABSTRIP_COLOR = [240, 240, 240];
const TABSTRIP_TAB_WIDTH = 80;
const TABSTRIP_TAB_HEIGHT = 20;
const TABSTRIP_TAB_LINE_WIDTH = 4;
const TABSTRIP_ARROW_WIDTH = 60;
const TABSTRIP_ARROW_STRIDE = 30;

export default class Component {
    static get Splitter(){
        return Splitter;
    }
    static get TabStrip(){
        return TabStrip;
    }
    static get Item(){
        return Item;
    }
}

/**
 * 簡易的なイベントエミッタ
 */
class Emitter {
    constructor(){
        this.listeners = {};
    }
    emit(eventName, arg){
        if(this.listeners.hasOwnProperty(eventName) === true){
            this.listeners[eventName](arg);
        }
    }
    on(eventName, listener){
        this.listeners[eventName] = listener;
    }
    off(eventName){
        this.listeners[eventName] = null;
    }
}

/**
 * DOM を分割するスプリッタ
 */
class Splitter extends Emitter {
    /**
     * @param {HTMLElement} parentDOM - スプリッタを包含する親要素
     * @param {boolean} [horizontal=true] - 水平分割かどうか
     * @param {number} [ratio=0.5] - 分割時の最初の領域の割合い（0.0 ~ 1.0）
     */
    constructor(parentDOM, horizontal = true, ratio = 0.5){
        super();
        this.parentDOM = parentDOM;
        this.horizontal = horizontal;
        this.wrap   = document.createElement('div');
        this.first  = document.createElement('div');
        this.split  = document.createElement('div');
        this.second = document.createElement('div');
        this.layer  = document.createElement('div');
        this.ratio = ratio;
        this.isDown = false;

        // styling
        util.appendStyle(this.wrap, {
            width: '100%',
            height: '100%',
            display: 'flex',
            flexDirection: this.horizontal === true ? 'column' : 'row',
            overflow: 'hidden',
        });
        util.appendStyle(this.split, {
            backgroundColor: `rgb(${SPLITTER_COLOR.join(',')})`,
            userSelect: 'none',
        });
        util.appendStyle(this.layer, {
            backgroundColor: `rgba(36, 32, 34, 0.6)`,
            width: '100%',
            height: `calc(100% - ${HEADER_HEIGHT + FOOTER_HEIGHT}px)`,
            display: 'none',
            position: 'absolute',
            top: `${HEADER_HEIGHT}px`,
            left: '0px',
        });

        // appending
        this.wrap.appendChild(this.first);
        this.wrap.appendChild(this.split);
        this.wrap.appendChild(this.second);
        this.parentDOM.appendChild(this.wrap);

        // event setting
        const DOWN = (evt) => {
            this.isDown = true;<commit_msg>fix curtain layer z-index<commit_after>
import util from './util.js';

let macos = process.platform === 'darwin';
const HEADER_HEIGHT = macos === true ? 22 : 36;
const FOOTER_HEIGHT = 20;
const SPLITTER_COLOR = [255, 20, 147];
const SPLITTER_WIDTH = 4;
const TABSTRIP_COLOR = [240, 240, 240];
const TABSTRIP_TAB_WIDTH = 80;
const TABSTRIP_TAB_HEIGHT = 20;
const TABSTRIP_TAB_LINE_WIDTH = 4;
const TABSTRIP_ARROW_WIDTH = 60;
const TABSTRIP_ARROW_STRIDE = 30;

export default class Component {
    static get Splitter(){
        return Splitter;
    }
    static get TabStrip(){
        return TabStrip;
    }
    static get Item(){
        return Item;
    }
}

/**
 * 簡易的なイベントエミッタ
 */
class Emitter {
    constructor(){
        this.listeners = {};
    }
    emit(eventName, arg){
        if(this.listeners.hasOwnProperty(eventName) === true){
            this.listeners[eventName](arg);
        }
    }
    on(eventName, listener){
        this.listeners[eventName] = listener;
    }
    off(eventName){
        this.listeners[eventName] = null;
    }
}

/**
 * DOM を分割するスプリッタ
 */
class Splitter extends Emitter {
    /**
     * @param {HTMLElement} parentDOM - スプリッタを包含する親要素
     * @param {boolean} [horizontal=true] - 水平分割かどうか
     * @param {number} [ratio=0.5] - 分割時の最初の領域の割合い（0.0 ~ 1.0）
     */
    constructor(parentDOM, horizontal = true, ratio = 0.5){
        super();
        this.parentDOM = parentDOM;
        this.horizontal = horizontal;
        this.wrap   = document.createElement('div');
        this.first  = document.createElement('div');
        this.split  = document.createElement('div');
        this.second = document.createElement('div');
        this.layer  = document.createElement('div');
        this.ratio = ratio;
        this.isDown = false;

        // styling
        util.appendStyle(this.wrap, {
            width: '100%',
            height: '100%',
            display: 'flex',
            flexDirection: this.horizontal === true ? 'column' : 'row',
            overflow: 'hidden',
        });
        util.appendStyle(this.split, {
            backgroundColor: `rgb(${SPLITTER_COLOR.join(',')})`,
            userSelect: 'none',
        });
        util.appendStyle(this.layer, {
            backgroundColor: `rgba(36, 32, 34, 0.6)`,
            width: '100%',
            height: `calc(100% - ${HEADER_HEIGHT + FOOTER_HEIGHT}px)`,
            display: 'none',
            position: 'absolute',
            top: `${HEADER_HEIGHT}px`,
            left: '0px',
            zIndex: 9999,
        });

        // appending
        this.wrap.appendChild(this.first);
        this.wrap.appendChild(this.split);
        this.wrap.appendChild(this.second);
        this.parentDOM.appendChild(this.wrap);

        // event setting
        const DOWN = (evt) => {
            this.isDown = true;
{'fraction_non_alphanumeric': 0.13783880171184024, 'fraction_numerical': 0.02282453637660485, 'mean_word_length': 2.199657729606389, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '1976856', 'n_tokens_mistral': 1942, 'n_tokens_neox': 1828, 'n_words': 358}