PageSourceSearch

https://ecomitram.org/_next/static/chunks/app/layout-956b840fed6e2de4.js

js ecomitram.org collected 2026-10-10 01:45:30 UTC 41,143 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5114,7177],{486:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>r});let r={src:"/_next/static/media/ecomitram-logo-320.698c0fb8.webp",height:320,width:320,blurDataURL:"data:image/webp;base64,UklGRsYAAABXRUJQVlA4WAoAAAAQAAAABwAABwAAQUxQSD8AAAABYBPbdpSbtOk2oMXBagEFIAgPdAjABT5wQEVLSVYRETEBgKUojzkTp39HYPHePwp2772fYMtaWO//uxqATgMAVlA4IGAAAADwAQCdASoIAAgAAkA4JagCdAYoBywfTeAAzjmPd8/VLNJcbCfmcLwAryOPr9KKDfneZ8EfMbzul91j3ifaKF9oAAmLZ+DB78/0wkqN6Lafj/8mG2m7fV0crb4/wa8AAAA=",blurWidth:8,blurHeight:8}},4592:(e,t,n)=>{"use strict";n.d(t,{ChunkErrorRecovery:()=>a});var r=n(41865),i=n(45283);function a(){return(0,r.useEffect)(()=>{let e=e=>{(0,i.Gf)(e.error)},t=e=>{(0,i.Gf)(e.reason)};return window.addEventListener("error",e),window.addEventListener("unhandledrejection",t),()=>{window.removeEventListener("error",e),window.removeEventListener("unhandledrejection",t)}},[]),null}},6884:(e,t,n)=>{"use strict";n.d(t,{R:()=>c});var r=n(84157),i=n(62733),a=n.n(i),s=n(74062),o=n(41865);let l=new Set,c=(0,o.forwardRef)(function(e,t){let{href:n,prefetch:i,onMouseEnter:c,onTouchStart:d,onFocus:u,children:m,...f}=e,h=null;try{h=(0,s.useRouter)()}catch(e){h=null}let x=(0,o.useCallback)(()=>{var e;if(!1===i||!h)return;let t="string"==typeof n?n:null!=(e=n.pathname)?e:JSON.stringify(n);if(!l.has(t)){l.add(t);try{h.prefetch(t)}catch(e){}}},[n,i,h]),p=(0,o.useCallback)(e=>{x(),null==c||c(e)},[x,c]),g=(0,o.useCallback)(e=>{x(),null==d||d(e)},[x,d]),b=(0,o.useCallback)(e=>{x(),null==u||u(e)},[x,u]);return(0,r.jsx)(a(),{ref:t,href:n,prefetch:i,onMouseEnter:p,onTouchStart:g,onFocus:b,...f,children:m})})},11140:(e,t,n)=>{"use strict";n.d(t,{F:()=>v,R:()=>m});var r=n(41865);let i="a2hs_dismissed_at",a="a2hs_dismiss_count";function s(){if(window.matchMedia("(display-mode: standalone)").matches||!0===navigator.standalone)return"standalone";if(document.referrer.includes("android-app://"))return"twa";let e=navigator.userAgent;if(/iPad|iPhone|iPod/.test(e)&&!("MSStream"in window)){let t=!/CriOS|FxiOS|EdgiOS|OPiOS/.test(e),n=/Macintosh/.test(e)&&"ontouchend"in document;return t&&!n?"ios":"desktop"}return/Android/.test(e)?"android":"desktop"}function o(){try{let e=localStorage.getItem(a);if((e?parseInt(e,10):0)>=7)return!0;let t=localStorage.getItem(i);if(!t)return!1;let n=parseInt(t,10);return Date.now()-n<864e5}catch(e){return!1}}let l=null,c={hasNativePrompt:!1,appInstalled:!1},d=new Set;function u(e){c=e,d.forEach(e=>e())}function m(){let e=s();return"ios"===e?!o():"android"===e&&c.hasNativePrompt&&!o()}function f(e){return d.add(e),()=>{d.delete(e)}}function h(){return c}let x=Object.freeze({hasNativePrompt:!1,appInstalled:!1});function p(){return x}let g=!1;async function b(){if(!l)return;let e=l;l=null,u({...c,hasNativePrompt:!1}),await e.prompt(),await e.userChoice}function v(){let{hasNativePrompt:e,appInstalled:t}=(0,r.useSyncExternalStore)(f,h,p),[n,l]=(0,r.useState)("desktop"),[c,d]=(0,r.useState)(!0),[u,m]=(0,r.useState)(!1);(0,r.useEffect)(()=>
1{l(s()),d(o())},[]);let x=(0,r.useCallback)(()=>{m(!0)},[]),g=(0,r.useCallback)(async()=>{await b()},[]),v=(0,r.useCallback)(()=>{d(!0);try{var e;localStorage.setItem(i,String(Date.now()));let t=parseInt(null!=(e=localStorage.getItem(a))?e:"0",10);localStorage.setItem(a,String(t+1))}catch(e){}},[]),w=e||"ios"===n;return{showBanner:w&&u&&!c&&("android"===n||"ios"===n),platform:n,promptInstall:g,dismiss:v,triggerShow:x,canInstall:w&&("android"===n||"ios"===n),isInstalled:t||"standalone"===n||"twa"===n,hasNativePrompt:e}}g=!0,window.addEventListener("beforeinstallprompt",e=>{e.preventDefault(),l=e,u({...c,hasNativePrompt:!0})}),window.addEventListener("appinstalled",()=>{l=null,u({hasNativePrompt:!1,appInstalled:!0})})},17700:(e,t,n)=>{"use strict";n.d(t,{AppShell:()=>ef});var r=n(84157),i=n(74062),a=n(62733),s=n.n(a),o=n(41865),l=n(86901),c=n(87948),d=n(84366);function u(){var e,t;let[n,i]=(0,o.useState)("en"),a=(0,o.useRef)(null),s=(0,o.useCallback)(e=>{a.current&&(a.current.cancelled=!0);let t={cancelled:!1};if(a.current=t,(0,d.xC)(e),"en"===e||(0,d.A5)())return;let n=0,r=()=>{if(!t.cancelled){if((0,d.A5)())return void(0,d.xC)(e);n++>50||window.setTimeout(r,300)}};r()},[]);(0,o.useEffect)(()=>{let e=(0,d.Sb)();if(i(e),"en"!==e)return(0,d.zF)(),s(e),()=>{a.current&&(a.current.cancelled=!0)}},[s]);let u=null!=(t=null==(e=d.Yj.find(e=>e.code===n))?void 0:e.shortLabel)?t:"EN";return(0,r.jsxs)(c.rI,{onOpenChange:e=>{e&&(0,d.zF)()},children:[(0,r.jsx)(c.ty,{className:"notranslate flex min-h-[44px] min-w-[44px] items-center justify-center text-sm font-semibold text-gray-700 dark:text-gray-300","aria-label":"Change language","data-testid":"language-selector",translate:"no",children:(0,r.jsx)("span",{className:"notranslate",translate:"no",children:u})}),(0,r.jsx)(c.SQ,{align:"end",className:"notranslate max-h-[70vh] w-48 overflow-y-auto bg-popover",translate:"no",children:d.Yj.map(e=>(0,r.jsxs)(c._2,{onSelect:()=>{var t;return t=e.code,void((0,d.Sm)(t),i(t),"en"!==t&&(0,d.zF)(),s(t))},className:"flex items-center justify-between","data-testid":"language-option-".concat(e.code),children:[(0,r.jsx)("span",{children:e.nativeLabel}),n===e.code&&(0,r.jsx)(l.A,{className:"h-4 w-4"})]},e.code))})]})}var m=n(60582);let f=window.history.length;function h(){let e=(0,i.useRouter)(),t=(0,i.usePathname)(),{state:n}=(0,m.As)(),a=["/","/activities","/profile/me"].includes(t),o="verified"===n?"/settings/notifications":"/login?redirect=".concat(encodeURIComponent("/settings/notifications"));return(0,r.jsx)("header",{className:"fixed top-0 left-0 right-0 z-50 border-b bg-white dark:border-gray-800 dark:bg-gray-950","data-testid":"top-bar",children:(0,r.jsxs)("div",{className:"mx-auto flex h-12 max-w-lg items-center justify-between px-4",children:[a?(0,r.jsx)(s(),{href:"/",className:"text-lg font-bold text-green-600 dark:text-green-400",children:"EcoMitram"}):(0,r.jsx)("button",{onClick:()=>{window.history.length>f?e.back():e.push("/")},className:"flex min-h-[44px] min-w-[44px] items-center justify-center","aria-label":"Go back","data-testid":"back-button",children:(0,r.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,r.jsx)("path",{d:"M19 12H5M12 19l-7-7 7-7"})})}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)(u,{}),(0,r.jsx)(s(),{href:o,className:"flex min-h-[44px] min-w-[44px] items-center justify-center","aria-label":"Notification settings","data-testid":"notification-bell",children:(0,r.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-gray-500",children:(0,r.jsx)("path",{d:"M18 8A6 6 0 006 8c0 7-3 9-3 9h18s-3-2-3-9M13.73 21a2 2 0 01-3.46 0"})})})]})]})})}var x=n(6884),p=n(77217),g=n(6333),b=n(28176),v=n(91300),w=n(80665),y=n(24525),j=n(34295),k=n(83876),A=n(3476),N=n(86645),S=n(94650),C=n(97230),E=n(43019),P=n(67249),I=n(96927),L=n(67715),R=n(61078),z=n(30018),M=n(11140),_=n(56921);let T="3.0.0",D="e834485",F="26.10.08.11.03";async function B(){let e={title:"EcoMitram - Eco-friendly community",text:"Join EcoMitram and make a difference for the environment!",url:"https://ecomitram.app"};if("function"==typeof navigator.share)try{await navigator.share(e);return}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)return}try{await navigator.clipboard.writeText("".concat(e.text," ").concat(e.url)),(0,_.Te)("Link copied!")}catch(e){(0,_.Qg)("Could not copy link")}}let W=[{label:"Top Scorers",icon:y.A,action:"/leaderboard",testId:"menu-leaderboard"},{label:"About EcoMitram",icon:j.A,action:"/page/about",testId:"menu-about"},{label:"Help & Support",icon:k.A,action:"/page/help",testId:"menu-help"},{label:"Visit our Website",icon:A.A,action:"https://paryavaransanrakshan.org/",testId:"menu-website",external:!0},{label:"Share App",icon:N.A,action:B,testId:"menu-share-app"},{label:"Send Feedback",icon:S.A,action:"https://forms.gle/ecomitram-feedback",testId:"menu-feedback",external:!0},{label:"Privacy Policy",icon:C.A,action:"/page/privacy",testId:"menu-privacy"},{label:"Terms of Service",icon:E.A,action:"/page/terms",testId:"menu-terms"}];
1async function O(){try{if("serviceWorker"in navigator){let e=await navigator.serviceWorker.getRegistrations();await Promise.all(e.map(e=>e.unregister()))}if("caches"in window){let e=await caches.keys();await Promise.all(e.map(e=>caches.delete(e)))}}catch(e){}window.location.replace("/?_=".concat(Date.now()))}function G(e){let{onItemClick:t}=e,n=(0,i.useRouter)(),[a,s]=(0,o.useState)(!1),[l,c]=(0,o.useState)(!1),{hasNativePrompt:d,isInstalled:u,promptInstall:f}=(0,M.F)(),{state:h}=(0,z.A)(),{signOut:x}=(0,m.BG)(),p=function(e){let t=(0,o.useRef)([]);return()=>{let n=Date.now();t.current=[...t.current.filter(e=>n-e<1500),n],t.current.length>=3&&(t.current=[],e())}}(async()=>{s(!0),(0,_.Te)("Reloading…"),await O()});async function g(){if(!l){c(!0);try{await x("/login"),null==t||t()}catch(e){(0,_.Qg)("Could not log out. Please try again."),c(!1)}}}async function b(){if(d){try{await f()}catch(e){}null==t||t();return}n.push("/page/install"),null==t||t()}return(0,r.jsxs)("div",{"data-testid":"app-menu",className:"flex flex-col",children:[(0,r.jsx)("nav",{"aria-label":"App menu",children:(0,r.jsxs)("ul",{className:"divide-y divide-border rounded-lg border border-border",children:["none"===h&&(0,r.jsx)("li",{children:(0,r.jsxs)("a",{href:"/login",onClick:t,className:"flex w-full items-center gap-3 px-4 text-sm font-semibold text-green-700 transition-colors hover:bg-accent dark:text-green-400",style:{minHeight:"56px"},"data-testid":"menu-signin",children:[(0,r.jsx)(P.A,{className:"size-5 shrink-0"}),(0,r.jsx)("span",{children:"Sign in"})]})}),"anonymous"===h&&(0,r.jsx)("li",{children:(0,r.jsxs)("a",{href:"/login?verify=true",onClick:t,className:"flex w-full items-center gap-3 px-4 text-sm font-semibold text-green-700 transition-colors hover:bg-accent dark:text-green-400",style:{minHeight:"56px"},"data-testid":"menu-upgrade",children:[(0,r.jsx)(I.A,{className:"size-5 shrink-0"}),(0,r.jsx)("span",{children:"Sign up / Upgrade"})]})}),!u&&(0,r.jsx)("li",{children:(0,r.jsxs)("button",{type:"button",onClick:b,className:"flex w-full items-center gap-3 px-4 text-sm text-foreground transition-colors hover:bg-accent",style:{minHeight:"56px"},"data-testid":"menu-install-app",children:[(0,r.jsx)(L.A,{className:"size-5 shrink-0 text-muted-foreground"}),(0,r.jsx)("span",{children:"Install App"})]})}),W.map(e=>{let n=e.icon,i="flex w-full items-center gap-3 px-4 text-sm text-foreground transition-colors hover:bg-accent",a={minHeight:"56px"};return"function"==typeof e.action?(0,r.jsx)("li",{children:(0,r.jsxs)("button",{type:"button",onClick:()=>{e.action(),null==t||t()},className:i,style:a,"data-testid":e.testId,children:[(0,r.jsx)(n,{className:"size-5 shrink-0 text-muted-foreground"}),(0,r.jsx)("span",{children:e.label})]})},e.testId):e.external?(0,r.jsx)("li",{children:(0,r.jsxs)("a",{href:e.action,target:"_blank",rel:"noopener noreferrer",onClick:t,className:i,style:a,"data-testid":e.testId,children:[(0,r.jsx)(n,{className:"size-5 shrink-0 text-muted-foreground"}),(0,r.jsx)("span",{children:e.label})]})},e.testId):(0,r.jsx)("li",{children:(0,r.jsxs)("a",{href:e.action,onClick:t,className:i,style:a,"data-testid":e.testId,children:[(0,r.jsx)(n,{className:"size-5 shrink-0 text-muted-foreground"}),(0,r.jsx)("span",{children:e.label})]})},e.testId)})]})}),"none"!==h&&(0,r.jsx)("div",{className:"mt-4",children:(0,r.jsxs)("button",{type:"button",onClick:g,disabled:l,className:"flex w-full items-center gap-3 rounded-lg border border-border px-4 text-sm text-destructive transition-colors hover:bg-destructive/10 disabled:opacity-50",style:{minHeight:"56px"},"data-testid":"menu-logout",children:[(0,r.jsx)(R.A,{className:"size-5 shrink-0"}),(0,r.jsx)("span",{children:l?"Logging out…":"Log out"})]})}),(0,r.jsxs)("footer",{className:"mt-6 flex flex-col items-center gap-1 px-4 pb-2 text-center text-xs text-muted-foreground",children:[(0,r.jsxs)("button",{type:"button",onClick:p,disabled:a,"aria-label":"App version ".concat(T,", build ").concat(D).concat(F?", ".concat(F):""),className:"select-none rounded px-2 py-1 font-mono tabular-nums","data-testid":"app-version",children:["v",T," \xb7 ",D,F?" \xb7 ".concat(F):""]}),(0,r.jsxs)("p",{children:["Made by"," ",(0,r.jsx)("a",{href:"https://shyamverma.com",target:"_blank",rel:"noopener noreferrer",className:"underline-offset-2 hover:underline","data-testid":"credit-shyam",children:"Shyam"})," \xb7 ",(0,r.jsx)("a",{href:"https://readybytes.in",target:"_blank",rel:"noopener noreferrer",className:"underline-offset-2 hover:underline","data-testid":"credit-readybytes",children:"Ready Bytes"})]})]})]})}
1var H=n(56248);let U=[{href:"/",label:"Community",testId:"nav-community",icon:p.A},{href:"/activities",label:"Activities",testId:"nav-actions",icon:g.A},{href:"/solutions",label:"Solutions",testId:"nav-solutions",icon:b.A}];function V(){let e=(0,i.usePathname)(),[t,n]=(0,o.useState)(!1),{state:a,user:s}=(0,m.As)(),c=function(e,t,n){if("none"===e)return{href:"/login?redirect=".concat(encodeURIComponent(n)),label:"Sign in",badge:"none"};if("anonymous"===e){let e=null==t?void 0:t.trim().split(/\s+/)[0];return{href:"/profile/me",label:e&&e.length>0?e:"Guest",badge:"anon"}}return{href:"/profile/me",label:"Me",badge:"verified"}}(a,null==s?void 0:s.name,e);return(0,r.jsx)("nav",{className:"fixed bottom-0 left-0 right-0 z-50 border-t bg-white dark:border-gray-800 dark:bg-gray-950",style:{paddingBottom:"env(safe-area-inset-bottom)"},"data-testid":"bottom-nav",role:"navigation","aria-label":"Main navigation",children:(0,r.jsxs)("div",{className:"mx-auto flex max-w-lg items-center justify-around",children:[U.map(t=>{let{href:n,label:i,testId:a,icon:s}=t,o="/"===n?"/"===e:e===n||e.startsWith("".concat(n,"/"));return(0,r.jsxs)(x.R,{href:n,className:"flex min-h-[44px] min-w-[44px] flex-col items-center justify-center px-3 py-2 text-xs ".concat(o?"text-green-600 dark:text-green-400":"text-gray-500 dark:text-gray-400"),"aria-current":o?"page":void 0,"data-testid":a,children:[(0,r.jsx)(s,{size:24,strokeWidth:o?2.5:2,"aria-hidden":"true"}),(0,r.jsx)("span",{className:"mt-0.5",children:i})]},n)}),(()=>{let t="/profile/me"===c.href&&("/profile/me"===e||e.startsWith("/profile/me/"));return(0,r.jsxs)(x.R,{href:c.href,className:"flex min-h-[44px] min-w-[44px] flex-col items-center justify-center px-3 py-2 text-xs ".concat(t?"text-green-600 dark:text-green-400":"text-gray-500 dark:text-gray-400"),"aria-current":t?"page":void 0,"data-testid":"nav-me",children:[(0,r.jsxs)("span",{className:"relative inline-flex",children:[(0,r.jsx)(v.A,{size:24,strokeWidth:t?2.5:2,"aria-hidden":"true"}),"verified"===c.badge&&(0,r.jsx)("span",{className:"absolute -bottom-0.5 -right-1 flex h-3 w-3 items-center justify-center rounded-full border-2 border-white bg-green-600 text-white dark:border-gray-950","aria-label":"Verified","data-testid":"me-tab-verified-tick",children:(0,r.jsx)(l.A,{className:"h-2 w-2",strokeWidth:4,"aria-hidden":"true"})}),"anon"===c.badge&&(0,r.jsx)("span",{className:"absolute -bottom-0.5 -right-1 flex h-3 w-3 items-center justify-center rounded-full border-2 border-white bg-white text-[9px] font-bold leading-none text-gray-600 dark:border-gray-950 dark:bg-gray-950 dark:text-gray-300",style:{boxShadow:"inset 0 0 0 1.5px #9ca3af"},"aria-label":"Identity not verified","data-testid":"me-tab-anon-badge",children:"?"})]}),(0,r.jsx)("span",{className:"mt-0.5 max-w-[60px] truncate",children:c.label})]},"me")})(),(0,r.jsxs)(H.cj,{open:t,onOpenChange:n,children:[(0,r.jsxs)("button",{type:"button",onClick:()=>n(!0),className:"flex min-h-[44px] min-w-[44px] flex-col items-center justify-center px-3 py-2 text-xs ".concat(t?"text-green-600 dark:text-green-400":"text-gray-500 dark:text-gray-400"),"aria-haspopup":"dialog","aria-expanded":t,"data-testid":"nav-more",children:[(0,r.jsx)(w.A,{size:24,strokeWidth:t?2.5:2,"aria-hidden":"true"}),(0,r.jsx)("span",{className:"mt-0.5",children:"More"})]}),(0,r.jsxs)(H.h,{side:"bottom",className:"max-h-[85vh] overflow-y-auto rounded-t-xl",style:{paddingBottom:"env(safe-area-inset-bottom)"},children:[(0,r.jsx)(H.Fm,{children:(0,r.jsx)(H.qp,{children:"Menu"})}),(0,r.jsx)("div",{className:"px-4 pb-4",children:(0,r.jsx)(G,{onItemClick:()=>n(!1)})})]})]})]})})}var Y=n(56764);let Q="ecomitram.create-post-hint.dismissed";function J(){let[e,t]=(0,o.useState)(!0),[n,i]=(0,o.useState)(!1),a=(0,o.useRef)(0),l=(0,o.useRef)(null),{requireUpgrade:c}=(0,Y.F)();(0,o.useEffect)(()=>{try{"1"!==window.localStorage.getItem(Q)&&i(!0)}catch(e){}},[]);let d=(0,o.useCallback)(()=>{i(!1);try{window.localStorage.setItem(Q,"1")}catch(e){}},[]),u=(0,o.useCallback)(e=>{0!==e.button||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(d(),c({kind:"post"})||e.preventDefault())},[d,c]),m=(0,o.useCallback)(()=>{null!==l.current&&cancelAnimationFrame(l.current),l.current=requestAnimationFrame(()=>{let e=window.scrollY,n=e-a.current;n>10?(t(!1),a.current=e):n<-10&&(t(!0),a.current=e)})},[]);return(0,o.useEffect)(()=>(window.addEventListener("scroll",m,{passive:!0}),()=>{window.removeEventListener("scroll",m),null!==l.current&&cancelAnimationFrame(l.current)}),[m]),(0,r.jsxs)(r.Fragment,{children:[n&&e&&(0,r.jsxs)("div",{className:"fixed right-4 z-50 max-w-[200px] rounded-2xl bg-foreground px-3 py-2 text-xs text-background shadow-lg",style:{bottom:"calc(180px + env(safe-area-inset-bottom))"},role:"status","data-testid":"create-post-hint",children:[(0,r.jsx)("p",{children:"Tap to share what you did for the planet today."}),(0,r.jsx)("button",{type:"button",onClick:d,className:"mt-1 inline-flex min-h-[44px] items-center text-xs text-background/80 underline hover:text-background","data-testid":"create-post-hint-dismiss",children:"Got it"}),(0,r.jsx)("span",{className:"absolute -bottom-1 right-6 h-2 w-2 rotate-45 bg-foreground"})]}),(0,r.jsx)(s(),{href:"/create","aria-label":"Create post","data-testid":"create-post-fab",onClick:u,className:"fixed right-4 z-50 flex h-14 w-14 items-center justify-center rounded-full bg-primary text-primary-foreground shadow-lg transition-transform duration-300 will-change-transform hover:bg-[var(--color-primary-hover)] motion-reduce:transition-none ".concat(e?"translate-y-0":"translate-y-40"),style:{bottom:"calc(80px + env(safe-area-inset-bottom))"},children:(0,r.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,r.jsx)("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),(0,r.jsx)("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]})}function K(){let[e,t]=(0,o.useState)(!1);return((0,o.useEffect)(()=>{let e=()=>t(!0),n=()=>t(!1);return t(!navigator.onLine),window.addEventListener("offline",e),window.addEventListener("online",n),()=>{window.removeEventListener("offline",e),window.removeEventListener("online",n)}},[]),e)?(0,r.jsx)("div",{className:"fixed top-12 left-0 right-0 z-40 bg-yellow-500 px-4 py-1 text-center text-sm text-white",role:"alert","data-testid":"offline-banner",children:"You're offline. Some features may be unavailable."}):null}function q(){let{showBanner:e,platform:t,promptInstall:n,dismiss:i,triggerShow:a}=(0,M.F)(),s=(0,o.useRef)(null),l=(0,o.useRef)(!1);return((0,o.useEffect)(()=>
1{if(l.current)return;let e=new IntersectionObserver(t=>{for(let n of t)if(n.isIntersecting){l.current=!0,a(),e.disconnect();break}},{threshold:.5});s.current=e;let t=()=>{let t=document.querySelectorAll('[data-testid="feed-post"]');return t.length>=3&&(e.observe(t[2]),!0)};if(!t()){let n=setInterval(()=>{t()&&clearInterval(n)},500),r=setTimeout(()=>clearInterval(n),1e4);return()=>{clearInterval(n),clearTimeout(r),e.disconnect()}}return()=>e.disconnect()},[a]),e)?(0,r.jsxs)("div",{className:"fixed top-12 left-0 right-0 z-40 flex items-center gap-2 bg-green-600 px-4 py-2 text-white shadow-md",role:"banner","data-testid":"install-banner",children:["android"===t?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:"flex-1 text-sm",children:"Add EcoMitram to your home screen"}),(0,r.jsx)("button",{onClick:n,className:"min-h-[44px] rounded-md bg-white px-4 py-1 text-sm font-medium text-green-700 hover:bg-green-50","data-testid":"install-button",children:"Install"})]}):(0,r.jsxs)("span",{className:"flex-1 text-sm","data-testid":"ios-instructions",children:["Tap"," ",(0,r.jsx)("span",{className:"inline-block","aria-label":"Share icon",children:(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"inline h-4 w-4 align-text-bottom","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"}),(0,r.jsx)("polyline",{points:"16 6 12 2 8 6"}),(0,r.jsx)("line",{x1:"12",y1:"2",x2:"12",y2:"15"})]})})," ",'Share then "Add to Home Screen"']}),(0,r.jsx)("button",{onClick:i,className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-white/80 hover:text-white","aria-label":"Dismiss install banner","data-testid":"install-dismiss",children:(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:"h-5 w-5","aria-hidden":"true",children:[(0,r.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,r.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}):null}var X=n(89462),$=n(60501),Z=n(54457),ee=n(30200),et=n(85374);let en="notification_nudge_snooze_until";function er(){let{permission:e,requestPermission:t}=(0,Z.usePushNotifications)(),[n,i]=(0,o.useState)(!1);if((0,o.useEffect)(()=>{if("default"!==e)return;let t=setTimeout(()=>{if((0,M.R)()||!/Android/.test(navigator.userAgent)&&"ios_pwa"!==(0,ee.Z)()||"true"===(0,et.zn)("first_activity_completed"))return;let e=(0,et.zn)(en);e&&Number(e)>Date.now()||i(!0)},1500);return()=>clearTimeout(t)},[e]),"default"!==e||!n)return null;let a=async()=>{await t(),i(!1)};return(0,r.jsxs)("div",{className:"fixed top-12 left-0 right-0 z-40 flex items-center gap-2 bg-green-600 px-4 py-2 text-white shadow-md",role:"banner","data-testid":"notification-nudge-banner",children:[(0,r.jsx)(X.A,{className:"h-4 w-4 shrink-0","aria-hidden":"true"}),(0,r.jsx)("span",{className:"flex-1 text-sm",children:"Get notified about activity results and achievements"}),(0,r.jsx)("button",{onClick:a,className:"min-h-[44px] rounded-md bg-white px-4 py-1 text-sm font-medium text-green-700 hover:bg-green-50","data-testid":"notification-nudge-enable",children:"Enable"}),(0,r.jsx)("button",{onClick:()=>{(0,et.bl)(en,String(Date.now()+6048e5)),i(!1)},className:"min-h-[44px] min-w-[44px] flex items-center justify-center text-white/80 hover:text-white","aria-label":"Dismiss notification banner","data-testid":"notification-nudge-dismiss",children:(0,r.jsx)($.A,{className:"h-5 w-5","aria-hidden":"true"})})]})}var ei=n(74063),ea=n(67283);let es="notification_snooze_until";function eo(){let{permission:e,requestPermission:t}=(0,Z.usePushNotifications)(),[n,i]=(0,o.useState)(!1);if((0,o.useEffect)(()=>{if("granted"===e||"denied"===e||"unsupported"===e||"true"!==(0,et.zn)("first_activity_completed"))return;let t=(0,et.zn)(es);t&&Number(t)>Date.now()||i(!0)},[e]),"granted"===e||"denied"===e||"unsupported"===e||!n)return null;let a=async()=>{await t(),i(!1)};return(0,r.jsx)(ei.lG,{open:n,onOpenChange:i,children:(0,r.jsxs)(ei.Cf,{"data-testid":"notification-permission-modal",children:[(0,r.jsxs)(ei.c7,{children:[(0,r.jsx)("div",{className:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-green-100 dark:bg-green-900",children:(0,r.jsx)(X.A,{className:"h-6 w-6 text-green-600 dark:text-green-400"})}),(0,r.jsx)(ei.L3,{className:"text-center",children:"Stay updated on eco-activities"}),(0,r.jsx)(ei.rr,{className:"text-center",children:"Get notified about new activities, results, and achievements"})]}),(0,r.jsxs)(ei.Es,{className:"flex-col gap-2 sm:flex-col",children:[(0,r.jsx)(ea.$,{onClick:a,className:"w-full min-h-11",children:"Enable Notifications"}),(0,r.jsx)(ea.$,{variant:"ghost",onClick:()=>{(0,et.bl)(es,String(Date.now()+2592e6)),i(!1)},className:"w-full min-h-11",children:"Not now"})]})]})})}var el=n(19176);function ec(e){let{kind:t,onReplay:n}=e,r=(0,o.useRef)(n);r.current=n,(0,o.useEffect)(()=>(0,el.B)(t,e=>{r.current(e)}),[t])}var ed=n(35114),eu=n(78079);let em=["/login","/admin"];function ef(e){let{children:t}=e,n=(0,i.usePathname)(),a=(0,i.useRouter)(),s=em.some(e=>n===e||n.startsWith("".concat(e,"/")));return(ec({kind:"post",onReplay:()=>{a.push("/create")}}),ec({kind:"adoptSwitch",onReplay:e=>{e&&(0,ed.apiMutate)("/switches/".concat(e,"/adopt"),{method:"POST"}).then(()=>(0,_.Te)("Habit adopted!")).catch(e=>{e instanceof eu.hD&&"AUTH_REQUIRED"===e.errorCode||(0,_.Qg)(e instanceof Error?e.message:"Could not save that — try again.")})}}),s)?(0,r.jsx)(r.Fragment,{children:t}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(h,{}),(0,r.jsx)(K,{}),"/"===n&&(0,r.jsx)(q,{}),"/"===n&&(0,r.jsx)(er,{}),(0,r.jsx)("div",{className:"pt-12 pb-20",children:t}),(0,r.jsx)(V,{}),(0,r.jsx)(eo,{}),"/"===n&&(0,r.jsx)(J,{})]})}}
1,18093:(e,t,n)=>{"use strict";n.d(t,{N:()=>i});var r=n(84157);function i(){return(0,r.jsxs)("svg",{className:"h-5 w-5",viewBox:"0 0 24 24","aria-hidden":"true",children:[(0,r.jsx)("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 0 1-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z",fill:"#4285F4"}),(0,r.jsx)("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),(0,r.jsx)("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),(0,r.jsx)("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]})}},19176:(e,t,n)=>{"use strict";n.d(t,{B:()=>i,J:()=>a});let r=new Map;function i(e,t){let n=r.get(e);return n||(n=new Set,r.set(e,n)),n.add(t),()=>{let n=r.get(e);n&&(n.delete(t),0===n.size&&r.delete(e))}}function a(e){let t=r.get(e.kind);if(t&&0!==t.size)for(let n of Array.from(t))try{n(e.refId)}catch(e){}}},20426:(e,t,n)=>{Promise.resolve().then(n.t.bind(n,86270,23)),Promise.resolve().then(n.bind(n,486)),Promise.resolve().then(n.bind(n,67379)),Promise.resolve().then(n.bind(n,17700)),Promise.resolve().then(n.bind(n,48145)),Promise.resolve().then(n.bind(n,53173)),Promise.resolve().then(n.bind(n,90299)),Promise.resolve().then(n.bind(n,4592)),Promise.resolve().then(n.bind(n,66621)),Promise.resolve().then(n.bind(n,74159)),Promise.resolve().then(n.bind(n,54520)),Promise.resolve().then(n.bind(n,54457)),Promise.resolve().then(n.bind(n,59026)),Promise.resolve().then(n.bind(n,53663)),Promise.resolve().then(n.bind(n,44996)),Promise.resolve().then(n.bind(n,4993)),Promise.resolve().then(n.t.bind(n,57480,23)),Promise.resolve().then(n.t.bind(n,28060,23)),Promise.resolve().then(n.t.bind(n,10178,23)),Promise.resolve().then(n.t.bind(n,9911,23)),Promise.resolve().then(n.t.bind(n,99443,23)),Promise.resolve().then(n.t.bind(n,5283,23)),Promise.resolve().then(n.t.bind(n,59846,23)),Promise.resolve().then(n.t.bind(n,30561,23)),Promise.resolve().then(n.t.bind(n,47995,23)),Promise.resolve().then(n.t.bind(n,66112,23)),Promise.resolve().then(n.t.bind(n,43337,23))},21437:(e,t,n)=>{"use strict";n.d(t,{VJ:()=>l,YA:()=>o,o2:()=>s});let r="em_attribution";function i(e){if(!e)return;let t=e.trim();if(t)return t.length>200?t.slice(0,200):t}function a(e){return!!e&&!!(e.utmSource||e.utmMedium||e.utmCampaign||e.utmContent||e.utmTerm)}function s(){let e;if("undefined"==typeof document)return null;try{e=document.cookie}catch(e){return null}let t=e.split(";").map(e=>e.trim()).find(e=>e.startsWith("".concat(r,"=")));if(!t)return null;let n=t.slice(r.length+1);if(!n)return null;try{return JSON.parse(decodeURIComponent(n))}catch(e){return null}}function o(){let e=function(){let e=new URLSearchParams(window.location.search),t=i(function(e){if(!e)return;let t=[e.indexOf("?"),e.indexOf("#")].filter(e=>e>=0).sort((e,t)=>e-t)[0];return void 0!==t?e.slice(0,t):e}(document.referrer)),n=i(window.location.pathname);return Object.fromEntries(Object.entries({utmSource:i(e.get("utm_source")),utmMedium:i(e.get("utm_medium")),utmCampaign:i(e.get("utm_campaign")),utmContent:i(e.get("utm_content")),utmTerm:i(e.get("utm_term")),referrer:t,landingPath:n,landedAt:new Date}).filter(e=>{let[,t]=e;return void 0!==t}))}(),t=a(e),n=!!e.referrer;if(!t&&!n)return;let o=s();(!(o&&a(o))||t)&&function(e){if("undefined"==typeof document)return;let t=encodeURIComponent(JSON.stringify(e)),n="https:"===window.location.protocol;try{document.cookie="".concat(r,"=").concat(t,"; Max-Age=").concat(2592e3,"; Path=/; SameSite=Lax").concat(n?"; Secure":"")}catch(e){}}(e)}function l(){if("undefined"==typeof document)return;let e="https:"===window.location.protocol;try{document.cookie="".concat(r,"=; Max-Age=0; Path=/; SameSite=Lax").concat(e?"; Secure":"")}catch(e){}}},30018:(e,t,n)=>{"use strict";n.d(t,{A:()=>r.As});var r=n(60582)},35114:(e,t,n)=>{"use strict";n.d(t,{apiMutate:()=>i});var r=n(78079);async function i(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{return await (0,r.uE)(e,t)}catch(e){if(e instanceof r.hD&&401===e.status&&"AUTH_REQUIRED"===e.errorCode){var n;null==(n=(0,r.uA)())||n()}throw e}}}
1,45283:(e,t,n)=>{"use strict";n.d(t,{Gf:()=>l,oz:()=>s});let r="chunk-reload-at",i="chunk-reload-count",a=[/ChunkLoadError/i,/Loading chunk [\w-]+ failed/i,/Loading CSS chunk/i,/Failed to fetch dynamically imported module/i,/error loading dynamically imported module/i,/undefined \(reading 'call'\)/i];function s(e){if(!e||"object"!=typeof e)return!1;let{name:t,message:n}=e,r="".concat("string"==typeof t?t:""," ").concat("string"==typeof n?n:"");return a.some(e=>e.test(r))}async function o(){let e="e834485";if(!e)return!1;try{let t=await fetch("/api/build-id?t=".concat(Date.now()),{cache:"no-store",signal:AbortSignal.timeout(3e3)});if(!t.ok)return!1;let n=await t.json(),r=n&&"object"==typeof n?n.commit:void 0;return"string"==typeof r&&r.length>0&&r!==e}catch(e){return!1}}async function l(e){var t;if(!s(e)||function(){var e,t;let n=Number(null!=(e=window.sessionStorage.getItem(r))?e:0);return Date.now()-n<15e3||Number(null!=(t=window.sessionStorage.getItem(i))?t:0)>=2}()||!await o())return!1;let n=Number(null!=(t=window.sessionStorage.getItem(i))?t:0);return window.sessionStorage.setItem(i,String(n+1)),window.sessionStorage.setItem(r,String(Date.now())),window.location.reload(),!0}}
1,47104:(e,t,n)=>{"use strict";n.d(t,{cn:()=>a});var r=n(77786),i=n(97721);function a(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,i.QP)((0,r.$)(t))}},48145:(e,t,n)=>{"use strict";n.d(t,{AttributionCapture:()=>s});var r=n(41865),i=n(74062),a=n(21437);function s(){let e=(0,i.usePathname)(),t=(0,i.useSearchParams)();return(0,r.useEffect)(()=>{(0,a.YA)()},[e,t]),null}},53173:(e,t,n)=>{"use strict";n.d(t,{AuthBootstrap:()=>A});var r=n(84157),i=n(41865),a=n(49199),s=n(74062),o=n(44996),l=n(53663);let c="existing-guest-prompt-dismissed",d=/^\/activities\/[^/]+\/(anon-join|certificate\/token)(\/|$)/,u=[];var m=n(43431),f=n(19176),h=n(4993),x=n(92213),p=n(49719),g=n(56921),b=n(18093);let v=new Set(["auth/popup-closed-by-user","auth/cancelled-popup-request","auth/user-cancelled"]),w={headline:"Sign in to keep going",reason:"Sign in to continue."};function y(e){let{open:t,onClose:n,returnTo:a,op:l}=e,c=(0,s.useRouter)(),{signIn:d}=(0,o.useAuthActions)(),{closeModal:u}=(0,o.useAuthModal)(),[m,f]=(0,i.useState)(!1),y=(0,i.useRef)(null),j=(0,i.useRef)(null),k=(0,i.useRef)(null);(0,i.useEffect)(()=>{if(!t)return;let e=e=>{if("Escape"===e.key){e.stopPropagation(),n();return}if("Tab"!==e.key)return;let t=y.current;if(!t)return;let r=t.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(0===r.length)return;let i=r[0],a=r[r.length-1],s=document.activeElement;e.shiftKey&&s===i?(e.preventDefault(),a.focus()):e.shiftKey||s!==a||(e.preventDefault(),i.focus())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[t,n]),(0,i.useEffect)(()=>{var e;if(!t)return;let n=document.body.style.overflow,r=document.activeElement;return r instanceof HTMLElement&&(k.current=r),document.body.style.overflow="hidden",null==(e=j.current)||e.focus(),()=>{var e,t;document.body.style.overflow=n,null==(t=k.current)||null==(e=t.focus)||e.call(t),k.current=null}},[t]),(0,i.useEffect)(()=>{t&&(0,h.prewarmGooglePopup)()},[t]);let A=(0,i.useCallback)(async()=>{f(!0);try{await d("google"),u()}catch(t){let e=function(e){let t=function(e){if("object"!=typeof e||null===e||!("code"in e))return null;let{code:t}=e;return"string"==typeof t?t:null}(e);return t&&v.has(t)?null:"auth/popup-blocked"===t?"Your browser blocked the Google sign-in popup. Allow popups for this site and try again, or use “Verify with email”.":"Couldn’t sign in with Google. Please try again, or use “Verify with email”."}(t);e&&(0,g.Qg)(e)}finally{f(!1)}},[d,u]),N=(0,i.useCallback)(()=>{let e=(0,x.sG)(null!=a?a:null);c.push((0,x.V)("/login/email",e))},[a,c]);if(!t)return null;let S=l&&(0,p.ko)(l.kind)?p.Wx[l.kind]:w;return(0,r.jsxs)("div",{className:"fixed inset-0 z-[60] flex items-end justify-center",role:"dialog","aria-modal":"true","aria-label":S.headline,children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-foreground
1/40",onClick:n,"aria-hidden":"true"}),(0,r.jsxs)("div",{ref:y,className:"relative w-full max-w-md rounded-t-2xl border border-border bg-background px-6 pt-6 shadow-lg pb-safe",style:{paddingBottom:"max(env(safe-area-inset-bottom), 1.25rem)"},children:[(0,r.jsx)("div",{className:"mb-3 flex justify-center",children:(0,r.jsx)("span",{className:"inline-flex items-center rounded-full bg-muted px-2.5 py-0.5 text-xs font-medium text-muted-foreground",children:"No verified email"})}),(0,r.jsx)("h2",{className:"mb-1 text-center text-lg font-semibold text-foreground",children:S.headline}),(0,r.jsx)("p",{className:"mb-5 text-center text-sm text-muted-foreground",children:S.reason}),(0,r.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,r.jsxs)("button",{ref:j,type:"button",onClick:A,disabled:m,"aria-busy":m,className:"inline-flex h-12 w-full items-center justify-center gap-2 rounded-xl border border-border bg-background px-4 text-sm font-medium text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary disabled:opacity-60",children:[(0,r.jsx)(b.N,{}),m?"Signing in…":"Continue with Google"]}),(0,r.jsx)("button",{type:"button",onClick:N,className:"inline-flex h-12 w-full items-center justify-center rounded-xl bg-primary px-4 text-sm font-medium text-primary-foreground hover:bg-[var(--color-primary-hover)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary",children:"Verify with email"}),(0,r.jsx)("button",{type:"button",onClick:n,className:"inline-flex h-12 w-full items-center justify-center rounded-xl text-sm font-medium text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary",children:"Not now"})]})]})]})}var j=n(58544);let k=(0,a.default)(()=>Promise.all([n.e(8208),n.e(2197),n.e(6333)]).then(n.bind(n,28733)).then(e=>({default:e.ExistingGuestProfilePrompt})),{loadableGenerated:{webpack:()=>[28733]},ssr:!1});function A(){let{isOpen:e,returnTo:t,closeModal:n}=(0,l.X)(),{state:a}=(0,o.useAuth)(),h=(0,s.usePathname)(),[x,p]=(0,i.useState)(null),[g,b]=(0,i.useState)(null),v=(0,i.useRef)(!1),w=(0,i.useRef)(!1);(0,i.useEffect)(()=>{if("/login/complete-profile"===h)return;let e=(0,j.es)();e&&p(e)},[h]),(0,i.useEffect)(()=>{e&&!v.current?b((0,m.VL)({peekOnly:!0})):e||b(null),v.current=e},[e]),(0,i.useEffect)(()=>{let e="verified"===a;if(e&&!w.current){let e=(0,m.VL)();e&&(0,f.J)(e)}w.current=e},[a]);let A=!!h&&h.startsWith("/login"),N=e&&!A,{shouldShow:S,dismiss:C}=function(){let{state:e,user:t}=(0,o.useAuth)(),{isOpen:n}=(0,o.useAuthModal)(),r=(0,s.usePathname)(),[a,l]=(0,i.useState)(!1);(0,i.useEffect)(()=>{(function(){try{return"1"===sessionStorage.getItem(c)}catch(e){return!1}})()&&l(!0)},u);let m=(0,i.useRef)(!1),f=null==t?void 0:t.profileComplete,h=(0,i.useMemo)(()=>!(a||"anonymous"!==e||!1!==f||r&&r.startsWith("/login")||r&&r.startsWith("/admin"))&&"/profile/me"!==r&&!(r&&d.test(r))&&!n&&!m.current,[e,f,r,n,a]);(0,i.useEffect)(()=>{h&&(m.current=!0)},[h]);let x=(0,i.useCallback)(()=>{try{sessionStorage.setItem(c,"1")}catch(e){}l(!0)},[]);return(0,i.useMemo)(()=>({shouldShow:h,dismiss:x}),[h,x])}();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(y,{open:N,onClose:n,returnTo:t,op:g}),S&&(0,r.jsx)(k,{open:!0,onDismiss:C}),x&&(0,r.jsx)(j.UF,{mergedFromGuest:x.mergedFromGuest,name:x.name,onDismiss:()=>p(null)})]})}},53663:(e,t,n)=>{"use strict";n.d(t,{AuthModalProvider:()=>a,X:()=>i.Xi});var r=n(84157),i=n(60582);function a(e){let{children:t}=e;return(0,r.jsx)(r.Fragment,{children:t})}},54520:(e,t,n)=>{"use strict";n.d(t,{Toaster:()=>u});var r=n(84157),i=n(86282),a=n(34295),s=n(5200),o=n(88423),l=n(97963),c=n(28426),d=n(49379);let u=e=>{let{...t}=e,{theme:n="system"}=(0,c.D)();return(0,r.jsx)(d.l$,{theme:n,className:"toaster group",icons:{success:(0,r.jsx)(i.A,{className:"size-4"}),info:(0,r.jsx)(a.A,{className:"size-4"}),warning:(0,r.jsx)(s.A,{className:"size-4"}),error:(0,r.jsx)(o.A,{className:"size-4"}),loading:(0,r.jsx)(l.A,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...t})}},58544:(e,t,n)=>{"use strict";n.d(t,{UF:()=>s,d4:()=>c,es:()=>l});var r=n(84157),i=n(41865),a=n(85374);function s(e){let{mergedFromGuest:t,name:n,autoDismissMs:a,onDismiss:s}=e,[o,l]=(0,i.useState)(!0),c=null!=a?a:t?7e3:5e3;return((0,i.useEffect)(()=>
1{if(!o)return;let e=setTimeout(()=>{l(!1),null==s||s()},c);return()=>clearTimeout(e)},[o,c,s]),o)?t?(0,r.jsxs)("div",{"data-testid":"post-sign-in-toast","data-merged":"true",role:"status","aria-live":"polite",children:[(0,r.jsxs)("p",{children:["Welcome back, ",null!=n?n:"there","!"]}),(0,r.jsx)("p",{children:"We merged your guest activity into your existing account."})]}):(0,r.jsx)("div",{"data-testid":"post-sign-in-toast","data-merged":"false",role:"status","aria-live":"polite",children:(0,r.jsx)("p",{children:"Email verified. You can now post and comment."})}):null}let o="post-sign-in-toast";function l(){let e=(0,a._A)(o);if(!e)return null;(0,a.Un)(o);try{return JSON.parse(e)}catch(e){return null}}function c(e){(0,a.YZ)(o,JSON.stringify(e))}},60582:(e,t,n)=>{"use strict";n.d(t,{As:()=>r.useAuth,BG:()=>r.useAuthActions,Xi:()=>r.useAuthModal});var r=n(44996);n(24404),n(85785),n(4993)},66621:(e,t,n)=>{"use strict";n.d(t,{PushNotificationProvider:()=>l});var r=n(41865),i=n(49379),a=n(30200),s=n(78414);function o(e,t){var n,r;null==(n=(r=window).gtag)||n.call(r,"event",e,t)}function l(){return(0,r.useEffect)(()=>{let e;return(0,a.H)(),async function(){try{let t=await (0,s.uT)();if(!t)return;let{onMessage:r}=await n.e(9830).then(n.bind(n,89830));e=r(t,e=>{var t,n,r,a,s,l;let c=null!=(s=null==(t=e.notification)?void 0:t.title)?s:"EcoMitram",d=null!=(l=null==(n=e.notification)?void 0:n.body)?l:"",u=null==(r=e.data)?void 0:r.link,m=null==(a=e.data)?void 0:a.type;o("notification_received",{notification_type:m}),(0,i.oR)(c,{description:d,action:u?{label:"View",onClick:()=>{o("notification_open",{notification_type:m}),window.location.href=u}}:void 0})})}catch(e){}}(),()=>null==e?void 0:e()},[]),null}},67379:(e,t,n)=>{"use strict";n.d(t,{ClarityLoader:()=>a});var r=n(41865),i=n(9932);function a(){return(0,r.useEffect)(()=>{let e=()=>i.A.init("x1tfh561me");if("function"==typeof window.requestIdleCallback){let t=window.requestIdleCallback(e,{timeout:8e3});return()=>window.cancelIdleCallback(t)}let t=window.setTimeout(e,4e3);return()=>window.clearTimeout(t)},[]),null}},74159:(e,t,n)=>{"use strict";n.d(t,{SWRegister:()=>i});var r=n(41865);function i(){return(0,r.useEffect)(()=>{if(!("serviceWorker"in navigator))return;let e=window.setTimeout(()=>{Promise.resolve(navigator.serviceWorker.register("/sw.js",{scope:"/"})).catch(()=>{})},0);return()=>window.clearTimeout(e)},[]),null}},86270:()=>{},90299:(e,t,n)=>{"use strict";n.d(t,{SentryUser:()=>s});var r=n(81041),i=n(41865),a=n(60582);function s(){let{user:e,loading:t}=(0,a.As)();return(0,i.useEffect)(()=>{t||(e?r.gV({id:e._id,segment:e.type}):r.gV(null))},[e,t]),null}}},e=>{e.O(0,[3333,3853,520,2733,4262,8737,7708,7180,9379,3743,3271,7271,562,8079,4996,2331,2023,6341,3902,7358],()=>e(e.s=20426)),_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.