1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1b645a58-1049-4f06-b56f-2f2364a62d7c",e._sentryDebugIdIdentifier="sentry-dbid-1b645a58-1049-4f06-b56f-2f2364a62d7c")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[12858,37943],{2111:(e,t,r)=>{let n;function i(e){n=e}function a(){return n}r.d(t,{K:()=>a,u:()=>i})},7837:(e,t,r)=>{r.d(t,{Pq:()=>i,_l:()=>a,d0:()=>n});let n=24;function i(e){return Array.from(e).length>n}function a(e){let t=Array.from(e);return t.length>n?t.slice(0,n-1).join("").trimEnd()+"â¦":e}},12107:(e,t,r)=>{r.d(t,{Y:()=>n});async function n(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:15e3,r=arguments.length>2?arguments[2]:void 0,n=new AbortController,i=()=>n.abort(new DOMException("Request cancelled","AbortError"));r?.aborted?i():r?.addEventListener("abort",i,{once:!0});let a=setTimeout(()=>n.abort(new DOMException("Request timed out","TimeoutError")),t),o=()=>{},s=new Promise((e,t)=>{o=()=>t(n.signal.reason),n.signal.aborted?o():n.signal.addEventListener("abort",o,{once:!0})});try{return await Promise.race([n.signal.aborted?s:e(n.signal),s])}finally{clearTimeout(a),r?.removeEventListener("abort",i),n.signal.removeEventListener("abort",o)}}},12510:(e,t,r)=>{r.d(t,{h:()=>i});var n=r(91993);class i extends Error{kind;status;code;userMessageKey;constructor(e){super(e.message),this.name="ApiError",this.kind=e.kind,this.status=e.status,this.code=e.code,this.userMessageKey=(0,n.do)(e.kind)}get retryable(){return(0,n.r3)(this.kind)}}},37411:(e,t,r)=>{async function n(e){return Array.from(new Uint8Array(await crypto.subtle.digest("SHA-256",new TextEncoder().encode(e)))).map(e=>e.toString(16).padStart(2,"0")).join("")}async function i(){let e=crypto.randomUUID();return{raw:e,hashed:await n(e)}}r.d(t,{y:()=>i})},42820:(e,t,r)=>{r.r(t),r.d(t,{default:()=>l,safeInternalRedirect:()=>c.n});var n=r(19749),i=r(53584),a=r(82222),o=r(12115);let s=!1;var u=r(62689),c=r(61124);function l(){let e,t,r,l=(0,n.c)(13),b=(0,a.useRouter)(),y=(0,a.usePathname)(),x=(0,i.useSupabaseAuthStore)(w),E=(0,i.useSupabaseAuthStore)(m),k=(0,i.useSupabaseAuthStore)(g),S=(0,i.useSupabaseAuthStore)(h),v=(0,i.useSupabaseAuthStore)(f),A=(0,i.useSupabaseAuthStore)(p),q=(0,i.useSupabaseAuthStore)(d);l[0]!==y?(e=(0,u.ou)(y)&&s,l[0]=y,l[1]=e):e=l[1];let M=(0,o.useRef)(e);return l[2]!==q||l[3]!==v||l[4]!==x||l[5]!==E||l[6]!==k||l[7]!==S||l[8]!==y||l[9]!==b||l[10]!==A?(t=()=>{if(!x){M.current=!1,s=!1;return}if(M.current){M.current=!1,s=!1,q();return}if((E||k)&&!A&&!S)return;let e=(0,c.n)(new URLSearchParams(window.location.search).get("redirect")),t=setTimeout(()=>{((0,u.ou)(y)&&(s=!0),b.refresh(),S)?b.replace("/complete-signup"):!1===v?b.replace("/welcome"):b.replace(e??"/home")},0);return()=>clearTimeout(t)},r=[x,E,k,S,b,v,A,y,M,q],l[2]=q,l[3]=v,l[4]=x,l[5]=E,l[6]=k,l[7]=S,l[8]=y,l[9]=b,l[10]=A,l[11]=t,l[12]=r):(t=l[11],r=l[12]),(0,o.useEffect)(t,r),null}function d(e){return e.endStaleSession}function p(e){return!!e.user}function f(e){return e.user?.firstSessionCompleted}function h(e){return e.needsProfileCompletion}function g(e){return e.isRecovering}function m(e){return e.isLoading}function w(e){return e.isAuthenticated}},43672:(e,t,r)=>{r.r(t),r.d(t,{ApiError:()=>n.h,apiFetch:()=>h,reportClientError:()=>b});var n=r(12510),i=r(28594),a=r(2111),o=r(12107),s=r(7724),u=r(57189),c=r(22265),l=r(91993),d=r(63118);function p(e){return"server"===e||"db_down"===e||"unknown"===e}function f(e,t){return e&&"object"==typeof e?{message:"string"==typeof e.error&&e.error||"string"==typeof e.message&&e.message||t,code:"string"==typeof e.code?e.code:void 0}:"string"==typeof e&&e.trim()?{message:e.slice(0,300)}:{message:t}}async function h(e){let t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};{let t=(0,d.getNetworkStatus)(),n=!1===navigator.onLine||!t.online;if(n||!1===t.serverReachable){let{readOfflineApi:t}=await Promise.all([r.e(93263),r.e(62059)]).then(r.bind(r,93263));try{let r=await t(e,i);if(r)return r.data}catch(e){if(n||i.signal?.aborted)throw e}}}let{timeoutMs:a=15e3,...s}=i,h=s;try{(0,c.x)()&&(h=await (0,u.prepareAIRequest)(e,s))}catch(e){if(e instanceof u.AIConsentDeclinedError)throw new n.h({kind:"val
1idation",message:e.message,status:428,code:"AI_CONSENT_REQUIRED"});throw e}let{signal:g,headers:m,...w}=h,y=new Headers(m);y.has("Accept")||y.set("Accept","application/json");let x=null,E=!1;try{t=await (0,o.Y)(async t=>{let r=await fetch(e,{...w,headers:y,signal:t}),n=(r.headers.get("content-type")??"").includes("application/json");try{x=n?await r.json():await r.text()}catch(e){if(t.aborted)throw t.reason;if(e instanceof TypeError)throw e;E=n}return r},a,g)}catch(r){let e=r instanceof DOMException&&"TimeoutError"===r.name?"timeout":(0,l.xO)(r);g?.aborted||"network"!==e&&"db_down"!==e&&"server"!==e&&"timeout"!==e||(0,d.Jz)();let t=new n.h({kind:e,message:r instanceof Error?r.message:"Request failed"});throw p(e)&&b({kind:e,message:t.message,source:"client"}),t}if(t.ok){if(E)throw new n.h({kind:"network",message:"Malformed response body",status:t.status});let e=x;if(e&&"object"==typeof e&&!1===e.success){let{message:r,code:i}=f(x,"Request failed"),a=(0,l.nW)({status:t.status,code:i,body:e});throw("db_down"===a||"server"===a)&&(0,d.Jz)(),new n.h({kind:a,message:r,status:t.status,code:i})}(0,d.Qy)();var k=x;return k&&"object"==typeof k&&!0===k.success&&"data"in k?k.data:k}let{message:S,code:v}=f(x,`Request failed (${t.status})`),A=(0,l.nW)({status:t.status,code:v,body:x});("db_down"===A||"server"===A)&&(0,d.Jz)();let q=new n.h({kind:A,message:S,status:t.status,code:v});throw p(A)&&b({kind:A,message:S,code:v,source:"client",statusCode:t.status}),q}let g=new Map,m=Date.now(),w=0;function b(e){try{if(!(0,i.hO)(document.cookie))return;let t=Date.now();if(t-m>6e4&&(m=t,w=0),w>=20)return;let r=e.path??window.location?.pathname??"unknown",n=`${e.kind??"unknown"}|${e.message}|${r}`,o=g.get(n);if(o&&t-o<3e4)return;if(g.set(n,t),g.size>100)for(let[e,r]of g)t-r>3e4&&g.delete(e);w++;let u=JSON.stringify({message:String(e.message).slice(0,2e3),kind:e.kind?String(e.kind).slice(0,64):void 0,source:e.source??"client",code:e.code?String(e.code).slice(0,200):void 0,path:String(r).slice(0,500),componentStack:e.componentStack?String(e.componentStack).slice(0,4e3):void 0,stack:e.stack?String(e.stack).slice(0,4e3):void 0,statusCode:e.statusCode,critical:!0===e.critical||"render"===e.source||void 0,surface:(0,s.EK)()?"capacitor":"web",version:"1.129.0",release:"7756fb3d8e8ef6d9e7a7f76bdf1fdd1473816d87",appSessionId:(0,a.K)()});fetch("/api/internal/client-errors",{method:"POST",headers:{"Content-Type":"application/json"},body:u,keepalive:!0}).catch(()=>{})}catch{}}},51336:(e,t,r)=>{function n(e){try{let t="string"==typeof e?.message?e.message.toLowerCase():"",r=(e?.code||"").toString().toLowerCase(),n="number"==typeof e?.status?e.status:void 0;if(t.includes("timeout")||t.includes("timed out")||t.includes("failed to fetch")||t.includes("fetch failed")||t.includes("load failed")||t.includes("network")||"ecnnreset"===r||"econnreset"===r||"etimedout"===r||"number"==typeof n&&n>=500||["500","502","503","504"].includes(r))return!0}catch{}return!1}async function i(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300;for(let a=0;a<=r;a++)try{return await e()}catch(e){if(t=e,!n(e)||a===r)throw e;await function(e){return new Promise(t=>setTimeout(t,e))}(i*Math.pow(2,a))}throw t}async function a(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3e4;try{return await Promise.race([Promise.resolve(e),new Promise((e,n)=>{t=setTimeout(()=>n(Error("Request timeout")),r)})])}finally{void 0!==t&&clearTimeout(t)}}async function o(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:12e3;try{return await Promise.race([Promise.resolve(e),new Promise((e,n)=>{t=setTimeout(()=>n(Error("Authentication request timeout - please check your connection")),r)})])}catch(e){throw e instanceof Error&&e.message.includes("timeout"),e}finally{void 0!==t&&clearTimeout(t)}}async function s(e,t){let r=t?.timeoutMs??3e4;return i(()=>a(e(),r),t?.retries??2)}async function u(e,t){let r=t?.timeoutMs??12e3;return i(()=>o(e(),r),t?.retries??1)}r.d(t,{Nj:()=>s,bD:()=>i,bV:()=>n,jl:()=>u,wj:()=>a})},61124:(e,t,r)=>{r.d(t,{n:()=>n});function n(e){return!e||!e.startsWith("/")||e.startsWith("//")||e.includes("\\")||Array.from(e).some(e=>32>e.charCodeAt(0)||127===e.charCodeAt(0))?null:e}},92285:(e,t,r)=>{r.d(t,{M_:()=>n,O:()=>h,R:()=>d,W4:()=>c,aj:()=>i,gh:()=>a,hE:()=>p,p:()=>f,q4:()=>l,vi:()=>u});let n={correctAnswer:10,incorrectAnswer:0,streakBonus:5,grammarPointMastered:25,dailyGoalMet:25,weeklyGoalBasePerDay:30,perfectReview:20,conjugationCorrect:1,vocabularyMastered:5,listeningMastered:6,idiomMeaningCorrect:1,idiomSentenceCorrect:3};function i(e,t){return t?`${e}_manual`:e}let a={white:{requiredExp:0,maxStripes:4},blue:{requiredExp:12e3,maxStripes:4},purple:{requiredExp:36e3,maxStripes:4},brown:{requiredExp:72e3,maxStripes:4},black:{requiredExp:144e3,maxStripes:6},coral:{requiredExp:288e3,maxStripes:6},red:{requiredExp:576e3,maxStripes:6}},o=["white","blue","purple","brown","black","coral","red"];function s(e){return 10*o.indexOf(e.rank)+e.stripe}function u(e){let t,r=Math.max(0,Math.trunc(e)),n="white";for(let e=o.length-1;e>=0;
1e-=1){let t=o[e];if(r>=a[t].requiredExp){n=t;break}}let i=o.indexOf(n),s=a[n],u=o[i+1];if(u){let e=(a[u].requiredExp-s.requiredExp)/(s.maxStripes+1);t=Math.min(s.maxStripes,Math.floor((r-s.requiredExp)/e))}else t=s.maxStripes;return{rank:n,stripe:t,experience:0,requiredExperience:s.requiredExp}}let c=(e,t)=>{if(!e)return{type:"stripe",expNeeded:0};let r=e.rank,n=e.stripe,i=t||e.experience,o=a[r],s=o.maxStripes;if(n<s){let e=l(r);if(e){let t=a[e].requiredExp,r=o.requiredExp,u=r+(t-r)/(s+1)*(n+1);return i>=u?{type:"stripe",expNeeded:0}:{type:"stripe",expNeeded:u-i}}}let u=l(r);if(u){let e=a[u].requiredExp;if(!(i>=e))return{type:"rank",expNeeded:e-i}}return{type:"rank",expNeeded:0}},l=e=>{let t=o.indexOf(e);return t<o.length-1?o[t+1]:null},d={white:{bg:"bg-white border-gray-300 text-gray-700",ring:"ring-gray-300",hex:"#e5e7eb"},blue:{bg:"bg-blue-500 text-white",ring:"ring-blue-500",hex:"#3b82f6"},purple:{bg:"bg-purple-500 text-white",ring:"ring-purple-500",hex:"#a855f7"},brown:{bg:"bg-amber-700 text-white",ring:"ring-amber-700",hex:"#b45309"},black:{bg:"bg-gray-900 text-white",ring:"ring-gray-900",hex:"#111827"},coral:{bg:"bg-[#FF6F61] text-white",ring:"ring-[#FF6F61]",hex:"#FF6F61"},red:{bg:"bg-red-600 text-white",ring:"ring-red-600",hex:"#dc2626"}},p=e=>d[e]?.bg??"bg-gray-300 text-gray-700",f=e=>{switch(e){case"white":default:return"Faixa Branca";case"blue":return"Faixa Azul";case"purple":return"Faixa Roxa";case"brown":return"Faixa Marrom";case"black":return"Faixa Preta";case"coral":return"Faixa Coral";case"red":return"Faixa Vermelha"}},h=(e,t,r)=>{let n=u(Math.max(0,Math.trunc((r??0)+t)));if(!e)return{newBelt:n,promoted:!1};let i=s(e),o=s(n);return o>i?{newBelt:n,promoted:!0,promotionType:n.rank===e.rank?"stripe":"rank"}:{newBelt:o===i?n:{...e,experience:0,requiredExperience:a[e.rank].requiredExp},promoted:!1}}}}]);
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.