1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[5229],{3484:function(e,t,i){i.r(t),i.d(t,{default:function(){return u}});var n=i(319),s=i.n(n),o=i(4575),r=i.n(o),l=i(3913),a=i.n(l),c=i(9713),h=i.n(c),d=i(1548),u=function(){function e(t){var i=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=n.contentAreaSelector,o=void 0===s?"[data-eb-content]":s,l=n.interestOptionsSelector,a=void 0===l?"[data-eb-interest]":l,c=n.scenarioOptionsSelector,u=void 0===c?"[data-eb-scenario]":c,v=n.prevSelector,p=void 0===v?"[data-eb-prev]":v,g=n.nextSelector,S=void 0===g?"[data-eb-next]":g,E=n.innerSelector,b=void 0===E?"[data-eb-inner]":E,m=n.closeSelector,f=void 0===m?"[data-eb-close]":m,L=n.recommendationsContainerSelector,y=void 0===L?"[data-eb-recommendations]":L,A=n.panelAttribute,x=void 0===A?"data-eb-step":A,k=n.buttonAttribute,C=void 0===k?"data-eb-go":k,q=n.panelBgClassesAttribute,I=void 0===q?"data-eb-inner-classes":q,O=n.apiRecommendUrl,T=void 0===O?"/ajax/experience-builder-api/":O,U=n.htmlUrl,w=void 0===U?"/ajax/experience-builder
1-ui/":U,_=n.localStorageKey,M=void 0===_?"ExperienceBuilder":_;r()(this,e),h()(this,"debugEnabled",!1),h()(this,"uiAlreadyRequested",!1),h()(this,"lastSearchParams",void 0),h()(this,"currentLevel",0),h()(this,"highestLevel",0),h()(this,"totalLevels",3),h()(this,"hasSelectedScenario",!1),h()(this,"hasSelectedInterests",!1),h()(this,"mainEl",void 0),h()(this,"backgroundEl",void 0),h()(this,"scrollerEl",void 0),h()(this,"contentEl",void 0),h()(this,"innerEl",void 0),h()(this,"recommendationsContainerEl",void 0),h()(this,"panelEls",void 0),h()(this,"buttonEls",void 0),h()(this,"prevEl",void 0),h()(this,"nextEl",void 0),h()(this,"modalInstance",void 0),h()(this,"recommendationsContainerSelector",void 0),h()(this,"interestOptionsSelector",void 0),h()(this,"scenarioOptionsSelector",void 0),h()(this,"prevSelector",void 0),h()(this,"nextSelector",void 0),h()(this,"innerSelector",void 0),h()(this,"closeSelector",void 0),h()(this,"panelAttribute",void 0),h()(this,"buttonAttribute",void 0),h()(this,"panelBgClassesAttribute",void 0),h()(this,"apiRecommendUrl",void 0),h()(this,"htmlUrl",void 0),h()(this,"localStorageKey",void 0),h()(this,"isLoadingClass","is-loading"),h()(this,"innerDefaultClass",void 0),h()(this,"debug",(function(e){i.debugEnabled&&console.log("experience builder debug",e)})),this.mainEl=t,this.contentEl=this.mainEl.querySelector(o),this.panelAttribute=x,this.buttonAttribute=C,this.panelBgClassesAttribute=I,this.interestOptionsSelector=a,this.scenarioOptionsSelector=u,this.prevSelector=p,this.nextSelector=S,this.innerSelector=b,this.closeSelector=f,this.recommendationsContainerSelector=y,this.apiRecommendUrl=T,this.htmlUrl=w,this.localStorageKey=M,this.modalInstance=new d.Z({el:t,name:"experience-builder",onOpen:function(){i.open()}})}return a()(e,[{key:"open",value:function(){this.loadUi()}},{key:"loadUi",value:function(){var e=this;this.uiAlreadyRequested||(this.uiAlreadyRequested=!0,this.contentEl.classList.add(this.isLoadingClass),this.contentEl.innerHTML=this.wrapMessage('<p class="experience-builder__message text--content">Loading the experience builder…</p>'),fetch(this.htmlUrl).then((function(e){return e.text()})).then((function(t){e.contentEl.innerHTML=t,e.setUpUi()})).catch((function(t){console.error(t),e.contentEl.innerHTML=e.wrapMessage('<p class="experience-builder__message text--content">Sorry, there was a problem loading the experience builder.</p>')})).then((function(){e.contentEl.classList.remove(e.isLoadingClass)})))}},{key:"setUpUi",value:function(){var e,t,i=this;this.panelEls=this.mainEl.querySelectorAll("[".concat(this.panelAttribute,"]")),this.panelEls.forEach((function(e){e.hidden=!1})),this.totalLevels=null===(e=this.panelEls)||void 0===e?void 0:e.length,this.innerEl=this.mainEl.querySelector(this.innerSelector),this.innerDefaultClass=(null===(t=this.innerEl)||void 0===t?void 0:t.getAttribute("class"))||"",this.recommendationsContainerEl=this.mainEl.querySelector(this.recommendationsContainerSelector),this.backgroundEl=this.mainEl.querySelector(".experience-builder__bg"),this.scrollerEl=this.mainEl.querySelector(".experience-builder__wrapper"),this.contentEl.querySelectorAll(this.scenarioOptionsSelector).forEach((function(e){e.addEventListener("change",(function(){i.updateButtonStates(i.totalLevels-3)}))})),this.contentEl.querySelectorAll(this.interestOptionsSelector).forEach((function(e){e.addEventListener("change",(function(){i.updateButtonStates(i.totalLevels-2)}))})),this.buttonEls=this.contentEl.querySelectorAll("[".concat(this.buttonAttribute,"]")),this.buttonEls.forEach((function(e){e.addEventListener("click",(function(){var t=parseInt(e.getAttribute(i.buttonAttribute));i.goToStep(t)}))})),this.prevEl=this.contentEl.querySelector(this.prevSelector),this.nextEl=this.contentEl.querySelector(this.nextSelector),this.prevEl&&this.nextEl&&(this.prevEl.addEventListener("click",(function(){console.log("prevEl clicked");var e=i.currentLevel-1>=0?i.currentLevel-1:0;i.goToStep(e)})),this.nextEl.addEventListener("click",(function(){console.log("nextEl clicked");var e=i.currentLevel+1<=i.highestLevel?i.currentLevel+1:i.highestLevel;i.goToStep(e)}))),this.contentEl.querySelectorAll(this.closeSelector).forEach((function(e){e.addEventListener("click",(function(){i.modalInstance.close()}))})),this.init()}},{key:"updateButtonStates",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;void 0===e&&(e=this.totalLevels-1),this.hasSelectedScenario=this.getScenarios().length>0,this.hasSelectedInterests=this.getInterests().length>0;var t=this.totalLevels-1,i=this.totalLevels-2,n=this.totalLevels-3,s=0;this.hasSelectedScenario?this.hasSelectedInterests?e===t&&this.highestLevel<=t&&this.getInterests().length>i?this.goToStep(t):(this.highestLevel=t,this.goToStep(i)):(this.highestLevel=i,this.goToStep(i)):(this.highestLevel=n,this.currentLevel>=s&&this.goToStep(s))}},{key:"goToStep",value:function(e){var t=this;
1this.save(),this.panelEls.forEach((function(e){e.inert=!0,e.setAttribute("aria-hidden","true")}));var i=this.contentEl.querySelector("[".concat(this.panelAttribute,'="').concat(e,'"]'));i.inert=!1,i.setAttribute("aria-hidden","false");var n,o=i.getAttribute(this.panelBgClassesAttribute);(e>this.highestLevel&&(this.highestLevel=e),e>=this.totalLevels-1&&this.getRecommendations(),this.currentLevel=e,this.mainEl.setAttribute("data-eb-current",String(this.currentLevel)),this.buttonEls.forEach((function(i){var n=parseInt(i.getAttribute(t.buttonAttribute));i.disabled=n>t.highestLevel,i.hasAttribute("role")&&"tab"===i.getAttribute("role")&&(i.setAttribute("aria-selected",n===e?"true":"false"),i.setAttribute("tab-index",n===e?"0":"-1"))})),this.prevEl&&(this.prevEl.disabled=0===this.currentLevel),this.nextEl&&(this.nextEl.disabled=this.currentLevel+1>this.highestLevel),this.innerEl.setAttribute("class",this.innerDefaultClass),o)&&(n=this.innerEl.classList).add.apply(n,s()(o.split(" ")))}},{key:"getRecommendations",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"<p>Loading your custom recommendations.</p>";this.debug("refresh recommendations called");var i=this.getInterests(),n=this.getScenarios(),s={interest:i.join(", "),scenario:n.join(", "),city:"",startDate:"",endDate:""},o=JSON.stringify(s);o!==this.lastSearchParams&&(this.lastSearchParams=o,this.recommendationsContainerEl.innerHTML=this.wrapMessage(t),this.recommendationsContainerEl.classList.add(this.isLoadingClass),fetch(this.apiRecommendUrl+"?"+new URLSearchParams(s)).then((function(e){return e.text()})).then((function(t){e.recommendationsContainerEl.innerHTML=t,e.recommendationsContainerEl.querySelectorAll("[data-aos]").forEach((function(e){e.removeAttribute("data-aos")}))})).catch((function(t){console.error(t),e.recommendationsContainerEl.innerHTML=e.wrapMessage("<p>Sorry, there was a problem loading your recommendations.</p>")})).then((function(){e.recommendationsContainerEl.classList.remove(e.isLoadingClass)})))}},{key:"getInterests",value:function(){var e=[],t=this.contentEl.querySelectorAll(this.interestOptionsSelector+":checked");return t.length&&t.forEach((function(t){e.push(t.value)})),e}},{key:"getScenarios",value:function(){var e=[],t=this.contentEl.querySelectorAll(this.scenarioOptionsSelector+":checked");return t.length&&t.forEach((function(t){e.push(t.value)})),e}},{key:"save",value:function(){var e={updated:Date.now(),interests:this.getInterests(),scenarios:this.getScenarios(),city:"",startDate:"",endDate:""};this.debug("saving"),this.debug(e),localStorage.setItem(this.localStorageKey,JSON.stringify(e))}},{key:"restore",value:function(e){var t=this;this.debug("restoring"),this.debug(e);var i=!1;void 0!==e.interests&&e.interests.length&&e.interests.forEach((function(e){var n=t.contentEl.querySelector(t.interestOptionsSelector+'[value="'+e+'"]');n&&(i=!0,n.checked=!0)})),void 0!==e.scenarios&&e.scenarios.length&&e.scenarios.forEach((function(e){var i=t.contentEl.querySelector(t.scenarioOptionsSelector+'[value="'+e+'"]');i&&(i.checked=!0)})),i&&this.getRecommendations('<p class="experience-builder__message text--content">Loading your previous recommendations.</p>'),this.updateButtonStates()}},{key:"init",value:function(){localStorage&&localStorage.getItem(this.localStorageKey)?this.restore(JSON.parse(localStorage.getItem(this.localStorageKey))):(this.goToStep(0),this.updateButtonStates())}},{key:"wrapMessage",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e?'<div class="experience-builder__message text--content">'.concat(e,"</div>"):""}}]),e}()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.