!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("coveo-search-ui")):"function"==typeof define&&define.amd?define(["coveo-search-ui"],t):"object"==typeof exports?exports.CoveoForSitecore=t(require("coveo-search-ui")):e.CoveoForSitecore=t(e.Coveo)}(window,function(e){return function(e){function t(t){for(var n,r,o=t[0],a=t[1],c=0,l=[];c<o.length;c++)r=o[c],i[r]&&l.push(i[r][0]),i[r]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(s&&s(t);l.length;)l.shift()()}var n={},i={1:0};function r(t){if(n[t])return n[t].exports;var i=n[t]={i:t,l:!1,exports:{}};return e[t].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.e=function(e){var t=[],n=i[e];if(0!==n)if(n)t.push(n[2]);else{var o=new Promise(function(t,r){n=i[e]=[t,r]});t.push(n[2]=o);var a,c=document.createElement("script");c.charset="utf-8",c.timeout=120,r.nc&&c.setAttribute("nonce",r.nc),c.src=function(e){return r.p+""+({2:"CoveoForSitecoreAnalytics",3:"CoveoForSitecoreBindWithUserContext",4:"CoveoForSitecoreConfigureSearchHub",5:"CoveoForSitecoreExpressions",6:"CoveoForSitecoreExternalContent",7:"CoveoForSitecoreFilterExpression",8:"CoveoForSitecoreLocalExpression",9:"CoveoForSitecoreRankingExpression",10:"CoveoForSitecoreSyntax",11:"GoogleApiPositionProvider",12:"NavigatorPositionProvider",13:"SendAnalyticsToSitecore",14:"StaticPositionProvider",15:"ValidateAnalyticsIncluded"}[e]||e)+".min.js"}(e),a=function(t){c.onerror=c.onload=null,clearTimeout(s);var n=i[e];if(0!==n){if(n){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src,a=new Error("Loading chunk "+e+" failed.\n("+r+": "+o+")");a.type=r,a.request=o,n[1](a)}i[e]=void 0}};var s=setTimeout(function(){a({type:"timeout",target:c})},12e4);c.onerror=c.onload=a,document.head.appendChild(c)}return Promise.all(t)},r.m=e,r.c=n,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r.oe=function(e){throw console.error(e),e};var o=window.webpackJsonpCoveoForSitecore=window.webpackJsonpCoveoForSitecore||[],a=o.push.bind(o);o.push=t,o=o.slice();for(var c=0;c<o.length;c++)t(o[c]);var s=a;return r(r.s=65)}([function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SitecoreContextEvents=void 0;t.SitecoreContextEvents=function(){function e(){}return e.onSitecoreContextInitialization="onSitecoreContextInitialization",e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Context=void 0;var i=n(31),r=n(6),o=n(0),a=function(){function e(){}return e.configureContext=function(e){if(null==e)throw Error("You must execute `configureContext` with an HTML element.");var t=o.ComponentOptions.initComponentOptions(e,r.CoveoForSitecoreContext);this.initializeWithContextOptions(e,t)},e.initializeWithContextOptions=function(e,t){var n=new i.ContextInitializer,r=n.createFieldsHandler({externalFields:t.scExternalFields,sourceSpecificFields:t.scSourceSpecificFields,preferSourceSpecificFields:t.scPreferSourceSpecificFields,prefix:t.scFieldPrefix,suffix:t.scFieldSuffix}),o=n.createLabelsHandler({labels:t.scLabels}),a=t.scIndexSourceName;n.initializePrebinding({fieldsHandler:r,context:t}),n.initializeUnderscoreFieldsHelpers(r),n.initializeUnderscoreLabelsHelpers(o),n.initializeUnderscoreContextHelpers(a),n.initializeContextElement(e),this.fields=r,this.labels=o,this.element=e},e}();t.Context=a},function(e,t,n){"use strict";function i(e){e.removeAttribute("id");for(var t=e.querySelectorAll("*[id]"),n=t.length,i=0;i<n;i++)t.item(i).removeAttribute("id");return e}Object.defineProperty(t,"__esModule",{value:!0}),t.removeAllIDAttributes=t.cloneElementSafelyForAccessibility=t.nodeListToArray=void 0,t.nodeListToArray=function(e){for(var t=[],n=0,i=e.length;n<i;n++)t.push(e.item(n));return t},t.cloneElementSafelyForAccessibility=function(e){return i(e.cloneNode(!0))},t.removeAllIDAttributes=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Prebinding=void 0;var i=n(35),r=n(36);t.Prebinding=function(){function e(){}return e.registerPrebindHelper=function(e,t){this.processor.registerPrebindHelper(e,t)},e.getHelper=function(e){return this.processor.getHelper(e)},e.applyPrebindingOnElement=function(e){this.processor.canApplyPrebind(e)&&this.processor.hasNotAppliedPrebind(e)&&this.processor.applyToElement(e)},e.applyPreprocessingToElements=function(e){return r.adjustDOMElements(e),e.querySelectorAll("*")},e.applyPrebindingOnChildren=function(e){var t=this,n=this.applyPreprocessingToElements(e);this.nodeListToArray(n).map(function(e){return e}).filter(function(e){return t.processor.canApplyPrebind(e)}).filter(function(e){return t.processor.hasNotAppliedPrebind(e)}).forEach(function(e){return t.processor.applyToElement(e)})},e.nodeListToArray=function(e){for(var t=[],n=0,i=e.length;n<i;n++)t.push(e[n]);return t},e.processor=new i.PrebindResolver,e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SitecoreExpressionEvents=void 0;t.SitecoreExpressionEvents=function(){function e(){}return e.onBuildingSitecoreExternalContent="onBuildingSitecoreExternalContent",e.onBuildingLocalSitecoreInstanceExpression="onBuildingLocalSitecoreInstanceExpression",e}()},function(e,t,n){"use strict";var i,r=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.CoveoForSitecoreContext=void 0;var o=n(0),a=n(1),c=t.CoveoForSitecoreContext=function(e){function t(n,i,r){var a=e.call(this,n,t.ID,r)||this;return a.element=n,a.options=i,a.bindings=r,a.options=o.ComponentOptions.initComponentOptions(n,t,i),a.bind.onRootElement(o.InitializationEvents.afterComponentsInitialization,a.afterComponentsInitialization),a.bind.onRootElement(o.QueryEvents.doneBuildingQuery,a.doneBuildingQuery),a.bind.onRootElement(o.OmniboxEvents.buildingQuerySuggest,a.buildingQuerySuggest),a}return r(t,e),t.prototype.doneBuildingQuery=function(e){this.hasDefaultPipelineNameSet()&&this.queryBuilderUsesDefaultPipeline(e.queryBuilder)&&(e.queryBuilder.pipeline=this.options.scDefaultPipelineName)},t.prototype.buildingQuerySuggest=function(e){this.hasDefaultPipelineNameSet()&&this.querySuggestUsesDefaultPipeline(e.payload)&&(e.payload.pipeline=this.options.scDefaultPipelineName)},t.prototype.hasDefaultPipelineNameSet=function(){return""!==this.options.scDefaultPipelineName},t.prototype.queryBuilderUsesDefaultPipeline=function(e){return void 0===e.pipeline},t.prototype.querySuggestUsesDefaultPipeline=function(e){return void 0===e.pipeline},t.prototype.afterComponentsInitialization=function(){var e={sitecoreItemId:this.options.scItemId,sitecoreItemUri:this.options.scItemUri,sitecorePageName:this.options.scPageName,shouldHaveAnalyticsComponent:this.options.scShouldHaveAnalyticsComponent,analyticsEnabled:this.options.scAnalyticsEnabled,indexSourceName:this.options.scIndexSourceName,currentLanguage:this.options.scCurrentLanguage,languageFieldName:this.options.scLanguageFieldName,latestVersionFieldName:this.options.scLatestVersionFieldName,isInExperienceEditor:this.options.scIsInExperienceEditor,sitecorePageFullPath:this.options.scPageNameFullPath,siteName:this.options.scSiteName,restEndpointUri:this.options.scRestEndpointUri,analyticsEndpointUri:this.options.scAnalyticsEndpointUri};this.bind.trigger(this.element,a.SitecoreContextEvents.onSitecoreContextInitialization,e)},t.ID="ForSitecoreContext",t.options={scItemId:o.ComponentOptions.buildStringOption(),scItemUri:o.ComponentOptions.buildStringOption(),scLanguageFieldName:o.ComponentOptions.buildStringOption(),scLatestVersionFieldName:o.ComponentOptions.buildStringOption(),scCurrentLanguage:o.ComponentOptions.buildStringOption(),scRestEndpointUri:o.ComponentOptions.buildStringOption(),scAnalyticsEndpointUri:o.ComponentOptions.buildStringOption(),scLabels:o.ComponentOptions.buildJsonOption(),scPageName:o.ComponentOptions.buildStringOption(),scDefaultPipelineName:o.ComponentOptions.buildStringOption(),scShouldHaveAnalyticsComponent:o.ComponentOptions.buildBooleanOption(),scAnalyticsEnabled:o.ComponentOptions.buildBooleanOption(),scIsUserAnonymous:o.ComponentOptions.buildBooleanOption(),scFieldPrefix:o.ComponentOptions.buildStringOption(),scFieldSuffix:o.ComponentOptions.buildStringOption(),scExternalFields:o.ComponentOptions.buildJsonOption(),scSourceSpecificFields:o.ComponentOptions.buildJsonOption(),scPreferSourceSpecificFields:o.ComponentOptions.buildBooleanOption(),scIndexSourceName:o.ComponentOptions.buildStringOption(),scIsInExperienceEditor:o.ComponentOptions.buildBooleanOption(),scMaximumAge:o.ComponentOptions.buildNumberOption(),scPageNameFullPath:o.ComponentOptions.buildStringOption(),scSiteName:o.ComponentOptions.buildStringOption()},t}(o.Component);o.Initialization.registerAutoCreateComponent(c)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LegacyFieldTypeResolver=void 0;var i=function(){function e(e){this.externalFields=this.parseExternalFields(e)}return e.prototype.parseExternalFields=function(e){var t=this;return e.map(function(e){return"string"==typeof e?{fieldName:e.toLowerCase(),shouldEscape:!1}:t.isExternalFieldConfig(e)?{fieldName:e.fieldName.toLowerCase(),shouldEscape:e.shouldEscape}:void console.error("Invalid external field '".concat(e,"'."))})},e.prototype.shouldEscapeFirstCharacter=function(e){return!1},e.prototype.shouldEscapeSpecialCharacters=function(e){var t=this.externalFields.filter(function(t){return t.fieldName.toLowerCase()===e.toLowerCase()});return!(t.length>0)||t[0].shouldEscape},e.prototype.shouldDecorate=function(e){return!this.externalFields.some(function(t){return t.fieldName.toLowerCase()===e.toLowerCase()})},e.prototype.isExternalField=function(e){return this.externalFields.some(function(t){return t.fieldName.toLowerCase()===e.toLowerCase()})},e.prototype.isExternalFieldConfig=function(e){return void 0!==e&&void 0!==e.fieldName&&void 0!==e.shouldEscape},e}();t.LegacyFieldTypeResolver=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UseItemIdSelectorAsIs=t.ResolveIfSelector=t.ResolveIfItemIdInPage=t.ItemIdSelectorPrebind=void 0;var i=function(){function e(){this.name="itemIdSelector",this.resolvers=[new o,new r,new a]}return e.prototype.getPrebind=function(e){var t=this;return function(e,n){return t.getFirstValidResolver(e,n).getValue(e,n)}},e.prototype.getFirstValidResolver=function(e,t){var n;do{if(0===this.resolvers.length){var i="Could not resolve the element using the current resolver. Ensure that a valid value is set.";throw console.error(i,{itemId:e,element:t}),i}n=this.resolvers.shift()}while(!n.canResolve(e,t));return n},e}();t.ItemIdSelectorPrebind=i;var r=function(){function e(){}return e.prototype.canResolve=function(e){return this.isItemDefined(e)&&this.isIdSelectorValid("#".concat(e))},e.prototype.getValue=function(e){return"#".concat(e)},e.prototype.isItemDefined=function(e){return!!e},e.prototype.isIdSelectorValid=function(e){return null!==document.querySelector(e)},e}();t.ResolveIfItemIdInPage=r;var o=function(){function e(){}return e.prototype.canResolve=function(e,t){return!!e&&this.isStartingWithSelectorCharacter(e)},e.prototype.getValue=function(e,t){return e},e.prototype.isStartingWithSelectorCharacter=function(e){var t=e[0];return-1!==[".","#"].indexOf(t)},e}();t.ResolveIfSelector=o;var a=function(){function e(){}return e.prototype.canResolve=function(e,t){return!0},e.prototype.getValue=function(e,t){return e},e}();t.UseItemIdSelectorAsIs=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.initHostedSearchPageInitializer=t.initExternalComponentsSectionForExperienceEditor=t.initExternalComponentsSection=t.initContextOnElement=t.initSearchboxIfStandalone=t.initializeSearchInterfaceForExperienceEditor=t.initSearchInterface=t.hostedSearchPageInitializer=t.externalComponentInitializer=t.searchboxInitializer=t.searchInterfaceInitializer=void 0;var i=n(49),r=n(50),o=n(51),a=n(13),c=n(52);function s(e){return t.searchInterfaceInitializer.initSearchInterface(e)}function l(e){t.externalComponentInitializer.initializeExternalComponentSection(e)}t.searchInterfaceInitializer=new o.SearchInterfaceInitializer,t.searchboxInitializer=new r.SearchboxInitializer,t.externalComponentInitializer=new i.ExternalComponentInitializer,t.hostedSearchPageInitializer=new c.HostedSearchPageInitializer,t.initSearchInterface=s,t.initializeSearchInterfaceForExperienceEditor=function(e){return t.searchInterfaceInitializer.initializeExperienceEditorHooksForSearchInterface(e),s(e)},t.initSearchboxIfStandalone=function(e,n,i){return t.searchboxInitializer.initSearchboxIfStandalone(e,n,i)},t.initContextOnElement=function(e){a.ElementWithContextInitializer.initializeContextWithinElement(e)},t.initExternalComponentsSection=l,t.initExternalComponentsSectionForExperienceEditor=function(e){t.externalComponentInitializer.initializeExperienceEditorHooksForExternalComponentsSection(e),l(e)},t.initHostedSearchPageInitializer=function(e){t.hostedSearchPageInitializer.initializeSearchPage(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getInitializerInstance=t.SearchInterfaceComponentInitializer=void 0;var i=n(4),r=n(3),o=n(0),a=function(){function e(){}return e.prototype.loadComponentsForSearchInterface=function(e,t){var n=this;return i.Prebinding.applyPrebindingOnElement(t),i.Prebinding.applyPrebindingOnChildren(t),o.Initialization.automaticallyCreateComponentsInside(t,{bindings:e.getBindings(),options:{}}).initResult.then(function(){n.removeAllPlaceholdersWithinElement(t),e.queryController.executeQuery({ignoreWarningSearchEvent:!0})})},e.prototype.tryUnloadComponentsForSearchInterface=function(e,t){var n=this;(0,r.nodeListToArray)(t.getElementsByClassName("CoveoFacet")).forEach(function(t){var i=(0,o.get)(t,"CoveoFacet");i&&e.detachComponent("Facet",i),n.removeAllChildren(t)}),(0,r.nodeListToArray)(t.getElementsByClassName("CoveoTab")).forEach(function(t){var i=(0,o.get)(t,"CoveoTab");i&&e.detachComponent("Tab",i),n.removeAllChildren(t)})},e.prototype.removeAllPlaceholdersWithinElement=function(e){var t=this;(0,r.nodeListToArray)(e.getElementsByClassName("coveo-during-initialization")).forEach(function(e){return t.removePlaceholders(e)})},e.prototype.removePlaceholders=function(e){e.classList.remove("coveo-during-initialization"),e.classList.contains("CoveoFacet")&&this.removeFacetsPlaceholders(e)},e.prototype.removeFacetsPlaceholders=function(e){e.classList.remove("coveo-with-placeholder"),this.removeAllChildren(e)},e.prototype.removeAllChildren=function(e){for(;e.firstChild;)e.removeChild(e.firstChild)},e.prototype.loadComponentsWithSearchInterfaceInitialization=function(e,t){i.Prebinding.applyPrebindingOnElement(t),i.Prebinding.applyPrebindingOnChildren(t),Coveo.options(e,{externalComponents:[t]})},e}();t.SearchInterfaceComponentInitializer=a;var c=new a;t.getInitializerInstance=function(){return c}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getExperienceEditorInstance=t.SitecoreExperienceEditor=void 0;var i=n(3),r=new(t.SitecoreExperienceEditor=function(){function e(){this.isAfterFrameLoadedOverriden=!1,this.isAfterPersonalizationChangedOverriden=!1,this.isBeforeUnloadingChromeOverriden=!1,this.onAfterFrameLoadedCallbacks=[],this.onAfterPersonalizationChanged=[],this.onBeforeUnloadingChrome=[]}return e.prototype.registerOnLoadRenderingFromUrl=function(e){this.tryOverrideSitecoreLoadRenderingFromUrl(),this.onAfterFrameLoadedCallbacks.push(e)},e.prototype.registerBeforeUnloadingChrome=function(e){this.tryOverrideOnUnloadingChrome(),this.onBeforeUnloadingChrome.push(e)},e.prototype.registerOnAfterPersonalizationChanged=function(e){this.tryOverrideSitecoreChromeTypesRenderingChangeCondition(),this.onAfterPersonalizationChanged.push(e)},e.prototype.isInBackgroundRendering=function(){return-1!==window.location.search.indexOf(e.isInBackgroundRenderingParameterName)},e.prototype.getComponentFromLoadRenderingFromUrlCallbackData=function(e){return document.getElementById(e.opening[0].id).nextElementSibling},e.prototype.tryOverrideSitecoreLoadRenderingFromUrl=function(){this.isAfterFrameLoadedOverriden||"undefined"==typeof Sitecore||this.overrideSitecoreLoadRenderingFromUrl()},e.prototype.overrideSitecoreLoadRenderingFromUrl=function(){var e=this,t=Sitecore.PageModes.ChromeTypes.Placeholder.prototype.insertRendering;Sitecore.PageModes.ChromeTypes.Placeholder.prototype.insertRendering=function(n){var i;t.call(this,n),i=n,e.onAfterFrameLoadedCallbacks.forEach(function(e){return e(i)})},this.isAfterFrameLoadedOverriden=!0},e.prototype.tryOverrideOnUnloadingChrome=function(){this.isBeforeUnloadingChromeOverriden||"undefined"==typeof Sitecore||(this.overrideSitecoreChromeChangeCondition(),this.isBeforeUnloadingChromeOverriden=!0)},e.prototype.overrideSitecoreChromeChangeCondition=function(){var e=this,t=Sitecore.PageModes.ChromeTypes.Rendering.prototype.changeCondition;Sitecore.PageModes.ChromeTypes.Rendering.prototype.changeCondition=function(n,i,r){var o;o=this.chrome.element[0],e.onBeforeUnloadingChrome.forEach(function(e){return e(o)}),t.apply(this,arguments)}},e.prototype.tryOverrideSitecoreChromeTypesRenderingChangeCondition=function(){this.isAfterPersonalizationChangedOverriden||"undefined"==typeof Sitecore||this.overrideSitecoreChromeTypesRenderingChangeCondition()},e.prototype.overrideSitecoreChromeTypesRenderingChangeCondition=function(){var e,t=this,n=Sitecore.PageModes.ChromeTypes.Rendering.prototype._startActivation,i=Sitecore.PageModes.ChromeTypes.Rendering.prototype._endActivation;Sitecore.PageModes.ChromeTypes.Rendering.prototype._startActivation=function(i,r){e=function(e){return t.isDifferentFirstLoadMarker(e)?e[2]:e[1]}(i),n.apply(this,arguments)},Sitecore.PageModes.ChromeTypes.Rendering.prototype._endActivation=function(n){var r;i.apply(this,arguments),e&&(r=e,t.onAfterPersonalizationChanged.forEach(function(e){return e(r)}))},this.isAfterPersonalizationChangedOverriden=!0},e.prototype.isDifferentFirstLoadMarker=function(e){return e[1].nodeType===Node.TEXT_NODE},e.prototype.registerShowDebugInformationCallback=function(){window.scCoveoShowDebugInformation||(window.scCoveoShowDebugInformation=function(e){var t=(0,i.nodeListToArray)(document.getElementsByClassName("coveo-debug-information"));e?t.forEach(function(e){return e.classList.remove("coveo-debug-hidden")}):t.forEach(function(e){return e.classList.add("coveo-debug-hidden")}),Sitecore.PageModes.ChromeManager.resetChromes()})},e.isInBackgroundRenderingParameterName="sc_phk",e}());t.getExperienceEditorInstance=function(){return r}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SearchInterfacesProvider=void 0;var i=n(0),r=n(3),o=function(){function e(){}return e.prototype.getSearchInterfacesInPage=function(e){var t=this.getSearchInterfacesSelectorFromComponentIds(e),n=document.querySelectorAll(t);return(0,r.nodeListToArray)(n)},e.prototype.getSearchInterfacesSelectorFromComponentIds=function(e){return e.map(function(e){return i.Component.computeSelectorForType(e)}).join(", ")},e}();t.SearchInterfacesProvider=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ElementWithContextInitializer=void 0;var i=n(4),r=n(2),o=n(3),a=function(){function e(){}return e.initializeContextWithinElement=function(e){r.Context.element&&e.appendChild((0,o.cloneElementSafelyForAccessibility)(r.Context.element)),i.Prebinding.applyPrebindingOnElement(e),i.Prebinding.applyPrebindingOnChildren(e)},e}();t.ElementWithContextInitializer=a},,,,,,,,,,,,,,,,function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SitecoreExpressionEvents=t.SitecoreContextEvents=void 0;var i=n(1);Object.defineProperty(t,"SitecoreContextEvents",{enumerable:!0,get:function(){return i.SitecoreContextEvents}});var r=n(5);Object.defineProperty(t,"SitecoreExpressionEvents",{enumerable:!0,get:function(){return r.SitecoreExpressionEvents}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SearchEndpoint=t.Prebinding=t.Context=void 0;var i=n(2);Object.defineProperty(t,"Context",{enumerable:!0,get:function(){return i.Context}});var r=n(4);Object.defineProperty(t,"Prebinding",{enumerable:!0,get:function(){return r.Prebinding}});var o=n(48);Object.defineProperty(t,"SearchEndpoint",{enumerable:!0,get:function(){return o.SearchEndpoint}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ContextInitializer=void 0;var i=n(32),r=n(33),o=n(34),a=n(4),c=n(37),s=n(0),l=n(7),u=function(){function e(){}return e.prototype.createFieldsHandler=function(e){var t=e.externalFields||[],n=e.sourceSpecificFields||[],o=e.preferSourceSpecificFields?new l.LegacyFieldTypeResolver(t):new r.SourceSpecificFieldResolver(n,t);return new i.CoveoFieldsHandler(o,e.prefix,e.suffix)},e.prototype.createLabelsHandler=function(e){var t=e.labels||{};return new o.CoveoLabelsHandler(t)},e.prototype.initializePrebinding=function(e){c.PrebindHelpers.getAllPrebindHelpers().forEach(function(t){a.Prebinding.registerPrebindHelper(t.name,t.getPrebind(e))})},e.prototype.initializeUnderscoreFieldsHelpers=function(e){s.TemplateHelpers.registerTemplateHelper("coveoFieldValue",function(t){return this.raw[e.toCoveo(t)]}),s.TemplateHelpers.registerTemplateHelper("coveoFieldName",function(t){return e.toCoveo(t)})},e.prototype.initializeUnderscoreLabelsHelpers=function(e){s.TemplateHelpers.registerTemplateHelper("translateLabel",function(t){return e.translate(t)})},e.prototype.initializeUnderscoreContextHelpers=function(e){s.TemplateHelpers.registerTemplateHelper("currentSourceName",function(){return e})},e.prototype.initializeContextElement=function(e){a.Prebinding.applyPrebindingOnElement(e)},e}();t.ContextInitializer=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CoveoFieldsHandler=void 0;var i=n(7);t.CoveoFieldsHandler=function(){function e(e,t,n){this.prefix=t,this.suffix=n,void 0!==e.shouldDecorate?this.resolver=e:this.resolver=new i.LegacyFieldTypeResolver(e)}return e.prototype.toCoveo=function(t){if(!this.isValidFieldName(t))return console.error("Could not translate the '".concat(t,"' field to a Coveo field. Returning as is.")),t;var n=t.toLowerCase(),i=this.stripCoveoFieldDelimiter(n);e.escapedCharacterRegex.test(i)&&(console.warn("Field name ".concat(t," contains the z\\d{2,3}x pattern. Ensure you avoid using this pattern in field names.")),console.trace());var r=this.translateFieldName(i);return this.startsWithAt(t)?this.addCoveoFieldDelimiter(r):r},e.prototype.addCoveoFieldDelimiter=function(t){var n=t;return this.startsWithAt(t)||(n="".concat(e.coveoFieldDelimiter).concat(t).toLowerCase()),n},e.prototype.isCoveoFieldName=function(e){var t=this.stripCoveoFieldDelimiter(e);return this.resolver.isExternalField(t)||this.isDecorated(t)},e.prototype.isDecorated=function(e){var t=this.prefix+"[\\w]+"+this.suffix;return new RegExp(t).test(e)},e.prototype.isValidFieldName=function(t){return t&&t!==e.coveoFieldDelimiter},e.prototype.startsWithAt=function(t){return t[0]===e.coveoFieldDelimiter},e.prototype.stripCoveoFieldDelimiter=function(e){var t=e;return this.startsWithAt(e)&&(t=t.substr(1)),t},e.prototype.translateFieldName=function(e){var t=e;return this.resolver.shouldEscapeSpecialCharacters(e)&&!this.isFieldAlreadyTranslated(e)&&(t=this.replaceSpecialCharacters(t)),this.resolver.shouldDecorate(e)&&(t=this.prefix+t+this.suffix),this.resolver.shouldEscapeFirstCharacter(t)&&(t=this.replaceFirstCharacter(t)),t},e.prototype.isFieldAlreadyTranslated=function(t){return e.fieldNameRegex.test(t)&&e.escapedCharacterRegex.test(t)},e.prototype.replaceFirstCharacter=function(e){var t=e.split(""),n=t.shift();return t.unshift(this.escapeSpecialCharacter(n)),t.join("")},e.prototype.replaceSpecialCharacters=function(e){return e.split("").map(this.replaceSpecialCharacter.bind(this)).join("")},e.prototype.replaceSpecialCharacter=function(t){return t.match(e.nonSpecialCharacters)?t:this.escapeSpecialCharacter(t)},e.prototype.escapeSpecialCharacter=function(e){return"z".concat(e.charCodeAt(0),"x")},e.nonSpecialCharactersString="[a-wyA-WY0-9]",e.nonSpecialCharacters=new RegExp(e.nonSpecialCharactersString),e.coveoFieldDelimiter="@",e.fieldNameRegex=new RegExp("^[^\\W_]*$"),e.escapedCharacterRegex=new RegExp("z\\d{2,3}x"),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SourceSpecificFieldResolver=void 0;t.SourceSpecificFieldResolver=function(){function e(e,t){this.sourceSpecificFields=e,this.externalFields=t}return e.prototype.shouldEscapeFirstCharacter=function(t){return!t[0].match(e.validFirstCharacters)},e.prototype.shouldEscapeSpecialCharacters=function(e){return!this.externalFields.some(function(t){return t.fieldName.toLowerCase()===e.toLowerCase()})},e.prototype.shouldDecorate=function(e){return this.sourceSpecificFields.some(function(t){return t.fieldName.toLowerCase()===e.toLowerCase()})},e.prototype.isExternalField=function(e){return this.externalFields.some(function(t){return t.fieldName.toLowerCase()===e.toLowerCase()})},e.validFirstCharacters=new RegExp("[a-zA-Z_]"),e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CoveoLabelsHandler=void 0;var i=function(){function e(e){this.labels=e}return e.prototype.translate=function(e){return this.labels[e]||e},e}();t.CoveoLabelsHandler=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PrebindResolver=void 0;t.PrebindResolver=function(){function e(){this.prebindAppliedValue="appliedPrebind",this.helpers={}}return e.prototype.registerPrebindHelper=function(e,t){if("string"!=typeof e||""===e)throw"You must define a name for the prebind helper.";if(null==t)throw"You must define a handler for the prebind helper.";this.helpers.hasOwnProperty(e)?console.warn("A prebind handler already exists for '".concat(e,"'. It will be ignored")):this.helpers[e]=t},e.prototype.hasHelper=function(e){return this.helpers.hasOwnProperty(e)},e.prototype.getHelper=function(e){if(!this.hasHelper(e))throw"'".concat(e,"' has no registered helper.");return this.helpers[e]},e.prototype.canApplyPrebind=function(e){return!!e.dataset},e.prototype.hasNotAppliedPrebind=function(e){return"true"!==e.dataset[this.prebindAppliedValue]},e.prototype.applyToElement=function(e){var t=this;try{var n=this.getPrebindingAttributesForElement(e);n.length>0&&(e.dataset[this.prebindAppliedValue]="true"),n.forEach(function(n){return t.applyPrebindToElement(n,e)})}catch(t){console.warn("(CoveoForSitecore) prebinding failed on element.",e,t)}},e.prototype.getPrebindingAttributesForElement=function(e){var t=this;return this.getAllPrebindingAttributesNames(e).map(function(n){var i=e.dataset[n],r=t.lowerCaseFirstCharacter(t.removePrebindPrefix(n));return{attribute:r,attributeValue:e.dataset[r]||"",method:t.getHelper(i)}})},e.prototype.getAllPrebindingAttributesNames=function(e){var t=this;return Object.keys(e.dataset).filter(function(e){return t.stringStartsWithPrebindingString(e)}).filter(function(n){var i=e.dataset[n];return t.filterAndWarnNonExistingHelperName(i,e)})},e.prototype.stringStartsWithPrebindingString=function(t){return 0===t.lastIndexOf(e.prebindString)},e.prototype.filterAndWarnNonExistingHelperName=function(e,t){var n=this.hasHelper(e);return n||console.warn("(CoveoForSitecore) an unregistered prebinding '".concat(e,"' was set on the element. Register this method using Prebinding.registerPrebindHelper(\"").concat(e,'", handler).'),t),n},e.prototype.removePrebindPrefix=function(t){return t.substring(e.prebindString.length)},e.prototype.lowerCaseFirstCharacter=function(e){return e.charAt(0).toLowerCase()+e.slice(1)},e.prototype.applyPrebindToElement=function(e,t){t.dataset[e.attribute]=e.method(e.attributeValue,t)},e.prebindString="prebind",e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.adjustDOMElements=void 0;var i=n(2),r=function(e){var t=e.cloneNode(!1),n=JSON.parse(t.dataset.sortCriteria);return n.direction="Descending"===n.direction?"Ascending":"Descending",t.dataset.sortCriteria=JSON.stringify(n),t},o=function(e){var t=JSON.parse(e.dataset.sortCriteria);e.dataset.caption="Descending"===t.direction?"".concat(e.dataset.caption," ").concat(i.Context.labels.translate("Descending")):"".concat(e.dataset.caption," ").concat(i.Context.labels.translate("Ascending"))};t.adjustDOMElements=function(e){!function(e){if(e.querySelector(".CoveoSortDropdown"))for(var t=0,n=e.querySelectorAll('.CoveoSort[data-sc-enable-both-sort-directions="true"]');t<n.length;t++){var i=n[t],a=r(i);i.insertAdjacentElement("afterend",a),o(i),o(a)}}(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PrebindHelpers=void 0;var i=n(38),r=n(39),o=n(40),a=n(41),c=n(42),s=n(43),l=n(44),u=n(8),d=n(45),p=n(47),f=function(){function e(){}return e.getAllPrebindHelpers=function(){return[new i.AnalyticsEnabledPrebind,new r.CoveoForSitecoreAnalyticsEndpointPrebind,new o.CurrentMaximumAge,new a.CurrentPageNamePrebind,new c.FieldTranslatorPrebind,new s.IsAnonymousPrebind,new l.MainSearchInterfaceSelectorPrebind,new u.ItemIdSelectorPrebind,new d.SortCriteriaPrebind,new p.UnfoldDictionaryToAttributesPrebind]},e}();t.PrebindHelpers=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AnalyticsEnabledPrebind=void 0;var i=function(){function e(){this.name="analyticsEnabled"}return e.prototype.getPrebind=function(e){return function(t,n){return e.context.scAnalyticsEnabled?"true":"false"}},e}();t.AnalyticsEnabledPrebind=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CoveoForSitecoreAnalyticsEndpointPrebind=void 0;var i=function(){function e(){this.name="coveoForSitecoreAnalyticsEndpoint"}return e.prototype.getPrebind=function(e){return function(t,n){return t||"".concat(e.context.scRestEndpointUri,"/ua")}},e}();t.CoveoForSitecoreAnalyticsEndpointPrebind=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CurrentMaximumAge=void 0;var i=function(){function e(){this.name="currentMaximumAge"}return e.prototype.getPrebind=function(e){return function(t,n){return t||e.context.scMaximumAge.toString()}},e}();t.CurrentMaximumAge=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CurrentPageNamePrebind=void 0;var i=function(){function e(){this.name="currentPageName"}return e.prototype.getPrebind=function(e){return function(t,n){return t||e.context.scPageName}},e}();t.CurrentPageNamePrebind=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FieldTranslatorPrebind=void 0;var i=function(){function e(){this.name="fieldTranslator"}return e.prototype.getPrebind=function(e){return function(t,n){return e.fieldsHandler.toCoveo(t)}},e}();t.FieldTranslatorPrebind=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IsAnonymousPrebind=void 0;var i=function(){function e(){this.name="isAnonymous"}return e.prototype.getPrebind=function(e){return function(t,n){return e.context.scIsUserAnonymous?"true":"false"}},e}();t.IsAnonymousPrebind=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MainSearchInterfaceSelectorPrebind=void 0;var i=n(8),r=n(0),o=function(){function e(){this.name="mainSearchInterfaceSelector",this.resolvers=[new i.ResolveIfSelector,new i.ResolveIfItemIdInPage,new a,new i.UseItemIdSelectorAsIs]}return e.prototype.getPrebind=function(e){var t=this;return function(e,n){return t.getFirstValidResolver(e,n).getValue(e,n)}},e.prototype.getFirstValidResolver=function(e,t){var n;do{if(0===this.resolvers.length){var i="Could not resolve the search interface element using the current resolver. Ensure that a valid value is set.";throw console.error(i,{mainSearchInterfaceId:e,element:t}),i}n=this.resolvers.shift()}while(!n.canResolve(e,t));return n},e}();t.MainSearchInterfaceSelectorPrebind=o;var a=function(){function e(){}return e.prototype.canResolve=function(e,t){return null!==this.getValue(e,t)},e.prototype.getValue=function(e,t){return void 0===this.foundId&&(this.foundId=this.tryFindParentSearchInterfaceFromElement(t)),this.foundId},e.prototype.tryFindParentSearchInterfaceFromElement=function(e){var t=this.findParentWithClass(e,"Coveo".concat(r.SearchInterface.ID));return t?"#".concat(t.id):null},e.prototype.findParentWithClass=function(e,t){for(var n=e.parentElement;(n=n.parentElement)&&!n.classList.contains(t););return n},e}()},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SortCriteriaPrebind=void 0;var i=n(46),r=function(){function e(){this.name="sortCriteriaResolver"}return e.prototype.getPrebind=function(e){var t=new i.SortCriteriaResolver(e.fieldsHandler);return function(e,n){var i=JSON.parse(e);if(0===Object.keys(i).length)return null;var r=(i.type||"relevancy").toLowerCase(),o=(i.direction||"ascending").toLowerCase(),a="true"===(n.dataset.scEnableBothSortDirections||"false").toLowerCase(),c=document.querySelector(".coveo-sort-section .CoveoSortDropdown"),s=document.body.contains(c);if("relevancy"===r)return t.resolveRelevancyCriteria();if("date"===r)return t.resolveDateCriteria(o,a,s);var l=i.field;return t.resolveFieldCriteria(l,o,a,s)}},e}();t.SortCriteriaPrebind=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SortCriteriaResolver=void 0;var i=function(){function e(e){this.fieldsHandler=e}return e.prototype.resolveFieldCriteria=function(e,t,n,i){var r="@"!==e.charAt(0)?"@".concat(e):e;return this.getFieldCriteria(this.fieldsHandler.toCoveo(r),t,n,i)},e.prototype.resolveDateCriteria=function(e,t,n){return this.getFieldCriteria("date",e,t,n)},e.prototype.resolveRelevancyCriteria=function(){return"relevancy"},e.prototype.getFieldCriteria=function(e,t,n,i){return n&&!i?"".concat(this.getFieldWithDirection(e,t),", ").concat(this.getFieldWithDirection(e,this.getInvertedDirection(t))):this.getFieldWithDirection(e,t)},e.prototype.getFieldWithDirection=function(e,t){return"".concat(e," ").concat(t)},e.prototype.getInvertedDirection=function(e){return"descending"===e?"ascending":"descending"},e}();t.SortCriteriaResolver=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnfoldDictionaryToAttributesPrebind=void 0;var i=function(){function e(){this.name="unfoldDictionaryToAttributesPrebind"}return e.prototype.getPrebind=function(e){return function(t,n){var i=JSON.parse(t);return Object.keys(i).forEach(function(t){var r=e.fieldsHandler.toCoveo(t),o="field"+r.charAt(0).toUpperCase()+r.slice(1);n.dataset[o]=i[t]}),t}},e}();t.UnfoldDictionaryToAttributesPrebind=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SearchEndpoint=void 0;var i=n(0),r=function(){function e(){}return e.configureSitecoreEndpoint=function(t){if(void 0===t)throw Error("You must define endpoint options when calling 'configureSitecoreEndpoint'.");e.getAccessToken().then(function(n){e.initializeEndPoint(t,n),e.dispatchInitializationEvent()})},e.initializeEndPoint=function(t,n){var r=e.createNewEndpoint(t,n);i.SearchEndpoint.endpoints.default=r},e.dispatchInitializationEvent=function(){var e=document.createEvent("CustomEvent");e.initEvent("CoveoSearchEndpointInitialized",!1,!0),"loading"!==document.readyState?document.dispatchEvent(e):document.addEventListener("DOMContentLoaded",function(){document.dispatchEvent(e)})},e.getAccessToken=function(){return e.fetchAccessToken().then(function(e){if(e.ok)return e.json()}).then(function(e){return e.token}).catch(function(){return""})},e.fetchAccessToken=function(){return fetch("/coveo/rest/token?t=".concat(Date.now()))},e.createNewEndpoint=function(t,n){return new i.SearchEndpoint({restUri:t.restEndpointUri?"".concat(t.restEndpointUri,"/search"):"/coveo/rest/search",queryStringArguments:{sitecoreItemUri:t.itemUri,siteName:t.siteName},accessToken:n,renewAccessToken:e.getAccessToken})},e}();t.SearchEndpoint=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExternalComponentInitializer=void 0;var i=n(10),r=n(11),o=n(12),a=n(0),c=function(){function e(e,t){void 0===e&&(e=(0,r.getExperienceEditorInstance)()),void 0===t&&(t=(0,i.getInitializerInstance)()),this.experienceEditor=e,this.searchInterfaceComponentInitializer=t,this.searchInterfacesProvider=new o.SearchInterfacesProvider}return e.prototype.initializeExternalComponentSection=function(e){var t=this.findSearchInterfaceForSection(e);if(t)this.searchInterfaceComponentInitializer.loadComponentsWithSearchInterfaceInitialization(t,e);else{var n=this.getAllSearchInterfaceIdsInPage();n.length>0&&console.error("Could not find the search interface element with the following ID: ".concat(this.getSearchInterfaceId(e),". The following IDs were found: ").concat(n.join(","),"."),e)}},e.prototype.initializeExperienceEditorHooksForExternalComponentsSection=function(e){var t=this,n=this.findSearchInterfaceForSection(e);n&&this.experienceEditor.registerOnLoadRenderingFromUrl(function(i){var r=t.experienceEditor.getComponentFromLoadRenderingFromUrlCallbackData(i);e.contains(r)&&t.searchInterfaceComponentInitializer.loadComponentsForSearchInterface((0,a.get)(n,a.SearchInterface),r)})},e.prototype.findSearchInterfaceForSection=function(e){var t=this.getSearchInterfaceId(e),n=document.getElementById(t);if(n)return n},e.prototype.getSearchInterfaceId=function(e){return e.dataset.searchInterfaceId},e.prototype.getAllSearchInterfaceIdsInPage=function(){return this.searchInterfacesProvider.getSearchInterfacesInPage(["SearchInterface"]).map(function(e){return e.id}).filter(function(e){return!!e})},e}();t.ExternalComponentInitializer=c},function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{s(i.next(e))}catch(e){o(e)}}function c(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,c)}s((i=i.apply(e,t||[])).next())})},r=this&&this.__generator||function(e,t){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(c){return function(s){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&c[0]?i.return:c[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,c[1])).done)return r;switch(i=0,r&&(c=[2&c[0],r.value]),c[0]){case 0:case 1:r=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,i=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!r||c[1]>r[0]&&c[1]<r[3])){a.label=c[1];break}if(6===c[0]&&a.label<r[1]){a.label=r[1],r=c;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(c);break}r[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],i=0}finally{n=r=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.SearchboxInitializer=void 0;var o=n(12),a=n(13),c=n(0),s=function(){function e(){this.searchInterfacesProvider=new o.SearchInterfacesProvider}return e.prototype.initSearchboxIfStandalone=function(e,t,n){return i(this,void 0,void 0,function(){var i;return r(this,function(r){switch(r.label){case 0:return i=this.searchInterfacesProvider.getSearchInterfacesInPage(["Recommendation","SearchInterface"]),[4,this.waitForSearchInterfacesInitialization(i)];case 1:return r.sent(),this.searchboxElementIsNotInitialized(e)&&(t?(a.ElementWithContextInitializer.initializeContextWithinElement(e.parentElement),(0,c.initSearchbox)(e.parentElement,t,n)):console.warn('The search box is not included in any search interface and the "searchPageUri" parameters is not specified. Consider using a Global Searchbox instead.',e)),[2]}})})},e.prototype.searchboxElementIsNotInitialized=function(e){return void 0===(0,c.get)(e,Coveo.Searchbox)},e.prototype.waitForSearchInterfacesInitialization=function(e){return i(this,void 0,void 0,function(){return r(this,function(t){switch(t.label){case 0:return[4,Promise.all(this.getAllSearchInterfacesAfterComponentInitialization(e))];case 1:return t.sent(),[2]}})})},e.prototype.getAllSearchInterfacesAfterComponentInitialization=function(e){var t=this;return e.map(function(e){return(0,c.$$)(e)}).map(function(e){return t.waitForSearchInterfaceInitialization(e)})},e.prototype.waitForSearchInterfaceInitialization=function(e){return new Promise(function(t,n){if(e.hasClass("coveo-after-initialization"))return t();e.on(c.InitializationEvents.afterComponentsInitialization,function(){return t()})})},e}();t.SearchboxInitializer=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SearchInterfaceInitializer=void 0;var i=n(9),r=n(10),o=n(11),a=n(0),c=function(){function e(e,t){void 0===e&&(e=(0,o.getExperienceEditorInstance)()),void 0===t&&(t=(0,r.getInitializerInstance)()),this.experienceEditor=e,this.searchInterfaceComponentInitializer=t}return e.prototype.initSearchInterface=function(e){if(!this.experienceEditor.isInBackgroundRendering()){this.experienceEditor.registerShowDebugInformationCallback(),(0,i.initContextOnElement)(e);var t=(0,a.init)(e);return t.then(function(){var t=document.createEvent("CustomEvent");t.initEvent("SearchInterfaceInitialized",!1,!0),e.dispatchEvent(t)}),t}},e.prototype.initializeExperienceEditorHooksForSearchInterface=function(e){var t=this;this.experienceEditor.registerOnLoadRenderingFromUrl(function(n){var i=t.experienceEditor.getComponentFromLoadRenderingFromUrlCallbackData(n);if(e.contains(i)){var r=Coveo.get(e,Coveo.SearchInterface);t.searchInterfaceComponentInitializer.loadComponentsForSearchInterface(r,i)}}),this.experienceEditor.registerOnAfterPersonalizationChanged(function(n){if(e.contains(n)){var i=Coveo.get(e,Coveo.SearchInterface);t.searchInterfaceComponentInitializer.loadComponentsForSearchInterface(i,n)}}),this.experienceEditor.registerBeforeUnloadingChrome(function(n){if(e.contains(n)){var i=Coveo.get(e,Coveo.SearchInterface);t.searchInterfaceComponentInitializer.tryUnloadComponentsForSearchInterface(i,n)}})},e}();t.SearchInterfaceInitializer=c},function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function a(e){try{s(i.next(e))}catch(e){o(e)}}function c(e){try{s(i.throw(e))}catch(e){o(e)}}function s(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,c)}s((i=i.apply(e,t||[])).next())})},r=this&&this.__generator||function(e,t){var n,i,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(c){return function(s){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(a=0)),a;)try{if(n=1,i&&(r=2&c[0]?i.return:c[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,c[1])).done)return r;switch(i=0,r&&(c=[2&c[0],r.value]),c[0]){case 0:case 1:r=c;break;case 4:return a.label++,{value:c[1],done:!1};case 5:a.label++,i=c[1],c=[0];continue;case 7:c=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===c[0]||2===c[0])){a=0;continue}if(3===c[0]&&(!r||c[1]>r[0]&&c[1]<r[3])){a.label=c[1];break}if(6===c[0]&&a.label<r[1]){a.label=r[1],r=c;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(c);break}r[2]&&a.ops.pop(),a.trys.pop();continue}c=t.call(e,a)}catch(e){c=[6,e],i=0}finally{n=r=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,s])}}};Object.defineProperty(t,"__esModule",{value:!0}),t.HostedSearchPageInitializer=void 0;var o=function(){function e(){this.UNABLE_TO_RETRIEVE_ACCESS_TOKEN="Unable to retrieve access token."}return e.prototype.initializeSearchPage=function(e){var t=this;this.searchPageElement=e,this.searchEndpointUri=e.dataset.searchEndpointUri,this.analyticsEndpointUri=e.dataset.analyticsEndpointUri,this.organizationId=e.dataset.organizationId,this.searchHub=e.dataset.searchHub,this.isInExperienceEditor="true"===e.dataset.isInExperienceEditor,this.getAccessToken=this.getAccessToken.bind(this),this.getAccessToken().then(function(n){t.initializeCoveo(e,n)}).catch(function(e){t.isInExperienceEditor&&t.displayErrorMessageInExperienceEditor(e.message)})},e.prototype.getAccessToken=function(){return i(this,void 0,void 0,function(){var e=this;return r(this,function(t){return[2,this.fetchAccessToken().then(function(t){if(t.ok)return t.json();throw Error(e.UNABLE_TO_RETRIEVE_ACCESS_TOKEN)}).then(function(e){return e.token}).catch(function(t){return e.isInExperienceEditor&&e.displayErrorMessageInExperienceEditor(t.message),""})]})})},e.prototype.initializeCoveo=function(e,t){var n=e.querySelector(".CoveoSearchInterface");n&&"undefined"!=typeof Coveo&&(Coveo.SearchEndpoint.endpoints.default=new Coveo.SearchEndpoint({restUri:"".concat(this.searchEndpointUri,"/rest/search/"),accessToken:t,queryStringArguments:{organizationId:this.organizationId},renewAccessToken:this.getAccessToken}),Coveo.Analytics.options.searchHub.defaultValue=this.searchHub,Coveo.Analytics.options.organization.defaultValue=this.organizationId,Coveo.Analytics.options.endpoint.defaultValue="".concat(this.analyticsEndpointUri,"/rest/ua/"),Coveo.init(n))},e.prototype.fetchAccessToken=function(){return i(this,void 0,void 0,function(){return r(this,function(e){switch(e.label){case 0:return[4,fetch("/coveo/rest/token?t=".concat(Date.now()))];case 1:return[2,e.sent()]}})})},e.prototype.displayErrorMessageInExperienceEditor=function(e){var t="\n            <span class='errorMessage'>".concat(e,"</span>\n        ");this.searchPageElement.insertAdjacentHTML("afterbegin",t)},e}();t.HostedSearchPageInitializer=o},,,,,,,,,,,,,function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&("get"in r?t.__esModule:!r.writable&&!r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}:function(e,t,n,i){void 0===i&&(i=n),e[i]=t[n]}),r=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||i(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.CoveoForSitecoreContext=void 0;var o=n(66);n.p=o.SitecorePublicPathUtils.getDynamicPublicPath();var a=n(6);Object.defineProperty(t,"CoveoForSitecoreContext",{enumerable:!0,get:function(){return a.CoveoForSitecoreContext}}),(0,n(67).lazyCoveoForSitecoreAnalytics)(),(0,n(68).lazyCoveoForSitecoreConfigureSearchHub)(),(0,n(69).lazyCoveoSendAnalyticsToSitecore)(),(0,n(70).lazyValidateAnalyticsIncluded)(),(0,n(71).lazyCoveoForSitecoreBindWithUserContext)(),(0,n(72).lazyCoveoForSitecoreExpressions)(),(0,n(73).lazyCoveoForSitecoreSyntax)(),(0,n(74).lazyCoveoForSitecoreRankingExpression)(),(0,n(75).lazyCoveoForSitecoreExternalContent)(),(0,n(76).lazyCoveoForSitecoreFilterExpression)(),(0,n(77).lazyCoveoForSitecoreLocalExpression)(),(0,n(78).lazyCoveoGoogleApiPositionProvider)(),(0,n(79).lazyCoveoNavigatorPositionProvider)(),(0,n(80).lazyCoveoStaticPositionProvider)(),r(n(29),t),r(n(30),t),r(n(9),t)},function(e,t,n){"use strict";var i,r=this&&this.__extends||(i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0}),t.SitecorePublicPathUtils=void 0;var o=n(0),a=n(3),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return r(t,e),t.getCoveoScript=function(){var e=this,t=(0,a.nodeListToArray)(document.querySelectorAll(".coveo-for-sitecore-script")).filter(function(t){return e.isScript(t)});return 0!==t.length?t[0]:(new o.Logger(this).warn("You should add the class coveo-for-sitecore-script on the script tag that includes the Coveo for Sitecore script. Not doing so may cause the framework to not be able to auto-detect the path to load the lazy chunks in certain environments.\n                More details here https://docs.coveo.com/en/295/javascript-search-framework/lazy-versus-eager-component-loading#fixing-code-chunks-loading-path-issues"),this.getCurrentScript())},t.isScript=function(e){return e&&(0,o.$$)(e).is("script")},t}(o.PublicPathUtils);t.SitecorePublicPathUtils=c},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lazyCoveoForSitecoreAnalytics=void 0;var i=n(0);t.lazyCoveoForSitecoreAnalytics=function(){i.LazyInitialization.registerLazyComponent("ForSitecoreAnalytics",function(){return new Promise(function(e,t){n.e(2).then(function(){var t=n(15).CoveoForSitecoreAnalytics;e(t)}.bind(null,n)).catch(i.LazyInitialization.buildErrorCallback("CoveoForSitecoreAnalytics",e))})})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lazyCoveoForSitecoreConfigureSearchHub=void 0;var i=n(0);t.lazyCoveoForSitecoreConfigureSearchHub=function(){i.LazyInitialization.registerLazyComponent("ForSitecoreConfigureSearchHub",function(){return new Promise(function(e,t){n.e(4).then(function(){var t=n(16).CoveoForSitecoreConfigureSearchHub;e(t)}.bind(null,n)).catch(i.LazyInitialization.buildErrorCallback("CoveoForSitecoreConfigureSearchHub",e))})})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lazyCoveoSendAnalyticsToSitecore=void 0;var i=n(0);t.lazyCoveoSendAnalyticsToSitecore=function(){i.LazyInitialization.registerLazyComponent("SendAnalyticsToSitecore",function(){return new Promise(function(e,t){n.e(13).then(function(){var t=n(17).SendAnalyticsToSitecore;e(t)}.bind(null,n)).catch(i.LazyInitialization.buildErrorCallback("SendAnalyticsToSitecore",e))})})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lazyValidateAnalyticsIncluded=void 0;var i=n(0);t.lazyValidateAnalyticsIncluded=function(){i.LazyInitialization.registerLazyComponent("ValidateAnalyticsIncluded",function(){return new Promise(function(e,t){n.e(15).then(function(){var t=n(18).ValidateAnalyticsIncluded;e(t)}.bind(null,n)).catch(i.LazyInitialization.buildErrorCallback("ValidateAnalyticsIncluded",e))})})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lazyCoveoForSitecoreBindWithUserContext=void 0;var i=n(0);t.lazyCoveoForSitecoreBindWithUserContext=function(){i.LazyInitialization.registerLazyComponent("ForSitecoreBindWithUserContext",function(){return new Promise(function(e,t){n.e(3).then(function(){var t=n(19).CoveoForSitecoreBindWithUserContext;e(t)}.bind(null,n)).catch(i.LazyInitialization.buildErrorCallback("CoveoForSitecoreBindWithUserContext",e))})})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lazyCoveoForSitecoreExpressions=void 0;var i=n(0);t.lazyCoveoForSitecoreExpressions=function(){i.LazyInitialization.registerLazyComponent("ForSitecoreExpressions",function(){return new Promise(function(e,t){n.e(5).then(function(){var t=n(20).CoveoForSitecoreExpressions;e(t)}.bind(null,n)).catch(i.LazyInitialization.buildErrorCallback("CoveoForSitecoreExpressions",e))})})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lazyCoveoForSitecoreSyntax=void 0;var i=n(0);t.lazyCoveoForSitecoreSyntax=function(){i.LazyInitialization.registerLazyComponent("ForSitecoreSyntax",function(){return new Promise(function(e,t){n.e(10).then(function(){var t=n(21).CoveoForSitecoreSyntax;e(t)}.bind(null,n)).catch(i.LazyInitialization.buildErrorCallback("CoveoForSitecoreSyntax",e))})})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lazyCoveoForSitecoreRankingExpression=void 0;var i=n(0);t.lazyCoveoForSitecoreRankingExpression=function(){i.LazyInitialization.registerLazyComponent("ForSitecoreRankingExpression",function(){return new Promise(function(e,t){n.e(9).then(function(){var t=n(22).CoveoForSitecoreRankingExpression;e(t)}.bind(null,n)).catch(i.LazyInitialization.buildErrorCallback("CoveoForSitecoreRankingExpression",e))})})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lazyCoveoForSitecoreExternalContent=void 0;var i=n(0);t.lazyCoveoForSitecoreExternalContent=function(){i.LazyInitialization.registerLazyComponent("ForSitecoreExternalContent",function(){return new Promise(function(e,t){n.e(6).then(function(){var t=n(23).CoveoForSitecoreExternalContent;e(t)}.bind(null,n)).catch(i.LazyInitialization.buildErrorCallback("CoveoForSitecoreExternalContent",e))})})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lazyCoveoForSitecoreFilterExpression=void 0;var i=n(0);t.lazyCoveoForSitecoreFilterExpression=function(){i.LazyInitialization.registerLazyComponent("ForSitecoreFilterExpression",function(){return new Promise(function(e,t){n.e(7).then(function(){var t=n(24).CoveoForSitecoreFilterExpression;e(t)}.bind(null,n)).catch(i.LazyInitialization.buildErrorCallback("CoveoForSitecoreFilterExpression",e))})})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lazyCoveoForSitecoreLocalExpression=void 0;var i=n(0);t.lazyCoveoForSitecoreLocalExpression=function(){i.LazyInitialization.registerLazyComponent("ForSitecoreLocalExpression",function(){return new Promise(function(e,t){n.e(8).then(function(){var t=n(25).CoveoForSitecoreLocalExpression;e(t)}.bind(null,n)).catch(i.LazyInitialization.buildErrorCallback("CoveoForSitecoreLocalExpression",e))})})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lazyCoveoGoogleApiPositionProvider=void 0;var i=n(0);t.lazyCoveoGoogleApiPositionProvider=function(){i.LazyInitialization.registerLazyComponent("GoogleApiPositionProvider",function(){return new Promise(function(e,t){n.e(11).then(function(){var t=n(26).GoogleApiPositionProvider;e(t)}.bind(null,n)).catch(i.LazyInitialization.buildErrorCallback("GoogleApiPositionProvider",e))})})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lazyCoveoNavigatorPositionProvider=void 0;var i=n(0);t.lazyCoveoNavigatorPositionProvider=function(){i.LazyInitialization.registerLazyComponent("NavigatorPositionProvider",function(){return new Promise(function(e,t){n.e(12).then(function(){var t=n(27).NavigatorPositionProvider;e(t)}.bind(null,n)).catch(i.LazyInitialization.buildErrorCallback("NavigatorPositionProvider",e))})})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lazyCoveoStaticPositionProvider=void 0;var i=n(0);t.lazyCoveoStaticPositionProvider=function(){i.LazyInitialization.registerLazyComponent("StaticPositionProvider",function(){return new Promise(function(e,t){n.e(14).then(function(){var t=n(28).StaticPositionProvider;e(t)}.bind(null,n)).catch(i.LazyInitialization.buildErrorCallback("StaticPositionProvider",e))})})}}])});
//# sourceMappingURL=CoveoForSitecore.Lazy.min.js.map