(()=>{"use strict";var e={n:t=>{var o=t&&t.__esModule?()=>t.default:()=>t;return e.d(o,{a:o}),o},d:(t,o)=>{for(var i in o)e.o(o,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:o[i]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)};(()=>{const t=jQuery;var o=e.n(t);const i={disable:function(){window.addEventListener&&window.addEventListener("wheel",i.preventDefaultValue,{passive:!1}),document.onkeydown=i.keyDown},enable:function(){window.removeEventListener&&window.removeEventListener("wheel",i.preventDefaultValue,{passive:!1}),window.onmousewheel=document.onmousewheel=document.onkeydown=null},preventDefaultValue:function(e){(e=e||window.event).preventDefault&&e.preventDefault(),e.returnValue=!1},keyDown:function(e){const t=[37,38,39,40];for(let o=t.length;o--;)if(e.keyCode===t[o])return void i.preventDefaultValue(e)}},n=i,s={check:function(e,t,i){if("object"!=typeof e||""===e||e.length||(e=o()(e)),e.length){const o=void 0!==e.data("viewport-offset")?e.data("viewport-offset"):.15,n=new IntersectionObserver((function(o){!0===o[0].isIntersecting&&(t.call(e),!1!==i&&n.disconnect())}),{threshold:[o]});n.observe(e[0])}}},r={check:function(e,t){if("object"!=typeof e||""===e||e.length||(e=o()(e)),e.length){"function"!=typeof e.find&&(e=o()(e));const i=e.find("img");if(i.length){let o=0;for(let n=0;n{l.initItem(e,t)}))},getRealCurrentItem:function(e){return"string"==typeof e&&""!==e&&(e=qiBlocksEditor.qodefGetCurrentBlockElement.get(e,"> .qodef-block .qodef-block-swiper",!0)),e},initItem:function(e,t){if(e=l.getRealCurrentItem(e),t||(l.document=document),l.document?.body?.classList.contains("wp-admin")&&(l.isEditorMode=!0),!e)return;const o=!!l.isEditorMode&&qiBlocksEditor.qodefGetCurrentBlockElement.getIframe();let i=e;NodeList.prototype.isPrototypeOf(e)||o?i&&void 0===i.length&&(i=[e]):i=[e];const n="object"!=typeof qiBlocksEditor?qiBlocks:qiBlocksEditor;i.forEach((e=>{n.qodefWaitForImages.check(e,(function(){setTimeout((()=>{const o=l.getOptions(e),i=l.getEvents(e,o);void 0!==e&&"object"==typeof e.swiper&&t&&e.swiper.destroy(),new Swiper(e,Object.assign(o,i))}),o?800:200)}))}))},getOptions:function(e){let t=void 0!==e.getAttribute("data-options")?JSON.parse(e.getAttribute("data-options")):{},o=void 0!==t.direction&&""!==t.direction?t.direction:"horizontal",i=void 0!==t.partialValue&&""!==t.partialValue?parseFloat(t.partialValue):0,n=void 0!==t.disablePartialValue&&""!==t.disablePartialValue?parseInt(t.disablePartialValue):"never",s=void 0!==t.spaceBetween&&""!==t.spaceBetween?t.spaceBetween:0,r=void 0!==t.spaceBetweenTablet&&""!==t.spaceBetweenTablet?t.spaceBetweenTablet:s,a=void 0!==t.spaceBetweenMobile&&""!==t.spaceBetweenMobile?t.spaceBetweenMobile:s,d=void 0!==t.slidesPerView&&""!==t.slidesPerView?"auto"===t.slidesPerView?"auto":parseInt(t.slidesPerView)+i:1+i,c=void 0!==t.centeredSlides&&""!==t.centeredSlides&&t.centeredSlides,u=void 0!==t.sliderScroll&&""!==t.sliderScroll&&t.sliderScroll,f=void 0!==t.effect&&""!==t.effect?t.effect:"slide",p=void 0===t.loop||""===t.loop||t.loop,w=void 0===t.autoplay||""===t.autoplay||t.autoplay,g=void 0!==t.speed&&""!==t.speed?parseInt(t.speed,10):5e3,h=void 0!==t.speedAnimation&&""!==t.speedAnimation?parseInt(t.speedAnimation,10):800,m=void 0!==t.customStages&&""!==t.customStages&&t.customStages,q=void 0===t.dragging||""===t.dragging||t.dragging,y=void 0!==t.outsideNavigation&&"yes"===t.outsideNavigation,b=y?".swiper-button-next-"+t.unique:e.querySelector(".swiper-button-next"),v=y?".swiper-button-prev-"+t.unique:e.querySelector(".swiper-button-prev"),k=void 0!==t.outsidePagination&&"yes"===t.outsidePagination?".swiper-pagination-"+t.unique:e.querySelector(".swiper-pagination");!1!==w&&5e3!==g?w={delay:g,disableOnInteraction:!1}:!1!==w&&(w={disableOnInteraction:!1});let B=void 0!==t.slidesPerView1440&&""!==t.slidesPerView1440?parseInt(t.slidesPerView1440,10)+i:"auto"===t.slidesPerView?"auto":5+i,I=void 0!==t.slidesPerView1366&&""!==t.slidesPerView1366?parseInt(t.slidesPerView1366,10)+i:"auto"===t.slidesPerView?"auto":4+i,E=void 0!==t.slidesPerView1024&&""!==t.slidesPerView1024?parseInt(t.slidesPerView1024,10)+i:"auto"===t.slidesPerView?"auto":3+i,S=void 0!==t.slidesPerView768&&""!==t.slidesPerView768?parseInt(t.slidesPerView768,10)+i:"auto"===t.slidesPerView?"auto":2+i,L=void 0!==t.slidesPerView680&&""!==t.slidesPerView680?parseInt(t.slidesPerView680,10)+i:"auto"===t.slidesPerView?"auto":1+i,P=void 0!==t.slidesPerView480&&""!==t.slidesPerView480?parseInt(t.slidesPerView480,10)+i:"auto"===t.slidesPerView?"auto":1+i;if(l.isEditorMode&&(l.document?.body?.classList.contains("qi-preview-screen-tablet")&&(d=d<3?d:E,s=r),l.document?.body?.classList.contains("qi-preview-screen-mobile")&&(d=P,s=a)),m||(d<2?(B=d,I=d,E=d,S=d):d<3?(B=d,I=d,E=d):d<4?(B=d,I=d):d<5&&(B=d)),"never"!==n)switch(n){case 1024:E=Math.floor(E),l.isEditorMode&&l.document?.body.classList.contains("qi-preview-screen-tablet")&&(d=Math.floor(d<3?d:E));break;case 768:S=Math.floor(S);break;case 680:L=Math.floor(L);break;case 480:P=Math.floor(P),l.isEditorMode&&l.document?.body.classList.contains("qi-preview-screen-mobile")&&(d=Math.floor(P))}let V={direction:o,slidesPerView:d,centeredSlides:c,sliderScroll:u,loopedSlides:"12",spaceBetween:s,effect:f,autoplay:w,loop:p,speed:h,navigation:{nextEl:b,prevEl:v},pagination:{el:k,type:"bullets",clickable:!0},grabCursor:!0,simulateTouch:!l.isEditorMode&&q,breakpoints:{0:{slidesPerView:P,spaceBetween:a},481:{slidesPerView:L,spaceBetween:a},681:{slidesPerView:S,spaceBetween:r},769:{slidesPerView:E,spaceBetween:r},1025:{slidesPerView:I},1367:{slidesPerView:B},1441:{slidesPerView:d}}};return Object.assign(V,l.getSliderDatas(e))},getSliderDatas:function(e){let t=o()(e).data(),i={};for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&"options"!==e&&void 0!==t[e]&&""!==t[e]&&(i[e]=t[e]);return i},getEvents:function(e,t){return{on:{beforeInit:function(){if("vertical"===t.direction){let o=0,i=0,n=e.querySelectorAll(".qodef-e");n.length&&n.forEach((e=>{i=e.offsetHeight,i>o&&(o=i)})),1===t.slidesPerView&&(e.style.height=o+"px",n.length&&n.forEach((e=>{e.style.height=o+"px"})))}},init:function(){if(e.classList.add("qodef--initialized"),l.isEditorMode?"object"==typeof qiBlocksEditor.qodefSetEditorLinkBehavior&&qiBlocksEditor.qodefSetEditorLinkBehavior.linkBehavior(e.querySelectorAll("a, button")):qiBlocks?.qodefLightboxPopup&&qiBlocks.qodefLightboxPopup.init(e.parentNode),"object"!=typeof qiBlocksEditor&&t.sliderScroll){let i=!1,n=o()(e),s=e.classList.contains("qodef-block")?n:n.parents(".qodef-block"),r=s.hasClass("qodef--focus-in-viewport"),l=s.offset().top,a=s.offset().top+s.outerHeight();r&&window.addEventListener("wheel",(function(e){let t=o()(window).scrollTop()+e.deltaY;(e.deltaY>0&&t0&&!e.swiper.isEnd)&&n.preventDefault(),r&&(n.originalEvent.deltaY<0&&e.swiper.isBeginning?(qiBlocks.qodefScroll.disable(),o()("html, body").stop().animate({scrollTop:Math.max(0,l-qiBlocks.windowHeight)},1200,(function(){qiBlocks.qodefScroll.enable()}))):n.originalEvent.deltaY>0&&e.swiper.isEnd&&(qiBlocks.qodefScroll.disable(),o()("html, body").stop().animate({scrollTop:a},1200,(function(){qiBlocks.qodefScroll.enable()}))))),i||(i=!0,n.originalEvent.deltaY>0?e.swiper.slideNext():e.swiper.slidePrev(),setTimeout((function(){i=!1}),1e3))}))}}}}}},a=l,d={masonry:[],isEditorMode:!1,init:function(){this.holder=document.querySelectorAll(".qodef-gutenberg-masonry-layout"),this.holder.length&&[...this.holder].map((e=>{d.createMasonry(e)}))},reLayout:function(){const e=d.masonry;"object"==typeof e&&Object.keys(e).length&&Object.values(e).map((e=>{setTimeout((()=>{const t=e.element.querySelectorAll(".qodef-gutenberg-column"),o=parseFloat(window.getComputedStyle(e.element.querySelector(".qodef-gutenberg-masonry-sizer")).getPropertyValue("width")),i=parseInt(window.getComputedStyle(e.element).getPropertyValue("column-gap"),10);o&&(t.forEach((e=>{e.style.width=o+"px"})),e.element.parentNode.classList.contains("qodef-items--fixed")&&d.setFixedImageSize(e.element,t[0],o,i)),setTimeout((()=>{e.layout()}),400)}),400)}))},getRealCurrentItem:function(e){return"string"==typeof e&&""!==e&&(e=qiBlocksEditor.qodefGetCurrentBlockElement.get(e,"> .qodef-block .qodef-gutenberg-masonry-layout")),e},initItem:function(e,t){const o=t?e:"";(e=d.getRealCurrentItem(e))&&(document.body.classList.contains("wp-admin")&&(d.isEditorMode=!0),o&&d.masonry[o]&&e?d.reInit(e,o,t):d.createMasonry(e,o))},reInit:function(e,t,o){const i=(d.isEditorMode?qiBlocksEditor.qodefGetCurrentBlockElement.getCurrentDocument():document).querySelectorAll(".qodef-gutenberg-masonry-layout");"function"==typeof Isotope&&i.length&&("object"==typeof d.masonry[t]&&"reinit"===o?d.masonry[t].layout():document.body.classList.contains("wp-admin")||!0!==e?d.createMasonry(e,t):d.masonry[t].layout())},createMasonry:function(e,t){if(!e)return;const o=e.querySelector(".qodef-gutenberg-row");if(o){const i=o.querySelector(".qodef-gutenberg-column");("object"!=typeof qiBlocksEditor?qiBlocks:qiBlocksEditor).qodefWaitForImages.check(o,(function(){d.createMasonryLogic(e,o,i,t)}))}},createMasonryLogic:function(e,t,o,i){if("function"==typeof Isotope&&(d.isEditorMode||!t.classList.contains("qodef--masonry-init"))){const n=t.querySelectorAll(".qodef-gutenberg-column"),s=parseFloat(window.getComputedStyle(t.querySelector(".qodef-gutenberg-masonry-sizer")).getPropertyValue("width")),r=parseInt(window.getComputedStyle(t).getPropertyValue("column-gap"),10);n.forEach((e=>{e.style.width=s+"px"})),e.classList.contains("qodef-items--fixed")&&d.setFixedImageSize(t,o,s,r);const l=new Isotope(t,{layoutMode:"packery",itemSelector:".qodef-gutenberg-column",percentPosition:!0,packery:{columnWidth:".qodef-gutenberg-masonry-sizer",gutter:r}});d.masonry[i]=l,setTimeout((()=>{l.layout()}),d.isEditorMode?600:0),t.classList.contains("qodef--masonry-init")||t.classList.add("qodef--masonry-init")}},setFixedImageSize:function(e,t,o,i){const n=d.isEditorMode?document.body.classList.contains("qi-preview-screen-tablet")||document.body.classList.contains("qi-preview-screen-mobile"):qiBlocks.windowWidth<=680,s=e.parentElement.classList.contains("qodef-col-num--1"),r=e.querySelectorAll(".qodef-gutenberg-column");r&&r.forEach((e=>{let t=o,r=o;s?(e.classList.contains("qodef-item--landscape")&&(r=Math.round(o/2)),e.classList.contains("qodef-item--portrait")&&(r=Math.round(2*o))):(e.classList.contains("qodef-item--landscape")&&(t=Math.round(2*o+i),n&&(t=Math.round(o),r=Math.round(o/2))),e.classList.contains("qodef-item--portrait")&&(r=Math.round(2*o+i)),e.classList.contains("qodef-item--huge-square")&&(t=Math.round(2*o+i),r=Math.round(2*o+i),n&&(t=Math.round(o),r=Math.round(o)))),e.style.width=t+"px",e.style.height=r+"px"}))}},c=d;var u={init:function(e){e?setTimeout((()=>{u.initItem(e)}),2e3):(this.holder=document.querySelectorAll(".qi-block-fslightbox-popup"),this.holder.length&&[...this.holder].map((e=>{u.initItem(e)})))},getRealCurrentItem:function(e){return"string"==typeof e&&""!==e&&(e=qiBlocksEditor.qodefGetCurrentBlockElement.get(e)),e},initItem:function(e,t){if(e=u.getRealCurrentItem(e)){refreshFsLightbox();for(const e in fsLightboxInstances){let t=fsLightboxInstances[e].props.sources,o=[],i=0;t.forEach((e=>{o.includes(e)||(o.push(e),i++)}));let n=i!==t.length?t.length-i:0;fsLightboxInstances[e].props.onOpen=function(){const t=fsLightboxInstances[e].elements.container.querySelectorAll(".fslightbox-slide-number-container");if(n>0&&t.length){const o=t[0].querySelector(".fslightbox-flex-centered > *:first-child"),s=t[0].querySelector(".fslightbox-flex-centered > *:last-child");new MutationObserver((()=>{let e=Number(o.innerText),t=e;e>i&&(t=n>i&&e>n?e-n:e-i),o.innerText=t,s.innerText=i})).observe(fsLightboxInstances[e].elements.container,{subtree:!0,attributes:!0,attributeFilter:["class"]})}},fsLightboxInstances[e].props.onInit=()=>{const t=fsLightboxInstances[e].elements.container,o=t.querySelectorAll(".fslightbox-slide-btn-container-previous > .fslightbox-slide-btn"),i=t.querySelectorAll(".fslightbox-slide-btn-container-next > .fslightbox-slide-btn"),n=t.querySelectorAll('[title="Close"]'),s="object"!=typeof qiBlocksEditor?qiBlocks:qiBlocksEditor;o.length&&(o[0].innerHTML=s.vars.arrowLeftIcon),i.length&&(i[0].innerHTML=s.vars.arrowRightIcon),n.length&&(n[0].innerHTML=s.vars.closeIcon)}}}}};const f=u,p={init:function(){this.holder=document.querySelectorAll(".qodef-image--hover-follow-info"),this.holder.length&&[...this.holder].map((e=>{p.initItem(e)}))},initItem:function(e){if(window.innerWidth>1024){const t=e.querySelectorAll(".qodef-image-wrapper");t.length&&[...t].map((e=>{p.initItemBehavior(e)}))}},initItemBehavior:function(e){if(e){const t=e.querySelector(".qodef-e-content");t&&e.addEventListener("mousemove",(e=>{e.clientX+t.offsetWidth+20>window.innerWidth?t.classList.add("qodef--right"):t.classList.remove("qodef--right"),t.style.top=e.clientY+20+"px",t.style.left=e.clientX+20+"px"}))}}},w=p;void 0===window.qiBlocks&&(window.qiBlocks={}),qiBlocks.body=o()("body"),qiBlocks.html=o()("html"),qiBlocks.windowWidth=o()(window).width(),qiBlocks.windowHeight=o()(window).height(),qiBlocks.scroll=0,qiBlocks.qodefScroll=n,qiBlocks.qodefIsInViewport=s,qiBlocks.qodefWaitForImages=r,qiBlocks.qodefSwiper=a,qiBlocks.qodefMasonryLayout=c,qiBlocks.qodefLightboxPopup=f,o()(document).ready((function(){qiBlocks.scroll=o()(window).scrollTop(),g.init(),a.init(),c.init(),f.init(),w.init()})),o()(window).resize((function(){qiBlocks.windowWidth=o()(window).width(),qiBlocks.windowHeight=o()(window).height(),c.reInit(!0),w.init()})),o()(window).scroll((function(){qiBlocks.scroll=o()(window).scrollTop()}));const g={init:function(){const e=document.querySelectorAll(".qodef-entrance-animation--on");e.length&&e.forEach((e=>{g.setClasses(e)}))},setClasses:function(e){e.classList.contains("qodef-animation--appeared")||qiBlocks.qodefIsInViewport.check(e,(function(){e.classList.add("qodef-animation--appeared"),e.getAttribute("data-animation")&&e.classList.add("animate__"+e.getAttribute("data-animation"))}))}};qiBlocks.qodefTriggerAnimation=g})()})();; var thirstyFunctions; jQuery( document ).ready( function($) { thirstyFunctions = { /** * Function that holds all of the necessary events to trigger a record link stat. * * @since 3.2.0 */ recordLinkStatEvents : function() { // record link on normal click if ( thirsty_global_vars.enable_record_stats == 'yes' ) $( 'body' ).on( 'click' , 'a' , thirstyFunctions.recordLinkStat ); }, /** * Record link clicks AJAX event trigger. * * @since 3.0.0 * @since 3.2.0 Removed event trigger. Added keyword variable in the AJAX trigger. * @since 3.3.0 Add javascript redirect feature. * @since 3.3.1 Make sure the duplicate click prevention only works on affiliate links. * @since 3.3.7 Add fail script for enhanced js redirect to still work on AJAX failure. * @since 3.4.0 Make sure query strings are added back when enhanced js redirect is active. */ recordLinkStat : function( e ) { var $link = $(this), href = $link.attr( 'href' ), linkID = $link.data( 'linkid' ), keyword = $link[0].innerText, qs = href ? href.split('?')[1] : '', // get the url query strings imgsrc, newWindow, monsterInsightsOnBeforeUnload; if ( ! keyword ) keyword = $link.text(); // if link clicked is not an affiliate link, then skip. if ( ! thirstyFunctions.isThirstyLink( href ) && ! linkID ) return; // prevent duplicate clicks. if ( $link.data( "clicked" ) ) { e.preventDefault(); return; } $link.data( "clicked" , true ); // get image filename and use it as keyword. if ( ! keyword && $link.find( 'img' ).length ) { imgsrc = $link.find( 'img' ).prop( 'src' ).split('/'); keyword = imgsrc[ imgsrc.length - 1 ]; } if ( thirsty_global_vars.enable_js_redirect === 'yes' && $link.data( 'nojs' ) != true ) { e.preventDefault(); if ( $link.prop( 'target' ) == '_blank' && ! thirstyFunctions.disableNewWindow() ) { newWindow = window.open( '', '_blank' ); } else if ( window.MonsterInsightsObject ) { setTimeout( function () { if ( typeof window.onbeforeunload === 'function' ) { monsterInsightsOnBeforeUnload = window.onbeforeunload; } }, 50 ); } } $.post( thirsty_global_vars.ajax_url , { action : 'ta_click_data_redirect', href : href, page : window.location.href, link_id : linkID, keyword : keyword, qs : qs } , function( redirect_url ) { $link.data( "clicked" , false ); if ( thirsty_global_vars.enable_js_redirect !== 'yes' || $link.data( 'nojs' ) == true ) return; if ( newWindow ) { newWindow.location.href = redirect_url ? redirect_url : href; } else { if ( typeof monsterInsightsOnBeforeUnload === 'function' && window.onbeforeunload === null ) { window.onbeforeunload = monsterInsightsOnBeforeUnload; } window.location.href = redirect_url ? redirect_url : href; } } ).fail( function() { $link.data( "clicked" , false ); if ( thirsty_global_vars.enable_js_redirect !== 'yes' || $link.data( 'nojs' ) == true ) return; if ( newWindow ) { newWindow.location.href = href; } else { if ( typeof monsterInsightsOnBeforeUnload === 'function' && window.onbeforeunload === null ) { window.onbeforeunload = monsterInsightsOnBeforeUnload; } window.location.href = href; } } ); }, /** * Check if we need to disable new window for enhanced javascript redirects. * This is intended to fix issue on browsing sites with FB/Messenger webview browser on iPhones. * * @since 3.3.6 * @since 3.6 Add support for Instagram, Pinterest, Twitter, Electron and Steam. */ disableNewWindow : function() { var strings = [ 'FBAN' , 'MessengerForiOS' , 'FBAV' , 'Instagram' , 'Pinterest' , 'Twitter' , 'Electron' , 'Steam' ]; for ( var x in strings ) { if ( navigator.userAgent.indexOf( strings[x] ) >= 0 ) return true; } return false; }, /** * Function to check if the loaded link is a ThirstyAffiliates link or not. * * @since 3.0.0 * @since 3.1.2 Make function detect root relative URLs. */ isThirstyLink : function( href ) { if ( ! href ) return; href = href.replace( 'http:' , '{protocol}' ).replace( 'https:' , '{protocol}' ); var link_uri = href.replace( thirsty_global_vars.home_url , '' ).replace( '{protocol}' , '' ), link_prefix, new_href; link_uri = link_uri.indexOf( '/' ) == 0 ? link_uri.replace( '/' , '' ) : link_uri; link_prefix = link_uri.substr( 0 , link_uri.indexOf( '/' ) ), new_href = href.replace( '/' + link_prefix + '/' , '/' + thirsty_global_vars.link_prefix + '/' ).replace( '{protocol}' , window.location.protocol ); return ( link_prefix && $.inArray( link_prefix , link_prefixes ) > -1 ) ? new_href : false; }, /** * Function to check if the loaded link is a ThirstyAffiliates link or not. * * @since 3.0.0 * @since 3.3.0 Add data-nojs attribute support. * @since 3.3.5 Make sure href property of links available before fetching the query strings. */ linkFixer : function() { if ( thirsty_global_vars.link_fixer_enabled !== 'yes' ) return; var $allLinks = $( 'body a' ), hrefs = [], href, linkClass, isShortcode, isImage , key; // fetch all links that are thirstylinks for ( key = 0; key < $allLinks.length; key++ ) { href = $( $allLinks[ key ] ).attr( 'href' ); linkClass = $( $allLinks[ key ] ).attr( 'class' ); isShortcode = $( $allLinks[ key ] ).data( 'shortcode' ); isImage = $( $allLinks[ key ] ).has( 'img' ).length; href = thirstyFunctions.isThirstyLink( href ); if ( href && ! isShortcode ) hrefs.push({ key : key , class : linkClass , href : href , is_image : isImage }); $( $allLinks[ key ] ).removeAttr( 'data-shortcode' ); } // skip if there are no affiliate links if ( hrefs.length < 1 ) return; $.post( thirsty_global_vars.ajax_url , { action : 'ta_link_fixer', hrefs : hrefs, post_id : thirsty_global_vars.post_id }, function( response ) { if ( response.status == 'success' ) { for ( var x in response.data ) { // make sure response data is valid before proceeding. if ( typeof response.data[ x ] != 'object' ) continue; var key = response.data[ x ][ 'key' ], hrefProp = $( $allLinks[ key ] ).prop( 'href' ), qs = hrefProp ? hrefProp.split('?')[1] : '', // get the url query strings href = response.data[ x ][ 'href' ], title = response.data[ x ][ 'title' ], className = response.data[ x ][ 'class' ], connector; if ( qs && response.data[ x ][ 'pass_qs' ] ) { connector = href.indexOf( '?' ) < 0 ? '?' : '&'; href = href + connector + qs; } // update protocol to replace it with the one used on the site. href = href.replace( 'http:' , window.location.protocol ).replace( 'https:' , window.location.protocol ); // add the title if present, if not then remove the attribute entirely. if ( title ) $( $allLinks[ key ] ).prop( 'title' , title ); else $( $allLinks[ key ] ).removeAttr( 'title' ); // if disable_thirstylink_class is set to yes then remove the thirstylink and thirstylinkimg classes. if ( thirsty_global_vars.disable_thirstylink_class == 'yes' ) className = className.replace( 'thirstylinkimg' , '' ).replace( 'thirstylink' , '' ).trim(); if ( className ) $( $allLinks[ key ] ).prop( 'class' , className ); else $( $allLinks[ key ] ).removeAttr( 'class' ); // map the other attributes. $( $allLinks[ key ] ).prop( 'href' , href ) .prop( 'rel' , response.data[ x ][ 'rel' ] ) .prop( 'target' , response.data[ x ][ 'target' ] ) .attr( 'data-linkid' , response.data[ x ][ 'link_id' ] ); // tag links as "nojs" to disable JS redirect for them. if ( thirsty_global_vars.enable_js_redirect === 'yes' ) $( $allLinks[ key ] ).attr( 'data-nojs' , response.data[ x ][ 'nojs' ] ); } } }, 'json' ); } } var link_prefixes = $.map( thirsty_global_vars.link_prefixes , function(value , index) { return [value]; }); // Initiate record link click stat function thirstyFunctions.recordLinkStatEvents(); // Initialize uncloak links function thirstyFunctions.linkFixer(); }); ; var thirstyGct; jQuery( document ).ready( function ($) { thirstyGct = { trackClick: function () { if ( ! window.thirstyFunctions) { return; } if ( tap_gct_vars.ga_func_name === '_gaq.push' ) { if ( typeof _gaq == 'undefined' || typeof _gaq.push != 'function' ) { return; } } else if ( tap_gct_vars.ga_func_name === 'dataLayer.push' ) { if ( typeof dataLayer == 'undefined' || typeof dataLayer.push != 'function' ) { return; } } else if (typeof window[tap_gct_vars.ga_func_name] != 'function') { return; } var $this = $( this ), linkID = $this.data( 'linkid' ), href = linkID ? $this.attr( 'href' ) : thirstyFunctions.isThirstyLink( $this.attr( 'href' ) ); if ( ! href ) { return; } var is_uncloak = href.indexOf( tap_gct_vars.home_url + '/' + thirsty_global_vars.link_prefix ) < 0, href_parts = href.split('/'), href_last = href_parts[ href_parts.length - 1 ] ? href_parts[ href_parts.length - 1 ] : href_parts[ href_parts.length - 2 ], link_text = $this.text(), link_uri = linkID && is_uncloak ? href : href.replace( tap_gct_vars.home_url , '' ), link_slug = linkID && is_uncloak ? href : href_last, event_action; if ( tap_gct_vars.event_action === 'href' ) { event_action = href; } else if ( tap_gct_vars.event_action === 'link_text' ) { event_action = link_text; } else if ( tap_gct_vars.event_action === 'link_slug' ) { event_action = link_slug; } else { event_action = link_uri; } switch (tap_gct_vars.script_type) { case 'gtm': dataLayer.push({ event: tap_gct_vars.action_name, link_uri: event_action }); break; case 'legacy_ga': _gaq.push( [ '_trackEvent', tap_gct_vars.action_name, event_action, tap_gct_vars.page_slug, undefined, false ] ); break; case 'universal_ga': window[tap_gct_vars.ga_func_name]( 'send', 'event', { eventCategory: tap_gct_vars.action_name, eventAction: event_action, eventLabel: tap_gct_vars.page_slug, transport: 'beacon' } ); break; case 'gtag_ga': default: gtag( 'event', tap_gct_vars.action_name, { event_category: tap_gct_vars.action_name, event_action: event_action, event_label: tap_gct_vars.page_slug } ); } } }; $( 'body' ).on( 'click', 'a', thirstyGct.trackClick ); // Backwards compatibility window.thirstyGoogleClickTrack = thirstyGct.trackClick; }); ; const TKPiano = { // Class selectors. selectors: { 'loginLinks': 'login-link', 'mobileLogoutLinks': '.menu-top-bar-menu-container .logout-link', 'logoutLinksSelector': '.site-header .main-navigation .logout-link a', 'myAccountLinks': 'my-account-link', 'welcomeLink': 'welcome-link', }, init() { this.loginLinks = Array.from(document.getElementsByClassName(this.selectors.loginLinks)); this.myAccountLinks = Array.from(document.getElementsByClassName(this.selectors.myAccountLinks)); this.welcomeLink = Array.from(document.getElementsByClassName(this.selectors.welcomeLink)); this.showLoginModal = this.showLoginModal.bind(this); this.handleLogout = this.handleLogout.bind(this); this.pianoInit = this.pianoInit.bind(this); document.addEventListener('DOMContentLoaded', function () { this.loadPiano(); }.bind(this)); }, /** * Trigger TinyPass init. */ loadPiano() { tp = window.tp || []; if ( tkPiano && 'sandbox' === tkPiano?.environment ) { tp.push(["setSandbox", true]); } tp.push( [ 'init', this.pianoInit ] ); tp.push([ 'addHandler', 'loginSuccess', function (data) { if (data.source == "PIANOID") { location.reload(); // this reloads the page after direct login (NOT login inside checkout) } } ]); if ('undefined' !== typeof tkPiano.pushArray && 'object' === typeof tkPiano.pushArray ) { for (let key in tkPiano.pushArray) { tp.push([key, tkPiano.pushArray[key]]); } } }, /** * Handle Piano initialization. */ pianoInit() { //Check if the user is logged in. This is helpful for SSO accross multiple domains. tp.pianoId.init({ loggedIn: function(data) { console.log('user ', data.user, ' logged in with token', data.token); console.log('data is ', data ); //location.reload(); }, loggedOut: function() { console.log('user logged out'); } }); //Reloads the page after and SSO login. window.addEventListener('message', function (e) { if(e.data == 'ssoReload') { location.reload(); } }); // Member Status Functions if (tp.user.isUserValid()) { const user = tp.user?.getProvider().getUser(); const username = ( user?.firstName ) ? user?.firstName : user?.email; this.showPianoLogoutLink(); // Hide home newsletter section if user is logged in document.querySelectorAll( '.newsletter-cta' ).forEach( el => el.remove() ); document.querySelectorAll( '.site-header .main-navigation .extras__newsletter' ).forEach( el => el.remove() ); document.querySelectorAll( '.site-header .main-navigation .overlay__newsletter' ).forEach( el => el.remove() ); document.querySelectorAll( this.selectors.mobileLogoutLinks ).forEach( el => el.addEventListener('click', this.handleLogout) ); document.querySelector( '.menu-top-bar-menu-container' ).classList.add( 'piano-user-in' ); if( document.getElementById( 'welcome-username' ) ) { document.getElementById( 'welcome-username' ).insertAdjacentHTML( 'beforeend', 'Welcome, ' + username ); } } // Show the My Account module if (this.is_page('my-account')) { tp.myaccount.show({ displayMode: "inline", containerSelector: "#piano-my-account" }); } // Show the Password Reset module if (this.is_page('reset-password')) { tp.push(['init', function() { // Password can be reset only if user is anonymous if (!tp.user.isUserValid()) { // If URL has reset_token parameter var tokenMatch = location.search.match(/reset_token=([A-Za-z0-9]+)/); if (tokenMatch) { // Get value of the token var token = tokenMatch[1]; // Present password reset form with the found token tp.pianoId.show({ displayMode: 'modal', confirmation: 'after', 'resetPasswordToken': token, loggedIn: function () { // Once user logs in - refresh the page location.reload(); } }); } } }]); } // Add event listener to login links. this.loginLinks.forEach(function (loginLink) { loginLink.addEventListener('click', this.showLoginModal, false); }.bind(this)); // Do the things according to user subscription status tp.push( [ 'init', function() { tp.api.callApi( '/access/list', { 'cross_app': true }, function( response ) { if ( response.data[0] ) { if ( response.data[0].access_id && response.data[0].granted ) { if ( response.data[0].resource ) { const ridArray = [ 'RFIBIKO', 'RZG6CR1', 'RH8X0JA', 'RN66EP5' ]; if( ridArray.includes( response.data[0].resource.rid ) ) { // Hide HW plus button for paid HW+ members $( '.site-header .main-navigation .header-hw-plus' ).hide(); } } } } } ); } ] ); }, /** * Shows logout and my-account links and hides login links. */ showPianoLogoutLink() { //Hide the Login links this.loginLinks.forEach(function (loginLink) { loginLink.style.display = 'none'; }); //Show the My Account links this.myAccountLinks.forEach(function (myAccountLink) { myAccountLink.style.display = 'block'; }); //Show the Logout links document.querySelectorAll( this.selectors.mobileLogoutLinks ).forEach( logoutLink => logoutLink.style.display = 'block' ); //Show the Welcome links this.welcomeLink.forEach(function (welcomeLink) { welcomeLink.style.display = 'block'; }); }, /** * Handle login link click. * * @param {object} event Event object. */ showLoginModal(event) { event.preventDefault(); tp.pianoId.show({ displayMode: 'modal', confirmation: 'after', }); }, /** * Handles logout link events. * * @param {object} event Event object. */ handleLogout(event) { event.preventDefault(); console.log( 'handle logout' ); tp.pianoId.logout(function () { window.location.replace('/'); }); }, /** * Checks if current page against passed pageSlug. * * @param string pageSlug Slug to check for. * * @returns boolean */ is_page(pageSlug) { if (tkPiano && undefined !== tkPiano.pageSlug && '' !== tkPiano.pageSlug.trim()) { return tkPiano.pageSlug === pageSlug; } return false; }, }; TKPiano.init();; /** * Handle Piano JS callbacks, send data using ajax to HubSpot. */ const TKHubSpot = { init() { if ( 'undefined' === typeof tkPiano ) { return; } document.addEventListener( 'DOMContentLoaded', function() { this.handleCheckoutEvents(); this.handleNewsletterSignup(); }.bind(this) ); }, handleCheckoutEvents() { tp = window.tp || []; tp.push( ['addHandler', 'startCheckout', function() { const today = new Date(); const time = today.getDate() + '/' + today.getMonth() + '/' + today.getFullYear(); const startObject = { checkoutStart : time }; this.sendToHubSpot( 'checkout', startObject ); }.bind(this)] ); tp.push( ['addHandler', 'checkoutComplete', function( conversion ) { this.sendToHubSpot( 'checkout', conversion ); }.bind(this)] ); tp.push( ['addHandler', 'showOffer', function( offerParams ) { offerParams.showOffer = true; this.sendToHubSpot( 'show', offerParams ); }.bind(this)] ); tp.push( ['addHandler', 'showTemplate', function( templateParams ) { templateParams.showTemplate = true; this.sendToHubSpot( 'show', templateParams ); }.bind(this)] ); }, handleNewsletterSignup() { tp = window.tp || []; tp.push( [ 'addHandler', 'customEvent', function( event, b, c, d ) { console.log('customEvent', event, b, c, d); switch ( event.eventName ) { case 'email-signup': var email = ''; var newsletter = ''; var contacttype = ''; var params; var iframeId; var iframe; var templateId; // We are parsing the params object sent from the template to find out which iframe triggered it params = JSON.parse(event.params.params); console.log( 'params', params ); // And here's the iframeId we're looking for iframeId = params.iframeId; console.log( 'iframeId', iframeId ); iframe = document.getElementById( iframeId ); console.log( 'iframe', iframe ); if ( ( typeof event.params.email != 'undefined' ) && ( event.params.email.length > 0 ) ) { email = event.params.email; } if ( ( typeof event.params.newsletter != 'undefined' ) && ( event.params.newsletter.length > 0 ) ) { newsletter = event.params.newsletter; } if ( ( typeof event.params.contacttype != 'undefined' ) && ( event.params.contacttype.length > 0 ) ) { contacttype = event.params.contacttype; } if ( ( typeof params.templateId != 'undefined' ) && ( params.templateId.length > 0 ) ) { templateId = params.templateId; } if ( ( typeof params.trackingId != 'undefined' ) && ( params.trackingId.length > 0 ) ) { trackingId = params.trackingId; } let dataObj = { action: 'piano_newsletter_signup', email: email, newsletter: newsletter, contacttype: contacttype, templateId: templateId, trackingId: trackingId, }; // Turn dataObj into a urlencoded string. let requestArray = []; for ( let key in dataObj ) { if ( dataObj.hasOwnProperty( key ) ) { requestArray.push( encodeURIComponent( key ) + "=" + encodeURIComponent( dataObj[ key ]) ); } } fetch( tkPiano.ajaxurl, { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, body: requestArray.join( '&' ), }) .then((response) => response.json()) .then((data) => { if (data) { console.log('[DATA]', data); console.log('message]', data.result.message); iframe.contentWindow.postMessage({ piano: { success: false, //currently this works for error and success message: data.result.message, object: 'email' } }, '*'); } }); break; case 'sticky-offer-close': $( '.bottom-sticky-ad' ).css( 'bottom', 0 ); break; } }]); }, sendToHubSpot( eventType, pianoObject ) { const user = tp.user?.getProvider().getUser(); // Get the user information, if not set do not process the callback. if ( !user?.email ) { return; } let dataObj = { nonce: tkPiano.nonce[ eventType ], action: 'piano_' + eventType, hbpagename: tkPiano.hbpagename, hbpageurl: tkPiano.hbpageurl, firstname: user?.firstName ?? '', lastname: user?.lastName ?? '', email: user?.email ?? '', uid: user?.uid ?? '', }; if ( pianoObject.showOffer !== undefined ) { dataObj.showoffer = pianoObject?.showOffer; } else if ( pianoObject.showTemplate !== undefined ) { dataObj.template = pianoObject?.showTemplate; } if ( pianoObject?.checkoutStart !== undefined ) { dataObj.startcheckout = true; } else if ( pianoObject?.stateName !== undefined ) { dataObj.statename = pianoObject?.stateName; } else { switch ( eventType ) { case 'checkout': dataObj.chargeamount = pianoObject?.chargeAmount; dataObj.expires = pianoObject?.expires; dataObj.promotionid = pianoObject?.promotionId; dataObj.offerid = pianoObject?.offerId; dataObj.startedate = pianoObject?.startedAt; dataObj.termid = pianoObject?.termId; dataObj.status = 'Active'; dataObj.stateview = pianoObject?.stateView; break; case 'show': dataObj.offerid = pianoObject?.offerId ?? ''; dataObj.templateid = pianoObject?.templateId ?? ''; break; default: return; } } // Turn dataObj into a urlencoded string. let requestArray = []; for ( let key in dataObj ) { if ( dataObj.hasOwnProperty( key ) ) { requestArray.push( encodeURIComponent( key ) + "=" + encodeURIComponent( dataObj[ key ]) ); } } fetch( tkPiano.ajaxurl, { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, body: requestArray.join( '&' ), }) .then( function( response ) { console.log( response ); }); } }; TKHubSpot.init();; !function(){"use strict";var e,t={noop:function(){},texturize:function(e){return(e=(e=(e=(e+="").replace(/'/g,"’").replace(/'/g,"’")).replace(/"/g,"”").replace(/"/g,"”").replace(/"/g,"”").replace(/[\u201D]/g,"”")).replace(/([\w]+)=&#[\d]+;(.+?)&#[\d]+;/g,'$1="$2"')).trim()},applyReplacements:function(e,t){if(e)return t?e.replace(/{(\d+)}/g,(function(e,r){return void 0!==t[r]?t[r]:e})):e},getBackgroundImage:function(e){var t=document.createElement("canvas"),r=t.getContext&&t.getContext("2d");if(e){r.filter="blur(20px) ",r.drawImage(e,0,0);var o=t.toDataURL("image/png");return t=null,o}}},r=function(){function e(e,t){return Element.prototype.matches?e.matches(t):Element.prototype.msMatchesSelector?e.msMatchesSelector(t):void 0}function r(e,t,r,o){if(!e)return o();e.style.removeProperty("display"),e.style.opacity=t,e.style.pointerEvents="none";var a=function(i,n){var l=(performance.now()-i)/n;l<1?(e.style.opacity=t+(r-t)*l,requestAnimationFrame((()=>a(i,n)))):(e.style.opacity=r,e.style.removeProperty("pointer-events"),o())};requestAnimationFrame((function(){requestAnimationFrame((function(){a(performance.now(),200)}))}))}return{closest:function(t,r){if(t.closest)return t.closest(r);var o=t;do{if(e(o,r))return o;o=o.parentElement||o.parentNode}while(null!==o&&1===o.nodeType);return null},matches:e,hide:function(e){e&&(e.style.display="none")},show:function(e){e&&(e.style.display="block")},fadeIn:function(e,o){r(e,0,1,o=o||t.noop)},fadeOut:function(e,o){o=o||t.noop,r(e,1,0,(function(){e&&(e.style.display="none"),o()}))},scrollToElement:function(e,t,r){if(!e||!t)return r?r():void 0;var o=t.querySelector(".jp-carousel-info-extra");o&&(o.style.minHeight=window.innerHeight-64+"px");var a=!0,i=Date.now(),n=t.scrollTop,l=Math.max(0,e.offsetTop-Math.max(0,window.innerHeight-function(e){var t=e.querySelector(".jp-carousel-info-footer"),r=e.querySelector(".jp-carousel-info-extra"),o=e.querySelector(".jp-carousel-info-content-wrapper");if(t&&r&&o){var a=window.getComputedStyle(r),i=parseInt(a.paddingTop,10)+parseInt(a.paddingBottom,10);return i=isNaN(i)?0:i,o.offsetHeight+t.offsetHeight+i}return 0}(t)))-t.scrollTop;function s(){a=!1}l=Math.min(l,t.scrollHeight-window.innerHeight),t.addEventListener("wheel",s),function e(){var c,u=Date.now(),d=(c=(u-i)/300)<.5?2*c*c:1-Math.pow(-2*c+2,2)/2,p=(d=d>1?1:d)*l;if(t.scrollTop=n+p,u<=i+300&&a)return requestAnimationFrame(e);r&&r(),o&&(o.style.minHeight=""),a=!1,t.removeEventListener("wheel",s)}()},getJSONAttribute:function(e,t){if(e&&e.hasAttribute(t))try{return JSON.parse(e.getAttribute(t))}catch(e){return}},convertToPlainText:function(e){var t=document.createElement("div");return t.textContent=e,t.innerHTML},stripHTML:function(e){return e.replace(/<[^>]*>?/gm,"")},emitEvent:function(e,t,r){var o;try{o=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:r||null})}catch(e){(o=document.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,r||null)}e.dispatchEvent(o)},isTouch:function(){return"ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch}}}();function o(){var o,a,i,n,l="",s=!1,c="div.gallery, div.tiled-gallery, ul.wp-block-gallery, ul.blocks-gallery-grid, figure.wp-block-gallery.has-nested-images, div.wp-block-jetpack-tiled-gallery, a.single-image-gallery",u=".gallery-item, .tiled-gallery-item, .blocks-gallery-item, .tiled-gallery__item",d=u+", .wp-block-image",p={},m="undefined"!=typeof wpcom&&wpcom.carousel&&wpcom.carousel.stat?wpcom.carousel.stat:t.noop,g="undefined"!=typeof wpcom&&wpcom.carousel&&wpcom.carousel.pageview?wpcom.carousel.pageview:t.noop;function h(t){if(!s)switch(t.which){case 38:t.preventDefault(),p.overlay.scrollTop-=100;break;case 40:t.preventDefault(),p.overlay.scrollTop+=100;break;case 39:t.preventDefault(),e.slideNext();break;case 37:case 8:t.preventDefault(),e.slidePrev();break;case 27:t.preventDefault(),b()}}function f(){s=!0}function v(){s=!1}function y(){p.overlay||(p.overlay=document.querySelector(".jp-carousel-overlay"),p.container=p.overlay.querySelector(".jp-carousel-wrap"),p.gallery=p.container.querySelector(".jp-carousel"),p.info=p.overlay.querySelector(".jp-carousel-info"),p.caption=p.info.querySelector(".jp-carousel-caption"),p.commentField=p.overlay.querySelector("#jp-carousel-comment-form-comment-field"),p.emailField=p.overlay.querySelector("#jp-carousel-comment-form-email-field"),p.authorField=p.overlay.querySelector("#jp-carousel-comment-form-author-field"),p.urlField=p.overlay.querySelector("#jp-carousel-comment-form-url-field"),window.innerWidth<=760&&Math.round(window.innerWidth/760*110)<40&&r.isTouch(),[p.commentField,p.emailField,p.authorField,p.urlField].forEach((function(e){e&&(e.addEventListener("focus",f),e.addEventListener("blur",v))})),p.overlay.addEventListener("click",(function(e){var t,o,a=e.target,i=!!r.closest(a,".jp-carousel-close-hint"),n=!!window.matchMedia("(max-device-width: 760px)").matches;if(a===p.overlay){if(n)return;b()}else if(i)b();else if(a.classList.contains("jp-carousel-image-download"))m("download_original_click");else if(a.classList.contains("jp-carousel-comment-login"))t=p.currentSlide,o=t?t.attrs.attachmentId:"0",window.location.href=jetpackCarouselStrings.login_url+"%23jp-carousel-"+o;else if(r.closest(a,"#jp-carousel-comment-form-container"))!function(e){var t=e.target,o=r.getJSONAttribute(p.container,"data-carousel-extra")||{},a=p.currentSlide.attrs.attachmentId,i=document.querySelector("#jp-carousel-comment-form-submit-and-info-wrapper"),n=document.querySelector("#jp-carousel-comment-form-spinner"),l=document.querySelector("#jp-carousel-comment-form-button-submit"),s=document.querySelector("#jp-carousel-comment-form");if(p.commentField&&p.commentField.getAttribute("id")===t.getAttribute("id"))f(),r.show(i);else if(r.matches(t,'input[type="submit"]')){e.preventDefault(),e.stopPropagation(),r.show(n),s.classList.add("jp-carousel-is-disabled");var c={action:"post_attachment_comment",nonce:jetpackCarouselStrings.nonce,blog_id:o.blog_id,id:a,comment:p.commentField.value};if(!c.comment.length)return void w(jetpackCarouselStrings.no_comment_text,!1);if(1!==Number(jetpackCarouselStrings.is_logged_in)&&(c.email=p.emailField.value,c.author=p.authorField.value,c.url=p.urlField.value,1===Number(jetpackCarouselStrings.require_name_email))){if(!c.email.length||!c.email.match("@"))return void w(jetpackCarouselStrings.no_comment_email,!1);if(!c.author.length)return void w(jetpackCarouselStrings.no_comment_author,!1)}var u=new XMLHttpRequest;u.open("POST",jetpackCarouselStrings.ajaxurl,!0),u.setRequestHeader("X-Requested-With","XMLHttpRequest"),u.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=UTF-8"),u.onreadystatechange=function(){if(this.readyState===XMLHttpRequest.DONE&&this.status>=200&&this.status<300){var e;try{e=JSON.parse(this.response)}catch(e){return void w(jetpackCarouselStrings.comment_post_error,!1)}"approved"===e.comment_status?w(jetpackCarouselStrings.comment_approved,!0):"unapproved"===e.comment_status?w(jetpackCarouselStrings.comment_unapproved,!0):w(jetpackCarouselStrings.comment_post_error,!1),H(),q(a),l.value=jetpackCarouselStrings.post_comment,r.hide(n),s.classList.remove("jp-carousel-is-disabled")}else w(jetpackCarouselStrings.comment_post_error,!1)};var d=[];for(var m in c)if(m){var g=encodeURIComponent(m)+"="+encodeURIComponent(c[m]);d.push(g.replace(/%20/g,"+"))}var h=d.join("&");u.send(h)}}(e);else if(r.closest(a,".jp-carousel-photo-icons-container")||a.classList.contains("jp-carousel-photo-title"))!function(e){e.preventDefault();var t=e.target,o=p.info.querySelector(".jp-carousel-info-extra"),a=p.info.querySelector(".jp-carousel-image-meta"),i=p.info.querySelector(".jp-carousel-comments-wrapper"),n=p.info.querySelector(".jp-carousel-icon-info"),l=p.info.querySelector(".jp-carousel-icon-comments");function s(){l&&l.classList.remove("jp-carousel-selected"),n.classList.toggle("jp-carousel-selected"),i&&i.classList.remove("jp-carousel-show"),a&&(a.classList.toggle("jp-carousel-show"),a.classList.contains("jp-carousel-show")?o.classList.add("jp-carousel-show"):o.classList.remove("jp-carousel-show"))}function c(){n&&n.classList.remove("jp-carousel-selected"),l.classList.toggle("jp-carousel-selected"),a&&a.classList.remove("jp-carousel-show"),i&&(i.classList.toggle("jp-carousel-show"),i.classList.contains("jp-carousel-show")?o.classList.add("jp-carousel-show"):o.classList.remove("jp-carousel-show"))}(r.closest(t,".jp-carousel-icon-info")||t.classList.contains("jp-carousel-photo-title"))&&(a&&a.classList.contains("jp-carousel-show")?r.scrollToElement(p.overlay,p.overlay,s):(s(),r.scrollToElement(p.info,p.overlay))),r.closest(t,".jp-carousel-icon-comments")&&(i&&i.classList.contains("jp-carousel-show")?r.scrollToElement(p.overlay,p.overlay,c):(c(),r.scrollToElement(p.info,p.overlay)))}(e);else if(!r.closest(a,".jp-carousel-info"))return})),window.addEventListener("keydown",h),p.overlay.addEventListener("jp_carousel.afterOpen",(function(){v(),p.slides.length<=1||(p.slides.length<=5?r.show(p.info.querySelector(".jp-swiper-pagination")):r.show(p.info.querySelector(".jp-carousel-pagination")))})),p.overlay.addEventListener("jp_carousel.beforeClose",(function(){f(),document.documentElement.style.removeProperty("height"),e&&e.enable(),r.hide(p.info.querySelector(".jp-swiper-pagination")),r.hide(p.info.querySelector(".jp-carousel-pagination"))})),p.overlay.addEventListener("jp_carousel.afterClose",(function(){window.history.pushState?history.pushState("",document.title,window.location.pathname+window.location.search):window.location.href="",l="",p.isOpen=!1})),p.overlay.addEventListener("touchstart",(function(e){e.touches.length>1&&e.preventDefault()})))}function w(e,t){var o=p.overlay.querySelector("#jp-carousel-comment-post-results"),a="jp-carousel-comment-post-"+(t?"success":"error");o.innerHTML=''+e+"",r.hide(p.overlay.querySelector("#jp-carousel-comment-form-spinner")),p.overlay.querySelector("#jp-carousel-comment-form").classList.remove("jp-carousel-is-disabled"),r.show(o)}function j(){var e=document.querySelectorAll("a img[data-attachment-id]");Array.prototype.forEach.call(e,(function(e){var t=e.parentElement,o=t.parentElement;if(!o.classList.contains("gallery-icon")&&!r.closest(o,u)&&t.hasAttribute("href")){var a=!1;t.getAttribute("href").split("?")[0]===e.getAttribute("data-orig-file").split("?")[0]&&1===Number(jetpackCarouselStrings.single_image_gallery_media_file)&&(a=!0),t.getAttribute("href")===e.getAttribute("data-permalink")&&(a=!0),a&&(t.classList.add("single-image-gallery"),t.setAttribute("data-carousel-extra",JSON.stringify({blog_id:Number(jetpackCarouselStrings.blog_id)})))}}))}function S(o){(!o||o<0||o>p.slides.length)&&(o=0),p.currentSlide=p.slides[o];var a,i,n=p.currentSlide,s=n.attrs.attachmentId;!function(e){var t=e.el,r=e.attrs,o=t.querySelector("img");if(!o.hasAttribute("data-loaded")){var a=!!r.previewImage,i=r.thumbSize;!a||i&&t.offsetWidth>i.width?o.src=r.src:o.src=r.previewImage,o.setAttribute("itemprop","image"),o.setAttribute("data-loaded",1)}}(p.slides[o]),1!==Number(jetpackCarouselStrings.display_background_image)||p.slides[o].backgroundImage||function(t){var r=t.el;e&&e.slides&&(r=e.slides[e.activeIndex]);var o=t.attrs.originalElement;o.complete&&0!==o.naturalHeight?A(t,r,o):o.onload=function(){A(t,r,o)}}(p.slides[o]),r.hide(p.caption),function(e){var t,o,a,i,n="",l="",s="";if(t=p.overlay.querySelector(".jp-carousel-photo-caption"),o=p.overlay.querySelector(".jp-carousel-caption"),a=p.overlay.querySelector(".jp-carousel-photo-title"),i=p.overlay.querySelector(".jp-carousel-photo-description"),r.hide(t),r.hide(o),r.hide(a),r.hide(i),n=k(e.caption)||"",l=k(e.title)||"",s=k(e.desc)||"",(n||l||s)&&(n&&(t.innerHTML=n,o.innerHTML=n,r.show(t),r.show(o)),r.stripHTML(n)===r.stripHTML(l)&&(l=""),r.stripHTML(n)===r.stripHTML(s)&&(s=""),r.stripHTML(l)===r.stripHTML(s)&&(s=""),s&&(i.innerHTML=s,r.show(i),l||n||(t.innerHTML=r.stripHTML(s),r.show(t))),l)){var c=r.stripHTML(l);a.innerHTML=c,n||(t.innerHTML=c,o.innerHTML=c,r.show(t)),r.show(a)}}({caption:n.attrs.caption,title:n.attrs.title,desc:n.attrs.desc}),function(e){if(!e||1!==Number(jetpackCarouselStrings.display_exif))return!1;var t=p.info.querySelector(".jp-carousel-image-meta ul.jp-carousel-image-exif"),r="";for(var o in e){var a=e[o],i=jetpackCarouselStrings.meta_data||[];if(0!==parseFloat(a)&&a.length&&-1!==i.indexOf(o)){switch(o){case"focal_length":a+="mm";break;case"shutter_speed":a=x(a);break;case"aperture":a="f/"+a}r+="
  • "+jetpackCarouselStrings[o]+"
    "+a+"
  • "}}t.innerHTML=r,t.style.removeProperty("display")}(p.slides[o].attrs.imageMeta),function(e){if(!e)return!1;var r,o=[e.attrs.origWidth,e.attrs.origHeight],a=document.createElement("a");a.href=e.attrs.src.replace(/\?.+$/,""),r=null!==a.hostname.match(/^i[\d]{1}\.wp\.com$/i)?a.href:e.attrs.origFile.replace(/\?.+$/,"");var i=p.info.querySelector(".jp-carousel-download-text"),n=p.info.querySelector(".jp-carousel-image-download");i.innerHTML=t.applyReplacements(jetpackCarouselStrings.download_original,o),n.setAttribute("href",r),n.style.removeProperty("display")}(n),1===Number(jetpackCarouselStrings.display_comments)&&(a=p.slides[o].attrs.commentsOpened,i=p.container.querySelector(".jp-carousel-comment-form-container"),1===parseInt(a,10)?r.fadeIn(i):r.fadeOut(i),q(s),r.hide(p.info.querySelector("#jp-carousel-comment-post-results")));var c=p.info.querySelector(".jp-carousel-pagination");if(c&&p.slides.length>5){var u=o+1;c.innerHTML=""+u+" / "+p.slides.length+""}jetpackCarouselStrings.stats&&((new Image).src=document.location.protocol+"//pixel.wp.com/g.gif?"+jetpackCarouselStrings.stats+"&post="+encodeURIComponent(s)+"&rand="+Math.random()),g(s),window.location.hash=l="#jp-carousel-"+s}function b(){document.body.style.overflow=a,document.documentElement.style.overflow=i,H(),f(),r.emitEvent(p.overlay,"jp_carousel.beforeClose"),window.scrollTo(window.scrollX||window.pageXOffset||0,n||0),e.destroy(),p.isOpen=!1,p.slides=[],p.currentSlide=void 0,p.gallery.innerHTML="",r.fadeOut(p.overlay,(function(){r.emitEvent(p.overlay,"jp_carousel.afterClose")}))}function L(e,t,r){var o=r?e.replace(/.*=([\d]+%2C[\d]+).*$/,"$1"):e.replace(/.*-([\d]+x[\d]+)\..+$/,"$1"),a=o!==e?r?o.split("%2C"):o.split("x"):[t,0];return"9999"===a[0]&&(a[0]="0"),"9999"===a[1]&&(a[1]="0"),a}function x(e){return e>=1?Math.round(10*e)/10+"s":"1/"+Math.round(1/e)+"s"}function k(e){return!e.match(" ")&&e.match("_")?"":e}function q(e,t){var a=void 0===t,i=p.info.querySelector(".jp-carousel-icon-comments .jp-carousel-has-comments-indicator");if(i.classList.remove("jp-carousel-show"),clearInterval(o),e){(!t||t<1)&&(t=0);var n=p.info.querySelector(".jp-carousel-comments"),l=p.info.querySelector("#jp-carousel-comments-loading");r.show(l),a&&(r.hide(n),n.innerHTML="");var s=new XMLHttpRequest,c=jetpackCarouselStrings.ajaxurl+"?action=get_attachment_comments&nonce="+jetpackCarouselStrings.nonce+"&id="+e+"&offset="+t;s.open("GET",c),s.setRequestHeader("X-Requested-With","XMLHttpRequest");var u=function(){r.fadeIn(n),r.fadeOut(l)};s.onload=function(){if(p.currentSlide&&p.currentSlide.attrs.attachmentId===e){var c,d=s.status>=200&&s.status<300;try{c=JSON.parse(s.responseText)}catch(e){}if(!d||!c||!Array.isArray(c))return u();a&&(n.innerHTML="");for(var m=0;m'+g.gravatar_markup+'
    '+g.author_markup+'
    '+g.date_gmt+"
    "+g.content+"
    ",n.appendChild(h),clearInterval(o),o=setInterval((function(){p.container.scrollTop+150>window.innerHeight&&(q(e,t+10),clearInterval(o))}),300)}c.length>0&&(r.show(n),i.innerText=c.length,i.classList.add("jp-carousel-show")),r.hide(l)}},s.onerror=u,s.send()}}function A(e,r,o){var a=t.getBackgroundImage(o);e.backgroundImage=a,r.style.backgroundImage="url("+a+")",r.style.backgroundSize="cover"}function H(){p.commentField&&(p.commentField.value="")}function T(e,o){p.slides=[];var a={width:window.innerWidth,height:window.innerHeight-64};0!==o&&((new Image).src=e[o].getAttribute("data-gallery-src"));var i=!!r.closest(e[0],".tiled-gallery.type-rectangular");Array.prototype.forEach.call(e,(function(e,o){var n=r.closest(e,"a"),l=e.getAttribute("data-orig-file")||e.getAttribute("src-orig"),s=e.getAttribute("data-attachment-id")||e.getAttribute("data-id")||"0",c=document.querySelector('img[data-attachment-id="'+s+'"] + figcaption');c=c?c.innerHTML:e.getAttribute("data-image-caption");var u={originalElement:e,attachmentId:s,commentsOpened:e.getAttribute("data-comments-opened")||"0",imageMeta:r.getJSONAttribute(e,"data-image-meta")||{},title:e.getAttribute("data-image-title")||"",desc:e.getAttribute("data-image-description")||"",mediumFile:e.getAttribute("data-medium-file")||"",largeFile:e.getAttribute("data-large-file")||"",origFile:l||"",thumbSize:{width:e.naturalWidth,height:e.naturalHeight},caption:c||"",permalink:n&&n.getAttribute("href"),src:l||e.getAttribute("src")||""},d=r.closest(e,".tiled-gallery-item"),m=d&&d.querySelector(".tiled-gallery-caption"),g=m&&m.innerHTML;g&&(u.caption=g);var h=function(e){var t=e.getAttribute("data-orig-size")||"";if(t){var r=t.split(",");return{width:parseInt(r[0],10),height:parseInt(r[1],10)}}return{width:e.getAttribute("data-original-width")||e.getAttribute("width")||void 0,height:e.getAttribute("data-original-height")||e.getAttribute("height")||void 0}}(e);if(u.origWidth=h.width||u.thumbSize.width,u.origHeight=h.height||u.thumbSize.height,"undefined"!=typeof wpcom&&wpcom.carousel&&wpcom.carousel.generateImgSrc?u.src=wpcom.carousel.generateImgSrc(e,a):u.src=function(e){if("object"!=typeof e&&(e={}),void 0===e.origFile)return"";if(void 0===e.origWidth||void 0===e.maxWidth)return e.origFile;if(void 0===e.mediumFile||void 0===e.largeFile)return e.origFile;var t=document.createElement("a");t.href=e.largeFile;var r=/^i[0-2]\.wp\.com$/i.test(t.hostname),o=L(e.mediumFile,e.origWidth,r),a=L(e.largeFile,e.origWidth,r),i=parseInt(a[0],10),n=parseInt(a[1],10),l=parseInt(o[0],10),s=parseInt(o[1],10);if(e.origMaxWidth=e.maxWidth,e.origMaxHeight=e.maxHeight,void 0!==window.devicePixelRatio&&window.devicePixelRatio>1&&(e.maxWidth=e.maxWidth*window.devicePixelRatio,e.maxHeight=e.maxHeight*window.devicePixelRatio),i>=e.maxWidth||n>=e.maxHeight)return e.largeFile;if(l>=e.maxWidth||s>=e.maxHeight)return e.mediumFile;if(r){var c=e.largeFile.lastIndexOf("?"),u=e.largeFile;return-1!==c&&(u=e.largeFile.substring(0,c),(e.origWidth>e.maxWidth||e.origHeight>e.maxHeight)&&(e.origMaxWidth=2*e.maxWidth,e.origMaxHeight=2*e.maxHeight,u+="?fit="+e.origMaxWidth+"%2C"+e.origMaxHeight)),u}return e.origFile}({origFile:u.src,origWidth:u.origWidth,origHeight:u.origHeight,maxWidth:a.width,maxHeight:a.height,mediumFile:u.mediumFile,largeFile:u.largeFile}),e.setAttribute("data-gallery-src",u.src),"0"!==u.attachmentId){u.title=t.texturize(u.title),u.desc=t.texturize(u.desc),u.caption=t.texturize(u.caption);var f=new Image;f.src=u.src;var v=document.createElement("div");v.classList.add("swiper-slide"),v.setAttribute("itemprop","associatedMedia"),v.setAttribute("itemscope",""),v.setAttribute("itemtype","https://schema.org/ImageObject");var y=document.createElement("div");y.classList.add("swiper-zoom-container"),p.gallery.appendChild(v),v.appendChild(y),y.appendChild(f),v.setAttribute("data-attachment-id",u.attachmentId),v.setAttribute("data-permalink",u.permalink),v.setAttribute("data-orig-file",u.origFile),i&&(u.previewImage=u.src);var w={el:v,attrs:u,index:o};p.slides.push(w)}}))}function C(e,t){if(!window.Swiper670){var o=document.querySelector("#jp-carousel-loading-overlay");r.show(o);var a=document.createElement("script");return a.id="jetpack-carousel-swiper-js",a.src=window.jetpackSwiperLibraryPath.url,a.async=!0,a.onload=function(){r.hide(o),E(e,t)},a.onerror=function(){r.hide(o)},void document.head.appendChild(a)}E(e,t)}function E(t,o){var l,s={imgSelector:".gallery-item [data-attachment-id], .tiled-gallery-item [data-attachment-id], img[data-attachment-id], img[data-id]",startIndex:0},c=r.getJSONAttribute(t,"data-carousel-extra");if(c&&(y(),!p.isOpen)){for(var u in p.isOpen=!0,a=getComputedStyle(document.body).overflow,document.body.style.overflow="hidden",i=getComputedStyle(document.documentElement).overflow,document.documentElement.style.overflow="hidden",n=window.scrollY||window.pageYOffset||0,p.container.setAttribute("data-carousel-extra",JSON.stringify(c)),m(["open","view_image"]),o||{})s[u]=o[u];-1===s.startIndex&&(s.startIndex=0),r.emitEvent(p.overlay,"jp_carousel.beforeOpen"),p.gallery.innerHTML="",p.overlay.style.opacity=1,p.overlay.style.display="block",T(t.querySelectorAll(s.imgSelector),s.startIndex),(e=new window.Swiper670(".jp-carousel-swiper-container",{centeredSlides:!0,zoom:!0,loop:p.slides.length>1,enabled:p.slides.length>1,pagination:{el:".jp-swiper-pagination",clickable:!0},navigation:{nextEl:".jp-swiper-button-next",prevEl:".jp-swiper-button-prev"},initialSlide:s.startIndex,on:{init:function(){S(s.startIndex)}},preventClicks:!1,preventClicksPropagation:!1,preventInteractionOnTransition:!r.isTouch(),threshold:5})).on("slideChange",(function(e){S(0===e.activeIndex?p.slides.length-1:e.activeIndex===p.slides.length+1?0:e.activeIndex-1),p.overlay.classList.remove("jp-carousel-hide-controls")})),e.on("zoomChange",(function(e,t){t>1&&p.overlay.classList.add("jp-carousel-hide-controls"),1===t&&p.overlay.classList.remove("jp-carousel-hide-controls")})),e.on("doubleTap",(function(e){if(clearTimeout(l),1===e.zoom.scale)var t=setTimeout((function(){p.overlay.classList.remove("jp-carousel-hide-controls"),clearTimeout(t)}),150)})),e.on("tap",(function(){e.zoom.scale>1&&(l=setTimeout((function(){p.overlay.classList.toggle("jp-carousel-hide-controls")}),150))})),r.fadeIn(p.overlay,(function(){r.emitEvent(p.overlay,"jp_carousel.afterOpen")}))}}document.body.addEventListener("click",(function(e){if(window.CSS&&window.CSS.supports&&window.CSS.supports("display","grid")){var t,o=e.target,a=r.closest(o,c);if(a){if(!(t=a)||!t.getAttribute("data-carousel-extra"))return;var i=o.parentElement,n=i.parentElement,l=null;if(n&&n.classList.contains("wp-block-image")?l=i.getAttribute("href"):i&&i.classList.contains("wp-block-image")&&i.querySelector(":scope > a")&&(l=i.querySelector(":scope > a").getAttribute("href")),l&&l.split("?")[0]!==o.getAttribute("data-orig-file").split("?")[0]&&l!==o.getAttribute("data-permalink"))return;if(i.classList.contains("gallery-caption"))return;if(r.matches(i,"figcaption"))return;document.documentElement.style.height="auto",e.preventDefault(),e.stopPropagation();var s=r.closest(o,d),u=Array.prototype.indexOf.call(a.querySelectorAll(d),s);C(a,{startIndex:u})}}})),1===Number(jetpackCarouselStrings.single_image_gallery)&&(j(),document.body.addEventListener("is.post-load",(function(){j()}))),window.addEventListener("hashchange",(function(){var t=/jp-carousel-(\d+)/;if(window.location.hash&&t.test(window.location.hash)){if(window.location.hash!==l||!p.isOpen)if(window.location.hash&&p.gallery&&!p.isOpen&&history.back)history.back();else{l=window.location.hash;for(var r,o,a=window.location.hash.match(t),i=parseInt(a[1],10),n=document.querySelectorAll(c),s=0;st.options.maxWidth?T()&&i||(O(),c.trigger("preUnfixed.ScrollToFixed"),w(),c.trigger("unfixed.ScrollToFixed")):-1==t.options.bottom?a>0&&s>=a-v()?e||S()&&i||(O(),c.trigger("preAbsolute.ScrollToFixed"),m(),c.trigger("unfixed.ScrollToFixed")):s>=p-v()?(F()&&i||(O(),c.trigger("preFixed.ScrollToFixed"),b(),u=-1,c.trigger("fixed.ScrollToFixed")),h(l)):T()&&i||(O(),c.trigger("preUnfixed.ScrollToFixed"),w(),c.trigger("unfixed.ScrollToFixed")):a>0?s+o(window).height()-c.outerHeight(!0)>=a-(v()||-function(){if(!t.options.bottom)return 0;return t.options.bottom}())?F()&&(O(),c.trigger("preUnfixed.ScrollToFixed"),"absolute"===r?m():w(),c.trigger("unfixed.ScrollToFixed")):(F()||(O(),c.trigger("preFixed.ScrollToFixed"),b()),h(l),c.trigger("fixed.ScrollToFixed")):h(l)}}function O(){var o=c.css("position");"absolute"==o?c.trigger("postAbsolute.ScrollToFixed"):"fixed"==o?c.trigger("postFixed.ScrollToFixed"):c.trigger("postUnfixed.ScrollToFixed")}var U=function(o){c.is(":visible")?(d=!1,y()):w()},z=function(o){window.requestAnimationFrame?requestAnimationFrame(y):y()};t.init=function(){t.options=o.extend({},o.ScrollToFixed.defaultOptions,e),s=c.css("z-index"),t.$el.css("z-index",t.options.zIndex),a=o("
    "),n=c.css("position"),r=c.css("position"),c.css("float"),l=c.css("top"),T()&&t.$el.after(a),o(window).bind("resize.ScrollToFixed",U),o(window).bind("scroll.ScrollToFixed",z),"ontouchmove"in window&&o(window).bind("touchmove.ScrollToFixed",y),t.options.preFixed&&c.bind("preFixed.ScrollToFixed",t.options.preFixed),t.options.postFixed&&c.bind("postFixed.ScrollToFixed",t.options.postFixed),t.options.preUnfixed&&c.bind("preUnfixed.ScrollToFixed",t.options.preUnfixed),t.options.postUnfixed&&c.bind("postUnfixed.ScrollToFixed",t.options.postUnfixed),t.options.preAbsolute&&c.bind("preAbsolute.ScrollToFixed",t.options.preAbsolute),t.options.postAbsolute&&c.bind("postAbsolute.ScrollToFixed",t.options.postAbsolute),t.options.fixed&&c.bind("fixed.ScrollToFixed",t.options.fixed),t.options.unfixed&&c.bind("unfixed.ScrollToFixed",t.options.unfixed),t.options.spacerClass&&a.addClass(t.options.spacerClass),c.bind("resize.ScrollToFixed",function(){a.height(c.height())}),c.bind("scroll.ScrollToFixed",function(){c.trigger("preUnfixed.ScrollToFixed"),w(),c.trigger("unfixed.ScrollToFixed"),y()}),c.bind("detach.ScrollToFixed",function(i){!function(o){(o=o||window.event).preventDefault&&o.preventDefault(),o.returnValue=!1}(i),c.trigger("preUnfixed.ScrollToFixed"),w(),c.trigger("unfixed.ScrollToFixed"),o(window).unbind("resize.ScrollToFixed",U),o(window).unbind("scroll.ScrollToFixed",z),c.unbind(".ScrollToFixed"),a.remove(),t.$el.removeData("ScrollToFixed")}),U()},t.init()},o.ScrollToFixed.defaultOptions={marginTop:0,limit:0,bottom:-1,zIndex:1e3,baseClassName:"scroll-to-fixed-fixed"},o.fn.scrollToFixed=function(i){return this.each(function(){new o.ScrollToFixed(this,i)})}}(jQuery)}});; !function(t){var e={};function i(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=25)}([function(t,e){t.exports=jQuery},function(t,e){function i(t){"@babel/helpers - typeof";return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)} /*! * jScroll - jQuery Plugin for Infinite Scrolling / Auto-Paging * @see @link{https://jscroll.com} * * @copyright Philip Klauzinski * @license Dual licensed under the MIT and GPL Version 2 licenses * @author Philip Klauzinski (https://webtopian.com) * @version 2.4.1 * @requires jQuery v1.8.0+ * @preserve */!function(t){"use strict";t.jscroll={defaults:{debug:!1,autoTrigger:!0,autoTriggerUntil:!1,loadingHtml:"Loading...",loadingFunction:!1,padding:0,nextSelector:"a:last",contentSelector:"",pagingSelector:"",callback:!1}};t.fn.jscroll=function(e){return this.each(function(){var n=t(this),o=n.data("jscroll");o&&o.initialized||function(e,n){var o,s=e.data("jscroll"),r="function"==typeof n?{callback:n}:n,a=t.extend({},t.jscroll.defaults,r,s||{}),l="visible"===e.css("overflow-y"),c=e.find(a.nextSelector).first(),d=t(window),u=t("body"),p=l?d:e,f=t.trim(c.prop("href")+" "+a.contentSelector),h=function(){e.find(".jscroll-inner").length||e.contents().wrapAll('
    ')},m=function(t){a.pagingSelector?t.closest(a.pagingSelector).hide():t.parent().not(".jscroll-inner,.jscroll-added").addClass("jscroll-next-parent").hide().length||t.wrap('
    ').parent().hide()},g=function(){return p.unbind(".jscroll").removeData("jscroll").find(".jscroll-inner").children().unwrap().filter(".jscroll-added").children().unwrap()},v=function(){if(e.is(":visible")){h();var t=e.find("div.jscroll-inner").first(),i=e.data("jscroll"),n=parseInt(e.css("borderTopWidth"),10),o=isNaN(n)?0:n,s=parseInt(e.css("paddingTop"),10)+o,r=l?p.scrollTop():e.offset().top,c=t.length?t.offset().top:0,d=Math.ceil(r-c+p.height()+s);if(!i.waiting&&d+a.padding>=t.outerHeight())return w("info","jScroll:",t.outerHeight()-d,"from bottom. Loading next request..."),b()}},y=function(){var i=e.find(a.nextSelector).first();if(i.length)if(a.autoTrigger&&(!1===a.autoTriggerUntil||0').children(".jscroll-added").last().html('
    '+a.loadingHtml+"
    ").promise().done(function(){a.loadingFunction&&a.loadingFunction()}),e.animate({scrollTop:i.outerHeight()},0,function(){var o=n.nextHref;i.find("div.jscroll-added").last().load(o,function(i,s){if("error"===s)return g();var r,l=t(this).find(a.nextSelector).first();n.waiting=!1,n.nextHref=!!l.prop("href")&&t.trim(l.prop("href")+" "+a.contentSelector),t(".jscroll-next-parent",e).remove(),(r=r||e.data("jscroll"))&&r.nextHref?y():(w("warn","jScroll: nextSelector not found - destroying"),g()),a.callback&&a.callback.call(this,o),w("dir",n)})})},w=function(t){if(a.debug&&"object"==("undefined"==typeof console?"undefined":i(console))&&("object"==i(t)||"function"==typeof console[t]))if("object"==i(t)){var e=[];for(var n in t)"function"==typeof console[n]?(e=t[n].length?t[n]:[t[n]],console[n].apply(console,e)):console.log.apply(console,e)}else console[t].apply(console,Array.prototype.slice.call(arguments,1))};e.data("jscroll",t.extend({},s,{initialized:!0,waiting:!1,nextHref:f})),h(),(o=t(a.loadingHtml).filter("img").attr("src"))&&((new Image).src=o),y(),t.extend(e.jscroll,{destroy:g})}(n,e)})}}(jQuery)},function(t,e,i){"use strict";i.d(e,"a",function(){return s}),i.d(e,"b",function(){return l}),i.d(e,"c",function(){return c});var n=i(3),o=i.n(n),s={init:function(){this.loadWebFonts()},loadWebFonts:function(){o.a.load({google:{families:["Poppins:300,400,500,600,700","Zilla+Slab:ital,wght@1,700"]}})}},r=(i(5),i(4)),a=i.n(r);i(1);var l={init:function(){this.bodyHtml=$("body, html"),this.header=$("#masthead"),this.leftSidebar=$(".site-real-trends .left-sidebar"),this.searchBarButton=$("header .extras__search .button__search"),this.searchBarIconOpen=$("header .extras__search--open"),this.searchBarIconClose=$("header .extras__search--close"),this.searchBar=$(".extras__search--close, .extras__search input:text"),this.overlayHamburger=$(".extras__hamburger"),this.overlayElements=$(".overlay__search, .overlay__opt-link, .overlay__newsletter, .overlay__login, .overlay__logout"),this.menuItemWithChildren=$("#main-menu-top .menu-item-has-children, #left-sidebar-filter-menu .menu-item-has-children"),this.menuItemWithChildrenButton=$("#main-menu-top .menu-item-has-children > button, #left-sidebar-filter-menu .menu-item-has-children > button"),this.poweredByLogo=$(".powered-by"),this.infiniteScroll=$(".infinite-scroll"),this.prevWebinarInfiniteScroll=$(".prev-webinar-infinite-scroll"),this.prevEventInfiniteScroll=$(".prev-event-infinite-scroll"),this.nextEventInfiniteScroll=$(".next-event-infinite-scroll"),this.stickySidebar=$(".sidebar-sticky"),this.categorySelect=$("#view-by-category"),this.homeCategorySelect=$("#category"),this.textToCopy=$(".text-to-copy"),this.breakingNewsBar=$(".breaking-news"),this.breakingNewsCloseButton=$(".breaking-news-close"),this.breakingNewsContent=$(".breaking-news p"),this.showMoreButton=$("#showMore"),this.bindEvents(),this.initPrevWebinarJScroll(),this.initPrevEventJScroll(),this.initNextEventJScroll(),this.initJScroll(),this.initScrollToFixed(),this.loadComments(),this.copyText(),this.setReferralTokenCookie(),this.setActiveTab(),this.scrollTabsMobile(),this.advertiseMenu(),this.addReadMoreButton(),this.customPopup(),this.superNavBar(),this.webinarFilter(),this.eventFilter(),this.testimonialPosts(),this.enterpriceSearchWidget(),this.topBarMenuToggle(),this.stickyHeader()},bindEvents:function(){var t=this;this.searchBarButton.on("click",function(e){return t.toggleSearchBar(e)}),this.overlayHamburger.on("click",function(e){return t.toggleOverlayMenu(e)}),this.menuItemWithChildren.on("click",function(e){return t.toggleSubMenu(e)}),this.categorySelect.on("change",function(e){return t.categorySelectFilter(e)}),this.homeCategorySelect.on("change",function(e){return t.categorySelectFilter(e)}),this.textToCopy.on("click",function(e){return t.copyText(e)}),$(function(){return t.breakingNewsCheck()}),this.breakingNewsCloseButton.on("click",function(e){return t.breakingNewsClose(e)}),this.showMoreButton.on("click",function(e){return t.toggleMortgageCatDetails(e)})},breakingNewsClose:function(t){t.preventDefault();var e=this.breakingNewsContent.text();localStorage.setItem("how_breaking_news_content",JSON.stringify({text:e,closed:!0})),this.breakingNewsBar.hide()},breakingNewsCheck:function(){if(0!=this.breakingNewsBar.length){var t=JSON.parse(localStorage.getItem("how_breaking_news_content")),e=this.breakingNewsContent.text();t&&e===t.text||(t={text:e,closed:!1},localStorage.setItem("how_breaking_news_content",JSON.stringify(t))),0==t.closed&&this.breakingNewsBar.show()}},toggleSearchBar:function(t){t.preventDefault(),this.searchBar.toggleClass("hide"),this.searchBarIconOpen.toggleClass("hide")},toggleOverlayMenu:function(t){t.preventDefault(),this.overlayHamburger.find("i").toggleClass("fa-bars fa-times").toggleClass("fa far"),$(".site-header").toggleClass("overlay-active"),$("#masthead").hasClass("is_mobile")&&(this.overlayElements.toggleClass("hide"),this.poweredByLogo.toggleClass("hide")),$(".hamburger-logo").toggleClass("hide"),$(".site-branding > h1:not(:first-child)").toggleClass("hide"),$(".site-branding").find("p.how-h1").toggleClass("hide"),834<$(window).width()&&($("#site-navigation").toggleClass("desktop-overlay"),$(".site-header").removeClass("overlay-active"))},toggleSubMenu:function(t){(this.header.hasClass("overlay-active")||this.leftSidebar.find(".menu-left-sidebar-menu-container"))&&(this.menuItemWithChildren.find("> .sub-menu").removeClass("active"),this.menuItemWithChildren.removeClass("active-menu"),$(t.currentTarget).children("ul.sub-menu").toggleClass("active"),$(t.currentTarget).toggleClass("active-menu"))},initPrevWebinarJScroll:function(){this.prevWebinarInfiniteScroll.jscroll({contentSelector:".prev-webinar-infinite-scroll-content",nextSelector:"#pre-webinar-loadmore > a",autoTrigger:!1,loadingHtml:'',debug:!1,callback:function(){$(document.body).trigger("post-load")}})},initPrevEventJScroll:function(){this.prevEventInfiniteScroll.jscroll({contentSelector:".prev-event-infinite-scroll-content",nextSelector:"#pre-event-loadmore > a",autoTrigger:!1,loadingHtml:'',debug:!1,callback:function(){$(document.body).trigger("post-load")}})},initNextEventJScroll:function(){this.nextEventInfiniteScroll.jscroll({contentSelector:".next-event-infinite-scroll-content",nextSelector:"#next-event-loadmore > a",autoTrigger:!1,loadingHtml:'',debug:!1,callback:function(){$(document.body).trigger("post-load")}})},initJScroll:function(){this.infiniteScroll.jscroll({contentSelector:".infinite-scroll-content",nextSelector:"#loadmore > a",autoTrigger:!1,loadingHtml:'',debug:!1,callback:function(){$(document.body).trigger("post-load")}})},initScrollToFixed:function(){if(0 li, .comment-list\tol, .comment-respond, .comment-navigation").slideDown("slow",function(){$(".comments-area .load-comments").remove()})})},setReferralTokenCookie:function(){var t=encodeURIComponent(window.location.search),e=new URLSearchParams(t);if(e.get("ref")){var i=e.get("ref");a.a.set("how_user_refferal",i,{expires:14})}},copyText:function(){var t=$(".container__share-link input"),e=$(".pill--copy-link");t.focus(),t.select(),document.execCommand("copy"),e.text("Copied"),setTimeout(function(){e.text("Copy Link")},3500)},setActiveTab:function(){if(""!==location.hash.substr(1)){var t="#"+location.hash.substr(1);$(".page-template-advertise "+t).length&&(setTimeout(function(){$('a[href="'+t+'"]').parent().trigger("click"),$(".tab-content").scrollIntoView()},1e3),$("html, body").animate({scrollTop:$(".tab-content").offset().top},"slow"))}},scrollTabsMobile:function(){$(".tab-navigation-mobile").on("click",function(){var t=$(this).parent().find(".mobile-tab-scroll"),e=365-t.offset().left+t.scrollLeft();t.animate({scrollLeft:e})})},advertiseMenu:function(){$(".menu-advertise-container ul li a").on("click",function(){var t=$(this).attr("href").split("#")[1];""!==t&&(t="#"+t,$(".page-template-advertise .tab-content-block "+t).length&&(setTimeout(function(){$('a[href="'+t+'"]').parent().trigger("click"),$(window).scrollTop($(".tab-content-block").offset().top)},1e3),$("html, body").animate({scrollTop:$(".tab-content-block").offset().top},"slow")))})},addReadMoreButton:function(){var t=1;$(".block-read-more").each(function(){var e="block-read-more-";e=e.concat(t),$(this).attr("id",e),$(this).after('Read More'),t++}),$(".btn-read-more").on("click",function(){var t=$(this).data("id");$("#"+t).toggle("fast"),$(this).html("Read More"===$(this).html()?"Read Less":"Read More")})},customPopup:function(){$("[data-modal]").on("click",function(){var t=$(this).data("modal");$("#"+t).show(),$("body").attr("style","overflow: hidden")}),$(".popup-modal .close-button").on("click",function(){$(this).closest(".popup-modal").hide(),$("body").removeAttr("style")})},toggleMortgageCatDetails:function(t){$("#showMore").hide(),$("#mortgageDesc").slideToggle("slow")},superNavBar:function(){$(".super-nav-link, .super-nav-content .close").on("click",function(){$(".super-nav-content").toggleClass("hide"),$(".super-nav-bar").toggleClass("open")})},webinarFilter:function(){$(".webinar-filters .button").on("click",function(){var t=$(this);$(this).toggleClass("selected");var e="";$(".webinar-filters .button.selected").each(function(){e=""===e?$(this).data("tag"):e+","+$(this).data("tag")}),$("#previous-webinars-outer").addClass("loading"),""===e?window.location.reload():$.ajax({url:HOW.ajax_url,type:"POST",dataType:"json",data:{action:"filter_the_webinars",tags:e,nonce:HOW.nonce},success:function(e){e.success?($("#previous-webinars-outer").removeClass("loading"),$("#previous-webinars-outer").html(""),$("#previous-webinars-outer").append(e.data),$("html,body").animate({scrollTop:$("#previous-webinars-outer").offset().top},1e3)):(t.toggleClass("selected"),$("#previous-webinars-outer").removeClass("loading"))}})})},eventFilter:function(){$(".event-filters .button").on("click",function(){var t=$(this);$(this).toggleClass("selected");var e="";$(".event-filters .button.selected").each(function(){e=""===e?$(this).data("tag"):e+","+$(this).data("tag")}),$("#previous-events-outer").addClass("loading"),""===e?window.location.reload():$.ajax({url:HOW.ajax_url,type:"POST",dataType:"json",data:{action:"filter_the_events",tags:e,nonce:HOW.nonce},success:function(e){e.success?($("#previous-events-outer").removeClass("loading"),$("#previous-events-outer").html(""),$("#previous-events-outer").append(e.data),$("html,body").animate({scrollTop:$("#previous-events-outer").offset().top},1e3)):(t.toggleClass("selected"),$("#previous-events-outer").removeClass("loading"))}})})},testimonialPosts:function(){$(".testimonial-posts-bottom .testimonial-link").on("click",function(t){t.preventDefault();var e=$(this).closest(".block-testimonial-posts").attr("id"),i=$(this).attr("data-testimonial");$("#"+e).find(".testimonial-posts-bottom .testimonial-link").removeClass("active"),$(this).addClass("active"),$("#"+e).find(".testimonial-posts-top .single-testimonial-post").removeClass("active"),$("#"+e).find("#"+i).addClass("active")})},enterpriceSearchWidget:function(){$(document).on("click",".advanced-search",function(t){t.preventDefault(),$(".advanced-search-filter").slideToggle()}),$(document).on("click",".advanced-search-filter button",function(){$(".advanced-search-filter").slideUp()}),$(document).on("click",".enterprise-search-checkbox",function(t){$(this).parent("label").addClass("checked");var e=$(this).next("#eps-link").attr("href");window.location.href=e})},topBarMenuToggle:function(){$(".main-navigation .welcome-link").mouseover(function(){$(this).parent().next(".menu-top-bar-menu-container").addClass("active")}),$(".menu-top-bar-menu-container").mouseleave(function(){$(this).removeClass("active")})},stickyHeader:function(){$(window).bind("scroll",function(){$("#masthead").hasClass("sticky-header")&&767<$(window).width()&&(67<$(this).scrollTop()&&($(".overlay").addClass("hide-overlay"),$(".site-header").addClass("header-shadow"),$(".extras__hamburger").show()),0==$(this).scrollTop()&&($(".overlay").removeClass("hide-overlay"),$(".site-header").removeClass("header-shadow"),$(".extras__hamburger").hide(),$(".extras__hamburger").find("i").hasClass("fa-times")&&($(".extras__hamburger").find("i").removeClass("fa-times"),$(".extras__hamburger").find("i").addClass("fa-bars")),$("#site-navigation").removeClass("desktop-overlay")))})}},c=(i(6),{init:function(){this.setProps(),this.createSlider()},setProps:function(){this.sliderContainer=$(".slick-slider"),this.agentSlider=$(".agent-slider")},createSlider:function(){this.agentSlider.length&&this.agentSlider.slick({centerMode:!0,infinite:!0,slidesToShow:5,slidesToScroll:1,arrow:!0,centerPadding:"30px",responsive:[{breakpoint:768,settings:{slidesToShow:1,centerMode:!1,slidesToScroll:1}}]}),this.sliderContainer.length&&this.sliderContainer.slick()}})},function(t,e,i){var n;!function(){function o(t,e,i){return t.call.apply(t.bind,arguments)}function s(t,e,i){if(!t)throw Error();if(2=e.f?o():t.fonts.load(function(t){return $(t)+" "+t.f+"00 300px "+S(t.c)}(e.a),e.h).then(function(t){1<=t.length?n():setTimeout(s,25)},function(){o()})}()}),o=null,s=new Promise(function(t,i){o=setTimeout(i,e.f)});Promise.race([s,n]).then(function(){o&&(clearTimeout(o),o=null),e.g(e.a)},function(){e.j(e.a)})};var j={D:"serif",C:"sans-serif"},N=null;function M(){if(null===N){var t=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);N=!!t&&(536>parseInt(t[1],10)||536===parseInt(t[1],10)&&11>=parseInt(t[2],10))}return N}function I(t,e,i){for(var n in j)if(j.hasOwnProperty(n)&&e===t.f[j[n]]&&i===t.f[j[n]])return!0;return!1}function P(t){var e,i=t.g.a.offsetWidth,n=t.h.a.offsetWidth;(e=i===t.f.serif&&n===t.f["sans-serif"])||(e=M()&&I(t,i,n)),e?a()-t.A>=t.w?M()&&I(t,i,n)&&(null===t.u||t.u.hasOwnProperty(t.a.c))?H(t,t.v):H(t,t.B):function(t){setTimeout(r(function(){P(this)},t),50)}(t):H(t,t.v)}function H(t,e){setTimeout(r(function(){u(this.g.a),u(this.h.a),u(this.j.a),u(this.m.a),e(this.a)},t),0)}function D(t,e,i){this.c=t,this.a=e,this.f=0,this.m=this.j=!1,this.s=i}z.prototype.start=function(){this.f.serif=this.j.a.offsetWidth,this.f["sans-serif"]=this.m.a.offsetWidth,this.A=a(),P(this)};var R=null;function F(t){0==--t.f&&t.j&&(t.m?((t=t.a).g&&p(t.f,[t.a.c("wf","active")],[t.a.c("wf","loading"),t.a.c("wf","inactive")]),_(t,"active")):x(t.a))}function W(t){this.j=t,this.a=new function(){this.c={}},this.h=0,this.f=this.g=!0}function B(t,e,i,n,o){var s=0==--t.h;(t.f||t.g)&&setTimeout(function(){var t=o||null,a=n||{};if(0===i.length&&s)x(e.a);else{e.f+=i.length,s&&(e.j=s);var l,c=[];for(l=0;lt.length)&&(e=t.length);for(var i=0,n=new Array(e);i1?i-1:0),o=1;o/gm),U=u(/\${[\w\W]*}/gm),q=u(/^data-[\-\w.\u00B7-\uFFFF]/),G=u(/^aria-[\-\w]+$/),X=u(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Y=u(/^(?:\w+script|data):/i),K=u(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),J=u(/^html$/i),Q=function(){return"undefined"==typeof window?null:window},V=function(e,i){if("object"!==t(e)||"function"!=typeof e.createPolicy)return null;var n=null;i.currentScript&&i.currentScript.hasAttribute("data-tt-policy-suffix")&&(n=i.currentScript.getAttribute("data-tt-policy-suffix"));var o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:function(t){return t},createScriptURL:function(t){return t}})}catch(t){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};return function e(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Q(),o=function(t){return e(t)};if(o.version="2.4.5",o.removed=[],!i||!i.document||9!==i.document.nodeType)return o.isSupported=!1,o;var s=i.document,r=i.document,a=i.DocumentFragment,l=i.HTMLTemplateElement,c=i.Node,u=i.Element,p=i.NodeFilter,f=i.NamedNodeMap,h=void 0===f?i.NamedNodeMap||i.MozNamedAttrMap:f,m=i.HTMLFormElement,_=i.DOMParser,Z=i.trustedTypes,tt=u.prototype,et=L(tt,"cloneNode"),it=L(tt,"nextSibling"),nt=L(tt,"childNodes"),ot=L(tt,"parentNode");if("function"==typeof l){var st=r.createElement("template");st.content&&st.content.ownerDocument&&(r=st.content.ownerDocument)}var rt=V(Z,s),at=rt?rt.createHTML(""):"",lt=r,ct=lt.implementation,dt=lt.createNodeIterator,ut=lt.createDocumentFragment,pt=lt.getElementsByTagName,ft=s.importNode,ht={};try{ht=O(r).documentMode?r.documentMode:{}}catch(t){}var mt={};o.isSupported="function"==typeof ot&&ct&&void 0!==ct.createHTMLDocument&&9!==ht;var gt,vt,yt=W,bt=B,wt=U,kt=q,St=G,Tt=Y,$t=K,Ct=X,xt=null,_t=A({},[].concat(n(E),n(z),n(j),n(M),n(P))),At=null,Ot=A({},[].concat(n(H),n(D),n(R),n(F))),Lt=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Et=null,zt=null,jt=!0,Nt=!0,Mt=!1,It=!0,Pt=!1,Ht=!1,Dt=!1,Rt=!1,Ft=!1,Wt=!1,Bt=!1,Ut=!0,qt=!1,Gt=!0,Xt=!1,Yt={},Kt=null,Jt=A({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Qt=null,Vt=A({},["audio","video","img","source","image","track"]),Zt=null,te=A({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ee="http://www.w3.org/1998/Math/MathML",ie="http://www.w3.org/2000/svg",ne="http://www.w3.org/1999/xhtml",oe=ne,se=!1,re=null,ae=A({},[ee,ie,ne],w),le=["application/xhtml+xml","text/html"],ce=null,de=r.createElement("form"),ue=function(t){return t instanceof RegExp||t instanceof Function},pe=function(e){ce&&ce===e||(e&&"object"===t(e)||(e={}),e=O(e),gt=gt=-1===le.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,vt="application/xhtml+xml"===gt?w:b,xt="ALLOWED_TAGS"in e?A({},e.ALLOWED_TAGS,vt):_t,At="ALLOWED_ATTR"in e?A({},e.ALLOWED_ATTR,vt):Ot,re="ALLOWED_NAMESPACES"in e?A({},e.ALLOWED_NAMESPACES,w):ae,Zt="ADD_URI_SAFE_ATTR"in e?A(O(te),e.ADD_URI_SAFE_ATTR,vt):te,Qt="ADD_DATA_URI_TAGS"in e?A(O(Vt),e.ADD_DATA_URI_TAGS,vt):Vt,Kt="FORBID_CONTENTS"in e?A({},e.FORBID_CONTENTS,vt):Jt,Et="FORBID_TAGS"in e?A({},e.FORBID_TAGS,vt):{},zt="FORBID_ATTR"in e?A({},e.FORBID_ATTR,vt):{},Yt="USE_PROFILES"in e&&e.USE_PROFILES,jt=!1!==e.ALLOW_ARIA_ATTR,Nt=!1!==e.ALLOW_DATA_ATTR,Mt=e.ALLOW_UNKNOWN_PROTOCOLS||!1,It=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Pt=e.SAFE_FOR_TEMPLATES||!1,Ht=e.WHOLE_DOCUMENT||!1,Ft=e.RETURN_DOM||!1,Wt=e.RETURN_DOM_FRAGMENT||!1,Bt=e.RETURN_TRUSTED_TYPE||!1,Rt=e.FORCE_BODY||!1,Ut=!1!==e.SANITIZE_DOM,qt=e.SANITIZE_NAMED_PROPS||!1,Gt=!1!==e.KEEP_CONTENT,Xt=e.IN_PLACE||!1,Ct=e.ALLOWED_URI_REGEXP||Ct,oe=e.NAMESPACE||ne,Lt=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ue(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Lt.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ue(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Lt.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Lt.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Pt&&(Nt=!1),Wt&&(Ft=!0),Yt&&(xt=A({},n(P)),At=[],!0===Yt.html&&(A(xt,E),A(At,H)),!0===Yt.svg&&(A(xt,z),A(At,D),A(At,F)),!0===Yt.svgFilters&&(A(xt,j),A(At,D),A(At,F)),!0===Yt.mathMl&&(A(xt,M),A(At,R),A(At,F))),e.ADD_TAGS&&(xt===_t&&(xt=O(xt)),A(xt,e.ADD_TAGS,vt)),e.ADD_ATTR&&(At===Ot&&(At=O(At)),A(At,e.ADD_ATTR,vt)),e.ADD_URI_SAFE_ATTR&&A(Zt,e.ADD_URI_SAFE_ATTR,vt),e.FORBID_CONTENTS&&(Kt===Jt&&(Kt=O(Kt)),A(Kt,e.FORBID_CONTENTS,vt)),Gt&&(xt["#text"]=!0),Ht&&A(xt,["html","head","body"]),xt.table&&(A(xt,["tbody"]),delete Et.tbody),d&&d(e),ce=e)},fe=A({},["mi","mo","mn","ms","mtext"]),he=A({},["foreignobject","desc","title","annotation-xml"]),me=A({},["title","style","font","a","script"]),ge=A({},z);A(ge,j),A(ge,N);var ve=A({},M);A(ve,I);var ye=function(t){y(o.removed,{element:t});try{t.parentNode.removeChild(t)}catch(e){try{t.outerHTML=at}catch(e){t.remove()}}},be=function(t,e){try{y(o.removed,{attribute:e.getAttributeNode(t),from:e})}catch(t){y(o.removed,{attribute:null,from:e})}if(e.removeAttribute(t),"is"===t&&!At[t])if(Ft||Wt)try{ye(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}},we=function(t){var e,i;if(Rt)t=""+t;else{var n=k(t,/^[\r\n\t ]+/);i=n&&n[0]}"application/xhtml+xml"===gt&&oe===ne&&(t=''+t+"");var o=rt?rt.createHTML(t):t;if(oe===ne)try{e=(new _).parseFromString(o,gt)}catch(t){}if(!e||!e.documentElement){e=ct.createDocument(oe,"template",null);try{e.documentElement.innerHTML=se?at:o}catch(t){}}var s=e.body||e.documentElement;return t&&i&&s.insertBefore(r.createTextNode(i),s.childNodes[0]||null),oe===ne?pt.call(e,Ht?"html":"body")[0]:Ht?e.documentElement:s},ke=function(t){return dt.call(t.ownerDocument||t,t,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT,null,!1)},Se=function(e){return"object"===t(c)?e instanceof c:e&&"object"===t(e)&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Te=function(t,e,i){mt[t]&&g(mt[t],function(t){t.call(o,e,i,ce)})},$e=function(t){var e;if(Te("beforeSanitizeElements",t,null),function(t){return t instanceof m&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||!(t.attributes instanceof h)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes)}(t))return ye(t),!0;if(C(/[\u0080-\uFFFF]/,t.nodeName))return ye(t),!0;var i=vt(t.nodeName);if(Te("uponSanitizeElement",t,{tagName:i,allowedTags:xt}),t.hasChildNodes()&&!Se(t.firstElementChild)&&(!Se(t.content)||!Se(t.content.firstElementChild))&&C(/<[/\w]/g,t.innerHTML)&&C(/<[/\w]/g,t.textContent))return ye(t),!0;if("select"===i&&C(/