(()=>{function A(t){let e=document.querySelector(t);if(!e)throw`Pirsch script ${t} tag not found!`;return e}function a(t,e){let r="";return t.length>0&&(e{i=i.trim().replaceAll("-"," "),i&&(e[i]="1")});return e}function P(t){return localStorage.getItem("disable_pirsch")||j(t)||!q(t)||H(t)}function S(t){return t?t=location.href.replace(location.hostname,t):t=location.href,t}function y(t,e,r){t||(t=location.href),e||(e=""),r||(r="");let i=new URL(t);return i.pathname=e+i.pathname+r,i.toString()}function R(t,e){let r=document.title;return t||(t=""),e||(e=""),t+r+e}function v(t){let e=document.referrer;return t&&(e=e.replace(location.hostname,t)),e}function C(t){try{let e=new URL(t);return e.search="",e.toString()}catch{return t}}function L(t){try{let e=new URL(t);return e.hash="",e.toString()}catch{return t}}function j(t){return!t.hasAttribute("data-dev")&&(/^localhost(.*)$|^127(\.[0-9]{1,3}){3}$/is.test(location.hostname)||location.protocol==="file:")?(console.info("Pirsch is ignored on localhost. Add the data-dev attribute to enable it."),!0):!1}function q(t){try{let e=t.getAttribute("data-include"),r=e?e.split(","):[];if(r.length){let i=!1;for(let n=0;nx(t))}document.body?x(t):window.addEventListener("DOMContentLoaded",()=>x(t))}function x(t){let{script:e,domains:r,rewrite:i,pathPrefix:n,pathSuffix:c,titlePrefix:l,titleSuffix:u,identificationCode:p,endpoint:f,disableQueryParams:d,disableReferrer:s,disableResolution:h,stripAnchor:g}=t;T({script:e,hostname:i,pathPrefix:r.length?"":a(n,0),pathSuffix:r.length?"":a(c,0),titlePrefix:r.length?"":a(l,0),titleSuffix:r.length?"":a(u,0),identificationCode:p,endpoint:f,disableQueryParams:d,disableReferrer:s,disableResolution:h,stripAnchor:g});for(let o=0;o`tag_${E.replaceAll("-"," ")}=${U||1}`).join("&"):""),b=new XMLHttpRequest;b.open("GET",m),b.send()}(function(){"use strict";let t=A("#pirschjs");if(P(t)||document.querySelector("#pirschextendedjs"))return;let e=t.getAttribute("data-endpoint")||"https://api.pirsch.io/hit",r=t.getAttribute("data-code")||"not-set",i=t.getAttribute("data-domain")?t.getAttribute("data-domain").split(",")||[]:[],n=t.hasAttribute("data-disable-query"),c=t.hasAttribute("data-disable-referrer"),l=t.hasAttribute("data-disable-resolution"),u=t.hasAttribute("data-disable-history"),p=t.getAttribute("data-dev"),f=t.getAttribute("data-path-prefix")?t.getAttribute("data-path-prefix").split(",")||[]:[],d=t.getAttribute("data-path-suffix")?t.getAttribute("data-path-suffix").split(",")||[]:[],s=t.getAttribute("data-title-prefix")?t.getAttribute("data-title-prefix").split(",")||[]:[],h=t.getAttribute("data-title-suffix")?t.getAttribute("data-title-suffix").split(",")||[]:[];O({script:t,domains:i,rewrite:p,pathPrefix:f,pathSuffix:d,titlePrefix:s,titleSuffix:h,identificationCode:r,endpoint:e,disableQueryParams:n,disableReferrer:c,disableResolution:l,disableHistory:u})})();})();