(()=>{"use strict";function e(e){return e.pathname.split("/").filter(Boolean)}function t(e){return(e||"").toLowerCase()}const o=[{type:"phone",schemes:["tel:"]},{type:"email",schemes:["mailto:"]},{type:"sms",schemes:["sms:","smsto:"]},{type:"whatsapp",schemes:["whatsapp:"],hosts:["wa.me","api.whatsapp.com","web.whatsapp.com"],hasRecipient:o=>{if("wa.me"===o.hostname){const[n,i]=e(o);return/^\d+$/.test(n||"")||["message","qr"].includes(t(n))&&!!i}return!!o.searchParams.get("phone")}},{type:"messenger",schemes:["fb-messenger:"],hosts:["m.me","messenger.com"],hasRecipient:o=>{if("m.me"===o.hostname)return e(o).length>0;if("messenger.com"===o.hostname){const[n,i]=e(o);return"t"===t(n)&&!!i}return["user-thread","user"].includes(o.hostname)}},{type:"telegram",schemes:["tg:"],hosts:["t.me","telegram.me"],hasRecipient:o=>{if("tg:"===o.protocol)return"resolve"===o.hostname&&!!o.searchParams.get("domain");const[n]=e(o);return!!n&&!n.startsWith("+")&&!["share","joinchat","addstickers","proxy"].includes(t(n))}},{type:"viber",schemes:["viber:"],hasRecipient:e=>["chat","add","pa"].includes(e.hostname)},{type:"signal",schemes:["sgnl:"],hosts:["signal.me"],hasRecipient:e=>"sgnl:"===e.protocol||e.hash.startsWith("#p/")&&e.hash.length>3},{type:"line",schemes:["line:"],hosts:["line.me","page.line.me"],hasRecipient:o=>{if("page.line.me"===o.hostname)return e(o).length>0;const n="line:"===o.protocol?[o.hostname,...e(o)]:e(o),[i,s,r,a]="r"===t(n[0])?n.slice(1):n;return"ti"===t(i)&&"p"===t(s)&&!!r&&!a}}],n=Object.create(null),i=Object.create(null);o.forEach(e=>{e.schemes?.forEach(t=>{n[t]=e}),e.hosts?.forEach(t=>{i[t]=e})});const s=["sponsored","ugc","nofollow"];function r(e){return"http:"===e.protocol||"https:"===e.protocol?{transport_type:"beacon"}:{}}const a="a.post-page-numbers";function l(e){try{const t=new URL(e.href);for(const e of["page","paged"]){const o=parseInt(t.searchParams.get(e)||"",10);if(o>0)return o}const o=t.pathname.split("/").filter(Boolean).pop()||"";if(/^\d+$/.test(o)){const e=parseInt(o,10);if(e>0)return e}}catch{}const t=parseInt(e.textContent?.trim()||"",10);return t>0?t:1}const c="https://player.vimeo.com/api/player.js",h="data-googlesitekit-vimeo-sdk";function m(){return globalThis.Vimeo}function d(e,t){return new Promise((o,n)=>{let i;function s(e){return(...t)=>{clearTimeout(i),e(...t)}}e.addEventListener("load",s(()=>o()),{once:!0}),e.addEventListener("error",s(()=>n(new Error("Site Kit: failed to load the Vimeo Player SDK script."))),{once:!0}),void 0!==t&&(i=setTimeout(s(()=>n(new Error("Site Kit: timed out waiting for the Vimeo Player SDK script to load."))),t))})}let u=null;const g=[10,25,50,75];function p(e,t){try{e()}catch(e){console.error(...t?[t,e]:[e])}}const f={postID:0,isReadableSinglePost:!1,hasVimeoEmbed:!1,wordCount:0,estimatedReadTimeSeconds:0,isLastPageOfMultiPagePost:!1,readTimeThresholdPercent:85,minimumReadTimeSeconds:5,...globalThis._googlesitekit?.contentEvents||{}};!async function(e){if(!e.hasVimeoEmbed)return;const t=globalThis.document.querySelectorAll('iframe[src*="player.vimeo.com"]');if(t.length)try{const e=await function(){const e=m();return"function"==typeof e?.Player?Promise.resolve(e.Player):(u||(u=async function(){const e=globalThis.document.querySelector(`script[src^="${c}"]`);if(e&&!e.hasAttribute(h))return void await d(e,1e4);e?.remove();const t=globalThis.document.createElement("script");t.src=c,t.setAttribute(h,"");const o=d(t);globalThis.document.head.appendChild(t),await o}().then(()=>{const e=m()?.Player;if("function"!=typeof e)throw new Error("Site Kit: the Vimeo Player SDK script did not expose Vimeo.Player.");return e}).catch(e=>{throw u=null,e})),u)}();await Promise.allSettled(Array.from(t).map(async(t,o)=>{await async function(e,t){const o=Promise.all([e.getVideoTitle(),e.getVideoUrl()]).then(([e,o])=>({video_provider:"vimeo",video_title:e,video_url:o,video_instance_index:t}));function n(e,t){o.then(o=>{globalThis._googlesitekit?.gtagEvent?.(e,{...o,video_percent:t})}).catch(()=>{})}o.catch(e=>{console.error("Site Kit: failed to fetch this Vimeo video’s title/URL; its engagement events will not be tracked.",e)});let i=!1,s=!1;const r=new Set;e.on("play",()=>{i||(i=!0,n("video_start",0))}),e.on("timeupdate",e=>{if(r.size===g.length)return;const t=Math.floor(100*e.percent);g.forEach(e=>{t>=e&&!r.has(e)&&(r.add(e),n("video_progress",e))})}),e.on("ended",()=>{s||(s=!0,n("video_complete",100))}),await o}(new e(t),o)}))}catch(e){console.error("Site Kit: failed to load the Vimeo Player SDK; video engagement events will not be tracked on this page.",e)}}(f),p(()=>function(e){globalThis.document.addEventListener("click",t=>{try{if(!(t.target instanceof Element))return;const o=t.target.closest(`${a}, body.single-topic .bbp-pagination-links a.page-numbers`);if(!o)return;const n=o.matches(a)?"post":"bbpress";globalThis._googlesitekit?.gtagEvent?.("pagination_click",{pagination_type:n,page_number:l(o),post_id:e.postID,transport_type:"beacon"})}catch(e){console.error("Site Kit: failed to track this pagination click.",e)}})}(f),"Site Kit: failed to initialize pagination click tracking."),p(()=>{globalThis.document.addEventListener("click",e=>{try{if(!(e.target instanceof Element))return;const t=e.target.closest("a[href]");if(!t)return;let o;try{o=new URL(t.href)}catch{return}const a=function(e){const t=new URL(e),o="http:"===t.protocol||"https:"===t.protocol;t.hostname=o?t.hostname.replace(/^www\./,""):t.hostname.toLowerCase();const s=o?i[t.hostname]:n[t.protocol];return s?s.hasRecipient?s.hasRecipient(t)?s.type:null:s.type:null}(o);if(a)globalThis._googlesitekit?.gtagEvent?.("contact_link_click",{link_type:a,...r(o)});else{const e=function(e,t){if("http:"!==t.protocol&&"https:"!==t.protocol||t.hostname===globalThis.location.hostname)return null;const o=new Set((e.getAttribute("rel")||"").toLowerCase().split(/[\s,]+/).filter(Boolean));return s.filter(e=>o.has(e)).join(" ")||null}(t,o);e&&globalThis._googlesitekit?.gtagEvent?.("outbound_link_click",{link_rel:e,link_url:o.href,link_domain:o.hostname,...r(o)})}}catch(e){console.error("Site Kit: failed to track this link click.",e)}})},"Site Kit: failed to initialize link click tracking."),p(()=>function(e){const{postID:t,isReadableSinglePost:o,isLastPageOfMultiPagePost:n,wordCount:i,estimatedReadTimeSeconds:s,readTimeThresholdPercent:r,minimumReadTimeSeconds:a}=e;if(!o||!n)return;const l=1e3*Math.max(a,s*r/100);let c=!1,h=!1,m=null,d=null,u=0,g=0;function p(){if(c&&h){try{globalThis._googlesitekit?.gtagEvent?.("read_article",{post_id:t,word_count:i,estimated_read_time_seconds:s})}catch(e){console.error("Site Kit: failed to send the read article event.",e)}f(),T(),globalThis.removeEventListener("blur",y),globalThis.removeEventListener("focus",y),globalThis.document.removeEventListener("visibilitychange",y)}}function f(){m?.disconnect(),m=null,globalThis.removeEventListener("scroll",v)}function b(){c=!0,f(),p()}function v(){(globalThis.scrollY+globalThis.innerHeight)/globalThis.document.documentElement.scrollHeight>=.9&&b()}function T(){null!==d&&(globalThis.clearTimeout(d),d=null,u+=globalThis.performance.now()-g)}function y(){"hidden"!==globalThis.document.visibilityState&&globalThis.document.hasFocus()?h||null!==d||(g=globalThis.performance.now(),d=globalThis.setTimeout(()=>{d=null,h=!0,p()},l-u)):T()}const w=function(){const e=globalThis.document.createTreeWalker(globalThis.document.body,globalThis.NodeFilter.SHOW_COMMENT);for(;e.nextNode();){const t=e.currentNode;if("[googlesitekit-end-of-content]"!==t.data)continue;let o=t.previousElementSibling;for(;o&&0===o.getClientRects().length;)o=o.previousElementSibling;return o||t.parentElement}return null}();w&&"function"==typeof globalThis.IntersectionObserver?(m=new globalThis.IntersectionObserver(e=>{e.some(e=>!e.isIntersecting&&e.rootBounds&&e.boundingClientRect.bottom<=e.rootBounds.top)&&b()},{rootMargin:"-100% 0px 1000000px 0px"}),"complete"===globalThis.document.readyState?m.observe(w):globalThis.addEventListener("load",()=>m?.observe(w),{once:!0})):(globalThis.addEventListener("scroll",v,{passive:!0}),v()),globalThis.addEventListener("blur",y),globalThis.addEventListener("focus",y),globalThis.document.addEventListener("visibilitychange",y),y()}(f),"Site Kit: failed to initialize read article tracking.")})();
(function(){
var supportsPassive=false;
try {
var opts=Object.defineProperty({}, 'passive', {
get:function(){
supportsPassive=true;
}});
window.addEventListener('testPassive', null, opts);
window.removeEventListener('testPassive', null, opts);
} catch(e){}
function init(){
var input_begin='';
var keydowns={};
var lastKeyup=null;
var lastKeydown=null;
var keypresses=[];
var modifierKeys=[];
var correctionKeys=[];
var lastMouseup=null;
var lastMousedown=null;
var mouseclicks=[];
var mouseclickCoordinates=[];
var mousemoveTimer=null;
var lastMousemoveX=null;
var lastMousemoveY=null;
var lastMousemoveTime=null;
var mousemoveStart=null;
var mousemoves=[];
var intervalsBetweenMousemovesAndClicks=[];
var touchmoveCountTimer=null;
var touchmoveCount=0;
var lastTouchEnd=null;
var lastTouchStart=null;
var touchEvents=[];
var scrollCountTimer=null;
var scrollCount=0;
var correctionKeyCodes=[ 'Backspace', 'Delete', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Home', 'End', 'PageUp', 'PageDown' ];
var modifierKeyCodes=[ 'Shift', 'CapsLock' ];
var forms=document.querySelectorAll('form[method=post]');
for(var i=0; i < forms.length; i++){
var form=forms[i];
var formAction=form.getAttribute('action');
if(formAction){
if(formAction.indexOf('http://')==0||formAction.indexOf('https://')==0){
if(formAction.indexOf('http://' + window.location.hostname + '/')!=0&&formAction.indexOf('https://' + window.location.hostname + '/')!=0){
continue;
}}
}
form.addEventListener('submit', function (){
var ak_bkp=prepare_array_for_request(keypresses);
var ak_bmc=prepare_array_for_request(mouseclicks);
var ak_bte=prepare_array_for_request(touchEvents);
var ak_bmm=prepare_array_for_request(mousemoves);
var ak_bcc=prepare_array_for_request(mouseclickCoordinates);
var ak_bibmac=intervalsBetweenMousemovesAndClicks.slice(0, 100).join(';');
var input_fields={
'bib': input_begin,
'bfs': Date.now(),
'bkpc': keypresses.length,
'bkp': ak_bkp,
'bmc': ak_bmc,
'bmcc': mouseclicks.length,
'bmk': modifierKeys.join(';'),
'bck': correctionKeys.join(';'),
'bmmc': mousemoves.length,
'btmc': touchmoveCount,
'bsc': scrollCount,
'bte': ak_bte,
'btec':touchEvents.length,
'bmm':ak_bmm,
'bcc':ak_bcc,
'bibmac':ak_bibmac
};
var akismet_field_prefix='ak_';
if(this.getElementsByClassName){
var possible_akismet_containers=this.getElementsByClassName('akismet-fields-container');
for(var containerIndex=0; containerIndex < possible_akismet_containers.length; containerIndex++){
var container=possible_akismet_containers.item(containerIndex);
if(container.getAttribute('data-prefix') ){
akismet_field_prefix=container.getAttribute('data-prefix');
break;
}}
}
for(var field_name in input_fields){
var field=document.createElement('input');
field.setAttribute('type', 'hidden');
field.setAttribute('name', akismet_field_prefix + field_name);
field.setAttribute('value', input_fields[ field_name ]);
this.appendChild(field);
}}, supportsPassive ? { passive: true }:false);
form.addEventListener('keydown', function(e){
if(e.key in keydowns){
return;
}
var keydownTime=(new Date()).getTime();
keydowns[ e.key ]=[ keydownTime ];
if(! input_begin){
input_begin=keydownTime;
}
var lastKeyEvent=Math.max(lastKeydown, lastKeyup);
if(lastKeyEvent){
keydowns[ e.key ].push(keydownTime - lastKeyEvent);
}
lastKeydown=keydownTime;
}, supportsPassive ? { passive: true }:false);
form.addEventListener('keyup', function(e){
if(!(e.key in keydowns) ){
return;
}
var keyupTime=(new Date()).getTime();
if('TEXTAREA'===e.target.nodeName||'INPUT'===e.target.nodeName){
if(-1!==modifierKeyCodes.indexOf(e.key) ){
modifierKeys.push(keypresses.length - 1);
}else if(-1!==correctionKeyCodes.indexOf(e.key) ){
correctionKeys.push(keypresses.length - 1);
}else{
var keydownTime=keydowns[ e.key ][0];
var keypress=[];
keypress.push(keyupTime - keydownTime);
if(keydowns[ e.key ].length > 1){
keypress.push(keydowns[ e.key ][1]);
}
keypresses.push(keypress);
}}
delete keydowns[ e.key ];
lastKeyup=keyupTime;
}, supportsPassive ? { passive: true }:false);
form.addEventListener("focusin", function(e){
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
form.addEventListener("focusout", function(e){
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
}
document.addEventListener('mousedown', function(e){
lastMousedown=(new Date()).getTime();
if(lastMousemoveTime){
intervalsBetweenMousemovesAndClicks.push(lastMousedown - lastMousemoveTime);
}
var mouseclickCoordinate=[];
var rect=e.target.getBoundingClientRect();
var relativeX=e.clientX - rect.left;
var relativeY=e.clientY - rect.top;
mouseclickCoordinate.push(Math.round(relativeX) );
mouseclickCoordinate.push(Math.round(relativeY) );
mouseclickCoordinate.push(rect.width > 0 ? Math.round(relativeX / rect.width * 100):0);
mouseclickCoordinate.push(rect.height > 0 ? Math.round(relativeY / rect.height * 100):0);
mouseclickCoordinates.push(mouseclickCoordinate);
}, supportsPassive ? { passive: true }:false);
document.addEventListener('mouseup', function(e){
if(! lastMousedown){
return;
}
var now=(new Date()).getTime();
var mouseclick=[];
mouseclick.push(now - lastMousedown);
if(lastMouseup){
mouseclick.push(lastMousedown - lastMouseup);
}
mouseclicks.push(mouseclick);
lastMouseup=now;
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
document.addEventListener('mousemove', function(e){
lastMousemoveTime=(new Date()).getTime();
if(mousemoveTimer){
clearTimeout(mousemoveTimer);
mousemoveTimer=null;
}else{
mousemoveStart=lastMousemoveTime;
lastMousemoveX=e.offsetX;
lastMousemoveY=e.offsetY;
}
mousemoveTimer=setTimeout(function(theEvent, originalMousemoveStart){
var now=(new Date()).getTime() - 500;
var mousemove=[];
mousemove.push(now - originalMousemoveStart);
mousemove.push(Math.round(Math.sqrt(Math.pow(theEvent.offsetX - lastMousemoveX, 2) +
Math.pow(theEvent.offsetY - lastMousemoveY, 2)
)
)
);
if(mousemove[1] > 0){
mousemoves.push(mousemove);
}
mousemoveStart=null;
mousemoveTimer=null;
}, 500, e, mousemoveStart);
}, supportsPassive ? { passive: true }:false);
document.addEventListener('touchmove', function(e){
if(touchmoveCountTimer){
clearTimeout(touchmoveCountTimer);
}
touchmoveCountTimer=setTimeout(function (){
touchmoveCount++;
}, 500);
}, supportsPassive ? { passive: true }:false);
document.addEventListener('touchstart', function(e){
lastTouchStart=(new Date()).getTime();
}, supportsPassive ? { passive: true }:false);
document.addEventListener('touchend', function(e){
if(! lastTouchStart){
return;
}
var now=(new Date()).getTime();
var touchEvent=[];
touchEvent.push(now - lastTouchStart);
if(lastTouchEnd){
touchEvent.push(lastTouchStart - lastTouchEnd);
}
touchEvents.push(touchEvent);
lastTouchEnd=now;
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
document.addEventListener('scroll', function(e){
if(scrollCountTimer){
clearTimeout(scrollCountTimer);
}
scrollCountTimer=setTimeout(function (){
scrollCount++;
}, 500);
}, supportsPassive ? { passive: true }:false);
}
function prepare_array_for_request(a, limit){
if(! limit){
limit=100;
}
var rv='';
if(a.length > 0){
var random_starting_point=Math.max(0, Math.floor(Math.random() * a.length - limit) );
for(var i=0; i < limit&&i < a.length; i++){
var entry=a[ random_starting_point + i ];
rv +=entry.join(',') + ';';
}}
return rv;
}
if(document.readyState!=='loading'){
init();
}else{
document.addEventListener('DOMContentLoaded', init);
}})();