(function(n,t){typeof exports=="object"&&typeof module!="undefined"?module.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self,n.ScrollReveal=t())})(this,function(){"use strict";function pt(){return document.documentElement.classList.remove("sr"),{clean:function(){},destroy:function(){},reveal:function(){},sync:function(){},get noop(){return!0}}}function wt(){document.documentElement.classList.add("sr");document.body?document.body.style.height="100%":document.addEventListener("DOMContentLoaded",function(){document.body.style.height="100%"})}function v(n){return typeof Node=="object"?n instanceof window.Node:n!==null&&typeof n=="object"&&typeof n.nodeType=="number"&&typeof n.nodeName=="string"}function bt(n){var t=Object.prototype.toString.call(n);return typeof NodeList=="object"?n instanceof window.NodeList:n!==null&&typeof n=="object"&&typeof n.length=="number"&&/^\[object (HTMLCollection|NodeList|Object)\]$/.test(t)&&(n.length===0||v(n[0]))}function o(n,t){if(t===void 0&&(t=document),n instanceof Array)return n.filter(v);if(v(n))return[n];if(bt(n))return Array.prototype.slice.call(n);if(typeof n=="string")try{var i=t.querySelectorAll(n);return Array.prototype.slice.call(i)}catch(r){return[]}return[]}function c(n){return n!==null&&n instanceof Object&&(n.constructor===Object||Object.prototype.toString.call(n)==="[object Object]")}function n(n,t){if(c(n)){var i=Object.keys(n);return i.forEach(function(i){return t(n[i],i,n)})}if(n instanceof Array)return n.forEach(function(i,r){return t(i,r,n)});throw new TypeError("Expected either an array or object literal.");}function r(n){for(var r=[],t=arguments.length-1,i;t-->0;)r[t]=arguments[t+1];this.constructor.debug&&console&&(i="%cScrollReveal: "+n,r.forEach(function(n){return i+="\n — "+n}),console.log(i,"color: #ea654b;"))}function ut(){var t=this,f=function(){return{active:[],stale:[]}},u=f(),i=f(),r=f();try{n(o("[data-sr-id]"),function(n){var t=parseInt(n.getAttribute("data-sr-id"));u.active.push(t)})}catch(e){throw e;}n(this.store.elements,function(n){u.active.indexOf(n.id)===-1&&u.stale.push(n.id)});n(u.stale,function(n){return delete t.store.elements[n]});n(this.store.elements,function(n){r.active.indexOf(n.containerId)===-1&&r.active.push(n.containerId);n.hasOwnProperty("sequence")&&i.active.indexOf(n.sequence.id)===-1&&i.active.push(n.sequence.id)});n(this.store.containers,function(n){r.active.indexOf(n.id)===-1&&r.stale.push(n.id)});n(r.stale,function(n){var i=t.store.containers[n].node;i.removeEventListener("scroll",t.delegate);i.removeEventListener("resize",t.delegate);delete t.store.containers[n]});n(this.store.sequences,function(n){i.active.indexOf(n.id)===-1&&i.stale.push(n.id)});n(i.stale,function(n){return delete t.store.sequences[n]})}function y(n){if(n.constructor!==Array)throw new TypeError("Expected array.");if(n.length===16)return n;if(n.length===6){var i=t();return i[0]=n[0],i[1]=n[1],i[4]=n[2],i[5]=n[3],i[12]=n[4],i[13]=n[5],i}throw new RangeError("Expected array with either 6 or 16 values.");}function t(){for(var n=[],t=0;t<16;t++)t%5==0?n.push(1):n.push(0);return n}function kt(n,t){for(var r,o,f=y(n),e=y(t),h=[],i=0;i<4;i++)for(r=[f[i],f[i+4],f[i+8],f[i+12]],o=0;o<4;o++){var u=o*4,s=[e[u],e[u+1],e[u+2],e[u+3]],c=r[0]*s[0]+r[1]*s[1]+r[2]*s[2]+r[3]*s[3];h[i+u]=c}return h}function dt(n){var i,r;return typeof n=="string"&&(i=n.match(/matrix(3d)?\(([^)]+)\)/),i)?(r=i[2].split(", ").map(parseFloat),y(r)):t()}function gt(n){var r=Math.PI/180*n,i=t();return i[5]=i[10]=Math.cos(r),i[6]=i[9]=Math.sin(r),i[9]*=-1,i}function ni(n){var r=Math.PI/180*n,i=t();return i[0]=i[10]=Math.cos(r),i[2]=i[8]=Math.sin(r),i[2]*=-1,i}function ti(n){var r=Math.PI/180*n,i=t();return i[0]=i[5]=Math.cos(r),i[1]=i[4]=Math.sin(r),i[4]*=-1,i}function ft(n,i){var r=t();return r[0]=n,r[5]=typeof i=="number"?i:n,r}function ii(n){var i=t();return i[12]=n,i}function ri(n){var i=t();return i[13]=n,i}function ui(n){var e=window.getComputedStyle(n.node),nt=e.position,t=n.config,o={},tt=n.node.getAttribute("style")||"",s=tt.match(/[\w-]+\s*:\s*[^;]+\s*/gi)||[],p,u,r,k,i,g,w;o.computed=s?s.map(function(n){return n.trim()}).join("; ")+";":"";o.generated=s.some(function(n){return n.match(/visibility\s?:\s?visible/i)})?o.computed:s.concat(["visibility: visible"]).map(function(n){return n.trim()}).join("; ")+";";var a=parseFloat(e.opacity),v=isNaN(parseFloat(t.opacity))?parseFloat(e.opacity):parseFloat(t.opacity),y={computed:a!==v?"opacity: "+a+";":"",generated:a!==v?"opacity: "+v+";":""},f=[];if(parseFloat(t.distance)){p=t.origin==="top"||t.origin==="bottom"?"Y":"X";u=t.distance;(t.origin==="top"||t.origin==="left")&&(u=/^-/.test(u)?u.substr(1):"-"+u);var b=u.match(/(^-?\d+\.?\d?)|(em$|px$|%$)/g),h=b[0],it=b[1];switch(it){case"em":u=parseInt(e.fontSize)*h;break;case"px":u=h;break;case"%":u=p==="Y"?n.node.getBoundingClientRect().height*h/100:n.node.getBoundingClientRect().width*h/100;break;default:throw new RangeError("Unrecognized or missing distance unit.");}p==="Y"?f.push(ri(u)):f.push(ii(u))}if(t.rotate.x&&f.push(gt(t.rotate.x)),t.rotate.y&&f.push(ni(t.rotate.y)),t.rotate.z&&f.push(ti(t.rotate.z)),t.scale!==1&&(t.scale===0?f.push(ft(.0002)):f.push(ft(t.scale))),r={},f.length?(r.property=et("transform"),r.computed={raw:e[r.property],matrix:dt(e[r.property])},f.unshift(r.computed.matrix),k=f.reduce(kt),r.generated={initial:r.property+": matrix3d("+k.join(", ")+");",final:r.property+": matrix3d("+r.computed.matrix.join(", ")+");"}):r.generated={initial:"",final:""},i={},y.generated||r.generated.initial){i.property=et("transition");i.computed=e[i.property];i.fragments=[];var d=t.delay,c=t.duration,l=t.easing;y.generated&&i.fragments.push({delayed:"opacity "+c/1e3+"s "+l+" "+d/1e3+"s",instant:"opacity "+c/1e3+"s "+l+" 0s"});r.generated.initial&&i.fragments.push({delayed:r.property+" "+c/1e3+"s "+l+" "+d/1e3+"s",instant:r.property+" "+c/1e3+"s "+l+" 0s"});g=i.computed&&!i.computed.match(/all 0s|none 0s/);g&&i.fragments.unshift({delayed:i.computed,instant:i.computed});w=i.fragments.reduce(function(n,t,i){return n.delayed+=i===0?t.delayed:", "+t.delayed,n.instant+=i===0?t.instant:", "+t.instant,n},{delayed:"",instant:""});i.generated={delayed:i.property+": "+w.delayed+";",instant:i.property+": "+w.instant+";"}}else i.generated={delayed:"",instant:""};return{inline:o,opacity:y,position:nt,transform:r,transition:i}}function f(n,t){t.split(";").forEach(function(t){var i=t.split(":"),r=i[0],u=i.slice(1);r&&u&&(n.style[r.trim()]=u.join(":"))})}function p(t){var i=this,u;try{n(o(t),function(n){var r=n.getAttribute("data-sr-id"),t;r!==null&&(u=!0,t=i.store.elements[r],t.callbackTimer&&window.clearTimeout(t.callbackTimer.clock),f(t.node,t.styles.inline.generated),n.removeAttribute("data-sr-id"),delete i.store.elements[r])})}catch(e){return r.call(this,"Clean failed.",e.message)}if(u)try{ut.call(this)}catch(e){return r.call(this,"Clean failed.",e.message)}}function fi(){var t=this;n(this.store.elements,function(n){f(n.node,n.styles.inline.generated);n.node.removeAttribute("data-sr-id")});n(this.store.containers,function(n){var i=n.node===document.documentElement?window:n.node;i.removeEventListener("scroll",t.delegate);i.removeEventListener("resize",t.delegate)});this.store={containers:{},elements:{},history:[],sequences:{}}}function s(t){for(var r=[],i=arguments.length-1;i-->0;)r[i]=arguments[i+1];if(c(t))return n(r,function(i){n(i,function(n,i){c(n)?(t[i]&&c(t[i])||(t[i]={}),s(t[i],n)):t[i]=n})}),t;throw new TypeError("Target must be an object literal.");}function l(n){return n===void 0&&(n=navigator.userAgent),/Android|iPhone|iPad|iPod/i.test(n)}function ot(){var t=this;ut.call(this);n(this.store.elements,function(n){var t=[n.styles.inline.generated];n.visible?(t.push(n.styles.opacity.computed),t.push(n.styles.transform.generated.final),n.revealed=!0):(t.push(n.styles.opacity.generated),t.push(n.styles.transform.generated.initial),n.revealed=!1);f(n.node,t.filter(function(n){return n!==""}).join(" "))});n(this.store.containers,function(n){var i=n.node===document.documentElement?window:n.node;i.addEventListener("scroll",t.delegate);i.addEventListener("resize",t.delegate)});this.delegate();this.initTimeout=null}function h(n,t){t===void 0&&(t={});var i=t.pristine||this.pristine,r=n.config.useDelay==="always"||n.config.useDelay==="onload"&&i||n.config.useDelay==="once"&&!n.seen,u=n.visible&&!n.revealed,f=!n.visible&&n.revealed&&n.config.reset;return t.reveal||u?ei.call(this,n,r):t.reset||f?oi.call(this,n):void 0}function ei(n,t){var i=[n.styles.inline.generated,n.styles.opacity.computed,n.styles.transform.generated.final];t?i.push(n.styles.transition.generated.delayed):i.push(n.styles.transition.generated.instant);n.revealed=n.seen=!0;f(n.node,i.filter(function(n){return n!==""}).join(" "));st.call(this,n,t)}function oi(n){var t=[n.styles.inline.generated,n.styles.opacity.generated,n.styles.transform.generated.initial,n.styles.transition.generated.instant];n.revealed=!1;f(n.node,t.filter(function(n){return n!==""}).join(" "));st.call(this,n)}function st(n,t){var r=this,u=t?n.config.duration+n.config.delay:n.config.duration,f=n.revealed?n.config.beforeReveal:n.config.beforeReset,e=n.revealed?n.config.afterReveal:n.config.afterReset,i=0;n.callbackTimer&&(i=Date.now()-n.callbackTimer.start,window.clearTimeout(n.callbackTimer.clock));f(n.node);n.callbackTimer={start:Date.now(),clock:window.setTimeout(function(){e(n.node);n.callbackTimer=null;n.revealed&&!n.config.reset&&n.config.cleanup&&p.call(r,n.node)},u-i)}}function ht(n,t){var i,r,u,f,o,e;if(t===void 0&&(t=this.pristine),!n.visible&&n.revealed&&n.config.reset)return h.call(this,n,{reset:!0});if(i=this.store.sequences[n.sequence.id],r=n.sequence.index,i){if(u=new ct(i,"visible",this.store),f=new ct(i,"revealed",this.store),i.models={visible:u,revealed:f},!f.body.length&&(o=i.members[u.body[0]],e=this.store.elements[o],e))return a.call(this,i,u.body[0],-1,t),a.call(this,i,u.body[0],1,t),h.call(this,e,{reveal:!0,pristine:t});if(!i.blocked.head&&r===[].concat(f.head).pop()&&r>=[].concat(u.body).shift())return a.call(this,i,r,-1,t),h.call(this,n,{reveal:!0,pristine:t});if(!i.blocked.foot&&r===[].concat(f.foot).shift()&&r<=[].concat(u.body).pop())return a.call(this,i,r,1,t),h.call(this,n,{reveal:!0,pristine:t})}}function si(n){var t=Math.abs(n);if(isNaN(t))throw new RangeError("Invalid sequence interval.");else this.id=w(),this.interval=Math.max(t,16),this.members=[],this.models={},this.blocked={head:!1,foot:!1}}function ct(t,i,r){var u=this;this.head=[];this.body=[];this.foot=[];n(t.members,function(n,t){var f=r.elements[n];f&&f[i]&&u.body.push(t)});this.body.length&&n(t.members,function(n,t){var f=r.elements[n];f&&!f[i]&&(t0;)u[r]=arguments[r+1];return i=null,n(u,function(r){n(r,function(n){i===null&&n.node===t&&(i=n.id)})}),i}function ci(){var t=this;n(this.store.history,function(n){lt.call(t,n.target,n.options,!0)});ot.call(this)}function yt(n,t){var f=t?n.node.clientHeight:n.node.offsetHeight,e=t?n.node.clientWidth:n.node.offsetWidth,r=0,u=0,i=n.node;do isNaN(i.offsetTop)||(r+=i.offsetTop),isNaN(i.offsetLeft)||(u+=i.offsetLeft),i=i.offsetParent;while(i);return{bounds:{top:r,right:u+e,bottom:r+f,left:u},height:f,width:e}}function vi(n){var t,i;return n.node===document.documentElement?(t=window.pageYOffset,i=window.pageXOffset):(t=n.node.scrollTop,i=n.node.scrollLeft),{top:t,left:i}}function yi(n){var t;if(n===void 0&&(n={}),t=this.store.containers[n.containerId],t){var i=Math.max(0,Math.min(1,n.config.viewFactor)),r=n.config.viewOffset,u={top:n.geometry.bounds.top+n.geometry.height*i,right:n.geometry.bounds.right-n.geometry.width*i,bottom:n.geometry.bounds.bottom-n.geometry.height*i,left:n.geometry.bounds.left+n.geometry.width*i},f={top:t.geometry.bounds.top+t.scroll.top+r.top,right:t.geometry.bounds.right+t.scroll.left-r.right,bottom:t.geometry.bounds.bottom+t.scroll.top-r.bottom,left:t.geometry.bounds.left+t.scroll.left+r.left};return u.topf.left&&u.bottom>f.top&&u.left0)-(n<0)||+n},at=Math.sign||li,vt=function(){var n=Date.now();return function(t){var i=Date.now();i-n>16?(n=i,t(i)):setTimeout(function(){return vt(t)},0)}}(),ai=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||vt,ki="4.0.9",b,k,d,g,nt,i,tt,it;return u.isSupported=function(){return wi()&&bi()},Object.defineProperty(u,"debug",{get:function(){return tt||!1},set:function(n){return tt=typeof n=="boolean"?n:tt}}),u(),u}),function(n,t){typeof exports=="object"&&typeof module!="undefined"?t(exports):typeof define=="function"&&define.amd?define(["exports"],t):(n=typeof globalThis!="undefined"?globalThis:n||self,t(n.countUp={}))}(this,function(n){"use strict";var t=undefined&&undefined.__assign||function(){return t=Object.assign||function(n){for(var t,r,i=1,u=arguments.length;iu.endVal?u.endVal:u.frameVal;u.frameVal=Number(u.frameVal.toFixed(u.options.decimalPlaces));u.printValue(u.frameVal);t1?u.options.decimal+e[1]:"",u.options.useGrouping){for(i="",r=0,s=t.length;rn;t=n-this.startVal;Math.abs(t)>this.options.smartEasingThreshold?(this.finalEndVal=n,i=this.countDown?1:-1,this.endVal=n+i*this.options.smartEasingAmount,this.duration=this.duration/2):(this.endVal=n,this.finalEndVal=null);this.useEasing=this.finalEndVal?!1:this.options.useEasing},n.prototype.start=function(n){this.error||(this.callback=n,this.duration>0?(this.determineDirectionAndSmartEasing(),this.paused=!1,this.rAF=requestAnimationFrame(this.count)):this.printValue(this.endVal))},n.prototype.update=function(n){(cancelAnimationFrame(this.rAF),this.startTime=null,this.endVal=this.validateValue(n),this.endVal!==this.frameVal)&&(this.startVal=this.frameVal,this.finalEndVal||this.resetDuration(),this.finalEndVal=null,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count))},n.prototype.printValue=function(n){var t=this.formattingFn(n),i;this.el.tagName==="INPUT"?(i=this.el,i.value=t):this.el.tagName==="text"||this.el.tagName==="tspan"?this.el.textContent=t:this.el.innerHTML=t},n.prototype.ensureNumber=function(n){return typeof n=="number"&&!isNaN(n)},n.prototype.validateValue=function(n){var t=Number(n);return this.ensureNumber(t)?t:(this.error="[CountUp] invalid start or end value: "+n,null)},n.prototype.resetDuration=function(){this.startTime=null;this.duration=Number(this.options.duration)*1e3;this.remaining=this.duration},n}();n.CountUp=i;Object.defineProperty(n,"__esModule",{value:!0})});