(()=>{var t={87344(t){class e{static defaultOptions={from:100,to:15e3,speed:2500,"refresh-interval":10,"decimal-character":".","thousand-divider":",",decimals:0};constructor(t,e=window){this.$element=t,this.$number=this.$element.find(".tve-number"),this.window=e,this.window.TCB_Front.Utils.isEditorPage()||this.$element.attr("data-init",1)}init(){this.currentValue=Number(this.getData("from")),this.started=!1,this.finished=!1,this.type=this.getData("anim");const t=this.getData("speed")+7;return this.loops=Math.ceil(t/100),this.increment=(this.getData("to")-this.getData("from"))/this.loops,this}getData(t=""){let i=this.$element.attr(`data-${t}`);return void 0===i&&(i=e.defaultOptions[t]),i}start(){"function"==typeof this[`${this.type}Animation`]&&(this.started=!0,this[`${this.type}Animation`]())}tickerAnimation(){this.loopCount=0,this.interval&&clearInterval(this.interval),this.interval=setInterval(this.updateValue.bind(this),this.getData("refresh-interval"))}slideAnimation(){this.recalculateDigitWidth();let t=this.getData("formatted-from"),e=this.getData("final-number");[t,e]=this.compareNumberRange(t,e),this.$number.empty(),e.split("").forEach((e,i)=>{const r=this.window.ThriveGlobal.$j(`<div class="tcb-digit">${e}</div>`).appendTo(this.$number);if([",","."," ","-"].includes(e))r.addClass("tcb-character-digit");else{r.empty(),e=parseInt(e);const n=this.getSize(),s=this.window.Scroller.getNewInstance({width:n,amount:n||25,direction:this.window.Scroller.DIRECTION.DOWN,interval:this.getData("speed"),separatorType:this.window.Scroller.SEPARATOR.THOUSAND});s.appendTo(r[0]);const a=t[i];[",","."," ","-"].includes(a)||s.scrollFromTo(a,e)}})}recalculateDigitWidth(){const t=this.$number.clone();t.addClass("tve-number-counter-temporary-clone").insertAfter(this.$number);let e=t.text("1").width();"italic"===t.css("font-style")&&(e+=e/10),this.window.TCB_Front.inlineCssVariable(this.$element,"--tve-number-counter-digit-width",`${e}px`),t.remove()}compareNumberRange(t,e){const i=e.length-t.length;return i>0?t="0".repeat(Math.abs(i))+t:i<0&&(e="0".repeat(Math.abs(i))+e),[t,e]}getDividerSize(){const t=this.getSize();return t<=50?10:t/5}getSize(){return parseFloat(this.$element.css("font-size"))}updateValue(){this.currentValue+=this.increment,this.loopCount++,this.render(),this.loopCount>=this.loops&&(clearInterval(this.interval),this.onFinish())}onFinish(){this.finished=!0;const t=this.getData("final-number");this.$element.find(".tve-number").html(t)}render(t){void 0===t&&(t=this.currentValue);let e=t.toFixed(this.getData("decimals"));e=e.replace(/\B(?=(?:\d{3})+(?!\d))/g,this.getData("thousand-divider"));const i=`.(?=${new Array(parseInt(this.getData("decimals"))).fill(".").join("")}$)`;0!==parseInt(this.getData("decimals"))&&(e=e.replace(new RegExp(i),this.getData("decimal-character"))),this.$number.html(e)}}t.exports=e}},e={};function i(r){var n=e[r];if(void 0!==n)return n.exports;var s=e[r]={exports:{}};return t[r](s,s.exports,i),s.exports}void 0===TCB_Front.js_modules["number-counter"]&&TCB_Front.setModuleLoadedStatus("number-counter",!1),((t,e)=>{if(TCB_Front.isModuleLoaded("number-counter"))return;const r=i(87344),n=[];t(window).on("tcb_after_dom_ready",()=>{let i=!1;t('.tve-number-counter .tve-number-wrapper:not([data-init="1"])').each((e,s)=>{const a=new r(t(s));a.$number.html(a.getData("final-number")),a.init().render(),n.push(a),i=!0}),i&&e.$window.trigger("scroll")}),e.add_scroll_callback(()=>{n.forEach(t=>{!t.started&&e.isInViewport(t.$element)&&t.start()})},e),window.TCB_Front.NumberCounter=r,e.setModuleLoadedStatus("number-counter",!0)})(ThriveGlobal.$j,TCB_Front)})();