PageSourceSearch

https://nlyapp.web.app/_next/static/chunks/pages/achievements-8585d2a90e7356dd.js

js nlyapp.web.app collected 2026-10-03 12:31:53 UTC 11,815 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="de877f9d-3246-4009-b8bc-ba0589f2d33d",e._sentryDebugIdIdentifier="sentry-dbid-de877f9d-3246-4009-b8bc-ba0589f2d33d")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5961],{27883:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/achievements",function(){return n(11215)}])},85922:function(e,t,n){"use strict";var i=n(85893);n(67294);var o=n(80158),l=n(14440),r=n(10355);t.Z=()=>{var e,t;let n=(0,o.CG)(e=>e.config);return(0,i.jsx)(l.Z,{sx:{backgroundColor:null==n?void 0:null===(e=n.paywall)||void 0===e?void 0:e.theme.backgroundColor},children:(0,i.jsx)(l.Z,{sx:{display:"flex",justifyContent:"center"},children:(0,i.jsx)(r.Z,{sx:{borderRadius:8,maxWidth:600,width:"100%",m:3,backgroundColor:"white","& .MuiLinearProgress-bar":{backgroundColor:null===(t=n.paywall)||void 0===t?void 0:t.theme.primary_main}}})})})}},60195:function(e,t,n){"use strict";var i=n(85893),o=n(67294),l=n(14440),r=n(33367),s=n(82290),d=n(60892),a=n(13674);t.Z=e=>{let{children:t}=e,n=(0,a.lh)(),c=(0,o.useRef)(null),[u,f]=(0,o.useState)(!0),[m,p]=(0,o.useState)(!0),h=(0,o.useCallback)(()=>{let e=c.current;if(!e)return;let{scrollLeft:t,scrollWidth:n,clientWidth:i}=e;f(t<=1),p(t+i>=n-1)},[]);(0,o.useEffect)(()=>{h();let e=c.current;if(e)return e.addEventListener("scroll",h,{passive:!0}),window.addEventListener("resize",h),()=>{e.removeEventListener("scroll",h),window.removeEventListener("resize",h)}},[h,t]);let v=e=>{let t=c.current;t&&t.scrollBy({left:e*t.clientWidth*.8,behavior:"smooth"})},g=(e,t)=>({position:"absolute",top:0,bottom:0,[e]:0,width:56,pointerEvents:"none",zIndex:1,opacity:t?1:0,background:"linear-gradient(to ".concat("left"===e?"right":"left",", ").concat(n.backgroundColor,", transparent)"),transition:(0,a.eR)(["opacity"]),...a.Gd}),x={position:"absolute",top:"40%",transform:"translateY(-50%)",zIndex:2,width:38,height:38,backgroundColor:n.backgroundColor,color:n.textColor,border:"1px solid ".concat(n.outlineColor),boxShadow:"0 2px 10px rgba(0, 0, 0, 0.12)",opacity:0,transition:(0,a.eR)(["opacity","background-color"]),...a.Gd,"&:hover":{backgroundColor:n.cardBackgroundColor}};return(0,i.jsxs)(l.Z,{sx:{position:"relative","&:hover .hscroll-arrow":{opacity:1}},children:[(0,i.jsx)(l.Z,{ref:c,sx:{display:"flex",gap:2,overflowX:"auto",scrollBehavior:"smooth",scrollSnapType:"x proximity","& > *":{scrollSnapAlign:"start"},scrollbarWidth:"none",msOverflowStyle:"none","&::-webkit-scrollbar":{display:"none"}},children:t}),(0,i.jsx)(l.Z,{sx:g("left",!u),"aria-hidden":!0}),(0,i.jsx)(l.Z,{sx:g("right",!m),"aria-hidden":!0}),!u&&(0,i.jsx)(r.Z,{className:"hscroll-arrow","aria-label":"Scroll left",onClick:()=>v(-1),sx:{...x,left:6},children:(0,i.jsx)(s.Z,{})}),!m&&(0,i.jsx)(r.Z,{className:"hscroll-arrow","aria-label":"Scroll right",onClick:()=>v(1),sx:{...x,right:6},children:(0,i.jsx)(d.Z,{})})]})}},11215:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return O}});var i=n(85893),o=n(67294),l=n(9008),r=n.n(l),s=n(11163),d=n(14440),a=n(59979),c=n(33367),u=n(94246),f=n(34934),m=n(23066),p=n(56710),h=n(39424),v=n(80158),g=n(8658),x=n(67748),b=n(3817),y=n(30117),C=n(48099),I=n(90109),_=n(12343),w=n(41117),j=n(76647);let E=async(e,t)=>{try{var n;let i=await (0,I.Yp)((0,I.IO)((0,I.hJ)(_.db,x.ym.COMMUNITY_POST),(0,I.ar)("isPost","==",t),(0,I.ar)("userId","==",e)));return(null!==(n=i.data().count)&&void 0!==n?n:0)>1}catch(e){return!1}},k=async e=>{let{uid:t,defs:n,earned:i,history:o,appUser:l,mediaList:r,isSubscribed:s,subDateMs:d}=e;try{var a,c,u,f,m,p,v,g,b,y;let e=(0,j.W)(o),h=null!==(a=l.Sessions)&&void 0!==a?a:0,C=null!==(c=l.TotalTime)&&void 0!==c?c:0,I=Date.now(),_=[],k=[],Z=(e,t)=>null==t?i.some(t=>t.id===e):i.some(n=>n.id===e&&n.achievedDateMs===t),S=(e,t)=>k.some(n=>n.achievementId===e&&n.achievedDateMs===t),M=(e,t)=>{if(Z(e,t||void 0))return;let n=t||I;S(e,n)||k.push({achievementId:e,achievedDateMs:n})},N=e=>/^\s*[+-]?\d+\s*$/.test(null!=e?e:"")?parseInt((null!=e?e:"").trim(),10):null,T=e=>e.dateCompletedUtcMs||I,L=n.filter(e=>!e.isArchived);for(let t of L){if(!["streak","session","total_time"].includes(t.type))continue;let n=N(t.condition);null!=n&&("streak"===t.type?e:"session"===t.type?h:C)>=n&&!Z(t.documentId)&&_.push(t.documentId)}let D=new Map(r.map(e=>[e.docId,e])),A=L.filter(e=>"content"===e.type&&e.condition),P=e=>A.filter(t=>t.condition===e);for(let e of A){let t=e.condition,n=D.get(t),i=o.filter(e=>e.mediaId===t),s=r.filter(e=>{var n,i;return e.type===x.w_.course?(null!==(n=e.mediaList)&&void 0!==n?n:[]).includes(t):e.type===x.w_.advancedCourse&&(null!==(i=e.categories)&&void 0!==i?i:[]).some(e=>{var n;return(null!==(n=e.mediaIds)&&void 0!==n?n:[]).includes(t)})});if(0!==i.length||0!==s.length){if((null==n?void 0:n.type)===x.w_.course){let t=null!==(u=n.mediaList)&&void 0!==u?u:[];for(let n of i){let i=null!==(f=N(n.dayCompleted))&&void 0!==f?f:0;if(t.length>0&&i===t.length&&M(e.documentId,n.dateCompletedUtcMs),i>0&&i<=t.length){let e=t[i-1];for(let t of P(e))M(t.documentId,n.dateCompletedUtcMs)}}}else if((null==n?void 0:n.type)===x.w_.advancedCourse){let t=null!==(p=n.numberOfClasses)&&void 0!==p?p:0,o=null!==(v=null===(m=l.advanced_course_progress)||void 0===m?void 0:m[n.docId])&&void 0!==v?v:[],r=[...i].sort((e,t)=>
1T(e)-T(t));for(let n=0;n<r.length;n++){let i=r[n].dateCompletedUtcMs;if(t>0&&n+1===t&&M(e.documentId,i),n<o.length){let e=String(o[n]).split(".").pop();for(let t of P(e))M(t.documentId,i)}}}else{for(let t of i)M(e.documentId,t.dateCompletedUtcMs);for(let n of s)if(n.type===x.w_.course){let i=(null!==(g=n.mediaList)&&void 0!==g?g:[]).indexOf(t);if(-1===i)continue;let l=String(i+1);for(let t of o)t.mediaId===n.docId&&t.dayCompleted===l&&M(e.documentId,t.dateCompletedUtcMs)}else{let i=(null!==(y=null===(b=l.advanced_course_progress)||void 0===b?void 0:b[n.docId])&&void 0!==y?y:[]).findIndex(e=>String(e)===t||String(e).endsWith(".".concat(t)));if(-1===i)continue;let r=o.filter(e=>e.mediaId===n.docId).sort((e,t)=>T(e)-T(t));i<r.length&&M(e.documentId,r[i].dateCompletedUtcMs)}}}}let O=L.find(e=>"subscription"===e.type);for(let e of(s&&O&&!Z(O.documentId)&&k.push({achievementId:O.documentId,achievedDateMs:null!=d?d:I}),L.filter(e=>"community"===e.type&&("first_post"===e.condition||"first_comment"===e.condition))))!Z(e.documentId)&&await E(t,"first_post"===e.condition)&&_.push(e.documentId);await Promise.all([..._.map(e=>(0,w.Dl)(t,e)),...k.map(e=>(0,w.Dl)(t,e.achievementId,e.achievedDateMs))])}catch(e){h.Tb(e)}};var Z=n(88949),S=n(36986),M=n(70451),N=n(77865),T=n(86006),L=n(85922),D=n(13674),A=n(60195),P=n(52782),O=()=>{var e,t,n,l,I,_;let j=(0,v.CG)(e=>e.config),E=(0,v.CG)(e=>e.auth),O=(0,v.CG)(e=>e.db.media),U=(0,v.TL)(),W=(0,s.useRouter)(),z=(0,D.lh)(),{i18n:R,language:F}=j,G=e=>(0,g.i0)({i18nDocs:R,language:F,text:e}),H=null!==(l=E.firebaseUserId)&&void 0!==l?l:"",B=E.appUser,V=null===(t=j.design)||void 0===t?void 0:null===(e=t.profile_page)||void 0===e?void 0:e.achievement_widget;(0,N.D)("achievements");let[Y,X]=(0,o.useState)(null),[q,J]=(0,o.useState)([]),[$,K]=(0,o.useState)(null),[Q,ee]=(0,o.useState)(!1);(0,o.useEffect)(()=>{(0,b.qw)(x.jH.OPEN_PAGE_ACHIEVEMENT)},[]);let et=null!==(I=null==V?void 0:V.enabled)&&void 0!==I&&I&&(null===(_=null==B?void 0:B.achievementEnabled)||void 0===_||_);(0,o.useEffect)(()=>{!j.isLoading&&j.design&&B&&!et&&W.replace(x.Z6.PROFILE)},[j.isLoading,j.design,B,et,W]),(0,o.useEffect)(()=>{if(!H)return;let e=!0;return Promise.all([(0,w.EP)(),(0,w.Mp)(H)]).then(t=>{let[n,i]=t;e&&(X(n),J(i))}).catch(t=>{h.Tb(t),e&&X([])}),()=>{e=!1}},[H]);let en=(0,o.useMemo)(()=>q.map(e=>e.id),[q]),ei=(0,o.useMemo)(()=>{var e;let t=null===(e=null==B?void 0:B.streakEnabled)||void 0===e||e,n=new Map;for(let e of null!=Y?Y:[]){if(!t&&"streak"===e.type)continue;let i="session"===e.type||"total_time"===e.type?"progress":e.type;n.has(i)||n.set(i,[]),n.get(i).push(e)}return Array.from(n.entries())},[Y,null==B?void 0:B.streakEnabled]),eo=e=>{switch(e){case"community":return(null==V?void 0:V.community_category_name)||"Community";case"content":return(null==V?void 0:V.content_category_name)||"Session";case"streak":return(null==V?void 0:V.streak_category_name)||"Streak";case"subscription":return(null==V?void 0:V.app_subscriber_category_name)||"Subscription";case"progress":return(null==V?void 0:V.progress_category_name)||"Progress";default:return""}};if(j.isLoading||E.isLoading||!E.firebaseUserId||!B)return(0,i.jsx)(T.Z,{});if(null==Y)return(0,i.jsx)(L.Z,{});let el=G((null==V?void 0:V.title)||"Achievements"),er=e=>en.includes(e.documentId),es=e=>{(0,b.qw)(x.jH.ACHIEVEMENT_DETAILS_OPENED,{[x.jg.ACHIEVEMENT_NAME]:e.name,[x.jg.ACHIEVEMENT_ID]:e.documentId,[x.jg.ACHIEVEMENT_TYPE]:e.type}),K(e)},ed=async()=>{if(!Q){ee(!0);try{var e,t;let n=O;if(0===n.length){let e=await (0,Z.GL)();U((0,M.S_)(e)),n=e.media}let i=await (0,S.p)(H,{includeEmptyMediaId:!0}),o=null===(e=E.revenueCatSubscription)||void 0===e?void 0:e.subscriptions,l=Object.values(null!=o?o:{}).map(e=>{var t;return Date.parse(null!==(t=null==e?void 0:e.original_purchase_date)&&void 0!==t?t:"")}).filter(e=>!isNaN(e)),r=(0,C.IN)(null!==(t=E.subscriptions)&&void 0!==t?t:[]).map(e=>{var t;return(null!==(t=e.created)&&void 0!==t?t:0)*1e3}).filter(e=>e>0),s=l.length?Math.min(...l):r.length?Math.min(...r):void 0;await k({uid:H,defs:null!=Y?Y:[],earned:q,history:i,appUser:B,mediaList:n,isSubscribed:(0,y.B)({lifetime:E.lifetimeSubscription,subscriptionFromRC:E.subscriptionFromRC,subscriptionFromCode:E.subscriptionFromCode,subscriptions:E.subscriptions}),subDateMs:s}),J(await (0,w.Mp)(H))}catch(e){h.Tb(e)}finally{ee(!1)}}};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(r(),{children:[(0,i.jsx)("link",{rel:"icon",href:null===(n=j.paywall)||void 0===n?void 0:n.logoUrl,type:"image/jpg",sizes:"32x32"}),(0,i.jsx)("title",{children:el})]}),(0,i.jsx)(d.Z,{sx:{backgroundColor:z.backgroundColor,minHeight:"100vh"},children:(0,i.jsxs)(a.Z,{maxWidth:"sm",sx:{py:3},children:[(0,i.jsxs)(d.Z,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:4},children:[(0,i.jsxs)(d.Z,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,i.jsx)(c.Z,{"aria-label":"Back",onClick:()=>window.history.length>1?W.back():W.push(x.Z6.PROFILE),sx:{color:z.textColor,ml:-1},children:(0,i.jsx)(m.Z,{})}),(0,i.jsx)(u.Z,{sx:{color:z.textColor,fontSize:{xs:26,sm:32},fontWeight:800,letterSpacing:"-0.01em"},children:el})]}),(0,i.jsx)(c.Z,{"aria-label":G("Refresh"),onClick:ed,disabled:Q,sx:{color:z.textColor},children:Q?(0,i.jsx)(f.Z,{size:24,sx:{color:z.textColor}}):(0,i.jsx)(p.Z,{sx:{fontSize:30}})})]}),ei.map(e=>{let[t,n]=e,o=n.filter(e=>!e.isArchived||er(e));return 0===o.length?null:(0,i.jsxs)(d.Z,{sx:{mb:3},children:[(0,i.jsx)(u.Z,{sx:{color:z.textColor,fontSize:20,fontWeight:600,mb:2},children:G(eo(t))}),(0,i.jsx)(A.Z,{children:o.map(e=>(0,i.jsxs)(d.Z,{onClick:()=>es(e),sx:{width:110,flexShrink:0,display:"flex",flexDirection:"column",alignItems:"center",cursor:"pointer"},children:[(0,i.jsx)(d.Z,{component:"img",src:e.icon,alt:e.name,sx:{width:80,height:80,objectFit:"contain",filter:er(e)?"none":"grayscale(1)"}}),(0,i.jsx)(u.Z,{noWrap:!0,sx:{color:z.textColor,fontSize:13,fontWeight:500,textAlign:"center",mt:1.5,maxWidth:"100%"},children:G(e.name)}
1),(0,i.jsx)(u.Z,{sx:{color:z.subTextColor,fontSize:10,textAlign:"center",mt:1,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:G(e.description)})]},e.documentId))})]},t)})]})}),(0,i.jsx)(P.h,{achievement:$,isUnlocked:!!$&&er($),onClose:()=>K(null)})]})}}},function(e){e.O(0,[3920,2888,9774,179],function(){return e(e.s=27883)}),_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.