@finsweet/consentpro-scan 1.0.25 → 1.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/results.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";(()=>{var Ze=Object.defineProperty;var Xe=(t,e,n)=>e in t?Ze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ce=(t,e,n)=>Xe(t,typeof e!="symbol"?e+"":e,n);var le=(t=document)=>t.documentElement.getAttribute("data-wf-site");var me=async t=>{let{Webflow:e}=window;if(!(!e||!("destroy"in e)||!("ready"in e)||!("require"in e))&&!(t&&!t.length)){if(t||(e.destroy(),e.ready()),!t||t.includes("ix2")){let n=e.require("ix2");if(n){let{store:o,actions:r}=n,{eventState:i}=o.getState().ixSession,s=Object.entries(i);t||n.destroy(),n.init(),await Promise.all(s.map(l=>o.dispatch(r.eventStateChanged(...l))))}}if(!t||t.includes("commerce")){let n=e.require("commerce"),o=le();n&&o&&(n.destroy(),n.init({siteId:o,apiUrl:"https://render.webflow.com"}))}if(t?.includes("lightbox")&&e.require("lightbox")?.ready(),t?.includes("slider")){let n=e.require("slider");n&&(n.redraw(),n.ready())}return t?.includes("tabs")&&e.require("tabs")?.redraw(),new Promise(n=>e.push(()=>n(void 0)))}};var C=t=>t.type==="script"||t.type==="iframe"||t.type==="link"||t.type==="noscript",I=t=>t.type==="cookie"||t.type==="local-storage"||t.type==="session-storage",G=t=>t.type==="banner",Ke=["essential","necessary"],L=t=>!!t&&Ke.includes(t),K=/googletagmanager\.com\/gtm\.js\?(?:[^"'#\s]*&)?id=(GTM-[A-Z0-9]+)/gi,de=t=>t.type!=="script"?!1:(K.lastIndex=0,K.test(t.source)),ue=t=>t.type!=="script"?!1:(K.lastIndex=0,K.test(t.url)),pe=t=>t.filter(C),Qe=t=>t.filter(G),Je=t=>t.filter(e=>C(e)||G(e)),fe=t=>t.filter(e=>e.type==="script"),et=t=>t.filter(e=>e.type==="iframe"),tt=t=>t.filter(e=>e.type==="link"),nt=t=>t.filter(e=>e.type==="noscript"),ot=t=>t.filter(e=>C(e)&&e.isThirdParty&&!L(e.category)&&!de(e)),rt=t=>t.filter(e=>e.type==="script"&&e.isThirdParty&&!L(e.category)&&!de(e)),F=t=>t.filter(I),ge=t=>t.filter(e=>e.type==="cookie"),st=t=>t.filter(e=>e.type==="local-storage"),it=t=>t.filter(e=>e.type==="session-storage"),at=t=>t.filter(e=>I(e)&&!L(e.category)),ye=t=>t.filter(e=>e.type==="cookie"&&!L(e.category)),he=t=>t.filter(e=>e.type==="local-storage"&&!L(e.category)),ke=t=>t.filter(e=>e.type==="session-storage"&&!L(e.category)),ve=t=>t.filter(e=>e.type==="cookie"&&(!e.category||e.category==="uncategorized")),be=t=>t.filter(e=>I(e)&&(!e.category||e.category==="uncategorized")),ct=/google\s*tag\s*manager|^gtm$/i,Ee=t=>ct.test(t.label),M=t=>t.filter(e=>!L(e.category)&&!Ee(e)),lt=(t,e)=>t.filter(n=>n.category===e),Q=t=>t.filter(e=>e.category==="analytics"&&!Ee(e)),J=t=>t.filter(e=>e.category==="marketing"),mt=t=>t.filter(e=>!e.category||e.category==="uncategorized"),ee=t=>M(t).flatMap(n=>n.resources||[]),dt=t=>{let e=ee(t);return new Set(e.map(n=>n.id))},we=t=>{let e=ee(t),n=["script","link","iframe","noscript"];return new Set(e.filter(o=>n.includes(o.type)).map(o=>o.id))},Re=t=>{let e=ee(t),n=["cookie","local-storage","session-storage"];return new Set(e.filter(o=>n.includes(o.type)).map(o=>o.id))},ut=(t,e)=>{let n=we(e);return t.filter(o=>C(o)&&n.has(o.id))},pt=(t,e)=>{let n=Re(e);return t.filter(o=>I(o)&&n.has(o.id))},x={isEssentialCategory:L,isResourceItem:C,isStorageItem:I,isBannerItem:G,isGTMContainerScript:de,isGTMContainerTracker:Ee,isGTMContainerTrackerResource:ue,domResources:pe,banners:Qe,allDOMElements:Je,scripts:fe,iframes:et,links:tt,noscripts:nt,loadedDOMResources:ot,loadedScripts:rt,storageResources:F,cookies:ge,localStorage:st,sessionStorage:it,loadedStorageResources:at,loadedCookies:ye,loadedLocalStorage:he,loadedSessionStorage:ke,uncategorizedCookies:ve,uncategorizedStorageItems:be,violatingTrackers:M,trackersByCategory:lt,analyticsTrackers:Q,marketingTrackers:J,uncategorizedTrackers:mt,getViolatingTrackerResources:ee,getViolatingResourceIds:dt,getViolatingDOMResourceIds:we,getViolatingStorageResourceIds:Re,affiliatedDOMResources:ut,affiliatedStorageResources:pt};var ft=[{id:"cookieyes",name:"CookieYes",patterns:{scripts:[/cookieyes\.com/i,/cookie-law-info/i],cookies:[/cookieyes-consent/i,/cky-consent/i,/cookielawinfo/i],dom:[/cky-consent/i,/cookie-law-info/i]}},{id:"termly",name:"Termly",patterns:{scripts:[/termly\.io/i,/termly-embed/i],cookies:[/termly/i],dom:[/termly/i]}},{id:"consentmanager",name:"Consentmanager.net",patterns:{scripts:[/consentmanager\.net/i,/consent-manager/i],cookies:[/consentmanager/i,/cmapi/i],dom:[/consent-manager/i]}},{id:"enzuzo",name:"Enzuzo",patterns:{scripts:[/enzuzo\.com/i],cookies:[/enzuzo/i],dom:[/enzuzo/i]}},{id:"cookiebot",name:"Cookiebot (by Usercentrics)",patterns:{scripts:[/cookiebot\.com/i,/consent\.cookiebot/i],cookies:[/CookieConsent/i,/cookiebot/i],dom:[/CookieConsent/i,/cookiebot/i]}},{id:"iubenda",name:"Iubenda",patterns:{scripts:[/iubenda\.com/i,/iubenda_cs/i],cookies:[/_iub_cs/i,/iubenda/i],dom:[/iubenda/i,/_iub_cs/i]}},{id:"osano",name:"Osano",patterns:{scripts:[/osano\.com/i],cookies:[/osano/i],dom:[/osano/i]}},{id:"usercentrics",name:"Usercentrics",patterns:{scripts:[/usercentrics\.eu/i,/usercentrics\.com/i],cookies:[/usercentrics/i,/uc_user_interaction/i],dom:[/usercentrics/i]}},{id:"cookiescript",name:"CookieScript",patterns:{scripts:[/cookiescript\.com/i,/cookie-script/i],cookies:[/CookieScriptConsent/i],dom:[/cookie-script/i]}},{id:"secureprivacy",name:"Secure Privacy",patterns:{scripts:[/secureprivacy\.ai/i],cookies:[/secureprivacy/i],dom:[/secureprivacy/i]}},{id:"onetrust",name:"OneTrust",patterns:{scripts:[/onetrust\.com/i,/optanon/i],cookies:[/OptanonConsent/i,/OptanonAlertBoxClosed/i],dom:[/onetrust/i,/optanon/i]}},{id:"trustarc",name:"TrustArc",patterns:{scripts:[/trustarc\.com/i,/truste\.com/i],cookies:[/truste/i,/notice_behavior/i],dom:[/truste/i]}},{id:"axeptio",name:"Axeptio",patterns:{scripts:[/axept\.io/i,/static\.axept\.io/i],cookies:[/axeptio_/i,/axeptio/i],dom:[/axeptio/i]}},{id:"complianz",name:"Complianz",patterns:{scripts:[/complianz/i],cookies:[/complianz/i,/cmplz/i],dom:[/complianz/i,/cmplz/i]}},{id:"quantcast",name:"Quantcast",patterns:{scripts:[/quantcast/i,/quantserve/i],cookies:[/quantcast/i,/__qca/i],dom:[/quantcast/i]}},{id:"cookieconsent-termsfeed",name:"Cookie Consent by TermsFeed",patterns:{scripts:[/cookieconsent\.com/i,/termsfeed\.com/i],cookies:[/cc_cookie/i],dom:[/cookieconsent/i]}},{id:"finsweet-fs-cc",name:"Finsweet [fs-cc] Consent",patterns:{scripts:[/@finsweet\/cookie-consent/i,/fs-cc\.js/i],cookies:[/fs-cc/i,/finsweet.*cookie/i],dom:[/fs-cc-(mode|src|category|placeholder)\s*=/i,/(?:^|[^-])fs-cc(?:[^-]|$)/i,/fs-consent-element/i,/fs-consent_banner/i],banners:[/fs-cc/i,/fs-consent/i,/cookie-consent/i]}},{id:"finsweet-cookie-consent",name:"Finsweet Cookie Consent | Finsweet Consent Pro",patterns:{scripts:[/@finsweet\/fs-components/i,/finsweet.*cookie-consent/i,/fs-cc\.js/i],cookies:[/fs-consent/i,/(?:^|[^-])fs-cc(?:[^-]|$)/i,/(?:^|[^-])fs-consent(?:[^-]|$)/i,/finsweet.*cookie/i],dom:[/fs-components-installed\s*=\s*["']consent["']/i,/(?:^|[^-])fs-cc(?:[^-]|$)/i,/(?:^|[^-])fs-consent(?:[^-]|$)/i,/fs-consent-element/i,/fs-consent_banner/i],banners:[/fs-consent/i,/fs-cc/i,/consentpro/i,/cookie-consent/i,/fs-components.*consent/i]}}],Le=/youtube\.com|youtu\.be|vimeo\.com|player\.vimeo/i,Me=/maps\.google|maps\.googleapis|google\.com\/maps/i,q=/fonts\.googleapis\.com|fonts\.gstatic\.com|use\.typekit\.net|use\.typekit\.com|p\.typekit\.net|fast\.fonts\.net|hello\.myfonts\.net|cloud\.typography\.com|api\.fontshare\.com|cdn\.fontshare\.com|fonts\.cdnfonts\.com/i,Ae=/googletagmanager\.com|gtm\.js/i,te=/cdn\.intellimize\.co\/snippet\/\d+\.js/i,j=/intellimize/i;function De(t){let e=[];e.push(gt(t)),e.push(yt(t)),e.push(ht(t)),e.push(kt(t)),e.push(xe(t)),e.push(vt(t)),e.push({id:"script-head-placement",name:"Script Head Placement",description:"Verify consent script is placed at the top of <head> section",status:"not-verifiable",details:"Cannot be verified from scan results. Manual review required."}),e.push(bt(t)),e.push({id:"auto-placeholder",name:"Auto-placeholder Support",description:"Check if blocked videos have placeholder elements",status:"not-verifiable",details:"Cannot be verified from scan results. Manual review required."});let n={passed:e.filter(c=>c.status==="pass").length,failed:e.filter(c=>c.status==="fail").length,notVerifiable:e.filter(c=>c.status==="not-verifiable").length},o=e.filter(c=>c.status!=="not-verifiable");if(o.length===0)return{overallScore:0,hasViolations:n.failed>0,criteria:e,summary:n};let r={"pre-consent-trackers":2.5,"consent-tool":2,"video-embeds":1,"google-maps":1,"external-fonts":1,"uncategorized-trackers":1,"webflow-optimize":1},i=0,s=0;for(let c of o){let m=r[c.id]??1,h=(c.status==="pass"?1:0)*m;i+=h,s+=m}return{overallScore:Math.round(i/s*100),hasViolations:n.failed>0,criteria:e,summary:n}}function ne(t){if(!t.results)throw new Error("No results found in response for compliance evaluation");return De(t.results)}function gt(t){let e=t.trackersInfo?.trackers??[],n=t.trackersInfo?.providers??[],o=new Map;n.forEach(d=>o.set(d.id,d.name));let r=M(e),i=Q(e).length,s=J(e).length,l=[...new Set(r.map(d=>o.get(d.providerId)||d.name||d.domain||d.providerId))];if(r.length===0)return{id:"pre-consent-trackers",name:"Pre-Consent Trackers",description:"Check for tracking scripts running before user consent",status:"pass",details:"No tracking scripts detected running before consent."};let c=[];i>0&&c.push(`${i} analytics`),s>0&&c.push(`${s} marketing`);let m=r.length-i-s;return m>0&&c.push(`${m} other`),{id:"pre-consent-trackers",name:"Pre-Consent Trackers",description:"Check for tracking scripts running before user consent",status:"fail",details:`Found ${r.length} tracker(s) running before consent (${c.join(", ")}). These should be blocked until user provides consent.`,affectedItems:l}}function yt(t){let e=t.trackersInfo?.trackers??[],n=M(e),o=new Set;n.forEach(l=>{l.resources?.forEach(c=>o.add(c.id))});let r=t.detectedItems.filter(C).filter(l=>Le.test(l.domain)||Le.test(l.source)).filter(l=>o.has(l.id)),i=r.map(l=>l.id);if(r.length===0)return{id:"video-embeds",name:"YouTube/Vimeo Detection",description:"Detect YouTube or Vimeo video embeds that may store cookies",status:"pass",details:"No violating YouTube or Vimeo embeds detected."};let s=r.filter(l=>l.isThirdParty);return{id:"video-embeds",name:"YouTube/Vimeo Detection",description:"Detect YouTube or Vimeo video embeds that may store cookies",status:"fail",details:`Found ${r.length} video embed(s) from YouTube/Vimeo. ${s.length} are third-party resources that may store cookies before consent.`,affectedItems:i}}function ht(t){let e=t.trackersInfo?.trackers??[],n=M(e),o=new Set;n.forEach(s=>{s.resources?.forEach(l=>o.add(l.id))});let r=t.detectedItems.filter(C).filter(s=>Me.test(s.domain)||Me.test(s.source)).filter(s=>o.has(s.id)),i=r.map(s=>s.id);return r.length===0?{id:"google-maps",name:"Google Maps Detection",description:"Detect Google Maps embeds that may store cookies",status:"pass",details:"No violating Google Maps embeds detected."}:{id:"google-maps",name:"Google Maps Detection",description:"Detect Google Maps embeds that may store cookies",status:"fail",details:`Found ${r.length} Google Maps embed(s) that may store cookies before consent.`,affectedItems:i}}function kt(t){let e=t.trackersInfo?.trackers??[],n=M(e),o=new Set;n.forEach(s=>{s.resources?.forEach(l=>o.add(l.id))});let r=t.detectedItems.filter(C).filter(s=>q.test(s.domain)||q.test(s.source)).filter(s=>o.has(s.id)),i=r.map(s=>s.id);return r.length===0?{id:"external-fonts",name:"External Fonts Detection",description:"Detect external fonts (Google Fonts, Typekit, etc.) which transfer IP addresses without consent",status:"pass",details:"No violating external fonts detected."}:{id:"external-fonts",name:"External Fonts Detection",description:"Detect external fonts (Google Fonts, Typekit, etc.) which transfer IP addresses without consent",status:"fail",details:`Found ${r.length} external font resource(s). This transfers visitor IP addresses to third-party servers without consent, which may violate data privacy regulations (GDPR, CCPA, HIPAA, etc.). Fonts should be self-hosted or loaded only after consent.`,affectedItems:i}}function xe(t){if(t.detectedCmps&&t.detectedCmps.length>0)return{id:"consent-tool",name:"Consent Tool Detection",description:"Check if a cookie consent management tool is installed",status:"pass",details:`Detected consent tool(s): ${t.detectedCmps.map(i=>i.version?`${i.name} (v${i.version})`:i.name).join(", ")}`};let e=[],n=new Map;for(let r of ft){let i=0;if(t.detectedItems&&Array.isArray(t.detectedItems)){for(let s of t.detectedItems)if(C(s)&&s.type==="script"){let{source:l}=s,c=s.element?.outerHTML||"";for(let m of r.patterns.scripts)if(m.test(l)||m.test(c)){i+=1,e.includes(s.id)||e.push(s.id);break}}}if(t.trackersInfo?.providers&&Array.isArray(t.trackersInfo.providers))for(let s of t.trackersInfo.providers){let l=s.name||"";for(let c of r.patterns.scripts)if(c.test(l)){i+=1,e.includes(s.id)||e.push(s.id);break}}if(t.detectedItems&&Array.isArray(t.detectedItems)){for(let s of t.detectedItems)if(I(s)&&s.type==="cookie"){let{name:l}=s;for(let c of r.patterns.cookies)if(c.test(l)){i+=1,e.includes(s.id)||e.push(s.id);break}}}if(t.detectedItems&&Array.isArray(t.detectedItems))for(let s of t.detectedItems){let c=C(s)&&s.element?.outerHTML||"";for(let m of r.patterns.dom)if(m.test(c)){i+=1,e.includes(s.id)||e.push(s.id);break}}if(t.detectedItems&&Array.isArray(t.detectedItems)){for(let s of t.detectedItems)if(G(s)){let l=s.element||"",c=r.patterns.banners||r.patterns.dom;for(let m of c)if(m.test(l)){i+=3,e.includes(s.id)||e.push(s.id);break}}}i>0&&n.set(r.name,i)}let o=Array.from(n.entries()).sort((r,i)=>i[1]-r[1]).map(([r])=>r);return o.length===0?{id:"consent-tool",name:"No cookie consent tool detected",description:"Check if a cookie consent management tool is installed",status:"fail",details:"No cookie consent tool detected. A consent banner is required for compliance with data privacy regulations (GDPR, CCPA, etc.). Note: Not all CMP tools can be automatically detected. If you have a CMP installed that is not recognized, please verify manually."}:{id:"consent-tool",name:"Consent Tool Detection",description:"Check if a cookie consent management tool is installed",status:"pass",details:`Detected consent tool(s): ${o.join(", ")}. Note: Detection is based on known patterns and may not identify all CMP configurations.`,affectedItems:e}}function vt(t){let e=t.trackersInfo?.trackers??[],n=t.detectedItems??[],o=new Set;e.forEach(m=>{m.resources?.forEach(d=>{ue(d)||o.add(d.id)})});let r=e.filter(m=>Ae.test(m.label)||Ae.test(m.domain??"")?!1:!m.category||m.category==="uncategorized"),i=be(n).filter(m=>o.has(m.id)?!0:m.attributedTo&&m.attributedTo.length>0?m.attributedTo.some(d=>o.has(d)):!1),s=[...r.map(m=>m.id),...i.map(m=>m.id)];if(r.length+i.length===0)return{id:"uncategorized-trackers",name:"Uncategorized Trackers",description:"Check for trackers without proper categorization",status:"pass",details:"All trackers are properly categorized."};let c=[];return r.length>0&&c.push(`${r.length} tracker(s)`),i.length>0&&c.push(`${i.length} storage item(s)`),{id:"uncategorized-trackers",name:"Uncategorized Trackers",description:"Check for trackers without proper categorization",status:"fail",details:`Found ${c.join(" and ")} without categorization. These should be categorized for proper consent management.`,affectedItems:s}}function bt(t){let e=t.detectedItems??[],{webflowAnalytics:n}=t;if(!n)return{id:"webflow-optimize",name:"Webflow Optimize Detection",description:"Detect Webflow Optimize and Analyze configurations",status:"fail",details:"Webflow Analytics configuration data not available."};if(!n.analytics||n.analytics==="never")return{id:"webflow-optimize",name:"Webflow Optimize Detection",description:"Detect Webflow Optimize and Analyze configurations",status:"pass",details:"Webflow Analytics is disabled."};if(!(n.analytics==="always"||n.analytics==="optOut"))return{id:"webflow-optimize",name:"Webflow Optimize Detection",description:"Detect Webflow Optimize and Analyze configurations",status:"pass",details:"Webflow Analytics not configured for tracking or opt-out mode."};if(!e.some(d=>C(d)&&d.type==="script"&&te.test(d.source)))return{id:"webflow-optimize",name:"Webflow Optimize Detection",description:"Detect Webflow Optimize and Analyze configurations",status:"pass",details:"Webflow Optimize/Analyze (Intellimize) not detected."};if(xe(t).status!=="pass")return{id:"webflow-optimize",name:"Webflow Optimize Detection",description:"Detect Webflow Optimize and Analyze configurations",status:"pass",details:"Webflow Optimize detected; no CMP\u2014consent-gating not applicable."};let s=e.filter(d=>I(d)&&d.type==="cookie"&&j.test(d.name)),l=e.filter(d=>I(d)&&d.type==="session-storage"&&j.test(d.name)),c=e.filter(d=>I(d)&&d.type==="local-storage"&&j.test(d.name)),m=[];if(s.length>0&&m.push(`${s.length} cookie(s)`),l.length>0&&m.push(`${l.length} session-storage key(s)`),c.length>0&&m.push(`${c.length} local-storage key(s)`),m.length>0){let d=[...s.map(h=>h.id),...l.map(h=>h.id),...c.map(h=>h.id)];return{id:"webflow-optimize",name:"Webflow Optimize Detection",description:"Detect Webflow Optimize and Analyze configurations",status:"fail",details:`Intellimize cookies/storage present despite CMP: ${m.join(", ")}.`,affectedItems:d}}return{id:"webflow-optimize",name:"Webflow Optimize Detection",description:"Detect Webflow Optimize and Analyze configurations",status:"pass",details:"Webflow Optimize detected; CMP present and no Intellimize cookies or storage detected."}}function Te(t){if(t.detectedCmps&&t.detectedCmps.length>0)return t.detectedCmps.map(o=>o.name).join(", ");let e=xe(t);return e.status!=="pass"||!e.details?null:e.details.match(/Detected consent tool\(s\): (.+)/)?.[1]?.trim()??null}function ze(t){return De(t).criteria.filter(n=>n.status==="fail").map(n=>`${n.name}: ${n.details}`)}function He(t){let e=[],n=t.trackersInfo?.trackers??[],o=t.trackersInfo?.providers??[],r=t.detectedItems??[],i=F(r),s=new Map;o.forEach(E=>s.set(E.id,E.name));let l=M(n),c=Q(n),m=J(n);if(c.length>0){let E=Ce(c,3,s);e.push(`${c.length} analytics tracker(s) running before consent: ${E}`)}if(m.length>0){let E=Ce(m,3,s);e.push(`${m.length} marketing tracker(s) firing before consent: ${E}`)}let d=l.filter(E=>E.category!=="analytics"&&E.category!=="marketing");if(d.length>0){let E=Ce(d,3,s);e.push(`${d.length} other tracker(s) need consent: ${E}`)}let h=ye(i);h.length>0&&e.push(`${h.length} non-essential cookies set before consent`);let f=ve(i);f.length>0&&e.push(`${f.length} uncategorized cookies detected - review and categorize`);let p=he(i),b=ke(i),S=p.length+b.length;return S>0&&e.push(`${S} localStorage/sessionStorage items set pre-consent`),Te(t)||e.push("No consent management platform detected"),e}function Ce(t,e,n){let o=[...new Set(t.map(r=>n.get(r.providerId)||r.name||r.domain||"Unknown"))];return o.length<=e?o.join(", "):`${o.slice(0,e).join(", ")} +${o.length-e} more`}var Et=localStorage.getItem("cs-dev")==="true",Y=Et?"https://fs-consentpro-api-dev.finsweet.workers.dev":"https://api.consentpro.com",wn=1440*60*1e3;var g={success:"#07601d",warning:"#bb5902",error:"#8F0C3D",info:"#598FFF",neutral:"#363636",white:"#ffffff","neutral-foreground":"#6f6f6f","success-foreground":"#25fc54","warning-foreground":"#FFAA00","error-foreground":"#FF265A","info-foreground":"#d5e8ff"};function Pe(t){if(!t.results)throw new Error("No results found in response for scan summary extraction");let{results:e}=t;return{scanId:e.trackingId,scanDuration:e.scanDuration,pagesScanned:e.pagesScanned.length,totalPages:e.totalPagesFound,detectedItemsCount:e.detectedItems.length,scannedAt:e.scannedAt}}function Ne(t){let e=ne(t);return{compliant:!e.hasViolations,score:e.overallScore,violations:e.summary.failed}}function $e(t){if(!t.results)throw new Error("No results found in response for actionable items extraction");let{results:e}=t,n=fe(e.detectedItems).length,o=ge(e.detectedItems).length,r=Te(e);return{scripts:n,cookies:o,cmpInstalled:r??void 0}}function Oe(t){if(!t.results)throw new Error("No results found in response for violations extraction");return ze(t.results)}function _e(t){if(!t.results)throw new Error("No results found in response for detected items extraction");let{results:e}=t,n=pe(e.detectedItems),o=F(e.detectedItems);return{dom:n,storage:o}}function Ue(t){let e=ne(t);return{pass:e.summary.passed,fail:e.summary.failed,unverified:e.summary.notVerifiable}}function Fe(t){if(!t.results)throw new Error("No results found in response for attention items extraction");return He(t.results)}function je(t){if(!t.results)throw new Error("No results found in response for statistics extraction");let{results:e}=t;return{scanDuration:Tt(e.scanDuration),resourcesCount:e.detectedItems.length,storageCount:F(e.detectedItems).length,firstParty:e.statistics?.firstPartyResources??0,thirdParty:e.statistics?.thirdPartyResources??0,categories:Object.keys(e.statistics?.categoryCounts||{}).length}}function Ct(t){return ne(t)}function xt(t){return{scanSummary:Pe(t),compliance:Ne(t),actionableItems:$e(t),violations:Oe(t),detectedItems:_e(t),complianceSummary:Ue(t),attentionItems:Fe(t),statistics:je(t)}}function Tt(t){let e=Math.floor(t/1e3);if(e<60)return`${e}s`;let n=Math.floor(e/60),o=e%60;return`${n}m ${o}s`}var w={extractScanSummary:Pe,extractCompliance:Ne,extractActionableItems:$e,extractViolations:Oe,extractDetectedItems:_e,extractComplianceSummary:Ue,extractAttentionItems:Fe,extractStatistics:je,extractFullCompliance:Ct,extractAll:xt};var Ve="data-fs-cs";var a=(t,e=document)=>e.querySelector(`[${Ve}="${t}"]`),V=(t,e=document)=>e.querySelectorAll(`[${Ve}="${t}"]`);var We={"X-Finsweet-ConsentPro-Version":"v2"},Be={"X-Finsweet-ConsentPro-Version":"v2","Content-Type":"application/json"},A=class extends Error{constructor(n,o,r){super(n);ce(this,"status");ce(this,"response");this.name="ScannerApiError",this.status=o,this.response=r}};async function oe(t){if(!t.ok){let e=t.statusText,n;try{let o=await t.json();n=o,o&&typeof o.error=="string"&&(e=o.error)}catch{n=await t.text().catch(()=>"Unknown error")}throw new A(`Report request failed: ${e}`,t.status,n)}return t.json()}var re={async startScan(t){let e=await fetch(`${Y}/v2/scanner/public/scan`,{method:"POST",headers:Be,body:JSON.stringify({url:t,acceptAll:!1})});if(e.status===409){let o=await e.json().catch(()=>({}));throw new A("A scan is already in progress for this website. Please wait for it to complete.",409,o)}if(e.status!==201){let o=await e.text().catch(()=>"Unknown error");throw new A(`Expected 201 Created but got ${e.status}`,e.status,o)}return await oe(e)},async getStatus(t){let e=await fetch(`${Y}/v2/scanner/public/status/${t}`,{headers:We});return await oe(e)},async getResults(t){let e=await fetch(`${Y}/v2/scanner/public/results/${t}`,{headers:We});return await oe(e)},async cancelScan(t){let e=await fetch(`${Y}/v2/scanner/public/scan/${t}`,{method:"DELETE",headers:Be});return await oe(e)}};var St='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/><path d="M12 9v4"/><path d="M12 17h.01"/></svg>',wt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/></svg>',Rt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22" fill="currentColor"><path d="M11 0C17.0751 0 22 4.92487 22 11C22 17.0751 17.0751 22 11 22C4.92487 22 0 17.0751 0 11C0 4.92487 4.92487 0 11 0ZM11 2C6.02944 2 2 6.02944 2 11C2 15.9706 6.02944 20 11 20C15.9706 20 20 15.9706 20 11C20 6.02944 15.9706 2 11 2ZM13.293 7.29297C13.6835 6.90244 14.3165 6.90244 14.707 7.29297C15.0975 7.6835 15.0975 8.31653 14.707 8.70703L12.4141 11L14.707 13.293C15.0975 13.6835 15.0975 14.3165 14.707 14.707C14.3165 15.0975 13.6835 15.0975 13.293 14.707L11 12.4141L8.70703 14.707C8.31653 15.0975 7.6835 15.0975 7.29297 14.707C6.90244 14.3165 6.90244 13.6835 7.29297 13.293L9.58594 11L7.29297 8.70703C6.90244 8.31651 6.90244 7.68349 7.29297 7.29297C7.68349 6.90244 8.31651 6.90244 8.70703 7.29297L11 9.58594L13.293 7.29297Z"/></svg>',Lt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m2 2 20 20"/><path d="M8.35 2.69A10 10 0 0 1 21.3 15.65"/><path d="M19.08 19.08A10 10 0 1 1 4.92 4.92"/></svg>',Mt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 16h.01M12 8v4M7.86 2h8.28L22 7.86v8.28L16.14 22H7.86L2 16.14V7.86z"/></svg>',At='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m9 18 6-6-6-6"/></svg>',Dt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" x2="12" y1="8" y2="12"/><line x1="12" x2="12.01" y1="16" y2="16"/></svg>',zt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>',Ht='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><path d="M12 17h.01"/></svg>',Pt={"warning-triangle":St,"check-circle":wt,"close-circle":Rt,"circle-off":Lt,"alert-octagon":Mt,"chevron-right":At,"alert-circle":Dt,clock:zt,"help-circle":Ht},Nt=(t,e)=>{let n=Pt[t];return e?.color&&(n=n.replace(/currentColor/g,e.color)),e?.size&&(n=n.replace("<svg",`<svg width="${e.size}" height="${e.size}"`)),n},W=(t,e,n)=>{let o=Nt(e,n),r=document.createElement("template");r.innerHTML=o.trim();let i=r.content.firstElementChild;if(!i)return null;if(i.setAttribute("data-fs-icon",e),n?.size&&(i.style.setProperty("width",`${n.size}px`,"important"),i.style.setProperty("height",`${n.size}px`,"important")),t.className){let s=i.getAttribute("class")||"";i.setAttribute("class",`${s} ${t.className}`.trim())}return t.replaceWith(i),i};var $t=1e3,Ot=()=>(localStorage.getItem("csdebug")===null&&localStorage.setItem("csdebug","false"),localStorage.getItem("csdebug")==="true"),ie={compliant:"check-circle",notCompliant:"close-circle"},Ge={pass:{icon:"check-circle",color:g["success-foreground"],label:"pass"},fail:{icon:"alert-circle",color:g["error-foreground"],label:"fail"},"not-verifiable":{icon:"help-circle",color:g.info,label:"not verifiable"}},_t=()=>{let t=new URLSearchParams(window.location.search),e=t.get("trid"),n=t.get("site");return!e||!n?(console.error("[Results] Missing required query parameters:",{trid:e,site:n}),window.location.assign("/scan"),null):{trackingId:e,site:n}},Ut=t=>{let e=a("current-scan-activity");e&&(e.textContent=t)},Ft=(t,e)=>{let n=a("scan-progress");if(n){let o=e>0?Math.round(t/e*100):0;n.textContent=`${t} / ${e} pages (${o}%)`}},jt=()=>{let t=a("scan-progress-container"),e=a("scan-error-container");t&&(t.style.display="flex"),e&&(e.style.display="none")},ae=t=>{let e=a("scan-progress-container"),n=a("scan-error-container"),o=a("current-scan-error");e&&(e.style.display="none"),n&&(n.style.display="flex"),o&&(o.innerHTML=t)},Vt=async t=>(jt(),new Promise((e,n)=>{let o=setInterval(async()=>{try{let r=await re.getStatus(t);if(r.currentActivity&&Ut(r.currentActivity),r.progress){let{pagesScanned:i,totalPages:s}=r.progress;Ft(i,s)}if(r.status==="completed")clearInterval(o),e();else if(r.status==="failed"){let i=r.error||"Scan failed unexpectedly";console.error("[Results] Scan failed:",i),ae(`Scan failed: ${i}`),clearInterval(o),n(new Error(i))}}catch(r){console.error("[Results] Error polling status:",r),ae("Unable to check scan status. Please try again."),clearInterval(o),n(r)}},$t)})),Wt=()=>{let t=a("scan-status_style");t&&t.remove()},Bt=async t=>re.getResults(t),Gt=t=>{if(!t.results)return null;let{pagesScanned:e,issues:n}=t.results;return e.length>0?null:n.siteInaccessible?n.siteInaccessible:n.notFound&&n.notFound.length>0?"<strong>No pages found</strong><br><br>We couldn't find any pages at the URL you provided. Please ensure you entered the correct URL and try scanning again.":"<strong>Scan completed with no pages</strong><br><br>No pages were scanned. Please verify the URL is correct and the site is publicly accessible, then try again."},qt=t=>{if(!t.results)return;let{pagesScanned:e,origin:n}=t.results,o=(e.length>0?e[0]:n).replace(/\/$/,"");V("target-website").forEach(s=>{s.textContent=o}),V("target-website-url").forEach(s=>{s instanceof HTMLAnchorElement?s.href=o:s.textContent=o})},Yt=t=>{let e=w.extractFullCompliance(t),n=a("compliance-score");if(n){let o=a("value",n);if(o){let r=Math.round(e.overallScore);o.textContent=`${r}%`;let i;r>=80?i=g["success-foreground"]:r>=50?i=g["warning-foreground"]:i=g["error-foreground"],o.style.color=i}}},Zt=t=>{let e=t.replace(/\/$/,"");V("target-website").forEach(r=>{r.textContent=e}),V("target-website-url").forEach(r=>{r instanceof HTMLAnchorElement?r.href=e:r.textContent=e})},Xt=t=>{let e=Math.floor(t/1e3);if(e<60)return`${e}s`;let n=Math.floor(e/60),o=e%60;return`${n}m ${o}s`},Kt=t=>new Date(t).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),N=(t,e,n,o)=>{let r=a(t);if(!r)return;let i=a("value",r),s=a("text",r);i&&(i.textContent=e),s&&n&&(s.textContent=n),o&&(r.style.backgroundColor=g[o])},Qt=t=>{if(!t.results)return;let{scanDuration:e,pagesScanned:n,detectedItems:o,scannedAt:r}=t.results;N("scan-duration-card",Xt(e)),N("pages-scanned-card",n.length.toString()),N("items-detected-card",o.length.toString()),N("scan-date-card",Kt(r))},Jt=t=>{if(!t.results)return;let{detectedItems:e,trackersInfo:n,webflowAnalytics:o}=t.results,r=n?.trackers??[],i=o?.analytics==="never",s=x.affiliatedDOMResources(e,r).length;if(i){let p=x.affiliatedDOMResources(e,r).filter(b=>{let S=b;return te.test(S.source||"")||/intellimize\.co/i.test(S.domain||"")}).length;s-=p}let l=new Map;x.violatingTrackers(r).forEach(p=>{p.resources?.forEach(b=>{x.isGTMContainerTrackerResource(b)||l.set(b.id,p)})});let m=x.loadedStorageResources(e).filter(p=>i&&j.test(p.name)||!p.attributedTo||p.attributedTo.length===0?!1:p.attributedTo.some(b=>l.has(b))).length,h=w.extractFullCompliance(t).summary.failed,{cmpInstalled:f}=w.extractActionableItems(t);N("scripts-detected-card",s.toString(),void 0,s===0?"success":"error"),N("cookies-detected-card",m.toString(),void 0,m===0?"success":"warning"),N("action-items-card",h.toString(),"Violations",h===0?"success":"error"),en(!!f)},en=t=>{let e=a("cmp-status-card");if(!e)return;let n=a("icon",e),o=a("text",e),r=t?g["success-foreground"]:g["error-foreground"];n&&W(n,t?ie.compliant:ie.notCompliant,{color:r,size:24}),o&&(o.textContent=t?"CMP Detected":"CMP Not Found"),e.style.backgroundColor=t?g.success:g.error},tn=t=>{if(!t.results)return;let e=V("compliance-container");if(e.length===0)return;let n=w.extractFullCompliance(t),{summary:o}=n,r=o.failed,i=r===0?"compliant":"non-compliant",s=()=>{if(r===0)return"No compliance violations detected. Nice work!";let p=n.criteria.filter(b=>b.status==="fail").map(b=>b.name);return`Found ${r} issue${r>1?"s":""}: ${p.slice(0,3).join(", ")}${p.length>3?", ...":""}. Action needed.`},c={compliant:{label:"Compliant",message:s(),icon:ie.compliant,color:g.success,iconColor:g["success-foreground"]},"non-compliant":{label:"Not Compliant",message:s(),icon:ie.notCompliant,color:g.error,iconColor:g["error-foreground"]}}[i];e.forEach(p=>{p.setAttribute("fs-cloak",""),p.classList.add("hide")});let m=null;e.forEach(p=>{(i==="compliant"&&p.classList.contains("compliant")||i!=="compliant"&&!p.classList.contains("compliant"))&&(m=p)}),m||([m]=e),m.removeAttribute("fs-cloak"),m.classList.remove("hide");let d=a("compliance-status",m);if(d){let p=a("icon",d),b=a("text",d);p&&W(p,c.icon,{color:c.iconColor,size:30}),b&&(b.textContent=c.label)}let h=a("compliance-details",m);h&&(h.textContent=c.message);let f=a("violations-wrapper",m);if(f){let p=a("value",f);p&&(p.textContent=r.toString())}m.style.backgroundColor=c.color},nn=t=>{if(!t.results)return;let{trackersInfo:e}=t.results,n=a("violations-component"),o=a("violations-list"),r=a("violation-template");if(!o||!r)return;let i=x.violatingTrackers(e?.trackers??[]);if(n){let f=a("icon",n);f&&W(f,"alert-octagon",{color:g["error-foreground"],size:24})}Array.from(o.children).forEach(f=>{f!==r&&f.remove()}),r.style.display="none";let l=a("violations-list-empty");if(i.length===0){l&&(l.removeAttribute("fs-cloak"),l.classList.remove("hide")),o.setAttribute("fs-cloak",""),o.classList.add("hide");return}l&&(l.setAttribute("fs-cloak",""),l.classList.add("hide")),o.removeAttribute("fs-cloak"),o.classList.remove("hide");let c=e?.providers??[],m=new Map;c.forEach(f=>m.set(f.id,f.name));let d={analytics:"\u{1F4CA}",marketing:"\u{1F4E2}",advertising:"\u{1F4FA}",functional:"\u2699\uFE0F",uncategorized:"\u2753"},h=new Set;i.forEach(f=>{let b=m.get(f.providerId)||f.name||f.domain||f.providerId||"Unknown",S=`${f.category}-${b}`;if(h.has(S))return;h.add(S);let E=r.cloneNode(!0);E.removeAttribute("data-fs-cs"),E.style.display="";let B=a("icon",E);B&&W(B,"chevron-right",{color:g["error-foreground"],size:16});let T=a("text",E);if(T){let $=d[f.category]??"\u{1F534}",R=f.category||"uncategorized";T.textContent=`${$} ${b}: ${R} tracker running before consent`}o.appendChild(E)})},se=t=>{let e=t?.toLowerCase()||"uncategorized";return["uncategorized","unknown"].includes(e)?1:["marketing","advertising"].includes(e)?2:["analytics","performance"].includes(e)?3:["functional","personalization"].includes(e)?4:["essential","necessary","strictly-necessary","strictly_necessary"].includes(e)?5:1},on=t=>{if(!t.results)return;let{detectedItems:e,trackersInfo:n,webflowAnalytics:o}=t.results,r=n?.trackers??[],i=n?.providers??[],s=o?.analytics==="never",l=new Map;i.forEach(y=>l.set(y.id,y.name));let c=new Map;x.violatingTrackers(r).forEach(y=>{y.resources?.forEach(u=>{x.isGTMContainerTrackerResource(u)||c.set(u.id,y)})});let d=Ot(),h=x.allDOMElements(e).sort((y,u)=>se(y.category)-se(u.category)),f=y=>{if(y.type==="banner")return!1;let u=y;return q.test(u.domain||"")||q.test(u.source||"")},p=y=>{if(y.type==="banner")return!1;let u=y;return te.test(u.source||"")||/intellimize\.co/i.test(u.domain||"")},b=d?h:h.filter(y=>y.type==="banner"||s&&p(y)?!1:c.has(y.id)),E=(d?x.storageResources(e):x.loadedStorageResources(e).filter(y=>s&&j.test(y.name)?!1:c.has(y.id)?!0:y.attributedTo&&y.attributedTo.length>0?y.attributedTo.some(u=>c.has(u)):!1)).sort((y,u)=>se(y.category)-se(u.category)),B=a("scripts-component"),T=a("script-list"),$=a("script-item"),R=a("script-list-empty");if(T&&$){if(B){let u=a("scripts-title",B);u&&(u.textContent=`Detected DOM Resources (${b.length})`)}Array.from(T.children).forEach(u=>{u!==$&&u.remove()}),$.style.display="none",b.length===0?(R&&(R.removeAttribute("fs-cloak"),R.classList.remove("hide")),T.setAttribute("fs-cloak",""),T.classList.add("hide")):(R&&(R.setAttribute("fs-cloak",""),R.classList.add("hide")),T.removeAttribute("fs-cloak"),T.classList.remove("hide"),b.forEach(u=>{let k=$.cloneNode(!0);k.removeAttribute("data-fs-cs"),k.style.display="";let z=a("script-title",k),H=a("script-url",k),P=a("script-type",k),v=a("script-tag",k),_=u.type==="banner",X=c.get(u.id),qe=!!X,Se=f(u);if(Se?(k.style.backgroundColor="",k.style.borderColor="",k.style.borderWidth="",k.style.borderStyle=""):(!qe||_)&&(k.style.backgroundColor=g.neutral,k.style.borderColor=g["neutral-foreground"],k.style.borderWidth="1px",k.style.borderStyle="solid"),_){let U=u;z&&(z.textContent="Consent Banner"),H&&(H.textContent=U.element||"N/A"),P&&(P.textContent="banner"),v&&(v.textContent="Category: essential",v.classList.add("is-essential"),v.style.backgroundColor=g.success,v.style.color=g.white)}else{let U=u;if(z&&(z.textContent=`${U.domain||`Unknown ${U.type}`}`),H&&(H.textContent=U.source?.slice(0,100)||"N/A"),P&&(P.textContent=U.type||"N/A"),v){if(X){let Ye=l.get(X.providerId)||X.label||"Unknown";v.textContent=`Provider: ${Ye}`,v.style.display="",v.style.backgroundColor=g.neutral,v.style.color=g.white}else v.style.display="none";v.classList.remove("is-marketing","is-analytics","is-advertising","is-uncategorized"),Se&&(v.textContent="External Font",v.style.display="",v.style.backgroundColor=g.white,v.style.color=g.neutral)}}T.appendChild(k)}))}let Ie=a("cookies-component"),D=a("cookie-list"),Z=a("cookie-item"),O=a("cookie-list-empty");if(D&&Z){if(Ie){let u=a("cookies-title",Ie);u&&(u.textContent=`Cookies & Storage Data (${E.length})`)}Array.from(D.children).forEach(u=>{u!==Z&&u.remove()}),Z.style.display="none",E.length===0?(O&&(O.removeAttribute("fs-cloak"),O.classList.remove("hide")),D.setAttribute("fs-cloak",""),D.classList.add("hide")):(O&&(O.setAttribute("fs-cloak",""),O.classList.add("hide")),D.removeAttribute("fs-cloak"),D.classList.remove("hide"),E.forEach(u=>{let k=Z.cloneNode(!0);k.removeAttribute("data-fs-cs"),k.style.display="";let z=a("cookie-name",k),H=a("cookie-url",k),P=a("cookie-type",k),v=a("cookie-tag",k);if(z&&(z.textContent=`${u.name||`Unknown ${u.type}`}`),H&&(H.textContent=u.domain||"N/A"),P&&(P.textContent=u.type||"N/A"),v){let _=u.category||"uncategorized";v.textContent=_,v.classList.remove("is-marketing","is-analytics","is-advertising","is-uncategorized"),v.classList.add(`is-${_}`),_==="uncategorized"&&(v.style.backgroundColor=g.error,v.style.color=g.white)}D.appendChild(k)}))}},rn=t=>{let e=w.extractAttentionItems(t),n=a("attention-list"),o=a("attention-item"),r=a("attention-list-empty");if(!(!n||!o)){if(o.style.display="none",e.length===0){r&&(r.removeAttribute("fs-cloak"),r.classList.remove("hide")),n.setAttribute("fs-cloak",""),n.classList.add("hide");return}r&&(r.setAttribute("fs-cloak",""),r.classList.add("hide")),n.removeAttribute("fs-cloak"),n.classList.remove("hide"),e.forEach((i,s)=>{let l=o.cloneNode(!0);l.removeAttribute("data-fs-cs"),l.style.display="";let c=a("value",l);c&&(c.textContent=(s+1).toString());let m=a("text",l);m&&(m.textContent=i),n.appendChild(l)})}},sn=t=>{let e=w.extractComplianceSummary(t),n=a("passed-items");if(n){let i=a("value",n);i&&(i.textContent=e.pass.toString())}let o=a("failed-items");if(o){let i=a("value",o);i&&(i.textContent=e.fail.toString())}let r=a("unverified-items");if(r){let i=a("value",r);i&&(i.textContent=e.unverified.toString())}},an=t=>{let e=w.extractFullCompliance(t),n=a("criteria-list"),o=a("criteria-item");if(!n||!o)return;Array.from(n.children).forEach(s=>{s!==o&&s.remove()}),o.style.display="none",e.criteria.filter(s=>s.status!=="not-verifiable").forEach(s=>{let l=o.cloneNode(!0);l.removeAttribute("data-fs-cs"),l.style.display="";let c=Ge[s.status]||Ge["not-verifiable"],m=a("icon",l);m&&W(m,c.icon,{color:c.color,size:24});let d=a("criteria-title",l),h=a("criteria-description",l);d&&(d.textContent=s.name),h&&(h.textContent=s.description);let f=a("criteria-status",l);f&&(f.textContent=c.label);let p=a("criteria-answer",l);p&&(p.textContent=s.details||"No additional details available."),n.appendChild(l)})},cn=t=>{let e=w.extractStatistics(t),n=a("stat-duration");if(n){let c=a("value",n);c&&(c.textContent=e.scanDuration)}let o=a("stat-resources");if(o){let c=a("value",o);c&&(c.textContent=e.resourcesCount.toString())}let r=a("stat-storage");if(r){let c=a("value",r);c&&(c.textContent=e.storageCount.toString())}let i=a("stat-first-party");if(i){let c=a("value",i);c&&(c.textContent=e.firstParty.toString())}let s=a("stat-third-party");if(s){let c=a("value",s);c&&(c.textContent=e.thirdParty.toString())}let l=a("stat-categories");if(l){let c=a("value",l);c&&(c.textContent=e.categories.toString())}},ln=[{name:"websiteInfo",updater:qt},{name:"complianceScore",updater:Yt,requiredElements:["compliance-score"]},{name:"primaryStats",updater:Qt},{name:"secondaryStats",updater:Jt},{name:"complianceContainer",updater:tn,requiredElements:["compliance-container"]},{name:"violationsList",updater:nn,requiredElements:["violations-list"]},{name:"detectedItems",updater:on},{name:"attentionItems",updater:rn,requiredElements:["attention-list"]},{name:"complianceSummary",updater:sn},{name:"complianceCriteria",updater:an,requiredElements:["criteria-list"]},{name:"statistics",updater:cn}],mn=t=>{ln.forEach(({name:e,updater:n,requiredElements:o})=>{try{if(o&&o.find(i=>!a(i)))return;n(t)}catch(r){console.error(`[Results] Error in updater "${e}":`,r)}}),me()},dn=()=>{let t=a("share-btn");if(!t)return;let e=document.createElement("span");e.textContent="Click to copy share url",e.style.cssText=`
1
+ "use strict";(()=>{var Ze=Object.defineProperty;var Ke=(t,e,n)=>e in t?Ze(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ce=(t,e,n)=>Ke(t,typeof e!="symbol"?e+"":e,n);var le=(t=document)=>t.documentElement.getAttribute("data-wf-site");var me=async t=>{let{Webflow:e}=window;if(!(!e||!("destroy"in e)||!("ready"in e)||!("require"in e))&&!(t&&!t.length)){if(t||(e.destroy(),e.ready()),!t||t.includes("ix2")){let n=e.require("ix2");if(n){let{store:o,actions:r}=n,{eventState:i}=o.getState().ixSession,s=Object.entries(i);t||n.destroy(),n.init(),await Promise.all(s.map(l=>o.dispatch(r.eventStateChanged(...l))))}}if(!t||t.includes("commerce")){let n=e.require("commerce"),o=le();n&&o&&(n.destroy(),n.init({siteId:o,apiUrl:"https://render.webflow.com"}))}if(t?.includes("lightbox")&&e.require("lightbox")?.ready(),t?.includes("slider")){let n=e.require("slider");n&&(n.redraw(),n.ready())}return t?.includes("tabs")&&e.require("tabs")?.redraw(),new Promise(n=>e.push(()=>n(void 0)))}};var C=t=>t.type==="script"||t.type==="iframe"||t.type==="link"||t.type==="noscript",I=t=>t.type==="cookie"||t.type==="local-storage"||t.type==="session-storage",G=t=>t.type==="banner",Xe=["essential","necessary"],L=t=>!!t&&Xe.includes(t),X=/googletagmanager\.com\/gtm\.js\?(?:[^"'#\s]*&)?id=(GTM-[A-Z0-9]+)/gi,de=t=>t.type!=="script"?!1:(X.lastIndex=0,X.test(t.source)),ue=t=>t.type!=="script"?!1:(X.lastIndex=0,X.test(t.url)),pe=t=>t.filter(C),Qe=t=>t.filter(G),Je=t=>t.filter(e=>C(e)||G(e)),fe=t=>t.filter(e=>e.type==="script"),et=t=>t.filter(e=>e.type==="iframe"),tt=t=>t.filter(e=>e.type==="link"),nt=t=>t.filter(e=>e.type==="noscript"),ot=t=>t.filter(e=>C(e)&&e.isThirdParty&&!L(e.category)&&!de(e)),rt=t=>t.filter(e=>e.type==="script"&&e.isThirdParty&&!L(e.category)&&!de(e)),F=t=>t.filter(I),ge=t=>t.filter(e=>e.type==="cookie"),st=t=>t.filter(e=>e.type==="local-storage"),it=t=>t.filter(e=>e.type==="session-storage"),at=t=>t.filter(e=>I(e)&&!L(e.category)),ye=t=>t.filter(e=>e.type==="cookie"&&!L(e.category)),he=t=>t.filter(e=>e.type==="local-storage"&&!L(e.category)),ke=t=>t.filter(e=>e.type==="session-storage"&&!L(e.category)),ve=t=>t.filter(e=>e.type==="cookie"&&(!e.category||e.category==="uncategorized")),be=t=>t.filter(e=>I(e)&&(!e.category||e.category==="uncategorized")),ct=/google\s*tag\s*manager|^gtm$/i,Ee=t=>ct.test(t.label),M=t=>t.filter(e=>!L(e.category)&&!Ee(e)),lt=(t,e)=>t.filter(n=>n.category===e),Q=t=>t.filter(e=>e.category==="analytics"&&!Ee(e)),J=t=>t.filter(e=>e.category==="marketing"),mt=t=>t.filter(e=>!e.category||e.category==="uncategorized"),ee=t=>M(t).flatMap(n=>n.resources||[]),dt=t=>{let e=ee(t);return new Set(e.map(n=>n.id))},we=t=>{let e=ee(t),n=["script","link","iframe","noscript"];return new Set(e.filter(o=>n.includes(o.type)).map(o=>o.id))},Re=t=>{let e=ee(t),n=["cookie","local-storage","session-storage"];return new Set(e.filter(o=>n.includes(o.type)).map(o=>o.id))},ut=(t,e)=>{let n=we(e);return t.filter(o=>C(o)&&n.has(o.id))},pt=(t,e)=>{let n=Re(e);return t.filter(o=>I(o)&&n.has(o.id))},x={isEssentialCategory:L,isResourceItem:C,isStorageItem:I,isBannerItem:G,isGTMContainerScript:de,isGTMContainerTracker:Ee,isGTMContainerTrackerResource:ue,domResources:pe,banners:Qe,allDOMElements:Je,scripts:fe,iframes:et,links:tt,noscripts:nt,loadedDOMResources:ot,loadedScripts:rt,storageResources:F,cookies:ge,localStorage:st,sessionStorage:it,loadedStorageResources:at,loadedCookies:ye,loadedLocalStorage:he,loadedSessionStorage:ke,uncategorizedCookies:ve,uncategorizedStorageItems:be,violatingTrackers:M,trackersByCategory:lt,analyticsTrackers:Q,marketingTrackers:J,uncategorizedTrackers:mt,getViolatingTrackerResources:ee,getViolatingResourceIds:dt,getViolatingDOMResourceIds:we,getViolatingStorageResourceIds:Re,affiliatedDOMResources:ut,affiliatedStorageResources:pt};var ft=[{id:"cookieyes",name:"CookieYes",patterns:{scripts:[/cookieyes\.com/i,/cookie-law-info/i],cookies:[/cookieyes-consent/i,/cky-consent/i,/cookielawinfo/i],dom:[/cky-consent/i,/cookie-law-info/i]}},{id:"termly",name:"Termly",patterns:{scripts:[/termly\.io/i,/termly-embed/i],cookies:[/termly/i],dom:[/termly/i]}},{id:"consentmanager",name:"Consentmanager.net",patterns:{scripts:[/consentmanager\.net/i,/consent-manager/i],cookies:[/consentmanager/i,/cmapi/i],dom:[/consent-manager/i]}},{id:"enzuzo",name:"Enzuzo",patterns:{scripts:[/enzuzo\.com/i],cookies:[/enzuzo/i],dom:[/enzuzo/i]}},{id:"cookiebot",name:"Cookiebot (by Usercentrics)",patterns:{scripts:[/cookiebot\.com/i,/consent\.cookiebot/i],cookies:[/CookieConsent/i,/cookiebot/i],dom:[/CookieConsent/i,/cookiebot/i]}},{id:"iubenda",name:"Iubenda",patterns:{scripts:[/iubenda\.com/i,/iubenda_cs/i],cookies:[/_iub_cs/i,/iubenda/i],dom:[/iubenda/i,/_iub_cs/i]}},{id:"osano",name:"Osano",patterns:{scripts:[/osano\.com/i],cookies:[/osano/i],dom:[/osano/i]}},{id:"usercentrics",name:"Usercentrics",patterns:{scripts:[/usercentrics\.eu/i,/usercentrics\.com/i],cookies:[/usercentrics/i,/uc_user_interaction/i],dom:[/usercentrics/i]}},{id:"cookiescript",name:"CookieScript",patterns:{scripts:[/cookiescript\.com/i,/cookie-script/i],cookies:[/CookieScriptConsent/i],dom:[/cookie-script/i]}},{id:"secureprivacy",name:"Secure Privacy",patterns:{scripts:[/secureprivacy\.ai/i],cookies:[/secureprivacy/i],dom:[/secureprivacy/i]}},{id:"onetrust",name:"OneTrust",patterns:{scripts:[/onetrust\.com/i,/optanon/i],cookies:[/OptanonConsent/i,/OptanonAlertBoxClosed/i],dom:[/onetrust/i,/optanon/i]}},{id:"trustarc",name:"TrustArc",patterns:{scripts:[/trustarc\.com/i,/truste\.com/i],cookies:[/truste/i,/notice_behavior/i],dom:[/truste/i]}},{id:"axeptio",name:"Axeptio",patterns:{scripts:[/axept\.io/i,/static\.axept\.io/i],cookies:[/axeptio_/i,/axeptio/i],dom:[/axeptio/i]}},{id:"complianz",name:"Complianz",patterns:{scripts:[/complianz/i],cookies:[/complianz/i,/cmplz/i],dom:[/complianz/i,/cmplz/i]}},{id:"quantcast",name:"Quantcast",patterns:{scripts:[/quantcast/i,/quantserve/i],cookies:[/quantcast/i,/__qca/i],dom:[/quantcast/i]}},{id:"cookieconsent-termsfeed",name:"Cookie Consent by TermsFeed",patterns:{scripts:[/cookieconsent\.com/i,/termsfeed\.com/i],cookies:[/cc_cookie/i],dom:[/cookieconsent/i]}},{id:"finsweet-fs-cc",name:"Finsweet [fs-cc] Consent",patterns:{scripts:[/@finsweet\/cookie-consent/i,/fs-cc\.js/i],cookies:[/fs-cc/i,/finsweet.*cookie/i],dom:[/fs-cc-(mode|src|category|placeholder)\s*=/i,/(?:^|[^-])fs-cc(?:[^-]|$)/i,/fs-consent-element/i,/fs-consent_banner/i],banners:[/fs-cc/i,/fs-consent/i,/cookie-consent/i]}},{id:"finsweet-cookie-consent",name:"Finsweet Cookie Consent | Finsweet Consent Pro",patterns:{scripts:[/@finsweet\/fs-components/i,/finsweet.*cookie-consent/i,/fs-cc\.js/i],cookies:[/fs-consent/i,/(?:^|[^-])fs-cc(?:[^-]|$)/i,/(?:^|[^-])fs-consent(?:[^-]|$)/i,/finsweet.*cookie/i],dom:[/fs-components-installed\s*=\s*["']consent["']/i,/(?:^|[^-])fs-cc(?:[^-]|$)/i,/(?:^|[^-])fs-consent(?:[^-]|$)/i,/fs-consent-element/i,/fs-consent_banner/i],banners:[/fs-consent/i,/fs-cc/i,/consentpro/i,/cookie-consent/i,/fs-components.*consent/i]}}],Le=/youtube\.com|youtu\.be|vimeo\.com|player\.vimeo/i,Me=/maps\.google|maps\.googleapis|google\.com\/maps/i,q=/fonts\.googleapis\.com|fonts\.gstatic\.com|use\.typekit\.net|use\.typekit\.com|p\.typekit\.net|fast\.fonts\.net|hello\.myfonts\.net|cloud\.typography\.com|api\.fontshare\.com|cdn\.fontshare\.com|fonts\.cdnfonts\.com/i,Ae=/googletagmanager\.com|gtm\.js/i,te=/cdn\.intellimize\.co\/snippet\/\d+\.js/i,j=/intellimize/i;function De(t){let e=[];e.push(gt(t)),e.push(yt(t)),e.push(ht(t)),e.push(kt(t)),e.push(xe(t)),e.push(vt(t)),e.push({id:"script-head-placement",name:"Script Head Placement",description:"Verify consent script is placed at the top of <head> section",status:"not-verifiable",details:"Cannot be verified from scan results. Manual review required."}),e.push(bt(t)),e.push({id:"auto-placeholder",name:"Auto-placeholder Support",description:"Check if blocked videos have placeholder elements",status:"not-verifiable",details:"Cannot be verified from scan results. Manual review required."});let n={passed:e.filter(c=>c.status==="pass").length,failed:e.filter(c=>c.status==="fail").length,notVerifiable:e.filter(c=>c.status==="not-verifiable").length},o=e.filter(c=>c.status!=="not-verifiable");if(o.length===0)return{overallScore:0,hasViolations:n.failed>0,criteria:e,summary:n};let r={"pre-consent-trackers":2.5,"consent-tool":2,"video-embeds":1,"google-maps":1,"external-fonts":1,"uncategorized-trackers":1,"webflow-optimize":1},i=0,s=0;for(let c of o){let m=r[c.id]??1,h=(c.status==="pass"?1:0)*m;i+=h,s+=m}return{overallScore:Math.round(i/s*100),hasViolations:n.failed>0,criteria:e,summary:n}}function ne(t){if(!t.results)throw new Error("No results found in response for compliance evaluation");return De(t.results)}function gt(t){let e=t.trackersInfo?.trackers??[],n=t.trackersInfo?.providers??[],o=new Map;n.forEach(d=>o.set(d.id,d.name));let r=M(e),i=Q(e).length,s=J(e).length,l=[...new Set(r.map(d=>o.get(d.providerId)||d.name||d.domain||d.providerId))];if(r.length===0)return{id:"pre-consent-trackers",name:"Pre-Consent Trackers",description:"Check for tracking scripts running before user consent",status:"pass",details:"No tracking scripts detected running before consent."};let c=[];i>0&&c.push(`${i} analytics`),s>0&&c.push(`${s} marketing`);let m=r.length-i-s;return m>0&&c.push(`${m} other`),{id:"pre-consent-trackers",name:"Pre-Consent Trackers",description:"Check for tracking scripts running before user consent",status:"fail",details:`Found ${r.length} tracker(s) running before consent (${c.join(", ")}). These should be blocked until user provides consent.`,affectedItems:l}}function yt(t){let e=t.trackersInfo?.trackers??[],n=M(e),o=new Set;n.forEach(l=>{l.resources?.forEach(c=>o.add(c.id))});let r=t.detectedItems.filter(C).filter(l=>Le.test(l.domain)||Le.test(l.source)).filter(l=>o.has(l.id)),i=r.map(l=>l.id);if(r.length===0)return{id:"video-embeds",name:"YouTube/Vimeo Detection",description:"Detect YouTube or Vimeo video embeds that may store cookies",status:"pass",details:"No violating YouTube or Vimeo embeds detected."};let s=r.filter(l=>l.isThirdParty);return{id:"video-embeds",name:"YouTube/Vimeo Detection",description:"Detect YouTube or Vimeo video embeds that may store cookies",status:"fail",details:`Found ${r.length} video embed(s) from YouTube/Vimeo. ${s.length} are third-party resources that may store cookies before consent.`,affectedItems:i}}function ht(t){let e=t.trackersInfo?.trackers??[],n=M(e),o=new Set;n.forEach(s=>{s.resources?.forEach(l=>o.add(l.id))});let r=t.detectedItems.filter(C).filter(s=>Me.test(s.domain)||Me.test(s.source)).filter(s=>o.has(s.id)),i=r.map(s=>s.id);return r.length===0?{id:"google-maps",name:"Google Maps Detection",description:"Detect Google Maps embeds that may store cookies",status:"pass",details:"No violating Google Maps embeds detected."}:{id:"google-maps",name:"Google Maps Detection",description:"Detect Google Maps embeds that may store cookies",status:"fail",details:`Found ${r.length} Google Maps embed(s) that may store cookies before consent.`,affectedItems:i}}function kt(t){let e=t.trackersInfo?.trackers??[],n=M(e),o=new Set;n.forEach(s=>{s.resources?.forEach(l=>o.add(l.id))});let r=t.detectedItems.filter(C).filter(s=>q.test(s.domain)||q.test(s.source)).filter(s=>o.has(s.id)),i=r.map(s=>s.id);return r.length===0?{id:"external-fonts",name:"External Fonts Detection",description:"Detect external fonts (Google Fonts, Typekit, etc.) which transfer IP addresses without consent",status:"pass",details:"No violating external fonts detected."}:{id:"external-fonts",name:"External Fonts Detection",description:"Detect external fonts (Google Fonts, Typekit, etc.) which transfer IP addresses without consent",status:"fail",details:`Found ${r.length} external font resource(s). This transfers visitor IP addresses to third-party servers without consent, which may violate data privacy regulations (GDPR, CCPA, HIPAA, etc.). Fonts should be self-hosted or loaded only after consent.`,affectedItems:i}}function xe(t){if(t.detectedCmps&&t.detectedCmps.length>0)return{id:"consent-tool",name:"Consent Tool Detection",description:"Check if a cookie consent management tool is installed",status:"pass",details:`Detected consent tool(s): ${t.detectedCmps.map(i=>i.version?`${i.name} (v${i.version})`:i.name).join(", ")}`};let e=[],n=new Map;for(let r of ft){let i=0;if(t.detectedItems&&Array.isArray(t.detectedItems)){for(let s of t.detectedItems)if(C(s)&&s.type==="script"){let{source:l}=s,c=s.element?.outerHTML||"";for(let m of r.patterns.scripts)if(m.test(l)||m.test(c)){i+=1,e.includes(s.id)||e.push(s.id);break}}}if(t.trackersInfo?.providers&&Array.isArray(t.trackersInfo.providers))for(let s of t.trackersInfo.providers){let l=s.name||"";for(let c of r.patterns.scripts)if(c.test(l)){i+=1,e.includes(s.id)||e.push(s.id);break}}if(t.detectedItems&&Array.isArray(t.detectedItems)){for(let s of t.detectedItems)if(I(s)&&s.type==="cookie"){let{name:l}=s;for(let c of r.patterns.cookies)if(c.test(l)){i+=1,e.includes(s.id)||e.push(s.id);break}}}if(t.detectedItems&&Array.isArray(t.detectedItems))for(let s of t.detectedItems){let c=C(s)&&s.element?.outerHTML||"";for(let m of r.patterns.dom)if(m.test(c)){i+=1,e.includes(s.id)||e.push(s.id);break}}if(t.detectedItems&&Array.isArray(t.detectedItems)){for(let s of t.detectedItems)if(G(s)){let l=s.element||"",c=r.patterns.banners||r.patterns.dom;for(let m of c)if(m.test(l)){i+=3,e.includes(s.id)||e.push(s.id);break}}}i>0&&n.set(r.name,i)}let o=Array.from(n.entries()).sort((r,i)=>i[1]-r[1]).map(([r])=>r);return o.length===0?{id:"consent-tool",name:"No cookie consent tool detected",description:"Check if a cookie consent management tool is installed",status:"fail",details:"No cookie consent tool detected. A consent banner is required for compliance with data privacy regulations (GDPR, CCPA, etc.). Note: Not all CMP tools can be automatically detected. If you have a CMP installed that is not recognized, please verify manually."}:{id:"consent-tool",name:"Consent Tool Detection",description:"Check if a cookie consent management tool is installed",status:"pass",details:`Detected consent tool(s): ${o.join(", ")}. Note: Detection is based on known patterns and may not identify all CMP configurations.`,affectedItems:e}}function vt(t){let e=t.trackersInfo?.trackers??[],n=t.detectedItems??[],o=new Set;e.forEach(m=>{m.resources?.forEach(d=>{ue(d)||o.add(d.id)})});let r=e.filter(m=>Ae.test(m.label)||Ae.test(m.domain??"")?!1:!m.category||m.category==="uncategorized"),i=be(n).filter(m=>o.has(m.id)?!0:m.attributedTo&&m.attributedTo.length>0?m.attributedTo.some(d=>o.has(d)):!1),s=[...r.map(m=>m.id),...i.map(m=>m.id)];if(r.length+i.length===0)return{id:"uncategorized-trackers",name:"Uncategorized Trackers",description:"Check for trackers without proper categorization",status:"pass",details:"All trackers are properly categorized."};let c=[];return r.length>0&&c.push(`${r.length} tracker(s)`),i.length>0&&c.push(`${i.length} storage item(s)`),{id:"uncategorized-trackers",name:"Uncategorized Trackers",description:"Check for trackers without proper categorization",status:"fail",details:`Found ${c.join(" and ")} without categorization. These should be categorized for proper consent management.`,affectedItems:s}}function bt(t){let e=t.detectedItems??[],{webflowAnalytics:n}=t;if(!n)return{id:"webflow-optimize",name:"Webflow Optimize Detection",description:"Detect Webflow Optimize and Analyze configurations",status:"fail",details:"Webflow Analytics configuration data not available."};if(!n.analytics||n.analytics==="never")return{id:"webflow-optimize",name:"Webflow Optimize Detection",description:"Detect Webflow Optimize and Analyze configurations",status:"pass",details:"Webflow Analytics is disabled."};if(!(n.analytics==="always"||n.analytics==="optOut"))return{id:"webflow-optimize",name:"Webflow Optimize Detection",description:"Detect Webflow Optimize and Analyze configurations",status:"pass",details:"Webflow Analytics not configured for tracking or opt-out mode."};if(!e.some(d=>C(d)&&d.type==="script"&&te.test(d.source)))return{id:"webflow-optimize",name:"Webflow Optimize Detection",description:"Detect Webflow Optimize and Analyze configurations",status:"pass",details:"Webflow Optimize/Analyze (Intellimize) not detected."};if(xe(t).status!=="pass")return{id:"webflow-optimize",name:"Webflow Optimize Detection",description:"Detect Webflow Optimize and Analyze configurations",status:"pass",details:"Webflow Optimize detected; no CMP\u2014consent-gating not applicable."};let s=e.filter(d=>I(d)&&d.type==="cookie"&&j.test(d.name)),l=e.filter(d=>I(d)&&d.type==="session-storage"&&j.test(d.name)),c=e.filter(d=>I(d)&&d.type==="local-storage"&&j.test(d.name)),m=[];if(s.length>0&&m.push(`${s.length} cookie(s)`),l.length>0&&m.push(`${l.length} session-storage key(s)`),c.length>0&&m.push(`${c.length} local-storage key(s)`),m.length>0){let d=[...s.map(h=>h.id),...l.map(h=>h.id),...c.map(h=>h.id)];return{id:"webflow-optimize",name:"Webflow Optimize Detection",description:"Detect Webflow Optimize and Analyze configurations",status:"fail",details:`Intellimize cookies/storage present despite CMP: ${m.join(", ")}.`,affectedItems:d}}return{id:"webflow-optimize",name:"Webflow Optimize Detection",description:"Detect Webflow Optimize and Analyze configurations",status:"pass",details:"Webflow Optimize detected; CMP present and no Intellimize cookies or storage detected."}}function Te(t){if(t.detectedCmps&&t.detectedCmps.length>0)return t.detectedCmps.map(o=>o.name).join(", ");let e=xe(t);return e.status!=="pass"||!e.details?null:e.details.match(/Detected consent tool\(s\): (.+)/)?.[1]?.trim()??null}function ze(t){return De(t).criteria.filter(n=>n.status==="fail").map(n=>`${n.name}: ${n.details}`)}function He(t){let e=[],n=t.trackersInfo?.trackers??[],o=t.trackersInfo?.providers??[],r=t.detectedItems??[],i=F(r),s=new Map;o.forEach(E=>s.set(E.id,E.name));let l=M(n),c=Q(n),m=J(n);if(c.length>0){let E=Ce(c,3,s);e.push(`${c.length} analytics tracker(s) running before consent: ${E}`)}if(m.length>0){let E=Ce(m,3,s);e.push(`${m.length} marketing tracker(s) firing before consent: ${E}`)}let d=l.filter(E=>E.category!=="analytics"&&E.category!=="marketing");if(d.length>0){let E=Ce(d,3,s);e.push(`${d.length} other tracker(s) need consent: ${E}`)}let h=ye(i);h.length>0&&e.push(`${h.length} non-essential cookies set before consent`);let f=ve(i);f.length>0&&e.push(`${f.length} uncategorized cookies detected - review and categorize`);let p=he(i),b=ke(i),S=p.length+b.length;return S>0&&e.push(`${S} localStorage/sessionStorage items set pre-consent`),Te(t)||e.push("No consent management platform detected"),e}function Ce(t,e,n){let o=[...new Set(t.map(r=>n.get(r.providerId)||r.name||r.domain||"Unknown"))];return o.length<=e?o.join(", "):`${o.slice(0,e).join(", ")} +${o.length-e} more`}var Et=localStorage.getItem("cs-dev")==="true",Y=Et?"https://fs-consentpro-api-dev.finsweet.workers.dev":"https://api.consentpro.com",wn=1440*60*1e3;var g={success:"#07601d",warning:"#bb5902",error:"#8F0C3D",info:"#598FFF",neutral:"#363636",white:"#ffffff","neutral-foreground":"#6f6f6f","success-foreground":"#25fc54","warning-foreground":"#FFAA00","error-foreground":"#FF265A","info-foreground":"#d5e8ff"};function Pe(t){if(!t.results)throw new Error("No results found in response for scan summary extraction");let{results:e}=t;return{scanId:e.trackingId,scanDuration:e.scanDuration,pagesScanned:e.pagesScanned.length,totalPages:e.totalPagesFound,detectedItemsCount:e.detectedItems.length,scannedAt:e.scannedAt}}function Ne(t){let e=ne(t);return{compliant:!e.hasViolations,score:e.overallScore,violations:e.summary.failed}}function $e(t){if(!t.results)throw new Error("No results found in response for actionable items extraction");let{results:e}=t,n=fe(e.detectedItems).length,o=ge(e.detectedItems).length,r=Te(e);return{scripts:n,cookies:o,cmpInstalled:r??void 0}}function Oe(t){if(!t.results)throw new Error("No results found in response for violations extraction");return ze(t.results)}function _e(t){if(!t.results)throw new Error("No results found in response for detected items extraction");let{results:e}=t,n=pe(e.detectedItems),o=F(e.detectedItems);return{dom:n,storage:o}}function Ue(t){let e=ne(t);return{pass:e.summary.passed,fail:e.summary.failed,unverified:e.summary.notVerifiable}}function Fe(t){if(!t.results)throw new Error("No results found in response for attention items extraction");return He(t.results)}function je(t){if(!t.results)throw new Error("No results found in response for statistics extraction");let{results:e}=t;return{scanDuration:Tt(e.scanDuration),resourcesCount:e.detectedItems.length,storageCount:F(e.detectedItems).length,firstParty:e.statistics?.firstPartyResources??0,thirdParty:e.statistics?.thirdPartyResources??0,categories:Object.keys(e.statistics?.categoryCounts||{}).length}}function Ct(t){return ne(t)}function xt(t){return{scanSummary:Pe(t),compliance:Ne(t),actionableItems:$e(t),violations:Oe(t),detectedItems:_e(t),complianceSummary:Ue(t),attentionItems:Fe(t),statistics:je(t)}}function Tt(t){let e=Math.floor(t/1e3);if(e<60)return`${e}s`;let n=Math.floor(e/60),o=e%60;return`${n}m ${o}s`}var w={extractScanSummary:Pe,extractCompliance:Ne,extractActionableItems:$e,extractViolations:Oe,extractDetectedItems:_e,extractComplianceSummary:Ue,extractAttentionItems:Fe,extractStatistics:je,extractFullCompliance:Ct,extractAll:xt};var Ve="data-fs-cs";var a=(t,e=document)=>e.querySelector(`[${Ve}="${t}"]`),V=(t,e=document)=>e.querySelectorAll(`[${Ve}="${t}"]`);var We={},Be={"Content-Type":"application/json"},P=class extends Error{constructor(n,o,r){super(n);ce(this,"status");ce(this,"response");this.name="ScannerApiError",this.status=o,this.response=r}};async function oe(t){if(!t.ok){let e=t.statusText,n;try{let o=await t.json();n=o,o&&typeof o.error=="string"&&(e=o.error)}catch{n=await t.text().catch(()=>"Unknown error")}throw new P(`Report request failed: ${e}`,t.status,n)}return t.json()}var re={async startScan(t){let e=await fetch(`${Y}/v2/scanner/public/scan`,{method:"POST",headers:Be,body:JSON.stringify({url:t,acceptAll:!1})});if(e.status===409){let o={};try{o=await e.json()}catch{}throw new P(o.error||"A scan is already in progress for this website. Please wait for it to complete.",409,o)}return e.ok?await e.json():oe(e)},async getStatus(t){let e=await fetch(`${Y}/v2/scanner/public/status/${t}`,{headers:We});return await oe(e)},async getResults(t){let e=await fetch(`${Y}/v2/scanner/public/results/${t}`,{headers:We});return await oe(e)},async cancelScan(t){let e=await fetch(`${Y}/v2/scanner/public/scan/${t}`,{method:"DELETE",headers:Be});return await oe(e)}};var St='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"/><path d="M12 9v4"/><path d="M12 17h.01"/></svg>',wt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/></svg>',Rt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22" fill="currentColor"><path d="M11 0C17.0751 0 22 4.92487 22 11C22 17.0751 17.0751 22 11 22C4.92487 22 0 17.0751 0 11C0 4.92487 4.92487 0 11 0ZM11 2C6.02944 2 2 6.02944 2 11C2 15.9706 6.02944 20 11 20C15.9706 20 20 15.9706 20 11C20 6.02944 15.9706 2 11 2ZM13.293 7.29297C13.6835 6.90244 14.3165 6.90244 14.707 7.29297C15.0975 7.6835 15.0975 8.31653 14.707 8.70703L12.4141 11L14.707 13.293C15.0975 13.6835 15.0975 14.3165 14.707 14.707C14.3165 15.0975 13.6835 15.0975 13.293 14.707L11 12.4141L8.70703 14.707C8.31653 15.0975 7.6835 15.0975 7.29297 14.707C6.90244 14.3165 6.90244 13.6835 7.29297 13.293L9.58594 11L7.29297 8.70703C6.90244 8.31651 6.90244 7.68349 7.29297 7.29297C7.68349 6.90244 8.31651 6.90244 8.70703 7.29297L11 9.58594L13.293 7.29297Z"/></svg>',Lt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m2 2 20 20"/><path d="M8.35 2.69A10 10 0 0 1 21.3 15.65"/><path d="M19.08 19.08A10 10 0 1 1 4.92 4.92"/></svg>',Mt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 16h.01M12 8v4M7.86 2h8.28L22 7.86v8.28L16.14 22H7.86L2 16.14V7.86z"/></svg>',At='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m9 18 6-6-6-6"/></svg>',Dt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" x2="12" y1="8" y2="12"/><line x1="12" x2="12.01" y1="16" y2="16"/></svg>',zt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>',Ht='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><path d="M12 17h.01"/></svg>',Pt={"warning-triangle":St,"check-circle":wt,"close-circle":Rt,"circle-off":Lt,"alert-octagon":Mt,"chevron-right":At,"alert-circle":Dt,clock:zt,"help-circle":Ht},Nt=(t,e)=>{let n=Pt[t];return e?.color&&(n=n.replace(/currentColor/g,e.color)),e?.size&&(n=n.replace("<svg",`<svg width="${e.size}" height="${e.size}"`)),n},W=(t,e,n)=>{let o=Nt(e,n),r=document.createElement("template");r.innerHTML=o.trim();let i=r.content.firstElementChild;if(!i)return null;if(i.setAttribute("data-fs-icon",e),n?.size&&(i.style.setProperty("width",`${n.size}px`,"important"),i.style.setProperty("height",`${n.size}px`,"important")),t.className){let s=i.getAttribute("class")||"";i.setAttribute("class",`${s} ${t.className}`.trim())}return t.replaceWith(i),i};var $t=1e3,Ot=()=>(localStorage.getItem("csdebug")===null&&localStorage.setItem("csdebug","false"),localStorage.getItem("csdebug")==="true"),ie={compliant:"check-circle",notCompliant:"close-circle"},Ge={pass:{icon:"check-circle",color:g["success-foreground"],label:"pass"},fail:{icon:"alert-circle",color:g["error-foreground"],label:"fail"},"not-verifiable":{icon:"help-circle",color:g.info,label:"not verifiable"}},_t=()=>{let t=new URLSearchParams(window.location.search),e=t.get("trid"),n=t.get("site");return!e||!n?(console.error("[Results] Missing required query parameters:",{trid:e,site:n}),window.location.assign("/scan"),null):{trackingId:e,site:n}},Ut=t=>{let e=a("current-scan-activity");e&&(e.textContent=t)},Ft=(t,e)=>{let n=a("scan-progress");if(n){let o=e>0?Math.round(t/e*100):0;n.textContent=`${t} / ${e} pages (${o}%)`}},jt=()=>{let t=a("scan-progress-container"),e=a("scan-error-container");t&&(t.style.display="flex"),e&&(e.style.display="none")},ae=t=>{let e=a("scan-progress-container"),n=a("scan-error-container"),o=a("current-scan-error");e&&(e.style.display="none"),n&&(n.style.display="flex"),o&&(o.innerHTML=t)},Vt=async t=>(jt(),new Promise((e,n)=>{let o=setInterval(async()=>{try{let r=await re.getStatus(t);if(r.currentActivity&&Ut(r.currentActivity),r.progress){let{pagesScanned:i,totalPages:s}=r.progress;Ft(i,s)}if(r.status==="completed")clearInterval(o),e();else if(r.status==="failed"){let i=r.error||"Scan failed unexpectedly";console.error("[Results] Scan failed:",i),ae(`Scan failed: ${i}`),clearInterval(o),n(new Error(i))}}catch(r){console.error("[Results] Error polling status:",r),ae("Unable to check scan status. Please try again."),clearInterval(o),n(r)}},$t)})),Wt=()=>{let t=a("scan-status_style");t&&t.remove()},Bt=async t=>re.getResults(t),Gt=t=>{if(!t.results)return null;let{pagesScanned:e,issues:n}=t.results;return e.length>0?null:n.siteInaccessible?n.siteInaccessible:n.notFound&&n.notFound.length>0?"<strong>No pages found</strong><br><br>We couldn't find any pages at the URL you provided. Please ensure you entered the correct URL and try scanning again.":"<strong>Scan completed with no pages</strong><br><br>No pages were scanned. Please verify the URL is correct and the site is publicly accessible, then try again."},qt=t=>{if(!t.results)return;let{pagesScanned:e,origin:n}=t.results,o=(e.length>0?e[0]:n).replace(/\/$/,"");V("target-website").forEach(s=>{s.textContent=o}),V("target-website-url").forEach(s=>{s instanceof HTMLAnchorElement?s.href=o:s.textContent=o})},Yt=t=>{let e=w.extractFullCompliance(t),n=a("compliance-score");if(n){let o=a("value",n);if(o){let r=Math.round(e.overallScore);o.textContent=`${r}%`;let i;r>=80?i=g["success-foreground"]:r>=50?i=g["warning-foreground"]:i=g["error-foreground"],o.style.color=i}}},Zt=t=>{let e=t.replace(/\/$/,"");V("target-website").forEach(r=>{r.textContent=e}),V("target-website-url").forEach(r=>{r instanceof HTMLAnchorElement?r.href=e:r.textContent=e})},Kt=t=>{let e=Math.floor(t/1e3);if(e<60)return`${e}s`;let n=Math.floor(e/60),o=e%60;return`${n}m ${o}s`},Xt=t=>new Date(t).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}),N=(t,e,n,o)=>{let r=a(t);if(!r)return;let i=a("value",r),s=a("text",r);i&&(i.textContent=e),s&&n&&(s.textContent=n),o&&(r.style.backgroundColor=g[o])},Qt=t=>{if(!t.results)return;let{scanDuration:e,pagesScanned:n,detectedItems:o,scannedAt:r}=t.results;N("scan-duration-card",Kt(e)),N("pages-scanned-card",n.length.toString()),N("items-detected-card",o.length.toString()),N("scan-date-card",Xt(r))},Jt=t=>{if(!t.results)return;let{detectedItems:e,trackersInfo:n,webflowAnalytics:o}=t.results,r=n?.trackers??[],i=o?.analytics==="never",s=x.affiliatedDOMResources(e,r).length;if(i){let p=x.affiliatedDOMResources(e,r).filter(b=>{let S=b;return te.test(S.source||"")||/intellimize\.co/i.test(S.domain||"")}).length;s-=p}let l=new Map;x.violatingTrackers(r).forEach(p=>{p.resources?.forEach(b=>{x.isGTMContainerTrackerResource(b)||l.set(b.id,p)})});let m=x.loadedStorageResources(e).filter(p=>i&&j.test(p.name)||!p.attributedTo||p.attributedTo.length===0?!1:p.attributedTo.some(b=>l.has(b))).length,h=w.extractFullCompliance(t).summary.failed,{cmpInstalled:f}=w.extractActionableItems(t);N("scripts-detected-card",s.toString(),void 0,s===0?"success":"error"),N("cookies-detected-card",m.toString(),void 0,m===0?"success":"warning"),N("action-items-card",h.toString(),"Violations",h===0?"success":"error"),en(!!f)},en=t=>{let e=a("cmp-status-card");if(!e)return;let n=a("icon",e),o=a("text",e),r=t?g["success-foreground"]:g["error-foreground"];n&&W(n,t?ie.compliant:ie.notCompliant,{color:r,size:24}),o&&(o.textContent=t?"CMP Detected":"CMP Not Found"),e.style.backgroundColor=t?g.success:g.error},tn=t=>{if(!t.results)return;let e=V("compliance-container");if(e.length===0)return;let n=w.extractFullCompliance(t),{summary:o}=n,r=o.failed,i=r===0?"compliant":"non-compliant",s=()=>{if(r===0)return"No compliance violations detected. Nice work!";let p=n.criteria.filter(b=>b.status==="fail").map(b=>b.name);return`Found ${r} issue${r>1?"s":""}: ${p.slice(0,3).join(", ")}${p.length>3?", ...":""}. Action needed.`},c={compliant:{label:"Compliant",message:s(),icon:ie.compliant,color:g.success,iconColor:g["success-foreground"]},"non-compliant":{label:"Not Compliant",message:s(),icon:ie.notCompliant,color:g.error,iconColor:g["error-foreground"]}}[i];e.forEach(p=>{p.setAttribute("fs-cloak",""),p.classList.add("hide")});let m=null;e.forEach(p=>{(i==="compliant"&&p.classList.contains("compliant")||i!=="compliant"&&!p.classList.contains("compliant"))&&(m=p)}),m||([m]=e),m.removeAttribute("fs-cloak"),m.classList.remove("hide");let d=a("compliance-status",m);if(d){let p=a("icon",d),b=a("text",d);p&&W(p,c.icon,{color:c.iconColor,size:30}),b&&(b.textContent=c.label)}let h=a("compliance-details",m);h&&(h.textContent=c.message);let f=a("violations-wrapper",m);if(f){let p=a("value",f);p&&(p.textContent=r.toString())}m.style.backgroundColor=c.color},nn=t=>{if(!t.results)return;let{trackersInfo:e}=t.results,n=a("violations-component"),o=a("violations-list"),r=a("violation-template");if(!o||!r)return;let i=x.violatingTrackers(e?.trackers??[]);if(n){let f=a("icon",n);f&&W(f,"alert-octagon",{color:g["error-foreground"],size:24})}Array.from(o.children).forEach(f=>{f!==r&&f.remove()}),r.style.display="none";let l=a("violations-list-empty");if(i.length===0){l&&(l.removeAttribute("fs-cloak"),l.classList.remove("hide")),o.setAttribute("fs-cloak",""),o.classList.add("hide");return}l&&(l.setAttribute("fs-cloak",""),l.classList.add("hide")),o.removeAttribute("fs-cloak"),o.classList.remove("hide");let c=e?.providers??[],m=new Map;c.forEach(f=>m.set(f.id,f.name));let d={analytics:"\u{1F4CA}",marketing:"\u{1F4E2}",advertising:"\u{1F4FA}",functional:"\u2699\uFE0F",uncategorized:"\u2753"},h=new Set;i.forEach(f=>{let b=m.get(f.providerId)||f.name||f.domain||f.providerId||"Unknown",S=`${f.category}-${b}`;if(h.has(S))return;h.add(S);let E=r.cloneNode(!0);E.removeAttribute("data-fs-cs"),E.style.display="";let B=a("icon",E);B&&W(B,"chevron-right",{color:g["error-foreground"],size:16});let T=a("text",E);if(T){let $=d[f.category]??"\u{1F534}",R=f.category||"uncategorized";T.textContent=`${$} ${b}: ${R} tracker running before consent`}o.appendChild(E)})},se=t=>{let e=t?.toLowerCase()||"uncategorized";return["uncategorized","unknown"].includes(e)?1:["marketing","advertising"].includes(e)?2:["analytics","performance"].includes(e)?3:["functional","personalization"].includes(e)?4:["essential","necessary","strictly-necessary","strictly_necessary"].includes(e)?5:1},on=t=>{if(!t.results)return;let{detectedItems:e,trackersInfo:n,webflowAnalytics:o}=t.results,r=n?.trackers??[],i=n?.providers??[],s=o?.analytics==="never",l=new Map;i.forEach(y=>l.set(y.id,y.name));let c=new Map;x.violatingTrackers(r).forEach(y=>{y.resources?.forEach(u=>{x.isGTMContainerTrackerResource(u)||c.set(u.id,y)})});let d=Ot(),h=x.allDOMElements(e).sort((y,u)=>se(y.category)-se(u.category)),f=y=>{if(y.type==="banner")return!1;let u=y;return q.test(u.domain||"")||q.test(u.source||"")},p=y=>{if(y.type==="banner")return!1;let u=y;return te.test(u.source||"")||/intellimize\.co/i.test(u.domain||"")},b=d?h:h.filter(y=>y.type==="banner"||s&&p(y)?!1:c.has(y.id)),E=(d?x.storageResources(e):x.loadedStorageResources(e).filter(y=>s&&j.test(y.name)?!1:c.has(y.id)?!0:y.attributedTo&&y.attributedTo.length>0?y.attributedTo.some(u=>c.has(u)):!1)).sort((y,u)=>se(y.category)-se(u.category)),B=a("scripts-component"),T=a("script-list"),$=a("script-item"),R=a("script-list-empty");if(T&&$){if(B){let u=a("scripts-title",B);u&&(u.textContent=`Detected DOM Resources (${b.length})`)}Array.from(T.children).forEach(u=>{u!==$&&u.remove()}),$.style.display="none",b.length===0?(R&&(R.removeAttribute("fs-cloak"),R.classList.remove("hide")),T.setAttribute("fs-cloak",""),T.classList.add("hide")):(R&&(R.setAttribute("fs-cloak",""),R.classList.add("hide")),T.removeAttribute("fs-cloak"),T.classList.remove("hide"),b.forEach(u=>{let k=$.cloneNode(!0);k.removeAttribute("data-fs-cs"),k.style.display="";let D=a("script-title",k),z=a("script-url",k),H=a("script-type",k),v=a("script-tag",k),_=u.type==="banner",K=c.get(u.id),qe=!!K,Se=f(u);if(Se?(k.style.backgroundColor="",k.style.borderColor="",k.style.borderWidth="",k.style.borderStyle=""):(!qe||_)&&(k.style.backgroundColor=g.neutral,k.style.borderColor=g["neutral-foreground"],k.style.borderWidth="1px",k.style.borderStyle="solid"),_){let U=u;D&&(D.textContent="Consent Banner"),z&&(z.textContent=U.element||"N/A"),H&&(H.textContent="banner"),v&&(v.textContent="Category: essential",v.classList.add("is-essential"),v.style.backgroundColor=g.success,v.style.color=g.white)}else{let U=u;if(D&&(D.textContent=`${U.domain||`Unknown ${U.type}`}`),z&&(z.textContent=U.source?.slice(0,100)||"N/A"),H&&(H.textContent=U.type||"N/A"),v){if(K){let Ye=l.get(K.providerId)||K.label||"Unknown";v.textContent=`Provider: ${Ye}`,v.style.display="",v.style.backgroundColor=g.neutral,v.style.color=g.white}else v.style.display="none";v.classList.remove("is-marketing","is-analytics","is-advertising","is-uncategorized"),Se&&(v.textContent="External Font",v.style.display="",v.style.backgroundColor=g.white,v.style.color=g.neutral)}}T.appendChild(k)}))}let Ie=a("cookies-component"),A=a("cookie-list"),Z=a("cookie-item"),O=a("cookie-list-empty");if(A&&Z){if(Ie){let u=a("cookies-title",Ie);u&&(u.textContent=`Cookies & Storage Data (${E.length})`)}Array.from(A.children).forEach(u=>{u!==Z&&u.remove()}),Z.style.display="none",E.length===0?(O&&(O.removeAttribute("fs-cloak"),O.classList.remove("hide")),A.setAttribute("fs-cloak",""),A.classList.add("hide")):(O&&(O.setAttribute("fs-cloak",""),O.classList.add("hide")),A.removeAttribute("fs-cloak"),A.classList.remove("hide"),E.forEach(u=>{let k=Z.cloneNode(!0);k.removeAttribute("data-fs-cs"),k.style.display="";let D=a("cookie-name",k),z=a("cookie-url",k),H=a("cookie-type",k),v=a("cookie-tag",k);if(D&&(D.textContent=`${u.name||`Unknown ${u.type}`}`),z&&(z.textContent=u.domain||"N/A"),H&&(H.textContent=u.type||"N/A"),v){let _=u.category||"uncategorized";v.textContent=_,v.classList.remove("is-marketing","is-analytics","is-advertising","is-uncategorized"),v.classList.add(`is-${_}`),_==="uncategorized"&&(v.style.backgroundColor=g.white,v.style.color=g.neutral)}A.appendChild(k)}))}},rn=t=>{let e=w.extractAttentionItems(t),n=a("attention-list"),o=a("attention-item"),r=a("attention-list-empty");if(!(!n||!o)){if(o.style.display="none",e.length===0){r&&(r.removeAttribute("fs-cloak"),r.classList.remove("hide")),n.setAttribute("fs-cloak",""),n.classList.add("hide");return}r&&(r.setAttribute("fs-cloak",""),r.classList.add("hide")),n.removeAttribute("fs-cloak"),n.classList.remove("hide"),e.forEach((i,s)=>{let l=o.cloneNode(!0);l.removeAttribute("data-fs-cs"),l.style.display="";let c=a("value",l);c&&(c.textContent=(s+1).toString());let m=a("text",l);m&&(m.textContent=i),n.appendChild(l)})}},sn=t=>{let e=w.extractComplianceSummary(t),n=a("passed-items");if(n){let i=a("value",n);i&&(i.textContent=e.pass.toString())}let o=a("failed-items");if(o){let i=a("value",o);i&&(i.textContent=e.fail.toString())}let r=a("unverified-items");if(r){let i=a("value",r);i&&(i.textContent=e.unverified.toString())}},an=t=>{let e=w.extractFullCompliance(t),n=a("criteria-list"),o=a("criteria-item");if(!n||!o)return;Array.from(n.children).forEach(s=>{s!==o&&s.remove()}),o.style.display="none",e.criteria.filter(s=>s.status!=="not-verifiable").forEach(s=>{let l=o.cloneNode(!0);l.removeAttribute("data-fs-cs"),l.style.display="";let c=Ge[s.status]||Ge["not-verifiable"],m=a("icon",l);m&&W(m,c.icon,{color:c.color,size:24});let d=a("criteria-title",l),h=a("criteria-description",l);d&&(d.textContent=s.name),h&&(h.textContent=s.description);let f=a("criteria-status",l);f&&(f.textContent=c.label);let p=a("criteria-answer",l);p&&(p.textContent=s.details||"No additional details available."),n.appendChild(l)})},cn=t=>{let e=w.extractStatistics(t),n=a("stat-duration");if(n){let c=a("value",n);c&&(c.textContent=e.scanDuration)}let o=a("stat-resources");if(o){let c=a("value",o);c&&(c.textContent=e.resourcesCount.toString())}let r=a("stat-storage");if(r){let c=a("value",r);c&&(c.textContent=e.storageCount.toString())}let i=a("stat-first-party");if(i){let c=a("value",i);c&&(c.textContent=e.firstParty.toString())}let s=a("stat-third-party");if(s){let c=a("value",s);c&&(c.textContent=e.thirdParty.toString())}let l=a("stat-categories");if(l){let c=a("value",l);c&&(c.textContent=e.categories.toString())}},ln=[{name:"websiteInfo",updater:qt},{name:"complianceScore",updater:Yt,requiredElements:["compliance-score"]},{name:"primaryStats",updater:Qt},{name:"secondaryStats",updater:Jt},{name:"complianceContainer",updater:tn,requiredElements:["compliance-container"]},{name:"violationsList",updater:nn,requiredElements:["violations-list"]},{name:"detectedItems",updater:on},{name:"attentionItems",updater:rn,requiredElements:["attention-list"]},{name:"complianceSummary",updater:sn},{name:"complianceCriteria",updater:an,requiredElements:["criteria-list"]},{name:"statistics",updater:cn}],mn=t=>{ln.forEach(({name:e,updater:n,requiredElements:o})=>{try{if(o&&o.find(i=>!a(i)))return;n(t)}catch(r){console.error(`[Results] Error in updater "${e}":`,r)}}),me()},dn=()=>{let t=a("share-btn");if(!t)return;let e=document.createElement("span");e.textContent="Click to copy share url",e.style.cssText=`
2
2
  position: absolute;
3
3
  bottom: 100%;
4
4
  left: 50%;
@@ -15,4 +15,4 @@
15
15
  pointer-events: none;
16
16
  margin-bottom: 8px;
17
17
  z-index: 1000;
18
- `;let n=t;getComputedStyle(n).position==="static"&&(n.style.position="relative"),n.appendChild(e),n.addEventListener("mouseenter",()=>{e.style.opacity="1",e.style.visibility="visible"}),n.addEventListener("mouseleave",()=>{e.style.opacity="0",e.style.visibility="hidden",setTimeout(()=>{e.textContent="Click to copy share url"},200)}),n.addEventListener("click",async()=>{try{await navigator.clipboard.writeText(window.location.href),e.textContent="Copied!"}catch{let r=document.createElement("textarea");r.value=window.location.href,r.style.position="fixed",r.style.left="-9999px",document.body.appendChild(r),r.select(),document.execCommand("copy"),document.body.removeChild(r),e.textContent="Copied!"}})},un=async()=>{let t=_t();if(!t){console.error("[Results] Cannot fetch results without tracking ID");return}let e;try{new URL(t.site),e=t.site}catch{e=`https://${t.site}`}Zt(e);try{await Vt(t.trackingId);let n=await Bt(t.trackingId),o=Gt(n);if(o){ae(o);return}mn(n),Wt()}catch(n){console.error("[Results] Error during scan:",n);let o="An error occurred. Please try again.";n instanceof A&&n.response&&typeof n.response=="object"&&"error"in n.response?o=n.response.error:n instanceof Error&&(o=n.message),ae(o)}};window.Webflow||(window.Webflow=[]);window.Webflow.push(()=>{dn(),un()});})();
18
+ `;let n=t;getComputedStyle(n).position==="static"&&(n.style.position="relative"),n.appendChild(e),n.addEventListener("mouseenter",()=>{e.style.opacity="1",e.style.visibility="visible"}),n.addEventListener("mouseleave",()=>{e.style.opacity="0",e.style.visibility="hidden",setTimeout(()=>{e.textContent="Click to copy share url"},200)}),n.addEventListener("click",async()=>{try{await navigator.clipboard.writeText(window.location.href),e.textContent="Copied!"}catch{let r=document.createElement("textarea");r.value=window.location.href,r.style.position="fixed",r.style.left="-9999px",document.body.appendChild(r),r.select(),document.execCommand("copy"),document.body.removeChild(r),e.textContent="Copied!"}})},un=async()=>{let t=_t();if(!t){console.error("[Results] Cannot fetch results without tracking ID");return}let e;try{new URL(t.site),e=t.site}catch{e=`https://${t.site}`}Zt(e);try{await Vt(t.trackingId);let n=await Bt(t.trackingId),o=Gt(n);if(o){ae(o);return}mn(n),Wt()}catch(n){console.error("[Results] Error during scan:",n);let o="An error occurred. Please try again.";n instanceof P&&n.response&&typeof n.response=="object"&&"error"in n.response?o=n.response.error:n instanceof Error&&(o=n.message),ae(o)}};window.Webflow||(window.Webflow=[]);window.Webflow.push(()=>{dn(),un()});})();
package/dist/scan.js CHANGED
@@ -1 +1 @@
1
- "use strict";(()=>{var b=Object.defineProperty;var E=(t,e,n)=>e in t?b(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var m=(t,e,n)=>E(t,typeof e!="symbol"?e+"":e,n);var v=localStorage.getItem("cs-dev")==="true",a=v?"https://fs-consentpro-api-dev.finsweet.workers.dev":"https://api.consentpro.com",Q=1440*60*1e3;var C="data-fs-cs";var i=(t,e=document)=>e.querySelector(`[${C}="${t}"]`);var y=t=>{let e=t.trim();if(!e||!/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//.test(e)&&e.includes("@"))return null;try{let o=p(e),r=new URL(o);return r.protocol!=="http:"&&r.protocol!=="https:"||!r.hostname||!r.hostname.includes(".")?null:r}catch{return null}};var k={"X-Finsweet-ConsentPro-Version":"v2"},h={"X-Finsweet-ConsentPro-Version":"v2","Content-Type":"application/json"},s=class extends Error{constructor(n,o,r){super(n);m(this,"status");m(this,"response");this.name="ScannerApiError",this.status=o,this.response=r}};async function c(t){if(!t.ok){let e=t.statusText,n;try{let o=await t.json();n=o,o&&typeof o.error=="string"&&(e=o.error)}catch{n=await t.text().catch(()=>"Unknown error")}throw new s(`Report request failed: ${e}`,t.status,n)}return t.json()}var d={async startScan(t){let e=await fetch(`${a}/v2/scanner/public/scan`,{method:"POST",headers:h,body:JSON.stringify({url:t,acceptAll:!1})});if(e.status===409){let o=await e.json().catch(()=>({}));throw new s("A scan is already in progress for this website. Please wait for it to complete.",409,o)}if(e.status!==201){let o=await e.text().catch(()=>"Unknown error");throw new s(`Expected 201 Created but got ${e.status}`,e.status,o)}return await c(e)},async getStatus(t){let e=await fetch(`${a}/v2/scanner/public/status/${t}`,{headers:k});return await c(e)},async getResults(t){let e=await fetch(`${a}/v2/scanner/public/results/${t}`,{headers:k});return await c(e)},async cancelScan(t){let e=await fetch(`${a}/v2/scanner/public/scan/${t}`,{method:"DELETE",headers:h});return await c(e)}},p=t=>{let e=t.trim();return!e.startsWith("http://")&&!e.startsWith("https://")&&(e="https://"+e),e};var S="[Scan]",T="Please enter a valid URL (e.g. https://example.com).",R="Failed to start scan. Please try again.",I="/result",w=()=>{let t=i("scan-form"),e=i("scan-url-input"),n=i("scan-submit"),o=i("form-error"),r=i("form-error-text");return!t||!e||!n||!o||!r?(console.error(`${S} Missing elements:`,{form:!!t,urlInput:!!e,submitButton:!!n,errorDiv:!!o,errorText:!!r}),null):{form:t,urlInput:e,submitButton:n,errorDiv:o,errorText:r}},f=(t,e)=>{t.errorText.innerHTML=e,t.errorDiv.style.display="flex"},D=t=>{t.errorDiv.style.display="none",t.errorText.innerHTML=""},M=(t,e)=>{let n=t.value.trim();if(!n)return f(e,T),null;let o=y(n);return o||(f(e,T),null)},L=t=>{let e=t.dataset.wait;e&&(t.value=e)},A=(t,e)=>{t.value=e,t.disabled=!1},u=t=>`${t.origin}${t.pathname}`,H=async(t,e,n)=>{try{let o=await d.startScan(u(t));if(!o.trackingId)throw new Error("No tracking ID returned");let r=new URL(I,window.location.origin);r.searchParams.set("trid",o.trackingId),r.searchParams.set("site",u(t)),window.location.href=r.href}catch(o){if(console.error(`${S} Scan failed:`,o),o instanceof s&&o.status===409){let g=o.response?.trackingId;if(g){let l=new URL(I,window.location.origin);l.searchParams.set("trid",g),l.searchParams.set("site",u(t)),window.location.href=l.href;return}}let r=o instanceof s?`Scan failed: ${o.message}`:R;f(e,r),A(e.submitButton,n)}},z=async(t,e)=>{t.preventDefault(),t.stopPropagation(),D(e);let n=M(e.urlInput,e);if(!n)return;e.urlInput.value=n.href;let o=e.submitButton.value||"Scan";L(e.submitButton),e.submitButton.disabled=!0,await H(n,e,o)},P=()=>{let t=w();t&&t.form.addEventListener("submit",e=>z(e,t),{capture:!0})};window.Webflow||(window.Webflow=[]);window.Webflow.push(P);})();
1
+ "use strict";(()=>{var b=Object.defineProperty;var E=(t,e,n)=>e in t?b(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var m=(t,e,n)=>E(t,typeof e!="symbol"?e+"":e,n);var v=localStorage.getItem("cs-dev")==="true",a=v?"https://fs-consentpro-api-dev.finsweet.workers.dev":"https://api.consentpro.com",Q=1440*60*1e3;var R="data-fs-cs";var i=(t,e=document)=>e.querySelector(`[${R}="${t}"]`);var y=t=>{let e=t.trim();if(!e||!/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//.test(e)&&e.includes("@"))return null;try{let o=p(e),r=new URL(o);return r.protocol!=="http:"&&r.protocol!=="https:"||!r.hostname||!r.hostname.includes(".")?null:r}catch{return null}};var k={},h={"Content-Type":"application/json"},s=class extends Error{constructor(n,o,r){super(n);m(this,"status");m(this,"response");this.name="ScannerApiError",this.status=o,this.response=r}};async function c(t){if(!t.ok){let e=t.statusText,n;try{let o=await t.json();n=o,o&&typeof o.error=="string"&&(e=o.error)}catch{n=await t.text().catch(()=>"Unknown error")}throw new s(`Report request failed: ${e}`,t.status,n)}return t.json()}var d={async startScan(t){let e=await fetch(`${a}/v2/scanner/public/scan`,{method:"POST",headers:h,body:JSON.stringify({url:t,acceptAll:!1})});if(e.status===409){let o={};try{o=await e.json()}catch{}throw new s(o.error||"A scan is already in progress for this website. Please wait for it to complete.",409,o)}return e.ok?await e.json():c(e)},async getStatus(t){let e=await fetch(`${a}/v2/scanner/public/status/${t}`,{headers:k});return await c(e)},async getResults(t){let e=await fetch(`${a}/v2/scanner/public/results/${t}`,{headers:k});return await c(e)},async cancelScan(t){let e=await fetch(`${a}/v2/scanner/public/scan/${t}`,{method:"DELETE",headers:h});return await c(e)}},p=t=>{let e=t.trim();return!e.startsWith("http://")&&!e.startsWith("https://")&&(e="https://"+e),e};var S="[Scan]",T="Please enter a valid URL (e.g. https://example.com).",C="Failed to start scan. Please try again.",I="/result",w=()=>{let t=i("scan-form"),e=i("scan-url-input"),n=i("scan-submit"),o=i("form-error"),r=i("form-error-text");return!t||!e||!n||!o||!r?(console.error(`${S} Missing elements:`,{form:!!t,urlInput:!!e,submitButton:!!n,errorDiv:!!o,errorText:!!r}),null):{form:t,urlInput:e,submitButton:n,errorDiv:o,errorText:r}},f=(t,e)=>{t.errorText.innerHTML=e,t.errorDiv.style.display="flex"},D=t=>{t.errorDiv.style.display="none",t.errorText.innerHTML=""},M=(t,e)=>{let n=t.value.trim();if(!n)return f(e,T),null;let o=y(n);return o||(f(e,T),null)},L=t=>{let e=t.dataset.wait;e&&(t.value=e)},A=(t,e)=>{t.value=e,t.disabled=!1},u=t=>`${t.origin}${t.pathname}`,H=async(t,e,n)=>{try{let o=await d.startScan(u(t));if(!o.trackingId)throw new Error("No tracking ID returned");let r=new URL(I,window.location.origin);r.searchParams.set("trid",o.trackingId),r.searchParams.set("site",u(t)),window.location.href=r.href}catch(o){if(console.error(`${S} Scan failed:`,o),o instanceof s&&o.status===409){let g=o.response?.trackingId;if(g){let l=new URL(I,window.location.origin);l.searchParams.set("trid",g),l.searchParams.set("site",u(t)),window.location.href=l.href;return}}let r=o instanceof s?`Scan failed: ${o.message}`:C;f(e,r),A(e.submitButton,n)}},z=async(t,e)=>{t.preventDefault(),t.stopPropagation(),D(e);let n=M(e.urlInput,e);if(!n)return;e.urlInput.value=n.href;let o=e.submitButton.value||"Scan";L(e.submitButton),e.submitButton.disabled=!0,await H(n,e,o)},P=()=>{let t=w();t&&t.form.addEventListener("submit",e=>z(e,t),{capture:!0})};window.Webflow||(window.Webflow=[]);window.Webflow.push(P);})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finsweet/consentpro-scan",
3
- "version": "1.0.25",
3
+ "version": "1.0.26",
4
4
  "description": "A frontend scanner for ConsentPro, a cookie consent management platform by Finsweet.",
5
5
  "homepage": "https://github.com/finsweet/consentpro-scan#readme",
6
6
  "license": "ISC",