(()=>{"use strict";const t="a.post-page-numbers";function e(t){var e;try{const e=new URL(t.href);for(const t of["page","paged"]){const r=parseInt(e.searchParams.get(t)||"",10);if(r>0)return r}const r=e.pathname.split("/").filter(Boolean).pop()||"";if(/^\d+$/.test(r)){const t=parseInt(r,10);if(t>0)return t}}catch(t){}const r=parseInt((null===(e=t.textContent)||void 0===e?void 0:e.trim())||"",10);return r>0?r:1}const r="https://player.vimeo.com/api/player.js",n="data-googlesitekit-vimeo-sdk";function o(){return globalThis.Vimeo}function i(t,e){return new Promise((r,n)=>{let o;function i(t){return function(){clearTimeout(o),t(...arguments)}}t.addEventListener("load",i(()=>r()),{once:!0}),t.addEventListener("error",i(()=>n(new Error("Site Kit: failed to load the Vimeo Player SDK script."))),{once:!0}),void 0!==e&&(o=setTimeout(i(()=>n(new Error("Site Kit: timed out waiting for the Vimeo Player SDK script to load."))),e))})}let a=null;function c(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function l(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=Array(e);r{var t;const e=null===(t=o())||void 0===t?void 0:t.Player;if("function"!=typeof e)throw new Error("Site Kit: the Vimeo Player SDK script did not expose Vimeo.Player.");return e}).catch(t=>{throw a=null,t})),a)}();await Promise.allSettled(Array.from(e).map(async(e,r)=>{await async function(t,e){const r=Promise.all([t.getVideoTitle(),t.getVideoUrl()]).then(t=>{let r=(o=2,function(t){if(Array.isArray(t))return t}(n=t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,o,i,a,c=[],l=!0,s=!1;try{if(i=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(c.push(n.value),c.length!==e);l=!0);}catch(t){s=!0,o=t}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(s)throw o}}return c}}(n,o)||function(t,e){if(t){if("string"==typeof t)return u(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(t,e):void 0}}(n,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());var n,o;return{video_provider:"vimeo",video_title:r[0],video_url:r[1],video_instance_index:e}});function n(t,e){r.then(r=>{var n,o;null===(n=globalThis._googlesitekit)||void 0===n||null===(o=n.gtagEvent)||void 0===o||o.call(n,t,l(l({},r),{},{video_percent:e}))}).catch(()=>{})}r.catch(t=>{console.error("Site Kit: failed to fetch this Vimeo video’s title/URL; its engagement events will not be tracked.",t)});let o=!1,i=!1;const a=new Set;t.on("play",()=>{o||(o=!0,n("video_start",0))}),t.on("timeupdate",t=>{if(a.size===f.length)return;const e=Math.floor(100*t.percent);f.forEach(t=>{e>=t&&!a.has(t)&&(a.add(t),n("video_progress",t))})}),t.on("ended",()=>{i||(i=!0,n("video_complete",100))}),await r}(new t(e),r)}))}catch(t){console.error("Site Kit: failed to load the Vimeo Player SDK; video engagement events will not be tracked on this page.",t)}}(y());try{v=y(),globalThis.document.addEventListener("click",r=>{try{var n,o;if(!(r.target instanceof Element))return;const i=r.target.closest("".concat(t,", ").concat("body.single-topic .bbp-pagination-links a.page-numbers"));if(!i)return;const a=i.matches(t)?"post":"bbpress";null===(n=globalThis._googlesitekit)||void 0===n||null===(o=n.gtagEvent)||void 0===o||o.call(n,"pagination_click",{pagination_type:a,page_number:e(i),post_id:v.postID,transport_type:"beacon"})}catch(t){console.error("Site Kit: failed to track this pagination click.",t)}})}catch(t){console.error("Site Kit: failed to initialize pagination click tracking.",t)}var v})();