1"use strict";(self.heliuxModules=self.heliuxModules||[]).push([[818],{53509(t,n,e){var o=e(23029),i=e(49530),s=e(50388),c=e(53954),r=e(85501),d=(e(74423),e(31526)),l=e(81),a=e(37252),h=e(50783);const u={setActiveState:!0,actions:{dropdown:"dropdown",close:"close"},selectors:{instanceCta:".calltoaction.button",renderElement:".calltoaction__dropdown-content"},elements:{dropdownContent:".dropdown__content"},subscribes:{closeDropdown:t=>`dropdown:${t}:closed`,expandDropdown:t=>`dropdown:${t}:expand`},template:(t,n,e=[])=>`\n <div class="dropdown"\n aria-expanded="true"\n id="dropdown${n}">\n <div class="dropdown__container ${e.join(" ")}"\n role="listitem"\n aria-labelledby="dropdown">\n <div class="dropdown__content">\n ${t}\n </div>\n </div>\n </div>`};function p(t,n,e){return n=(0,c.A)(n),(0,s.A)(t,f()?Reflect.construct(n,e||[],(0,c.A)(t).constructor):n.apply(t,e))}function f(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(f=function(){return!!t})()}let g=function(t){function n(){return(0,o.A)(this,n),p(this,n,arguments)}return(0,r.A)(n,t),(0,i.A)(n,[{key:"init",value:function(){this.logger=new a.V(this.name),this.config={...u,...this.config},this.invalidAction=!1,this.setCallActionMethod(),this.container=document.createElement("div"),this.el.append(this.container),this.setBinds(),this.addEventListeners()}},{key:"path",get:function(){return this.config.path}},{key:"dropdownContent",get:function(){return this.config.dropdownContent}},{key:"id",get:function(){return this.el.id.split("btn__").pop()}},{key:"dropdownId",get:function(){return`dropdown${this.id}`}},{key:"hasDropdownContent",get:function(){return this.dropdownContent&&""!==this.dropdownContent}},{key:"isDropdown",get:function(){const{dropdown:t}=this.config.actions;return[t].includes(this.config.action)}},{key:"isClose",get:function(){const{close:t}=this.config.actions;return[t].includes(this.config.action)}},{key:"shouldCloseOpenedDropdown",get:function(){const{dropdown:t,close:n}=this.config.actions;return this.nextAction===n&&[t].includes(this.config.action)}},{key:"hasXFPath",get:function(){return this.isDropdown&&this.path&&""!==this.path}},{key:"setBinds",value:function(){this.clickHandlers=this.clickHandlers.bind(this),this.closeDropdownHandler=this.closeDropdownHandler.bind(this)}},{key:"setActiveState",value:function(){this.nextAction=this.config.actions.close}},{key:"removeActiveState",value:function(){this.nextAction=void 0}},{key:"clickHandlers",value:function(t){this.callActionMethod(t)}},{key:"closeDropdownHandler",value:function(t){const n=this.el.closest(this.config.selectors.instanceCta).querySelector(this.config.selectors.renderElement);n.contains(t.target)||this.el.contains(t.target)||(n.innerHTML="",this.el.disabled=!1)}},{key:"setCallActionMethod",value:function(){""!==this.config.action&&Object.values(this.config.actions).includes(this.config.action)?this.actionMethod=`action${this.config.action}`:this.invalidAction=!0}
1},{key:"callActionMethod",value:function(t){t?.preventDefault(),this[this.actionMethod](t)}},{key:"actionclose",value:function(t){(this.isClose||this.shouldCloseOpenedDropdown)&&(0,d.publish)("dropdown::close",t)}},{key:"actiondropdown",value:function(){if(this.el.disabled=!0,this.hasXFPath)this.createRequest();else if(this.hasDropdownContent){const t=document.querySelector(this.dropdownContent),n=t&&t.outerHTML;n?this.load(n):this.logger.error(`No element found for "${this.dropdownContent}" selector`)}else this.logger.error('"this.dropdownContent" selector is not configured')}},{key:"createRequest",value:function(){this.path&&""!==this.path&&(this.requestAbortController=new AbortController,(0,h.BU)(this.path,null,this.requestAbortController).then(({fragmentString:t})=>{this.load(t),this.closePopupAutomatically()}).catch(t=>this.logger.error(t)))}},{key:"addEventListeners",value:function(){if(this.invalidAction)return;const{dropdown:t}=this.config.actions,{expandDropdown:n,closeDropdown:e}=this.config.subscribes;this.el.addEventListener("click",this.clickHandlers),document.addEventListener("click",this.closeDropdownHandler),[t].includes(this.config.action)&&this.config.setActiveState&&((0,d.B1)(n(this.dropdownId),()=>this.callActionMethod()),(0,d.B1)(e(this.dropdownId),()=>this.removeActiveState()))}},{key:"load",value:function(t){const n=this.id,e=[this.el.dataset.customizationclass],o=this.config.template(t,n,e),i=(0,l.ME)(o);this.hasDropdownContent&&(0,l.Y9)(i.querySelector(this.config.elements.dropdownContent)),this.el.closest(this.config.selectors.instanceCta).querySelector(this.config.selectors.renderElement).appendChild(i),this.config.setActiveState&&this.setActiveState()}}])}(d.xu);(0,d.kz)({CallToActionDropdownControl:g},0)}},t=>{t.O(0,[750],()=>t(53509)),t.O()}]);
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.