<commit_before>!(function (W, D) {
  function isBody(el) {
    return el.toString && el.toString() === '[object HTMLBodyElement]'
  }
  class Biu {
    constructor(text, options) {
      this.text = text
      this.options = options
      this.el = D.createElement('div')
      this.el.className = `biu-instance biu-${options.type}`
      this.el.style.textAlign = this.options.align

      if (this.options.pop) {
        this.el.classList.add('biu-pop')
      }

      if (!isBody(this.options.el)) {
        this.options.el.style.overflow = 'hidden'
        this.options.el.style.position = 'relative'
        this.el.style.position = 'absolute'
      }

      // initial events
      this.events = {}

      // inner element
      this.insert()

      // auto hide animation
      if (this.options.autoHide !== false) {
        this.startTimeout()
      }

      // mouse events
      this.registerEvents()
    }

    insert() {
      // close button
      this.closeButton = D.createElement('div')
      this.closeButton.className = 'biu-close'
      this.closeButton.innerHTML = this.options.closeButton
      this.el.appendChild(this.closeButton)

      // main
      const elMain = D.createElement('div')
      elMain.className = 'biu-main'
      elMain.innerHTML = this.text
      this.el.appendChild(elMain)

      this.options.el.appendChild(this.el)
      setTimeout(() => {
        this.el.classList.add('biu-shown')
      }, 200)
    }

    registerEvents() {
      if (this.options.autoHide !== false) {
        this.events.mouseover = () => {
          clearTimeout(this.timeout)
          this.timeout = null
        }
        this.events.mouseleave = () => this.startTimeout()
        this.el.addEventListener('mouseover', this.events.mouseover, false)
        this.el.addEventListener('mouseleave', this.events.mouseleave, false)
      }

      this.events.hide = () => this.hide()
      this.closeButton.addEventListener('click', this.events.hide, false)
    }

    startTimeout(timeout = this.options.timeout) {
      this.timeout = setTimeout(() => {
        this.hide()
      }, timeout)
    }

    hide() {
      if (this.options.pop) {
        this.el.style.transform = 'translateX(-50%) translateY(-110%)'
      } else {
        this.el.style.transform = 'translateY(-100%)'
      }
      setTimeout(() => {
        if (this.options.onHidden) {
          this.options.onHidden.call(this)
        }<commit_msg>Don't try to hide if `el` is missing. (#9)<commit_after>!(function (W, D) {
  function isBody(el) {
    return el.toString && el.toString() === '[object HTMLBodyElement]'
  }
  class Biu {
    constructor(text, options) {
      this.text = text
      this.options = options
      this.el = D.createElement('div')
      this.el.className = `biu-instance biu-${options.type}`
      this.el.style.textAlign = this.options.align

      if (this.options.pop) {
        this.el.classList.add('biu-pop')
      }

      if (!isBody(this.options.el)) {
        this.options.el.style.overflow = 'hidden'
        this.options.el.style.position = 'relative'
        this.el.style.position = 'absolute'
      }

      // initial events
      this.events = {}

      // inner element
      this.insert()

      // auto hide animation
      if (this.options.autoHide !== false) {
        this.startTimeout()
      }

      // mouse events
      this.registerEvents()
    }

    insert() {
      // close button
      this.closeButton = D.createElement('div')
      this.closeButton.className = 'biu-close'
      this.closeButton.innerHTML = this.options.closeButton
      this.el.appendChild(this.closeButton)

      // main
      const elMain = D.createElement('div')
      elMain.className = 'biu-main'
      elMain.innerHTML = this.text
      this.el.appendChild(elMain)

      this.options.el.appendChild(this.el)
      setTimeout(() => {
        this.el.classList.add('biu-shown')
      }, 200)
    }

    registerEvents() {
      if (this.options.autoHide !== false) {
        this.events.mouseover = () => {
          clearTimeout(this.timeout)
          this.timeout = null
        }
        this.events.mouseleave = () => this.startTimeout()
        this.el.addEventListener('mouseover', this.events.mouseover, false)
        this.el.addEventListener('mouseleave', this.events.mouseleave, false)
      }

      this.events.hide = () => this.hide()
      this.closeButton.addEventListener('click', this.events.hide, false)
    }

    startTimeout(timeout = this.options.timeout) {
      this.timeout = setTimeout(() => {
        this.hide()
      }, timeout)
    }

    hide() {
      if (!this.el) return
        
      if (this.options.pop) {
        this.el.style.transform = 'translateX(-50%) translateY(-110%)'
      } else {
        this.el.style.transform = 'translateY(-100%)'
      }
      setTimeout(() => {
        if (this.options.onHidden) {
          this.options.onHidden.call(this)
        }
{'fraction_non_alphanumeric': 0.14609929078014183, 'fraction_numerical': 0.004660587639311043, 'mean_word_length': 2.1141955835962145, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '2826917', 'n_tokens_mistral': 1516, 'n_tokens_neox': 1477, 'n_words': 241}