PageSourceSearch

https://sobrkey.vercel.app/_next/static/chunks/app/dashboard/page-10929c883d961003.js

js sobrkey.vercel.app collected 2026-10-03 07:46:07 UTC 44,375 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[486],{144:(e,t,s)=>{Promise.resolve().then(s.bind(s,8416))},1762:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(6150).A)("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]])},2465:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(6150).A)("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]])},3764:(e,t,s)=>{"use strict";s.d(t,{p:()=>n});var a=s(1669),r=s(9745),l=s(3175);let n=r.forwardRef((e,t)=>{let{className:s,type:r,...n}=e;return(0,a.jsx)("input",{type:r,className:(0,l.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",s),ref:t,...n})});n.displayName="Input"},4339:(e,t,s)=>{"use strict";s.d(t,{MobileNav:()=>x});var a=s(1669),r=s(226),l=s.n(r),n=s(471),i=s(6150);let c=(0,i.A)("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]),o=(0,i.A)("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]),d=(0,i.A)("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);var m=s(9314);let h=(0,i.A)("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);function x(){let e=(0,n.usePathname)();return(0,a.jsx)("nav",{className:"fixed bottom-0 left-0 right-0 bg-white border-t border-gray-200",children:(0,a.jsx)("div",{className:"container mx-auto px-4",children:(0,a.jsxs)("div",{className:"flex justify-between items-center h-16",children:[(0,a.jsxs)(l(),{href:"/dashboard",className:"flex flex-col items-center justify-center w-full h-full ".concat("/dashboard"===e?"text-purple-600":"text-gray-500"),children:[(0,a.jsx)(c,{className:"h-5 w-5"}),(0,a.jsx)("span",{className:"text-xs mt-1",children:"Home"})]}),(0,a.jsxs)(l(),{href:"/dashboard?tab=public",className:"flex flex-col items-center justify-center w-full h-full ".concat("/dashboard"===e&&e.includes("public")?"text-purple-600":"text-gray-500"),children:[(0,a.jsx)(o,{className:"h-5 w-5"}),(0,a.jsx)("span",{className:"text-xs mt-1",children:"Community"})]}),(0,a.jsxs)(l(),{href:"/dashboard?tab=mira",className:"flex flex-col items-center justify-center w-full h-full ".concat("/dashboard"===e&&e.includes("mira")?"text-purple-600":"text-gray-500"),children:[(0,a.jsx)(d,{className:"h-5 w-5"}),(0,a.jsx)("span",{className:"text-xs mt-1",children:"Mira"})]}),(0,a.jsxs)(l(),{href:"/journal",className:"flex flex-col items-center justify-center w-full h-full ".concat("/journal"===e?"text-purple-600":"text-gray-500"),children:[(0,a.jsx)(m.A,{className:"h-5 w-5"}),(0,a.jsx)("span",{className:"text-xs mt-1",children:"Journal"})]}),(0,a.jsxs)(l(),{href:"/profile",className:"flex flex-col items-center justify-center w-full h-full ".concat("/profile"===e?"text-purple-600":"text-gray-500"),children:[(0,a.jsx)(h,{className:"h-5 w-5"}),(0,a.jsx)("span",{className:"text-xs mt-1",children:"Profile"})]})]})})})}},8416:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>H});var a=s(1669),r=s(9745),l=s(2124);function n(e){let t=[],s=e,a=/\.(jpg|jpeg|png|gif|webp|svg|bmp|tiff)(\?.*)?$/i,r=/\.(mp4|webm|ogg|avi|mov|wmv|flv|mkv)(\?.*)?$/i;for(let l of e.match(/(https?:\/\/[^\s]+)/g)||[])try{let e=l.replace(/[.,;:!?]+$/,"");a.test(e)?(t.push({type:"image",url:e,alt:"Image from ".concat(new 
1URL(e).hostname)}),s=s.replace(l,"").trim()):r.test(e)&&(t.push({type:"video",url:e,alt:"Video from ".concat(new URL(e).hostname)}),s=s.replace(l,"").trim())}catch(e){console.warn("Invalid URL found in content:",l)}return{media:t,cleanContent:s}}function i(e){let t=function(e){let t=/\.(jpg|jpeg|png|gif|webp|svg|bmp|tiff)(\?.*)?$/i,s=/\.(mp4|webm|ogg|avi|mov|wmv|flv|mkv)(\?.*)?$/i;return(e.match(/(https?:\/\/[^\s]+)/g)||[]).map(e=>e.replace(/[.,;:!?]+$/,"")).filter(e=>{try{if(t.test(e)||s.test(e))return!1;return!0}catch(e){return!1}}).filter((e,t,s)=>s.indexOf(e)===t)}(e),s=e;for(let e of t)s=s.replace(e,"").trim();return{links:t,cleanContent:s}}var c=s(4024),o=s(1762),d=s(6150);let m=(0,d.A)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);var h=s(2394),x=s(4728);function u(e){let{media:t,className:s=""}=e,[l,n]=(0,r.useState)(null),[i,d]=(0,r.useState)(!1);if(!t||0===t.length)return null;let u=e=>{n(e),d(!0)},p=e=>{let t=document.createElement("a");t.href=e.url,t.download=e.url.split("/").pop()||"media",t.target="_blank",document.body.appendChild(t),t.click(),document.body.removeChild(t)};return(0,a.jsxs)("div",{className:"space-y-2 ".concat(s),children:[t.map((e,t)=>(0,a.jsx)("div",{className:"relative group",children:"image"===e.type?(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("img",{src:e.url,alt:e.alt||"Image ".concat(t+1),className:"max-w-full h-auto rounded-lg cursor-pointer hover:opacity-90 transition-opacity",onClick:()=>u(e),onError:e=>{e.target.style.display="none"}}),(0,a.jsx)("div",{className:"absolute inset-0 bg-black bg-opacity-0 group-hover:bg-opacity-10 transition-all duration-200 rounded-lg flex items-center justify-center opacity-0 group-hover:opacity-100",children:(0,a.jsx)("div",{className:"flex space-x-2",children:(0,a.jsx)(x.$,{size:"sm",variant:"secondary",onClick:t=>{t.stopPropagation(),p(e)},className:"bg-white/90 hover:bg-white",children:(0,a.jsx)(o.A,{className:"h-4 w-4"})})})})]}):(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("video",{src:e.url,className:"max-w-full h-auto rounded-lg cursor-pointer",onClick:()=>u(e),controls:!1,preload:"metadata",onError:e=>{e.target.style.display="none"},children:"Your browser does not support the video tag."}),(0,a.jsx)("div",{className:"absolute inset-0 bg-black bg-opacity-30 rounded-lg flex items-center justify-center",children:(0,a.jsx)("div",{className:"bg-white/90 rounded-full p-2",children:(0,a.jsx)(m,{className:"h-6 w-6 text-gray-800"})})}),(0,a.jsx)("div",{className:"absolute inset-0 bg-black bg-opacity-0 group-hover:bg-opacity-10 transition-all duration-200 rounded-lg flex items-center justify-center opacity-0 group-hover:opacity-100",children:(0,a.jsx)("div",{className:"flex space-x-2",children:(0,a.jsx)(x.$,{size:"sm",variant:"secondary",onClick:t=>{t.stopPropagation(),p(e)},className:"bg-white/90 hover:bg-white",children:(0,a.jsx)(o.A,{className:"h-4 w-4"})})})})]})},t)),(0,a.jsx)(c.lG,{open:i,onOpenChange:d,children:(0,a.jsx)(c.Cf,{className:"max-w-4xl max-h-[90vh] p-0",children:(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(x.$,{variant:"ghost",size:"sm",className:"absolute top-4 right-4 z-10 bg-black/50 hover:bg-black/70 text-white",onClick:()=>d(!1),children:(0,a.jsx)(h.A,{className:"h-4 w-4"})}),l&&(0,a.jsx)("div",{className:"flex items-center justify-center min-h-[400px]",children:"image"===l.type?(0,a.jsx)("img",{src:l.url,alt:l.alt||"Full size image",className:"max-w-full max-h-[80vh] object-contain"}):(0,a.jsx)("video",{src:l.url,className:"max-w-full max-h-[80vh]",controls:!0,autoPlay:!0,children:"Your browser does not support the video tag."})})]})})})]})}let p=(0,d.A)("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]),g=(0,d.A)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);var v=s(3175);let f=r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("div",{ref:t,className:(0,v.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",s),...r})});
1f.displayName="Card",r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("div",{ref:t,className:(0,v.cn)("flex flex-col space-y-1.5 p-6",s),...r})}).displayName="CardHeader",r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("div",{ref:t,className:(0,v.cn)("text-2xl font-semibold leading-none tracking-tight",s),...r})}).displayName="CardTitle",r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("div",{ref:t,className:(0,v.cn)("text-sm text-muted-foreground",s),...r})}).displayName="CardDescription";let j=r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("div",{ref:t,className:(0,v.cn)("p-6 pt-0",s),...r})});function y(e){let{url:t,className:s=""}=e,[l,n]=(0,r.useState)(null),[i,c]=(0,r.useState)(!0),[o,d]=(0,r.useState)(!1);(0,r.useEffect)(()=>{(async()=>{try{c(!0),d(!1);let e=new URL(t).hostname,s={url:t,domain:e,title:e,description:"Visit ".concat(e),favicon:"https://www.google.com/s2/favicons?domain=".concat(e,"&sz=32")};try{let e=await fetch("/api/link-preview?url=".concat(encodeURIComponent(t)));if(e.ok){let t=await e.json();t.title&&(s.title=t.title),t.description&&(s.description=t.description),t.image&&(s.image=t.image)}}catch(e){console.log("Link preview API not available, using basic preview")}n(s)}catch(e){console.error("Error fetching link preview:",e),d(!0)}finally{c(!1)}})()},[t]);let m=()=>{window.open(t,"_blank","noopener,noreferrer")};return i?(0,a.jsx)("div",{className:"animate-pulse ".concat(s),children:(0,a.jsx)(f,{className:"border border-gray-200 hover:border-gray-300 transition-colors",children:(0,a.jsx)(j,{className:"p-4",children:(0,a.jsxs)("div",{className:"flex items-start space-x-3",children:[(0,a.jsx)("div",{className:"w-4 h-4 bg-gray-200 rounded"}),(0,a.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,a.jsx)("div",{className:"h-4 bg-gray-200 rounded w-3/4"}),(0,a.jsx)("div",{className:"h-3 bg-gray-200 rounded w-1/2"})]})]})})})}):o||!l?(0,a.jsx)("div",{className:s,children:(0,a.jsx)(f,{className:"border border-gray-200 hover:border-gray-300 transition-colors cursor-pointer",onClick:m,children:(0,a.jsx)(j,{className:"p-4",children:(0,a.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,a.jsx)(p,{className:"w-4 h-4 text-gray-500"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-gray-900 truncate",children:t}),(0,a.jsx)("p",{className:"text-xs text-gray-500 truncate",children:"Click to visit"})]}),(0,a.jsx)(g,{className:"w-4 h-4 text-gray-400"})]})})})}):(0,a.jsx)("div",{className:s,children:(0,a.jsx)(f,{className:"border border-gray-200 hover:border-gray-300 transition-colors cursor-pointer group",onClick:m,children:(0,a.jsxs)(j,{className:"p-4",children:[(0,a.jsxs)("div",{className:"flex items-start space-x-3",children:[(0,a.jsx)("div",{className:"flex-shrink-0",children:l.favicon?(0,a.jsx)("img",{src:l.favicon,alt:"",className:"w-4 h-4 rounded",onError:e=>{e.target.style.display="none"}}):(0,a.jsx)(p,{className:"w-4 h-4 text-gray-500"})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("h4",{className:"text-sm font-medium text-gray-900 group-hover:text-blue-600 transition-colors line-clamp-2",children:l.title||l.domain}),l.description&&(0,a.jsx)("p",{className:"text-xs text-gray-500 mt-1 line-clamp-2",children:l.description}),(0,a.jsx)("p",{className:"text-xs text-gray-400 mt-1 truncate",children:l.domain})]}),(0,a.jsx)(g,{className:"w-4 h-4 text-gray-400 group-hover:text-blue-500 transition-colors flex-shrink-0"})]}),l.image&&(0,a.jsx)("div",{className:"mt-3 rounded overflow-hidden",children:(0,a.jsx)("img",{src:l.image,alt:l.title||"Preview",className:"w-full h-32 object-cover",onError:e=>{e.target.style.display="none"}})})]})})})}function N(e){let{urls:t,className:s=""}=e;return t&&0!==t.length?(0,a.jsx)("div",{className:"space-y-2 ".concat(s),children:t.map((e,t)=>(0,a.jsx)(y,{url:e},t))}):null}j.displayName="CardContent",r.forwardRef((e,t)=>{let{className:s,...r}=e;return(0,a.jsx)("div",{ref:t,className:(0,v.cn)("flex items-center p-6 pt-0",s),...r})}
1).displayName="CardFooter";var b=s(3764),w=s(3775);let k=(0,d.A)("ThumbsUp",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]);var C=s(3492),S=s(6636),M=s(2465),L=s(471),E=s(4339);let I=(0,d.A)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);var A=s(2708);function P(e){let{onClick:t}=e;return(0,a.jsx)(A.P.div,{className:"fixed bottom-20 right-4 z-50",initial:{scale:0},animate:{scale:1},transition:{type:"spring",stiffness:260,damping:20},children:(0,a.jsx)(x.$,{size:"icon",className:"h-14 w-14 rounded-full shadow-lg bg-gradient-to-r from-purple-600 to-orange-500 hover:opacity-90 hover:shadow-xl transform hover:scale-105 transition-all duration-200 text-white border-none",onClick:t,children:(0,a.jsx)(I,{className:"h-6 w-6"})})})}var z=s(5370);let O=["public","mira","meet","about","12steps","emergency"],R=new Date("2025-04-23T20:00:00-04:00").getTime()/1e3,H=()=>{let[e,t]=(0,r.useState)("public"),[s,o]=(0,r.useState)(""),[d,m]=(0,r.useState)([]),[h,p]=(0,r.useState)({}),[g,v]=(0,r.useState)({}),[f,j]=(0,r.useState)(!1),{privateKey:y,publicKey:I,logout:A}=(0,l.yX)(),{toast:H}=(0,w.dj)(),_=(0,L.useRouter)();(0,r.useEffect)(()=>{y||_.push("/auth/welcome")},[y,_]);let[$,T]=(0,r.useState)([]),[D,W]=(0,r.useState)(!1),[B,F]=(0,r.useState)({}),[V,U]=(0,r.useState)({}),[q,Y]=(0,r.useState)(null),[G,J]=(0,r.useState)("notes"),[Z,K]=(0,r.useState)(null),[X,Q]=(0,r.useState)(null),[ee,et]=(0,r.useState)(!1),[es,ea]=(0,r.useState)(""),er=new URLSearchParams(window.location.search).get("tab"),[el,en]=(0,r.useState)(!1),ei=(0,r.useRef)(new Map),ec=(0,r.useRef)(new Set),eo=(0,r.useRef)(new Set),ed=(0,r.useRef)(null),[em,eh]=(0,r.useState)({}),[ex,eu]=(0,r.useState)({});(0,r.useEffect)(()=>{console.log("Comment state changed:",{commentsByNoteId:Object.entries(em).map(e=>{let[t,s]=e;return{noteId:t,commentCount:Object.keys(s).length,comments:Object.entries(s).map(e=>{let[t,s]=e;return{id:t,content:s.content,kind:s.kind,tags:s.tags,created_at:new Date(1e3*s.created_at).toISOString()}})}}),commentRelationships:Object.entries(ex).map(e=>{let[t,s]=e;return{id:t,parentId:s.parentId,childCount:s.childIds.length,childIds:s.childIds}}),expandedComments:Object.entries(g).filter(e=>{let[t,s]=e;return s}).map(e=>{let[t]=e;return t})})},[em,ex,g]),(0,r.useEffect)(()=>{let e=Object.entries(g).filter(e=>{let[t,s]=e;return s}).map(e=>{let[t]=e;return t});console.log("Note expansion state:",{expandedNotes:e,expandedNoteCount:e.length,totalNotes:d.length,notesWithComments:Object.keys(em).length}),e.forEach(e=>{let t=em[e]||{},s=ej(e);console.log("Note ".concat(e," details:"),{totalComments:Object.keys(t).length,topLevelComments:s.length,commentIds:Object.keys(t),relationships:Object.entries(ex).filter(t=>{let[s,a]=t;return a.parentId===e}).map(e=>{let[t,s]=e;return{id:t,childCount:s.childIds.length,childIds:s.childIds}})})})},[g,d,em,ex]),(0,r.useEffect)(()=>{console.log("Comment subscription state:",{activeSubscriptions:ei.current.size,processedCommentIds:ec.current.size,processedNoteIds:eo.current.size})},[ei.current,ec.current,eo.current]),(0,r.useEffect)(()=>{console.log("Comment input state:",{activeInputs:Object.entries(h).filter(e=>{let[t,s]=e;return s.trim().length>0}).map(e=>{let[t,s]=e;return{noteId:t,length:s.length}}),totalInputs:Object.keys(h).length})},[h]),(0,r.useEffect)(()=>{if(q){var e;console.log("Reply state:",{replyingTo:q,parentComment:null===(e=em[q])||void 0===e?void 0:e[q],parentNoteId:Object.keys(em).find(e=>{var t;return(null===(t=em[e])||void 0===t?void 0:t[q])!==void 0})})}},[q,em]),(0,r.useEffect)(()=>{er&&O.includes(er)&&t(er)},[er]),(0,r.useEffect)(()=>{let e="true"===localStorage.getItem("darkMode");en(e),e&&document.documentElement.classList.add("dark")},[]);let ep=e=>{t(e),_.push("/dashboard?tab=".concat(e))},eg=()=>{A(),window.location.href="/"},ev=async()=>{W(!0);try{let e=await fetch("https://findtreatment.samhsa.gov/locator/listing"),t=await e.json();
1T(t.slice(0,5))}catch(e){console.error("Failed to fetch local resources:",e)}finally{W(!1)}},ef=e=>{let t=em[e]||{},s=Object.keys(t),a=s.map(e=>t[e]).filter(e=>1111===e.kind),r=a.length;console.log("Updating counts for note ".concat(e,":"),{totalComments:r,commentIds:s.length,kind1111Comments:a.length,relationships:Object.keys(ex).length}),F(t=>({...t,[e]:{...t[e],comments:r}}))},ej=e=>Object.keys(em[e]||{}).filter(t=>{var s;let a=em[e][t];return 1111===a.kind&&(null===(s=a.tags)||void 0===s?void 0:s.some(t=>"e"===t[0]&&t[1]===e&&"root"===t[2]))}),ey=e=>{console.log("Toggling comments for note:",e,{currentState:g[e],hasComments:void 0!==em[e]}),v(t=>{let s={...t,[e]:!t[e]};return t[e]||em[e]||console.log("Note expanded without comments, triggering comment load"),s})},eN=async(e,t,s)=>{if(!y){console.error("Cannot publish comment: private key not available");return}try{let a=s?[["e",e,"root"],["e",s,"reply"]]:[["e",e,"root"]];console.log("Publishing comment:",{kind:1111,tags:a,parentCommentId:s||"none"});let r=await (0,l.p8)(y,e,t,s||"",1111);if(!r)throw Error("Failed to publish comment");let n={id:r.id,content:r.content,created_at:r.created_at,pubkey:r.pubkey,kind:1111,tags:a};eh(t=>{let s={...t[e]||{}};return s[r.id]=n,{...t,[e]:s}}),eu(t=>{if(!s)return{...t,[r.id]:{parentId:e,childIds:[]}};{let a=t[s]||{parentId:e,childIds:[]};return{...t,[s]:{...a,childIds:[...new Set([...a.childIds,r.id])]},[r.id]:{parentId:s,childIds:[]}}}}),p(t=>{let a={...t};return s?delete a[s]:delete a[e],a}),setTimeout(()=>ef(e),100),g[e]||v(t=>({...t,[e]:!0}))}catch(e){console.error("Error publishing comment:",e),H({title:"Error",description:e instanceof Error?e.message:"Failed to publish comment. Please try again.",variant:"destructive"})}};(0,r.useEffect)(()=>{Object.entries(g).forEach(e=>{let[t,s]=e;!s&&h[t]&&p(e=>{let s={...e};return delete s[t],s})})},[g,h]),(0,r.useEffect)(()=>{let e=Object.entries(g).filter(e=>{let[t,s]=e;return s}).map(e=>{let[t]=e;return t});console.log("Handling expanded notes:",{expandedNoteIds:e,notesWithComments:Object.keys(em)}),e.forEach(e=>{ei.current.has(e)||console.log("Setting up subscription for expanded note:",e)})},[g,em]),(0,r.useEffect)(()=>((async()=>{for(let e of d)if(!ei.current.has(e.id)){let t=await (0,l.kH)(e.id,t=>{if(!ec.current.has(t.id)){ec.current.add(t.id);let{media:s,cleanContent:a}=n(t.content),{links:r,cleanContent:l}=i(a);if(eh(a=>{let n={...a[e.id]||{}};return n[t.id]={id:t.id,content:t.content,created_at:t.created_at,pubkey:t.pubkey,kind:t.kind,tags:t.tags,media:s,links:r,cleanContent:l},{...a,[e.id]:n}}),1111===t.kind){let e=t.tags.find(e=>"e"===e[0]&&"reply"===e[2]),s=t.tags.find(e=>"e"===e[0]&&"root"===e[2]);e&&s&&eu(a=>{var r;return{...a,[e[1]]:{parentId:s[1],childIds:[...(null===(r=a[e[1]])||void 0===r?void 0:r.childIds)||[],t.id]}}})}}});ei.current.set(e.id,t)}})(),()=>{ei.current.forEach(e=>{"function"==typeof e&&e()}),ei.current.clear(),ec.current.clear()}),[d]),(0,r.useEffect)(()=>{console.log("Cutoff date:",new Date(1e3*R).toLocaleString()),console.log("Notes:",d.map(e=>({date:new Date(1e3*e.created_at).toLocaleString(),timestamp:e.created_at,content:e.content})))},[d]),(0,r.useEffect)(()=>{console.log("Notes state changed:",{count:d.length,notes:d.map(e=>({id:e.id,content:e.content,created_at:e.created_at}))})},[d]),(0,r.useEffect)(()=>((async()=>{!ed.current&&(ed.current=(0,l.DA)(l.G3,e=>{eo.current.has(e.id)||(eo.current.add(e.id),m(t=>{if(t.some(t=>t.id===e.id))return t;let{media:s,cleanContent:a}=n(e.content),{links:r,cleanContent:l}=i(a);return[{id:e.id,content:e.content,created_at:e.created_at,pubkey:e.pubkey,media:s,links:r,cleanContent:l,reactions:{likes:0},comments:[],aggregatedCounts:{reactions:0,comments:0}},...t]}))}))})(),()=>{ed.current&&(ed.current(),ed.current=null),eo.current.clear()}),[]);let eb=async()=>{if(!I||!y||!es.trim()){H({title:"Error",description:"Please write something before publishing",variant:"destructive"});return}try{j(!0);let e=await (0,l.cN)(es.trim(),y);if(!e)throw Error("Failed to publish note");m(t=>t.some(t=>t.id===e.id)?t:[{id:e.id,content:e.content,created_at:e.created_at,pubkey:e.pubkey,reactions:{likes:0},comments:[],aggregatedCounts:{reactions:0,comments:0}},...t]),ea(""),et(!1),H({title:"Success",description:"Your note has been published!"})}catch(e){console.error("Error publishing note:",e),H({title:"Error",description:e instanceof Error?e.message:"Failed to publish note. Please try again.",variant:"destructive"})}finally{j(!1)}},ew=async e=>{if(!y){H({title:"Error",description:"Please log in to add reactions",variant:"destructive"});return}try{await (0,l.ZH)(y,e),U(t=>({...t,[e]:(t[e]||0)+1})),m(t=>t.map(t=>
1t.id===e?{...t,reactions:{...t.reactions,likes:(t.reactions.likes||0)+1}}:t))}catch(e){H({title:"Error",description:"Failed to add reaction: "+e.message,variant:"destructive"})}},ek=(e,t)=>{Y(q===t?null:t)},eC=function(e,t){var s;let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,l=null===(s=em[e])||void 0===s?void 0:s[t];if(!l)return null;let n=(ex[t]||{parentId:null,childIds:[]}).childIds.filter(t=>{var s;return(null===(s=em[e])||void 0===s?void 0:s[t])!==void 0});return(0,a.jsxs)("div",{className:"mt-2 ".concat(r>0?"ml-4":""),children:[(0,a.jsxs)("div",{className:"bg-gray-100 dark:bg-gray-800 p-2 rounded-lg",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:new Date(1e3*l.created_at).toLocaleString()}),(0,a.jsx)("span",{className:"text-sm font-medium",children:l.pubkey.slice(0,8)+"..."+l.pubkey.slice(-8)})]}),(0,a.jsx)("p",{className:"mt-1 text-sm",children:l.content}),(0,a.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,a.jsx)("button",{onClick:()=>ek(e,t),className:"text-sm text-blue-500 hover:text-blue-600 dark:text-blue-400 dark:hover:text-blue-300",children:"Reply"}),n.length>0&&(0,a.jsxs)("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:[n.length," ",1===n.length?"reply":"replies"]})]})]}),g[e]&&n.length>0&&(0,a.jsx)("div",{className:"mt-2",children:n.map(t=>eC(e,t,r+1))})]},t)},eS=()=>{let e=d.filter(e=>e.created_at>=R).sort((e,t)=>t.created_at-e.created_at);return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("div",{className:"flex justify-between items-center",children:(0,a.jsx)("h2",{className:"text-2xl font-bold",children:"Community Support"})}),(0,a.jsx)("div",{className:"space-y-6",children:0===e.length?(0,a.jsx)("div",{className:"text-center text-gray-500 py-8",children:"No posts available yet"}):e.map(e=>{var t,s;return(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-sm border border-gray-100 hover:shadow-md transition-shadow duration-200",children:[(0,a.jsxs)("div",{className:"p-6 cursor-pointer",onClick:()=>ey(e.id),children:[(0,a.jsxs)("div",{className:"flex justify-between items-start mb-3",children:[(0,a.jsx)("div",{className:"text-xs text-gray-500",children:new Date(1e3*e.created_at).toLocaleString()}),(0,a.jsx)("div",{className:"flex items-center space-x-2",children:(0,a.jsx)("div",{className:"text-xs font-mono text-purple-600 bg-purple-50 px-2 py-0.5 rounded",children:e.pubkey.slice(-4)})})]}),(0,a.jsx)("p",{className:"text-gray-900 whitespace-pre-wrap text-base mb-4",children:e.cleanContent||e.content}),e.media&&e.media.length>0&&(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)(u,{media:e.media})}),e.links&&e.links.length>0&&(0,a.jsx)("div",{className:"mb-4",children:(0,a.jsx)(N,{urls:e.links})}),(0,a.jsxs)("div",{className:"flex items-center space-x-4 text-sm text-gray-600",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("button",{onClick:t=>{t.stopPropagation(),ew(e.id)},className:"flex items-center space-x-1.5 hover:text-purple-600 transition-colors",children:[(0,a.jsx)(k,{className:"h-4 w-4"}),(0,a.jsx)("span",{children:e.reactions.likes||0})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-1.5",children:[(0,a.jsx)(C.A,{className:"h-4 w-4"}),(0,a.jsx)("span",{children:(null===(t=B[e.id])||void 0===t?void 0:t.comments)||0})]})]})]}),g[e.id]&&(0,a.jsx)("div",{className:"border-t border-gray-100",children:(0,a.jsx)("div",{className:"p-6",children:(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(b.p,{value:h[e.id]||"",onChange:t=>p(s=>({...s,[e.id]:t.target.value})),placeholder:"Write a comment...",className:"text-sm pr-12",onClick:e=>e.stopPropagation()}),(0,a.jsx)(x.$,{size:"sm",className:"absolute right-1 top-1 h-7",onClick:t=>{t.stopPropagation(),eN(e.id,h[e.id]||"",void 0)},disabled:!(null===(s=h[e.id])||void 0===s?void 0:s.trim()),children:(0,a.jsx)(S.A,{className:"h-3.5 w-3.5"})})]}),(0,a.jsx)("div",{className:"space-y-4",onClick:e=>e.stopPropagation(),children:ej(e.id).map(t=>eC(e.id,t))})]})})})]},e.id)})})]})},eM=()=>(0,a.jsx)("div",{className:"max-w-2xl mx-auto",children:(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-sm border border-gray-100 p-6",children:[(0,a.jsx)("h2",{className:"text-2xl font-bold text-gray-900 mb-6",children:"Profile Settings"}),(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"border-t border-gray-200 pt-6",children:[(0,a.jsx)("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Account Information"}),(0,a.jsx)("div",{className:"space-y-4",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm font-medium text-gray-700",children:"Public Key"}),(0,a.jsx)("div",{className:"mt-1",children:(0,a.jsx)(b.p,{value:
1I||"",readOnly:!0,className:"bg-gray-50"})})]})})]}),(0,a.jsxs)("div",{className:"border-t border-gray-200 pt-6",children:[(0,a.jsx)("h3",{className:"text-lg font-medium text-red-600 mb-4",children:"Danger Zone"}),(0,a.jsx)(x.$,{variant:"destructive",onClick:eg,className:"w-full sm:w-auto",children:"Logout"})]})]})]})});return y?(0,a.jsxs)("div",{className:"min-h-screen bg-gray-50 dark:bg-gray-900",children:[(0,a.jsx)("div",{className:"container mx-auto px-4 py-4",children:(0,a.jsxs)("div",{className:"max-w-4xl mx-auto",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-8",children:[(0,a.jsx)("div",{children:(0,a.jsx)("h1",{className:"text-3xl font-bold bg-gradient-to-r from-[#663399] to-orange-500 bg-clip-text text-transparent",children:"Sobrkey"})}),(0,a.jsx)("div",{className:"flex items-center gap-2",children:(0,a.jsx)(x.$,{variant:"ghost",size:"icon",onClick:eg,className:"text-gray-500 hover:text-gray-700",children:(0,a.jsx)(M.A,{className:"h-4 w-4"})})})]}),O.length>0&&(0,a.jsx)("div",{className:"flex gap-2 overflow-x-auto pb-4 mb-6",children:O.map(t=>(0,a.jsx)(x.$,{onClick:()=>ep(t),variant:e===t?"default":"ghost",className:"\n                    whitespace-nowrap\n                    ".concat(e===t?"bg-gradient-to-r from-[#663399] to-orange-500 text-white":"text-gray-600 hover:text-gray-900","\n                  "),children:t},t))}),(0,a.jsx)("div",{className:"space-y-4",children:(()=>{switch(e){case"mira":return(0,a.jsx)("div",{className:"max-w-2xl mx-auto",children:(0,a.jsx)("div",{className:"bg-white rounded-lg shadow-sm border border-gray-100 p-6",children:(0,a.jsxs)("div",{className:"text-center space-y-6",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-gradient-to-r from-purple-100 to-orange-100 mb-4",children:(0,a.jsx)("svg",{className:"w-8 h-8 text-purple-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})})}),(0,a.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Chat with Mira"}),(0,a.jsx)("div",{className:"flex justify-center",children:(0,a.jsx)(x.$,{variant:"outline",className:"bg-gradient-to-r from-purple-100 to-orange-100 border-purple-200 text-purple-600 hover:from-purple-200 hover:to-orange-200",children:"Coming Soon"})}),(0,a.jsx)("p",{className:"text-gray-600 max-w-md mx-auto",children:"Mira, your AI companion for recovery, is coming soon. She'll be here to provide support, guidance, and a listening ear 24/7."}),(0,a.jsxs)("div",{className:"space-y-4 text-left max-w-md mx-auto",children:[(0,a.jsxs)("div",{className:"flex items-start space-x-3",children:[(0,a.jsx)("div",{className:"flex-shrink-0 mt-1",children:(0,a.jsx)("div",{className:"w-2 h-2 rounded-full bg-purple-600"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"font-medium text-gray-900",children:"Personalized Support"}),(0,a.jsx)("p",{className:"text-sm text-gray-600",children:"Get tailored guidance and support based on your unique journey and needs."})]})]}),(0,a.jsxs)("div",{className:"flex items-start space-x-3",children:[(0,a.jsx)("div",{className:"flex-shrink-0 mt-1",children:(0,a.jsx)("div",{className:"w-2 h-2 rounded-full bg-purple-600"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"font-medium text-gray-900",children:"24/7 Availability"}),(0,a.jsx)("p",{className:"text-sm text-gray-600",children:"Access support anytime, anywhere - Mira is always here to help."})]})]}),(0,a.jsxs)("div",{className:"flex items-start space-x-3",children:[(0,a.jsx)("div",{className:"flex-shrink-0 mt-1",children:(0,a.jsx)("div",{className:"w-2 h-2 rounded-full bg-purple-600"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"font-medium text-gray-900",children:"Private & Secure"}),(0,a.jsx)("p",{className:"text-sm text-gray-600",children:"Your conversations with Mira are completely private and secure."})]})]})]}),(0,a.jsx)("div",{className:"pt-4",children:(0,a.jsx)("p",{className:"text-sm text-gray-500",children:"We're working hard to bring Mira to you. Stay tuned for updates!"})})]})})});case"meet":return(0,a.jsx)("div",{className:"max-w-2xl mx-auto",children:(0,a.jsx)("div",{className:"bg-white rounded-lg shadow-sm border border-gray-100 p-6",children:(0,a.jsxs)("div",{className:"text-center space-y-4",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-purple-100 mb-4",children:(0,a.jsx)("svg",{className:"w-8 h-8 text-purple-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 8h2a2 2 0 012 2v6a2 2 0 01-2 2h-2v4l-4-4H9a1.994 1.994 0 01-1.414-.586m0 0L11 14h4a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2v4l.586-.586z"})})}),(0,a.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Let's Meet"}),(0,a.jsx)("p",{className:"text-gray-600",children:"Coming soon: Connect with others in real-time through our community spaces."}),(0,a.jsxs)("div",{className:"space-y-4 text-left",children:[(0,a.jsxs)("div",{className:"flex items-start space-x-3",children:[(0,a.jsx)("div",{className:"flex-shrink-0 mt-1",children:(0,a.jsx)("div",{className:"w-2 h-2 rounded-full bg-purple-600"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"font-medium text-gray-900",children:"Live Audio Spaces"}),(0,a.jsx)("p",{className:"text-sm text-gray-600",children:"Join moderated discussions and share your experiences in a safe, supportive environment."})]})]}),(0,a.jsxs)("div",{className:"flex items-start space-x-3",children:[(0,a.jsx)("div",{className:"flex-shrink-0 mt-1",children:(0,a.jsx)("div",{className:"w-2 h-2 rounded-full bg-purple-600"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"font-medium text-gray-900",children:"Scheduled Events"}),(0,a.jsx)("p",{className:"text-sm text-gray-600",children:"Participate in regular meetings, workshops, and special guest sessions."})]})]}),(0,a.jsxs)("div",{className:"flex items-start space-x-3",children:[(0,a.jsx)("div",{className:"flex-shrink-0 mt-1",children:(0,a.jsx)("div",{className:"w-2 h-2 rounded-full bg-purple-600"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"font-medium text-gray-900",children:"Anonymous Participation"}),(0,a.jsx)("p",{className:"text-sm text-gray-600",children:"Join discu
1ssions while maintaining your privacy and anonymity."})]})]})]}),(0,a.jsx)("div",{className:"pt-4",children:(0,a.jsx)("p",{className:"text-sm text-gray-500",children:"Stay tuned for updates on this exciting new feature!"})})]})})});case"about":return(0,a.jsx)("div",{className:"max-w-2xl mx-auto",children:(0,a.jsxs)("div",{className:"bg-white rounded-lg shadow-sm border border-gray-100 p-6",children:[(0,a.jsx)("h2",{className:"text-2xl font-bold mb-4",children:"About Sobrkey"}),(0,a.jsxs)("div",{className:"prose prose-gray max-w-none",children:[(0,a.jsx)("p",{className:"mb-4",children:"Sobrkey is a decentralized community built on the Nostr protocol. It's a space for individuals navigating sobriety, recovery, and personal growth — powered by connection, anonymity, and support."}),(0,a.jsx)("p",{className:"mb-4",children:"The platform is inspired by the principles of the 12-step program but reimagined for an open, peer-driven world. Here, you can journal privately, reflect publicly, or just listen."}),(0,a.jsxs)("div",{className:"mt-6 space-y-3 text-sm text-gray-600",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("span",{className:"text-lg",children:"\uD83D\uDCAC"}),(0,a.jsx)("span",{children:"Powered by Nostr + Mira, the AI companion"})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("span",{className:"text-lg",children:"⚡"}),(0,a.jsx)("span",{children:"Zaps optional, support is free"})]}),(0,a.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,a.jsx)("span",{className:"text-lg",children:"\uD83D\uDEE0️"}),(0,a.jsx)("span",{children:"Built with care, not for profit"})]})]})]})]})});case"12steps":return(0,a.jsx)("div",{className:"max-w-2xl mx-auto",children:(0,a.jsx)("div",{className:"bg-white rounded-lg shadow-sm border border-gray-100 p-6",children:(0,a.jsxs)("div",{className:"text-center space-y-4",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-purple-100 mb-4",children:(0,a.jsx)("svg",{className:"w-8 h-8 text-purple-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,a.jsx)("h2",{className:"text-2xl font-bold text-gray-900",children:"Your Recovery Journey"}),(0,a.jsx)("p",{className:"text-gray-600",children:"Take the next step in your recovery with our guided 12-step program."}),(0,a.jsx)(x.$,{onClick:()=>_.push("/12steps"),className:"mt-4 bg-gradient-to-r from-orange-500 to-purple-600 hover:from-orange-600 hover:to-purple-700",children:"Begin Your Journey"})]})})});case"emergency":return(0,a.jsx)("div",{className:"max-w-2xl mx-auto",children:(0,a.jsx)("div",{className:"bg-white rounded-lg shadow-sm border border-gray-100 p-6",children:(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-red-100 mb-4",children:(0,a.jsx)("svg",{className:"w-8 h-8 text-red-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",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)("h2",{className:"text-2xl font-bold text-gray-900",children:"Emergency Resources"}),(0,a.jsx)("p",{className:"text-gray-600",children:"Immediate help and support is available. You are not alone."})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,a.jsx)("div",{className:"bg-red-50 rounded-lg p-4 border border-red-100",children:(0,a.jsxs)("div",{className:"flex items-start space-x-3",children:[(0,a.jsx)("div",{className:"flex-shrink-0",children:(0,a.jsx)("svg",{className:"w-6 h-6 text-red-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 
111.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"})})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-red-900",children:"National Suicide Prevention Lifeline"}),(0,a.jsx)("p",{className:"text-red-800 mb-2",children:"Available 24/7"}),(0,a.jsx)("a",{href:"tel:988",className:"text-red-600 hover:text-red-700 font-medium",children:"Call or Text: 988"})]})]})}),(0,a.jsx)("div",{className:"bg-purple-50 rounded-lg p-4 border border-purple-100",children:(0,a.jsxs)("div",{className:"flex items-start space-x-3",children:[(0,a.jsx)("div",{className:"flex-shrink-0",children:(0,a.jsx)("svg",{className:"w-6 h-6 text-purple-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 8h2a2 2 0 012 2v6a2 2 0 01-2 2h-2v4l-4-4H9a1.994 1.994 0 01-1.414-.586m0 0L11 14h4a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2v4l.586-.586z"})})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-purple-900",children:"SAMHSA National Helpline"}),(0,a.jsx)("p",{className:"text-purple-800 mb-2",children:"Treatment Referral and Information"}),(0,a.jsx)("a",{href:"tel:18006624357",className:"text-purple-600 hover:text-purple-700 font-medium",children:"Call: 1-800-662-HELP (4357)"})]})]})}),(0,a.jsx)("div",{className:"bg-blue-50 rounded-lg p-4 border border-blue-100",children:(0,a.jsxs)("div",{className:"flex items-start space-x-3",children:[(0,a.jsx)("div",{className:"flex-shrink-0",children:(0,a.jsx)("svg",{className:"w-6 h-6 text-blue-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"})})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-blue-900",children:"Crisis Text Line"}),(0,a.jsx)("p",{className:"text-blue-800 mb-2",children:"Text for immediate support"}),(0,a.jsx)("a",{href:"sms:741741",className:"text-blue-600 hover:text-blue-700 font-medium",children:"Text HOME to 741741"})]})]})}),(0,a.jsx)("div",{className:"bg-green-50 rounded-lg p-4 border border-green-100",children:(0,a.jsxs)("div",{className:"flex items-start space-x-3",children:[(0,a.jsx)("div",{className:"flex-shrink-0",children:(0,a.jsx)("svg",{className:"w-6 h-6 text-green-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 21V5a2 2 0 00-2-2H7a2 2 0 00-2 2v16m14 0h2m-2 0h-5m-9 0H3m2 0h5M9 7h1m-1 4h1m4-4h1m-1 4h1m-5 10v-5a1 1 0 011-1h2a1 1 0 011 1v5m-4 0h4"})})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-green-900",children:"Local Emergency Services"}),(0,a.jsx)("p",{className:"text-green-800 mb-2",children:"For immediate medical assistance"}),(0,a.jsx)("a",{href:"tel:911",className:"text-green-600 hover:text-green-700 font-medium",children:"Call: 911"})]})]})})]}),(0,a.jsx)("div",{className:"bg-yellow-50 rounded-lg p-4 border border-yellow-100",children:(0,a.jsxs)("div",{className:"flex items-start space-x-3",children:[(0,a.jsx)("div",{className:"flex-shrink-0",children:(0,a.jsxs)("svg",{className:"w-6 h-6 text-yellow-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-yellow-900",children:"Local Treatment Centers"}),(0,a.jsx)("p",{className:"text-yellow-800 mb-2",children:"Find help near you"}),(0,a.jsx)(x.$,{variant:"outline",size:"sm",onClick:ev,className:"text-yellow-600 hover:text-yellow-700",children:D?"Loading...":"Find Local Help"}),$.length>0&&(0,a.jsx)("div",{className:"mt-4 space-y-2",children:$.map((e,t)=>(0,a.jsxs)("div",{className:"text-sm",children:[(0,a.jsx)("p",{className:"font-medium",children:e.name}),(0,a.jsx)("p",{className:"text-yellow-700",children:e.address}),(0,a.jsx)("a",{href:"tel:".concat(e.phone),className:"text-yellow-600 hover:text-yellow-700",children:e.phone})]},t))})]})]})}),(0,a.jsx)("div",{className:"bg-gray-50 rounded-lg p-4 border border-gray-100",children:(0,a.jsxs)("div",{className:"flex items-start space-x-3",children:[(0,a.jsx)("div",{className:"flex-shrink-0",children:(0,a.jsx)("svg",{className:"w-6 h-6 text-gray-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:"Additional Resources"}),(0,a.jsxs)("div",{className:"mt-2 space-y-2",children:[(0,a.jsx)("a",{href:"https://www.aa.org",className:"block text-gray-600 hover:text-gray-900",children:"Alcoholics Anonymous"}),(0,a.jsx)("a",{href:"https://www.na.org",className:"block text-gray-600 hover:text-gray-900",children:"Narcotics Anonymous"}),(0,a.jsx)("a",{href:"https://www.smartrecovery.org",className:"block text-gray-600 hover:text-gray-900",children:"SMART Recovery"})]})]})]})}),(0,a.jsxs)("div",{className:"text-center text-sm text-gray-500",children:[(0,a.jsx)("p",{children:"These services are available 24/7. Please reach out if you need help."}),(0,a.jsx)("p",{className:"mt-2",children:"Remember: Your life is valuable, and help is always available."})]})]})})});case"profile":return eM();default:return eS()}})()})]})}),(0,a.jsx)(E.MobileNav,{}),(0,a.jsx)(P,{onClick:()=>et(!0)}),(0,a.jsx)(c.lG,{open:ee,onOpenChange:et,children:(0,a.jsxs)(c.Cf,{className:"sm:max-w-[500px]",children:[(0,a.jsx)(c.c7,{children:(0,a.jsx)(c.L3,{children:"Create New Note"})}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(z.T,{value:es,onChange:e=>ea(e.target.value),placeholder:"What's on your mind?",className:"min-h-[200px] resize-none",autoFocus:!0}),(0,a.jsx)(x.$,{className:"w-full bg-gradient-to-r from-[#663399] to-orange-500 text-white hover:opacity-90 disabled:opacity-50",onClick:eb,disabled:!es.trim()||f,children:f?"Publishing...":"Publish Note"})]})]})})]}):(0,a.jsx)("div",{className:"min-h-screen flex items-center justify-center",children:(0,a.jsxs)("div",{className:"text-center",children:[(0,a.jsx)("h1",{className:"text-2xl font-bold mb-4",children:"Not logged in"}),(0,a.jsx)(x.$,{onClick:()=>window.location.href="/",children:"Go to login page"})]})})}},9314:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(6150).A)("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]])}},e=>{var t=t=>e(e.s=t);e.O(0,[7,958,708,226,698,285,942,678,358],()=>t(144)),_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.