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1EAhB,UAAUiB,8BAA8BrE,kDAAAA,EAAUC,WAAWC,qBAAqB,WAC9EJ,kBAAkBwE,WAAWnE,oBACjC,G,2ECPe,SAASoE,mBACtBC,cACAC,OACAC,gBACAC,mBACAC,aACAC,QACAC,iBACAC,YAGA,IAoBIC,KApBAC,QACuB,mBAAlBT,cAA+BA,cAAcS,QAAUT,cAuDhE,GApDIC,SACFQ,QAAQR,OAASA,OACjBQ,QAAQP,gBAAkBA,gBAC1BO,QAAQC,WAAY,GAIlBP,qBACFM,QAAQE,YAAa,GAInBN,UACFI,QAAQG,SAAW,UAAYP,SAI7BC,kBAEFE,KAAO,SAAUK,UAEfA,QACEA,SACCxB,KAAKyB,QAAUzB,KAAKyB,OAAOC,YAC3B1B,KAAK2B,QAAU3B,KAAK2B,OAAOF,QAAUzB,KAAK2B,OAAOF,OAAOC,aAEZ,oBAAxBE,sBACrBJ,QAAUI,qBAGRb,cACFA,aAAac,KAAK7B,KAAMwB,SAGtBA,SAAWA,QAAQM,uBACrBN,QAAQM,sBAAsBC,IAAId,iBAEtC,EAGAG,QAAQY,aAAeb,MACdJ,eACTI,KAAOD,WACH,WACEH,aAAac,KACX7B,MACCoB,QAAQE,WAAatB,KAAK2B,OAAS3B,MAAMiC,MAAMC,SAASC,WAE7D,EACApB,cAGFI,KACF,GAAIC,QAAQE,WAAY,CAGtBF,QAAQgB,cAAgBjB,KAExB,IAAIkB,eAAiBjB,QAAQR,OAC7BQ,QAAQR,OAAS,SAAkC0B,EAAGd,SAEpD,OADAL,KAAKU,KAAKL,SACHa,eAAeC,EAAGd,QAC3B,CACF,KAAO,CAEL,IAAIe,SAAWnB,QAAQoB,aACvBpB,QAAQoB,aAAeD,SAAW,GAAGE,OAAOF,SAAUpB,MAAQ,CAACA,KACjE,CAGF,MAAO,CACLuB,QAAS/B,cACTS,QAEJ,C","sources":["webpack://RdoWeb/./ResourcePackages/Main/assets/src/scripts/widgets/autocomplete-header.js","webpack://RdoWeb/./node_modules/vue-loader/lib/runtime/componentNormalizer.js"],"sourcesContent":["import { WidgetInitializer } from \"../functions/widget-initializer\";\r\nimport { Constants } from \"../functions/constants\";\r\nimport { ConfigUtils } from \"../functions/config-utils\";\r\nimport algoliasearch from 'algoliasearch/lite';\r\nimport { AisInstantSearch, AisHighlight, AisIndex, AisConfigure, AisHits } from 'vue-instantsearch';\r\nimport QueryRuleCustomDataExtended from \"../components/search/QueryRuleCustomDataExtended\";\r\nimport AutocompleteInstance from \"../components/search/AutocompleteInstance\";\r\nimport AutocompleteSingleIndex from \"../components/search/AutocompleteSingleIndex\"; \r\nimport algoliaAutocompleteMixin from \"../mixins/algolia-autocomplete-mixin\";\r\n\r\nvar widgetInitializer = new WidgetInitializer(Constants.COMPONENTS.AUTOCOMPLETE_HEADER);\r\nGlobalApp.registerInitializationHandler(Constants.COMPONENTS.AUTOCOMPLETE_HEADER, function () {\r\n widgetInitializer.initialize(initAutocompleteApp);\r\n});\r\n\r\nfunction initAutocompleteApp(element) {\r\n var config = ConfigUtils.getConfigFor(element);\r\n const algoliaClient = algoliasearch(config.appId, config.apiKey);\r\n\r\n const searchClient = {\r\n ...algoliaClient,\r\n search(requests) {\r\n if (requests.every(({ params, indexName }) => !params.query && !indexName.endsWith('_query_suggestions'))) {\r\n var emptyResponse = Promise.resolve({\r\n results: requests.map(() => ({\r\n hits: [],\r\n nbHits: 0,\r\n nbPages: 0,\r\n page: 0,\r\n processingTimeMS: 0,\r\n hitsPerPage: 0,\r\n exhaustiveNbHits: false,\r\n query: '',\r\n queryID: '',\r\n params: '',\r\n })),\r\n });\r\n\r\n return emptyResponse;\r\n }\r\n\r\n return algoliaClient.search(requests);\r\n },\r\n };\r\n\r\n var vueApp = new Vue({\r\n el: '#' + element.id,\r\n mixins: [algoliaAutocompleteMixin],\r\n components: {\r\n AisInstantSearch,\r\n AisHighlight,\r\n AisIndex,\r\n AisConfigure,\r\n AisHits,\r\n QueryRuleCustomDataExtended,\r\n AutocompleteInstance,\r\n AutocompleteSingleIndex\r\n },\r\n data: function () {\r\n return {\r\n initializationReadyHook: GlobalApp.getInitializationReadyHook(),\r\n searchClient: searchClient,\r\n middlewares: [],\r\n search_term: null,\r\n default_context: ['header-search'],\r\n searchPageUrl: config.searchPageUrl\r\n }\r\n },\r\n methods: {\r\n },\r\n computed: {\r\n ruleContext: function () {\r\n return this.default_context;\r\n },\r\n },\r\n created: async function () {\r\n this.initializationReadyHook(element.id);\r\n this.initializeAutocompleteInsights();\r\n },\r\n destroyed() {\r\n\r\n }\r\n });\r\n\r\n return vueApp.$el;\r\n}","/* globals __VUE_SSR_CONTEXT__ */\n\n// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).\n// This module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle.\n\nexport default function normalizeComponent(\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier /* server only */,\n shadowMode /* vue-cli only */\n) {\n // Vue.extend constructor export interop\n var options =\n typeof scriptExports === 'function' ? scriptExports.options : scriptExports\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) {\n // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () {\n injectStyles.call(\n this,\n (options.functional ? this.parent : this).$root.$options.shadowRoot\n )\n }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functional component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection(h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing ? [].concat(existing, hook) : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}\n"],"names":["widgetInitializer","WidgetInitializer","Constants","COMPONENTS","AUTOCOMPLETE_HEADER","initAutocompleteApp","element","_created","config","ConfigUtils","getConfigFor","algoliaClient","algoliasearch","appId","apiKey","searchClient","_objectSpread","search","requests","every","_ref","params","query","indexName","endsWith","Promise","resolve","results","map","hits","nbHits","nbPages","page","processingTimeMS","hitsPerPage","exhaustiveNbHits","queryID","vueApp","Vue","el","id","mixins","algoliaAutocompleteMixin","components","AisInstantSearch","AisHighlight","AisIndex","AisConfigure","AisHits","QueryRuleCustomDataExtended","AutocompleteInstance","AutocompleteSingleIndex","data","initializationReadyHook","GlobalApp","getInitializationReadyHook","middlewares","search_term","default_context","searchPageUrl","methods","computed","ruleContext","this","created","_asyncToGenerator","initializeAutocompleteInsights","apply","arguments","destroyed","$el","registerInitializationHandler","initialize","normalizeComponent","scriptExports","render","staticRenderFns","functionalTemplate","injectStyles","scopeId","moduleIdentifier","shadowMode","hook","options","_compiled","functional","_scopeId","context","$vnode","ssrContext","parent","__VUE_SSR_CONTEXT__","call","_registeredComponents","add","_ssrRegister","$root","$options","shadowRoot","_injectStyles","originalRender","h","existing","beforeCreate","concat","exports"],"sourceRoot":""}