quiz_model_trainer / app_files /script.pageview-props.js.download
Percy3822
Fix training and add live logs
3f48220
!function(){var t,n,e,i,o=window.location,a=window.document,t=a.currentScript,r={};function l(t,n,e){window.fetch&&fetch(t,{method:"POST",headers:{"Content-Type":"text/plain"},keepalive:!0,body:JSON.stringify(n)}).then(function(t){e&&e.callback&&e.callback({status:t.status})}).catch(function(t){e&&e.callback&&e.callback({error:t})})}var c=!1,d=location.href,u={},s=-1,w=0,p=0;function v(){var t=h();if(!n&&(s<i||t>=3e3)){s=i;var o={n:"engagement",sd:Math.round(i/e*100),d:r.domain,u:d,p:u,e:t,v:25};w=0,p=0,l(r.endpoint,o)}}function f(){"visible"===document.visibilityState&&document.hasFocus()&&0===w?w=Date.now():"hidden"!==document.visibilityState&&document.hasFocus()||(p=h(),w=0,v())}function h(){return w?p+(Date.now()-w):p}function g(){var t=document.body||{},n=document.documentElement||{};return Math.max(t.scrollHeight||0,t.offsetHeight||0,t.clientHeight||0,n.scrollHeight||0,n.offsetHeight||0,n.clientHeight||0)}function b(){var t=document.body||{},n=document.documentElement||{},i=window.innerHeight||n.clientHeight||0,o=window.scrollY||n.scrollTop||t.scrollTop||0;return e<=i?e:o+i}function m(h,m){var S,E="pageview"===h;if(E&&c&&(v(),e=g(),i=b()),/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(o.hostname)||"file:"===o.protocol)return y(h,m,"localhost");if((window._phantom||window.__nightmare||window.navigator.webdriver||window.Cypress)&&!window.__plausible)return y(h,m);try{if("true"===window.localStorage.plausible_ignore)return y(h,m,"localStorage flag")}catch(t){}var L={};L.n=h,L.v=25,L.u=o.href,L.d=r.domain,L.r=a.referrer||null,m&&m.meta&&(L.m=JSON.stringify(m.meta)),m&&m.props&&(L.p=m.props),m&&!1===m.interactive&&(L.i=!1);var H=t.getAttributeNames().filter(function(t){return"event-"===t.substring(0,6)}),S=L.p||{};H.forEach(function(n){var e=n.replace("event-",""),i=t.getAttribute(n);S[e]=S[e]||i}),L.p=S,E&&(n=!1,d=L.u,u=L.p,s=-1,p=0,w=Date.now(),c||(document.addEventListener("visibilitychange",f),window.addEventListener("blur",f),window.addEventListener("focus",f),c=!0)),l(r.endpoint,L,m)}function y(t,e,i){i&&r.logging&&console.warn("Ignoring Event: "+i),e&&e.callback&&e.callback(),"pageview"===t&&(n=!0)}!function n(l){r.endpoint=t.getAttribute("data-api")||new URL(t.src).origin+"/api/event",r.domain=t.getAttribute("data-domain"),r.logging=!0,e=g(),i=b(),window.addEventListener("load",function(){e=g();var t=0,n=setInterval(function(){e=g(),15==++t&&clearInterval(n)},200)}),document.addEventListener("scroll",function(){e=g();var t=b();t>i&&(i=t)}),function(t){function n(n){n&&e===o.pathname||(e=o.pathname,t("pageview"))}var e,i=function(){n(!0)},r=window.history;if(r.pushState){var l=r.pushState;r.pushState=function(){l.apply(this,arguments),i()},window.addEventListener("popstate",i)}"hidden"===a.visibilityState||"prerender"===a.visibilityState?a.addEventListener("visibilitychange",function(){e||"visible"!==a.visibilityState||n()}):n(),window.addEventListener("pageshow",function(t){t.persisted&&n()})}(m);for(var c=window.plausible&&window.plausible.q||[],d=0;d<c.length;d++)m.apply(this,c[d]);window.plausible=m,window.plausible.init=n,window.plausible.v=25,window.plausible.l=!0}()}();