(()=>{const e=document.querySelectorAll(".coblocks-animate");if("IntersectionObserver"in window){const t=new IntersectionObserver((e=>{e.forEach((e=>{e.isIntersecting&&(e.target.classList.add(e.target.dataset.coblocksAnimation),t.unobserve(e.target))}))}),{threshold:[.15]});e.forEach((e=>{t.observe(e)}))}else e.forEach((e=>{e.classList.remove("coblocks-animate"),delete e.dataset.coblocksAnimation}))})();; (()=>{var e={2590:function(e){e.exports=function(){"use strict";function e(){return e=Object.assign||function(e){for(var t=1;te.longSwipesMs?c(r+h*(m>0?-1:1)):c(m>0?r-v:r+v),w(n,i)}}}}(r,e,t,o),u=c.preheat,l=c.move,f=c.stop;function p(e){var t=a?e.changedTouches[0]:e;return{x:t.pageX,y:t.pageY}}function d(t){for(var n=0;n0||navigator.msMaxTouchPoints>0||window.DocumentTouch&&document instanceof DocumentTouch);Object.assign(n,{touchable:o,element:e,measure:i,limitation:r})}return n.update=i,i(e),n}var T="data-shallow-slider",P="data-slider";function E(e,n){function i(i){var r=e.element.$wrapper,o=i.index;r.querySelectorAll("["+P+"]").forEach((function(e){var i,r,a=~~e.getAttribute(P);i=e,void 0===(r=[n.slidePrevClass,n.slideNextClass,n.slideActiveClass])&&(r=[]),Array.isArray(r)||(r=[r]),r.forEach((function(e){return i.classList.contains(e)&&i.classList.remove(e)})),a===o&&t(e,n.slideActiveClass),a===o-1&&t(e,n.slidePrevClass),a===o+1&&t(e,n.slideNextClass)}))}function a(){e.element.$wrapper.querySelectorAll("["+T+"]").forEach((function(t){return e.element.$wrapper.removeChild(t)}))}function s(){e.element.$list.forEach((function(e,t){return r(e,P,t)})),a(),function(){if(n.loop){var t=e.element,i=e.limitation,o=t.$list,a=t.$wrapper,s=i.expand,c=o.slice(-s).map((function(e){return e.cloneNode(!0)})),u=o.slice(0,s).map((function(e){return e.cloneNode(!0)}));c.forEach((function(e,t){a.appendChild(r(u[t],T)),a.insertBefore(r(c[t],T),o[0])}))}}()}function c(){var t,i=e.element,r=e.measure,a=i.$wrapper,s={display:"flex",willChange:"transform",flexDirection:n.isHorizontal?"row":"column"},c=((t={})[n.isHorizontal?"width":"height"]=r.slideSize+"px",t[n.isHorizontal?"margin-right":"margin-bottom"]=n.spaceBetween+"px",t);o(a,s),a.querySelectorAll("["+P+"]").forEach((function(e){return o(e,c)}))}return{init:function(){s(),c()},render:function(t,r,o,a){var s=e.element.$wrapper,c=void 0===r?n.speed:r;n.injections.translate(t,e,n,c),t.isStart||i(t),a&&getComputedStyle(s).transform,o&&setTimeout(o,c)},destroy:function(){var t=e.element,i=t.$list,r=t.$wrapper,o=n.isHorizontal?"margin-right":"margin-bottom";["display","will-change","flex-direction"].forEach((function(e){r.style.removeProperty(e)})),i.forEach((function(e){return e.style.removeProperty(o)})),a()},updateSize:c}}function M(e,t){var n=e-t.max,i=e-t.min;return n>0?n:i<0?i:0}function A(t,n,i,r,o){function a(e){var n=t.measure;return Math.ceil(Math.abs(e)/n.boxSize-i.longSwipesRatio)}function s(e,t,i){r.render(n,e,t,i)}function c(r){var a,s=t.limitation,c=s.min,u=s.max,f=u-c+(i.loop?t.measure.boxSize:0),p=f+1;n.transforms=r,i.loop?(a=(u-r)%p/f,n.progress=a<0?1+a:a>1?a-1:a):(a=(u-r)/f,n.progress=a<0?0:a>1?1:a),o.emit(l,e({},n))}function p(e,r){var l=t.measure,p=t.limitation,d=p.maxIndex-p.minIndex+1,m=i.loop?(e%d+d)%d:e>p.maxIndex?p.maxIndex:e0?1:-1)*(n.minIndex-r-1)+t-e;return Math.abs(i)>Math.abs(o)?o:i}(n.index,m,p,x);g===x||h?n.index===m&&c(h>0?p.min-l.boxSize+h:p.max+l.boxSize+h):c(g<0?p.min-l.boxSize:p.max+l.boxSize),s(0,void 0,!0)}o.emit(u,n.index,n,m),n.index=m,c(v),s(r,(function(){o.emit(f,m,n)}))}return{update:function(){p(n.index,0),r.updateSize()},render:s,transform:c,slideTo:p,scrollPixel:function(e){var r=n.transforms,o=t.measure,a=t.limitation,s=Number(e.toExponential().split("e")[1]),u=s<=0?Math.pow(10,-(s-1)):1,l=r;if(i.resistance&&!i.loop&&(e>0&&r>=a.max?e-=Math.pow(e*u,i.resistanceRatio)/u:e<0&&r<=a.min&&(e+=Math.pow(-e*u,i.resistanceRatio)/u)),l+=e,i.loop){var f=n.tracker.vector(),p=i.isHorizontal?f.velocityX:f.velocityY,d=M(r,a);d&&function(e,t,n){return e>0&&t>n.max||e<0&&t0?a.min-o.boxSize+d:a.max+o.boxSize+d)}c(l)},initStatus:function(e){void 0===e&&(e=0),n.startTransform=e,n.isStart=!1,n.isScrolling=!1,n.isTouching=!1},initLayout:function(e){c(e)},getOffsetSteps:a}}function C(e,t){var n="string"==typeof e?document.body.querySelector(e):e,i=n.querySelector("."+t.wrapperClass),r=[].slice.call(n.getElementsByClassName(t.slideClass));return{$el:n,$wrapper:i,$list:r=r.filter((function(e){return null===e.getAttribute("data-shallow-slider")}))}}var $=function t(n,i){var r,o=function(t){var n=e({},a,t);return e({},n,{isHorizontal:"horizontal"===n.direction})}(i),u=(r={},{on:function(e,t){r[e]?r[e].push(t):r[e]=[t]},off:function(e,t){if(r[e]){var n=r[e].indexOf(t);n>-1&&r[e].splice(n,1)}},emit:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i{var e={7152:function(e){e.exports=function(){"use strict";function e(){return(e=Object.assign||function(e){for(var t=1;te.longSwipesMs?l(p+m*(0h.maxIndex?h.maxIndex:eMath.abs(f)?f:v)===p||l?n.index===b&&d(0=s.max?e-=Math.pow(e*l,i.resistanceRatio)/l:e<0&&r<=s.min&&(e+=Math.pow(-e*l,i.resistanceRatio)/l)),c+=e,i.loop&&(o=n.tracker.vector(),l=i.isHorizontal?o.velocityX:o.velocityY,(e=w(r,s))&&(o=r,r=s,0r.max||l<0&&o{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var i in t)n.o(t,i)&&!n.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=n(7152),t=n.n(e),i=n(3266),o=n.n(i);!function(){const e=document.querySelectorAll(".wp-block-coblocks-gallery-carousel");for(let n=0;n{const t=s.querySelector(`.wp-block-coblocks-gallery-carousel-thumbnail-${r}`);if(t){t.classList.remove("is-active");const n=s.querySelector(`.wp-block-coblocks-gallery-carousel-thumbnail-${e}`);n&&n.classList.add("is-active")}},c=e=>{i?.slideTo(e),l(e),r=e},u=e=>{e!==r&&(l(e),r=e)},d=s.querySelector(".swiper-container");if(d){const e=d.getAttribute("data-swiper");if(e){const n=JSON.parse(e),r=s.querySelector(".nav-button__prev"),l=s.querySelector(".nav-button__next");r&&r.setAttribute("aria-label",coblocksTinyswiper.carouselPrevButtonAriaLabel),l&&l.setAttribute("aria-label",coblocksTinyswiper.carouselNextButtonAriaLabel);const p=s.querySelectorAll("img");for(let e=0;e{i.update()})).observe(d),n.thumbnails){const e=s.querySelectorAll(".wp-block-coblocks-gallery-carousel-thumbnail");for(const[t,n]of Object.entries(e))n.addEventListener("click",(()=>c(t)));const t=s.querySelector(".wp-block-coblocks-gallery-carousel-thumbnail-0");t&&t.classList.add("is-active")}if(!n.thumbnails&&n.pageDots){const e=s.querySelectorAll(".wp-block-coblocks-gallery-carousel-page-dot-pagination");for(const[t,n]of Object.entries(e))n.addEventListener("click",(()=>c(t)));const t=s.querySelector(".wp-block-coblocks-gallery-carousel-page-dot--0");t&&t.classList.add("is-active")}if(!0!==n.draggable){const e=s.querySelector(".swiper-wrapper");e?.addEventListener("mousedown",(e=>{e.stopPropagation()}))}!0===n.autoPlay&&n.autoPlaySpeed&&(!0===n.pauseHover&&(d.addEventListener("mouseenter",(()=>{a=!0})),d.addEventListener("mouseleave",(()=>{a=!1}))),setInterval((()=>{!0===n.pauseHover&&!0===a||i?.slideTo(i.state.index+1)}),n.autoPlaySpeed)),i.on("after-slide",u)}}}}()})()})();; jQuery(document).ready(function(){var t=!1;void 0!==eztoc_smooth_local.JumpJsLinks&&1===parseInt(eztoc_smooth_local.JumpJsLinks)&&(t=!0),document.querySelectorAll(".ez-toc-link").forEach(t=>{t=t.replaceWith(t.cloneNode(!0))}),document.querySelectorAll(".ez-toc-section").forEach(t=>{t.setAttribute("ez-toc-data-id","#"+decodeURI(t.getAttribute("id")))}),jQuery("a.ez-toc-link").click(function(){let e=jQuery(this).attr("data-href"),i=jQuery(this).attr("href");if(1===parseInt(eztoc_smooth_local.add_request_uri)){if(jQuery(this).attr("data-href")){let r=jQuery(this).attr("data-href").split("#");r&&r.length>1&&(e=`#${r[1]}`)}if(jQuery(this).attr("href")){let a=jQuery(this).attr("href").split("#");a&&a.length>1&&(i=`#${a[1]}`)}}let l=t?e:i,o=jQuery("#wpadminbar"),s=jQuery("header"),h=0;if(parseInt(eztoc_smooth_local.scroll_offset)>30&&(h=parseInt(eztoc_smooth_local.scroll_offset)),o.length&&(h+=o.height()),(s.length&&"fixed"==s.css("position")||"sticky"==s.css("position"))&&(h+=s.height()),jQuery('[ez-toc-data-id="'+decodeURI(l)+'"]').length>0&&(h=jQuery('[ez-toc-data-id="'+decodeURI(l)+'"]').offset().top-h),jQuery("html, body").animate({scrollTop:h},500),t)return!1})});; /*! * JavaScript Cookie v2.2.1 * https://github.com/js-cookie/js-cookie * * Copyright 2006, 2015 Klaus Hartl & Fagner Brack * Released under the MIT license */ !function(factory){var registeredInModuleLoader;if("function"==typeof define&&define.amd&&(define(factory),registeredInModuleLoader=!0),"object"==typeof exports&&(module.exports=factory(),registeredInModuleLoader=!0),!registeredInModuleLoader){var OldCookies=window.Cookies,api=window.Cookies=factory();api.noConflict=function(){return window.Cookies=OldCookies,api}}}((function(){function extend(){for(var i=0,result={};i");u=function(){var J,L,K;if(z){return;}I=p.height();J=parseInt(w.css("border-top-width"),10);L=parseInt(w.css("padding-top"),10); G=parseInt(w.css("padding-bottom"),10);q=w.offset().top+J+L;i=w.height();if(r){r=false;D=false;if(f==null){t.insertAfter(v);v.detach();}t.css({position:"",top:"",width:"",bottom:""}).removeClass(g); K=true;}B=t.offset().top-(parseInt(t.css("margin-top"),10)||0)-l;C=t.outerHeight(true);y=t.css("float");if(v){v.css({width:t.outerWidth(true),height:C,display:t.css("display"),"vertical-align":t.css("vertical-align"),"float":y}); }if(K){return E();}};u();if(C===i){return;}F=void 0;s=l;A=c;E=function(){var L,O,M,K,J,N;if(z){return;}M=false;if(A!=null){A-=1;if(A<=0){A=c;u();M=true; }}if(!M&&p.height()!==I){u();M=true;}K=b.scrollTop();if(F!=null){O=K-F;}F=K;if(r){if(o){J=K+C+s>i+q;if(D&&!J){D=false;t.css({position:"fixed",bottom:"",top:s}).trigger("sticky_kit:unbottom"); }}if(KN){if(!D){s-=O;s=Math.max(N-C,s);s=Math.min(l,s);if(r){t.css({top:s+"px"});}}}}}else{if(K>B){r=true;L={position:"fixed",top:s}; L.width=t.css("box-sizing")==="border-box"?t.outerWidth()+"px":t.width()+"px";t.css(L).addClass(g);if(f==null){t.after(v);if(y==="left"||y==="right"){v.append(t); }}t.trigger("sticky_kit:stick");}}if(r&&o){if(J==null){J=K+C+s>i+q;}if(!D&&J){D=true;if(w.css("position")==="static"){w.css({position:"relative"});}return t.css({position:"absolute",bottom:G,top:"auto"}).trigger("sticky_kit:bottom"); }}};x=function(){u();return E();};H=function(){z=true;b.off("touchmove",E);b.off("scroll",E);b.off("resize",x);a(document.body).off("sticky_kit:recalc",x); t.off("sticky_kit:detach",H);t.removeData("sticky_kit");t.css({position:"",bottom:"",top:"",width:""});w.position("position","");if(r){if(f==null){if(y==="left"||y==="right"){t.insertAfter(v); }v.remove();}return t.removeClass(g);}};b.on("touchmove",E);b.on("scroll",E);b.on("resize",x);a(document.body).on("sticky_kit:recalc",x);t.on("sticky_kit:detach",H); return setTimeout(E,0);};for(j=0,k=this.length;j0&&i'+v+""),p=e("#ez-toc-height-test"),b=p.height(),p.remove(),b-(g.children("ul").first().height()||0)),e(".ez-toc-widget-container ul.ez-toc-list li.active").css("height",m+"px")}}function f(){e(window).off("load resize scroll",h)}l.length>0&&e(".ez-toc-widget-container").length&&e(window).on("load resize scroll",h)}e("#ez-toc-container").length&&!e("#ez-toc-container .ez-toc-toggle label span").html()&&e("#ez-toc-container .ez-toc-toggle label").html(ezTOC.fallbackIcon),ezTOC.init=function(){t()},t(),void 0!==ezTOC.ajax_toggle&&1===parseInt(ezTOC.ajax_toggle)&&e(document).ajaxComplete(function(){t()})}e(document).on("click","#ez-toc-open-sub-hd",function(t){e(this).attr("id","ez-toc-open-sub-hd-active"),t.preventDefault()}),e(document).on("click","#ez-toc-open-sub-hd-active",function(t){e(this).attr("id","ez-toc-open-sub-hd"),t.preventDefault()}),e("#ez-toc-more-links-enabler").click(function(){e(".ez-toc-more-link").show(),e("#ez-toc-more-links-enabler").hide(),e("#ez-toc-more-links-disabler").attr("style","display:inline-block")}),e("#ez-toc-more-links-disabler").click(function(){e(".ez-toc-more-link").hide(),e("#ez-toc-more-links-enabler").show(),e("#ez-toc-more-links-disabler").hide()}),1===parseInt(ezTOC.chamomile_theme_is_on)&&e("#ez-toc-container").find(".hamburger").remove()});; /** * Makes "skip to content" link work correctly in IE9, Chrome, and Opera * for better accessibility. * * @link http://www.nczonline.net/blog/2013/01/15/fixing-skip-to-content-links/ */ ( function() { var isWebkit = navigator.userAgent.toLowerCase().indexOf( 'webkit' ) > -1, isOpera = navigator.userAgent.toLowerCase().indexOf( 'opera' ) > -1, isIE = navigator.userAgent.toLowerCase().indexOf( 'msie' ) > -1; if ( ( isWebkit || isOpera || isIE ) && document.getElementById && window.addEventListener ) { window.addEventListener( 'hashchange', function() { var id = location.hash.substring( 1 ), element; if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) { return; } element = document.getElementById( id ); if ( element ) { if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) { element.tabIndex = -1; } element.focus(); // Repositions the window on jump-to-anchor to account for admin bar and border height. window.scrollBy( 0, -53 ); } }, false ); } } )(); ; /* global screenReaderText */ /** * Theme functions file. * * Contains handlers for navigation and widget area. */ ( function () { 'use strict'; var mainNav, masthead, menuToggle, siteNavigation, socialNavigation, siteHeaderMenu, resizeTimer; function matches( el, sel ) { if ( Element.prototype.matches ) { return el.matches( sel ); } if ( Element.prototype.msMatchesSelector ) { return el.msMatchesSelector( sel ); } } // Based on https://developer.mozilla.org/en-US/docs/Web/API/Element/closest#Polyfill function closest( el, sel ) { if ( el.closest ) { return el.closest( sel ); } var current = el; do { if ( matches( el, sel ) ) { return current; } current = current.parentElement || current.parentNode; } while ( current !== null && current.nodeType === 1 ); return null; } function forEachNode( parent, selector, fn ) { var nodes = parent.querySelectorAll( selector ); for ( var i = 0; i < nodes.length; i++ ) { fn( nodes[ i ] ); } } function initMainNavigation( container ) { forEachNode( container, '.menu-item-has-children > a', function ( el ) { // Add dropdown toggle that displays child menu items. var dropdownToggle = document.createElement( 'button' ); dropdownToggle.className = 'dropdown-toggle'; dropdownToggle.setAttribute( 'aria-expanded', 'false' ); var span = document.createElement( 'span' ); span.className = 'screen-reader-text'; span.textContent = screenReaderText.expand; dropdownToggle.appendChild( span ); el.parentNode.insertBefore( dropdownToggle, el.nextSibling ); } ); // Toggle buttons and submenu items with active children menu items. forEachNode( container, '.current-menu-ancestor > button', function ( el ) { el.classList.add( 'toggled-on' ); } ); forEachNode( container, '.current-menu-ancestor > .sub-menu', function ( el ) { el.classList.add( 'toggled-on' ); } ); // Add menu items with submenus to aria-haspopup="true". forEachNode( container, '.menu-item-has-children', function ( el ) { el.setAttribute( 'aria-haspopup', 'true' ); } ); forEachNode( container, '.dropdown-toggle', function ( el ) { el.addEventListener( 'click', function ( e ) { var screenReaderSpan = el.querySelector( '.screen-reader-text' ); e.preventDefault(); el.classList.toggle( 'toggled-on' ); var next = el.nextElementSibling; if ( next && matches( next, '.children, .sub-menu' ) ) { next.classList.toggle( 'toggled-on' ); } el.setAttribute( 'aria-expanded', el.getAttribute( 'aria-expanded' ) === 'false' ? 'true' : 'false' ); screenReaderSpan.textContent = screenReaderSpan.textContent === screenReaderText.expand ? screenReaderText.collapse: screenReaderText.expand; } ); } ); } mainNav = document.querySelector( '.main-navigation' ); if ( mainNav ) { initMainNavigation( mainNav ); } masthead = document.querySelector( '#masthead' ); menuToggle = masthead && masthead.querySelector( '#menu-toggle' ); siteHeaderMenu = masthead && masthead.querySelector( '#site-header-menu' ); siteNavigation = masthead && masthead.querySelector( '#site-navigation' ); socialNavigation = masthead && masthead.querySelector( '#social-navigation' ); // Enable menuToggle. ( function () { // Return early if menuToggle is missing. if ( ! menuToggle ) { return; } var controls = [ menuToggle, siteNavigation, socialNavigation ].filter( Boolean ); // Add an initial values for the attribute. controls.forEach( function ( el ) { el.setAttribute( 'aria-expanded', 'false' ); } ); menuToggle.addEventListener( 'click', function () { menuToggle.classList.toggle( 'toggled-on' ); siteHeaderMenu.classList.toggle( 'toggled-on' ); var newVal = menuToggle.getAttribute( 'aria-expanded' ) === 'false' ? 'true' : 'false'; controls.forEach( function ( el ) { el.setAttribute( 'aria-expanded', newVal ); } ); } ); } )(); // Fix sub-menus for touch devices and better focus for hidden submenu items for accessibility. ( function () { if ( ! siteNavigation || ! siteNavigation.children.length ) { return; } // Init `focus` class to allow submenu access on tablets. function initFocusClassTouchScreen() { document.body.addEventListener( 'touchstart', function ( e ) { if ( ! closest( e.target, '.main-navigation li' ) ) { forEachNode( document, '.main-navigation li', function ( el ) { el.classList.remove( 'focus' ); } ); } } ); forEachNode( siteNavigation, '.menu-item-has-children > a', function ( link ) { link.addEventListener( 'touchstart', function ( e ) { if ( window.innerWidth >= 910 ) { var el = link.parentElement; if ( matches( el, 'li' ) && ! el.classList.contains( 'focus' ) ) { e.preventDefault(); el.classList.toggle( 'focus' ); var children = el.parentElement.children; for ( var i = 0; i < children.length; i++ ) { if ( children[ i ] !== el ) { children[ i ].classList.remove( 'focus' ); } } } } } ); } ); } function toggleFocus( el ) { var item = closest( el, '.menu-item' ); if ( item ) { item.classList.toggle( 'focus' ); } } if ( 'ontouchstart' in window ) { initFocusClassTouchScreen(); } forEachNode( siteNavigation, 'a', function ( link ) { link.addEventListener( 'focus', toggleFocus( link ) ); link.addEventListener( 'blur', toggleFocus( link ) ); } ); } )(); // Add the default ARIA attributes for the menu toggle and the navigations. function onResizeARIA() { if ( window.innerWidth < 910 ) { if ( menuToggle && menuToggle.classList.contains( 'toggled-on' ) ) { menuToggle.setAttribute( 'aria-expanded', 'true' ); } else { menuToggle.setAttribute( 'aria-expanded', 'false' ); } if ( siteHeaderMenu && siteHeaderMenu.classList.contains( 'toggled-on' ) ) { siteNavigation && siteNavigation.setAttribute( 'aria-expanded', 'true' ); socialNavigation && socialNavigation.setAttribute( 'aria-expanded', 'true' ); } else { siteNavigation && siteNavigation.setAttribute( 'aria-expanded', 'false' ); socialNavigation && socialNavigation.setAttribute( 'aria-expanded', 'false' ); } menuToggle && menuToggle.setAttribute( 'aria-controls', 'site-navigation social-navigation' ); } else { menuToggle && menuToggle.removeAttribute( 'aria-expanded' ); siteNavigation && siteNavigation.removeAttribute( 'aria-expanded' ); socialNavigation && socialNavigation.removeAttribute( 'aria-expanded' ); menuToggle && menuToggle.removeAttribute( 'aria-controls' ); } } // Add 'below-entry-meta' class to elements. function belowEntryMetaClass( selector ) { if ( document.body.classList.contains( 'page' ) || document.body.classList.contains( 'search' ) || document.body.classList.contains( 'single-attachment' ) || document.body.classList.contains( 'error404' ) ) { return; } forEachNode( document, '.entry-content', function ( content ) { forEachNode( content, selector, function ( element ) { var elementPosTop = element.getBoundingClientRect().top; var article = closest( element, 'article' ); var entryFooter = article && article.querySelector( '.entry-footer' ); var entryFooterPosBottom = entryFooter ? entryFooter.getBoundingClientRect().top + entryFooter.offsetHeight + 28 : null; var caption = closest( element, 'figure' ); var next = element.nextSibling; var figcaption = next && matches( next, 'figcaption' ) ? next : null; var newImg; // Add 'below-entry-meta' to elements below the entry meta. if ( entryFooterPosBottom !== null && elementPosTop > entryFooterPosBottom ) { // Check if full-size images and captions are larger than or equal to 840px. if ( selector === 'img.size-full' || selector === '.wp-block-image img' ) { // Create an image to find native image width of resized images (i.e. max-width: 100%). newImg = new Image(); newImg.src = element.getAttribute( 'src' ); newImg.onload = function () { if ( newImg.width >= 840 ) { // Check if an image in an image block has a width attribute; if its value is less than 840, return. if ( selector === '.wp-block-image img' && element.hasAttribute( 'width' ) && element.getAttribute( 'width' ) < 840 ) { return; } element.classList.add( 'below-entry-meta' ); if ( caption && caption.classList.contains( 'wp-caption' ) ) { caption.classList.add( 'below-entry-meta' ); caption.removeAttribute( 'style' ); } if ( figcaption ) { figcaption.classList.add( 'below-entry-meta' ); } } }; } else { element.classList.add( 'below-entry-meta' ); } } else { element.classList.remove( 'below-entry-meta' ); caption && caption.classList.remove( 'below-entry-meta' ); } } ); } ); } function init() { window.addEventListener( 'load', onResizeARIA ); window.addEventListener( 'resize', function () { clearTimeout( resizeTimer ); resizeTimer = setTimeout( function () { belowEntryMetaClass( 'img.size-full' ); belowEntryMetaClass( 'blockquote.alignleft, blockquote.alignright' ); belowEntryMetaClass( '.wp-block-image img' ); }, 300 ); onResizeARIA(); } ); belowEntryMetaClass( 'img.size-full' ); belowEntryMetaClass( 'blockquote.alignleft, blockquote.alignright' ); belowEntryMetaClass( '.wp-block-image img' ); } if ( document.readyState === 'loading' ) { document.addEventListener( 'DOMContentLoaded', init ); } else { init(); } } )(); ; !function(){function e(){this.galleries=[],this.findAndSetupNewGalleries()}function t(e){this.gallery=e,this.addCaptionEvents(),this.resize(),this.gallery.classList.remove("tiled-gallery-unresized")}e.prototype.findAndSetupNewGalleries=function(){var e=this,r=document.querySelectorAll(".tiled-gallery.tiled-gallery-unresized");Array.prototype.forEach.call(r,(function(r){e.galleries.push(new t(r))}))},e.prototype.resizeAll=function(){Array.prototype.forEach.call(this.galleries,(function(e){e.resize()}))},t.prototype.resizeableElementsSelector=".gallery-row, .gallery-group, .tiled-gallery-item img",t.prototype.addCaptionEvents=function(){var e=this.gallery.querySelectorAll(".tiled-gallery-caption");Array.prototype.forEach.call(e,(function(e){e.style.display="none"}));var t=function(e){var t=e.target.closest(".tiled-gallery-item"),r="mouseover"===e.type?"block":"none";if(t){var i=t.querySelector(".tiled-gallery-caption");i&&(i.style.display=r)}};this.gallery.addEventListener("mouseover",t),this.gallery.addEventListener("mouseout",t)},t.prototype.getExtraDimension=function(e,t,r){if("horizontal"===r){var i="border"===t?"borderLeftWidth":t+"Left",n="border"===t?"borderRightWidth":t+"Right";return(parseInt(e.style[i],10)||0)+(parseInt(e.style[n],10)||0)}if("vertical"===r){var o="border"===t?"borderTopWidth":t+"Top",a="border"===t?"borderBottomWidth":t+"Bottom";return(parseInt(e.style[o],10)||0)+(parseInt(e.style[a],10)||0)}return 0},t.prototype.resize=function(){var e=parseInt(this.gallery.dataset.originalWidth,10),t=parseFloat(getComputedStyle(this.gallery.parentNode,null).width.replace("px","")),r=Math.min(1,t/e),i=this,n=this.gallery.querySelectorAll(this.resizeableElementsSelector);Array.prototype.forEach.call(n,(function(e){var t=i.getExtraDimension(e,"margin","horizontal"),n=i.getExtraDimension(e,"margin","vertical"),o=i.getExtraDimension(e,"padding","horizontal"),a=i.getExtraDimension(e,"padding","vertical"),l=i.getExtraDimension(e,"border","horizontal"),s=i.getExtraDimension(e,"border","vertical"),d=parseInt(e.dataset.originalWidth,10)+o+l+t,c=parseInt(e.dataset.originalHeight,10)+a+s+n;e.style.width=Math.floor(r*d)-t+"px",e.style.height=Math.floor(r*c)-n+"px"}))};var r,i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame;r=function(){var t=new e;document.body.addEventListener("is.post-load",(function(){t.findAndSetupNewGalleries()})),window.chrome&&i?function(e){var t=!1,r=null;function n(){e.resizeAll(),t&&i(n)}window.addEventListener("resize",(function(){clearTimeout(r),t||i(n),t=!0,r=setTimeout((function(){t=!1}),15)}))}(t):function(e){window.addEventListener("resize",(function(){e.resizeAll()}))}(t),"undefined"!=typeof wp&&wp.customize&&wp.customize.selectiveRefresh&&wp.customize.selectiveRefresh.bind("partial-content-rendered",(function(e){wp.isJetpackWidgetPlaced(e,"gallery")&&t.findAndSetupNewGalleries()}))},"loading"!==document.readyState?r():document.addEventListener("DOMContentLoaded",r)}();;