// source --> http://racetopassiveincome.com/wp-content/themes/thrive-theme/inc/assets/dist/frontend.min.js?ver=2.7.2 
/*! Thrive Themes 2021-07-30
* http://www.thrivethemes.com/
* Copyright (c) 2021 Thrive Themes */

"use strict";function _possibleConstructorReturn(e,t){return!t||"object"!==_typeof(t)&&"function"!=typeof t?_assertThisInitialized(e):t}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,i){return t&&_defineProperties(e.prototype,t),i&&_defineProperties(e,i),e}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(a){var f,d,s,p,m,o={".js":[],".json":[],".css":[],".html":[]},c="function"==typeof require?require:null;return p=function(e){var t=new Error("Could not find module '"+e+"'");return t.code="MODULE_NOT_FOUND",t},m=function(e,t,i){var n,s;if("function"==typeof e[t+i])return t+i;for(n=0;s=o[i][n];++n)if("function"==typeof e[t+s])return t+s;return null},f=function(e,t,i,n,s,o){var r,l,a,c,h,u;for("."!==(r=(i=i.split("/")).pop())&&".."!==r||(i.push(r),r="");null!=(l=i.shift());)if(l&&"."!==l&&(".."===l?(e=t.pop(),o=o.slice(0,o.lastIndexOf("/"))):(t.push(e),e=e[l],o+="/"+l),!e))throw p(n);if(r&&"function"!=typeof e[r]&&((u=m(e,r,".js"))||(u=m(e,r,".json")),u||(u=m(e,r,".css")),u||(u=m(e,r,".html")),u?r=u:2!==s&&"object"===_typeof(e[r])&&(t.push(e),e=e[r],o+="/"+r,r="")),!r)return 1!==s&&e[":mainpath:"]?f(e,t,e[":mainpath:"],n,1,o):f(e,t,"index",n,2,o);if(!(h=e[r]))throw p(n);return h.hasOwnProperty("module")?h.module.exports:(a={},h.module=c={exports:a,id:o+"/"+r},h.call(a,a,c,d(e,t,o)),c.exports)},s=function(e,t,i,n){var s,o=i,r=i.charAt(0),l=0;if("/"===r){if(o=o.slice(1),!(e=a["/"])){if(c)return c(i);throw p(i)}n="/",t=[]}else if("."!==r){if(s=o.split("/",1)[0],!(e=a[s])){if(c)return c(i);throw p(i)}n=s,t=[],(o=o.slice(s.length+1))||(l=(o=e[":mainpath:"])?1:(o="index",2))}return f(e,t,o,i,l,n)},(d=function(t,i,n){return function(e){return s(t,[].concat(i),e,n)}})(a,[],"")}({workspace:{inc:{assets:{js:{frontend:{"jquery-plugins.js":function(e,t,i){var o;o=ThriveTheme.$,t.exports={isOnScreen:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:["top","right","bottom","left"];e="string"==typeof e?[e]:e;var t=o(window),i={top:t.scrollTop(),left:t.scrollLeft()},n=this.offset(),s=!0;return i.right=i.left+t.width(),i.bottom=i.top+t.height(),n.right=n.left+this.outerWidth(),n.bottom=n.top+this.outerHeight(),e.forEach(function(e){switch(e){case"top":s=s&&n.top<i.bottom&&n.top>i.top;break;case"bottom":s=s&&n.bottom<i.bottom&&n.bottom>i.top;break;case"right":s=s&&n.right<i.right&&n.right>i.left;break;case"left":s=s&&n.left>i.left&&n.left<i.right;break;default:s=!(i.right<n.left||i.left>n.right||i.bottom<n.top||i.top>n.bottom)}}),s}}},"main.js":function(e,t,i){var l,n,s,o,r;window.ThriveTheme={$:jQuery.noConflict()},l=ThriveTheme.$,n="undefined"==typeof TCB_Front?{}:TCB_Front,s=i("./models/comments"),o=i("./models/dynamic-video"),r=i("./models/dynamic-audio"),n&&n.identifiers&&(n.identifiers.parentStickyParent+=",.theme-section",n.identifiers.pageStickyParent+=",#wrapper,.theme-section",n.identifiers.stickyParentType+=",.theme-section",n.identifiers.parentZindexFix="".concat(n.identifiers.parentZindexFix?n.identifiers.parentZindexFix+",":"",".theme-section")),l.fn.extend(i("./jquery-plugins")),ThriveTheme.localize=thrive_front_localize,ThriveTheme.utils=i("./utils/general"),ThriveTheme.initElements=function(){ThriveTheme.$sections={sidebar:l("#theme-sidebar-section"),content:l("#theme-content-section")},ThriveTheme.hasAdminBar=window.document.body.classList.contains("admin-bar"),ThriveTheme.sidebar=i("./models/sidebar")(l,ThriveTheme.$sections.sidebar,TCB_Front),ThriveTheme.progressBar=i("./models/progress-bar")(l,l(".thrive-progress-bar"))},l(function(){var e,t;ThriveTheme.initElements(),tve_frontend_options.is_editor_page?(t=TVE.CONST.theme.is_theme_template?(e=ThriveTheme.localize.tar_post_url,".tar-redirect"):(e=ThriveTheme.localize.template_url,".theme-template-redirect"),TVE.main.sidebar_extra.$el.find(t).attr("href",e)):function(){l(".comment-form").each(function(e,t){var i=l(t);0===i.closest(".woocommerce-Reviews").length&&new s(i)}),l(".thrv_responsive_video[data-type=dynamic]").each(function(e,t){o.instance(l(t)).initAttributes().makeAutoplayVideo()}),l(".thrv_audio[data-type=dynamic]").each(function(e,t){r.instance(l(t)).initAttributes().makeAutoplayAudio()});var e=l(".thrv_contents_table").not("#tve_editor .thrv_contents_table");0<e.length&&e.tableOfContents({target:".tcb-post-content"}).addClass("tve-rendered");var t=l(".tve-dynamic-toc");0<t.length&&t.tableOfContents({target:".tcb-post-content"}).addClass("tve-rendered"),n.toc&&n.toc.initToc(n.$body)}(),thrive_front_localize.is_singular||l("body").on("tcb_post_list_identifier.tcb","#main",function(e){return e.identifier="#main",e}).on("tcb_pagination_extra_classes.tcb","#main",function(e){var t=i("./models/pagination-infinite-scroll");return e.paginationClasses={infinite_scroll:t},e}).on("tcb_after_numeric_pagination_render",'.tcb-pagination[data-list="#main"]',function(e,t){var i=thrive_front_localize.pagination_url.template,n=function(e){return 1===parseInt(e)?thrive_front_localize.pagination_url.base:i.replace("[thrive_page_number]",e)};for(var s in t.$pageNumberContainer.find(".tcb-pagination-link").each(function(e,t){l(t).find("a").attr("href",n(t.dataset.page))}),t.buttons){var o=t.buttons[s],r=o.hasClass("tcb-disabled-pagination-button");o.find("a").attr("href",r?"":n(o.attr("data-page")))}}),l(window).trigger("theme.frontend.init")})},models:{"comments.js":function(e,t,i){var o,r,n,l,s;o=ThriveTheme.$,r=i("../utils/validation"),l="."+(n="error-message"),s=function(){function t(e){_classCallCheck(this,t),this.$form=e,this.addErrorFields(),this.$form.submit(function(e){t.submitAction(e,o(this))})}return _createClass(t,[{key:"addErrorFields",value:function(){this.$form.find(":input:visible:not(input[type=radio]),textarea:visible").after('<span class="'+n+'"></span>')}}],[{key:"submitAction",value:function(e,t){var n=JSON.parse(t.closest("#comments").find(".thrive-theme-comments-error-msg").html()),i=t.find(".comment-form-text textarea, .comment-form-item :input"),s=!0;if(t.find(l).hide(),i.each(function(e,t){var i=o(this).next(l);t.required&&!t.value&&(i.text(n.required).show(),s=!1),r.validateField(t.name,t.value,t.required)||(i.text(n[t.name]).show(),s=!1),0<i.text().length&&t.setAttribute("class",((t.getAttribute("class")||"")+" comment-it-error").trim())}),!s)return e.preventDefault(),e.stopPropagation(),!1;i.each(function(e,t){t.value=r.escapeHtml(t.value)})}}]),t}(),t.exports=s},"dynamic-audio.js":function(e,t,i){var n,s;n=ThriveTheme.$,s=function(){function t(e){_classCallCheck(this,t),this.$element=e}return _createClass(t,[{key:"initAttributes",value:function(){var i=this;return this.$element.find(".tve_audio_container").each(function(e,t){n.each(t.attributes,function(e,t){!["class","data-css","style"].includes(t.name)&&t.value.length&&i.$element.attr(t.name,t.value)})}),this}},{key:"makeAutoplayAudio",value:function(){return(0<arguments.length&&void 0!==arguments[0]?arguments[0]:ThriveTheme.localize.is_editor)||(this.$element.find("audio").each(function(){var e=this;if(this.hasAttribute("data-autoplay")){var t=this.play();null!==t&&t.catch(function(){e.play()})}}),this.$element.find('iframe[data-provider="soundcloud"][data-autoplay="1"]').each(function(){var e=this.getAttribute("src").replace("&auto_play=0","")+"&auto_play=1";this.setAttribute("src",e)})),this}},{key:"getData",value:function(e){return this.$element.attr("data-".concat(e))}}],[{key:"instance",value:function(e){return new t(e)}}]),t}(),t.exports=s},"dynamic-video.js":function(e,t,i){var n,s;n=ThriveTheme.$,s=function(){function t(e){_classCallCheck(this,t),this.$element=e}return _createClass(t,[{key:"initAttributes",value:function(){var i=this;return this.$element.find(".tve_responsive_video_container").each(function(e,t){n.each(t.attributes,function(e,t){!["class","data-css","style"].includes(t.name)&&t.value.length&&i.$element.attr(t.name,t.value)})}),this}},{key:"makeAutoplayVideo",value:function(){if(!(0<arguments.length&&void 0!==arguments[0]?arguments[0]:ThriveTheme.localize.is_editor)){var e,t,i=this.$element.find("iframe, video"),n=this.getData("provider");if("1"===this.getData("autoplay")){switch(n){case"youtube":e="&autoplay=1&mute=1";break;case"vimeo":e="&autoplay=1&muted=1";break;case"wistia":e="&autoPlay=true&muted=true"}if("youtube"===n||"vimeo"===n||"wistia"===n)(t=this.getData("src"))&&0!==t.length&&-1===t.indexOf(e)&&("?"===t.charAt(t.length-1)&&(e=e.substr(1)),i.attr("src",t+e));else if("custom"===n||"self"===n){var s=i.get(0);s.muted=!0,s.paused&&s.play()}return this}}}},{key:"getData",value:function(e){return this.$element.attr("data-".concat(e))}}],[{key:"instance",value:function(e){return new t(e)}}]),t}(),t.exports=s},"pagination-infinite-scroll.js":function(e,t,i){var n,s;n=ThriveTheme.$,s=function(e){function i(e,t){return _classCallCheck(this,i),_possibleConstructorReturn(this,_getPrototypeOf(i).call(this,e,t))}return _inherits(i,TCB_Front.Pagination),_createClass(i,[{key:"addLoadListeners",value:function(){var e=this;n(window).scroll(function(){e.list.$element.isOnScreen("bottom")&&e.load()})}},{key:"load",value:function(){var t=this;if(!this.isLoading()){this.enableLoading("load-bot");var e=this.list.listArgs;e.query.paged+=1,this.list.getItems(function(e){t.list.insertItems(e),t.disableLoading()},e)}}},{key:"render",value:function(){}}]),i}(),t.exports=s},"progress-bar.js":function(e,t,i){t.exports=function(i,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:window,s=i(window),o=i(document),r=i("body"),l=i("#thrive-header");return new(function(){function t(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:i();_classCallCheck(this,t),this.$countdown=i('span[data-shortcode="thrive_remaining_time"]'),(e.length||this.$countdown.length)&&(this.$element=e,this.$postContent=i(".tcb-post-content:not(.tcb-post-list .tcb-post-content)"),this.prevScroll=0,this.$postContent.length&&(this.postContentOffsetTop=this.$postContent.offset().top,"undefined"!=typeof ResizeObserver&&new ResizeObserver(this.initialState.bind(this)).observe(this.$postContent[0]),this.init()))}return _createClass(t,[{key:"init",value:function(){var e=this;this.initialState(),n.tve_frontend_options.is_editor_page||(this.setPosition(),s.off("scroll.progress").on("scroll.progress",function(){e.scrollTop=o.scrollTop(),e.onScroll()}).trigger("scroll.progress"))}},{key:"initialState",value:function(){var e=this.$postContent[0].getBoundingClientRect();this.contentTop=e.top-s.height()+o.scrollTop(),this.totalDistance=e.bottom-e.top,this.totalMinutes=ThriveTheme.utils.readingMinutes(this.$postContent),this.setCountdown(0)}},{key:"onScroll",value:function(){if(this.isPostContentIntoView()){var e=100*(this.scrollTop-this.contentTop)/this.totalDistance;this.setProgress(e),this.setCountdown(e),this.setPosition(),this.scrollDir=this.scrollTop>=this.prevScroll?"Down":"Up",this.prevScroll=this.scrollTop}0===this.scrollTop&&this.setProgress(0),this.toggleBar()}},{key:"toggleBar",value:function(e){if(void 0===e)if("under"===this.$element.attr("data-position")){var t=l.hasClass("tve-scroll-sticky")||l.hasClass("tve-scroll-appear")&&"Up"===this.scrollDir;e=0!==this.scrollTop&&t&&parseInt(l.css("top"))>=r.offset().top}else e=0!==this.scrollTop;this.$element.toggleClass("show",e)}},{key:"setProgress",value:function(e){this.$element.attr("value",e)}},{key:"setCountdown",value:function(e){if(this.$countdown.length){var t=0===e?this.totalMinutes:this.totalMinutes-Math.floor(this.totalMinutes*(e/100)),i=l.find('.thrive-symbol-shortcode-scroll span[data-shortcode="thrive_remaining_time"]');i.length&&(this.$countdown=this.$countdown.add(i)),this.$countdown.html(t<=0?"<1":t)}}},{key:"setPosition",value:function(){var e=TCB_Front.bodyOffsetTop(),t=0;if("under"===this.$element.attr("data-position")&&l.length){var i=l.find(".thrive-symbol-shortcode-scroll");t=i.length?i[0].getBoundingClientRect().bottom:l[0].getBoundingClientRect().bottom}this.$element.css("top",t||e)}},{key:"isPostContentIntoView",value:function(){return this.postContentOffsetTop<=this.scrollTop+s.height()}}]),t}())(e)}},sidebar:{"off-screen.js":function(e,t,i){t.exports=function(){var s=0<arguments.length&&void 0!==arguments[0]?arguments[0]:jQuery,o=1<arguments.length&&void 0!==arguments[1]?arguments[1]:window,r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:document.body;return function(){function i(e){_classCallCheck(this,i),this.sidebarInstance=e,this.$element=e.$element,this.element=e.$element[0],this.$main=e.$element.parent(),this.inEditor=e.constructor.inEditor&&TVE.Theme&&TVE.Theme.template;var t=e.getJsonData("off-screen");this.setConfig(t)}return _createClass(i,null,[{key:"clickListener",get:function(){return"click.off-screen"}},{key:"defaultSettings",get:function(){return{display:{desktop:"slide",mobile:"slide"},visibleOnLoad:{desktop:!0,mobile:!1},visibleInEditor:!0,hasOverlay:{desktop:!1},hasDefaultTrigger:{desktop:!0},hasCloseIcon:{desktop:!0},sidebarWidth:null,triggerPosition:{desktop:"center"},collapsedIcon:"icon-menu-left-solid",expandedIcon:"icon-menu-right-solid",closeIcon:"icon-close-solid"}}},{key:"triggerSelector",get:function(){return".tve-off-screen-sidebar-trigger"}},{key:"closeIconSelector",get:function(){return".tve-sidebar-close-icon"}}]),_createClass(i,[{key:"init",value:function(){var e=this;return this.sidebarSide=this.$main.hasClass("flip-sections")?"left":"right",r.setAttribute("data-off-screen-side",this.sidebarSide),r.setAttribute("data-off-screen-type",this.getConfig("display",this.getDevice())),r.classList.add("theme-has-off-screen-sidebar"),this.updateSidebarWidth(),this.initDefaultTrigger(),this.initCloseIcon(),this.toggleCloseIcon(this.getConfig("hasCloseIcon",this.getDevice())),r.classList.remove("visible-off-screen-sidebar"),this.element.classList.remove("theme-has-off-screen-overlay"),this.element.classList.remove("sidebar-off-screen-on-".concat(this.getDevice())),this.element.style.display="block",this.inEditor?this.getConfig("visibleInEditor")&&setTimeout(function(){return e.toggle(!0)},24):(this.setSidebarTop(),s(document).off("keyup.off-screen").on("keyup.off-screen",this.onKeyUp.bind(this)),this.getConfig("hasOverlay",this.getDevice())&&this.$element.off(i.clickListener).on(i.clickListener,this.onClick.bind(this)),this.isVisibleOnLoad()&&setTimeout(function(){return e.toggle(!0)},24),this.$element.appendTo(s("#wrapper"))),this}},{key:"isVisibleOnLoad",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.getDevice(),t=null;return!this.inEditor&&"mobile"!==e&&ThriveTheme.localize.is_user_logged_in&&ThriveTheme.localize.sidebar_visibility&&void 0!==ThriveTheme.localize.sidebar_visibility[e]&&(t=!!parseInt(ThriveTheme.localize.sidebar_visibility[e])),null===t&&(t=this.getConfig("visibleOnLoad",e)),t}},{key:"initDefaultTrigger",value:function(){var e=this;this.$trigger=this.$element.find(i.triggerSelector),this.inEditor?(this.$trigger.data("tcb-elem-type","sidebar-trigger"),this.$trigger.attr("data-selector",i.triggerSelector)):this.$trigger.off(i.clickListener).on(i.clickListener,function(){e.toggle(!e.isVisible())}),this.$trigger.css({display:this.getConfig("hasDefaultTrigger",this.getDevice())?"flex":"none"});var t=this.getConfig("triggerPosition",this.getDevice());r.classList.contains("admin-bar")&&"top"===t&&this.$trigger.css({top:o.TCB_Front.bodyOffsetTop()}),this.element.setAttribute("data-trigger-position",t)}},{key:"initCloseIcon",value:function(){var e=this;this.inEditor?this.$element.find(i.closeIconSelector).attr("data-selector",i.closeIconSelector).addClass("tve_no_icons tve_no_drag"):s(document).off(i.clickListener).on(i.clickListener,i.closeIconSelector,function(){return e.toggle(!1)})}},{key:"destroy",value:function(){return r.classList.remove("theme-has-off-screen-sidebar"),r.classList.remove("visible-off-screen-sidebar"),this.element.style.removeProperty("top"),this.element.style.removeProperty("height"),this.element.style.removeProperty("display"),this.element.style.removeProperty("min-width"),this.element.classList.remove("sidebar-off-screen-on-".concat(this.getDevice())),this.$trigger&&this.$trigger.hide(),this.toggleCloseIcon(!1),"wrapper"===this.$element.parent().attr("id")&&this.$element.insertBefore(s(".main-columns-separator")),this}},{key:"toggle",value:function(e){var t=this;void 0===e&&(e=!this.isVisible());var i=this.getDevice();return this.$element.hasClass("tcb-".concat(i,"-hidden"))&&(e=!1),e&&this.getConfig("hasOverlay",i)?(this.element.classList.add("theme-has-off-screen-overlay"),setTimeout(function(){r.classList.toggle("visible-off-screen-sidebar",e)},42)):(r.classList.toggle("visible-off-screen-sidebar",e),setTimeout(function(){t.element.classList.remove("theme-has-off-screen-overlay")},420)),!this.sidebarInstance.constructor.inEditor&&ThriveTheme.localize.is_user_logged_in&&"mobile"!==i&&this.updateUserSidebarSettings(e),setTimeout(function(){tve_frontend_options.is_editor_page&&o.TCB_Front.resizePageSection(),TCB_Front.handleIframes(t.$element,e)},500),this}},{key:"setConfig",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this.config=e,this}},{key:"getConfig",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,i=this.config;return e&&(i=i[e],t&&(i=this.sidebarInstance.getConfigByDevice(i,t))),i}},{key:"updateSidebarWidth",value:function(e){var t=s(o).width();if(void 0===e){switch(this.getDevice()){case"desktop":var i=getComputedStyle(this.element.parentElement);e="wrap"===i.flexWrap?parseInt(i.width)/2:parseFloat(i.getPropertyValue("--sidebar-size"))*parseInt(i.width)/100-parseFloat(i.getPropertyValue("--separator-size"))/2;break;case"tablet":e=t/2;break;case"mobile":e=t-24}var n=this.$element.css("min-width");n.includes("%")?n=parseInt(n)*t/100:(n=parseInt(n),isNaN(n)&&(n=0)),e=Math.max(n,e)}return t<=e&&(e=t-24),parseInt(this.$element.css("min-width"))&&this.$element.css("min-width","".concat(e,"px")),r.style.setProperty("--off-screen-sidebar-size","".concat(e,"px")),e}},{key:"toggleCloseIcon",value:function(){var e=!(0<arguments.length&&void 0!==arguments[0])||arguments[0];this.$element.find(i.closeIconSelector).toggle(e)}},{key:"setSidebarTop",value:function(){var e=o.TCB_Front.bodyOffsetTop();this.$element.css({top:"".concat(e,"px"),height:"calc(100vh - ".concat(e,"px)")})}},{key:"updateUserSidebarSettings",value:function(e){("object"!==_typeof(ThriveTheme.localize.sidebar_visibility)||Array.isArray(ThriveTheme.localize.sidebar_visibility))&&(ThriveTheme.localize.sidebar_visibility={}),ThriveTheme.localize.sidebar_visibility[this.getDevice()]=e?1:0,s.ajax({url:"".concat(ThriveTheme.localize.routes.frontend,"/user_options"),headers:{"X-WP-Nonce":tve_frontend_options.nonce},type:"POST",data:{template:ThriveTheme.localize.ID,option:"sidebar_visibility",value:ThriveTheme.localize.sidebar_visibility}})}},{key:"onClick",value:function(e){e.target.classList.contains("sidebar-section")&&this.toggle(!1)}},{key:"onKeyUp",value:function(e){"Escape"===e.key&&this.toggle(!1)}},{key:"isVisible",value:function(){return r.classList.contains("visible-off-screen-sidebar")}},{key:"getDevice",value:function(){return void 0===o.TCB_Front?TVE.main.device:o.TCB_Front.getDisplayType()}}]),i}()}},"sticky.js":function(e,t,i){t.exports=function(i){var n=i(window),s=i(document),o=i("body"),r=window.innerHeight,l=n.width(),a=o.offset().top;return function(){function t(e){_classCallCheck(this,t),this.$element=e.$element,this.element=e.$element[0],this.$content=this.$element.find(".section-content"),this.$parent=e.$element.parent(),this.setConfig(e.getJsonData("sticky")),e.constructor.inEditor||("undefined"!=typeof ResizeObserver&&(new ResizeObserver(this.onContentResize.bind(this)).observe(o[0]),new ResizeObserver(this.onContentResize.bind(this)).observe(this.element)),n.off("ultimatum.form.display").on("ultimatum.form.display",this.onContentResize.bind(this)))}return _createClass(t,[{key:"needsExtraScroll",value:function(){return this.elementHeight>r}},{key:"shouldBeSticky",value:function(){var e=768<l;if(e){var t=ThriveTheme.$sections.content.outerHeight(),i=ThriveTheme.$sections.content.offset().top;(this.offset.top>=i+t||this.offset.top+this.$element.outerHeight()<i)&&(e=!1)}return e}},{key:"setConfig",value:function(e){this.config=e}},{key:"isSticky",value:function(){return this.element.classList.contains("tve-is-sticky")}}],[{key:"defaultSettings",get:function(){return{sticky:!1,delta:0,stickyUntil:"main",element:""}}}]),_createClass(t,[{key:"init",value:function(){var e=this;this.isSticky()&&this.destroy(),r=window.innerHeight,l=n.width(),a=o.offset().top,this.delta=parseInt(this.config.delta),this.offset=this.$element.offset(),this.$sidebarClone.hide(),this.prevScroll=0,this._sentinelTop=null,this.stickySide=this.$parent.hasClass("flip-sections")?"left":"right",this.elementWidth=this.$element.outerWidth(),this.parentTopPadding=parseInt(this.$parent.css("padding-top")),n.off("scroll.sidebar"),this.shouldBeSticky()&&(this.element.classList.add("tve-sticky-sidebar"),this.element.style.alignItems=this.$content.css("justify-content"),this.setElementHeight(),this.$sidebarClone.css("height","".concat(this.elementHeight,"px")),n.on("scroll.sidebar",function(){e.scrollTop=s.scrollTop(),e.scrollDir=e.scrollTop>=e.prevScroll?"Down":"Up",e.prevScroll=e.scrollTop,e.elementTop=parseInt(e.element.style.top),e.onScroll(),e["onScroll".concat(e.scrollDir)]()}).trigger("scroll.sidebar"))}},{key:"setElementHeight",value:function(){return this.elementHeight=this.$content.outerHeight(),this.elementHeight<r&&(this.elementHeight=this.$element.outerHeight()),this}},{key:"onScroll",value:function(){this.hasReachedSentinel()||this.needsExtraScroll()||(this.offset.top<=this.scrollTop+this.delta+a?(this.isSticky()||this.makeItSticky(),this.element.style.position="fixed",this.element.style.left="".concat(this.offset.left,"px"),this.element.style.top="".concat(this.delta+a,"px")):this.isSticky()&&this.destroy())}},{key:"onScrollDown",value:function(){if(this.hasReachedSentinel()&&this.isSticky()){var e=this.sentinelTop+this.parentTopPadding-this.elementHeight-this.offset.top;this.needsExtraScroll()&&(e-=this.delta),this.element.style.removeProperty("left"),this.element.style.removeProperty("bottom"),this.element.style.removeProperty("position"),this.element.style.top="".concat(e,"px")}else if(this.needsExtraScroll()&&("fixed"!==this.element.style.position||!this.element.style.bottom))if("fixed"===this.element.style.position&&this.element.style.top){var t=this.$element.offset();this.element.style.removeProperty("position"),this.element.style.removeProperty("left"),this.element.style.top="".concat(t.top+this.delta-this.offset.top,"px")}else{var i=this.offset.top+this.elementHeight;this.elementTop&&(i+=this.elementTop-this.parentTopPadding),this.scrollTop+r>i+this.delta&&(this.isSticky()||this.makeItSticky(),this.element.style.position="fixed",this.element.style.left="".concat(this.offset.left,"px"),this.element.style.bottom="".concat(this.delta,"px"),this.element.style.removeProperty("top"))}}},{key:"onScrollUp",value:function(){if(this.needsExtraScroll()&&this.isSticky()&&!this.hasReachedSentinel())if("fixed"===this.element.style.position&&this.element.style.bottom){var e=this.$element.offset();this.element.style.removeProperty("position"),this.element.style.removeProperty("left"),this.element.style.removeProperty("bottom"),this.element.style.top="".concat(e.top+this.parentTopPadding-this.offset.top,"px")}else{if("fixed"===this.element.style.position&&this.offset.top>this.scrollTop+this.delta+a)this.destroy();else this.$element.offset().top>this.scrollTop+this.delta+a&&(this.element.style.position="fixed",this.element.style.left="".concat(this.offset.left,"px"),this.element.style.top="".concat(a+this.delta,"px"))}}},{key:"hasReachedSentinel",value:function(){return this.scrollTop+r>this.sentinelTop}},{key:"onContentResize",value:function(){this._sentinelTop=null,a=o.offset().top,this.offset=(this.isSticky()?this.$sidebarClone:this.$element).offset(),this.setElementHeight()}},{key:"makeItSticky",value:function(){this.$sidebarClone.show(),this.element.classList.add("tve-is-sticky"),this.element.style[this.stickySide]=this.$parent.css("padding-".concat(this.stickySide)),this.element.style.setProperty("width","".concat(this.elementWidth,"px"),"important"),this.needsExtraScroll()||(this.element.style.minHeight="calc(100vh - ".concat(a+this.delta,"px)"),this.elementHeight=this.$element.outerHeight(),this._sentinelTop=null)}},{key:"destroy",value:function(){this.$sidebarClone.remove(),this.element.classList.remove("tve-is-sticky"),this.element.style.removeProperty(this.stickySide),this.element.style.removeProperty("position"),this.element.style.removeProperty("bottom"),this.element.style.removeProperty("width"),this.element.style.removeProperty("left"),this.element.style.removeProperty("top"),this.needsExtraScroll()||this.element.style.removeProperty("min-height")}},{key:"sentinelTop",get:function(){if(null===this._sentinelTop){switch(this.config.stickyUntil){case"end":this._sentinelTop=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight);break;case"element":if(this.config.element=this.config.element.replace(/([^a-zA-Z0-9_-])/g,"").trim(),""!==this.config.element){var e=i("#".concat(this.config.element));e.length&&e.offset().top>this.offset.top+this.elementHeight&&(this._sentinelTop=e.offset().top)}}null===this._sentinelTop&&(this._sentinelTop=this.$parent.offset().top+this.$parent.outerHeight())}return this._sentinelTop}},{key:"$sidebarClone",get:function(){var e=this.$parent.find(".sidebar-empty-clone");return e.length?e:i('<div class="sidebar-section sidebar-empty-clone"></div>').insertAfter(this.$element)}}]),t}()}}},"sidebar.js":function(e,t,s){t.exports=function(i,e,o){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:window,t=4<arguments.length&&void 0!==arguments[4]?arguments[4]:document.body,r=s("./sidebar/sticky")(i),l=s("./sidebar/off-screen")(i,n,t),a=n.outerWidth;return new(function(){function s(){var t=this,e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:i();_classCallCheck(this,s),this.$element=e,this.$content=e.find(".section-content"),e&&e.length&&(this.init(),s.inEditor?(this.sidebarTypeInit().fixContentHeight(),"undefined"!=typeof ResizeObserver&&new ResizeObserver(function(){t.fixContentHeight()}).observe(this.$content[0])):(i(n).on("resize",function(e){e.detail&&e.detail.fromTcb||a===n.outerWidth||(a=n.outerWidth,t.sidebarTypeInit().fixContentHeight())}),i(function(){return t.sidebarTypeInit().fixContentHeight()})))}return _createClass(s,null,[{key:"getDefaultValues",value:function(){var e;switch(0<arguments.length&&void 0!==arguments[0]?arguments[0]:""){case"sticky":e=r.defaultSettings;break;case"off-screen":e=l.defaultSettings;break;case"display-type":e={desktop:"normal"};break;default:e={}}return e}},{key:"inEditor",get:function(){return!!n.tve_frontend_options.is_editor_page}}]),_createClass(s,[{key:"init",value:function(){this.$element.data("sticky",new r(this)),this.$element.data("off-screen",new l(this))}},{key:"sidebarTypeInit",value:function(){var t=this;if(!this.isHidden()){["sticky","off-screen"].forEach(function(e){return t._get(e)&&t._get(e).destroy()});var e=this.getDisplayType();("sticky"===e&&!s.inEditor||"off-screen"===e)&&this._get(e).init()}return this}},{key:"_get",value:function(e){return this.$element.data(e)}},{key:"getJsonData",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:null,i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null,n=this.$element.attr("data-".concat(t));try{n=JSON.parse(n)}catch(e){n=s.getDefaultValues(t)}return e&&(n=n[e]),i&&(n=this.getConfigByDevice(n,i)),n}},{key:"getConfigByDevice",value:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:o.getDisplayType(),i=this.getDisplayType(t),n=[t];for("mobile"===t&&i===this.getDisplayType("tablet")&&n.push("tablet"),n.push("desktop");void 0===e[n[0]]&&n.length;)n.shift();return n[0]?e[n[0]]:null}},{key:"setJsonData",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"",i=1<arguments.length?arguments[1]:void 0,n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"",s=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;"object"===_typeof(i)?e=i:(e=this.getJsonData(t),s?e[i][s]=n:e[i]=n);try{this.$element.attr("data-".concat(t),JSON.stringify(e))}catch(e){this.$element.attr("data-".concat(t),JSON.stringify(this.getJsonData(t)))}return this}},{key:"isSticky",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:o.getDisplayType();return"sticky"===this.getDisplayType(e)}},{key:"isOffScreen",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:o.getDisplayType();return"off-screen"===this.getDisplayType(e)}},{key:"isHidden",value:function(){return this.$element.hasClass("hide-section")}},{key:"getDisplayType",value:function(){var e,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:o.getDisplayType(),i=this.getJsonData("display-type");return"mobile"!==t&&this.getJsonData("sticky","sticky")?this.getJsonData("sticky","visibleOn").includes(t)&&(e="sticky"):e=i[t],e||(e="mobile"===t&&i.tablet?i.tablet:i.desktop),"sticky"===e&&"mobile"===t&&(e="sticky"===i.tablet?"sticky"===i.desktop?"normal":i.desktop:i.tablet),e}},{key:"offScreenRefresh",value:function(){var e=0<arguments.length&&void 0!==arguments[0]&&arguments[0];if(this.isOffScreen()){var t=this._get("off-screen"),i=t.isVisible();e&&t.destroy();var n=this.getJsonData("off-screen");t.setConfig(n).init(),(i||s.inEditor&&n.visibleInEditor)&&t.toggle(!0)}}},{key:"updateConfig",value:function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.getDisplayType(),t=this._get(e);return t&&"function"==typeof t.setConfig&&t.setConfig(this.getJsonData(e)),this}},{key:"fixContentHeight",value:function(){if("normal"!==this.$content.css("justify-content")){this.$content.css("display","block");var e=Array.from(this.$content.children()).reduce(function(e,t){return e+i(t).outerHeight(!0)},0);this.$content.height()>e&&this.$content.css("display","flex")}}}]),s}())(e)}}},utils:{"general.js":function(e,t,i){var s=["noscript","img","style","script",".tcb-post-list-dynamic-style",".thrive-colors-palette-config",".thrive-local-colors-config",".thrive-group-edit-config",".tve_custom_style",".thrive-shortcode-config",".tqb-shortcode-wrapper",".thrive-quiz-builder-shortcode",".thrv_lead_generation_code"];t.exports={addHttp:function(e){return(e=e.trim())&&!/^(?:f|ht)tps?\:\/\//.test(e)&&(e="http://"+e),e},readingMinutes:function(e){return Math.floor(this.countWords(e)/200)},countWords:function(e){var t=e.clone();t.find(s.join(", ")).remove();var i=t.text(),n=0;return"string"==typeof i&&(n=i.match(/[a-zA-Z0-9_'\u0392-\u03c9\u0400-\u04FF\u0027]+|[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af\u0400-\u04FF]+|[\u00E4\u00C4\u00E5\u00C5\u00F6\u00D6]+|[\u0531-\u0556\u0561-\u0586\u0559\u055A\u055B]+|\w+/g)),n?n.length:0},throttle:function(n,s){var o=2<arguments.length&&void 0!==arguments[2]&&arguments[2],r=null,l=!0;return function(){var e=this,t=arguments,i=function(){n.apply(e,t),r=null};o&&l&&(l=!1,i()),r||(r=setTimeout(i,s))}}}},"validation.js":function(e,t,i){var s=i("./general"),n=function(){function n(){_classCallCheck(this,n)}return _createClass(n,null,[{key:"validateField",value:function(e,t){if(!(!(2<arguments.length&&void 0!==arguments[2])||arguments[2])&&0===t.trim().length)return!0;var i="validate_"+e;return"function"!=typeof n[i]||n[i](t)}},{key:"validateEmail",value:function(e){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(e)}},{key:"validateUrl",value:function(e){return null!==s.addHttp(e).match(/(http(s)?:\/\/.)(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g)}},{key:"escapeHtml",value:function(e){var t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#x60;","=":"&#x3D;"};return String(e).replace(/[&<>"'`=\/]/g,function(e){return t[e]?t[e]:e})}}]),n}();t.exports=n}}}}}}}})("workspace/inc/assets/js/frontend/main");