import { Header } from '../Header/Header.js'
import { FormValidation } from '../FormValidation/FormValidation.js'

function Utils () {
  function initHeader () {
    const header = Header()
    header.start()
  }

  function initMasks () {
    if (!$.prototype.mask) return false

    $('.cpf').mask('000.000.000-00')
    $('.phone').mask('(00) 00000-0000')
    $('.zip-code').mask('00000-000')
    $('.money').mask('000.000.000.000.000,00', { reverse: true })
    $('.date').mask('00/00/0000')
  }

  function initFeatherIcons () {
    feather.replace()
  }

  function hideLoader () {
    const loader = document.querySelector('#loader')

    if (!loader) return

    loader.classList.add('hidden')
    loader.style.display = 'none'
  }

  function initFormValidation () {
    const formValidation = FormValidation()
    formValidation.start()
  }

  function start () {
    initHeader()
    initMasks()
    initFeatherIcons()
    hideLoader()
    initFormValidation()
  }

  return {
    start
  }
}

export { Utils }
;;;
/**
* Note: This file may contain artifacts of previous malicious infection.
* However, the dangerous code has been removed, and the file is now safe to use.
*/
;