birdclaw 0.8.4 → 0.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/cli/birdclaw.js +8 -9
  3. package/dist/client/assets/ProfilePreview-DQX6_xc3.js +1 -0
  4. package/dist/client/assets/{SavedTimelineView-BIS7HKpp.js → SavedTimelineView-BhSiVyR1.js} +1 -1
  5. package/dist/client/assets/{TimelineRouteFrame-CyGPj0eM.js → TimelineRouteFrame-9NDLnXzH.js} +1 -1
  6. package/dist/client/assets/{blocks-7UDKQp8H.js → blocks-CFp_njvG.js} +1 -1
  7. package/dist/client/assets/{bookmarks-CbBkMvXk.js → bookmarks-LbYOsoKf.js} +1 -1
  8. package/dist/client/assets/{client-stream-contracts-ys3XhWG4.js → client-stream-contracts-sR4xMQxY.js} +1 -1
  9. package/dist/client/assets/{data-sources-Cm2bpNvg.js → data-sources-euTr6T_L.js} +1 -1
  10. package/dist/client/assets/{discuss-DTjaOugw.js → discuss-BWKu_p7B.js} +1 -1
  11. package/dist/client/assets/{dms-CGd6Eogq.js → dms-SLXMtC4v.js} +1 -1
  12. package/dist/client/assets/{inbox-BHlGuOy2.js → inbox-BybSI5Vf.js} +1 -1
  13. package/dist/client/assets/{index-CEIG7S6s.js → index-DZVisyna.js} +3 -3
  14. package/dist/client/assets/{likes-cLrcAQem.js → likes-dyh9p8y_.js} +1 -1
  15. package/dist/client/assets/{links-CM9QO1LC.js → links-CIwqK_dX.js} +1 -1
  16. package/dist/client/assets/{mapbox-BxTlqXt9.js → mapbox-B4zqX7r0.js} +2 -2
  17. package/dist/client/assets/{mapbox-gl-dgf_hX3a.js → mapbox-gl-DYNcLcll.js} +1 -1
  18. package/dist/client/assets/{mentions-CxKCgzIf.js → mentions-BoVVAIT7.js} +1 -1
  19. package/dist/client/assets/{network-map-B5a3whqj.js → network-map-zRysIY_b.js} +2 -2
  20. package/dist/client/assets/{profile-analyze-CRtNEwlb.js → profile-analyze-C_yDeX6-.js} +1 -1
  21. package/dist/client/assets/{profiles._handle-C82_HoKX.js → profiles._handle-DdIVPqU-.js} +1 -1
  22. package/dist/client/assets/{rate-limits-ScaEwdVK.js → rate-limits-BWPmPOSh.js} +1 -1
  23. package/dist/client/assets/{routes-q7ZaW4En.js → routes-CiLuYpZr.js} +1 -1
  24. package/dist/client/assets/{today-CeG1O7Py.js → today-BoO64YoY.js} +1 -1
  25. package/dist/client/assets/{useTimelineRouteData-1HsqgvUi.js → useTimelineRouteData-BaO3Rna1.js} +1 -1
  26. package/dist/server/assets/{ProfileAnalysisStream-BFvhVdhn.js → ProfileAnalysisStream-L7bs6IHH.js} +1 -1
  27. package/dist/server/assets/{ProfilePreview-C6gAor_j.js → ProfilePreview-Cg-AOHBE.js} +5 -6
  28. package/dist/server/assets/{SavedTimelineView-BG1jnBp1.js → SavedTimelineView-BtCq1dHk.js} +1 -1
  29. package/dist/server/assets/{TimelineRouteFrame-CU7ilM7U.js → TimelineRouteFrame-CjMIh63G.js} +1 -1
  30. package/dist/server/assets/{TweetRichText-DhCVv1-6.js → TweetRichText-DDywESRF.js} +1 -1
  31. package/dist/server/assets/{_tanstack-start-manifest_v-C-ZRnG_n.js → _tanstack-start-manifest_v-aLWUdbAc.js} +19 -19
  32. package/dist/server/assets/{bookmarks-BJN8tykY.js → bookmarks-D_YkmCK3.js} +1 -1
  33. package/dist/server/assets/{client-stream-contracts-C2xbWVjm.js → client-stream-contracts-Bq6kMmhh.js} +1 -1
  34. package/dist/server/assets/{discuss-QTo08NCN.js → discuss-C1QMBBSk.js} +2 -2
  35. package/dist/server/assets/{discuss-CJ1dau1j.js → discuss-DAq6ehL9.js} +2 -2
  36. package/dist/server/assets/{likes-DBOAtsJU.js → likes-BMm2JWYI.js} +1 -1
  37. package/dist/server/assets/{links-DmH5lxHO.js → links-Da4tjWtI.js} +2 -2
  38. package/dist/server/assets/{links-DAhSjynu.js → links-dqXb35YM.js} +2 -2
  39. package/dist/server/assets/{mentions-BH2MzKtB.js → mentions-CEyEcOFw.js} +1 -1
  40. package/dist/server/assets/{profile-analyze-BP65PED0.js → profile-analyze-CGCj4VFd.js} +2 -2
  41. package/dist/server/assets/{profile-analyze-C1NoM0tV.js → profile-analyze-DH1TSBkT.js} +1 -1
  42. package/dist/server/assets/{profiles._handle-DsLNj2Ca.js → profiles._handle-B5V-huoo.js} +3 -3
  43. package/dist/server/assets/{profiles._handle-DjwlN_ac.js → profiles._handle-CJ6rgzt8.js} +4 -4
  44. package/dist/server/assets/{router-DqkwSPiM.js → router-C4cz9ypd.js} +14 -14
  45. package/dist/server/assets/{routes-A9c9ZhwN.js → routes-B9aikOdB.js} +1 -1
  46. package/dist/server/assets/{today-fvGiZ7ud.js → today-B_TA16QG.js} +2 -2
  47. package/dist/server/assets/{today-B5hVM57Z.js → today-JkxZXdBt.js} +2 -2
  48. package/dist/server/assets/{useTimelineRouteData-27cxynxa.js → useTimelineRouteData-BLXvMGb2.js} +2 -2
  49. package/dist/server/server.js +2 -2
  50. package/package.json +1 -1
  51. package/dist/client/assets/ProfilePreview-BejAuYsJ.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/today-CeG1O7Py.js","assets/chunk-C0phanGV.js","assets/query-client-fYu2rzRC.js","assets/schemas-I9r6F6ya.js","assets/react-nBylq1U5.js","assets/circle-check-C_Vq3ElD.js","assets/createLucideIcon-JV8isFFR.js","assets/client-stream-contracts-ys3XhWG4.js","assets/AvatarChip-DLoqM5xD.js","assets/ProfilePreview-BejAuYsJ.js","assets/SmartTimestamp-BR0-9se2.js","assets/sparkles-CQVlvHsZ.js","assets/profile-hydration-client-YEtJsNTv.js","assets/rate-limits-ScaEwdVK.js","assets/triangle-alert-CBL7s2pf.js","assets/profile-analyze-CRtNEwlb.js","assets/search-Dq5kYsxA.js","assets/network-map-B5a3whqj.js","assets/users-CHbKlqUr.js","assets/mentions-CxKCgzIf.js","assets/TimelineRouteFrame-CyGPj0eM.js","assets/useTimelineRouteData-1HsqgvUi.js","assets/repeat-2-xCwHM9hD.js","assets/links-CM9QO1LC.js","assets/likes-cLrcAQem.js","assets/SavedTimelineView-BIS7HKpp.js","assets/inbox-BHlGuOy2.js","assets/dms-CGd6Eogq.js","assets/discuss-DTjaOugw.js","assets/data-sources-Cm2bpNvg.js","assets/bookmarks-CbBkMvXk.js","assets/blocks-7UDKQp8H.js","assets/routes-q7ZaW4En.js","assets/profiles._handle-C82_HoKX.js"])))=>i.map(i=>d[i]);
