!function(){"use strict";(t=>{const{screen:{width:e,height:a},navigator:{language:r,doNotTrack:n,msDoNotTrack:i},location:o,document:c,history:s,top:u,doNotTrack:d}=t,{currentScript:l,referrer:f}=c;if(!l)return;const{hostname:h,href:m,origin:p}=o,y=m.startsWith("data:")?void 0:t.localStorage,g="data-",b="true",v=l.getAttribute.bind(l),S=v(g+"website-id"),w=v(g+"host-url"),k=v(g+"before-send"),N=v(g+"tag")||void 0,T="false"!==v(g+"auto-track"),A=v(g+"do-not-track")===b,j=v(g+"exclude-search")===b,x=v(g+"exclude-hash")===b,L=v(g+"domains")||"",$=L.split(",").map(t=>t.trim()),E=`${(w||""||l.src.split("/").slice(0,-1).join("/")).replace(/\/$/,"")}/api/send`,K=`${e}x${a}`,O=/data-umami-event-([\w-_]+)/,U=g+"umami-event",_=300,D=t=>{if(!t)return t;try{const e=new URL(t,o.href);return j&&(e.search=""),x&&(e.hash=""),e.toString()}catch(e){return t}},R=()=>({website:S,screen:K,language:r,title:c.title,hostname:h,url:F,referrer:G,tag:N,id:z||void 0}),W=(t,e,a)=>{a&&(G=F,F=D(new URL(a,o.href).toString()),F!==G&&setTimeout(J,_))},B=()=>M||!S||y&&y.getItem("umami.disabled")||L&&!$.includes(h)||A&&(()=>{const t=d||n||i;return 1===t||"1"===t||"yes"===t})(),C=async(e,a="event")=>{if(B())return;const r=t[k];if("function"==typeof r&&(e=r(a,e)),e)try{const t=await fetch(E,{keepalive:!0,method:"POST",body:JSON.stringify({type:a,payload:e}),headers:{"Content-Type":"application/json",...void 0!==q&&{"x-umami-cache":q}},credentials:"omit"}),r=await t.json();r&&(M=!!r.disabled,q=r.cache)}catch(t){}},I=()=>{H||(H=!0,J(),(()=>{const t=(t,e,a)=>{const r=t[e];return(...e)=>(a.apply(null,e),r.apply(t,e))};s.pushState=t(s,"pushState",W),s.replaceState=t(s,"replaceState",W)})(),(()=>{const t=async t=>{const e=t.getAttribute(U);if(e){const a={};return t.getAttributeNames().forEach(e=>{const r=e.match(O);r&&(a[r[1]]=t.getAttribute(e))}),J(e,a)}};c.addEventListener("click",async e=>{const a=e.target,r=a.closest("a,button");if(!r)return t(a);const{href:n,target:i}=r;if(r.getAttribute(U)){if("BUTTON"===r.tagName)return t(r);if("A"===r.tagName&&n){const a="_blank"===i||e.ctrlKey||e.shiftKey||e.metaKey||e.button&&1===e.button;return a||e.preventDefault(),t(r).then(()=>{a||(("_top"===i?u.location:o).href=n)})}}},!0)})())},J=(t,e)=>C("string"==typeof t?{...R(),name:t,data:e}:"object"==typeof t?{...t}:"function"==typeof t?t(R()):R()),P=(t,e)=>("string"==typeof t&&(z=t),q="",C({...R(),data:"object"==typeof t?t:e},"identify"));t.umami||(t.umami={track:J,identify:P});let q,z,F=D(m),G=D(f.startsWith(p)?"":f),H=!1,M=!1;T&&!B()&&("complete"===c.readyState?I():c.addEventListener("readystatechange",I,!0))})(window)}();