1/*! 2* Common client JS-dependencies 3* (c) Publish Lab AS 4* https://www.labradorcms.com 5*/ 6(()=>{"use strict";var t,e;!function(){const t=document.querySelectorAll("[data-expandable]"),e=t=>{t.preventDefault(),t.stopPropagation(),t.currentTarget.classList.toggle("expanded")};for(const i of t)i.addEventListener("click",e,!1)}(),function(){var t=null,e=null,i={max:{width:1740,height:1740},buffer:140,window:{width:window.innerWidth,height:window.innerHeight}},s=document.querySelectorAll("figure[data-zoomable='1']");if(s.length)for(var n=function(t){t.addEventListener("click",function(e){o(t)},!1)},o=function(s){t||((t=document.createElement("div")).classList.add("imagezoom"),(e=document.createElement("div")).classList.add("content"),t.appendChild(e),document.body.appendChild(t));var n=s.querySelector("img");if(!n)return;var o=n.width/n.height;if(!o)return;i.window.width=window.innerWidth,i.window.height=window.innerHeight;var r=Math.min(i.max.width,i.window.width),c=r/o,h=c-Math.min(i.max.height,i.window.height);h>0&&(c-=h,r-=h*o),r=Math.round(1.5*r),c=Math.round(1.5*c);var d=s.cloneNode(!0),u=d.querySelector("img"),m=u.currentSrc?u.currentSrc:u.src;const g=d.querySelectorAll("source"),p=m+"&width="+r+"&height="+c;for(const t of g)t.setAttribute("srcset",p);u.setAttribute("src",p),u.removeAttribute("width"),u.removeAttribute("height"),d.classList.add("image-loading");const f=u.getAttribute("style")||"";for(u.style.width="100vw",u.addEventListener("load",t=>{u.setAttribute("style",f),d.classList.remove("image-loading")},!1),u.addEventListener("click",function(t){l()},!1),e.setAttribute("data-isWide",o>=1?"true":"false");e.firstChild;)e.removeChild(e.firstChild);e.appendChild(d);const v=document.createElement("span");v.setAttribute("title","Close (Escape)"),v.classList.add("close-btn","fi-x"),v.addEventListener("click",function(t){l()},!1),e.appendChild(v),a()},r=function(t){"Escape"==t.key&&l()},a=function(){t.classList.add("visible"),document.addEventListener("keydown",r,!1)},l=function(){t.classList.remove("visible"),document.removeEventListener("keydown",r,!1)},c=0;c<s.length;c++)n(s[c])}(),window.Dac||(window.Dac={}),window.Dac.AutoScroller=function(t,e,i){var s=null;if(t){var n=t.querySelector("ul.articles");if(n){var o=n.children;if(o.length){var r=t.querySelector("span.left"),a=t.querySelector("span.right"),l=0,c=o[0].offsetWidth,h=Math.round(n.offsetWidth/c),d=n.offsetWidth/h,u=i||4e3;if(!(h>=o.length)){var m,g=[],p=function(){g=[];for(var t=0;t<o.length;t++)g.push(new v(o[t],d))};window.ResizeObserver&&(m=new ResizeObserver(t=>{for(let i of t)if(i.target===n){var e=o[0].offsetWidth;e!==c&&(c=e,d=n.offsetWidth/h,p(),y(1))}}));var f=t.querySelector("ul.dots"),v=function(t,e){this.element=t,this.slotWidth=e,this.xPos=0,this.step=function(t,e){this.xPos-=this.slotWidth*t,this.move(this.xPos,e)},this.reset=function(){this.xPos=0,this.move(0)},this.move=function(t,e){var i=this.element;e?i.classList.add("transformHidden"):i.classList.remove("transformHidden"),i.style.transform="translateX("+t+"px)"};var i=this;return{step:function(t,e){i.step(t,e)},reset:function(){i.reset()}}},w=function(t,e){var i=l;l+=t,Math.abs(l)>=g.length&&(l=0),g.forEach(function(i){i.step(t,e)}),t>0?b(Math.abs(t)):t<0&&y(Math.abs(t)),S(l,i)},b=function(t){var e=g.shift();e.step(-2-g.length,!0),window.setTimeout(function(){e.step(1)},50),g.push(e),--t>0&&b(t)},y=function(t){var e=g.pop();g.unshift(e),e.step(g.length,!0),--t>0&&y(t)};if(r&&r.addEventListener("click",function(){w(-1),e=!1},!1),a&&a.addEventListener("click",function(){w(1),e=!1},!1),f){for(var I=0;I<f.children.length;I++)f.children[I].addEventListener("click",x,!1);S(0)}p(),y(1),m&&m.observe(n),e&&(s=window.setInterval(function(){e?w(1):window.clearInterval(s)},u))}}}}function x(t){t.preventDefault(),t.stopPropagation();var i,s=(i=this,Array.prototype.slice.call(i.parentNode.children).indexOf(i));s>-1&&w(s-l,!0),e=!1}function S(t,e){if(f){var i=f.children[e];i&&i.classList.remove("selected");var s=f.children[t];s&&s.classList.add("selected")}}},(()=>{window.Dac||(window.Dac={});let{Dac:t}=window;t.SwipeHelper=class{constructor(t,e){this.debug=window.location.toString().includes("debug="),this.log("Creating instance ..."),this.settings={isHorizontal:e.isHorizontal,css:{hidden:"nav-hidden"},navWidth:0,preloadNextImage:!!e.preloadNextImage,intersectionObserver:{threshold:void 0===e.threshold?.5:e.threshold},itemsSelector:e.itemsSelector},this.callbacks={navUpdate:[]};const i=e.navItemsSelector?t.querySelector(e.navItemsSelector):null,s=e.previewItemsSelector?t.querySelector(e.previewItemsSelector):null;if(this.elements={nav:{forward:t.querySelector(e.navItems.forwardSelector),backward:t.querySelector(e.navItems.backwardSelector)},itemsContainer:this.settings.isHorizontal?t.querySelector(e.itemsContainerSelector):document.querySelector(e.itemsContainerSelector),items:t.querySelectorAll(this.settings.itemsSelector),navItems:i?[...i.children]:null,previewItems:s?[...s.children]:null},this.noIndexList=[],this.domIndex=null,e.noIndexItemsSelector){const i=t.querySelectorAll(e.noIndexItemsSelector);if(i&&i.length){this.log(`Will exclude ${i.length} elements from indexing ...`);for(const t of i){const e=Array.from(this.elements.items).indexOf(t);-1!==e&&(this.noIndexList.push(e),this.log(` - Excluding index ${e}`))}this.log(`Did exclude ${this.noIndexList.length} elements from indexing ...`)}}this.validateElement(this.elements.itemsContainer)&&this.validateElement(this.elements.items)?this.elements.items.length<2?this.log("To few elements. No need for the helper.",!0):(this.items=[...this.elements.items].map(t=>({visible:!1,element:t})),this.index=null,this.observer=null,this.observeElements(this.elements.itemsContainer,this.elements.items),this.setupNavigation(),this.autoScrollInterval=null,this.autoScroll=e.autoScroll,this.elementWidth=this.items[0].element.scrollWidth,this.currentLeft=0,this.isAutoscrolling=!1,this.preloadedIndexes=[],this.registerAutoscroll()):this.log("Missing required dom-element(s).",!0)}addNavUpdate(t){this.log("Adding navigation update callback ..."),this.callbacks.navUpdate.push(t)}reflow(){this.log("Will reflow items"),this.unobserve(this.elements.items),this.elements.items=this.elements.itemsContainer.querySelectorAll(this.settings.itemsSelector),this.items=[...this.elements.items].map(t=>({visible:!1,element:t})),this.observeElements(this.elements.itemsContainer,this.elements.items)}log(t,e=!1){e&&console.warn("[SwipeHelper]",t),this.debug&&console.log("[
6SwipeHelper]",t)}validateElement(t){return t&&(t.length||1===t.nodeType)}registerAutoscroll(){if(!this.autoScroll||!this.autoScroll.enabled)return;this.autoScroll.interval||(this.autoScroll.interval=4e3);new IntersectionObserver((t,e)=>{t[0].isIntersecting?this.startAutoScroll():this.stopAutoScroll()},{root:null,rootMargin:"0px",threshold:0}).observe(this.elements.itemsContainer)}startAutoScroll(){if(this.isAutoscrolling||!this.settings.isHorizontal)return;this.isAutoscrolling=!0,this.log("Starting autoscroll ..."),this.autoScrollInterval=setInterval(()=>{this.autoScroll.scrolling=!0,this.autoScroll.reset?(this.elements.itemsContainer.scrollTo({top:0,left:0,behavior:"smooth"}),this.autoScroll.reset=!1):this.elements.itemsContainer.scrollTo({top:0,left:this.elements.itemsContainer.scrollLeft+this.elementWidth,behavior:"smooth"}),setTimeout(()=>{this.autoScroll.scrolling=!1},1e3)},parseInt(this.autoScroll.interval,10));const t=()=>{this.autoScroll.scrolling||(this.log("Will disable autoscroll"),this.stopAutoScroll(),this.elements.itemsContainer.removeEventListener("scroll",t))};this.elements.itemsContainer.addEventListener("scroll",t)}stopAutoScroll(){this.isAutoscrolling&&(this.log("Stopping autoscroll ..."),clearInterval(this.autoScrollInterval),this.autoScrollInterval=null,this.isAutoscrolling=!1)}setupNavigation(){if(this.elements.nav.forward&&this.elements.nav.backward&&(this.log("Will register events for navigation."),this.settings.navWidth=this.elements.nav.backward.offsetWidth,this.elements.nav.backward.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation(),this.navigate(-1)},!1),this.elements.nav.forward.addEventListener("click",t=>{t.preventDefault(),t.stopPropagation(),this.navigate(1)},!1)),this.elements.navItems)for(const t of this.elements.navItems){const e=this.elements.navItems.indexOf(t);t.addEventListener("click",t=>{this.navigateToIndex(e,"auto")},!1)}if(this.elements.previewItems)for(const t of this.elements.previewItems){const e=this.elements.previewItems.indexOf(t);t.addEventListener("click",t=>{this.navigateToIndex(e,"auto")},!1)}}navigateToIndex(t,e){this.log(`Navigate to index: ${t}`),this.items[t]&&this.navigateToItem(this.items[t],e)}navigate(t){const e=this.items.filter(t=>t.visible);
6if(!e.length)return void this.log("Cannot navigate. Did not find any visible items ...",!0);const i=this.items.indexOf(e.shift())+t;i>=0&&i<this.items.length&&this.navigateToItem(this.items[i])}navigateToItem(t,e="smooth"){if(this.settings.isHorizontal){const i=Math.max(0,t.element.offsetLeft-this.settings.navWidth);this.elements.itemsContainer.scrollTo({top:0,left:i,behavior:e})}else this.elements.itemsContainer===document.body?window.scrollTo({top:t.element.offsetTop,left:0,behavior:e}):this.elements.itemsContainer.scrollTo({top:t.element.offsetTop,left:0,behavior:e})}internalToPublicIndex(t,e=!0){let i=t;if(this.noIndexList.length){let s=0;for(const i of this.noIndexList)(!e&&i<t||e&&i<=t)&&s++;i-=s}return i}publicToInternalIndex(t){let e=t;if(this.noIndexList.length){let t=0;for(const i of this.noIndexList)i<=e+t&&t++;e+=t}return e}observeElements(t,e){this.log(`Will register IntersectionObserver for ${e.length} items`);const i={root:this.settings.isHorizontal?t:null,rootMargin:"0px",threshold:this.settings.intersectionObserver.threshold};this.observer=new IntersectionObserver((t,i)=>{const s=[];let n=null;for(const i of t){const t=Array.from(i.target.parentNode.querySelectorAll(this.settings.itemsSelector)).indexOf(i.target);if(-1===t)return void this.unobserve(e);this.items[t].visible=i.isIntersecting,s.push(t),this.items[t].visible&&(n=t),this.settings.preloadNextImage&&i.isIntersecting&&this.items[t+1]&&!this.preloadedIndexes.includes(t+1)&&this.preloadAtIndex(t+1),this.log(`IntersectionObserver triggered at index ${t}. Setting visibility to ${this.items[t].visible}.`)}if(null!==n){const t=n>=this.domIndex?"next":"prev";let e=null;this.noIndexList.length&&(e=this.noIndexList.map(t=>t-n).filter(e=>"next"===t?e>=0:e<=0),e=e.length?"next"===t?Math.min(...e):Math.max(...e):null),null!==e&&e<0&&(e=Math.abs(e)),this.updateNavItems(this.internalToPublicIndex(n,n>this.index),{originalIndex:n,direction:t,noIndexDistance:e})}(s.includes(0)||s.includes(this.items.length-1))&&(this.updateGui(),this.autoScroll&&this.autoScroll.enabled&&this.items[this.items.length-1].visible&&(this.autoScroll.reset=!0)),this.domIndex=n},i);for(const t of e)this.observer.observe(t)}unobserve(t){this.log(`Will unobserve ${t.length} items`);for(const e of t)this.observer.unobserve(e)}preloadAtIndex(t){if(this.preloadedIndexes.push(t),!this.items[t]||!this.items[t].element)return;const e=this.items[t].element.querySelector("img");e&&(this.log(`Will preload image at index ${t}`),e.removeAttribute("loading"))}updateGui(){this.elements.nav.forward&&this.elements.nav.backward&&(this.log("Updating navigation-GUI ..."),this.items[0].visible?this.elements.nav.backward.classList.add(this.settings.css.hidden):this.elements.nav.backward.classList.remove(this.settings.css.hidden),this.items[this.items.length-1].visible?this.elements.nav.forward.classList.add(this.settings.css.hidden):this.elements.nav.forward.classList.remove(this.settings.css.hidden))}updateNavItems(t,{originalIndex:e,direction:i,noIndexDistance:s}){const n="selected";this.elements.navItems&&(this.elements.navItems[this.index]&&this.elements.navItems[this.index].classList.remove(n),this.elements.navItems[t]&&this.elements.navItems[t].classList.add(n)),this.elements.previewItems&&(this.elements.previewItems[this.index]&&this.elements.previewItems[this.index].classList.remove(n),this.elements.previewItems[t]&&this.elements.previewItems[t].classList.add(n)),this.index=t;for(const t of this.callbacks.navUpdate)t(this.index,{isNoIndex:this.noIndexList.includes(e),direction:i,domIndex:e,noIndexDistance:s})}}})(),window.Dac||(window.Dac={}),window.Dac.Parallax=class{constructor(t){this.container=t.container,this.debug=t.debug,this.log(`Starting Parallax-instance for element "${this.container.classList}".`),this.isAnimating=!1,this.handler=this.scrollHandler.bind(this),this.animator=this.animate.bind(this),this.register(this.container),this.elements=t.elements,this.resizeTimeoutId=null,this.lastYPos=window.scrollY,this.animatedItems=[],this.items=this.registerItems(this.elements),this.decorateStaticAttributes()}registerItems(t){this.log(`Will register ${t.length} item(s)`),document.body.classList.add("dac-reflow");const e=t.map(t=>{const e=this.container.querySelector(t.selector),i=e.getBoundingClientRect();return{index:t.index,element:e,rect:i,animations:t.animations,staticAttributes:t.staticAttributes,style:"",position:{top:parseInt(i.top+window.scrollY,10),bottom:parseInt(i.bottom+window.scrollY,10)}}});return document.body.classList.remove("dac-reflow"),e}reflow(){this.log("Will reflow items"),this.items=this.registerItems(this.elements)}scrollHandler(t){this.requestAnimation()}decorateStaticAttributes(){for(const t of this.items){const e=t.staticAttributes.map(e=>this[`handleStatic_${e.name}`](e,t));t.element.setAttribute("style",`transform: ${e.join(" ")}`)}}
6getItemsByPosition(t,e){return this.items.filter(i=>i.position.top<e&&i.position.bottom>t)}getPercentScroll(t,e){const i=Math.max(t.position.top-window.innerHeight,0);return(e-i)/(t.position.bottom-i)*100}log(t){this.debug&&console.log("Parallax:",t)}requestAnimation(){this.isAnimating||requestAnimationFrame(this.animator),this.isAnimating=!0}activateAnimations(){this.log("Will activate animations"),this.container.classList.add("parallax-js-mode"),window.addEventListener("scroll",this.handler,!1),this.handler()}deactivateAnimations(){this.log("Will deactivate animations"),this.container.style.height="",this.container.classList.remove("parallax-js-mode"),window.removeEventListener("scroll",this.handler,!1)}register(t){this.log("Will register IntersectionObserver"),new IntersectionObserver((e,i)=>{for(const i of e)i.target===t&&(this.log(`IntersectionObserver triggered. Intersecting: ${i.isIntersecting}, ratio: ${i.intersectionRatio}`),i.isIntersecting?this.activateAnimations():this.deactivateAnimations())},{root:null,rootMargin:"0px"}).observe(t),window.addEventListener("resize",t=>{this.log("Window resized"),clearTimeout(this.resizeTimeoutId),this.resizeTimeoutId=setTimeout(()=>{this.reflow()},300)})}getFloat(t,e=2){return parseFloat(t.toFixed(e))}getInt(t){return parseInt(t,10)}getCurrentValue(t,e){return e<t.startScrollPosition?parseFloat(t.startValue):e>=t.endScrollPosition?parseFloat(t.endValue):100/(t.endScrollPosition-t.startScrollPosition)*(e-t.startScrollPosition)/100*(t.endValue-t.startValue)+parseFloat(t.startValue)}animate(){const t=this.getItemsByPosition(window.scrollY,window.scrollY+window.innerHeight);if(this.debug){const e=t.map(t=>`[${t.animations.map(t=>t.name).join(", ")}]`);this.log(`Will animate ${t.length} element(s) ${e.join(", ")}`)}for(const e of this.animatedItems)t.includes(e)||(this.log("Setting start/end state for item outside range."),this.animateItem(e,this.lastYPos<=window.scrollY?100:0),e.element.classList.remove("isAnimating"));for(const e of t){e.element.classList.add("isAnimating");const t=this.getPercentScroll(e,window.scrollY);this.animateItem(e,t)}this.lastYPos=window.scrollY,this.isAnimating=!1,this.animatedItems=t}animateItem(t,e){const i={transform:[],filter:[],definition:[]};for(const s of t.animations){const n=this[`handleAnimation_${s.name}`](s,e,t);i[n.key].push(n.value)}if(i.transform.length&&i.definition.push(`transform: ${i.transform.join(" ")}`),i.filter.length&&i.definition.push(`filter: ${i.filter.join(" ")}`),i.definition.length){const e=i.definition.join("; ");t.style!==e&&(t.element.setAttribute("style",i.definition.join("; ")),t.style=e)}}handleAnimation_perspective(t,e,i){const s=this.getCurrentValue(t,e/100)/100;return{key:"transform",value:`translateZ(${this.getFloat(100*s)}px) scale(${this.getFloat(s)})`}}handleAnimation_scale(t,e,i){const s=this.getCurrentValue(t,e)/100;return{key:"transform",value:`scale(${this.getFloat(s,4)})`}}handleAnimation_opacity(t,e,i){const s=this.getCurrentValue(t,e)/100;return{key:"definition",value:`opacity:${this.getFloat(s)}`}}handleAnimation_rotate(t,e,i){const s=this.getCurrentValue(t,e)/100*360;return{key:"transform",value:`rotate(${this.getInt(s)}deg)`}}handleAnimation_blur(t,e,i){const s=this.getCurrentValue(t,e)/2;return{key:"filter",value:`blur(${this.getFloat(s)}px)`}}handleAnimation_sepia(t,e,i){const s=this.getCurrentValue(t,e);return{key:"filter",value:`sepia(${this.getInt(s)}%)`}}handleAnimation_brightness(t,e,i){const s=this.getCurrentValue(t,e);return{key:"filter",value:`brightness(${this.getInt(s)}%)`}}handleStatic_perspective(t,e){const i=this.getFloat(t.value/100);return{key:"transform",value:`translateZ(${t.value}px) scale(${i})`}}},window.Dac=window.Dac||{},window.Dac.TabNavigation=class{constructor(t){this.index=null,this.debug=!!t.debug,this.canCloseTabs=!!t.canCloseTabs,this.onNavigate=t.onNavigate||(()=>{}),this.log("Creating instance ..."),this.elements={container:null,tabs:null,navigationItems:null},this.setup(t)?(this.activeSelector="selected",this.setupNavigation(),t.defaultIndex&&!isNaN(t.defaultIndex)&&this.setIndex(parseInt(t.defaultIndex,10))):this.log("Missing required dom-elements.",!0)}log(t,e=!1){e?console.warn("TabNavigation:",t):this.debug&&console.log("TabNavigation:",t)}setup(t){return this.elements.container=document.querySelector(t.selector),!!this.elements.container&&(this.elements.tabs=this.elements.container.querySelectorAll(t.tabsSelector),this.elements.navigationItems=this.elements.container.querySelectorAll(t.navigationSelector),this.log(`Found ${this.elements.tabs.length} tab-elements and ${this.elements.navigationItems.length} navigation items.`),this.elements.tabs.length>0&&this.elements.navigationItems.length>0)}setupNavigation(){this.log("Will register events for navigation.");let t=0;for(const e of this.elements.navigationItems)this.setupNavigationItem(e,t),t++}setupNavigationItem(t,e){const i=t=>{t.stopPropagation();const i=this.index;this.setIndex(e),this.onNavigate(this.createCallbackObject(i),this.createCallbackObject(this.index))};t.addEventListener("click",i,!1),t.addEventListener("keydown",t=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),i(t))},!1)}createCallbackObject(t){return null===t?null:{tab:this.elements.tabs[t],navigator:this.elements.navigationItems[t]}}setIndex(t){if(this.index===t){if(!this.canCloseTabs)return void this.log(`Index ${t} already defined. No change.`);t=null}t<0||t>=this.elements.tabs.length?this.log(`Index ${t} is out of bounds.`,!0):(this.log(`Will set index ${t}.`),this.index=t,this.updateGui())}updateGui(){for(const t of this.elements.tabs)t.classList.remove(this.activeSelector);for(const t of this.elements.navigationItems)t.classList.remove(this.activeSelector);this.elements.tabs[this.index]&&this.elements.tabs[this.index].classList.add(this.activeSelector),this.elements.navigationItems[this.index]&&this.elements.navigationItems[this.index].classList.add(this.activeSelector)}},window.Dac||(window.Dac={}),window.Dac.ElementAttributeToggler=class{constructor(t={selectors:[]}){this.validate(t),this.options=t,this.selectors=this.getSelectorsElements(),this.setup()}
6setup(){this.selectors.forEach(t=>{this.setInitialAttributes(t),this.addListeners(t)})}getSelectorsElements(){return this.options.selectors.map(t=>({activators:document.querySelectorAll(t.toggleActivator),elements:document.querySelectorAll(t.elementToToggle),attributes:t.attributes}))}setInitialAttributes(t){const e=t.attributes;t.elements.forEach((t,i)=>{for(const i of Object.keys(e||{}))e[i].initial&&this.setAttribute(t,i,e[i].value)})}setAttribute(t,e,i){"className"===e?t.classList.add(i):t[e]=i}addListeners(t){t.activators.forEach((e,i)=>{e.addEventListener("click",e=>{e.preventDefault(),this.segregateAttributeHandlers(t.elements[i],t)})})}segregateAttributeHandlers(t,e){const i=e.attributes;for(const e of Object.keys(i||{}))"className"===e?this.toggleClassName(t,i[e].value):this.toggleAnyAttribute(t,i[e].value,e)}toggleClassName(t,e){t.classList.toggle(e)}toggleAnyAttribute(t,e,i){t[i]===e?t[i]="":t[i]=e}validate(t){return this.validateObject(t)?this.validateArray(t.selectors)?void 0:(console.error("ElementAttributeToggler: Options.selectors is not an array."),!1):(console.error("ElementAttributeToggler: Options is not an object."),!1)}validateObject(t){return"object"==typeof t&&null!==t}validateArray(t){return Array.isArray(t)}},t=void 0,e=function(){var t=Object.prototype.toString,e=Array.isArray||function(e){return"[object Array]"===t.call(e)};function i(t){return"function"==typeof t}function s(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function n(t,e){return null!=t&&"object"==typeof t&&e in t}function o(t,e){return null!=t&&"object"!=typeof t&&t.hasOwnProperty&&t.hasOwnProperty(e)}var r=RegExp.prototype.test,a=/\S/;function l(t){return!function(t,e){return r.call(t,e)}(a,t)}var c={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="},h=/\s*/,d=/\s+/,u=/\s*=/,m=/\s*\}/,g=/#|\^|\/|>|\{|&|=|!/;function p(t){this.string=t,this.tail=t,this.pos=0}function f(t,e){this.view=t,this.cache={".":this.view},this.parent=e}function v(){this.templateCache={_cache:{},set:function(t,e){this._cache[t]=e},get:function(t){return this._cache[t]},clear:function(){this._cache={}}}}p.prototype.eos=function(){return""===this.tail},p.prototype.scan=function(t){var e=this.tail.match(t);if(!e||0!==e.index)return"";var i=e[0];return this.tail=this.tail.substring(i.length),this.pos+=i.length,i},p.prototype.scanUntil=function(t){var e,i=this.tail.search(t);switch(i){case-1:e=this.tail,this.tail="";break;case 0:e="";break;default:e=this.tail.substring(0,i),this.tail=this.tail.substring(i)}return this.pos+=e.length,e},f.prototype.push=function(t){return new f(t,this)},f.prototype.lookup=function(t){var e,s=this.cache;if(s.hasOwnProperty(t))e=s[t];else{for(var r,a,l,c=this,h=!1;c;){if(t.indexOf(".")>0)for(r=c.view,a=t.split("."),l=0;null!=r&&l<a.length;)l===a.length-1&&(h=n(r,a[l])||o(r,a[l])),r=r[a[l++]];else r=c.view[t],h=n(c.view,t);if(h){e=r;break}c=c.parent}s[t]=e}return i(e)&&(e=e.call(this.view)),e},v.prototype.clearCache=function(){void 0!==this.templateCache&&this.templateCache.clear()},v.prototype.parse=function(t,i){var n=this.templateCache,o=t+":"+(i||w.tags).join(":"),r=void 0!==n,a=r?n.get(o):void 0;return null==a&&(a=function(t,i){if(!t)return[];var n,o,r,a=!1,c=[],f=[],v=[],b=!1,y=!1,I="",x=0;function S(){if(b&&!y)for(;v.length;)delete f[v.pop()];else v=[];b=!1,y=!1}function A(t){if("string"==typeof t&&(t=t.split(d,2)),!e(t)||2!==t.length)throw new Error("Invalid tags: "+t);n=new RegExp(s(t[0])+"\\s*"),o=new RegExp("\\s*"+s(t[1])),r=new RegExp("\\s*"+s("}"+t[1]))}A(i||w.tags);for(var k,L,E,C,T,P,$=new p(t);!$.eos();){if(k=$.pos,E=$.scanUntil(n))for(var q=0,_=E.length;q<_;++q)l(C=E.charAt(q))?(v.push(f.length),I+=C):(y=!0,a=!0,I+=" "),f.push(["text",C,k,k+1]),k+=1,"\n"===C&&(S(),I="",x=0,a=!1);if(!$.scan(n))break;if(b=!0,L=$.scan(g)||"name",$.scan(h),"="===L?(E=$.scanUntil(u),$.scan(u),$.scanUntil(o)):"{"===L?(E=$.scanUntil(r),$.scan(m),$.scanUntil(o),L="&"):E=$.scanUntil(o),!$.scan(o))throw new Error("Unclosed tag at "+$.pos);if(T=">"==L?[L,E,k,$.pos,I,x,a]:[L,E,k,$.pos],x++,f.push(T),"#"===L||"^"===L)c.push(T);else if("/"===L){if(!(P=c.pop()))throw new Error('Unopened section "'+E+'" at '+k);if(P[1]!==E)throw new Error('Unclosed section "'+P[1]+'" at '+k)}else"name"===L||"{"===L||"&"===L?y=!0:"="===L&&A(E)}if(S(),P=c.pop())throw new Error('Unclosed section "'+P[1]+'" at '+$.pos);return function(t){for(var e,i=[],s=i,n=[],o=0,r=t.length;o<r;++o)switch((e=t[o])[0]){case"#":case"^":s.push(e),n.push(e),s=e[4]=[];break;case"/":n.pop()[5]=e[2],s=n.length>0?n[n.length-1][4]:i;break;default:s.push(e)}return i}(function(t){for(var e,i,s=[],n=0,o=t.length;n<o;++n)(e=t[n])&&("text"===e[0]&&i&&"text"===i[0]?(i[1]+=e[1],i[3]=e[3]):(s.push(e),i=e));return s}(f))}(t,i),r&&n.set(o,a)),a}
6,v.prototype.render=function(t,e,i,s){var n=this.parse(t,s),o=e instanceof f?e:new f(e,void 0);return this.renderTokens(n,o,i,t,s)},v.prototype.renderTokens=function(t,e,i,s,n){for(var o,r,a,l="",c=0,h=t.length;c<h;++c)a=void 0,"#"===(r=(o=t[c])[0])?a=this.renderSection(o,e,i,s):"^"===r?a=this.renderInverted(o,e,i,s):">"===r?a=this.renderPartial(o,e,i,n):"&"===r?a=this.unescapedValue(o,e):"name"===r?a=this.escapedValue(o,e):"text"===r&&(a=this.rawValue(o)),void 0!==a&&(l+=a);return l},v.prototype.renderSection=function(t,s,n,o){var r=this,a="",l=s.lookup(t[1]);if(l){if(e(l))for(var c=0,h=l.length;c<h;++c)a+=this.renderTokens(t[4],s.push(l[c]),n,o);else if("object"==typeof l||"string"==typeof l||"number"==typeof l)a+=this.renderTokens(t[4],s.push(l),n,o);else if(i(l)){if("string"!=typeof o)throw new Error("Cannot use higher-order sections without the original template");null!=(l=l.call(s.view,o.slice(t[3],t[5]),function(t){return r.render(t,s,n)}))&&(a+=l)}else a+=this.renderTokens(t[4],s,n,o);return a}},v.prototype.renderInverted=function(t,i,s,n){var o=i.lookup(t[1]);if(!o||e(o)&&0===o.length)return this.renderTokens(t[4],i,s,n)},v.prototype.indentPartial=function(t,e,i){for(var s=e.replace(/[^ \t]/g,""),n=t.split("\n"),o=0;o<n.length;o++)n[o].length&&(o>0||!i)&&(n[o]=s+n[o]);return n.join("\n")},v.prototype.renderPartial=function(t,e,s,n){if(s){var o=i(s)?s(t[1]):s[t[1]];if(null!=o){var r=t[6],a=t[5],l=t[4],c=o;return 0==a&&l&&(c=this.indentPartial(o,l,r)),this.renderTokens(this.parse(c,n),e,s,c,n)}}},v.prototype.unescapedValue=function(t,e){var i=e.lookup(t[1]);if(null!=i)return i},v.prototype.escapedValue=function(t,e){var i=e.lookup(t[1]);if(null!=i)return"number"==typeof i?String(i):w.escape(i)},v.prototype.rawValue=function(t){return t[1]};var w={name:"mustache.js",version:"4.0.1",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(t){b.templateCache=t},get templateCache(){return b.templateCache}},b=new v;return w.clearCache=function(){return b.clearCache()},w.parse=function(t,e){return b.parse(t,e)},w.render=function(t,i,s,n){if("string"!=typeof t)throw new TypeError('Invalid template! Template should be a "string" but "'+(e(o=t)?"array":typeof o)+'" was given as the first argument for mustache#render(template, view, partials)');var o;return b.render(t,i,s,n)},w.escape=function(t){return String(t).replace(/[&<>"'`=\/]/g,function(t){return c[t]})},w.Scanner=p,w.Context=f,w.Writer=v,w},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Mustache=e(),window.Dac.InfinityScrollAds||(window.Dac.InfinityScrollAds={}),window.Dac.InfinityScrollAds=class{constructor(t){this.articleId=t}reloadSkyscraperAds(){const t=window.innerWidth>1315,e=this.getTags(this.articleId),i=e.split(","),s=this.getPageType(this.articleId),n=this.getSection(this.articleId),o=new CustomEvent("skyscrapersReloading",{detail:{articleId:this.articleId,skyscraperVisible:t,tags:e,context:s,section:n}});if(document.dispatchEvent(o),!t||window.lab_ads&&window.lab_ads.disableSkyscraperReload)return;const r=document.querySelector(".placement-right > div > .adunit"),a=document.querySelector(".placement-left > div > .adunit");r&&a&&window.lwhb.cmd.push(()=>{window.lwhb.removeAdUnit(a.id),window.lwhb.removeAdUnit(r.id);const t=`context_${s}_section_${n}`,o={ext:{data:{tags:i,contextAndSection:t,context:s,section:n}}};window.lwhb.loadAd({tagId:a.id,keywords:{tags:e,contextAndSection:t,context:s,section:n},ortb2:o}),window.lwhb.loadAd({tagId:r.id,keywords:{tags:e,contextAndSection:t,context:s,section:n},ortb2:o})})}updateAdPlacements(){document.querySelectorAll('div[id^="infiniteArticle-"]:not(.adUnitUpdated)').forEach(t=>{const e=t.id.match(/infiniteArticle-(\d+)/);if(e){t.classList.add("adUnitUpdated");const i=e[1];t.querySelectorAll(".adunit").forEach(e=>{e.id.endsWith(`_${i}`)||t.id.endsWith("_/_d+$/")||(e.id=`${e.id}_${i}`)})}})}reloadArticleAds(){const t=document.querySelectorAll('div[id^="infiniteArticle-"]'),e=[];t.forEach(t=>{t.querySelectorAll(".adunit").forEach(t=>e.push(t))}),e.forEach(t=>{if(t.id.endsWith(`_${this.articleId}`)){const e=this.getTags(this.articleId),i=e.split(","),s=`context_${this.getPageType(this.articleId)}
6_section_${this.getSection(this.articleId)}`,n=this.getPageType(this.articleId),o=this.getSection(this.articleId);window.lwhb.cmd.push(()=>{window.lwhb.loadAd({adUnitName:t.id.replace(`_${this.articleId}`,""),tagId:t.id,ignoreVisibility:!0,keywords:{tags:e,contextAndSection:s,context:n,section:o},ortb2:{ext:{data:{tags:i,contextAndSection:s,context:n,section:o}}}})})}})}getTags(t){if(!window.lab_article_data||!window.lab_article_data[t])return"";const{tagsString:e}=window.lab_article_data[t];return e}getPageType(t){if(!window.lab_article_data||!window.lab_article_data[t])return"";const{pageType:e}=window.lab_article_data[t];return e}getSection(t){if(!window.lab_article_data||!window.lab_article_data[t])return"";const{section:e}=window.lab_article_data[t];return e}},window.Dac=window.Dac||{},window.Dac.Definition=class{constructor(t){this.id=t||"mainArticleSection",this.article=document.getElementById(this.id),this.dfns=this.article?this.article.querySelectorAll("dfn"):[],this.template=document.querySelector("template.definitionTemplate"),this.openPopup=this.openPopup.bind(this),this.closePopup=this.closePopup.bind(this),this.setup()}setup(){this.dfns.forEach(t=>{t.addEventListener("click",this.openPopup),t.addEventListener("keydown",this.openPopup)})}closePopup(){const t=document.querySelector(".definitionPopup");t&&t.remove()}openPopup(t){if("click"===t.type||"keydown"===t.type&&"Enter"===t.key){let e;if(t.stopPropagation(),this.closePopup(),"DFN"===t.target.tagName?e=t.target:"SPAN"===t.target.tagName&&"DFN"===t.target.parentElement.tagName&&(e=t.target.parentElement),this.template){const t=this.template.content.firstElementChild.cloneNode(!0);"SPAN"===e.parentNode.tagName?e.parentNode.parentNode.style.position="relative":e.parentNode.style.position="relative",e.after(t);const i=e.textContent;t.querySelector("p").textContent=i;const s=e.getAttribute("title");t.querySelector("span").textContent=s,t.querySelector("button").addEventListener("click",t=>{t.stopPropagation(),this.closePopup()}),document.body.addEventListener("click",e=>{t.contains(e.target)||this.closePopup()}),t.style.display="flex",t.style.top=`${e.offsetTop+e.offsetHeight+10}px`;const n=document.querySelector(".definitionPopup"),o=this.article&&this.article.querySelector(".pageWidth")&&this.article.querySelector(".pageWidth").offsetWidth;o&&(n.clientWidth+e.offsetLeft<o?(t.style.left="unset",t.style.right=o-(n.clientWidth+e.offsetLeft)+"px"):(t.style.left="0.7rem",t.style.right="0.7rem"))}}}}})();
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.