/** * Minified by jsDelivr using Terser v5.39.0. * Original file: /npm/eleventy-plugin-plausible@2.0.0-beta.1/.eleventy.js * * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files */ const defaults={domain:"",async:!1,transform:!1,exclude:[],include:[],scriptExtensions:[],proxyPath:!1};module.exports=(t,e)=>{const s={...defaults,...e};let{domain:n,async:i,exclude:o,include:a,scriptExtensions:r,proxyPath:l}=s;if(!n)throw new Error("Must include domain option.");n.startsWith("https://")&&(n=n.slice(8)),n.startsWith("http://")&&(n=n.slice(7));const p=i?" async defer ":" defer ";let c="";o.length&&(r.push("exclusions"),c=' data-exclude="'+o.join(", ")+'" ',c+=a.length?' data-include"'+a.join(", ")+'" ':"");const d=t=>{let e=l||"https://plausible.io/js/script",s="";if(t.length){r.push("pageview-props"),t=t.trim();try{const e=JSON.parse(t);s=Object.entries(e).map((([t,e])=>` event-${t}="${e}" `)).join(" ")}catch(t){console.log("Error: ",t.message)}}return r.length?e=`${e}.${Array.from(new Set(r)).join(".")}.js`:e+=".js",`