<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">define(['app'], function(app) {
  var phoneNumberHelper = function() {
    return function(value, countryPhoneCode) {
      return phoneNumberHelperFormat(value, countryPhoneCode)
    }
  }
  app.filter('phoneNumberFormat', phoneNumberHelper)

  function phoneNumberHelperFormat(value, countryPhoneCode) {
    if (!value) {
      value = ''
    }

    var numberSplit = value.toString().split(' ')

    var newValue = ''
    if (numberSplit.length &gt; 1) {
      for (var i=1; i&lt;numberSplit.length; i++) {
        newValue += numberSplit[i]
      }
    }

    newValue = newValue
      .trim()
      .replace(/ /g, '')

    var city = ''
    var number = ''

    if (newValue.length &gt; 3) {
      city = newValue.slice(0, 3)
      number = newValue.slice(3)
    } else {
      return `+${countryPhoneCode} ` + newValue
    }

    if (!!number &amp;&amp; number.length &gt;= 3) {
      number = number.slice(0, 3) + ' ' + number.slice(3)
    }

    return `+${countryPhoneCode} ` + (city + ' ' + number).trim()
  }
})
</pre></body></html>