1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[592],{4356:(e,t,s)=>{"use strict";s.d(t,{A:()=>r});var a=s(4232),l=s(5004);function r(){let[e,t]=(0,a.useState)(null),[s,r]=(0,a.useState)(!0);return(0,a.useEffect)(()=>{localStorage.getItem("wasLoggedOut");let e=l.j2.onAuthStateChanged(async e=>{t(e),r(!1)});return()=>e()},[]),{user:e,loading:s}}s(2009)},6172:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/checker-older",function(){return s(6900)}])},6900:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>H});var a=s(7876),l=s(5004),r=s(7746),i=s(5418);let n=(0,s(7963).A)("clock",[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var o=s(3784);s(7328);var c=s(8230),d=s.n(c),u=s(6068),m=s(4232),p=s(9104),h=s(2189),x=s(5226),g=s(4356),f=s(1041),v=s(2078),b=s(3752),y=s(2009),j=s(9099),N=s(886);let w="https://us-central1-noviolation-ee22f.cloudfunctions.net";if(!w)throw console.error("CLOUD_FUNCTION_URL is not defined in environment variables. Please check your .env.local file"),Error("CLOUD_FUNCTION_URL environment variable is required");let k={"Starting processing":0,"Downloading video":10,"Staging for analysis":20,"Spinning up models":30,"Listening to audio":50,"Watching video":70,"Combining results":90,Complete:100},S=[{id:"regular",label:"Regular TikTok Video",description:"Standard TikTok content for entertainment or education"},{id:"shop",label:"TikTok Shop Video",description:"Content specifically for TikTok Shop and product promotions"}],C=[{id:"base",label:"Base Rules Check",value:"Base Rules",description:"Checks against basic content safety guidelines."},{id:"18plus",label:"18+ Content Check",value:"18+",description:"Analyzes for explicit adult content and mature themes."},{id:"all",label:"All Rules Check",value:"All Rules",description:"A comprehensive analysis against all available guidelines."},{id:"fyf",label:"FYF Ineligible Check",value:"FYF Ineligible",description:"Checks if the video meets FYF eligibility criteria."}],A=(0,r.Qg)((0,l.Ql)(),"checkIPTrialStatus"),R="noviolation_trial_status",T="noviolation_device_id",P=[{id:"performance",label:"Making my videos perform better (views / sales)"},{id:"what_to_change",label:"Knowing exactly what to change before posting"},{id:"planning",label:"Planning or writing the video before I film"},{id:"only_violations",label:"I only care about avoiding violations"}],D=[{id:"auto_fix",label:"Automatically fix issues in my video"},{id:"step_by_step",label:"Tell me exactly what to change (step-by-step)"},{id:"risk_score",label:"Score my video for risk vs viral potential"},{id:"script_help",label:"Help me write or plan my script before filming"},{id:"other",label:"Other"}],U="noviolation_first_scan_complete",L="noviolation_questions_v2_answered",_=async()=>{let e=localStorage.getItem(T);if(e)return e;try{let e=i.Ay.load(),t=await e,s=(await t.get()).visitorId;return localStorage.setItem(T,s),s}catch(t){console.error("Error generating fingerprint:",t);let e=Math.random().toString(36).substring(2,15);return localStorage.setItem(T,e),e}},I=async(e,t)=>{let s=await _(),a=(null==e?void 0:e.scansRemaining)<=0,l=localStorage.getItem(R),r=l?JSON.parse(l):{};return r={...r,ipHasUsedTrial:a,deviceId:s,userId:t,lastChecked:new Date().toISOString()},localStorage.setItem(R,JSON.stringify(r)),{hasUsedTrial:a||r.hasCompletedTrial,deviceId:s}},F=async e=>{let t=await _(),s=localStorage.getItem(R),a=s?JSON.parse(s):{};a={...a,hasCompletedTrial:!0,completedAt:new Date().toISOString(),userId:e,deviceId:t},localStorage.setItem(R,JSON.stringify(a))},O=e=>{let t,{userData:s,highIntentScanCardActive:i=!1,onHighIntentGoPro:n=()=>{},onHighIntentKeepScanning:o=()=>{}}=e,[c,u]=(0,m.useState)(null),[p,h]=(0,m.useState)(!0),[x,g]=(0,m.useState)([]);if((0,m.useEffect)(()=>{(async()=>{try{let e=await A();u(e.data)}catch(e){console.error("Error fetching IP trial status:",e)}finally{h(!1)}})()},[]),(0,m.useEffect)(()=>{(async()=>{try{let e=(0,r.Qg)((0,l.Ql)(),"getCreditPackages"),{data:t}=await e();(null==t?void 0:t.success)&&Array.isArray(t.packages)&&g(t.packages)}catch(e){console.error("Failed to load credit packages:",e)}})()},[]),!s)return null;let f=void 0!==s.scansRemaining?s.scansRemaining:0,v=void 0!==s.scansPerDay?s.scansPerDay:0,b=s.scanCredits||0,y=b>0,j="free"===s.subscriptionLevel;t=v>0?f/v*100:0;let N=(null==c?void 0:c.scansRemaining)||0,w=(null==c?void 0:c.trialLimit)||5,k=w>0?N/w*100:0,S=f,C=t;j&&c&&N<f&&(S=N,C=k);
1let R=Number(null==s?void 0:s.creditsDisplayBase)||0,T=R,P=0;if(T>0)P=Math.min(100,b/T*100);else{let e=(x||[]).map(e=>Number(e.scans)).filter(e=>Number.isFinite(e)&&e>0).sort((e,t)=>e-t);P=(T=0===b?0:e.find(e=>b<=e)||b)>0?Math.min(100,b/T*100):0}return(0,a.jsxs)("div",{className:"mb-6 p-4 border border-purple-100 rounded-lg bg-white shadow-sm",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-3",children:[(0,a.jsx)("h3",{className:"text-sm font-medium text-gray-700",children:"Available Scans"}),(0,a.jsx)("div",{className:"flex items-center gap-2",children:!(i&&j)&&(0,a.jsxs)(a.Fragment,{children:[y&&(0,a.jsx)("span",{className:"text-xs bg-purple-100 text-purple-800 px-2 py-1 rounded-full",children:"Scan Packs"}),s.subscriptionLevel&&"free"!==s.subscriptionLevel&&(0,a.jsxs)("span",{className:"text-xs bg-purple-100 text-purple-800 px-2 py-1 rounded-full",children:[s.subscriptionLevel.charAt(0).toUpperCase()+s.subscriptionLevel.slice(1)," Plan"]}),"free"===s.subscriptionLevel&&!y&&(0,a.jsx)("span",{className:"text-xs bg-gray-100 text-gray-800 px-2 py-1 rounded-full",children:"Free Trial"})]})})]}),i&&j?(0,a.jsxs)("div",{className:"space-y-3 pt-1",children:[(0,a.jsx)("p",{className:"text-sm font-bold text-gray-900 leading-snug",children:"You're using NoViolation like a daily creator"}),(0,a.jsx)("p",{className:"text-sm font-medium text-gray-700",children:"Pro gives you 5 scans every day â no interruptions"}),(0,a.jsx)("p",{className:"text-xs text-gray-600 leading-relaxed",children:"Most creators need multiple scans to create a winning video â don't lose momentum"}),(0,a.jsx)("button",{type:"button",onClick:n,className:"w-full rounded-lg bg-purple-600 px-3 py-2.5 text-sm font-semibold text-white transition-colors hover:bg-purple-700 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-offset-2",children:"Go Pro â $15/month"}),(0,a.jsx)("button",{type:"button",onClick:o,className:"w-full py-2 text-center text-sm text-gray-500 transition-colors hover:text-gray-700 focus:outline-none focus:ring-2 focus:ring-gray-300 rounded-lg",children:"Keep using scans"})]}):null,!(i&&j)&&(0,a.jsxs)("div",{className:"space-y-3",children:[y&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)("span",{className:"text-xs text-gray-600",children:"Scan Packs Remaining"}),(0,a.jsx)("span",{className:"text-sm font-medium",children:R>0?"".concat(b," / ").concat(R):b})]}),(0,a.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2",children:(0,a.jsx)("div",{className:"".concat(P>60?"bg-green-500":P>30?"bg-yellow-500":"bg-red-500"," h-2 rounded-full"),style:{width:"".concat(P,"%")}})})]}),(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)("span",{className:"text-xs text-gray-600",children:j?"Trial Scans Remaining":"Scans Remaining Today"}),(0,a.jsxs)("span",{className:"text-sm font-medium",children:[S," / ",v]})]}),(0,a.jsx)("div",{className:"w-full bg-gray-200 rounded-full h-2",children:(0,a.jsx)("div",{className:"".concat(C>60?"bg-green-500":C>30?"bg-yellow-500":"bg-red-500"," h-2 rounded-full"),style:{width:"".concat(Math.min(100,C),"%")}})}),S<=0&&(0,a.jsx)("div",{className:"mt-1 text-xs text-gray-500",children:y?"Trial scans used. Your purchased scan packs will be used for uploads.":"You've used all available trial scans."}),"free"!==s.subscriptionLevel&&s.nextRefreshDate&&(0,a.jsxs)("div",{className:"flex justify-between text-xs",children:[(0,a.jsx)("span",{className:"text-gray-600",children:"Next Refresh"}),(0,a.jsx)("span",{className:"font-medium",children:(e=>{if(!e)return"N/A";let t=e instanceof Date?e:e.toDate();return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",hour:"numeric",minute:"numeric",hour12:!0}).format(t)})(s.nextRefreshDate)})]}),S<=0&&!y&&(0,a.jsx)("div",{className:"mt-2 p-2 bg-purple-50 border border-purple-200 rounded text-xs text-purple-800",children:(0,a.jsxs)("div",{className:"flex items-start",children:[(0,a.jsx)("svg",{className:"w-3.5 h-3.5 text-purple-500 mt-0.5 mr-1.5 flex-shrink-0",fill:"currentColor",viewBox:"0 0 20 20",children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-11a1 1 0 10-2 0v2H7a1 1 0 100 2h2v2a1 1 0 102 0v-2h2a1 1 0 100-2h-2V7z",clipRule:"evenodd"})}),(0,a.jsxs)("span",{children:[(0,a.jsx)(d(),{href:"/pricing",className:"font-medium text-purple-700 hover:text-purple-900 underline",children:"Buy 5 more scans for $1.50"})," to keep scanning"]})]})}),j&&!y&&S>0&&(0,a.jsxs)("div",{className:"mt-2 text-xs text-gray-500 text-center",children:[(0,a.jsx)(d(),{href:"/pricing",className:"text-purple-600 hover:text-purple-800 font-semibold",children:"Buy 5 scans for $1.50"}),(0,a.jsx)("div",{className:"mt-1",children:"No subscription. Use anytime."})]}),j&&y&&(0,a.jsxs)("div",{className:"mt-2 text-xs text-gray-600 text-center",children:["Scan packs are active. Need more? ",(0,a.jsx)(d(),{href:"/pricing",className:"text-purple-600 hover:text-purple-800",children:"Buy more"}),"."]})]})]})},E=e=>{var t,s,l,r,i,n,o,c;let{onSubmit:d,responses:u,setResponses:m,stepNumber:p,isDisabled:h,isSaving:x,isSaved:g}=e,f=(null==(t=u.hardestPart)?void 0:t.trim())&&u.mostHelpWith&&(null==(s=u.wouldActuallyUse)?void 0:s.length)>0&&(!(null==(l=u.wouldActuallyUse)?void 0:l.includes("other"))||(null==(r=u.wouldActuallyUseOther)?void 0:r.trim()));return(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-purple-100 p-6 ".concat(h?"o
1pacity-50 pointer-events-none":""),children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold mb-4 flex items-center",children:[(0,a.jsx)("span",{className:"bg-purple-100 text-purple-600 w-6 h-6 rounded-full flex items-center justify-center mr-2 text-sm",children:p}),"Quick Feedback:"]}),(0,a.jsxs)("form",{onSubmit:e=>{e.preventDefault(),d(u)},className:"space-y-6",children:[(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"When creating TikTok videos, what's the hardest part for you right now?"}),(0,a.jsx)("textarea",{placeholder:"Tell us what's challenging...",value:u.hardestPart,onChange:e=>m({...u,hardestPart:e.target.value}),className:"block w-full rounded-md border-2 py-3 px-4 shadow-sm \n focus:border-purple-600 focus:ring-purple-600 focus:ring-opacity-50 text-sm resize-none \n focus-within:border-purple-600 focus:outline-none\n ".concat((null==(i=u.hardestPart)||i.trim(),"border-gray-400")),rows:3,"aria-label":"What's the hardest part of creating TikTok videos"})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Outside of avoiding violations, what would you want the most help with?"}),(0,a.jsx)("p",{className:"text-xs text-gray-500",children:"(Select one)"}),(0,a.jsx)("div",{className:"space-y-2",children:P.map(e=>(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("input",{type:"radio",id:"help_".concat(e.id),name:"mostHelpWith",value:e.id,checked:u.mostHelpWith===e.id,onChange:e=>m({...u,mostHelpWith:e.target.value}),className:"h-5 w-5 text-purple-600 accent-purple-600 border-gray-600 checked:border-purple-600 focus:ring-purple-500 focus:ring-offset-0 cursor-pointer","aria-label":e.label}),(0,a.jsx)("label",{htmlFor:"help_".concat(e.id),className:"ml-3 text-sm text-gray-600 cursor-pointer",children:e.label})]},e.id))})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("label",{className:"block text-sm font-medium text-gray-700",children:"Which of these would you actually use?"}),(0,a.jsx)("p",{className:"text-xs text-gray-500",children:"(Select all that apply)"}),(0,a.jsx)("div",{className:"space-y-2",children:D.map(e=>{var t;return(0,a.jsxs)("div",{className:"flex items-center",children:[(0,a.jsx)("input",{type:"checkbox",id:"feature_".concat(e.id),checked:(null==(t=u.wouldActuallyUse)?void 0:t.includes(e.id))||!1,onChange:()=>(e=>{let t=u.wouldActuallyUse||[];t.includes(e)?m({...u,wouldActuallyUse:t.filter(t=>t!==e)}):m({...u,wouldActuallyUse:[...t,e]})})(e.id),className:"h-5 w-5 text-purple-600 accent-purple-600 border-gray-600 focus:ring-purple-500 focus:ring-offset-0 cursor-pointer rounded","aria-label":e.label}),(0,a.jsx)("label",{htmlFor:"feature_".concat(e.id),className:"ml-3 text-sm text-gray-600 cursor-pointer",children:e.label})]},e.id)})}),(null==(n=u.wouldActuallyUse)?void 0:n.includes("other"))&&(0,a.jsx)("input",{type:"text",placeholder:"Please specify what else you'd use...",value:u.wouldActuallyUseOther,onChange:e=>m({...u,wouldActuallyUseOther:e.target.value}),className:"mt-2 block w-full rounded-md border-2 py-3 px-4 shadow-sm \n focus:border-purple-600 focus:ring-purple-600 focus:ring-opacity-50 text-sm \n focus-within:border-purple-600 focus:outline-none\n ".concat((null==(o=u.wouldActuallyUse)?void 0:o.includes("other"))&&!(null==(c=u.wouldActuallyUseOther)?void 0:c.trim())?"border-red-400":"border-gray-400"),"aria-label":"Specify other feature you'd use"})]}),(0,a.jsx)("button",{type:"submit",disabled:!f||x||g,className:"w-full py-2 px-4 rounded-md shadow-sm text-sm font-medium text-white \n ".concat(!f||x||g?"bg-gray-300 cursor-not-allowed":"bg-purple-600 hover:bg-purple-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-purple-500"),"aria-label":"Submit feedback",children:x?"Savingâ¦":g?"Saved":"Submit Feedback"}),g&&(0,a.jsx)("div",{className:"mt-3 text-sm bg-green-50 border border-green-200 text-green-700 rounded-md p-2",children:"Feedback saved."})]})]})},V=e=>{var t,s,l,r;let{analysisResult:i,userData:o,onOpenTimeline:c,isPaidForThisScan:u=!1}=e,m=u||(null==o?void 0:o.subscriptionLevel)&&(null==o?void 0:o.subscriptionLevel)!=="free",p=(null==i||null==(s=i.enhancedFeatures)||null==(t=s.frameAnalyses)?void 0:t.length)>0;return(0,a.jsx)("div",{className:"-mt-6 space-y-6",children:(0,a.jsxs)("div",{className:"bg-white p-6 rounded-xl shadow-sm space-y-4",children:[(0,a.jsx)("div",{className:"text-center pb-4 border-b",children:(0,a.jsx)("span",{className:"inline-flex items-center px-4 py-2 rounded-full text-lg font-medium ".concat(i.passed?"bg-green-100 text-green-800":"bg-red-100 text-red-800"),children:i.passed?"PASSED â":"DID NOT PASS â"})}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[(0,a.jsxs)("div",{className:"p-4 bg-gray-50 rounded-lg",children:[(0,a.jsx)("h4",{className:"text-sm font-medium text-gray-500",children:"Status"}),(0,a.jsx)("p",{className:"text-lg font-semibold ".concat(i.violationFound?"text-red-600":"text-green-600"),children:i.violationFound?"Violations Found":"No Violations"})]}),(0,a.jsxs)("div",{className:"p-4 bg-gray-50 rounded-lg",children:[(0,a.jsx)("h4",{className:"text-sm font-medium text-gray-500",children:"Violation Probability"}),(0,a.jsxs)("p",{className:"text-lg font-semibold",children:[i.violationProbability,"%"]})]}),(0,a.jsxs)("div",{className:"p-4 bg-gray-50 rounded-lg",children:[(0,a.jsx)("h4",{className:"text-sm font-medium text-gray-500",children:"Confidence Score"}),(0,a.jsxs)("p",{className:"text-lg font-semibold",children:[i.confidence,"%"]})]})]}),p&&(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row items-center justify-between p-4 bg-gradient-to-r from-purple-50 to-indigo-50 rounded-lg border border-purple-100",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 mb-3 sm:mb-0",children:[(0,a.jsx)("div",{className:"p-2 bg-purple-100 rounded-lg",children:(0,a.jsx)(n,{className:"w-5 h-5 text-purple-600"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"font-medium text-gray-900",children:"Timeline Analysis Available"}),(0,a.jsx)("p",{className:"text-sm text-gray-600",children:m?"View frame-by-frame violation timeline with timestamps":"Preview our frame-by-frame violation timeline feature"})]})]}),(0,a.jsxs)("button",{onClick:c,className:"inline-flex items-center gap-2 px-4 py-2 bg-purple-600 text-white rounded-lg hover:bg-purple-700 transition-colors font-medium whitespace-nowrap",children:[(0,a.jsx)(n,{className:"w-4 h-4"}),m?"View Violation Timeline":"Preview Violation Timeline"]})]}),!m&&(0,a.jsxs)("div",{className:"mt-4 bg-purple-50 border border-purple-100 rounded-lg p-6 text-center",children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-purple-800 mb-2",children:"Unlock Premium Analysis Features"}),(0,a.jsx)("p",{className:"text-sm text-purple-700 mb-6 max-w-md mx-auto",children:"Upgrade to see detailed analysis, get AI-powered improvement suggestions, and understand exactly what our AI detected in your video."}),(0,a.jsx)(d(),{href:"/pricing",className:"inline-block bg-purple-600 text-white px-8 py-3 rounded-lg font-medium hover:bg-purple-700 transition-colors",children:"Upgrade Now"})]}),(0,a.jsxs)("div",{className:"pt-4 border-t relative",children:[(0,a.jsx)("h4",{className:"font-medium mb-2",children:"Analysis Details:"}),(0,a.jsxs)("div",{className:"space-y-4 ".concat(m?"":"blur-sm select-none"),children:[(0,a.jsxs)("div",{className:"bg-gray-50 p-4 rounded-lg",children:[(0,a.jsx)("h5",{className:"font-medium text-purple-600 mb-2",children:"Audio Analysis"}),(0,a.jsx)("p",{className:"text-gray-600",children:i.reason})]}
1),Number(i.framesAnalyzed)>0?(0,a.jsxs)("div",{className:"bg-gray-50 p-4 rounded-lg",children:[(0,a.jsx)("h5",{className:"font-medium text-purple-600 mb-2",children:"Visual Analysis"}),(0,a.jsx)("p",{className:"text-gray-600 mt-2",children:i.violationFound?null==(l=i.visualReason)?void 0:l.split("\n").find(e=>e.trim()):null==(r=i.visualReason)?void 0:r.split("\n")[0]})]}):null]})]}),Array.isArray(i.suggestedFixes)&&i.suggestedFixes.length>0&&(0,a.jsxs)("div",{className:"pt-4 border-t relative",children:[(0,a.jsx)("h4",{className:"font-medium mb-2",children:"Suggested Improvements:"}),(0,a.jsx)("ul",{className:"list-disc pl-5 space-y-2 ".concat(m?"":"blur-sm select-none"),children:i.suggestedFixes.map((e,t)=>(0,a.jsx)("li",{className:"text-gray-600 pb-1",children:e.includes(":")?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("span",{className:"font-medium text-gray-700",children:e.split(":")[0]}),": ".concat(e.split(":").slice(1).join(":"))]}):e},t))})]})]})})};function H(){var e;let[t,s]=(0,m.useState)(!1),[r,i]=(0,m.useState)(null),[n,c]=(0,m.useState)(0),[T,P]=(0,m.useState)("idle"),[D,H]=(0,m.useState)(null),{user:M,loading:z}=(0,g.A)(),[W,B]=(0,m.useState)(!1),[Y,J]=(0,m.useState)(!1),q=(0,m.useRef)(0),[G,Q]=(0,m.useState)(""),[$,K]=(0,m.useState)(!1),[X,Z]=(0,m.useState)(null),[ee,et]=(0,m.useState)(null),[es,ea]=(0,m.useState)(null),[el,er]=(0,m.useState)(""),[ei,en]=(0,m.useState)(!1),[eo,ec]=(0,m.useState)(null),[ed,eu]=(0,m.useState)(0),[em,ep]=(0,m.useState)("Starting processing..."),[eh,ex]=(0,m.useState)(null),[eg,ef]=(0,m.useState)(!0),[ev,eb]=(0,m.useState)(!1),[ey,ej]=(0,m.useState)(null),eN=(0,j.useRouter)(),[ew,ek]=(0,m.useState)(!1),[eS,eC]=(0,m.useState)(!1),[eA,eR]=(0,m.useState)(null),[eT,eP]=(0,m.useState)(!0),[eD,eU]=(0,m.useState)(null),[eL,e_]=(0,m.useState)(!1),[eI,eF]=(0,m.useState)(!1),[eO,eE]=(0,m.useState)(!1),[eV,eH]=(0,m.useState)(!1),[eM,ez]=(0,m.useState)(!1),[eW,eB]=(0,m.useState)({hardestPart:"",mostHelpWith:"",wouldActuallyUse:[],wouldActuallyUseOther:""}),[eY,eJ]=(0,m.useState)(!1);(0,m.useEffect)(()=>{(async()=>{let e=localStorage.getItem("cookiePreferences");e&&JSON.parse(e).analytics&&(await (0,l.fz)(),(0,l.sx)("page_view",{page_title:"Checker",page_location:window.location.href,page_path:window.location.pathname}))})(),(async()=>{eU(await _());let e=localStorage.getItem(R);e&&JSON.parse(e).hasCompletedTrial&&K(!0)})();let e=async()=>{if(M){eP(!0);try{let e=await (0,y.x7)((0,y.H9)(l.db,"users",M.uid));if(e.exists()){let t=e.data(),s=!1;try{(s=!!t.stripeCustomerId||!!t.hasStripeCustomer)||(s=(await (0,y.x7)((0,y.H9)(l.db,"customers",M.uid))).exists())}catch(e){console.error("Error checking Stripe customer status:",e)}eR({...t,scansRemaining:void 0!==t.scansRemaining?t.scansRemaining:0,scansPerDay:void 0!==t.scansPerDay?t.scansPerDay:0,nextRefreshDate:t.nextRefreshDate,lastScanRefresh:t.lastScanRefresh,hasStripeCustomer:s});let a=t.trialRunCompleted||!1;K(a),t.mostHelpWith&&(eF(!0),localStorage.setItem(L,"true")),a&&F(M.uid),t.trialRunCompleted&&"free"===t.subscriptionLevel&&!s&&t.scansRemaining<=0&&B(!0)}else eR({scansRemaining:0,scansPerDay:0})}catch(e){console.error("Error fetching user data:",e)}finally{eP(!1)}}};M?e():eP(!1)},[M]),(0,m.useEffect)(()=>{(async()=>{if(null==eA||!eA.subscriptionLevel||"free"===eA.subscriptionLevel)try{let e=await A();if((await I(e.data,null==M?void 0:M.uid)).hasUsedTrial){K(!0),ef(!1);return}}catch(e){console.error("Error checking IP trial status:",e),(null==eA?void 0:eA.subscriptionLevel)==="free"&&ef(!1)}})()},[M,eA]),(0,m.useEffect)(()=>{eA&&"number"==typeof eA.totalCreditsUsed&&(q.current=eA.totalCreditsUsed||0)},[null==eA?void 0:eA.totalCreditsUsed]),(0,m.useEffect)(()=>{if(!(null==M?void 0:M.uid))return void J(!1);let e=null==eA?void 0:eA.subscriptionLevel;if(e&&"free"!==e)return void J(!1);eA&&((0,b.Iy)(M.uid,!0)?J(!0):J(!1))},[null==M?void 0:M.uid,null==eA?void 0:eA.subscriptionLevel]),(0,m.useEffect)(()=>{Y&&(0,l.sx)("high_intent_scan_card_shown",{page:"checker"})},[Y]),(0,m.useEffect)(()=>{let e=localStorage.getItem("defaultAnalysisType");e&&(ea(e),Z(e))},[]),(0,m.useEffect)(()=>()=>{document.querySelectorAll('video[data-purpose="thumbnail"]').forEach(e
1=>e.remove())},[]),(0,m.useEffect)(()=>{let e="true"===localStorage.getItem(U);eI||eF("true"===localStorage.getItem(L)),e_(e),e&&!eI&&eo&&eE(!0)},[eo,eI]);let eq=async e=>{if((0,l.sx)("file_selected",{file_type:e.type,file_size:e.size,page:"checker"}),!M||!M.emailVerified)return void en(!0);if((null==eA?void 0:eA.subscriptionLevel)==="free"){let e=(null==eA?void 0:eA.scansRemaining)||0,t=(null==eA?void 0:eA.scanCredits)||0;if(e<=0&&t<=0)return void er("You have no scans remaining. Get a scan pack to keep checking videos.")}if(e.size>0xc800000)return void alert("File is too large. Maximum size is 200MB");if(!e.type.startsWith("video/"))return void alert("Please upload a video file");H(null),i(e),P("idle");try{await new Promise((t,s)=>{let a=document.createElement("video"),l=document.createElement("canvas");a.autoplay=!1,a.muted=!0,a.src=URL.createObjectURL(e),a.onloadeddata=()=>{let e,r,i=a.videoWidth/a.videoHeight;i>1?r=(e=Math.min(400,a.videoWidth))/i:e=(r=Math.min(400,a.videoHeight))*i,l.width=e,l.height=r,a.currentTime=.01,a.onseeked=()=>{try{l.getContext("2d").drawImage(a,0,0,e,r);let s=l.toDataURL("image/jpeg",.7);et(s),URL.revokeObjectURL(a.src),t(s)}catch(e){console.error("Error generating thumbnail:",e),s(e)}finally{a.remove(),l.remove()}}},a.onerror=e=>{console.error("Video error:",e),URL.revokeObjectURL(a.src),a.remove(),l.remove(),s(e)}})}catch(e){console.error("Failed to generate thumbnail:",e),er("Failed to generate video thumbnail")}},eG=async()=>{let e=(0,N.xI)();return await e.currentUser.getIdToken(!0)},eQ=async()=>{let e;if((0,l.sx)("analysis_submitted",{analysis_type:X,page:"checker"}),!r)return;if(!eo)return void er("Please select a video type");if((null==eA?void 0:eA.subscriptionLevel)==="free"&&0>=((null==eA?void 0:eA.scanCredits)||0))try{let e=await A();if(await _(),e.data.scansRemaining<=0){K(!0),er("You have already used your free trial from this IP address. Please upgrade to continue.");return}}catch(e){console.error("Error checking IP trial status before submission:",e),er("Unable to verify trial eligibility. Please try again later.");return}let t=(null==eA?void 0:eA.subscriptionLevel)&&"free"!==eA.subscriptionLevel||((null==eA?void 0:eA.scanCredits)||0)>0;eC(t);let s="shop"===eo?"Tik Tok Shop Rules":X;P("uploading");try{let a=(0,x.c7)(),i="".concat(Date.now(),"-").concat(r.name),n=(0,x.KR)(a,"temp/".concat(i)),o={contentType:r.type,customMetadata:{"Access-Control-Allow-Origin":"*","Access-Control-Allow-Methods":"GET, POST, PUT, DELETE, OPTIONS","Access-Control-Allow-Headers":"Content-Type, Authorization"}},d=(0,x.bp)(n,r,o);d.on("state_changed",e=>{let t=e.bytesTransferred/e.totalBytes*100;c(t)},e=>{console.error("Upload error:",e),P("error"),er("Failed to upload video")},async()=>{try{let r=await (0,x.qk)(d.snapshot.ref);P("processing"),eu(k["Starting processing"]),ep("Starting processing..."),e=setInterval(async()=>{try{let t=await eG(),s=encodeURIComponent(i),a="".concat(w.replace(/\/$/,"")).concat(o,"/status/").concat(s),l=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(t)}});if(l.ok){let t=await l.json();void 0!==k[t.status]&&(eu(k[t.status]),ep(t.status)),"Complete"===t.status&&clearInterval(e)}else{let e;try{e=await l.json()}catch(t){e={error:await l.text()}}if(console.error("Status check failed:",{status:l.status,data:e}),403===l.status&&"auth/id-token-expired"===e.code)return}}catch(e){console.error("Status polling error:",e)}},2e3),ex(e);let n=await eG(),o="/processVideoTest",c=await fetch("".concat(w).concat(o),{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(n)},body:JSON.stringify({videoUrl:r,userId:M.uid,fileName:i,analysisType:s,videoType:eo,deviceId:eD,isPaidForThisScan:t})});if(!c.ok){let e,t=await c.text();console.error("Response error:",{status:c.status,text:t});try{let s=JSON.parse(t);e=s.message||s.error||"Failed to process video",403===c.status&&(e.includes("Trial scan already used")||e.includes("Trial already used from this IP address"))&&K(!0)}catch(s){e=t||"HTTP error! status: ".concat(c.status)}throw P("error"),er(e),ep("Processing failed"),eu(0),Error(e)}let u=await c.json();if("success"===u.status){var a;eu(100),ep("Complete");let e={...u.analysis,enhancedFeatures:u.enhancedFeatures||null,storagePath:u.storagePath||null,videoUrl:u.videoUrl||null};H(e),u.thumbnailUrl&&et(u.thumbnailUrl),P("complete"),(null==(a=u.analysis.policyViolations)?void 0:a.length)>
10&&er("Content policy violations detected at ".concat(u.analysis.policyViolations.map(e=>"".concat(e.timestamp,"s")).join(", "),". Please review and modify the content."));try{let e=await (0,y.x7)((0,y.H9)(l.db,"users",M.uid));if(e.exists()){let t=e.data(),s=q.current,a=(0,b.S)({uid:M.uid,fresh:t,prevTotalCreditsUsed:s});eR(e=>{var s;return{...e,...t,scansRemaining:t.scansRemaining||0,scansPerDay:t.scansPerDay||0,scanCredits:t.scanCredits||0,totalCreditsUsed:void 0!==t.totalCreditsUsed&&null!==t.totalCreditsUsed?t.totalCreditsUsed:null!=(s=null==e?void 0:e.totalCreditsUsed)?s:0,nextRefreshDate:t.nextRefreshDate}}),q.current=a.nextTotalCreditsUsed,a.openModal&&(0,b.b)(M.uid),a.showScanCardUpsell&&J(!0),"free"===(t.subscriptionLevel||"free")&&0===(t.scansRemaining||0)&&0===(t.scanCredits||0)&&setTimeout(()=>B(!0),3e3)}}catch(e){console.error("Failed to refresh user data after scan:",e)}eL||(localStorage.setItem(U,"true"),e_(!0))}else throw Error(u.message||"Analysis failed")}catch(t){e&&clearInterval(e),P("error"),er(t.message||"Failed to process video"),ep("Processing failed"),eu(0)}})}catch(t){e&&clearInterval(e),eh&&(clearInterval(eh),ex(null)),P("error"),er(t.message||"Failed to process video"),ep("Processing failed"),eu(0)}},e$=async e=>{try{eH(!0),ez(!1),await (0,y.mZ)((0,y.H9)(l.db,"users",M.uid),{hardestPart:e.hardestPart,mostHelpWith:e.mostHelpWith,wouldActuallyUse:e.wouldActuallyUse,wouldActuallyUseOther:e.wouldActuallyUseOther||null,questionsAnsweredAt:new Date}),localStorage.setItem(L,"true"),eF(!0),eE(!1),ez(!0),(0,l.sx)("feedback_submitted",{hardestPart:e.hardestPart,mostHelpWith:e.mostHelpWith,wouldActuallyUse:e.wouldActuallyUse,hasOther:!!e.wouldActuallyUseOther})}catch(e){console.error("Error saving feedback:",e),er("Failed to save feedback. Please try again.")}finally{eH(!1)}},eK=M&&M.emailVerified&&(null==eA?void 0:eA.subscriptionLevel)==="free"&&0>=((null==eA?void 0:eA.scansRemaining)||0)&&0>=((null==eA?void 0:eA.scanCredits)||0);(0,m.useEffect)(()=>{z||M||eN.push("/auth")},[M,z,eN]);let eX=async()=>{if(eA&&"free"!==eA.subscriptionLevel&&eA.nextRefreshDate){let e;if(e=eA.nextRefreshDate instanceof Date?eA.nextRefreshDate.getTime():eA.nextRefreshDate&&"function"==typeof eA.nextRefreshDate.toDate?eA.nextRefreshDate.toDate().getTime():eA.nextRefreshDate?new Date(eA.nextRefreshDate).getTime():0,Date.now()>=e)try{let e=await (0,N.xI)().currentUser.getIdToken(),t=await fetch("https://us-central1-noviolation-ee22f.cloudfunctions.net/manualScanRefresh",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer ".concat(e)},body:JSON.stringify({force:!0})}),s=await t.json();if(s.success)try{let e=await (0,y.x7)((0,y.H9)(l.db,"users",M.uid));if(e.exists()){let t=e.data();eR({...t,scansRemaining:t.scansRemaining||0,scansPerDay:t.scansPerDay||0,nextRefreshDate:t.nextRefreshDate,lastScanRefresh:t.lastScanRefresh})}}catch(e){eR(e=>({...e,scansRemaining:s.newScansRemaining,nextRefreshDate:new Date(s.nextRefreshDate)}))}}catch(e){console.error("[AUTO REFRESH] Error refreshing scans:",e)}}};return((0,m.useEffect)(()=>{eX();let e=setInterval(eX,3e3);return()=>clearInterval(e)},[null==eA?void 0:eA.nextRefreshDate]),z)?(0,a.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:(0,a.jsx)("div",{className:"animate-spin h-8 w-8 border-4 border-purple-600 border-t-transparent rounded-full"})}):M&&M.emailVerified?(0,a.jsxs)("div",{className:"min-h-screen bg-white",children:[(0,a.jsx)(p.A,{title:"Violation Checker - NoViolation.ai",description:"Upload your TikTok video and get instant feedback on potential violations. AI-powered analysis to protect your account.",keywords:"tiktok violation checker, content analysis, video moderation, ai content check",ogImage:"/images/og-checker.jpeg"}),(0,a.jsx)(h.A,{}),(0,a.jsx)("main",{className:"max-w-7xl mx-auto px-4 md:px-8 py-12",children:(0,a.jsxs)("div",{className:"max-w-3xl mx-auto",children:[(0,a.jsxs)("div",{className:"text-center mb-8",children:[(0,a.jsx)("h1",{className:"text-3xl md:text-4xl font-bold mb-2",children:"Analyze Your Video"}),(0,a.jsx)("p",{className:"text-base text-gray-600",children:"Scan your video for TikTok violations"})]}),eT?(0,a.jsx)("div",{className:"mb-6 p-4 border border-purple-100 rounded-lg bg-white shadow-sm flex justify-center",children:(0,a.jsx)("div",{className:"animate-pulse flex space-x-4 w-full",children:(0,a.jsxs)("div",{className:"flex-1 space-y-3 py-1",children:[(0,a.jsx)("div",{className:"h-4 bg-gray-200 rounded w-3/4"}),(0,a.jsx)("div",{className:"h-4 bg-gray-200 rounded w-full"}),(0,a.jsx)("div",{className:"h-4 bg-gray-200 rounded w-5/6"})]})})}):eA&&(0,a.jsx)(O,{userData:eA,highIntentScanCardActive:(null==eA?void 0:eA.subscriptionLevel)==="free"&&Y,onHighIntentGoPro:()=>{(0,l.sx)("high_intent_scan_card_go_pro",{page:"checker"}),eN.push({pathname:"/checkout",query:{plan:"pro"}}),J(!1)},onHighIntentKeepScanning:()=>{(null==M?void 0:M.uid)&&((0,l.sx)("high_intent_scan_card_keep_scans",{page:"checker"}),(0,b.q8)(M.uid),J(!1))}}),(0,a.jsxs)("div",{className:"space-y-6",children:[!1,(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-purple-100 p-6",children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold mb-4 flex items-center",children:[(0,a.jsx)("span",{className:"bg-purple-100 text-purple-600 w-6 h-6 rounded-full flex items-center justify-center mr-2 text-sm",children:"1"}),"Select Video Type"]}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:S.map(e=>(0,a.jsxs)("button",{onClick:()=>ec(e.id),className:"p-4 rounded-lg border-2 transition-colors text-left ".concat(eo===e.id?"border-purple-600 bg-purple-50":"border-gray-200 hover:border-purple-300"),children:[(0,a.jsx)("h3",{className:"font-medium mb-1",children:e.label}),(0,a.jsx)("p",{className:"text-sm text-gray-600",children:e.description})]},e.id))})]}),"regular"===eo&&(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-purple-100 p-6 ".concat(eo?"":"opacity-50 pointer-events-none"),children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold mb-4 flex items-center",children:[(0,a.jsx)("span",{className:"bg-purple-100 text-purple-600 w-6 h-6 rounded-full flex items-center justify-center mr-2 text-sm",children:"2"}),"Choose Analysis Type"]}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:C.map(e=>(0,a.jsxs)("button",{onClick:()=>Z(e.value),className:"p-4 rounded-lg border-2 transition-colors text-left ".concat(X===e.value?"border-purple-600 bg-purple-50":"border-gray-200 hover:border-purple-300"),children:[(0,a.jsx)("h3",{className:"font-medium mb-1",children:e.label}),(0,a.jsx)("p",{className:"text-sm text-gray-600",children:e.description})]},e.id))})]}),eL&&!eI||eY&&!eM?(0,a.jsx)(E,{onSubmit:e$,responses:eW,setResponses:eB,stepNumber:"regular"===eo?"3":"2",isDisabled:!eo||"regular"===eo&&!X,isSaving:eV,isSaved:eM}):null,(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-purple-100 p-6 ".concat(eK||eo&&("regular"!==eo||X)&&
1(!eL||eI)&&(!eY||eM)?"":"opacity-50 pointer-events-none"),children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold mb-4 flex items-center",children:[(0,a.jsx)("span",{className:"bg-purple-100 text-purple-600 w-6 h-6 rounded-full flex items-center justify-center mr-2 text-sm",children:(()=>{if("regular"===eo)if(eL&&!eI)return"4";else return"3";return eL&&!eI?"3":"2"})()}),"Upload Your Video"]}),(0,a.jsx)("div",{className:"border-2 border-dashed rounded-xl p-8 text-center transition-colors\n ".concat(t?"border-purple-600 bg-purple-50":"border-gray-300","\n ").concat(r?"bg-gray-50":""),onDragOver:e=>{e.preventDefault(),s(!0)},onDragLeave:()=>{s(!1)},onDrop:e=>{if(e.preventDefault(),s(!1),!M||!M.emailVerified)return void en(!0);let t=e.dataTransfer.files[0];(null==t?void 0:t.type.startsWith("video/"))&&eq(t)},children:M&&((null==eA?void 0:eA.subscriptionLevel)==="free"?(null==eA?void 0:eA.scansRemaining)>0||((null==eA?void 0:eA.scanCredits)||0)>0:M.emailVerified)&&(!eL||eI||eM)&&(!eY||eM)?"complete"===T&&D?(0,a.jsxs)("div",{className:"text-center space-y-6",children:[(0,a.jsx)("div",{className:"mb-6",children:(0,a.jsx)("span",{className:"text-4xl",children:"â
"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold mb-3",children:"Analysis Complete"}),(0,a.jsx)("input",{type:"file",accept:"video/*",className:"hidden",onChange:e=>{(0,l.sx)("checker_reset",{page:"checker"}),i(null),H(null),c(0),P("idle"),et(null),Z(es),eq(e.target.files[0])},id:"upload-another"}),(0,a.jsx)("label",{htmlFor:"upload-another",className:"bg-purple-600 text-white px-6 md:px-8 py-3 md:py-4 rounded-lg font-medium hover:bg-purple-700 transition-colors cursor-pointer inline-block",children:"Analyze Another Video"})]}):(0,a.jsxs)("div",{className:"text-center",children:[ee&&r?(0,a.jsxs)("div",{className:"relative w-24 h-44 mx-auto mb-4",children:[(0,a.jsx)("img",{src:ee,alt:"Video thumbnail",className:"w-full h-full object-cover rounded-lg shadow-sm"}),(0,a.jsx)("button",{onClick:()=>{i(null),et(null)},className:"absolute -top-2 -right-2 bg-red-500 text-white rounded-full p-1 hover:bg-red-600",children:(0,a.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})})]}):(0,a.jsx)("div",{className:"mb-6",children:(0,a.jsx)("span",{className:"text-4xl",children:"\uD83D\uDCE4"})}),(0,a.jsx)("h3",{className:"text-lg font-semibold mb-3",children:"Drag and drop your video here"}),(0,a.jsx)("p",{className:"text-sm md:text-base text-gray-600 mb-8",children:"or click to select a file from your computer"}),(0,a.jsx)("input",{type:"file",accept:"video/*",className:"hidden",onChange:e=>eq(e.target.files[0]),id:"file-upload"}),(0,a.jsx)("label",{htmlFor:"file-upload",className:"bg-purple-600 text-white px-6 md:px-8 py-3 md:py-4 rounded-lg font-medium hover:bg-purple-700 transition-colors cursor-pointer text-sm md:text-base",children:"Select video"}),r&&"idle"===T&&(0,a.jsxs)("div",{className:"mt-4 text-center",children:[(0,a.jsxs)("p",{className:"mb-2 text-gray-600",children:["You have selected: ",(0,a.jsx)("strong",{children:r.name})]}),(!eo||"regular"===eo&&!X)&&(0,a.jsxs)("p",{className:"text-amber-600 text-sm mb-4",children:["Please ",eo?"select an analysis type":"select a video type"," before submitting"]}),(0,a.jsx)("button",{onClick:eQ,disabled:!eo||"regular"===eo&&!X,className:"bg-purple-600 text-white px-6 md:px-8 py-3 md:py-4 rounded-lg font-medium \n transition-colors ".concat(eo&&("regular"!==eo||X)?"hover:bg-purple-700":"opacity-50 cursor-not-allowed"),children:"Submit Video for Analysis"})]})]}):(0,a.jsxs)("div",{className:"text-center space-y-6 pointer-events-auto",children:[(0,a.jsx)("div",{className:"mb-6",children:(0,a.jsx)("span",{className:"text-4xl md:text-6xl",children:"\uD83D\uDD12"})}),(0,a.jsx)("h3",{className:"text-lg md:text-xl font-semibold mb-2",children:M&&M.emailVerified?eL&&!eI||eY&&!eM?"Please Complete the Feedback Form":"Out of scans":"Please Sign In to Continue"}),(0,a.jsx)("p",{className:"text-sm md:text-base text-gray-600 mb-6",children:M&&M.emailVerified?eL&&!eI||eY&&!eM?"We value your feedback! Please complete the quick feedback form above to continue analyzing videos.":"You've used all your free scans. Grab a scan pack to keep checking videos before you post.":"Sign in or create an account to check your videos"}),(0,a.jsx)("div",{className:"space-y-4",children:M&&M.emailVerified?eL&&!eI||eY&&!eM?(0,a.jsx)("button",{onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),className:"inline-block bg-purple-600 text-white px-6 md:px-8 py-3 md:py-4 rounded-lg font-medium hover:bg-purple-700 transition-colors",children:"Go to Feedback Form"}):(0,a.jsx)(d(),{href:"/pricing",className:"inline-block bg-purple-600 text-white px-6 md:px-8 py-3 md:py-4 rounded-lg font-medium hover:bg-purple-700 transition-colors pointer-events-auto",children:"Get 5 scans for $1.50"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d(),{href:"/auth",className:"inline-block bg-purple-600 text-white px-6 md:px-8 py-3 md:py-4 rounded-lg font-medium hover:bg-purple-700 transition-colors",children:"Sign In"}),(0,a.jsx)(d(),{href:"/auth?signup=true",className:"block text-purple-600 hover:text-purple-700",children:"Create Account"})]})})]})})]}),("idle"!==T||D)&&(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-purple-100 p-6",children:["uploading"===T&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)("div",{className:"h-2 w-full bg-gray-200 rounded-full overflow-hidden",children:(0,a.jsx)("div",{className:"h-full bg-purple-600 transition-all duration-300",style:{width:"".concat(n,"%")}})}),(0,a.jsxs)("p",{className:"text-sm text-gray-600 text-center",children:["Uploading... ",Math.round(n),"%"]})]}),"processing"===T&&(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("div",{className:"h-2 w-full bg-gray-200 rounded-full overflow-hidden",children:(0,a.jsx)("div",{className:"h-full transition-all duration-300 ".concat("error"===T?"bg-red-500":"Complete"===em?"bg-green-500":"bg-purple-600"),style:{width:"".concat(ed,"%")}})}),(0,a.jsx)("div",{className:"flex items-center justify-center gap-2",children:"error"===T?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("svg",{className:"h-5 w-5 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),(0,a.jsx)("span",{className:"text-red-500",children:el||"Processing failed"})]}):"Complete"===em?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("svg",{className:"h-5 w-5 text-green-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),(0,a.jsx)("span",{className:"text-green-500",children:"Analysis Complete!"})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("svg",{className:"animate-spin h-5 w-5 text-purple-600",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4",fill:"none"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),(0,a.jsx)("span",{className:"text-purple-600",children:em})]})})]}),"complete"===T&&(()=>{if(!D)return null;let e=eS||(null==eA?void 0:eA.subscriptionLevel)&&(null==eA?void 0:eA.subscriptionLevel)!=="free"||(null==eA?void 0:eA.scanCredits)>0;return(0,a.jsx)(V,{analysisResult:D,userData:eA,isPaidForThisScan:e,onOpenTimeline:()=>{ej(D),eb(!0)}})})(),G&&(0,a.jsx)("div",{className:"bg-red-50 text-red-600 p-4 rounded-lg mt-4",children:G}),(null==D?void 0:D.policyViolations)&&(0,a.jsx)(e=>{let{violations:t}=e;return(null==t?void 0:t.length)?(0,a.jsx)("div",{className:"mt-4 bg-red-50 border-l-4 border-red-500 p-4",children:(0,a.jsxs)("div",{className:"flex",children:[(0,a.jsx)("div",{className:"flex-shrink-0",children:(0,a.jsx)("svg",{className:"h-5 w-5 text-red-400",viewBox:"0 0 20 20",fill:"currentColor",children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})})}),(0,a.jsxs)("div",{className:"ml-3",children:[(0,a.jsx)("h3",{className:"text-sm font-medium text-red-800",children:"Content Policy Violations Detected"}),(0,a.jsxs)("div",{className:"mt-2 text-sm text-red-700",children:[(0,a.jsx)("p",{children:"Violations foun
1d at timestamps:"}),(0,a.jsx)("ul",{className:"list-disc list-inside mt-1",children:t.map((e,t)=>(0,a.jsxs)("li",{children:[e.timestamp," seconds"]},t))}),(0,a.jsx)("p",{className:"mt-2",children:"Please review and modify the content at these timestamps."})]})]})]})}):null},{violations:D.policyViolations}),"error"===T&&(0,a.jsx)("div",{className:"bg-red-50 border-l-4 border-red-500 p-4 mt-4",children:(0,a.jsxs)("div",{className:"flex",children:[(0,a.jsx)("div",{className:"flex-shrink-0",children:(0,a.jsx)("svg",{className:"h-5 w-5 text-red-400",viewBox:"0 0 20 20",fill:"currentColor",children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"})})}),(0,a.jsxs)("div",{className:"ml-3",children:[(0,a.jsx)("h3",{className:"text-sm font-medium text-red-800",children:"Processing Error"}),(0,a.jsxs)("div",{className:"mt-2 text-sm text-red-700",children:[(0,a.jsx)("p",{children:el}),el.includes("scans remaining")&&(0,a.jsxs)("p",{className:"mt-2",children:["Your daily scan limit has been reached. Scans will refresh in 24 hours, or you can"," ",(0,a.jsx)(d(),{href:"/pricing",className:"text-purple-700 hover:text-purple-900 font-medium",children:"upgrade your plan"})," ","for more scans."]})]})]})]})})]})]}),(0,a.jsx)("div",{className:"mt-8",children:(0,a.jsx)("div",{className:"bg-blue-50 p-4 rounded-lg border border-blue-100",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("div",{className:"text-blue-500 mt-0.5",children:(0,a.jsx)(o.A,{className:"w-5 h-5"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"font-medium text-blue-800 text-sm",children:"AI Suggestion Disclaimer"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-blue-700",children:"The suggested fixes are generated by AI and may not be 100% accurate. While our system aims to provide helpful guidance, please use your judgment when implementing changes. Our analysis is based on current understanding of content policies, which may evolve over time."})]})]})})})]})}),(0,a.jsx)(u.A,{}),W&&(null==eA?void 0:eA.subscriptionLevel)==="free"&&(0,a.jsx)(f.A,{hasUsedTrial:$,subscriptionLevel:null==eA?void 0:eA.subscriptionLevel,nextRefreshDate:null==eA||null==(e=eA.nextRefreshDate)?void 0:e.toDate(),onClose:()=>B(!1)}),ei&&(0,a.jsx)(LoginPrompt,{}),(0,a.jsx)(v.A,{isOpen:ev,onClose:()=>eb(!1),analysisData:ey,isPaidUser:eS||(null==eA?void 0:eA.subscriptionLevel)&&(null==eA?void 0:eA.subscriptionLevel)!=="free"||(null==eA?void 0:eA.scanCredits)>0})]}):(eN.push("/auth"),null)}}},e=>{e.O(0,[8,587,751,987,78,27,636,593,792],()=>e(e.s=6172)),_N_E=e.O()}]);
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.