"use strict";(()=>{function e(e){let t=location.href;if(e){let n=new URL(t);if(n.pathname!==e)return n.pathname=e,n.search="",n.href}return t}function t(){return!!(navigator.webdriver||navigator.userAgent.includes("Headless"))}var n,a,r,i,o=(r=()=>{},()=>(r&&(i=r(r=0)),i));(n=()=>{o(),function(){let n=e=>e,a=document,r=a.currentScript;if(t())return;let i=(null==r?void 0:r.dataset.endpoint)||(null!=r&&r.src.includes("/va/")?"/va":"/_vercel/insights"),o=null==r?void 0:r.dataset.disableAutoTrack,l=null,s=null,u=!0;async function d(e){if(e&&!Array.isArray(e))return{p:e};let t=a.querySelectorAll("[data-flag-values]");if(!r||!t.length)return;let n=new URL(r.src),i=n.pathname.split("/"),o=i.pop();return o&&i.push("flags",o),n.pathname=i.join("/"),import(n.href).then(n=>n.gather(t,e))}async function c({type:t,data:o,options:u}){var c,f,p;let h=e(s),v=a.referrer,w=n({type:t,url:h,payload:o});if(!1===w||null===w)return;w&&(h=w.url,o=null!=(c=w.payload)?c:o);let y=v.includes(location.host),g={o:h,sv:"0.1.3",sdkn:null!=(f=null==r?void 0:r.dataset.sdkn)?f:void 0,sdkv:null!=(p=null==r?void 0:r.dataset.sdkv)?p:void 0,ts:Date.now(),...l&&{dp:l},...null!=u&&u.withReferrer&&!y?{r:v}:{},..."event"===t&&o&&{en:o.name,ed:o.data},f:await d(null==u?void 0:u.flags).catch(()=>{})};try{await fetch(`${i}/${"pageview"===t?"view":"event"}`,{method:"POST",keepalive:!0,headers:{"Content-Type":"application/json"},body:JSON.stringify(g)})}catch(m){}}async function f(e={}){return c({type:"pageview",options:{withReferrer:e.withReferrer}})}async function p(e,t,n){return c({type:"event",data:{name:e,data:t},options:{withReferrer:!0,flags:null==n?void 0:n.flags}})}async function h(){await fetch(`${i}/session`,{method:"GET",keepalive:!0}).catch(()=>{})}function v(e){return e.pathname===new URL(y).pathname}function w(e){let t=e?"string"==typeof e?new URL(e,location.origin):new URL(e.href):null;!t||v(t)||t.hash&&v(t)||f()}let y=e(),g=()=>{var e;window.va=function(e,t){"beforeSend"===e?n=t:"event"===e?t&&p(t.name,t.data,t.options):"pageview"===e&&t&&(t.route&&(l=t.route),t.path&&(s=t.path),f({withReferrer:u}),u=!1),"enableCookie"===e&&h()},null==(e=window.vaq)||e.forEach(([e,t])=>{window.va(e,t)})};(()=>{if(window.vai||(window.vai=!0,g(),o))return;f({withReferrer:!0});let t=history.pushState.bind(history);history.pushState=function(...n){t(...n);try{w(n[2]),y=e()}catch(a){}},window.addEventListener("popstate",function(){w(e()),y=e()})})()}()},()=>(a||n((a={exports:{}}).exports,a),a.exports))()})();