ghost 6.17.1 → 6.17.2

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 (102) hide show
  1. package/components/tryghost-i18n-6.17.2.tgz +0 -0
  2. package/components/{tryghost-parse-email-address-6.17.1.tgz → tryghost-parse-email-address-6.17.2.tgz} +0 -0
  3. package/content/themes/source/package.json +1 -1
  4. package/core/built/admin/assets/{PolarAngleAxis-DVj7Sw2n.js → PolarAngleAxis-B8JrAxf_.js} +1 -1
  5. package/core/built/admin/assets/{_baseAssignValue-CrCkbXur.js → _baseAssignValue-Bbalamaq.js} +1 -1
  6. package/core/built/admin/assets/{a-large-small-BLquRSNr.js → a-large-small-CgWPeKpi.js} +1 -1
  7. package/core/built/admin/assets/{at-sign-Cj4_ORaa.js → at-sign-BottTo2X.js} +1 -1
  8. package/core/built/admin/assets/{audience-ACTBvUSt.js → audience-CcGOt5Fb.js} +1 -1
  9. package/core/built/admin/assets/{avatar-flipboard-BeKL4BEF.js → avatar-flipboard-MxW2k124.js} +1 -1
  10. package/core/built/admin/assets/{bluesky-sharing-CP7ej5rz.js → bluesky-sharing-BBmDBlxr.js} +1 -1
  11. package/core/built/admin/assets/{chart-B6jk72FT.js → chart-pimL5Chk.js} +1 -1
  12. package/core/built/admin/assets/{chunk.524.6c12997c856012ea06f5.js → chunk.524.9a8f5123fd3ecf3e4451.js} +6 -6
  13. package/core/built/admin/assets/{chunk.582.a0abd5b93eb1bc50335a.js → chunk.582.41886d06af2895d571bd.js} +7 -7
  14. package/core/built/admin/assets/{code-editor-view-CVRtsOBM.js → code-editor-view-tCZOpc_h.js} +1 -1
  15. package/core/built/admin/assets/{comments-CxjhZH_T.js → comments-OXqhcC0t.js} +1 -1
  16. package/core/built/admin/assets/{copy-YhtJexiS.js → copy-aC0WUVtq.js} +1 -1
  17. package/core/built/admin/assets/{data-list-BPSXm3ej.js → data-list-BOdyZGWI.js} +1 -1
  18. package/core/built/admin/assets/{deleted-feed-item-D8BHDEHh.js → deleted-feed-item-BnUJ8bWP.js} +1 -1
  19. package/core/built/admin/assets/{edit-profile-FrkkXMG7.js → edit-profile-CEgPhWMJ.js} +1 -1
  20. package/core/built/admin/assets/{empty-indicator-SsCyCd50.js → empty-indicator-CR_9BHAH.js} +1 -1
  21. package/core/built/admin/assets/{en-ZWZBSdFY.js → en-ajofhc7o.js} +1 -1
  22. package/core/built/admin/assets/{feed-BvVJCTy8.js → feed-Ci-ODCHE.js} +1 -1
  23. package/core/built/admin/assets/{filters-BupJ4mUj.js → filters-CmJJOv3I.js} +1 -1
  24. package/core/built/admin/assets/{gh-chart-Dp9VXeON.js → gh-chart-hn7wEnik.js} +1 -1
  25. package/core/built/admin/assets/{growth-CRDHOGrZ.js → growth-CQceZQ1g.js} +1 -1
  26. package/core/built/admin/assets/{hash-CPAX2PwN.js → hash-BcaWmkw5.js} +1 -1
  27. package/core/built/admin/assets/{inbox-DuT2edmx.js → inbox-D9hID-rO.js} +1 -1
  28. package/core/built/admin/assets/{index-bl5YmBtG.js → index-B1rKIiOr.js} +1 -1
  29. package/core/built/admin/assets/{index-B2oDZJ9B.js → index-BJS8H75W.js} +1 -1
  30. package/core/built/admin/assets/{index-BPYePamp.js → index-BmK6ThYl.js} +1 -1
  31. package/core/built/admin/assets/{index-BX3kQzlo.js → index-CZ3lARQ2.js} +1 -1
  32. package/core/built/admin/assets/{index-8ECl7z0l.js → index-Cl2eSBwg.js} +1 -1
  33. package/core/built/admin/assets/{index-BwUQiVrX.js → index-D8syEvSm.js} +1 -1
  34. package/core/built/admin/assets/{index-Dk-Wh_Fw.js → index-DJDgMk-T.js} +1 -1
  35. package/core/built/admin/assets/{index-DnY4rls4.js → index-DO76vL0R.js} +1 -1
  36. package/core/built/admin/assets/{index-CjzFwwKZ.js → index-DYM1MbXR.js} +1 -1
  37. package/core/built/admin/assets/{index-B1rQYn0h.js → index-Do091GLu.js} +1 -1
  38. package/core/built/admin/assets/{index-CQP2hNBo.js → index-d_UH71zm.js} +1 -1
  39. package/core/built/admin/assets/{index-exFCQBCk.js → index-f5Lv9kLb.js} +9 -9
  40. package/core/built/admin/assets/{index--Nwo3958.js → index-g4BWcHhl.js} +1 -1
  41. package/core/built/admin/assets/{index-ByYZ5TiM.js → index-kXF42nga.js} +1 -1
  42. package/core/built/admin/assets/{index-CeFAaI2v.js → index-rluYcfd-.js} +1 -1
  43. package/core/built/admin/assets/{koenig-lexical-eRS1y7PS.js → koenig-lexical-D2XHvS2J.js} +1 -1
  44. package/core/built/admin/assets/{kpi-card-DShFKtte.js → kpi-card-Dga9rFZ5.js} +1 -1
  45. package/core/built/admin/assets/{kpis-Bxyr_zYY.js → kpis-BbnqD1za.js} +1 -1
  46. package/core/built/admin/assets/{label-hgdYQhmm.js → label-D8WHEOe0.js} +1 -1
  47. package/core/built/admin/assets/{links-5NNDFN65.js → links-dgwx7ko1.js} +1 -1
  48. package/core/built/admin/assets/{lucide-react-f58FO8MB.js → lucide-react-BARFK2PZ.js} +1 -1
  49. package/core/built/admin/assets/{main-layout-BDz_2UZs.js → main-layout-CcjtCuF_.js} +1 -1
  50. package/core/built/admin/assets/{message-square-text-6dTKbQKA.js → message-square-text-BxquqPhA.js} +1 -1
  51. package/core/built/admin/assets/{minus-D2C19Fiu.js → minus-Ziy4LSYD.js} +1 -1
  52. package/core/built/admin/assets/{modals-DzetQgXf.js → modals-fMQzR7L6.js} +1 -1
  53. package/core/built/admin/assets/{moderation-87QsKbyf.js → moderation-Ci9UNwiZ.js} +1 -1
  54. package/core/built/admin/assets/{newsletter-BhI9Lgkn.js → newsletter-DnrS7Fvi.js} +1 -1
  55. package/core/built/admin/assets/{newsletters-adLgF_Re.js → newsletters-D78pgnas.js} +1 -1
  56. package/core/built/admin/assets/{note-BbPR57Yw.js → note-BAfNweZN.js} +1 -1
  57. package/core/built/admin/assets/{overview-CqyRlIVM.js → overview-CWQPNOF0.js} +1 -1
  58. package/core/built/admin/assets/{pagemenu-DlQF5jN4.js → pagemenu-DjSqq3Wu.js} +1 -1
  59. package/core/built/admin/assets/{post-analytics-BudH7GCA.js → post-analytics-c8kRV0YB.js} +1 -1
  60. package/core/built/admin/assets/{post-analytics-context-CxuzZluw.js → post-analytics-context-CEqWyqgm.js} +1 -1
  61. package/core/built/admin/assets/{post-analytics-header-BV_8onIF.js → post-analytics-header-CpPPBAz4.js} +1 -1
  62. package/core/built/admin/assets/{post-share-modal-CnM21JFK.js → post-share-modal-Dln0kZhn.js} +1 -1
  63. package/core/built/admin/assets/{posts-C5zAbpdG.js → posts-C1Eh5Ypq.js} +1 -1
  64. package/core/built/admin/assets/{repeat-BbSnXois.js → repeat-CN4fiG5H.js} +1 -1
  65. package/core/built/admin/assets/{reply-CuCJJfZj.js → reply-BfWgvH7y.js} +1 -1
  66. package/core/built/admin/assets/{select-Bv-dkHeU.js → select-B_0NBkLz.js} +1 -1
  67. package/core/built/admin/assets/{settings-Cit2-dRQ.js → settings-BqaVcJee.js} +4 -4
  68. package/core/built/admin/assets/{settings-wlK_oNsg.js → settings-Dk9E7Fqv.js} +1 -1
  69. package/core/built/admin/assets/{sort-button-Dmyldyzm.js → sort-button-C2M35dLh.js} +1 -1
  70. package/core/built/admin/assets/{source-icon-DjyV6RS6.js → source-icon-DkGi13e_.js} +1 -1
  71. package/core/built/admin/assets/{sprout-jOQR37se.js → sprout-BKiwQsGn.js} +1 -1
  72. package/core/built/admin/assets/{square-IrYxuAJL.js → square-BEpRc_fY.js} +1 -1
  73. package/core/built/admin/assets/{stats-C4LbW8IV.js → stats-CRgy_cWm.js} +1 -1
  74. package/core/built/admin/assets/{stats-view-BwaLDryw.js → stats-view-CTQ4qO3S.js} +1 -1
  75. package/core/built/admin/assets/{step-1-C0QApeYD.js → step-1-CNbdmB8C.js} +1 -1
  76. package/core/built/admin/assets/{step-2-h0b6Njyb.js → step-2-Ddrl2uae.js} +1 -1
  77. package/core/built/admin/assets/{step-3-CaM-Hz3F.js → step-3-CbqkEtwh.js} +1 -1
  78. package/core/built/admin/assets/{table-P4FGxGxN.js → table-Dw9xFlFd.js} +1 -1
  79. package/core/built/admin/assets/{tabs-Cj65mCsJ.js → tabs-DCHagOip.js} +1 -1
  80. package/core/built/admin/assets/{tags-CDvEkvxr.js → tags-BsDlfsPN.js} +1 -1
  81. package/core/built/admin/assets/{tags-Dnv6zTag.js → tags-DV2SSdMK.js} +1 -1
  82. package/core/built/admin/assets/{tiers-Y3OCOT03.js → tiers-tc5tafWV.js} +1 -1
  83. package/core/built/admin/assets/{toggle-group-kZZo_vdJ.js → toggle-group-DS-ZVhCr.js} +1 -1
  84. package/core/built/admin/assets/{topic-filter-Cn1_Z9I7.js → topic-filter-BfoEqHRD.js} +1 -1
  85. package/core/built/admin/assets/{trash-ln90Rlgi.js → trash-CpnxYen-.js} +1 -1
  86. package/core/built/admin/assets/{url-helpers-B5_oMSPb.js → url-helpers-wKPPeCtD.js} +1 -1
  87. package/core/built/admin/assets/{use-growth-stats-DQsJauHH.js → use-growth-stats-CbHIETF_.js} +1 -1
  88. package/core/built/admin/assets/{use-infinite-virtual-scroll-4OIpSNMH.js → use-infinite-virtual-scroll-DU1EUhyj.js} +1 -1
  89. package/core/built/admin/assets/{use-simple-pagination-BedA-MMT.js → use-simple-pagination-X6kmRz2u.js} +1 -1
  90. package/core/built/admin/assets/{user-round-check-CYI147XP.js → user-round-check-DYkrjHxF.js} +1 -1
  91. package/core/built/admin/assets/{wallet-cards-xpilOd6G.js → wallet-cards-CSdWOmJE.js} +1 -1
  92. package/core/built/admin/assets/{web-VPMnLvnh.js → web-C39IKnvl.js} +1 -1
  93. package/core/built/admin/index.html +2 -2
  94. package/core/server/services/email-address/email-address-service-wrapper.js +3 -0
  95. package/core/server/services/email-address/email-address-service.js +11 -0
  96. package/core/server/services/email-address/email-address-service.ts +13 -0
  97. package/core/server/services/members/api.js +3 -1
  98. package/core/server/services/members/members-api/controllers/router-controller.js +5 -2
  99. package/core/server/services/members/members-api/members-api.js +4 -2
  100. package/package.json +5 -5
  101. package/tsconfig.tsbuildinfo +1 -1
  102. package/components/tryghost-i18n-6.17.1.tgz +0 -0
