<commit_before>class ConfigView extends HTMLElement

  createdCallback: ->
    @classList.add('atom-ternjs-config')

    container = document.createElement('div')
    @content = document.createElement('div')
    @close = document.createElement('button')
    @close.classList.add('btn', 'atom-ternjs-config-close')
    @close.innerHTML = 'Close'
    container.appendChild(@close)
    container.appendChild(@content)
    @appendChild(container)

  initialize: (model) ->
    @setModel(model)
    this

  buildOptionsMarkup: ->
    config = @getModel().config
    @content.appendChild(@buildBoolean(config.libs))
    @content.appendChild(@buildStringArray(config.loadEagerly))

  buildStringArray: (obj) ->
    wrapper = document.createElement('div')
    header = document.createElement('h2')
    header.innerHTML = 'loadEagerly:'
    wrapper.appendChild(header)
    for path in obj
      item = document.createElement('input')
      item.type = 'text'
      item.value = path
      wrapper.appendChild(item)
    wrapper

  buildBoolean: (libs) ->
    wrapper = document.createElement('div')
    header = document.createElement('h2')
    header.innerHTML = 'libs:'
    wrapper.appendChild(header)
    for lib in libs
      label = document.createElement('span')
      label.innerHTML = lib.name
      checkbox = document.createElement('input')
      checkbox.type = 'checkbox'
      checkbox.checked = lib.value
      wrapper.appendChild(label)
      wrapper.appendChild(checkbox)
    wrapper

  getClose: -><commit_msg>wrap libs<commit_after>class ConfigView extends HTMLElement

  createdCallback: ->
    @classList.add('atom-ternjs-config')

    container = document.createElement('div')
    @content = document.createElement('div')
    @close = document.createElement('button')
    @close.classList.add('btn', 'atom-ternjs-config-close')
    @close.innerHTML = 'Close'
    container.appendChild(@close)
    container.appendChild(@content)
    @appendChild(container)

  initialize: (model) ->
    @setModel(model)
    this

  buildOptionsMarkup: ->
    config = @getModel().config
    @content.appendChild(@buildBoolean(config.libs))
    @content.appendChild(@buildStringArray(config.loadEagerly))

  buildStringArray: (obj) ->
    wrapper = document.createElement('div')
    header = document.createElement('h2')
    header.innerHTML = 'loadEagerly:'
    wrapper.appendChild(header)
    for path in obj
      item = document.createElement('input')
      item.type = 'text'
      item.value = path
      wrapper.appendChild(item)
    wrapper

  buildBoolean: (libs) ->
    wrapper = document.createElement('div')
    header = document.createElement('h2')
    header.innerHTML = 'libs:'
    wrapper.appendChild(header)
    for lib in libs
      inputWrapper = document.createElement('div')
      inputWrapper.classList.add('input-wrapper')
      label = document.createElement('span')
      label.innerHTML = lib.name
      checkbox = document.createElement('input')
      checkbox.type = 'checkbox'
      checkbox.checked = lib.value
      inputWrapper.appendChild(label)
      inputWrapper.appendChild(checkbox)
      wrapper.appendChild(inputWrapper)
    wrapper

  getClose: ->
{'fraction_non_alphanumeric': 0.1251178874567746, 'fraction_numerical': 0.0012574662055957245, 'mean_word_length': 3.545714285714286, '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': '2344665', 'n_tokens_mistral': 882, 'n_tokens_neox': 862, 'n_words': 157}