PageSourceSearch

https://www2.chromatic.com/js/script.exclusions.hash.local.manual.pageview-props.tagged-events.js

js chromatic.com collected 2026-09-24 15:19:28 UTC 3,973 bytes, 1 lines download raw bytes

1!function(){var e,t,n,i,a=document.currentScript,r={};function o(e,t,n){window.fetch&&fetch(e,{method:"POST",headers:{"Content-Type":"text/plain"},keepalive:!0,body:JSON.stringify(t)}).then(function(e){n&&n.callback&&n.callback({status:e.status})}).catch(function(e){n&&n.callback&&n.callback({error:e})})}var c=!1,u={},l=-1,s=0,d=0;function p(){var a=m();if(!e&&(l<i||a>=3e3)){l=i;var c={n:"engagement",sd:Math.round(i/n*100),d:r.domain,u:t,p:u,e:a,v:36};s=0,d=0,c.h=1,o(r.endpoint,c)}}function f(){"visible"===document.visibilityState&&document.hasFocus()&&0===s?s=Date.now():"hidden"!==document.visibilityState&&document.hasFocus()||(d=m(),s=0,p())}function m(){return s?d+(Date.now()-s):d}function v(){var e=document.body||{},t=document.documentElement||{};return Math.max(e.scrollHeight||0,e.offsetHeight||0,e.clientHeight||0,t.scrollHeight||0,t.offsetHeight||0,t.clientHeight||0)}function g(){var e,t;return e=window.innerHeight,t=window.scrollY,n<=e?n:t+e}function h(m,h){var b,L="pageview"===m;L&&c&&(p(),n=v(),i=g());try{if("true"===window.localStorage.plausible_ignore)return w(m,h,"localStorage flag")}catch(e){}var E=a&&a.getAttribute("data-include"),k=a&&a.getAttribute("data-exclude");function y(e){var t=location.pathname;return(t+=location.hash).match(RegExp("^"+e.trim().replace(/\*\*/g,".*").replace(/([^\.])\*/g,"$1[^\\s/]*")+"/?$"))}if(L){var N=!E||E&&E.split(",").some(y),x=k&&k.split(",").some(y);if(!N||x)return w(m,h,"exclusion rule")}var S={};S.n=m,S.v=36,S.u=h&&(h.u||h.url)||location.href,S.d=r.domain,S.r=document.referrer||null,h&&h.meta&&(S.m=JSON.stringify(h.meta)),h&&h.props&&(S.p=h.props),h&&!1===h.interactive&&(S.i=!1);var H=a.getAttributeNames().filter(function(e){return"event-"===e.substring(0,6)}),b=S.p||{};H.forEach(function(e){var t=e.replace("event-",""),n=a.getAttribute(e);b[t]=b[t]||n}),S.p=b,S.h=1,L&&(e=!1,t=S.u,u=S.p,l=-1,d=0,s=Date.now(),c||(document.addEventListener("visibilitychange",f),window.addEventListener("blur",f),window.addEventListener("focus",f),c=!0)),o(r.endpoint,S,h)}function w(t,n,i){i&&r.logging&&console.warn("Ignoring Event: "+i),n&&n.callback&&n.callback(),"pageview"===t&&(e=!0)}function b(e){return e&&e.tagName&&"a"===e.tagName.toLowerCase()}function L(e){if("auxclick"!==e.type||1===e.button){var t=function(e){for(;e&&(void 0===e.tagName||!b(e)||!e.href);)e=e.parentNode;return e}(e.target);t&&"string"==typeof t.href&&t.href.split("?")[0],function e(t,n){return!!t&&!(n>3)&&(!!E(t)||e(t.parentNode,n+1))}(t,0)}}function E(e){var t=e&&e.classList;if(t){for(var n=0;n<t.length;n++)if(t.item(n).match(/plausible-event-name(=|--)(.+)/))return!0}return!1}function k(e){var t=E(e)?e:e&&e.parentNode,n={name:null,props:{}},i=t&&t.classList;if(!i)return n;for(var a=0;a<i.length;a++){var r,o,c=i.item(a).match(/plausible-event-(.+)(=|--)(.+)/);c&&(r=c[1],o=c[3].replace(/\+/g," "),"name"==r.toLowerCase()?n.name=o:n.props[r]=o)}return n}!function e(t){r.endpoint=a.getAttribute("data-api")||new URL(a.src).origin+"/api/event",r.domain=a.getAttribute("data-domain"),r.logging=!0,n=v(),i=g(),new ResizeObserver(function(){n=v()}).observe(document.documentElement),document.addEventListener("scroll",function(){var e=g();e>i&&(i=e)}),function(){function e(e){if("auxclick"!==e.type||1===e.button){for(var t,n,i=e.target,a=0;a<=3&&i;a++){if((r=i)&&r.tagName&&"form"===r.tagName.toLowerCase())return;b(i)&&(t=i),E(i)&&(n=i),i=i.parentNode}if(n){var r,o,c=k(n);if(t)c.props.url=t.href,o={props:c.props},h(c.name,o);else{var u={};u.props=c.props,h(c.name,u)}}}}document.addEventListener("click",L),document.addEventListener("auxclick",L),document.addEventListener("submit",function(e){var t,n=k(e.target);n.name&&(t={props:n.props},h(n.name,t))}),document.addEventListener("click",e),document.addEventListener("auxclick",e)}();for(var o=window.plausible&&window.plausible.q||[],c=0;c<o.length;c++)h.apply(this,o[c]);window.plausible=h,window.plausible.init=e,window.plausible.v=36,window.plausible.l=!0}()}();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.