@@ -1 +1 @@
1
- import{r as v,aq as N,ar as P,j as u,as as S,at as w,au as p,av as x,aw as F,ax as D,ay as T,az as V}from"./index-exFCQBCk.js";var g="Tabs",[G]=S(g,[x]),C=x(),[L,m]=G(g),h=v.forwardRef((e,n)=>{const{__scopeTabs:i,value:a,onValueChange:r,defaultValue:c,orientation:t="horizontal",dir:d,activationMode:b="automatic",...f}=e,s=N(d),[o,l]=P({prop:a,onChange:r,defaultProp:c??"",caller:g});return u.jsx(L,{scope:i,baseId:w(),value:o,onValueChange:l,orientation:t,dir:s,activationMode:b,children:u.jsx(p.div,{dir:s,"data-orientation":t,...f,ref:n})})});h.displayName=g;var I="TabsList",R=v.forwardRef((e,n)=>{const{__scopeTabs:i,loop:a=!0,...r}=e,c=m(I,i),t=C(i);return u.jsx(F,{asChild:!0,...t,orientation:c.orientation,dir:c.dir,loop:a,children:u.jsx(p.div,{role:"tablist","aria-orientation":c.orientation,...r,ref:n})})});R.displayName=I;var y="TabsTrigger",_=v.forwardRef((e,n)=>{const{__scopeTabs:i,value:a,disabled:r=!1,...c}=e,t=m(y,i),d=C(i),b=j(t.baseId,a),f=M(t.baseId,a),s=a===t.value;return u.jsx(D,{asChild:!0,...d,focusable:!r,active:s,children:u.jsx(p.button,{type:"button",role:"tab","aria-selected":s,"aria-controls":f,"data-state":s?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:b,...c,ref:n,onMouseDown:T(e.onMouseDown,o=>{!r&&o.button===0&&o.ctrlKey===!1?t.onValueChange(a):o.preventDefault()}),onKeyDown:T(e.onKeyDown,o=>{[" ","Enter"].includes(o.key)&&t.onValueChange(a)}),onFocus:T(e.onFocus,()=>{const o=t.activationMode!=="manual";!s&&!r&&o&&t.onValueChange(a)})})})});_.displayName=y;var A="TabsContent",E=v.forwardRef((e,n)=>{const{__scopeTabs:i,value:a,forceMount:r,children:c,...t}=e,d=m(A,i),b=j(d.baseId,a),f=M(d.baseId,a),s=a===d.value,o=v.useRef(s);return v.useEffect(()=>{const l=requestAnimationFrame(()=>o.current=!1);return()=>cancelAnimationFrame(l)},[]),u.jsx(V,{present:r||s,children:({present:l})=>u.jsx(p.div,{"data-state":s?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":b,hidden:!l,id:f,tabIndex:0,...t,ref:n,style:{...e.style,animationDuration:o.current?"0s":void 0},children:l&&c})})});E.displayName=A;function j(e,n){return`${e}-trigger-${n}`}function M(e,n){return`${e}-content-${n}`}var k=h,K=R,q=_,z=E;export{z as C,K as L,k as R,q as T};
1
+ import{r as v,aq as N,ar as P,j as u,as as S,at as w,au as p,av as x,aw as F,ax as D,ay as T,az as V}from"./index-f5Lv9kLb.js";var g="Tabs",[G]=S(g,[x]),C=x(),[L,m]=G(g),h=v.forwardRef((e,n)=>{const{__scopeTabs:i,value:a,onValueChange:r,defaultValue:c,orientation:t="horizontal",dir:d,activationMode:b="automatic",...f}=e,s=N(d),[o,l]=P({prop:a,onChange:r,defaultProp:c??"",caller:g});return u.jsx(L,{scope:i,baseId:w(),value:o,onValueChange:l,orientation:t,dir:s,activationMode:b,children:u.jsx(p.div,{dir:s,"data-orientation":t,...f,ref:n})})});h.displayName=g;var I="TabsList",R=v.forwardRef((e,n)=>{const{__scopeTabs:i,loop:a=!0,...r}=e,c=m(I,i),t=C(i);return u.jsx(F,{asChild:!0,...t,orientation:c.orientation,dir:c.dir,loop:a,children:u.jsx(p.div,{role:"tablist","aria-orientation":c.orientation,...r,ref:n})})});R.displayName=I;var y="TabsTrigger",_=v.forwardRef((e,n)=>{const{__scopeTabs:i,value:a,disabled:r=!1,...c}=e,t=m(y,i),d=C(i),b=j(t.baseId,a),f=M(t.baseId,a),s=a===t.value;return u.jsx(D,{asChild:!0,...d,focusable:!r,active:s,children:u.jsx(p.button,{type:"button",role:"tab","aria-selected":s,"aria-controls":f,"data-state":s?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:b,...c,ref:n,onMouseDown:T(e.onMouseDown,o=>{!r&&o.button===0&&o.ctrlKey===!1?t.onValueChange(a):o.preventDefault()}),onKeyDown:T(e.onKeyDown,o=>{[" ","Enter"].includes(o.key)&&t.onValueChange(a)}),onFocus:T(e.onFocus,()=>{const o=t.activationMode!=="manual";!s&&!r&&o&&t.onValueChange(a)})})})});_.displayName=y;var A="TabsContent",E=v.forwardRef((e,n)=>{const{__scopeTabs:i,value:a,forceMount:r,children:c,...t}=e,d=m(A,i),b=j(d.baseId,a),f=M(d.baseId,a),s=a===d.value,o=v.useRef(s);return v.useEffect(()=>{const l=requestAnimationFrame(()=>o.current=!1);return()=>cancelAnimationFrame(l)},[]),u.jsx(V,{present:r||s,children:({present:l})=>u.jsx(p.div,{"data-state":s?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":b,hidden:!l,id:f,tabIndex:0,...t,ref:n,style:{...e.style,animationDuration:o.current?"0s":void 0},children:l&&c})})});E.displayName=A;function j(e,n){return`${e}-trigger-${n}`}function M(e,n){return`${e}-content-${n}`}var k=h,K=R,q=_,z=E;export{z as C,K as L,k as R,q as T};
@@ -1 +1 @@
1
- import{r as c}from"./index-exFCQBCk.js";const z=(n,t)=>n==null?t:t==null?n:Math.max(n,t),C=new WeakMap,ut={onUpdate(n,t,e){if(C.set(e,void 0),!e.computedTrend)return;const i=t.integer.concat(t.fraction).filter(o=>o.type==="integer"||o.type==="fraction"),s=n.integer.concat(n.fraction).filter(o=>o.type==="integer"||o.type==="fraction"),r=i.find(o=>!s.find(l=>l.pos===o.pos&&l.value===o.value)),a=s.find(o=>!i.find(l=>o.pos===l.pos&&o.value===l.value));C.set(e,z(r?.pos,a?.pos))},getDelta(n,t,e){const i=n-t,s=C.get(e.flow);if(!i&&s!=null&&s>=e.pos)return e.length*e.flow.computedTrend}},y=(n,t,e)=>{const i=document.createElement(n),[s,r]=Array.isArray(t)?[void 0,t]:[t,e];return s&&Object.assign(i,s),r?.forEach(a=>i.appendChild(a)),i},J=(n,t)=>{var e;return t==="left"?n.offsetLeft:(((e=n.offsetParent instanceof HTMLElement?n.offsetParent:null)==null?void 0:e.offsetWidth)??0)-n.offsetWidth-n.offsetLeft},G=n=>n.offsetWidth>0&&n.offsetHeight>0,Y=(n,t)=>{!customElements.get(n)&&customElements.define(n,t)};function Z(n,t,{reverse:e=!1}={}){const i=n.length;for(let s=e?i-1:0;e?s>=0:s<i;e?s--:s++)t(n[s],s)}function q(n,t,e,i){const s=t.formatToParts(n);e&&s.unshift({type:"prefix",value:e}),i&&s.push({type:"suffix",value:i});const r=[],a=[],o=[],l=[],u={},p=d=>`${d}:${u[d]=(u[d]??-1)+1}`;let f="",m=!1,g=!1;for(const d of s){f+=d.value;const h=d.type==="minusSign"||d.type==="plusSign"?"sign":d.type;h==="integer"?(m=!0,a.push(...d.value.split("").map(A=>({type:h,value:parseInt(A)})))):h==="group"?a.push({type:h,value:d.value}):h==="decimal"?(g=!0,o.push({type:h,value:d.value,key:p(h)})):h==="fraction"?o.push(...d.value.split("").map(A=>({type:h,value:parseInt(A),key:p(h),pos:-1-u[h]}))):(m||g?l:r).push({type:h,value:d.value,key:p(h)})}const M=[];for(let d=a.length-1;d>=0;d--){const h=a[d];M.unshift(h.type==="integer"?{...h,key:p(h.type),pos:u[h.type]}:{...h,key:p(h.type)})}return{pre:r,integer:M,fraction:o,post:l,valueAsString:f,value:typeof n=="string"?parseFloat(n):n}}const Q=String.raw,K=(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0})(),tt=typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)"),w=typeof matchMedia<"u"?matchMedia("(prefers-reduced-motion: reduce)"):null,E="--_number-flow-d-opacity",U="--_number-flow-d-width",R="--_number-flow-dx",k="--_number-flow-d",et=(()=>{try{return CSS.registerProperty({name:E,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:R,syntax:"<length>",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:U,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:k,syntax:"<number>",inherits:!0,initialValue:"0"}),!0}catch{return!1}})(),it="var(--number-flow-char-height, 1em)",v="var(--number-flow-mask-height, 0.25em)",N=`calc(${v} / 2)`,$="var(--number-flow-mask-width, 0.5em)",_=`calc(${$} / var(--scale-x))`,b="#000 0, transparent 71%",P=Q`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:${it} !important}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${U}) / var(--width));transform:translateX(var(${R})) scaleX(var(--scale-x));margin:0 calc(-1 * ${$});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${_},#000 calc(100% - ${_}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${v},#000 calc(100% - ${v}),transparent 100% ),radial-gradient(at bottom right,${b}),radial-gradient(at bottom left,${b}),radial-gradient(at top left,${b}),radial-gradient(at top right,${b});-webkit-mask-size:100% calc(100% - ${v} * 2),calc(100% - ${_} * 2) 100%,${_} ${v},${_} ${v},${_} ${v},${_} ${v};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${N} ${$};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${R})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${k})}.digit__num,.number .section::after{padding:${N} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${E}))}`,st=HTMLElement,B=tt&&K&&et;let S;class I extends st{constructor(){super(),this.created=!1,this.batched=!1;const{animated:t,...e}=this.constructor.defaultProps;this._animated=this.computedAnimated=t,Object.assign(this,e)}get animated(){return this._animated}set animated(t){var e;this.animated!==t&&(this._animated=t,(e=this.shadowRoot)==null||e.getAnimations().forEach(i=>i.finish()))}set data(t){var e;if(t==null)return;const{pre:i,integer:s,fraction:r,post:a,value:o}=t;if(this.created){const l=this._data;this._data=t,this.computedTrend=typeof this.trend=="function"?this.trend(l.value,o):this.trend,this.computedAnimated=B&&this._animated&&(!this.respectMotionPreference||!(w!=null&&w.matches))&&G(this),(e=this.plugins)==null||e.forEach(u=>{var p;return(p=u.onUpdate)==null?void 0:p.call(u,t,l,this)}),this.batched||this.willUpdate(),this._pre.update(i),this._num.update({integer:s,fraction:r}),this._post.update(a),this.batched||this.didUpdate()}else{this._data=t,this.attachShadow({mode:"open"});try{this._internals??(this._internals=this.attachInternals()),this._internals.role="img"}catch{}if(typeof CSSStyleSheet<"u"&&this.shadowRoot.adoptedStyleSheets)S||(S=new CSSStyleSheet,S.replaceSync(P)),this.shadowRoot.adoptedStyleSheets=[S];else{const l=document.createElement("style");l.textContent=P,this.shadowRoot.appendChild(l)}this._pre=new F(this,i,{justify:"right",part:"left"}),this.shadowRoot.appendChild(this._pre.el),this._num=new nt(this,s,r),this.shadowRoot.appendChild(this._num.el),this._post=new F(this,a,{justify:"left",part:"right"}),this.shadowRoot.appendChild(this._post.el),this.created=!0}try{this._internals.ariaLabel=t.valueAsString}catch{}}willUpdate(){this._pre.willUpdate(),this._num.willUpdate(),this._post.willUpdate()}didUpdate(){if(!this.computedAnimated)return;this._abortAnimationsFinish?this._abortAnimationsFinish.abort():this.dispatchEvent(new Event("animationsstart")),this._pre.didUpdate(),this._num.didUpdate(),this._post.didUpdate();const t=new AbortController;Promise.all(this.shadowRoot.getAnimations().map(e=>e.finished)).then(()=>{t.signal.aborted||(this.dispatchEvent(new Event("animationsfinish")),this._abortAnimationsFinish=void 0)}),this._abortAnimationsFinish=t}}I.defaultProps={transformTiming:{duration:900,easing:"linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"},spinTiming:void 0,opacityTiming:{duration:450,easing:"ease-out"},animated:!0,trend:(n,t)=>Math.sign(t-n),respectMotionPreference:!0,plugins:void 0,digits:void 0};class nt{constructor(t,e,i,{className:s,...r}={}){this.flow=t,this._integer=new L(t,e,{justify:"right",part:"integer"}),this._fraction=new L(t,i,{justify:"left",part:"fraction"}),this._inner=y("span",{className:"number__inner"},[this._integer.el,this._fraction.el]),this.el=y("span",{...r,part:"number",className:`number ${s??""}`},[this._inner])}willUpdate(){this._prevWidth=this.el.offsetWidth,this._prevLeft=this.el.getBoundingClientRect().left,this._integer.willUpdate(),this._fraction.willUpdate()}update({integer:t,fraction:e}){this._integer.update(t),this._fraction.update(e)}didUpdate(){const t=this.el.getBoundingClientRect();this._integer.didUpdate(),this._fraction.didUpdate();const e=this._prevLeft-t.left,i=this.el.offsetWidth,s=this._prevWidth-i;this.el.style.setProperty("--width",String(i)),this.el.animate({[R]:[`${e}px`,"0px"],[U]:[s,0]},{...this.flow.transformTiming,composite:"accumulate"})}}class D{constructor(t,e,{justify:i,className:s,...r},a){this.flow=t,this.children=new Map,this.onCharRemove=l=>()=>{this.children.delete(l)},this.justify=i;const o=e.map(l=>this.addChar(l).el);this.el=y("span",{...r,className:`section section--justify-${i} ${s??""}`},a?a(o):o)}addChar(t,{startDigitsAtZero:e=!1,...i}={}){const s=t.type==="integer"||t.type==="fraction"?new X(this,t.type,e?0:t.value,t.pos,{...i,onRemove:this.onCharRemove(t.key)}):new at(this,t.type,t.value,{...i,onRemove:this.onCharRemove(t.key)});return this.children.set(t.key,s),s}unpop(t){t.el.removeAttribute("inert"),t.el.style.top="",t.el.style[this.justify]=""}pop(t){t.forEach(e=>{e.el.style.top=`${e.el.offsetTop}px`,e.el.style[this.justify]=`${J(e.el,this.justify)}px`}),t.forEach(e=>{e.el.setAttribute("inert",""),e.present=!1})}addNewAndUpdateExisting(t){const e=new Map,i=new Map,s=this.justify==="left",r=s?"prepend":"append";if(Z(t,a=>{let o;this.children.has(a.key)?(o=this.children.get(a.key),i.set(a,o),this.unpop(o),o.present=!0):(o=this.addChar(a,{startDigitsAtZero:!0,animateIn:!0}),e.set(a,o)),this.el[r](o.el)},{reverse:s}),this.flow.computedAnimated){const a=this.el.getBoundingClientRect();e.forEach(o=>{o.willUpdate(a)})}e.forEach((a,o)=>{a.update(o.value)}),i.forEach((a,o)=>{a.update(o.value)})}willUpdate(){const t=this.el.getBoundingClientRect();this._prevOffset=t[this.justify],this.children.forEach(e=>e.willUpdate(t))}didUpdate(){const t=this.el.getBoundingClientRect();this.children.forEach(s=>s.didUpdate(t));const e=t[this.justify],i=this._prevOffset-e;i&&this.children.size&&this.el.animate({transform:[`translateX(${i}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}class L extends D{update(t){const e=new Map;this.children.forEach((i,s)=>{t.find(r=>r.key===s)||e.set(s,i),this.unpop(i)}),this.addNewAndUpdateExisting(t),e.forEach(i=>{i instanceof X&&i.update(0)}),this.pop(e)}}class F extends D{update(t){const e=new Map;this.children.forEach((i,s)=>{t.find(r=>r.key===s)||e.set(s,i)}),this.pop(e),this.addNewAndUpdateExisting(t)}}class x{constructor(t,e,{onRemove:i,animateIn:s=!1}={}){this.flow=t,this.el=e,this._present=!0,this._remove=()=>{var r;this.el.remove(),(r=this._onRemove)==null||r.call(this)},this.el.classList.add("animate-presence"),this.flow.computedAnimated&&s&&this.el.animate({[E]:[-.9999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),this._onRemove=i}get present(){return this._present}set present(t){if(this._present!==t){if(this._present=t,t?this.el.removeAttribute("inert"):this.el.setAttribute("inert",""),!this.flow.computedAnimated){t||this._remove();return}this.el.style.setProperty("--_number-flow-d-opacity",t?"0":"-.999"),this.el.animate({[E]:t?[-.9999,0]:[.999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),t?this.flow.removeEventListener("animationsfinish",this._remove):this.flow.addEventListener("animationsfinish",this._remove,{once:!0})}}}class W extends x{constructor(t,e,i,s){super(t.flow,i,s),this.section=t,this.value=e,this.el=i}}class X extends W{constructor(t,e,i,s,r){var a,o;const l=(((o=(a=t.flow.digits)==null?void 0:a[s])==null?void 0:o.max)??9)+1,u=Array.from({length:l}).map((f,m)=>{const g=y("span",{className:"digit__num"},[document.createTextNode(String(m))]);return m!==i&&g.setAttribute("inert",""),g.style.setProperty("--n",String(m)),g}),p=y("span",{part:`digit ${e}-digit`,className:"digit"},u);p.style.setProperty("--current",String(i)),p.style.setProperty("--length",String(l)),super(t,i,p,r),this.pos=s,this._onAnimationsFinish=()=>{this.el.classList.remove("is-spinning")},this._numbers=u,this.length=l}willUpdate(t){const e=this.el.getBoundingClientRect();this._prevValue=this.value;const i=e[this.section.justify]-t[this.section.justify],s=e.width/2;this._prevCenter=this.section.justify==="left"?i+s:i-s}update(t){this.el.style.setProperty("--current",String(t)),this._numbers.forEach((e,i)=>i===t?e.removeAttribute("inert"):e.setAttribute("inert","")),this.value=t}didUpdate(t){const e=this.el.getBoundingClientRect(),i=e[this.section.justify]-t[this.section.justify],s=e.width/2,r=this.section.justify==="left"?i+s:i-s,a=this._prevCenter-r;a&&this.el.animate({transform:[`translateX(${a}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"});const o=this.getDelta();o&&(this.el.classList.add("is-spinning"),this.el.animate({[k]:[-o,0]},{...this.flow.spinTiming??this.flow.transformTiming,composite:"accumulate"}),this.flow.addEventListener("animationsfinish",this._onAnimationsFinish,{once:!0}))}getDelta(){var t;if(this.flow.plugins)for(const s of this.flow.plugins){const r=(t=s.getDelta)==null?void 0:t.call(s,this.value,this._prevValue,this);if(r!=null)return r}const e=this.value-this._prevValue,i=this.flow.computedTrend||Math.sign(e);return i<0&&this.value>this._prevValue?this.value-this.length-this._prevValue:i>0&&this.value<this._prevValue?this.length-this._prevValue+this.value:e}}class at extends W{constructor(t,e,i,s){const r=y("span",{className:"symbol__value",textContent:i});super(t,i,y("span",{part:`symbol ${e}`,className:"symbol"},[r]),s),this.type=e,this._children=new Map,this._onChildRemove=a=>()=>{this._children.delete(a)},this._children.set(i,new x(this.flow,r,{onRemove:this._onChildRemove(i)}))}willUpdate(t){if(this.type==="decimal")return;const e=this.el.getBoundingClientRect();this._prevOffset=e[this.section.justify]-t[this.section.justify]}update(t){if(this.value!==t){const e=this._children.get(this.value);e&&(e.present=!1);const i=this._children.get(t);if(i)i.present=!0;else{const s=y("span",{className:"symbol__value",textContent:t});this.el.appendChild(s),this._children.set(t,new x(this.flow,s,{animateIn:!0,onRemove:this._onChildRemove(t)}))}}this.value=t}didUpdate(t){if(this.type==="decimal")return;const e=this.el.getBoundingClientRect()[this.section.justify]-t[this.section.justify],i=this._prevOffset-e;i&&this.el.animate({transform:[`translateX(${i}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}const rt=parseInt(c.version.match(/^(\d+)\./)?.[1]),j=rt>=19,ot=["data","digits"];class T extends I{attributeChangedCallback(t,e,i){this[t]=JSON.parse(i)}}T.observedAttributes=j?[]:ot;Y("number-flow-react",T);const lt={},O=j?n=>n:JSON.stringify;function V(n){const{transformTiming:t,spinTiming:e,opacityTiming:i,animated:s,respectMotionPreference:r,trend:a,plugins:o,...l}=n;return[{transformTiming:t,spinTiming:e,opacityTiming:i,animated:s,respectMotionPreference:r,trend:a,plugins:o},l]}class ht extends c.Component{updateProperties(t){if(!this.el)return;this.el.batched=!this.props.isolate;const[e]=V(this.props);Object.entries(e).forEach(([i,s])=>{this.el[i]=s??T.defaultProps[i]}),t?.onAnimationsStart&&this.el.removeEventListener("animationsstart",t.onAnimationsStart),this.props.onAnimationsStart&&this.el.addEventListener("animationsstart",this.props.onAnimationsStart),t?.onAnimationsFinish&&this.el.removeEventListener("animationsfinish",t.onAnimationsFinish),this.props.onAnimationsFinish&&this.el.addEventListener("animationsfinish",this.props.onAnimationsFinish)}componentDidMount(){this.updateProperties(),j&&this.el&&(this.el.digits=this.props.digits,this.el.data=this.props.data)}getSnapshotBeforeUpdate(t){if(this.updateProperties(t),t.data!==this.props.data){if(this.props.group)return this.props.group.willUpdate(),()=>this.props.group?.didUpdate();if(!this.props.isolate)return this.el?.willUpdate(),()=>this.el?.didUpdate()}return null}componentDidUpdate(t,e,i){i?.()}handleRef(t){this.props.innerRef&&(this.props.innerRef.current=t),this.el=t}render(){const[t,{innerRef:e,className:i,data:s,willChange:r,isolate:a,group:o,digits:l,onAnimationsStart:u,onAnimationsFinish:p,...f}]=V(this.props);return c.createElement("number-flow-react",{ref:this.handleRef,"data-will-change":r?"":void 0,class:i,...f,dangerouslySetInnerHTML:{__html:""},suppressHydrationWarning:!0,digits:O(l),data:O(s)})}constructor(t){super(t),this.handleRef=this.handleRef.bind(this)}}const ft=c.forwardRef(function({value:t,locales:e,format:i,prefix:s,suffix:r,...a},o){c.useImperativeHandle(o,()=>l.current,[]);const l=c.useRef(),u=c.useContext(H);u?.useRegister(l);const p=c.useMemo(()=>e?JSON.stringify(e):"",[e]),f=c.useMemo(()=>i?JSON.stringify(i):"",[i]),m=c.useMemo(()=>{const g=lt[`${p}:${f}`]??=new Intl.NumberFormat(e,i);return q(t,g,s,r)},[t,p,f,s,r]);return c.createElement(ht,{...a,group:u,data:m,innerRef:l})}),H=c.createContext(void 0);function mt({children:n}){const t=c.useRef(new Set),e=c.useRef(!1),i=c.useRef(new WeakMap),s=c.useMemo(()=>({useRegister(r){c.useEffect(()=>(t.current.add(r),()=>{t.current.delete(r)}),[])},willUpdate(){e.current||(e.current=!0,t.current.forEach(r=>{const a=r.current;!a||!a.created||(a.willUpdate(),i.current.set(a,!0))}))},didUpdate(){t.current.forEach(r=>{const a=r.current;!a||!i.current.get(a)||(a.didUpdate(),i.current.delete(a))}),e.current=!1}}),[]);return c.createElement(H.Provider,{value:s},n)}const ct=()=>c.useSyncExternalStore(()=>()=>{},()=>B,()=>!1),dt=()=>c.useSyncExternalStore(n=>(w?.addEventListener("change",n),()=>w?.removeEventListener("change",n)),()=>w.matches,()=>!1);function gt({respectMotionPreference:n=!0}={}){const t=ct(),e=dt();return t&&(!n||!e)}export{T as NumberFlowElement,mt as NumberFlowGroup,ut as continuous,ft as default,gt as useCanAnimate,ct as useIsSupported,dt as usePrefersReducedMotion};
1
+ import{r as c}from"./index-f5Lv9kLb.js";const z=(n,t)=>n==null?t:t==null?n:Math.max(n,t),C=new WeakMap,ut={onUpdate(n,t,e){if(C.set(e,void 0),!e.computedTrend)return;const i=t.integer.concat(t.fraction).filter(o=>o.type==="integer"||o.type==="fraction"),s=n.integer.concat(n.fraction).filter(o=>o.type==="integer"||o.type==="fraction"),r=i.find(o=>!s.find(l=>l.pos===o.pos&&l.value===o.value)),a=s.find(o=>!i.find(l=>o.pos===l.pos&&o.value===l.value));C.set(e,z(r?.pos,a?.pos))},getDelta(n,t,e){const i=n-t,s=C.get(e.flow);if(!i&&s!=null&&s>=e.pos)return e.length*e.flow.computedTrend}},y=(n,t,e)=>{const i=document.createElement(n),[s,r]=Array.isArray(t)?[void 0,t]:[t,e];return s&&Object.assign(i,s),r?.forEach(a=>i.appendChild(a)),i},J=(n,t)=>{var e;return t==="left"?n.offsetLeft:(((e=n.offsetParent instanceof HTMLElement?n.offsetParent:null)==null?void 0:e.offsetWidth)??0)-n.offsetWidth-n.offsetLeft},G=n=>n.offsetWidth>0&&n.offsetHeight>0,Y=(n,t)=>{!customElements.get(n)&&customElements.define(n,t)};function Z(n,t,{reverse:e=!1}={}){const i=n.length;for(let s=e?i-1:0;e?s>=0:s<i;e?s--:s++)t(n[s],s)}function q(n,t,e,i){const s=t.formatToParts(n);e&&s.unshift({type:"prefix",value:e}),i&&s.push({type:"suffix",value:i});const r=[],a=[],o=[],l=[],u={},p=d=>`${d}:${u[d]=(u[d]??-1)+1}`;let f="",m=!1,g=!1;for(const d of s){f+=d.value;const h=d.type==="minusSign"||d.type==="plusSign"?"sign":d.type;h==="integer"?(m=!0,a.push(...d.value.split("").map(A=>({type:h,value:parseInt(A)})))):h==="group"?a.push({type:h,value:d.value}):h==="decimal"?(g=!0,o.push({type:h,value:d.value,key:p(h)})):h==="fraction"?o.push(...d.value.split("").map(A=>({type:h,value:parseInt(A),key:p(h),pos:-1-u[h]}))):(m||g?l:r).push({type:h,value:d.value,key:p(h)})}const M=[];for(let d=a.length-1;d>=0;d--){const h=a[d];M.unshift(h.type==="integer"?{...h,key:p(h.type),pos:u[h.type]}:{...h,key:p(h.type)})}return{pre:r,integer:M,fraction:o,post:l,valueAsString:f,value:typeof n=="string"?parseFloat(n):n}}const Q=String.raw,K=(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0})(),tt=typeof CSS<"u"&&CSS.supports&&CSS.supports("line-height","mod(1,1)"),w=typeof matchMedia<"u"?matchMedia("(prefers-reduced-motion: reduce)"):null,E="--_number-flow-d-opacity",U="--_number-flow-d-width",R="--_number-flow-dx",k="--_number-flow-d",et=(()=>{try{return CSS.registerProperty({name:E,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:R,syntax:"<length>",inherits:!0,initialValue:"0px"}),CSS.registerProperty({name:U,syntax:"<number>",inherits:!1,initialValue:"0"}),CSS.registerProperty({name:k,syntax:"<number>",inherits:!0,initialValue:"0"}),!0}catch{return!1}})(),it="var(--number-flow-char-height, 1em)",v="var(--number-flow-mask-height, 0.25em)",N=`calc(${v} / 2)`,$="var(--number-flow-mask-width, 0.5em)",_=`calc(${$} / var(--scale-x))`,b="#000 0, transparent 71%",P=Q`:host{display:inline-block;direction:ltr;white-space:nowrap;isolation:isolate;line-height:${it} !important}.number,.number__inner{display:inline-block;transform-origin:left top}:host([data-will-change]) :is(.number,.number__inner,.section,.digit,.digit__num,.symbol){will-change:transform}.number{--scale-x:calc(1 + var(${U}) / var(--width));transform:translateX(var(${R})) scaleX(var(--scale-x));margin:0 calc(-1 * ${$});position:relative;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 ${_},#000 calc(100% - ${_}),transparent ),linear-gradient(to bottom,transparent 0,#000 ${v},#000 calc(100% - ${v}),transparent 100% ),radial-gradient(at bottom right,${b}),radial-gradient(at bottom left,${b}),radial-gradient(at top left,${b}),radial-gradient(at top right,${b});-webkit-mask-size:100% calc(100% - ${v} * 2),calc(100% - ${_} * 2) 100%,${_} ${v},${_} ${v},${_} ${v},${_} ${v};-webkit-mask-position:center,center,top left,top right,bottom right,bottom left;-webkit-mask-repeat:no-repeat}.number__inner{padding:${N} ${$};transform:scaleX(calc(1 / var(--scale-x))) translateX(calc(-1 * var(${R})))}:host > :not(.number){z-index:5}.section,.symbol{display:inline-block;position:relative;isolation:isolate}.section::after{content:'\200b';display:inline-block}.section--justify-left{transform-origin:center left}.section--justify-right{transform-origin:center right}.section > [inert],.symbol > [inert]{margin:0 !important;position:absolute !important;z-index:-1}.digit{display:inline-block;position:relative;--c:var(--current) + var(${k})}.digit__num,.number .section::after{padding:${N} 0}.digit__num{display:inline-block;--offset-raw:mod(var(--length) + var(--n) - mod(var(--c),var(--length)),var(--length));--offset:calc( var(--offset-raw) - var(--length) * round(down,var(--offset-raw) / (var(--length) / 2),1) );--y:clamp(-100%,var(--offset) * 100%,100%);transform:translateY(var(--y))}.digit__num[inert]{position:absolute;top:0;left:50%;transform:translateX(-50%) translateY(var(--y))}.digit:not(.is-spinning) .digit__num[inert]{display:none}.symbol__value{display:inline-block;mix-blend-mode:plus-lighter;white-space:pre}.section--justify-left .symbol > [inert]{left:0}.section--justify-right .symbol > [inert]{right:0}.animate-presence{opacity:calc(1 + var(${E}))}`,st=HTMLElement,B=tt&&K&&et;let S;class I extends st{constructor(){super(),this.created=!1,this.batched=!1;const{animated:t,...e}=this.constructor.defaultProps;this._animated=this.computedAnimated=t,Object.assign(this,e)}get animated(){return this._animated}set animated(t){var e;this.animated!==t&&(this._animated=t,(e=this.shadowRoot)==null||e.getAnimations().forEach(i=>i.finish()))}set data(t){var e;if(t==null)return;const{pre:i,integer:s,fraction:r,post:a,value:o}=t;if(this.created){const l=this._data;this._data=t,this.computedTrend=typeof this.trend=="function"?this.trend(l.value,o):this.trend,this.computedAnimated=B&&this._animated&&(!this.respectMotionPreference||!(w!=null&&w.matches))&&G(this),(e=this.plugins)==null||e.forEach(u=>{var p;return(p=u.onUpdate)==null?void 0:p.call(u,t,l,this)}),this.batched||this.willUpdate(),this._pre.update(i),this._num.update({integer:s,fraction:r}),this._post.update(a),this.batched||this.didUpdate()}else{this._data=t,this.attachShadow({mode:"open"});try{this._internals??(this._internals=this.attachInternals()),this._internals.role="img"}catch{}if(typeof CSSStyleSheet<"u"&&this.shadowRoot.adoptedStyleSheets)S||(S=new CSSStyleSheet,S.replaceSync(P)),this.shadowRoot.adoptedStyleSheets=[S];else{const l=document.createElement("style");l.textContent=P,this.shadowRoot.appendChild(l)}this._pre=new F(this,i,{justify:"right",part:"left"}),this.shadowRoot.appendChild(this._pre.el),this._num=new nt(this,s,r),this.shadowRoot.appendChild(this._num.el),this._post=new F(this,a,{justify:"left",part:"right"}),this.shadowRoot.appendChild(this._post.el),this.created=!0}try{this._internals.ariaLabel=t.valueAsString}catch{}}willUpdate(){this._pre.willUpdate(),this._num.willUpdate(),this._post.willUpdate()}didUpdate(){if(!this.computedAnimated)return;this._abortAnimationsFinish?this._abortAnimationsFinish.abort():this.dispatchEvent(new Event("animationsstart")),this._pre.didUpdate(),this._num.didUpdate(),this._post.didUpdate();const t=new AbortController;Promise.all(this.shadowRoot.getAnimations().map(e=>e.finished)).then(()=>{t.signal.aborted||(this.dispatchEvent(new Event("animationsfinish")),this._abortAnimationsFinish=void 0)}),this._abortAnimationsFinish=t}}I.defaultProps={transformTiming:{duration:900,easing:"linear(0,.005,.019,.039,.066,.096,.129,.165,.202,.24,.278,.316,.354,.39,.426,.461,.494,.526,.557,.586,.614,.64,.665,.689,.711,.731,.751,.769,.786,.802,.817,.831,.844,.856,.867,.877,.887,.896,.904,.912,.919,.925,.931,.937,.942,.947,.951,.955,.959,.962,.965,.968,.971,.973,.976,.978,.98,.981,.983,.984,.986,.987,.988,.989,.99,.991,.992,.992,.993,.994,.994,.995,.995,.996,.996,.9963,.9967,.9969,.9972,.9975,.9977,.9979,.9981,.9982,.9984,.9985,.9987,.9988,.9989,1)"},spinTiming:void 0,opacityTiming:{duration:450,easing:"ease-out"},animated:!0,trend:(n,t)=>Math.sign(t-n),respectMotionPreference:!0,plugins:void 0,digits:void 0};class nt{constructor(t,e,i,{className:s,...r}={}){this.flow=t,this._integer=new L(t,e,{justify:"right",part:"integer"}),this._fraction=new L(t,i,{justify:"left",part:"fraction"}),this._inner=y("span",{className:"number__inner"},[this._integer.el,this._fraction.el]),this.el=y("span",{...r,part:"number",className:`number ${s??""}`},[this._inner])}willUpdate(){this._prevWidth=this.el.offsetWidth,this._prevLeft=this.el.getBoundingClientRect().left,this._integer.willUpdate(),this._fraction.willUpdate()}update({integer:t,fraction:e}){this._integer.update(t),this._fraction.update(e)}didUpdate(){const t=this.el.getBoundingClientRect();this._integer.didUpdate(),this._fraction.didUpdate();const e=this._prevLeft-t.left,i=this.el.offsetWidth,s=this._prevWidth-i;this.el.style.setProperty("--width",String(i)),this.el.animate({[R]:[`${e}px`,"0px"],[U]:[s,0]},{...this.flow.transformTiming,composite:"accumulate"})}}class D{constructor(t,e,{justify:i,className:s,...r},a){this.flow=t,this.children=new Map,this.onCharRemove=l=>()=>{this.children.delete(l)},this.justify=i;const o=e.map(l=>this.addChar(l).el);this.el=y("span",{...r,className:`section section--justify-${i} ${s??""}`},a?a(o):o)}addChar(t,{startDigitsAtZero:e=!1,...i}={}){const s=t.type==="integer"||t.type==="fraction"?new X(this,t.type,e?0:t.value,t.pos,{...i,onRemove:this.onCharRemove(t.key)}):new at(this,t.type,t.value,{...i,onRemove:this.onCharRemove(t.key)});return this.children.set(t.key,s),s}unpop(t){t.el.removeAttribute("inert"),t.el.style.top="",t.el.style[this.justify]=""}pop(t){t.forEach(e=>{e.el.style.top=`${e.el.offsetTop}px`,e.el.style[this.justify]=`${J(e.el,this.justify)}px`}),t.forEach(e=>{e.el.setAttribute("inert",""),e.present=!1})}addNewAndUpdateExisting(t){const e=new Map,i=new Map,s=this.justify==="left",r=s?"prepend":"append";if(Z(t,a=>{let o;this.children.has(a.key)?(o=this.children.get(a.key),i.set(a,o),this.unpop(o),o.present=!0):(o=this.addChar(a,{startDigitsAtZero:!0,animateIn:!0}),e.set(a,o)),this.el[r](o.el)},{reverse:s}),this.flow.computedAnimated){const a=this.el.getBoundingClientRect();e.forEach(o=>{o.willUpdate(a)})}e.forEach((a,o)=>{a.update(o.value)}),i.forEach((a,o)=>{a.update(o.value)})}willUpdate(){const t=this.el.getBoundingClientRect();this._prevOffset=t[this.justify],this.children.forEach(e=>e.willUpdate(t))}didUpdate(){const t=this.el.getBoundingClientRect();this.children.forEach(s=>s.didUpdate(t));const e=t[this.justify],i=this._prevOffset-e;i&&this.children.size&&this.el.animate({transform:[`translateX(${i}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}class L extends D{update(t){const e=new Map;this.children.forEach((i,s)=>{t.find(r=>r.key===s)||e.set(s,i),this.unpop(i)}),this.addNewAndUpdateExisting(t),e.forEach(i=>{i instanceof X&&i.update(0)}),this.pop(e)}}class F extends D{update(t){const e=new Map;this.children.forEach((i,s)=>{t.find(r=>r.key===s)||e.set(s,i)}),this.pop(e),this.addNewAndUpdateExisting(t)}}class x{constructor(t,e,{onRemove:i,animateIn:s=!1}={}){this.flow=t,this.el=e,this._present=!0,this._remove=()=>{var r;this.el.remove(),(r=this._onRemove)==null||r.call(this)},this.el.classList.add("animate-presence"),this.flow.computedAnimated&&s&&this.el.animate({[E]:[-.9999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),this._onRemove=i}get present(){return this._present}set present(t){if(this._present!==t){if(this._present=t,t?this.el.removeAttribute("inert"):this.el.setAttribute("inert",""),!this.flow.computedAnimated){t||this._remove();return}this.el.style.setProperty("--_number-flow-d-opacity",t?"0":"-.999"),this.el.animate({[E]:t?[-.9999,0]:[.999,0]},{...this.flow.opacityTiming,composite:"accumulate"}),t?this.flow.removeEventListener("animationsfinish",this._remove):this.flow.addEventListener("animationsfinish",this._remove,{once:!0})}}}class W extends x{constructor(t,e,i,s){super(t.flow,i,s),this.section=t,this.value=e,this.el=i}}class X extends W{constructor(t,e,i,s,r){var a,o;const l=(((o=(a=t.flow.digits)==null?void 0:a[s])==null?void 0:o.max)??9)+1,u=Array.from({length:l}).map((f,m)=>{const g=y("span",{className:"digit__num"},[document.createTextNode(String(m))]);return m!==i&&g.setAttribute("inert",""),g.style.setProperty("--n",String(m)),g}),p=y("span",{part:`digit ${e}-digit`,className:"digit"},u);p.style.setProperty("--current",String(i)),p.style.setProperty("--length",String(l)),super(t,i,p,r),this.pos=s,this._onAnimationsFinish=()=>{this.el.classList.remove("is-spinning")},this._numbers=u,this.length=l}willUpdate(t){const e=this.el.getBoundingClientRect();this._prevValue=this.value;const i=e[this.section.justify]-t[this.section.justify],s=e.width/2;this._prevCenter=this.section.justify==="left"?i+s:i-s}update(t){this.el.style.setProperty("--current",String(t)),this._numbers.forEach((e,i)=>i===t?e.removeAttribute("inert"):e.setAttribute("inert","")),this.value=t}didUpdate(t){const e=this.el.getBoundingClientRect(),i=e[this.section.justify]-t[this.section.justify],s=e.width/2,r=this.section.justify==="left"?i+s:i-s,a=this._prevCenter-r;a&&this.el.animate({transform:[`translateX(${a}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"});const o=this.getDelta();o&&(this.el.classList.add("is-spinning"),this.el.animate({[k]:[-o,0]},{...this.flow.spinTiming??this.flow.transformTiming,composite:"accumulate"}),this.flow.addEventListener("animationsfinish",this._onAnimationsFinish,{once:!0}))}getDelta(){var t;if(this.flow.plugins)for(const s of this.flow.plugins){const r=(t=s.getDelta)==null?void 0:t.call(s,this.value,this._prevValue,this);if(r!=null)return r}const e=this.value-this._prevValue,i=this.flow.computedTrend||Math.sign(e);return i<0&&this.value>this._prevValue?this.value-this.length-this._prevValue:i>0&&this.value<this._prevValue?this.length-this._prevValue+this.value:e}}class at extends W{constructor(t,e,i,s){const r=y("span",{className:"symbol__value",textContent:i});super(t,i,y("span",{part:`symbol ${e}`,className:"symbol"},[r]),s),this.type=e,this._children=new Map,this._onChildRemove=a=>()=>{this._children.delete(a)},this._children.set(i,new x(this.flow,r,{onRemove:this._onChildRemove(i)}))}willUpdate(t){if(this.type==="decimal")return;const e=this.el.getBoundingClientRect();this._prevOffset=e[this.section.justify]-t[this.section.justify]}update(t){if(this.value!==t){const e=this._children.get(this.value);e&&(e.present=!1);const i=this._children.get(t);if(i)i.present=!0;else{const s=y("span",{className:"symbol__value",textContent:t});this.el.appendChild(s),this._children.set(t,new x(this.flow,s,{animateIn:!0,onRemove:this._onChildRemove(t)}))}}this.value=t}didUpdate(t){if(this.type==="decimal")return;const e=this.el.getBoundingClientRect()[this.section.justify]-t[this.section.justify],i=this._prevOffset-e;i&&this.el.animate({transform:[`translateX(${i}px)`,"none"]},{...this.flow.transformTiming,composite:"accumulate"})}}const rt=parseInt(c.version.match(/^(\d+)\./)?.[1]),j=rt>=19,ot=["data","digits"];class T extends I{attributeChangedCallback(t,e,i){this[t]=JSON.parse(i)}}T.observedAttributes=j?[]:ot;Y("number-flow-react",T);const lt={},O=j?n=>n:JSON.stringify;function V(n){const{transformTiming:t,spinTiming:e,opacityTiming:i,animated:s,respectMotionPreference:r,trend:a,plugins:o,...l}=n;return[{transformTiming:t,spinTiming:e,opacityTiming:i,animated:s,respectMotionPreference:r,trend:a,plugins:o},l]}class ht extends c.Component{updateProperties(t){if(!this.el)return;this.el.batched=!this.props.isolate;const[e]=V(this.props);Object.entries(e).forEach(([i,s])=>{this.el[i]=s??T.defaultProps[i]}),t?.onAnimationsStart&&this.el.removeEventListener("animationsstart",t.onAnimationsStart),this.props.onAnimationsStart&&this.el.addEventListener("animationsstart",this.props.onAnimationsStart),t?.onAnimationsFinish&&this.el.removeEventListener("animationsfinish",t.onAnimationsFinish),this.props.onAnimationsFinish&&this.el.addEventListener("animationsfinish",this.props.onAnimationsFinish)}componentDidMount(){this.updateProperties(),j&&this.el&&(this.el.digits=this.props.digits,this.el.data=this.props.data)}getSnapshotBeforeUpdate(t){if(this.updateProperties(t),t.data!==this.props.data){if(this.props.group)return this.props.group.willUpdate(),()=>this.props.group?.didUpdate();if(!this.props.isolate)return this.el?.willUpdate(),()=>this.el?.didUpdate()}return null}componentDidUpdate(t,e,i){i?.()}handleRef(t){this.props.innerRef&&(this.props.innerRef.current=t),this.el=t}render(){const[t,{innerRef:e,className:i,data:s,willChange:r,isolate:a,group:o,digits:l,onAnimationsStart:u,onAnimationsFinish:p,...f}]=V(this.props);return c.createElement("number-flow-react",{ref:this.handleRef,"data-will-change":r?"":void 0,class:i,...f,dangerouslySetInnerHTML:{__html:""},suppressHydrationWarning:!0,digits:O(l),data:O(s)})}constructor(t){super(t),this.handleRef=this.handleRef.bind(this)}}const ft=c.forwardRef(function({value:t,locales:e,format:i,prefix:s,suffix:r,...a},o){c.useImperativeHandle(o,()=>l.current,[]);const l=c.useRef(),u=c.useContext(H);u?.useRegister(l);const p=c.useMemo(()=>e?JSON.stringify(e):"",[e]),f=c.useMemo(()=>i?JSON.stringify(i):"",[i]),m=c.useMemo(()=>{const g=lt[`${p}:${f}`]??=new Intl.NumberFormat(e,i);return q(t,g,s,r)},[t,p,f,s,r]);return c.createElement(ht,{...a,group:u,data:m,innerRef:l})}),H=c.createContext(void 0);function mt({children:n}){const t=c.useRef(new Set),e=c.useRef(!1),i=c.useRef(new WeakMap),s=c.useMemo(()=>({useRegister(r){c.useEffect(()=>(t.current.add(r),()=>{t.current.delete(r)}),[])},willUpdate(){e.current||(e.current=!0,t.current.forEach(r=>{const a=r.current;!a||!a.created||(a.willUpdate(),i.current.set(a,!0))}))},didUpdate(){t.current.forEach(r=>{const a=r.current;!a||!i.current.get(a)||(a.didUpdate(),i.current.delete(a))}),e.current=!1}}),[]);return c.createElement(H.Provider,{value:s},n)}const ct=()=>c.useSyncExternalStore(()=>()=>{},()=>B,()=>!1),dt=()=>c.useSyncExternalStore(n=>(w?.addEventListener("change",n),()=>w?.removeEventListener("change",n)),()=>w.matches,()=>!1);function gt({respectMotionPreference:n=!0}={}){const t=ct(),e=dt();return t&&(!n||!e)}export{T as NumberFlowElement,mt as NumberFlowGroup,ut as continuous,ft as default,gt as useCanAnimate,ct as useIsSupported,dt as usePrefersReducedMotion};
@@ -1 +1 @@
1
- import{k as v,u as b,b as j,l as y,r as k,j as e,L as F,H as P,B,X as E,e as C,f as T,m as S,P as U,A,S as x,n as H,o as L,s as M}from"./index-exFCQBCk.js";import{T as I}from"./topic-filter-Cn1_Z9I7.js";import{S as z}from"./sprout-jOQR37se.js";const f=({profile:s,update:l,isLoading:t,onOpenChange:r})=>{const o=S("index","me"),{data:m}=o,n=s.handle===m?.handle,p=()=>{l(s.id,{followedByMe:!0})},i=()=>{l(s.id,{followedByMe:!1})},c=j();return e.jsx("div",{className:"flex w-full cursor-pointer items-start gap-3 pt-4 [&:last-of-type>:nth-child(2)]:border-none",onClick:()=>{c(`/profile/${s.handle}`)},children:e.jsxs("div",{className:"flex w-full flex-col gap-1 border-b border-gray-200 pb-4 dark:border-gray-950",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(U,{actor:s,isCurrentUser:n,children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx(A,{author:{icon:{url:s.avatarUrl},name:s.name,handle:s.handle},onClick:()=>r?.(!1)}),e.jsxs("div",{className:"-mt-0.5 flex grow flex-col break-anywhere",children:[e.jsx("span",{className:"line-clamp-1 font-semibold text-black dark:text-white",children:t?e.jsx(x,{className:"w-full max-w-48"}):s.name}),e.jsx("span",{className:"line-clamp-1 text-md text-gray-700 dark:text-gray-600",children:t?e.jsx(x,{className:"w-32"}):s.handle})]})]})}),t?e.jsx("div",{className:"inline-flex items-center",children:e.jsx(x,{className:"w-24"})}):n?null:e.jsx(H,{className:"ml-auto",following:s.followedByMe,handle:s.handle,type:"primary",onFollow:p,onUnfollow:i})]}),e.jsx("div",{className:"pl-[52px]",children:t?e.jsx(x,{className:"w-full max-w-96"}):s.bio&&e.jsx("div",{dangerouslySetInnerHTML:{__html:L(M(s.bio,["a","br"]))},className:"ap-profile-content pointer-events-none mt-0 line-clamp-2 max-w-[460px] break-anywhere"})})]})})},Q=()=>{const{isExplainerClosed:s,setExplainerClosed:l}=v(),t=b(),r=j(),o=t.topic||"top",{exploreProfilesQuery:m,updateExploreProfile:n}=y("index",o),{data:p,isLoading:i,fetchNextPage:c,hasNextPage:h,isFetchingNextPage:u}=m,g=Array(10).fill(null).map((a,d)=>({id:`skeleton-${d}`,name:"",handle:"",avatarUrl:"",bio:"",url:"",followedByMe:!1})),w=p?.pages.flatMap(a=>a.accounts)||[];return k.useEffect(()=>{const a=document.querySelector(".load-more-trigger");if(!a)return;const d=new IntersectionObserver(N=>{N[0].isIntersecting&&h&&!u&&c()},{threshold:.1});return d.observe(a),()=>d.disconnect()},[h,u,c]),e.jsxs(F,{children:[!s&&e.jsxs("div",{className:"relative mb-6 flex items-start gap-1 rounded-md bg-gradient-to-r from-[#CFB0FF66] to-[#B6E8FF66] p-4 pr-10 dark:from-[#CFB0FF20] dark:to-[#B6E8FF20]",children:[e.jsx("div",{className:"min-w-[46px]",children:e.jsx(z,{className:"text-purple",size:46,strokeWidth:.75})}),e.jsxs("div",{className:"mt-1 flex flex-col gap-[2px]",children:[e.jsx(P,{className:"text-pretty",children:"The fastest way to grow your followers, is to follow others!"}),e.jsx("p",{className:"2xl:text-pretty text-balance text-sm text-black/60 dark:text-white/60",children:"Here are some recommendations to get you started, from Ghost publishers and other great accounts from around the social web."})]}),e.jsx(B,{className:"absolute right-4 top-[17px] size-6 opacity-40",variant:"link",onClick:()=>l(!0),children:e.jsx(E,{size:20})})]}),e.jsx(I,{currentTopic:o,excludeTopics:["following"],onTopicChange:a=>{a==="top"?r("/explore",{replace:!0}):r(`/explore/${a}`,{replace:!0})}}),e.jsx("div",{className:"mt-12 flex flex-col gap-12 pb-20 max-md:mt-5",children:i?e.jsx("div",{children:g.map(a=>e.jsx("div",{className:"mx-auto w-full max-w-[640px]",children:e.jsx(f,{isLoading:i,profile:a,update:()=>{}})},a.id))}):e.jsxs("div",{className:"mx-auto flex w-full max-w-[640px] flex-col items-center",children:[e.jsx("div",{className:"w-full",children:w.map(a=>e.jsx(C.Fragment,{children:e.jsx(f,{isLoading:!1,profile:a,update:n})},a.id))}),e.jsx("div",{className:"load-more-trigger h-4 w-full"}),u&&e.jsx("div",{className:"mt-2 flex w-full justify-center",children:e.jsx(T,{size:"sm"})})]})})]})};export{Q as default};
1
+ import{k as v,u as b,b as j,l as y,r as k,j as e,L as F,H as P,B,X as E,e as C,f as T,m as S,P as U,A,S as x,n as H,o as L,s as M}from"./index-f5Lv9kLb.js";import{T as I}from"./topic-filter-BfoEqHRD.js";import{S as z}from"./sprout-BKiwQsGn.js";const f=({profile:s,update:l,isLoading:t,onOpenChange:r})=>{const o=S("index","me"),{data:m}=o,n=s.handle===m?.handle,p=()=>{l(s.id,{followedByMe:!0})},i=()=>{l(s.id,{followedByMe:!1})},c=j();return e.jsx("div",{className:"flex w-full cursor-pointer items-start gap-3 pt-4 [&:last-of-type>:nth-child(2)]:border-none",onClick:()=>{c(`/profile/${s.handle}`)},children:e.jsxs("div",{className:"flex w-full flex-col gap-1 border-b border-gray-200 pb-4 dark:border-gray-950",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(U,{actor:s,isCurrentUser:n,children:e.jsxs("div",{className:"flex gap-3",children:[e.jsx(A,{author:{icon:{url:s.avatarUrl},name:s.name,handle:s.handle},onClick:()=>r?.(!1)}),e.jsxs("div",{className:"-mt-0.5 flex grow flex-col break-anywhere",children:[e.jsx("span",{className:"line-clamp-1 font-semibold text-black dark:text-white",children:t?e.jsx(x,{className:"w-full max-w-48"}):s.name}),e.jsx("span",{className:"line-clamp-1 text-md text-gray-700 dark:text-gray-600",children:t?e.jsx(x,{className:"w-32"}):s.handle})]})]})}),t?e.jsx("div",{className:"inline-flex items-center",children:e.jsx(x,{className:"w-24"})}):n?null:e.jsx(H,{className:"ml-auto",following:s.followedByMe,handle:s.handle,type:"primary",onFollow:p,onUnfollow:i})]}),e.jsx("div",{className:"pl-[52px]",children:t?e.jsx(x,{className:"w-full max-w-96"}):s.bio&&e.jsx("div",{dangerouslySetInnerHTML:{__html:L(M(s.bio,["a","br"]))},className:"ap-profile-content pointer-events-none mt-0 line-clamp-2 max-w-[460px] break-anywhere"})})]})})},Q=()=>{const{isExplainerClosed:s,setExplainerClosed:l}=v(),t=b(),r=j(),o=t.topic||"top",{exploreProfilesQuery:m,updateExploreProfile:n}=y("index",o),{data:p,isLoading:i,fetchNextPage:c,hasNextPage:h,isFetchingNextPage:u}=m,g=Array(10).fill(null).map((a,d)=>({id:`skeleton-${d}`,name:"",handle:"",avatarUrl:"",bio:"",url:"",followedByMe:!1})),w=p?.pages.flatMap(a=>a.accounts)||[];return k.useEffect(()=>{const a=document.querySelector(".load-more-trigger");if(!a)return;const d=new IntersectionObserver(N=>{N[0].isIntersecting&&h&&!u&&c()},{threshold:.1});return d.observe(a),()=>d.disconnect()},[h,u,c]),e.jsxs(F,{children:[!s&&e.jsxs("div",{className:"relative mb-6 flex items-start gap-1 rounded-md bg-gradient-to-r from-[#CFB0FF66] to-[#B6E8FF66] p-4 pr-10 dark:from-[#CFB0FF20] dark:to-[#B6E8FF20]",children:[e.jsx("div",{className:"min-w-[46px]",children:e.jsx(z,{className:"text-purple",size:46,strokeWidth:.75})}),e.jsxs("div",{className:"mt-1 flex flex-col gap-[2px]",children:[e.jsx(P,{className:"text-pretty",children:"The fastest way to grow your followers, is to follow others!"}),e.jsx("p",{className:"2xl:text-pretty text-balance text-sm text-black/60 dark:text-white/60",children:"Here are some recommendations to get you started, from Ghost publishers and other great accounts from around the social web."})]}),e.jsx(B,{className:"absolute right-4 top-[17px] size-6 opacity-40",variant:"link",onClick:()=>l(!0),children:e.jsx(E,{size:20})})]}),e.jsx(I,{currentTopic:o,excludeTopics:["following"],onTopicChange:a=>{a==="top"?r("/explore",{replace:!0}):r(`/explore/${a}`,{replace:!0})}}),e.jsx("div",{className:"mt-12 flex flex-col gap-12 pb-20 max-md:mt-5",children:i?e.jsx("div",{children:g.map(a=>e.jsx("div",{className:"mx-auto w-full max-w-[640px]",children:e.jsx(f,{isLoading:i,profile:a,update:()=>{}})},a.id))}):e.jsxs("div",{className:"mx-auto flex w-full max-w-[640px] flex-col items-center",children:[e.jsx("div",{className:"w-full",children:w.map(a=>e.jsx(C.Fragment,{children:e.jsx(f,{isLoading:!1,profile:a,update:n})},a.id))}),e.jsx("div",{className:"load-more-trigger h-4 w-full"}),u&&e.jsx("div",{className:"mt-2 flex w-full justify-center",children:e.jsx(T,{size:"sm"})})]})})]})};export{Q as default};
@@ -1 +1 @@
1
- import{j as t,bq as F,e as u,b as g,br as T,r as j,bm as z,bn as E,L as S,E as M,c as P,bs as U,S as w,A as $,B as L,be as B,n as C,h as v,d as W,s as _,bt as D,bu as H,f as O,P as q}from"./index-exFCQBCk.js";import{A as V}from"./at-sign-Cj4_ORaa.js";import{R as G,U as K}from"./user-round-check-CYI147XP.js";import{R as Q}from"./reply-CuCJJfZj.js";const I=({notificationType:a,size:l="lg",className:i})=>{let r,s="";const n="white",o=l==="sm"?13:20,c=l==="sm"?2:1.5;switch(a){case"follow":r=t.jsx(K,{className:`-mr-0.5 -mt-0.5 ${l==="sm"&&"size-[11px]"}`,color:n,size:o,strokeWidth:c}),s="bg-blue-600";break;case"like":r=t.jsx(F,{className:`${l==="sm"?"size-[11px]":"mt-px size-5"}`,color:n,strokeWidth:c}),s="bg-pink-600";break;case"reply":r=t.jsx(Q,{className:"mb-px mr-px",color:n,size:o,strokeWidth:c}),s="bg-purple-600";break;case"repost":r=t.jsx(G,{color:n,size:o,strokeWidth:c}),s="bg-green-500";break;case"mention":r=t.jsx(V,{className:`${l==="sm"?"size-[12px]":"size-5"}`,color:n,size:o,strokeWidth:c}),s="bg-orange-500";break}return t.jsx("div",{className:`flex ${l==="sm"?"size-5":"size-9"} items-center justify-center rounded-full ${s} ${i&&i}`,children:r})},Z=u.createContext(void 0),h=({isGrouped:a,centerAlign:l,children:i,onClick:r,url:s,className:n})=>t.jsx(Z.Provider,{value:{onClick:r,url:s},children:t.jsx("div",{className:`group relative -mx-4 -my-px ${a?"grid":"flex"} ${l?"items-center":"items-start"} cursor-pointer grid-cols-[auto_1fr] gap-x-4 gap-y-2.5 rounded-lg px-4 py-5 text-left break-anywhere hover:bg-gray-75 ${n}`,role:"button",onClick:r,children:i})}),J=({size:a="lg",type:l})=>t.jsx("div",{className:"col-start-1 row-start-1",children:t.jsx(I,{notificationType:l,size:a})}),X=({children:a})=>t.jsx("div",{className:"col-start-2 row-start-1 flex gap-2",children:a}),Y=({children:a})=>t.jsx("div",{className:"col-start-2 row-start-2 -mt-0.5 grow overflow-hidden",children:a});h.Icon=J;h.Avatars=X;h.Content=Y;const ee=()=>t.jsx("div",{className:"h-px w-full bg-gray-150 dark:bg-gray-950"});function te(a){const r=new Date(a).getTime();return(Math.floor(r/864e5)*864e5).toString()}function se(a){const l={};let i=null,r=0;return a.forEach(s=>{s.type!==i&&(r+=1,i=s.type);let n="";const o=`_${te(s.createdAt)}`,c=`_seq${r}`;switch(s.type){case"like":s.post?.id&&(n=`like_${s.post.id}${o}${c}`);break;case"reply":n=`reply_${s.id}`;break;case"repost":s.post?.id&&(n=`repost_${s.post.id}${o}${c}`);break;case"follow":n=`follow_${o}${c}`;break;case"mention":n=`mention_${s.id}`;break}l[n]||(l[n]={id:s.id,type:s.type,actors:[],post:s.post,inReplyTo:s.inReplyTo,createdAt:s.createdAt}),l[n].actors.find(f=>f.id===s.actor.id)||l[n].actors.push(s.actor)}),Object.values(l)}const ae=({group:a})=>{const[l,...i]=a.actors,r=i.length>0,s="cursor-pointer font-semibold hover:underline text-black dark:text-white",n=g(),o=t.jsxs(t.Fragment,{children:[t.jsx(q,{actor:l,align:"center",isCurrentUser:!1,children:t.jsx("span",{className:s,onClick:c=>{c?.stopPropagation(),v(l.handle,n)},children:l.name})}),r&&` and ${i.length} ${i.length>1?"others":"other"}`]});switch(a.type){case"follow":return t.jsxs(t.Fragment,{children:[o," followed you"]});case"like":return t.jsxs(t.Fragment,{children:[o," liked your ",a.post?.type==="article"?"post":"note"]});case"repost":return t.jsxs(t.Fragment,{children:[o," reposted your ",a.post?.type==="article"?"post":"note"]});case"reply":if(a.inReplyTo&&typeof a.inReplyTo!="string")return o;break;case"mention":return o}return t.jsx(t.Fragment,{})},ne=({content:a,className:l,stripTags:i=[]})=>{const r=j.useRef(null),s=g();return j.useEffect(()=>{const n=r.current;if(!n)return;const o=c=>{const y=c.target.closest("a[data-profile]");if(y){const x=y.getAttribute("data-profile")?.trim();/^@([\w.-]+)@([\w-]+\.[\w.-]+[a-zA-Z])$/.test(x||"")&&x&&(c.preventDefault(),c.stopPropagation(),v(x,s))}};return n.addEventListener("click",o),()=>{n.removeEventListener("click",o)}},[s,a]),t.jsx("div",{dangerouslySetInnerHTML:{__html:_(a||"",i)},ref:r,className:l})},oe=()=>{const[a,l]=u.useState({}),i=g(),r=e=>{l(d=>({...d,[e]:!d[e]}))},s=()=>{},n=5,{data:o,error:c,fetchNextPage:f,hasNextPage:y,isFetchingNextPage:x,isLoading:b}=T("index"),k=o?.pages.flatMap(e=>se(e.notifications))??Array(10).fill({actors:[{}]}),p=j.useRef(null),N=j.useRef(null);j.useEffect(()=>(p.current&&p.current.disconnect(),p.current=new IntersectionObserver(e=>{e[0].isIntersecting&&y&&!x&&f()}),N.current&&p.current.observe(N.current),()=>{p.current&&p.current.disconnect()}),[y,x,f]);const R=(e,d)=>{switch(e.type){case"like":e.post&&i(`/${e.post.type==="article"?"reader":"notes"}/${encodeURIComponent(e.post.id)}`);break;case"reply":e.post&&e.inReplyTo&&i(`/notes/${encodeURIComponent(e.post.id)}`);break;case"repost":e.post&&i(`/${e.post.type==="article"?"reader":"notes"}/${encodeURIComponent(e.post.id)}`);break;case"follow":e.actors.length>1?r(e.id||`${e.type}_${d}`):v(e.actors[0].handle,i);break;case"mention":e.post&&i(`/notes/${encodeURIComponent(e.post.id)}`);break}};return c&&z(c)?t.jsx(E,{errorCode:c.code,statusCode:c.statusCode}):t.jsx(S,{children:t.jsxs("div",{className:"z-0 flex w-full flex-col items-center",children:[b===!1&&k.length===0&&t.jsxs(M,{children:[t.jsx(P,{children:t.jsx(U,{})}),"Quiet for now, but not for long! When someone likes, boosts, or replies to you, you'll find it here."]}),k.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"my-8 flex w-full max-w-[620px] flex-col max-md:mt-5",children:k.map((e,d)=>t.jsxs(u.Fragment,{children:[t.jsxs(h,{centerAlign:e.actors.length<2&&e.type==="follow",className:"hover:bg-gray-75 dark:hover:bg-gray-950",isGrouped:e.actors.length>1,onClick:()=>R(e,d),children:[b?t.jsx(w,{className:"rounded-full",containerClassName:"flex h-10 w-10"}):e.actors.length>1?t.jsx(h.Icon,{type:e.type}):t.jsxs("div",{className:"relative",children:[t.jsx($,{author:{icon:{url:e.actors[0].avatarUrl||""},name:e.actors[0].name,handle:e.actors[0].handle},size:"notification"},e.actors[0].id),t.jsx(I,{className:"absolute -bottom-1 -right-1 z-10 border-2 border-white dark:border-black",notificationType:e.type,size:"sm"})]}),e.actors.length>1&&t.jsx(h.Avatars,{children:t.jsxs("div",{className:"flex w-full flex-col",children:[t.jsxs("div",{className:"relative flex items-center pl-2",children:[!a[e.id||`${e.type}_${d}`]&&e.actors.slice(0,n).map(m=>t.jsx($,{author:{icon:{url:m.avatarUrl||""},name:m.name,handle:m.handle},className:"-ml-2 !bg-[#F3F3F3] outline outline-2 outline-white group-hover:!bg-[#EDEEF0] group-hover:outline-gray-75 dark:outline-black group-hover:dark:outline-gray-950",size:"notification"},m.id)),e.actors.length>n&&!a[e.id||`${e.type}_${d}`]&&t.jsx("div",{className:"absolute right-[28px] z-10 flex size-9 items-center justify-center rounded-full bg-black/50 text-base font-semibold tracking-tightest text-white",children:`+${e.actors.length-n}`}),e.actors.length>1&&t.jsxs(L,{className:`group flex items-center gap-0.5 text-gray-700 hover:bg-transparent hover:text-black dark:text-gray-600 dark:hover:text-white ${a[e.id||`${e.type}_${d}`]?"ml-[-20px]":"ml-0 w-[28px]"}`,variant:"ghost",onClick:m=>{m?.stopPropagation(),r(e.id||`${e.type}_${d}`)},children:[t.jsx(B,{className:`${a[e.id||`${e.type}_${d}`]?"rotate-180":""}`,size:20,strokeWidth:1.5}),a[e.id||`${e.type}_${d}`]?"Hide":t.jsx("span",{className:"sr-only",children:"Show all"})]})]}),t.jsx("div",{className:`overflow-hidden transition-all duration-300 ease-in-out ${a[e.id||`${e.type}_${d}`]?"mb-2 max-h-[1384px] opacity-100":"max-h-0 opacity-0"}`,children:a[e.id||`${e.type}_${d}`]&&e.actors.length>1&&t.jsx("div",{className:"flex flex-col gap-2 pt-2",children:e.actors.map(m=>t.jsxs("div",{className:"group/item flex items-center justify-between gap-4 break-anywhere",onClick:A=>{A?.stopPropagation(),v(m.handle,i)},children:[t.jsxs("div",{className:"flex min-w-0 items-center",children:[t.jsx($,{author:{icon:{url:m.avatarUrl||""},name:m.name,handle:m.handle},size:"xs"}),t.jsx("span",{className:"ml-2 line-clamp-1 text-base font-semibold group-hover/item:underline dark:text-white",children:m.name}),t.jsx("span",{className:"ml-1 line-clamp-1 text-base text-gray-700 dark:text-gray-600",children:m.handle})]}),e.type==="follow"&&!m.followedByMe&&t.jsx(C,{following:!1,handle:m.handle,variant:"link"})]},m.id))})})]})}),t.jsxs(h.Content,{children:[t.jsx("div",{children:b?t.jsxs(t.Fragment,{children:[t.jsx(w,{}),t.jsx(w,{className:"w-full max-w-60"})]}):t.jsxs("div",{className:"flex justify-between",children:[t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"truncate",children:t.jsx(ae,{group:e})}),e.actors.length<2&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mt-px text-[8px] text-gray-700 dark:text-gray-600",children:"•"}),t.jsx("span",{className:"mt-0.5 text-sm text-gray-700 dark:text-gray-600",children:W(e,!1)})]})]}),e.actors.length===1&&(e.type==="follow"||e.type==="reply"||e.type==="mention")&&!e.actors[0].followedByMe&&t.jsx(C,{following:!1,handle:e.actors[0].handle,variant:"link"})]})}),(e.type==="reply"&&e.inReplyTo||e.type==="mention"||e.type==="like"&&!e.post?.name&&e.post?.content||e.type==="repost"&&!e.post?.name&&e.post?.content)&&(e.type!=="reply"&&e.type!=="mention"?t.jsxs("div",{className:"ap-note-content mt-0.5 line-clamp-1 text-pretty text-sm text-gray-700 dark:text-gray-600",children:[e.post?.type==="article"&&e.post?.title&&t.jsxs(t.Fragment,{children:[e.post.title," — "]}),t.jsx("span",{dangerouslySetInnerHTML:{__html:_(e.post?.content||"")}})]}):t.jsx(t.Fragment,{children:t.jsxs("div",{className:"mt-2.5 rounded-md bg-gray-100 px-5 py-[14px] group-hover:bg-gray-200 dark:bg-gray-925/30 group-hover:dark:bg-black/40",children:[t.jsx(ne,{className:"ap-note-content text-pretty",content:e.post?.content||"",stripTags:["a"]}),e.post&&e.post.attachments&&e.post.attachments.length>0&&t.jsx("div",{className:"notification-attachments mb-1 [&_.attachment-gallery]:flex [&_.attachment-gallery]:flex-wrap [&_img]:aspect-square [&_img]:max-w-[calc(20%-6.4px)]",children:D({...e.post,type:"Note",attachment:e.post.attachments})})]})})),(e.type==="reply"&&e.post||e.type==="mention")&&t.jsx("div",{className:"mt-1.5",children:t.jsx(H,{actor:{...e.actors[0],icon:{url:e.actors[0].avatarUrl||""},id:e.actors[0].url,preferredUsername:e.actors[0].handle?.replace(/^@([^@]+)@.*$/,"$1")||"unknown"},buttonClassName:"hover:bg-gray-200",commentCount:e.post.replyCount||0,layout:"notification",likeCount:e.post.likeCount||0,object:{...e.post,liked:e.post.likedByMe,reposted:e.post.repostedByMe},repostCount:e.post.repostCount||0,onLikeClick:s})})]})]}),d<k.length-1&&t.jsx("div",{className:"pl-[52px]",children:t.jsx(ee,{})})]},e.id||`${e.type}_${d}`))}),t.jsx("div",{ref:N,className:"h-1"}),x&&t.jsx("div",{className:"-mt-4 mb-8 flex flex-col items-center justify-center space-y-4 text-center",children:t.jsx(O,{size:"md"})})]})]})})};export{oe as default};
1
+ import{j as t,bq as F,e as u,b as g,br as T,r as j,bm as z,bn as E,L as S,E as M,c as P,bs as U,S as w,A as $,B as L,be as B,n as C,h as v,d as W,s as _,bt as D,bu as H,f as O,P as q}from"./index-f5Lv9kLb.js";import{A as V}from"./at-sign-BottTo2X.js";import{R as G,U as K}from"./user-round-check-DYkrjHxF.js";import{R as Q}from"./reply-BfWgvH7y.js";const I=({notificationType:a,size:l="lg",className:i})=>{let r,s="";const n="white",o=l==="sm"?13:20,c=l==="sm"?2:1.5;switch(a){case"follow":r=t.jsx(K,{className:`-mr-0.5 -mt-0.5 ${l==="sm"&&"size-[11px]"}`,color:n,size:o,strokeWidth:c}),s="bg-blue-600";break;case"like":r=t.jsx(F,{className:`${l==="sm"?"size-[11px]":"mt-px size-5"}`,color:n,strokeWidth:c}),s="bg-pink-600";break;case"reply":r=t.jsx(Q,{className:"mb-px mr-px",color:n,size:o,strokeWidth:c}),s="bg-purple-600";break;case"repost":r=t.jsx(G,{color:n,size:o,strokeWidth:c}),s="bg-green-500";break;case"mention":r=t.jsx(V,{className:`${l==="sm"?"size-[12px]":"size-5"}`,color:n,size:o,strokeWidth:c}),s="bg-orange-500";break}return t.jsx("div",{className:`flex ${l==="sm"?"size-5":"size-9"} items-center justify-center rounded-full ${s} ${i&&i}`,children:r})},Z=u.createContext(void 0),h=({isGrouped:a,centerAlign:l,children:i,onClick:r,url:s,className:n})=>t.jsx(Z.Provider,{value:{onClick:r,url:s},children:t.jsx("div",{className:`group relative -mx-4 -my-px ${a?"grid":"flex"} ${l?"items-center":"items-start"} cursor-pointer grid-cols-[auto_1fr] gap-x-4 gap-y-2.5 rounded-lg px-4 py-5 text-left break-anywhere hover:bg-gray-75 ${n}`,role:"button",onClick:r,children:i})}),J=({size:a="lg",type:l})=>t.jsx("div",{className:"col-start-1 row-start-1",children:t.jsx(I,{notificationType:l,size:a})}),X=({children:a})=>t.jsx("div",{className:"col-start-2 row-start-1 flex gap-2",children:a}),Y=({children:a})=>t.jsx("div",{className:"col-start-2 row-start-2 -mt-0.5 grow overflow-hidden",children:a});h.Icon=J;h.Avatars=X;h.Content=Y;const ee=()=>t.jsx("div",{className:"h-px w-full bg-gray-150 dark:bg-gray-950"});function te(a){const r=new Date(a).getTime();return(Math.floor(r/864e5)*864e5).toString()}function se(a){const l={};let i=null,r=0;return a.forEach(s=>{s.type!==i&&(r+=1,i=s.type);let n="";const o=`_${te(s.createdAt)}`,c=`_seq${r}`;switch(s.type){case"like":s.post?.id&&(n=`like_${s.post.id}${o}${c}`);break;case"reply":n=`reply_${s.id}`;break;case"repost":s.post?.id&&(n=`repost_${s.post.id}${o}${c}`);break;case"follow":n=`follow_${o}${c}`;break;case"mention":n=`mention_${s.id}`;break}l[n]||(l[n]={id:s.id,type:s.type,actors:[],post:s.post,inReplyTo:s.inReplyTo,createdAt:s.createdAt}),l[n].actors.find(f=>f.id===s.actor.id)||l[n].actors.push(s.actor)}),Object.values(l)}const ae=({group:a})=>{const[l,...i]=a.actors,r=i.length>0,s="cursor-pointer font-semibold hover:underline text-black dark:text-white",n=g(),o=t.jsxs(t.Fragment,{children:[t.jsx(q,{actor:l,align:"center",isCurrentUser:!1,children:t.jsx("span",{className:s,onClick:c=>{c?.stopPropagation(),v(l.handle,n)},children:l.name})}),r&&` and ${i.length} ${i.length>1?"others":"other"}`]});switch(a.type){case"follow":return t.jsxs(t.Fragment,{children:[o," followed you"]});case"like":return t.jsxs(t.Fragment,{children:[o," liked your ",a.post?.type==="article"?"post":"note"]});case"repost":return t.jsxs(t.Fragment,{children:[o," reposted your ",a.post?.type==="article"?"post":"note"]});case"reply":if(a.inReplyTo&&typeof a.inReplyTo!="string")return o;break;case"mention":return o}return t.jsx(t.Fragment,{})},ne=({content:a,className:l,stripTags:i=[]})=>{const r=j.useRef(null),s=g();return j.useEffect(()=>{const n=r.current;if(!n)return;const o=c=>{const y=c.target.closest("a[data-profile]");if(y){const x=y.getAttribute("data-profile")?.trim();/^@([\w.-]+)@([\w-]+\.[\w.-]+[a-zA-Z])$/.test(x||"")&&x&&(c.preventDefault(),c.stopPropagation(),v(x,s))}};return n.addEventListener("click",o),()=>{n.removeEventListener("click",o)}},[s,a]),t.jsx("div",{dangerouslySetInnerHTML:{__html:_(a||"",i)},ref:r,className:l})},oe=()=>{const[a,l]=u.useState({}),i=g(),r=e=>{l(d=>({...d,[e]:!d[e]}))},s=()=>{},n=5,{data:o,error:c,fetchNextPage:f,hasNextPage:y,isFetchingNextPage:x,isLoading:b}=T("index"),k=o?.pages.flatMap(e=>se(e.notifications))??Array(10).fill({actors:[{}]}),p=j.useRef(null),N=j.useRef(null);j.useEffect(()=>(p.current&&p.current.disconnect(),p.current=new IntersectionObserver(e=>{e[0].isIntersecting&&y&&!x&&f()}),N.current&&p.current.observe(N.current),()=>{p.current&&p.current.disconnect()}),[y,x,f]);const R=(e,d)=>{switch(e.type){case"like":e.post&&i(`/${e.post.type==="article"?"reader":"notes"}/${encodeURIComponent(e.post.id)}`);break;case"reply":e.post&&e.inReplyTo&&i(`/notes/${encodeURIComponent(e.post.id)}`);break;case"repost":e.post&&i(`/${e.post.type==="article"?"reader":"notes"}/${encodeURIComponent(e.post.id)}`);break;case"follow":e.actors.length>1?r(e.id||`${e.type}_${d}`):v(e.actors[0].handle,i);break;case"mention":e.post&&i(`/notes/${encodeURIComponent(e.post.id)}`);break}};return c&&z(c)?t.jsx(E,{errorCode:c.code,statusCode:c.statusCode}):t.jsx(S,{children:t.jsxs("div",{className:"z-0 flex w-full flex-col items-center",children:[b===!1&&k.length===0&&t.jsxs(M,{children:[t.jsx(P,{children:t.jsx(U,{})}),"Quiet for now, but not for long! When someone likes, boosts, or replies to you, you'll find it here."]}),k.length>0&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"my-8 flex w-full max-w-[620px] flex-col max-md:mt-5",children:k.map((e,d)=>t.jsxs(u.Fragment,{children:[t.jsxs(h,{centerAlign:e.actors.length<2&&e.type==="follow",className:"hover:bg-gray-75 dark:hover:bg-gray-950",isGrouped:e.actors.length>1,onClick:()=>R(e,d),children:[b?t.jsx(w,{className:"rounded-full",containerClassName:"flex h-10 w-10"}):e.actors.length>1?t.jsx(h.Icon,{type:e.type}):t.jsxs("div",{className:"relative",children:[t.jsx($,{author:{icon:{url:e.actors[0].avatarUrl||""},name:e.actors[0].name,handle:e.actors[0].handle},size:"notification"},e.actors[0].id),t.jsx(I,{className:"absolute -bottom-1 -right-1 z-10 border-2 border-white dark:border-black",notificationType:e.type,size:"sm"})]}),e.actors.length>1&&t.jsx(h.Avatars,{children:t.jsxs("div",{className:"flex w-full flex-col",children:[t.jsxs("div",{className:"relative flex items-center pl-2",children:[!a[e.id||`${e.type}_${d}`]&&e.actors.slice(0,n).map(m=>t.jsx($,{author:{icon:{url:m.avatarUrl||""},name:m.name,handle:m.handle},className:"-ml-2 !bg-[#F3F3F3] outline outline-2 outline-white group-hover:!bg-[#EDEEF0] group-hover:outline-gray-75 dark:outline-black group-hover:dark:outline-gray-950",size:"notification"},m.id)),e.actors.length>n&&!a[e.id||`${e.type}_${d}`]&&t.jsx("div",{className:"absolute right-[28px] z-10 flex size-9 items-center justify-center rounded-full bg-black/50 text-base font-semibold tracking-tightest text-white",children:`+${e.actors.length-n}`}),e.actors.length>1&&t.jsxs(L,{className:`group flex items-center gap-0.5 text-gray-700 hover:bg-transparent hover:text-black dark:text-gray-600 dark:hover:text-white ${a[e.id||`${e.type}_${d}`]?"ml-[-20px]":"ml-0 w-[28px]"}`,variant:"ghost",onClick:m=>{m?.stopPropagation(),r(e.id||`${e.type}_${d}`)},children:[t.jsx(B,{className:`${a[e.id||`${e.type}_${d}`]?"rotate-180":""}`,size:20,strokeWidth:1.5}),a[e.id||`${e.type}_${d}`]?"Hide":t.jsx("span",{className:"sr-only",children:"Show all"})]})]}),t.jsx("div",{className:`overflow-hidden transition-all duration-300 ease-in-out ${a[e.id||`${e.type}_${d}`]?"mb-2 max-h-[1384px] opacity-100":"max-h-0 opacity-0"}`,children:a[e.id||`${e.type}_${d}`]&&e.actors.length>1&&t.jsx("div",{className:"flex flex-col gap-2 pt-2",children:e.actors.map(m=>t.jsxs("div",{className:"group/item flex items-center justify-between gap-4 break-anywhere",onClick:A=>{A?.stopPropagation(),v(m.handle,i)},children:[t.jsxs("div",{className:"flex min-w-0 items-center",children:[t.jsx($,{author:{icon:{url:m.avatarUrl||""},name:m.name,handle:m.handle},size:"xs"}),t.jsx("span",{className:"ml-2 line-clamp-1 text-base font-semibold group-hover/item:underline dark:text-white",children:m.name}),t.jsx("span",{className:"ml-1 line-clamp-1 text-base text-gray-700 dark:text-gray-600",children:m.handle})]}),e.type==="follow"&&!m.followedByMe&&t.jsx(C,{following:!1,handle:m.handle,variant:"link"})]},m.id))})})]})}),t.jsxs(h.Content,{children:[t.jsx("div",{children:b?t.jsxs(t.Fragment,{children:[t.jsx(w,{}),t.jsx(w,{className:"w-full max-w-60"})]}):t.jsxs("div",{className:"flex justify-between",children:[t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("span",{className:"truncate",children:t.jsx(ae,{group:e})}),e.actors.length<2&&t.jsxs(t.Fragment,{children:[t.jsx("span",{className:"mt-px text-[8px] text-gray-700 dark:text-gray-600",children:"•"}),t.jsx("span",{className:"mt-0.5 text-sm text-gray-700 dark:text-gray-600",children:W(e,!1)})]})]}),e.actors.length===1&&(e.type==="follow"||e.type==="reply"||e.type==="mention")&&!e.actors[0].followedByMe&&t.jsx(C,{following:!1,handle:e.actors[0].handle,variant:"link"})]})}),(e.type==="reply"&&e.inReplyTo||e.type==="mention"||e.type==="like"&&!e.post?.name&&e.post?.content||e.type==="repost"&&!e.post?.name&&e.post?.content)&&(e.type!=="reply"&&e.type!=="mention"?t.jsxs("div",{className:"ap-note-content mt-0.5 line-clamp-1 text-pretty text-sm text-gray-700 dark:text-gray-600",children:[e.post?.type==="article"&&e.post?.title&&t.jsxs(t.Fragment,{children:[e.post.title," — "]}),t.jsx("span",{dangerouslySetInnerHTML:{__html:_(e.post?.content||"")}})]}):t.jsx(t.Fragment,{children:t.jsxs("div",{className:"mt-2.5 rounded-md bg-gray-100 px-5 py-[14px] group-hover:bg-gray-200 dark:bg-gray-925/30 group-hover:dark:bg-black/40",children:[t.jsx(ne,{className:"ap-note-content text-pretty",content:e.post?.content||"",stripTags:["a"]}),e.post&&e.post.attachments&&e.post.attachments.length>0&&t.jsx("div",{className:"notification-attachments mb-1 [&_.attachment-gallery]:flex [&_.attachment-gallery]:flex-wrap [&_img]:aspect-square [&_img]:max-w-[calc(20%-6.4px)]",children:D({...e.post,type:"Note",attachment:e.post.attachments})})]})})),(e.type==="reply"&&e.post||e.type==="mention")&&t.jsx("div",{className:"mt-1.5",children:t.jsx(H,{actor:{...e.actors[0],icon:{url:e.actors[0].avatarUrl||""},id:e.actors[0].url,preferredUsername:e.actors[0].handle?.replace(/^@([^@]+)@.*$/,"$1")||"unknown"},buttonClassName:"hover:bg-gray-200",commentCount:e.post.replyCount||0,layout:"notification",likeCount:e.post.likeCount||0,object:{...e.post,liked:e.post.likedByMe,reposted:e.post.repostedByMe},repostCount:e.post.repostCount||0,onLikeClick:s})})]})]}),d<k.length-1&&t.jsx("div",{className:"pl-[52px]",children:t.jsx(ee,{})})]},e.id||`${e.type}_${d}`))}),t.jsx("div",{ref:N,className:"h-1"}),x&&t.jsx("div",{className:"-mt-4 mb-8 flex flex-col items-center justify-center space-y-4 text-center",children:t.jsx(O,{size:"md"})})]})]})})};export{oe as default};