1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="04418061-ed40-41f9-82f7-f391632e3984",e._sentryDebugIdIdentifier="sentry-dbid-04418061-ed40-41f9-82f7-f391632e3984")}()}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4010],{38216:function(e,t,n){n.d(t,{w:function(){return a}});var r=n(57437);function a(){return(0,r.jsx)("div",{className:"flex items-center justify-center h-screen",children:(0,r.jsx)("div",{className:"ping"})})}},84671:function(e,t,n){n.d(t,{l:function(){return o}}),n(57437),n(2265),n(92595),n(46393),n(81973),n(38216);var r=JSON.parse('{"products":{"starter":{"name":"Starter","description":"Kostenloser Basis-Plan","features":["Autom. KI-Korrekturen","Autom. BFSG-Erkl\xe4rung","accessibleAI Widget","PDF-Accessibility-Reports","E-Mail Support"],"stripeIds":{"test":{"productId":"prod_SdYgyaRN78Wuil","priceIds":{"monthly":"price_1RjEXY4MRuKPY9kCGHuWQQF4"}},"live":{"productId":"prod_SeZLYrrD5dbXyg","priceIds":{"monthly":"price_1RjGCxG84vurRrHgmCuvUDZd"}}},"prices":{"monthly":{"amount":0,"currency":"EUR","interval":"month","trialDays":0}},"fairUsagePolicy":{"maxPages":10}},"pro":{"name":"Pro","description":"F\xfcr B2C-Shops & Websites, die eine L\xf6sung suchen um ihre Barrierefreiheit f\xfcr das \xa7BFSG zu optimieren.","features":["Autom. KI-Korrekturen","Autom. BFSG-Erkl\xe4rung","accessibleAI Widget","PDF-Accessibility-Reports","E-Mail Support","Keine Einrichtungskosten"],"popular":true,"stripeIds":{"test":{"productId":"prod_SdaBVjIVFcAl1G","priceIds":{"monthly":"price_1RiJ1A4MRuKPY9kCs5lIf5cx","yearly":"price_1RiJUn4MRuKPY9kCYWwVK6wz"}},"live":{"productId":"prod_SeZLXRWSO1Gcp0","priceIds":{"monthly":"price_1RjGCtG84vurRrHg1foh4xEH","yearly":"price_1RjGCtG84vurRrHg80yF2voZ"}}},"prices":{"monthly":{"amount":4900,"currency":"EUR","interval":"month","trialDays":14},"yearly":{"amount":49000,"currency":"EUR","interval":"year","trialDays":14,"discount":0.15,"savings":"2 Monate gratis"}},"fairUsagePolicy":{"maxPages":100}},"team":{"name":"Team","description":"F\xfcr Mittelstand, gro\xdfe Shops und Agenturen, die nach einer Compliance-L\xf6sung f\xfcr ihre Barrierefreiheits-Optimierung suchen.","features":["Autom. KI-Korrekturen","Autom. BFSG-Erkl\xe4rung","Anpassbares Widget","PDF-Compliance-Report","Leichte Sprache / Einfache Sprache","\xdcbersetzungen in die wichtigsten Europ\xe4ischen Sprachen"],"comingSoon":true,"stripeIds":{"test":{"productId":"prod_SdaYXMfwSnQKKq","priceIds":{"monthly":"price_1RicLE4MRuKPY9kCFTSj1P9K","yearly":"price_1RicLW4MRuKPY9kC9BZczCdX"}},"live":{"productId":"prod_SeZL0eeTQ5ROU9","priceIds":{"monthly":"price_1RjGCoG84vurRrHgiJdVcUBY","yearly":"price_1RjGCnG84vurRrHgSZUWXMtm"}}},"prices":{"monthly":{"amount":8900,"currency":"EUR","interval":"month","trialDays":14},"yearly":{"amount":89000,"currency":"EUR","interval":"year","trialDays":14,"discount":0.15,"savings":"2 Monate gratis"}},"fairUsagePolicy":{"maxPages":250}}}}'),a=n(56615);n(40257),n(70878);let o=function(){let{products:e}=r,t=[],n=function(){{let e="localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname?"test":"live";return a.k.log("\uD83D\uDD0D [Stripe Environment] Client-side detected: ".concat(e," (hostname: ").concat(window.location.hostname,")")),e}}();if(e.starter){let r=e.starter,a=r.stripeIds.test.priceIds.monthly,o=r.stripeIds.live.priceIds.monthly,i="live"===n?o:a,l="live"===n?r.stripeIds.live.productId:r.stripeIds.test.productId;t.push({id:l,name:r.name,monthlyPriceDisplay:"0",yearlyPriceDisplay:"0",stripeMonthlyPriceId:i||"price_starter_monthly",stripeYearlyPriceId:i||"price_starter_monthly",monthlyFrequency:"/ Monat",yearlyFrequency:"/ Jahr",features:r.features,highlight:!1,target:r.description,allProductIds:[r.stripeIds.test.productId,r.stripeIds.live.productId],allPriceIds:{monthly:[a,o].filter(Boolean),yearly:[a,o].filter(Boolean)}})}if(e.pro){let r=e.pro,a=r.prices.monthly.amount/100,o=r.prices.yearly.amount/100,i="live"===n?r.stripeIds.live:r.stripeIds.test,l=r.stripeIds.test,s=r.stripeIds.live;t.push({id:i.productId,name:r.name,monthlyPriceDisplay:a.toString(),yearlyPriceDisplay:o.toString(),stripeMonthlyPriceId:i.priceIds.monthly,stripeYearlyPriceId:i.priceIds.yearly,monthlyFrequency:"/ Monat",yearlyFrequency:"/ Jahr",billingNoteMonthly:null,billingNoteYearly:r.prices.yearly.savings?"(entspricht ".concat(r.prices.yearly.savings,")"):null,features:r.features,highlight:r.popular||!1,comingSoon:!1,target:r.description,allProductIds:[l.productId,s.productId],allPriceIds:{monthly:[l.priceIds.monthly,s.priceIds.monthly],yearly:[l.priceIds.yearly,s.priceIds.yearly]}})}if(e.team){let r=e.team,a=r.prices.monthly.amount/100,o=r.prices.yearly.amount/100,i="live"===n?r.stripeIds.live:r.stripeIds.test,l=r.stripeIds.test,s=r.stripeIds.live;t.push({id:i.productId,name:r.name,monthlyPriceDisplay:a.toString(),yearlyPriceDisplay:o.toString(),stripeMonthlyPriceId:i.priceIds.monthly,stripeYearlyPriceId:i.priceIds.yearly,monthlyFrequency:"/ Monat",yearlyFrequency:"/ Jahr",billingNoteMonthly:null,billingNoteYearly:r.prices.yearly.savings?"(entspricht ".concat(r.prices.yearly.savings,")"):null,features:r.features,highlight:!1,comingSoon:r.comingSoon||!1,target:r.description,allProductIds:[l.productId,s.productId],allPriceIds:{monthly:[l.priceIds.monthly,s.priceIds.monthly],yearly:[l.priceIds.yearly,s.priceIds.yearly]}})}return a.k.log("â
[Stripe Config] Loaded ".concat(t.length," pricing plans for ").concat(n," environment")),t}()},81973:function(e,t,n){n.d(t,{I:function(){return i}});var r=n(57437),a=n(2265),o=n(94508);let i=a.forwardRef((e,t)=>
1{let{className:n,type:a,...i}=e;return(0,r.jsx)("input",{type:a,className:(0,o.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",n),ref:t,...i})});i.displayName="Input"},46393:function(e,t,n){n.d(t,{_:function(){return u}});var r=n(57437),a=n(2265),o=n(6394),i=n(90535),l=n(94508);let s=(0,i.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),u=a.forwardRef((e,t)=>{let{className:n,...a}=e;return(0,r.jsx)(o.f,{ref:t,className:(0,l.cn)(s(),n),...a})});u.displayName=o.f.displayName},70836:function(e,t,n){n.d(t,{d:function(){return o}});var r=n(11713);async function a(){let e=await fetch("/api/public/pricing-dynamic");if(!e.ok)throw Error("HTTP ".concat(e.status,": ").concat(e.statusText));let t=await e.json();if(!Array.isArray(t))throw Error("Invalid response format: expected array of plans");return t}function o(){var e;let{data:t=[],isLoading:n,error:o,refetch:i}=(0,r.a)({queryKey:["pricing-plans"],queryFn:a,staleTime:3e5,gcTime:18e5});return{plans:t,isLoading:n,error:null!==(e=null==o?void 0:o.message)&&void 0!==e?e:null,refetch:i}}},50382:function(e,t,n){n.d(t,{l:function(){return m}});var r=n(57437),a=n(2265),o=n(99376),i=n(56615);class l{initStorageListener(){window.addEventListener("storage",e=>{if(e.key===this.storageKey&&e.newValue)try{let t=JSON.parse(e.newValue);this.listeners.forEach(e=>e(t))}catch(e){i.k.error("Error parsing tab sync data:",e)}})}updateState(e){let t={...e,timestamp:Date.now()};try{localStorage.setItem(this.storageKey,JSON.stringify(t))}catch(e){i.k.error("Error updating tab sync state:",e)}}getState(){try{let e=localStorage.getItem(this.storageKey);if(!e)return null;let t=JSON.parse(e);if(Date.now()-t.timestamp>6e5)return this.cleanup(),null;return t}catch(e){return i.k.error("Error getting tab sync state:",e),null}}onStateChange(e){return this.listeners.add(e),()=>this.listeners.delete(e)}cleanup(){try{localStorage.removeItem(this.storageKey)}catch(e){i.k.error("Error cleaning up tab sync:",e)}this.listeners.clear()}constructor(e){this.listeners=new Set,this.storageKey="polling-state-".concat(e),this.initStorageListener()}}let s={POLLING_INTERVAL:1e4,MAX_POLLING_TIME:18e5,MAX_RETRIES:3};var u=n(39537),c=n(2563),d=n(85812),g=n(7710),p=n(84042);let m=e=>{let{analytics:t,logContext:m="QuickTestFlow"}=e,h=(0,o.useSearchParams)(),[f,y]=(0,a.useState)("initial"),[k,S]=(0,a.useState)(""),[v,w]=(0,a.useState)(null),[I,D]=(0,a.useState)(null),[b,P]=(0,a.useState)(null),[E,C]=(0,a.useState)(!1),[x,Q]=(0,a.useState)(!1),[T,_]=(0,a.useState)(!1),[A,R]=(0,a.useState)(null),[N,j]=(0,a.useState)(!1),[L,F]=(0,a.useState)("teaser"),[O,M]=(0,a.useState)(null),[B,G]=(0,a.useState)(!1),{isAuthenticated:U,user:q}=(0,c.Ii)(),{handlePostLoginNavigation:K}=(0,u.HJ)(),W=(0,a.useRef)(null);W.current=v,(0,a.useEffect)(()=>{let e=(0,p.hL)();F(e),i.k.log("[".concat(m,"] Feature flag check - resultsPageVariant:"),e)},[m]);let{status:J,taskId:Y,queueData:z,error:V,progress:H,estimatedDuration:X,userMessage:Z,startPolling:$,stopPolling:ee,clearStatus:et}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[t,n]=(0,a.useState)("idle"),[r,o]=(0,a.useState)(null),[u,c]=(0,a.useState)(null),[d,g]=(0,a.useState)(null),p=(0,a.useRef)(null),m=(0,a.useRef)(0),h=(0,a.useRef)(0),f=(0,a.useRef)(!1),y=(0,a.useRef)("idle"),k=(0,a.useRef)(null),S=(0,a.useRef)(null);(0,a.useEffect)(()=>{y.current=t},[t]);let v=(0,a.useCallback)(e=>(k.current&&S.current===e||(k.current&&k.current.cleanup(),k.current=new l(e),S.current=e,i.k.log("[QueueStatusPolling] Created new TabSynchronization for task:",e)),k.current),[]),w=(0,a.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=y.current;i.k.log("[QueueStatusPolling] Running cleanup...",{forceStop:e,currentStatus:t}),p.current?e||"completed"===t||"error"===t?(clearInterval(p.current),p.current=null,i.k.log("[QueueStatusPolling] Cleared polling interval"),f.current=!1,i.k.log("[QueueStatusPolling] Set polling inactive (stopped polling)")):i.k.log("[QueueStatusPolling] \uD83D\uDEE1ï¸ PROTECTION: Keeping polling interval active during background analysis"):e||"completed"===t||"error"===t?(f.current=!1,i.k.log("[QueueStatusPolling] Set polling inactive (no interval, but force stop/completion)")):i.k.log("[QueueStatusPolling] \uD83D\uDEE1ï¸ PROTECTION: Keeping isActive=true, no interval to clear")},[]),I=(0,a.useCallback)(e=>{let t=new Date,n=new Date(e).getTime()-t.getTime();if(n<=0)return"0 Sekunden";let r=Math.ceil(n/1e3);if(r<60)return"".concat(r," Sekunden");if(r<3600){let e=Math.ceil(r/60);return"".concat(e," ").concat(1===e?"Minute":"Minuten")}return"".concat(Math.floor(r/3600),":").concat(Math.ceil(r%3600/60).toString().padStart(2,"0")," Stunden")},[]),D=(0,a.useCallback)(e=>{let{chunks_queued:t,chunks_processing:n,chunks_completed:r,total_chunks:a,estimated_completion:o}=e;if(n>0){let e=I(o);return"Analysiere Ihre Website... noch ca. ".concat(e)}return"Ihre Analyse wird vorbereitet..."},[I]),b=(0,a.useCallback)(async t=>{try{i.k.log("[QueueStatusPolling] Polling queue status for task: ".concat(t));let r=await fetch("/api/quick-analysis/queue-status?taskId=".concat(encodeURIComponent(t)));if(!r.ok){if(404===r.status)return i.k.log("[QueueStatusPolling] 404 - Task not found, stopping polling: ".concat(t)),n("error"),g("Task nicht gefunden oder abgelaufen"),w(),{isCompleted:!0};if(500===r.status)try{let e=await r.json();if(!1===e.retryable){let r="Server-Fehler: ".concat(e.error||"Unbekannter Fehler");return i.k.log("[QueueStatusPolling] 500 with retryable:false - Stopping polling: ".concat(t),e),n("error"),g(r),w(),{isCompleted:!0}}}catch(e){i.k.log("[QueueStatusPolling] Could not parse 500 error response, treating as retryable")}throw Error("HTTP ".concat(r.status,": ").concat(r.statusText))}let a=await r.json();i.k.log("[QueueStatusPolling] Queue status response:",a),c(a);let{chunks_queued:o,chunks_processing:l,chunks_completed:s,total_chunks:u}=a;if(s===u&&u>0||a.is_task_complete){i.k.log("[QueueStatusPolling] â
All chunks completed!"),i.k.log("[QueueStatusPolling] \uD83D\uDD27 DEBUG: Test log immediately after...");try{i.k.log("[QueueStatusPolling] \uD83D\uDCCA Completion data:",{chunks_completed:s,total_chunks:u,task_status:(null==a?void 0:a.task_status)||"undefined",is_task_complete:(null==a?void 0:a.is_task_complete)||"undefined"})}catch(e){i.k.error("[QueueStatusPolling] â Error logging completion data:",e)}i.k.log("[QueueStatusPolling] \uD83D\uDD27 DEBUG: About to call setStatus completed..."),n("completed"),i.k.log("[QueueStatusPolling] \uD83D\uDD27 DEBUG: setStatus completed called successfully!"),f.current=!1,i.k.log("[QueueStatusPolling] \uD83D\uDD04 Analysis completed - setting isActive=false"),i.k.log("[QueueStatusPolling] \uD83D\uDCE7 Starting background email notifications..."),setTimeout(async()=>
1{try{i.k.log("[QueueStatusPolling] \uD83D\uDCE7 [Background] Triggering email notifications for task:",t);let e=await fetch("/api/quick-analysis/send-completion-email",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:t,analysisData:a})});if(e.ok){let t=await e.json();i.k.log("[QueueStatusPolling] â
[Background] Email notifications sent successfully:",t)}else{let t=await e.text();i.k.warn("[QueueStatusPolling] â ï¸ [Background] Email notification failed:",{status:e.status,statusText:e.statusText,error:t})}}catch(e){i.k.error("[QueueStatusPolling] â [Background] Email notification error:",e)}},0),i.k.log("[QueueStatusPolling] \uD83D\uDCF8 Starting background screenshot capture..."),setTimeout(async()=>{try{i.k.log("[QueueStatusPolling] \uD83D\uDCF8 [Background] Triggering screenshot capture for task:",t);let e=await fetch("/api/analysis/capture-screenshot",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:t})});if(e.ok){let t=await e.json();i.k.log("[QueueStatusPolling] â
[Background] Screenshot captured successfully:",t)}else{let t=await e.text();i.k.warn("[QueueStatusPolling] â ï¸ [Background] Screenshot capture failed:",{status:e.status,statusText:e.statusText,error:t})}}catch(e){i.k.error("[QueueStatusPolling] â [Background] Screenshot capture error:",e)}},0),v(t).updateState({status:"completed",results:a}),i.k.log("[QueueStatusPolling] \uD83D\uDD27 DEBUG: About to call onComplete handler directly..."),i.k.log("[QueueStatusPolling] \uD83D\uDD27 DEBUG: onComplete handler exists?",!!e.onComplete);try{e.onComplete?(i.k.log("[QueueStatusPolling] \uD83D\uDE80 Calling onComplete handler with taskId:",t),e.onComplete(t),i.k.log("[QueueStatusPolling] â
onComplete handler called successfully")):i.k.warn("[QueueStatusPolling] â ï¸ No onComplete handler provided")}catch(e){i.k.error("[QueueStatusPolling] â onComplete handler failed:",e),i.k.error("[QueueStatusPolling] â Error stack:",e instanceof Error?e.stack:"No stack")}return{isCompleted:!0,data:a}}return l>0||s>0?(n("processing"),f.current=!0,i.k.log("[QueueStatusPolling] \uD83D\uDD04 Status: processing, ensuring isActive=true")):o>0&&(n("queued"),f.current=!0,i.k.log("[QueueStatusPolling] \uD83D\uDD04 Status: queued, ensuring isActive=true")),i.k.log("[QueueStatusPolling] Queue processing continues..."),{isCompleted:!1}}catch(e){throw i.k.error("[QueueStatusPolling] Poll error:",e),e}},[v,w,e]),P=(0,a.useCallback)(async t=>{i.k.log("[QueueStatusPolling] \uD83D\uDE80 Starting queue polling for task ".concat(t));let r=y.current;if(S.current===t&&f.current&&("queued"===r||"processing"===r)){i.k.log("[QueueStatusPolling] \uD83D\uDEE1ï¸ PROTECTION: Already polling task ".concat(t," - not starting duplicate polling"));return}i.k.log("[QueueStatusPolling] Stopping any previous polling before starting new one..."),w(!0),o(t),n("queued"),g(null),c(null),m.current=0,h.current=Date.now(),f.current=!0,i.k.log("[QueueStatusPolling] State reset complete, status set to 'queued', isActive set to true"),v(t).updateState({status:"queued"});try{i.k.log("[QueueStatusPolling] Checking immediately for queue status...");let{isCompleted:n,data:r}=await b(t);if(n&&r){var a;i.k.log("[QueueStatusPolling] \uD83C\uDF89 Task already completed - finishing immediately"),null===(a=e.onComplete)||void 0===a||a.call(e,t),w(!0);return}i.k.log("[QueueStatusPolling] Task not completed yet - starting regular polling")}catch(e){i.k.log("[QueueStatusPolling] Initial check failed:",e)}let l=async()=>{var r,a,o;let l=y.current;if(i.k.log("[QueueStatusPolling] \uD83D\uDD04 Poll function called - isActive: ".concat(f.current,", status: ").concat(l)),!f.current){i.k.log("[QueueStatusPolling] Polling not active, skipping poll");return}let u=Date.now()-h.current;if(i.k.log("[QueueStatusPolling] â±ï¸ Elapsed time: ".concat(Math.round(u/1e3),"s / ").concat(Math.round(s.MAX_POLLING_TIME/1e3),"s")),u>s.MAX_POLLING_TIME){let a="Timeout nach 30 Minuten erreicht";i.k.log("[QueueStatusPolling] â° Timeout reached: ".concat(a)),n("error"),g(a),w(!0),v(t).updateState({status:"error",error:a}),null===(r=e.onError)||void 0===r||r.call(e,a);return}try{i.k.log("[QueueStatusPolling] \uD83D\uDCE1 Starting pollQueueStatus call for task: ".concat(t));let{isCompleted:n,data:r}=await b(t),o=y.current;i.k.log("[QueueStatusPolling] \uD83D\uDCE1 pollQueueStatus result - isCompleted: ".concat(n,", hasData: ").concat(!!r,", currentStatus: ").concat(o,", isActive: ").concat(f.current)),n&&r?(i.k.log("[QueueStatusPolling] \uD83C\uDF89 Queue polling completed!"),null===(a=e.onComplete)||void 0===a||a.call(e,t),w(!0)):i.k.log("[QueueStatusPolling] â³ Task not completed yet, continuing polling... (status: ".concat(o,", isActive: ").concat(f.current,")"))}catch(r){if(m.current++,i.k.error("[QueueStatusPolling] Polling failed (retr
1y ".concat(m.current,"/").concat(s.MAX_RETRIES,"):"),r),m.current>=s.MAX_RETRIES){let r="Maximale Anzahl Wiederholungsversuche erreicht (".concat(s.MAX_RETRIES,")");i.k.log("[QueueStatusPolling] â Max retries reached: ".concat(r)),n("error"),g(r),w(!0),v(t).updateState({status:"error",error:r}),null===(o=e.onError)||void 0===o||o.call(e,r)}else i.k.log("[QueueStatusPolling] \uD83D\uDD04 Will retry after next polling interval...")}};i.k.log("[QueueStatusPolling] \uD83D\uDE80 Starting immediate poll"),l(),i.k.log("[QueueStatusPolling] â° Setting up polling interval: ".concat(s.POLLING_INTERVAL,"ms")),p.current=setInterval(()=>{let e=y.current;i.k.log("[QueueStatusPolling] \uD83D\uDD50 Interval triggered - calling poll function (isActive: ".concat(f.current,", status: ").concat(e,")")),l()},s.POLLING_INTERVAL),i.k.log("[QueueStatusPolling] â
Polling interval set up with ID: ".concat(p.current))},[b,v,w,e]),E=(0,a.useCallback)(()=>{let e=y.current;if(i.k.log("[QueueStatusPolling] Stop polling requested - checking if analysis is running...",{status:e}),"queued"===e||"processing"===e){i.k.log("[QueueStatusPolling] \uD83D\uDEE1ï¸ PROTECTION: Analysis is running - ignoring manual stop request to preserve background analysis");return}i.k.log("[QueueStatusPolling] Stopping polling manually"),w(!0),n("idle")},[w]),C=(0,a.useCallback)(()=>{i.k.log("[QueueStatusPolling] Clearing all status and resetting state"),w(!0),n("idle"),o(null),c(null),g(null),k.current&&(k.current.cleanup(),k.current=null)},[w]);(0,a.useEffect)(()=>{if(!r)return;let e=v(r),t=e.getState();t&&"completed"===t.status&&(i.k.log("[QueueStatusPolling] Found completed state from other tab"),n("completed"),t.results&&c(t.results),w());let a=e.onStateChange(e=>{i.k.log("[QueueStatusPolling] Received state from other tab:",e.status),"completed"===e.status?(i.k.log("[QueueStatusPolling] Other tab completed - updating local state"),n("completed"),e.results&&c(e.results),w(!0)):"error"===e.status&&e.error&&(i.k.log("[QueueStatusPolling] Other tab errored - updating local state"),n("error"),g(e.error),w(!0))});return()=>{a()}},[r,v,w]),(0,a.useEffect)(()=>()=>{let e=y.current;if(i.k.log("[QueueStatusPolling] Component unmounting...",{status:e,isActive:f.current}),"queued"===e||"processing"===e){i.k.log("[QueueStatusPolling] \uD83D\uDEE1ï¸ PROTECTION: Analysis running - NOT cleaning up on unmount to preserve background polling");return}"idle"===e||"completed"===e||"error"===e?(i.k.log("[QueueStatusPolling] Safe to cleanup - analysis not running"),w(!0),k.current&&(k.current.cleanup(),k.current=null)):i.k.log("[QueueStatusPolling] Delaying cleanup - analysis still running in background")},[w]),(0,a.useEffect)(()=>{i.k.log("[QueueStatusPolling] Status changed to: ".concat(t))},[t]);let x=(null==u?void 0:u.overall_progress)||0,Q=(null==u?void 0:u.estimated_completion)||null,T=Q?I(Q):null,_=u?D(u):"Vorbereitung...";return{status:t,taskId:r,queueData:u,error:d,progress:x,estimatedCompletion:Q,estimatedDuration:T,userMessage:_,startPolling:P,stopPolling:E,clearStatus:C}}({onComplete:async e=>{i.k.log("[".concat(m,"] Queue analysis completed for task:"),e);try{let g;let p=W.current;if(i.k.log("[".concat(m,"] Fetching final results for sessionId:"),p),!p){i.k.error("[".concat(m,"] onComplete called with null sessionId!")),P("Sitzungs-ID nicht gefunden, Ergebnisse konnten nicht abgerufen werden."),y("initial"),_(!1);return}let h="lead_qualification_".concat(p),f=sessionStorage.getItem(h);if(f)try{let e=JSON.parse(f);if(i.k.log("[".concat(m,"] Submitting Lead Qualification data for ").concat(p,":"),{hasAnswers:!!e.answers,answersCount:Object.keys(e.answers||{}).length,hasEmail:!!e.emailCaptured,hasPhone:!!e.phoneCaptured}),(g=await fetch("/api/polling/pages/".concat(p,"/results"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok){sessionStorage.removeItem(h);let e=[];for(let t=0;t<sessionStorage.length;t++){let n=sessionStorage.key(t);(null==n?void 0:n.startsWith("lead_qualification_"))&&e.push(n)}e.forEach(e=>sessionStorage.removeItem(e)),i.k.log("[".concat(m,"] â
Lead Qualification data submitted and ").concat(e.length+1," session storage entr
1ies cleared"))}}catch(e){i.k.error("[".concat(m,"] Error parsing Lead Qualification data:"),e),g=await fetch("/api/polling/pages/".concat(p,"/results"))}else g=await fetch("/api/polling/pages/".concat(p,"/results"));if(!g.ok)throw Error("Failed to fetch results: ".concat(g.status));let S=await g.json();if(i.k.log("[".concat(m,"] Analysis results received:"),S),!S.has_results&&"pending"===S.status){i.k.log("[".concat(m,"] Results not yet available, retrying..."));for(let e=1;e<=5;e++){await new Promise(e=>setTimeout(e,3e3)),i.k.log("[".concat(m,"] Retry ").concat(e,"/").concat(5," for results..."));let t=await fetch("/api/polling/pages/".concat(p,"/results"));if(t.ok&&(S=await t.json()).has_results){i.k.log("[".concat(m,"] Results available after retry ").concat(e));break}}S.has_results||i.k.warn("[".concat(m,"] Results still not available after ").concat(5," retries"))}let v={url:S.url,issues:S.issues||[],analysis_status:S.analysis_status},w=await fetch("/api/results/transform",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({rawResults:v,domain:v.url?new URL(v.url).hostname:"unknown-domain",testType:"widget"})});if(w.ok){var n,r,a,o,l,s,u,c;let g=await w.json(),h=(null===(n=v.issues)||void 0===n?void 0:n.length)||0,f=(null===(r=v.issues)||void 0===r?void 0:r.filter(e=>e.isAutoFixable).length)||0;i.k.log("[".concat(m,"] Saving analysis results to store..."));let S={testId:p,completedAt:new Date().toISOString(),domain:v.url?new URL(v.url).hostname:"unknown-domain",url:v.url||k,issues:(null===(a=v.issues)||void 0===a?void 0:a.map(e=>({id:e.issueId||e.vaeId||"issue-".concat(Math.random()),description:e.description||"Barrierefreiheitsproblem",wcag_criterion:e.wcagCriterion||"N/A",severity:e.impact||"moderate",explanation:e.explanation||e.description||"Keine Erkl\xe4rung verf\xfcgbar",selector:e.selector||"N/A",isAutoFixable:e.isAutoFixable||!1,category:"accessibility",action:e.action||null,actionParams:e.actionParams||null,fixConfidence:e.fixConfidence||null,manual_fix_necessary:e.manual_fix_necessary||!1,manualFixInstructions:e.manualFixInstructions||null})))||[]};i.k.log("[".concat(m,"] Attempting to save results to store..."));try{let e=d.ZP.getState();(null===(c=e.analysis)||void 0===c?void 0:c.setAnalysisResults)?(e.analysis.setAnalysisResults(p,S.url,S),i.k.log("[".concat(m,"] Results saved to store successfully"))):i.k.warn("[".concat(m,"] Store analysis slice not ready for saving results"))}catch(e){i.k.warn("[".concat(m,"] Failed to save results to store:"),e)}i.k.log("[".concat(m,"] Setting testResults with correct IDs:"),{pageId:p,taskId:e,usingPageId:!0}),D({sessionId:p,url:v.url||k,totalIssues:h,autoFixableIssues:f,riskScore:null===(l=g.results)||void 0===l?void 0:null===(o=l.summary)||void 0===o?void 0:o.riskScore,complianceScore:null===(u=g.results)||void 0===u?void 0:null===(s=u.summary)||void 0===s?void 0:s.complianceScore,results:v}),y("results"),_(!1),t.trackQuickTestComplete(k,h,f),fetch("/api/quick-test/".concat(e,"/complete"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:v.url||k,issues:v.issues||[],indexOnly:!0})}).then(e=>{e.ok?i.k.log("[".concat(m,"] Added to Digital Accessibility Index")):i.k.log("[".concat(m,"] Index addition returned non-ok status: ").concat(e.status))}).catch(e=>{i.k.log("[".concat(m,"] Index addition failed (non-critical):"),e)})}else throw i.k.error("[".concat(m,"] Transform API error:"),w.status,await w.text()),Error("Failed to transform results")}catch(e){i.k.error("[".concat(m,"] Error processing completed analysis:"),e),P("Fehler beim Verarbeiten der Ergebnisse"),y("initial"),_(!1)}},onError:e=>{i.k.error("[".concat(m,"] Queue polling error:"),e),P(e),y("initial"),_(!1)}});(0,a.useEffect)(()=>{let e=()=>{i.k.log("[".concat(m,"] Page unloading - stopping polling")),ee(),et()},t=()=>{document.hidden&&(i.k.log("[".concat(m,"] Page hidden - stopping polling")),ee())},n=e=>{window.location.pathname.includes("/onboarding")&&(i.k.log("[".concat(m,"] Navigation to onboarding detected - stopping polling immediately")),ee(),et())};return window.addEventListener("beforeunload",e),document.addEventListener("visibilitychange",t),window.addEventListener("popstate",n),(
1)=>{i.k.log("[".concat(m,"] Component unmounting - cleanup polling")),ee(),et(),window.removeEventListener("beforeunload",e),document.removeEventListener("visibilitychange",t),window.removeEventListener("popstate",n)}},[ee,et,m]),(0,a.useEffect)(()=>{if("google_login_no_account"===h.get("error")){i.k.warn("[useQuickTestFlow] Deprecated error parameter detected, clearing it");let e=new URL(window.location.href);e.searchParams.delete("error"),window.history.replaceState({},"",e.toString())}},[h]),(0,a.useEffect)(()=>{"true"===sessionStorage.getItem("onboarding_intent")&&U&&q&&(i.k.info("ONBOARDING_LOG: [".concat(m,"] User has onboarding intent - immediate redirect to onboarding")),j(!0),sessionStorage.removeItem("onboarding_intent"),setTimeout(()=>{window.location.href="/onboarding"},100))},[U,q,m]),(0,a.useEffect)(()=>{let e,t=!0;return(async()=>{var r;if(!U||!q||!t)return;if(A){i.k.warn("[useQuickTestFlow] Google login error still present, skipping client check");return}if("signup"===h.get("type")){i.k.log("[".concat(m,"] Skipping client check - LoginProcessor is handling signup flow"));return}let a=h.get("redirect_to"),o=h.get("onboarding"),l=sessionStorage.getItem("onboarding_intent");if((null==a?void 0:a.includes("onboarding"))||"true"===o){i.k.log("[".concat(m,"] Skipping client check - user is intentionally going to onboarding"),{redirectTo:a,onboardingParam:o,onboardingIntent:l});return}let s=async()=>{if(t)try{i.k.log("[".concat(m,"] \uD83D\uDD0D Checking client data via API..."));let a=await (0,g.Lu)("/api/clients/aggregated-data",{method:"GET",credentials:"include"});i.k.log("[".concat(m,"] \uD83D\uDCCA API response status:"),a.status);let o=!1;if(404===a.status)o=!0,i.k.log("[".concat(m,"] User has no client (404 response)"));else if(a.ok){let e=await a.json();i.k.log("[".concat(m,"] \uD83D\uDCCB Client data received:"),e),e.success&&Array.isArray(e.data)&&0===e.data.length&&(o=!0,i.k.log("[".concat(m,"] User has no client (empty data array)")))}if(o){var e,r;if(!t)return;i.k.log("[".concat(m,"] User has no client, checking authentication method"));let{createClientSupabaseClient:a}=await Promise.resolve().then(n.bind(n,58717)),o=a(),{data:{session:l}}=await o.auth.getSession(),s=null==l?void 0:null===(r=l.user)||void 0===r?void 0:null===(e=r.app_metadata)||void 0===e?void 0:e.provider;if(i.k.log("[".concat(m,"] Authentication provider:"),s),"google"===s){i.k.log("[".concat(m,"] \uD83C\uDFAF Google OAuth user without client - redirecting to Quick-Setup")),sessionStorage.removeItem("onboarding_intent"),i.k.log("[".concat(m,"] Letting LoginProcessor handle Quick-Setup redirect for Google user"));return}i.k.log("[".concat(m,"] Email/password user has no client, redirecting to Quick-Setup")),sessionStorage.removeItem("onboarding_intent");return}i.k.log("[".concat(m,"] â
User has client data, no action needed. Status:"),a.status)}catch(e){e instanceof TypeError&&"Failed to fetch"===e.message?i.k.log("[".concat(m,"] Fetch cancelled - likely due to navigation")):i.k.error("[".concat(m,"] Error checking user client:"),e)}};"google"===(null==q?void 0:null===(r=q.app_metadata)||void 0===r?void 0:r.provider)?(i.k.log("[".concat(m,"] Google user detected - running immediate client check")),s()):e=setTimeout(s,1e3)})(),()=>{t=!1,e&&clearTimeout(e)}},[U,q,h,A,m]);let en=async e=>{var n,r,a,o,l,s,u,c;i.k.info("ONBOARDING_LOG: [".concat(m,"] Starting accessibility test for URL:"),e);let g=d.ZP.getState();i.k.log("[".concat(m,"] Store debug at start:"),{storeExists:!!g,hasAnalysis:!!g.analysis,analysisKeys:g.analysis?Object.keys(g.analysis):"none",hasStartFunction:typeof(null===(n=g.analysis)||void 0===n?void 0:n.startLandingpageAnalysis),allStoreKeys:Object.keys(g)}),S(e),y("testing"),P(null),_(!0),t.trackQuickTestStart(e);try{let n=await fetch("/api/quick-analysis/setup",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})});if(!n.ok){let e=await n.json();throw Error(e.error||"Failed to start analysis")}let{sessionId:p}=await n.json();w(p),W.current=p,i.k.log("[".concat(m,"] Session created:"),p);try{g.analysis?(g.analysis.setCurrentTestId(p),i.k.log("[".concat(m,"] â
Store testId set:"),p)):i.k.log("[".concat(m,"] â ï¸ Store analysis not ready, continuing without store testId"))}catch(e){i.k.log("[".concat(m,"] â ï¸ Store testId failed:"),e instanceof Error?e.message:e)}let h=await fetch("/api/quick-analysis/check-cache",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:p,url:e})});if(h.ok){let n=await h.json();if(n.cached&&n.skip_injection&&n.results){i.k.log("[".concat(m,"] Cache hit! Using cached results"));let r=(null===(o=n.results)||void 0===o?void 0:null===(a=o.issues)||void 0===a?void 0:a.length)||0,g=(null===(s=n.results)||void 0===s?void 0:null===(l=s.issues)||void 0===l?void 0:l.filter(e=>e.isAutoFixable).length)||0;D({sessionId:p,url:e,totalIssues:r,autoFixableIssues:g,complianceScore:null===(u=n.results)||void 0===u?void 0:u.complianceScore,results:n.results});let h=d.ZP.getState();if(h.analysis&&"function"==typeof h.analysis.setAnalysisResults){i.k.log("[".concat(m,"] Saving cached results to store..."));let t={testId:p,completedAt:new Date().toISOString(),domain:new URL(e).hostname,url:e,issues:(null===(c=n.results.issues)||void 0===c?void 0:c.map(e=>({id:e.issueId||e.vaeId||"issue-".concat(Math.random()),description:e.description||"Barrierefreiheitsproblem",wcag_criterion:e.wcagCriterion||"N/A",severity:e.impact||"moderate",explanation:e.explanation||e.description||"Keine Erkl\xe4rung verf\xfcgbar",selector:e.selector||"N/A",isAutoFixable:e.isAutoFixable||!1,category:"accessibility",action:e.action||null,actionParams:e.actionParams||null,fixConfidence:e.fixConfidence||null,manual_fix_necessary:e.manual_fix_necessary||!1,manualFixInstructions:e.manualFixInstructions||null})))||[]};h.analysis.setAnalysisResults(p,e,t),i.k.log("[".concat(m,"] â
Cached results s
1aved to store"))}else i.k.warn("[".concat(m,"] Store analysis functions not available for cache hit"));y("results"),_(!1),t.trackQuickTestComplete(e,r,g);return}}i.k.log("[".concat(m,"] Cache miss, starting widget injection..."));let f=await fetch("/api/quick-analysis/start-widget-injection",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:p})});if(!f.ok){let e=await f.json();if(422===f.status)throw Error("WEBSITE_BLOCKED");throw Error(e.error||"Widget injection failed")}let k=await f.json();if(i.k.log("[".concat(m,"] Widget injection started:"),k),null===(r=k.widgetInjectionResult)||void 0===r?void 0:r.taskId)i.k.log("[".concat(m,"] Starting queue polling for task:"),k.widgetInjectionResult.taskId),$(k.widgetInjectionResult.taskId);else throw Error("No taskId returned from widget injection")}catch(t){i.k.error("[".concat(m,"] Error starting test:"),t),t instanceof Error&&"WEBSITE_BLOCKED"===t.message?(P("\uD83D\uDD12 Diese Website ist vor externen Analysen gesch\xfctzt.\n\n⨠Aber keine Sorge! Sobald Sie unseren Code in Ihre Website eingef\xfcgt haben, k\xf6nnen wir sie problemlos analysieren - versprochen! \uD83C\uDFAF\n\nNach der Integration erhalten Sie Zugriff auf:\n⢠Vollst\xe4ndige Barrierefreiheits-Analyse\n⢠Automatische Fehlerbehebung\n⢠Kontinuierliche \xdcberwachung"),M(e),w(null),W.current=null):P(t instanceof Error?t.message:"Test konnte nicht gestartet werden"),y("initial"),_(!1)}},er=async()=>{i.k.log("[".concat(m,"] \uD83D\uDE80 handleStartRegistration called")),i.k.log("[".concat(m,"] Current state:"),{testResults:I?"exists":"null",sessionId:v,failedTestUrl:O,isAuthenticated:U,error:b});let e=new URLSearchParams;try{new URL(window.location.href).searchParams.forEach((t,n)=>{n.toLowerCase().startsWith("utm_")&&e.set(n,t)})}catch(e){}let n=(null==I?void 0:I.sessionId)||v;n&&e.set("testId",n);let r=e.toString(),a=r?"?".concat(r):"",o="/auth/quick-setup".concat(a);if(U)try{let e=await (0,g.Lu)("/api/clients/aggregated-data",{credentials:"include"});if(e.ok){var l;let t=await e.json(),n=Array.isArray(null==t?void 0:t.data)&&(null===(l=t.data[0])||void 0===l?void 0:l.id)?t.data[0].id:void 0;if(n){window.location.href="/client/".concat(n,"/integration").concat(a);return}}window.location.href=o;return}catch(e){i.k.warn("[".concat(m,"] Client lookup failed, falling back to QuickâSetup:"),e),window.location.href=o;return}sessionStorage.setItem("onboarding_intent","true"),t.trackRegistrationIntent(I?"test_completed_homepage":"blocked_website_registration"),window.location.href=o},ea=()=>{C(!1)},eo=()=>{C(!1),Q(!0)},ei=()=>{R(null);{let e=new URL(window.location.href);e.searchParams.delete("error"),window.history.replaceState({},"",e.toString())}},el=()=>{i.k.log("[".concat(m,"] \uD83C\uDFAF Activating focus effect and scrolling to QuickTest")),A&&ei(),G(!0),window.scrollTo({top:0,behavior:"smooth"}),setTimeout(()=>{let e=document.getElementById("website-url");e&&e.focus()},500)},es=(0,a.useCallback)(()=>{i.k.log("[".concat(m,"] \uD83D\uDEAB Closing focus effect")),G(!1)},[m]);return(0,a.useEffect)(()=>{if(!B)return;let e=e=>{"Escape"===e.key&&es()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[B,es]),{flowState:f,testUrl:k,sessionId:v,testResults:I,error:b,showRegistration:E,showLogin:x,isLoadingTest:T,googleLoginError:A,redirectingToOnboarding:N,resultsPageVariant:L,failedTestUrl:O,isTestFocused:B,queueStatus:J,taskId:Y,queueData:z,queueError:V,queueProgress:H,estimatedDuration:X,userMessage:Z,handleTestSubmit:en,handleStartRegistration:er,handleCloseRegistration:ea,handleSwitchToLogin:eo,handleCloseGoogleError:ei,scrollToQuickTest:el,closeFocusEffect:es,handleOverlayClick:e=>{e.target===e.currentTarget&&es()},initializeScrollDepthTracking:(0,a.useCallback)(()=>{let e,n=0,r=()=>{let r=Math.round(window.scrollY/(document.documentElement.scrollHeight-window.innerHeight)*100);r>n&&(n=r,clearTimeout(e),e=setTimeout(()=>{t.trackScrollDepth(r)},1e3))};return window.addEventListener("scroll",r),()=>{window.removeEventListener("scroll",r),clearTimeout(e)}},[t]),renderGoogleErrorNotification:()=>A?(0,r.jsx)("div",{className:"fixed top-20 left-1/2 transform -translate-x-1/2 z-50 w-full max-w-md mx-auto px-4",children:(0,r.jsx)("div",{className:"bg-orange-50 border border-orange-200 rounded-lg p-4 shadow-lg",children:(0,r.jsxs)("div",{className:"flex items-start",children:[(0,r.jsx)("div",{className:"flex-shrink-0",children:(0,r.jsx)("svg",{className:"h-5 w-5 text-orange-600",viewBox:"0 0 20 20",fill:"currentColor",children:(0,r.jsx)("path",{fillRule:"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z",clipRule:"evenodd"})})}),(0,r.jsxs)("div",{className:"ml-3 flex-1",children:[(0,r.jsx)("h3",{className:"text-sm font-medium text-orange-800",children:"Anmeldung fehlgeschlagen"}),(0,r.jsx)("div",{className:"mt-2 text-sm text-orange-700",children:(0,r.jsx)("p",{children:A})}),(0,r.jsx)("div",{className:"mt-4",children:(0,r.jsxs)("div",{className:"flex",children:[(0,r.jsx)("button",{onClick:el,className:"bg-orange-600 text-white text-sm px-3 py-2 rounded-md hover:bg-orange-700 transition-colors mr-3",children:"Jetzt testen"}),(0,r.jsx)("button",{onClick:ei,className:"text-orange-600 text-sm px-3 py-2 rounded-md border border-orange-300 hover:bg-orange-100 transition-colors",children:"Schlie\xdfen"})]})})]})]})})}):null,renderOnboardingRedirectLoading:()=>N?(0,r.jsx)("div",{className:"fixed inset-0 z-50 bg-white/90 backdrop-blur-sm flex items-center justify-center",children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("div",{className:"w-8 h-8 border-2 border-blue-600 border-t-transparent roun
1ded-full animate-spin mx-auto mb-4"}),(0,r.jsx)("p",{className:"text-gray-700 font-medium",children:"Weiterleitung zum Onboarding..."})]})}):null,renderModals:(e,t)=>(0,r.jsxs)(r.Fragment,{children:[E&&(0,r.jsx)(e,{onClose:ea,onSwitchToLogin:eo,testResults:I?{url:I.url,totalIssues:I.totalIssues,autoFixableIssues:I.autoFixableIssues,sessionId:I.sessionId}:O?{url:O,totalIssues:0,autoFixableIssues:0}:void 0}),x&&(0,r.jsx)(t,{onClose:()=>Q(!1),onSwitchToSignUp:()=>{Q(!1),C(!0)}})]})}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.