!function(){"use strict";(t=>{const{screen:{width:e,height:a},navigator:{language:n,doNotTrack:r,msDoNotTrack:i},location:o,document:c,history:s,top:f,doNotTrack:l}=t,{currentScript:u,referrer:d}=c;if(!u)return;const{hostname:h,href:m,origin:p}=o;let g;try{g=m.startsWith("data:")?void 0:t.localStorage}catch{}const y="data-",b="true",v=u.getAttribute.bind(u),T=t=>v(`${y}${t}`),S=T("website-id"),w=T("host-url"),x=T("before-send"),E=T("tag")||void 0,k="false"!==T("auto-track"),M=T("do-not-track")===b,N=T("exclude-search")===b,j=T("exclude-hash")===b,O=T("domains")||"",$=T("fetch-credentials")||"omit",A=T("performance")===b,L=O.split(",").map(t=>t.trim()),I=`${(w||""||u.src.split("/").slice(0,-1).join("/")).replace(/\/$/,"")}/api/send`,P=`${e}x${a}`,K=/data-umami-event-([\w-_]+)/,R=`${y}umami-event`,U=300,_=t=>{if(!t)return t;try{const e=new URL(t,o.href);return N&&(e.search=""),j&&(e.hash=""),e.toString()}catch{return t}},B=()=>({website:S,screen:P,language:n,title:c.title,hostname:h,url:V,referrer:X,tag:E,id:H||void 0}),D=(t,e,a)=>{a&&("function"==typeof Q&&Q(),X=V,V=_(new URL(a,o.href).toString()),V!==X&&setTimeout(q,U))},W=()=>Z||!S||g?.getItem("umami.disabled")||O&&!L.includes(h)||M&&(()=>{const t=l||r||i;return 1===t||"1"===t||"yes"===t})(),C=async(e,a="event")=>{if(W())return;const n=t[x];if("function"==typeof n&&(e=await Promise.resolve(n(a,e))),e)try{const t=await fetch(I,{keepalive:!0,method:"POST",body:JSON.stringify({type:a,payload:e}),headers:{"Content-Type":"application/json",...void 0!==G&&{"x-umami-cache":G}},credentials:$}),n=await t.json();n&&(Z=!!n.disabled,G=n.cache)}catch(t){}},J=()=>{Y||(Y=!0,q(),(()=>{const t=(t,e,a)=>{const n=t[e];return(...e)=>(a.apply(null,e),n.apply(t,e))};s.pushState=t(s,"pushState",D),s.replaceState=t(s,"replaceState",D)})(),(()=>{const t=async t=>{const e=t.getAttribute(R);if(e){const a={};return t.getAttributeNames().forEach(e=>{const n=e.match(K);n&&(a[n[1]]=t.getAttribute(e))}),q(e,a)}};c.addEventListener("click",async e=>{const a=e.target,n=a.closest("a,button");if(!n)return t(a);const{href:r,target:i}=n;if(n.getAttribute(R)){if("BUTTON"===n.tagName)return t(n);if("A"===n.tagName&&r){const a="_blank"===i||e.ctrlKey||e.shiftKey||e.metaKey||e.button&&1===e.button;return a||e.preventDefault(),t(n).then(()=>{a||(("_top"===i?f.location:o).href=r)})}}},!0)})(),A&&F())},q=(t,e)=>C("string"==typeof t?{...B(),name:t,data:e}:"object"==typeof t?{...t}:"function"==typeof t?t(B()):B()),z=(t,e)=>("string"==typeof t&&(H=t),G="",C({...B(),data:"object"==typeof t?t:e},"identify")),F=()=>{const e={};let a,n=!1,r=!0,i=0,o=0;const s=(t,e)=>{try{new PerformanceObserver(t=>{t.getEntries().forEach(e)}).observe({type:t,buffered:!0})}catch{}};s("navigation",t=>{i=t.activationStart||0,e.ttfb=Math.max(t.responseStart-i,0)}),s("paint",t=>{"first-contentful-paint"===t.name&&(e.fcp=Math.max(t.startTime-i,0))}),s("largest-contentful-paint",t=>{e.lcp=Math.max(t.startTime-i,0)});let f=0,l=[];s("layout-shift",t=>{if(!t.hadRecentInput){const a=l[l.length-1],n=l[0];a&&t.startTime-a.startTime-a.duration<1e3&&t.startTime-n.startTime<5e3?(f+=t.value,l.push(t)):(f=t.value,l=[t]),f>(e.cls||0)&&(e.cls=f)}});let u={};try{new PerformanceObserver(t=>{t.getEntries().forEach(t=>{if(t.interactionId){const a=u[t.interactionId];(!a||t.duration>a)&&(u[t.interactionId]=t.duration);const n=Object.values(u).sort((t,e)=>e-t);if(n.length){const t=Math.floor(.02*Math.max(n.length,10));e.inp=n[Math.min(t,n.length-1)]}}})}).observe({type:"event",buffered:!0,durationThreshold:40})}catch{}const d=e=>{try{return t.performance?.getEntriesByType?.(e)||[]}catch{return[]}},h=()=>{n||((()=>{if(r){if(void 0===e.ttfb){const t=d("navigation")?.[0];t&&(e.ttfb=Math.max(t.responseStart-(t.activationStart||0),0))}if(void 0===e.fcp){const t=d("paint")?.find(t=>"first-contentful-paint"===t.name);t&&(e.fcp=Math.max(t.startTime-i,0))}if(void 0===e.lcp){const t=d("largest-contentful-paint"),a=t?.[t.length-1];a&&(e.lcp=Math.max(a.startTime-i,0))}}})(),e.duration=Math.round(performance.now()-o),n=!0,a&&clearTimeout(a),C({...B(),...e},"performance"))};Q=()=>{h(),r=!1,Object.keys(e).forEach(t=>{delete e[t]}),i=0,o=performance.now(),f=0,l=[],u={},n=!1,a&&clearTimeout(a),a=setTimeout(h,1e4)},a=setTimeout(h,1e4),c.addEventListener("visibilitychange",()=>{"hidden"===c.visibilityState&&h()}),t.addEventListener("pagehide",h)};t.umami||(t.umami={track:q,identify:z,getSession:()=>({cache:G,website:S})});let G,H,Q,V=_(m),X=_(d.startsWith(p)?"":d),Y=!1,Z=!1;k&&!W()&&("complete"===c.readyState?J():c.addEventListener("readystatechange",J,!0))})(window)}();