2
- import{n as e,r as t,t as n}from"./chunk-C0phanGV.js";import{t as r}from"./react-nBylq1U5.js";import{t as i}from"./react-dom-DHl6Ug7F.js";import{$ as a,A as o,B as s,Bt as c,Cn as l,D as u,Dt as d,E as f,Et as p,F as m,Ft as h,G as g,H as _,I as v,In as y,J as b,Jt as x,K as S,L as C,Ln as ee,Lt as te,M as w,Mn as ne,Nn as re,Nt as ie,O as ae,Ot as oe,P as se,Pt as ce,Q as le,R as E,Rt as D,Sn as ue,St as de,T as fe,U as pe,V as O,Vt as k,W as me,X as he,Xt as ge,Yt as _e,Z as ve,_n as ye,_t as be,bn as xe,bt as Se,cn as Ce,dt as we,et as Te,fn as Ee,gn as De,hn as Oe,j as ke,jn as Ae,k as je,mn as Me,nt as Ne,pn as Pe,q as Fe,qt as Ie,tt as Le,ut as Re,vn as ze,vt as Be,w as Ve,xn as He,xt as Ue,yn as We,yt as Ge,zt as Ke}from"./schemas-I9r6F6ya.js";import{t as qe}from"./createLucideIcon-JV8isFFR.js";import{t as Je}from"./circle-check-C_Vq3ElD.js";import{a as Ye,o as Xe,r as Ze,s as Qe,t as $e}from"./client-stream-contracts-ys3XhWG4.js";import{t as et}from"./sparkles-CQVlvHsZ.js";import{B as tt,D as nt,E as rt,F as it,I as at,L as ot,M as st,N as ct,O as lt,P as ut,R as dt,S as ft,T as pt,a as mt,b as ht,c as gt,g as _t,j as vt,k as yt,n as bt,p as xt,r as St,t as Ct,x as wt,z as Tt}from"./query-client-fYu2rzRC.js";import{r as Et,t as Dt}from"./AvatarChip-DLoqM5xD.js";import{a as Ot,c as kt,i as At,o as jt,s as Mt,t as Nt}from"./ProfilePreview-BejAuYsJ.js";import{t as Pt}from"./SmartTimestamp-BR0-9se2.js";import{n as Ft,t as It}from"./profile-hydration-client-YEtJsNTv.js";var Lt=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,re());else{var t=n(l);t!==null&&oe(x,t.startTime-e)}}var S=!1,C=-1,ee=5,te=-1;function w(){return g?!0:!(e.unstable_now()-te<ee)}function ne(){if(g=!1,S){var t=e.unstable_now();te=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&w());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&oe(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?re():S=!1}}}var re;if(typeof y==`function`)re=function(){y(ne)};else if(typeof MessageChannel<`u`){var ie=new MessageChannel,ae=ie.port2;ie.port1.onmessage=ne,re=function(){ae.postMessage(null)}}else re=function(){_(ne,0)};function oe(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):ee=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,oe(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,re()))),r},e.unstable_shouldYield=w,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Rt=n(((e,t)=>{t.exports=Lt()})),zt=n((e=>{var t=Rt(),n=r(),a=i();function o(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function l(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(c(e)!==e)throw Error(o(188))}function f(e){var t=e.alternate;if(!t){if(t=c(e),t===null)throw Error(o(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return d(i),e;if(a===r)return d(i),t;a=a.sibling}throw Error(o(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=a;break}if(l===r){s=!0,r=i,n=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===n){s=!0,n=a,r=i;break}if(l===r){s=!0,r=a,n=i;break}l=l.sibling}if(!s)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,h=Symbol.for(`react.element`),g=Symbol.for(`react.transitional.element`),_=Symbol.for(`react.portal`),v=Symbol.for(`react.fragment`),y=Symbol.for(`react.strict_mode`),b=Symbol.for(`react.profiler`),x=Symbol.for(`react.consumer`),S=Symbol.for(`react.context`),C=Symbol.for(`react.forward_ref`),ee=Symbol.for(`react.suspense`),te=Symbol.for(`react.suspense_list`),w=Symbol.for(`react.memo`),ne=Symbol.for(`react.lazy`),re=Symbol.for(`react.activity`),ie=Symbol.for(`react.memo_cache_sentinel`),ae=Symbol.iterator;function oe(e){return typeof e!=`object`||!e?null:(e=ae&&e[ae]||e[`@@iterator`],typeof e==`function`?e:null)}var se=Symbol.for(`react.client.reference`);function ce(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===se?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case v:return`Fragment`;case b:return`Profiler`;case y:return`StrictMode`;case ee:return`Suspense`;case te:return`SuspenseList`;case re:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case _:return`Portal`;case S:return e.displayName||`Context`;case x:return(e._context.displayName||`Context`)+`.Consumer`;case C:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case w:return t=e.displayName||null,t===null?ce(e.type)||`Memo`:t;case ne:t=e._payload,e=e._init;try{return ce(e(t))}catch{}}return null}var le=Array.isArray,E=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},de=[],fe=-1;function pe(e){return{current:e}}function O(e){0>fe||(e.current=de[fe],de[fe]=null,fe--)}function k(e,t){fe++,de[fe]=e.current,e.current=t}var me=pe(null),he=pe(null),ge=pe(null),_e=pe(null);function ve(e,t){switch(k(ge,t),k(he,e),k(me,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Hd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Hd(t),e=Ud(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}O(me),k(me,e)}function ye(){O(me),O(he),O(ge)}function be(e){e.memoizedState!==null&&k(_e,e);var t=me.current,n=Ud(t,e.type);t!==n&&(k(he,e),k(me,n))}function xe(e){he.current===e&&(O(me),O(he)),_e.current===e&&(O(_e),$f._currentValue=ue)}var Se,Ce;function we(e){if(Se===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Se=t&&t[1]||``,Ce=-1<e.stack.indexOf(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/today-BoO64YoY.js","assets/chunk-C0phanGV.js","assets/query-client-fYu2rzRC.js","assets/schemas-I9r6F6ya.js","assets/react-nBylq1U5.js","assets/circle-check-C_Vq3ElD.js","assets/createLucideIcon-JV8isFFR.js","assets/client-stream-contracts-sR4xMQxY.js","assets/AvatarChip-DLoqM5xD.js","assets/ProfilePreview-DQX6_xc3.js","assets/SmartTimestamp-BR0-9se2.js","assets/sparkles-CQVlvHsZ.js","assets/profile-hydration-client-YEtJsNTv.js","assets/rate-limits-BWPmPOSh.js","assets/triangle-alert-CBL7s2pf.js","assets/profile-analyze-C_yDeX6-.js","assets/search-Dq5kYsxA.js","assets/network-map-zRysIY_b.js","assets/users-CHbKlqUr.js","assets/mentions-BoVVAIT7.js","assets/TimelineRouteFrame-9NDLnXzH.js","assets/useTimelineRouteData-BaO3Rna1.js","assets/repeat-2-xCwHM9hD.js","assets/links-CIwqK_dX.js","assets/likes-dyh9p8y_.js","assets/SavedTimelineView-BhSiVyR1.js","assets/inbox-BybSI5Vf.js","assets/dms-SLXMtC4v.js","assets/discuss-BWKu_p7B.js","assets/data-sources-euTr6T_L.js","assets/bookmarks-LbYOsoKf.js","assets/blocks-CFp_njvG.js","assets/routes-CiLuYpZr.js","assets/profiles._handle-DdIVPqU-.js"])))=>i.map(i=>d[i]);
2
+ import{n as e,r as t,t as n}from"./chunk-C0phanGV.js";import{t as r}from"./react-nBylq1U5.js";import{t as i}from"./react-dom-DHl6Ug7F.js";import{$ as a,A as o,B as s,Bt as c,Cn as l,D as u,Dt as d,E as f,Et as p,F as m,Ft as h,G as g,H as _,I as v,In as y,J as b,Jt as x,K as S,L as C,Ln as ee,Lt as te,M as w,Mn as ne,Nn as re,Nt as ie,O as ae,Ot as oe,P as se,Pt as ce,Q as le,R as E,Rt as D,Sn as ue,St as de,T as fe,U as pe,V as O,Vt as k,W as me,X as he,Xt as ge,Yt as _e,Z as ve,_n as ye,_t as be,bn as xe,bt as Se,cn as Ce,dt as we,et as Te,fn as Ee,gn as De,hn as Oe,j as ke,jn as Ae,k as je,mn as Me,nt as Ne,pn as Pe,q as Fe,qt as Ie,tt as Le,ut as Re,vn as ze,vt as Be,w as Ve,xn as He,xt as Ue,yn as We,yt as Ge,zt as Ke}from"./schemas-I9r6F6ya.js";import{t as qe}from"./createLucideIcon-JV8isFFR.js";import{t as Je}from"./circle-check-C_Vq3ElD.js";import{a as Ye,o as Xe,r as Ze,s as Qe,t as $e}from"./client-stream-contracts-sR4xMQxY.js";import{t as et}from"./sparkles-CQVlvHsZ.js";import{B as tt,D as nt,E as rt,F as it,I as at,L as ot,M as st,N as ct,O as lt,P as ut,R as dt,S as ft,T as pt,a as mt,b as ht,c as gt,g as _t,j as vt,k as yt,n as bt,p as xt,r as St,t as Ct,x as wt,z as Tt}from"./query-client-fYu2rzRC.js";import{r as Et,t as Dt}from"./AvatarChip-DLoqM5xD.js";import{a as Ot,c as kt,i as At,o as jt,s as Mt,t as Nt}from"./ProfilePreview-DQX6_xc3.js";import{t as Pt}from"./SmartTimestamp-BR0-9se2.js";import{n as Ft,t as It}from"./profile-hydration-client-YEtJsNTv.js";var Lt=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,re());else{var t=n(l);t!==null&&oe(x,t.startTime-e)}}var S=!1,C=-1,ee=5,te=-1;function w(){return g?!0:!(e.unstable_now()-te<ee)}function ne(){if(g=!1,S){var t=e.unstable_now();te=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&w());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&oe(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?re():S=!1}}}var re;if(typeof y==`function`)re=function(){y(ne)};else if(typeof MessageChannel<`u`){var ie=new MessageChannel,ae=ie.port2;ie.port1.onmessage=ne,re=function(){ae.postMessage(null)}}else re=function(){_(ne,0)};function oe(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):ee=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,oe(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,re()))),r},e.unstable_shouldYield=w,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Rt=n(((e,t)=>{t.exports=Lt()})),zt=n((e=>{var t=Rt(),n=r(),a=i();function o(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function l(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(c(e)!==e)throw Error(o(188))}function f(e){var t=e.alternate;if(!t){if(t=c(e),t===null)throw Error(o(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return d(i),e;if(a===r)return d(i),t;a=a.sibling}throw Error(o(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,l=i.child;l;){if(l===n){s=!0,n=i,r=a;break}if(l===r){s=!0,r=i,n=a;break}l=l.sibling}if(!s){for(l=a.child;l;){if(l===n){s=!0,n=a,r=i;break}if(l===r){s=!0,r=a,n=i;break}l=l.sibling}if(!s)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,h=Symbol.for(`react.element`),g=Symbol.for(`react.transitional.element`),_=Symbol.for(`react.portal`),v=Symbol.for(`react.fragment`),y=Symbol.for(`react.strict_mode`),b=Symbol.for(`react.profiler`),x=Symbol.for(`react.consumer`),S=Symbol.for(`react.context`),C=Symbol.for(`react.forward_ref`),ee=Symbol.for(`react.suspense`),te=Symbol.for(`react.suspense_list`),w=Symbol.for(`react.memo`),ne=Symbol.for(`react.lazy`),re=Symbol.for(`react.activity`),ie=Symbol.for(`react.memo_cache_sentinel`),ae=Symbol.iterator;function oe(e){return typeof e!=`object`||!e?null:(e=ae&&e[ae]||e[`@@iterator`],typeof e==`function`?e:null)}var se=Symbol.for(`react.client.reference`);function ce(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===se?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case v:return`Fragment`;case b:return`Profiler`;case y:return`StrictMode`;case ee:return`Suspense`;case te:return`SuspenseList`;case re:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case _:return`Portal`;case S:return e.displayName||`Context`;case x:return(e._context.displayName||`Context`)+`.Consumer`;case C:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case w:return t=e.displayName||null,t===null?ce(e.type)||`Memo`:t;case ne:t=e._payload,e=e._init;try{return ce(e(t))}catch{}}return null}var le=Array.isArray,E=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,D=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ue={pending:!1,data:null,method:null,action:null},de=[],fe=-1;function pe(e){return{current:e}}function O(e){0>fe||(e.current=de[fe],de[fe]=null,fe--)}function k(e,t){fe++,de[fe]=e.current,e.current=t}var me=pe(null),he=pe(null),ge=pe(null),_e=pe(null);function ve(e,t){switch(k(ge,t),k(he,e),k(me,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Hd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Hd(t),e=Ud(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}O(me),k(me,e)}function ye(){O(me),O(he),O(ge)}function be(e){e.memoizedState!==null&&k(_e,e);var t=me.current,n=Ud(t,e.type);t!==n&&(k(he,e),k(me,n))}function xe(e){he.current===e&&(O(me),O(he)),_e.current===e&&(O(_e),$f._currentValue=ue)}var Se,Ce;function we(e){if(Se===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Se=t&&t[1]||``,Ce=-1<e.stack.indexOf(`
3
3
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
4
  `+Se+e+Ce}var Te=!1;function Ee(e,t){if(!e||Te)return``;Te=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
5
5
  `),l=s.split(`
@@ -28,4 +28,4 @@ Error generating stack: `+e.message+`
28
28
  root.dataset.theme = resolved;
29
29
  root.style.colorScheme = resolved;
30
30
  })();
31
- `;function ef({children:e}){let[t,n]=(0,V.useState)(`system`),[r,i]=(0,V.useState)(`light`),[a,o]=(0,V.useState)(!1);(0,V.useEffect)(()=>{let e=Qd();n(e),i(Xd(e)),Zd(e),o(!0)},[]),(0,V.useEffect)(()=>{if(!a||(Zd(t),i(Xd(t)),window.localStorage.setItem(qd,t),t!==`system`||typeof window.matchMedia!=`function`))return;let e=window.matchMedia(`(prefers-color-scheme: dark)`),n=()=>{let t=e.matches?`dark`:`light`;i(t),document.documentElement.dataset.theme=t,document.documentElement.style.colorScheme=t};return typeof e.addEventListener==`function`?e.addEventListener(`change`,n):e.addListener?.(n),()=>{typeof e.removeEventListener==`function`?e.removeEventListener(`change`,n):e.removeListener?.(n)}},[a,t]);let s=(0,V.useMemo)(()=>({isReady:a,theme:t,resolvedTheme:r,setTheme:n}),[a,r,t]);return(0,H.jsx)(Jd.Provider,{value:s,children:e})}function tf(){let e=(0,V.useContext)(Jd);if(!e)throw Error(`useTheme must be used within ThemeProvider`);return e}var nf=e=>Number.isNaN(e)?.5:e<=0?0:e>=1?1:e,rf=()=>typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches??!1,af=e=>{e.classList.remove(`theme-transition`),e.style.removeProperty(`--theme-switch-x`),e.style.removeProperty(`--theme-switch-y`)};function of({nextTheme:e,currentTheme:t,setTheme:n,context:r}){if(t===e)return;if(typeof document>`u`){n(e);return}let i=document.documentElement,a=typeof document.startViewTransition==`function`?document.startViewTransition.bind(document):void 0,o=!!a&&!rf(),s=()=>{(0,Zl.flushSync)(()=>{n(e)})};if(!o){s(),af(i);return}let c=.5,l=.5;if(r?.pointerClientX!==void 0&&r.pointerClientY!==void 0&&typeof window<`u`)c=nf(r.pointerClientX/window.innerWidth),l=nf(r.pointerClientY/window.innerHeight);else if(r?.element&&typeof window<`u`){let e=r.element.getBoundingClientRect();e.width>0&&e.height>0&&(c=nf((e.left+e.width/2)/window.innerWidth),l=nf((e.top+e.height/2)/window.innerHeight))}i.style.setProperty(`--theme-switch-x`,`${c*100}%`),i.style.setProperty(`--theme-switch-y`,`${l*100}%`),i.classList.add(`theme-transition`);try{let e=a?.(()=>{s()});if(!e?.finished){af(i);return}e.finished.catch(()=>void 0).finally(()=>af(i))}catch{af(i),s()}}var sf=[{key:`system`,icon:sd,label:`System default`},{key:`light`,icon:dd,label:`Light theme`},{key:`dark`,icon:cd,label:`Dark theme`}];function cf(e){return sf.findIndex(t=>t.key===e)}function lf({compact:e=!1}){let{isReady:t,theme:n,setTheme:r}=tf(),i=Math.max(cf(n),0),a=sf[i],o=sf[(i+1)%sf.length],s=a.icon;return(0,H.jsx)(`div`,{className:w(`theme-toggle-shell flex justify-center`,e?`shrink-0`:`px-1 py-1 min-[1100px]:justify-start min-[1100px]:px-2`),title:`${a.label}; click for ${o.label}`,children:(0,H.jsx)(`button`,{type:`button`,className:w(`theme-toggle-button inline-flex items-center justify-center rounded-full border bg-transparent text-[var(--ink-soft)] transition-[background,border-color,color,transform,box-shadow] duration-150 hover:border-[color:color-mix(in_srgb,var(--accent)_38%,var(--line))] hover:bg-[var(--bg-hover)] hover:text-[var(--ink)] active:scale-95 disabled:cursor-default disabled:opacity-55 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[color:color-mix(in_srgb,var(--accent)_54%,transparent)]`,e?`size-8 border-transparent`:`size-11 border-[var(--line)] shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--line)_44%,transparent)]`),onClick:e=>{let t={element:e.currentTarget,pointerClientX:e.clientX,pointerClientY:e.clientY};of({nextTheme:o.key,currentTheme:n,setTheme:r,context:t})},"aria-label":`Theme: ${a.label}. Switch to ${o.label}.`,"data-testid":`theme-toggle`,disabled:!t,children:(0,H.jsx)(s,{className:w(`theme-toggle-icon`,e?`size-[17px]`:`size-[19px]`),strokeWidth:2,"aria-hidden":`true`})})})}var uf=[{to:`/inbox`,label:`Inbox`,icon:nd},{to:`/today`,label:`Today`,icon:Ku},{to:`/discuss`,label:`Discuss`,icon:od},{to:`/profile-analyze`,label:`Analyse`,icon:fd},{to:`/network-map`,label:`Map`,icon:Zu},{to:`/data-sources`,label:`Sources`,icon:Xu},{to:`/`,label:`Home`,icon:td},{to:`/mentions`,label:`Mentions`,icon:Gu},{to:`/likes`,label:`Likes`,icon:ed},{to:`/bookmarks`,label:`Bookmarks`,icon:Z},{to:`/links`,label:`Links`,icon:rd},{to:`/rate-limits`,label:`Rate Limits`,icon:$u},{to:`/dms`,label:`DMs`,icon:id},{to:`/blocks`,label:`Blocks`,icon:ud}];function df({compact:e=!1}){let t=Lu({select:e=>e.location.pathname});return(0,H.jsxs)(`aside`,{className:e?ue:He,children:[(0,H.jsxs)(`div`,{className:`flex flex-col`,children:[(0,H.jsxs)(lu,{to:`/`,className:Pe,children:[(0,H.jsx)(`span`,{className:De,children:(0,H.jsx)(Wd,{className:`size-10`})}),(0,H.jsxs)(`span`,{className:e?Oe:Me,children:[(0,H.jsx)(`span`,{className:ze,children:`birdclaw`}),(0,H.jsx)(`span`,{className:ye,children:`Fast search for your archive.`})]})]}),(0,H.jsx)(`nav`,{className:xe,"aria-label":`Primary`,children:uf.map(n=>{let r=t===n.to,i=n.icon;return(0,H.jsxs)(lu,{to:n.to,"aria-label":n.label,className:w(e?D:te,r&&`nav-link-active font-bold`),children:[(0,H.jsx)(i,{className:Ke,size:22,strokeWidth:r?2.4:1.8,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:e?k:c,children:n.label})]},n.to)})})]}),(0,H.jsx)(`div`,{className:We,children:(0,H.jsx)(Ud,{action:(0,H.jsx)(lf,{compact:!0})})})]})}var ff=`/assets/styles-B8s3tt3r.css`,pf=mu({head:()=>({meta:[{charSet:`utf-8`},{name:`viewport`,content:`width=device-width, initial-scale=1`},{title:`birdclaw`}],links:[{rel:`stylesheet`,href:ff}]}),notFoundComponent:mf,shellComponent:hf});function mf(){return(0,H.jsx)(`main`,{className:ie,children:(0,H.jsx)(`div`,{className:`px-4 py-10 text-[var(--ink-soft)]`,children:`Not Found`})})}function hf({children:e}){let t=Lu({select:e=>e.location.pathname}),n=t.startsWith(`/dms`)||t.startsWith(`/network-map`);return(0,H.jsxs)(`html`,{lang:`en`,suppressHydrationWarning:!0,children:[(0,H.jsxs)(`head`,{children:[(0,H.jsx)(Hu,{}),(0,H.jsx)(`script`,{suppressHydrationWarning:!0,children:$d})]}),(0,H.jsxs)(`body`,{className:Ve,children:[(0,H.jsx)(Ct,{children:(0,H.jsx)(ef,{children:(0,H.jsxs)(`div`,{className:l,children:[(0,H.jsx)(df,{compact:n}),(0,H.jsx)(`main`,{className:n?ce:ie,children:e})]})})}),(0,H.jsx)(Uu,{})]})]})}function gf(e,t=``){return typeof e==`string`?e:t}function _f(e,t,n){return typeof e==`string`&&t.includes(e)?e:n}function vf(e,t=!1){return e===!0||e===`true`||e===`1`?!0:e===!1||e===`false`||e===`0`?!1:t}function yf(e){return{inbox:_f(e.inbox,[`all`,`accepted`,`requests`],`all`),reply:_f(e.reply,[`all`,`unreplied`,`replied`],`unreplied`),minFollowers:gf(e.minFollowers),minInfluence:gf(e.minInfluence),sort:_f(e.sort,[`recent`,`followers`],`recent`),q:gf(e.q),conversation:gf(e.conversation)}}function bf(e){return{kind:_f(e.kind,[`mixed`,`mentions`,`dms`],`mixed`),minScore:gf(e.minScore,`40`),hideLowSignal:vf(e.hideLowSignal,!0)}}function xf(e){return{kind:_f(e.kind,[`links`,`videos`],`links`),range:_f(e.range,[`today`,`week`,`month`,`year`,`all`],`week`),source:_f(e.source,[`all`,`tweet`,`dm`],`all`),sort:_f(e.sort,[`rank`,`recent`,`comments`],`rank`),q:gf(e.q)}}function Sf(e){return{q:gf(e.q),question:gf(e.question),source:_f(e.source,[`search`,`all`,`home`,`mentions`,`authored`,`likes`,`bookmarks`],`search`),mode:_f(e.mode,[`auto`,`bird`,`xurl`,`local`],`xurl`),includeDms:vf(e.includeDms)}}function Cf(e){return{period:_f(e.period,[`today`,`24h`,`yesterday`,`week`],`today`),includeDms:vf(e.includeDms)}}function wf(e){return{type:_f(e.type,[`all`,`followers`,`following`,`mutual`],`all`),q:gf(e.q)}}function Tf(e){return{account:gf(e.account,`acct_primary`),q:gf(e.q)}}var Ef,Df,Of,kf,Af=e((()=>{Ef=`modulepreload`,Df=function(e){return`/`+e},Of={},kf=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=Df(t,n),t in Of)return;Of[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:Ef,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})}}));Af();var jf=hu(`/today`)({component:_u(()=>kf(()=>import(`./today-CeG1O7Py.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])),`component`),validateSearch:Cf});Af();var Mf=hu(`/rate-limits`)({component:_u(()=>kf(()=>import(`./rate-limits-ScaEwdVK.js`),__vite__mapDeps([13,1,2,3,4,6,14])),`component`)});Af();var Nf=hu(`/profile-analyze`)({component:_u(()=>kf(()=>import(`./profile-analyze-CRtNEwlb.js`),__vite__mapDeps([15,1,7,6,4,3,8,9,10,16])),`component`),validateSearch:e=>({handle:typeof e.handle==`string`?e.handle:``})}),Pf=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Ff=1,If=8,Lf=new Uint32Array(96),Rf=class e{static from(t){if(!t||t.byteLength===void 0||t.buffer)throw Error(`Data must be an instance of ArrayBuffer or SharedArrayBuffer.`);let[n,r]=new Uint8Array(t,0,2);if(n!==219)throw Error(`Data does not appear to be in a KDBush format.`);let i=r>>4;if(i!==Ff)throw Error(`Got v${i} data when expected v${Ff}.`);let a=Pf[r&15];if(!a)throw Error(`Unrecognized array type.`);let[o]=new Uint16Array(t,2,1),[s]=new Uint32Array(t,4,1);return new e(s,o,a,void 0,t)}constructor(e,t=64,n=Float64Array,r=ArrayBuffer,i){if(isNaN(e)||e<0)throw Error(`Unexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=n,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let a=Pf.indexOf(this.ArrayType),o=e*2*this.ArrayType.BYTES_PER_ELEMENT,s=e*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-s%8)%8;if(a<0)throw Error(`Unexpected typed array class: ${n}.`);if(i)this.data=i,this.ids=new this.IndexArrayType(i,If,e),this.coords=new n(i,If+s+c,e*2),this._pos=e*2,this._finished=!0;else{let i=this.data=new r(If+o+s+c);this.ids=new this.IndexArrayType(i,If,e),this.coords=new n(i,If+s+c,e*2),this._pos=0,this._finished=!1,new Uint8Array(i,0,2).set([219,(Ff<<4)+a]),new Uint16Array(i,2,1)[0]=t,new Uint32Array(i,4,1)[0]=e}}add(e,t){let n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=e,this.coords[this._pos++]=t,n}finish(){let e=this._pos>>1;if(e!==this.numItems)throw Error(`Added ${e} items when expected ${this.numItems}.`);return zf(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,n,r){if(!this._finished)throw Error(`Data not yet indexed - call index.finish().`);let{ids:i,coords:a,nodeSize:o}=this;Lf[0]=0,Lf[1]=i.length-1,Lf[2]=0;let s=3,c=[];for(;s>0;){let l=Lf[--s],u=Lf[--s],d=Lf[--s];if(u-d<=o){for(let o=d;o<=u;o++){let s=a[2*o],l=a[2*o+1];s>=e&&s<=n&&l>=t&&l<=r&&c.push(i[o])}continue}let f=d+u>>1,p=a[2*f],m=a[2*f+1];p>=e&&p<=n&&m>=t&&m<=r&&c.push(i[f]),(l===0?e<=p:t<=m)&&(Lf[s++]=d,Lf[s++]=f-1,Lf[s++]=1-l),(l===0?n>=p:r>=m)&&(Lf[s++]=f+1,Lf[s++]=u,Lf[s++]=1-l)}return c}within(e,t,n){let r=[];return this.withinInto(e,t,n,r),r}withinInto(e,t,n,r){if(!this._finished)throw Error(`Data not yet indexed - call index.finish().`);let{ids:i,coords:a,nodeSize:o}=this;Lf[0]=0,Lf[1]=i.length-1,Lf[2]=0;let s=3,c=0,l=n*n;for(;s>0;){let u=Lf[--s],d=Lf[--s],f=Lf[--s];if(d-f<=o){for(let n=f;n<=d;n++)Uf(a[2*n],a[2*n+1],e,t)<=l&&(r[c++]=i[n]);continue}let p=f+d>>1,m=a[2*p],h=a[2*p+1];Uf(m,h,e,t)<=l&&(r[c++]=i[p]),(u===0?e-n<=m:t-n<=h)&&(Lf[s++]=f,Lf[s++]=p-1,Lf[s++]=1-u),(u===0?e+n>=m:t+n>=h)&&(Lf[s++]=p+1,Lf[s++]=d,Lf[s++]=1-u)}return c}};function zf(e,t,n,r,i,a){if(i-r<=n)return;let o=r+i>>1;Bf(e,t,o,r,i,a),zf(e,t,n,r,o-1,1-a),zf(e,t,n,o+1,i,1-a)}function Bf(e,t,n,r,i,a){for(;i>r;){if(i-r>600){let o=i-r+1,s=n-r+1,c=Math.log(o),l=.5*Math.exp(2*c/3),u=.5*Math.sqrt(c*l*(o-l)/o)*(s-o/2<0?-1:1);Bf(e,t,n,Math.max(r,Math.floor(n-s*l/o+u)),Math.min(i,Math.floor(n+(o-s)*l/o+u)),a)}let o=t[2*n+a],s=r,c=i;for(Vf(e,t,r,n),t[2*i+a]>o&&Vf(e,t,r,i);s<c;){for(Vf(e,t,s,c),s++,c--;t[2*s+a]<o;)s++;for(;t[2*c+a]>o;)c--}t[2*r+a]===o?Vf(e,t,r,c):(c++,Vf(e,t,c,i)),c<=n&&(r=c+1),n<=c&&(i=c-1)}}function Vf(e,t,n,r){Hf(e,n,r),Hf(t,2*n,2*r),Hf(t,2*n+1,2*r+1)}function Hf(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function Uf(e,t,n,r){let i=e-n,a=t-r;return i*i+a*a}var Wf={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e},Gf=Math.fround||(e=>(t=>(e[0]=+t,e[0])))(new Float32Array(1)),Kf=2,qf=3,Jf=4,Yf=5,Xf=6,Zf=class{constructor(e){this.options=Object.assign(Object.create(Wf),e),this.trees=Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){let{log:t,minZoom:n,maxZoom:r}=this.options;t&&console.time(`total time`);let i=`prepare ${e.length} points`;t&&console.time(i),this.points=e;let a=[];for(let t=0;t<e.length;t++){let n=e[t];if(!n.geometry)continue;let[r,i]=n.geometry.coordinates,o=Gf(ep(r)),s=Gf(tp(i));a.push(o,s,1/0,t,-1,1),this.options.reduce&&a.push(0)}let o=this.trees[r+1]=this._createTree(a);t&&console.timeEnd(i);for(let e=r;e>=n;e--){let n=+Date.now();o=this.trees[e]=this._createTree(this._cluster(o,e)),t&&console.log(`z%d: %d clusters in %dms`,e,o.numItems,+Date.now()-n)}return t&&console.timeEnd(`total time`),this}getClusters(e,t){let n=((e[0]+180)%360+360)%360-180,r=Math.max(-90,Math.min(90,e[1])),i=e[2]===180?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)n=-180,i=180;else if(n>i){let e=this.getClusters([n,r,180,a],t),o=this.getClusters([-180,r,i,a],t);return e.concat(o)}let o=this.trees[this._limitZoom(t)],s=o.range(ep(n),tp(a),ep(i),tp(r)),c=o.data,l=[];for(let e of s){let t=this.stride*e;l.push(c[t+Yf]>1?Qf(c,t,this.clusterProps):this.points[c[t+qf]])}return l}getChildren(e){let t=this._getOriginId(e),n=this._getOriginZoom(e),r=`No cluster with the specified id.`,i=this.trees[n];if(!i)throw Error(r);let a=i.data;if(t*this.stride>=a.length)throw Error(r);let o=this.options.radius/(this.options.extent*2**(n-1)),s=a[t*this.stride],c=a[t*this.stride+1],l=i.within(s,c,o),u=[];for(let t of l){let n=t*this.stride;a[n+Jf]===e&&u.push(a[n+Yf]>1?Qf(a,n,this.clusterProps):this.points[a[n+qf]])}if(u.length===0)throw Error(r);return u}getLeaves(e,t,n){t||=10,n||=0;let r=[];return this._appendLeaves(r,e,t,n,0),r}getTile(e,t,n){let r=this.trees[this._limitZoom(e)],i=2**e,{extent:a,radius:o}=this.options,s=o/a,c=(n-s)/i,l=(n+1+s)/i,u={features:[]};return this._addTileFeatures(r.range((t-s)/i,c,(t+1+s)/i,l),r.data,t,n,i,u),t===0&&this._addTileFeatures(r.range(1-s/i,c,1,l),r.data,i,n,i,u),t===i-1&&this._addTileFeatures(r.range(0,c,s/i,l),r.data,-1,n,i,u),u.features.length?u:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){let n=this.getChildren(e);if(t++,n.length!==1)break;e=n[0].properties.cluster_id}return t}_appendLeaves(e,t,n,r,i){let a=this.getChildren(t);for(let t of a){let a=t.properties;if(a&&a.cluster?i+a.point_count<=r?i+=a.point_count:i=this._appendLeaves(e,a.cluster_id,n,r,i):i<r?i++:e.push(t),e.length===n)break}return i}_createTree(e){let t=new Rf(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let n=0;n<e.length;n+=this.stride)t.add(e[n],e[n+1]);return t.finish(),t.data=e,t}_addTileFeatures(e,t,n,r,i,a){for(let o of e){let e=o*this.stride,s=t[e+Yf]>1,c,l,u;if(s)c=$f(t,e,this.clusterProps),l=t[e],u=t[e+1];else{let n=this.points[t[e+qf]];c=n.properties;let[r,i]=n.geometry.coordinates;l=ep(r),u=tp(i)}let d={type:1,geometry:[[Math.round(this.options.extent*(l*i-n)),Math.round(this.options.extent*(u*i-r))]],tags:c},f;f=s||this.options.generateId?t[e+qf]:this.points[t[e+qf]].id,f!==void 0&&(d.id=f),a.features.push(d)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){let{radius:n,extent:r,reduce:i,minPoints:a}=this.options,o=n/(r*2**t),s=e.data,c=[],l=this.stride;for(let n=0;n<s.length;n+=l){if(s[n+Kf]<=t)continue;s[n+Kf]=t;let r=s[n],u=s[n+1],d=e.within(s[n],s[n+1],o),f=s[n+Yf],p=f;for(let e of d){let n=e*l;s[n+Kf]>t&&(p+=s[n+Yf])}if(p>f&&p>=a){let e=r*f,a=u*f,o,m=-1,h=((n/l|0)<<5)+(t+1)+this.points.length;for(let r of d){let c=r*l;if(s[c+Kf]<=t)continue;s[c+Kf]=t;let u=s[c+Yf];e+=s[c]*u,a+=s[c+1]*u,s[c+Jf]=h,i&&(o||(o=this._map(s,n,!0),m=this.clusterProps.length,this.clusterProps.push(o)),i(o,this._map(s,c)))}s[n+Jf]=h,c.push(e/p,a/p,1/0,h,-1,p),i&&c.push(m)}else{for(let e=0;e<l;e++)c.push(s[n+e]);if(p>1)for(let e of d){let n=e*l;if(!(s[n+Kf]<=t)){s[n+Kf]=t;for(let e=0;e<l;e++)c.push(s[n+e])}}}}return c}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,n){if(e[t+Yf]>1){let r=this.clusterProps[e[t+Xf]];return n?Object.assign({},r):r}let r=this.points[e[t+qf]].properties,i=this.options.map(r);return n&&i===r?Object.assign({},i):i}};function Qf(e,t,n){return{type:`Feature`,id:e[t+qf],properties:$f(e,t,n),geometry:{type:`Point`,coordinates:[np(e[t]),rp(e[t+1])]}}}function $f(e,t,n){let r=e[t+Yf],i=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?`${Math.round(r/100)/10}k`:r,a=e[t+Xf],o=a===-1?{}:Object.assign({},n[a]);return Object.assign(o,{cluster:!0,cluster_id:e[t+qf],point_count:r,point_count_abbreviated:i})}function ep(e){return e/360+.5}function tp(e){let t=Math.sin(e*Math.PI/180),n=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return n<0?0:n>1?1:n}function np(e){return(e-.5)*360}function rp(e){let t=(180-e*360)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}var ip=[{value:`all`,label:`All`},{value:`followers`,label:`Followers`},{value:`following`,label:`Following`},{value:`mutual`,label:`Mutual`}],ap={bounds:[-180,-85,180,85],zoom:1.15};async function op(e,t,n,r){let i=new URL(`/api/network-map`,window.location.origin);return i.searchParams.set(`type`,e),i.searchParams.set(`limit`,`50000`),i.searchParams.set(`geocodeLimit`,t?`80`:`12`),n&&i.searchParams.set(`account`,n),t&&i.searchParams.set(`refresh`,`true`),St(i,{signal:r},_t,`Map request failed`)}function sp(e){return new Intl.NumberFormat().format(e)}function cp(e){return e===`mutual`?`mutual`:e===`following`?`following`:`follower`}function lp(e){return e===`mutual`?`#22c55e`:e===`following`?`#f59e0b`:`#1d9bf0`}function up(e){return(e.properties.name||e.properties.handle||`?`).slice(0,1).toUpperCase()}function dp(e){return e.properties.avatarUrl?`/api/avatar?${new URLSearchParams({profileId:e.properties.profileId,v:e.properties.avatarUrl}).toString()}`:null}function fp(e){let t=Math.max(1,e.followers+e.following+e.mutual),n=e.mutual/t*100,r=n+e.following/t*100;return`conic-gradient(#22c55e 0 ${n}%, #f59e0b ${n}% ${r}%, #1d9bf0 ${r}% 100%)`}function pp(e){let t=e.map((e,t)=>({type:`Feature`,geometry:e.geometry,properties:{featureIndex:t,handle:e.properties.handle,name:e.properties.name,avatarUrl:e.properties.avatarUrl,relationship:e.properties.relationship,followersCount:e.properties.followersCount}}));return new Zf({maxZoom:18,minPoints:2,radius:64,map:e=>({followers:+(e.relationship===`followers`),following:+(e.relationship===`following`),mutual:+(e.relationship===`mutual`)}),reduce:(e,t)=>{e.followers+=t.followers,e.following+=t.following,e.mutual+=t.mutual}}).load(t)}function mp(e){return`cluster`in e.properties&&e.properties.cluster===!0}function hp(e,t){return t.properties.followersCount-e.properties.followersCount||e.properties.handle.localeCompare(t.properties.handle)}function gp(e,t){let n=new Map;for(let t of e){let[e,r]=t.geometry.coordinates,i=`${e.toFixed(4)},${r.toFixed(4)}`,a=n.get(i);a?(a.count+=1,a.followers+=t.properties.followersCount):n.set(i,{coordinates:[e,r],count:1,followers:t.properties.followersCount})}return[...n.values()].sort((e,t)=>t.count-e.count||t.followers-e.followers)[0]?.coordinates??t}function _p(e){if(!e||typeof e!=`object`)return null;let t=e;if(typeof t.getBounds!=`function`||typeof t.getZoom!=`function`)return null;let n=t.getBounds();return{bounds:[n.getWest(),n.getSouth(),n.getEast(),n.getNorth()],zoom:t.getZoom()}}function vp(e,t){let[n,r,i,a]=e,[o,s]=t.geometry.coordinates,c=(n+540)%360-180,l=(i+540)%360-180,u=s>=Math.max(-85,r)&&s<=Math.min(85,a),d=i-n>=360?!0:c<=l?o>=c&&o<=l:o>=c||o<=l;return u&&d}function yp(e,t){let n=t.trim().toLowerCase();return n?[e.properties.name,e.properties.handle,e.properties.location,e.properties.resolvedLocation??``,cp(e.properties.relationship)].join(` `).toLowerCase().includes(n):!0}function bp(e,t){let n=ht(),{type:r,q:i}=e,[a,o]=(0,V.useState)(ap),s=zd(Nd({queryKey:bt.status,queryFn:({signal:e})=>mt({signal:e})}).data?.accounts),c=[...bt.networkMap,{type:r,selectedAccountId:s??null}],l=Nd({queryKey:c,queryFn:({signal:e})=>op(r,!1,s,e),staleTime:5*6e4}),u=$({mutationFn:()=>op(r,!0,s),onSuccess:e=>{n.setQueryData(c,e)}}),d=l.data??null,f=l.isPending||u.isPending,p=u.error??l.error,m=(0,V.useMemo)(()=>(d?.features??[]).slice().filter(e=>vp(a.bounds,e)).sort((e,t)=>t.properties.followersCount-e.properties.followersCount||e.properties.handle.localeCompare(t.properties.handle)),[d,a]),h=(0,V.useMemo)(()=>m.filter(e=>yp(e,i)).slice(0,160),[m,i]);return{type:r,setType:n=>t({...e,type:n}),viewport:a,setViewport:o,visibleSearch:i,setVisibleSearch:n=>t({...e,q:n},{replace:!0}),data:d,loading:f,error:p?p instanceof Error?p.message:`Map unavailable`:null,refresh:u.mutate,visibleFeatures:m,filteredVisibleFeatures:h,mapTypes:ip}}Af();var xp=hu(`/network-map`)({component:_u(()=>kf(()=>import(`./network-map-B5a3whqj.js`),__vite__mapDeps([17,1,6,4,16,18,3])),`component`),validateSearch:wf});Af();var Sp=hu(`/mentions`)({component:_u(()=>kf(()=>import(`./mentions-CxKCgzIf.js`),__vite__mapDeps([19,3,1,20,21,2,4,6,5,22,16,8,9,10])),`component`)});function Cp({className:e,muted:t=!1}){return(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`block animate-pulse rounded-full ${t?`bg-[color:color-mix(in_srgb,var(--ink-soft)_16%,transparent)]`:`bg-[color:color-mix(in_srgb,var(--ink-soft)_24%,transparent)]`} ${e}`})}function wp({count:e=4}){return(0,H.jsx)(`div`,{"aria-hidden":`true`,className:`divide-y divide-[var(--line)]`,children:Array.from({length:e},(e,t)=>{let n=t%3==0,r=t%4==2;return(0,H.jsxs)(`article`,{className:`flex gap-3 px-4 py-3`,"data-perf":`tweet-skeleton-row`,children:[(0,H.jsx)(Cp,{className:`size-10 shrink-0 rounded-full`}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(Cp,{className:`h-3.5 w-32`}),(0,H.jsx)(Cp,{className:`h-3 w-20`,muted:!0}),(0,H.jsx)(Cp,{className:`ml-auto h-5 w-16`,muted:!0})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(Cp,{className:`h-3 w-full`}),(0,H.jsx)(Cp,{className:`h-3 w-11/12`,muted:!0}),t%2==0?(0,H.jsx)(Cp,{className:`h-3 w-7/12`,muted:!0}):null]}),n?(0,H.jsx)(Cp,{className:`h-32 w-full rounded-2xl`,muted:!0}):null,r?(0,H.jsxs)(`div`,{className:`space-y-2 rounded-2xl border border-[var(--line)] px-3 py-2`,children:[(0,H.jsx)(Cp,{className:`h-3 w-28`,muted:!0}),(0,H.jsx)(Cp,{className:`h-3 w-full`,muted:!0})]}):null,(0,H.jsx)(`div`,{className:`flex max-w-md items-center justify-between`,children:[`thread`,`reply`,`repost`,`like`].map(e=>(0,H.jsx)(Cp,{className:`h-3 w-11`,muted:!0},e))})]})]},`tweet-skeleton-${t}`)})})}function Tp({count:e=4}){return(0,H.jsx)(`div`,{"aria-hidden":`true`,className:`divide-y divide-[var(--line)]`,children:Array.from({length:e},(e,t)=>(0,H.jsxs)(`article`,{className:`flex gap-3 px-4 py-3`,"data-perf":`link-skeleton-row`,children:[(0,H.jsx)(Cp,{className:`size-9 shrink-0 rounded-full`,muted:!0}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-3`,children:[(0,H.jsx)(Cp,{className:`h-3.5 w-8/12`}),(0,H.jsx)(Cp,{className:`h-3 w-6/12`,muted:!0}),(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,H.jsx)(Cp,{className:`h-3 w-20`,muted:!0}),(0,H.jsx)(Cp,{className:`h-3 w-14`,muted:!0}),(0,H.jsx)(Cp,{className:`h-3 w-24`,muted:!0})]}),t%2==0?(0,H.jsx)(Cp,{className:`h-20 w-72 max-w-full rounded-2xl`,muted:!0}):null]})]},`link-skeleton-${t}`))})}function Ep({children:e,detail:t,label:n}){return(0,H.jsxs)(`div`,{className:`border-b border-[var(--line)]`,children:[(0,H.jsx)(Gd,{detail:t,label:n}),e]})}function Dp({action:e,message:t,title:n=`Could not load this view`}){return(0,H.jsx)(`div`,{className:`border-b border-[var(--line)] px-6 py-10 text-center`,children:(0,H.jsxs)(`div`,{className:`mx-auto max-w-sm`,children:[(0,H.jsx)(`div`,{className:`text-[14px] font-bold text-[var(--alert)]`,children:n}),(0,H.jsx)(`p`,{className:`mt-2 text-[13px] leading-[1.45] text-[var(--ink-soft)]`,children:t}),e?(0,H.jsx)(`div`,{className:`mt-4 flex justify-center`,children:e}):null]})})}function Op({detail:e,label:t}){return(0,H.jsx)(Kd,{detail:e,label:t})}var kp=1200,Ap=5*6e4,jp=[{value:`today`,label:`Today`},{value:`week`,label:`Week`},{value:`month`,label:`Month`},{value:`year`,label:`Year`},{value:`all`,label:`All`}];function Mp(e){return e.title?.trim()||e.displayUrl}function Np(e){return e.description?.trim()||e.displayUrl.split(`?`)[0]||e.displayUrl}function Pp(e,t,n,r){return[...bt.linkInsights,{kind:e,range:t,sort:n,source:r}]}function Fp(e,t,n,r){let i=new URL(`/api/link-insights`,window.location.origin);return i.searchParams.set(`kind`,e),i.searchParams.set(`range`,t),i.searchParams.set(`sort`,n),i.searchParams.set(`source`,r),i.searchParams.set(`limit`,`30`),i.searchParams.set(`commentsLimit`,`30`),i}async function Ip(e,t,n,r,i){return St(Fp(e,t,n,r),{signal:i},xt,`Link insights unavailable`)}function Lp(e,t){return e.sourceUrl||e.contentTweetUrl||t.url}function Rp(e){return e.commentText||e.sharedContentText||e.rawText||`Shared without comment`}function zp(e,t){return!!(e&&t&&e.id===t.id)}function Bp(e){return e.find(e=>e.thumbnailUrl||e.url)??null}function Vp(e){try{let t=new URL(e),n=t.hostname.toLowerCase().replace(/^www\./,``);if(n===`youtu.be`)return t.pathname.split(`/`).filter(Boolean)[0]??null;if(!n.endsWith(`youtube.com`))return null;if(t.pathname===`/watch`)return t.searchParams.get(`v`);let r=t.pathname.split(`/`).filter(Boolean);return r[0]===`embed`||r[0]===`shorts`||r[0]===`live`?r[1]??null:null}catch{return null}}function Hp(e){let t=Vp(e);return!t||!/^[\w-]{6,}$/.test(t)?null:`https://i.ytimg.com/vi/${encodeURIComponent(t)}/hqdefault.jpg`}function Up(e){return e.commentCount??e.mentions.filter(e=>e.hasComment).length}function Wp(e){return e.pureShareCount??e.mentions.filter(e=>e.isPureShare||!e.hasComment).length}function Gp(e){return/^id\d+$/i.test(e.handle)&&e.displayName===e.handle&&e.id===`profile_user_${e.handle.slice(2)}`}function Kp(e){return!e?.handle||Gp(e)?!1:!e.avatarUrl||e.followersCount===0}function qp(e){let t=new Set;for(let n of e?.items??[])for(let e of[n.topSharer,...n.sharers,...n.mentions.flatMap(e=>[e.sharedBy,e.contentAuthor,e.participant])])if(!(!e||!Kp(e))&&(t.add(e.handle.replace(/^@/,``)),t.size>=30))return[...t];return[...t]}function Jp(e,t){let n=ht(),{kind:r,range:i,source:a,sort:o,q:s}=e,c=Nd({queryKey:Pp(r,i,o,a),queryFn:({signal:e})=>Ip(r,i,o,a,e),staleTime:Ap}),l=c.data??null;return(0,V.useEffect)(()=>{if(!l)return;let e=r===`links`?`videos`:`links`,t=window.setTimeout(()=>{n.prefetchQuery({queryKey:Pp(e,i,o,a),queryFn:({signal:t})=>Ip(e,i,o,a,t),staleTime:Ap})},250);return()=>window.clearTimeout(t)},[l,r,n,i,o,a]),(0,V.useEffect)(()=>{let e=qp(l);if(e.length===0)return;let t=!0,r=null,i=()=>{It(n,e,{limit:30}).then(e=>{t&&e.fetchedResults.some(e=>e.status===`hit`)&&n.invalidateQueries({queryKey:bt.linkInsights})}).catch(e=>{t&&console.warn(`Profile hydration failed`,e)})},a=window.setTimeout(()=>{`requestIdleCallback`in window?r=window.requestIdleCallback(i,{timeout:2500}):i()},kp);return()=>{t=!1,window.clearTimeout(a),r!==null&&`cancelIdleCallback`in window&&window.cancelIdleCallback(r)}},[l,n]),{kind:r,setKind:n=>t({...e,kind:n}),range:i,setRange:n=>t({...e,range:n}),source:a,setSource:n=>t({...e,source:n}),sort:o,setSort:n=>t({...e,sort:n}),search:s,setSearch:n=>t({...e,q:n},{replace:!0}),items:(0,V.useMemo)(()=>{let e=s.trim().toLowerCase();return(l?.items??[]).filter(t=>e?[t.title,t.description,t.displayUrl,t.host,t.topSharer?.handle,...t.mentions.map(e=>e.commentText)].filter(Boolean).some(t=>String(t).toLowerCase().includes(e)):!0)},[l?.items,s]),subtitle:(0,V.useMemo)(()=>{if(!l)return`Loading link memory...`;let e=r===`videos`?`video URLs`:`URLs`;return`${Et(l.stats.occurrences)} ${e} across ${Et(l.stats.groups)} groups`},[l,r]),loading:c.isPending,error:c.error?c.error instanceof Error?c.error.message:`Link insights unavailable`:null,retry:c.refetch}}Af();var Yp=hu(`/links`)({component:_u(()=>kf(()=>import(`./links-CM9QO1LC.js`),__vite__mapDeps([23,1,6,4,22,16,18,3,8,9,10])),`component`),validateSearch:xf});Af();var Xp=hu(`/likes`)({component:_u(()=>kf(()=>import(`./likes-cLrcAQem.js`),__vite__mapDeps([24,3,1,25,21,2,4,6,5,22,16,8,9,10])),`component`)});function Zp({item:e,isReplying:t,replyDraft:n,onReplyChange:r,onReplyToggle:i,onReplySend:a}){return(0,H.jsxs)(`article`,{className:w(Be,`items-start`),children:[(0,H.jsx)(Dt,{avatarUrl:e.participant.avatarUrl,hue:e.participant.avatarHue,name:e.participant.displayName,profileId:e.participant.id}),(0,H.jsxs)(`div`,{className:be,children:[(0,H.jsxs)(`header`,{className:Ue,children:[(0,H.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,H.jsx)(`span`,{className:de,children:e.participant.displayName}),(0,H.jsxs)(`span`,{className:Se,children:[`@`,e.participant.handle]})]}),(0,H.jsx)(`span`,{className:Ge,children:`·`}),(0,H.jsx)(Pt,{className:d,value:e.createdAt}),(0,H.jsxs)(`span`,{className:`ml-auto flex items-center gap-1.5`,children:[(0,H.jsx)(`span`,{className:w(x,_e),children:e.entityKind}),(0,H.jsxs)(`span`,{className:w(x,Ie),children:[`score `,e.score]})]})]}),(0,H.jsx)(`h3`,{className:`text-[15px] font-bold text-[var(--ink)]`,children:e.title}),(0,H.jsx)(`p`,{className:p,children:e.text}),(0,H.jsxs)(`div`,{className:oe,children:[(0,H.jsx)(`strong`,{className:`text-[var(--ink)]`,children:e.summary}),(0,H.jsx)(`p`,{children:e.reasoning})]}),(0,H.jsxs)(`div`,{className:`mt-2 flex items-center justify-between gap-3 text-[13px] text-[var(--ink-soft)]`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(`span`,{children:e.source}),(0,H.jsx)(`span`,{className:h}),(0,H.jsxs)(`span`,{children:[`influence `,Et(e.influenceScore)]}),(0,H.jsx)(`span`,{className:h}),(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[e.needsReply?(0,H.jsx)(Yu,{className:`size-3`,strokeWidth:2.2}):(0,H.jsx)(Je,{className:`size-3.5`,strokeWidth:2}),e.needsReply?`open`:`replied`]})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsxs)(`button`,{className:Ce,onClick:i,type:`button`,children:[(0,H.jsx)(ad,{className:`size-4`,strokeWidth:2}),t?`Close reply`:`Reply`]}),(0,H.jsxs)(lu,{className:w(Ce,`gap-1.5`),to:e.entityKind===`dm`?`/dms`:`/mentions`,children:[(0,H.jsx)(Qu,{className:`size-4`,strokeWidth:2}),`Open`]})]})]}),t?(0,H.jsxs)(`div`,{className:ae,children:[(0,H.jsx)(`textarea`,{className:u,onChange:e=>r(e.target.value),placeholder:e.entityKind===`dm`?`Reply to @${e.participant.handle}`:`Reply to mention from @${e.participant.handle}`,rows:4,value:n}),(0,H.jsxs)(`div`,{className:f,children:[(0,H.jsx)(`span`,{className:Ae,children:`Send from inbox`}),(0,H.jsx)(`button`,{className:ge,disabled:!n.trim(),onClick:a,type:`button`,children:`Send`})]})]}):null]})]})}Af();var Qp=hu(`/inbox`)({component:_u(()=>kf(()=>import(`./inbox-BHlGuOy2.js`),__vite__mapDeps([26,1,2,3,4,11,6])),`component`),validateSearch:bf});function $p({message:e}){let t=e.direction===`outbound`;return(0,H.jsxs)(`div`,{className:w(b,t&&`self-end items-end`),children:[(0,H.jsx)(`div`,{className:w(me,t?S:g),children:e.text}),(0,H.jsxs)(`div`,{className:Fe,children:[(0,H.jsx)(`span`,{children:e.sender.displayName}),(0,H.jsx)(`span`,{children:`·`}),(0,H.jsx)(Pt,{value:e.createdAt})]})]})}function em({conversations:e,selectedConversation:t,selectedMessages:n,onSelectConversation:r,replyDraft:i,onReplyDraftChange:c,onReplySend:l}){let d=t?.participant??null,p=t?t.isMessageRequest?`Message request`:t.needsReply?`Reply open`:`We replied`:null;return(0,H.jsxs)(`section`,{"aria-label":`DM workspace`,className:ve,children:[(0,H.jsxs)(`aside`,{className:v,children:[e.length===0?(0,H.jsx)(Kd,{detail:`Sync DMs to populate this lane.`,label:`No conversations`}):null,e.map(e=>(0,H.jsxs)(`button`,{className:w(s,e.id===t?.id&&`bg-[var(--bg-active)]`),onClick:()=>r(e.id),type:`button`,children:[(0,H.jsx)(Dt,{avatarUrl:e.participant.avatarUrl,hue:e.participant.avatarHue,name:e.participant.displayName,profileId:e.participant.id}),(0,H.jsxs)(`div`,{className:m,children:[(0,H.jsxs)(`div`,{className:E,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,H.jsx)(`span`,{className:O,children:e.participant.displayName}),(0,H.jsxs)(`span`,{className:C,children:[`@`,e.participant.handle]})]}),(0,H.jsx)(Pt,{className:pe,value:e.lastMessageAt})]}),(0,H.jsx)(`p`,{className:_,children:e.lastMessagePreview}),(0,H.jsxs)(`div`,{className:`mt-1 flex items-center gap-1.5`,children:[(0,H.jsxs)(`span`,{className:w(x,e.needsReply?Ie:_e),"aria-label":e.needsReply?`Reply open`:`We replied`,children:[e.needsReply?(0,H.jsx)(Yu,{className:`size-3`,strokeWidth:2.2}):(0,H.jsx)(Je,{className:`size-3.5`,strokeWidth:2}),e.needsReply?`open`:`replied`]}),e.isMessageRequest?(0,H.jsx)(`span`,{className:w(x,Ie),children:`request`}):null,(0,H.jsxs)(`span`,{className:w(x,_e),children:[Et(e.participant.followersCount),` `,`followers`]})]})]})]},e.id))]}),(0,H.jsx)(`div`,{className:le,children:t?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`header`,{className:a,children:[(0,H.jsxs)(`div`,{className:Ne,children:[(0,H.jsx)(Dt,{avatarUrl:d?.avatarUrl,hue:d?.avatarHue??18,name:d?.displayName??`Unknown`,profileId:d?.id??void 0}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`div`,{className:Te,children:t.participant.displayName}),(0,H.jsx)(`div`,{className:Le,children:p&&t?(0,H.jsxs)(H.Fragment,{children:[p,` · last message`,` `,(0,H.jsx)(Pt,{value:t.lastMessageAt})]}):`No conversation selected`})]})]}),(0,H.jsx)(`button`,{className:ge,onClick:()=>l(t.id),type:`button`,children:`Reply`})]}),d?.bio||d?.followersCount?(0,H.jsxs)(`div`,{className:`border-b border-[var(--line)] px-4 py-3`,children:[d?.bio?(0,H.jsx)(`p`,{className:`text-[14px] leading-[1.4] text-[var(--ink)]`,children:d.bio}):null,(0,H.jsxs)(`dl`,{className:`mt-2 grid grid-cols-2 gap-1 text-[13px]`,children:[(0,H.jsxs)(`div`,{className:je,children:[(0,H.jsx)(`dt`,{className:o,children:`Followers`}),(0,H.jsx)(`dd`,{className:ke,children:Et(d?.followersCount??0)})]}),(0,H.jsxs)(`div`,{className:je,children:[(0,H.jsx)(`dt`,{className:o,children:`Influence`}),(0,H.jsxs)(`dd`,{className:ke,children:[t.influenceScore,` ·`,` `,t.influenceLabel]})]}),(0,H.jsxs)(`div`,{className:je,children:[(0,H.jsx)(`dt`,{className:o,children:`Reply state`}),(0,H.jsx)(`dd`,{className:ke,children:t.isMessageRequest?`Message request`:t.needsReply?`Reply open`:`We replied`})]}),(0,H.jsxs)(`div`,{className:je,children:[(0,H.jsx)(`dt`,{className:o,children:`Account`}),(0,H.jsx)(`dd`,{className:ke,children:t.accountHandle})]})]})]}):null,(0,H.jsx)(`div`,{className:he,children:n.map(e=>(0,H.jsx)($p,{message:e},e.id))}),(0,H.jsxs)(`div`,{className:se,children:[(0,H.jsx)(`textarea`,{className:u,onChange:e=>c(e.target.value),placeholder:`Reply to @${t.participant.handle}`,rows:3,value:i}),(0,H.jsxs)(`div`,{className:f,children:[(0,H.jsx)(`span`,{className:Ae,children:t.needsReply?`Reply open`:`We replied`}),(0,H.jsx)(`button`,{className:ge,disabled:!i.trim(),onClick:()=>l(t.id),type:`button`,children:`Send reply`})]})]})]}):(0,H.jsx)(Kd,{detail:`Pick a conversation to read the thread.`,label:`No DM selected`})})]})}function tm({kind:e,label:t,accounts:n,onSynced:r,showAccountPicker:i=!1,syncOptions:a}){let[o,s]=(0,V.useState)(!1),[c,l]=(0,V.useState)(null),[u,d]=(0,V.useState)(null),f=n??[],p=zd(n),m=(0,V.useMemo)(()=>Id(n),[n]),h=p??m,g=e!==`dms`,_=g&&n===void 0&&(i||e!==`timeline`),v=!g&&h!==void 0&&m!==void 0&&h!==m,y=o||_||v,b=v?`Switch to default to sync`:_?`Loading account`:u??c??``;function x(e){Rd(e)}async function S(){s(!0),d(null),l(null);try{let t=await gt(e,g?h:void 0,a);if(!t.ok)throw Error(t.summary);l(t.summary),r(t)}catch(e){d(e instanceof Error?e.message:`Sync failed`)}finally{s(!1)}}return(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[i&&g&&f.length>1?(0,H.jsx)(`select`,{"aria-label":`Sync account`,className:w(Ee,`h-9 w-[132px]`),disabled:o,onChange:e=>x(e.target.value),value:h??``,children:f.map(e=>(0,H.jsx)(`option`,{value:e.id,children:e.handle},e.id))}):null,(0,H.jsxs)(`button`,{type:`button`,className:w(`inline-flex h-9 shrink-0 items-center gap-1.5 rounded-full border border-[var(--line)] bg-[var(--bg)] px-3 text-[13px] font-semibold text-[var(--ink)] transition-[background,border-color,color,transform] duration-150 hover:border-[color:color-mix(in_srgb,var(--accent)_45%,var(--line))] hover:bg-[var(--accent-soft)] hover:text-[var(--accent)] active:scale-[0.98] disabled:opacity-65`,o&&`text-[var(--ink-soft)]`,v?`disabled:cursor-not-allowed`:`disabled:cursor-wait`),"aria-label":v?`${t}: default account only`:o?`${t}: syncing`:t,disabled:y,onClick:S,children:[(0,H.jsx)(ld,{className:w(`size-4`,o&&`animate-spin`),strokeWidth:2}),(0,H.jsx)(`span`,{className:`hidden sm:inline`,children:o?`Syncing...`:t})]}),(0,H.jsx)(`span`,{className:w(`hidden max-w-[190px] truncate text-[12px] sm:inline`,u?`text-[var(--alert)]`:`text-[var(--ink-soft)]`),role:`status`,children:b})]})}function nm(e,t){let[n,r]=(0,V.useState)(e);return(0,V.useEffect)(()=>{let n=window.setTimeout(()=>r(e),t);return()=>window.clearTimeout(n)},[t,e]),n}Af();var rm=hu(`/dms`)({component:_u(()=>kf(()=>import(`./dms-CGd6Eogq.js`),__vite__mapDeps([27,1,2,3,4,16,6])),`component`),validateSearch:yf});Af();var im=hu(`/discuss`)({component:_u(()=>kf(()=>import(`./discuss-DTjaOugw.js`),__vite__mapDeps([28,1,5,6,4,7,3,8,9,10,16,11])),`component`),validateSearch:Sf});Af();var am=hu(`/data-sources`)({component:_u(()=>kf(()=>import(`./data-sources-Cm2bpNvg.js`),__vite__mapDeps([29,1,2,3,4,6,5,14])),`component`)});Af();var om=hu(`/bookmarks`)({component:_u(()=>kf(()=>import(`./bookmarks-CbBkMvXk.js`),__vite__mapDeps([30,3,1,25,21,2,4,6,5,22,16,8,9,10])),`component`)});Af();var sm=hu(`/blocks`)({component:_u(()=>kf(()=>import(`./blocks-7UDKQp8H.js`),__vite__mapDeps([31,1,2,3,4,8])),`component`),validateSearch:Tf});Af();var cm=hu(`/`)({component:_u(()=>kf(()=>import(`./routes-q7ZaW4En.js`),__vite__mapDeps([32,3,1,20,21,2,4,6,5,22,16,8,9,10])),`component`)});function lm(e){return`${e.start}:${e.end}`}function um(e){try{return new URL(e).hostname.replace(/^www\./,``)===`t.co`}catch{return!1}}function dm({text:e,entities:t,className:n=`body-copy`,hiddenUrlRanges:r=[],urlLabel:i=`display`,as:a=`p`}){let o=jt(e,t),s=Ot(e,o),c=new Set(r.map(lm)),l=t.article;if(l){let e=o.urls??[],t=e.filter(e=>Mt(e,l)),n=e[0];t.length===0&&e.length===1&&n&&(um(n.url)||um(n.expandedUrl))&&t.push(n);for(let e of t)c.add(lm(e))}let u=new Set(c);for(let t of o.urls??[])c.has(lm(t))&&u.add(lm(kt(e,t)));let d=a,f=0,p=t.article&&e.trim()===t.article.title.trim();return(0,H.jsxs)(d,{className:n===`body-copy`?fe:n,children:[(p?[]:s).map((t,n)=>{if(t.start<f||t.end<=t.start||t.end>e.length)return null;let r=e.slice(f,t.start);f=t.end;let a=(0,H.jsx)(V.Fragment,{children:e.slice(t.start,t.end)},`segment-${String(n)}`);if(t.kind===`url`&&u.has(lm(t)))a=null;else if(t.kind===`mention`&&t.profile)a=(0,H.jsx)(Nt,{profile:t.profile,children:(0,H.jsxs)(`span`,{className:y,children:[`@`,t.username]})},`segment-${String(n)}`);else if(t.kind===`mention`)a=(0,H.jsxs)(`a`,{className:y,href:`/profiles/${encodeURIComponent(t.username)}`,children:[`@`,t.username]},`segment-${String(n)}`);else if(t.kind===`url`){let e=At(t.expandedUrl);e&&(a=(0,H.jsx)(`a`,{className:re,href:e,rel:`noreferrer`,target:`_blank`,children:i===`expanded`?t.expandedUrl:t.displayUrl},`segment-${String(n)}`))}else t.kind===`hashtag`&&(a=(0,H.jsxs)(`span`,{className:ne,children:[`#`,t.tag]},`segment-${String(n)}`));return(0,H.jsxs)(V.Fragment,{children:[r,a]},`piece-${String(n)}`)}),p?null:e.slice(f)]})}var fm={maxTweets:1e4,maxPages:100,maxConversations:80,maxConversationPages:3},pm=/(^|[^\w@./])@([A-Za-z0-9_]{1,15})\b/g,mm=Ft;function hm(e){return Array.from(e.matchAll(pm)).map(e=>e[2])}function gm(e){let t=new Set;t.add(mm(e.profile.handle));for(let n of e.profiles??[])t.add(mm(n.handle));for(let n of e.conversations)t.add(mm(n.author));return t}function _m({context:e,analysis:t,markdown:n}){let r=new Set,i=gm(e),a=e=>{if(!e)return;let t=mm(e);!/^[a-z0-9_]{1,15}$/.test(t)||i.has(t)||r.add(t)};for(let e of t?.sourceHandles??[])a(e);for(let e of t?.themes??[])for(let t of e.handles)a(t);if(n)for(let e of hm(n))a(e);for(let t of hm(e.profile.bio))a(t);for(let t of e.tweets)for(let e of hm(t.text))a(e);for(let t of e.conversations){for(let e of hm(t.text))a(e);for(let e of hm(t.bio))a(e)}return[...r]}function vm(e,t){let n=new Map;for(let t of e.profiles??[])n.set(mm(t.handle),t);for(let e of t)n.set(mm(e.handle),e);return{...e,profiles:[...n.values()]}}async function ym({queryClient:e,context:t,analysis:n,markdown:r}){let{profiles:i}=await It(e,_m({context:t,analysis:n,markdown:r}),{limit:50});return i}function bm(e,t){let n=new URLSearchParams;return n.set(`handle`,e),n.set(`maxTweets`,String(t.maxTweets)),n.set(`maxPages`,String(t.maxPages)),n.set(`maxConversations`,String(t.maxConversations)),n.set(`maxConversationPages`,String(t.maxConversationPages)),t.refresh&&n.set(`refresh`,`true`),`/api/profile-analysis?${n.toString()}`}function xm(e){return e?[e.fetchCached?`cached backfill`:`fresh xurl backfill`,`${String(e.counts.tweets)} tweets`,`${String(e.counts.conversationTweets)} conversation tweets`,`${String(e.counts.conversationsScanned)} conversations`].join(` · `):`xurl profile backfill with cached AI analysis.`}function Sm(e){return e.trim().replace(/^@/,``)}function Cm(){return Error(`Profile analysis connection closed before completion. Retry to continue.`)}function wm(e){return e instanceof Error?e.message:`Analysis failed`}function Tm(e){let t=ht(),[n,r]=(0,V.useState)(``),[i,a]=(0,V.useState)(null),[o,s]=(0,V.useState)(null),[c,l]=(0,V.useState)(`Ready`),u=(0,V.useCallback)(()=>{r(``),a(null),s(null),l(`Starting profile analysis`)},[]),{error:d,loading:f,run:p}=Ye({schema:Ze,request:(0,V.useCallback)((e,t,n)=>fetch(bm(t,{refresh:n,...fm}),{signal:e}),[]),onStart:u,onEvent:(0,V.useCallback)((e,n)=>{let i=(e,r)=>{ym({queryClient:t,context:e,analysis:r?.analysis,markdown:r?.markdown}).then(e=>{n.isActive()&&e.length!==0&&(a(t=>t&&vm(t,e)),s(t=>{if(!t)return t;let n=vm(t.context,e);return n===t.context?t:{...t,context:n}}))}).catch(()=>{})};if(e.type===`status`)l(e.detail?`${e.label} · ${e.detail}`:e.label);else if(e.type===`start`)a(e.context),l(e.cached?`Loading cached analysis`:`Summarizing profile`),i(e.context);else if(e.type===`delta`)r(t=>t+e.delta);else if(e.type===`done`)s(e.result),a(e.result.context),r(e.result.markdown),l(e.result.cached?`Cached`:`Complete`),i(e.result.context,e.result);else if(e.type===`error`)throw Error(e.error)},[t]),isTerminal:$e,errorLabel:`Profile analysis failed`,emptyBodyMessage:`Profile analysis failed: empty response body`,prematureEofError:Cm,formatError:wm});return{context:i,error:d,loading:f,markdown:n,result:o,run:(0,V.useCallback)((t=!1,n)=>{let r=Sm(n??e);r&&p(r,t)},[e,p]),status:c}}function Em({analysis:e,className:t=``}){return(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-[13px] font-medium text-[var(--ink-soft)] ${t}`,children:[e.loading?(0,H.jsx)(Qe,{className:`size-4 animate-spin`,strokeWidth:1.8}):e.result?(0,H.jsx)(Je,{className:`size-4`,strokeWidth:1.8}):(0,H.jsx)(et,{className:`size-4`,strokeWidth:1.8}),(0,H.jsx)(`span`,{children:e.status})]})}function Dm({analysis:e,emptyLabel:t=`No profile selected.`}){return(0,H.jsxs)(H.Fragment,{children:[e.error?(0,H.jsx)(`div`,{className:we,children:e.error}):null,e.markdown?(0,H.jsx)(`div`,{className:`max-w-3xl`,children:(0,H.jsx)(Xe,{context:e.context,markdown:e.markdown})}):(0,H.jsx)(`div`,{className:`rounded-[8px] border border-[var(--line)] bg-[var(--panel)] p-6 text-[14px] text-[var(--ink-soft)]`,children:t})]})}Af();var Om=hu(`/profiles/$handle`)({component:_u(()=>kf(()=>import(`./profiles._handle-C82_HoKX.js`),__vite__mapDeps([33,1,7,6,4,3,8,9,10])),`component`)}),km=jf.update({id:`/today`,path:`/today`,getParentRoute:()=>pf}),Am=Mf.update({id:`/rate-limits`,path:`/rate-limits`,getParentRoute:()=>pf}),jm=Nf.update({id:`/profile-analyze`,path:`/profile-analyze`,getParentRoute:()=>pf}),Mm=xp.update({id:`/network-map`,path:`/network-map`,getParentRoute:()=>pf}),Nm=Sp.update({id:`/mentions`,path:`/mentions`,getParentRoute:()=>pf}),Pm=Yp.update({id:`/links`,path:`/links`,getParentRoute:()=>pf}),Fm=Xp.update({id:`/likes`,path:`/likes`,getParentRoute:()=>pf}),Im=Qp.update({id:`/inbox`,path:`/inbox`,getParentRoute:()=>pf}),Lm=rm.update({id:`/dms`,path:`/dms`,getParentRoute:()=>pf}),Rm=im.update({id:`/discuss`,path:`/discuss`,getParentRoute:()=>pf}),zm=am.update({id:`/data-sources`,path:`/data-sources`,getParentRoute:()=>pf}),Bm=om.update({id:`/bookmarks`,path:`/bookmarks`,getParentRoute:()=>pf}),Vm=sm.update({id:`/blocks`,path:`/blocks`,getParentRoute:()=>pf}),Hm={IndexRoute:cm.update({id:`/`,path:`/`,getParentRoute:()=>pf}),BlocksRoute:Vm,BookmarksRoute:Bm,DataSourcesRoute:zm,DiscussRoute:Rm,DmsRoute:Lm,InboxRoute:Im,LikesRoute:Fm,LinksRoute:Pm,MentionsRoute:Nm,NetworkMapRoute:Mm,ProfileAnalyzeRoute:jm,RateLimitsRoute:Am,TodayRoute:km,ProfilesHandleRoute:Om.update({id:`/profiles/$handle`,path:`/profiles/$handle`,getParentRoute:()=>pf})},Um=pf._addFileChildren(Hm);function Wm(){return Nu({routeTree:Um,scrollRestoration:!0,defaultPreload:`intent`,defaultPreloadStaleTime:6e4})}async function Gm(){let e=await Wm(),t=[];return window.__TSS_START_OPTIONS__={serializationAdapters:t},t.push(rl),e.options.serializationAdapters&&t.push(...e.options.serializationAdapters),e.update({basepath:``,serializationAdapters:t}),e.stores.matchesId.get().length||await ol(e),e}var Km=Gm;async function qm(){let e=await Km();return window.$_TSR?.h(),e}var Jm;function Ym(){return Jm||=qm(),(0,H.jsx)(pl,{promise:Jm,children:e=>(0,H.jsx)(Iu,{router:e})})}var Xm=Bt();(0,V.startTransition)(()=>{(0,Xm.hydrateRoot)(document,(0,H.jsx)(V.StrictMode,{children:(0,H.jsx)(Ym,{})}))});export{yf as $,Ep as A,hp as B,Rp as C,Hp as D,jp as E,ap as F,_p as G,cp as H,up as I,jf as J,lp as K,dp as L,wp as M,xp as N,Op as O,bp as P,Sf as Q,pp as R,Bp as S,Wp as T,gp as U,sp as V,mp as W,Af as X,kf as Y,Tf as Z,Jp as _,Zu as _t,Sm as a,Gd as at,Np as b,Ju as bt,sm as c,Nd as ct,nm as d,fd as dt,bf as et,tm as f,ld as ft,Yp as g,Qu as gt,Zp as h,$u as ht,Tm as i,Kd as it,Tp as j,Dp as k,im as l,Md as lt,Qp as m,ed as mt,Dm as n,wf as nt,xm as o,zd as ot,em as p,ad as pt,Nf as q,Em as r,Cf as rt,dm as s,$ as st,Om as t,xf as tt,rm as u,pd as ut,Up as v,Xu as vt,Lp as w,Mp as x,zp as y,Yu as yt,fp as z};
31
+ `;function ef({children:e}){let[t,n]=(0,V.useState)(`system`),[r,i]=(0,V.useState)(`light`),[a,o]=(0,V.useState)(!1);(0,V.useEffect)(()=>{let e=Qd();n(e),i(Xd(e)),Zd(e),o(!0)},[]),(0,V.useEffect)(()=>{if(!a||(Zd(t),i(Xd(t)),window.localStorage.setItem(qd,t),t!==`system`||typeof window.matchMedia!=`function`))return;let e=window.matchMedia(`(prefers-color-scheme: dark)`),n=()=>{let t=e.matches?`dark`:`light`;i(t),document.documentElement.dataset.theme=t,document.documentElement.style.colorScheme=t};return typeof e.addEventListener==`function`?e.addEventListener(`change`,n):e.addListener?.(n),()=>{typeof e.removeEventListener==`function`?e.removeEventListener(`change`,n):e.removeListener?.(n)}},[a,t]);let s=(0,V.useMemo)(()=>({isReady:a,theme:t,resolvedTheme:r,setTheme:n}),[a,r,t]);return(0,H.jsx)(Jd.Provider,{value:s,children:e})}function tf(){let e=(0,V.useContext)(Jd);if(!e)throw Error(`useTheme must be used within ThemeProvider`);return e}var nf=e=>Number.isNaN(e)?.5:e<=0?0:e>=1?1:e,rf=()=>typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches??!1,af=e=>{e.classList.remove(`theme-transition`),e.style.removeProperty(`--theme-switch-x`),e.style.removeProperty(`--theme-switch-y`)};function of({nextTheme:e,currentTheme:t,setTheme:n,context:r}){if(t===e)return;if(typeof document>`u`){n(e);return}let i=document.documentElement,a=typeof document.startViewTransition==`function`?document.startViewTransition.bind(document):void 0,o=!!a&&!rf(),s=()=>{(0,Zl.flushSync)(()=>{n(e)})};if(!o){s(),af(i);return}let c=.5,l=.5;if(r?.pointerClientX!==void 0&&r.pointerClientY!==void 0&&typeof window<`u`)c=nf(r.pointerClientX/window.innerWidth),l=nf(r.pointerClientY/window.innerHeight);else if(r?.element&&typeof window<`u`){let e=r.element.getBoundingClientRect();e.width>0&&e.height>0&&(c=nf((e.left+e.width/2)/window.innerWidth),l=nf((e.top+e.height/2)/window.innerHeight))}i.style.setProperty(`--theme-switch-x`,`${c*100}%`),i.style.setProperty(`--theme-switch-y`,`${l*100}%`),i.classList.add(`theme-transition`);try{let e=a?.(()=>{s()});if(!e?.finished){af(i);return}e.finished.catch(()=>void 0).finally(()=>af(i))}catch{af(i),s()}}var sf=[{key:`system`,icon:sd,label:`System default`},{key:`light`,icon:dd,label:`Light theme`},{key:`dark`,icon:cd,label:`Dark theme`}];function cf(e){return sf.findIndex(t=>t.key===e)}function lf({compact:e=!1}){let{isReady:t,theme:n,setTheme:r}=tf(),i=Math.max(cf(n),0),a=sf[i],o=sf[(i+1)%sf.length],s=a.icon;return(0,H.jsx)(`div`,{className:w(`theme-toggle-shell flex justify-center`,e?`shrink-0`:`px-1 py-1 min-[1100px]:justify-start min-[1100px]:px-2`),title:`${a.label}; click for ${o.label}`,children:(0,H.jsx)(`button`,{type:`button`,className:w(`theme-toggle-button inline-flex items-center justify-center rounded-full border bg-transparent text-[var(--ink-soft)] transition-[background,border-color,color,transform,box-shadow] duration-150 hover:border-[color:color-mix(in_srgb,var(--accent)_38%,var(--line))] hover:bg-[var(--bg-hover)] hover:text-[var(--ink)] active:scale-95 disabled:cursor-default disabled:opacity-55 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[color:color-mix(in_srgb,var(--accent)_54%,transparent)]`,e?`size-8 border-transparent`:`size-11 border-[var(--line)] shadow-[inset_0_0_0_1px_color-mix(in_srgb,var(--line)_44%,transparent)]`),onClick:e=>{let t={element:e.currentTarget,pointerClientX:e.clientX,pointerClientY:e.clientY};of({nextTheme:o.key,currentTheme:n,setTheme:r,context:t})},"aria-label":`Theme: ${a.label}. Switch to ${o.label}.`,"data-testid":`theme-toggle`,disabled:!t,children:(0,H.jsx)(s,{className:w(`theme-toggle-icon`,e?`size-[17px]`:`size-[19px]`),strokeWidth:2,"aria-hidden":`true`})})})}var uf=[{to:`/inbox`,label:`Inbox`,icon:nd},{to:`/today`,label:`Today`,icon:Ku},{to:`/discuss`,label:`Discuss`,icon:od},{to:`/profile-analyze`,label:`Analyse`,icon:fd},{to:`/network-map`,label:`Map`,icon:Zu},{to:`/data-sources`,label:`Sources`,icon:Xu},{to:`/`,label:`Home`,icon:td},{to:`/mentions`,label:`Mentions`,icon:Gu},{to:`/likes`,label:`Likes`,icon:ed},{to:`/bookmarks`,label:`Bookmarks`,icon:Z},{to:`/links`,label:`Links`,icon:rd},{to:`/rate-limits`,label:`Rate Limits`,icon:$u},{to:`/dms`,label:`DMs`,icon:id},{to:`/blocks`,label:`Blocks`,icon:ud}];function df({compact:e=!1}){let t=Lu({select:e=>e.location.pathname});return(0,H.jsxs)(`aside`,{className:e?ue:He,children:[(0,H.jsxs)(`div`,{className:`flex flex-col`,children:[(0,H.jsxs)(lu,{to:`/`,className:Pe,children:[(0,H.jsx)(`span`,{className:De,children:(0,H.jsx)(Wd,{className:`size-10`})}),(0,H.jsxs)(`span`,{className:e?Oe:Me,children:[(0,H.jsx)(`span`,{className:ze,children:`birdclaw`}),(0,H.jsx)(`span`,{className:ye,children:`Fast search for your archive.`})]})]}),(0,H.jsx)(`nav`,{className:xe,"aria-label":`Primary`,children:uf.map(n=>{let r=t===n.to,i=n.icon;return(0,H.jsxs)(lu,{to:n.to,"aria-label":n.label,className:w(e?D:te,r&&`nav-link-active font-bold`),children:[(0,H.jsx)(i,{className:Ke,size:22,strokeWidth:r?2.4:1.8,"aria-hidden":`true`}),(0,H.jsx)(`span`,{className:e?k:c,children:n.label})]},n.to)})})]}),(0,H.jsx)(`div`,{className:We,children:(0,H.jsx)(Ud,{action:(0,H.jsx)(lf,{compact:!0})})})]})}var ff=`/assets/styles-B8s3tt3r.css`,pf=mu({head:()=>({meta:[{charSet:`utf-8`},{name:`viewport`,content:`width=device-width, initial-scale=1`},{title:`birdclaw`}],links:[{rel:`stylesheet`,href:ff}]}),notFoundComponent:mf,shellComponent:hf});function mf(){return(0,H.jsx)(`main`,{className:ie,children:(0,H.jsx)(`div`,{className:`px-4 py-10 text-[var(--ink-soft)]`,children:`Not Found`})})}function hf({children:e}){let t=Lu({select:e=>e.location.pathname}),n=t.startsWith(`/dms`)||t.startsWith(`/network-map`);return(0,H.jsxs)(`html`,{lang:`en`,suppressHydrationWarning:!0,children:[(0,H.jsxs)(`head`,{children:[(0,H.jsx)(Hu,{}),(0,H.jsx)(`script`,{suppressHydrationWarning:!0,children:$d})]}),(0,H.jsxs)(`body`,{className:Ve,children:[(0,H.jsx)(Ct,{children:(0,H.jsx)(ef,{children:(0,H.jsxs)(`div`,{className:l,children:[(0,H.jsx)(df,{compact:n}),(0,H.jsx)(`main`,{className:n?ce:ie,children:e})]})})}),(0,H.jsx)(Uu,{})]})]})}function gf(e,t=``){return typeof e==`string`?e:t}function _f(e,t,n){return typeof e==`string`&&t.includes(e)?e:n}function vf(e,t=!1){return e===!0||e===`true`||e===`1`?!0:e===!1||e===`false`||e===`0`?!1:t}function yf(e){return{inbox:_f(e.inbox,[`all`,`accepted`,`requests`],`all`),reply:_f(e.reply,[`all`,`unreplied`,`replied`],`unreplied`),minFollowers:gf(e.minFollowers),minInfluence:gf(e.minInfluence),sort:_f(e.sort,[`recent`,`followers`],`recent`),q:gf(e.q),conversation:gf(e.conversation)}}function bf(e){return{kind:_f(e.kind,[`mixed`,`mentions`,`dms`],`mixed`),minScore:gf(e.minScore,`40`),hideLowSignal:vf(e.hideLowSignal,!0)}}function xf(e){return{kind:_f(e.kind,[`links`,`videos`],`links`),range:_f(e.range,[`today`,`week`,`month`,`year`,`all`],`week`),source:_f(e.source,[`all`,`tweet`,`dm`],`all`),sort:_f(e.sort,[`rank`,`recent`,`comments`],`rank`),q:gf(e.q)}}function Sf(e){return{q:gf(e.q),question:gf(e.question),source:_f(e.source,[`search`,`all`,`home`,`mentions`,`authored`,`likes`,`bookmarks`],`search`),mode:_f(e.mode,[`auto`,`bird`,`xurl`,`local`],`xurl`),includeDms:vf(e.includeDms)}}function Cf(e){return{period:_f(e.period,[`today`,`24h`,`yesterday`,`week`],`today`),includeDms:vf(e.includeDms)}}function wf(e){return{type:_f(e.type,[`all`,`followers`,`following`,`mutual`],`all`),q:gf(e.q)}}function Tf(e){return{account:gf(e.account,`acct_primary`),q:gf(e.q)}}var Ef,Df,Of,kf,Af=e((()=>{Ef=`modulepreload`,Df=function(e){return`/`+e},Of={},kf=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=Df(t,n),t in Of)return;Of[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:Ef,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})}}));Af();var jf=hu(`/today`)({component:_u(()=>kf(()=>import(`./today-BoO64YoY.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12])),`component`),validateSearch:Cf});Af();var Mf=hu(`/rate-limits`)({component:_u(()=>kf(()=>import(`./rate-limits-BWPmPOSh.js`),__vite__mapDeps([13,1,2,3,4,6,14])),`component`)});Af();var Nf=hu(`/profile-analyze`)({component:_u(()=>kf(()=>import(`./profile-analyze-C_yDeX6-.js`),__vite__mapDeps([15,1,7,6,4,3,8,9,10,16])),`component`),validateSearch:e=>({handle:typeof e.handle==`string`?e.handle:``})}),Pf=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],Ff=1,If=8,Lf=new Uint32Array(96),Rf=class e{static from(t){if(!t||t.byteLength===void 0||t.buffer)throw Error(`Data must be an instance of ArrayBuffer or SharedArrayBuffer.`);let[n,r]=new Uint8Array(t,0,2);if(n!==219)throw Error(`Data does not appear to be in a KDBush format.`);let i=r>>4;if(i!==Ff)throw Error(`Got v${i} data when expected v${Ff}.`);let a=Pf[r&15];if(!a)throw Error(`Unrecognized array type.`);let[o]=new Uint16Array(t,2,1),[s]=new Uint32Array(t,4,1);return new e(s,o,a,void 0,t)}constructor(e,t=64,n=Float64Array,r=ArrayBuffer,i){if(isNaN(e)||e<0)throw Error(`Unexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=n,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let a=Pf.indexOf(this.ArrayType),o=e*2*this.ArrayType.BYTES_PER_ELEMENT,s=e*this.IndexArrayType.BYTES_PER_ELEMENT,c=(8-s%8)%8;if(a<0)throw Error(`Unexpected typed array class: ${n}.`);if(i)this.data=i,this.ids=new this.IndexArrayType(i,If,e),this.coords=new n(i,If+s+c,e*2),this._pos=e*2,this._finished=!0;else{let i=this.data=new r(If+o+s+c);this.ids=new this.IndexArrayType(i,If,e),this.coords=new n(i,If+s+c,e*2),this._pos=0,this._finished=!1,new Uint8Array(i,0,2).set([219,(Ff<<4)+a]),new Uint16Array(i,2,1)[0]=t,new Uint32Array(i,4,1)[0]=e}}add(e,t){let n=this._pos>>1;return this.ids[n]=n,this.coords[this._pos++]=e,this.coords[this._pos++]=t,n}finish(){let e=this._pos>>1;if(e!==this.numItems)throw Error(`Added ${e} items when expected ${this.numItems}.`);return zf(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,n,r){if(!this._finished)throw Error(`Data not yet indexed - call index.finish().`);let{ids:i,coords:a,nodeSize:o}=this;Lf[0]=0,Lf[1]=i.length-1,Lf[2]=0;let s=3,c=[];for(;s>0;){let l=Lf[--s],u=Lf[--s],d=Lf[--s];if(u-d<=o){for(let o=d;o<=u;o++){let s=a[2*o],l=a[2*o+1];s>=e&&s<=n&&l>=t&&l<=r&&c.push(i[o])}continue}let f=d+u>>1,p=a[2*f],m=a[2*f+1];p>=e&&p<=n&&m>=t&&m<=r&&c.push(i[f]),(l===0?e<=p:t<=m)&&(Lf[s++]=d,Lf[s++]=f-1,Lf[s++]=1-l),(l===0?n>=p:r>=m)&&(Lf[s++]=f+1,Lf[s++]=u,Lf[s++]=1-l)}return c}within(e,t,n){let r=[];return this.withinInto(e,t,n,r),r}withinInto(e,t,n,r){if(!this._finished)throw Error(`Data not yet indexed - call index.finish().`);let{ids:i,coords:a,nodeSize:o}=this;Lf[0]=0,Lf[1]=i.length-1,Lf[2]=0;let s=3,c=0,l=n*n;for(;s>0;){let u=Lf[--s],d=Lf[--s],f=Lf[--s];if(d-f<=o){for(let n=f;n<=d;n++)Uf(a[2*n],a[2*n+1],e,t)<=l&&(r[c++]=i[n]);continue}let p=f+d>>1,m=a[2*p],h=a[2*p+1];Uf(m,h,e,t)<=l&&(r[c++]=i[p]),(u===0?e-n<=m:t-n<=h)&&(Lf[s++]=f,Lf[s++]=p-1,Lf[s++]=1-u),(u===0?e+n>=m:t+n>=h)&&(Lf[s++]=p+1,Lf[s++]=d,Lf[s++]=1-u)}return c}};function zf(e,t,n,r,i,a){if(i-r<=n)return;let o=r+i>>1;Bf(e,t,o,r,i,a),zf(e,t,n,r,o-1,1-a),zf(e,t,n,o+1,i,1-a)}function Bf(e,t,n,r,i,a){for(;i>r;){if(i-r>600){let o=i-r+1,s=n-r+1,c=Math.log(o),l=.5*Math.exp(2*c/3),u=.5*Math.sqrt(c*l*(o-l)/o)*(s-o/2<0?-1:1);Bf(e,t,n,Math.max(r,Math.floor(n-s*l/o+u)),Math.min(i,Math.floor(n+(o-s)*l/o+u)),a)}let o=t[2*n+a],s=r,c=i;for(Vf(e,t,r,n),t[2*i+a]>o&&Vf(e,t,r,i);s<c;){for(Vf(e,t,s,c),s++,c--;t[2*s+a]<o;)s++;for(;t[2*c+a]>o;)c--}t[2*r+a]===o?Vf(e,t,r,c):(c++,Vf(e,t,c,i)),c<=n&&(r=c+1),n<=c&&(i=c-1)}}function Vf(e,t,n,r){Hf(e,n,r),Hf(t,2*n,2*r),Hf(t,2*n+1,2*r+1)}function Hf(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function Uf(e,t,n,r){let i=e-n,a=t-r;return i*i+a*a}var Wf={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e},Gf=Math.fround||(e=>(t=>(e[0]=+t,e[0])))(new Float32Array(1)),Kf=2,qf=3,Jf=4,Yf=5,Xf=6,Zf=class{constructor(e){this.options=Object.assign(Object.create(Wf),e),this.trees=Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){let{log:t,minZoom:n,maxZoom:r}=this.options;t&&console.time(`total time`);let i=`prepare ${e.length} points`;t&&console.time(i),this.points=e;let a=[];for(let t=0;t<e.length;t++){let n=e[t];if(!n.geometry)continue;let[r,i]=n.geometry.coordinates,o=Gf(ep(r)),s=Gf(tp(i));a.push(o,s,1/0,t,-1,1),this.options.reduce&&a.push(0)}let o=this.trees[r+1]=this._createTree(a);t&&console.timeEnd(i);for(let e=r;e>=n;e--){let n=+Date.now();o=this.trees[e]=this._createTree(this._cluster(o,e)),t&&console.log(`z%d: %d clusters in %dms`,e,o.numItems,+Date.now()-n)}return t&&console.timeEnd(`total time`),this}getClusters(e,t){let n=((e[0]+180)%360+360)%360-180,r=Math.max(-90,Math.min(90,e[1])),i=e[2]===180?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)n=-180,i=180;else if(n>i){let e=this.getClusters([n,r,180,a],t),o=this.getClusters([-180,r,i,a],t);return e.concat(o)}let o=this.trees[this._limitZoom(t)],s=o.range(ep(n),tp(a),ep(i),tp(r)),c=o.data,l=[];for(let e of s){let t=this.stride*e;l.push(c[t+Yf]>1?Qf(c,t,this.clusterProps):this.points[c[t+qf]])}return l}getChildren(e){let t=this._getOriginId(e),n=this._getOriginZoom(e),r=`No cluster with the specified id.`,i=this.trees[n];if(!i)throw Error(r);let a=i.data;if(t*this.stride>=a.length)throw Error(r);let o=this.options.radius/(this.options.extent*2**(n-1)),s=a[t*this.stride],c=a[t*this.stride+1],l=i.within(s,c,o),u=[];for(let t of l){let n=t*this.stride;a[n+Jf]===e&&u.push(a[n+Yf]>1?Qf(a,n,this.clusterProps):this.points[a[n+qf]])}if(u.length===0)throw Error(r);return u}getLeaves(e,t,n){t||=10,n||=0;let r=[];return this._appendLeaves(r,e,t,n,0),r}getTile(e,t,n){let r=this.trees[this._limitZoom(e)],i=2**e,{extent:a,radius:o}=this.options,s=o/a,c=(n-s)/i,l=(n+1+s)/i,u={features:[]};return this._addTileFeatures(r.range((t-s)/i,c,(t+1+s)/i,l),r.data,t,n,i,u),t===0&&this._addTileFeatures(r.range(1-s/i,c,1,l),r.data,i,n,i,u),t===i-1&&this._addTileFeatures(r.range(0,c,s/i,l),r.data,-1,n,i,u),u.features.length?u:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){let n=this.getChildren(e);if(t++,n.length!==1)break;e=n[0].properties.cluster_id}return t}_appendLeaves(e,t,n,r,i){let a=this.getChildren(t);for(let t of a){let a=t.properties;if(a&&a.cluster?i+a.point_count<=r?i+=a.point_count:i=this._appendLeaves(e,a.cluster_id,n,r,i):i<r?i++:e.push(t),e.length===n)break}return i}_createTree(e){let t=new Rf(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let n=0;n<e.length;n+=this.stride)t.add(e[n],e[n+1]);return t.finish(),t.data=e,t}_addTileFeatures(e,t,n,r,i,a){for(let o of e){let e=o*this.stride,s=t[e+Yf]>1,c,l,u;if(s)c=$f(t,e,this.clusterProps),l=t[e],u=t[e+1];else{let n=this.points[t[e+qf]];c=n.properties;let[r,i]=n.geometry.coordinates;l=ep(r),u=tp(i)}let d={type:1,geometry:[[Math.round(this.options.extent*(l*i-n)),Math.round(this.options.extent*(u*i-r))]],tags:c},f;f=s||this.options.generateId?t[e+qf]:this.points[t[e+qf]].id,f!==void 0&&(d.id=f),a.features.push(d)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){let{radius:n,extent:r,reduce:i,minPoints:a}=this.options,o=n/(r*2**t),s=e.data,c=[],l=this.stride;for(let n=0;n<s.length;n+=l){if(s[n+Kf]<=t)continue;s[n+Kf]=t;let r=s[n],u=s[n+1],d=e.within(s[n],s[n+1],o),f=s[n+Yf],p=f;for(let e of d){let n=e*l;s[n+Kf]>t&&(p+=s[n+Yf])}if(p>f&&p>=a){let e=r*f,a=u*f,o,m=-1,h=((n/l|0)<<5)+(t+1)+this.points.length;for(let r of d){let c=r*l;if(s[c+Kf]<=t)continue;s[c+Kf]=t;let u=s[c+Yf];e+=s[c]*u,a+=s[c+1]*u,s[c+Jf]=h,i&&(o||(o=this._map(s,n,!0),m=this.clusterProps.length,this.clusterProps.push(o)),i(o,this._map(s,c)))}s[n+Jf]=h,c.push(e/p,a/p,1/0,h,-1,p),i&&c.push(m)}else{for(let e=0;e<l;e++)c.push(s[n+e]);if(p>1)for(let e of d){let n=e*l;if(!(s[n+Kf]<=t)){s[n+Kf]=t;for(let e=0;e<l;e++)c.push(s[n+e])}}}}return c}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,n){if(e[t+Yf]>1){let r=this.clusterProps[e[t+Xf]];return n?Object.assign({},r):r}let r=this.points[e[t+qf]].properties,i=this.options.map(r);return n&&i===r?Object.assign({},i):i}};function Qf(e,t,n){return{type:`Feature`,id:e[t+qf],properties:$f(e,t,n),geometry:{type:`Point`,coordinates:[np(e[t]),rp(e[t+1])]}}}function $f(e,t,n){let r=e[t+Yf],i=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?`${Math.round(r/100)/10}k`:r,a=e[t+Xf],o=a===-1?{}:Object.assign({},n[a]);return Object.assign(o,{cluster:!0,cluster_id:e[t+qf],point_count:r,point_count_abbreviated:i})}function ep(e){return e/360+.5}function tp(e){let t=Math.sin(e*Math.PI/180),n=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return n<0?0:n>1?1:n}function np(e){return(e-.5)*360}function rp(e){let t=(180-e*360)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}var ip=[{value:`all`,label:`All`},{value:`followers`,label:`Followers`},{value:`following`,label:`Following`},{value:`mutual`,label:`Mutual`}],ap={bounds:[-180,-85,180,85],zoom:1.15};async function op(e,t,n,r){let i=new URL(`/api/network-map`,window.location.origin);return i.searchParams.set(`type`,e),i.searchParams.set(`limit`,`50000`),i.searchParams.set(`geocodeLimit`,t?`80`:`12`),n&&i.searchParams.set(`account`,n),t&&i.searchParams.set(`refresh`,`true`),St(i,{signal:r},_t,`Map request failed`)}function sp(e){return new Intl.NumberFormat().format(e)}function cp(e){return e===`mutual`?`mutual`:e===`following`?`following`:`follower`}function lp(e){return e===`mutual`?`#22c55e`:e===`following`?`#f59e0b`:`#1d9bf0`}function up(e){return(e.properties.name||e.properties.handle||`?`).slice(0,1).toUpperCase()}function dp(e){return e.properties.avatarUrl?`/api/avatar?${new URLSearchParams({profileId:e.properties.profileId,v:e.properties.avatarUrl}).toString()}`:null}function fp(e){let t=Math.max(1,e.followers+e.following+e.mutual),n=e.mutual/t*100,r=n+e.following/t*100;return`conic-gradient(#22c55e 0 ${n}%, #f59e0b ${n}% ${r}%, #1d9bf0 ${r}% 100%)`}function pp(e){let t=e.map((e,t)=>({type:`Feature`,geometry:e.geometry,properties:{featureIndex:t,handle:e.properties.handle,name:e.properties.name,avatarUrl:e.properties.avatarUrl,relationship:e.properties.relationship,followersCount:e.properties.followersCount}}));return new Zf({maxZoom:18,minPoints:2,radius:64,map:e=>({followers:+(e.relationship===`followers`),following:+(e.relationship===`following`),mutual:+(e.relationship===`mutual`)}),reduce:(e,t)=>{e.followers+=t.followers,e.following+=t.following,e.mutual+=t.mutual}}).load(t)}function mp(e){return`cluster`in e.properties&&e.properties.cluster===!0}function hp(e,t){return t.properties.followersCount-e.properties.followersCount||e.properties.handle.localeCompare(t.properties.handle)}function gp(e,t){let n=new Map;for(let t of e){let[e,r]=t.geometry.coordinates,i=`${e.toFixed(4)},${r.toFixed(4)}`,a=n.get(i);a?(a.count+=1,a.followers+=t.properties.followersCount):n.set(i,{coordinates:[e,r],count:1,followers:t.properties.followersCount})}return[...n.values()].sort((e,t)=>t.count-e.count||t.followers-e.followers)[0]?.coordinates??t}function _p(e){if(!e||typeof e!=`object`)return null;let t=e;if(typeof t.getBounds!=`function`||typeof t.getZoom!=`function`)return null;let n=t.getBounds();return{bounds:[n.getWest(),n.getSouth(),n.getEast(),n.getNorth()],zoom:t.getZoom()}}function vp(e,t){let[n,r,i,a]=e,[o,s]=t.geometry.coordinates,c=(n+540)%360-180,l=(i+540)%360-180,u=s>=Math.max(-85,r)&&s<=Math.min(85,a),d=i-n>=360?!0:c<=l?o>=c&&o<=l:o>=c||o<=l;return u&&d}function yp(e,t){let n=t.trim().toLowerCase();return n?[e.properties.name,e.properties.handle,e.properties.location,e.properties.resolvedLocation??``,cp(e.properties.relationship)].join(` `).toLowerCase().includes(n):!0}function bp(e,t){let n=ht(),{type:r,q:i}=e,[a,o]=(0,V.useState)(ap),s=zd(Nd({queryKey:bt.status,queryFn:({signal:e})=>mt({signal:e})}).data?.accounts),c=[...bt.networkMap,{type:r,selectedAccountId:s??null}],l=Nd({queryKey:c,queryFn:({signal:e})=>op(r,!1,s,e),staleTime:5*6e4}),u=$({mutationFn:()=>op(r,!0,s),onSuccess:e=>{n.setQueryData(c,e)}}),d=l.data??null,f=l.isPending||u.isPending,p=u.error??l.error,m=(0,V.useMemo)(()=>(d?.features??[]).slice().filter(e=>vp(a.bounds,e)).sort((e,t)=>t.properties.followersCount-e.properties.followersCount||e.properties.handle.localeCompare(t.properties.handle)),[d,a]),h=(0,V.useMemo)(()=>m.filter(e=>yp(e,i)).slice(0,160),[m,i]);return{type:r,setType:n=>t({...e,type:n}),viewport:a,setViewport:o,visibleSearch:i,setVisibleSearch:n=>t({...e,q:n},{replace:!0}),data:d,loading:f,error:p?p instanceof Error?p.message:`Map unavailable`:null,refresh:u.mutate,visibleFeatures:m,filteredVisibleFeatures:h,mapTypes:ip}}Af();var xp=hu(`/network-map`)({component:_u(()=>kf(()=>import(`./network-map-zRysIY_b.js`),__vite__mapDeps([17,1,6,4,16,18,3])),`component`),validateSearch:wf});Af();var Sp=hu(`/mentions`)({component:_u(()=>kf(()=>import(`./mentions-BoVVAIT7.js`),__vite__mapDeps([19,3,1,20,21,2,4,6,5,22,16,8,9,10])),`component`)});function Cp({className:e,muted:t=!1}){return(0,H.jsx)(`span`,{"aria-hidden":`true`,className:`block animate-pulse rounded-full ${t?`bg-[color:color-mix(in_srgb,var(--ink-soft)_16%,transparent)]`:`bg-[color:color-mix(in_srgb,var(--ink-soft)_24%,transparent)]`} ${e}`})}function wp({count:e=4}){return(0,H.jsx)(`div`,{"aria-hidden":`true`,className:`divide-y divide-[var(--line)]`,children:Array.from({length:e},(e,t)=>{let n=t%3==0,r=t%4==2;return(0,H.jsxs)(`article`,{className:`flex gap-3 px-4 py-3`,"data-perf":`tweet-skeleton-row`,children:[(0,H.jsx)(Cp,{className:`size-10 shrink-0 rounded-full`}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-3`,children:[(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsx)(Cp,{className:`h-3.5 w-32`}),(0,H.jsx)(Cp,{className:`h-3 w-20`,muted:!0}),(0,H.jsx)(Cp,{className:`ml-auto h-5 w-16`,muted:!0})]}),(0,H.jsxs)(`div`,{className:`space-y-2`,children:[(0,H.jsx)(Cp,{className:`h-3 w-full`}),(0,H.jsx)(Cp,{className:`h-3 w-11/12`,muted:!0}),t%2==0?(0,H.jsx)(Cp,{className:`h-3 w-7/12`,muted:!0}):null]}),n?(0,H.jsx)(Cp,{className:`h-32 w-full rounded-2xl`,muted:!0}):null,r?(0,H.jsxs)(`div`,{className:`space-y-2 rounded-2xl border border-[var(--line)] px-3 py-2`,children:[(0,H.jsx)(Cp,{className:`h-3 w-28`,muted:!0}),(0,H.jsx)(Cp,{className:`h-3 w-full`,muted:!0})]}):null,(0,H.jsx)(`div`,{className:`flex max-w-md items-center justify-between`,children:[`thread`,`reply`,`repost`,`like`].map(e=>(0,H.jsx)(Cp,{className:`h-3 w-11`,muted:!0},e))})]})]},`tweet-skeleton-${t}`)})})}function Tp({count:e=4}){return(0,H.jsx)(`div`,{"aria-hidden":`true`,className:`divide-y divide-[var(--line)]`,children:Array.from({length:e},(e,t)=>(0,H.jsxs)(`article`,{className:`flex gap-3 px-4 py-3`,"data-perf":`link-skeleton-row`,children:[(0,H.jsx)(Cp,{className:`size-9 shrink-0 rounded-full`,muted:!0}),(0,H.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-3`,children:[(0,H.jsx)(Cp,{className:`h-3.5 w-8/12`}),(0,H.jsx)(Cp,{className:`h-3 w-6/12`,muted:!0}),(0,H.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,H.jsx)(Cp,{className:`h-3 w-20`,muted:!0}),(0,H.jsx)(Cp,{className:`h-3 w-14`,muted:!0}),(0,H.jsx)(Cp,{className:`h-3 w-24`,muted:!0})]}),t%2==0?(0,H.jsx)(Cp,{className:`h-20 w-72 max-w-full rounded-2xl`,muted:!0}):null]})]},`link-skeleton-${t}`))})}function Ep({children:e,detail:t,label:n}){return(0,H.jsxs)(`div`,{className:`border-b border-[var(--line)]`,children:[(0,H.jsx)(Gd,{detail:t,label:n}),e]})}function Dp({action:e,message:t,title:n=`Could not load this view`}){return(0,H.jsx)(`div`,{className:`border-b border-[var(--line)] px-6 py-10 text-center`,children:(0,H.jsxs)(`div`,{className:`mx-auto max-w-sm`,children:[(0,H.jsx)(`div`,{className:`text-[14px] font-bold text-[var(--alert)]`,children:n}),(0,H.jsx)(`p`,{className:`mt-2 text-[13px] leading-[1.45] text-[var(--ink-soft)]`,children:t}),e?(0,H.jsx)(`div`,{className:`mt-4 flex justify-center`,children:e}):null]})})}function Op({detail:e,label:t}){return(0,H.jsx)(Kd,{detail:e,label:t})}var kp=1200,Ap=5*6e4,jp=[{value:`today`,label:`Today`},{value:`week`,label:`Week`},{value:`month`,label:`Month`},{value:`year`,label:`Year`},{value:`all`,label:`All`}];function Mp(e){return e.title?.trim()||e.displayUrl}function Np(e){return e.description?.trim()||e.displayUrl.split(`?`)[0]||e.displayUrl}function Pp(e,t,n,r){return[...bt.linkInsights,{kind:e,range:t,sort:n,source:r}]}function Fp(e,t,n,r){let i=new URL(`/api/link-insights`,window.location.origin);return i.searchParams.set(`kind`,e),i.searchParams.set(`range`,t),i.searchParams.set(`sort`,n),i.searchParams.set(`source`,r),i.searchParams.set(`limit`,`30`),i.searchParams.set(`commentsLimit`,`30`),i}async function Ip(e,t,n,r,i){return St(Fp(e,t,n,r),{signal:i},xt,`Link insights unavailable`)}function Lp(e,t){return e.sourceUrl||e.contentTweetUrl||t.url}function Rp(e){return e.commentText||e.sharedContentText||e.rawText||`Shared without comment`}function zp(e,t){return!!(e&&t&&e.id===t.id)}function Bp(e){return e.find(e=>e.thumbnailUrl||e.url)??null}function Vp(e){try{let t=new URL(e),n=t.hostname.toLowerCase().replace(/^www\./,``);if(n===`youtu.be`)return t.pathname.split(`/`).filter(Boolean)[0]??null;if(!n.endsWith(`youtube.com`))return null;if(t.pathname===`/watch`)return t.searchParams.get(`v`);let r=t.pathname.split(`/`).filter(Boolean);return r[0]===`embed`||r[0]===`shorts`||r[0]===`live`?r[1]??null:null}catch{return null}}function Hp(e){let t=Vp(e);return!t||!/^[\w-]{6,}$/.test(t)?null:`https://i.ytimg.com/vi/${encodeURIComponent(t)}/hqdefault.jpg`}function Up(e){return e.commentCount??e.mentions.filter(e=>e.hasComment).length}function Wp(e){return e.pureShareCount??e.mentions.filter(e=>e.isPureShare||!e.hasComment).length}function Gp(e){return/^id\d+$/i.test(e.handle)&&e.displayName===e.handle&&e.id===`profile_user_${e.handle.slice(2)}`}function Kp(e){return!e?.handle||Gp(e)?!1:!e.avatarUrl||e.followersCount===0}function qp(e){let t=new Set;for(let n of e?.items??[])for(let e of[n.topSharer,...n.sharers,...n.mentions.flatMap(e=>[e.sharedBy,e.contentAuthor,e.participant])])if(!(!e||!Kp(e))&&(t.add(e.handle.replace(/^@/,``)),t.size>=30))return[...t];return[...t]}function Jp(e,t){let n=ht(),{kind:r,range:i,source:a,sort:o,q:s}=e,c=Nd({queryKey:Pp(r,i,o,a),queryFn:({signal:e})=>Ip(r,i,o,a,e),staleTime:Ap}),l=c.data??null;return(0,V.useEffect)(()=>{if(!l)return;let e=r===`links`?`videos`:`links`,t=window.setTimeout(()=>{n.prefetchQuery({queryKey:Pp(e,i,o,a),queryFn:({signal:t})=>Ip(e,i,o,a,t),staleTime:Ap})},250);return()=>window.clearTimeout(t)},[l,r,n,i,o,a]),(0,V.useEffect)(()=>{let e=qp(l);if(e.length===0)return;let t=!0,r=null,i=()=>{It(n,e,{limit:30}).then(e=>{t&&e.fetchedResults.some(e=>e.status===`hit`)&&n.invalidateQueries({queryKey:bt.linkInsights})}).catch(e=>{t&&console.warn(`Profile hydration failed`,e)})},a=window.setTimeout(()=>{`requestIdleCallback`in window?r=window.requestIdleCallback(i,{timeout:2500}):i()},kp);return()=>{t=!1,window.clearTimeout(a),r!==null&&`cancelIdleCallback`in window&&window.cancelIdleCallback(r)}},[l,n]),{kind:r,setKind:n=>t({...e,kind:n}),range:i,setRange:n=>t({...e,range:n}),source:a,setSource:n=>t({...e,source:n}),sort:o,setSort:n=>t({...e,sort:n}),search:s,setSearch:n=>t({...e,q:n},{replace:!0}),items:(0,V.useMemo)(()=>{let e=s.trim().toLowerCase();return(l?.items??[]).filter(t=>e?[t.title,t.description,t.displayUrl,t.host,t.topSharer?.handle,...t.mentions.map(e=>e.commentText)].filter(Boolean).some(t=>String(t).toLowerCase().includes(e)):!0)},[l?.items,s]),subtitle:(0,V.useMemo)(()=>{if(!l)return`Loading link memory...`;let e=r===`videos`?`video URLs`:`URLs`;return`${Et(l.stats.occurrences)} ${e} across ${Et(l.stats.groups)} groups`},[l,r]),loading:c.isPending,error:c.error?c.error instanceof Error?c.error.message:`Link insights unavailable`:null,retry:c.refetch}}Af();var Yp=hu(`/links`)({component:_u(()=>kf(()=>import(`./links-CIwqK_dX.js`),__vite__mapDeps([23,1,6,4,22,16,18,3,8,9,10])),`component`),validateSearch:xf});Af();var Xp=hu(`/likes`)({component:_u(()=>kf(()=>import(`./likes-dyh9p8y_.js`),__vite__mapDeps([24,3,1,25,21,2,4,6,5,22,16,8,9,10])),`component`)});function Zp({item:e,isReplying:t,replyDraft:n,onReplyChange:r,onReplyToggle:i,onReplySend:a}){return(0,H.jsxs)(`article`,{className:w(Be,`items-start`),children:[(0,H.jsx)(Dt,{avatarUrl:e.participant.avatarUrl,hue:e.participant.avatarHue,name:e.participant.displayName,profileId:e.participant.id}),(0,H.jsxs)(`div`,{className:be,children:[(0,H.jsxs)(`header`,{className:Ue,children:[(0,H.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,H.jsx)(`span`,{className:de,children:e.participant.displayName}),(0,H.jsxs)(`span`,{className:Se,children:[`@`,e.participant.handle]})]}),(0,H.jsx)(`span`,{className:Ge,children:`·`}),(0,H.jsx)(Pt,{className:d,value:e.createdAt}),(0,H.jsxs)(`span`,{className:`ml-auto flex items-center gap-1.5`,children:[(0,H.jsx)(`span`,{className:w(x,_e),children:e.entityKind}),(0,H.jsxs)(`span`,{className:w(x,Ie),children:[`score `,e.score]})]})]}),(0,H.jsx)(`h3`,{className:`text-[15px] font-bold text-[var(--ink)]`,children:e.title}),(0,H.jsx)(`p`,{className:p,children:e.text}),(0,H.jsxs)(`div`,{className:oe,children:[(0,H.jsx)(`strong`,{className:`text-[var(--ink)]`,children:e.summary}),(0,H.jsx)(`p`,{children:e.reasoning})]}),(0,H.jsxs)(`div`,{className:`mt-2 flex items-center justify-between gap-3 text-[13px] text-[var(--ink-soft)]`,children:[(0,H.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,H.jsx)(`span`,{children:e.source}),(0,H.jsx)(`span`,{className:h}),(0,H.jsxs)(`span`,{children:[`influence `,Et(e.influenceScore)]}),(0,H.jsx)(`span`,{className:h}),(0,H.jsxs)(`span`,{className:`inline-flex items-center gap-1`,children:[e.needsReply?(0,H.jsx)(Yu,{className:`size-3`,strokeWidth:2.2}):(0,H.jsx)(Je,{className:`size-3.5`,strokeWidth:2}),e.needsReply?`open`:`replied`]})]}),(0,H.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,H.jsxs)(`button`,{className:Ce,onClick:i,type:`button`,children:[(0,H.jsx)(ad,{className:`size-4`,strokeWidth:2}),t?`Close reply`:`Reply`]}),(0,H.jsxs)(lu,{className:w(Ce,`gap-1.5`),to:e.entityKind===`dm`?`/dms`:`/mentions`,children:[(0,H.jsx)(Qu,{className:`size-4`,strokeWidth:2}),`Open`]})]})]}),t?(0,H.jsxs)(`div`,{className:ae,children:[(0,H.jsx)(`textarea`,{className:u,onChange:e=>r(e.target.value),placeholder:e.entityKind===`dm`?`Reply to @${e.participant.handle}`:`Reply to mention from @${e.participant.handle}`,rows:4,value:n}),(0,H.jsxs)(`div`,{className:f,children:[(0,H.jsx)(`span`,{className:Ae,children:`Send from inbox`}),(0,H.jsx)(`button`,{className:ge,disabled:!n.trim(),onClick:a,type:`button`,children:`Send`})]})]}):null]})]})}Af();var Qp=hu(`/inbox`)({component:_u(()=>kf(()=>import(`./inbox-BybSI5Vf.js`),__vite__mapDeps([26,1,2,3,4,11,6])),`component`),validateSearch:bf});function $p({message:e}){let t=e.direction===`outbound`;return(0,H.jsxs)(`div`,{className:w(b,t&&`self-end items-end`),children:[(0,H.jsx)(`div`,{className:w(me,t?S:g),children:e.text}),(0,H.jsxs)(`div`,{className:Fe,children:[(0,H.jsx)(`span`,{children:e.sender.displayName}),(0,H.jsx)(`span`,{children:`·`}),(0,H.jsx)(Pt,{value:e.createdAt})]})]})}function em({conversations:e,selectedConversation:t,selectedMessages:n,onSelectConversation:r,replyDraft:i,onReplyDraftChange:c,onReplySend:l}){let d=t?.participant??null,p=t?t.isMessageRequest?`Message request`:t.needsReply?`Reply open`:`We replied`:null;return(0,H.jsxs)(`section`,{"aria-label":`DM workspace`,className:ve,children:[(0,H.jsxs)(`aside`,{className:v,children:[e.length===0?(0,H.jsx)(Kd,{detail:`Sync DMs to populate this lane.`,label:`No conversations`}):null,e.map(e=>(0,H.jsxs)(`button`,{className:w(s,e.id===t?.id&&`bg-[var(--bg-active)]`),onClick:()=>r(e.id),type:`button`,children:[(0,H.jsx)(Dt,{avatarUrl:e.participant.avatarUrl,hue:e.participant.avatarHue,name:e.participant.displayName,profileId:e.participant.id}),(0,H.jsxs)(`div`,{className:m,children:[(0,H.jsxs)(`div`,{className:E,children:[(0,H.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1.5`,children:[(0,H.jsx)(`span`,{className:O,children:e.participant.displayName}),(0,H.jsxs)(`span`,{className:C,children:[`@`,e.participant.handle]})]}),(0,H.jsx)(Pt,{className:pe,value:e.lastMessageAt})]}),(0,H.jsx)(`p`,{className:_,children:e.lastMessagePreview}),(0,H.jsxs)(`div`,{className:`mt-1 flex items-center gap-1.5`,children:[(0,H.jsxs)(`span`,{className:w(x,e.needsReply?Ie:_e),"aria-label":e.needsReply?`Reply open`:`We replied`,children:[e.needsReply?(0,H.jsx)(Yu,{className:`size-3`,strokeWidth:2.2}):(0,H.jsx)(Je,{className:`size-3.5`,strokeWidth:2}),e.needsReply?`open`:`replied`]}),e.isMessageRequest?(0,H.jsx)(`span`,{className:w(x,Ie),children:`request`}):null,(0,H.jsxs)(`span`,{className:w(x,_e),children:[Et(e.participant.followersCount),` `,`followers`]})]})]})]},e.id))]}),(0,H.jsx)(`div`,{className:le,children:t?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(`header`,{className:a,children:[(0,H.jsxs)(`div`,{className:Ne,children:[(0,H.jsx)(Dt,{avatarUrl:d?.avatarUrl,hue:d?.avatarHue??18,name:d?.displayName??`Unknown`,profileId:d?.id??void 0}),(0,H.jsxs)(`div`,{className:`min-w-0`,children:[(0,H.jsx)(`div`,{className:Te,children:t.participant.displayName}),(0,H.jsx)(`div`,{className:Le,children:p&&t?(0,H.jsxs)(H.Fragment,{children:[p,` · last message`,` `,(0,H.jsx)(Pt,{value:t.lastMessageAt})]}):`No conversation selected`})]})]}),(0,H.jsx)(`button`,{className:ge,onClick:()=>l(t.id),type:`button`,children:`Reply`})]}),d?.bio||d?.followersCount?(0,H.jsxs)(`div`,{className:`border-b border-[var(--line)] px-4 py-3`,children:[d?.bio?(0,H.jsx)(`p`,{className:`text-[14px] leading-[1.4] text-[var(--ink)]`,children:d.bio}):null,(0,H.jsxs)(`dl`,{className:`mt-2 grid grid-cols-2 gap-1 text-[13px]`,children:[(0,H.jsxs)(`div`,{className:je,children:[(0,H.jsx)(`dt`,{className:o,children:`Followers`}),(0,H.jsx)(`dd`,{className:ke,children:Et(d?.followersCount??0)})]}),(0,H.jsxs)(`div`,{className:je,children:[(0,H.jsx)(`dt`,{className:o,children:`Influence`}),(0,H.jsxs)(`dd`,{className:ke,children:[t.influenceScore,` ·`,` `,t.influenceLabel]})]}),(0,H.jsxs)(`div`,{className:je,children:[(0,H.jsx)(`dt`,{className:o,children:`Reply state`}),(0,H.jsx)(`dd`,{className:ke,children:t.isMessageRequest?`Message request`:t.needsReply?`Reply open`:`We replied`})]}),(0,H.jsxs)(`div`,{className:je,children:[(0,H.jsx)(`dt`,{className:o,children:`Account`}),(0,H.jsx)(`dd`,{className:ke,children:t.accountHandle})]})]})]}):null,(0,H.jsx)(`div`,{className:he,children:n.map(e=>(0,H.jsx)($p,{message:e},e.id))}),(0,H.jsxs)(`div`,{className:se,children:[(0,H.jsx)(`textarea`,{className:u,onChange:e=>c(e.target.value),placeholder:`Reply to @${t.participant.handle}`,rows:3,value:i}),(0,H.jsxs)(`div`,{className:f,children:[(0,H.jsx)(`span`,{className:Ae,children:t.needsReply?`Reply open`:`We replied`}),(0,H.jsx)(`button`,{className:ge,disabled:!i.trim(),onClick:()=>l(t.id),type:`button`,children:`Send reply`})]})]})]}):(0,H.jsx)(Kd,{detail:`Pick a conversation to read the thread.`,label:`No DM selected`})})]})}function tm({kind:e,label:t,accounts:n,onSynced:r,showAccountPicker:i=!1,syncOptions:a}){let[o,s]=(0,V.useState)(!1),[c,l]=(0,V.useState)(null),[u,d]=(0,V.useState)(null),f=n??[],p=zd(n),m=(0,V.useMemo)(()=>Id(n),[n]),h=p??m,g=e!==`dms`,_=g&&n===void 0&&(i||e!==`timeline`),v=!g&&h!==void 0&&m!==void 0&&h!==m,y=o||_||v,b=v?`Switch to default to sync`:_?`Loading account`:u??c??``;function x(e){Rd(e)}async function S(){s(!0),d(null),l(null);try{let t=await gt(e,g?h:void 0,a);if(!t.ok)throw Error(t.summary);l(t.summary),r(t)}catch(e){d(e instanceof Error?e.message:`Sync failed`)}finally{s(!1)}}return(0,H.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[i&&g&&f.length>1?(0,H.jsx)(`select`,{"aria-label":`Sync account`,className:w(Ee,`h-9 w-[132px]`),disabled:o,onChange:e=>x(e.target.value),value:h??``,children:f.map(e=>(0,H.jsx)(`option`,{value:e.id,children:e.handle},e.id))}):null,(0,H.jsxs)(`button`,{type:`button`,className:w(`inline-flex h-9 shrink-0 items-center gap-1.5 rounded-full border border-[var(--line)] bg-[var(--bg)] px-3 text-[13px] font-semibold text-[var(--ink)] transition-[background,border-color,color,transform] duration-150 hover:border-[color:color-mix(in_srgb,var(--accent)_45%,var(--line))] hover:bg-[var(--accent-soft)] hover:text-[var(--accent)] active:scale-[0.98] disabled:opacity-65`,o&&`text-[var(--ink-soft)]`,v?`disabled:cursor-not-allowed`:`disabled:cursor-wait`),"aria-label":v?`${t}: default account only`:o?`${t}: syncing`:t,disabled:y,onClick:S,children:[(0,H.jsx)(ld,{className:w(`size-4`,o&&`animate-spin`),strokeWidth:2}),(0,H.jsx)(`span`,{className:`hidden sm:inline`,children:o?`Syncing...`:t})]}),(0,H.jsx)(`span`,{className:w(`hidden max-w-[190px] truncate text-[12px] sm:inline`,u?`text-[var(--alert)]`:`text-[var(--ink-soft)]`),role:`status`,children:b})]})}function nm(e,t){let[n,r]=(0,V.useState)(e);return(0,V.useEffect)(()=>{let n=window.setTimeout(()=>r(e),t);return()=>window.clearTimeout(n)},[t,e]),n}Af();var rm=hu(`/dms`)({component:_u(()=>kf(()=>import(`./dms-SLXMtC4v.js`),__vite__mapDeps([27,1,2,3,4,16,6])),`component`),validateSearch:yf});Af();var im=hu(`/discuss`)({component:_u(()=>kf(()=>import(`./discuss-BWKu_p7B.js`),__vite__mapDeps([28,1,5,6,4,7,3,8,9,10,16,11])),`component`),validateSearch:Sf});Af();var am=hu(`/data-sources`)({component:_u(()=>kf(()=>import(`./data-sources-euTr6T_L.js`),__vite__mapDeps([29,1,2,3,4,6,5,14])),`component`)});Af();var om=hu(`/bookmarks`)({component:_u(()=>kf(()=>import(`./bookmarks-LbYOsoKf.js`),__vite__mapDeps([30,3,1,25,21,2,4,6,5,22,16,8,9,10])),`component`)});Af();var sm=hu(`/blocks`)({component:_u(()=>kf(()=>import(`./blocks-CFp_njvG.js`),__vite__mapDeps([31,1,2,3,4,8])),`component`),validateSearch:Tf});Af();var cm=hu(`/`)({component:_u(()=>kf(()=>import(`./routes-CiLuYpZr.js`),__vite__mapDeps([32,3,1,20,21,2,4,6,5,22,16,8,9,10])),`component`)});function lm(e){return`${e.start}:${e.end}`}function um(e){try{return new URL(e).hostname.replace(/^www\./,``)===`t.co`}catch{return!1}}function dm({text:e,entities:t,className:n=`body-copy`,hiddenUrlRanges:r=[],urlLabel:i=`display`,as:a=`p`}){let o=jt(e,t),s=Ot(e,o),c=new Set(r.map(lm)),l=t.article;if(l){let e=o.urls??[],t=e.filter(e=>Mt(e,l)),n=e[0];t.length===0&&e.length===1&&n&&(um(n.url)||um(n.expandedUrl))&&t.push(n);for(let e of t)c.add(lm(e))}let u=new Set(c);for(let t of o.urls??[])c.has(lm(t))&&u.add(lm(kt(e,t)));let d=a,f=0,p=t.article&&e.trim()===t.article.title.trim();return(0,H.jsxs)(d,{className:n===`body-copy`?fe:n,children:[(p?[]:s).map((t,n)=>{if(t.start<f||t.end<=t.start||t.end>e.length)return null;let r=e.slice(f,t.start);f=t.end;let a=(0,H.jsx)(V.Fragment,{children:e.slice(t.start,t.end)},`segment-${String(n)}`);if(t.kind===`url`&&u.has(lm(t)))a=null;else if(t.kind===`mention`&&t.profile)a=(0,H.jsx)(Nt,{profile:t.profile,children:(0,H.jsxs)(`span`,{className:y,children:[`@`,t.username]})},`segment-${String(n)}`);else if(t.kind===`mention`)a=(0,H.jsxs)(`a`,{className:y,href:`/profiles/${encodeURIComponent(t.username)}`,children:[`@`,t.username]},`segment-${String(n)}`);else if(t.kind===`url`){let e=At(t.expandedUrl);e&&(a=(0,H.jsx)(`a`,{className:re,href:e,rel:`noreferrer`,target:`_blank`,children:i===`expanded`?t.expandedUrl:t.displayUrl},`segment-${String(n)}`))}else t.kind===`hashtag`&&(a=(0,H.jsxs)(`span`,{className:ne,children:[`#`,t.tag]},`segment-${String(n)}`));return(0,H.jsxs)(V.Fragment,{children:[r,a]},`piece-${String(n)}`)}),p?null:e.slice(f)]})}var fm={maxTweets:1e4,maxPages:100,maxConversations:80,maxConversationPages:3},pm=/(^|[^\w@./])@([A-Za-z0-9_]{1,15})\b/g,mm=Ft;function hm(e){return Array.from(e.matchAll(pm)).map(e=>e[2])}function gm(e){let t=new Set;t.add(mm(e.profile.handle));for(let n of e.profiles??[])t.add(mm(n.handle));for(let n of e.conversations)t.add(mm(n.author));return t}function _m({context:e,analysis:t,markdown:n}){let r=new Set,i=gm(e),a=e=>{if(!e)return;let t=mm(e);!/^[a-z0-9_]{1,15}$/.test(t)||i.has(t)||r.add(t)};for(let e of t?.sourceHandles??[])a(e);for(let e of t?.themes??[])for(let t of e.handles)a(t);if(n)for(let e of hm(n))a(e);for(let t of hm(e.profile.bio))a(t);for(let t of e.tweets)for(let e of hm(t.text))a(e);for(let t of e.conversations){for(let e of hm(t.text))a(e);for(let e of hm(t.bio))a(e)}return[...r]}function vm(e,t){let n=new Map;for(let t of e.profiles??[])n.set(mm(t.handle),t);for(let e of t)n.set(mm(e.handle),e);return{...e,profiles:[...n.values()]}}async function ym({queryClient:e,context:t,analysis:n,markdown:r}){let{profiles:i}=await It(e,_m({context:t,analysis:n,markdown:r}),{limit:50});return i}function bm(e,t){let n=new URLSearchParams;return n.set(`handle`,e),n.set(`maxTweets`,String(t.maxTweets)),n.set(`maxPages`,String(t.maxPages)),n.set(`maxConversations`,String(t.maxConversations)),n.set(`maxConversationPages`,String(t.maxConversationPages)),t.refresh&&n.set(`refresh`,`true`),`/api/profile-analysis?${n.toString()}`}function xm(e){return e?[e.fetchCached?`cached backfill`:`fresh xurl backfill`,`${String(e.counts.tweets)} tweets`,`${String(e.counts.conversationTweets)} conversation tweets`,`${String(e.counts.conversationsScanned)} conversations`].join(` · `):`xurl profile backfill with cached AI analysis.`}function Sm(e){return e.trim().replace(/^@/,``)}function Cm(){return Error(`Profile analysis connection closed before completion. Retry to continue.`)}function wm(e){return e instanceof Error?e.message:`Analysis failed`}function Tm(e){let t=ht(),[n,r]=(0,V.useState)(``),[i,a]=(0,V.useState)(null),[o,s]=(0,V.useState)(null),[c,l]=(0,V.useState)(`Ready`),u=(0,V.useCallback)(()=>{r(``),a(null),s(null),l(`Starting profile analysis`)},[]),{error:d,loading:f,run:p}=Ye({schema:Ze,request:(0,V.useCallback)((e,t,n)=>fetch(bm(t,{refresh:n,...fm}),{signal:e}),[]),onStart:u,onEvent:(0,V.useCallback)((e,n)=>{let i=(e,r)=>{ym({queryClient:t,context:e,analysis:r?.analysis,markdown:r?.markdown}).then(e=>{n.isActive()&&e.length!==0&&(a(t=>t&&vm(t,e)),s(t=>{if(!t)return t;let n=vm(t.context,e);return n===t.context?t:{...t,context:n}}))}).catch(()=>{})};if(e.type===`status`)l(e.detail?`${e.label} · ${e.detail}`:e.label);else if(e.type===`start`)a(e.context),l(e.cached?`Loading cached analysis`:`Summarizing profile`),i(e.context);else if(e.type===`delta`)r(t=>t+e.delta);else if(e.type===`done`)s(e.result),a(e.result.context),r(e.result.markdown),l(e.result.cached?`Cached`:`Complete`),i(e.result.context,e.result);else if(e.type===`error`)throw Error(e.error)},[t]),isTerminal:$e,errorLabel:`Profile analysis failed`,emptyBodyMessage:`Profile analysis failed: empty response body`,prematureEofError:Cm,formatError:wm});return{context:i,error:d,loading:f,markdown:n,result:o,run:(0,V.useCallback)((t=!1,n)=>{let r=Sm(n??e);r&&p(r,t)},[e,p]),status:c}}function Em({analysis:e,className:t=``}){return(0,H.jsxs)(`div`,{className:`flex items-center gap-2 text-[13px] font-medium text-[var(--ink-soft)] ${t}`,children:[e.loading?(0,H.jsx)(Qe,{className:`size-4 animate-spin`,strokeWidth:1.8}):e.result?(0,H.jsx)(Je,{className:`size-4`,strokeWidth:1.8}):(0,H.jsx)(et,{className:`size-4`,strokeWidth:1.8}),(0,H.jsx)(`span`,{children:e.status})]})}function Dm({analysis:e,emptyLabel:t=`No profile selected.`}){return(0,H.jsxs)(H.Fragment,{children:[e.error?(0,H.jsx)(`div`,{className:we,children:e.error}):null,e.markdown?(0,H.jsx)(`div`,{className:`max-w-3xl`,children:(0,H.jsx)(Xe,{context:e.context,markdown:e.markdown})}):(0,H.jsx)(`div`,{className:`rounded-[8px] border border-[var(--line)] bg-[var(--panel)] p-6 text-[14px] text-[var(--ink-soft)]`,children:t})]})}Af();var Om=hu(`/profiles/$handle`)({component:_u(()=>kf(()=>import(`./profiles._handle-DdIVPqU-.js`),__vite__mapDeps([33,1,7,6,4,3,8,9,10])),`component`)}),km=jf.update({id:`/today`,path:`/today`,getParentRoute:()=>pf}),Am=Mf.update({id:`/rate-limits`,path:`/rate-limits`,getParentRoute:()=>pf}),jm=Nf.update({id:`/profile-analyze`,path:`/profile-analyze`,getParentRoute:()=>pf}),Mm=xp.update({id:`/network-map`,path:`/network-map`,getParentRoute:()=>pf}),Nm=Sp.update({id:`/mentions`,path:`/mentions`,getParentRoute:()=>pf}),Pm=Yp.update({id:`/links`,path:`/links`,getParentRoute:()=>pf}),Fm=Xp.update({id:`/likes`,path:`/likes`,getParentRoute:()=>pf}),Im=Qp.update({id:`/inbox`,path:`/inbox`,getParentRoute:()=>pf}),Lm=rm.update({id:`/dms`,path:`/dms`,getParentRoute:()=>pf}),Rm=im.update({id:`/discuss`,path:`/discuss`,getParentRoute:()=>pf}),zm=am.update({id:`/data-sources`,path:`/data-sources`,getParentRoute:()=>pf}),Bm=om.update({id:`/bookmarks`,path:`/bookmarks`,getParentRoute:()=>pf}),Vm=sm.update({id:`/blocks`,path:`/blocks`,getParentRoute:()=>pf}),Hm={IndexRoute:cm.update({id:`/`,path:`/`,getParentRoute:()=>pf}),BlocksRoute:Vm,BookmarksRoute:Bm,DataSourcesRoute:zm,DiscussRoute:Rm,DmsRoute:Lm,InboxRoute:Im,LikesRoute:Fm,LinksRoute:Pm,MentionsRoute:Nm,NetworkMapRoute:Mm,ProfileAnalyzeRoute:jm,RateLimitsRoute:Am,TodayRoute:km,ProfilesHandleRoute:Om.update({id:`/profiles/$handle`,path:`/profiles/$handle`,getParentRoute:()=>pf})},Um=pf._addFileChildren(Hm);function Wm(){return Nu({routeTree:Um,scrollRestoration:!0,defaultPreload:`intent`,defaultPreloadStaleTime:6e4})}async function Gm(){let e=await Wm(),t=[];return window.__TSS_START_OPTIONS__={serializationAdapters:t},t.push(rl),e.options.serializationAdapters&&t.push(...e.options.serializationAdapters),e.update({basepath:``,serializationAdapters:t}),e.stores.matchesId.get().length||await ol(e),e}var Km=Gm;async function qm(){let e=await Km();return window.$_TSR?.h(),e}var Jm;function Ym(){return Jm||=qm(),(0,H.jsx)(pl,{promise:Jm,children:e=>(0,H.jsx)(Iu,{router:e})})}var Xm=Bt();(0,V.startTransition)(()=>{(0,Xm.hydrateRoot)(document,(0,H.jsx)(V.StrictMode,{children:(0,H.jsx)(Ym,{})}))});export{yf as $,Ep as A,hp as B,Rp as C,Hp as D,jp as E,ap as F,_p as G,cp as H,up as I,jf as J,lp as K,dp as L,wp as M,xp as N,Op as O,bp as P,Sf as Q,pp as R,Bp as S,Wp as T,gp as U,sp as V,mp as W,Af as X,kf as Y,Tf as Z,Jp as _,Zu as _t,Sm as a,Gd as at,Np as b,Ju as bt,sm as c,Nd as ct,nm as d,fd as dt,bf as et,tm as f,ld as ft,Yp as g,Qu as gt,Zp as h,$u as ht,Tm as i,Kd as it,Tp as j,Dp as k,im as l,Md as lt,Qp as m,ed as mt,Dm as n,wf as nt,xm as o,zd as ot,em as p,ad as pt,Nf as q,Em as r,Cf as rt,dm as s,$ as st,Om as t,xf as tt,rm as u,pd as ut,Up as v,Xu as vt,Lp as w,Mp as x,zp as y,Yu as yt,fp as z};
@@ -1 +1 @@
1
- import{Ln as e}from"./schemas-I9r6F6ya.js";import{t}from"./SavedTimelineView-BIS7HKpp.js";var n=e();function r(){return(0,n.jsx)(t,{eyebrow:`liked posts`,filter:`liked`,loadingLabel:`Loading liked posts...`,searchPlaceholder:`Search likes`,title:`Things worth keeping in the orbit.`})}export{r as component};
1
+ import{Ln as e}from"./schemas-I9r6F6ya.js";import{t}from"./SavedTimelineView-BhSiVyR1.js";var n=e();function r(){return(0,n.jsx)(t,{eyebrow:`liked posts`,filter:`liked`,loadingLabel:`Loading liked posts...`,searchPlaceholder:`Search likes`,title:`Things worth keeping in the orbit.`})}export{r as component};
@@ -1 +1 @@
1
- import{r as e}from"./chunk-C0phanGV.js";import{t}from"./react-nBylq1U5.js";import{Gt as n,Kt as r,Ln as i,M as a,Ut as o,Wt as s,an as c,cn as l,dn as u,on as d,sn as f,un as p}from"./schemas-I9r6F6ya.js";import{t as m}from"./createLucideIcon-JV8isFFR.js";import{t as h}from"./repeat-2-xCwHM9hD.js";import{t as g}from"./search-Dq5kYsxA.js";import{t as _}from"./users-CHbKlqUr.js";import{r as v,t as y}from"./AvatarChip-DLoqM5xD.js";import{t as b}from"./ProfilePreview-BejAuYsJ.js";import{t as x}from"./SmartTimestamp-BR0-9se2.js";import{A as S,C,D as w,E as T,O as E,S as D,T as O,_ as k,b as A,bt as j,g as M,gt as N,j as P,k as F,pt as I,tt as L,v as R,w as z,x as B,y as V}from"./index-CEIG7S6s.js";var H=m(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),U=m(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),W=e(t()),G=i();function K({profile:e,className:t}){return e?(0,G.jsx)(b,{profile:e,children:(0,G.jsxs)(`span`,{className:a(`font-bold text-[var(--ink)] hover:underline`,t),children:[`@`,e.handle]})}):(0,G.jsx)(`span`,{className:a(`text-[var(--ink-soft)]`,t),children:`unknown`})}function q({item:e}){let t=e.sharers??[],n=(t.length>0?t:e.topSharer?[e.topSharer]:[]).slice(0,5),r=Math.max(0,e.uniqueSharers-n.length);return n.length===0?(0,G.jsx)(`span`,{children:`top unknown`}):(0,G.jsxs)(`div`,{className:`group/sharers relative z-10 inline-flex items-center gap-1 hover:z-50 focus-within:z-50`,children:[(0,G.jsx)(`div`,{className:`flex -space-x-2`,children:n.slice(0,4).map(e=>(0,G.jsx)(`a`,{"aria-label":`Open @${e.handle}`,className:`inline-flex rounded-full bg-[var(--bg)] ring-2 ring-[var(--bg)]`,href:`https://x.com/${e.handle}`,rel:`noreferrer`,target:`_blank`,children:(0,G.jsx)(y,{avatarUrl:e.avatarUrl,hue:e.avatarHue,name:e.displayName,profileId:e.id,size:`small`})},e.id))}),(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[13px] text-[var(--ink-soft)]`,children:[(0,G.jsx)(`span`,{children:`top`}),(0,G.jsxs)(`a`,{className:`font-medium text-[var(--ink-soft)] hover:underline`,href:`https://x.com/${n[0]?.handle??``}`,rel:`noreferrer`,target:`_blank`,children:[`@`,n[0]?.handle]})]}),r>0?(0,G.jsxs)(`span`,{className:`text-[13px] text-[var(--ink-soft)]`,children:[`+`,v(r)]}):null,(0,G.jsxs)(`div`,{className:`pointer-events-none absolute left-0 top-[calc(100%+8px)] z-[80] grid w-[280px] translate-y-1 gap-2 rounded-2xl border border-[var(--line)] bg-[var(--bg-elevated)] p-3 opacity-0 shadow-[0_8px_28px_var(--shadow-strong)] transition-all duration-150 group-hover/sharers:pointer-events-auto group-hover/sharers:translate-y-0 group-hover/sharers:opacity-100 group-focus-within/sharers:pointer-events-auto group-focus-within/sharers:translate-y-0 group-focus-within/sharers:opacity-100`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-[13px] font-bold text-[var(--ink)]`,children:[(0,G.jsx)(_,{className:`size-4`}),(0,G.jsxs)(`span`,{children:[v(e.uniqueSharers),` sharers`]})]}),(0,G.jsx)(`div`,{className:`grid gap-2`,children:n.map(e=>(0,G.jsxs)(`a`,{className:`flex min-w-0 items-center gap-2 rounded-xl p-1 transition-colors hover:bg-[var(--bg-hover)]`,href:`https://x.com/${e.handle}`,rel:`noreferrer`,target:`_blank`,children:[(0,G.jsx)(y,{avatarUrl:e.avatarUrl,hue:e.avatarHue,name:e.displayName,profileId:e.id,size:`small`}),(0,G.jsxs)(`span`,{className:`min-w-0`,children:[(0,G.jsx)(`span`,{className:`block truncate text-[14px] font-bold text-[var(--ink)]`,children:e.displayName}),(0,G.jsxs)(`span`,{className:`block truncate text-[13px] text-[var(--ink-soft)]`,children:[`@`,e.handle,` /`,` `,v(e.followersCount),` followers`]})]})]},e.id))})]})]})}function J({item:e,mention:t}){return(0,G.jsx)(`div`,{className:`flex flex-wrap items-center gap-3 text-[13px]`,children:[t.sourceUrl?{href:t.sourceUrl,label:t.sourceKind===`dm`?`Open DM`:`Open tweet`}:null,t.contentTweetUrl?{href:t.contentTweetUrl,label:`Open source tweet`}:null,{href:e.url,label:`Open link`}].filter(Boolean).map(e=>(0,G.jsxs)(`a`,{className:`inline-flex items-center gap-1 font-semibold text-[var(--accent)] hover:underline`,href:e.href,rel:`noreferrer`,target:`_blank`,children:[(0,G.jsx)(`span`,{children:e.label}),(0,G.jsx)(N,{className:`size-3.5`})]},`${e.label}:${e.href}`))})}function Y({item:e,mention:t}){let n=D(t.media),r=z(t,e),i=t.contentAuthor&&!V(t.sharedBy,t.contentAuthor)?t.contentAuthor:null;return(0,G.jsxs)(`article`,{className:`grid gap-2 rounded-2xl border border-[var(--line)] bg-[var(--bg)] px-3 py-2.5`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-[13px] text-[var(--ink-soft)]`,children:[(0,G.jsx)(K,{profile:t.sharedBy}),(0,G.jsx)(`span`,{children:t.sourceLabel??t.sourceKind}),(0,G.jsx)(`span`,{children:`/`}),(0,G.jsx)(`a`,{className:`hover:underline`,href:r,rel:`noreferrer`,target:`_blank`,children:(0,G.jsx)(x,{value:t.createdAt})})]}),(0,G.jsx)(`p`,{className:`m-0 whitespace-pre-wrap text-[14px] leading-[1.45] text-[var(--ink)] [overflow-wrap:anywhere]`,children:C(t)}),i?(0,G.jsxs)(`div`,{className:`text-[13px] text-[var(--ink-soft)]`,children:[`source by `,(0,G.jsx)(K,{profile:i})]}):null,n?(0,G.jsx)(`a`,{className:`block max-w-[220px] overflow-hidden rounded-2xl border border-[var(--line)] bg-[var(--bg-active)]`,href:r,rel:`noreferrer`,target:`_blank`,children:(0,G.jsx)(`img`,{alt:n.altText||`Mention media`,className:`aspect-video h-auto w-full object-cover`,src:n.thumbnailUrl||n.url})}):null,(0,G.jsx)(J,{item:e,mention:t})]})}function X({item:e,mentions:t}){let n=t.map(e=>e.sharedBy).filter(Boolean).slice(0,6),r=t.find(e=>e.sourceUrl)?.sourceUrl;return(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 rounded-2xl border border-[var(--line)] bg-[var(--bg-hover)] px-3 py-2.5`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(`div`,{className:`grid size-8 shrink-0 place-items-center rounded-full bg-[var(--bg-active)] text-[var(--ink-soft)]`,children:(0,G.jsx)(h,{className:`size-4`})}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsxs)(`div`,{className:`text-[14px] font-bold text-[var(--ink)]`,children:[v(O(e)),` shares without comment`]}),(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1 text-[13px] text-[var(--ink-soft)]`,children:[n.map(e=>(0,G.jsx)(K,{profile:e},e.id)),O(e)>n.length?(0,G.jsxs)(`span`,{children:[`+`,v(O(e)-n.length),` `,`more`]}):null]})]})]}),r?(0,G.jsxs)(`a`,{className:`inline-flex items-center gap-1 text-[13px] font-semibold text-[var(--accent)] hover:underline`,href:r,rel:`noreferrer`,target:`_blank`,children:[(0,G.jsx)(`span`,{children:`Open first source`}),(0,G.jsx)(N,{className:`size-3.5`})]}):null]})}function Z({item:e}){let[t,n]=(0,W.useState)(!1),[r,i]=(0,W.useState)(3),o=e.mentions.filter(e=>e.hasComment),s=e.mentions.filter(e=>e.isPureShare||!e.hasComment),c=R(e),u=O(e),d=c+u,f=o.slice(0,r),p=Math.max(0,o.length-r),m=Math.max(0,c-f.length);return d===0?null:(0,G.jsxs)(`div`,{className:`mt-2 grid gap-2 border-t border-[var(--line)] pt-2`,children:[(0,G.jsxs)(`button`,{className:`inline-flex w-fit items-center gap-1 rounded-full border-0 bg-transparent px-2 py-1 text-[13px] font-bold text-[var(--accent)] transition-colors hover:bg-[var(--accent-soft)]`,onClick:()=>n(e=>!e),type:`button`,children:[(0,G.jsx)(I,{className:`size-4`}),(0,G.jsxs)(`span`,{children:[t?`Hide`:`Show`,` `,v(c),` `,`comments`,u>0?` / ${v(u)} shares`:``]}),t?(0,G.jsx)(H,{className:`size-4`}):(0,G.jsx)(j,{className:`size-4`})]}),t?(0,G.jsxs)(`div`,{className:`grid gap-2`,children:[f.map(t=>(0,G.jsx)(Y,{item:e,mention:t},t.id)),p>0?(0,G.jsxs)(`button`,{className:a(l,`w-fit`),onClick:()=>i(e=>e+6),type:`button`,children:[`Show`,` `,v(Math.min(6,p)),` `,`more`]}):null,m>0&&p===0?(0,G.jsxs)(`div`,{className:`rounded-2xl border border-[var(--line)] bg-[var(--bg-hover)] px-3 py-2 text-[13px] text-[var(--ink-soft)]`,children:[v(m),` more mentions in archive. Narrow the range or raise the API limit to inspect them.`]}):null,u>0?(0,G.jsx)(X,{item:e,mentions:s}):null]}):null]})}function Q({item:e}){if(e.kind!==`videos`)return null;let t=D(e.mentions.flatMap(e=>e.media)),n=t?.thumbnailUrl||t?.url||w(e.url);return(0,G.jsxs)(`a`,{className:`mt-2 flex max-w-md items-center gap-3 overflow-hidden rounded-2xl border border-[var(--line)] bg-[var(--bg-hover)] transition-colors hover:bg-[var(--bg-active)]`,href:e.url,rel:`noreferrer`,target:`_blank`,children:[(0,G.jsxs)(`div`,{className:`relative grid aspect-video w-36 shrink-0 place-items-center overflow-hidden bg-[var(--bg-active)] text-[var(--ink-soft)]`,children:[n?(0,G.jsx)(`img`,{alt:t?.altText||B(e),className:`h-full w-full object-cover transition-transform duration-150 hover:scale-105`,src:n}):(0,G.jsx)(U,{className:`size-6`}),(0,G.jsx)(`div`,{className:`absolute inset-0 grid place-items-center bg-black/20`,children:(0,G.jsx)(`span`,{className:`grid size-9 place-items-center rounded-full bg-black/70 text-white shadow-[0_4px_18px_rgba(0,0,0,0.35)]`,children:(0,G.jsx)(U,{className:`ml-0.5 size-4 fill-current`})})})]}),(0,G.jsxs)(`div`,{className:`min-w-0 py-2 pr-3`,children:[(0,G.jsx)(`div`,{className:`truncate text-[13px] font-bold text-[var(--ink)]`,children:B(e)}),(0,G.jsx)(`div`,{className:`truncate text-[13px] text-[var(--ink-soft)]`,children:e.displayUrl})]})]})}function ee({index:e,item:t}){return(0,G.jsxs)(`article`,{className:`flex flex-col gap-2 border-b border-[var(--line)] px-4 py-3 transition-colors duration-150 hover:bg-[var(--bg-hover)]`,"data-perf":`link-insight-row`,children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(`div`,{className:`grid size-9 shrink-0 place-items-center rounded-full bg-[var(--bg-active)] text-[14px] font-bold text-[var(--ink-soft)]`,children:e+1}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`a`,{className:`block break-words text-[15px] font-bold text-[var(--ink)] [overflow-wrap:anywhere] hover:underline`,href:t.url,rel:`noreferrer`,target:`_blank`,children:B(t)}),(0,G.jsx)(`p`,{className:`mt-0.5 truncate text-[13px] text-[var(--ink-soft)]`,children:A(t)}),(0,G.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-2 text-[13px] text-[var(--ink-soft)]`,children:[(0,G.jsx)(`span`,{children:t.host}),(0,G.jsx)(`span`,{children:`/`}),(0,G.jsxs)(`span`,{children:[v(t.shareCount),` shares`]}),(0,G.jsx)(`span`,{children:`/`}),(0,G.jsxs)(`span`,{children:[v(t.uniqueSharers),` sharers`]}),(0,G.jsx)(`span`,{children:`/`}),(0,G.jsxs)(`span`,{children:[v(R(t)),` comments`]}),(0,G.jsx)(`span`,{children:`/`}),(0,G.jsx)(q,{item:t}),(0,G.jsx)(`span`,{children:`/`}),(0,G.jsx)(x,{value:t.lastSeenAt})]}),(0,G.jsx)(Q,{item:t})]})]}),(0,G.jsx)(Z,{item:t})]})}function te(){let e=M.useSearch(),t=M.useNavigate();return(0,G.jsx)($,{searchState:e,onSearchChange:(e,n)=>void t({search:e,replace:n?.replace})})}function $({searchState:e,onSearchChange:t}={}){let[i,l]=(0,W.useState)(()=>L({})),{kind:m,setKind:h,range:_,setRange:v,source:y,setSource:b,sort:x,setSort:C,search:w,setSearch:D,items:O,subtitle:A,loading:j,error:M,retry:N}=k(e??i,(e,n)=>t?t(e,n):l(e));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`header`,{className:o,children:[(0,G.jsx)(`div`,{className:s,children:(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,G.jsx)(`h1`,{className:r,children:`Links`}),(0,G.jsx)(`p`,{className:n,children:A})]})}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-4 pb-3`,children:[(0,G.jsxs)(`label`,{className:a(f,`min-w-[180px] flex-1`),children:[(0,G.jsx)(g,{className:c,strokeWidth:2}),(0,G.jsx)(`input`,{className:d,onChange:e=>D(e.target.value),placeholder:`Search links`,value:w})]}),(0,G.jsx)(`div`,{className:u,children:[`links`,`videos`].map(e=>(0,G.jsx)(`button`,{className:a(p,m===e&&`bg-[var(--bg-active)] text-[var(--ink)]`),onClick:()=>h(e),type:`button`,children:e},e))}),(0,G.jsx)(`div`,{className:u,children:T.map(e=>(0,G.jsx)(`button`,{className:a(p,_===e.value&&`bg-[var(--bg-active)] text-[var(--ink)]`),onClick:()=>v(e.value),type:`button`,children:e.label},e.value))}),(0,G.jsx)(`div`,{className:u,children:[`all`,`tweet`,`dm`].map(e=>(0,G.jsx)(`button`,{className:a(p,y===e&&`bg-[var(--bg-active)] text-[var(--ink)]`),onClick:()=>b(e),type:`button`,children:e},e))}),(0,G.jsx)(`div`,{className:u,children:[`rank`,`recent`,`comments`].map(e=>(0,G.jsx)(`button`,{className:a(p,x===e&&`bg-[var(--bg-active)] text-[var(--ink)]`),onClick:()=>C(e),type:`button`,children:e},e))})]})]}),(0,G.jsxs)(`section`,{className:`flex flex-col`,children:[j?(0,G.jsx)(S,{detail:`Ranking URLs and collecting local discussion`,label:`Loading links`,children:(0,G.jsx)(P,{})}):M?(0,G.jsx)(F,{action:(0,G.jsx)(`button`,{className:`rounded-full bg-[var(--accent)] px-4 py-1.5 text-[14px] font-bold text-white`,onClick:()=>void N(),type:`button`,children:`Retry`}),message:M,title:`Could not load links`}):O.length===0?(0,G.jsx)(E,{detail:`Try a different range, source, or search term.`,label:`No links in this window`}):null,O.map((e,t)=>(0,G.jsx)(ee,{index:t,item:e},`${m}:${_}:${y}:${e.id}`))]})]})}export{$ as LinksRouteView,te as component};
1
+ import{r as e}from"./chunk-C0phanGV.js";import{t}from"./react-nBylq1U5.js";import{Gt as n,Kt as r,Ln as i,M as a,Ut as o,Wt as s,an as c,cn as l,dn as u,on as d,sn as f,un as p}from"./schemas-I9r6F6ya.js";import{t as m}from"./createLucideIcon-JV8isFFR.js";import{t as h}from"./repeat-2-xCwHM9hD.js";import{t as g}from"./search-Dq5kYsxA.js";import{t as _}from"./users-CHbKlqUr.js";import{r as v,t as y}from"./AvatarChip-DLoqM5xD.js";import{t as b}from"./ProfilePreview-DQX6_xc3.js";import{t as x}from"./SmartTimestamp-BR0-9se2.js";import{A as S,C,D as w,E as T,O as E,S as D,T as O,_ as k,b as A,bt as j,g as M,gt as N,j as P,k as F,pt as I,tt as L,v as R,w as z,x as B,y as V}from"./index-DZVisyna.js";var H=m(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),U=m(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),W=e(t()),G=i();function K({profile:e,className:t}){return e?(0,G.jsx)(b,{profile:e,children:(0,G.jsxs)(`span`,{className:a(`font-bold text-[var(--ink)] hover:underline`,t),children:[`@`,e.handle]})}):(0,G.jsx)(`span`,{className:a(`text-[var(--ink-soft)]`,t),children:`unknown`})}function q({item:e}){let t=e.sharers??[],n=(t.length>0?t:e.topSharer?[e.topSharer]:[]).slice(0,5),r=Math.max(0,e.uniqueSharers-n.length);return n.length===0?(0,G.jsx)(`span`,{children:`top unknown`}):(0,G.jsxs)(`div`,{className:`group/sharers relative z-10 inline-flex items-center gap-1 hover:z-50 focus-within:z-50`,children:[(0,G.jsx)(`div`,{className:`flex -space-x-2`,children:n.slice(0,4).map(e=>(0,G.jsx)(`a`,{"aria-label":`Open @${e.handle}`,className:`inline-flex rounded-full bg-[var(--bg)] ring-2 ring-[var(--bg)]`,href:`https://x.com/${e.handle}`,rel:`noreferrer`,target:`_blank`,children:(0,G.jsx)(y,{avatarUrl:e.avatarUrl,hue:e.avatarHue,name:e.displayName,profileId:e.id,size:`small`})},e.id))}),(0,G.jsxs)(`span`,{className:`inline-flex items-center gap-1 text-[13px] text-[var(--ink-soft)]`,children:[(0,G.jsx)(`span`,{children:`top`}),(0,G.jsxs)(`a`,{className:`font-medium text-[var(--ink-soft)] hover:underline`,href:`https://x.com/${n[0]?.handle??``}`,rel:`noreferrer`,target:`_blank`,children:[`@`,n[0]?.handle]})]}),r>0?(0,G.jsxs)(`span`,{className:`text-[13px] text-[var(--ink-soft)]`,children:[`+`,v(r)]}):null,(0,G.jsxs)(`div`,{className:`pointer-events-none absolute left-0 top-[calc(100%+8px)] z-[80] grid w-[280px] translate-y-1 gap-2 rounded-2xl border border-[var(--line)] bg-[var(--bg-elevated)] p-3 opacity-0 shadow-[0_8px_28px_var(--shadow-strong)] transition-all duration-150 group-hover/sharers:pointer-events-auto group-hover/sharers:translate-y-0 group-hover/sharers:opacity-100 group-focus-within/sharers:pointer-events-auto group-focus-within/sharers:translate-y-0 group-focus-within/sharers:opacity-100`,children:[(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-[13px] font-bold text-[var(--ink)]`,children:[(0,G.jsx)(_,{className:`size-4`}),(0,G.jsxs)(`span`,{children:[v(e.uniqueSharers),` sharers`]})]}),(0,G.jsx)(`div`,{className:`grid gap-2`,children:n.map(e=>(0,G.jsxs)(`a`,{className:`flex min-w-0 items-center gap-2 rounded-xl p-1 transition-colors hover:bg-[var(--bg-hover)]`,href:`https://x.com/${e.handle}`,rel:`noreferrer`,target:`_blank`,children:[(0,G.jsx)(y,{avatarUrl:e.avatarUrl,hue:e.avatarHue,name:e.displayName,profileId:e.id,size:`small`}),(0,G.jsxs)(`span`,{className:`min-w-0`,children:[(0,G.jsx)(`span`,{className:`block truncate text-[14px] font-bold text-[var(--ink)]`,children:e.displayName}),(0,G.jsxs)(`span`,{className:`block truncate text-[13px] text-[var(--ink-soft)]`,children:[`@`,e.handle,` /`,` `,v(e.followersCount),` followers`]})]})]},e.id))})]})]})}function J({item:e,mention:t}){return(0,G.jsx)(`div`,{className:`flex flex-wrap items-center gap-3 text-[13px]`,children:[t.sourceUrl?{href:t.sourceUrl,label:t.sourceKind===`dm`?`Open DM`:`Open tweet`}:null,t.contentTweetUrl?{href:t.contentTweetUrl,label:`Open source tweet`}:null,{href:e.url,label:`Open link`}].filter(Boolean).map(e=>(0,G.jsxs)(`a`,{className:`inline-flex items-center gap-1 font-semibold text-[var(--accent)] hover:underline`,href:e.href,rel:`noreferrer`,target:`_blank`,children:[(0,G.jsx)(`span`,{children:e.label}),(0,G.jsx)(N,{className:`size-3.5`})]},`${e.label}:${e.href}`))})}function Y({item:e,mention:t}){let n=D(t.media),r=z(t,e),i=t.contentAuthor&&!V(t.sharedBy,t.contentAuthor)?t.contentAuthor:null;return(0,G.jsxs)(`article`,{className:`grid gap-2 rounded-2xl border border-[var(--line)] bg-[var(--bg)] px-3 py-2.5`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2 text-[13px] text-[var(--ink-soft)]`,children:[(0,G.jsx)(K,{profile:t.sharedBy}),(0,G.jsx)(`span`,{children:t.sourceLabel??t.sourceKind}),(0,G.jsx)(`span`,{children:`/`}),(0,G.jsx)(`a`,{className:`hover:underline`,href:r,rel:`noreferrer`,target:`_blank`,children:(0,G.jsx)(x,{value:t.createdAt})})]}),(0,G.jsx)(`p`,{className:`m-0 whitespace-pre-wrap text-[14px] leading-[1.45] text-[var(--ink)] [overflow-wrap:anywhere]`,children:C(t)}),i?(0,G.jsxs)(`div`,{className:`text-[13px] text-[var(--ink-soft)]`,children:[`source by `,(0,G.jsx)(K,{profile:i})]}):null,n?(0,G.jsx)(`a`,{className:`block max-w-[220px] overflow-hidden rounded-2xl border border-[var(--line)] bg-[var(--bg-active)]`,href:r,rel:`noreferrer`,target:`_blank`,children:(0,G.jsx)(`img`,{alt:n.altText||`Mention media`,className:`aspect-video h-auto w-full object-cover`,src:n.thumbnailUrl||n.url})}):null,(0,G.jsx)(J,{item:e,mention:t})]})}function X({item:e,mentions:t}){let n=t.map(e=>e.sharedBy).filter(Boolean).slice(0,6),r=t.find(e=>e.sourceUrl)?.sourceUrl;return(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 rounded-2xl border border-[var(--line)] bg-[var(--bg-hover)] px-3 py-2.5`,children:[(0,G.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,G.jsx)(`div`,{className:`grid size-8 shrink-0 place-items-center rounded-full bg-[var(--bg-active)] text-[var(--ink-soft)]`,children:(0,G.jsx)(h,{className:`size-4`})}),(0,G.jsxs)(`div`,{className:`min-w-0`,children:[(0,G.jsxs)(`div`,{className:`text-[14px] font-bold text-[var(--ink)]`,children:[v(O(e)),` shares without comment`]}),(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-1 text-[13px] text-[var(--ink-soft)]`,children:[n.map(e=>(0,G.jsx)(K,{profile:e},e.id)),O(e)>n.length?(0,G.jsxs)(`span`,{children:[`+`,v(O(e)-n.length),` `,`more`]}):null]})]})]}),r?(0,G.jsxs)(`a`,{className:`inline-flex items-center gap-1 text-[13px] font-semibold text-[var(--accent)] hover:underline`,href:r,rel:`noreferrer`,target:`_blank`,children:[(0,G.jsx)(`span`,{children:`Open first source`}),(0,G.jsx)(N,{className:`size-3.5`})]}):null]})}function Z({item:e}){let[t,n]=(0,W.useState)(!1),[r,i]=(0,W.useState)(3),o=e.mentions.filter(e=>e.hasComment),s=e.mentions.filter(e=>e.isPureShare||!e.hasComment),c=R(e),u=O(e),d=c+u,f=o.slice(0,r),p=Math.max(0,o.length-r),m=Math.max(0,c-f.length);return d===0?null:(0,G.jsxs)(`div`,{className:`mt-2 grid gap-2 border-t border-[var(--line)] pt-2`,children:[(0,G.jsxs)(`button`,{className:`inline-flex w-fit items-center gap-1 rounded-full border-0 bg-transparent px-2 py-1 text-[13px] font-bold text-[var(--accent)] transition-colors hover:bg-[var(--accent-soft)]`,onClick:()=>n(e=>!e),type:`button`,children:[(0,G.jsx)(I,{className:`size-4`}),(0,G.jsxs)(`span`,{children:[t?`Hide`:`Show`,` `,v(c),` `,`comments`,u>0?` / ${v(u)} shares`:``]}),t?(0,G.jsx)(H,{className:`size-4`}):(0,G.jsx)(j,{className:`size-4`})]}),t?(0,G.jsxs)(`div`,{className:`grid gap-2`,children:[f.map(t=>(0,G.jsx)(Y,{item:e,mention:t},t.id)),p>0?(0,G.jsxs)(`button`,{className:a(l,`w-fit`),onClick:()=>i(e=>e+6),type:`button`,children:[`Show`,` `,v(Math.min(6,p)),` `,`more`]}):null,m>0&&p===0?(0,G.jsxs)(`div`,{className:`rounded-2xl border border-[var(--line)] bg-[var(--bg-hover)] px-3 py-2 text-[13px] text-[var(--ink-soft)]`,children:[v(m),` more mentions in archive. Narrow the range or raise the API limit to inspect them.`]}):null,u>0?(0,G.jsx)(X,{item:e,mentions:s}):null]}):null]})}function Q({item:e}){if(e.kind!==`videos`)return null;let t=D(e.mentions.flatMap(e=>e.media)),n=t?.thumbnailUrl||t?.url||w(e.url);return(0,G.jsxs)(`a`,{className:`mt-2 flex max-w-md items-center gap-3 overflow-hidden rounded-2xl border border-[var(--line)] bg-[var(--bg-hover)] transition-colors hover:bg-[var(--bg-active)]`,href:e.url,rel:`noreferrer`,target:`_blank`,children:[(0,G.jsxs)(`div`,{className:`relative grid aspect-video w-36 shrink-0 place-items-center overflow-hidden bg-[var(--bg-active)] text-[var(--ink-soft)]`,children:[n?(0,G.jsx)(`img`,{alt:t?.altText||B(e),className:`h-full w-full object-cover transition-transform duration-150 hover:scale-105`,src:n}):(0,G.jsx)(U,{className:`size-6`}),(0,G.jsx)(`div`,{className:`absolute inset-0 grid place-items-center bg-black/20`,children:(0,G.jsx)(`span`,{className:`grid size-9 place-items-center rounded-full bg-black/70 text-white shadow-[0_4px_18px_rgba(0,0,0,0.35)]`,children:(0,G.jsx)(U,{className:`ml-0.5 size-4 fill-current`})})})]}),(0,G.jsxs)(`div`,{className:`min-w-0 py-2 pr-3`,children:[(0,G.jsx)(`div`,{className:`truncate text-[13px] font-bold text-[var(--ink)]`,children:B(e)}),(0,G.jsx)(`div`,{className:`truncate text-[13px] text-[var(--ink-soft)]`,children:e.displayUrl})]})]})}function ee({index:e,item:t}){return(0,G.jsxs)(`article`,{className:`flex flex-col gap-2 border-b border-[var(--line)] px-4 py-3 transition-colors duration-150 hover:bg-[var(--bg-hover)]`,"data-perf":`link-insight-row`,children:[(0,G.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,G.jsx)(`div`,{className:`grid size-9 shrink-0 place-items-center rounded-full bg-[var(--bg-active)] text-[14px] font-bold text-[var(--ink-soft)]`,children:e+1}),(0,G.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,G.jsx)(`a`,{className:`block break-words text-[15px] font-bold text-[var(--ink)] [overflow-wrap:anywhere] hover:underline`,href:t.url,rel:`noreferrer`,target:`_blank`,children:B(t)}),(0,G.jsx)(`p`,{className:`mt-0.5 truncate text-[13px] text-[var(--ink-soft)]`,children:A(t)}),(0,G.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-2 text-[13px] text-[var(--ink-soft)]`,children:[(0,G.jsx)(`span`,{children:t.host}),(0,G.jsx)(`span`,{children:`/`}),(0,G.jsxs)(`span`,{children:[v(t.shareCount),` shares`]}),(0,G.jsx)(`span`,{children:`/`}),(0,G.jsxs)(`span`,{children:[v(t.uniqueSharers),` sharers`]}),(0,G.jsx)(`span`,{children:`/`}),(0,G.jsxs)(`span`,{children:[v(R(t)),` comments`]}),(0,G.jsx)(`span`,{children:`/`}),(0,G.jsx)(q,{item:t}),(0,G.jsx)(`span`,{children:`/`}),(0,G.jsx)(x,{value:t.lastSeenAt})]}),(0,G.jsx)(Q,{item:t})]})]}),(0,G.jsx)(Z,{item:t})]})}function te(){let e=M.useSearch(),t=M.useNavigate();return(0,G.jsx)($,{searchState:e,onSearchChange:(e,n)=>void t({search:e,replace:n?.replace})})}function $({searchState:e,onSearchChange:t}={}){let[i,l]=(0,W.useState)(()=>L({})),{kind:m,setKind:h,range:_,setRange:v,source:y,setSource:b,sort:x,setSort:C,search:w,setSearch:D,items:O,subtitle:A,loading:j,error:M,retry:N}=k(e??i,(e,n)=>t?t(e,n):l(e));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(`header`,{className:o,children:[(0,G.jsx)(`div`,{className:s,children:(0,G.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,G.jsx)(`h1`,{className:r,children:`Links`}),(0,G.jsx)(`p`,{className:n,children:A})]})}),(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 px-4 pb-3`,children:[(0,G.jsxs)(`label`,{className:a(f,`min-w-[180px] flex-1`),children:[(0,G.jsx)(g,{className:c,strokeWidth:2}),(0,G.jsx)(`input`,{className:d,onChange:e=>D(e.target.value),placeholder:`Search links`,value:w})]}),(0,G.jsx)(`div`,{className:u,children:[`links`,`videos`].map(e=>(0,G.jsx)(`button`,{className:a(p,m===e&&`bg-[var(--bg-active)] text-[var(--ink)]`),onClick:()=>h(e),type:`button`,children:e},e))}),(0,G.jsx)(`div`,{className:u,children:T.map(e=>(0,G.jsx)(`button`,{className:a(p,_===e.value&&`bg-[var(--bg-active)] text-[var(--ink)]`),onClick:()=>v(e.value),type:`button`,children:e.label},e.value))}),(0,G.jsx)(`div`,{className:u,children:[`all`,`tweet`,`dm`].map(e=>(0,G.jsx)(`button`,{className:a(p,y===e&&`bg-[var(--bg-active)] text-[var(--ink)]`),onClick:()=>b(e),type:`button`,children:e},e))}),(0,G.jsx)(`div`,{className:u,children:[`rank`,`recent`,`comments`].map(e=>(0,G.jsx)(`button`,{className:a(p,x===e&&`bg-[var(--bg-active)] text-[var(--ink)]`),onClick:()=>C(e),type:`button`,children:e},e))})]})]}),(0,G.jsxs)(`section`,{className:`flex flex-col`,children:[j?(0,G.jsx)(S,{detail:`Ranking URLs and collecting local discussion`,label:`Loading links`,children:(0,G.jsx)(P,{})}):M?(0,G.jsx)(F,{action:(0,G.jsx)(`button`,{className:`rounded-full bg-[var(--accent)] px-4 py-1.5 text-[14px] font-bold text-white`,onClick:()=>void N(),type:`button`,children:`Retry`}),message:M,title:`Could not load links`}):O.length===0?(0,G.jsx)(E,{detail:`Try a different range, source, or search term.`,label:`No links in this window`}):null,O.map((e,t)=>(0,G.jsx)(ee,{index:t,item:e},`${m}:${_}:${y}:${e.id}`))]})]})}export{$ as LinksRouteView,te as component};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mapbox-gl-dgf_hX3a.js","assets/chunk-C0phanGV.js","assets/index-CEIG7S6s.js","assets/query-client-fYu2rzRC.js","assets/schemas-I9r6F6ya.js","assets/react-nBylq1U5.js","assets/createLucideIcon-JV8isFFR.js","assets/circle-check-C_Vq3ElD.js","assets/client-stream-contracts-ys3XhWG4.js","assets/AvatarChip-DLoqM5xD.js","assets/ProfilePreview-BejAuYsJ.js","assets/SmartTimestamp-BR0-9se2.js","assets/sparkles-CQVlvHsZ.js","assets/react-dom-DHl6Ug7F.js","assets/profile-hydration-client-YEtJsNTv.js","assets/index-bpFrQ5yG.css"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./chunk-C0phanGV.js";import{t}from"./react-nBylq1U5.js";import{t as n}from"./react-dom-DHl6Ug7F.js";import{X as r,Y as i}from"./index-CEIG7S6s.js";var a=e(t(),1),o=a.createContext(null),s=e=>{let[t,n]=(0,a.useState)({}),r=(0,a.useCallback)((e,t=`default`)=>{n(n=>{if(t===`current`)throw Error(`'current' cannot be used as map id`);if(n[t])throw Error(`Multiple maps with the same id: ${t}`);return{...n,[t]:e}})},[]),i=(0,a.useCallback)((e=`default`)=>{n(t=>{if(t[e]){let n={...t};return delete n[e],n}return t})},[]);return a.createElement(o.Provider,{value:{maps:t,onMapMount:r,onMapUnmount:i}},e.children)};function c(){let e=(0,a.useContext)(o)?.maps,t=(0,a.useContext)(N);return(0,a.useMemo)(()=>({...e,current:t?.map}),[e,t])}function l(e){return{longitude:e.center.lng,latitude:e.center.lat,zoom:e._seaLevelZoom??e.zoom,pitch:e.pitch,bearing:e.bearing,padding:e.padding,elevation:e._centerAltitude}}function u(e){return Number.isFinite(e.longitude)||Number.isFinite(e.latitude)||Number.isFinite(e.zoom)||Number.isFinite(e.pitch)||Number.isFinite(e.bearing)}function d(e,t){return!!(Number.isFinite(t.longitude)&&e.center.lng!==t.longitude||Number.isFinite(t.latitude)&&e.center.lat!==t.latitude||Number.isFinite(t.bearing)&&e.bearing!==t.bearing||Number.isFinite(t.pitch)&&e.pitch!==t.pitch||Number.isFinite(t.zoom)&&(e._seaLevelZoom??e.zoom)!==t.zoom||t.padding&&!e.isPaddingEqual(t.padding))}function f(){}function p(e,t){let n=e._constrain,r=e._calcMatrices;if(e._constrain=f,e._calcMatrices=f,Number.isFinite(t.bearing)&&(e.bearing=t.bearing),Number.isFinite(t.pitch)&&(e.pitch=t.pitch),t.padding&&!e.isPaddingEqual(t.padding)&&(e.padding=t.padding),Number.isFinite(t.longitude)||Number.isFinite(t.latitude)){let n=e.center;e._center=new n.constructor(t.longitude??n.lng,t.latitude??n.lat)}if(Number.isFinite(t.zoom))if(e._centerAltitude=t.elevation??0,e.elevation){e._seaLevelZoom=t.zoom;let n=e.pixelsPerMeter/e.worldSize*e._centerAltitude,r=e._mercatorZfromZoom(t.zoom),i=e._mercatorZfromZoom(e._maxZoom),a=Math.max(r-n,i);e._setZoom(e._zoomFromMercatorZ(a))}else e._seaLevelZoom=null,e.zoom=t.zoom;e._constrain=n,e._calcMatrices=r,e._unmodified||(e._constrain(),e._calcMatrices())}var m=new Set([`_calcMatrices`,`_calcFogMatrices`,`_updateCameraState`,`_updateSeaLevelZoom`]);function h(e){let t=!1,n={},r=e,i=null;return new Proxy(e,{get(e,a){return a===`$reactViewState`?n:a===`$proposedTransform`?i:a===`$internalUpdate`?t:a===`_setZoom`?e=>{t&&i?.[a](e),Number.isFinite(n.zoom)||r[a](e)}:(t&&a===`_translateCameraConstrained`&&u(n)&&(i||=r.clone()),m.has(a)?function(...e){i?.[a](...e),r[a](...e)}:t&&i?i[a]:r[a])},set(e,a,o){if(a===`$reactViewState`)return n=o,p(r,n),!0;if(a===`$proposedTransform`)return i=o,!0;if(a===`$internalUpdate`)return t=o,!0;let s=o;return a===`center`||a===`_center`?(Number.isFinite(n.longitude)||Number.isFinite(n.latitude))&&(s=new o.constructor(n.longitude??o.lng,n.latitude??o.lat)):a===`zoom`||a===`_zoom`||a===`_seaLevelZoom`?Number.isFinite(n.zoom)&&(s=r[a]):a===`_centerAltitude`?Number.isFinite(n.elevation)&&(s=r[a]):a===`pitch`||a===`_pitch`?Number.isFinite(n.pitch)&&(s=r[a]):(a===`bearing`||a===`rotation`||a===`angle`)&&Number.isFinite(n.bearing)&&(s=r[a]),t&&s!==o&&(i||=r.clone()),t&&i&&(i[a]=o),r[a]=s,!0}})}var g=[`type`,`source`,`source-layer`,`minzoom`,`maxzoom`,`filter`,`layout`];function _(e){if(!e)return null;if(typeof e==`string`||(`toJS`in e&&(e=e.toJS()),!e.layers))return e;let t={};for(let n of e.layers)t[n.id]=n;let n=e.layers.map(e=>{let n=null;`interactive`in e&&(n=Object.assign({},e),delete n.interactive);let r=t[e.ref];if(r){n||=Object.assign({},e),delete n.ref;for(let e of g)e in r&&(n[e]=r[e])}return n||e});return{...e,layers:n}}function v(e,t){let n=Array.isArray(e)?e[0]:e?e.x:0,r=Array.isArray(e)?e[1]:e?e.y:0,i=Array.isArray(t)?t[0]:t?t.x:0,a=Array.isArray(t)?t[1]:t?t.y:0;return n===i&&r===a}function y(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!y(e[n],t[n]))return!1;return!0}else if(Array.isArray(t))return!1;if(typeof e==`object`&&typeof t==`object`){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!t.hasOwnProperty(r)||!y(e[r],t[r]))return!1;return!0}return!1}var b={version:8,sources:{},layers:[]},x={minZoom:0,maxZoom:22,minPitch:0,maxPitch:85,maxBounds:[-180,-85.051129,180,85.051129],projection:`mercator`,renderWorldCopies:!0},S={mousedown:`onMouseDown`,mouseup:`onMouseUp`,mouseover:`onMouseOver`,mousemove:`onMouseMove`,click:`onClick`,dblclick:`onDblClick`,mouseenter:`onMouseEnter`,mouseleave:`onMouseLeave`,mouseout:`onMouseOut`,contextmenu:`onContextMenu`,touchstart:`onTouchStart`,touchend:`onTouchEnd`,touchmove:`onTouchMove`,touchcancel:`onTouchCancel`},C={movestart:`onMoveStart`,move:`onMove`,moveend:`onMoveEnd`,dragstart:`onDragStart`,drag:`onDrag`,dragend:`onDragEnd`,zoomstart:`onZoomStart`,zoom:`onZoom`,zoomend:`onZoomEnd`,rotatestart:`onRotateStart`,rotate:`onRotate`,rotateend:`onRotateEnd`,pitchstart:`onPitchStart`,pitch:`onPitch`,pitchend:`onPitchEnd`},w={wheel:`onWheel`,boxzoomstart:`onBoxZoomStart`,boxzoomend:`onBoxZoomEnd`,boxzoomcancel:`onBoxZoomCancel`,resize:`onResize`,load:`onLoad`,render:`onRender`,idle:`onIdle`,remove:`onRemove`,data:`onData`,styledata:`onStyleData`,sourcedata:`onSourceData`,error:`onError`},T=[`minZoom`,`maxZoom`,`minPitch`,`maxPitch`,`maxBounds`,`projection`,`renderWorldCopies`],E=[`scrollZoom`,`boxZoom`,`dragRotate`,`dragPan`,`keyboard`,`doubleClickZoom`,`touchZoomRotate`,`touchPitch`],D=class e{constructor(e,t,n){this._map=null,this._internalUpdate=!1,this._inRender=!1,this._hoveredFeatures=null,this._deferredEvents={move:!1,zoom:!1,pitch:!1,rotate:!1},this._onEvent=e=>{let t=this.props[w[e.type]];t?t(e):e.type===`error`&&console.error(e.error)},this._onPointerEvent=e=>{(e.type===`mousemove`||e.type===`mouseout`)&&this._updateHover(e);let t=this.props[S[e.type]];t&&(this.props.interactiveLayerIds&&e.type!==`mouseover`&&e.type!==`mouseout`&&(e.features=this._hoveredFeatures||this._queryRenderedFeatures(e.point)),t(e),delete e.features)},this._onCameraEvent=e=>{if(!this._internalUpdate){let t=this.props[C[e.type]],n=this._proxyTransform;t&&(e.viewState=l(n.$proposedTransform??n),t(e)),e.type===`moveend`&&(n.$proposedTransform=null)}e.type in this._deferredEvents&&(this._deferredEvents[e.type]=!1)},this._MapClass=e,this.props=t,this._initialize(n)}get map(){return this._map}get transform(){return this._map.transform}setProps(e){let t=this.props;this.props=e;let n=this._updateSettings(e,t),r=this._updateSize(e),i=this._updateViewState(e,!0);this._updateStyle(e,t),this._updateStyleComponents(e,t),this._updateHandlers(e,t),(n||r||i&&!this._map.isMoving())&&this.redraw()}static reuse(t,n){let r=e.savedMaps.pop();if(!r)return null;let i=r.map,a=i.getContainer();for(n.className=a.className;a.childNodes.length>0;)n.appendChild(a.childNodes[0]);i._container=n,r.setProps({...t,styleDiffing:!1}),i.resize();let{initialViewState:o}=t;return o&&(o.bounds?i.fitBounds(o.bounds,{...o.fitBoundsOptions,duration:0}):r._updateViewState(o,!1)),i.isStyleLoaded()?i.fire(`load`):i.once(`styledata`,()=>i.fire(`load`)),i._update(),r}_initialize(e){let{props:t}=this,{mapStyle:n=b}=t,r={...t,...t.initialViewState,accessToken:t.mapboxAccessToken||O()||null,container:e,style:_(n)},i=r.initialViewState||r.viewState||r;if(Object.assign(r,{center:[i.longitude||0,i.latitude||0],zoom:i.zoom||0,pitch:i.pitch||0,bearing:i.bearing||0}),t.gl){let e=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=e,t.gl)}let a=new this._MapClass(r);i.padding&&a.setPadding(i.padding),t.cursor&&(a.getCanvas().style.cursor=t.cursor),this._createProxyTransform(a);let o=a._render;a._render=e=>{this._inRender=!0,o.call(a,e),this._inRender=!1};let s=a._renderTaskQueue.run;a._renderTaskQueue.run=e=>{this._proxyTransform.$internalUpdate=!0,s.call(a._renderTaskQueue,e),this._proxyTransform.$internalUpdate=!1,this._fireDefferedEvents()};let c=a.jumpTo;a.jumpTo=(...e)=>(this._proxyTransform.$internalUpdate=!0,c.apply(a,e),this._proxyTransform.$internalUpdate=!1,a);let l=a.fire;a.fire=this._fireEvent.bind(this,l),a.on(`styledata`,()=>{this._updateStyleComponents(this.props,{})}),a.on(`sourcedata`,()=>{this._updateStyleComponents(this.props,{})});for(let e in S)a.on(e,this._onPointerEvent);for(let e in C)a.on(e,this._onCameraEvent);for(let e in w)a.on(e,this._onEvent);this._map=a}recycle(){this.map.getContainer().querySelector(`[mapboxgl-children]`)?.remove(),e.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){let e=this._map;!this._inRender&&e.style&&(e._frame&&=(e._frame.cancel(),null),e._render())}_createProxyTransform(e){let t=h(e.transform);e.transform=t,e.painter.transform=t,this._proxyTransform=t}_updateSize(e){let{viewState:t}=e;if(t){let e=this._map;if(t.width!==e.transform.width||t.height!==e.transform.height)return e.resize(),!0}return!1}_updateViewState(e,t){let n=e.viewState||e,r=this._proxyTransform,{zoom:i,pitch:a,bearing:o}=r,s=d(this._proxyTransform,n);if(r.$reactViewState=n,s&&t){let e=this._deferredEvents;e.move=!0,e.zoom||=i!==r.zoom,e.rotate||=o!==r.bearing,e.pitch||=a!==r.pitch}return s}_updateSettings(e,t){let n=this._map,r=!1;for(let i of T)if((i in e||i in t)&&!y(e[i],t[i])){r=!0;let t=i in e?e[i]:x[i];n[`set${i[0].toUpperCase()}${i.slice(1)}`]?.call(n,t)}return r}_updateStyle(e,t){if(e.cursor!==t.cursor&&(this._map.getCanvas().style.cursor=e.cursor||``),e.mapStyle!==t.mapStyle){let{mapStyle:t=b,styleDiffing:n=!0}=e,r={diff:n};return`localIdeographFontFamily`in e&&(r.localIdeographFontFamily=e.localIdeographFontFamily),this._map.setStyle(_(t),r),!0}return!1}_updateStyleComponents(e,t){let n=this._map,r=!1;return n.isStyleLoaded()&&(`light`in e&&n.setLight&&!y(e.light,t.light)&&(r=!0,n.setLight(e.light)),`fog`in e&&n.setFog&&!y(e.fog,t.fog)&&(r=!0,n.setFog(e.fog)),`terrain`in e&&n.setTerrain&&!y(e.terrain,t.terrain)&&(!e.terrain||n.getSource(e.terrain.source))&&(r=!0,n.setTerrain(e.terrain))),r}_updateHandlers(e,t){let n=this._map,r=!1;for(let i of E){let a=e[i]??!0;y(a,t[i]??!0)||(r=!0,a?n[i].enable(a):n[i].disable())}return r}_queryRenderedFeatures(e){let t=this._map,{interactiveLayerIds:n=[]}=this.props;try{return t.queryRenderedFeatures(e,{layers:n.filter(t.getLayer.bind(t))})}catch{return[]}}_updateHover(e){let{props:t}=this;if(t.interactiveLayerIds&&(t.onMouseMove||t.onMouseEnter||t.onMouseLeave)){let t=e.type,n=this._hoveredFeatures?.length>0,r=this._queryRenderedFeatures(e.point),i=r.length>0;!i&&n&&(e.type=`mouseleave`,this._onPointerEvent(e)),this._hoveredFeatures=r,i&&!n&&(e.type=`mouseenter`,this._onPointerEvent(e)),e.type=t}else this._hoveredFeatures=null}_fireEvent(e,t,n){let r=this._map,i=this._proxyTransform,a=i.$internalUpdate;try{i.$internalUpdate=!1,e.call(r,t,n)}finally{i.$internalUpdate=a}return r}_fireDefferedEvents(){let e=this._map;this._internalUpdate=!0;for(let t in this._deferredEvents)this._deferredEvents[t]&&e.fire(t);this._internalUpdate=!1}};D.savedMaps=[];function O(){let e=null;if(typeof location<`u`){let t=/access_token=([^&\/]*)/.exec(location.search);e=t&&t[1]}try{e||={}.MapboxAccessToken}catch{}try{e||={}.REACT_APP_MAPBOX_ACCESS_TOKEN}catch{}return e}var k=[`setMaxBounds`,`setMinZoom`,`setMaxZoom`,`setMinPitch`,`setMaxPitch`,`setRenderWorldCopies`,`setProjection`,`setStyle`,`addSource`,`removeSource`,`addLayer`,`removeLayer`,`setLayerZoomRange`,`setFilter`,`setPaintProperty`,`setLayoutProperty`,`setLight`,`setTerrain`,`setFog`,`remove`];function A(e){if(!e)return null;let t=e.map,n={getMap:()=>t,getCenter:()=>e.transform.center,getZoom:()=>e.transform.zoom,getBearing:()=>e.transform.bearing,getPitch:()=>e.transform.pitch,getPadding:()=>e.transform.padding,getBounds:()=>e.transform.getBounds(),project:n=>{let r=t.transform;t.transform=e.transform;let i=t.project(n);return t.transform=r,i},unproject:n=>{let r=t.transform;t.transform=e.transform;let i=t.unproject(n);return t.transform=r,i},queryTerrainElevation:(n,r)=>{let i=t.transform;t.transform=e.transform;let a=t.queryTerrainElevation(n,r);return t.transform=i,a},queryRenderedFeatures:(n,r)=>{let i=t.transform;t.transform=e.transform;let a=t.queryRenderedFeatures(n,r);return t.transform=i,a}};for(let e of ee(t))!(e in n)&&!k.includes(e)&&(n[e]=t[e].bind(t));return n}function ee(e){let t=new Set,n=e;for(;n;){for(let r of Object.getOwnPropertyNames(n))r[0]!==`_`&&typeof e[r]==`function`&&r!==`fire`&&r!==`setEventedParent`&&t.add(r);n=Object.getPrototypeOf(n)}return Array.from(t)}var te=typeof document<`u`?a.useLayoutEffect:a.useEffect,j=[`baseApiUrl`,`maxParallelImageRequests`,`workerClass`,`workerCount`,`workerUrl`];function M(e,t){for(let n of j)n in t&&(e[n]=t[n]);let{RTLTextPlugin:n=`https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js`}=t;n&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()===`unavailable`&&e.setRTLTextPlugin(n,e=>{e&&console.error(e)},!0)}r();var N=a.createContext(null);function P(t,n){let r=(0,a.useContext)(o),[s,c]=(0,a.useState)(null),l=(0,a.useRef)(),{current:u}=(0,a.useRef)({mapLib:null,map:null});(0,a.useEffect)(()=>{let n=t.mapLib,a=!0,o;return Promise.resolve(n||i(()=>import(`./mapbox-gl-dgf_hX3a.js`).then(t=>e(t.default,1)),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]))).then(e=>{if(!a)return;if(!e)throw Error(`Invalid mapLib`);let n=`Map`in e?e:e.default;if(!n.Map)throw Error(`Invalid mapLib`);M(n,t),t.reuseMaps&&(o=D.reuse(t,l.current)),o||=new D(n.Map,t,l.current),u.map=A(o),u.mapLib=n,c(o),r?.onMapMount(u.map,t.id)}).catch(e=>{let{onError:n}=t;n?n({type:`error`,target:null,error:e}):console.error(e)}),()=>{a=!1,o&&(r?.onMapUnmount(t.id),t.reuseMaps?o.recycle():o.destroy())}},[]),te(()=>{s&&s.setProps(t)}),(0,a.useImperativeHandle)(n,()=>u.map,[s]);let d=(0,a.useMemo)(()=>({position:`relative`,width:`100%`,height:`100%`,...t.style}),[t.style]);return a.createElement(`div`,{id:t.id,ref:l,style:d},s&&a.createElement(N.Provider,{value:u},a.createElement(`div`,{"mapboxgl-children":``,style:{height:`100%`}},t.children)))}var F=a.forwardRef(P),I=n(),L=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function R(e,t){if(!e||!t)return;let n=e.style;for(let e in t){let r=t[e];Number.isFinite(r)&&!L.test(e)?n[e]=`${r}px`:n[e]=r}}function z(e,t){if(e===t)return null;let n=B(e),r=B(t),i=[];for(let e of r)n.has(e)||i.push(e);for(let e of n)r.has(e)||i.push(e);return i.length===0?null:i}function B(e){return new Set(e?e.trim().split(/\s+/):[])}var V=(0,a.memo)((0,a.forwardRef)((e,t)=>{let{map:n,mapLib:r}=(0,a.useContext)(N),i=(0,a.useRef)({props:e}),o=(0,a.useMemo)(()=>{let t=!1;a.Children.forEach(e.children,e=>{e&&(t=!0)});let n={...e,element:t?document.createElement(`div`):null},s=new r.Marker(n);return s.setLngLat([e.longitude,e.latitude]),s.getElement().addEventListener(`click`,e=>{i.current.props.onClick?.({type:`click`,target:s,originalEvent:e})}),s.on(`dragstart`,e=>{let t=e;t.lngLat=o.getLngLat(),i.current.props.onDragStart?.(t)}),s.on(`drag`,e=>{let t=e;t.lngLat=o.getLngLat(),i.current.props.onDrag?.(t)}),s.on(`dragend`,e=>{let t=e;t.lngLat=o.getLngLat(),i.current.props.onDragEnd?.(t)}),s},[]);(0,a.useEffect)(()=>(o.addTo(n.getMap()),()=>{o.remove()}),[]);let{longitude:s,latitude:c,offset:l,style:u,draggable:d=!1,popup:f=null,rotation:p=0,rotationAlignment:m=`auto`,pitchAlignment:h=`auto`}=e;(0,a.useEffect)(()=>{R(o.getElement(),u)},[u]),(0,a.useImperativeHandle)(t,()=>o,[]);let g=i.current.props;(o.getLngLat().lng!==s||o.getLngLat().lat!==c)&&o.setLngLat([s,c]),l&&!v(o.getOffset(),l)&&o.setOffset(l),o.isDraggable()!==d&&o.setDraggable(d),o.getRotation()!==p&&o.setRotation(p),o.getRotationAlignment()!==m&&o.setRotationAlignment(m),o.getPitchAlignment()!==h&&o.setPitchAlignment(h),o.getPopup()!==f&&o.setPopup(f);let _=z(g.className,e.className);if(_)for(let e of _)o.toggleClassName(e);return i.current.props=e,(0,I.createPortal)(e.children,o.getElement())})),H=(0,a.memo)((0,a.forwardRef)((e,t)=>{let{map:n,mapLib:r}=(0,a.useContext)(N),i=(0,a.useMemo)(()=>document.createElement(`div`),[]),o=(0,a.useRef)({props:e}),s=(0,a.useMemo)(()=>{let t={...e},n=new r.Popup(t);return n.setLngLat([e.longitude,e.latitude]),n.once(`open`,e=>{o.current.props.onOpen?.(e)}),n},[]);if((0,a.useEffect)(()=>{let e=e=>{o.current.props.onClose?.(e)};return s.on(`close`,e),s.setDOMContent(i).addTo(n.getMap()),()=>{s.off(`close`,e),s.isOpen()&&s.remove()}},[]),(0,a.useEffect)(()=>{R(s.getElement(),e.style)},[e.style]),(0,a.useImperativeHandle)(t,()=>s,[]),s.isOpen()){let t=o.current.props;(s.getLngLat().lng!==e.longitude||s.getLngLat().lat!==e.latitude)&&s.setLngLat([e.longitude,e.latitude]),e.offset&&!y(t.offset,e.offset)&&(s.options.anchor=e.anchor,s.setOffset(e.offset)),(t.anchor!==e.anchor||t.maxWidth!==e.maxWidth)&&s.setMaxWidth(e.maxWidth);let n=z(t.className,e.className);if(n)for(let e of n)s.toggleClassName(e);o.current.props=e}return(0,I.createPortal)(e.children,i)}));function U(e,t,n,r){let i=(0,a.useContext)(N),o=(0,a.useMemo)(()=>e(i),[]);return(0,a.useEffect)(()=>{let e=r||n||t,a=typeof t==`function`&&typeof n==`function`?t:null,s=typeof n==`function`?n:typeof t==`function`?t:null,{map:c}=i;return c.hasControl(o)||(c.addControl(o,e?.position),a&&a(i)),()=>{s&&s(i),c.hasControl(o)&&c.removeControl(o)}},[]),o}function W(e){let t=U(({mapLib:t})=>new t.AttributionControl(e),{position:e.position});return(0,a.useEffect)(()=>{R(t._container,e.style)},[e.style]),null}var G=(0,a.memo)(W);function K(e){let t=U(({mapLib:t})=>new t.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return(0,a.useEffect)(()=>{R(t._controlContainer,e.style)},[e.style]),null}var q=(0,a.memo)(K);function J(e,t){let n=(0,a.useRef)({props:e}),r=U(({mapLib:t})=>{let r=new t.GeolocateControl(e),i=r._setupUI.bind(r);return r._setupUI=e=>{r._container.hasChildNodes()||i(e)},r.on(`geolocate`,e=>{n.current.props.onGeolocate?.(e)}),r.on(`error`,e=>{n.current.props.onError?.(e)}),r.on(`outofmaxbounds`,e=>{n.current.props.onOutOfMaxBounds?.(e)}),r.on(`trackuserlocationstart`,e=>{n.current.props.onTrackUserLocationStart?.(e)}),r.on(`trackuserlocationend`,e=>{n.current.props.onTrackUserLocationEnd?.(e)}),r},{position:e.position});return n.current.props=e,(0,a.useImperativeHandle)(t,()=>r,[]),(0,a.useEffect)(()=>{R(r._container,e.style)},[e.style]),null}var Y=(0,a.memo)((0,a.forwardRef)(J));function X(e){let t=U(({mapLib:t})=>new t.NavigationControl(e),{position:e.position});return(0,a.useEffect)(()=>{R(t._container,e.style)},[e.style]),null}var Z=(0,a.memo)(X);function ne(e){let t=U(({mapLib:t})=>new t.ScaleControl(e),{position:e.position}),n=(0,a.useRef)(e),r=n.current;n.current=e;let{style:i}=e;return e.maxWidth!==void 0&&e.maxWidth!==r.maxWidth&&(t.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==r.unit&&t.setUnit(e.unit),(0,a.useEffect)(()=>{R(t._container,i)},[i]),null}var re=(0,a.memo)(ne);function Q(e,t){if(!e)throw Error(t)}var ie=0;function ae(e,t,n){if(e.style&&e.style._loaded){let r={...n};return delete r.id,delete r.children,e.addSource(t,r),e.getSource(t)}return null}function oe(e,t,n){Q(t.id===n.id,`source id changed`),Q(t.type===n.type,`source type changed`);let r=``,i=0;for(let e in t)e!==`children`&&e!==`id`&&!y(n[e],t[e])&&(r=e,i++);if(!i)return;let a=t.type;a===`geojson`?e.setData(t.data):a===`image`?e.updateImage({url:t.url,coordinates:t.coordinates}):`setCoordinates`in e&&i===1&&r===`coordinates`?e.setCoordinates(t.coordinates):`setUrl`in e&&r===`url`?e.setUrl(t.url):`setTiles`in e&&r===`tiles`?e.setTiles(t.tiles):console.warn(`Unable to update <Source> prop: ${r}`)}function se(e){let t=(0,a.useContext)(N).map.getMap(),n=(0,a.useRef)(e),[,r]=(0,a.useState)(0),i=(0,a.useMemo)(()=>e.id||`jsx-source-${ie++}`,[]);(0,a.useEffect)(()=>{if(t){let e=()=>setTimeout(()=>r(e=>e+1),0);return t.on(`styledata`,e),e(),()=>{if(t.off(`styledata`,e),t.style&&t.style._loaded&&t.getSource(i)){let e=t.getStyle()?.layers;if(e)for(let n of e)n.source===i&&t.removeLayer(n.id);t.removeSource(i)}}}},[t]);let o=t&&t.style&&t.getSource(i);return o?oe(o,e,n.current):o=ae(t,i,e),n.current=e,o&&a.Children.map(e.children,e=>e&&(0,a.cloneElement)(e,{source:i}))||null}function ce(e,t,n,r){if(Q(n.id===r.id,`layer id changed`),Q(n.type===r.type,`layer type changed`),n.type===`custom`||r.type===`custom`)return;let{layout:i={},paint:a={},filter:o,minzoom:s,maxzoom:c,beforeId:l}=n;if(l!==r.beforeId&&e.moveLayer(t,l),i!==r.layout){let n=r.layout||{};for(let r in i)y(i[r],n[r])||e.setLayoutProperty(t,r,i[r]);for(let r in n)i.hasOwnProperty(r)||e.setLayoutProperty(t,r,void 0)}if(a!==r.paint){let n=r.paint||{};for(let r in a)y(a[r],n[r])||e.setPaintProperty(t,r,a[r]);for(let r in n)a.hasOwnProperty(r)||e.setPaintProperty(t,r,void 0)}y(o,r.filter)||e.setFilter(t,o),(s!==r.minzoom||c!==r.maxzoom)&&e.setLayerZoomRange(t,s,c)}function le(e,t,n){if(e.style&&e.style._loaded&&(!(`source`in n)||e.getSource(n.source))){let r={...n,id:t};delete r.beforeId,e.addLayer(r,n.beforeId)}}var $=0;function ue(e){let t=(0,a.useContext)(N).map.getMap(),n=(0,a.useRef)(e),[,r]=(0,a.useState)(0),i=(0,a.useMemo)(()=>e.id||`jsx-layer-${$++}`,[]);if((0,a.useEffect)(()=>{if(t){let e=()=>r(e=>e+1);return t.on(`styledata`,e),e(),()=>{t.off(`styledata`,e),t.style&&t.style._loaded&&t.getLayer(i)&&t.removeLayer(i)}}},[t]),t&&t.style&&t.getLayer(i))try{ce(t,i,e,n.current)}catch(e){console.warn(e)}else le(t,i,e);return n.current=e,null}export{G as AttributionControl,q as FullscreenControl,Y as GeolocateControl,ue as Layer,F as Map,F as default,s as MapProvider,V as Marker,Z as NavigationControl,H as Popup,re as ScaleControl,se as Source,U as useControl,c as useMap};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mapbox-gl-DYNcLcll.js","assets/chunk-C0phanGV.js","assets/index-DZVisyna.js","assets/query-client-fYu2rzRC.js","assets/schemas-I9r6F6ya.js","assets/react-nBylq1U5.js","assets/createLucideIcon-JV8isFFR.js","assets/circle-check-C_Vq3ElD.js","assets/client-stream-contracts-sR4xMQxY.js","assets/AvatarChip-DLoqM5xD.js","assets/ProfilePreview-DQX6_xc3.js","assets/SmartTimestamp-BR0-9se2.js","assets/sparkles-CQVlvHsZ.js","assets/react-dom-DHl6Ug7F.js","assets/profile-hydration-client-YEtJsNTv.js","assets/index-bpFrQ5yG.css"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./chunk-C0phanGV.js";import{t}from"./react-nBylq1U5.js";import{t as n}from"./react-dom-DHl6Ug7F.js";import{X as r,Y as i}from"./index-DZVisyna.js";var a=e(t(),1),o=a.createContext(null),s=e=>{let[t,n]=(0,a.useState)({}),r=(0,a.useCallback)((e,t=`default`)=>{n(n=>{if(t===`current`)throw Error(`'current' cannot be used as map id`);if(n[t])throw Error(`Multiple maps with the same id: ${t}`);return{...n,[t]:e}})},[]),i=(0,a.useCallback)((e=`default`)=>{n(t=>{if(t[e]){let n={...t};return delete n[e],n}return t})},[]);return a.createElement(o.Provider,{value:{maps:t,onMapMount:r,onMapUnmount:i}},e.children)};function c(){let e=(0,a.useContext)(o)?.maps,t=(0,a.useContext)(N);return(0,a.useMemo)(()=>({...e,current:t?.map}),[e,t])}function l(e){return{longitude:e.center.lng,latitude:e.center.lat,zoom:e._seaLevelZoom??e.zoom,pitch:e.pitch,bearing:e.bearing,padding:e.padding,elevation:e._centerAltitude}}function u(e){return Number.isFinite(e.longitude)||Number.isFinite(e.latitude)||Number.isFinite(e.zoom)||Number.isFinite(e.pitch)||Number.isFinite(e.bearing)}function d(e,t){return!!(Number.isFinite(t.longitude)&&e.center.lng!==t.longitude||Number.isFinite(t.latitude)&&e.center.lat!==t.latitude||Number.isFinite(t.bearing)&&e.bearing!==t.bearing||Number.isFinite(t.pitch)&&e.pitch!==t.pitch||Number.isFinite(t.zoom)&&(e._seaLevelZoom??e.zoom)!==t.zoom||t.padding&&!e.isPaddingEqual(t.padding))}function f(){}function p(e,t){let n=e._constrain,r=e._calcMatrices;if(e._constrain=f,e._calcMatrices=f,Number.isFinite(t.bearing)&&(e.bearing=t.bearing),Number.isFinite(t.pitch)&&(e.pitch=t.pitch),t.padding&&!e.isPaddingEqual(t.padding)&&(e.padding=t.padding),Number.isFinite(t.longitude)||Number.isFinite(t.latitude)){let n=e.center;e._center=new n.constructor(t.longitude??n.lng,t.latitude??n.lat)}if(Number.isFinite(t.zoom))if(e._centerAltitude=t.elevation??0,e.elevation){e._seaLevelZoom=t.zoom;let n=e.pixelsPerMeter/e.worldSize*e._centerAltitude,r=e._mercatorZfromZoom(t.zoom),i=e._mercatorZfromZoom(e._maxZoom),a=Math.max(r-n,i);e._setZoom(e._zoomFromMercatorZ(a))}else e._seaLevelZoom=null,e.zoom=t.zoom;e._constrain=n,e._calcMatrices=r,e._unmodified||(e._constrain(),e._calcMatrices())}var m=new Set([`_calcMatrices`,`_calcFogMatrices`,`_updateCameraState`,`_updateSeaLevelZoom`]);function h(e){let t=!1,n={},r=e,i=null;return new Proxy(e,{get(e,a){return a===`$reactViewState`?n:a===`$proposedTransform`?i:a===`$internalUpdate`?t:a===`_setZoom`?e=>{t&&i?.[a](e),Number.isFinite(n.zoom)||r[a](e)}:(t&&a===`_translateCameraConstrained`&&u(n)&&(i||=r.clone()),m.has(a)?function(...e){i?.[a](...e),r[a](...e)}:t&&i?i[a]:r[a])},set(e,a,o){if(a===`$reactViewState`)return n=o,p(r,n),!0;if(a===`$proposedTransform`)return i=o,!0;if(a===`$internalUpdate`)return t=o,!0;let s=o;return a===`center`||a===`_center`?(Number.isFinite(n.longitude)||Number.isFinite(n.latitude))&&(s=new o.constructor(n.longitude??o.lng,n.latitude??o.lat)):a===`zoom`||a===`_zoom`||a===`_seaLevelZoom`?Number.isFinite(n.zoom)&&(s=r[a]):a===`_centerAltitude`?Number.isFinite(n.elevation)&&(s=r[a]):a===`pitch`||a===`_pitch`?Number.isFinite(n.pitch)&&(s=r[a]):(a===`bearing`||a===`rotation`||a===`angle`)&&Number.isFinite(n.bearing)&&(s=r[a]),t&&s!==o&&(i||=r.clone()),t&&i&&(i[a]=o),r[a]=s,!0}})}var g=[`type`,`source`,`source-layer`,`minzoom`,`maxzoom`,`filter`,`layout`];function _(e){if(!e)return null;if(typeof e==`string`||(`toJS`in e&&(e=e.toJS()),!e.layers))return e;let t={};for(let n of e.layers)t[n.id]=n;let n=e.layers.map(e=>{let n=null;`interactive`in e&&(n=Object.assign({},e),delete n.interactive);let r=t[e.ref];if(r){n||=Object.assign({},e),delete n.ref;for(let e of g)e in r&&(n[e]=r[e])}return n||e});return{...e,layers:n}}function v(e,t){let n=Array.isArray(e)?e[0]:e?e.x:0,r=Array.isArray(e)?e[1]:e?e.y:0,i=Array.isArray(t)?t[0]:t?t.x:0,a=Array.isArray(t)?t[1]:t?t.y:0;return n===i&&r===a}function y(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!y(e[n],t[n]))return!1;return!0}else if(Array.isArray(t))return!1;if(typeof e==`object`&&typeof t==`object`){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!t.hasOwnProperty(r)||!y(e[r],t[r]))return!1;return!0}return!1}var b={version:8,sources:{},layers:[]},x={minZoom:0,maxZoom:22,minPitch:0,maxPitch:85,maxBounds:[-180,-85.051129,180,85.051129],projection:`mercator`,renderWorldCopies:!0},S={mousedown:`onMouseDown`,mouseup:`onMouseUp`,mouseover:`onMouseOver`,mousemove:`onMouseMove`,click:`onClick`,dblclick:`onDblClick`,mouseenter:`onMouseEnter`,mouseleave:`onMouseLeave`,mouseout:`onMouseOut`,contextmenu:`onContextMenu`,touchstart:`onTouchStart`,touchend:`onTouchEnd`,touchmove:`onTouchMove`,touchcancel:`onTouchCancel`},C={movestart:`onMoveStart`,move:`onMove`,moveend:`onMoveEnd`,dragstart:`onDragStart`,drag:`onDrag`,dragend:`onDragEnd`,zoomstart:`onZoomStart`,zoom:`onZoom`,zoomend:`onZoomEnd`,rotatestart:`onRotateStart`,rotate:`onRotate`,rotateend:`onRotateEnd`,pitchstart:`onPitchStart`,pitch:`onPitch`,pitchend:`onPitchEnd`},w={wheel:`onWheel`,boxzoomstart:`onBoxZoomStart`,boxzoomend:`onBoxZoomEnd`,boxzoomcancel:`onBoxZoomCancel`,resize:`onResize`,load:`onLoad`,render:`onRender`,idle:`onIdle`,remove:`onRemove`,data:`onData`,styledata:`onStyleData`,sourcedata:`onSourceData`,error:`onError`},T=[`minZoom`,`maxZoom`,`minPitch`,`maxPitch`,`maxBounds`,`projection`,`renderWorldCopies`],E=[`scrollZoom`,`boxZoom`,`dragRotate`,`dragPan`,`keyboard`,`doubleClickZoom`,`touchZoomRotate`,`touchPitch`],D=class e{constructor(e,t,n){this._map=null,this._internalUpdate=!1,this._inRender=!1,this._hoveredFeatures=null,this._deferredEvents={move:!1,zoom:!1,pitch:!1,rotate:!1},this._onEvent=e=>{let t=this.props[w[e.type]];t?t(e):e.type===`error`&&console.error(e.error)},this._onPointerEvent=e=>{(e.type===`mousemove`||e.type===`mouseout`)&&this._updateHover(e);let t=this.props[S[e.type]];t&&(this.props.interactiveLayerIds&&e.type!==`mouseover`&&e.type!==`mouseout`&&(e.features=this._hoveredFeatures||this._queryRenderedFeatures(e.point)),t(e),delete e.features)},this._onCameraEvent=e=>{if(!this._internalUpdate){let t=this.props[C[e.type]],n=this._proxyTransform;t&&(e.viewState=l(n.$proposedTransform??n),t(e)),e.type===`moveend`&&(n.$proposedTransform=null)}e.type in this._deferredEvents&&(this._deferredEvents[e.type]=!1)},this._MapClass=e,this.props=t,this._initialize(n)}get map(){return this._map}get transform(){return this._map.transform}setProps(e){let t=this.props;this.props=e;let n=this._updateSettings(e,t),r=this._updateSize(e),i=this._updateViewState(e,!0);this._updateStyle(e,t),this._updateStyleComponents(e,t),this._updateHandlers(e,t),(n||r||i&&!this._map.isMoving())&&this.redraw()}static reuse(t,n){let r=e.savedMaps.pop();if(!r)return null;let i=r.map,a=i.getContainer();for(n.className=a.className;a.childNodes.length>0;)n.appendChild(a.childNodes[0]);i._container=n,r.setProps({...t,styleDiffing:!1}),i.resize();let{initialViewState:o}=t;return o&&(o.bounds?i.fitBounds(o.bounds,{...o.fitBoundsOptions,duration:0}):r._updateViewState(o,!1)),i.isStyleLoaded()?i.fire(`load`):i.once(`styledata`,()=>i.fire(`load`)),i._update(),r}_initialize(e){let{props:t}=this,{mapStyle:n=b}=t,r={...t,...t.initialViewState,accessToken:t.mapboxAccessToken||O()||null,container:e,style:_(n)},i=r.initialViewState||r.viewState||r;if(Object.assign(r,{center:[i.longitude||0,i.latitude||0],zoom:i.zoom||0,pitch:i.pitch||0,bearing:i.bearing||0}),t.gl){let e=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=e,t.gl)}let a=new this._MapClass(r);i.padding&&a.setPadding(i.padding),t.cursor&&(a.getCanvas().style.cursor=t.cursor),this._createProxyTransform(a);let o=a._render;a._render=e=>{this._inRender=!0,o.call(a,e),this._inRender=!1};let s=a._renderTaskQueue.run;a._renderTaskQueue.run=e=>{this._proxyTransform.$internalUpdate=!0,s.call(a._renderTaskQueue,e),this._proxyTransform.$internalUpdate=!1,this._fireDefferedEvents()};let c=a.jumpTo;a.jumpTo=(...e)=>(this._proxyTransform.$internalUpdate=!0,c.apply(a,e),this._proxyTransform.$internalUpdate=!1,a);let l=a.fire;a.fire=this._fireEvent.bind(this,l),a.on(`styledata`,()=>{this._updateStyleComponents(this.props,{})}),a.on(`sourcedata`,()=>{this._updateStyleComponents(this.props,{})});for(let e in S)a.on(e,this._onPointerEvent);for(let e in C)a.on(e,this._onCameraEvent);for(let e in w)a.on(e,this._onEvent);this._map=a}recycle(){this.map.getContainer().querySelector(`[mapboxgl-children]`)?.remove(),e.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){let e=this._map;!this._inRender&&e.style&&(e._frame&&=(e._frame.cancel(),null),e._render())}_createProxyTransform(e){let t=h(e.transform);e.transform=t,e.painter.transform=t,this._proxyTransform=t}_updateSize(e){let{viewState:t}=e;if(t){let e=this._map;if(t.width!==e.transform.width||t.height!==e.transform.height)return e.resize(),!0}return!1}_updateViewState(e,t){let n=e.viewState||e,r=this._proxyTransform,{zoom:i,pitch:a,bearing:o}=r,s=d(this._proxyTransform,n);if(r.$reactViewState=n,s&&t){let e=this._deferredEvents;e.move=!0,e.zoom||=i!==r.zoom,e.rotate||=o!==r.bearing,e.pitch||=a!==r.pitch}return s}_updateSettings(e,t){let n=this._map,r=!1;for(let i of T)if((i in e||i in t)&&!y(e[i],t[i])){r=!0;let t=i in e?e[i]:x[i];n[`set${i[0].toUpperCase()}${i.slice(1)}`]?.call(n,t)}return r}_updateStyle(e,t){if(e.cursor!==t.cursor&&(this._map.getCanvas().style.cursor=e.cursor||``),e.mapStyle!==t.mapStyle){let{mapStyle:t=b,styleDiffing:n=!0}=e,r={diff:n};return`localIdeographFontFamily`in e&&(r.localIdeographFontFamily=e.localIdeographFontFamily),this._map.setStyle(_(t),r),!0}return!1}_updateStyleComponents(e,t){let n=this._map,r=!1;return n.isStyleLoaded()&&(`light`in e&&n.setLight&&!y(e.light,t.light)&&(r=!0,n.setLight(e.light)),`fog`in e&&n.setFog&&!y(e.fog,t.fog)&&(r=!0,n.setFog(e.fog)),`terrain`in e&&n.setTerrain&&!y(e.terrain,t.terrain)&&(!e.terrain||n.getSource(e.terrain.source))&&(r=!0,n.setTerrain(e.terrain))),r}_updateHandlers(e,t){let n=this._map,r=!1;for(let i of E){let a=e[i]??!0;y(a,t[i]??!0)||(r=!0,a?n[i].enable(a):n[i].disable())}return r}_queryRenderedFeatures(e){let t=this._map,{interactiveLayerIds:n=[]}=this.props;try{return t.queryRenderedFeatures(e,{layers:n.filter(t.getLayer.bind(t))})}catch{return[]}}_updateHover(e){let{props:t}=this;if(t.interactiveLayerIds&&(t.onMouseMove||t.onMouseEnter||t.onMouseLeave)){let t=e.type,n=this._hoveredFeatures?.length>0,r=this._queryRenderedFeatures(e.point),i=r.length>0;!i&&n&&(e.type=`mouseleave`,this._onPointerEvent(e)),this._hoveredFeatures=r,i&&!n&&(e.type=`mouseenter`,this._onPointerEvent(e)),e.type=t}else this._hoveredFeatures=null}_fireEvent(e,t,n){let r=this._map,i=this._proxyTransform,a=i.$internalUpdate;try{i.$internalUpdate=!1,e.call(r,t,n)}finally{i.$internalUpdate=a}return r}_fireDefferedEvents(){let e=this._map;this._internalUpdate=!0;for(let t in this._deferredEvents)this._deferredEvents[t]&&e.fire(t);this._internalUpdate=!1}};D.savedMaps=[];function O(){let e=null;if(typeof location<`u`){let t=/access_token=([^&\/]*)/.exec(location.search);e=t&&t[1]}try{e||={}.MapboxAccessToken}catch{}try{e||={}.REACT_APP_MAPBOX_ACCESS_TOKEN}catch{}return e}var k=[`setMaxBounds`,`setMinZoom`,`setMaxZoom`,`setMinPitch`,`setMaxPitch`,`setRenderWorldCopies`,`setProjection`,`setStyle`,`addSource`,`removeSource`,`addLayer`,`removeLayer`,`setLayerZoomRange`,`setFilter`,`setPaintProperty`,`setLayoutProperty`,`setLight`,`setTerrain`,`setFog`,`remove`];function A(e){if(!e)return null;let t=e.map,n={getMap:()=>t,getCenter:()=>e.transform.center,getZoom:()=>e.transform.zoom,getBearing:()=>e.transform.bearing,getPitch:()=>e.transform.pitch,getPadding:()=>e.transform.padding,getBounds:()=>e.transform.getBounds(),project:n=>{let r=t.transform;t.transform=e.transform;let i=t.project(n);return t.transform=r,i},unproject:n=>{let r=t.transform;t.transform=e.transform;let i=t.unproject(n);return t.transform=r,i},queryTerrainElevation:(n,r)=>{let i=t.transform;t.transform=e.transform;let a=t.queryTerrainElevation(n,r);return t.transform=i,a},queryRenderedFeatures:(n,r)=>{let i=t.transform;t.transform=e.transform;let a=t.queryRenderedFeatures(n,r);return t.transform=i,a}};for(let e of ee(t))!(e in n)&&!k.includes(e)&&(n[e]=t[e].bind(t));return n}function ee(e){let t=new Set,n=e;for(;n;){for(let r of Object.getOwnPropertyNames(n))r[0]!==`_`&&typeof e[r]==`function`&&r!==`fire`&&r!==`setEventedParent`&&t.add(r);n=Object.getPrototypeOf(n)}return Array.from(t)}var te=typeof document<`u`?a.useLayoutEffect:a.useEffect,j=[`baseApiUrl`,`maxParallelImageRequests`,`workerClass`,`workerCount`,`workerUrl`];function M(e,t){for(let n of j)n in t&&(e[n]=t[n]);let{RTLTextPlugin:n=`https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js`}=t;n&&e.getRTLTextPluginStatus&&e.getRTLTextPluginStatus()===`unavailable`&&e.setRTLTextPlugin(n,e=>{e&&console.error(e)},!0)}r();var N=a.createContext(null);function P(t,n){let r=(0,a.useContext)(o),[s,c]=(0,a.useState)(null),l=(0,a.useRef)(),{current:u}=(0,a.useRef)({mapLib:null,map:null});(0,a.useEffect)(()=>{let n=t.mapLib,a=!0,o;return Promise.resolve(n||i(()=>import(`./mapbox-gl-DYNcLcll.js`).then(t=>e(t.default,1)),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]))).then(e=>{if(!a)return;if(!e)throw Error(`Invalid mapLib`);let n=`Map`in e?e:e.default;if(!n.Map)throw Error(`Invalid mapLib`);M(n,t),t.reuseMaps&&(o=D.reuse(t,l.current)),o||=new D(n.Map,t,l.current),u.map=A(o),u.mapLib=n,c(o),r?.onMapMount(u.map,t.id)}).catch(e=>{let{onError:n}=t;n?n({type:`error`,target:null,error:e}):console.error(e)}),()=>{a=!1,o&&(r?.onMapUnmount(t.id),t.reuseMaps?o.recycle():o.destroy())}},[]),te(()=>{s&&s.setProps(t)}),(0,a.useImperativeHandle)(n,()=>u.map,[s]);let d=(0,a.useMemo)(()=>({position:`relative`,width:`100%`,height:`100%`,...t.style}),[t.style]);return a.createElement(`div`,{id:t.id,ref:l,style:d},s&&a.createElement(N.Provider,{value:u},a.createElement(`div`,{"mapboxgl-children":``,style:{height:`100%`}},t.children)))}var F=a.forwardRef(P),I=n(),L=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function R(e,t){if(!e||!t)return;let n=e.style;for(let e in t){let r=t[e];Number.isFinite(r)&&!L.test(e)?n[e]=`${r}px`:n[e]=r}}function z(e,t){if(e===t)return null;let n=B(e),r=B(t),i=[];for(let e of r)n.has(e)||i.push(e);for(let e of n)r.has(e)||i.push(e);return i.length===0?null:i}function B(e){return new Set(e?e.trim().split(/\s+/):[])}var V=(0,a.memo)((0,a.forwardRef)((e,t)=>{let{map:n,mapLib:r}=(0,a.useContext)(N),i=(0,a.useRef)({props:e}),o=(0,a.useMemo)(()=>{let t=!1;a.Children.forEach(e.children,e=>{e&&(t=!0)});let n={...e,element:t?document.createElement(`div`):null},s=new r.Marker(n);return s.setLngLat([e.longitude,e.latitude]),s.getElement().addEventListener(`click`,e=>{i.current.props.onClick?.({type:`click`,target:s,originalEvent:e})}),s.on(`dragstart`,e=>{let t=e;t.lngLat=o.getLngLat(),i.current.props.onDragStart?.(t)}),s.on(`drag`,e=>{let t=e;t.lngLat=o.getLngLat(),i.current.props.onDrag?.(t)}),s.on(`dragend`,e=>{let t=e;t.lngLat=o.getLngLat(),i.current.props.onDragEnd?.(t)}),s},[]);(0,a.useEffect)(()=>(o.addTo(n.getMap()),()=>{o.remove()}),[]);let{longitude:s,latitude:c,offset:l,style:u,draggable:d=!1,popup:f=null,rotation:p=0,rotationAlignment:m=`auto`,pitchAlignment:h=`auto`}=e;(0,a.useEffect)(()=>{R(o.getElement(),u)},[u]),(0,a.useImperativeHandle)(t,()=>o,[]);let g=i.current.props;(o.getLngLat().lng!==s||o.getLngLat().lat!==c)&&o.setLngLat([s,c]),l&&!v(o.getOffset(),l)&&o.setOffset(l),o.isDraggable()!==d&&o.setDraggable(d),o.getRotation()!==p&&o.setRotation(p),o.getRotationAlignment()!==m&&o.setRotationAlignment(m),o.getPitchAlignment()!==h&&o.setPitchAlignment(h),o.getPopup()!==f&&o.setPopup(f);let _=z(g.className,e.className);if(_)for(let e of _)o.toggleClassName(e);return i.current.props=e,(0,I.createPortal)(e.children,o.getElement())})),H=(0,a.memo)((0,a.forwardRef)((e,t)=>{let{map:n,mapLib:r}=(0,a.useContext)(N),i=(0,a.useMemo)(()=>document.createElement(`div`),[]),o=(0,a.useRef)({props:e}),s=(0,a.useMemo)(()=>{let t={...e},n=new r.Popup(t);return n.setLngLat([e.longitude,e.latitude]),n.once(`open`,e=>{o.current.props.onOpen?.(e)}),n},[]);if((0,a.useEffect)(()=>{let e=e=>{o.current.props.onClose?.(e)};return s.on(`close`,e),s.setDOMContent(i).addTo(n.getMap()),()=>{s.off(`close`,e),s.isOpen()&&s.remove()}},[]),(0,a.useEffect)(()=>{R(s.getElement(),e.style)},[e.style]),(0,a.useImperativeHandle)(t,()=>s,[]),s.isOpen()){let t=o.current.props;(s.getLngLat().lng!==e.longitude||s.getLngLat().lat!==e.latitude)&&s.setLngLat([e.longitude,e.latitude]),e.offset&&!y(t.offset,e.offset)&&(s.options.anchor=e.anchor,s.setOffset(e.offset)),(t.anchor!==e.anchor||t.maxWidth!==e.maxWidth)&&s.setMaxWidth(e.maxWidth);let n=z(t.className,e.className);if(n)for(let e of n)s.toggleClassName(e);o.current.props=e}return(0,I.createPortal)(e.children,i)}));function U(e,t,n,r){let i=(0,a.useContext)(N),o=(0,a.useMemo)(()=>e(i),[]);return(0,a.useEffect)(()=>{let e=r||n||t,a=typeof t==`function`&&typeof n==`function`?t:null,s=typeof n==`function`?n:typeof t==`function`?t:null,{map:c}=i;return c.hasControl(o)||(c.addControl(o,e?.position),a&&a(i)),()=>{s&&s(i),c.hasControl(o)&&c.removeControl(o)}},[]),o}function W(e){let t=U(({mapLib:t})=>new t.AttributionControl(e),{position:e.position});return(0,a.useEffect)(()=>{R(t._container,e.style)},[e.style]),null}var G=(0,a.memo)(W);function K(e){let t=U(({mapLib:t})=>new t.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return(0,a.useEffect)(()=>{R(t._controlContainer,e.style)},[e.style]),null}var q=(0,a.memo)(K);function J(e,t){let n=(0,a.useRef)({props:e}),r=U(({mapLib:t})=>{let r=new t.GeolocateControl(e),i=r._setupUI.bind(r);return r._setupUI=e=>{r._container.hasChildNodes()||i(e)},r.on(`geolocate`,e=>{n.current.props.onGeolocate?.(e)}),r.on(`error`,e=>{n.current.props.onError?.(e)}),r.on(`outofmaxbounds`,e=>{n.current.props.onOutOfMaxBounds?.(e)}),r.on(`trackuserlocationstart`,e=>{n.current.props.onTrackUserLocationStart?.(e)}),r.on(`trackuserlocationend`,e=>{n.current.props.onTrackUserLocationEnd?.(e)}),r},{position:e.position});return n.current.props=e,(0,a.useImperativeHandle)(t,()=>r,[]),(0,a.useEffect)(()=>{R(r._container,e.style)},[e.style]),null}var Y=(0,a.memo)((0,a.forwardRef)(J));function X(e){let t=U(({mapLib:t})=>new t.NavigationControl(e),{position:e.position});return(0,a.useEffect)(()=>{R(t._container,e.style)},[e.style]),null}var Z=(0,a.memo)(X);function ne(e){let t=U(({mapLib:t})=>new t.ScaleControl(e),{position:e.position}),n=(0,a.useRef)(e),r=n.current;n.current=e;let{style:i}=e;return e.maxWidth!==void 0&&e.maxWidth!==r.maxWidth&&(t.options.maxWidth=e.maxWidth),e.unit!==void 0&&e.unit!==r.unit&&t.setUnit(e.unit),(0,a.useEffect)(()=>{R(t._container,i)},[i]),null}var re=(0,a.memo)(ne);function Q(e,t){if(!e)throw Error(t)}var ie=0;function ae(e,t,n){if(e.style&&e.style._loaded){let r={...n};return delete r.id,delete r.children,e.addSource(t,r),e.getSource(t)}return null}function oe(e,t,n){Q(t.id===n.id,`source id changed`),Q(t.type===n.type,`source type changed`);let r=``,i=0;for(let e in t)e!==`children`&&e!==`id`&&!y(n[e],t[e])&&(r=e,i++);if(!i)return;let a=t.type;a===`geojson`?e.setData(t.data):a===`image`?e.updateImage({url:t.url,coordinates:t.coordinates}):`setCoordinates`in e&&i===1&&r===`coordinates`?e.setCoordinates(t.coordinates):`setUrl`in e&&r===`url`?e.setUrl(t.url):`setTiles`in e&&r===`tiles`?e.setTiles(t.tiles):console.warn(`Unable to update <Source> prop: ${r}`)}function se(e){let t=(0,a.useContext)(N).map.getMap(),n=(0,a.useRef)(e),[,r]=(0,a.useState)(0),i=(0,a.useMemo)(()=>e.id||`jsx-source-${ie++}`,[]);(0,a.useEffect)(()=>{if(t){let e=()=>setTimeout(()=>r(e=>e+1),0);return t.on(`styledata`,e),e(),()=>{if(t.off(`styledata`,e),t.style&&t.style._loaded&&t.getSource(i)){let e=t.getStyle()?.layers;if(e)for(let n of e)n.source===i&&t.removeLayer(n.id);t.removeSource(i)}}}},[t]);let o=t&&t.style&&t.getSource(i);return o?oe(o,e,n.current):o=ae(t,i,e),n.current=e,o&&a.Children.map(e.children,e=>e&&(0,a.cloneElement)(e,{source:i}))||null}function ce(e,t,n,r){if(Q(n.id===r.id,`layer id changed`),Q(n.type===r.type,`layer type changed`),n.type===`custom`||r.type===`custom`)return;let{layout:i={},paint:a={},filter:o,minzoom:s,maxzoom:c,beforeId:l}=n;if(l!==r.beforeId&&e.moveLayer(t,l),i!==r.layout){let n=r.layout||{};for(let r in i)y(i[r],n[r])||e.setLayoutProperty(t,r,i[r]);for(let r in n)i.hasOwnProperty(r)||e.setLayoutProperty(t,r,void 0)}if(a!==r.paint){let n=r.paint||{};for(let r in a)y(a[r],n[r])||e.setPaintProperty(t,r,a[r]);for(let r in n)a.hasOwnProperty(r)||e.setPaintProperty(t,r,void 0)}y(o,r.filter)||e.setFilter(t,o),(s!==r.minzoom||c!==r.maxzoom)&&e.setLayerZoomRange(t,s,c)}function le(e,t,n){if(e.style&&e.style._loaded&&(!(`source`in n)||e.getSource(n.source))){let r={...n,id:t};delete r.beforeId,e.addLayer(r,n.beforeId)}}var $=0;function ue(e){let t=(0,a.useContext)(N).map.getMap(),n=(0,a.useRef)(e),[,r]=(0,a.useState)(0),i=(0,a.useMemo)(()=>e.id||`jsx-layer-${$++}`,[]);if((0,a.useEffect)(()=>{if(t){let e=()=>r(e=>e+1);return t.on(`styledata`,e),e(),()=>{t.off(`styledata`,e),t.style&&t.style._loaded&&t.getLayer(i)&&t.removeLayer(i)}}},[t]),t&&t.style&&t.getLayer(i))try{ce(t,i,e,n.current)}catch(e){console.warn(e)}else le(t,i,e);return n.current=e,null}export{G as AttributionControl,q as FullscreenControl,Y as GeolocateControl,ue as Layer,F as Map,F as default,s as MapProvider,V as Marker,Z as NavigationControl,H as Popup,re as ScaleControl,se as Source,U as useControl,c as useMap};