1(self.webpackChunk=self.webpackChunk||[]).push([[5229],{3646:function(e,t,i){var n=i(7228);e.exports=function(e){if(Array.isArray(e))return n(e)}},6860:function(e){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},8206:function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},319:function(e,t,i){var n=i(3646),s=i(6860),o=i(379),r=i(8206);e.exports=function(e){return n(e)||s(e)||o(e)||r()}},3484:function(e,t,i){"use strict";i.r(t),i.d(t,{default:function(){return p}});var n=i(319),s=i.n(n),o=i(4575),r=i.n(o),a=i(3913),l=i.n(a),c=i(9713),h=i.n(c),u=i(9669),d=i.n(u),v=i(1548),p=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,a=n.interestOptionsSelector,l=void 0===a?"[data-eb-interest]":a,c=n.scenarioOptionsSelector,u=void 0===c?"[data-eb-scenario]":c,d=n.prevSelector,p=void 0===d?"[data-eb-prev]":d,g=n.nextSelector,S=void 0===g?"[data-eb-next]":g,b=n.innerSelector,m=void 0===b?"[data-eb-inner]":b,E=n.closeSelector,f=void 0===E?"[data-eb-close]":E,y=n.recommendationsContainerSelector,L=void 0===y?"[data-eb-recommendations]":y,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
1-api/":O,U=n.htmlUrl,w=void 0===U?"/ajax/experience-builder-ui/":U,M=n.localStorageKey,B=void 0===M?"ExperienceBuilder":M;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,"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=l,this.scenarioOptionsSelector=u,this.prevSelector=p,this.nextSelector=S,this.innerSelector=m,this.closeSelector=f,this.recommendationsContainerSelector=L,this.apiRecommendUrl=T,this.htmlUrl=w,this.localStorageKey=B,this.modalInstance=new v.Z({el:t,name:"experience-builder",onOpen:function(){i.open()}})}return l()(e,[{key:"launch",value:function(){this.modalInstance.open()}},{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>'),d().get(this.htmlUrl).then((function(t){e.contentEl.innerHTML=t.data,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=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=this.innerEl.getAttribute("class"),this.recommendationsContainerEl=this.mainEl.querySelector(this.recommendationsContainerSelector),this.contentEl.querySelectorAll(this.scenarioOptionsSelector).forEach((function(e){e.addEventListener("change",(function(){t.updateButtonStates(t.totalLevels-3)}))})),this.contentEl.querySelectorAll(this.interestOptionsSelector).forEach((function(e){e.addEventListener("change",(function(){t.updateButtonStates(t.totalLevels-2)}))})),this.buttonEls=this.contentEl.querySelectorAll("[".concat(this.buttonAttribute,"]")),this.buttonEls.forEach((function(e){e.addEventListener("click",(function(){var i=parseInt(e.getAttribute(t.buttonAttribute));t.goToStep(i)}))})),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=t.currentLevel-1>=0?t.currentLevel-1:0;t.goToStep(e)})),this.nextEl.addEventListener("click",(function(){console.log("nextEl clicked");var e=t.currentLevel+1<=t.highestLevel?t.currentLevel+1:t.highestLevel;t.goToStep(e)}))),this.contentEl.querySelectorAll(this.closeSelector).forEach((function(e){e.addEventListener("click",(function(){t.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-current",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),d().get(this.apiRecommendUrl,{params:s}).then((function(t){e.recommendationsContainerEl.innerHTML=t.data,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.