{"version":3,"sources":["webpack:///./node_modules/easy-autocomplete/dist/jquery.easy-autocomplete.js"],"names":["scope","EasyAutocomplete","main","$input","options","requestDelayTimeoutId","consts","Constans","config","Configuration","logger","Logger","template","Template","listBuilderService","ListBuilderService","proccess","checkParam","equals","$field","$container","elementsList","selectedElement","prepareField","$elements_container","highlight","string","phrase","get","escapedPhrase","str","replace","RegExp","highlightPhrase","parent","hasClass","getValue","next","remove","unwrap","$wrapper","$","classes","getTemplateClass","addClass","wrap","fieldWidth","outerWidth","css","createWrapper","attr","getContainerId","prepend","on","showAnimation","type","animationTime","time","callback","find","slideDown","fadeIn","show","onShowListEvent","hideAnimation","slideUp","fadeOut","hide","onHideListEvent","removeClass","eq","onSelectItemEvent","event","listBuilders","$item","$listContainer","empty","detach","counter","builderIndex","listBuildersLength","length","listData","data","undefined","header","append","i","listDataLength","maxListSize","j","itemCounter","elementsValue","val","trigger","selectElement","onClickEvent","onChooseEvent","mouseover","onMouseOverEvent","mouseout","onMouseOutEvent","html","build","push","onLoadEvent","after","elementId","showContainer","hideContainer","index","loadElements","list","this","getConstants","getConfiguration","getContainer","getSelectedItemIndex","getItems","getItemData","getSelectedItemData","init","error","checkDataUrlProperties","checkRequiredProperties","bindAllEvents","removeAutocomplete","bindFocusOut","bindKeyup","bindKeydown","bindKeypress","bindFocus","bindBlur","focusout","fieldValue","match","caseSensitive","toLowerCase","off","keyup","keyCode","preventDefault","inputPhrase","hideOnEmptyPhrase","clearTimeout","setTimeout","loadData","updateCategories","processData","settings","createAjaxSettings","url","dataType","ajax","done","convertXml","checkInputPhraseMatchResponse","checkIfDataExists","fail","warning","always","ajaxSettings","set","evt","window","suppressKeypress","keydown","onKeyEnterEvent","focus","blur","bindEvents","eacHandles","getHandle","id","inputHasId","input","assignRandomId","fieldId","Math","floor","random","setHandle","handle","genericTemplates","basic","method","element","cssClass","description","fields","iconLeft","icon","iconRight","iconSrc","links","link","custom","_cssClass","emptyStringFunction","templateClass","_fields","buildMethod","elementValue","prepareBuildMethod","listBuilder","preparedList","enabled","findMatch","sort","maxNumberOfElements","slice","reduceElementsInList","value","configuration","proccessResponseData","convertToListBuilder","category","builder","toUpperCase","listLocation","xmlElementName","convertXmlToListBuilder","convertDataToListBuilder","defaultsGetValue","convertXmlToList","simpleList","each","Array","constants","CONTAINER_CLASS","CONTAINER_ID","WRAPPER_CSS_CLASS","propertyName","message","console","log","defaults","autocompleteOff","placeholder","ajaxCallback","matchResponseProperty","a","b","search","theme","cssClasses","minCharNumber","requestDelay","adjustWidth","preparePostData","loggerEnabled","categoriesAssigned","categories","externalObjects","printPropertiesThatDoesntExist","consol","optionsToCheck","checkPropertiesIfExist","source","target","property","inArray","name","isAssigned","text","prepareDefaults","mergeObjects","mergedObject","defaultUrl","defaultlistLocation","processAfterMerge","fn","easyAutocomplete","$this","eacHandle","inputId","jQuery"],"mappings":"8EAAA,cAYA,IAAiCA,EAkoB7BC,EAAmB,SAAUD,GAqb/B,OApbAA,EAAME,KAAO,SAAcC,EAAQC,GACjC,IAcEC,EAVEC,EAAS,IAAIN,EAAMO,SACrBC,EAAS,IAAIR,EAAMS,cAAcL,GACjCM,EAAS,IAAIV,EAAMW,OACnBC,EAAW,IAAIZ,EAAMa,SAAST,EAAQQ,UACtCE,EAAqB,IAAId,EAAMe,mBAAmBP,EAAQR,EAAMgB,UAChEC,EAAaT,EAAOU,OACpBC,EAAShB,EACTiB,EAAa,GACbC,EAAe,GACfC,GAAmB,EAkDrB,SAASC,IAoCP,IACMC,EA2FN,SAASC,EAAUC,EAAQC,GACzB,OAAInB,EAAOoB,IAAI,oBAAiC,KAAXD,EASvC,SAAyBD,EAAQC,GAC/B,IAAIE,GAJgBC,EAIaH,EAH1BG,EAAIC,QAAQ,sCAAuC,SAD5D,IAAsBD,EAKpB,OAAQJ,EAAS,IAAIK,QAAQ,IAAIC,OAAO,IAAMH,EAAgB,IAAK,MAAO,YAC5E,CAXWI,CAAgBP,EAAQC,GAExBD,CAEX,CArIIP,EAAOe,SAAS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YT,IAEjD,CACV,EACArE,EAAEsO,GAAGvJ,oBAAsB,WACzB,IAAI2J,EAAU1O,EAAEwE,MAAM/D,KAAK,MAC3B,YAAgBkC,IAAZ+L,EACKlR,EAAiB2K,UAAUuG,GAAS3J,uBAErC,CACV,CACD,CAxCD,CAwCG4J,E","file":"js/vendors~business~customer-b4d39262e85f2459aeda.chunk.js","sourcesContent":["/*\r\n * easy-autocomplete\r\n * jQuery plugin for autocompletion\r\n * \r\n * @author Łukasz Pawełczak (http://github.com/pawelczak)\r\n * @version 1.3.5\r\n * Copyright  License: \r\n */\n\n/*\r\n * EasyAutocomplete - Configuration \r\n */\nvar EasyAutocomplete = function (scope) {\n  scope.Configuration = function Configuration(options) {\n    var defaults = {\n      data: \"list-required\",\n      url: \"list-required\",\n      dataType: \"json\",\n      listLocation: function (data) {\n        return data;\n      },\n      xmlElementName: \"\",\n      getValue: function (element) {\n        return element;\n      },\n      autocompleteOff: true,\n      placeholder: false,\n      ajaxCallback: function () {},\n      matchResponseProperty: false,\n      list: {\n        sort: {\n          enabled: false,\n          method: function (a, b) {\n            a = defaults.getValue(a);\n            b = defaults.getValue(b);\n            if (a < b) {\n              return -1;\n            }\n            if (a > b) {\n              return 1;\n            }\n            return 0;\n          }\n        },\n        maxNumberOfElements: 6,\n        hideOnEmptyPhrase: true,\n        match: {\n          enabled: false,\n          caseSensitive: false,\n          method: function (element, phrase) {\n            if (element.search(phrase) > -1) {\n              return true;\n            } else {\n              return false;\n            }\n          }\n        },\n        showAnimation: {\n          type: \"normal\",\n          //normal|slide|fade\n          time: 400,\n          callback: function () {}\n        },\n        hideAnimation: {\n          type: \"normal\",\n          time: 400,\n          callback: function () {}\n        },\n        /* Events */\n        onClickEvent: function () {},\n        onSelectItemEvent: function () {},\n        onLoadEvent: function () {},\n        onChooseEvent: function () {},\n        onKeyEnterEvent: function () {},\n        onMouseOverEvent: function () {},\n        onMouseOutEvent: function () {},\n        onShowListEvent: function () {},\n        onHideListEvent: function () {}\n      },\n      highlightPhrase: true,\n      theme: \"\",\n      cssClasses: \"\",\n      minCharNumber: 0,\n      requestDelay: 0,\n      adjustWidth: true,\n      ajaxSettings: {},\n      preparePostData: function (data, inputPhrase) {\n        return data;\n      },\n      loggerEnabled: true,\n      template: \"\",\n      categoriesAssigned: false,\n      categories: [{\n        maxNumberOfElements: 4\n      }]\n    };\n    var externalObjects = [\"ajaxSettings\", \"template\"];\n    this.get = function (propertyName) {\n      return defaults[propertyName];\n    };\n    this.equals = function (name, value) {\n      if (isAssigned(name)) {\n        if (defaults[name] === value) {\n          return true;\n        }\n      }\n      return false;\n    };\n    this.checkDataUrlProperties = function () {\n      if (defaults.url === \"list-required\" && defaults.data === \"list-required\") {\n        return false;\n      }\n      return true;\n    };\n    this.checkRequiredProperties = function () {\n      for (var propertyName in defaults) {\n        if (defaults[propertyName] === \"required\") {\n          logger.error(\"Option \" + propertyName + \" must be defined\");\n          return false;\n        }\n      }\n      return true;\n    };\n    this.printPropertiesThatDoesntExist = function (consol, optionsToCheck) {\n      printPropertiesThatDoesntExist(consol, optionsToCheck);\n    };\n    prepareDefaults();\n    mergeOptions();\n    if (defaults.loggerEnabled === true) {\n      printPropertiesThatDoesntExist(console, options);\n    }\n    addAjaxSettings();\n    processAfterMerge();\n    function prepareDefaults() {\n      if (options.dataType === \"xml\") {\n        if (!options.getValue) {\n          options.getValue = function (element) {\n            return $(element).text();\n          };\n        }\n        if (!options.list) {\n          options.list = {};\n        }\n        if (!options.list.sort) {\n          options.list.sort = {};\n        }\n        options.list.sort.method = function (a, b) {\n          a = options.getValue(a);\n          b = options.getValue(b);\n          if (a < b) {\n            return -1;\n          }\n          if (a > b) {\n            return 1;\n          }\n          return 0;\n        };\n        if (!options.list.match) {\n          options.list.match = {};\n        }\n        options.list.match.method = function (element, phrase) {\n          if (element.search(phrase) > -1) {\n            return true;\n          } else {\n            return false;\n          }\n        };\n      }\n      if (options.categories !== undefined && options.categories instanceof Array) {\n        var categories = [];\n        for (var i = 0, length = options.categories.length; i < length; i += 1) {\n          var category = options.categories[i];\n          for (var property in defaults.categories[0]) {\n            if (category[property] === undefined) {\n              category[property] = defaults.categories[0][property];\n            }\n          }\n          categories.push(category);\n        }\n        options.categories = categories;\n      }\n    }\n    function mergeOptions() {\n      defaults = mergeObjects(defaults, options);\n      function mergeObjects(source, target) {\n        var mergedObject = source || {};\n        for (var propertyName in source) {\n          if (target[propertyName] !== undefined && target[propertyName] !== null) {\n            if (typeof target[propertyName] !== \"object\" || target[propertyName] instanceof Array) {\n              mergedObject[propertyName] = target[propertyName];\n            } else {\n              mergeObjects(source[propertyName], target[propertyName]);\n            }\n          }\n        }\n\n        /* If data is an object */\n        if (target.data !== undefined && target.data !== null && typeof target.data === \"object\") {\n          mergedObject.data = target.data;\n        }\n        return mergedObject;\n      }\n    }\n    function processAfterMerge() {\n      if (defaults.url !== \"list-required\" && typeof defaults.url !== \"function\") {\n        var defaultUrl = defaults.url;\n        defaults.url = function () {\n          return defaultUrl;\n        };\n      }\n      if (defaults.ajaxSettings.url !== undefined && typeof defaults.ajaxSettings.url !== \"function\") {\n        var defaultUrl = defaults.ajaxSettings.url;\n        defaults.ajaxSettings.url = function () {\n          return defaultUrl;\n        };\n      }\n      if (typeof defaults.listLocation === \"string\") {\n        var defaultlistLocation = defaults.listLocation;\n        if (defaults.dataType.toUpperCase() === \"XML\") {\n          defaults.listLocation = function (data) {\n            return $(data).find(defaultlistLocation);\n          };\n        } else {\n          defaults.listLocation = function (data) {\n            return data[defaultlistLocation];\n          };\n        }\n      }\n      if (typeof defaults.getValue === \"string\") {\n        var defaultsGetValue = defaults.getValue;\n        defaults.getValue = function (element) {\n          return element[defaultsGetValue];\n        };\n      }\n      if (options.categories !== undefined) {\n        defaults.categoriesAssigned = true;\n      }\n    }\n    function addAjaxSettings() {\n      if (options.ajaxSettings !== undefined && typeof options.ajaxSettings === \"object\") {\n        defaults.ajaxSettings = options.ajaxSettings;\n      } else {\n        defaults.ajaxSettings = {};\n      }\n    }\n    function isAssigned(name) {\n      if (defaults[name] !== undefined && defaults[name] !== null) {\n        return true;\n      } else {\n        return false;\n      }\n    }\n    function printPropertiesThatDoesntExist(consol, optionsToCheck) {\n      checkPropertiesIfExist(defaults, optionsToCheck);\n      function checkPropertiesIfExist(source, target) {\n        for (var property in target) {\n          if (source[property] === undefined) {\n            consol.log(\"Property '\" + property + \"' does not exist in EasyAutocomplete options API.\");\n          }\n          if (typeof source[property] === \"object\" && $.inArray(property, externalObjects) === -1) {\n            checkPropertiesIfExist(source[property], target[property]);\n          }\n        }\n      }\n    }\n  };\n  return scope;\n}(EasyAutocomplete || {});\n\n/*\r\n * EasyAutocomplete - Logger \r\n */\nvar EasyAutocomplete = function (scope) {\n  scope.Logger = function Logger() {\n    this.error = function (message) {\n      console.log(\"ERROR: \" + message);\n    };\n    this.warning = function (message) {\n      console.log(\"WARNING: \" + message);\n    };\n  };\n  return scope;\n}(EasyAutocomplete || {});\n\n/*\r\n * EasyAutocomplete - Constans\r\n */\nvar EasyAutocomplete = function (scope) {\n  scope.Constans = function Constans() {\n    var constants = {\n      CONTAINER_CLASS: \"easy-autocomplete-container\",\n      CONTAINER_ID: \"eac-container-\",\n      WRAPPER_CSS_CLASS: \"easy-autocomplete\"\n    };\n    this.getValue = function (propertyName) {\n      return constants[propertyName];\n    };\n  };\n  return scope;\n}(EasyAutocomplete || {});\n\n/*\r\n * EasyAutocomplete - ListBuilderService \r\n *\r\n * @author Łukasz Pawełczak \r\n *\r\n */\nvar EasyAutocomplete = function (scope) {\n  scope.ListBuilderService = function ListBuilderService(configuration, proccessResponseData) {\n    this.init = function (data) {\n      var listBuilder = [],\n        builder = {};\n      builder.data = configuration.get(\"listLocation\")(data);\n      builder.getValue = configuration.get(\"getValue\");\n      builder.maxListSize = configuration.get(\"list\").maxNumberOfElements;\n      listBuilder.push(builder);\n      return listBuilder;\n    };\n    this.updateCategories = function (listBuilder, data) {\n      if (configuration.get(\"categoriesAssigned\")) {\n        listBuilder = [];\n        for (var i = 0; i < configuration.get(\"categories\").length; i += 1) {\n          var builder = convertToListBuilder(configuration.get(\"categories\")[i], data);\n          listBuilder.push(builder);\n        }\n      }\n      return listBuilder;\n    };\n    this.convertXml = function (listBuilder) {\n      if (configuration.get(\"dataType\").toUpperCase() === \"XML\") {\n        for (var i = 0; i < listBuilder.length; i += 1) {\n          listBuilder[i].data = convertXmlToList(listBuilder[i]);\n        }\n      }\n      return listBuilder;\n    };\n    this.processData = function (listBuilder, inputPhrase) {\n      for (var i = 0, length = listBuilder.length; i < length; i += 1) {\n        listBuilder[i].data = proccessResponseData(configuration, listBuilder[i], inputPhrase);\n      }\n      return listBuilder;\n    };\n    this.checkIfDataExists = function (listBuilders) {\n      for (var i = 0, length = listBuilders.length; i < length; i += 1) {\n        if (listBuilders[i].data !== undefined && listBuilders[i].data instanceof Array) {\n          if (listBuilders[i].data.length > 0) {\n            return true;\n          }\n        }\n      }\n      return false;\n    };\n    function convertToListBuilder(category, data) {\n      var builder = {};\n      if (configuration.get(\"dataType\").toUpperCase() === \"XML\") {\n        builder = convertXmlToListBuilder();\n      } else {\n        builder = convertDataToListBuilder();\n      }\n      if (category.header !== undefined) {\n        builder.header = category.header;\n      }\n      if (category.maxNumberOfElements !== undefined) {\n        builder.maxNumberOfElements = category.maxNumberOfElements;\n      }\n      if (configuration.get(\"list\").maxNumberOfElements !== undefined) {\n        builder.maxListSize = configuration.get(\"list\").maxNumberOfElements;\n      }\n      if (category.getValue !== undefined) {\n        if (typeof category.getValue === \"string\") {\n          var defaultsGetValue = category.getValue;\n          builder.getValue = function (element) {\n            return element[defaultsGetValue];\n          };\n        } else if (typeof category.getValue === \"function\") {\n          builder.getValue = category.getValue;\n        }\n      } else {\n        builder.getValue = configuration.get(\"getValue\");\n      }\n      return builder;\n      function convertXmlToListBuilder() {\n        var builder = {},\n          listLocation;\n        if (category.xmlElementName !== undefined) {\n          builder.xmlElementName = category.xmlElementName;\n        }\n        if (category.listLocation !== undefined) {\n          listLocation = category.listLocation;\n        } else if (configuration.get(\"listLocation\") !== undefined) {\n          listLocation = configuration.get(\"listLocation\");\n        }\n        if (listLocation !== undefined) {\n          if (typeof listLocation === \"string\") {\n            builder.data = $(data).find(listLocation);\n          } else if (typeof listLocation === \"function\") {\n            builder.data = listLocation(data);\n          }\n        } else {\n          builder.data = data;\n        }\n        return builder;\n      }\n      function convertDataToListBuilder() {\n        var builder = {};\n        if (category.listLocation !== undefined) {\n          if (typeof category.listLocation === \"string\") {\n            builder.data = data[category.listLocation];\n          } else if (typeof category.listLocation === \"function\") {\n            builder.data = category.listLocation(data);\n          }\n        } else {\n          builder.data = data;\n        }\n        return builder;\n      }\n    }\n    function convertXmlToList(builder) {\n      var simpleList = [];\n      if (builder.xmlElementName === undefined) {\n        builder.xmlElementName = configuration.get(\"xmlElementName\");\n      }\n      $(builder.data).find(builder.xmlElementName).each(function () {\n        simpleList.push(this);\n      });\n      return simpleList;\n    }\n  };\n  return scope;\n}(EasyAutocomplete || {});\n\n/*\r\n * EasyAutocomplete - Data proccess module\r\n *\r\n * Process list to display:\r\n * - sort \r\n * - decrease number to specific number\r\n * - show only matching list\r\n *\r\n */\nvar EasyAutocomplete = function (scope) {\n  scope.proccess = function proccessData(config, listBuilder, phrase) {\n    scope.proccess.match = match;\n    var list = listBuilder.data,\n      inputPhrase = phrase; //TODO REFACTOR\n\n    list = findMatch(list, inputPhrase);\n    list = reduceElementsInList(list);\n    list = sort(list);\n    return list;\n    function findMatch(list, phrase) {\n      var preparedList = [],\n        value = \"\";\n      if (config.get(\"list\").match.enabled) {\n        for (var i = 0, length = list.length; i < length; i += 1) {\n          value = config.get(\"getValue\")(list[i]);\n          if (match(value, phrase)) {\n            preparedList.push(list[i]);\n          }\n        }\n      } else {\n        preparedList = list;\n      }\n      return preparedList;\n    }\n    function match(value, phrase) {\n      if (!config.get(\"list\").match.caseSensitive) {\n        if (typeof value === \"string\") {\n          value = value.toLowerCase();\n        }\n        phrase = phrase.toLowerCase();\n      }\n      if (config.get(\"list\").match.method(value, phrase)) {\n        return true;\n      } else {\n        return false;\n      }\n    }\n    function reduceElementsInList(list) {\n      if (listBuilder.maxNumberOfElements !== undefined && list.length > listBuilder.maxNumberOfElements) {\n        list = list.slice(0, listBuilder.maxNumberOfElements);\n      }\n      return list;\n    }\n    function sort(list) {\n      if (config.get(\"list\").sort.enabled) {\n        list.sort(config.get(\"list\").sort.method);\n      }\n      return list;\n    }\n  };\n  return scope;\n}(EasyAutocomplete || {});\n\n/*\r\n * EasyAutocomplete - Template \r\n *\r\n * \r\n *\r\n */\nvar EasyAutocomplete = function (scope) {\n  scope.Template = function Template(options) {\n    var genericTemplates = {\n        basic: {\n          type: \"basic\",\n          method: function (element) {\n            return element;\n          },\n          cssClass: \"\"\n        },\n        description: {\n          type: \"description\",\n          fields: {\n            description: \"description\"\n          },\n          method: function (element) {\n            return element + \" - description\";\n          },\n          cssClass: \"eac-description\"\n        },\n        iconLeft: {\n          type: \"iconLeft\",\n          fields: {\n            icon: \"\"\n          },\n          method: function (element) {\n            return element;\n          },\n          cssClass: \"eac-icon-left\"\n        },\n        iconRight: {\n          type: \"iconRight\",\n          fields: {\n            iconSrc: \"\"\n          },\n          method: function (element) {\n            return element;\n          },\n          cssClass: \"eac-icon-right\"\n        },\n        links: {\n          type: \"links\",\n          fields: {\n            link: \"\"\n          },\n          method: function (element) {\n            return element;\n          },\n          cssClass: \"\"\n        },\n        custom: {\n          type: \"custom\",\n          method: function () {},\n          cssClass: \"\"\n        }\n      },\n      /*\r\n       * Converts method with {{text}} to function\r\n       */\n      convertTemplateToMethod = function (template) {\n        var _fields = template.fields,\n          buildMethod;\n        if (template.type === \"description\") {\n          buildMethod = genericTemplates.description.method;\n          if (typeof _fields.description === \"string\") {\n            buildMethod = function (elementValue, element) {\n              return elementValue + \" - <span>\" + element[_fields.description] + \"</span>\";\n            };\n          } else if (typeof _fields.description === \"function\") {\n            buildMethod = function (elementValue, element) {\n              return elementValue + \" - <span>\" + _fields.description(element) + \"</span>\";\n            };\n          }\n          return buildMethod;\n        }\n        if (template.type === \"iconRight\") {\n          if (typeof _fields.iconSrc === \"string\") {\n            buildMethod = function (elementValue, element) {\n              return elementValue + \"<img class='eac-icon' src='\" + element[_fields.iconSrc] + \"' />\";\n            };\n          } else if (typeof _fields.iconSrc === \"function\") {\n            buildMethod = function (elementValue, element) {\n              return elementValue + \"<img class='eac-icon' src='\" + _fields.iconSrc(element) + \"' />\";\n            };\n          }\n          return buildMethod;\n        }\n        if (template.type === \"iconLeft\") {\n          if (typeof _fields.iconSrc === \"string\") {\n            buildMethod = function (elementValue, element) {\n              return \"<img class='eac-icon' src='\" + element[_fields.iconSrc] + \"' />\" + elementValue;\n            };\n          } else if (typeof _fields.iconSrc === \"function\") {\n            buildMethod = function (elementValue, element) {\n              return \"<img class='eac-icon' src='\" + _fields.iconSrc(element) + \"' />\" + elementValue;\n            };\n          }\n          return buildMethod;\n        }\n        if (template.type === \"links\") {\n          if (typeof _fields.link === \"string\") {\n            buildMethod = function (elementValue, element) {\n              return \"<a href='\" + element[_fields.link] + \"' >\" + elementValue + \"</a>\";\n            };\n          } else if (typeof _fields.link === \"function\") {\n            buildMethod = function (elementValue, element) {\n              return \"<a href='\" + _fields.link(element) + \"' >\" + elementValue + \"</a>\";\n            };\n          }\n          return buildMethod;\n        }\n        if (template.type === \"custom\") {\n          return template.method;\n        }\n        return genericTemplates.basic.method;\n      },\n      prepareBuildMethod = function (options) {\n        if (!options || !options.type) {\n          return genericTemplates.basic.method;\n        }\n        if (options.type && genericTemplates[options.type]) {\n          return convertTemplateToMethod(options);\n        } else {\n          return genericTemplates.basic.method;\n        }\n      },\n      templateClass = function (options) {\n        var emptyStringFunction = function () {\n          return \"\";\n        };\n        if (!options || !options.type) {\n          return emptyStringFunction;\n        }\n        if (options.type && genericTemplates[options.type]) {\n          return function () {\n            var _cssClass = genericTemplates[options.type].cssClass;\n            return function () {\n              return _cssClass;\n            };\n          }();\n        } else {\n          return emptyStringFunction;\n        }\n      };\n    this.getTemplateClass = templateClass(options);\n    this.build = prepareBuildMethod(options);\n  };\n  return scope;\n}(EasyAutocomplete || {});\n\n/*\r\n * EasyAutocomplete - jQuery plugin for autocompletion\r\n *\r\n */\nvar EasyAutocomplete = function (scope) {\n  scope.main = function Core($input, options) {\n    var module = {\n      name: \"EasyAutocomplete\",\n      shortcut: \"eac\"\n    };\n    var consts = new scope.Constans(),\n      config = new scope.Configuration(options),\n      logger = new scope.Logger(),\n      template = new scope.Template(options.template),\n      listBuilderService = new scope.ListBuilderService(config, scope.proccess),\n      checkParam = config.equals,\n      $field = $input,\n      $container = \"\",\n      elementsList = [],\n      selectedElement = -1,\n      requestDelayTimeoutId;\n    scope.consts = consts;\n    this.getConstants = function () {\n      return consts;\n    };\n    this.getConfiguration = function () {\n      return config;\n    };\n    this.getContainer = function () {\n      return $container;\n    };\n    this.getSelectedItemIndex = function () {\n      return selectedElement;\n    };\n    this.getItems = function () {\n      return elementsList;\n    };\n    this.getItemData = function (index) {\n      if (elementsList.length < index || elementsList[index] === undefined) {\n        return -1;\n      } else {\n        return elementsList[index];\n      }\n    };\n    this.getSelectedItemData = function () {\n      return this.getItemData(selectedElement);\n    };\n    this.build = function () {\n      prepareField();\n    };\n    this.init = function () {\n      init();\n    };\n    function init() {\n      if ($field.length === 0) {\n        logger.error(\"Input field doesn't exist.\");\n        return;\n      }\n      if (!config.checkDataUrlProperties()) {\n        logger.error(\"One of options variables 'data' or 'url' must be defined.\");\n        return;\n      }\n      if (!config.checkRequiredProperties()) {\n        logger.error(\"Will not work without mentioned properties.\");\n        return;\n      }\n      prepareField();\n      bindEvents();\n    }\n    function prepareField() {\n      if ($field.parent().hasClass(consts.getValue(\"WRAPPER_CSS_CLASS\"))) {\n        removeContainer();\n        removeWrapper();\n      }\n      createWrapper();\n      createContainer();\n      $container = $(\"#\" + getContainerId());\n      if (config.get(\"placeholder\")) {\n        $field.attr(\"placeholder\", config.get(\"placeholder\"));\n      }\n      function createWrapper() {\n        var $wrapper = $(\"<div>\"),\n          classes = consts.getValue(\"WRAPPER_CSS_CLASS\");\n        if (config.get(\"theme\") && config.get(\"theme\") !== \"\") {\n          classes += \" eac-\" + config.get(\"theme\");\n        }\n        if (config.get(\"cssClasses\") && config.get(\"cssClasses\") !== \"\") {\n          classes += \" \" + config.get(\"cssClasses\");\n        }\n        if (template.getTemplateClass() !== \"\") {\n          classes += \" \" + template.getTemplateClass();\n        }\n        $wrapper.addClass(classes);\n        $field.wrap($wrapper);\n        if (config.get(\"adjustWidth\") === true) {\n          adjustWrapperWidth();\n        }\n      }\n      function adjustWrapperWidth() {\n        var fieldWidth = $field.outerWidth();\n        $field.parent().css(\"width\", fieldWidth);\n      }\n      function removeWrapper() {\n        $field.unwrap();\n      }\n      function createContainer() {\n        var $elements_container = $(\"<div>\").addClass(consts.getValue(\"CONTAINER_CLASS\"));\n        $elements_container.attr(\"id\", getContainerId()).prepend($(\"<ul>\"));\n        (function () {\n          $elements_container\n          /* List show animation */.on(\"show.eac\", function () {\n            switch (config.get(\"list\").showAnimation.type) {\n              case \"slide\":\n                var animationTime = config.get(\"list\").showAnimation.time,\n                  callback = config.get(\"list\").showAnimation.callback;\n                $elements_container.find(\"ul\").slideDown(animationTime, callback);\n                break;\n              case \"fade\":\n                var animationTime = config.get(\"list\").showAnimation.time,\n                  callback = config.get(\"list\").showAnimation.callback;\n                $elements_container.find(\"ul\").fadeIn(animationTime), callback;\n                break;\n              default:\n                $elements_container.find(\"ul\").show();\n                break;\n            }\n            config.get(\"list\").onShowListEvent();\n          })\n          /* List hide animation */.on(\"hide.eac\", function () {\n            switch (config.get(\"list\").hideAnimation.type) {\n              case \"slide\":\n                var animationTime = config.get(\"list\").hideAnimation.time,\n                  callback = config.get(\"list\").hideAnimation.callback;\n                $elements_container.find(\"ul\").slideUp(animationTime, callback);\n                break;\n              case \"fade\":\n                var animationTime = config.get(\"list\").hideAnimation.time,\n                  callback = config.get(\"list\").hideAnimation.callback;\n                $elements_container.find(\"ul\").fadeOut(animationTime, callback);\n                break;\n              default:\n                $elements_container.find(\"ul\").hide();\n                break;\n            }\n            config.get(\"list\").onHideListEvent();\n          }).on(\"selectElement.eac\", function () {\n            $elements_container.find(\"ul li\").removeClass(\"selected\");\n            $elements_container.find(\"ul li\").eq(selectedElement).addClass(\"selected\");\n            config.get(\"list\").onSelectItemEvent();\n          }).on(\"loadElements.eac\", function (event, listBuilders, phrase) {\n            var $item = \"\",\n              $listContainer = $elements_container.find(\"ul\");\n            $listContainer.empty().detach();\n            elementsList = [];\n            var counter = 0;\n            for (var builderIndex = 0, listBuildersLength = listBuilders.length; builderIndex < listBuildersLength; builderIndex += 1) {\n              var listData = listBuilders[builderIndex].data;\n              if (listData.length === 0) {\n                continue;\n              }\n              if (listBuilders[builderIndex].header !== undefined && listBuilders[builderIndex].header.length > 0) {\n                $listContainer.append(\"<div class='eac-category' >\" + listBuilders[builderIndex].header + \"</div>\");\n              }\n              for (var i = 0, listDataLength = listData.length; i < listDataLength && counter < listBuilders[builderIndex].maxListSize; i += 1) {\n                $item = $(\"<li><div class='eac-item'></div></li>\");\n                (function () {\n                  var j = i,\n                    itemCounter = counter,\n                    elementsValue = listBuilders[builderIndex].getValue(listData[j]);\n                  $item.find(\" > div\").on(\"click\", function () {\n                    $field.val(elementsValue).trigger(\"change\");\n                    selectedElement = itemCounter;\n                    selectElement(itemCounter);\n                    config.get(\"list\").onClickEvent();\n                    config.get(\"list\").onChooseEvent();\n                  }).mouseover(function () {\n                    selectedElement = itemCounter;\n                    selectElement(itemCounter);\n                    config.get(\"list\").onMouseOverEvent();\n                  }).mouseout(function () {\n                    config.get(\"list\").onMouseOutEvent();\n                  }).html(template.build(highlight(elementsValue, phrase), listData[j]));\n                })();\n                $listContainer.append($item);\n                elementsList.push(listData[i]);\n                counter += 1;\n              }\n            }\n            $elements_container.append($listContainer);\n            config.get(\"list\").onLoadEvent();\n          });\n        })();\n        $field.after($elements_container);\n      }\n      function removeContainer() {\n        $field.next(\".\" + consts.getValue(\"CONTAINER_CLASS\")).remove();\n      }\n      function highlight(string, phrase) {\n        if (config.get(\"highlightPhrase\") && phrase !== \"\") {\n          return highlightPhrase(string, phrase);\n        } else {\n          return string;\n        }\n      }\n      function escapeRegExp(str) {\n        return str.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, \"\\\\$&\");\n      }\n      function highlightPhrase(string, phrase) {\n        var escapedPhrase = escapeRegExp(phrase);\n        return (string + \"\").replace(new RegExp(\"(\" + escapedPhrase + \")\", \"gi\"), \"<b>$1</b>\");\n      }\n    }\n    function getContainerId() {\n      var elementId = $field.attr(\"id\");\n      elementId = consts.getValue(\"CONTAINER_ID\") + elementId;\n      return elementId;\n    }\n    function bindEvents() {\n      bindAllEvents();\n      function bindAllEvents() {\n        if (checkParam(\"autocompleteOff\", true)) {\n          removeAutocomplete();\n        }\n        bindFocusOut();\n        bindKeyup();\n        bindKeydown();\n        bindKeypress();\n        bindFocus();\n        bindBlur();\n      }\n      function bindFocusOut() {\n        $field.focusout(function () {\n          var fieldValue = $field.val(),\n            phrase;\n          if (!config.get(\"list\").match.caseSensitive) {\n            fieldValue = fieldValue.toLowerCase();\n          }\n          for (var i = 0, length = elementsList.length; i < length; i += 1) {\n            phrase = config.get(\"getValue\")(elementsList[i]);\n            if (!config.get(\"list\").match.caseSensitive) {\n              phrase = phrase.toLowerCase();\n            }\n            if (phrase === fieldValue) {\n              selectedElement = i;\n              selectElement(selectedElement);\n              return;\n            }\n          }\n        });\n      }\n      function bindKeyup() {\n        $field.off(\"keyup\").keyup(function (event) {\n          switch (event.keyCode) {\n            case 27:\n              hideContainer();\n              loseFieldFocus();\n              break;\n            case 38:\n              event.preventDefault();\n              if (elementsList.length > 0 && selectedElement > 0) {\n                selectedElement -= 1;\n                $field.val(config.get(\"getValue\")(elementsList[selectedElement]));\n                selectElement(selectedElement);\n              }\n              break;\n            case 40:\n              event.preventDefault();\n              if (elementsList.length > 0 && selectedElement < elementsList.length - 1) {\n                selectedElement += 1;\n                $field.val(config.get(\"getValue\")(elementsList[selectedElement]));\n                selectElement(selectedElement);\n              }\n              break;\n            default:\n              if (event.keyCode > 40 || event.keyCode === 8) {\n                var inputPhrase = $field.val();\n                if (!(config.get(\"list\").hideOnEmptyPhrase === true && event.keyCode === 8 && inputPhrase === \"\")) {\n                  if (config.get(\"requestDelay\") > 0) {\n                    if (requestDelayTimeoutId !== undefined) {\n                      clearTimeout(requestDelayTimeoutId);\n                    }\n                    requestDelayTimeoutId = setTimeout(function () {\n                      loadData(inputPhrase);\n                    }, config.get(\"requestDelay\"));\n                  } else {\n                    loadData(inputPhrase);\n                  }\n                } else {\n                  hideContainer();\n                }\n              }\n              break;\n          }\n          function loadData(inputPhrase) {\n            if (inputPhrase.length < config.get(\"minCharNumber\")) {\n              return;\n            }\n            if (config.get(\"data\") !== \"list-required\") {\n              var data = config.get(\"data\");\n              var listBuilders = listBuilderService.init(data);\n              listBuilders = listBuilderService.updateCategories(listBuilders, data);\n              listBuilders = listBuilderService.processData(listBuilders, inputPhrase);\n              loadElements(listBuilders, inputPhrase);\n              if ($field.parent().find(\"li\").length > 0) {\n                showContainer();\n              } else {\n                hideContainer();\n              }\n            }\n            var settings = createAjaxSettings();\n            if (settings.url === undefined || settings.url === \"\") {\n              settings.url = config.get(\"url\");\n            }\n            if (settings.dataType === undefined || settings.dataType === \"\") {\n              settings.dataType = config.get(\"dataType\");\n            }\n            if (settings.url !== undefined && settings.url !== \"list-required\") {\n              settings.url = settings.url(inputPhrase);\n              settings.data = config.get(\"preparePostData\")(settings.data, inputPhrase);\n              $.ajax(settings).done(function (data) {\n                var listBuilders = listBuilderService.init(data);\n                listBuilders = listBuilderService.updateCategories(listBuilders, data);\n                listBuilders = listBuilderService.convertXml(listBuilders);\n                if (checkInputPhraseMatchResponse(inputPhrase, data)) {\n                  listBuilders = listBuilderService.processData(listBuilders, inputPhrase);\n                  loadElements(listBuilders, inputPhrase);\n                }\n                if (listBuilderService.checkIfDataExists(listBuilders) && $field.parent().find(\"li\").length > 0) {\n                  showContainer();\n                } else {\n                  hideContainer();\n                }\n                config.get(\"ajaxCallback\")();\n              }).fail(function () {\n                logger.warning(\"Fail to load response data\");\n              }).always(function () {});\n            }\n            function createAjaxSettings() {\n              var settings = {},\n                ajaxSettings = config.get(\"ajaxSettings\") || {};\n              for (var set in ajaxSettings) {\n                settings[set] = ajaxSettings[set];\n              }\n              return settings;\n            }\n            function checkInputPhraseMatchResponse(inputPhrase, data) {\n              if (config.get(\"matchResponseProperty\") !== false) {\n                if (typeof config.get(\"matchResponseProperty\") === \"string\") {\n                  return data[config.get(\"matchResponseProperty\")] === inputPhrase;\n                }\n                if (typeof config.get(\"matchResponseProperty\") === \"function\") {\n                  return config.get(\"matchResponseProperty\")(data) === inputPhrase;\n                }\n                return true;\n              } else {\n                return true;\n              }\n            }\n          }\n        });\n      }\n      function bindKeydown() {\n        $field.on(\"keydown\", function (evt) {\n          evt = evt || window.event;\n          var keyCode = evt.keyCode;\n          if (keyCode === 38) {\n            suppressKeypress = true;\n            return false;\n          }\n        }).keydown(function (event) {\n          if (event.keyCode === 13 && selectedElement > -1) {\n            $field.val(config.get(\"getValue\")(elementsList[selectedElement]));\n            config.get(\"list\").onKeyEnterEvent();\n            config.get(\"list\").onChooseEvent();\n            selectedElement = -1;\n            hideContainer();\n            event.preventDefault();\n          }\n        });\n      }\n      function bindKeypress() {\n        $field.off(\"keypress\");\n      }\n      function bindFocus() {\n        $field.focus(function () {\n          if ($field.val() !== \"\" && elementsList.length > 0) {\n            selectedElement = -1;\n            showContainer();\n          }\n        });\n      }\n      function bindBlur() {\n        $field.blur(function () {\n          setTimeout(function () {\n            selectedElement = -1;\n            hideContainer();\n          }, 250);\n        });\n      }\n      function removeAutocomplete() {\n        $field.attr(\"autocomplete\", \"off\");\n      }\n    }\n    function showContainer() {\n      $container.trigger(\"show.eac\");\n    }\n    function hideContainer() {\n      $container.trigger(\"hide.eac\");\n    }\n    function selectElement(index) {\n      $container.trigger(\"selectElement.eac\", index);\n    }\n    function loadElements(list, phrase) {\n      $container.trigger(\"loadElements.eac\", [list, phrase]);\n    }\n    function loseFieldFocus() {\n      $field.trigger(\"blur\");\n    }\n  };\n  scope.eacHandles = [];\n  scope.getHandle = function (id) {\n    return scope.eacHandles[id];\n  };\n  scope.inputHasId = function (input) {\n    if ($(input).attr(\"id\") !== undefined && $(input).attr(\"id\").length > 0) {\n      return true;\n    } else {\n      return false;\n    }\n  };\n  scope.assignRandomId = function (input) {\n    var fieldId = \"\";\n    do {\n      fieldId = \"eac-\" + Math.floor(Math.random() * 10000);\n    } while ($(\"#\" + fieldId).length !== 0);\n    elementId = scope.consts.getValue(\"CONTAINER_ID\") + fieldId;\n    $(input).attr(\"id\", fieldId);\n  };\n  scope.setHandle = function (handle, id) {\n    scope.eacHandles[id] = handle;\n  };\n  return scope;\n}(EasyAutocomplete || {});\n(function ($) {\n  $.fn.easyAutocomplete = function (options) {\n    return this.each(function () {\n      var $this = $(this),\n        eacHandle = new EasyAutocomplete.main($this, options);\n      if (!EasyAutocomplete.inputHasId($this)) {\n        EasyAutocomplete.assignRandomId($this);\n      }\n      eacHandle.init();\n      EasyAutocomplete.setHandle(eacHandle, $this.attr(\"id\"));\n    });\n  };\n  $.fn.getSelectedItemIndex = function () {\n    var inputId = $(this).attr(\"id\");\n    if (inputId !== undefined) {\n      return EasyAutocomplete.getHandle(inputId).getSelectedItemIndex();\n    }\n    return -1;\n  };\n  $.fn.getItems = function () {\n    var inputId = $(this).attr(\"id\");\n    if (inputId !== undefined) {\n      return EasyAutocomplete.getHandle(inputId).getItems();\n    }\n    return -1;\n  };\n  $.fn.getItemData = function (index) {\n    var inputId = $(this).attr(\"id\");\n    if (inputId !== undefined && index > -1) {\n      return EasyAutocomplete.getHandle(inputId).getItemData(index);\n    }\n    return -1;\n  };\n  $.fn.getSelectedItemData = function () {\n    var inputId = $(this).attr(\"id\");\n    if (inputId !== undefined) {\n      return EasyAutocomplete.getHandle(inputId).getSelectedItemData();\n    }\n    return -1;\n  };\n})(jQuery);"],"sourceRoot":""}