!function(){"use strict";document.body;"undefined"!=typeof window&&(void 0===window.__nectarSuppressContentTrail&&(window.__nectarSuppressContentTrail=!1),window.addEventListener("beforeunload",function(){window.__nectarSuppressContentTrail=!0}),window.addEventListener("pagehide",function(){window.__nectarSuppressContentTrail=!0}),document.addEventListener("visibilitychange",function(){"hidden"===document.visibilityState?window.__nectarSuppressContentTrail=!0:"visible"===document.visibilityState&&(window.__nectarSuppressContentTrail=!1)}),window.addEventListener("focus",function(){window.__nectarSuppressContentTrail=!1}));const e={lerp:(e,t,i)=>e+(t-e)*i,distance:(e,t,i,s)=>Math.hypot(i-e,s-t)};class t{constructor(e){if(this.el=e,this.referenceImages=[],this.placeholderElements=[],this.referenceTexts=[],this.textColors=[],this.isTextMode="text"===this.el.dataset.type,this.isTextMode){if([...this.el.querySelectorAll(".nectar-content-trail__list .nectar-content-trail__text")].forEach(e=>{this.referenceTexts.push({text:e.textContent,color:e.style.color||""})}),this.el.dataset.colors)try{this.textColors=JSON.parse(this.el.dataset.colors.replace(/"/g,'"'))}catch(e){this.textColors=[]}}else[...this.el.querySelectorAll(".nectar-content-trail__list img")].forEach(e=>{this.referenceImages.push({src:void 0!==e.dataset.nectarImgSrc&&null!==e.dataset.nectarImgSrc?e.dataset.nectarImgSrc:e.src})}),[...this.el.querySelectorAll(".nectar-content-trail__list .nectar-content-trail__image--placeholder")].forEach(e=>{this.placeholderElements.push(e)});this.referenceImagesTotal=this.isTextMode?this.referenceTexts.length:this.referenceImages.length,this.imgPosition=0,this.colorPosition=0,this.zIndexVal=1,this.imageCache=new Map,this.hasInteracted=!1,this.threshold=void 0!==this.el.dataset.frequency&&null!==this.el.dataset.frequency?this.el.dataset.frequency:100,this.threshold=parseFloat(this.threshold),this.duration=void 0!==this.el.dataset.duration&&null!==this.el.dataset.duration?this.el.dataset.duration:1,this.duration=1e3*parseFloat(this.duration),this.randomize="true"===this.el.dataset.randomize,this.randomizeRotation=void 0!==this.el.dataset.randomizeRotation&&null!==this.el.dataset.randomizeRotation&&this.el.dataset.randomizeRotation,this.randomizeRotation="true"===this.randomizeRotation,this.lerp=void 0!==this.el.dataset.lerp&&null!==this.el.dataset.lerp?this.el.dataset.lerp:70,this.lerp=Math.max(parseFloat((100-this.lerp)/100),.1),this.mousePos={x:0,y:0},this.lastMousePos={x:0,y:0},this.cacheMousePos={x:0,y:0},this.animating=!1,this.animationIn=this.el.dataset.animationIn||"none",this.animationOut=this.el.dataset.animationOut||"none",this.swiftOut="cubicBezier(0,.2,.2,1)",this.swiftOut2="easeOutQuart",this.styleSettings={none:{in:{opacity:{value:1,duration:0,easing:"easeOutExpo"}},out:{opacity:{value:0,easing:"easeOutExpo",duration:0}}},scale:{in:{opacity:{value:[0,1],duration:300,easing:"easeOutCubic"},scale:{value:[0,1],duration:this.duration,easing:this.swiftOut}},out:{opacity:{value:[1,0],duration:300,easing:"easeOutCubic",delay:Math.max(this.duration-500,0)},scale:{value:[1,0],duration:this.duration-200,easing:this.swiftOut2}}},circle_mask:{in:{opacity:{value:[0,1],duration:200,easing:"easeOutCubic"},clipPath:{value:["circle(0% at 50% 50%)",this.isTextMode?"circle(100% at 50% 50%)":"circle(75% at 50% 50%)"],duration:this.duration,easing:this.swiftOut}},out:{opacity:0,easing:"easeInOutCubic",duration:250}},fade:{in:{opacity:{value:[0,1],duration:400,easing:this.swiftOut}},out:{opacity:0,easing:this.swiftOut2,duration:400}}},this.renderedImages=[],this.maxRenderedImages=100;this.boundUpdatePosition=(e=>{const t=this.el.getBoundingClientRect();let i,s;if(e.type&&0===e.type.indexOf("touch")){if(!e.touches||0===e.touches.length)return;const t=e.touches[0];i=t.clientX,s=t.clientY}else i=e.clientX,s=e.clientY;const n=i-t.left,o=s-t.top;n<0||o<0||n>t.width||o>t.height||(this.mousePos={x:n,y:o},this.hasInteracted||(this.hasInteracted=!0,this.preloadAllImages(),this.isVisible&&!this.animating&&(this.animating=!0,this.render())))}).bind(this),this.boundTouchEnd=(e=>{this.lastMousePos={x:0,y:0}}),window.addEventListener("mousemove",this.boundUpdatePosition,{passive:!0}),this.isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),this.isMobile&&(this.el.style.pointerEvents="none",window.addEventListener("touchstart",this.boundUpdatePosition,{passive:!0}),window.addEventListener("touchmove",this.boundUpdatePosition,{passive:!0}),window.addEventListener("touchend",this.boundTouchEnd,{passive:!0})),this.isMobile&&(this.threshold=.6*this.threshold,this.lerp=Math.max(.8*this.lerp,.05)),this.isVisible=!1,this.observer=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting?(this.isVisible=!0,this.hasInteracted&&!this.animating&&(this.animating=!0,this.render())):(this.isVisible=!1,this.animating=!1)})},{threshold:0}),this.observer.observe(this.el)}destroy(){this.animating=!1,this.isVisible=!1,this.observer&&(this.observer.disconnect(),this.observer=null),this.boundUpdatePosition&&(window.removeEventListener("mousemove",this.boundUpdatePosition),this.isMobile&&(window.removeEventListener("touchstart",this.boundUpdatePosition),window.removeEventListener("touchmove",this.boundUpdatePosition),this.boundTouchEnd&&window.removeEventListener("touchend",this.boundTouchEnd))),this.renderedImages&&this.renderedImages.length>0&&(this.renderedImages.forEach(e=>{e&&e.parentNode&&(anime.remove(e),e.remove())}),this.renderedImages=[]),this.imageCache&&this.imageCache.clear()}preloadAllImages(e=!1){if(this.isTextMode||0===this.referenceImagesTotal)return;window.__nectarImageObjectURLs||(window.__nectarImageObjectURLs=new Set),window.__nectarRevokeBound||(window.addEventListener("beforeunload",function(){try{for(const e of window.__nectarImageObjectURLs)URL.revokeObjectURL(e);window.__nectarImageObjectURLs.clear()}catch(e){}}),window.__nectarRevokeBound=!0),[...new Set(this.referenceImages.map(e=>e.src))].forEach(t=>{let i=this.imageCache.get(t);if(i||(i={objectUrl:null,width:0,height:0,ready:!1,promise:null},this.imageCache.set(t,i)),e){try{if(i.objectUrl){try{URL.revokeObjectURL(i.objectUrl)}catch(e){}window.__nectarImageObjectURLs&&window.__nectarImageObjectURLs.delete(i.objectUrl)}}catch(e){}i.objectUrl=null,i.ready=!1,i.promise=null}else if(i.promise||i.ready||i.objectUrl)return;window.fetch&&window.URL&&URL.createObjectURL?i.promise=fetch(t).then(e=>{if(!e.ok)throw new Error("Image fetch failed");return e.blob()}).then(e=>(i.objectUrl=URL.createObjectURL(e),window.__nectarImageObjectURLs.add(i.objectUrl),new Promise(e=>{const t=new Image;t.onload=(()=>{i.width=t.naturalWidth,i.height=t.naturalHeight,i.ready=!0,e()}),t.src=i.objectUrl}))).catch(()=>{i.promise=new Promise(e=>{const s=new Image;s.onload=(()=>{i.width=s.naturalWidth,i.height=s.naturalHeight,i.ready=!1,e()}),s.src=t})}):i.promise=new Promise(e=>{const s=new Image;s.onload=(()=>{i.width=s.naturalWidth,i.height=s.naturalHeight,i.ready=!1,e()}),s.src=t})})}render(){if(!this.isVisible)return;if(window.nectarState&&window.nectarState.materialOffCanvasOpen)return void requestAnimationFrame(()=>this.render());if(window.__nectarSuppressContentTrail)return void requestAnimationFrame(()=>this.render());let t=e.distance(this.mousePos.x,this.mousePos.y,this.lastMousePos.x,this.lastMousePos.y);this.cacheMousePos.x=e.lerp(this.cacheMousePos.x||this.mousePos.x,this.mousePos.x,this.lerp),this.cacheMousePos.y=e.lerp(this.cacheMousePos.y||this.mousePos.y,this.mousePos.y,this.lerp),t>this.threshold&&(this.randomize?0===this.referenceImagesTotal?this.imgPosition=Math.floor(6*Math.random()):this.imgPosition=Math.floor(Math.random()*this.referenceImagesTotal):0===this.referenceImagesTotal?this.imgPosition=(this.imgPosition+1)%6:this.imgPosition=this.imgPosition0&&(this.colorPosition=(this.colorPosition+1)%this.textColors.length),this.lastMousePos=Object.assign({},this.mousePos)),requestAnimationFrame(()=>this.render())}showNextImage(){if(window.__nectarSuppressContentTrail)return;let e;if(this.isTextMode){if(0===this.referenceImagesTotal)return;const t=this.referenceTexts[this.imgPosition];if(!t)return;(e=document.createElement("div")).className="nectar-content-trail__text",e.textContent=t.text,this.textColors.length>0&&e.style.setProperty("--text-color-bg",this.textColors[this.colorPosition])}else if(0===this.referenceImagesTotal){e=document.createElement("div");const i=this.imgPosition%6+1;let s="nectar-aspect-ratio--3-2";if(this.placeholderElements.length>0){const e=this.placeholderElements[0].className.split(" ");for(var t=0;tthis.maxRenderedImages){const e=this.renderedImages.shift();e&&e.parentNode&&e.remove()}e.style.position="absolute",anime.remove(e),anime.set(e,{opacity:0,zIndex:this.zIndexVal,left:this.cacheMousePos.x,top:this.cacheMousePos.y,translateX:"-50%",translateY:"-50%",transformOrigin:"50% 50%",scale:1,rotate:!0===this.randomizeRotation?40*Math.random()-20:0}),"none"===this.animationOut?anime.timeline().add({targets:e,...this.styleSettings[this.animationIn].in,left:{value:this.mousePos.x,duration:this.duration,easing:"easeOutExpo"},top:{value:this.mousePos.y,duration:this.duration,easing:"easeOutExpo"},complete:()=>{e.remove();const t=this.renderedImages.indexOf(e);-1!==t&&this.renderedImages.splice(t,1)}}):anime.timeline().add({targets:e,...this.styleSettings[this.animationIn].in,left:{value:this.mousePos.x,duration:this.duration,easing:"easeOutExpo"},top:{value:this.mousePos.y,duration:this.duration,easing:"easeOutExpo"}}).add({targets:e,...this.styleSettings[this.animationOut].out,complete:()=>{e.remove();const t=this.renderedImages.indexOf(e);-1!==t&&this.renderedImages.splice(t,1)}})}}let i=[];function s(){i&&i.length>0&&i.forEach(e=>{e&&"function"==typeof e.destroy&&e.destroy()}),i=[];const e=document.querySelectorAll(".nectar-content-trail");0!==e.length&&e.forEach((e,s)=>{i[s]=new t(e)})}window.nectarContentTrailInit=s,"loading"===document.readyState?document.addEventListener("DOMContentLoaded",s):s(),window.addEventListener("pageshow",function(e){const t="undefined"!=typeof performance&&performance.getEntriesByType?performance.getEntriesByType("navigation"):[];if(e&&!0===e.persisted||t&&t.length>0&&"back_forward"===t[0].type){try{if(window.__nectarImageObjectURLs){for(const e of window.__nectarImageObjectURLs)try{URL.revokeObjectURL(e)}catch(e){}window.__nectarImageObjectURLs.clear()}}catch(e){}i&&i.length&&i.forEach(e=>{if(e&&e.imageCache){try{e.imageCache.forEach(e=>{if(e){if(e.objectUrl)try{URL.revokeObjectURL(e.objectUrl)}catch(e){}e.objectUrl=null,e.ready=!1,e.promise=null}})}catch(e){}e.hasInteracted&&e.preloadAllImages(!0)}}),window.__nectarSuppressContentTrail=!1}});let n=null;jQuery(window).on("vc_reload",()=>{n&&clearTimeout(n),n=setTimeout(()=>{n=null,s()},200)})}();